Capture and recording prevention

Prev Next

Available in Classic and VPC

This page provides instructions for setting up player capture and recording prevention.

Caution

This feature only works on physical devices. It does not work on simulators.

Note

This applies to both Android and iOS.

screenRecordingPrevention

Use this to prevent screen capture or recording.
On iOS, captured content appears as a black screen.
On Android, capture is prevented along with an "Unable to capture" toast message.

const playerRef = useRef(null);
return (
  <VpePlayer
      ...
      ref={playerRef}
      options={{
            playlist: [ //Playback source
                {
                    file: 'https://CDNdomain/example_video_01.mp4'
                },
            ],
            screenRecordingPrevention: true, //Prevent screen capture
          }}
      ...
  />

) 

app.json configuration

Use this to prevent screen captures.

{
  "expo": {
    
    "plugins": [
       
        [
            "react-native-capture-protection",
            {
                "captureType": "fullMediaCapture"
            }
        ],
       
    ],
    
    },
  }
}
Caution

You may need to run prebuild or pod install depending on the situation.