Skip to content

Commit

Permalink
[giow] (0) support "removetrack" events to handle long-running <video…
Browse files Browse the repository at this point in the history
…> elements on streams with multiple TV shows having different audio and video streams.

Fixing https://www.w3.org/Bugs/Public/show_bug.cgi?id=14492
Affected topics: Video Text Tracks, Video and Audio

git-svn-id: http://svn.whatwg.org/webapps@7098 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed May 8, 2012
1 parent 0a69af6 commit 090bcc1
Show file tree
Hide file tree
Showing 3 changed files with 121 additions and 5 deletions.
41 changes: 39 additions & 2 deletions complete.html
Expand Up @@ -29504,6 +29504,26 @@ <h5 id=offsets-into-the-media-resource><span class=secno>4.8.10.6 </span>Offsets
known</a>, the <a href=#current-playback-position>current playback position</a> can never be
less than the <a href=#earliest-possible-position>earliest possible position</a>.</p>

<!-- see https://www.w3.org/Bugs/Public/show_bug.cgi?id=14492 -->
<!-- basically this is to handle very-long-running streams that use
different video and audio tracks per TV show -->
<p>If at any time the user agent learns that an audio or video track
has ended and all <a href=#media-data>media data</a> relating to that track
corresponds to parts of the <a href=#media-timeline>media timeline</a> that are
<em>before</em> the <a href=#earliest-possible-position>earliest possible position</a>, the
user agent may <a href=#queue-a-task>queue a task</a> to remove the track from
the <code title=dom-media-audioTracks><a href=#dom-media-audiotracks>audioTracks</a></code>
attribute's <code><a href=#audiotracklist>AudioTrackList</a></code> object or the <code title=dom-media-videoTracks><a href=#dom-media-videotracks>videoTracks</a></code> attribute's
<code><a href=#videotracklist>VideoTrackList</a></code> object as appropriate and then fire an
event with the name <code title=event-removetrack>removetrack</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 <code><a href=#audiotrack>AudioTrack</a></code> or
<code><a href=#videotrack>VideoTrack</a></code> object representing the track, at the
<a href=#media-element>media element</a>'s aforementioned
<code><a href=#audiotracklist>AudioTrackList</a></code> or <code><a href=#videotracklist>VideoTrackList</a></code>
object.</p>

<p>The <dfn id=dom-media-duration title=dom-media-duration><code>duration</code></dfn>
attribute must return the time of the end of the <a href=#media-resource>media
resource</a>, in seconds, on the <a href=#media-timeline>media timeline</a>. If
Expand Down Expand Up @@ -30774,6 +30794,7 @@ <h6 id=audiotracklist-and-videotracklist-objects><span class=secno>4.8.10.10.1 <

[TreatNonCallableAsNull] attribute <a href=#function>Function</a>? <a href=#handler-tracklist-onchange title=handler-TrackList-onchange>onchange</a>;
[TreatNonCallableAsNull] attribute <a href=#function>Function</a>? <a href=#handler-tracklist-onaddtrack title=handler-TrackList-onaddtrack>onaddtrack</a>;
[TreatNonCallableAsNull] attribute <a href=#function>Function</a>? <a href=#handler-tracklist-onremovetrack title=handler-TrackList-onremovetrack>onremovetrack</a>;
};

interface <dfn id=audiotrack>AudioTrack</dfn> {
Expand All @@ -30792,6 +30813,7 @@ <h6 id=audiotracklist-and-videotracklist-objects><span class=secno>4.8.10.10.1 <

[TreatNonCallableAsNull] attribute <a href=#function>Function</a>? <a href=#handler-tracklist-onchange title=handler-TrackList-onchange>onchange</a>;
[TreatNonCallableAsNull] attribute <a href=#function>Function</a>? <a href=#handler-tracklist-onaddtrack title=handler-TrackList-onaddtrack>onaddtrack</a>;
[TreatNonCallableAsNull] attribute <a href=#function>Function</a>? <a href=#handler-tracklist-onremovetrack title=handler-TrackList-onremovetrack>onremovetrack</a>;
};

