Search code examples
javamedia-playerjmf

How to check if mediaplayer is playing or stopped?


How can I check whether the mediaplayer is playing or stopped, using Java Media Framework?


Solution

  • You can call getState and check against Controller.Started:

    if (mediaPlayer.getState() == Controller.Started)