PallyCon > Content Security  > Multi-DRM  > How to Integrate PallyCon Multi-DRM with Bitmovin Video Player
PallyCon blog Integration with bitmovin html5 player

How to Integrate PallyCon Multi-DRM with Bitmovin Video Player

Overview

PallyCon Multi-DRM Service can be easily integrated with various HTML5 web players via ‘Encrypted Media Extensions(EME)’ and ‘MPEG Common Encryption(CENC)’ specifications. Using HTML5 web player with PallyCon Multi-DRM, you can stream DRM-protected audio/video contents without plugin on EME-supported web browsers such as IE11, Edge, Chrome, Firefox, and Safari.

Please refer to the below links for the EME HTML5 standards and the use cases of protecting audio contents using multi-DRM.

This tutorial is a step-by-step guide to integrate with Bitmovin Video Player among various HTML5 player solutions. Bitmovin Player supports PC/Mobile web browsers as well as iOS and Android native applications using native player SDKs. So you can integrate PallyCon multi-DRM with Bitmovin Player for web browsers, mobile apps, and OTT platforms such as smart TVs in the same way.

PallyCon Logo

About PallyCon

PallyCon Forensic Watermarkingand Multi-DRM  are cloud-based content security services which are developed and served by INKA Entworks PallyCon Multi-DRM provides license management of PlayReady, Widevine, FairPlay Streaming, and NCG DRM. It is integrated with various encoder/transcoder solutions and player solutions for easy deployment of multi-DRM to online video services.

Bitmovin logo

About Bitmovin

Bitmovin is a global solution provider of video related software solutions such as video encoder, player, and analytics. Bitmovin Player supports HLS and MPEG-DASH streaming playback on a variety of platforms including web browsers, mobile devices and smart TVs.

This tutorial has three steps as below. To make it quick and easy, the integration is based on PallyCon CLI Packager and DRM license token.

  • Step 1: Sign up for PallyCon and Bitmovin trial accounts
  • Step 2: DRM content packaging with PallyCon CLI Packager
  • Step 3: DRM content playback on Bitmovin Player via PallyCon license token integration

Please refer to the below links for more details about PallyCon CLI Packager and the license token integration.

Step 1: Sign up for PallyCon and Bitmovin trial account

To follow this tutorial, you need to sign up for trials accounts on PallyCon and Bitmovin web sites.

1-1. Sign up for PallyCon Multi-DRM trial

Browse to PallyCon Console login page and click ‘Sign up’ button. Fill in the sign up form as below and click ‘Sign up’ button on the form.

PallyCon Console screenshot for Join
1-2. Verify the email account for PallyCon trial site

You will receive the welcome email on your email account used for the sign up. Click the ‘Verify’ button to verify your email. The trial site on PallyCon service will be created after the verification.

1-3. Check the trial site information

Sign in to PallyCon Console site and go to ‘Integration Settings’ page under ‘Site Settings’ menu. Copy and paste the ‘Site ID’, ‘Site Key’, and ‘Access Key’ values on a text editor such as Notepad. These values will be used in later stages for the DRM integration.

PallyCon Console - Check the trial site information
1-4. Bitmovin Sign up for Bitmovin Player trial

Browse to Bitmovin website and click ‘Sign up’ link. Create your trial account through the sign up forms as below.

You will receive Bitmovin account activation email the same as PallyCon. Click the ‘Activate your account’ button to verify your email.

1-5. Setup your test domain for player license

You need to add your test server’s domain on Bitmovin player’s license setting by following below.

  • Login to Bitmovin site with your trial account and go to ‘Player > Licenses’ screen.
  • Click the trial license key shown on the screen. The page will be switched to the ‘license details’ screen.
  • Input your test web server’s domain as shown below and click ‘Add’ button.

It may take several minutes for the domain setting to take effect.

Step 2: DRM content packaging with PallyCon CLI packager

You need to package a video to test DRM content playback on the player. Follow the below guide to perform DRM content packaging.

