Skip to content
Permalink
Browse files

[giow] (0) Captions - Stage 20.5: TimedTrackCue constructor and some …

…fallout from that.

git-svn-id: http://svn.whatwg.org/webapps@5143 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information...
Hixie committed Jul 8, 2010
1 parent 57e002c commit 77bf101930acdb6678ac9069253fd6c8914ddbcc
Showing with 392 additions and 60 deletions.
  1. +125 −21 complete.html
  2. +125 −21 index
  3. +142 −18 source
<dd>

<p>A list of <a href=#timed-track-cue title="timed track cue">timed track
cues</a>, along with rules for their rendering (e.g., for
<a href=#websrt>WebSRT</a>, the <a href=#rules-for-updating-the-display-of-websrt-timed-tracks>rules for updating the display of
WebSRT timed tracks</a>).</p>
cues</a>, along with <dfn id=rules-for-updating-the-timed-track-rendering>rules for updating the timed track
rendering</dfn> (e.g., for <a href=#websrt>WebSRT</a>, the <a href=#rules-for-updating-the-display-of-websrt-timed-tracks>rules
for updating the display of WebSRT timed tracks</a>).</p>

<p>The <a href=#timed-track-list-of-cues title="timed track list of cues">list of cues of a
timed track</a> can change dynamically, either because the
preferences and the requirements of the relevant specification for
the data.</li>

<li><p>Leave the <a href=#timed-track-list-of-cues>timed track list of cues</a> empty, and
associate with it the <a href=#rules-for-updating-the-timed-track-rendering>rules for updating the timed track
rendering</a> appropriate for the format in question.</p>

<li><p>Add the new <a href=#timed-track>timed track</a> to the <a href=#media-element>media
element</a>'s <a href=#list-of-timed-tracks>list of timed tracks</a>.</li>

the algorithm below.</p>

<p>The <a href=#timed-track-list-of-cues>timed track list of cues</a> is initially empty. It
is dynamically modified when the referenced file is parsed.</p>
is dynamically modified when the referenced file is parsed.
Associated with the list are the <a href=#rules-for-updating-the-timed-track-rendering>rules for updating the timed
track rendering</a> appropriate for the format in question; for
<a href=#websrt>WebSRT</a>, this is the <a href=#rules-for-updating-the-display-of-websrt-timed-tracks>rules for updating the
display of WebSRT timed tracks</a>.</p>

<p>When a <code><a href=#the-track-element>track</a></code> element's parent element changes and
the new parent is a <a href=#media-element>media element</a>, then the user agent
the <a href=#timed-track-disabled>timed track disabled</a> mode.</p>

<p>If the <a href=#timed-track-mode>timed track mode</a> was previously the
<a href=#timed-track-showing>timed track showing</a> mode, then <a href=#update-the-timed-track-rendering>update the timed
track rendering</a> of the <a href=#media-element>media element</a>.</p>
<a href=#timed-track-showing>timed track showing</a> mode, then apply the rules for
updating the timed track rendering of the <a href=#media-element>media
element</a> appropriate for the <a href=#timed-track>timed track</a>.</p>

</dd>

the <a href=#timed-track-hidden>timed track hidden</a> mode.</p>

<p>If the <a href=#timed-track-mode>timed track mode</a> was previously the
<a href=#timed-track-showing>timed track showing</a> mode, then <a href=#update-the-timed-track-rendering>update the timed
track rendering</a> of the <a href=#media-element>media element</a>.</p>
<a href=#timed-track-showing>timed track showing</a> mode, then apply the rules for
updating the timed track rendering of the <a href=#media-element>media
element</a> appropriate for the <a href=#timed-track>timed track</a>.</p>

</dd>

track</a> that the <code><a href=#timedtrack>TimedTrack</a></code> object represents to
the <a href=#timed-track-showing>timed track showing</a> mode.</p>

<p><a href=#update-the-timed-track-rendering>Update the timed track rendering</a> of the
<a href=#media-element>media element</a>.</p>
<p>Apply the rules for updating the timed track rendering of the
<a href=#media-element>media element</a> appropriate for the <a href=#timed-track>timed
track</a>.</p>

</dd>

<a href=#timed-track-readiness-state>timed track readiness state</a> to the <a href=#timed-track-loaded>timed track
loaded</a> state, its <a href=#timed-track-mode>timed track mode</a> to the
<a href=#timed-track-hidden>timed track hidden</a> mode, and its <a href=#timed-track-list-of-cues>timed track
list of cues</a> to an empty list, with the rules for its
interpretation being the <a href=#websrt-cue-text-parsing-rules>WebSRT cue text parsing
rules</a>, the <a href=#websrt-cue-text-rendering-rules>WebSRT cue text rendering rules</a>,
and the <a href=#websrt-cue-text-dom-construction-rules>WebSRT cue text DOM construction rules</a></p>
list of cues</a> to an empty list, associated with the
<a href=#rules-for-updating-the-display-of-websrt-timed-tracks>rules for updating the display of WebSRT timed tracks</a>
as its <a href=#rules-for-updating-the-timed-track-rendering>rules for updating the timed track
rendering</a>.</p>

