How to play MPEG-CENC ClearKey content
Overview
Please replace YOUR-PLAYER-LICENSE-KEY-HERE,YOUR-KEY-HERE, and YOUR-KID-HERE with their respective values, in the example below. You can create MPEG-CENC ClearKey encrypted content via our Encoder.
Example
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="https://cdn.bitmovin.com/player/web/8/bitmovinplayer.js"></script>
</head>
<body>
<div id="my-player"></div>
<script type="text/javascript">
const container = document.getElementById('my-player');
const playerConfig = {
key: 'YOUR-PLAYER-LICENSE-KEY-HERE',
};
const source = {
dash: "https://example.com/path/to/your/clear-key/content/manifest.mpd",
drm: {
clearkey: [
{
//values in hex string format
key: "YOUR-KEY-HERE",
kid: "YOUR-KID-HERE" //optional
}
]
}
};
const player = new bitmovin.player.Player(container, playerConfig);
player.load(source).then(
player => {
console.log('Successfully created Bitmovin Player instance')
},
reason => {
console.log('Error while creating Bitmovin Player instance')
}
);
</script>
</body>
</html>
Updated 2 days ago