interface <dfn id=videotrack>VideoTrack</dfn> {
Expand Down Expand Up @@ -31117,6 +31139,7 @@ <h6 id=audiotracklist-and-videotracklist-objects><span class=secno>4.8.10.10.1 <
<table><thead><tr><th><a href=#event-handlers title="event handlers">Event handler</a> <th><a href=#event-handler-event-type>Event handler event type</a>
<tbody><tr><td><dfn id=handler-tracklist-onchange title=handler-TrackList-onchange><code>onchange</code></dfn> <td> <code title=event-change>change</code>
<tr><td><dfn id=handler-tracklist-onaddtrack title=handler-TrackList-onaddtrack><code>onaddtrack</code></dfn> <td> <code title=event-addtrack>addtrack</code>
<tr><td><dfn id=handler-tracklist-onremovetrack title=handler-TrackList-onremovetrack><code>onremovetrack</code></dfn> <td> <code title=event-removetrack>removetrack</code>
</table><hr><p>The <a href=#task-source>task source</a> for the <a href=#concept-task title=concept-task>tasks</a> listed in this section is the
<a href=#dom-manipulation-task-source>DOM manipulation task source</a>.</p>

Expand Down Expand Up @@ -32460,7 +32483,12 @@ <h6 id=sourcing-in-band-text-tracks><span class=secno>4.8.10.12.2 </span>Sourcin
<code title=dom-media-textTracks><a href=#dom-media-texttracks>textTracks</a></code> attribute's
<code><a href=#texttracklist>TextTrackList</a></code> object.</li>

</ol><p>When a <a href=#media-element>media element</a> is to <dfn id="forget-the-media-element's-media-resource-specific-text-tracks">forget the media
</ol><!-- removetrack: we don't currently ever remove an in-band text
track, because it might have been manipulated or might be about to
be manipulated. If we made in-band text tracks readonly, we could
probably get away with cleaning them up when they fall into the time
before the earliest possible position and are known to be over and
done with. --><p>When a <a href=#media-element>media element</a> is to <dfn id="forget-the-media-element's-media-resource-specific-text-tracks">forget the media
element's media-resource-specific text tracks</dfn>, the user
agent must remove from the <a href=#media-element>media element</a>'s <a href=#list-of-text-tracks>list
of text tracks</a> all the <a href=#media-resource-specific-text-track title="media-resource-specific
Expand Down Expand Up @@ -32534,7 +32562,14 @@ <h6 id=sourcing-out-of-band-text-tracks><span class=secno>4.8.10.12.3 </span>Sou
the old parent was a <a href=#media-element>media element</a>, then the user agent
must remove the <code><a href=#the-track-element>track</a></code> element's corresponding
<a href=#text-track>text track</a> from the <a href=#media-element>media element</a>'s
<a href=#list-of-text-tracks>list of text tracks</a>.</p> <!-- removetrack -->
<a href=#list-of-text-tracks>list of text tracks</a>, and then <a href=#queue-a-task>queue a task</a>
to fire an event with the name <code title=event-removetrack>removetrack</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 <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> <!-- removetrack -->

<p>When a <a href=#text-track>text track</a> corresponding to a
<code><a href=#the-track-element>track</a></code> element is added to a <a href=#media-element>media
Expand Down Expand Up @@ -32847,6 +32882,7 @@ <h6 id=text-track-api><span class=secno>4.8.10.12.5 </span>Text track API</h6>
getter <a href=#texttrack>TextTrack</a> (unsigned long index);

[TreatNonCallableAsNull] attribute <a href=#function>Function</a>? <a href=#handler-texttracklist-onaddtrack title=handler-TextTrackList-onaddtrack>onaddtrack</a>;
[TreatNonCallableAsNull] attribute <a href=#function>Function</a>? <a href=#handler-texttracklist-onremovetrack title=handler-TextTrackList-onremovetrack>onremovetrack</a>;
};</pre>

<dl class=domintro><dt><var title="">media</var> . <code title=dom-media-textTracks><a href=#dom-media-texttracks>textTracks</a></code> . <code title="">length</code></dt>
Expand Down Expand Up @@ -33735,6 +33771,7 @@ <h6 id=cue-events><span class=secno>4.8.10.12.7 </span>Event definitions</h6>

