The film ended in JMF, now the completion program

I want my program to end as soon as the movie ending has finished using system.exit (0).

Is there any way to do this?

I do not want to use a timer.

+3
source share
2 answers

Got!

    player.addControllerListener(new ControllerListener()

    { 

      public void controllerUpdate(ControllerEvent e) 

      {   

      if (e instanceof EndOfMediaEvent) 

        {   

        System.exit(0); 

        }

      } 

    } 
0
source

The OP posted this answer as a comment.

 player.addControllerListener(new ControllerListener() {
     public void controllerUpdate(ControllerEvent e) { 
        if (e instanceof EndOfMediaEvent) { 
            System.exit(0); 
        }
     }
 }
0
source

Source: https://habr.com/ru/post/1785746/


All Articles