HTML video can't play inline and use native fullscreen within WKWebView

53 views Asked by At

I have a media player in VueJS project that is being injected from a 3rd party. Its a basic HTML <video /> with some wrappers and containers where we call the 3rd party API for content, and send it to the player. This web page is loaded by WKWebView with the configuration allowsInlineMediaPlayback = true. But with this set to true, the fullscreen mode does not use the native controller. Instead it only fills the webview context (not the full screen) and basically breaks the page. How can I allow the video to play inline AND use the native fullscreen controller on iOS?

1

There are 1 answers

0
george tselos On

I had the same issue in a different setup and I found out that the library I was using had the value of isElementFullscreenEnabled in WKPreferences set to true. Setting this to false achieved the desired behavior.

Documentation: https://developer.apple.com/documentation/webkit/wkpreferences/3917769-iselementfullscreenenabled