我试图使用JavaFX MediaPlayer循环播放视频,但我没有循环播放,我想向后播放,我在javadoc上找不到任何内容,有人知道怎么做它?
public class Test extends Application {
public static void main(String[] args) {
Application.launch(Test.class);
}
@Override
public void start(Stage primaryStage) throws Exception {
MediaView mediaView = new MediaView();
Media media = new Media("http://clips.vorwaerts-gmbh.de/VfE_html5.mp4");
MediaPlayer mediaPlayer = new MediaPlayer(media);
mediaPlayer.setVolume(0.1); // for the glory of the headphones
mediaPlayer.play();
mediaView.setMediaPlayer(mediaPlayer);
BorderPane borderPane = new BorderPane();
borderPane.setCenter(mediaView);
Scene scene = new Scene(borderPane);
primaryStage.setScene(scene);
primaryStage.setWidth(800);
primaryStage.setHeight(600);
primaryStage.centerOnScreen();
primaryStage.show();
}
}