Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS 11 Screen Record disable VIDEO RECORDING

iOS 11 has new feature which enables users to record their screen, I want to disable only VIDEO recording when i am playing video in my application keeping screen record enabled.

For example. I am recording my screen and open my application start using it, but as soon as AVPlayer starts playing video it should pause the screen recording so that video in my application does not get captured in Recording while audio can be captured in the Screen Record.

Thanks!

like image 473
Shuja Ud Din Avatar asked Sep 21 '17 06:09

Shuja Ud Din


1 Answers

There is currently no way to disable the user from recording the screen. You can, however, determine when the user is recording the screen, and respond accordingly.

To be notified when the user starts or finishes recording their screen, you can listen for a UIScreenCapturedDidChange notification.

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

You can also inspect the isScreenCaptured property of UIScreen to determine if the screen is currently being recorded.

UIScreen.main.isCaptured

In your case, since you can't disable the screen recording, the best solution is to show some UI that blocks the video when the screen is being recorded.

like image 97
nathangitter Avatar answered Nov 09 '22 23:11

nathangitter