I have an app which uses a UISplitViewController to load a webpage in the Detail View Controller, which has a WKWebView property. Some of the URLs are links to embedded YouTube videos, and some are direct links to .mp4 files. Either way, the video files are loaded automatically (after tapping for the YouTube videos) into a fullscreen system player, which I assume is an AVPlayerViewController. I've seen several posts about subclassing AVPlayerViewController to allow the rotation by implementing supportedInterfaceOrientations, and other posts which recommended either checking the class of the UIWindow's rootViewController presentedViewController in application: supportedInterfaceOrientationsForWindow: or checking a variable on the AppDelegate that was set when the AVPlayerViewController was presented, but none of these solutions have worked for me because I'm not creating or presenting my own instance of AVPlayerViewController, so I'm not sure how to allow the rotation to landscape when these videos are playing.
Is there a way I can tell when the system is playing a video in full screen mode, so I can allow the rotation?
Here are links to some of the posts I've seen already: