Documentation Index

Fetch the complete documentation index at: https://guide.ncloud-docs.com/llms.txt

Use this file to discover all available pages before exploring further.

コンテンツ認証

Prev Next

Classic/VPC環境で利用できます。

TV SDKでは、Digital Rights Management(DRM)によって保護されたコンテンツを再生する方法をご案内します。

注意

DRMはシミュレータ / エミュレータでは動作しません。必ず実デバイスでテストしてください。

プラットフォーム別 DRM

プラットフォーム別対応 DRMおよび再生エンジンは次の通りです。

プラットフォーム DRM エンジン
Android TV Widevine(com.widevine.alpha) ExoPlayer
tvOS FairPlay(com.apple.fps) AVPlayer

方式1: ウェブ SDK対応 DRMキー

SDKがプラットフォームに応じて自動的に適切な DRMを選択します。Android TVは Widevine、tvOSは 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動画' },
        }],
    }}
    onBack={() => navigation.goBack()}
/>

方式2: react-native-videoによる直接 DRM形式

react-native-videoの DRM形式を直接使用することも可能です。

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

token プロパティで再生ソースに Secure Tokenを適用して OneTimeUrlをサポートします。再生中にトークンを更新することも可能です。

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()}
/>

// 再生中のトークンを更新
playerRef.current?.tokenChange('NEW_TOKEN_VALUE');