如何在React Native中实现DRM?

时间:2019-07-20 10:58:14

标签: reactjs react-native video drm

我正在使用此react-native-video this分支版本的原始react-native-video,因为它支持DRM。我也检查了他们的DRM doc。但是无法取得任何成功。 这是我尝试实现DRM的示例。但是不能播放视频。 它没有显示任何错误或警告。

<?php
// First ensure that you are on an Even page
$mpdf->AddPage('','E');

// Then set the headers for the next page before you add the page
$mpdf->SetHTMLHeader('
<div style="text-align: right; border-bottom: 1px solid #000000; font-weight: bold; font-size: 10pt;">
    Chapter 2
</div>','O');
$mpdf->SetHTMLHeader('
<div style="border-bottom: 1px solid #000000; font-weight: bold; font-size: 10pt;">
    Chapter 2
</div>','E');

$mpdf->AddPage();

$mpdf->SetHTMLFooter('
<div style="text-align: right; font-weight: bold; font-size: 8pt; font-style: italic;">
    Chapter 2
</div>','O');
$mpdf->SetHTMLFooter('
<div style="font-weight: bold; font-size: 8pt; font-style: italic;">
    Chapter 2
</div>','E');

$mpdf->WriteHTML('Rest of the document');

$mpdf->Output();

1 个答案:

答案 0 :(得分:1)

尝试

<Video
source={{
    uri: 'https://media.axprod.net/TestVectors/v7-MultiDRM-SingleKey/Manifest_1080p.mpd',
    drm: {
        type: 'widevine',
        licenseServer: 'https://drm-widevine-licensing.axtest.net/AcquireLicense',
        headers: {
            'X-AxDRM-Message': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ2ZXJzaW9uIjoxLCJjb21fa2V5X2lkIjoiYjMzNjRlYjUtNTFmNi00YWUzLThjOTgtMzNjZWQ1ZTMxYzc4IiwibWVzc2FnZSI6eyJ0eXBlIjoiZW50aXRsZW1lbnRfbWVzc2FnZSIsImZpcnN0X3BsYXlfZXhwaXJhdGlvbiI6NjAsInBsYXlyZWFkeSI6eyJyZWFsX3RpbWVfZXhwaXJhdGlvbiI6dHJ1ZX0sImtleXMiOlt7ImlkIjoiOWViNDA1MGQtZTQ0Yi00ODAyLTkzMmUtMjdkNzUwODNlMjY2IiwiZW5jcnlwdGVkX2tleSI6ImxLM09qSExZVzI0Y3Iya3RSNzRmbnc9PSJ9XX19.FAbIiPxX8BHi9RwfzD7Yn-wugU19ghrkBFKsaCPrZmU'
        },
    }
}}
 style={styles.backgroundVideo}
/>