OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <title>Multiple playbacks alternating between encrypted and clear source
s.</title> | 4 <title>Multiple playbacks alternating between encrypted and clear source
s.</title> |
5 <script src="encrypted-media-utils.js"></script> | 5 <script src="encrypted-media-utils.js"></script> |
6 <script src="../../resources/testharness.js"></script> | 6 <script src="../../resources/testharness.js"></script> |
7 <script src="../../resources/testharnessreport.js"></script> | 7 <script src="../../resources/testharnessreport.js"></script> |
8 </head> | 8 </head> |
9 <body> | 9 <body> |
10 <video id="testVideo"></video> | 10 <video id="testVideo"></video> |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 return video.setMediaKeys(null); | 91 return video.setMediaKeys(null); |
92 } | 92 } |
93 | 93 |
94 function startPlayback() { | 94 function startPlayback() { |
95 if (playbackCount % 2) { | 95 if (playbackCount % 2) { |
96 video.src = '../content/test-vp8-vorbis-webvtt.webm'; | 96 video.src = '../content/test-vp8-vorbis-webvtt.webm'; |
97 video.play(); | 97 video.play(); |
98 return; | 98 return; |
99 } | 99 } |
100 | 100 |
101 navigator.requestMediaKeySystemAccess('org.w3.clearkey', [{}
]).then(function(access) { | 101 requestClearKeySystemAccessForInitType('webm').then(function
(access) { |
102 return access.createMediaKeys(); | 102 return access.createMediaKeys(); |
103 }).then(function(mediaKeys) { | 103 }).then(function(mediaKeys) { |
104 return video.setMediaKeys(mediaKeys); | 104 return video.setMediaKeys(mediaKeys); |
105 }).then(function(result) { | 105 }).then(function(result) { |
106 video.src = '../content/test-encrypted.webm'; | 106 video.src = '../content/test-encrypted.webm'; |
107 assert_false(video.mediaKeys === null, "video.mediaKeys
is null."); | 107 assert_false(video.mediaKeys === null, "video.mediaKeys
is null."); |
108 video.play(); | 108 video.play(); |
109 }).catch(function(error) { | 109 }).catch(function(error) { |
110 forceTestFailureFromPromise(test, error); | 110 forceTestFailureFromPromise(test, error); |
111 }); | 111 }); |
112 } | 112 } |
113 | 113 |
114 waitForEventAndRunStep('playing', video, onPlaying, test); | 114 waitForEventAndRunStep('playing', video, onPlaying, test); |
115 waitForEventAndRunStep('encrypted', video, onEncrypted, test); | 115 waitForEventAndRunStep('encrypted', video, onEncrypted, test); |
116 startPlayback(); | 116 startPlayback(); |
117 }, 'Multiple playbacks alternating between encrypted and clear sourc
es.'); | 117 }, 'Multiple playbacks alternating between encrypted and clear sourc
es.'); |
118 </script> | 118 </script> |
119 </body> | 119 </body> |
120 </html> | 120 </html> |
OLD | NEW |