blob: e02d677d2e3df9a97d2f2dd2b40e4fd11fae19b2 [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<title>Encrypted ClearKey CENC Event</title>
<script src="../medias-enc.js"></script>
<script src="../../video-test.js"></script>
<script src="../../media-source/media-source-loader-simple.js"></script>
<script>
var onEncryptedEvent;
function runTest() {
if (!navigator.requestMediaKeySystemAccess) {
logResult(false, "EME API is not supported");
return;
} else {
logResult(true, "EME API is supported");
}
findMediaElement();
waitForEventOn(video, "encrypted", encrypted);
function encrypted(event) {
onEncryptedEvent = event;
testExpected("onEncryptedEvent.target", video);
testExpected("onEncryptedEvent", window.MediaEncryptedEvent, "instanceof");
testExpected("onEncryptedEvent.initDataType.toLowerCase()", "cenc");
testExpected("onEncryptedEvent.initData", null, "!=");
endTest();
}
var ms = new MediaSourceLoaderSimple(video);
ms.onready = function() {
logResult(true, "Media source is opened");
ms.createSourceBuffer(streamMedias["simpleClearKeyMSE"].video, 1);
};
}
</script>
</head>
<body onload="runTest()">
<video></video>
</body>
</html>