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,
ResizeMode,
SelectedTrack,
DRMType,
} from 'react-native-video';
import ToggleControl from './ToggleControl';
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=',
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(
@ -716,6 +735,7 @@ class VideoPlayer extends Component {
}}
source={this.srcList[this.state.srcListId]}
adTagUrl={this.srcList[this.state.srcListId]?.adTagUrl}
drm={this.srcList[this.state.srcListId]?.drm}
style={viewStyle}
rate={this.state.rate}
paused={this.state.paused}

View File

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

View File

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