Skip to content

Commit

Permalink
[giow] (0) Add <video audio=muted>.
Browse files Browse the repository at this point in the history
Fixing http://www.w3.org/Bugs/Public/show_bug.cgi?id=10419

git-svn-id: http://svn.whatwg.org/webapps@5636 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Oct 15, 2010
1 parent 00d0525 commit 798a862
Show file tree
Hide file tree
Showing 3 changed files with 208 additions and 16 deletions.
71 changes: 66 additions & 5 deletions complete.html
Expand Up @@ -23840,6 +23840,7 @@ <h4 id=video><span class=secno>4.8.6 </span>The <dfn><code>video</code></dfn> el
<dd><code title=attr-media-preload><a href=#attr-media-preload>preload</a></code></dd>
<dd><code title=attr-media-autoplay><a href=#attr-media-autoplay>autoplay</a></code></dd>
<dd><code title=attr-media-loop><a href=#attr-media-loop>loop</a></code></dd>
<dd><code title=attr-media-audio><a href=#attr-media-audio>audio</a></code></dd>
<dd><code title=attr-media-controls><a href=#attr-media-controls>controls</a></code></dd>
<dd><code title=attr-dim-width><a href=#attr-dim-width>width</a></code></dd>
<dd><code title=attr-dim-height><a href=#attr-dim-height>height</a></code></dd>
Expand All @@ -23851,6 +23852,7 @@ <h4 id=video><span class=secno>4.8.6 </span>The <dfn><code>video</code></dfn> el
readonly attribute unsigned long <a href=#dom-video-videowidth title=dom-video-videoWidth>videoWidth</a>;
readonly attribute unsigned long <a href=#dom-video-videoheight title=dom-video-videoHeight>videoHeight</a>;
attribute DOMString <a href=#dom-video-poster title=dom-video-poster>poster</a>;
attribute boolean <a href=#dom-media-audio title=dom-media-audio>audio</a>; <!-- attr-media-audio -->
};</pre>
</dd>
</dl><p>A <code><a href=#video>video</a></code> element is used for playing videos or
Expand All @@ -23876,7 +23878,9 @@ <h4 id=video><span class=secno>4.8.6 </span>The <dfn><code>video</code></dfn> el
with associated audio data.</p>

<p>The <code title=attr-media-src><a href=#attr-media-src>src</a></code>, <code title=attr-media-preload><a href=#attr-media-preload>preload</a></code>, <code title=attr-media-autoplay><a href=#attr-media-autoplay>autoplay</a></code>, <code title=attr-media-loop><a href=#attr-media-loop>loop</a></code>, and <code title=attr-media-controls><a href=#attr-media-controls>controls</a></code> attributes are <a href=#media-element-attributes title="media element attributes">the attributes common to all media
elements</a>.</p>
elements</a>. The <code title=attr-media-audio><a href=#attr-media-audio>audio</a></code>
attribute <a href=#attr-media-audio title=attr-media-audio>controls the audio
channel</a>.</p>

<p>The <dfn id=attr-video-poster title=attr-video-poster><code>poster</code></dfn>
attribute gives the address of an image file that the user agent can
Expand All @@ -23900,9 +23904,6 @@ <h4 id=video><span class=secno>4.8.6 </span>The <dfn><code>video</code></dfn> el

<div class=impl>

<p>The <dfn id=dom-video-poster title=dom-video-poster><code>poster</code></dfn> IDL
attribute must <a href=#reflect>reflect</a> the <code title=attr-video-poster><a href=#attr-video-poster>poster</a></code> content attribute.</p>

<hr><p>When no video data is available (the element's <code title=dom-media-readyState><a href=#dom-media-readystate>readyState</a></code> attribute is either
<code title=dom-media-HAVE_NOTHING><a href=#dom-media-have_nothing>HAVE_NOTHING</a></code>, or <code title=dom-media-HAVE_METADATA><a href=#dom-media-have_metadata>HAVE_METADATA</a></code> but no video
data has yet been obtained at all), the <code><a href=#video>video</a></code> element
Expand Down Expand Up @@ -24046,6 +24047,12 @@ <h4 id=video><span class=secno>4.8.6 </span>The <dfn><code>video</code></dfn> el
agents could disable screensavers while video playback is in
progress.</p>

