Classic/VPC環境で利用できます。
このページでは、プレイヤーのスクリーンショット・録画防止を設定するガイドについて説明します。
注意
この機能は実機のみで動作します。シミュレータでは動作しません。
参考
Android、iOSで共通して適用されます。
screenRecordingPrevention
画面のスクリーンショットと画面録画を防止します。
iOSはスクリーンショット結果がブラックスクリーンで表示されます。
Androidは「スクリーンショットできません。」トースト通知とともにスクリーンショットを防止します。
const playerRef = useRef(null);
return (
<VpePlayer
...
ref={playerRef}
options={{
playlist: [ //再生ソース
{
file: 'https://CDNドメイン/example_video_01.mp4'
},
],
screenRecordingPrevention: true, //スクリーンショット防止
}}
...
/>
)
app.json設定
スクリーンショット防止のための設定です。
{
"expo": {
"plugins": [
[
"react-native-capture-protection",
{
"captureType": "fullMediaCapture"
}
],
],
},
}
}
注意
状況に応じて prebuildまたは pod installが必要です。