OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <title>WebVTT two-cue layout after the first cue has ended</title> | 2 <title>Text track cue layout after controls are removed</title> |
3 <video style="border:1px solid gray"> | 3 <style> |
| 4 ::cue { |
| 5 font-size: 50px; |
| 6 } |
| 7 </style> |
| 8 <video controls style="border:1px solid gray"> |
4 <source src="opera/track/webvtt/rendering/reftest/media/white.webm" type="vide
o/webm"> | 9 <source src="opera/track/webvtt/rendering/reftest/media/white.webm" type="vide
o/webm"> |
5 <source src="opera/track/webvtt/rendering/reftest/media/white.mp4" type="video
/mp4"> | 10 <source src="opera/track/webvtt/rendering/reftest/media/white.mp4" type="video
/mp4"> |
6 </video> | 11 </video> |
7 <script> | 12 <script> |
8 // Without testRunner.displayAsyncThen there is no guarantee for when the first | 13 // Without testRunner.displayAsyncThen there is no guarantee for when the first |
9 // cue layout is done, so make no attempt to work without testRunner. | 14 // cue layout is done, so make no attempt to work without testRunner. |
10 testRunner.waitUntilDone(); | 15 testRunner.waitUntilDone(); |
11 | 16 |
12 // Add two cues, where the first cue ends before the second. | 17 // Add a cue that will overlap with the video controls. |
13 var video = document.querySelector("video"); | 18 var video = document.querySelector("video"); |
14 var track = video.addTextTrack("captions"); | 19 var track = video.addTextTrack("captions"); |
15 track.addCue(new VTTCue(0, 1, "cue 1")); | 20 track.addCue(new VTTCue(0, 1, "text")); |
16 track.addCue(new VTTCue(0, 3, "cue 2")); | |
17 track.mode = "showing"; | 21 track.mode = "showing"; |
18 | 22 |
19 video.onloadeddata = function() { | 23 video.onloadeddata = function() { |
20 testRunner.displayAsyncThen(function() { | 24 testRunner.displayAsyncThen(function() { |
21 // Seek past the end of the first cue. The second cue should not move. | 25 // Remove the controls. The cue should not move. |
22 video.currentTime = 2; | 26 video.controls = false; |
23 video.onseeked = function() { testRunner.notifyDone(); }; | 27 testRunner.notifyDone(); |
24 }); | 28 }); |
25 }; | 29 }; |
26 </script> | 30 </script> |
OLD | NEW |