要在我的应用程序中播放视频我正在使用AVPlayerVIEwController,我以模态方式呈现
let player = AVPlayer.init(url: url)let playerVIEwController = AVPlayerVIEwController.init()playerVIEwController.player = playerparentVIEwController.present(playerVIEwController,animated: true,completion: {...})
一切正常,视频全屏播放,我可以将设备旋转到横向和再次纵向移动……仍然一切都运行顺畅.
当我点击右下角的语音气泡来改变音频或字幕设置时,这种UIAlertController以纵向模式显示(iPhone 7加肖像):
在横向模式下点击相同的按钮时,它看起来像这样(基本相同,但将以纵向显示,iPhone 7横向):
在iPad Air 2风景中做同样的事情看起来像这样:
现在实际问题是:在横向模式下在6 / 6s / 7 PLUS设备上播放电影并点击语音气泡时,应用程序崩溃了!这是调试器输出和堆栈跟踪中出现的内容:
2017-08-10 12:08:18.683184 0200 MyApp [27739:6396143] [Assert] TransitionVIEwForCurrentTransition未设置! (< _UIFullscreenPresentationController:0x7ffe3e586000>)
对我来说,它看起来像一个Apple BUG,因为我在这里没有做任何特别的事情(至少我是这么认为),因为崩溃仅在使用plus设备时显示,这是唯一具有紧凑和常规尺寸类别的组合.
有没有人知道这里发生了什么?
解决方法 我得到同样的问题,我在AppDelegate.m中使用以下代码修复它- (NSUInteger)application:(UIApplication *)application supportedInterfaceOrIEntationsForWindow:(UIWindow *)window{ for (UIVIEw *TransitionVIEw in window.subvIEws) { if ([TransitionVIEw isKindOfClass:NSClassFromString(@"UITransitionVIEw")]) { for (UIVIEw *subVIEw in TransitionVIEw.subvIEws) { ID nextResponder = [subVIEw nextResponder]; if ([nextResponder isKindOfClass:NSClassFromString(@"AVFullScreenVIEwController")]) { return UIInterfaceOrIEntationMaskAll; } } } } return (1 << UIInterfaceOrIEntationLandscapeRight) | (1 << UIInterfaceOrIEntationLandscapeleft);}总结
以上是内存溢出为你收集整理的ios – 在iPhone plus设备上点击横向媒体选择按钮时,AVPlayerViewController崩溃全部内容,希望文章能够帮你解决ios – 在iPhone plus设备上点击横向媒体选择按钮时,AVPlayerViewController崩溃所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)