vlcj播放来自网址的视频

时间:2015-11-04 12:24:01

标签: java video stream vlcj

需要vlcj播放来自网址的视频,它适用于磁盘上的文件,但是当它使用网络时 - 它无法正常工作。 测试视频:http://www.quirksmode.org/html5/videos/big_buck_bunny.mp4

错误中我有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);

请,帮助)

1 个答案:

答案 0 :(得分:4)

您是否尝试过首先准备mrl?

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