MPMoviePlayerController playback control disappears
I added the MPMoviePlayerController in my project and it works fine. But the playback control appears only at the beginning. If I want to return to the previous view, I have to wait until the movie end...
I checked the sample project "MoviePlayer" and its playback control will appear/disappear when user touches the screen.
Here is my code about playing movie, I think there is no much different to the sample code.
============================
- (void)playMovieAtURL:(NSURL*)url {
MPMoviePlayerController* mPlayer = [[MPMoviePlayerController alloc] initWithContentURL:url];
mPlayer.scalingMode = MPMovieScalingModeAspectFit;
mPlayer.movieControlMode = MPMovieControlModeDefault;
mPlayer.backgroundColor = [UIColor blackColor];
mPlayer.initialPlaybackTime = -1.0;
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(movieFinishedCallback:) name:MPMoviePlayerPlaybackDidFinishNotification
object:mPlayer];
[mPlayer play];
}
- (void)movieFinishedCallback:(NSNotification*)aNotification {
MPMoviePlayerController* mPlayer = [aNotification object];
[[NSNotificationCenter defaultCenter] removeObserver:self name:MPMoviePlayerPlaybackDidFinishNotification
object:mPlayer];
[mPlayer stop];
[mPlayer release];
}
=========================
Could anyone tell me how to show the playback control just as the sample project??
BTW, the view in my project is applied with OpenGL, although I dont think this is the cause.
Thank you very much 🙂
iPhone OS 3.0.1