Radiant Media Player

MPEG-DASH DRM



Last updated on January 4, 2017.

MPEG-DASH DRM documentation sections:


Supported MPEG-DASH DRM

HTML5

Starting with Radiant Media Player 3.2 we provide support for the following DRM with MPEG-DASH streaming:

Our DRM implementation relies on Encrypted Media Extensions (EME) support in the browser. Complementary to EME support a browser must have a compatible Content Decryption Module (CDM) to decrypt the DRM content.

You an use either one DRM or a combination of multiple DRM for wider browser support. The player will automatically pick the correct DRM for the targeted browser where supported. When multi-DRM are present the player will test support first for Widevine, then PlayReady and eventually Clear Key.


Supported browsers for MPEG-DASH DRM

The following information are valid as of November 2016:

Desktop/portable browsers:

  • Widevine: Chrome 34+, Opera 31+, Firefox 47+
  • Playready: IE11 on Windows 8+, MS Edge
  • Clear Key: latest Chrome and Firefox

Mobile browsers:

  • Widevine: Chrome 34+ for Android 5+
  • Playready: MS Edge for Windows 10+ mobile

Support for playback of DRM content with MPEG-DASH on mobile devices may vary based on device specification and OS/browser versions.

On iOS MPEG-DASH is not supported. We recommend using HLSe (AES-128 encrypted HLS) for mobile devices.

You can use MPEG-DASH with DRM content on Chrome for Android 5+. This is an opt-in option that is enabled with dashAndroid setting set to true. This is provided as an experimental feature. Alternatively use HLSe on Android.

In order to provide decent browser coverage you are most likely going to have to use a multi-DRM approach. Combining Widevine and Playready is the current standard in the industry for MPEG-DASH DRM.


Player configuration


General consideration

You need to the player with valid MPEG-DASH manifest. This manifest should contain the necessary information for the player to obtain the required DRM license information in order to decrypt the content.

Optionally you can pass custom protection data to the player:

dashProtectionData: Object

The information contained in the dashProtectionData object are specific to each DRM technology. Default: {}. See below for examples specific to each supported DRM (Widevine, PlayReady, W3C ClearKey).

Other DRM-related player settings

dashDrmCheck: Boolean

When set to true the player will operate a prelimary check to detect EME/CDM support when both Widevine and Playready DRM are provided. Because this add some extra processing to the player this setting must be opt in. Default: false. Note that this setting is only compatible when MPEG-DASH content with both Widevine and Playready DRM are available. If you have Clear Key DRM or Widevine only DRM for example you must build your own detection logic as explained below.
When no drm support is available the player will fire the nodrmsupport event through our player API. If no AES-128 encrypted HLS stream is provided a no-support error message will be displayed (set with player labels error.noSupportMessage).

dashDrmUseAesHlsFallback: Boolean

When set to true the player will use a fallback AES-128 encrypted HLS stream. This HLS stream is provided through the player setting bitrates object. Default: false. This setting only applies when dashDrmCheck is set to true. This setting causes the dashFirst player parameter to be set to true.
Note that HLS with AES-128 encrypted content may not satisfy all use-cases as some content provider or right owners may require a technology with more a advanced level of security. Make sure to check AES-128 HLS meets your project requirement before using this option.


Player code example

The below examples use 3rd-party DRM services and streaming URLs. They may not always be available for testing. We recommend using your own streaming URLs and DRM service for better testing Radiant Media Player DRM support. Our free 14-day trial is available here.

