Skip to main content
Version: 11.7.0

Clear Key on Web

This article provides a simple example of how to use Clear Key with THEOplayer.

Usually, DRM systems require you to specify a licenseAcquisitionURL and additional optional data (e.g.: certificate, credentials, headers). Clear Key does not need a DRM provider. You can provide the key(s) directly to the player (hence "clear" key) through the keys property in its LicenseAcquisitionDescription (in fact, this property is only available for Clear Key). Alternatively, you can have the player fetch the keys from a licenseAcquisitionURL, which returns a JSON object containing the same keys.

Head to our page on DRM for more general information.

Please check also our related API documentation on how to set these.

Code example

With keys:

player.source = {
sources: {
src: 'your-manifest-URL',
useCredentials: false,
contentProtection: {
clearkey: {
keys: [
{
id: 'id',
value: 'value',
},
],
},
},
},
};

With a license URL:

player.source = {
sources: {
src: 'https://storage.googleapis.com/shaka-demo-assets/angel-one-clearkey/dash.mpd',
useCredentials: false,
contentProtection: {
clearkey: {
licenseAcquisitionURL: 'https://cwip-shaka-proxy.appspot.com/clearkey?_u3wDe7erb7v8Lqt8A3QDQ=ABEiM0RVZneImaq7zN3u_w',
},
},
},
};

Resources