我正在尝试在 javafx2 中运行 flv 文件。我的代码如下:
Media media = new Media("file:///C:/Users/Darren/workspace/player/src/player/football.flv");
MediaPlayer player = new MediaPlayer(media);
MediaView view = new MediaView(player);
root.getChildren().add(view);
Scene scene = new Scene(root, 400, 400, Color.BLACK);
stage.setScene(scene);
stage.show();
player.play();
我收到以下错误:
Caused by: MediaException: MEDIA_UNAVAILABLE : C:\Users\Darren\workspace\player\src\player\football.flv (The system cannot find the file specified)
我在这里查看了类似的帖子。我还尝试将视频文件存储在不同的地方,并尝试了多种不同的访问方式。
该文件的路径是:
C:\Users\Darren\workspace\player\src\player
我在这里遗漏了什么明显的东西吗?