You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: webvtt.html
+110-7Lines changed: 110 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -448,6 +448,37 @@ <h3>Other features</h3>
448
448
::cue(.loud) { font-size: 2em }</pre>
449
449
450
450
</div>
451
+
452
+
<divclass="example">
453
+
<p>This example shows two regions containing rollup captions for two different speakers. Fred's cues scroll up in a region in the left half of the video, Bill's cues scroll up in a region on the right half of the video. Fred's first cue disappears at 12.5sec even through it is defined until 20sec because its region is limited to 3 lines and at 12.5sec a fourth cue appears:
<p>Note that regions are only defined for horizontal cues.</p>
479
+
480
+
</div>
481
+
451
482
</section>
452
483
453
484
</section>
@@ -505,6 +536,9 @@ <h3>Dependencies</h3>
505
536
<section>
506
537
<h2>Data model</h2>
507
538
539
+
<section>
540
+
<h3>Text Track Cues</h3>
541
+
508
542
<p>WebVTT cues are HTML <atitle="text track cue">text track cues</a> that additionally
509
543
consist of the following: <ahref="#refsHTML5">[HTML5]</a></p>
510
544
@@ -603,9 +637,7 @@ <h2>Data model</h2>
603
637
604
638
<dt><dfntitle="text track cue text position">A text position</dfn>
605
639
<dd>
606
-
<p>A number giving the position of the text of the cue within each line, to be interpreted as a
607
-
percentage of the video, as defined by the <atitle="text track cue writing
608
-
direction">writing direction</a>.</p>
640
+
<p>A number giving the position of the text of the cue within each line. If the cue is not within a region, to be interpreted as a percentage of the video, as defined by the <spantitle="text track cue writing direction">writing direction</span>, otherwise to be interpreted as a percentage of the region width.</p>
609
641
</dd>
610
642
611
643
<dt><dfntitle="text track cue size">A size</dfn>
@@ -645,6 +677,11 @@ <h2>Data model</h2>
645
677
646
678
</dd>
647
679
680
+
<dt><dfntitle="text track cue region identifier">A region identifier</dfn></dt>
681
+
<dd>
682
+
<p>A string that references by identifier the region that a cue belongs to, if it is not null.</p>
683
+
</dd>
684
+
648
685
</dl>
649
686
650
687
<p>The associated <a>rules for updating the text track rendering</a> of WebVTT <a
or <atitle="text track cue text">text</a> change value, then the user agent must empty
700
+
the <a>text track cue display state</a>, and then immediately run the <a>text track</a>'s
701
+
<a>rules for updating the display of WebVTT text tracks</a>.</p>
665
702
666
703
</div>
667
704
668
705
</section>
669
706
707
+
<section>
708
+
<h3>Text track region</h3>
709
+
710
+
<p>A <dfntitle="text track region">text track region</dfn> represents a subpart of the video viewport and provides a rendering area for <atitle="text track cue">text track cues</a>.</p>
<dt><dfntitle="text track region identifier">An identifier</dfn></dt>
717
+
<dd>
718
+
<p>An arbitrary string.</p>
719
+
</dd>
720
+
721
+
<dt><dfntitle="text track region width">A width</dfn></dt>
722
+
<dd>
723
+
<p>A number giving the width of the box within which the text of each line of the containing cues is to be rendered, to be interpreted as a percentage of the video width. Defaults to 100.</p>
724
+
</dd>
725
+
726
+
<dt><dfntitle="text track region lines">A lines value</dfn></dt>
727
+
<dd>
728
+
<p>A number giving the number of lines of the box within which the text of each line of the containing cues is to be rendered. Defaults to 3.</p>
729
+
</dd>
730
+
731
+
<dt><dfntitle="text track region anchor">A region anchor point</dfn></dt>
732
+
<dd>
733
+
<p>Two numbers giving the x and y coordinates within the region which is anchored to the video viewport and does not change location even when the region does, e.g. because of font size changes. Defaults to (0,100), i.e. the bottom left corner of the region.</p>
734
+
</dd>
735
+
736
+
<dt><dfntitle="text track region viewport anchor">A region viewport anchor point</dfn></dt>
737
+
<dd>
738
+
<p>Two numbers giving the x and y coordinates within the video viewport to which the region anchor point is anchored. Defaults to (0,100), i.e. the bottom left corner of the viewport.</p>
739
+
</dd>
740
+
741
+
<dt><dfntitle="text track region scroll">A scroll value</dfn></dt>
742
+
<dd>
743
+
<p>One of the following:</p>
744
+
<dl>
745
+
<dt><dfntitle="text track region scroll none">None</dfn></dt>
746
+
<dd>Indicates that the cues in the region are not to scroll and instead stay fixed at the location they were first painted in.</dd>
747
+
748
+
<dt><dfntitle="text track region scroll up">Up</dfn></dt>
749
+
<dd>Indicates that the cues in the region will be added at the bottom of the region and push any already displayed cues in the region up until all lines of the new cue are visible in the region.</dd>
750
+
<!-- in the future we may introduce scroll="down"-->
751
+
</dl>
752
+
</dd>
753
+
</dl>
754
+
755
+
</section>
756
+
757
+
<section>
758
+
<h3>Text track list of regions</h3>
759
+
760
+
<dl>
761
+
<dt><dfntitle="text track list of regions">A text track list of regions</dfn></dfn>
762
+
763
+
<dd>
764
+
765
+
<p>A list of zero or more <atitle="text track region">text track regions</a>. The <atitle="text track list of regions">list of regions of a text track</a> can change dynamically, either because the <atitle="text track">text track</a> has <atitle="text track not loaded">not yet been loaded</a> or is still <atitle="text track loading">loading</a>.</p>
0 commit comments