Hi I am working on iOS 10 with Swift3 right now.
My scenario is to autoplay a youtube video inline using WKWebView. I set the config's mediaPlaybackRequiresUserAction to false in order to enable the video autoplay, as suggested by Apple Dev Docs.
However this config does not seem to work, the video loaded correctly, but you have to press the play button to make it actually play.
Any ideas? Thanks :)
let config = WKWebViewConfiguration()
config.requiresUserActionForMediaPlayback = false
config.allowsInlineMediaPlayback = true
let webView = WKWebView(frame: self.topView.bounds, configuration: config)
webView.addObserver(self, forKeyPath: self.webViewLoadingKey, options: .new, context: nil)