fix: revert drm type definition change (#3409)

And add drm content in android sample

Co-authored-by: olivier <olivier.bouillet@ifeelsmart.com>
This commit is contained in:
Olivier Bouillet 2023-12-08 11:58:00 +01:00 committed by GitHub
parent 908e30f9b8
commit fbb5654a8e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 24 additions and 4 deletions

View File

@ -32,6 +32,7 @@ import Video, {
VideoRef, VideoRef,
ResizeMode, ResizeMode,
SelectedTrack, SelectedTrack,
DRMType,
} from 'react-native-video'; } from 'react-native-video';
import ToggleControl from './ToggleControl'; import ToggleControl from './ToggleControl';
import MultiValueControl, { import MultiValueControl, {
@ -145,6 +146,24 @@ class VideoPlayer extends Component {
'https://pubads.g.doubleclick.net/gampad/ads?iu=/21775744923/external/vmap_ad_samples&sz=640x480&cust_params=sample_ar%3Dpremidpostoptimizedpodbumper&ciu_szs=300x250&gdfp_req=1&ad_rule=1&output=vmap&unviewed_position_start=1&env=vp&impl=s&cmsid=496&vid=short_onecue&correlator=', 'https://pubads.g.doubleclick.net/gampad/ads?iu=/21775744923/external/vmap_ad_samples&sz=640x480&cust_params=sample_ar%3Dpremidpostoptimizedpodbumper&ciu_szs=300x250&gdfp_req=1&ad_rule=1&output=vmap&unviewed_position_start=1&env=vp&impl=s&cmsid=496&vid=short_onecue&correlator=',
uri: 'http://d23dyxeqlo5psv.cloudfront.net/big_buck_bunny.mp4', uri: 'http://d23dyxeqlo5psv.cloudfront.net/big_buck_bunny.mp4',
}, },
{
description: 'WV: Secure SD & HD (cbcs,MP4,H264)',
uri: 'https://storage.googleapis.com/wvmedia/cbcs/h264/tears/tears_aes_cbcs.mpd',
drm: {
type: DRMType.WIDEVINE,
licenseServer:
'https://proxy.uat.widevine.com/proxy?provider=widevine_test',
},
},
{
description: 'Secure UHD (cenc)',
uri: 'https://storage.googleapis.com/wvmedia/cenc/h264/tears/tears_uhd.mpd',
drm: {
type: DRMType.WIDEVINE,
licenseServer:
'https://proxy.uat.widevine.com/proxy?provider=widevine_test',
},
},
]; ];
srcList = this.srcAllPlatformList.concat( srcList = this.srcAllPlatformList.concat(
@ -716,6 +735,7 @@ class VideoPlayer extends Component {
}} }}
source={this.srcList[this.state.srcListId]} source={this.srcList[this.state.srcListId]}
adTagUrl={this.srcList[this.state.srcListId]?.adTagUrl} adTagUrl={this.srcList[this.state.srcListId]?.adTagUrl}
drm={this.srcList[this.state.srcListId]?.drm}
style={viewStyle} style={viewStyle}
rate={this.state.rate} rate={this.state.rate}
paused={this.state.paused} paused={this.state.paused}

View File

@ -50,7 +50,7 @@ export type Filter =
| 'CIPhotoEffectTransfer' | 'CIPhotoEffectTransfer'
| 'CISepiaTone'; | 'CISepiaTone';
export type DrmType = 'widevine' | 'playready' | 'clearkey' | 'fairplay'; export type DRMType = 'widevine' | 'playready' | 'clearkey' | 'fairplay';
type DebugConfig = Readonly<{ type DebugConfig = Readonly<{
enable?: boolean; enable?: boolean;
@ -58,7 +58,7 @@ type DebugConfig = Readonly<{
}>; }>;
type Drm = Readonly<{ type Drm = Readonly<{
type?: DrmType; type?: DRMType;
licenseServer?: string; licenseServer?: string;
headers?: Headers; headers?: Headers;
contentId?: string; // ios contentId?: string; // ios

View File

@ -33,7 +33,7 @@ export type DebugConfig = Readonly<{
thread?: boolean; thread?: boolean;
}>; }>;
export enum DrmType { export enum DRMType {
WIDEVINE = 'widevine', WIDEVINE = 'widevine',
PLAYREADY = 'playready', PLAYREADY = 'playready',
CLEARKEY = 'clearkey', CLEARKEY = 'clearkey',
@ -41,7 +41,7 @@ export enum DrmType {
} }
export type Drm = Readonly<{ export type Drm = Readonly<{
type?: DrmType; type?: DRMType;
licenseServer?: string; licenseServer?: string;
headers?: Headers; headers?: Headers;
contentId?: string; // ios contentId?: string; // ios