我有一个MPMoviePlayerViewController,如果视频是横向的,视频播放效果很好,完成后应用程序转为横向。完成视频后,我希望应用程序保持纵向。
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];
答案 0 :(得分:0)
覆盖视图控制器的-shouldAutorotateToInterfaceOrientation:
,仅为肖像返回YES。