How to create PlayReady DRM protected content


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 Requirements

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

About this example

The code snippets shown here are based on the full example called, 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 Configuration

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)

private static CencDrm createDrmConfig(
    Encoding encoding, Muxing muxing, Output output, String outputPath) throws BitmovinException {
  CencDrm cencDrm = new CencDrm();
  cencDrm.addOutputsItem(buildEncodingOutput(output, outputPath));
  CencPlayReady playReadyDrm = new CencPlayReady();
  return bitmovinApi.encoding.encodings.muxings.fmp4.drm.cenc.create(
      encoding.getId(), muxing.getId(), cencDrm);

Get Started with a Bitmovin SDK

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/TypescriptIntegrate 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.