| 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                 MediaKeys.create('org.w3.clearkey').then(function(mediaKeys) { | 74                 navigator.requestMediaKeySystemAccess('org.w3.clearkey').then(fu
    nction(access) { | 
|  | 75                     return access.createMediaKeys(); | 
|  | 76                 }).then(function(mediaKeys) { | 
| 75 | 77 | 
| 76                     waitForEventAndRunStep('encrypted', video, onEncrypted, test
    ); | 78                     waitForEventAndRunStep('encrypted', video, onEncrypted, test
    ); | 
| 77                     waitForEventAndRunStep('playing', video, onPlaying, test); | 79                     waitForEventAndRunStep('playing', video, onPlaying, test); | 
| 78 | 80 | 
| 79                     video.src = '../content/test-encrypted.webm'; | 81                     video.src = '../content/test-encrypted.webm'; | 
| 80                     return video.setMediaKeys(mediaKeys); | 82                     return video.setMediaKeys(mediaKeys); | 
| 81                 }).then(function(result) { | 83                 }).then(function(result) { | 
| 82                     video.play(); | 84                     video.play(); | 
| 83                 }).catch(function(error) { | 85                 }).catch(function(error) { | 
| 84                     forceTestFailureFromPromise(test, error); | 86                     forceTestFailureFromPromise(test, error); | 
| 85                 }); | 87                 }); | 
| 86             }, 'Playback using Clear Key key system, calling setMediaKeys() afte
    r setting src attribute.'); | 88             }, 'Playback using Clear Key key system, calling setMediaKeys() afte
    r setting src attribute.'); | 
| 87         </script> | 89         </script> | 
| 88     </body> | 90     </body> | 
| 89 </html> | 91 </html> | 
| OLD | NEW | 
|---|