Cenc Playready/Widevine (Axinom)
<!-- Include Radiant Media Player JavaScript file in your <body> or <head> -->
<script src="https://cdn.radiantmediatechs.com/rmp/v3/latest/js/rmp.min.js"></script>
<!-- Set up your wrapper div with its unique id -->
<div id="rmpPlayer"></div>
<!-- Set up player configuration options -->
<script>
// First we specify bitrates to feed to the player
var bitrates = {
  dash: 'http://media.axprod.net/TestVectors/v6-MultiDRM/Manifest_1080p.mpd'
};
// Then our MPEG-DASH custom protection data
var protectionData = {
  "com.widevine.alpha": {
    "serverURL": "http://drm-widevine-licensing.axtest.net/AcquireLicense",
    "httpRequestHeaders": {
      "X-AxDRM-Message": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ2ZXJzaW9uIjoxLCJjb21fa2V5X2lkIjoiNjllNTQwODgtZTllMC00NTMwLThjMWEtMWViNmRjZDBkMTRlIiwibWVzc2FnZSI6eyJ0eXBlIjoiZW50aXRsZW1lbnRfbWVzc2FnZSIsImtleXMiOlt7ImlkIjoiNmU1YTFkMjYtMjc1Ny00N2Q3LTgwNDYtZWFhNWQxZDM0YjVhIn1dfX0.yF7PflOPv9qHnu3ZWJNZ12jgkqTabmwXbDWk_47tLNE"
    }
  },
  "com.microsoft.playready": {
    "serverURL": "http://drm-playready-licensing.axtest.net/AcquireLicense",
    "httpRequestHeaders": {
      "X-AxDRM-Message": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ2ZXJzaW9uIjoxLCJjb21fa2V5X2lkIjoiNjllNTQwODgtZTllMC00NTMwLThjMWEtMWViNmRjZDBkMTRlIiwibWVzc2FnZSI6eyJ0eXBlIjoiZW50aXRsZW1lbnRfbWVzc2FnZSIsImtleXMiOlt7ImlkIjoiNmU1YTFkMjYtMjc1Ny00N2Q3LTgwNDYtZWFhNWQxZDM0YjVhIn1dfX0.yF7PflOPv9qHnu3ZWJNZ12jgkqTabmwXbDWk_47tLNE"
    }
  }
};
// Then we set our player settings
var settings = {
  licenseKey: 'your-license-key',
  bitrates: bitrates,  
  delayToFade: 3000,
  width: 640,
  height: 360,
  dashProtectionData: protectionData,
  debug: true,
  streamDebug: true,
  skin: 's1',
  poster: 'https://www.radiantmediaplayer.com/images/poster-rmp-showcase.jpg'
};
// Reference to the wrapper div (unique id)
var elementID = 'rmpPlayer';
// Create an object based on RadiantMP constructor
var rmp = new RadiantMP(elementID);
// Initialization ... test your page and done!
rmp.init(settings);
</script>

The above example shows a sample with the Axinom DRM encryption service but this is just an example - you can use any standard compliant DRM encryption service. An example for the above player code can be found here.

