[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

Setup the Bitmovin Player with DRMtoday DRM Service

OverviewLink Icon

If you are not sure what DRM is, you want have an overview and get started, please have a look at our DRM Setup Guide.

Nearly every license provider, such as Irdeto, 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 key: 'YOUR-PLAYER-KEY-HERE',
3 source: {
4 dash: '//example.com/path/to/your/manifest.mpd',
5 drm: {
6 widevine: {
7 LA_URL: 'https://license-server-url-provided-by-drmtoday',
8 headers : [{
9 name: 'dt-custom-data',
10 value: 'INSERT-YOUR-BASE64-ENCODED-CUSTOMDATA'
11 }],
12 prepareLicense : function(licenseObj) {
13 var license = {license: licenseObj.license};
14
15 try {
16 var drmTodayObj = JSON.parse(String.fromCharCode.apply(null, licenseObj.license));
17 if (drmTodayObj && drmTodayObj.status && drmTodayObj.license) {
18 if (drmTodayObj.status === 'OK') {
19 var str = window.atob(drmTodayObj.license);
20 var bufView = new Uint8Array(new ArrayBuffer(str.length));
21 for (var i = 0; i < str.length; i++) {
22 bufView[i] = str.charCodeAt(i);
23 }
24 license.license = bufView;
25 } else {
26 // license not okay
27 }
28 } else {
29 // no valid DRMtoday license
30 }
31 } catch (e) {
32 // no valid DRMtoday license
33 }
34 return license;
35 }
36 }
37 }
38 }
39}

PlayReadyLink Icon

1var conf = {
2 key: 'YOUR-PLAYER-KEY-HERE',
3 source: {
4 dash: '//example.com/path/to/your/manifest.mpd',
5 drm: {
6 playready: {
7 LA_URL: 'https://license-server-url-provided-by-drmtoday',
8 headers : [{
9 name: 'http-header-CustomData',
10 value: 'INSERT-YOUR-BASE64-ENCODED-CUSTOMDATA'
11 }]
12 }
13 }
14 }
15}

FairPlayLink Icon

1var conf = {
2 key: 'YOUR-PLAYER-KEY-HERE',
3 source: {
4 hls: '//example.com/path/to/your/master-playlist.m3u8',
5 drm: {
6 fairplay: {
7 LA_URL: 'https://license-server-url-provided-by-drmtoday',
8 certificateURL: 'https://certificate-url-provided-by-drmtoday',
9 certificateHeaders: [{
10 name: 'dt-custom-data',
11 value: 'INSERT-YOUR-BASE64-ENCODED-CUSTOMDATA'
12 }],
13 headers: [{
14 name: 'dt-custom-data',
15 value: 'INSERT-YOUR-BASE64-ENCODED-CUSTOMDATA'
16 }],
17 prepareMessage : function(event, session) {
18 return 'spc=' + encodeURIComponent(event.messageBase64Encoded) + '&' + session.contentId;
19 },
20 prepareContentId : function(contentId) {
21 var pattern='skd://drmtoday?';
22 var idx = contentId.indexOf(pattern);
23 if (idx > -1) {
24 var parameters = contentId.substring(idx + pattern.length);
25 parameters = parameters.replace(/assetid/gi, 'assetId');
26 parameters = parameters.replace(/variantid/gi, 'variantId');
27 return parameters;
28 } else {
29 return '';
30 }
31 }
32 }
33 }
34 }
35}

Adobe Access (Flash Fallback)Link Icon

1var conf = {
2 key: 'YOUR-PLAYER-KEY-HERE',
3 source: {
4 dash: '//example.com/path/to/your/manifest.mpd',
5 drm: {
6 access: {
7 LA_URL: 'https://license-server-url-provided-by-drmtoday',
8 authToken: 'INSERT-YOUR-BASE64-ENCODED-CUSTOMDATA'
9 }
10 }
11 }
12}

Complete example for Widevine, PlayReady, Access and FairPlayLink Icon

1var conf = {
2 key: 'YOUR-PLAYER-KEY-HERE',
3 source: {
4 dash: '//example.com/path/to/your/manifest.mpd',
5 hls: '//example.com/path/to/your/master-playlist.m3u8',
6 drm: {
7 widevine: {
8 LA_URL: 'https://license-server-url-provided-by-drmtoday',
9 headers : [{
10 name: 'dt-custom-data',
11 value: 'INSERT-YOUR-BASE64-ENCODED-CUSTOMDATA'
12 }],
13 prepareLicense : function(licenseObj) {
14 var license = {license: licenseObj.license};
15
16 try {
17 var drmTodayObj = JSON.parse(String.fromCharCode.apply(null, licenseObj.license));
18 if (drmTodayObj && drmTodayObj.status && drmTodayObj.license) {
19 if (drmTodayObj.status === 'OK') {
20 var str = window.atob(drmTodayObj.license);
21 var bufView = new Uint8Array(new ArrayBuffer(str.length));
22 for (var i = 0; i < str.length; i++) {
23 bufView[i] = str.charCodeAt(i);
24 }
25 license.license = bufView;
26 } else {
27 // license not okay
28 }
29 } else {
30 // no valid DRMtoday license
31 }
32 } catch (e) {
33 // no valid DRMtoday license
34 }
35 return license;
36 }
37 },
38 playready: {
39 LA_URL: 'https://license-server-url-provided-by-drmtoday',
40 headers : [{
41 name: 'http-header-CustomData',
42 value: 'INSERT-YOUR-BASE64-ENCODED-CUSTOMDATA'
43 }]
44 },
45 fairplay: {
46 LA_URL: 'https://license-server-url-provided-by-drmtoday',
47 certificateURL: 'https://certificate-url-provided-by-drmtoday',
48 certificateHeaders: [{
49 name: 'dt-custom-data',
50 value: 'INSERT-YOUR-BASE64-ENCODED-CUSTOMDATA'
51 }],
52 headers: [{
53 name: 'dt-custom-data',
54 value: 'INSERT-YOUR-BASE64-ENCODED-CUSTOMDATA'
55 }],
56 prepareMessage : function(event, session) {
57 return 'spc=' + encodeURIComponent(event.messageBase64Encoded) + '&' + session.contentId;
58 },
59 prepareContentId : function(contentId) {
60 var pattern='skd://drmtoday?';
61 var idx = contentId.indexOf(pattern);
62 if (idx > -1) {
63 var parameters = contentId.substring(idx + pattern.length);
64 parameters = parameters.replace(/assetid/gi, 'assetId');
65 parameters = parameters.replace(/variantid/gi, 'variantId');
66 return parameters;
67 } else {
68 return '';
69 }
70 }
71 },
72 access: {
73 LA_URL: 'https://license-server-url-provided-by-drmtoday',
74 authToken: 'INSERT-YOUR-BASE64-ENCODED-CUSTOMDATA'
75 }
76 }
77 }
78}

Give us feedback