allowed-to-play.html (710B)
1 <!doctype html> 2 <title><audio and <video> autoplay</title> 3 <link rel="help" href="https://html.spec.whatwg.org/multipage/media.html#dom-media-play"> 4 <script src="/resources/testharness.js"></script> 5 <script src="/resources/testharnessreport.js"></script> 6 <script src="/common/media.js"></script> 7 <video></video> 8 <script> 9 async_test(t => { 10 const a = new Audio(getAudioURI("/media/sound_5")); 11 a.play(); 12 assert_false(a.paused); 13 a.onplaying = t.step_func_done(); 14 }, "<audio> autoplay"); 15 16 async_test(t => { 17 const v = document.querySelector("video"); 18 v.src = getVideoURI("/media/movie_5"); 19 v.play(); 20 assert_false(v.paused); 21 v.onplaying = t.step_func_done(); 22 }, "<video> autoplay"); 23 </script>