1547784.html (1179B)
1 <html class="reftest-wait"> 2 <head> 3 <script> 4 const doc = new Document(); 5 const video = document.createElementNS('http://www.w3.org/1999/xhtml', 'video'); 6 const source = new MediaSource(); 7 8 navigator.requestMediaKeySystemAccess('org.w3.clearkey', [{ '': [{ '': '' }] }]) 9 .then(keySystemAccess => { 10 return keySystemAccess.createMediaKeys(); 11 }).then(_ => { 12 video.src = URL.createObjectURL(source); 13 source.addEventListener('sourceopen', () => { 14 doc.adoptNode(video); 15 }); 16 }); 17 18 navigator.requestMediaKeySystemAccess('org.w3.clearkey', [{ '': [{ '': '' }] }]) 19 .then(keySystemAccess => { 20 return keySystemAccess.createMediaKeys(); 21 }).then(mediaKeys => { 22 return video.setMediaKeys(mediaKeys); 23 }).then(() => { 24 video.src = URL.createObjectURL(source); 25 document.documentElement.removeAttribute("class"); 26 }).catch(e => { 27 // Catch JS errors caused by raciness in the test. So long as we're 28 // not crashing we're good. 29 document.documentElement.removeAttribute("class"); 30 }); 31 </script> 32 </head> 33 </html>