Apple Fairplay DRM

Bitmovin offers Apple FaiPlay DRM StreamingFairplay is the Apple DRM and was initially used only in the iTunes store to protect AAC encoded audio files but got soon also adopted for Apple’s video products that are now part of the iTunes store. Fairplay is specifically designed for Apple HTTP Live Streaming (HLS) with Apple playback devices such as iPhone, iPad, Apple TV and Mac OS X. Fairplay is also used as Content Decryption Module (CDM) of the Safari browser. This enables HTML5 native playback of DRM encrypted Fairplay streams without plugins in Safari.

Encoding & Packaging

The Bitmovin encoding service support Fairplay encryption for HLS. Fairplay uses SAMPLE-AES encryption and specific fields that can be set through the Bitmovin REST API or one of our API Clients available in different languages such as PHP, Python, Java, JavaScript, Node.js, Ruby, etc.
You just need to add the HLSEncryptionConfig to the encoding job as shown in the following Java example:

/* CREATE FAIRPLAY DRM CONFIG */
HlsEncryptionConfig hlsEncryptionConfig = new HlsEncryptionConfig();
hlsEncryptionConfig.method = HlsMethod.FAIRPLAY;
hlsEncryptionConfig.key = "YOUR_KEY";
hlsEncryptionConfig.iv = "YOUR_IV";
hlsEncryptionConfig.uri = "skd://YOUR_SKD_URL";
    
/* Create Encoding Job */
JobConfig jobConfig = new JobConfig();
...
jobConfig.manifestTypes.addElement(ManifestType.HLS_M3U8);
jobConfig.speed = Speed.STANDARD;
jobConfig.hlsEncryptionConfig = hlsEncryptionConfig;
Java Fairplay Encryption Example

The parameters of the HLSEncryptionConfig have the following meaning:

  • method: You can either encrypt your content using AES_128, SAMPLE_AES or FAIRPLAY
  • key: You need to provide a key that will be used to encrypt the content (16 byte; 32 hexadecimal characters)
  • iv: The initialization vector is optional. If it is not provided we will generate one for you. (16 byte; 32 hexadecimal characters)
  • uri: If provided, this URI will be used for license acquisition

For Fairplay it is important to select FAIRPLAY as method. Fairplay internally uses SAMPLE-AES but it also needs some special packaging. Therefore, you need to signal Fairplay encryption explicitly through in the API request or through the API Clients.

Playback

We also support Fairplay with our Bitmovin adaptive streaming player. Through our player configuration you can set all values that are needed for Fairplay streaming. We also support multiple advanced options that are needed by 3rd party licensing servers to provide further features. An example Fairplay configuration could look like the following:

fairplay                : {
    LA_URL                : 'https://fairplay.licenseserver.com/',
    certificateURL        : 'https://fairplay.licenseserver.com/certificate-url'
  }
Back to Top
Simple Share Buttons