I have simple ViewController with WKWebView configured as follows:
webView.configuration.allowsInlineMediaPlayback = true
webView.configuration.mediaTypesRequiringUserActionForPlayback = .video
But right after loading a web page with YouTube video it starts to play automatically (and switching to full screen at the same time) without any user interaction which is required. How to disable autoplay?
1. On the Home tab of the YouTube app, tap your profile picture, then tap Settings. 2. Tap Autoplay, then tap the autoplay switch to the off position to turn off the feature.
I also had same problem,YouTube vide was playing in full screen
webview.configuration.allowsInlineMediaPlayback = true
programmatically setting allowsInlineMediaPlayback value didn't work for me
You can avoid video switching fullscreen by enable inline playback for WKWebview.
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