I have a MPMoviePlayerViewController, while the video plays fine if the video is in landscape, and when it finished the app turns to landscape. After video finished I want the App to remain portrait.
MPMoviePlayerViewController *moviePlayer = [[MPMoviePlayerViewController alloc] initWithContentURL:movieURL];
//[开发者_如何学编程moviePlayer shouldAutorotateToInterfaceOrientation:UIInterfaceOrientationLandscapeLeft];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(moviePlayBackDidFinished:) name:MPMoviePlayerPlaybackDidFinishNotification object:(moviePlayer.moviePlayer)];
[self presentMoviePlayerViewControllerAnimated:moviePlayer];
[moviePlayer.moviePlayer play];
Override your view controller's -shouldAutorotateToInterfaceOrientation:
to return YES only for portrait.
精彩评论