3
votes

need vlcj play video from url, it works with files on disk, but when it couses web - it doestn't work. Test video: http://www.quirksmode.org/html5/videos/big_buck_bunny.mp4

In errors I have this filesystem access error: cannot open file /home/progsmile/Documents/dev/java/trying2/http://www.quirksmode.org/html5/videos/big_buck_bunny.mp4 (No such file or directory) [0x7f9c4801ad18] main access error: File reading failed

//here is part of code
MediaPlayerFactory mediaPlayerFactory = new MediaPlayerFactory();
EmbeddedMediaPlayer mediaPlayer = mediaPlayerFactory.newEmbeddedMediaPlayer();

//...

String filePath = "http://www.quirksmode.org/html5/videos/big_buck_bunny.mp4";
mediaPlayer.playMedia(filePath);

Please, help)

1
Clearly from the errors you quote, the http URL is being treated as a local file. This is probably a bug in the version of vlcj you are using, but I think you are using an ancient version. Try it with the latest version.caprica

1 Answers

4
votes

Have you tried preparing the mrl first?

mediaPlayer.prepareMedia(filePath);
//mediaPlayer.setPlaySubItems(true);
mediaPlayer.play();