Search code examples
javavideo-processingjmfsystem.exit

Movie ended on JMF,now terminate program


I want my program to terminate itself once the movie played has ended, using system.exit(0).

is there a way of doing that?

I dont want to use Timer.


Solution

  • Got it!

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