title: How to determine a mediaplayer has stopped playing in ios
body: <p>I need to show images and videos as the slide show in an application. I have kept the images and videos link in an array and determining which is video and which is image, and set the slide show timings according to the video time length and 2 sec for each image, Now the problem is when I start the slide show and the video comes and it plays, I cannot determine the video is stopped playing or not?</p>
  
  <p>I am using <code>MPMediaplayer</code> and checking the stopping by</p>
  
  <pre><code>      if (player.playbackState == MPMoviePlaybackStatePlaying)
        { //playing
        }
        if (player.playbackState == MPMoviePlaybackStateStopped)
        { //stopped
        }if (player.playbackState == MPMoviePlaybackStatePaused)
        { //paused
        }if (player.playbackState == MPMoviePlaybackStateInterrupted)
        { //interrupted
        }if (player.playbackState == MPMoviePlaybackStateSeekingForward)
        { //seeking forward
        }if (player.playbackState == MPMoviePlaybackStateSeekingBackward)
        { //seeking backward
        }
  </code></pre>
  
  <p>But all the time it is going to the <code>MPMoviePlaybackStatePaused</code> section, when the video is stopped. Can anyone help me why it is going to that condition all the time when video stopped ? or any other method that can help me to determine the video is stopped playing?</p>