OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <title>Clear Key Playback</title> | 4 <title>Clear Key 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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 } | 64 } |
65 | 65 |
66 function onTimeUpdate(event) | 66 function onTimeUpdate(event) |
67 { | 67 { |
68 if (event.target.currentTime < 0.2 || !isUpdatePromiseResolv
ed) | 68 if (event.target.currentTime < 0.2 || !isUpdatePromiseResolv
ed) |
69 return; | 69 return; |
70 | 70 |
71 test.done(); | 71 test.done(); |
72 } | 72 } |
73 | 73 |
74 navigator.requestMediaKeySystemAccess('org.w3.clearkey', [{}]).t
hen(function(access) { | 74 requestClearKeySystemAccessForInitType('webm').then(function(acc
ess) { |
75 return access.createMediaKeys(); | 75 return access.createMediaKeys(); |
76 }).then(function(mediaKeys) { | 76 }).then(function(mediaKeys) { |
77 | 77 |
78 waitForEventAndRunStep('encrypted', video, onEncrypted, test
); | 78 waitForEventAndRunStep('encrypted', video, onEncrypted, test
); |
79 waitForEventAndRunStep('playing', video, onPlaying, test); | 79 waitForEventAndRunStep('playing', video, onPlaying, test); |
80 | 80 |
81 return video.setMediaKeys(mediaKeys); | 81 return video.setMediaKeys(mediaKeys); |
82 }).then(function(result) { | 82 }).then(function(result) { |
83 video.src = '../content/test-encrypted.webm'; | 83 video.src = '../content/test-encrypted.webm'; |
84 video.play(); | 84 video.play(); |
85 }).catch(function(error) { | 85 }).catch(function(error) { |
86 forceTestFailureFromPromise(test, error); | 86 forceTestFailureFromPromise(test, error); |
87 }); | 87 }); |
88 }, 'Playback using Clear Key key system, calling setMediaKeys() befo
re setting src attribute.'); | 88 }, 'Playback using Clear Key key system, calling setMediaKeys() befo
re setting src attribute.'); |
89 </script> | 89 </script> |
90 </body> | 90 </body> |
91 </html> | 91 </html> |
OLD | NEW |