Skip to content

Commit

Permalink
Extend iframe with a new allowusermedia attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
adam-be committed Feb 4, 2016
1 parent cf3d866 commit 47e82cf
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions getusermedia.html
Expand Up @@ -2655,6 +2655,17 @@ <h3>MediaDevices Interface Extensions</h3>
<p>If <var>requestedMediaTypes</var> is the empty set, return a
promise rejected with a <code>TypeError</code>.</p>
</li>
<li>
<p>If the current [[!HTML51]] <a href=
"https://www.w3.org/TR/2015/WD-html51-20150506/browsers.html#browsing-context">
browsing context</a> is a <a href=
"https://www.w3.org/TR/2015/WD-html51-20150506/browsers.html#nested-browsing-context">
nested browsing context</a> which is not <a>allowed to use user
media</a>, return a promise rejected with a
<code><a>DOMException</a></code> object whose
<code><a>name</a></code> attribute has the value
<code>SecurityError</code>.</p>
</li>
<li>
<p>Let <var>p</var> be a new promise.</p>
</li>
Expand Down Expand Up @@ -2876,6 +2887,36 @@ <h2>NavigatorUserMediaErrorCallback</h2>
object or an <code><a>OverconstrainedError</a></code> object.
</div>
</section>
<section>
<h2>User Media in an IFrame</h2>
<p>There are some special circumstances when an [[!HTML51]]
<code><a href="https://www.w3.org/TR/2015/WD-html51-20150506/semantics.html#the-iframe-element">
iframe</a></code> wants to use user media. The iframe needs explicit
permission from the embedding page and it needs to identify itself in the
security prompt presented to the user. This section, together with the
<code><a>getUserMedia()</a></code> algorithm, specifies that
behavior.</p>
<p>The <code><a>HTMLIFrameElement</a></code> is extended with an <dfn id=
"iframe-allowusermedia"><code>allowusermedia</code></dfn> content
attribute. <code>allowusermedia</code> is a [[!HTML51]] <code><a href=
"https://www.w3.org/TR/2015/WD-html51-20150506/infrastructure.html#boolean-attribute">
boolean attribute</a></code>. When specified, it indicates that scripts
in the iframe element's browsing context are <dfn>allowed to use user
media</dfn> (if it's not blocked for other reasons, e.g. there is another
ancestor iframe without this attribute set).</p>
<p>The iframe DOM interface is extended as described by the partial
interface below.</p>
<dl class="idl" title="partial interface HTMLIFrameElement">
<dt>attribute boolean allowUserMedia</dt>
<dd>
<p>The allowUserMedia IDL attribute MUST [[!HTML51]] <code><a href=
"https://www.w3.org/TR/2015/WD-html51-20150506/infrastructure.html#reflect">
reflect</a></code> the <code><a href=
"#iframe-allowusermedia">allowusermedia</a></code> content
attribute.</p>
</dd>
</dl>
</section>
<section>
<h2>Implementation Suggestions</h2>
<div class="practice">
Expand Down

0 comments on commit 47e82cf

Please sign in to comment.