blob: 90a1ecf3372050409ff5a325b99679643badb0f3 [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<title>Playback ClearKey CENC audio with full-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 audioConf = streamMedias["simpleClearKeyMSE"].audio;
function runTest() {
findMediaElement();
const emeHandler = new EncryptedMediaHandler(video, audioConf);
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(audioConf, 4);
video.play();
};
}
</script>
</head>
<body onload="runTest()">
<video></video>
</body>
</html>