On both macOS and iOS, when a user takes a screenshot of a video file playing within iTunes / the TV app, the screenshot is obscured and the media player layer appears as a solid black box in the screenshot as shown here:
iOS:
macOS:
I have read in other posts that it is not possible to obscure/prevent the user from taking a screenshot on iOS devices; however, as shown in these images, Apple appears to be using some method to obscure the content of the video in the screenshot file.
In these cases, how is the app managing to obscure the video content within the screenshot?
For MacOS it's pretty easy... set the window level to be above a certain point, for example in one of my apps where I disallow screenshots, I do this (in Objective-C):
windowLevel = CGShieldingWindowLevel();
[myWindowOutlet setLevel: windowLevel];
For iOS it's trickier. You can tell when a screenshot has been taken, but there's no official API to stop it from happening. One person on Apple's developer forums suggested to call "touchesCancelled
"