Cenc Playready/Widevine with AES-128 HLS fallback
<!-- Include Radiant Media Player JavaScript file in your <body> or <head> -->
<script src="https://cdn.radiantmediatechs.com/rmp/v3/latest/js/rmp.min.js"></script>
<!-- Set up your wrapper div with its unique id -->
<div id="rmpPlayer"></div>
<!-- Set up player configuration options -->
<script>
// First we specify bitrates to feed to the player
var bitrates = {
  dash: 'http://media.axprod.net/TestVectors/v6-MultiDRM/Manifest_1080p.mpd',
  hls: 'https://rmpsite-1479.kxcdn.com/media/rmp-segment/bbb-abr-aes/playlist.m3u8'
};
// Then our MPEG-DASH custom protection data
var protectionData = {
  "com.widevine.alpha": {
    "serverURL": "http://drm-widevine-licensing.axtest.net/AcquireLicense",
    "httpRequestHeaders": {
      "X-AxDRM-Message": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ2ZXJzaW9uIjoxLCJjb21fa2V5X2lkIjoiNjllNTQwODgtZTllMC00NTMwLThjMWEtMWViNmRjZDBkMTRlIiwibWVzc2FnZSI6eyJ0eXBlIjoiZW50aXRsZW1lbnRfbWVzc2FnZSIsImtleXMiOlt7ImlkIjoiNmU1YTFkMjYtMjc1Ny00N2Q3LTgwNDYtZWFhNWQxZDM0YjVhIn1dfX0.yF7PflOPv9qHnu3ZWJNZ12jgkqTabmwXbDWk_47tLNE"
    }
  },
  "com.microsoft.playready": {
    "serverURL": "http://drm-playready-licensing.axtest.net/AcquireLicense",
    "httpRequestHeaders": {
      "X-AxDRM-Message": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ2ZXJzaW9uIjoxLCJjb21fa2V5X2lkIjoiNjllNTQwODgtZTllMC00NTMwLThjMWEtMWViNmRjZDBkMTRlIiwibWVzc2FnZSI6eyJ0eXBlIjoiZW50aXRsZW1lbnRfbWVzc2FnZSIsImtleXMiOlt7ImlkIjoiNmU1YTFkMjYtMjc1Ny00N2Q3LTgwNDYtZWFhNWQxZDM0YjVhIn1dfX0.yF7PflOPv9qHnu3ZWJNZ12jgkqTabmwXbDWk_47tLNE"
    }
  }
};
// Then we set our player settings
var settings = {
  licenseKey: 'your-license-key',
  bitrates: bitrates,  
  delayToFade: 3000,
  width: 640,
  height: 360,
  dashProtectionData: protectionData,
  dashDrmCheck: true,
  dashDrmUseAesHlsFallback: true,
  debug: true,
  streamDebug: true,
  skin: 's3',
  poster: 'https://www.radiantmediaplayer.com/images/poster-rmp-showcase.jpg'
};
// Reference to the wrapper div (unique id)
var elementID = 'rmpPlayer';
// Create an object based on RadiantMP constructor
var rmp = new RadiantMP(elementID);
// Example for catching the nodrmsupport event
var rmpContainer = document.getElementById(elementID);
rmpContainer.addEventListener('nodrmsupport', function() {
  console.log('nodrmsupport');
});
// Initialization ... test your page and done!
rmp.init(settings);
</script>

W3C ClearKey DRM example

Custom protectionData:

var protectionData = {
  "org.w3.clearkey": {
    "clearkeys": {
      "H3JbV93QV3mPNBKQON2UtQ": "ClKhDPHMtCouEx1vLGsJsA"
    }
  }
}

ExpressPlay multi-drm example (using ExpressPlay tokens) - Cenc Playready/Widevine

ExpressPlay is a Radiant Media Player technology alliance partner.

Custom protectionData:

var protectionData = {
  "com.widevine.alpha": {
    "serverURL": "https://wv.test.expressplay.com/hms/wv/rights/?ExpressPlayToken=AQAAAw3paXgAAABQspzLNQNh4hZbd8PGRZI0HqY47W8g4G8-y_3XjUuYCQkbT1RCyHha0YJmqoed_HxdPaqOgETYKRhqV-bbQc61IlNRjmC3YKA-XWQbM0fdeMyXIt44CeXileOMh6ngDkjwJWpIWw"
  },
  "com.microsoft.playready": {
    "serverURL": "https://pr.test.expressplay.com/playready/RightsManager.asmx?ExpressPlayToken=AQAAAw3pWtgAAABgs-tivO_PM27AQvSjxG2CiJrtQ1MFfcIGvu2VYvd0ZSVJ7tE_48I2GJYNZLd8hwWTxwW1t3as0lkV3Ac-4fKwe3GZLe2eNpvHoRnjbej52rrFlKDbnoGthCD8PkR75tguGxBMMuxICQcUmBD52QzrL8xIuOw"
  }
};

DRMtoday multi-drm example - Cenc Playready/Widevine

Custom protectionData:

