blob: 6bc952d9d8eca1c10aec30246b8c7f8679224856 [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<title>Playback ClearKey CENC video with sub-sample encryption</title>
<script src="../medias-enc.js"></script>
<script src="../../video-test.js"></script>
<script src="../../media-source/media-source-loader-simple.js"></script>
<script src="encrypted-media-clearKey-handler.js"></script>
<script>
const videoConf = streamMedias["simpleClearKeyMSE"].video;
function runTest() {
findMediaElement();
const emeHandler = new EncryptedMediaHandler(video, videoConf);
if (!emeHandler)
endTest();
video.addEventListener('timeupdate', function onTimeUpdate(event) {
if (video.paused)
endTest();
else {
if (video.currentTime >= 2) {
testExpected("video.currentTime", 2, ">=")
endTest();
}
}
});
const ms = new MediaSourceLoaderSimple(video);
ms.onready = function() {
logResult(true, "Media source is opened");
ms.createSourceBuffer(videoConf, 4);
video.play();
};
}
</script>
</head>
<body onload="runTest()">
<video></video>
</body>
</html>