我想在我的应用程序中流式传输视频。我发现的方法是:MPMoviePlayerViewController |允许横向模式
NSURL *theMovieURL = [NSURL URLWithString:self.data.trailer];
if (theMovieURL)
{
self.movieController = [[MPMoviePlayerViewController alloc] initWithContentURL:theMovieURL];
[self presentMoviePlayerViewControllerAnimated:self.movieController];
[self.movieController.moviePlayer play];
}
我不确定它是最传统的,但它的工作原理。
问题是,我不知道如何只允许视频横向模式。我应该使用类似shouldAutorotate
还是shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation
,以及如何?
仅供参考,整个应用程序只允许肖像模式。
感谢您的帮助。
检查presentViewController是否被解散(isBeingDismissed属性),否则呈现viewcontroller将显示在landscapemode – peko