【发布时间】:2013-06-26 12:17:32
【问题描述】:
我正在尝试在 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
我在这里遗漏了什么明显的东西吗?
【问题讨论】:
-
我也有这个问题。一个答案会很好。
标签: java media-player javafx-2 javafx