| <!DOCTYPE html> |
| <html> |
| <head> |
| <title>Playback ClearKey WebM video </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["simpleClearKeyWebMMSE"].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, 1); |
| video.play(); |
| }; |
| } |
| </script> |
| </head> |
| <body onload="runTest()"> |
| <video></video> |
| </body> |
| </html> |