HTML5 Tracker

Diff (omit for latest revision)
Filter

Short URL: http://html5.org/r/5072

SVNBugCommentTime (UTC)
5072[Gecko] [Internet Explorer] [Opera] [Webkit] Captions - Stage 3: defining what a timed track and a timed track cue are.2010-05-04 10:05
Index: source
===================================================================
--- source	(revision 5071)
+++ source	(revision 5072)
@@ -25353,8 +25353,8 @@
 };
 
 interface <dfn>MutableMediaTrack</dfn> : <span>MediaTrack</span> {
- void <span title="dom-MutableMediaTrack-addCue">addCue">(in <span>MediaCue</span> cue);
- void <span title="dom-MutableMediaTrack-removeCue">removeCue">(in <span>MediaCue</span> cue);
+ void <span title="dom-MutableMediaTrack-addCue">addCue</span>(in <span>MediaCue</span> cue);
+ void <span title="dom-MutableMediaTrack-removeCue">removeCue</span>(in <span>MediaCue</span> cue);
 };
 
 interface <dfn>MediaCueList</dfn> {
@@ -25372,11 +25372,11 @@
   readonly attribute float <span title="dom-MediaCue-endTime">endTime</span>;
   readonly attribute boolean <span title="dom-MediaCue-pauseOnExit">pauseOnExit</span>;
 
+  readonly attribute DOMString <span title="dom-MediaCue-direction">direction</span>;
   readonly attribute boolean <span title="dom-MediaCue-snapToLines">snapToLines</span>;
   readonly attribute long <span title="dom-MediaCue-linePosition">linePosition</span>;
   readonly attribute long <span title="dom-MediaCue-textPosition">textPosition</span>;
   readonly attribute long <span title="dom-MediaCue-size">size</span>;
-  readonly attribute DOMString <span title="dom-MediaCue-direction">direction</span>;
   readonly attribute DOMString <span title="dom-MediaCue-alignment">alignment</span>;
 
   readonly attribute DOMString <span title="dom-MediaCue-voice">voice</span>;
@@ -27859,8 +27859,214 @@
 
   <h5>Timed tracks</h5>
 
-  <p class="XXX">processing model for timed tracks</p>
+  <h6>Timed track model</h6>
 
+  <p>A <span>media element</span> can have a group of associated <dfn
+  title="timed track">timed tracks</dfn>, known as the <span>media
+  element</span>'s <dfn>list of timed tracks</dfn>. The <span
+  title="timed track">timed tracks</span> are sorted as follows:</p>
+
+  <ol class="brief">
+
+   <li>The <span title="timed track">timed tracks</span> corresponding
+   to <code>track</code> element children of the <span>media
+   element</span>, in <span>tree order</span>.</li>
+
+   <li>Any <span title="timed track">timed tracks</span> added using
+   the <code title="dom-media-addTrack">addTrack()</code> method, in
+   the order they were added, oldest first.</li>
+
+   <li>Any <span title="timed track">timed tracks</span> corresponding
+   to data in the <span>media resource</span>, in the order defined by
+   the <span>media resource</span>'s format specification.</li>
+
+  </ol>
+
+  <p>A <span>timed track</span> consists of:</p>
+
+  <dl>
+
+   <dt><dfn title="timed track kind">The kind of timed track</dfn>
+
+   <dd>
+
+    <p>This decides how the track is handled by the user agent. The
+    kind is represented by a string. The possible strings are:</p>
+
+    <ul class="brief">
+     <li><dfn title="dom-MediaTrack-kind-subtitles"><code>subtitles</code></dfn>
+     <li><dfn title="dom-MediaTrack-kind-captions"><code>captions</code></dfn>
+     <li><dfn title="dom-MediaTrack-kind-descriptions"><code>descriptions</code></dfn>
+     <li><dfn title="dom-MediaTrack-kind-chapters"><code>chapters</code></dfn>
+     <li><dfn title="dom-MediaTrack-kind-metadata"><code>metadata</code></dfn>
+    </ul>
+
+    <p>The <span title="timed track kind">kind of track</span> can
+    change dynamically, in the case of a <span>timed track</span>
+    corresponding to a <code>track</code> element.</p>
+
+   </dd>
+
+   <dt><dfn title="timed track label">A label</dfn>
+
+   <dd>
+
+    <p>This is a human-readable string intended to identify the track
+    for the user. In certain cases, the label might be generated
+    automatically.</p>
+
+    <p>The <span title="timed track label">label of a track</span> can
+    change dynamically, in the case of a <span>timed track</span>
+    corresponding to a <code>track</code> element or in the case of an
+    automatically-generated label whose value depends on variable
+    factors such as the user's preferred user interface language.</p>
+
+   </dd>
+
+   <dt><dfn title="timed track language">A language</dfn>
+
+   <dd>
+
+    <p>This is a string (a BCP 47 language tag) representing the
+    language of the timed track's cues. <a
+    href="#refsBCP47">[BCP47]</a></p>
+
+    <p>The <span title="timed track language">language of a timed
+    track</span> can change dynamically, in the case of a <span>timed
+    track</span> corresponding to a <code>track</code> element.</p>
+
+   </dd>
+
+   <dt><dfn title="timed track list of cues">A list of zero or more cues</dfn>
+
+   <dd>
+
+    <p>A list of <span title="timed track cue">timed track cues</span>.</p>
+
+    <p>The <span title="timed track list of cues">list of cues of a
+    timed track</span> can change dynamically, in the case of a
+    <span>timed track</span> corresponding to a
+    <code>MutableTimedTrack</code> object: individual cues can be
+    added or removed dynamically.</p>
+
+   </dd>
+
+  </dl>
+
+  <p>A <dfn>timed track cue</dfn> is the unit of time-sensitive data
+  in a <span>timed track</span>, corresponding for instance for
+  subtitles and captions to the text that appears at a particular time
+  and disappears at another time.</p>
+
+  <p>Each <span>timed track cue</span> consists of:</p>
+
+  <dl>
+
+   <dt><dfn title="timed track cue identifier">An identifier</dfn>
+   <dd>
+    <p>An arbitrary string.</p>
+   </dd>
+
+   <dt><dfn title="timed track cue start time">A start time</dfn>
+   <dd>
+    <p>A time, in seconds and fractions of a second, at which the cue
+    becomes relevant.</p>
+   </dd>
+
+   <dt><dfn title="timed track cue end time">An end time</dfn>
+   <dd>
+    <p>A time, in seconds and fractions of a second, at which the cue
+    stops being relevant.</p>
+   </dd>
+
+   <dt><dfn title="timed track cue pause-on-exit flag">A pause-on-exit flag</dfn>
+   <dd>
+    <p>A boolean indicating whether playback of the <span>media
+    resource</span> is to pause when the cue stops being relevant.</p>
+   </dd>
+
+   <dt><dfn title="timed track cue writing direction">A writing direction</dfn>
+   <dd>
+    <p>A writing direction, either <dfn title="timed track cue
+    horizontal writing direction">horizontal</dfn> (a line extends
+    horizontally and is positioned vertically, with consecutive lines
+    displayed below each other), <dfn title="timed track cue vertical
+    growing right writing direction">vertical growing right</dfn> (a
+    line extends vertically and is positioned horizontally, with
+    consecutive lines displayed to the right of each other<!-- used
+    for east asian-->), or <dfn title="timed track cue vertical
+    growing left writing direction">vertical growing left</dfn> (a
+    line extends vertically and is positioned horizontally, with
+    consecutive lines displayed to the left of each other<!-- used for
+    mongolian -->).</p>
+   </dd>
+
+   <dt><dfn title="timed track cue snap-to-lines flag">A snap-to-lines flag</dfn>
+   <dd>
+    <p>A boolean indicating whether the <span title="timed track cue
+    line position">line's position</span> is a line position
+    (positioned to a multiple of the line dimensions of the first line
+    of the cue), or whether it is a percentage of the dimension of the
+    video.</p>
+   </dd>
+
+   <dt><dfn title="timed track cue line position">A line position</dfn>
+   <dd>
+    <p>A number giving the position of the lines of the cue, to be
+    interpreted as defined by the <span title="timed track cue writing
+    direction">writing direction</span> and <span title="timed track
+    cue snap-to-lines flag">snap-to-lines flag</span> of the cue.</p>
+   </dd>
+
+   <dt><dfn title="timed track cue text position">A text position</dfn>
+   <dd>
+    <p>A number giving the position of the text of the cue within each
+    line, to be interpreted as a percentage of the video, as defined
+    by the <span title="timed track cue writing direction">writing
+    direction</span>.</p>
+   </dd>
+
+   <dt><dfn title="timed track cue size">A size</dfn>
+   <dd>
+    <p>A number giving the size of the box within which the text of
+    each line of the cue is to be aligned, to be interpreted as a
+    percentage of the video, as defined by the <span title="timed
+    track cue writing direction">writing direction</span>.</p>
+   </dd>
+
+   <dt><dfn title="timed track cue alignment">An alignment</dfn>
+   <dd>
+    <p>An alignment for the text of each line of the cue, either <dfn
+    title="timed track cue start alignment">start alignment</dfn> (the
+    text is aligned towards its start side), <dfn title="timed track
+    cue middle alignment">middle alignment</dfn> (the text is aligned
+    centered between its start and end sides), <dfn title="timed track
+    cue end alignment">end alignment</dfn> (the text is aligned
+    towards its end side). Which sides are the start and end sides
+    depends on the Unicode bidirectional algorithm and the <span
+    title="timed track cue writing direction">writing
+    direction</span>. <a href="#refsBIDI">[BIDI]</a></p>
+   </dd>
+
+   <dt><dfn title="timed track cue voice identifier">A voice identifier</dfn>
+   <dd>
+    <p>A string identifying the voice with which the cue is associated.</p>
+   </dd>
+
+   <dt><dfn title="timed track cue text">The text of the cue</dfn>
+   <dd>
+    <p>The raw text of the cue, and rules for its interpretation,
+    allowing the text to be converted to an equivalent fragment of
+    HTML.</p>
+   </dd>
+
+  </dl>
+
+  <p class="XXX">...
+
+
+  <h6>Timed track API</h6>
+
 <!--
   // timed tracks on HTMLMediaElement:
   readonly attribute <span>MediaTrack</span>[] <span title="dom-media-tracks">tracks</span>;
