Java Reference
In-Depth Information
slider.setValue(1);
slider.setShowTickLabels(true);
slider.setShowTickMarks(true);
slider.valueProperty().addListener((ObservableValue<?
extends Number> observable,
Number oldValue, Number newValue) -> {
if (paused) {
long dur = newValue.intValue() * 1000;
mediaPlayer.seek(new Duration(dur));
}
});
slider.translateYProperty().bind(scene.heightProperty().subtract(30));
return slider;
}
Figure 16-3 depicts the JavaFX basic video player with a slider control.
Figure 16-3 . JavaFX basic video player
How It Works
To create a video player, you will model the application similar to the example in Re-
cipe 16-1 by reusing the same application features such as drag-and-drop files, media
button controls, and so on. For the sake of clarity, I took the previous recipe and moved
 
 
Search WWH ::




Custom Search