Skip to content
Permalink
Browse files

[giow] (0) Fold MutableTextTrack into TextTrack.

Fixing http://www.w3.org/Bugs/Public/show_bug.cgi?id=14105

git-svn-id: http://svn.whatwg.org/webapps@6710 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information...
Hixie committed Oct 20, 2011
1 parent 5020dae commit c416bd167cfc31a7c540de8932a873df34dd0a6d
Showing with 210 additions and 267 deletions.
  1. +67 −85 complete.html
  2. +67 −85 index
  3. +76 −97 source

<header class=head id=head><p><a class=logo href=http://www.whatwg.org/><img alt=WHATWG height=101 src=/images/logo width=101></a></p>
<hgroup><h1 class=allcaps>HTML</h1>
<h2 class="no-num no-toc">Living Standard &mdash; Last Updated 19 October 2011</h2>
<h2 class="no-num no-toc">Living Standard &mdash; Last Updated 20 October 2011</h2>
</hgroup><dl><dt><strong>Web developer edition:</strong></dt>
<dd><strong><a href=http://developers.whatwg.org/>http://developers.whatwg.org/</a></strong></dd>
<dt>Multiple-page version:</dt>
readonly attribute <a href=#audiotracklist>AudioTrackList</a> <a href=#dom-media-audiotracks title=dom-media-audioTracks>audioTracks</a>;
readonly attribute <a href=#videotracklist>VideoTrackList</a> <a href=#dom-media-videotracks title=dom-media-videoTracks>videoTracks</a>;
readonly attribute <a href=#texttracklist>TextTrackList</a> <a href=#dom-media-texttracks title=dom-media-textTracks>textTracks</a>;
<a href=#mutabletexttrack>MutableTextTrack</a> <a href=#dom-media-addtexttrack title=dom-media-addTextTrack>addTextTrack</a>(DOMString kind, optional DOMString label, optional DOMString language);
<a href=#texttrack>TextTrack</a> <a href=#dom-media-addtexttrack title=dom-media-addTextTrack>addTextTrack</a>(DOMString kind, optional DOMString label, optional DOMString language);
};</pre>

<p>The <dfn id=media-element-attributes>media element attributes</dfn>, <code title=attr-media-src><a href=#attr-media-src>src</a></code>, <code title=attr-media-crossorigin><a href=#attr-media-crossorigin>crossorigin</a></code>, <code title=attr-media-preload><a href=#attr-media-preload>preload</a></code>, <code title=attr-media-autoplay><a href=#attr-media-autoplay>autoplay</a></code>,

<dd>

<p>Indicates that the text track is known to exist (e.g. it has
been declared with a <code><a href=#the-track-element>track</a></code> element), but its cues
have not been obtained.</p>
<p>Indicates that the text track's cues have not been
obtained.</p>

</dd>


<p>Indicates that the text track is loading and there have been
no fatal errors encountered so far. Further cues might still be
added to the track.</p>
added to the track by the parser.</p>

</dd>

<dd>

<p>Indicates that the text track has been loaded with no fatal
errors. No new cues will be added to the track except if the
<a href=#text-track>text track</a> corresponds to a
<code><a href=#mutabletexttrack>MutableTextTrack</a></code> object.</p>
errors.</p>

</dd>

text track</a> can change dynamically, either because the
<a href=#text-track>text track</a> has <a href=#text-track-not-loaded title="text track not
loaded">not yet been loaded</a> or is still <a href=#text-track-loading title="text
track loading">loading</a>, or because the <a href=#text-track>text
track</a> corresponds to a <code><a href=#mutabletexttrack>MutableTextTrack</a></code>
object, whose API allows individual cues can be added or removed
dynamically.</p>
track loading">loading</a>, or due to DOM manipulation.</p>

</dd>

readonly attribute <a href=#texttrackcuelist>TextTrackCueList</a>? <a href=#dom-texttrack-cues title=dom-TextTrack-cues>cues</a>;
readonly attribute <a href=#texttrackcuelist>TextTrackCueList</a>? <a href=#dom-texttrack-activecues title=dom-TextTrack-activeCues>activeCues</a>;

void <a href=#dom-texttrack-addcue title=dom-TextTrack-addCue>addCue</a>(<a href=#texttrackcue>TextTrackCue</a> cue);
void <a href=#dom-texttrack-removecue title=dom-TextTrack-removeCue>removeCue</a>(<a href=#texttrackcue>TextTrackCue</a> cue);

[TreatNonCallableAsNull] attribute <a href=#function>Function</a>? <a href=#handler-texttrack-oncuechange title=handler-TextTrack-oncuechange>oncuechange</a>;
};</pre>

<p>Returns the <a href=#text-track-cue title="text track cue">text track cues</a> from the <a href=#text-track-list-of-cues>text track list of cues</a> that are currently active (i.e. that start before the <a href=#current-playback-position>current playback position</a> and end after it), as a <code><a href=#texttrackcuelist>TextTrackCueList</a></code> object.</p>
</dd>

