IOS 11 Screen Recording Prevention Like Netflix

I have a video game in my application that I do not want to record. What the Netflix application does is that they allow you to record audio but not video while recording.

Does anyone have an idea how to implement this feature?

+6
source share
4 answers

You can listen to the UIScreenCapturedDidChange notification.

 NotificationCenter.default.addObserver(self, selector: #selector(screenCaptureChanged), name: NSNotification.Name.UIScreenCapturedDidChange, object: nil) 

This is called when iOS 11 screen recording starts and ends. When a user records a screen, you can change the user interface to block any content that you do not want to record.

This notification is called when the UIScreen isCaptured property isCaptured . You can also check this property yourself:

 UIScreen.main.isCaptured 
+3
source

I create a black view and add it at the top of the UIWindow. Then, in the field of view of the PlayerVideo controller, create an observer

NotificationCenter.default.addObserver(self, selector: #selector(screenCaptureChanged), name: NSNotification.Name.UIScreenCapturedDidChange, object: nil)

Then in screenCaptureChanged :

 (void) screenCaptureChanged { if (@available(iOS 11.0, *)) { BOOL isCaptured = [[UIScreen mainScreen] isCaptured]; if (isCaptured) { self.blackView.hidden = false; } else { self.blackView.hidden = true; } } 

}

This solution blocks PlayerVideo during user recording. However, I would like to create something like Netflix. I want users to do whatever they want while watching a movie. If they record, they can continue to watch the video without black viewing. However, when they stop recording, the video will be saved with a black look. I still understand how Netflix really liked it.

0
source

Netflix's solution DOES NOT code. This is called DRM or Digital Rights Management. It protects data from any piracy. Including screen recording / screenshots and downloads. Man, it's expensive.

0
source

I believe that Netflix takes advantage of the FairPlay Streaming technology provided by Apple. According to Apple documentation

If your application uses FairPlay streaming (FPS), your video content will not be automatically captured by the iOS 11 or QuickTime Player screen recording feature on macOS. The part of your application that plays the content will be darkened.

You can get a deeper understanding of FPS at the link below:

https://developer.apple.com/streaming/fps/

Any application can include FPS to achieve the same results as Netflix.

0
source

Source: https://habr.com/ru/post/1271970/


All Articles