</li>


</div>

<hr><pre class=idl>[<span title=dom-TimedTrackCue>Constructor</span>(in DOMString id, in float startTime, in float endTime, in DOMString text, in optional DOMString settings, in optional DOMString voice, in optional boolean pauseOnExit)]
<hr><pre class=idl>[<a href=#dom-timedtrackcue title=dom-TimedTrackCue>Constructor</a>(in DOMString id, in float startTime, in float endTime, in DOMString text, in optional DOMString settings, in optional DOMString voice, in optional boolean pauseOnExit)]
interface <dfn id=timedtrackcue>TimedTrackCue</dfn> {
readonly attribute <a href=#timedtrack>TimedTrack</a> <span title=dom-TimedTrackCue-track>track</span>;
readonly attribute DOMString <span title=dom-TimedTrackCue-id>id</span>;
readonly attribute <a href=#function>Function</a> <a href=#handler-timedtrackcue-onexit title=handler-TimedTrackCue-onexit>onexit</a>;
};</pre>

<dl class=domintro><dt><var title="">cue</var> = new <code title=dom-TimedTrackCue>TimedTrackCue</code>( <var title="">id</var>, <var title="">startTime</var>, <var title="">endTime</var>, <var title="">text</var> [, <var title="">settings</var> [, <var title="">voice</var> [, <var title="">pauseOnExit</var> ] ] ] )</dt>
<dl class=domintro><dt><var title="">cue</var> = new <code title=dom-TimedTrackCue><a href=#dom-timedtrackcue>TimedTrackCue</a></code>( <var title="">id</var>, <var title="">startTime</var>, <var title="">endTime</var>, <var title="">text</var> [, <var title="">settings</var> [, <var title="">voice</var> [, <var title="">pauseOnExit</var> ] ] ] )</dt>
<dd>
<p>Returns a new <code><a href=#timedtrackcue>TimedTrackCue</a></code> object, for use with the <code title=dom-MutableTimedTrack-addCue><a href=#dom-mutabletimedtrack-addcue>addCue()</a></code> method.</p>
<p>The <var title="">id</var> argument sets the <a href=#timed-track-cue-identifier>timed track cue identifier</a>.</p>

</dl><div class=impl>

<p class=XXX>...</p>
<p>The <dfn id=dom-timedtrackcue title=dom-TimedTrackCue><code>TimedTrackCue(<var title="">id</var>, <var title="">startTime</var>, <var title="">endTime</var>, <var title="">text</var>, <var title="">settings</var>, <var title="">voice</var>, <var title="">pauseOnExit</var>)</code></dfn> constructor, when invoked,
must run the following steps:</p>

</div>
<ol><li><p>Create a new <a href=#timed-track-cue>timed track cue</a> that is not
associated with any <a href=#timed-track>timed track</a>. Let <var title="">cue</var> be that <a href=#timed-track-cue>timed track cue</a>.</li>

<li><p>Let <var title="">cue</var>'s <a href=#timed-track-cue-identifier>timed track cue
identifier</a> be the value of the <var title="">id</var>
argument.</li>

<li><p>Let <var title="">cue</var>'s <a href=#timed-track-cue-start-time>timed track cue start
time</a> be the value of the <var title="">startTime</var>
argument, interpreted as a time in seconds.</li>

<li><p>Let <var title="">cue</var>'s <a href=#timed-track-cue-end-time>timed track cue end
time</a> be the value of the <var title="">endTime</var>
argument, interpreted as a time in seconds.</li>

<li><p>Let <var title="">cue</var>'s <a href=#timed-track-cue-pause-on-exit-flag>timed track cue
pause-on-exit flag</a> be true if the <var title="">pauseOnExit</var> is present and true. Otherwise, let it
be false.</li>

<li><p>Let <var title="">cue</var>'s <a href=#timed-track-cue-voice-identifier>timed track cue voice
identifier</a> be the value of the <var title="">voice</var>
argument, if it is present, or the empty string otherwise.</li>

<li><p>Let <var title="">cue</var>'s <a href=#timed-track-cue-text>timed track cue
text</a> be the value of the <var title="">text</var> argument,
and let the rules for its interpretation be the <a href=#websrt-cue-text-parsing-rules>WebSRT cue
text parsing rules</a>, the <a href=#websrt-cue-text-rendering-rules>WebSRT cue text rendering
rules</a>, and the <a href=#websrt-cue-text-dom-construction-rules>WebSRT cue text DOM construction
rules</a>.</li>

<!-- default settings -->

<li><p>Let <var title="">cue</var>'s <a href=#timed-track-cue-writing-direction>timed track cue
writing direction</a> be <a href=#timed-track-cue-horizontal-writing-direction title="timed track cue
horizontal writing direction">horizontal</a>.</li>

<li><p>Let <var title="">cue</var>'s <a href=#timed-track-cue-snap-to-lines-flag>timed track cue
snap-to-lines flag</a> be true.</li>

<li><p>Let <var title="">cue</var>'s <a href=#timed-track-cue-line-position>timed track cue line
position</a> be <a href=#timed-track-cue-automatic-line-position title="timed track cue automatic line
position">auto</a>.</li>

<li><p>Let <var title="">cue</var>'s <a href=#timed-track-cue-text-position>timed track cue
text position</a> be 50.</li>

<li><p>Let <var title="">cue</var>'s <a href=#timed-track-cue-size>timed track cue
size</a> be 100.</li>

<li><p>Let <var title="">cue</var>'s <a href=#timed-track-cue-alignment>timed track cue
alignment</a> be <a href=#timed-track-cue-middle-alignment title="timed track cue middle
alignment">middle alignment</a>.</li>

<li><p>Let <var title="">input</var> be the string given by the
<var title="">settings</var> argument.</li>

<li><p>Let <var title="">position</var> be a pointer into <var title="">input</var>, initially pointing at the start of the
string.</li>

<li><p><a href=#parse-the-websrt-settings>Parse the WebSRT settings</a> for <var title="">cue</var>.</li>

<li><p>Return the <code><a href=#timedtrackcue>TimedTrackCue</a></code> object representing
<var title="">cue</var>.</li>

</ol><!-- XXX

<dfn title="dom-TimedTrackCue-track"><code>track</code></dfn>
<dfn title="dom-TimedTrackCue-id"><code>id</code></dfn>

<dfn title="dom-TimedTrackCue-startTime"><code>startTime</code></dfn>
<dfn title="dom-TimedTrackCue-endTime"><code>endTime</code></dfn>
<dfn title="dom-TimedTrackCue-pauseOnExit"><code>pauseOnExit</code></dfn>

<dfn title="dom-TimedTrackCue-direction"><code>direction</code></dfn>
<dfn title="dom-TimedTrackCue-snapToLines"><code>snapToLines</code></dfn>
<dfn title="dom-TimedTrackCue-linePosition"><code>linePosition</code></dfn>
<dfn title="dom-TimedTrackCue-textPosition"><code>textPosition</code></dfn>
<dfn title="dom-TimedTrackCue-size"><code>size</code></dfn>
<dfn title="dom-TimedTrackCue-alignment"><code>alignment</code></dfn>

<dfn title="dom-TimedTrackCue-voice"><code>voice</code></dfn>
<dfn title="dom-TimedTrackCue-getCueAsSource()"><code>getCueAsSource()</code></dfn>
<dfn title="dom-TimedTrackCue-getCueAsHTML()"><code>getCueAsHTML()</code></dfn>

--></div>


<div class=impl>
U+000A LINE FEED (LF) characters.</li>

<li><p>Let <var title="">cue</var> be a new <a href=#timed-track-cue>timed track
cue</a>.</li>
cue</a> associated with <var title="">output</var>'s <a href=#timed-track>timed
track</a>.</li>

<li><p>Let <var title="">cue</var>'s <a href=#timed-track-cue-identifier>timed track cue
identifier</a> be the empty string.</li>

<li><p><a href=#skip-whitespace>Skip whitespace</a>.</li>

<li><p><a href=#parse-the-websrt-settings>Parse the WebSRT settings</a> for <var title="">cue</var>.</li>

</ol><p>When the user agent is to <dfn id=parse-the-websrt-settings>parse the WebSRT settings</dfn>
for a <a href=#timed-track-cue>timed track cue</a> <var title="">cue</var>,, the
user agent must run the following steps:</p>

<ol><li><p>Let <var title="">input</var> and <var title="">position</var> be the same variables as those of the same
name in the algorithm that invoked these steps.</li>

<li><p><i>Settings</i>: If <var title="">position</var> is beyond
the end of <var title="">input</var> then abort these
steps.</li>

<p class=XXX>The <dfn id=rules-for-updating-the-display-of-websrt-timed-tracks>rules for updating the display of WebSRT timed tracks</dfn>

<p class=XXX><dfn id=update-the-timed-track-rendering>update the timed track rendering</dfn> of a <a href=#media-element>media element</a></p>

<!--

list of active WebSRT or WebSRT-compatible cues and their positions

0 comments on commit 77bf101

Please sign in to comment.
You can’t perform that action at this time.