2-1.Download and install PallyCon CLI Packager

Download PallyCon CLI Packager from Packager and Sample Downloads page on PallyCon Developer Guide site. Create a folder on a test PC or server to perform the content packaging. And copy the CLI executable file located in ‘bin’ folder of the downloaded zip file. (e.g. ~/pallycon-test/PallyConPackager)

PallyCon CLI Packager supports 64bit Windows and Linux(Ubuntu, CentOS) OS. Gcc and g++ libraries (6.0 or later) are required for Linux OS.

2-2. Package plain MP4 video to MPEG-DASH content

Copy an MP4(H264 AVC) video file for the test to the same folder as the PallyCon CLI Packager executable. You can use the PallyCon introduction video linked below if you want.

PallyCon introduction video : https://pallycon.com/docs/files/pallycon-intro.mp4
PallyCon CLI Packager supports DASH-CENC (Widevine, PlayReady) and HLS-AES (FairPlay) packaging for multi-DRM, as well as NCG and NCG-HLS packaging functions for Netsync Content Guard (NCG) DRM. In this tutorial, we will only proceed with DASH-CENC packaging for a brief test.

Run the command as below to perform a DASH content packaging. Please refer to the below table for the details about each parameters.
./PallyConPackager --site_id --access_key --content_id --dash -i -o

the details about each parameters
Parameter Input value Specification Example
--site_id The trial site ID which is shown on ‘Integration Settings’ page of PallyCon Console site. Four uppercase alphanumeric characters ABCD
--access_key The access key string which is shown on ‘Integration Settings’ page of PallyCon Console site. 32-length characters H24FS8wdo3C7CWrSjcIhPYWpYaFu6Lh3
--content_id Unique ID of content to distinguish each content when DRM packaging and licensing. The DRM encryption key and license are managed based on the ID, and the content ID managed by the CMS (Content Management System) is generally input. Max 200 alphanumeric characters pallycon-intro
-i The name of the original MP4 file to be packaged. If the package is in a different path from the executable file, enter the file name including the path. Path of a file ~/pallycon-test/input/pallycon-intro.mp4
-o The path of output folder Path of a folder ~/pallycon-test/output/pallycon-intro/
parameter: –site_id
Input value: The trial site ID which is shown on ‘Integration Settings’ page of PallyCon Console site.
Specification: Four uppercase alphanumeric characters
Example: ABCD
parameter: –access_key
Input value: The access key string which is shown on ‘Integration Settings’ page of PallyCon Console site.
Specification: 32-length characters
Example: H24FS8wdo3C7CWrSjcIhPYWpYaFu6Lh3
parameter: –content_id
Input value: Unique ID of content to distinguish each content when DRM packaging and licensing. The DRM encryption key and license are managed based on the ID, and the content ID managed by the CMS (Content Management System) is generally input.
Specification: Max 200 alphanumeric characters
Example: pallycon-intro
parameter: -i
Input value: The name of the original MP4 file to be packaged. If the package is in a different path from the executable file, enter the file name including the path.
Specification: Path of a file
Example: ~/pallycon-test/input/pallycon-intro.mp4
parameter: -o
Input value: The path of output folder
Specification: Path of a folder
Example: ~/pallycon-test/output/pallycon-intro/

If the command is configured according to the input value shown above, it is as follows. The site ID and the access key, which are shown as examples, do not actually work, and you must replace them with the values that correspond to the account you joined in Step 1.
./PallyConPackager --site_id ABCD --access_key H24FS8wdo3C7CWrSjcIhPYWpYaFu6Lh3 --content_id pallycon-intro --dash -i ~/pallycon-test/input/pallycon-intro.mp4 -o ~/pallycon-test/output/pallycon-intro/

After the packaging is successfully completed, the history will be displayed on the ‘DRM Packaging History’ page of the PallyCon console site as shown below.

PallyCon Console - DRM DRM Packaging History
2-3. Upload the packaged DASH content on a test web server

