title: How to stop WKWebView from autoplaying HTML5 videos?
body: <p>My attempt was to set <code>webView.configuration.mediaTypesRequiringUserActionForPlayback = .video</code></p>
  
  <p>However, this does not work and after searching Google I was not able to find a workaround.</p>
  
  <p>webView is an IBOutlet with a custom WKWebView class as follows:</p>
  
  <pre><code>import UIKit
  import WebKit
  
  class ScrollWebView: WKWebView {
  
  
    required init?(coder aDecoder: NSCoder) {
      super.init(coder: aDecoder)
      self.configuration.allowsInlineMediaPlayback = true
      self.configuration.mediaTypesRequiringUserActionForPlayback = .all
    }
  }
  </code></pre>