Skip to content

Separate ViewportMediaStreamConstraints dictionary. #22

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
45 changes: 44 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ <h2>
<pre class="idl"
>partial interface MediaDevices {
Promise&lt;MediaStream&gt; getViewportMedia(
optional DisplayMediaStreamConstraints constraints = {});
optional ViewportMediaStreamConstraints constraints = {});
};</pre>
<dl data-link-for="MediaDevices" data-dfn-for="MediaDevices" class="methods">
<dt>
Expand Down Expand Up @@ -358,6 +358,49 @@ <h2 id="constrainable-properties">
those relevant to {{MediaDevices/getDisplayMedia()}}, as defined in
<a data-cite="SCREEN-CAPTURE#constrainable-properties">
5.4 Constrainable Properties for Captured Display Surfaces</a>.
<section>
<h2>ViewportMediaStreamConstraints</h2>
<p>The <dfn>ViewportMediaStreamConstraints</dfn> dictionary is used to
instruct the user agent what sort of {{MediaStreamTrack}}s may be
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

{{MediaStreamTracks}} would also work, iianm...?

included in the {{MediaStream}} returned by
{{MediaDevices/getViewportMedia}}.</p>
<div>
<pre class="idl">
dictionary ViewportMediaStreamConstraints {
(boolean or MediaTrackConstraints) video = true;
(boolean or MediaTrackConstraints) audio = false;
};</pre>
<section>
<h2>Dictionary <a class="idlType">ViewportMediaStreamConstraints</a>
Members</h2>
<dl data-link-for="ViewportMediaStreamConstraints" data-dfn-for=
"ViewportMediaStreamConstraints" class="dictionary-members">
<dt><dfn><code>video</code></dfn> of type <code>(boolean or {{MediaTrackConstraints}})</code>,
defaulting to <code>true</code></dt>
<dd>
<p>If <code>true</code>, it requests that the returned
{{MediaStream}} contain a video track. If a {{MediaTrackConstraints}}
structure is provided, it further specifies desired processing
options to be applied to the video track rendition of the
display surface chosen by the user. If <code>false</code>, the
request will be [=rejected=] with a {{TypeError}}, as per the
{{MediaDevices/getViewportMedia}} algorithm</a>.</p>
</dd>
<dt><dfn><code>audio</code></dfn> of type <code>(boolean or {{MediaTrackConstraints}})</code>,
defaulting to <code>false</code></dt>
<dd>
<p>If <code>true</code>, it signals an interest that the
returned {{MediaStream}} contain an audio track, if
supported and audio is available.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's bake in that the user agent is allowed to offer the user the option to approve-without-audio even if the user asks for audio. Let's leave it up to user agents to decide if they want to offer that or not, though. Maybe:
"...contain an audio track, if supported, and audio is available, and the user has not opted out of sharing audio."

If a {{MediaTrackConstraints}} structure is provided, it
further specifies desired processing options to be applied to
the audio track. If <code>false</code>, the {{MediaStream}}
will not contain an audio track.</p>
</dd>
</dl>
</section>
</div>
</section>
</section>
<section data-cite="permissions">
<h2 id="permissions-intergration">Permissions Integration</h2>
Expand Down