Screen recording restrictions for default player, playing a video in full screen using webview

How to restrict or close the video played in default player of webview for ios when user starts screen recording?

What I have done is!!! In order to achieve data hiding when screen recording is ON,

  1. Notification center is used to notify the changes for screen recording.
  2. I have used if else condition to check if the screen recording is ON or OFF.
  3. Based on above checks i am hiding the window as window.ishidden = true/false
  4. With the above condition i am able to restrict user from recording the data present on screen.

Failure case:

  1. The app is totally on webview.
  2. When user clicks on a course it shows the list of videos. When clicked on any of the video it plays with the iOS default player on a full screen.
  3. When the user starts on screen recording the window.isHidden = true and user will not be able to see anything on screen.
  4. Like wise when the user taps on a video in webview and it starts playing in a full screen and user taps on screen recording the window.isHidden = true but the video still Plays. By showing the window hidden property to true.
  5. When I close the player then as the window.ishiddenproperty is TRUE the screen becomes blank with no content visible.

Please do help me with this as i am using webview which loads up the data and player might be on top of window element.

Screen recording restrictions for default player, playing a video in full screen using webview
 
 
Q