var protectionData = {
  "com.widevine.alpha": {
    "drmtoday": true,
    "serverURL": "https://lic.staging.drmtoday.com/license-proxy-widevine/cenc/",
    "httpRequestHeaders": {
      "dt-custom-data": "eyJ1c2VySWQiOiIxMjM0NSIsInNlc3Npb25JZCI6ImV3b2dJQ0p3Y205bWFXeGxJaUE2SUhzS0lDQWdJQ0p3ZFhKamFHRnpaU0lnT2lCN0lIMEtJQ0I5TEFvZ0lDSnZkWFJ3ZFhSUWNtOTBaV04wYVc5dUlpQTZJSHNLSUNBZ0lDSmthV2RwZEdGc0lpQTZJR1poYkhObExBb2dJQ0FnSW1GdVlXeHZaM1ZsSWlBNklHWmhiSE5sTEFvZ0lDQWdJbVZ1Wm05eVkyVWlJRG9nWm1Gc2MyVUtJQ0I5TEFvZ0lDSnpkRzl5WlV4cFkyVnVjMlVpSURvZ1ptRnNjMlVLZlFvSyIsIm1lcmNoYW50IjoiY2FibGVsYWJzIn0K"
    }
  },
  "com.microsoft.playready": {
    "drmtoday": true,
    "serverURL": "https://lic.staging.drmtoday.com/license-proxy-headerauth/drmtoday/RightsManager.asmx",
    "httpRequestHeaders": {
      "http-header-CustomData": "eyJ1c2VySWQiOiIxMjM0NSIsInNlc3Npb25JZCI6ImV3b2dJQ0p3Y205bWFXeGxJaUE2SUhzS0lDQWdJQ0p3ZFhKamFHRnpaU0lnT2lCN0lIMEtJQ0I5TEFvZ0lDSnZkWFJ3ZFhSUWNtOTBaV04wYVc5dUlpQTZJSHNLSUNBZ0lDSmthV2RwZEdGc0lpQTZJR1poYkhObExBb2dJQ0FnSW1GdVlXeHZaM1ZsSWlBNklHWmhiSE5sTEFvZ0lDQWdJbVZ1Wm05eVkyVWlJRG9nWm1Gc2MyVUtJQ0I5TEFvZ0lDSnpkRzl5WlV4cFkyVnVjMlVpSURvZ1ptRnNjMlVLZlFvSyIsIm1lcmNoYW50IjoiY2FibGVsYWJzIn0K"
    }
  }
}

The above example shows a sample protectionData object with the DRMtoday encryption service (in which case you must add a "drmtoday": true parameter to your dashProtectionData object).


Full DRM (MPEG-DASH, Flash, AES-HLS)

Where MPEG-DASH DRM (Widevine/Playready) combined with AES-128 HLS is not enough it is possible to use Flash DRM (Adobe Access/Primetime DRM) with Radiant Media Player Flash fallback. Refer to our Flash DRM documentation for more information.


Detecting CDM support within a browser

The player automatically processes DRM information and attempts to play/decrypt a MPEG-DASH stream. Additionally you can use the dashDrmCheck setting to detect if the DRM couple Widevine/Playready is supported.

If you have a specific set up (like Widevine only or Widevine/ClearKey) that you want to support you can implement your own detection logic to check for in-browser DRM support. Read our blog post on detecting EME/CDM support in the browser for guidelines on how to implement such a fallback mechanism. Note that when building a custom fallback mechanism the check for EME/CDM support must be done before the player is loaded on your page.


Advanced use cases

We provide a ready-to-use solution for MPEG-DASH DRM. All DRM interactions are built-in the player and automatically handled. The following information are provided for users who want to set up advanced DRM use cases and have an advanced knowledge of JavaScript and dash.js. As of October 2016 Radiant Media Player is based on dash.js 2.3.0.

As such we expose methods, properties and events based on the dash.js API. Refer to this documentation link for a list of methods, events and properties supported by dash.js.