<hr><p>The <dfn id=dom-video-poster title=dom-video-poster><code>poster</code></dfn> IDL
attribute must <a href=#reflect>reflect</a> the <code title=attr-video-poster><a href=#attr-video-poster>poster</a></code> content attribute.</p>

<p>The <dfn id=dom-media-audio title=dom-media-audio><code>audio</code></dfn> IDL
attribute must <a href=#reflect>reflect</a> the <code title=attr-media-audio><a href=#attr-media-audio>audio</a></code> content attribute.</p>

</div>

<div class=example>
Expand Down Expand Up @@ -24678,7 +24685,7 @@ <h4 id=media-elements><span class=secno>4.8.10 </span>Media elements</h4>
};</pre>

<p>The <dfn id=media-element-attributes>media element attributes</dfn>, <code title=attr-media-src><a href=#attr-media-src>src</a></code>, <code title=attr-media-preload><a href=#attr-media-preload>preload</a></code>, <code title=attr-media-autoplay><a href=#attr-media-autoplay>autoplay</a></code>, <code title=attr-media-loop><a href=#attr-media-loop>loop</a></code>, and <code title=attr-media-controls><a href=#attr-media-controls>controls</a></code>, apply to all <a href=#media-element title="media element">media elements</a>. They are defined in
this section.</p>
this section.</p> <!-- attr-media-audio -->

<!-- proposed v2 (actually v3!) features:
* frame forward / backwards / step(n) while paused
Expand Down Expand Up @@ -30033,6 +30040,60 @@ <h5 id=user-interface><span class=secno>4.8.10.12 </span>User interface</h5>

</div>

<p>The <dfn id=attr-media-audio title=attr-media-audio><code>audio</code></dfn>
attribute on the <code><a href=#video>video</a></code> element controls the default
state of the audio channel of the <a href=#media-resource>media resource</a>,
potentially overriding user preferences.</p>

<p>The <code title=attr-media-audio><a href=#attr-media-audio>audio</a></code> attribute, if
specified, must have a value that is an <a href=#unordered-set-of-unique-space-separated-tokens>unordered set of
unique space-separated tokens</a>, which are <a href=#ascii-case-insensitive>ASCII
case-insensitive</a>. The tokens must be from the following list
(currently, only one allowed token is defined):</p>

<dl><dt><dfn id=attr-media-audio-keyword-muted title=attr-media-audio-keyword-muted><code>muted</code></dfn></dt>

<dd>

<p>Causes the user agent to override the user's preferences, if
any, and always default the video to muted.</p>

</dd>

</dl><p class=note>A future version of this specification will probably
introduce new values here, e.g. to control the default volume, or to
select a default audio track.</p>

<div class=impl>

<p>When a <code><a href=#video>video</a></code> element is created, if it has an <code title=attr-media-audio><a href=#attr-media-audio>audio</a></code> attribute specified, the user
agent must <a href=#split-a-string-on-spaces title="split a string on spaces">split the
attribute's value on spaces</a>; if any of the tokens are an
<a href=#ascii-case-insensitive>ASCII case-insensitive</a> match for the string <code title=attr-media-audio-keyword-muted><a href=#attr-media-audio-keyword-muted>muted</a></code>, the user agent
must then set the <code title=dom-media-muted><a href=#dom-media-muted>muted</a></code>
attribute to true, overriding any user preference.</p>

<!-- attr-media-audio
<p>The <dfn title="dom-media-audio"><code>audio</code></dfn> IDL
attribute must <span>reflect</span> the content attribute of the
same name.</p>
-->

</div>

<p class=note>This attribute has no dynamic effect (it only
controls the default state of the element).</p>

<div class=example>

<p>This video (an advertisment) autoplays, but to avoid annoying
users, it does so without sound, and allows the user to turn the
sound on.</p>

<pre>&lt;video src="adverts.cgi?kind=video" controls autoplay loop audio=muted&gt;&lt;/video&gt;</pre>

</div>




