Example usage for javafx.scene.media MediaPlayer volumeProperty

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

Introduction

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

Prototype

public DoubleProperty volumeProperty() 

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 .ja  v a  2s. co  m*/
        public void run() {
            songModel.getMediaPlayer().stop();
        }
    });

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