title: iOS Screen Capture Including Playing Video
body: <p>I am trying to capture a UIImage of the screen. However, there is a video (in a AVPlayerViewController). The capture works, but what is displayed in the AVPlayerViewController area is always empty - the rest of the screen is captured correctly.</p>
  
  <p>Is there a way to capture what is in the AVPlayerViewController window too ?</p>
  
  <p>This is how I am capturing the screen</p>
  
  <pre><code>    func captureScreen() -&gt; UIImage? {
          UIGraphicsBeginImageContextWithOptions(self.view.bounds.size, false, UIScreen.main.scale)
          self.view.layer.render(in: UIGraphicsGetCurrentContext()!)
          let image = UIGraphicsGetImageFromCurrentImageContext()
          UIGraphicsEndImageContext()
          return image
      }
  </code></pre>