Bradmax player supports default integration DRM providers, which is quite common. Setting "provider": “default” in DRM config will be required.
Your web server has to generate Authentication XML for user, who need access to selected media. It will be used as “pass” for License server for obtaining license. With this license, player will be able to decode encrypted video.
For correct playback player needs:
You need to prepare drm configuration object and set it for each media source object . Each media source points to single HLS, MPEG-DASH, MSSmoothStreaming stream. drm object specification:
Field name | Type | Description |
---|---|---|
provider | string | Key defining provider. Should be “default”. |
playready | object | PlayReady configuration object. See keys below. |
playready.laUrl | string | URL address for PlayReady license server. |
playready.customData | string | Authentication XML encoded as base64 string. |
widevine | object | Widevine configuration object. See keys below. |
widevine.laUrl | string | URL address for Widevine license server. |
widevine.customData | string | Authentication XML encoded as base64 string. |
widevine.audioRobustness | string | Robustness level for DRM. Default: SW_SECURE_CRYPTO |
widevine.videoRobustness | string | Robustness level for DRM. Default: SW_SECURE_CRYPTO |
fairplay | object | FairPlay configuration object. See keys below. |
fairplay.laUrl | string | URL address for FairPlay license server. |
fairplay.certUrl | string | URL address for FairPlay license server certificate. |
fairplay.customData | string | Authentication XML encoded as base64 string. |
// DRM configuration.
var authenticationXmlBase64Encoded = "PEtleU9TQXV0aGVudGljYXRpb25YTUw+PERhdGE+PEdlbmVyYXRpb25UaW1lPjIwMTYtMTEtMTkgMDk6MzQ6MDEuOTkyPC9HZW5lcmF0aW9uVGltZT48RXhwaXJhdGlvblRpbWU+MjAyNi0xMS0xOSAwOTozNDowMS45OTI8L0V4cGlyYXRpb25UaW1lPjxVbmlxdWVJZD4wZmZmMTk3YWQzMzQ0ZTMyOWU0MTA0OTIwMmQ5M2VlYzwvVW5pcXVlSWQ+PFJTQVB1YktleUlkPjdlMTE0MDBjN2RjY2QyOWQwMTc0YzY3NDM5N2Q5OWRkPC9SU0FQdWJLZXlJZD48V2lkZXZpbmVQb2xpY3kgZmxfQ2FuUGxheT0idHJ1ZSIgZmxfQ2FuUGVyc2lzdD0iZmFsc2UiIC8+PFdpZGV2aW5lQ29udGVudEtleVNwZWMgVHJhY2tUeXBlPSJIRCI+PFNlY3VyaXR5TGV2ZWw+MTwvU2VjdXJpdHlMZXZlbD48L1dpZGV2aW5lQ29udGVudEtleVNwZWM+PEZhaXJQbGF5UG9saWN5IC8+PExpY2Vuc2UgdHlwZT0ic2ltcGxlIiAvPjwvRGF0YT48U2lnbmF0dXJlPk1sNnhkcU5xc1VNalNuMDdicU8wME15bHhVZUZpeERXSHB5WjhLWElBYlAwOE9nN3dnRUFvMTlYK1c3MDJOdytRdmEzNFR0eDQydTlDUlJPU1NnREQzZTM4aXE1RHREcW9HelcwS2w2a0JLTWxHejhZZGRZOWhNWmpPTGJkNFVkRnJUbmxxU21raC9CWnNjSFljSmdaUm5DcUZIbGI1Y0p0cDU1QjN4QmtxMUREZUEydnJUNEVVcVJiM3YyV1NueUhGeVZqWDhCR3o0ZWFwZmVFeDlxSitKbWI3dUt3VjNqVXN2Y0Fab1ozSHh4QzU3WTlySzRqdk9Wc1I0QUd6UDlCc3pYSXhKd1ZSZEk3RXRoMjhZNXVEQUVZVi9hZXRxdWZiSXIrNVZOaE9yQ2JIVjhrR2praDhHRE43dC9nYWh6OWhVeUdOaXRqY2NCekJvZHRnaXdSUT09PC9TaWduYXR1cmU+PC9LZXlPU0F1dGhlbnRpY2F0aW9uWE1MPg==";
var drmConfig = {
"provider": "default",
"playready": {
"laUrl": "https://drm-playready.example.com/rightsmanager.asmx",
"customData": authenticationXmlBase64Encoded
},
"widevine": {
"laUrl": "https://drm-widevine.example.com/getkey",
"customData": authenticationXmlBase64Encoded
},
"fairplay": {
"laUrl": "https://drm-fairplay.example.com/getkey",
"customData": authenticationXmlBase64Encoded,
"certUrl": "https://drm-fairplay.example.com/cert/server-cert.der"
}
};
// Setting DRM configuration into player dataProvider object.
var options = {
"dataProvider": {
"source": [
{
"url": "https://cdn.example.com/g180-avc_a2.0-vbr-aac-128k/r30/dash-wv-pr/stream.mpd",
"drm": drmConfig
},
{
"url": "https://cdn.example.com/g180-avc_a2.0-vbr-aac-128k/r30/hls-fp/master.m3u8",
"drm": drmConfig
}
],
"duration": 718,
"title": "DRM Demo",
"splashImages": [
{
"url": "https://example.com/startsplash.jpg"
}
]
}
};
var element = document.getElementById("player");
window.bradmax.player.create(element, options);