poster-12.html (914B)
1 <!DOCTYPE HTML> 2 <html class="reftest-wait"> 3 <!-- Test: Create video, load, play. Add poster frame, load again, poster should show. --> 4 <script> 5 function runTest() { 6 var v = document.createElement('video'); 7 8 var endTest = function() { 9 setTimeout(function(){document.documentElement.className = '';}, 0); 10 }; 11 12 var play = 13 function() { 14 v.removeEventListener('loadeddata', play); 15 v.play(); 16 } 17 18 var addPoster = function() { 19 v.removeEventListener('playing', addPoster); 20 v.poster = "blue140x100.png"; 21 v.addEventListener('loadeddata', endTest); 22 v.load(); 23 }; 24 25 v.addEventListener('loadeddata', 26 play); 27 v.addEventListener('playing', 28 addPoster); 29 v.id = 'v'; 30 v.src = "black140x100.webm"; 31 v.preload = "auto"; 32 document.body.appendChild(v); 33 } 34 35 </script> 36 <body style="background:white;" onload="runTest();"> 37 </body> 38 </html>