[html5] r7098 - [giow] (0) support "removetrack" events to handle long-running <video> elements [...]
whatwg at whatwg.org
whatwg at whatwg.org
Tue May 8 10:22:00 PDT 2012
Author: ianh
Date: 2012-05-08 10:21:58 -0700 (Tue, 08 May 2012)
New Revision: 7098
Modified:
complete.html
index
source
Log:
[giow] (0) support "removetrack" events to handle long-running <video> 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
Modified: complete.html
===================================================================
--- complete.html 2012-05-08 00:36:23 UTC (rev 7097)
+++ complete.html 2012-05-08 17:21:58 UTC (rev 7098)
@@ -29504,6 +29504,26 @@
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
@@ -30774,6 +30794,7 @@
[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> {
@@ -30792,6 +30813,7 @@
[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> {
@@ -31117,6 +31139,7 @@
<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>
@@ -32460,7 +32483,12 @@
<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
@@ -32534,7 +32562,14 @@
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
@@ -32847,6 +32882,7 @@
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>
@@ -33735,6 +33771,7 @@
<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
Modified: index
===================================================================
--- index 2012-05-08 00:36:23 UTC (rev 7097)
+++ index 2012-05-08 17:21:58 UTC (rev 7098)
@@ -29504,6 +29504,26 @@
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
@@ -30774,6 +30794,7 @@
[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> {
@@ -30792,6 +30813,7 @@
[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> {
@@ -31117,6 +31139,7 @@
<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>
@@ -32460,7 +32483,12 @@
<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
@@ -32534,7 +32562,14 @@
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
@@ -32847,6 +32882,7 @@
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>
@@ -33735,6 +33771,7 @@
<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
Modified: source
===================================================================
--- source 2012-05-08 00:36:23 UTC (rev 7097)
+++ source 2012-05-08 17:21:58 UTC (rev 7098)
@@ -32031,6 +32031,28 @@
known</a>, the <span>current playback position</span> can never be
less than the <span>earliest possible position</span>.</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 <span>media data</span> relating to that track
+ corresponds to parts of the <span>media timeline</span> that are
+ <em>before</em> the <span>earliest possible position</span>, the
+ user agent may <span>queue a task</span> to remove the track from
+ the <code title="dom-media-audioTracks">audioTracks</code>
+ attribute's <code>AudioTrackList</code> object or the <code
+ title="dom-media-videoTracks">videoTracks</code> attribute's
+ <code>VideoTrackList</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>TrackEvent</code>
+ interface, with the <code title="dom-TrackEvent-track">track</code>
+ attribute initialized to the <code>AudioTrack</code> or
+ <code>VideoTrack</code> object representing the track, at the
+ <span>media element</span>'s aforementioned
+ <code>AudioTrackList</code> or <code>VideoTrackList</code>
+ object.</p>
+
<p>The <dfn title="dom-media-duration"><code>duration</code></dfn>
attribute must return the time of the end of the <span>media
resource</span>, in seconds, on the <span>media timeline</span>. If
@@ -33547,6 +33569,7 @@
[TreatNonCallableAsNull] attribute <span>Function</span>? <span title="handler-TrackList-onchange">onchange</span>;
[TreatNonCallableAsNull] attribute <span>Function</span>? <span title="handler-TrackList-onaddtrack">onaddtrack</span>;
+ [TreatNonCallableAsNull] attribute <span>Function</span>? <span title="handler-TrackList-onremovetrack">onremovetrack</span>;
};
interface <dfn>AudioTrack</dfn> {
@@ -33565,6 +33588,7 @@
[TreatNonCallableAsNull] attribute <span>Function</span>? <span title="handler-TrackList-onchange">onchange</span>;
[TreatNonCallableAsNull] attribute <span>Function</span>? <span title="handler-TrackList-onaddtrack">onaddtrack</span>;
+ [TreatNonCallableAsNull] attribute <span>Function</span>? <span title="handler-TrackList-onremovetrack">onremovetrack</span>;
};
interface <dfn>VideoTrack</dfn> {
@@ -33940,6 +33964,7 @@
<tbody>
<tr><td><dfn title="handler-TrackList-onchange"><code>onchange</code></dfn> <td> <code title="event-change">change</code>
<tr><td><dfn title="handler-TrackList-onaddtrack"><code>onaddtrack</code></dfn> <td> <code title="event-addtrack">addtrack</code>
+ <tr><td><dfn title="handler-TrackList-onremovetrack"><code>onremovetrack</code></dfn> <td> <code title="event-removetrack">removetrack</code>
</table>
<hr>
@@ -35465,6 +35490,13 @@
</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 <span>media element</span> is to <dfn>forget the media
element's media-resource-specific text tracks</dfn>, the user
agent must remove from the <span>media element</span>'s <span>list
@@ -35554,7 +35586,15 @@
the old parent was a <span>media element</span>, then the user agent
must remove the <code>track</code> element's corresponding
<span>text track</span> from the <span>media element</span>'s
- <span>list of text tracks</span>.</p> <!-- removetrack -->
+ <span>list of text tracks</span>, and then <span>queue a task</span>
+ 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>TrackEvent</code>
+ interface, with the <code title="dom-TrackEvent-track">track</code>
+ attribute initialized to the <span>text track</span>'s
+ <code>TextTrack</code> object, at the <span>media element</span>'s
+ <code title="dom-media-textTracks">textTracks</code> attribute's
+ <code>TextTrackList</code> object.</p> <!-- removetrack -->
<p>When a <span>text track</span> corresponding to a
<code>track</code> element is added to a <span>media
@@ -35910,6 +35950,7 @@
getter <span>TextTrack</span> (unsigned long index);
[TreatNonCallableAsNull] attribute <span>Function</span>? <span title="handler-TextTrackList-onaddtrack">onaddtrack</span>;
+ [TreatNonCallableAsNull] attribute <span>Function</span>? <span title="handler-TextTrackList-onremovetrack">onremovetrack</span>;
};</pre>
<dl class="domintro">
@@ -36920,6 +36961,7 @@
<tr><th><span title="event handlers">Event handler</span> <th><span>Event handler event type</span>
<tbody>
<tr><td><dfn title="handler-TextTrackList-onaddtrack"><code>onaddtrack</code></dfn> <td> <code title="event-addtrack">addtrack</code>
+ <tr><td><dfn title="handler-TextTrackList-onremovetrack"><code>onremovetrack</code></dfn> <td> <code title="event-removetrack">removetrack</code>
</table>
<p>The following are the <span>event handlers</span> that (and their
More information about the Commit-Watchers
mailing list