[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

Docs Home
User shortcuts for search
Focus by pressing f
Hide results by pressing Esc
Navigate via   keys

Thu Nov 14 2019

How to create PlayReady DRM protected content

OverviewLink Icon

Microsoft released PlayReady in 2008 and it’s one of major DRM systems out in the market with broad device support, sophisticated features and has been used at scale already by many events such as the Olympics in Sochi, Russia. The Bitmovin encoding service supports PlayReady encryption and packaging with MPEG-CENC. The Bitmovin player plays PlayReady encrypted videos on platforms that support the PlayReady DRM natively in HTML5 without plugins.

PlayReady DRM RequirementsLink Icon

  • A multi DRM licensing server provider such as Irdeto, EZDRM, ExpressPlay, Axinom or others.

About this exampleLink Icon

The code snippets shown here are based on the full example called CencDrmContentProtection.java, using our Bitmovin SDK for Java.

Hint: If you haven't created any encodings with our Service yet, its recommended to start with our quick start guide called "Get Started with the Bitmovin API" first, before you continue :)

Encoding with DRM ConfigurationLink Icon

The key part to create an encoding that encodes and encrypt content with DRM solutions that support MPEG-CENC, is to add a CencDRM Configuration to a Muxing.

To encrypt your content so it can be used with PlayReady DRM, an encryption key (referred to as key later on) is required. All other values are optional, however sometimes required by specific DRM vendors, therefore have to be set (kid, pssh, ...).

General configuration values:

  • key: (required) You need to provide a key that will be used to encrypt the content (16 byte encryption key, represented as 32 hexadecimal characters)
  • kid: (optional) also known as Key ID, or ContentID. Its a unique identifer for your content (16 byte initialization vector, represented as 32 hexadecimal characters)

HINT: Some DRM providers provide you with a dedicated service to create and safely store Encryption Keys, so you don't have to create and manage them by yourself. These values are required to generate a proper playback license using DRM solution providers like Irdeto, EZDRM, ExpressPlay, Axinom, etc. to control playback permissions on the client side. Learn more.

PlayReady DRM specific configuration options: You can either provide an pssh string or an laUrl in this configuration.

  • pssh: (optional)Base64 encoded String, PSSH payload Example: QWRvYmVhc2Rmc2FkZmFzZg==
  • laUrl: (optional) The License Aquistion URL that shall be used by the player.

Java SDK Example - createDrmConfig() Method (Line in Example)

1private static CencDrm createDrmConfig(
2 Encoding encoding, Muxing muxing, Output output, String outputPath) throws BitmovinException {
3 CencDrm cencDrm = new CencDrm();
4 cencDrm.addOutputsItem(buildEncodingOutput(output, outputPath));
5 cencDrm.setKey("cab5b529ae28d5cc5e3e7bc3fd4a544d");
6 cencDrm.setKid("08eecef4b026deec395234d94218273d");
7
8 ...
9
10 CencPlayReady playReadyDrm = new CencPlayReady();
11 playReadyDrm.setLaUrl("http://playready.directtaps.net/pr/svc/rightsmanager.asmx");
12 //playReadyDrm.setPssh("QWRvYmVhc2Rmc2FkZmFzZg==");
13 cencDrm.setPlayReady(playReadyDrm);
14
15 ...
16
17 return bitmovinApi.encoding.encodings.muxings.fmp4.drm.cenc.create(
18 encoding.getId(), muxing.getId(), cencDrm);
19}

Get Started with a Bitmovin SDKLink Icon

Bitmovin API SDKDescription
JavaIntegrate the SDK into your Java Project easily and add it to the config of your dependency manager like Maven or Gradle. Learn more
Javascript/Typescript Integrate the SDK into your Javascript/Typescript based project easily by adding it as a dependency via NPM. Learn more
PythonIntegrate the SDK into your Python based project easily by adding it as a dependency via pip or Setuptools. Learn more
.NETIntegrate the SDK into your .NET based project easily by adding it as a dependency via nuget. Learn more
PHPIntegrate the SDK into your PHP based project easily by adding it as a dependency via composer. Learn more

Visit our Github Example Repository that provides you with examples for all Bitmovin SDK's available.

Give us feedback