video_loop_base.html (1402B)
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <title>Video Test: video_loop_base</title> 5 <link rel="author" title="Intel" href="http://www.intel.com" /> 6 <link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-media-loop" /> 7 <meta name="flags" content="" /> 8 <meta name="assert" content="Check if video.loop is set to true that expecting the seeking event is fired more than once" /> 9 <script src="/resources/testharness.js"></script> 10 <script src="/resources/testharnessreport.js"></script> 11 <script src="/common/media.js"></script> 12 </head> 13 <body> 14 <div id="log"></div> 15 <video id="m" controls>The user agent doesn't support media element.</video> 16 <script type="text/javascript"> 17 var media = document.getElementById("m"); 18 var name = document.getElementsByName("assert")[0].content; 19 var t = async_test(name); 20 var looped = false; 21 22 function startTest() { 23 if (looped) { 24 t.step(function() { 25 assert_true(true, "looped"); 26 }); 27 t.done(); 28 media.pause(); 29 } 30 31 looped = true; 32 } 33 34 media.addEventListener("seeking", startTest, false); 35 media.loop = true; 36 media.src = getVideoURI("/media/2x2-green") + "?" + new Date() + Math.random(); 37 media.play(); 38 </script> 39 </body> 40 </html>