Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use relevant settings objects. #136

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
42 changes: 17 additions & 25 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,8 @@ <h2>Methods</h2>
steps:</p>
<ol class="method-algorithm">
<li>
<p>Let <var>document</var> be the
<a data-cite="!HTML/webappapis.html#current-settings-object">
current settings object</a>'s
<a data-cite="!HTML/webappapis.html#concept-relevant-global">
relevant global object</a>'s
<a data-cite="!HTML/window-object.html#concept-document-window">
associated <code>Document</code></a>.</p>
<p>Let <var>document</var> be [=this=]'s [=relevant global object=]'s
[=associated `Document`=].</p>
</li>
<li>
<p>If <var>document</var> is not
Expand Down Expand Up @@ -248,7 +243,7 @@ <h2>Methods</h2>
<p>When the {{selectAudioOutput}} method is called,
the [=user agent=] MUST run the following steps:</p>
<ol>
<li><p>If the [=relevant global object=] of [=this=] does not have
<li><p>If [=this=]'s [=relevant global object=] does not have
[=transient activation=], return a promise <a>rejected</a> with
a {{DOMException}} object whose {{DOMException/name}} attribute
has the value {{InvalidStateError}}.</p></li>
Expand Down Expand Up @@ -300,7 +295,7 @@ <h2>Methods</h2>
has the value {{NotAllowedError}} and abort these steps.</p></li>
<li><p>Let <var>deviceInfo</var> be a new {{MediaDeviceInfo}} object to represent the selected audio output device.</p></li>
<li><p>Add <var>deviceInfo</var>.{{MediaDeviceInfo/deviceId}}
to <a data-link-for="relevant global object">[[\explicitlyGrantedAudioOutputDevices]]</a>.</p></li>
to <a data-link-for="MediaDevices">[[\explicitlyGrantedAudioOutputDevices]]</a>.</p></li>
<li><p>Resolve <var>p</var> with <var>deviceInfo</var>.</p></li>
</ol>
</li>
Expand Down Expand Up @@ -391,28 +386,25 @@ <h3>Obtaining Consent</h3>
This conveniently handles the common case of wanting
to route both input and output audio through a headset or speakerphone
device.</p>
<p>On page load, run the following step:</p>
<ol>
<p> Upon [=create a MediaDevices | creation of a MediaDevices=] object
<var>mediaDevices</var>, initialize <var>mediaDevices</var> with an
additional internal slot:</p>
<ul data-dfn-for="MediaDevices">
<li>
<p>On the <a data-cite="!HTML/#concept-relevant-global">relevant global object</a>,
create an internal slot: <dfn data-dfn-for="relevant global object">[[\explicitlyGrantedAudioOutputDevices]]</dfn>,
used to store devices that the user grants explicitly through {{MediaDevices/selectAudioOutput}},
initialized to an empty set.</p>
<p><dfn data-dfn-for="MediaDevices">[[\explicitlyGrantedAudioOutputDevices]]</dfn>,
to store devices that the user grants explicitly through
{{MediaDevices/selectAudioOutput}}, initialized to an empty [=map/set=].</p>
</li>
</ol>
</ul>
<p>This specification specifies the <dfn data-cite="!GETUSERMEDIA#device-exposure-decision-non-camera-microphone">
exposure decision algorithm for devices other than camera and microphone</dfn>.
The algorithm runs as follows, with <var>device</var>, <var>microphoneList</var> and <var>cameraList</var> as input:
The algorithm runs as follows, with <var>device</var>, <var>microphoneList</var>, <var>cameraList</var> and
<var>mediaDevices</var> as input:
</p>
<ol>
<li>
<p>Let <var>document</var> be the
<a data-cite="!HTML/webappapis.html#current-settings-object">
current settings object</a>'s
<a data-cite="!HTML/webappapis.html#concept-relevant-global">
relevant global object</a>'s
<a data-cite="!HTML/window-object.html#concept-document-window">
associated <code>Document</code></a>.</p>
<p>Let <var>document</var> be <var>mediaDevices</var>'s
[=relevant global object=]'s [=associated `Document`=].</p>
</li>
<li><p>Let <var>deviceInfo</var> be a new {{MediaDeviceInfo}} object to represent the device.</p></li>
<li>
Expand All @@ -423,7 +415,7 @@ <h3>Obtaining Consent</h3>
</li>
<li>
<p>If <var>deviceInfo</var>.{{MediaDeviceInfo/deviceId}}
is in <a data-link-for="relevant global object">[[\explicitlyGrantedAudioOutputDevices]]</a>, return <code>true</code>.</p>
is in <a data-link-for="MediaDevices">[[\explicitlyGrantedAudioOutputDevices]]</a>, return <code>true</code>.</p>
</li>
<li>
<p>If <var>deviceInfo</var>.{{MediaDeviceInfo/groupId}}
Expand Down
2 changes: 1 addition & 1 deletion script.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ var respecConfig = {
// name (without the @w3.org) of the public mailing to which comments are due
wgPublicList: "public-webrtc",
github: "https://github.com/w3c/mediacapture-output/",
xref: ["webidl", "html", "permissions", "mediacapture-streams", "permissions-policy","dom", "webaudio"],
xref: ["webidl", "html", "permissions", "mediacapture-streams", "permissions-policy","dom", "webaudio", "infra"],
implementationReportURI: "https://wpt.fyi/audio-output",
otherLinks: [
{
Expand Down