event_timeupdate.html (1120B)
1 <!doctype html> 2 <html> 3 <head> 4 <title>{audio,video} events - timeupdate</title> 5 <script src="/resources/testharness.js"></script> 6 <script src="/resources/testharnessreport.js"></script> 7 <script src="/common/media.js"></script> 8 </head> 9 <body> 10 <p><a href="https://html.spec.whatwg.org/multipage/#mediaevents">spec reference</a></p> 11 <audio id="a" autoplay controls> 12 </audio> 13 <video id="v" autoplay controls> 14 </video> 15 <div id="log"></div> 16 <script> 17 var ta = async_test("setting src attribute on a sufficiently long autoplay audio should trigger timeupdate event"); 18 var a = document.getElementById("a"); 19 a.addEventListener("timeupdate", function() { 20 ta.done(); 21 a.pause(); 22 }, false); 23 a.src = getAudioURI("/media/sound_5") + "?" + new Date() + Math.random(); 24 25 var tv = async_test("setting src attribute on a sufficiently long autoplay video should trigger timeupdate event"); 26 var v = document.getElementById("v"); 27 v.addEventListener("timeupdate", function() { 28 tv.done(); 29 v.pause(); 30 }, false); 31 v.src = getVideoURI("/media/movie_5") + "?" + new Date() + Math.random(); 32 </script> 33 </body> 34 </html>