When packaging is complete, an MPEG-DASH content is created, consisting of an mpd manifest file and audio / video tracks in the ‘dash’ folder in the output folder. To test DRM content playback in Step 3, you must upload the folder to the test web server. Upload DASH content to the storage associated with the CDN or to a typical web server.

Browsers such as Chrome and Firefox are forced to apply HTTPS to all URLs related to media streaming for security reasons. For the playback testing in step 3, you must apply an SSL certificate to your test web server and use an HTTPS URL.

Step 3: DRM content playback on Bitmovin Video Player via license token integration

Play the DASH content that you packaged in Step 2 using the Bitmovin player. DRM license integration and content playback are performed through the following process.

3-1. Download Bitmovin player sample and edit the source

Log in to the Bitmovin site and go to the ‘Player > Web SDK’ screen. Click the ‘Sample Page’ tab in the ‘Player Embedding’ section and click the ‘clicking here’ link in the image below to download the sample html file.

Integration with Bitmovin Player Download web sdk sample html

Edit the ‘bitmovin-player-samplepage.html’ file that you downloaded with a text editor. If you search the string ‘.mpd’ with the search function first, you will go to the following part.

var source = {
dash: 'https://bitmovin-a.akamaihd.net/content/MI201109210084_1/mpds/f08e80da-bf1d-4e3d-8899-f0f6155f6efa.mpd',
hls: 'https://bitmovin-a.akamaihd.net/content/MI201109210084_1/m3u8s/f08e80da-bf1d-4e3d-8899-f0f6155f6efa.m3u8',
progressive: 'https://bitmovin-a.akamaihd.net/content/MI201109210084_1/MI201109210084_mpeg-4_hd_high_1080p25_10mbits.mp4',
poster: 'https://bitmovin-a.akamaihd.net/content/MI201109210084_1/poster.jpg'
};

Modify the contents of the above source to fit the test environment as shown below.


var source = {
dash: 'https://test-web-server-url/pallycon-intro/dash/stream.mpd',
drm: {
widevine: {
LA_URL: "https://license.pallycon.com/ri/licenseManager.do",
headers: {
"pallycon-customdata-v2" : "CUSTOM_HEADER_VALUE"
}
},
playready: {
LA_URL: "https://license.pallycon.com/ri/licenseManager.do",
headers: {
"pallycon-customdata-v2" : "CUSTOM_HEADER_VALUE"
}
}
}
};

  • The mpd file URL in the above source code should be replaced with the URL that corresponds to the DASH content uploaded to the test web server in Step 2.
  • The value of “CUSTOM_HEADER_VALUE” should be replaced with the value of the license token generated later in the process below.
3-2. Create and set the token for DRM license acquisition

In order to play the packaged content, the DRM license must be issued to the player through DRM license integration. PallyCon Multi DRM supports callback and token type licensing, and in this tutorial we will proceed with token licensing.

For detailed instructions on how to issue licenses, please refer to the online guide linked below.

The token used in the license request must be generated in accordance with the specifications in the server side (backend) of the video service to which PallyCon Multi-DRM will be applied. In this tutorial, you will use the ‘Create token’ function provided on the ‘Developer Console’ page of the PallyCon site for quick testing. Go to the Developer Console page at the link below and enter the below items on the form.

