Example usage for javafx.scene.media MediaPlayer totalDurationProperty

List of usage examples for javafx.scene.media MediaPlayer totalDurationProperty

Introduction

In this page you can find the example usage for javafx.scene.media MediaPlayer totalDurationProperty.

Prototype

public ReadOnlyObjectProperty<Duration> totalDurationProperty() 

Source Link

Usage

From source file:AudioPlayer3.java

private void addListenersAndBindings(final MediaPlayer mp) {
    mp.statusProperty().addListener(statusListener);
    mp.currentTimeProperty().addListener(currentTimeListener);
    mp.totalDurationProperty().addListener(new TotalDurationListener());

    mp.setOnEndOfMedia(new Runnable() {
        @Override//from   ww  w  .  j av  a 2 s . c  o m
        public void run() {
            songModel.getMediaPlayer().stop();
        }
    });

    volumeSlider.valueProperty().bindBidirectional(mp.volumeProperty());
}