<table><thead><tr><th><a href=#event-handlers title="event handlers">Event handler</a> <th><a href=#event-handler-event-type>Event handler event type</a>
<tbody><tr><td><dfn id=handler-texttracklist-onaddtrack title=handler-TextTrackList-onaddtrack><code>onaddtrack</code></dfn> <td> <code title=event-addtrack>addtrack</code>
<tr><td><dfn id=handler-texttracklist-onremovetrack title=handler-TextTrackList-onremovetrack><code>onremovetrack</code></dfn> <td> <code title=event-removetrack>removetrack</code>
</table><p>The following are the <a href=#event-handlers>event handlers</a> that (and their
corresponding <a href=#event-handler-event-type title="event handler event type">event handler
event types</a>) must be supported, as IDL attributes, by all
Expand Down
41 changes: 39 additions & 2 deletions index
Expand Up @@ -29504,6 +29504,26 @@ interface <dfn id=htmlaudioelement>HTMLAudioElement</dfn> : <a href=#htmlmediael
known</a>, the <a href=#current-playback-position>current playback position</a> can never be
less than the <a href=#earliest-possible-position>earliest possible position</a>.</p>

<!-- see https://www.w3.org/Bugs/Public/show_bug.cgi?id=14492 -->
<!-- basically this is to handle very-long-running streams that use
different video and audio tracks per TV show -->
<p>If at any time the user agent learns that an audio or video track
has ended and all <a href=#media-data>media data</a> relating to that track
corresponds to parts of the <a href=#media-timeline>media timeline</a> that are
<em>before</em> the <a href=#earliest-possible-position>earliest possible position</a>, the
user agent may <a href=#queue-a-task>queue a task</a> to remove the track from
the <code title=dom-media-audioTracks><a href=#dom-media-audiotracks>audioTracks</a></code>
attribute's <code><a href=#audiotracklist>AudioTrackList</a></code> object or the <code title=dom-media-videoTracks><a href=#dom-media-videotracks>videoTracks</a></code> attribute's
<code><a href=#videotracklist>VideoTrackList</a></code> object as appropriate and then fire an
event with the name <code title=event-removetrack>removetrack</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 <code><a href=#audiotrack>AudioTrack</a></code> or
<code><a href=#videotrack>VideoTrack</a></code> object representing the track, at the
<a href=#media-element>media element</a>'s aforementioned
<code><a href=#audiotracklist>AudioTrackList</a></code> or <code><a href=#videotracklist>VideoTrackList</a></code>
object.</p>

<p>The <dfn id=dom-media-duration title=dom-media-duration><code>duration</code></dfn>
attribute must return the time of the end of the <a href=#media-resource>media
resource</a>, in seconds, on the <a href=#media-timeline>media timeline</a>. If
Expand Down Expand Up @@ -30774,6 +30794,7 @@ interface <dfn id=htmlaudioelement>HTMLAudioElement</dfn> : <a href=#htmlmediael

[TreatNonCallableAsNull] attribute <a href=#function>Function</a>? <a href=#handler-tracklist-onchange title=handler-TrackList-onchange>onchange</a>;
[TreatNonCallableAsNull] attribute <a href=#function>Function</a>? <a href=#handler-tracklist-onaddtrack title=handler-TrackList-onaddtrack>onaddtrack</a>;
[TreatNonCallableAsNull] attribute <a href=#function>Function</a>? <a href=#handler-tracklist-onremovetrack title=handler-TrackList-onremovetrack>onremovetrack</a>;
};

interface <dfn id=audiotrack>AudioTrack</dfn> {
Expand All @@ -30792,6 +30813,7 @@ interface <dfn id=videotracklist>VideoTrackList</dfn> : <a href=#eventtarget>Eve

[TreatNonCallableAsNull] attribute <a href=#function>Function</a>? <a href=#handler-tracklist-onchange title=handler-TrackList-onchange>onchange</a>;
[TreatNonCallableAsNull] attribute <a href=#function>Function</a>? <a href=#handler-tracklist-onaddtrack title=handler-TrackList-onaddtrack>onaddtrack</a>;
[TreatNonCallableAsNull] attribute <a href=#function>Function</a>? <a href=#handler-tracklist-onremovetrack title=handler-TrackList-onremovetrack>onremovetrack</a>;
};

