Prevent screen capture and recording

Prev Next

Available in Classic and VPC

This section explains how to configure the player to prevent screen capture and recording.

Supported platforms: Android iOS

Note

This feature only works on physical devices. (Simulator not supported)

screenRecordingPrevention

To prevent screen capture or recording, you must configure the screenRecordingPrevention option.

  • On iOS, captured results are processed as a black screen.
  • On Android, screen capture is blocked and the "Couldn't capture screen." toast message is displayed.
const playerRef = useRef(null);

return (
  <VpePlayer
    ref={playerRef}
    options={{
      playlist: [
        { file: 'https://CDNdomain/example_video_01.mp4' },
      ],
      screenRecordingPrevention: true, // Screen capture and recording prevented
    }}
  />
);

app.json configuration

You need to add a configuration to prevent screen capture and recording.

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

Depending on the situation, either prebuild or pod install is required.