Skip to main content
Version: 7.7.1

Multi-key HLS

There are multiple DRM key systems on the market to choose from. The most popular ones are Google Widevine, Microsoft PlayReady and Apple FairPlay. Under the hood, all these systems encrypt the media samples using the AES-128 encryption algorithm. AES-128 is a standardized block-cipher that allows for multiple ways of choosing the blocks. Widevine and PlayReady both use CTR and FairPlay uses CBC. Therefore, it was possible to share segments between Widevine and PlayReady protected streams, but not with FairPlay protected stream. However, support has been added for Widevine and PlayReady with AES-128 in CBC mode. Hence, it is now possible to create HLS streams compatible with all these key systems. Where you previously had to encode the stream twice, this is no longer needed. A multi-key HLS stream will play in all web platforms that support MSE and either Widevine, PlayReady or FairPlay.

The HLS playlist

A multi-key HLS playlist could look like this:


There is an #EXT-X-KEY tag for all the key systems which all have method SAMPLE-AES. The KEYFORMAT specifies the key system:

  • urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed for Widevine
  • for PlayReady
  • for FairPlay

The URI is either a data URI containing the initialization data, or a URI pointing to the initialization data. For more information, please check out the specifications for Widevine, PlayReady and FairPlay.

Configuring THEOplayer

A corresponding player configuration looks like:

player.source = {
sources: [
src: "",
type: "application/x-mpegurl",
contentProtection: {
widevine: {
licenseAcquisitionURL: ""
playready: {
licenseAcquisitionURL: ""
fairplay: {
certificateURL: "",
licenseAcquisitionURL: ""

Note that this feature is available on the current HLS pipeline (default since THEOplayer 4.X). To use it in previous versions, the lowLatency flag must be set to true.