interface <dfn id=videotrack>VideoTrack</dfn> {
Expand Down Expand Up @@ -31117,6 +31139,7 @@ interface <dfn id=videotrack>VideoTrack</dfn> {
<table><thead><tr><th><a href=#event-handlers title="event handlers">Event handler</a> <th><a href=#event-handler-event-type>Event handler event type</a>
<tbody><tr><td><dfn id=handler-tracklist-onchange title=handler-TrackList-onchange><code>onchange</code></dfn> <td> <code title=event-change>change</code>
<tr><td><dfn id=handler-tracklist-onaddtrack title=handler-TrackList-onaddtrack><code>onaddtrack</code></dfn> <td> <code title=event-addtrack>addtrack</code>
<tr><td><dfn id=handler-tracklist-onremovetrack title=handler-TrackList-onremovetrack><code>onremovetrack</code></dfn> <td> <code title=event-removetrack>removetrack</code>
</table><hr><p>The <a href=#task-source>task source</a> for the <a href=#concept-task title=concept-task>tasks</a> listed in this section is the
<a href=#dom-manipulation-task-source>DOM manipulation task source</a>.</p>

Expand Down Expand Up @@ -32460,7 +32483,12 @@ interface <dfn id=mediacontroller>MediaController</dfn> {
<code title=dom-media-textTracks><a href=#dom-media-texttracks>textTracks</a></code> attribute's
<code><a href=#texttracklist>TextTrackList</a></code> object.</li>

</ol><p>When a <a href=#media-element>media element</a> is to <dfn id="forget-the-media-element's-media-resource-specific-text-tracks">forget the media
</ol><!-- removetrack: we don't currently ever remove an in-band text
track, because it might have been manipulated or might be about to
be manipulated. If we made in-band text tracks readonly, we could
probably get away with cleaning them up when they fall into the time
before the earliest possible position and are known to be over and
done with. --><p>When a <a href=#media-element>media element</a> is to <dfn id="forget-the-media-element's-media-resource-specific-text-tracks">forget the media
element's media-resource-specific text tracks</dfn>, the user
agent must remove from the <a href=#media-element>media element</a>'s <a href=#list-of-text-tracks>list
of text tracks</a> all the <a href=#media-resource-specific-text-track title="media-resource-specific
Expand Down Expand Up @@ -32534,7 +32562,14 @@ interface <dfn id=mediacontroller>MediaController</dfn> {
the old parent was a <a href=#media-element>media element</a>, then the user agent
must remove the <code><a href=#the-track-element>track</a></code> element's corresponding
<a href=#text-track>text track</a> from the <a href=#media-element>media element</a>'s
<a href=#list-of-text-tracks>list of text tracks</a>.</p> <!-- removetrack -->
<a href=#list-of-text-tracks>list of text tracks</a>, and then <a href=#queue-a-task>queue a task</a>
to fire an event with the name <code title=event-removetrack>removetrack</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 <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> <!-- removetrack -->

<p>When a <a href=#text-track>text track</a> corresponding to a
<code><a href=#the-track-element>track</a></code> element is added to a <a href=#media-element>media
Expand Down Expand Up @@ -32847,6 +32882,7 @@ interface <dfn id=mediacontroller>MediaController</dfn> {
getter <a href=#texttrack>TextTrack</a> (unsigned long index);

[TreatNonCallableAsNull] attribute <a href=#function>Function</a>? <a href=#handler-texttracklist-onaddtrack title=handler-TextTrackList-onaddtrack>onaddtrack</a>;
[TreatNonCallableAsNull] attribute <a href=#function>Function</a>? <a href=#handler-texttracklist-onremovetrack title=handler-TextTrackList-onremovetrack>onremovetrack</a>;
};</pre>

<dl class=domintro><dt><var title="">media</var> . <code title=dom-media-textTracks><a href=#dom-media-texttracks>textTracks</a></code> . <code title="">length</code></dt>
Expand Down Expand Up @@ -33735,6 +33771,7 @@ The General Relativistic Field Equations</pre>

<table><thead><tr><th><a href=#event-handlers title="event handlers">Event handler</a> <th><a href=#event-handler-event-type>Event handler event type</a>
<tbody><tr><td><dfn id=handler-texttracklist-onaddtrack title=handler-TextTrackList-onaddtrack><code>onaddtrack</code></dfn> <td> <code title=event-addtrack>addtrack</code>
<tr><td><dfn id=handler-texttracklist-onremovetrack title=handler-TextTrackList-onremovetrack><code>onremovetrack</code></dfn> <td> <code title=event-removetrack>removetrack</code>
</table><p>The following are the <a href=#event-handlers>event handlers</a> that (and their
corresponding <a href=#event-handler-event-type title="event handler event type">event handler
event types</a>) must be supported, as IDL attributes, by all
Expand Down

0 comments on commit 090bcc1

Please sign in to comment.