[MPlayer-users] states of mplayer

Dennis Aristow _den at bk.ru
Mon Sep 25 12:46:41 CEST 2006


I have solved this problem by introducing 
an boolean variable 'paused':

...
boolean paused = false;
...
while ((line = player.stdout.readLine()) != null) {
  if (paused) {		                           // resume playback
    paused = false;
    player.informAboutState(Marks.STARTING_PLAYBACK);
  }
  if (line.startsWith(Marks.STARTING_PLAYBACK)) {  // playback
    player.informAboutState(Marks.STARTING_PLAYBACK);
  } 
  else if (line.startsWith(Marks.PAUSE)) {         // paused
    player.informAboutState(Marks.PAUSE);
    paused = true;
  }
  else if (line.startsWith(Marks.END_OF_FILE)) {   // end of file
    player.informAboutState(Marks.END_OF_FILE);
  } 
  else if (line.startsWith(Marks.QUIT)) {          // quit
    player.informAboutState(Marks.QUIT);
  }
}
...



More information about the MPlayer-users mailing list