Create and set the token for DRM license acquisition
Item Input value Specification Example
SITE ID The trial site ID which is shown on ‘Integration Settings’ page of PallyCon Console site. Four uppercase alphabet characters ABCD
SITE Key The site key string which is shown on ‘Integration Settings’ page of PallyCon Console site. 32-length characters 3H24FS8wdo3C7CWrSjcIhPYWpYaFu6Lh
ACCESS Key The access key string which is shown on ‘Integration Settings’ page of PallyCon Console site. 32-length characters gktt7xArRiSrWXEvrommuBdUD6Ktk3cP
DRM Type The name of DRM which is supported by client web browser widevine/playready/fairplay Chrome/FireFox: widevine, IE11/Edge: playready
CID The content ID which was input to CLI packager in Step 2. Max 200 alphanumeric characters pallycon-intro
USER ID A unique user ID used to verify the rights of the content service user.
In the token-based license integration, a token must be generated after the authorization check is completed between the content service backend and the client.
Max 200 alphanumeric characters test-user
Time stamp The validity time of the token. Generally, it is set as token generation time, and the token is valid for 600 seconds after that point by default. The length of validity can be configured on PallyCon Console site. yyyy-mm-ddThh:mm:ssZ
(GMT based)
2019-04-03T08:30:00Z
Token Rule DRM-related rule data to be applied when issuing license (refer to Token guide for details) JSON string {
"playback_policy": {
"limit": true,
"persistent": false,
"duration" : 300
}
}
Item: USER ID
Input value: A unique user ID used to verify the rights of the content service user.
In the token-based license integration, a token must be generated after the authorization check is completed between the content service backend and the client.
Specification: Max 200 alphanumeric characters
Example: test-user
Item: Token Rule
Input value: DRM-related rule data to be applied when issuing license (refer to Token guide for details)
Specification: JSON string
Example: {
"playback_policy": {
"limit": true,
"persistent": false,
"duration" : 300
}
}
Item: Time stamp
Input value: The validity time of the token. Generally, it is set as token generation time, and the token is valid for 600 seconds after that point by default. The length of validity can be configured on PallyCon Console site.
Specification: yyyy-mm-ddThh:mm:ssZ(GMT based)
Example: 2019-04-03T08:30:00Z
Item: SITE Key
Input value: The site key string which is shown on ‘Integration Settings’ page of PallyCon Console site.
Specification: 32-length characters
Example: 3H24FS8wdo3C7CWrSjcIhPYWpYaFu6Lh
Item: SITE ID
Input value: The trial site ID which is shown on ‘Integration Settings’ page of PallyCon Console site.
Specification: Four uppercase alphabet characters
Example: ABCD
Item: DRM Type
Input value: The name of DRM which is supported by client web browser
Specification: widevine/playready/Fairplay
Example: Chrome/FireFox: widevine, IE11/Edge: playready
Item: CID
Input value: The content ID which was input to CLI packager in Step 2.
Specification: Max 200 alphanumeric characters
Example: pallycon-intro
Item: ACCESS Key
Input value: The access key string which is shown on ‘Integration Settings’ page of PallyCon Console site.
Specification: 32-length characters
Example: gktt7xArRiSrWXEvrommuBdUD6Ktk3cP
Enter the values required to generate the token as above and click the ‘REQUEST TOKEN’ button. A token string will be created at the bottom of the page. Copy the string and paste it into ‘CUSTOM_HEADER_VALUE’ for each DRM in the Bitmovin player sample file you modified in step 3-2. The final html source will be as below.
var source = {
dash: 'https://test-web-server-url/pallycon-intro/dash/stream.mpd',
drm: {
widevine: {
LA_URL: "https://license.pallycon.com/ri/licenseManager.do",
headers: {
"pallycon-customdata-v2" : "eyJ0aW1lc3RhbXAiOiIyMDE5LTA0LTAzVDA5OjA4OjAwWiIsImhhc2giOiJRTEUzOGxPQjVJUzZ3cUlYOSt6eWpUR1oxOXVrXC9BVVdFQkxkSjRQZVNiaz0iLCJ0b2tlbiI6IkhCOHVvRXBaTTZ2dEFIVXFLSTQyM0s0amNHTzltU1A5YjJWM2IzaTNEd21cL3dpS1wvSlV2WTVWVVQ4WVNZTUVLZm5PXC9PXC9yTU9hUlZrR0JuQXI0RStSM1FFUVJZandldlNRaGN2cWR6QWN6THFcL1VhaXhRK1J5Z21EMnRDWDFXdFwvdmQ5d1JpeWd4RFgyckt6VWwxeUZyUT09Iiwic2l0ZV9pZCI6IjE3WUwiLCJkcm1fdHlwZSI6IndpZGV2aW5lIiwidXNlcl9pZCI6InRlc3QtdXNlciIsImNpZCI6InBhbGx5Y29uLWludHJvIn0="
}
},
playready: {
LA_URL: "https://license.pallycon.com/ri/licenseManager.do",
headers: {
"pallycon-customdata-v2" : "eyJ0aW1lc3RhbXAiOiIyMDE5LTA0LTAzVDA5OjA4OjAwWiIsImhhc2giOiI2S0t6dVY2NWFwSnpDSmJxdDRhK1NRUjZJM0ZFRlB4amdJaHNCc3g4OXNJPSIsInRva2VuIjoiSEI4dW9FcFpNNnZ0QUhVcUtJNDIzSzRqY0dPOW1TUDliMlYzYjNpM0R3bVwvd2lLXC9KVXZZNVZVVDhZU1lNRUtmbk9cL09cL3JNT2FSVmtHQm5BcjRFK1IzUUVRUllqd2V2U1FoY3ZxZHpBY3pMcVwvVWFpeFErUnlnbUQydENYMVd0XC92ZDl3Uml5Z3hEWDJyS3pVbDF5RnJRPT0iLCJzaXRlX2lkIjoiMTdZTCIsImRybV90eXBlIjoicGxheXJlYWR5IiwidXNlcl9pZCI6InRlc3QtdXNlciIsImNpZCI6InBhbGx5Y29uLWludHJvIn0="
}
}
}
};

  • The token string in the sample code above should be replaced with the value you created yourself through the tutorial.
  • To test playback on both Chrome / Firefox (Widevine DRM) and IE11 / Edge (PlayReady DRM), you need to create and set two different tokens with the ‘DRM Type’ input as ‘widevine’ and ‘playready’.
