我试过了
public class Video3 extends Application{
public static void main(String[] args) {
launch(args);
}
@Override
public void start(Stage stage) throws Exception {
Group root = new Group();
Scene scene = new Scene(root, 1280, 1024, Color.BLACK);
File file = new File("/home/ubuntu/NetBeansProjects/VideoPaly/src/videopaly/vid.flv");
String path = file.toURI().toASCIIString();
URI uri = new URI(path);
root.getChildren().add(MediaViewBuilder.create().mediaPlayer(MediaPlayerBuilder.create()
.media(new Media(path)).build()).build());
stage.setScene(scene);
stage.show();
}
}
当我在上面运行代码时,它会显示黑色窗口,我该如何解决?