/**
  * Initiates playback stop and wait util it stops.
  *
  * @throws InterruptedException
  */
 public void stopSync() throws InterruptedException {
   stop();
   waitForState(PlayerState.STOPPED);
 }
 /**
  * Requests pause and wait until playback pauses.
  *
  * @throws InterruptedException
  */
 public void pauseSync() throws InterruptedException {
   pause();
   waitForState(PlayerState.PAUSED);
 }
 /**
  * Initiate playback preparation and wait until playback will start.
  *
  * @throws InterruptedException
  */
 public void playSync() throws InterruptedException {
   play();
   waitForState(PlayerState.PLAYING);
 }