The title is nearly describing everything, but here in detail... To play videos in my app I am using an AVPlayerViewController which I am presenting modally
let player = AVPlayer.init(url: url)
let playerViewController = AVPlayerViewController.init()
playerViewController.player = player
parentViewController.present(playerViewController, animated: true, completion: {...})
All is working fine, the video plays in full screen and I am able to rotate the device to landscape and to portrait back again ... still everything is running smoothly.
When I tap the speech bubble in the lower right corner to change audio or subtitle setting this kind of UIAlertController shows in portrait mode (iPhone 7 plus portrait):
When tapping the same button in landscape mode it looks like this (basically the same but will present in portrait orientation, iPhone 7 landscape):
Doing the same on an iPad Air 2 in landscape looks like this:
Now the actual issue: when playing the movie on a 6/6s/7 PLUS device in landscape mode and tapping the speech bubble, the app crashes! This is what is appearing in the debugger output and the stack trace:
2017-08-10 12:08:18.683184+0200 MyApp[27739:6396143] [Assert] transitionViewForCurrentTransition is not set! (<_UIFullscreenPresentationController: 0x7ffe3e586000>)
For me it looks like an Apple bug because I am not doing anything special here (at least I think so) and because the crash is only showing when using a plus device, which are the only ones having the combination of compact and regular size class.
Does anybody have an idea what is going on here?
I get same issue, I fixed it with the following code in 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);
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With