Short URL: http://html5.org/r/5961
Index: source
===================================================================
--- source (revision 5960)
+++ source (revision 5961)
@@ -26642,6 +26642,7 @@
<dd><code title="attr-video-poster">poster</code></dd>
<dd><code title="attr-media-preload">preload</code></dd>
<dd><code title="attr-media-autoplay">autoplay</code></dd>
+<!--END w3c-html--><!--CONTROLLER--> <dd><code title="attr-media-mediagroup">mediagroup</code></dd><!--START w3c-html--><!--CONTROLLER-->
<dd><code title="attr-media-loop">loop</code></dd>
<dd><code title="attr-media-audio">audio</code></dd>
<dd><code title="attr-media-controls">controls</code></dd>
@@ -26684,8 +26685,11 @@
<p>The <code title="attr-media-src">src</code>, <code
title="attr-media-preload">preload</code>, <code
- title="attr-media-autoplay">autoplay</code>, <code
- title="attr-media-loop">loop</code>, and <code
+ title="attr-media-autoplay">autoplay</code>,
+<!--END w3c-html--><!--CONTROLLER-->
+ <code title="attr-media-mediagroup">mediagroup</code>,
+<!--START w3c-html--><!--CONTROLLER-->
+ <code title="attr-media-loop">loop</code>, and <code
title="attr-media-controls">controls</code> attributes are <span
title="media element attributes">the attributes common to all media
elements</span>. The <code title="attr-media-audio">audio</code>
@@ -26790,9 +26794,8 @@
Similarly, any audio associated with the <span>media resource</span>
must, if played, be played synchronized with the <span>current
- playback position</span>, at the specified <span
- title="dom-media-volume">volume</span> with the specified <span
- title="dom-media-muted">mute state</span>.</p>
+ playback position</span>, at the element's <span>effective media
+ volume</span>.</p>
<p>When a <code>video</code> element whose <span>media
resource</span> has a video channel is neither <span>potentially
@@ -27025,6 +27028,7 @@
<dd><code title="attr-media-src">src</code></dd>
<dd><code title="attr-media-preload">preload</code></dd>
<dd><code title="attr-media-autoplay">autoplay</code></dd>
+<!--END w3c-html--><!--CONTROLLER--> <dd><code title="attr-media-mediagroup">mediagroup</code></dd><!--START w3c-html--><!--CONTROLLER-->
<dd><code title="attr-media-loop">loop</code></dd>
<dd><code title="attr-media-controls">controls</code></dd>
<dt>DOM interface:</dt>
@@ -27074,8 +27078,11 @@
<p>The <code title="attr-media-src">src</code>, <code
title="attr-media-preload">preload</code>, <code
- title="attr-media-autoplay">autoplay</code>, <code
- title="attr-media-loop">loop</code>, and <code
+ title="attr-media-autoplay">autoplay</code>,
+<!--END w3c-html--><!--CONTROLLER-->
+ <code title="attr-media-mediagroup">mediagroup</code>,
+<!--START w3c-html--><!--CONTROLLER-->
+ <code title="attr-media-loop">loop</code>, and <code
title="attr-media-controls">controls</code> attributes are <span
title="media element attributes">the attributes common to all media
elements</span>.</p>
@@ -27084,9 +27091,8 @@
<p>When an <code>audio</code> element is <span>potentially
playing</span>, it must have its audio data played synchronized with
- the <span>current playback position</span>, at the specified <span
- title="dom-media-volume">volume</span> with the specified <span
- title="dom-media-muted">mute state</span>.</p>
+ the <span>current playback position</span>, at the element's
+ <span>effective media volume</span>.</p>
<p>When an <code>audio</code> element is not <span>potentially
playing</span>, audio must not play for the element.</p>
@@ -27638,13 +27644,21 @@
attribute boolean <span title="dom-media-loop">loop</span>;
void <span title="dom-media-play">play</span>();
void <span title="dom-media-pause">pause</span>();
+<!--END w3c-html--><!--CONTROLLER-->
+ // media controller
+ attribute <span>DOMString</span> <span title="dom-media-mediaGroup">mediaGroup</span>;
+ attribute <span>MediaController</span> <span title="dom-media-controller">controller</span>;<!--START w3c-html--><!--CONTROLLER-->
// controls
attribute boolean <span title="dom-media-controls">controls</span>;
attribute double <span title="dom-media-volume">volume</span>;
attribute boolean <span title="dom-media-muted">muted</span>;
<!--KEEP-END w3c-html--><!--TT-->
- // text tracks
+ // tracks
+<!--END w3c-html--><!--CONTROLLER-->
+ readonly attribute <span>MultipleTrackList</span> <span title="dom-media-audioTracks">audioTracks</span>;
+ readonly attribute <span>ExclusiveTrackList</span> <span title="dom-media-videoTracks">videoTracks</span>;
+<!--START w3c-html--><!--CONTROLLER-->
readonly attribute <span>TextTrack</span>[] <span title="dom-media-textTracks">textTracks</span>;
<span>MutableTextTrack</span> <span title="dom-media-addTrack">addTrack</span>(in DOMString kind, in optional DOMString label, in optional DOMString language);
<!--KEEP-START w3c-html--><!--TT-->
@@ -27653,15 +27667,17 @@
<p>The <dfn>media element attributes</dfn>, <code
title="attr-media-src">src</code>, <code
title="attr-media-preload">preload</code>, <code
- title="attr-media-autoplay">autoplay</code>, <code
- title="attr-media-loop">loop</code>, and <code
+ title="attr-media-autoplay">autoplay</code>,
+<!--END w3c-html--><!--CONTROLLER-->
+ <code title="attr-media-mediagroup">mediagroup</code>,
+<!--START w3c-html--><!--CONTROLLER-->
+ <code title="attr-media-loop">loop</code>, and <code
title="attr-media-controls">controls</code>, apply to all <span
title="media element">media elements</span>. They are defined in
this section.</p> <!-- attr-media-audio -->
<!-- proposed v2 (actually v3!) features:
* frame forward / backwards / step(n) while paused
- * hasAudio, hasVideo, hasCaptions, etc
* per-frame control: get current frame; set current frame
* queue of content
- pause current stream and insert content at front of queue to play immediately
@@ -27676,6 +27692,7 @@
* video: applying CSS filters
* an event to notify people of when the video size changes
(e.g. for chained Ogg streams of multiple independent videos)
+ (or for when the current video track changes)
* balance and 3D position audio
* audio filters
* audio synthesis (see <audio> section for use cases)
@@ -27701,6 +27718,18 @@
resource</dfn> is used to refer to the complete set of media data,
e.g. the complete video file, or complete audio file.</p>
+<!--END w3c-html--><!--CONTROLLER-->
+ <p>A <span>media resource</span> can have multiple audio and video
+ tracks. For the purposes of a <span>media element</span>, the video
+ data of the <span>media resource</span> is only that of the
+ currently selected track (if any) given by the element's <code
+ title="dom-media-videoTracks">videoTracks</code> attribute, and the
+ audio data of the <span>media resource</span> is the result of
+ mixing all the currently enabled tracks (if any) given by the
+ element's <code title="dom-media-audioTracks">audioTracks</code>
+ attribute.</p>
+<!--START w3c-html--><!--CONTROLLER-->
+
<div class="impl">
<p>Except where otherwise specified, the <span>task source</span>
@@ -28736,13 +28765,31 @@
resulting exceptions (if the position is out of range, it is
effectively ignored).</p>
- <p class="example">For example, a fragment identifier could be
- used to indicate a start position.</p>
+ <p class="example">For example, with media formats that
+ support the <cite>Media Fragments URI</cite> fragment
+ identifier syntax, the fragment identifier can be used to
+ indicate a start position. <a
+ href="#refsMEDIAFRAG">[MEDIAFRAG]</a></p>
</li>
+<!--END w3c-html--><!--CONTROLLER-->
<li>
+ <p>If either the <span>media resource</span> or the address of
+ the <var title="">current media resource</var> indicate a
+ particular set of audio or video tracks to enable, then the
+ selected audio tracks must be enabled in the element's <code
+ title="dom-media-audioTracks">audioTracks</code> object, and
+ the the first selected video track must be selected in the
+ element's <code
+ title="dom-media-videoTracks">videoTracks</code> object.</p>
+
+ </li>
+<!--START w3c-html--><!--CONTROLLER-->
+
+ <li>
+
<p>Once the <code
title="dom-media-readyState">readyState</code> attribute
reaches <code
@@ -29740,16 +29787,24 @@
attribute represents whether the <span>media element</span> is
paused or not. The attribute must initially be true.</p>
+ <p>A <span>media element</span> is a <dfn>blocked media
+ element</dfn> if its <code
+ title="dom-media-readyState">readyState</code> attribute is in the
+ <code title="dom-media-HAVE_NOTHING">HAVE_NOTHING</code> state or
+ the <code title="dom-media-HAVE_METADATA">HAVE_METADATA</code>
+ state, or if the element has <span>paused for user
+ interaction</span>.</p>
+
<p>A <span>media element</span> is said to be <dfn>potentially
playing</dfn> when its <code title="dom-media-paused">paused</code>
- attribute is false, the <code
- title="dom-media-readyState">readyState</code> attribute is either
- <code title="dom-media-HAVE_CURRENT_DATA">HAVE_CURRENT_DATA</code>,
- <code title="dom-media-HAVE_FUTURE_DATA">HAVE_FUTURE_DATA</code>, or
- <code title="dom-media-HAVE_ENOUGH_DATA">HAVE_ENOUGH_DATA</code>,
- the element has not <span>ended playback</span>, playback has not
- <span>stopped due to errors</span>, and the element has not <span>paused
- for user interaction</span>.</p>
+ attribute is false, the element has not <span>ended playback</span>,
+ playback has not <span>stopped due to errors</span>,
+<!--END w3c-html--><!--CONTROLLER-->
+ the element either has no <span>current media controller</span> or
+ has a <span>current media controller</span> that is itself not a
+ <span>blocked media controller</span>,
+<!--START w3c-html--><!--CONTROLLER-->
+ and the element is not a <span>blocked media element</span>.</p>
<p>A <span>media element</span> is said to have <dfn>ended
playback</dfn> when the element's <code
@@ -29867,6 +29922,11 @@
value it was set to, or 1.0 if it hasn't yet been set; on setting
the attribute must be set to the new value.</p>
+ <p class="note">The <code
+ title="dom-media-defaultPlaybackRate">defaultPlaybackRate</code> is
+ used by the user agent when it <span title="expose a user interface
+ to the user">exposes a user interface to the user</span>.</p>
+
<p>The <dfn
title="dom-media-playbackRate"><code>playbackRate</code></dfn>
attribute gives the speed at which the <span>media resource</span>
@@ -29880,28 +29940,21 @@
value, and the playback must change speed (if the element is
<span>potentially playing</span>).</p>
- <p>If the <code title="dom-media-playbackRate">playbackRate</code>
- is positive or zero, then the <dfn>direction of playback</dfn> is
- forwards. Otherwise, it is backwards.</p>
+ <p>The <code title="dom-media-playbackRate">playbackRate</code> can
+ be 0.0, in which case the <span>current playback position</span>
+ doesn't move, despite playback not being paused (<code
+ title="dom-media-paused">paused</code> doesn't become true, and the
+ <code title="event-media-pause">pause</code> event doesn't fire).</p>
- <p>The "play" function in a user agent's interface must set the
- <code title="dom-media-playbackRate">playbackRate</code> attribute
- to the value of the <code
- title="dom-media-defaultPlaybackRate">defaultPlaybackRate</code>
- attribute before invoking the <code
- title="dom-media-play">play()</code> method's steps. Features such
- as fast-forward or rewind must be implemented by only changing the
- <code title="dom-media-playbackRate">playbackRate</code>
- attribute.</p>
-
<p id="rateUpdate">When the <code
title="dom-media-defaultPlaybackRate">defaultPlaybackRate</code> or
<code title="dom-media-playbackRate">playbackRate</code> attributes
change value (either by being set by script or by being changed
directly by the user agent, e.g. in response to user control) the
user agent must <span>queue a task</span> to <span>fire a simple
- event</span> named <code title="event-media-ratechange">ratechange</code>
- at the <span>media element</span>.</p>
+ event</span> named <code
+ title="event-media-ratechange">ratechange</code> at the <span>media
+ element</span>.</p>
<p>The <dfn title="dom-media-played"><code>played</code></dfn>
attribute must return a new static <span>normalized
@@ -30034,13 +30087,36 @@
<hr>
+ <p>The
+<!--END w3c-html--><!--CONTROLLER-->
+ <var title="">effective playback rate</var> is not necessarily the
+ element's <code title="dom-media-playbackRate">playbackRate</code>.
+ When a <span>media element</span> has a <span>current media
+ controller</span>, its <var title="">effective playback rate</var>
+ is the element's <code
+ title="dom-media-playbackRate">playbackRate</code> multiplied by the
+ <code>MediaController</code>'s <span>media controller playback rate
+ multiplier</span>. Otherwise, the
+<!--START w3c-html--><!--CONTROLLER-->
+ <var title="">effective playback rate</var> is just the
+ element's <code
+ title="dom-media-playbackRate">playbackRate</code>.</p>
+
+ <p>If the <var title="">effective playback rate</var> is positive or
+ zero, then the <dfn>direction of playback</dfn> is forwards.
+ Otherwise, it is backwards.</p>
+
<p id="media-playback">When a <span>media element</span> is
<span>potentially playing</span> and its <code>Document</code> is a
<span>fully active</span> <code>Document</code>, its <span>current
- playback position</span> must increase monotonically at <code
- title="dom-media-playbackRate">playbackRate</code> units of media
- time per unit time of wall clock time.</p>
+ playback position</span> must increase monotonically at <var
+ title="">effective playback rate</var> units of media time per unit
+ time of wall clock time.</p> <!--XXX will change with bug 12339 -->
+ <p class="note">If the <var title="">effective playback rate</var>
+ is zero, the <span>current playback position</span> doesn't
+ move.</p>
+
<p class="note">This specification doesn't define how the user agent
achieves the appropriate playback rate — depending on the
protocol and media available, it is plausible that the user agent
@@ -30050,22 +30126,14 @@
playback rate) the client doesn't actually have to drop or
interpolate any frames.</p>
- <p>When the <code title="dom-media-playbackRate">playbackRate</code>
- is negative (playback is backwards), any corresponding audio must be
- muted. When the <code
- title="dom-media-playbackRate">playbackRate</code> is so low or so
- high that the user agent cannot play audio usefully, the
- corresponding audio must also be muted. If the <code
- title="dom-media-playbackRate">playbackRate</code> is not 1.0, the
- user agent may apply pitch adjustments to the audio as necessary to
+ <p>When the <span>direction of playback</span> is backwards, any
+ corresponding audio must be muted. When the <var title="">effective
+ playback rate</var> is so low or so high that the user agent cannot
+ play audio usefully, the corresponding audio must also be muted. If
+ the <var title="">effective playback rate</var> is not 1.0, the user
+ agent may apply pitch adjustments to the audio as necessary to
render it faithfully.</p>
- <p>The <code title="dom-media-playbackRate">playbackRate</code> can
- be 0.0, in which case the <span>current playback position</span>
- doesn't move, despite playback not being paused (<code
- title="dom-media-paused">paused</code> doesn't become true, and the
- <code title="event-media-pause">pause</code> event doesn't fire).</p>
-
<p><span title="media element">Media elements</span> that are
<span>potentially playing</span> while not <span>in a
<code>Document</code></span> must not play any video, but should
@@ -30427,8 +30495,803 @@
</div>
+<!--END w3c-html--><!--CONTROLLER-->
+ <h5>Media resources with multiple media tracks</h5>
+ <p>A <span>media resource</span> can have multiple embedded audio
+ and video tracks. For example, in addition to the primary video and
+ audio tracks, a <span>media resource</span> could have
+ foreign-language dubbed dialogues, director's commentaries, audio
+ descriptions, alternative angles, or sign-language overlays.</p>
+
+ <dl class="domintro">
+
+ <dt><var title="">media</var> . <code title="dom-media-audioTracks">audioTracks</code></dt>
+
+ <dd>
+
+ <p>Returns a <code>MultipleTrackList</code> object representing
+ the audio tracks available in the <span>media resource</span>.</p>
+
+ </dd>
+
+ <dt><var title="">media</var> . <code title="dom-media-videoTracks">videoTracks</code></dt>
+
+ <dd>
+
+ <p>Returns an <code>ExclusiveTrackList</code> object representing
+ the video tracks available in the <span>media resource</span>.</p>
+
+ </dd>
+
+ </dl>
+
+ <div class="impl">
+
+ <p>The <dfn
+ title="dom-media-audioTracks"><code>audioTracks</code></dfn>
+ attribute of a <span>media element</span> must return a
+ <span>live</span> <code>MultipleTrackList</code> object representing
+ the audio tracks available in the <span>media element</span>'s
+ <span>media resource</span>. The same object must be returned each
+ time.</p>
+
+ <p>The <dfn
+ title="dom-media-videoTracks"><code>videoTracks</code></dfn>
+ attribute of a <span>media element</span> must return a
+ <span>live</span> <code>ExclusiveTrackList</code> object
+ representing the video tracks available in the <span>media
+ element</span>'s <span>media resource</span>. The same object must
+ be returned each time.</p>
+
+ </div>
+
+
+ <h6><code>TrackList</code> objects</h6>
+
+ <p>The <code>MultipleTrackList</code> and
+ <code>ExclusiveTrackList</code> interfaces, used by the attributes
+ defined in the previous section, are substantially similar. Their
+ common features are defined in the <code>TrackList</code> interface,
+ from which they both inherit.</p>
+
+ <pre class="idl">interface <dfn>TrackList</dfn> {
+ readonly attribute unsigned long <span title="dom-TrackList-length">length</span>;
+ DOMString <span title="dom-TrackList-getName">getName</span>(in unsigned long index);
+ DOMString <span title="dom-TrackList-getLanguage">getLanguage</span>(in unsigned long index);
+};
+
+interface <dfn>MultipleTrackList</dfn> : <span>TrackList</span> {
+ boolean <span title="dom-TrackList-isEnabled">isEnabled</span>(in unsigned long index);
+ void <span title="dom-TrackList-enable">enable</span>(in unsigned long index);
+ void <span title="dom-TrackList-disable">disable</span>(in unsigned long index);
+};
+
+interface <dfn>ExclusiveTrackList</dfn> : <span>TrackList</span> {
+ readonly attribute unsigned long <span title="dom-TrackList-selectedIndex">selectedIndex</span>;
+ void <span title="dom-TrackList-select">select</span>(in unsigned long index);
+};</pre>
+
+ <dl class="domintro">
+
+ <dt><var title="">tracks</var> . <code title="dom-TrackList-length">length</code></dt>
+
+ <dd>
+
+ <p>Returns the number of tracks in the list.</p>
+
+ </dd>
+
+ <dt><var title="">name</var> = <var title="">tracks</var> . <code title="dom-TrackList-getName">getName</code>( <var title="">index</var> )</dt>
+
+ <dd>
+
+ <p>Returns the name of the given track, if known, or the empty string otherwise.</p>
+
+ </dd>
+
+ <dt><var title="">language</var> = <var title="">tracks</var> . <code title="dom-TrackList-getLanguage">getLanguage</code>( <var title="">index</var> )</dt>
+
+ <dd>
+
+ <p>Returns the language of the given track, if known, or the empty string otherwise.</p>
+
+ </dd>
+
+ <dt><var title="">enabled</var> = <var title="">audioTracks</var> . <code title="dom-TrackList-isEnabled">isEnabled</code>( <var title="">index</var> )</dt>
+
+ <dd>
+
+ <p>Returns true if the given track is active, and false otherwise.</p>
+
+ </dd>
+
+ <dt><var title="">audioTracks</var> . <code title="dom-TrackList-enable">enable</code>( <var title="">index</var> )</dt>
+
+ <dd>
+
+ <p>Enables the given track.</p>
+
+ </dd>
+
+ <dt><var title="">audioTracks</var> . <code title="dom-TrackList-disable">disable</code>( <var title="">index</var> )</dt>
+
+ <dd>
+
+ <p>Disables the given track.</p>
+
+ </dd>
+
+ <dt><var title="">videoTracks</var> . <code title="dom-TrackList-selectedIndex">isEnabled</code></dt>
+
+ <dd>
+
+ <p>Returns the index of the currently selected track, if any, or −1 otherwise.</p>
+
+ </dd>
+
+ <dt><var title="">videoTracks</var> . <code title="dom-TrackList-select">select</code>( <var title="">index</var> )</dt>
+
+ <dd>
+
+ <p>Selects the given track.</p>
+
+ </dd>
+
+ </dl>
+
+ <div class="impl">
+
+ <p class="note">There are only ever two <code>TrackList</code>
+ objects (one <code>MultipleTrackList</code> object and one
+ <code>ExclusiveTrackList</code> object) per <span>media
+ element</span>, even if another <span>media resource</span> is
+ loaded into the element: the objects are reused.</p>
+
+ <p>The <dfn title="dom-TrackList-length"><code>length</code></dfn>
+ attribute must return the number of tracks represented by the
+ <code>TrackList</code> object at the time of getting.</p>
+
+ <p>Tracks in a <code>TrackList</code> object must be consistently
+ ordered. If the <span>media resource</span> is in a format that
+ defines an order, then that order must be used; otherwise, the order
+ must be the relative order in which the tracks are declared in the
+ <span>media resource</span>. Each track in a <code>TrackList</code>
+ thus has an index; the first has the index 0, and each subsequent
+ track is numbered one higher than the previous one.</p>
+
+ <p>The <dfn title="dom-TrackList-getName"><code>getName(<var
+ title="">index</var>)</code></dfn> method must return the name of
+ the track with index <var title="">index</var>, if there is one and
+ it has a name. If there is no such track, then the method must
+ instead throw an <code>INDEX_SIZE_ERR</code> exception. If there is
+ a track with index <var title="">index</var>, but it has no name,
+ then the method must return the empty string.</p>
+
+ <p>The <dfn title="dom-TrackList-getLanguage"><code>getLanguage(<var
+ title="">index</var>)</code></dfn> method must return the BCP 47
+ language tag of the language of the track with index <var
+ title="">index</var>, if there is one and it has a language. If
+ there is no such track, then the method must instead throw an
+ <code>INDEX_SIZE_ERR</code> exception. If there is a track with
+ index <var title="">index</var>, but it has no language, or the user
+ agent is not able to express that language as a BCP 47 language tag
+ (for example because the language information in the <span>media
+ resource</span>'s format is a free-form string without a defined
+ interpretation), then the method must return the empty string.</p>
+
+ <hr>
+
+ <p>A <code>MultipleTrackList</code> object represents a track list
+ where multiple tracks can be enabled simultaneously. Each track is
+ either enabled or disabled.</p>
+
+ <p>The <dfn title="dom-TrackList-isEnabled"><code>isEnabled(<var
+ title="">index</var>)</code></dfn> method must return true if there
+ is a track with index <var title="">index</var>, and it is currently
+ enabled, false if there is a track with index <var
+ title="">index</var>, but it is currently disabled, and must throw
+ an <code>INDEX_SIZE_ERR</code> exception if there is no track with
+ index <var title="">index</var>.</p>
+
+ <p>The <dfn title="dom-TrackList-enable"><code>enable(<var
+ title="">index</var>)</code></dfn> method must enable the track with
+ index <var title="">index</var>, if there is one. If there is not,
+ it must instead throw an <code>INDEX_SIZE_ERR</code> exception.</p>
+
+ <p>The <dfn title="dom-TrackList-disable"><code>disable(<var
+ title="">index</var>)</code></dfn> method must disable the track with
+ index <var title="">index</var>, if there is one. If there is not,
+ it must instead throw an <code>INDEX_SIZE_ERR</code> exception.</p>
+
+ <hr>
+
+ <p>An <code>ExclusiveTrackList</code> object represents a track list
+ where exactly one track is selected at a time.</p>
+
+ <p>The <dfn
+ title="dom-TrackList-selectedIndex"><code>selectedIndex</code></dfn>
+ attribute must return the index of the currently selected track. If
+ the <code>ExclusiveTrackList</code> object does not represent any
+ tracks, it must instead return −1.</p>
+
+ <p>The <dfn title="dom-TrackList-select"><code>select(<var
+ title="">index</var>)</code></dfn> must select the track with index
+ <var title="">index</var>, if there is one, unselecting whichever
+ track was previously selected. If there is no track with index <var
+ title="">index</var>, it must instead throw an
+ <code>INDEX_SIZE_ERR</code> exception.</p>
+
+ </div>
+
+
+ <h6>Selecting specific audio and video tracks declaratively</h6>
+
+ <p>The <code title="dom-media-audioTracks">audioTracks</code> and
+ <code title="dom-media-videoTracks">videoTracks</code> attributes
+ allow scripts to select which track should play, but it is also
+ possible to select specific tracks declaratively, by specifying
+ particular tracks in the fragment identifier of the <span>URL</span>
+ of the <span>media resource</span>. The format of the fragment
+ identifier depends on the <span>MIME type</span> of the <span>media
+ resource</span>. <a href="#refsRFC2046">[RFC2046]</a> <a
+ href="#refsRFC3986">[RFC3986]</a></p>
+
+ <div class="example">
+
+ <p>In this example, a video that uses a format that supports the
+ <cite>Media Fragments URI</cite> fragment identifier syntax is
+ embedded in such a way that the alternative angles labeled
+ "Alternative" are enabled instead of the default video track. <a
+ href="#refsMEDIAFRAG">[MEDIAFRAG]</a></p>
+
+ <pre><video src="myvideo#track=Alternative"></video></pre>
+
+ <!-- XXX need to check with the mediafrag people about whether
+ there's a way to select a specific audio or video track without
+ affecting the default track selection of the other axis, e.g.
+ setting the video track without changing the default audio track
+ selection -->
+
+ </div>
+
+
+ <h5>Synchronising multiple media elements</h5>
+
+ <h6>Introduction</h6>
+
+ <p>Each <span>media element</span> can have a
+ <code>MediaController</code>. A <code>MediaController</code> is an
+ object that coordinates the playback of multiple <span title="media
+ element">media elements</span>, for instance so that a sign-language
+ interpreter track can be overlaid on a video track, with the two
+ being kept in sync.</p>
+
+ <p>By default, a <span>media element</span> has no
+ <code>MediaController</code>. An implicit
+ <code>MediaController</code> can be assigned using the <code
+ title="attr-media-mediagroup">mediagroup</code> content attribute.
+ An explicit <code>MediaController</code> can be assigned directly
+ using the <code title="dom-media-controller">controller</code> IDL
+ attribute.</p>
+
+ <p><span title="media element">Media elements</span> with a
+ <code>MediaController</code> are said to be <i>slaved</i> to their
+ controller. The <code>MediaController</code> modifies the playback
+ rate and the playback volume of each of the <span title="media
+ element">media elements</span> slaved to it, and ensures that when
+ any of its slaved <span title="media element">media elements</span>
+ unexpectedly stall, the others are stopped at the same time.</p>
+
+ <div class="example">
+
+ <p>In this example, two audio elements are slaved to the same
+ (implicit) controller so that a waltz played by one audio element
+ is kept exactly synchronised to the "tick tock tock" sound of the
+ metronome played by the second element:</p>
+
+ <pre><audio src="The%20Amelia%20Earhart%20Waltz.wav" controls autoplay mediagroup="song"></audio>
+<audio src="metronomes/3-4.wav" autoplay loop mediagroup="song"></audio></pre>
+
+ <p>Assuming the song keeps a regular tempo throughout and assuming
+ the metronome has the same tempo, this works even though if the
+ metronome file only has one measure's worth of "tick tock tock",
+ because the controller (implied by the <code
+ title="attr-media-mediagroup">mediagroup</code> attribute)
+ guarantees that the two elements will be kept synchronised, even if
+ the user rewinds, jumps to a different part of the song, etc (the
+ user agent controls made available by the <code
+ title="attr-media-controls">controls</code> attribute on the song's
+ <code>audio</code> element affect the
+ <code>MediaController</code>'s state).</p>
+
+ <p>If the metronome has the wrong rate, its rate can be adjusted by
+ script separately from the song's (using the <code
+ title="dom-media-playbackRate">audio.playbackRate</code> IDL
+ attribute). The two elements will play back their <span>media
+ data</span> at different rates, but the ratio will again be
+ controlled by the <code>MediaController</code>.</p>
+
+ </div>
+
+
+ <h6>Media controllers</h6>
+
+ <pre class="idl">[<span title="dom-MediaController">Constructor</span>]
+interface <dfn>MediaController</dfn> {
+ readonly attribute boolean <span title="dom-MediaController-paused">paused</span>;
+ void <span title="dom-MediaController-play">play</span>();
+ void <span title="dom-MediaController-pause">pause</span>();
+
+ attribute double <span title="dom-MediaController-defaultPlaybackRate">defaultPlaybackRate</span>;
+ attribute double <span title="dom-MediaController-playbackRate">playbackRate</span>;
+
+ attribute double <span title="dom-MediaController-volume">volume</span>;
+ attribute boolean <span title="dom-MediaController-muted">muted</span>;
+
+ void <span title="dom-MediaController-seek">seek</span>(in double delta);
+
+ attribute <span>Function</span> <span title="handler-MediaController-onplay">onplay</span>;
+ attribute <span>Function</span> <span title="handler-MediaController-onpause">onpause</span>;
+ attribute <span>Function</span> <span title="handler-MediaController-onratechange">onratechange</span>;
+ attribute <span>Function</span> <span title="handler-MediaController-onvolumechange">onvolumechange</span>;
+};</pre>
+
+ <dl class="domintro">
+
+ <dt><var title="">controller</var> = new <code title="dom-MediaController">MediaController</code>()</dt>
+
+ <dd>
+
+ <p>Returns a new <code>MediaController</code> object.</p>
+
+ </dd>
+
+ <dt><var title="">media</var> . <code title="dom-media-controller">controller</code> [ = <var title="">controller</var> ]</dt>
+
+ <dd>
+
+ <p>Returns the current <code>MediaController</code> for the <span>media element</span>, if any; returns null otherwise.</p>
+
+ <p>Can be set, to set an explicit <code>MediaController</code>.
+ Doing so removes the <code
+ title="attr-media-mediagroup">mediagroup</code> attribute, if
+ any.</p>
+
+ </dd>
+
+ <dt><var title="">controller</var> . <code title="dom-MediaController-paused">paused</code></dt>
+
+ <dd>
+
+ <p>Returns true if playback is paused; false otherwise. When this
+ attribute is true, any <span>media element</span> slaved to this
+ controller will be stopped.</p>
+
+ </dd>
+
+ <dt><var title="">controller</var> . <code title="dom-MediaController-play">play</code>()</dt>
+
+ <dd>
+
+ <p>Sets the <code title="dom-MediaController-paused">paused</code>
+ attribute to false.</p>
+
+ </dd>
+
+ <dt><var title="">controller</var> . <code title="dom-MediaController-pause">pause</code>()</dt>
+
+ <dd>
+
+ <p>Sets the <code title="dom-MediaController-paused">paused</code>
+ attribute to true.</p>
+
+ </dd>
+
+ <dt><var title="">controller</var> . <code title="dom-MediaController-defaultPlaybackRate">defaultPlaybackRate</code> [ = <var title="">value</var> ]</dt>
+
+ <dd>
+
+ <p>Returns the default multiplier of the rate of playback.</p>
+
+ <p>Can be set, to change the default multiplier of the rate of
+ playback.</p>
+
+ <p>This default multiplier has no direct effect on playback, but
+ if the user switches to a fast-forward mode, when they return to
+ the normal playback mode, it is expected that rate of playback
+ multiplier (<code
+ title="dom-MediaController-playbackRate">playbackRate</code>) will
+ be returned to this default multiplier.</p>
+
+ </dd>
+
+ <dt><var title="">controller</var> . <code title="dom-MediaController-playbackRate">playbackRate</code> [ = <var title="">value</var> ]</dt>
+
+ <dd>
+
+ <p>Returns the current multiplier of the rate playback, where 1.0
+ is no multiplier.</p>
+
+ <p>Can be set, to change the rate of playback of the <span
+ title="media element">media elements</span> slaved to this
+ controller.</p>
+
+ </dd>
+
+ <dt><var title="">controller</var> . <code title="dom-MediaController-volume">volume</code> [ = <var title="">value</var> ]</dt>
+
+ <dd>
+
+ <p>Returns the current playback volume multiplier, as a number in
+ the range 0.0 to 1.0, where 0.0 is the quietest and 1.0 the
+ loudest.</p>
+
+ <p>Can be set, to change the volume multiplier.</p>
+
+ <p>Throws an <code>INDEX_SIZE_ERR</code> if the new value is not
+ in the range 0.0 .. 1.0.</p>
+
+ </dd>
+
+ <dt><var title="">controller</var> . <code title="dom-MediaController-muted">muted</code> [ = <var title="">value</var> ]</dt>
+
+ <dd>
+
+ <p>Returns true if all audio is muted (regardless of other
+ attributes either on the controller or on any <span title="media
+ element">media elements</span> slaved to this controller), and
+ false otherwise.</p>
+
+ <p>Can be set, to change whether the audio is muted or not.</p>
+
+ </dd>
+
+ <dt><var title="">controller</var> . <code title="dom-MediaController-seek">seek</code>( <var title="">delta</var> )</dt>
+
+ <dd>
+
+ <p>Advances the <span title="media element">media elements</span>
+ slaved to this controller by <var title="">delta</var> seconds,
+ corrected to take into account their relative playback rates.</p>
+
+ </dd>
+
+ </dl>
+
+ <div class="impl">
+
+ <p>A <span>media element</span> can have a <dfn>current media
+ controller</dfn>, which is a <code>MediaController</code> object.
+ The <dfn>slaved media elements</dfn> of a
+ <code>MediaController</code> are the <span title="media
+ element">media elements</span> whose <span>current media
+ controller</span> is that <code>MediaController</code>.</p>
+
+ <p>All the <span>slaved media elements</span> of a
+ <code>MediaController</code> must use the same clock for their
+ definition of their <span>media timeline</span>'s unit time.</p>
+
+ <p>When a <code>MediaController</code> is created it is a
+ <dfn>playing media controller</dfn>. It can be changed into a
+ <dfn>paused media controller</dfn> and back either via the user
+ agent's user interface (when the element is <span title="expose a
+ user interface to the user">exposing a user interface to the
+ user</span>) or via the APIs defined in this section (see
+ below).</p>
+
+ <p>A <code>MediaController</code> is a <dfn>blocked media
+ controller</dfn> if the <code>MediaController</code> is a
+ <span>paused media controller</span>, or if any of its <span>slaved
+ media elements</span> are <span title="blocked media
+ element">blocked media elements</span>, or if any of its
+ <span>slaved media elements</span> whose <span>autoplaying
+ flag</span> is true still have a <code
+ title="dom-media-paused">paused</code> attribute this is true.</p>
+
+ <p>A <code>MediaController</code> has a <dfn>media controller
+ default playback rate multiplier</dfn>, a <dfn>media controller
+ playback rate multiplier</dfn>, and a <dfn>media controller volume
+ multiplier</dfn>, which must all be set to 1.0 when the
+ <code>MediaController</code> object is created. A
+ <code>MediaController</code> also has a <dfn>media controller mute
+ override</dfn>, much must initially be false.</p>
+
+ <hr>
+
+ <p>The <dfn
+ title="dom-media-controller"><code>controller</code></dfn> attribute
+ on a <span>media element</span>, on getting, must return the
+ element's <span>current media controller</span>, if any, or null
+ otherwise. On setting, it must first remove the element's <code
+ title="attr-media-mediagroup">mediagroup</code> attribute, if any,
+ and then set the <span>current media controller</span> to the given
+ value. If the given value is null, the element no longer has a
+ <span>current media controller</span>.</p>
+
+ <hr>
+
+ <p>The <dfn
+ title="dom-MediaController"><code>MediaController()</code></dfn>
+ constructor, when invoked, must return a newly created
+ <code>MediaController</code> object.</p>
+
+ <hr>
+
+ <p>The <dfn
+ title="dom-MediaController-paused"><code>paused</code></dfn>
+ attribute must return true if the <code>MediaController</code>
+ object is a <span>paused media controller</span>, and false
+ otherwise.</p>
+
+ <p>When the <dfn
+ title="dom-MediaController-pause"><code>pause()</code></dfn> method
+ is invoked, the user agent must change the
+ <code>MediaController</code> into a <span>paused media
+ controller</span>.</p>
+
+ <p>Whenever the <code>MediaController</code> changes from a
+ <span>playing media controller</span> to a <span>paused media
+ controller</span>, the user agent must <span>queue a task</span> to
+ <span>fire a simple event</span> named <code
+ title="event-media-pause">pause</code> at the
+ <code>MediaController</code>.</p>
+
+ <p>When the <dfn
+ title="dom-MediaController-play"><code>play()</code></dfn> method
+ is invoked, the user agent must change the
+ <code>MediaController</code> into a <span>playing media
+ controller</span>.</p>
+
+ <p>Whenever the <code>MediaController</code> changes from a
+ <span>paused media controller</span> to a <span>playing media
+ controller</span>, the user agent must <span>queue a task</span> to
+ <span>fire a simple event</span> named <code
+ title="event-media-play">play</code> at the
+ <code>MediaController</code>.</p>
+
+ <hr>
+
+ <p>The <dfn
+ title="dom-MediaController-defaultPlaybackRate"><code>defaultPlaybackRate</code></dfn>
+ attribute, on getting, must return the
+ <code>MediaController</code>'s <span>media controller default
+ playback rate multiplier</span>, and on setting, must set the
+ <code>MediaController</code>'s <span>media controller default
+ playback rate multiplier</span> to the new value.</p>
+
+ <p>The <dfn
+ title="dom-MediaController-playbackRate"><code>playbackRate</code></dfn>
+ attribute, on getting, must return the
+ <code>MediaController</code>'s <span>media controller playback rate
+ multiplier</span>, and on setting, must set the
+ <code>MediaController</code>'s <span>media controller playback rate
+ multiplier</span> to the new value.</p>
+
+ <p>Whenever the <span>media controller default playback rate
+ multiplier</span> or the <span>media controller playback rate
+ multiplier</span> are changed, the user agent must <span>queue a
+ task</span> to <span>fire a simple event</span> named <code
+ title="event-media-ratechange">ratechange</code> at the
+ <code>MediaController</code>.</p>
+
+ <hr>
+
+ <p>The <dfn
+ title="dom-MediaController-volume"><code>volume</code></dfn>
+ attribute, on getting, must return the
+ <code>MediaController</code>'s <span>media controller volume
+ multiplier</span>, and on setting, if the new value is in the range
+ 0.0 to 1.0 inclusive, must set the <code>MediaController</code>'s
+ <span>media controller volume multiplier</span> to the new value. If
+ the new value is outside the range 0.0 to 1.0 inclusive, then, on
+ setting, an <code>INDEX_SIZE_ERR</code> exception must be raised
+ instead.</p>
+
+ <p>The <dfn
+ title="dom-MediaController-muted"><code>muted</code></dfn>
+ attribute, on getting, must return the
+ <code>MediaController</code>'s <span>media controller mute
+ override</span>, and on setting, must set the
+ <code>MediaController</code>'s <span>media controller mute
+ override</span> to the new value.</p>
+
+ <p>Whenever either the <span>media controller volume
+ multiplier</span> or the <span>media controller mute override</span>
+ are changed, the user agent must <span>queue a task</span> to
+ <span>fire a simple event</span> named <code
+ title="event-media-volumechange">volumechange</code> at the
+ <code>MediaController</code>.</p>
+
+ <hr>
+
+ <p>The <dfn
+ title="dom-MediaController-seek"><code>seek()</code></dfn> method
+ must run the following steps for each <span title="slaved media
+ elements">slaved media element</span>, if any:</p>
+
+ <ol>
+
+ <li><p>Let <var title="">delta</var> be the method's argument.</p></li>
+
+ <li><p>Let <var title="">element</var> be the <span title="slaved
+ media elements">slaved media element</span> being processed in this
+ iteration.</p></li>
+
+ <li><p>Let <var title="">effective delta</var> be <var
+ title="">delta</var> multiplied by the value of <var
+ title="">element</var>'s <code
+ title="dom-media-playbackRate">playbackRate</code>
+ attribute.</p></li>
+
+ <li><p>Let <var title="">new position</var> be <var
+ title="">element</var>'s <span>current playback position</span> (in
+ seconds) plus <var title="">effective delta</var>.</p></li>
+
+ <li><p>Let <var title="">duration</var> be the difference between
+ <var title="">element</var>'s <span>earliest possible
+ position</span> (in seconds) and the time at the end of <var
+ title="">element</var>'s <span>media data</span> (in
+ seconds).</p></li>
+
+ <li>
+
+ <p>If <var title="">element</var>'s <code
+ title="attr-media-loop">loop</code> attribute is not specified,
+ then skip this step. Otherwise:</p>
+
+ <p>While <var title="">new position</var> is greater than the time
+ at the end of <var title="">element</var>'s <span>media
+ data</span> (in seconds), decrement <var title="">new
+ position</var> by <var title="">duration</var>.</p>
+
+ <p>While <var title="">new position</var> is less than <var
+ title="">element</var>'s <span>earliest possible position</span>
+ (in seconds), increment <var title="">new position</var> by <var
+ title="">duration</var>.</p>
+
+ </li>
+
+ <li><p><span title="dom-media-seek">Seek</span> <var
+ title="">element</var> to <var title="">new position</var>
+ (interpreted as a time in seconds).</p></li>
+
+ </ol>
+
+ <hr>
+
+ <p>The following are the <span>event handlers</span> that must be
+ supported, as IDL attributes, by all objects implementing the
+ <code>MediaController</code> interface:</p>
+
+ <table>
+ <thead>
+ <tr><th><span title="event handlers">Event handler</span> <th><span>Event handler event type</span>
+ <tbody>
+ <tr><td><dfn title="handler-MediaController-onplay"><code>onplay</code></dfn> <td> <code title="event-play">play</code>
+ <tr><td><dfn title="handler-MediaController-onpause"><code>onpause</code></dfn> <td> <code title="event-pause">pause</code>
+ <tr><td><dfn title="handler-MediaController-onratechange"><code>onratechange</code></dfn> <td> <code title="event-ratechange">ratechange</code>
+ <tr><td><dfn title="handler-MediaController-onvolumechange"><code>onvolumechange</code></dfn> <td> <code title="event-volumechange">volumechange</code>
+ </table>
+
+ </div>
+
+
+ <h6>Assigning a media controller declaratively</h6>
+
+ <p>The <dfn
+ title="attr-media-mediagroup"><code>mediagroup</code></dfn> content
+ attribute on <span title="media element">media elements</span> can
+ be used to link multiple <span title="media element">media
+ elements</span> together by implicitly creating a
+ <code>MediaController</code>.</p>
+
+ <div class="impl">
+
+ <p>When a <span>media element</span> is created with a <code
+ title="attr-media-mediagroup">mediagroup</code> attribute, and when
+ a <span>media element</span>'s <code
+ title="attr-media-mediagroup">mediagroup</code> attribute is set,
+ changed, or removed, the user agent must run the following
+ steps:</p>
+
+ <ol>
+
+ <li><p>Let <var title="">m</var> be the <span>media element</span>
+ in question.</p></li>
+
+ <li><p>Let <var title="">m</var> have no <span>current
+ media controller</span>, if it currently has one.</p></li>
+
+ <li><p>If <var title="">m</var>'s <code
+ title="attr-media-mediagroup">mediagroup</code> attribute is being
+ removed, then abort these steps.</p></li>
+
+ <li>
+
+ <p>If there is another <span>media element</span> whose
+ <code>Document</code> is the same as <var title="">m</var>'s
+ <code>Document</code> (even if one or both of these elements are
+ not actually <span title="in a Document"><em>in</em> the
+ <code>Document</code></span>), and which also has a <code
+ title="attr-media-mediagroup">mediagroup</code> attribute, and
+ whose <code title="attr-media-mediagroup">mediagroup</code>
+ attribute has the same value as the new value of <var
+ title="">m</var>'s <code
+ title="attr-media-mediagroup">mediagroup</code> attribute, then
+ let <var title="">controller</var> be that <span>media
+ element</span>'s <span>current media controller</span>.</p>
+
+ <p>Otherwise, let <var title="">controller</var> be a newly created
+ <code>MediaController</code>.</p>
+
+ </li>
+
+ <li><p>Let <var title="">m</var>'s <span>current media
+ controller</span> be <var title="">controller</var>.</p></li>
+
+ </ol>
+
+ <p>The <dfn
+ title="dom-media-mediaGroup"><code>mediaGroup</code></dfn> IDL
+ attribute on <span title="media element">media elements</span> must
+ <span>reflect</span> the <code
+ title="attr-media-mediagroup">mediagroup</code> content
+ attribute.</p>
+
+ </div>
+
+ <div class="example">
+
+ <p>Multiple <span title="media element">media elements</span>
+ referencing the same <span>media resource</span> will share a
+ single network request. This can be used to efficiently play two
+ (video) tracks from the same <span>media resource</span> in two
+ different places on the screen. Used with the <code
+ title="attr-media-mediagroup">mediagroup</code> attribute, these
+ elements can also be kept synchronised.</p>
+
+ <p>In this example, a sign-languge interpreter track from a movie
+ file is overlaid on the primary video track of that same video file
+ using two <code>video</code> elements, some CSS, and an implicit
+ <code>MediaController</code>:</p>
+
+ <pre><article>
+ <style scoped>
+ div { margin: 1em auto; position: relative; width: 400px; height: 300px; }
+ video { position; absolute; bottom: 0; right: 0; }
+ video:first-child { width: 100%; height: 100%; }
+ video:last-child { width: 30%; }
+ </style>
+ <div>
+ <video src="movie.vid#track=Video&amp;track=English" autoplay controls mediagroup=movie></video>
+ <video src="movie.vid#track=sign" autoplay mediagroup=movie></video>
+ </div>
+</article></pre>
+
+ </div>
+
+
+<!--v2:
+ <h6>Ducking</h6>
+
+ <p><dfn>Ducking</dfn> is the process of reducing the volume of one
+ audio track when another audio track is playing, for example
+ occasionally reducing the volume of a the soundtrack to allow the
+ viewer to hear an intermittent commentary track.</p>
+
+ (add an "autoduck" attribute that reduces the volume of other media
+ elements with the same <span>current media controller</span>
+ whenever this media element is playing audio)
+
+ <video src="movie.vid#track=Video&amp;track=English" autoplay controls mediagroup=main></video>
+ <audio src="movie.vid#track=Descriptions" mediagroup=main autoduck></audio>
+-->
+
+<!--START w3c-html--><!--CONTROLLER-->
+
+
<!--KEEP-END w3c-html--><!--TT-->
<!--<div data-component="other Hixie drafts (editor: Ian Hickson)">-->
<h5>Timed text tracks</h5>
@@ -34274,7 +35137,8 @@
context menu.</p>
<p>Where possible (specifically, for starting, stopping, pausing,
- and unpausing playback, for seeking,
+ and unpausing playback, for seeking, for changing the rate of
+ playback, for fast-forwarding or rewinding,
<!--KEEP-END w3c-html--><!--TT-->
for listing, enabling, and disabling text tracks,
<!--KEEP-START w3c-html--><!--TT-->
@@ -34283,6 +35147,59 @@
the DOM API described above, so that, e.g., all the same events
fire.</p>
+<!--END w3c-html--><!--CONTROLLER-->
+ <p>When a <span>media element</span> has a <span>current media
+ controller</span>, the user agent must implement its user interface
+ for pausing and unpausing playback, for seeking, for changing the
+ rate of playback, for fast-forwarding or rewinding, and for muting
+ or changing the volume of audio must be implemented specifically in
+ terms of the <code>MediaController</code> API exposed on that
+ <span>current media controller</span>.</p>
+<!--START w3c-html--><!--CONTROLLER-->
+
+ <p>The "play" function in the user agent's interface must set the
+ <code title="">playbackRate</code> attribute to the value of the
+ <code title="">defaultPlaybackRate</code> attribute before invoking
+ the <code title="">play()</code> method.
+<!--END w3c-html--><!--CONTROLLER-->
+ When a <span>media element</span> has a <span>current media
+ controller</span>, the attributes and method with those names on
+ that <code>MediaController</code> object must be used. Otherwise,
+ the attributes and method with those names on the <span>media
+ element</span> itself must be used.
+<!--START w3c-html--><!--CONTROLLER-->
+ </p>
+
+ <p>Features such as fast-forward or rewind must be implemented by
+ only changing the <code title="">playbackRate</code> attribute (and
+ not the <code title="">defaultPlaybackRate</code> attribute).
+<!--END w3c-html--><!--CONTROLLER-->
+ Again, when a <span>media element</span> has a <span>current media
+ controller</span>, the attributes with those names on that
+ <code>MediaController</code> object must be used; otherwise, the
+ attributes with those names on the <span>media element</span> itself
+ must be used.
+<!--START w3c-html--><!--CONTROLLER-->
+ </p>
+
+<!--END w3c-html--><!--CONTROLLER-->
+
+ <p>When a <span>media element</span> has a <span>current media
+ controller</span>, seeking must be implemented in terms of the <code
+ title="dom-MediaController-seek">seek()</code> method on that
+ <code>MediaController</code> object. Otherwise, the user agent must
+ directly <span title="dom-media-seek">seek</span> to the requested
+ position in the <span>media element</span>'s <span>media
+ timeline</span>.</p>
+
+ <p>When a <span>media element</span> has a <span>current media
+ controller</span>, user agents may additionally provide the user
+ with controls that directly manipulate an individual <span>media
+ element</span> without affecting the <code>MediaController</code>,
+ but such features are considered relatively advanced and unlikely to
+ be useful to most users.
+<!--START w3c-html--><!--CONTROLLER-->
+
<!--KEEP-END w3c-html--><!--TT-->
<p>For the purposes of listing chapters in the <span>media
resource</span>, only <span title="text track">text tracks</span>
@@ -34346,15 +35263,9 @@
remember the last set value across sessions, on a per-site basis or
otherwise, so the volume may start at other values. On setting, if
the new value is in the range 0.0 to 1.0 inclusive, the attribute
- must be set to the new value and the playback volume must be
- correspondingly adjusted as soon as possible after setting the
- attribute, with 0.0 being silent, and 1.0 being the loudest setting,
- values in between increasing in loudness. The range need not be
- linear. The loudest setting may be lower than the system's loudest
- possible setting; for example the user could have set a maximum
- volume. If the new value is outside the range 0.0 to 1.0 inclusive,
- then, on setting, an <code>INDEX_SIZE_ERR</code> exception must be
- raised instead.</p>
+ must be set to the new value. If the new value is outside the range
+ 0.0 to 1.0 inclusive, then, on setting, an
+ <code>INDEX_SIZE_ERR</code> exception must be raised instead.</p>
<p>The <dfn title="dom-media-muted"><code>muted</code></dfn>
attribute must return true if the audio channels are muted and false
@@ -34362,9 +35273,7 @@
(false), but user agents may remember the last set value across
sessions, on a per-site basis or otherwise, so the muted state may
start as muted (true). On setting, the attribute must be set to the
- new value; if the new value is true, audio playback for this
- <span>media resource</span> must then be muted, and if false, audio
- playback must then be enabled.</p>
+ new value.</p>
<p>Whenever either the <code title="dom-media-muted">muted</code> or
<code title="dom-media-volume">volume</code> attributes are changed,
@@ -34373,6 +35282,43 @@
title="event-media-volumechange">volumechange</code> at the <span>media
element</span>.</p>
+ <p>An element's <dfn>effective media volume</dfn> is determined as
+ follows:</p>
+
+ <ol>
+
+ <li><p>If the element's <code title="dom-media-muted">muted</code>
+ attribute is true, the element's <span>effective media
+ volume</span> is zero. Abort these steps.</p></li>
+
+<!--END w3c-html--><!--CONTROLLER-->
+ <li><p>If the element has a <span>current media controller</span>
+ and that <code>MediaController</code> object's <span>media
+ controller mute override</span> is true, the element's
+ <span>effective media volume</span> is zero. Abort these
+ steps.</p></li>
+<!--START w3c-html--><!--CONTROLLER-->
+
+ <li><p>Let <var title="">volume</var> be the value of the element's
+ <code title="dom-media-volume">volume</code> attribute.</p></li>
+
+<!--END w3c-html--><!--CONTROLLER-->
+ <li><p>If the element has a <span>current media controller</span>,
+ multiply <var title="">volume</var> by that
+ <code>MediaController</code> object's <span>media controller volume
+ multiplier</span>.</p></li>
+<!--START w3c-html--><!--CONTROLLER-->
+
+ <li><p>The element's <span>effective media volume</span> is <var
+ title="">volume</var>, interpreted relative to the range 0.0 to
+ 1.0, with 0.0 being silent, and 1.0 being the loudest setting,
+ values in between increasing in loudness. The range need not be
+ linear. The loudest setting may be lower than the system's loudest
+ possible setting; for example the user could have set a maximum
+ volume.</p></li>
+
+ </ol>
+
</div>
<p>The <dfn title="attr-media-audio"><code>audio</code></dfn>
@@ -34586,18 +35532,6 @@
<tbody>
<tr>
- <td><dfn title="event-media-play"><code>play</code></dfn>
- <td><code>Event</code>
- <td>Playback has begun. Fired after the <code title="dom-media-play">play()</code> method has returned, or when the <code title="attr-media-autoplay">autoplay</code> attribute has caused playback to begin.
- <td><code title="dom-media-paused">paused</code> is newly false.
- <tr>
- <td><dfn title="event-media-pause"><code>pause</code></dfn>
- <td><code>Event</code>
- <td>Playback has been paused. Fired after the <code title="dom-media-pause">pause()</code> method has returned.
- <td><code title="dom-media-paused">paused</code> is newly true.
-
- <tbody>
- <tr>
<td><dfn title="event-media-loadedmetadata"><code>loadedmetadata</code></dfn>
<td><code>Event</code>
<td>The user agent has just determined the duration and dimensions of the <span>media resource</span>
@@ -34652,26 +35586,40 @@
<td><code>Event</code>
<td>Playback has stopped because the end of the <span>media resource</span> was reached.
<td><code title="dom-media-currentTime">currentTime</code> equals the end of the <span>media resource</span>; <code title="dom-media-ended">ended</code> is true.
+ <tr>
+ <td><dfn title="event-media-durationchange"><code>durationchange</code></dfn>
+ <td><code>Event</code>
+ <td>The <code title="dom-media-duration">duration</code> attribute has just been updated.
+ <td>
<tbody>
<tr>
+ <td><dfn title="event-media-play"><code>play</code></dfn>
+ <td><code>Event</code>
+ <td>Playback has begun. Fired after the <code title="dom-media-play">play()</code> method has returned, or when the <code title="attr-media-autoplay">autoplay</code> attribute has caused playback to begin.
+ <td><code title="dom-media-paused">paused</code> is newly false.
+ <tr>
+ <td><dfn title="event-media-pause"><code>pause</code></dfn>
+ <td><code>Event</code>
+ <td>Playback has been paused. Fired after the <code title="dom-media-pause">pause()</code> method has returned.
+ <td><code title="dom-media-paused">paused</code> is newly true.
+ <tr>
<td><dfn title="event-media-ratechange"><code>ratechange</code></dfn>
<td><code>Event</code>
<td>Either the <code title="dom-media-defaultPlaybackRate">defaultPlaybackRate</code> or the <code title="dom-media-playbackRate">playbackRate</code> attribute has just been updated.
<td>
<tr>
- <td><dfn title="event-media-durationchange"><code>durationchange</code></dfn>
- <td><code>Event</code>
- <td>The <code title="dom-media-duration">duration</code> attribute has just been updated.
- <td>
- <tr>
<td><dfn title="event-media-volumechange"><code>volumechange</code></dfn>
<td><code>Event</code>
<td>Either the <code title="dom-media-volume">volume</code> attribute or the <code title="dom-media-muted">muted</code> attribute has changed. Fired after the relevant attribute's setter has returned.
<td>
</table>
+<!--END w3c-html--><!--CONTROLLER-->
+ <p>The last four events in this table are also fired on <code>MediaController</code> objects.</p>
+<!--START w3c-html--><!--CONTROLLER-->
+
<div class="impl">
<h5>Security and privacy considerations</h5>
@@ -105005,6 +105953,7 @@
<code title="attr-media-src">src</code>;
<code title="attr-media-preload">preload</code>;
<code title="attr-media-autoplay">autoplay</code>;
+<!--END w3c-html--><!--CONTROLLER--> <code title="attr-media-mediagroup">mediagroup</code>;<!--START w3c-html--><!--CONTROLLER-->
<code title="attr-media-loop">loop</code>;
<code title="attr-media-controls">controls</code></td>
<td><code>HTMLAudioElement</code></td>
@@ -106321,6 +107270,7 @@
<code title="attr-video-poster">poster</code>;
<code title="attr-media-preload">preload</code>;
<code title="attr-media-autoplay">autoplay</code>;
+<!--END w3c-html--><!--CONTROLLER--> <code title="attr-media-mediagroup">mediagroup</code>;<!--START w3c-html--><!--CONTROLLER-->
<code title="attr-media-loop">loop</code>;
<code title="attr-media-controls">controls</code>;
<code title="attr-dim-width">width</code>;
@@ -107126,7 +108076,15 @@
<code title="attr-style-media">style</code>
<td> Applicable media
<td> <span>Valid media query</span>
+<!--END w3c-html--><!--CONTROLLER-->
<tr>
+ <th> <code title="">mediagroup</code>
+ <td> <code title="attr-media-mediagroup">audio</code>;
+ <code title="attr-media-mediagroup">video</code>
+ <td> Groups <span title="media element">media elements</span> together with an implicit <code>MediaController</code>
+ <td> <a href="#attribute-text">Text</a>
+<!--START w3c-html--><!--CONTROLLER-->
+ <tr>
<th> <code title="">method</code>
<td> <code title="attr-fs-method">form</code>
<td> HTTP method to use for <span>form submission</span>
@@ -108967,6 +109925,12 @@
Markup Language (MathML)</a></cite>, D. Carlisle, P. Ion, R. Miner,
N. Poppelier. W3C.</dd>
+ <dt id="refsMEDIAFRAG">[MEDIAFRAG]</dt>
+ <dd><cite><a
+ href="http://www.w3.org/2008/WebVideo/Fragments/WD-media-fragments-spec/">Media
+ Fragments URI</a></cite>, R. Troncy, E. Mannens, S. Pfeiffer, D.
+ Van Deursen. W3C.</dd>
+
<dt id="refsMIMESNIFF">[MIMESNIFF]</dt>
<dd><cite><a
href="http://tools.ietf.org/html/draft-abarth-mime-sniff">Media