3-3. Upload modified player sample and test playback

Upload the player sample html file that you set up to the license token string to the test web server. Browse to the sample html page’s URL using a multi-DRM supported web browser such as Chrome, Firefox, IE11, and Edge. The Bitmovin Video Player sample page will be displayed as below.

Integration with Bitmovin Player bitmovin player playchecking

If the license token is set up normally, the license will be issued from the PallyCon cloud server click the play button of the player. To apply the token-based licensing to the actual content service, the token must be generated in real time after the user authentication and content authorization process on the server (backend) of the content service site. Please refer to the ‘Token integration sample’ on the ‘Packager and Sample Downloads’ page and the token integration guide linked below.

Content playback may fail in the following cases:

  • Expiration of token: Please increase the token validity period which can be set in the PallyCon console, or create a new token based on the current GMT time. The timestamp value of the token must be entered in GMT time, not in your local time zone.
  • CORS Error: Cross-Origin Resource Sharing (CORS) error occurs when player html file and DASH content file are located in different domains. To resolve the error, you must move the file to the same domain or set Access-Control-Allow-Origin in the response header of the corresponding web server.

This concludes the PallyCon Multi DRM and Bitmovin Video Player integration tutorial. If you are having difficulty with the tutorial content, please contact us using the helpdesk account created when you signed up for PallyCon trial.

Thank you.

Find out more

In addition to the CLI packager and Bitmovin player used in this tutorial, the PallyCon Multi DRM service works with a variety of partner solutions, including:

  • Encoder, transcoder, streaming server : AWS Elemental (via SPEKE API), Harmonic, Anevia, Flussonic Media Server, Wowza Streaming Engine (via CPIX API)
  • HTML5 player: Shaka Player, Bitmovin Player, Viblast Player, THEO Player, VideoJS, NexPlayer
  • Native player support: Android ExoPlayer(Widevine, NCG DRM), iOS AVPlayer(FairPlay, NCG DRM), UWP MediaPlayer(PlayReady)

For more information on PallyCon Multi DRM and various partner solutions, please refer to PallyCon Developer’s Guide site.