The dash.js player instance is exposed as rmp.dashPlayer with Radiant Media Player. The dash.js instance is only available after the dashjsinstancecreated event has fired.

Example:

<script src="https://cdn.radiantmediatechs.com/rmp/v3/latest/js/rmp.min.js"></script>
<div id="rmpPlayer"></div>
<script>
var bitrates = {
  dash: 'http://media.axprod.net/TestVectors/v6-MultiDRM/Manifest_1080p.mpd'
};
var protectionData = {
  "com.widevine.alpha": {
    "serverURL": "http://drm-widevine-licensing.axtest.net/AcquireLicense",
    "httpRequestHeaders": {
      "X-AxDRM-Message": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ2ZXJzaW9uIjoxLCJjb21fa2V5X2lkIjoiNjllNTQwODgtZTllMC00NTMwLThjMWEtMWViNmRjZDBkMTRlIiwibWVzc2FnZSI6eyJ0eXBlIjoiZW50aXRsZW1lbnRfbWVzc2FnZSIsImtleXMiOlt7ImlkIjoiNmU1YTFkMjYtMjc1Ny00N2Q3LTgwNDYtZWFhNWQxZDM0YjVhIn1dfX0.yF7PflOPv9qHnu3ZWJNZ12jgkqTabmwXbDWk_47tLNE"
    }
  },
  "com.microsoft.playready": {
    "serverURL": "http://drm-playready-licensing.axtest.net/AcquireLicense",
    "httpRequestHeaders": {
      "X-AxDRM-Message": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ2ZXJzaW9uIjoxLCJjb21fa2V5X2lkIjoiNjllNTQwODgtZTllMC00NTMwLThjMWEtMWViNmRjZDBkMTRlIiwibWVzc2FnZSI6eyJ0eXBlIjoiZW50aXRsZW1lbnRfbWVzc2FnZSIsImtleXMiOlt7ImlkIjoiNmU1YTFkMjYtMjc1Ny00N2Q3LTgwNDYtZWFhNWQxZDM0YjVhIn1dfX0.yF7PflOPv9qHnu3ZWJNZ12jgkqTabmwXbDWk_47tLNE"
    }
  }
};
var settings = {
  licenseKey: 'your-license-key',
  bitrates: bitrates,  
  delayToFade: 3000,
  width: 640,
  height: 360,
  dashProtectionData: protectionData,
  debug: true,
  streamDebug: true,
  skin: 's3',
  poster: 'https://www.radiantmediaplayer.com/images/poster-rmp-showcase.jpg'
};
var elementID = 'rmpPlayer';
var rmp = new RadiantMP(elementID);
var rmpContainer = document.getElementById(elementID);
rmpContainer.addEventListener('dashjsinstancecreated', function() {
  console.log('dashjsinstancecreated');
  console.log(rmp.dashPlayer);
  rmp.dashPlayer.on('manifestloaded', function() {
    console.log(rmp.dashPlayer.getProtectionController());
    console.log('manifestloaded');
  });
  rmp.dashPlayer.on('streaminitialized', function() {
    console.log('streaminitialized');
    console.log(rmp.dashPlayer.getSource());
  });
  rmp.dashPlayer.on('public_licenseRequestComplete', function() {
    console.log('public_licenseRequestComplete');
  });
  rmp.dashPlayer.on('playbackTimeUpdated', function() {
    console.log('playbackTimeUpdated');
  });
});
rmp.init(settings);
</script>

Supported DRM service providers

Radiant Media Player should work with any standard compliant DRM service providers that can encrypted media content with Widevine and/or PlayReady DRM. Below are some example of services that we have tested and that our customers have successfully used with Radiant Media Player:

Based on the solution your DRM service provider offer you may also need a solution to package your content for MPEG-DASH. Wowza Streaming Engine supports on-the-fly MPEG-DASH CENC encryption for on demand and live content via the PlayReady and Widevine DRM systems.