title: Swift: Why my screenshot not displaying Avplayer video?
body: <p>In my project i used AVPlayerViewController in an embedded view.And allow user to draw on the video.To take a screenshot i used the below code...</p>
  
  <pre><code>UIGraphicsBeginImageContextWithOptions(UIScreen.mainScreen().bounds.size, false, 0);
              self.view.drawViewHierarchyInRect(view.bounds, afterScreenUpdates: true)
              var image:UIImage = UIGraphicsGetImageFromCurrentImageContext();
  UIGraphicsEndImageContext();
  UIImageWriteToSavedPhotosAlbum(image, nil, nil, nil)
  </code></pre>
  
  <p>The problem is when i run the above code in simulator it works well but in Physical device it returns black image </p>
  
  <p>Any suggestion would be helpful</p>
  
  <p><a href="https://i.stack.imgur.com/13VNE.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/13VNE.png" alt="Simulator screenshot"></a></p>
  
  <p>iPad screenshot:
  <a href="https://i.stack.imgur.com/Cdc4b.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Cdc4b.png" alt="ipad screenshot"></a></p>