[object Object] Icon

Encoding
Learn how to create, start, manage and modify Encodings

[object Object] Icon

Player
Learn how to create, start, manage and modify Players

[object Object] Icon

Analytics
Learn how to create, start, manage and modify Analyticss

How to play DRM protected content with EZDRM

OverviewLink Icon

Nearly every license provider, such as Irdeto or EZDRM, requires a few special information being sent to the DRM license server, or responds with a proprietary format. Instead of integrating a few license providers into the core of our player, we decided to provide necessary configuration options via the player configuration.


WidevineLink Icon

1var conf = {
2 ...
3 source: {
4 dash: 'DASH_MANIFEST_URL',
5 drm: {
6 widevine: {
7 LA_URL: 'http://widevine-dash.ezdrm.com/proxy?pX=EZDRM_ACCOUNT_ID'
8 }
9 }
10 }
11};

Please replace the following placeholders in the code:

  • DASH_MANIFEST_URL: The URL to the DASH manifest (MPD) file.
  • EZDRM_ACCOUNT_ID: Your EZDRM account ID. If your setup requires the sending of customData to the license server, this can be added to the license server URL as well:
1var conf = {
2 ...
3 source: {
4 dash: 'DASH_MANIFEST_URL',
5 drm: {
6 widevine: {
7 LA_URL: 'http://widevine-dash.ezdrm.com/proxy?pX=EZDRM_ACCOUNT_ID&CustomData=BASE64_ENCODED_CUSTOM_DATA'
8 }
9 }
10 }
11};

Please replace the following placeholders in the code:

  • DASH_MANIFEST_URL: The URL to the DASH manifest (MPD) file.
  • EZDRM_ACCOUNT_ID: Your EZDRM account ID.
  • BASE64_ENCODED_CUSTOM_DATA: EZDRM customData to send along with the license request.

PlayReadyLink Icon

1var conf = {
2 ...
3 source: {
4 dash: 'DASH_MANIFEST_URL',
5 drm: {
6 playready: {
7 LA_URL: 'http://playready.ezdrm.com/cency/preauth.aspx?pX=EZDRM_ACCOUNT_ID'
8 }
9 }
10 }
11};

Please replace the following placeholders in the code:

  • DASH_MANIFEST_URL: The URL to the DASH manifest (MPD) file.
  • EZDRM_ACCOUNT_ID: Your EZDRM account ID. If your setup requires the sending of customData to the license server, this can be added to the license server URL as well:
1var conf = {
2 ...
3 source: {
4 dash: 'DASH_MANIFEST_URL',
5 drm: {
6 playready: {
7 LA_URL: 'http://playready.ezdrm.com/cency/preauth.aspx?pX=EZDRM_ACCOUNT_ID&t=BASE64_ENCODED_CUSTOM_DATA'
8 }
9 }
10 }
11};

Please replace the following placeholders in the code:

  • DASH_MANIFEST_URL: The URL to the DASH manifest (MPD) file.
  • EZDRM_ACCOUNT_ID: Your EZDRM account ID.
  • BASE64_ENCODED_CUSTOM_DATA: EZDRM customData to send along with the license request.

FairPlayLink Icon

1var conf = {
2 ...
3 source: {
4 hls: 'HLS_MANIFEST_URL',
5 drm: {
6 fairplay: {
7 LA_URL: 'http://fps.ezdrm.com/api/licenses/CONTENT_ID',
8 certificateURL: 'CERTIFICATE_URL',
9 prepareContentId: function(contentId) {
10 var uri = contentId;
11 var uriParts = uri.split('://', 1);
12 var protocol = uriParts[0].slice(-3);
13 uriParts = uri.split(';', 2);
14 contentId = uriParts.length > 1 ? uriParts[1] : '';
15 uriParts = contentId.split('?', 2);
16 contentId = uriParts.length > 1 ? uriParts[0] : contentId;
17 return protocol.toLowerCase() == 'skd' ? contentId : '';
18 },
19 prepareLicenseAsync: function(ckc) {
20 return new Promise(function(resolve, reject) {
21 var reader = new FileReader();
22 reader.addEventListener('loadend', function() {
23 resolve(new Uint8Array(reader.result));
24 });
25 reader.addEventListener('error', function() {
26 reject(reader.error);
27 });
28 reader.readAsArrayBuffer(ckc);
29 });
30 },
31 prepareMessage: function(event, session) {
32 return new Blob([event.message], {type: 'application/octet-binary'});
33 },
34 headers: [{
35 name: 'content-type',
36 value: 'application/octet-stream'
37 }],
38 useUint16InitData: true,
39 licenseResponseType: 'blob'
40 }
41 }
42 }
43};

Please replace the following placeholders in the code:

  • HLS_MANIFEST_URL: The URL to the HLS manifest (M3U8) file.
  • CONTENT_ID: The content ID for the given asset, which should be in the format xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.
  • CERTIFICATE_URL: The URL to the Fairplay certificate. This needs to be accessible for the player.

Complete example for Widevine, PlayReady and FairPlayLink Icon

1var conf = {
2 ...
3 source: {
4 dash: 'DASH_MANIFEST_URL',
5 hls: 'HLS_MANIFEST_URL',
6 drm: {
7 widevine: {
8 LA_URL: 'http://widevine-dash.ezdrm.com/proxy?pX=EZDRM_ACCOUNT_ID'
9 },
10 playready: {
11 LA_URL: 'http://playready.ezdrm.com/cency/preauth.aspx?pX=EZDRM_ACCOUNT_ID'
12 },
13 fairplay: {
14 LA_URL: 'http://fps.ezdrm.com/api/licenses/CONTENT_ID',
15 certificateURL: 'CERTIFICATE_URL',
16 prepareContentId: function(contentId) {
17 var uri = contentId;
18 var uriParts = uri.split('://', 1);
19 var protocol = uriParts[0].slice(-3);
20 uriParts = uri.split(';', 2);
21 contentId = uriParts.length > 1 ? uriParts[1] : '';
22 uriParts = contentId.split('?', 2);
23 contentId = uriParts.length > 1 ? uriParts[0] : contentId;
24 return protocol.toLowerCase() == 'skd' ? contentId : '';
25 },
26 prepareLicenseAsync: function(ckc) {
27 return new Promise(function(resolve, reject) {
28 var reader = new FileReader();
29 reader.addEventListener('loadend', function() {
30 resolve(new Uint8Array(reader.result));
31 });
32 reader.addEventListener('error', function() {
33 reject(reader.error);
34 });
35 reader.readAsArrayBuffer(ckc);
36 });
37 },
38 prepareMessage: function(event, session) {
39 return new Blob([event.message], {type: 'application/octet-binary'});
40 },
41 headers: [{
42 name: 'content-type',
43 value: 'application/octet-stream'
44 }],
45 useUint16InitData: true,
46 licenseResponseType: 'blob'
47 }
48 }
49 }
50};

Please replace the following placeholders in the code:

  • DASH_MANIFEST_URL: The URL to the DASH manifest (MPD) file.
  • HLS_MANIFEST_URL: The URL to the HLS manifest (M3U8) file.
  • CONTENT_ID: The content ID for the given asset, which should be in the format xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.
  • CERTIFICATE_URL: The URL to the Fairplay certificate. This needs to be accessible for the player.
  • EZDRM_ACCOUNT_ID: Your EZDRM account ID.

Give us feedback