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
<li>The <dfn data-x-href="https://w3c.github.io/webvtt/#rules-for-updating-the-display-of-webvtt-text-tracks">rules for updating the display of WebVTT text tracks</dfn></li>
On setting, the <span>text track cue pause-on-exit flag</span> must be set if the new value is
37228
37212
true, and must be unset otherwise.</p>
37229
37213
37230
-
</div>
37231
-
37232
-
37233
-
<h6>Text tracks describing chapters</h6>
37234
-
37235
-
<p>Chapters are segments of a <span>media resource</span> with a given title. Chapters can be
37236
-
nested, in the same way that sections in a document outline can have subsections.</p>
37237
-
37238
-
<p>Each <span>text track cue</span> in a <span>text track</span> being used for describing
37239
-
chapters has three key features: the <span>text track cue start time</span>, giving the start time
37240
-
of the chapter, the <span>text track cue end time</span>, giving the end time of the chapter, and
37241
-
the <span>text track rules for extracting the chapter title</span>.</p>
37242
-
37243
-
<div w-nodev>
37244
-
37245
-
<p>The <dfn>rules for constructing the chapter tree from a text track</dfn> are as follows. They
37246
-
produce a potentially nested list of chapters, each of which have a start time, end time, title,
37247
-
and a list of nested chapters. This algorithm discards cues that do not correctly nest within each
37248
-
other, or that are out of order.</p>
37249
-
37250
-
<ol>
37251
-
37252
-
<li><p>Let <var>list</var> be a copy of the <span data-x="text track list of cues">list
37253
-
of cues</span> of the <span>text track</span> being processed.</p></li>
37254
-
37255
-
<li><p>Remove from <var>list</var> any <span>text track cue</span> whose <span>text
37256
-
track cue end time</span> is before its <span>text track cue start time</span>.</p></li>
37257
-
37258
-
<li><p>Let <var>output</var> be an empty list of chapters, where a chapter is a record
37259
-
consisting of a start time, an end time, a title, and a (potentially empty) list of nested
37260
-
chapters. For the purpose of this algorithm, each chapter also has a parent chapter.</p></li>
37261
-
37262
-
<li><p>Let <var>current chapter</var> be a stand-in chapter whose start time is negative
37263
-
infinity, whose end time is positive infinity, and whose list of nested chapters is <var>output</var>. (This is just used to make the algorithm easier to describe.)</p></li>
37264
-
37265
-
<!-- while not empty... -->
37266
-
<li><p><i>Loop</i>: If <var>list</var> is empty, jump to the step labeled
37267
-
<i>end</i>.</p></li>
37268
-
37269
-
<!-- do... -->
37270
-
<li><p>Let <var>current cue</var> be the first cue in <var>list</var>, and then
37271
-
remove it from <var>list</var>.</p></li>
37272
-
37273
-
<li><p>If <var>current cue</var>'s <span>text track cue start time</span> is less than
37274
-
the start time of <var>current chapter</var>, then return to the step labeled
37275
-
<i>loop</i>.</p> <!-- out of order chapter -->
37276
-
37277
-
<li><p>While <var>current cue</var>'s <span>text track cue start time</span> is greater
37278
-
than or equal to <var>current chapter</var>'s end time, let <var>current
37279
-
chapter</var> be <var>current chapter</var>'s parent chapter.</p></li>
37280
-
37281
-
<li><p>If <var>current cue</var>'s <span>text track cue end time</span> is greater than
37282
-
the end time of <var>current chapter</var>, then return to the step labeled
37283
-
<i>loop</i>.</p> <!-- misnested chapter -->
37284
-
37285
-
<li>
37286
-
37287
-
<p>Create a new chapter <var>new chapter</var>, whose start time is <var>current cue</var>'s <span>text track cue start time</span>, whose end time is <var>current cue</var>'s <span>text track cue end time</span>, whose title is the result of running <var>current cue</var>'s <span>text track rules for extracting the chapter title</span>, and whose list of nested chapters is
37288
-
empty.</p>
37289
-
37290
-
</li>
37291
-
37292
-
<li><p>Append <var>new chapter</var> to <var>current chapter</var>'s list of
37293
-
nested chapters, and let <var>current chapter</var> be <var>new chapter</var>'s
37294
-
parent.</p></li>
37295
-
37296
-
<li><p>Let <var>current chapter</var> be <var>new chapter</var>.</p></li>
37297
-
37298
-
<li><p>Return to the step labeled <i>loop</i>.</p></li>
0 commit comments