Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 4255ed4

Browse filesBrowse files
Added region example to Introduction section under "Other features".
Extended the Data Model section to include regions and list of regions.
1 parent 59161ee commit 4255ed4
Copy full SHA for 4255ed4

File tree

Expand file treeCollapse file tree

1 file changed

+110
-7
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+110
-7
lines changed
Open diff view settings
Collapse file

‎webvtt.html‎

Copy file name to clipboardExpand all lines: webvtt.html
+110-7Lines changed: 110 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -448,6 +448,37 @@ <h3>Other features</h3>
448448
::cue(.loud) { font-size: 2em }</pre>
449449

450450
</div>
451+
452+
<div class="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:
454+
</p>
455+
456+
<pre>WEBVTT
457+
Region: id=fred width=50% lines=3 regionanchor=0%,100% viewportanchor=10%,90% scroll=up
458+
Region: id=bill width=50% lines=3 regionanchor=100%,100% viewportanchor=90%,90% scroll=up
459+
460+
00:00:00.000 --> 00:00:20.000 region:fred align:left
461+
&lt;v Fred>Hi, my name is Fred
462+
463+
00:00:02.500 --> 00:00:22.500 region:bill align:right
464+
&lt;v Bill>Hi, I'm Bill
465+
466+
00:00:05.000 --> 00:00:25.000 region:fred align:left
467+
&lt;v Fred>Would you like to get a coffee?
468+
469+
00:00:07.500 --> 00:00:27.500 region:bill align:right
470+
&lt;v Bill>Sure! I've only had one today.
471+
472+
00:00:10.000 --> 00:00:30.000 region:fred align:left
473+
&lt;v Fred>This is my fourth!
474+
475+
00:00:12.500 --> 00:00:32.500 region:fred align:left
476+
&lt;v Fred>OK, let's go.</pre>
477+
478+
<p>Note that regions are only defined for horizontal cues.</p>
479+
480+
</div>
481+
451482
</section>
452483

453484
</section>
@@ -505,6 +536,9 @@ <h3>Dependencies</h3>
505536
<section>
506537
<h2>Data model</h2>
507538

539+
<section>
540+
<h3>Text Track Cues</h3>
541+
508542
<p>WebVTT cues are HTML <a title="text track cue">text track cues</a> that additionally
509543
consist of the following: <a href="#refsHTML5">[HTML5]</a></p>
510544

@@ -603,9 +637,7 @@ <h2>Data model</h2>
603637

604638
<dt><dfn title="text track cue text position">A text position</dfn>
605639
<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 <a title="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 <span title="text track cue writing direction">writing direction</span>, otherwise to be interpreted as a percentage of the region width.</p>
609641
</dd>
610642

611643
<dt><dfn title="text track cue size">A size</dfn>
@@ -645,6 +677,11 @@ <h2>Data model</h2>
645677

646678
</dd>
647679

680+
<dt><dfn title="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+
648685
</dl>
649686

650687
<p>The associated <a>rules for updating the text track rendering</a> of WebVTT <a
@@ -658,15 +695,81 @@ <h2>Data model</h2>
658695
direction</a>, <a title="text track cue snap-to-lines flag">snap-to-lines flag</a>, <a
659696
title="text track cue line position">line position</a>, <a title="text track cue text
660697
position">text position</a>, <a title="text track cue size">size</a>, <a title="text
661-
track cue alignment">alignment</a>, or <a title="text track cue text">text</a> change
662-
value, then the user agent must empty the <a>text track cue display state</a>, and then
663-
immediately run the <a>text track</a>'s <a>rules for updating the display of WebVTT text
664-
tracks</a>.</p>
698+
track cue alignment">alignment</a>, <a title="text track regon identifier">region</a>,
699+
or <a title="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>
665702

666703
</div>
667704

668705
</section>
669706

707+
<section>
708+
<h3>Text track region</h3>
709+
710+
<p>A <dfn title="text track region">text track region</dfn> represents a subpart of the video viewport and provides a rendering area for <a title="text track cue">text track cues</a>.</p>
711+
712+
<p>Each <a tile="text track region">text track region</a> consists of:</p>
713+
714+
<dl>
715+
716+
<dt><dfn title="text track region identifier">An identifier</dfn></dt>
717+
<dd>
718+
<p>An arbitrary string.</p>
719+
</dd>
720+
721+
<dt><dfn title="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><dfn title="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><dfn title="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><dfn title="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><dfn title="text track region scroll">A scroll value</dfn></dt>
742+
<dd>
743+
<p>One of the following:</p>
744+
<dl>
745+
<dt><dfn title="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><dfn title="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><dfn title="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 <a title="text track region">text track regions</a>. The <a title="text track list of regions">list of regions of a text track</a> can change dynamically, either because the <a title="text track">text track</a> has <a title="text track not loaded">not yet been loaded</a> or is still <a title="text track loading">loading</a>.</p>
766+
767+
</dd>
768+
</dl>
769+
</section>
770+
771+
</section>
772+
670773
<section>
671774
<h2>The WebVTT file format</h2>
672775

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.