I am using MPMoviePlayerViewController to play video stream from the server, everything else working smooth. My problem is that when I play the Video it plays automatically and goes to the pause state automatically if no playable content available, and not playing after getting the content loaded.
movieController = [[MPMoviePlayerViewController alloc] init];
movieController.moviePlayer.movieSourceType = MPMovieSourceTypeStreaming;
[movieController.moviePlayer setContentURL:mediaURL];
[movieController.moviePlayer prepareToPlay];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(moviePlayBackDidFinish:)
name:MPMoviePlayerPlaybackDidFinishNotification
object:nil];
[movieController.moviePlayer setControlStyle:MPMovieControlStyleFullscreen];
[movieController.moviePlayer setFullscreen:YES];
[movieController.moviePlayer setShouldAutoplay:YES];
[movieController.moviePlayer play];
[self presentMoviePlayerViewControllerAnimated:movieController];
This is my code used to play the video from the url given with mediaURL. I have tried to add MPMoviePlayerPlaybackStateDidChangeNotification to check state changed to MPMoviePlaybackStatePaused, its also working fine. Also checked MPMovieLoadState with MPMovieLoadStatePlaythroughOK using MPMoviePlayerLoadStateDidChangeNotification the issue is that not get the MPMovieLoadStatePlaythroughOK after pause automatically.This link
Also Is there any way to get pause button tap other than MPMoviePlayerPlaybackStateDidChangeNotification, because notification get fired for other reasons also.
I've added a transparent button above the default Play/Pause button in
MPMoviePlayerViewControlleras follows.