<dt><var title="">textTrack</var> . <code title=dom-TextTrack-addCue><a href=#dom-texttrack-addcue>addCue</a></code>( <var title="">cue</var> )</dt>
<dd>
<p>Adds the given cue to <var title="">textTrack</var>'s <a href=#text-track-list-of-cues>text track list of cues</a>.</p>
<p>Throws an exception if the argument is associated with another <a href=#text-track>text track</a> or already in the list of cues.</p>
</dd>

<dt><var title="">textTrack</var> . <code title=dom-TextTrack-removeCue><a href=#dom-texttrack-removecue>removeCue</a></code>( <var title="">cue</var> )</dt>
<dd>
<p>Removes the given cue from <var title="">textTrack</var>'s <a href=#text-track-list-of-cues>text track list of cues</a>.</p>
<p>Throws an exception if the argument is associated with another <a href=#text-track>text track</a> or not in the list of cues.</p>
</dd>

<dt><var title="">textTrack</var> = <var title="">media</var> . <code title=dom-media-addTextTrack><a href=#dom-media-addtexttrack>addTextTrack</a></code>( <var title="">kind</var> [, <var title="">label</var> [, <var title="">language</var> ] ] )</dt>
<dd>
<p>Creates and returns a new <code><a href=#texttrack>TextTrack</a></code> object, which is also added to the <a href=#media-element>media element</a>'s <a href=#list-of-text-tracks>list of text tracks</a>.</p>
</dd>

</dl><div class=impl>

<p>The <dfn id=dom-texttrack-kind title=dom-TextTrack-kind><code>kind</code></dfn>
flag</a> was set the last time the <a href=#event-loop>event loop</a>
reached step 1.</p>

</div>
<hr><p>The <dfn id=dom-texttrack-addcue title=dom-TextTrack-addCue><code>addCue(<var title="">cue</var>)</code></dfn> method of <code><a href=#texttrack>TextTrack</a></code>
objects, when invoked, must run the following steps:</p>

<hr><pre class=idl>interface <dfn id=mutabletexttrack>MutableTextTrack</dfn> : <a href=#texttrack>TextTrack</a> {
void <a href=#dom-mutabletexttrack-addcue title=dom-MutableTextTrack-addCue>addCue</a>(<a href=#texttrackcue>TextTrackCue</a> cue);
void <a href=#dom-mutabletexttrack-removecue title=dom-MutableTextTrack-removeCue>removeCue</a>(<a href=#texttrackcue>TextTrackCue</a> cue);
};</pre>
<ol><li><p>If the given <var title="">cue</var> is already associated
with a <a href=#text-track>text track</a> other than the method's
<code><a href=#texttrack>TextTrack</a></code> object's <a href=#text-track>text track</a>, then throw
an <code><a href=#invalidstateerror>InvalidStateError</a></code> exception and abort these
steps.</li>

<dl class=domintro><dt><var title="">mutableTextTrack</var> = <var title="">media</var> . <code title=dom-media-addTextTrack><a href=#dom-media-addtexttrack>addTextTrack</a></code>( <var title="">kind</var> [, <var title="">label</var> [, <var title="">language</var> ] ] )</dt>
<li><p>Associate <var title="">cue</var> with the method's
<code><a href=#texttrack>TextTrack</a></code> object's <a href=#text-track>text track</a>, if it is
not currently associated with a <a href=#text-track>text track</a>.</li>

<dd>
<p>Creates and returns a new <code><a href=#mutabletexttrack>MutableTextTrack</a></code> object, which is also added to the <a href=#media-element>media element</a>'s <a href=#list-of-text-tracks>list of text tracks</a>.</p>
</dd>
<li><p>If the given <var title="">cue</var> is already listed in
the method's <code><a href=#texttrack>TextTrack</a></code> object's <a href=#text-track>text
track</a>'s <a href=#text-track-list-of-cues>text track list of cues</a>, then throw an
<code><a href=#invalidstateerror>InvalidStateError</a></code> exception.</li>

<dt><var title="">mutableTextTrack</var> . <code title=dom-MutableTextTrack-addCue><a href=#dom-mutabletexttrack-addcue>addCue</a></code>( <var title="">cue</var> )</dt>
<dd>
<p>Adds the given cue to <var title="">mutableTextTrack</var>'s <a href=#text-track-list-of-cues>text track list of cues</a>.</p>
<p>Throws an exception if the argument is associated with another <a href=#text-track>text track</a> or already in the list of cues.</p>
</dd>
<li><p>Add <var title="">cue</var> to the method's
<code><a href=#texttrack>TextTrack</a></code> object's <a href=#text-track>text track</a>'s
<a href=#text-track-list-of-cues>text track list of cues</a>.</li>

