[ad_1]
Context:
I’m utilizing WKWebView for a video-streaming WebView app.
It mechanically opens up the native iOS AVPLayer view when exhibiting the video in fullscreen.
Motive:
I wish to lock the orientation of this view, so when the person views the video in fullscreen, it locks to panorama orientation and reverts again to portrait when it exits fullscreen.
Difficulty:
Nonetheless, no orientation locks applied in AppDelegate or in the primary WKWebView ViewController class have an effect on the orientation behaviour of the native AVPlayer. It nonetheless rotates if the machine hasn’t disabled auto-rotate.
Present Standing and Query:
I can solely appear to detect when the app enters and exits this fullscreen video view (the AVPlayer), however I can not seem to entry the view itself. Is that this attainable?
- If it’s not attainable, I assume I have to construct a customized AVPlayer and get it to
override WKWebView’s native one so as to management it. Has anybody achieved this or have suggestions on how to take action?
Enormously respect any recommendation!
[ad_2]
