I'm trying to programmatically take a screenshot of a view controller that has an AVPlayerViewController. The problem is that, when taking the screenshot on the simulator, the video player appears but on a real device the video player will appear as blank.
Here's the relevant code:
UIGraphicsBeginImageContextWithOptions(imageSize, NO, 0.0f);
CGContextRef context = UIGraphicsGetCurrentContext();
[window drawViewHierarchyInRect:windowFrame afterScreenUpdates:afterScreenUpdates];
UIImage *screenShot = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();