title: How to play HTML5 videos fullscreen from within WKWebView (or WebView) on OS X
body: <p>I have a WKWebView in my cocoa application (OS X) that displays YouTube. Whenever I play a video (HTML5) and click on the fullscreen button, it says: "Full screen is unavailable.". How could I configure WKWebView to play HTML5 videos in fullscreen?</p>
  
  <pre><code>self.webView = WKWebView(frame: self.view.frame, configuration: WKWebViewConfiguration())
  self.webView.navigationDelegate = self
  self.webView.translatesAutoresizingMaskIntoConstraints = false
  self.view.addSubview(self.webView)
  
  let url = NSURL(string: "https://www.youtube.com")
  let request = NSURLRequest(URL: url!)
  webView.loadRequest(request)
  </code></pre>