Expand Down
71 changes: 66 additions & 5 deletions index
Expand Up @@ -23820,6 +23820,7 @@ href="?audio"&gt;audio&lt;/a&gt; test instead.)&lt;/p&gt;</pre>
<dd><code title=attr-media-preload><a href=#attr-media-preload>preload</a></code></dd>
<dd><code title=attr-media-autoplay><a href=#attr-media-autoplay>autoplay</a></code></dd>
<dd><code title=attr-media-loop><a href=#attr-media-loop>loop</a></code></dd>
<dd><code title=attr-media-audio><a href=#attr-media-audio>audio</a></code></dd>
<dd><code title=attr-media-controls><a href=#attr-media-controls>controls</a></code></dd>
<dd><code title=attr-dim-width><a href=#attr-dim-width>width</a></code></dd>
<dd><code title=attr-dim-height><a href=#attr-dim-height>height</a></code></dd>
Expand All @@ -23831,6 +23832,7 @@ href="?audio"&gt;audio&lt;/a&gt; test instead.)&lt;/p&gt;</pre>
readonly attribute unsigned long <a href=#dom-video-videowidth title=dom-video-videoWidth>videoWidth</a>;
readonly attribute unsigned long <a href=#dom-video-videoheight title=dom-video-videoHeight>videoHeight</a>;
attribute DOMString <a href=#dom-video-poster title=dom-video-poster>poster</a>;
attribute boolean <a href=#dom-media-audio title=dom-media-audio>audio</a>; <!-- attr-media-audio -->
};</pre>
</dd>
</dl><p>A <code><a href=#video>video</a></code> element is used for playing videos or
Expand All @@ -23856,7 +23858,9 @@ href="?audio"&gt;audio&lt;/a&gt; test instead.)&lt;/p&gt;</pre>
with associated audio data.</p>

<p>The <code title=attr-media-src><a href=#attr-media-src>src</a></code>, <code title=attr-media-preload><a href=#attr-media-preload>preload</a></code>, <code title=attr-media-autoplay><a href=#attr-media-autoplay>autoplay</a></code>, <code title=attr-media-loop><a href=#attr-media-loop>loop</a></code>, and <code title=attr-media-controls><a href=#attr-media-controls>controls</a></code> attributes are <a href=#media-element-attributes title="media element attributes">the attributes common to all media
elements</a>.</p>
elements</a>. The <code title=attr-media-audio><a href=#attr-media-audio>audio</a></code>
attribute <a href=#attr-media-audio title=attr-media-audio>controls the audio
channel</a>.</p>

<p>The <dfn id=attr-video-poster title=attr-video-poster><code>poster</code></dfn>
attribute gives the address of an image file that the user agent can
Expand All @@ -23880,9 +23884,6 @@ href="?audio"&gt;audio&lt;/a&gt; test instead.)&lt;/p&gt;</pre>

<div class=impl>

<p>The <dfn id=dom-video-poster title=dom-video-poster><code>poster</code></dfn> IDL
attribute must <a href=#reflect>reflect</a> the <code title=attr-video-poster><a href=#attr-video-poster>poster</a></code> content attribute.</p>

<hr><p>When no video data is available (the element's <code title=dom-media-readyState><a href=#dom-media-readystate>readyState</a></code> attribute is either
<code title=dom-media-HAVE_NOTHING><a href=#dom-media-have_nothing>HAVE_NOTHING</a></code>, or <code title=dom-media-HAVE_METADATA><a href=#dom-media-have_metadata>HAVE_METADATA</a></code> but no video
data has yet been obtained at all), the <code><a href=#video>video</a></code> element
Expand Down Expand Up @@ -24026,6 +24027,12 @@ href="?audio"&gt;audio&lt;/a&gt; test instead.)&lt;/p&gt;</pre>
agents could disable screensavers while video playback is in
progress.</p>

<hr><p>The <dfn id=dom-video-poster title=dom-video-poster><code>poster</code></dfn> IDL
attribute must <a href=#reflect>reflect</a> the <code title=attr-video-poster><a href=#attr-video-poster>poster</a></code> content attribute.</p>

<p>The <dfn id=dom-media-audio title=dom-media-audio><code>audio</code></dfn> IDL
attribute must <a href=#reflect>reflect</a> the <code title=attr-media-audio><a href=#attr-media-audio>audio</a></code> content attribute.</p>

