I have one application for viewing with 5 buttons, and when one of the buttons is pressed, the player slides over the original view and starts playing the video in full screen mode (as it should be).
Everything works fine except for clicking on the Fullscreen / Minimize icon (two diagonal arrows pointing to each other next to the playback controls). When you click this button, the original view with five buttons will move over the video player. The problem is that the video is still playing under the original view. I would really like to exclude the Fullscreen / Minimize icon, but I can say that this is not possible. So ... I think I could use an observer to listen when the Fullscreen / Minimize icon is clicked, and I can do what I need. I just can't find anything solid in how to do this. Any help / direction would be appreciated.
Here is my current code ...
-(IBAction)playvideo {
NSURL *url = [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"Megamind" ofType:@"mov"]];
MPMoviePlayerViewController * playerController = [[MPMoviePlayerViewController alloc] initWithContentURL:url];
[self presentMoviePlayerViewControllerAnimated:(MPMoviePlayerViewController *)playerController];
playerController.moviePlayer.movieSourceType = MPMovieSourceTypeFile;
[playerController.moviePlayer play];
[playerController release];
playerController=nil;
}
- (void)moviePlayerWillExitFullscreen:(NSNotification *)theNotification {
MPMoviePlayerController *playerController = [theNotification object];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(moviePlayerWillExitFullscreen:)
name:MPMoviePlayerWillExitFullscreenNotification
object:nil];
[playerController stop];
[self dismissMoviePlayerViewControllerAnimated];
}
joeyd