chore: update DRM example (#4259)

This commit is contained in:
Krzysztof Moch
2024-10-26 14:55:11 +02:00
committed by GitHub
parent 3b4bfd3936
commit f850b7a71c
2 changed files with 18 additions and 13 deletions

View File

@@ -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`
<PlatformsList types={['iOS']} />
<PlatformsList types={['iOS', 'visionOS']} />
Type: bool\
Default: false
@@ -22,7 +27,7 @@ Whether or not the certificate url returns it on base64.
### `certificateUrl`
<PlatformsList types={['iOS']} />
<PlatformsList types={['iOS', 'visionOS']} />
Type: string\
Default: undefined
@@ -31,7 +36,7 @@ URL to fetch a valid certificate for FairPlay.
### `getLicense`
<PlatformsList types={['iOS']} />
<PlatformsList types={['iOS', 'visionOS']} />
Type: function\
Default: undefined
@@ -79,7 +84,7 @@ getLicense: (spcString, contentId, licenseUrl, loadedLicenseUrl) => {
### `contentId`
<PlatformsList types={['iOS']} />
<PlatformsList types={['iOS', 'visionOS']} />
Type: string\
Default: undefined
@@ -88,7 +93,7 @@ Specify the content id of the stream, otherwise it will take the host value from
### `headers`
<PlatformsList types={['Android', 'iOS']} />
<PlatformsList types={['Android', 'iOS', 'visionOS']} />
Type: Object\
Default: undefined
@@ -112,7 +117,7 @@ drm={{
### `licenseServer`
<PlatformsList types={['Android', 'iOS']} />
<PlatformsList types={['Android', 'iOS', 'visionOS']} />
Type: string\
Default: false
@@ -139,7 +144,7 @@ for iOS: DRMType.FAIRPLAY
### `localSourceEncryptionKeyScheme`
<PlatformsList types={['iOS']} />
<PlatformsList types={['iOS', 'visionOS']} />
Set the url scheme for stream encryption key for local assets