【发布时间】:2016-10-24 03:17:28
【问题描述】:
我已经在 AppDelegate.m 中实现了这段代码
-(UIInterfaceOrientationMask) application:(UIApplication *)application supportedInterfaceOrientationsForWindow :(UIWindow *)window
{
UIViewController *currentVC = [(UINavigationController *)[UIApplication sharedApplication].delegate.window.rootViewController topViewController];
if ([currentVC isKindOfClass:[VideoPlayerVC class]])
{
return UIInterfaceOrientationMaskAll;
}
return UIInterfaceOrientationMaskPortrait;
}
并通过如下链接推送到 VideoPlayerVC:
NSURL *link = [NSURL URLWithString:strUrl];
VideoPlayerVC *vc = [[VideoPlayerVC alloc] init];
vc.videoUrl = link;
[self.navigationController pushViewController:vc animated:false];
这允许我在 VideoPlayer ViewController 中启用自动旋转,但是当视频播放以横向模式结束时,整个应用程序只会转换为横向视图模式。
请帮我解决这个问题。 提前致谢。
【问题讨论】:
标签: ios objective-c mpmovieplayercontroller