我的应用程序包含在横向和纵向模式下播放视频的功能。视频也可以是YouTube一切工作正常,直到iOS 7,但现在youtube视频不能在横向模式下工作在iOS 8Youtube视频不能在横向模式下播放iOS 8
我的代码:
- (NSUInteger)application:(UIApplication *)applicationsupportedInterfaceOrientationsForWindow:(UIWindow *)window {
if ([[window.rootViewController presentedViewController]
isKindOfClass:[MPMoviePlayerViewController class]] || [[window.rootViewController presentedViewController] isKindOfClass:NSClassFromString(@"MPInlineVideoFullscreenViewController")]) {
return UIInterfaceOrientationMaskAllButUpsideDown;
} else {
if ([[window.rootViewController presentedViewController]
isKindOfClass:[UINavigationController class]]) {
// look for it inside UINavigationController
UINavigationController *nc = (UINavigationController *)[window.rootViewController presentedViewController];
// is at the top?
if ([nc.topViewController isKindOfClass:[MPMoviePlayerViewController class]]) {
return UIInterfaceOrientationMaskAllButUpsideDown;
// or it's presented from the top?
} else if ([[nc.topViewController presentedViewController]
isKindOfClass:[MPMoviePlayerViewController class]]) {
return UIInterfaceOrientationMaskAllButUpsideDown;
}
}
}
return UIInterfaceOrientationMaskPortrait;
}
一切工作正常,直到iOS的7,但停止在iOS 8 工作任何帮助表示赞赏
upvoted cuz回答你自己的问题并不傻。未答复的帖子是愚蠢的。 – overeasy 2014-09-25 05:13:03
感谢您的答案,我有麻烦使它在iOS7上工作 - 细节太大,不能评论,提出了一个新问题http://stackoverflow.com/questions/26443485/fullscreen-video-screen-is-not -mpmovieplayerviewcontroller-on-ios7-device – Boaz 2014-10-18 19:07:59
谢谢!视频视图处于活动状态时,旋转按预期工作。我遇到了一个问题,在应用程序处于横向模式时点击完成按钮后,应用程序返回到纵向模式,但导航栏无法正确调整大小。导航栏的高度比应该小。 – 2014-12-10 23:00:23