# Google Widevine
Note
This feature is available only to ByteArk Video Cloud for Business customers. Please contact sales@byteark.com if you would like to use it.
ByteArk Player SDK for Flutter supports playback of content protected with Google Widevine (opens new window) on Android. The Flutter SDK passes the DRM configuration through to Android's ExoPlayer to handle licensing and decryption.
# Usage
Configure WidevineDrm via ByteArkDrm on ByteArkPlayerItem:
final playerItem = ByteArkPlayerItem(
url: "<MEDIA_URL>",
drm: ByteArkDrm(
widevineDrm: WidevineDrm(
licenseUrl: "<WIDEVINE_LICENSE_URL>",
),
),
);
1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
| Property | Type | Required | Description |
|---|---|---|---|
licenseUrl | String? | Yes | Widevine license server URL |
licenseRequestHeaders | Map<String, String>? | No | Custom headers for the license request |
# Send custom headers
final playerItem = ByteArkPlayerItem(
url: "<MEDIA_URL>",
drm: ByteArkDrm(
widevineDrm: WidevineDrm(
licenseUrl: "<WIDEVINE_LICENSE_URL>",
licenseRequestHeaders: {
"Authorization": "Bearer <YOUR_TOKEN>",
},
),
),
);
1
2
3
4
5
6
7
8
9
10
11
2
3
4
5
6
7
8
9
10
11
# Enable Secure Surface
To prevent screen capture while playing DRM-protected content, enable Secure Surface via ByteArkPlayerConfig:
final config = ByteArkPlayerConfig(
licenseKey: licenseKey,
playerItem: playerItem,
secureSurface: true,
);
1
2
3
4
5
2
3
4
5
Caution
- DRM must use HTTPS.
- Some Android devices that lack hardware-backed Widevine may not be able to play content with high robustness settings.