Fri, 16 Jan 2015 18:13:44 +0100
Integrate suggestion from review to improve consistency with existing code.
1 <!DOCTYPE HTML>
2 <html class="reftest-wait">
3 <!-- Test: Create video, load. Add poster frame, load again, poster should show. -->
4 <script>
5 function runTest() {
6 var v = document.createElement('video');
8 var endTest = function() {
9 setTimeout(function(){document.documentElement.className = '';}, 0);
10 };
12 var addPoster = function() {
13 v.removeEventListener('loadeddata', addPoster, false);
14 v.poster = "blue140x100.png";
15 v.addEventListener('loadeddata', endTest, false);
16 v.load();
17 };
19 v.addEventListener('loadeddata', addPoster, false);
20 v.id = 'v';
21 v.src = "black140x100.webm";
22 v.preload = "auto";
23 document.body.appendChild(v);
24 }
26 </script>
27 <body style="background:white;" onload="runTest();">
28 </body>
29 </html>