我显示在一个的TabBar应用使用MPMoviePlayerViewController视频,视频播放精细在纵向模式下,但不处于风景模式旋转。

相同的代码工作正常在另一个项目,而不使用TabBar。

我试图强迫autoresizingmask到flexibleWidth和flexibleHeight没有成功。

如果我在shouldAutorotateToInterfaceOrientation YES返回状态栏旋转,但不是电影接口。

    - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    // Return YES for supported orientations
    return YES;
}

    -(IBAction) showFamilleMovie {
     NSString *videoURL = [[NSBundle mainBundle] 
            pathForResource:@"film1" 
            ofType:@"mp4"];

     MPMoviePlayerViewController* theMoviePlayer = [[MPMoviePlayerViewController alloc] initWithContentURL:[NSURL fileURLWithPath:videoURL]];
        theMoviePlayer.view.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
     [self presentMoviePlayerViewControllerAnimated:theMoviePlayer];

    }

你有任何想法,该项目可能会来自哪里?

谢谢, 文森特

有帮助吗?

解决方案

您可以尝试:

 [yourTabbarController presentModalViewController: theMoviePlayer]

这应该允许MoviePlayer旋转。

其他提示

我有同样的问题和用于该代码的杀手是在我的appDelegate代码加入的图。它没有让玩家正常转动。

我的问题是:为了实现FBConnect库,您需要在您的appDelegate添加视图让您使用的handleOpenURL方法(从Safari浏览器回来时,身份验证完成),并控制反馈控制器类对象回调。我花一个小时,直到我意识到这种观点阻止转动。

顺便说一句,不关心标签栏。玩家应该正常旋转,即使你没有添加shouldAutorotateToInterfaceOrientation方法做的。

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top