From f850b7a71cada89386b53df6e51e6147b7ba0a1d Mon Sep 17 00:00:00 2001 From: Krzysztof Moch Date: Sat, 26 Oct 2024 14:55:11 +0200 Subject: [PATCH] chore: update DRM example (#4259) --- docs/pages/component/drm.mdx | 21 +++++++++++++-------- examples/bare/src/DRMExample.tsx | 10 +++++----- 2 files changed, 18 insertions(+), 13 deletions(-) diff --git a/docs/pages/component/drm.mdx b/docs/pages/component/drm.mdx index da9074d5ea..4dd1ab73aa 100644 --- a/docs/pages/component/drm.mdx +++ b/docs/pages/component/drm.mdx @@ -2,18 +2,23 @@ import PlatformsList from '../../components/PlatformsList/PlatformsList.tsx'; # DRM -> **Note:** DRM is not supported on visionOS yet. +## DRM Example + +We have avaliable example for DRM usage in the [example app](https://github.com/TheWidlarzGroup/react-native-video/blob/master/examples/bare/src/DRMExample.tsx). +To get token needed for DRM playback you can go to [our site]() and get it. ## Provide DRM data (only tested with http/https assets) You can provide some configuration to allow DRM playback. This feature will disable the use of `TextureView` on Android. +```jsx + DRM object allows this members: ### `base64Certificate` - + Type: bool\ Default: false @@ -22,7 +27,7 @@ Whether or not the certificate url returns it on base64. ### `certificateUrl` - + Type: string\ Default: undefined @@ -31,7 +36,7 @@ URL to fetch a valid certificate for FairPlay. ### `getLicense` - + Type: function\ Default: undefined @@ -79,7 +84,7 @@ getLicense: (spcString, contentId, licenseUrl, loadedLicenseUrl) => { ### `contentId` - + Type: string\ Default: undefined @@ -88,7 +93,7 @@ Specify the content id of the stream, otherwise it will take the host value from ### `headers` - + Type: Object\ Default: undefined @@ -112,7 +117,7 @@ drm={{ ### `licenseServer` - + Type: string\ Default: false @@ -139,7 +144,7 @@ for iOS: DRMType.FAIRPLAY ### `localSourceEncryptionKeyScheme` - + Set the url scheme for stream encryption key for local assets diff --git a/examples/bare/src/DRMExample.tsx b/examples/bare/src/DRMExample.tsx index 24db938572..fe26059210 100644 --- a/examples/bare/src/DRMExample.tsx +++ b/examples/bare/src/DRMExample.tsx @@ -20,19 +20,19 @@ const DRMExample = () => { const [source, setSource] = React.useState(null); const [hls, setHls] = React.useState( - 'https://d5lhbv70lxyop.cloudfront.net/02b91d1c-dcde-4a93-8391-8524f7836a72/assets/5a116d5e-4acb-4461-8bc0-81adf45a8432/videokit-576p-dash-hls-drm/hls/index.m3u8', + 'https://d2e67eijd6imrw.cloudfront.net/559c7a7e-960d-4cd8-9dba-bc4e59890177/assets/47cfca69-91b5-4311-bf6c-b9b1f297ed9b/videokit-720p-dash-hls-drm/hls/index.m3u8', ); const [fairplayLicense, setFairplayLicense] = React.useState( - 'https://videokit-demo-7dr2zvpf.la.drm.cloud/acquire-license/fairplay?BrandGuid=02b91d1c-dcde-4a93-8391-8524f7836a72', + 'https://thewidlarzgroup.la.drm.cloud/acquire-license/fairplay?brandGuid=559c7a7e-960d-4cd8-9dba-bc4e59890177', ); const [fairplayCertificate, setFairplayCertificate] = React.useState( - 'https://videokit-demo-7dr2zvpf.la.drm.cloud/certificate/fairplay?BrandGuid=02b91d1c-dcde-4a93-8391-8524f7836a72', + 'https://thewidlarzgroup.la.drm.cloud/certificate/fairplay?brandGuid=559c7a7e-960d-4cd8-9dba-bc4e59890177', ); const [dash, setDash] = React.useState( - 'https://d5lhbv70lxyop.cloudfront.net/02b91d1c-dcde-4a93-8391-8524f7836a72/assets/5a116d5e-4acb-4461-8bc0-81adf45a8432/videokit-576p-dash-hls-drm/dash/index.mpd', + 'https://d2e67eijd6imrw.cloudfront.net/559c7a7e-960d-4cd8-9dba-bc4e59890177/assets/47cfca69-91b5-4311-bf6c-b9b1f297ed9b/videokit-720p-dash-hls-drm/dash/index.mpd', ); const [widevineLicense, setWidevineLicense] = React.useState( - 'https://videokit-demo-7dr2zvpf.la.drm.cloud/acquire-license/widevine?BrandGuid=02b91d1c-dcde-4a93-8391-8524f7836a72', + 'https://thewidlarzgroup.la.drm.cloud/acquire-license/widevine?brandGuid=559c7a7e-960d-4cd8-9dba-bc4e59890177', ); // ------------- DMR Token -------------