I get this warning whenever I enter/exit Fullscreen or enter/exit PiP on the iPad.
This is how I setup my player. I add the view of the playerViewController to an already existing UIView sitting in my normal UI.
I guess I need to somehow take action on the called delegate methods, but what and where exactly?? I want to get rid of this message and be a good video-playing-dev-citizen.
Any help on this would be nice.
I already watched https://developer.apple.com/videos/play/wwdc2019/503/ more than twice, but still don't get it. btw, why is there no tutorial/documentation on this important stuff? I mean, which developer playing videos does NOT want to go fullscreen or PiP if possible??AVPlayerViewController is trying to enter full screen, but is not in its view's window's view controller hierarchy. This results in undefined behavior.
This is how I setup my player. I add the view of the playerViewController to an already existing UIView sitting in my normal UI.
Code Block // configure video player self.playerViewController = [[AVPlayerViewController alloc] init]; playerViewController.delegate = self; playerViewController.showsPlaybackControls = YES; [playerViewController setPlayer:[AVPlayer playerWithURL:bundleBasedVideoURL]]; playerViewController.player.muted = YES; playerViewController.player.allowsExternalPlayback = YES; playerViewController.entersFullScreenWhenPlaybackBegins = NO; playerViewController.exitsFullScreenWhenPlaybackEnds = YES; playerViewController.allowsPictureInPicturePlayback = YES; playerViewController.canStartPictureInPictureAutomaticallyFromInline = YES; [self.placeholderView addSubview:playerViewController.view]; [playerViewController didMoveToParentViewController:self]; [playerViewController.view setFrame:self.placeholderView.bounds]; LOG( @"STATUS: %i", (int)[self.playerViewController.player status] );
I guess I need to somehow take action on the called delegate methods, but what and where exactly?? I want to get rid of this message and be a good video-playing-dev-citizen.
Any help on this would be nice.