| <!DOCTYPE html> |
| <html> |
| <head> |
| <title>Playback ClearKey CENC video with multi keys and multi resolutions </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["multiKeyClearKeyVideoMSE"].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 >= 4) { |
| testExpected("video.currentTime", 4, ">=") |
| endTest(); |
| } |
| }); |
| |
| const ms = new MediaSourceLoaderSimple(video); |
| ms.onready = function() { |
| logResult(true, "Media source is opened"); |
| ms.createSourceBuffer(videoConf, 8); |
| video.play(); |
| }; |
| } |
| </script> |
| </head> |
| <body onload="runTest()"> |
| <video></video> |
| </body> |
| </html> |