</div>

<div class=example>
Expand Down Expand Up @@ -24658,7 +24665,7 @@ interface <dfn id=htmlaudioelement>HTMLAudioElement</dfn> : <a href=#htmlmediael
};</pre>

<p>The <dfn id=media-element-attributes>media element attributes</dfn>, <code title=attr-media-src><a href=#attr-media-src>src</a></code>, <code title=attr-media-preload><a href=#attr-media-preload>preload</a></code>, <code title=attr-media-autoplay><a href=#attr-media-autoplay>autoplay</a></code>, <code title=attr-media-loop><a href=#attr-media-loop>loop</a></code>, and <code title=attr-media-controls><a href=#attr-media-controls>controls</a></code>, apply to all <a href=#media-element title="media element">media elements</a>. They are defined in
this section.</p>
this section.</p> <!-- attr-media-audio -->

<!-- proposed v2 (actually v3!) features:
* frame forward / backwards / step(n) while paused
Expand Down Expand Up @@ -30013,6 +30020,60 @@ interface <dfn id=timedtrackcue>TimedTrackCue</dfn> {

</div>

<p>The <dfn id=attr-media-audio title=attr-media-audio><code>audio</code></dfn>
attribute on the <code><a href=#video>video</a></code> element controls the default
state of the audio channel of the <a href=#media-resource>media resource</a>,
potentially overriding user preferences.</p>

<p>The <code title=attr-media-audio><a href=#attr-media-audio>audio</a></code> attribute, if
specified, must have a value that is an <a href=#unordered-set-of-unique-space-separated-tokens>unordered set of
unique space-separated tokens</a>, which are <a href=#ascii-case-insensitive>ASCII
case-insensitive</a>. The tokens must be from the following list
(currently, only one allowed token is defined):</p>

<dl><dt><dfn id=attr-media-audio-keyword-muted title=attr-media-audio-keyword-muted><code>muted</code></dfn></dt>

<dd>

<p>Causes the user agent to override the user's preferences, if
any, and always default the video to muted.</p>

</dd>

</dl><p class=note>A future version of this specification will probably
introduce new values here, e.g. to control the default volume, or to
select a default audio track.</p>

<div class=impl>

<p>When a <code><a href=#video>video</a></code> element is created, if it has an <code title=attr-media-audio><a href=#attr-media-audio>audio</a></code> attribute specified, the user
agent must <a href=#split-a-string-on-spaces title="split a string on spaces">split the
attribute's value on spaces</a>; if any of the tokens are an
<a href=#ascii-case-insensitive>ASCII case-insensitive</a> match for the string <code title=attr-media-audio-keyword-muted><a href=#attr-media-audio-keyword-muted>muted</a></code>, the user agent
must then set the <code title=dom-media-muted><a href=#dom-media-muted>muted</a></code>
attribute to true, overriding any user preference.</p>

<!-- attr-media-audio
<p>The <dfn title="dom-media-audio"><code>audio</code></dfn> IDL
attribute must <span>reflect</span> the content attribute of the
same name.</p>
-->

</div>

<p class=note>This attribute has no dynamic effect (it only
controls the default state of the element).</p>

<div class=example>

<p>This video (an advertisment) autoplays, but to avoid annoying
users, it does so without sound, and allows the user to turn the
sound on.</p>

<pre>&lt;video src="adverts.cgi?kind=video" controls autoplay loop audio=muted&gt;&lt;/video&gt;</pre>

</div>




Expand Down
82 changes: 76 additions & 6 deletions source
Expand Up @@ -25581,6 +25581,7 @@ href="?audio">audio&lt;/a> test instead.)&lt;/p></pre>
<dd><code title="attr-media-preload">preload</code></dd>
<dd><code title="attr-media-autoplay">autoplay</code></dd>
<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>
<dd><code title="attr-dim-width">width</code></dd>
<dd><code title="attr-dim-height">height</code></dd>
Expand All @@ -25592,6 +25593,7 @@ href="?audio">audio&lt;/a> test instead.)&lt;/p></pre>
readonly attribute unsigned long <span title="dom-video-videoWidth">videoWidth</span>;
readonly attribute unsigned long <span title="dom-video-videoHeight">videoHeight</span>;
attribute DOMString <span title="dom-video-poster">poster</span>;
attribute boolean <span title="dom-media-audio">audio</span>; <!-- attr-media-audio -->
};</pre>
</dd>
</dl>
Expand Down Expand Up @@ -25624,7 +25626,9 @@ href="?audio">audio&lt;/a> test instead.)&lt;/p></pre>
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>
elements</span>. The <code title="attr-media-audio">audio</code>
attribute <span title="attr-media-audio">controls the audio
channel</span>.</p>