<dt><var title="">mutableTextTrack</var> . <code title=dom-MutableTextTrack-removeCue><a href=#dom-mutabletexttrack-removecue>removeCue</a></code>( <var title="">cue</var> )</dt>
<dd>
<p>Removes the given cue from <var title="">mutableTextTrack</var>'s <a href=#text-track-list-of-cues>text track list of cues</a>.</p>
<p>Throws an exception if the argument is associated with another <a href=#text-track>text track</a> or not in the list of cues.</p>
</dd>
</ol><p>The <dfn id=dom-texttrack-removecue title=dom-TextTrack-removeCue><code>removeCue(<var title="">cue</var>)</code></dfn> method of
<code><a href=#texttrack>TextTrack</a></code> objects, when invoked, must run the
following steps:</p>

</dl><div class=impl>
<ol><li><p>If the given <var title="">cue</var> is not associated with
the method's <code><a href=#texttrack>TextTrack</a></code> object's <a href=#text-track>text
track</a>, then throw an <code><a href=#invalidstateerror>InvalidStateError</a></code>
exception.</li>

<p>The <dfn id=dom-media-addtexttrack title=dom-media-addTextTrack><code>addTextTrack(<var title="">kind</var>, <var title="">label</var>, <var title="">language</var>)</code></dfn> method of <a href=#media-element title="media
<li><p>If the given <var title="">cue</var> is not currently listed
in the method's <code><a href=#texttrack>TextTrack</a></code> object's <a href=#text-track>text
track</a>'s <a href=#text-track-list-of-cues>text track list of cues</a>, then throw a
<code><a href=#notfounderror>NotFoundError</a></code> exception.</li>

<li><p>Remove <var title="">cue</var> from the method's
<code><a href=#texttrack>TextTrack</a></code> object's <a href=#text-track>text track</a>'s
<a href=#text-track-list-of-cues>text track list of cues</a>.</li>

</ol><hr><p>The <dfn id=dom-media-addtexttrack title=dom-media-addTextTrack><code>addTextTrack(<var title="">kind</var>, <var title="">label</var>, <var title="">language</var>)</code></dfn> method of <a href=#media-element title="media
element">media elements</a>, when invoked, must run the following
steps:</p>


<li>

<p>Create a new <code><a href=#mutabletexttrack>MutableTextTrack</a></code> object.</p>
<p>Create a new <code><a href=#texttrack>TextTrack</a></code> object.</p>

</li>

<p><a href=#queue-a-task>Queue a task</a> to fire an event with the name <code title=event-addtrack>addtrack</code>, that does not bubble and
is not cancelable, and that uses the <code><a href=#trackevent>TrackEvent</a></code>
interface, with the <code title=dom-TrackEvent-track><a href=#dom-trackevent-track>track</a></code> attribute initialized to
the new <a href=#text-track>text track</a>'s <code><a href=#mutabletexttrack>MutableTextTrack</a></code>
object, at the <a href=#media-element>media element</a>'s <code title=dom-media-textTracks><a href=#dom-media-texttracks>textTracks</a></code> attribute's
the new <a href=#text-track>text track</a>'s <code><a href=#texttrack>TextTrack</a></code> object,
at the <a href=#media-element>media element</a>'s <code title=dom-media-textTracks><a href=#dom-media-texttracks>textTracks</a></code> attribute's
<code><a href=#texttracklist>TextTrackList</a></code> object.</p>

</li>

<li>

<p>Return the new <code><a href=#mutabletexttrack>MutableTextTrack</a></code> object.</p>
<p>Return the new <code><a href=#texttrack>TextTrack</a></code> object.</p>

</li>

</ol><p>The <dfn id=dom-mutabletexttrack-addcue title=dom-MutableTextTrack-addCue><code>addCue(<var title="">cue</var>)</code></dfn> method of
<code><a href=#mutabletexttrack>MutableTextTrack</a></code> objects, when invoked, must run the
following steps:</p>

<ol><li><p>If the given <var title="">cue</var> is already associated
with a <a href=#text-track>text track</a> other than the method's
<code><a href=#mutabletexttrack>MutableTextTrack</a></code> object's <a href=#text-track>text track</a>,
then throw an <code><a href=#invalidstateerror>InvalidStateError</a></code> exception and abort
these steps.</li>

<li><p>Associate <var title="">cue</var> with the method's
<code><a href=#mutabletexttrack>MutableTextTrack</a></code> object's <a href=#text-track>text track</a>,
if it is not currently associated with a <a href=#text-track>text
track</a>.</li>

<li><p>If the given <var title="">cue</var> is already listed in
the method's <code><a href=#mutabletexttrack>MutableTextTrack</a></code> object's <a href=#text-track>text
track</a>'s <a href=#text-track-list-of-cues>text track list of cues</a>, then throw an
<code><a href=#invalidstateerror>InvalidStateError</a></code> exception.</li>

