小编Dar*_*ohn的帖子

javafx 2 MediaException:MEDIA_UNAVAILABLE将不会加载文件

我正在尝试在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();
Run Code Online (Sandbox Code Playgroud)

我收到以下错误:

Caused by: MediaException: MEDIA_UNAVAILABLE : C:\Users\Darren\workspace\player\src\player\football.flv (The system cannot find the file specified)
Run Code Online (Sandbox Code Playgroud)

我在这里查看了类似的帖子.我还尝试将视频文件存储在不同的地方,并尝试了大量不同的访问方式.

该文件的路径是:

C:\Users\Darren\workspace\player\src\player

我错过了这里明显的一切吗?

java javafx media-player javafx-2

5
推荐指数
1
解决办法
711
查看次数

标签 统计

java ×1

javafx ×1

javafx-2 ×1

media-player ×1