17

I need to find the MPMovieplayerController is playing or not with condition.

Check the Condition button click event....!

Any one help with me us....!

Thanks....!

2 Answers 2

44

MPMovieplayerController is having playbackState property. On button click event you can do like

-(IBAction)btnClicked:(id)sender
{
    if(yourMoviePlayerObject.playbackState == MPMoviePlaybackStatePlaying)
        NSLog(@"Yes Playing");
    else
        NSLog(@"Not Playing");
}
1
  • Note the common solution is to register for a change within the playback state instead for detecting it (see the documentation on the MPMoviePlayerPlaybackStateDidChange notification).
    – Till
    Mar 31, 2012 at 13:16
5

This is clearly stated in the documentation

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.