<li><p>Add <var title="">cue</var> to the method's
<code><a href=#mutabletexttrack>MutableTextTrack</a></code> object's <a href=#text-track>text track</a>'s
<a href=#text-track-list-of-cues>text track list of cues</a>.</li>

</ol><p>The <dfn id=dom-mutabletexttrack-removecue title=dom-MutableTextTrack-removeCue><code>removeCue(<var title="">cue</var>)</code></dfn> method of
<code><a href=#mutabletexttrack>MutableTextTrack</a></code> objects, when invoked, must run the
following steps:</p>

<ol><li><p>If the given <var title="">cue</var> is not associated with
the method's <code><a href=#mutabletexttrack>MutableTextTrack</a></code> object's <a href=#text-track>text
track</a>, then throw an <code><a href=#invalidstateerror>InvalidStateError</a></code>
exception.</li>

<li><p>If the given <var title="">cue</var> is not currently listed
in the method's <code><a href=#mutabletexttrack>MutableTextTrack</a></code> object's <a href=#text-track>text
track</a>'s <a href=#text-track-list-of-cues>text track list of cues</a>, then throw a
<code><a href=#notfounderror>NotFoundError</a></code> exception.</li>

<li><p>Remove <var title="">cue</var> from the method's
<code><a href=#mutabletexttrack>MutableTextTrack</a></code> object's <a href=#text-track>text track</a>'s
<a href=#text-track-list-of-cues>text track list of cues</a>.</li>

</ol></div>

<div class=example>
</div>

<hr><pre class=idl>
<!--TTVTT-->
[<a href=#dom-texttrackcue title=dom-TextTrackCue>Constructor</a>(DOMString id, double startTime, double endTime, DOMString text, optional DOMString settings, optional boolean pauseOnExit)]
<!--TTVTT-->
interface <dfn id=texttrackcue>TextTrackCue</dfn> : <a href=#eventtarget>EventTarget</a> {
readonly attribute <a href=#texttrack>TextTrack</a>? <a href=#dom-texttrackcue-track title=dom-TextTrackCue-track>track</a>;
readonly attribute DOMString <a href=#dom-texttrackcue-id title=dom-TextTrackCue-id>id</a>;
[TreatNonCallableAsNull] attribute <a href=#function>Function</a>? <a href=#handler-texttrackcue-onexit title=handler-TextTrackCue-onexit>onexit</a>;
};</pre>

<dl class=domintro><!--TTVTT--><dt><var title="">cue</var> = new <code title=dom-TextTrackCue><a href=#dom-texttrackcue>TextTrackCue</a></code>( <var title="">id</var>, <var title="">startTime</var>, <var title="">endTime</var>, <var title="">text</var> [, <var title="">settings</var> [, <var title="">pauseOnExit</var> ] ] )</dt>
<dl class=domintro><dt><var title="">cue</var> = new <code title=dom-TextTrackCue><a href=#dom-texttrackcue>TextTrackCue</a></code>( <var title="">id</var>, <var title="">startTime</var>, <var title="">endTime</var>, <var title="">text</var> [, <var title="">settings</var> [, <var title="">pauseOnExit</var> ] ] )</dt>
<dd>
<p>Returns a new <code><a href=#texttrackcue>TextTrackCue</a></code> object, for use with the <code title=dom-MutableTextTrack-addCue><a href=#dom-mutabletexttrack-addcue>addCue()</a></code> method.</p>
<p>Returns a new <code><a href=#texttrackcue>TextTrackCue</a></code> object, for use with the <code title=dom-TextTrack-addCue><a href=#dom-texttrack-addcue>addCue()</a></code> method.</p>
<p>The <var title="">id</var> argument sets the <a href=#text-track-cue-identifier>text track cue identifier</a>.</p>
<p>The <var title="">startTime</var> argument sets the <a href=#text-track-cue-start-time>text track cue start time</a>.</p>
<p>The <var title="">endTime</var> argument sets the <a href=#text-track-cue-end-time>text track cue end time</a>.</p>
<p>The <var title="">text</var> argument sets the <a href=#text-track-cue-text>text track cue text</a>.</p>
<p>The <var title="">settings</var> argument is a string in the format of <a href=#webvtt-cue-settings>WebVTT cue settings</a>. If omitted, the empty string is assumed.</p>
<p>The <var title="">pauseOnExit</var> argument sets the <a href=#text-track-cue-pause-on-exit-flag>text track cue pause-on-exit flag</a>. If omitted, false is assumed.</p>
</dd>
<!--TTVTT-->

<dt><var title="">cue</var> . <a href=#dom-texttrackcue-track title=dom-TextTrackCue-track>track</a></dt>
<dd>

0 comments on commit c416bd1

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