Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 35 additions & 25 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -40709,12 +40709,7 @@ interface <dfn interface>MediaError</dfn> {
</div>

<div algorithm>
<p>While the <span>direction of playback</span> is backwards, any corresponding audio must be
<span data-x="concept-media-muted">muted</span>. While the element's <code
data-x="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 <span
data-x="concept-media-muted">muted</span>. If the element's <code
data-x="dom-media-playbackRate">playbackRate</code> is not 1.0 and <code
<p>If the element's <code data-x="dom-media-playbackRate">playbackRate</code> is not 1.0 and <code
data-x="dom-media-preservesPitch">preservesPitch</code> is true, the user agent must apply pitch
adjustment to preserve the original pitch of the audio. Otherwise, the user agent must speed up
or slow down the audio without any pitch adjustment.</p>
Expand Down Expand Up @@ -43358,19 +43353,37 @@ red:89
<code>DOMException</code> must be thrown instead.</p>
</div>

<p>A <span>media element</span> can also be <dfn for="media element" data-x="concept-media-muted"
export>muted</dfn>. If anything is muting the element, then it is muted. (For example, when the
<span>direction of playback</span> is backwards, the element is muted.)</p>
<p>A <span>media element</span> is <dfn for="media element" data-x="concept-media-muted"
export>muted</dfn> if any of the following are true:</p>

<ul>
<li><p>Its <span data-x="concept-media-muted-state">muted state</span> is true.</p></li>

<li><p>Its <span data-x="concept-media-muted-state">muted state</span> is "<code
data-x="">default</code>" and it has a <code data-x="attr-media-muted">muted</code> content
attribute.</p></li>

<li><p>The <span>direction of playback</span> is backwards.</p></li>

<li><p>Its <code data-x="dom-media-playbackRate">playbackRate</code> is so low or so high that the
user agent cannot play audio usefully.</p></li>
</ul>

<p>Each <span>media element</span> has a <dfn data-x="concept-media-muted-state">muted
state</dfn>, which is either true, false, or "<code data-x="">default</code>"; it is initially "<code
data-x="">default</code>". User agents may set a <span>media element</span>'s <span
data-x="concept-media-muted-state">muted state</span> to true or false (e.g., remembering the last
set value across sessions, on a per-site basis or otherwise).</p>

<div algorithm>
<p>The <dfn attribute for="HTMLMediaElement"><code data-x="dom-media-muted">muted</code></dfn>
getter steps are to return true if this is <span
data-x="concept-media-muted">muted</span>; otherwise false.</p>
</div>

<div algorithm>
<p>The <dfn attribute for="HTMLMediaElement"><code data-x="dom-media-muted">muted</code></dfn> IDL
attribute must return the value to which it was last set. When a <span>media element</span> is
created, if the element has a <code data-x="attr-media-muted">muted</code> content attribute
specified, then the <code data-x="dom-media-muted">muted</code> IDL attribute should be set to
true; otherwise, the user agents may set the value to the user's preferred value (e.g. remembering
the last set value across sessions, on a per-site basis or otherwise). While the <code
data-x="dom-media-muted">muted</code> IDL attribute is set to true, the <span>media element</span>
must be <span data-x="concept-media-muted">muted</span>.</p>
<p>The <code data-x="dom-media-muted">muted</code> setter steps are to set this's
<span data-x="concept-media-muted-state">muted state</span> to the given value.</p>
</div>

<div algorithm>
Expand Down Expand Up @@ -43398,8 +43411,7 @@ red:89
<li><p>If the user agent's <span>volume locked</span> is true, then return the system
volume.</p></li>

<li><p>If the element's audio output is <span data-x="concept-media-muted">muted</span>, then
return zero.</p></li>
<li><p>If the element is <span data-x="concept-media-muted">muted</span>, then return 0.</p></li>

<li><p>Let <var>volume</var> be the <span data-x="concept-media-volume">playback
volume</span> of the audio portions of the <span>media element</span>, in range 0.0 (silent) to
Expand All @@ -43416,20 +43428,18 @@ red:89

<p>The <dfn element-attr for="audio,video"><code data-x="attr-media-muted">muted</code></dfn>
content attribute on <span data-x="media element">media elements</span> is a <span>boolean
attribute</span> that controls the default state of the audio output of the <span>media
resource</span>, potentially overriding user preferences.</p>
attribute</span> that gives the default value for muting.</p>

<p class="note">This attribute has no dynamic effect (it only controls the default state of the
element).</p>
<p class="note">This attribute has no further effect once the <code
data-x="dom-media-muted">muted</code> setter has been invoked or the user indicated a
preference.</p>

<div class="example">

<p>This video (an advertisement) autoplays, but to avoid annoying users, it does so without
sound, and allows the user to turn the sound on. The user agent can pause the video if it's
unmuted without a user interaction.</p>

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

</div>


Expand Down
Loading