<p>The <dfn title="attr-video-poster"><code>poster</code></dfn>
attribute gives the address of an image file that the user agent can
Expand All @@ -25651,10 +25655,6 @@ href="?audio">audio&lt;/a> test instead.)&lt;/p></pre>

<div class="impl">

<p>The <dfn title="dom-video-poster"><code>poster</code></dfn> IDL
attribute must <span>reflect</span> the <code
title="attr-video-poster">poster</code> content attribute.</p>

<hr>

<p>When no video data is available (the element's <code
Expand Down Expand Up @@ -25822,6 +25822,16 @@ href="?audio">audio&lt;/a> test instead.)&lt;/p></pre>
agents could disable screensavers while video playback is in
progress.</p>

<hr>

<p>The <dfn title="dom-video-poster"><code>poster</code></dfn> IDL
attribute must <span>reflect</span> the <code
title="attr-video-poster">poster</code> content attribute.</p>

<p>The <dfn title="dom-media-audio"><code>audio</code></dfn> IDL
attribute must <span>reflect</span> the <code
title="attr-media-audio">audio</code> content attribute.</p>

</div>

<div class="example">
Expand Down Expand Up @@ -26534,7 +26544,7 @@ interface <dfn>HTMLAudioElement</dfn> : <span>HTMLMediaElement</span> {};</pre>
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>
this section.</p> <!-- attr-media-audio -->

<!-- proposed v2 (actually v3!) features:
* frame forward / backwards / step(n) while paused
Expand Down Expand Up @@ -32886,6 +32896,66 @@ interface <dfn>TimedTrackCue</dfn> {

</div>

<p>The <dfn title="attr-media-audio"><code>audio</code></dfn>
attribute on the <code>video</code> element controls the default
state of the audio channel of the <span>media resource</span>,
potentially overriding user preferences.</p>

<p>The <code title="attr-media-audio">audio</code> attribute, if
specified, must have a value that is an <span>unordered set of
unique space-separated tokens</span>, which are <span>ASCII
case-insensitive</span>. The tokens must be from the following list
(currently, only one allowed token is defined):</p>

<dl>

<dt><dfn title="attr-media-audio-keyword-muted"><code>muted</code></dfn></dt>

<dd>

<p>Causes the user agent to override the user's preferences, if
any, and always default the video to muted.</p>

</dd>

</dl>

<p class="note">A future version of this specification will probably
introduce new values here, e.g. to control the default volume, or to
select a default audio track.</p>

<div class="impl">

<p>When a <code>video</code> element is created, if it has an <code
title="attr-media-audio">audio</code> attribute specified, the user
agent must <span title="split a string on spaces">split the
attribute's value on spaces</span>; if any of the tokens are an
<span>ASCII case-insensitive</span> match for the string <code
title="attr-media-audio-keyword-muted">muted</code>, the user agent
must then set the <code title="dom-media-muted">muted</code>
attribute to true, overriding any user preference.</p>

<!-- attr-media-audio
<p>The <dfn title="dom-media-audio"><code>audio</code></dfn> IDL
attribute must <span>reflect</span> the content attribute of the
same name.</p>
-->

</div>

<p class="note">This attribute has no dynamic effect (it only
controls the default state of the element).</p>

<div class="example">

<p>This video (an advertisment) autoplays, but to avoid annoying
users, it does so without sound, and allows the user to turn the
sound on.</p>

<pre>&lt;video src="adverts.cgi?kind=video" controls autoplay loop audio=muted>&lt;/video></pre>

</div>




Expand Down

0 comments on commit 798a862

Please sign in to comment.