MPMoviePlayerController doesn't get control events when full-screen
MPMoviePlayerController doesn't get control events when full-screen
- Subject: MPMoviePlayerController doesn't get control events when full-screen
- From: Fritz Anderson <email@hidden>
- Date: Mon, 28 Nov 2011 12:54:20 -0600
Xcode 4.2.1, iPad 4.3 Simulator, iOS 5.0 SDK, iPad-only.
My master-detail app has a bar button that triggers this action in the master view controller:
- (IBAction) showLegalText: (id) sender
{
UCPromotionController * ucp = [[UCPromotionController alloc] init];
ucp.delegate = self;
ucp.modalPresentationStyle = UIModalPresentationFormSheet;
[self presentModalViewController: ucp animated: YES];
}
In UCPromotionController, self.view is the root view. It contains a navigation bar to host some controls, and a web view. I have a "Demo" button at the left end of the nav bar. Its action is:
- (IBAction) videoButtonTapped: (id) sender
{
NSURL * videoURL = [[NSBundle mainBundle] URLForResource: @"Demo"
withExtension: @"mov"];
// Note that the video is in the application bundle.
// H.264, AAC (but no audio present), 214 x 278
assert(videoURL);
MPMoviePlayerController * player =
[[MPMoviePlayerController alloc] initWithContentURL: videoURL];
player.view.frame = self.view.bounds;
[self.view addSubview: player.view];
__block id mpPlayBackFinishHandler =
[[NSNotificationCenter defaultCenter]
addObserverForName: nil
object: player
queue: [NSOperationQueue mainQueue]
usingBlock: ^(NSNotification *note) {
if ([note.name isEqualToString: MPMoviePlayerPlaybackDidFinishNotification]) {
[player.view removeFromSuperview];
[[NSNotificationCenter defaultCenter]
removeObserver: mpPlayBackFinishHandler];
}
}];
[player play];
}
This works well when the animation runs in the modal window. If the user taps the full-screen control, the video goes to full screen. Full-screen movie-player views are supposed to show controls when tapped, but this one shows them only every four or five taps or so. The full-screen controls do not respond to taps at all, trapping the user in the video.
How can I get this to work? Is my problem that the presenting view controller is modal?
— F
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden