media_fragment_seek.html (1621B)
1 <!doctype html> 2 <meta charset="utf-8"> 3 <meta name="timeout" content="long"> 4 <title>Video should seek to time specified in media fragment syntax</title> 5 <script src="/resources/testharness.js"></script> 6 <script src="/resources/testharnessreport.js"></script> 7 <script src="/common/media.js"></script> 8 <div id="log"></div> 9 <video id="video"></video> 10 <script> 11 async_test(function () { 12 let video = document.getElementById("video"); 13 video.src = getVideoURI('/media/movie_5') + "#t=4,7"; 14 video.load(); 15 this.step_timeout(function () { 16 assert_equals(video.currentTime, 4.0); 17 18 video.src = getVideoURI('/media/movie_5') + "#t=%6Ept:3"; 19 video.load(); 20 this.step_timeout(function () { 21 assert_true(video.src.endsWith("t=%6Ept:3")); 22 assert_equals(video.currentTime, 3.0); 23 24 video.src = getVideoURI('/media/movie_5') + "#t=00:00:01.00"; 25 video.load(); 26 this.step_timeout(function () { 27 assert_true(video.src.endsWith("t=00:00:01.00")); 28 assert_equals(video.currentTime, 1.0); 29 30 video.src = getVideoURI('/media/movie_5') + "#u=12&t=3"; 31 video.load(); 32 this.step_timeout(function () { 33 assert_true(video.src.endsWith("#u=12&t=3")); 34 assert_equals(video.currentTime, 3.0); 35 36 video.src = getVideoURI('/media/movie_5') + "#t=npt%3A3"; 37 video.load(); 38 this.step_timeout(function () { 39 assert_true(video.src.endsWith("t=npt%3A3")); 40 assert_equals(video.currentTime, 3.0); 41 this.done(); 42 }, 1000); 43 }, 1000); 44 }, 1000); 45 }, 1000); 46 }, 1000); 47 }); 48 </script>