@@ -27883,8 +28089,8 @@
 };
 
 interface <dfn>MutableMediaTrack</dfn> : <span>MediaTrack</span> {
- void <span title="dom-MutableMediaTrack-addCue">addCue">(in <span>MediaCue</span> cue);
- void <span title="dom-MutableMediaTrack-removeCue">removeCue">(in <span>MediaCue</span> cue);
+ void <span title="dom-MutableMediaTrack-addCue">addCue</span>(in <span>MediaCue</span> cue);
+ void <span title="dom-MutableMediaTrack-removeCue">removeCue</span>(in <span>MediaCue</span> cue);
 };
 
 interface <dfn>MediaCueList</dfn> {
@@ -27902,11 +28108,11 @@
   readonly attribute float <span title="dom-MediaCue-endTime">endTime</span>;
   readonly attribute boolean <span title="dom-MediaCue-pauseOnExit">pauseOnExit</span>;
 
+  readonly attribute DOMString <span title="dom-MediaCue-direction">direction</span>;
   readonly attribute boolean <span title="dom-MediaCue-snapToLines">snapToLines</span>;
   readonly attribute long <span title="dom-MediaCue-linePosition">linePosition</span>;
   readonly attribute long <span title="dom-MediaCue-textPosition">textPosition</span>;
   readonly attribute long <span title="dom-MediaCue-size">size</span>;
-  readonly attribute DOMString <span title="dom-MediaCue-direction">direction</span>;
   readonly attribute DOMString <span title="dom-MediaCue-alignment">alignment</span>;
 
   readonly attribute DOMString <span title="dom-MediaCue-voice">voice</span>;
@@ -27915,28 +28121,45 @@
 };
 -->
 
-  <h6>Timed track model</h6>
+  <p class="XXX">domintro
 
+  <div class="impl">
+
   <p class="XXX">...
 
-  <h6>Event definitions</h6>
+  </div>
 
+
+  <h6>In-band timed tracks</h6>
+
   <p class="XXX">...
 
-<!-- XXX
-CueEvent
- readonly attribute MediaCue cue;
--->
 
-  <h6>In-band timed tracks</h6>
+  <h6>WebSRT timed tracks</h6>
 
   <p class="XXX">...
 
-  <h6>WebSRT</h6>
 
+  <h6>Sourcing timed tracks</h6>
+
   <p class="XXX">...
 
 
+  <h6>Timed track processing model</h6>
+
+  <p class="XXX">...
+
+
+  <h6>Event definitions</h6>
+
+  <p class="XXX">...
+
+<!-- XXX
+CueEvent
+ readonly attribute MediaCue cue;
+-->
+
+
   <h5>User interface</h5>
 
   <p>The <dfn title="attr-media-controls"><code>controls</code></dfn>

|