I need a "listenerstopplaying" when playing music with Mediaplayer, JavaFX,

0

I want to make the MediaPlayer of the JavaFX library play one song after another. The problem is that I have to determine which song is played next when it finishes playing one, for that reason I need to execute a code when it finishes playing. As the question says, I need an ActionListener. My idea is to execute a code when the state of the mediaplayer is Stop. In the following example I call the reprodutor in a simple way.

private Media musica=null;
static MediaPlayer reproductor = null;
musica = new Media(proximotema);
reproductor = new MediaPlayer(musica);
reproductor.play();

How can I execute a code when 'player' I finish the music and enter the state "STOPPED"?

since thanks

link

    
asked by Bernardo Harreguy 19.03.2018 в 18:36
source

0 answers