title: Autoplay YouTube videos in WKWebView with iOS 11
body: <p>I want to have small YouTube player in my app. The only way i found to be recommended is embeding web page with YouTube player into my app. So i used WKWebView and loaded embed YouTube player page with <strong>autoplay</strong> parameter: <code>https://www.youtube.com/embed/VUbsFtLkGN8?autoplay=1</code>.</p>
  
  <p>Code would be like:</p>
  
  <pre><code>let webConfiguration = WKWebViewConfiguration()
  let webView = WKWebView(frame: .zero, configuration: webConfiguration)
  let youtubeURL = URL(string: "https://www.youtube.com/embed/VUbsFtLkGN8?autoplay=1")
  webView.load(URLRequest(url: youtubeURL!))
  </code></pre>
  
  <p>This embed player url autoplays in desktop Safari, but does not autoplay in mobile Safari or WKWebView. Can i force WKWebView to autoplay video somehow? Or use another YouTube player url?</p>