Java Reference
In-Depth Information
mediaView = new MediaView();
mediaView.setMediaPlayer(mediaPlayer);
mediaView.setX(4);
mediaView.setY(4);
mediaView.setPreserveRatio(true);
mediaView.setOpacity(.85);
mediaView.setSmooth(true);
mediaView.fitWidthProperty().bind(scene.widthProperty().subtract(220));
mediaView.fitHeightProperty().bind(scene.heightProperty().subtract(30));
// make media view as the second node on the
scene.
root.getChildren().add(1, mediaView);
}
// sometimes loading errors occur, print error
when this happens
mediaView.setOnError((MediaErrorEvent event1) -> {
event1.getMediaError().printStackTrace();
});
mediaView.setMediaPlayer(mediaPlayer);
event.setDropCompleted(success);
event.consume();
});
// rectangular area holding buttons
final Group buttonArea = createButtonArea(scene);
// stop button will stop and rewind the media
Node stopButton = createStopControl();
// play button can resume or start a media
final Node playButton = createPlayControl();
// pause media play
Search WWH ::




Custom Search