OLD | NEW |
---|---|
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <title>Text track cue layout after controls are added (reference)</title> | 2 <title>Text track cue layout after controls are added (reference)</title> |
3 <style> | 3 <style> |
4 ::cue { | 4 ::cue { |
5 font-size: 50px; | 5 font-size: 50px; |
6 } | 6 } |
7 </style> | 7 </style> |
8 <video controls style="border:1px solid gray"> | 8 <video controls style="border:1px solid gray; width: 500px;"> |
whywhat
2016/09/15 18:29:48
ditto
kdsilva
2016/09/16 11:28:58
Done.
| |
9 <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"> |
10 <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"> |
11 </video> | 11 </video> |
12 <script> | 12 <script> |
13 // Add a single cue at line -2, where it would be if there were controls visible | 13 // Add a single cue at line -2, where it would be if there were controls visible |
14 // at the bottom. (This assumes that those controls are less than 50px high.) | 14 // at the bottom. (This assumes that those controls are less than 50px high.) |
15 // cue at line -1. | 15 // cue at line -1. |
16 var video = document.querySelector("video"); | 16 var video = document.querySelector("video"); |
17 var track = video.addTextTrack("captions"); | 17 var track = video.addTextTrack("captions"); |
18 var cue = new VTTCue(0, 1, "text"); | 18 var cue = new VTTCue(0, 1, "text"); |
19 cue.line = -2; | 19 cue.line = -2; |
20 track.addCue(cue); | 20 track.addCue(cue); |
21 track.mode = "showing"; | 21 track.mode = "showing"; |
22 </script> | 22 </script> |
OLD | NEW |