[html5] r6291 - [giow] (0) Clarify what happens when a stream ends.
whatwg at whatwg.org
whatwg at whatwg.org
Tue Jul 12 15:34:07 PDT 2011
Author: ianh
Date: 2011-07-12 15:34:05 -0700 (Tue, 12 Jul 2011)
New Revision: 6291
Modified:
complete.html
index
source
Log:
[giow] (0) Clarify what happens when a stream ends.
Modified: complete.html
===================================================================
--- complete.html 2011-07-12 22:23:07 UTC (rev 6290)
+++ complete.html 2011-07-12 22:34:05 UTC (rev 6291)
@@ -75107,15 +75107,27 @@
<code><a href=#peerconnection>PeerConnection</a></code> object.</p>
<p>Each track in a <code><a href=#mediastream>MediaStream</a></code> object can be disabled,
- meaning that it does not appear in the object's output. All tracks
- are initially enabled.</p>
+ meaning that it is muted in the object's output. All tracks are
+ initially enabled.</p>
+ <p id=finishedMute>A <code><a href=#mediastream>MediaStream</a></code> can be <a href=#concept-stream-finished title=concept-stream-finished>finished</a>, indicating that its
+ inputs have forever stopped providing data. When a
+ <code><a href=#mediastream>MediaStream</a></code> object is finished, all its tracks are
+ muted regardless of whether they are enabled or disabled.</p>
+
+ <p>The output of a <code><a href=#mediastream>MediaStream</a></code> object must correspond
+ to the tracks in its input. Muted audio tracks must be replaced with
+ silence. Muted video tracks must be replaced with blackness.</p>
+
<p>A <code><a href=#mediastream>MediaStream</a></code> object's output can be "forked" by
creating a new <code><a href=#mediastream>MediaStream</a></code> object from it using the
<code title=dom-MediaStream><a href=#dom-mediastream>MediaStream()</a></code> constructor. The
new <code><a href=#mediastream>MediaStream</a></code> object's input is the output of the
- object from which it was created, and its output is therefore at
- most a subset of the "parent" object.</p>
+ object from which it was created, with any disabled tracks removed,
+ and its output is therefore at most a subset of that "parent"
+ object. (Merely muted tracks are not removed, so the tracks do not
+ change when the parent is finished.) When such a fork's parent
+ finishes, the fork is also said to have finished.</p>
<p><img alt="" src=http://images.whatwg.org/media-stream-1.png></p><!-- no alt since
it's all described in the previous paragraphs: this is just a
@@ -75383,18 +75395,14 @@
}
-->
- <p>If a track in a <code><a href=#mediastream>MediaStream</a></code> <var title="">parent</var> is disabled, it does not have a corresponding
- track in any <code><a href=#mediastream>MediaStream</a></code> objects that were created from
- <var title="">parent</var>. When a track in a
- <code><a href=#mediastream>MediaStream</a></code> <var title="">parent</var> is disabled, any
- <code><a href=#mediastreamtrack>MediaStreamTrack</a></code> objects corresponding to the tracks in any
- <code><a href=#mediastream>MediaStream</a></code> objects that were created from <var title="">parent</var> are disassociated from any track, and must not
- be reused for tracks again. If a disabled track in a
- <code><a href=#mediastream>MediaStream</a></code> <var title="">parent</var> is re-enabled,
- from the perspective of any <code><a href=#mediastream>MediaStream</a></code> objects that
- were created from <var title="">parent</var> it is a new track and
- thus new <code><a href=#mediastreamtrack>MediaStreamTrack</a></code> objects must be created for the
- tracks that correspond to the re-enabled track.</p>
+ <p>When a track in a <code><a href=#mediastream>MediaStream</a></code> <var title="">parent</var> is disabled, any <code><a href=#mediastreamtrack>MediaStreamTrack</a></code>
+ objects corresponding to the tracks in any <code><a href=#mediastream>MediaStream</a></code>
+ objects that were created from <var title="">parent</var> are
+ disassociated from any track, and must not be reused for tracks
+ again. If a disabled track in a <code><a href=#mediastream>MediaStream</a></code> <var title="">parent</var> is re-enabled, from the perspective of any
+ <code><a href=#mediastream>MediaStream</a></code> objects that were created from <var title="">parent</var> it is a new track and thus new
+ <code><a href=#mediastreamtrack>MediaStreamTrack</a></code> objects must be created for the tracks
+ that correspond to the re-enabled track.</p>
<hr><p>The <code><a href=#localmediastream>LocalMediaStream</a></code> interface is used when the user
agent is generating the stream's data (e.g. from a camera or
@@ -75581,17 +75589,18 @@
user agent learns that no more data will ever be forthcoming for
this stream.</p>
- <p>When a <code><a href=#mediastream>MediaStream</a></code> object ends for any reason other
- than the <code title=dom-MediaStream-stop><a href=#dom-mediastream-stop>stop()</a></code> method
- being invoked (e.g. because the user rescinds the permission for the
- page to use the local camera, or because the data comes from a
- finite file and the file's end has been reached and the user has not
- requested that it be looped, or because the stream comes from a
- remote peer and the remote peer has permanently stopped sending
- data, or because the <code><a href=#mediastream>MediaStream</a></code> was created from
- another <code><a href=#mediastream>MediaStream</a></code> and that stream has just itself
- ended), the user agent must <a href=#queue-a-task>queue a task</a> that runs the
- following steps:</p>
+ <p>When a <code><a href=#mediastream>MediaStream</a></code> object ends for any reason (e.g.
+ because the user rescinds the permission for the page to use the
+ local camera, or because the data comes from a finite file and the
+ file's end has been reached and the user has not requested that it
+ be looped, or because the stream comes from a remote peer and the
+ remote peer has permanently stopped sending data, or because the
+ <code><a href=#mediastream>MediaStream</a></code> was created from another
+ <code><a href=#mediastream>MediaStream</a></code> and that stream has just itself ended), it
+ is said to be <dfn id=concept-stream-finished title=concept-stream-finished>finished</dfn>.
+ When this happens for any reason other than the <code title=dom-MediaStream-stop><a href=#dom-mediastream-stop>stop()</a></code> method being invoked, the
+ user agent must <a href=#queue-a-task>queue a task</a> that runs the following
+ steps:</p>
<ol><li><p>If the object's <code title=dom-MediaStream-readyState><a href=#dom-mediastream-readystate>readyState</a></code> attribute has the
value <code title=dom-MediaStream-ENDED><a href=#dom-mediastream-ended>ENDED</a></code> (2) already, then
@@ -75604,11 +75613,41 @@
<li><p><a href=#fire-a-simple-event>Fire a simple event</a> named <code title=event-MediaStream-ended><a href=#event-mediastream-ended>ended</a></code> at the object.</li>
- </ol><p>If the end of the stream was reached due to a user request, the
+ </ol><p>As soon as a <code><a href=#mediastream>MediaStream</a></code> object is <a href=#concept-stream-finished title=concept-stream-finished>finished</a>, the stream's tracks
+ start outputting only silence and/or blackness, as appropriate, <a href=#finishedMute>as defined earlier</a>.</p>
+
+ <p>If the end of the stream was reached due to a user request, the
<a href=#task-source>task source</a> for this <a href=#concept-task title=concept-task>task</a> is the <a href=#user-interaction-task-source>user interaction task
source</a>. Otherwise the <a href=#task-source>task source</a> for this <a href=#concept-task title=concept-task>task</a> is the <a href=#networking-task-source>networking task
source</a>.</p>
+ <hr><p>When a <code><a href=#localmediastream>LocalMediaStream</a></code> object's <dfn id=dom-mediastream-stop title=dom-MediaStream-stop><code>stop()</code></dfn> method is
+ invoked, the user agent must <a href=#queue-a-task>queue a task</a> that runs the
+ following steps:</p>
+
+ <ol><li><p>If the object's <code title=dom-MediaStream-readyState><a href=#dom-mediastream-readystate>readyState</a></code> attribute is
+ in the <code title=dom-MediaStream-ENDED><a href=#dom-mediastream-ended>ENDED</a></code> (2) state,
+ then abort these steps.</li>
+
+ <li><p>Permanently stop the generation of data for the stream. If
+ the data is being generated from a live source (e.g. a microphone
+ or camera), and no other stream is being generated from a live
+ source, then the user agent should remove any active "on-air"
+ indicator. If the data is being generated from a prerecorded source
+ (e.g. a video file), any remaining content in the file is ignored.
+ The stream is <a href=#concept-stream-finished title=concept-stream-finished>finished</a>. The stream's
+ tracks start outputting only silence and/or blackness, as
+ appropriate, <a href=#finishedMute>as defined
+ earlier</a>.</li>
+
+ <li><p>Set the object's <code title=dom-MediaStream-readyState><a href=#dom-mediastream-readystate>readyState</a></code> attribute to
+ <code title=dom-MediaStream-ENDED><a href=#dom-mediastream-ended>ENDED</a></code> (2).</li>
+
+ <li><p><a href=#fire-a-simple-event>Fire a simple event</a> named <code title=event-MediaStream-ended><a href=#event-mediastream-ended>ended</a></code> at the object.</li>
+
+ </ol><p>The <a href=#task-source>task source</a> for the <a href=#concept-task title=concept-task>tasks</a> queued for the <code title=dom-MediaStream-stop><a href=#dom-mediastream-stop>stop()</a></code> method is the <a href=#dom-manipulation-task-source>DOM
+ manipulation task source</a>.</p>
+
<hr><p>When a <code><a href=#localmediastream>LocalMediaStream</a></code> object is created, the user
agent must generate a globally unique identifier string, and must
initialize the object's <code title=dom-MediaStream-label><a href=#dom-mediastream-label>label</a></code>
@@ -75649,30 +75688,6 @@
invoked, the user agent must return a new
<code><a href=#mediastreamrecorder>MediaStreamRecorder</a></code> object associated with the stream.</p>
- <hr><p>When a <code><a href=#localmediastream>LocalMediaStream</a></code> object's <dfn id=dom-mediastream-stop title=dom-MediaStream-stop><code>stop()</code></dfn> method is
- invoked, the user agent must <a href=#queue-a-task>queue a task</a> that runs the
- following steps:</p>
-
- <ol><li><p>If the object's <code title=dom-MediaStream-readyState><a href=#dom-mediastream-readystate>readyState</a></code> attribute is
- in the <code title=dom-MediaStream-ENDED><a href=#dom-mediastream-ended>ENDED</a></code> (2) state,
- then abort these steps.</li>
-
- <li><p>Permanently stop the generation of data for the stream. If
- the data is being generated from a live source (e.g. a microphone
- or camera), and no other stream is being generated from a live
- source, then the user agent should remove any active "on-air"
- indicator. If the data is being generated from a prerecorded source
- (e.g. a video file), any remaining content in the file is
- ignored. The stream has <i>ended</i>.</li>
-
- <li><p>Set the object's <code title=dom-MediaStream-readyState><a href=#dom-mediastream-readystate>readyState</a></code> attribute to
- <code title=dom-MediaStream-ENDED><a href=#dom-mediastream-ended>ENDED</a></code> (2).</li>
-
- <li><p><a href=#fire-a-simple-event>Fire a simple event</a> named <code title=event-MediaStream-ended><a href=#event-mediastream-ended>ended</a></code> at the object.</li>
-
- </ol><p>The <a href=#task-source>task source</a> for the <a href=#concept-task title=concept-task>tasks</a> queued for the <code title=dom-MediaStream-stop><a href=#dom-mediastream-stop>stop()</a></code> method is the <a href=#dom-manipulation-task-source>DOM
- manipulation task source</a>.</p>
-
<hr><p>A <code><a href=#mediastream>MediaStream</a></code> can have multiple audio and video
sources (e.g. because the user has multiple microphones, or because
the real source of the stream is a <a href=#media-resource>media resource</a> with
@@ -76422,6 +76437,15 @@
<li>
+ <p>By definition, <var title="">stream</var> is now <a href=#concept-stream-finished title=concept-stream-finished>finished</a>.</p>
+
+ <p class=note>A <a href=#concept-task title=concept-task>task</a> is thus
+ <a href=#queue-a-task title="queue a task">queued</a> to update <var title="">stream</var> and fire an event.</p>
+
+ </li>
+
+ <li>
+
<p><a href=#queue-a-task>Queue a task</a> to run the following substeps:</p>
<ol><li><p>If the <var title="">connection</var>'s
Modified: index
===================================================================
--- index 2011-07-12 22:23:07 UTC (rev 6290)
+++ index 2011-07-12 22:34:05 UTC (rev 6291)
@@ -75005,15 +75005,27 @@
<code><a href=#peerconnection>PeerConnection</a></code> object.</p>
<p>Each track in a <code><a href=#mediastream>MediaStream</a></code> object can be disabled,
- meaning that it does not appear in the object's output. All tracks
- are initially enabled.</p>
+ meaning that it is muted in the object's output. All tracks are
+ initially enabled.</p>
+ <p id=finishedMute>A <code><a href=#mediastream>MediaStream</a></code> can be <a href=#concept-stream-finished title=concept-stream-finished>finished</a>, indicating that its
+ inputs have forever stopped providing data. When a
+ <code><a href=#mediastream>MediaStream</a></code> object is finished, all its tracks are
+ muted regardless of whether they are enabled or disabled.</p>
+
+ <p>The output of a <code><a href=#mediastream>MediaStream</a></code> object must correspond
+ to the tracks in its input. Muted audio tracks must be replaced with
+ silence. Muted video tracks must be replaced with blackness.</p>
+
<p>A <code><a href=#mediastream>MediaStream</a></code> object's output can be "forked" by
creating a new <code><a href=#mediastream>MediaStream</a></code> object from it using the
<code title=dom-MediaStream><a href=#dom-mediastream>MediaStream()</a></code> constructor. The
new <code><a href=#mediastream>MediaStream</a></code> object's input is the output of the
- object from which it was created, and its output is therefore at
- most a subset of the "parent" object.</p>
+ object from which it was created, with any disabled tracks removed,
+ and its output is therefore at most a subset of that "parent"
+ object. (Merely muted tracks are not removed, so the tracks do not
+ change when the parent is finished.) When such a fork's parent
+ finishes, the fork is also said to have finished.</p>
<p><img alt="" src=http://images.whatwg.org/media-stream-1.png></p><!-- no alt since
it's all described in the previous paragraphs: this is just a
@@ -75281,18 +75293,14 @@
}
-->
- <p>If a track in a <code><a href=#mediastream>MediaStream</a></code> <var title="">parent</var> is disabled, it does not have a corresponding
- track in any <code><a href=#mediastream>MediaStream</a></code> objects that were created from
- <var title="">parent</var>. When a track in a
- <code><a href=#mediastream>MediaStream</a></code> <var title="">parent</var> is disabled, any
- <code><a href=#mediastreamtrack>MediaStreamTrack</a></code> objects corresponding to the tracks in any
- <code><a href=#mediastream>MediaStream</a></code> objects that were created from <var title="">parent</var> are disassociated from any track, and must not
- be reused for tracks again. If a disabled track in a
- <code><a href=#mediastream>MediaStream</a></code> <var title="">parent</var> is re-enabled,
- from the perspective of any <code><a href=#mediastream>MediaStream</a></code> objects that
- were created from <var title="">parent</var> it is a new track and
- thus new <code><a href=#mediastreamtrack>MediaStreamTrack</a></code> objects must be created for the
- tracks that correspond to the re-enabled track.</p>
+ <p>When a track in a <code><a href=#mediastream>MediaStream</a></code> <var title="">parent</var> is disabled, any <code><a href=#mediastreamtrack>MediaStreamTrack</a></code>
+ objects corresponding to the tracks in any <code><a href=#mediastream>MediaStream</a></code>
+ objects that were created from <var title="">parent</var> are
+ disassociated from any track, and must not be reused for tracks
+ again. If a disabled track in a <code><a href=#mediastream>MediaStream</a></code> <var title="">parent</var> is re-enabled, from the perspective of any
+ <code><a href=#mediastream>MediaStream</a></code> objects that were created from <var title="">parent</var> it is a new track and thus new
+ <code><a href=#mediastreamtrack>MediaStreamTrack</a></code> objects must be created for the tracks
+ that correspond to the re-enabled track.</p>
<hr><p>The <code><a href=#localmediastream>LocalMediaStream</a></code> interface is used when the user
agent is generating the stream's data (e.g. from a camera or
@@ -75479,17 +75487,18 @@
user agent learns that no more data will ever be forthcoming for
this stream.</p>
- <p>When a <code><a href=#mediastream>MediaStream</a></code> object ends for any reason other
- than the <code title=dom-MediaStream-stop><a href=#dom-mediastream-stop>stop()</a></code> method
- being invoked (e.g. because the user rescinds the permission for the
- page to use the local camera, or because the data comes from a
- finite file and the file's end has been reached and the user has not
- requested that it be looped, or because the stream comes from a
- remote peer and the remote peer has permanently stopped sending
- data, or because the <code><a href=#mediastream>MediaStream</a></code> was created from
- another <code><a href=#mediastream>MediaStream</a></code> and that stream has just itself
- ended), the user agent must <a href=#queue-a-task>queue a task</a> that runs the
- following steps:</p>
+ <p>When a <code><a href=#mediastream>MediaStream</a></code> object ends for any reason (e.g.
+ because the user rescinds the permission for the page to use the
+ local camera, or because the data comes from a finite file and the
+ file's end has been reached and the user has not requested that it
+ be looped, or because the stream comes from a remote peer and the
+ remote peer has permanently stopped sending data, or because the
+ <code><a href=#mediastream>MediaStream</a></code> was created from another
+ <code><a href=#mediastream>MediaStream</a></code> and that stream has just itself ended), it
+ is said to be <dfn id=concept-stream-finished title=concept-stream-finished>finished</dfn>.
+ When this happens for any reason other than the <code title=dom-MediaStream-stop><a href=#dom-mediastream-stop>stop()</a></code> method being invoked, the
+ user agent must <a href=#queue-a-task>queue a task</a> that runs the following
+ steps:</p>
<ol><li><p>If the object's <code title=dom-MediaStream-readyState><a href=#dom-mediastream-readystate>readyState</a></code> attribute has the
value <code title=dom-MediaStream-ENDED><a href=#dom-mediastream-ended>ENDED</a></code> (2) already, then
@@ -75502,11 +75511,41 @@
<li><p><a href=#fire-a-simple-event>Fire a simple event</a> named <code title=event-MediaStream-ended><a href=#event-mediastream-ended>ended</a></code> at the object.</li>
- </ol><p>If the end of the stream was reached due to a user request, the
+ </ol><p>As soon as a <code><a href=#mediastream>MediaStream</a></code> object is <a href=#concept-stream-finished title=concept-stream-finished>finished</a>, the stream's tracks
+ start outputting only silence and/or blackness, as appropriate, <a href=#finishedMute>as defined earlier</a>.</p>
+
+ <p>If the end of the stream was reached due to a user request, the
<a href=#task-source>task source</a> for this <a href=#concept-task title=concept-task>task</a> is the <a href=#user-interaction-task-source>user interaction task
source</a>. Otherwise the <a href=#task-source>task source</a> for this <a href=#concept-task title=concept-task>task</a> is the <a href=#networking-task-source>networking task
source</a>.</p>
+ <hr><p>When a <code><a href=#localmediastream>LocalMediaStream</a></code> object's <dfn id=dom-mediastream-stop title=dom-MediaStream-stop><code>stop()</code></dfn> method is
+ invoked, the user agent must <a href=#queue-a-task>queue a task</a> that runs the
+ following steps:</p>
+
+ <ol><li><p>If the object's <code title=dom-MediaStream-readyState><a href=#dom-mediastream-readystate>readyState</a></code> attribute is
+ in the <code title=dom-MediaStream-ENDED><a href=#dom-mediastream-ended>ENDED</a></code> (2) state,
+ then abort these steps.</li>
+
+ <li><p>Permanently stop the generation of data for the stream. If
+ the data is being generated from a live source (e.g. a microphone
+ or camera), and no other stream is being generated from a live
+ source, then the user agent should remove any active "on-air"
+ indicator. If the data is being generated from a prerecorded source
+ (e.g. a video file), any remaining content in the file is ignored.
+ The stream is <a href=#concept-stream-finished title=concept-stream-finished>finished</a>. The stream's
+ tracks start outputting only silence and/or blackness, as
+ appropriate, <a href=#finishedMute>as defined
+ earlier</a>.</li>
+
+ <li><p>Set the object's <code title=dom-MediaStream-readyState><a href=#dom-mediastream-readystate>readyState</a></code> attribute to
+ <code title=dom-MediaStream-ENDED><a href=#dom-mediastream-ended>ENDED</a></code> (2).</li>
+
+ <li><p><a href=#fire-a-simple-event>Fire a simple event</a> named <code title=event-MediaStream-ended><a href=#event-mediastream-ended>ended</a></code> at the object.</li>
+
+ </ol><p>The <a href=#task-source>task source</a> for the <a href=#concept-task title=concept-task>tasks</a> queued for the <code title=dom-MediaStream-stop><a href=#dom-mediastream-stop>stop()</a></code> method is the <a href=#dom-manipulation-task-source>DOM
+ manipulation task source</a>.</p>
+
<hr><p>When a <code><a href=#localmediastream>LocalMediaStream</a></code> object is created, the user
agent must generate a globally unique identifier string, and must
initialize the object's <code title=dom-MediaStream-label><a href=#dom-mediastream-label>label</a></code>
@@ -75547,30 +75586,6 @@
invoked, the user agent must return a new
<code><a href=#mediastreamrecorder>MediaStreamRecorder</a></code> object associated with the stream.</p>
- <hr><p>When a <code><a href=#localmediastream>LocalMediaStream</a></code> object's <dfn id=dom-mediastream-stop title=dom-MediaStream-stop><code>stop()</code></dfn> method is
- invoked, the user agent must <a href=#queue-a-task>queue a task</a> that runs the
- following steps:</p>
-
- <ol><li><p>If the object's <code title=dom-MediaStream-readyState><a href=#dom-mediastream-readystate>readyState</a></code> attribute is
- in the <code title=dom-MediaStream-ENDED><a href=#dom-mediastream-ended>ENDED</a></code> (2) state,
- then abort these steps.</li>
-
- <li><p>Permanently stop the generation of data for the stream. If
- the data is being generated from a live source (e.g. a microphone
- or camera), and no other stream is being generated from a live
- source, then the user agent should remove any active "on-air"
- indicator. If the data is being generated from a prerecorded source
- (e.g. a video file), any remaining content in the file is
- ignored. The stream has <i>ended</i>.</li>
-
- <li><p>Set the object's <code title=dom-MediaStream-readyState><a href=#dom-mediastream-readystate>readyState</a></code> attribute to
- <code title=dom-MediaStream-ENDED><a href=#dom-mediastream-ended>ENDED</a></code> (2).</li>
-
- <li><p><a href=#fire-a-simple-event>Fire a simple event</a> named <code title=event-MediaStream-ended><a href=#event-mediastream-ended>ended</a></code> at the object.</li>
-
- </ol><p>The <a href=#task-source>task source</a> for the <a href=#concept-task title=concept-task>tasks</a> queued for the <code title=dom-MediaStream-stop><a href=#dom-mediastream-stop>stop()</a></code> method is the <a href=#dom-manipulation-task-source>DOM
- manipulation task source</a>.</p>
-
<hr><p>A <code><a href=#mediastream>MediaStream</a></code> can have multiple audio and video
sources (e.g. because the user has multiple microphones, or because
the real source of the stream is a <a href=#media-resource>media resource</a> with
@@ -76320,6 +76335,15 @@
<li>
+ <p>By definition, <var title="">stream</var> is now <a href=#concept-stream-finished title=concept-stream-finished>finished</a>.</p>
+
+ <p class=note>A <a href=#concept-task title=concept-task>task</a> is thus
+ <a href=#queue-a-task title="queue a task">queued</a> to update <var title="">stream</var> and fire an event.</p>
+
+ </li>
+
+ <li>
+
<p><a href=#queue-a-task>Queue a task</a> to run the following substeps:</p>
<ol><li><p>If the <var title="">connection</var>'s
Modified: source
===================================================================
--- source 2011-07-12 22:23:07 UTC (rev 6290)
+++ source 2011-07-12 22:34:05 UTC (rev 6291)
@@ -85725,15 +85725,28 @@
<code>PeerConnection</code> object.</p>
<p>Each track in a <code>MediaStream</code> object can be disabled,
- meaning that it does not appear in the object's output. All tracks
- are initially enabled.</p>
+ meaning that it is muted in the object's output. All tracks are
+ initially enabled.</p>
+ <p id="finishedMute">A <code>MediaStream</code> can be <span
+ title="concept-stream-finished">finished</span>, indicating that its
+ inputs have forever stopped providing data. When a
+ <code>MediaStream</code> object is finished, all its tracks are
+ muted regardless of whether they are enabled or disabled.</p>
+
+ <p>The output of a <code>MediaStream</code> object must correspond
+ to the tracks in its input. Muted audio tracks must be replaced with
+ silence. Muted video tracks must be replaced with blackness.</p>
+
<p>A <code>MediaStream</code> object's output can be "forked" by
creating a new <code>MediaStream</code> object from it using the
<code title="dom-MediaStream">MediaStream()</code> constructor. The
new <code>MediaStream</code> object's input is the output of the
- object from which it was created, and its output is therefore at
- most a subset of the "parent" object.</p>
+ object from which it was created, with any disabled tracks removed,
+ and its output is therefore at most a subset of that "parent"
+ object. (Merely muted tracks are not removed, so the tracks do not
+ change when the parent is finished.) When such a fork's parent
+ finishes, the fork is also said to have finished.</p>
<p><img src="images/media-stream-1.png" alt=""></p><!-- no alt since
it's all described in the previous paragraphs: this is just a
@@ -86001,20 +86014,17 @@
}
-->
- <p>If a track in a <code>MediaStream</code> <var
- title="">parent</var> is disabled, it does not have a corresponding
- track in any <code>MediaStream</code> objects that were created from
- <var title="">parent</var>. When a track in a
- <code>MediaStream</code> <var title="">parent</var> is disabled, any
- <code>MediaStreamTrack</code> objects corresponding to the tracks in any
+ <p>When a track in a <code>MediaStream</code> <var
+ title="">parent</var> is disabled, any <code>MediaStreamTrack</code>
+ objects corresponding to the tracks in any <code>MediaStream</code>
+ objects that were created from <var title="">parent</var> are
+ disassociated from any track, and must not be reused for tracks
+ again. If a disabled track in a <code>MediaStream</code> <var
+ title="">parent</var> is re-enabled, from the perspective of any
<code>MediaStream</code> objects that were created from <var
- title="">parent</var> are disassociated from any track, and must not
- be reused for tracks again. If a disabled track in a
- <code>MediaStream</code> <var title="">parent</var> is re-enabled,
- from the perspective of any <code>MediaStream</code> objects that
- were created from <var title="">parent</var> it is a new track and
- thus new <code>MediaStreamTrack</code> objects must be created for the
- tracks that correspond to the re-enabled track.</p>
+ title="">parent</var> it is a new track and thus new
+ <code>MediaStreamTrack</code> objects must be created for the tracks
+ that correspond to the re-enabled track.</p>
<hr>
@@ -86218,17 +86228,19 @@
user agent learns that no more data will ever be forthcoming for
this stream.</p>
- <p>When a <code>MediaStream</code> object ends for any reason other
- than the <code title="dom-MediaStream-stop">stop()</code> method
- being invoked (e.g. because the user rescinds the permission for the
- page to use the local camera, or because the data comes from a
- finite file and the file's end has been reached and the user has not
- requested that it be looped, or because the stream comes from a
- remote peer and the remote peer has permanently stopped sending
- data, or because the <code>MediaStream</code> was created from
- another <code>MediaStream</code> and that stream has just itself
- ended), the user agent must <span>queue a task</span> that runs the
- following steps:</p>
+ <p>When a <code>MediaStream</code> object ends for any reason (e.g.
+ because the user rescinds the permission for the page to use the
+ local camera, or because the data comes from a finite file and the
+ file's end has been reached and the user has not requested that it
+ be looped, or because the stream comes from a remote peer and the
+ remote peer has permanently stopped sending data, or because the
+ <code>MediaStream</code> was created from another
+ <code>MediaStream</code> and that stream has just itself ended), it
+ is said to be <dfn title="concept-stream-finished">finished</dfn>.
+ When this happens for any reason other than the <code
+ title="dom-MediaStream-stop">stop()</code> method being invoked, the
+ user agent must <span>queue a task</span> that runs the following
+ steps:</p>
<ol>
@@ -86249,6 +86261,11 @@
</ol>
+ <p>As soon as a <code>MediaStream</code> object is <span
+ title="concept-stream-finished">finished</span>, the stream's tracks
+ start outputting only silence and/or blackness, as appropriate, <a
+ href="#finishedMute">as defined earlier</a>.</p>
+
<p>If the end of the stream was reached due to a user request, the
<span>task source</span> for this <span
title="concept-task">task</span> is the <span>user interaction task
@@ -86258,6 +86275,46 @@
<hr>
+ <p>When a <code>LocalMediaStream</code> object's <dfn
+ title="dom-MediaStream-stop"><code>stop()</code></dfn> method is
+ invoked, the user agent must <span>queue a task</span> that runs the
+ following steps:</p>
+
+ <ol>
+
+ <li><p>If the object's <code
+ title="dom-MediaStream-readyState">readyState</code> attribute is
+ in the <code title="dom-MediaStream-ENDED">ENDED</code> (2) state,
+ then abort these steps.</p></li>
+
+ <li><p>Permanently stop the generation of data for the stream. If
+ the data is being generated from a live source (e.g. a microphone
+ or camera), and no other stream is being generated from a live
+ source, then the user agent should remove any active "on-air"
+ indicator. If the data is being generated from a prerecorded source
+ (e.g. a video file), any remaining content in the file is ignored.
+ The stream is <span
+ title="concept-stream-finished">finished</span>. The stream's
+ tracks start outputting only silence and/or blackness, as
+ appropriate, <a href="#finishedMute">as defined
+ earlier</a>.</p></li>
+
+ <li><p>Set the object's <code
+ title="dom-MediaStream-readyState">readyState</code> attribute to
+ <code title="dom-MediaStream-ENDED">ENDED</code> (2).</p></li>
+
+ <li><p><span>Fire a simple event</span> named <code
+ title="event-MediaStream-ended">ended</code> at the object.</p></li>
+
+ </ol>
+
+ <p>The <span>task source</span> for the <span
+ title="concept-task">tasks</span> queued for the <code
+ title="dom-MediaStream-stop">stop()</code> method is the <span>DOM
+ manipulation task source</span>.</p>
+
+ <hr>
+
<p>When a <code>LocalMediaStream</code> object is created, the user
agent must generate a globally unique identifier string, and must
initialize the object's <code title="dom-MediaStream-label">label</code>
@@ -86304,42 +86361,6 @@
<hr>
- <p>When a <code>LocalMediaStream</code> object's <dfn
- title="dom-MediaStream-stop"><code>stop()</code></dfn> method is
- invoked, the user agent must <span>queue a task</span> that runs the
- following steps:</p>
-
- <ol>
-
- <li><p>If the object's <code
- title="dom-MediaStream-readyState">readyState</code> attribute is
- in the <code title="dom-MediaStream-ENDED">ENDED</code> (2) state,
- then abort these steps.</p></li>
-
- <li><p>Permanently stop the generation of data for the stream. If
- the data is being generated from a live source (e.g. a microphone
- or camera), and no other stream is being generated from a live
- source, then the user agent should remove any active "on-air"
- indicator. If the data is being generated from a prerecorded source
- (e.g. a video file), any remaining content in the file is
- ignored. The stream has <i>ended</i>.</p></li>
-
- <li><p>Set the object's <code
- title="dom-MediaStream-readyState">readyState</code> attribute to
- <code title="dom-MediaStream-ENDED">ENDED</code> (2).</p></li>
-
- <li><p><span>Fire a simple event</span> named <code
- title="event-MediaStream-ended">ended</code> at the object.</p></li>
-
- </ol>
-
- <p>The <span>task source</span> for the <span
- title="concept-task">tasks</span> queued for the <code
- title="dom-MediaStream-stop">stop()</code> method is the <span>DOM
- manipulation task source</span>.</p>
-
- <hr>
-
<p>A <code>MediaStream</code> can have multiple audio and video
sources (e.g. because the user has multiple microphones, or because
the real source of the stream is a <span>media resource</span> with
@@ -87199,6 +87220,17 @@
<li>
+ <p>By definition, <var title="">stream</var> is now <span
+ title="concept-stream-finished">finished</span>.</p>
+
+ <p class="note">A <span title="concept-task">task</span> is thus
+ <span title="queue a task">queued</span> to update <var
+ title="">stream</var> and fire an event.</p>
+
+ </li>
+
+ <li>
+
<p><span>Queue a task</span> to run the following substeps:</p>
<ol>
More information about the Commit-Watchers
mailing list