The latest service changes have not yet been reflected in this content. We will update the content as soon as possible. Please refer to the Korean version for information on the latest updates.
Available in Classic and VPC
It provides guidance on how to play DRM (Digital Rights Management) protected content in the TV SDK.
DRM does not work on simulators or emulators. Test on a real device.
DRM by platform
The supported DRM and playback engines by platform are as follows:
| Platform | DRM | Engine |
|---|---|---|
| Android TV | Widevine(com.widevine.alpha) |
ExoPlayer |
| tvOS | FairPlay(com.apple.fps) |
AVPlayer |
Method 1: Web SDK-compatible DRM key
The SDK automatically selects the appropriate DRM depending on the platform. Android TV uses Widevine, while tvOS uses FairPlay.
<VpePlayer
accessKey="YOUR_ACCESS_KEY"
options={{
playlist: [{
drm: {
'com.widevine.alpha': {
src: 'https://example.com/manifest.mpd',
licenseUri: 'https://license-server.com/widevine',
licenseRequestHeader: {
'pallycon-customdata-v2': 'DRM_TOKEN',
},
},
'com.apple.fps': {
src: 'https://example.com/index.m3u8',
certificateUri: 'https://license-server.com/cert',
certificateRequestHeader: {
'pallycon-customdata-v2': 'DRM_TOKEN',
},
licenseUri: 'https://license-server.com/fairplay',
licenseRequestHeader: {
'pallycon-customdata-v2': 'DRM_TOKEN',
},
},
},
poster: 'https://example.com/poster.jpg',
description: { title: 'DRM video' },
}],
}}
onBack={() => navigation.goBack()}
/>
Method 2: Direct DRM format with react-native-video
You can also use the DRM format of react-native-video directly.
FairPlay (tvOS)
<VpePlayer
accessKey="YOUR_ACCESS_KEY"
options={{
playlist: [{
file: 'https://example.com/video.m3u8',
drm: {
type: 'fairplay',
licenseServer: 'https://license-server.com/fairplay',
certificateUrl: 'https://license-server.com/cert',
headers: { 'pallycon-customdata-v2': 'DRM_TOKEN' },
},
}],
}}
onBack={() => navigation.goBack()}
/>
Widevine (Android TV)
<VpePlayer
accessKey="YOUR_ACCESS_KEY"
options={{
playlist: [{
file: 'https://example.com/video.mpd',
drm: {
type: 'widevine',
licenseServer: 'https://license-server.com/widevine',
headers: { 'pallycon-customdata-v2': 'DRM_TOKEN' },
},
}],
}}
onBack={() => navigation.goBack()}
/>
Secure Token
You can apply Secure Token to playback source and support OneTimeUrl as the token property. Token renewal during playback is also possible.
const playerRef = useRef<PlayerHandle>(null);
<VpePlayer
ref={playerRef}
accessKey="YOUR_ACCESS_KEY"
options={{
playlist: [{ file: 'https://example.com/video.m3u8' }],
token: 'token=st=1675320871~exp=1675320901~acl=....',
}}
onBack={() => navigation.goBack()}
/>
// Token renewal during playback
playerRef.current?.tokenChange('NEW_TOKEN_VALUE');