MPMoviePlayerViewController完成应用程序返回Landscape

时间:2010-07-03 14:39:58

标签: iphone

我有一个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];

1 个答案:

答案 0 :(得分:0)

覆盖视图控制器的-shouldAutorotateToInterfaceOrientation:,仅为肖像返回YES。