track-cues-pause-on-exit.html (1245B)
1 <!DOCTYPE html> 2 <title>Video is paused after cues having pause-on-exit flag are processed</title> 3 <script src="/common/media.js"></script> 4 <script src="/resources/testharness.js"></script> 5 <script src="/resources/testharnessreport.js"></script> 6 <video> 7 <track src="resources/simple-captions.vtt" default> 8 <script> 9 async_test(function(t) { 10 var video = document.querySelector("video"); 11 var track = document.querySelector("track"); 12 track.onload = t.step_func(function() { 13 assert_equals(track.track.cues.length, 4); 14 for (var i = 0; i < track.track.cues.length; ++i) { 15 var cue = track.track.cues[i]; 16 if (i % 2 == 0) { 17 cue.pauseOnExit = true; 18 cue.onexit = t.step_func(function(event) { 19 assert_true(video.paused); 20 21 video.play(); 22 23 if (event.target.id == 2) 24 t.done(); 25 }); 26 } 27 } 28 video.src = getVideoURI("/media/test"); 29 video.currentTime = 4.00; 30 video.play(); 31 assert_false(video.paused); 32 }); 33 }); 34 </script> 35 </video>