I am playing a video using MPMoviePlayerController. I am getting a black screen that does not respond to taps on controls in the following scenarios:
- User taps on fast-forward button
- User taps on rewind button
- User long-holds, and fast-forwards to the end of the video
All the other controls work as expected.
Note that a long-hold on fast-forward and rewind does work as expected.
I did look at the documentation at the link below. There are notifications for when the user is seeking forward and backward (e.g., long holding); respectively, MPMoviePlaybackStateSeekingForward and MPMoviePlaybackStateSeekingBackward. That being said, there are no notifications for a simple_tap_ on the seek buttons.
Link is "Here".
For completeness, here is the code that I'm using to call the player. Nothing really out of the ordinary; when video ends (observing MPMoviePlayerPlaybackDidFinishNotification), I rewind to the beginning.
NSString *path = [[NSBundle mainBundle] pathForResource:@"catSleeping" ofType:@mp4"];
_videoPlayer = [[MPMoviePlayerController alloc]
initWithContentURL:[NSURL fileURLWithPath:path]];
[_videoPlayer prepareToPlay];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(moviePlayBackDidFinish:)
name:MPMoviePlayerPlaybackDidFinishNotification
object:_videoPlayer];
_videoPlayer.controlStyle = MPMovieControlStyleFullscreen;
_videoPlayer.shouldAutoplay = YES;
[self.view addSubview:_videoPlayer.view];
[_videoPlayer setFullscreen:YES animated:YES];
[_videoPlayer play];
}
- (void) moviePlayBackDidFinish:(NSNotification*)notification {
MPMoviePlayerController *player = [notification object];
player.currentPlaybackTime = 0.1;
[player stop];
[player play];
[player pause];
}
Any ideas?
tyvm Keith :)