OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <title>Reloading during encrypted media playback</title> | 4 <title>Reloading during encrypted media playback</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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 // Reload the page to catch any possible teardown issues. | 73 // Reload the page to catch any possible teardown issues. |
74 if (location.hash == '#x') { | 74 if (location.hash == '#x') { |
75 test.done(); | 75 test.done(); |
76 return; | 76 return; |
77 } | 77 } |
78 | 78 |
79 location.hash += 'x'; | 79 location.hash += 'x'; |
80 location.reload(); | 80 location.reload(); |
81 } | 81 } |
82 | 82 |
83 navigator.requestMediaKeySystemAccess('org.w3.clearkey', [{}]).t
hen(function(access) { | 83 getSupportedInitDataType().then(function(initDataType) { |
| 84 return requestClearKeySystemAccessForInitType(initDataType); |
| 85 }).then(function(access) { |
84 return access.createMediaKeys(); | 86 return access.createMediaKeys(); |
85 }).then(function(mediaKeys) { | 87 }).then(function(mediaKeys) { |
86 waitForEventAndRunStep('encrypted', video, onEncrypted, test
); | 88 waitForEventAndRunStep('encrypted', video, onEncrypted, test
); |
87 waitForEventAndRunStep('playing', video, onPlaying, test); | 89 waitForEventAndRunStep('playing', video, onPlaying, test); |
88 video.src = '../content/test-encrypted.webm'; | 90 video.src = '../content/test-encrypted.webm'; |
89 return video.setMediaKeys(mediaKeys); | 91 return video.setMediaKeys(mediaKeys); |
90 }).then(function(result) { | 92 }).then(function(result) { |
91 video.play(); | 93 video.play(); |
92 }).catch(function(error) { | 94 }).catch(function(error) { |
93 forceTestFailureFromPromise(test, error); | 95 forceTestFailureFromPromise(test, error); |
94 }); | 96 }); |
95 }, 'Reloading during encrypted media playback.'); | 97 }, 'Reloading during encrypted media playback.'); |
96 </script> | 98 </script> |
97 </body> | 99 </body> |
98 </html> | 100 </html> |
OLD | NEW |