开发者

MPMoviePlayerViewController Finished the App returns Landscape

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