Introduce DisplayMediaStreamConstraints.surfaceSwitching by eladalon1983 · Pull Request #225 · w3c/mediacapture-screen-share · GitHub
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

Introduce DisplayMediaStreamConstraints.surfaceSwitching #225

Merged
merged 12 commits into from
Jun 16, 2022
50 changes: 50 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -796,6 +796,47 @@ <h2><dfn>SystemAudioPreferenceEnum</dfn></h2>
</tbody>
</table>
</section>
<section>
<h2><dfn>SurfaceSwitchingPreferenceEnum</dfn></h2>
<p>
Describes whether an application invoking {{MediaDevices/getDisplayMedia()}}
would like the user agent to offer the user an option to dynamically switch
the source [=display surface=] during the capture.
</p>
<pre class="idl">
enum SurfaceSwitchingPreferenceEnum {
"include",
"exclude"
Copy link
Contributor

Choose a reason for hiding this comment

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

I would prefer "allow" and "deny".

Copy link
Member Author

Choose a reason for hiding this comment

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

I'd be happy to change this if Youenn and Jan-Ivar agree.

Copy link
Contributor

Choose a reason for hiding this comment

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

Agree that "Allow" and "Deny" is better than "include"/"exclude".

Copy link
Member

Choose a reason for hiding this comment

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

Actually, I like "include" and "exclude" here since it's consistent with recent enums we've added around surface inclusion/exclusion. This is slightly different since it's a dynamic feature to switch surfaces later, but seems similar in that it has to do with what surfaces the user can choose.

Those other enums were also hints, so being consistent in naming with them would be nice, and might help readers intuitively understand they're all hints

};
</pre>
<table data-dfn-for="SurfaceSwitchingPreferenceEnum" class="simple">
<tbody>
<tr>
<th colspan="2">
Enumeration description
</th>
</tr>
<tr>
<td>
<dfn id="idl-def-SurfaceSwitchingPreferenceEnum.include">include</dfn>
</td>
<td>
The application prefers that an option to dynamically switch the source
[=display surface=] during the capture be offered to the user.
</td>
</tr>
<tr>
<td>
<dfn id="idl-def-SurfaceSwitchingPreferenceEnum.exclude">exclude</dfn>
</td>
<td>
The application prefers that an option to dynamically switch the source
[=display surface=] during the capture NOT be offered to the user.
</td>
</tr>
</tbody>
</table>
</section>
<section>
<h2>DisplayMediaStreamConstraints</h2>
<p>The <dfn>DisplayMediaStreamConstraints</dfn> dictionary is used to
Expand All @@ -809,6 +850,7 @@ <h2>DisplayMediaStreamConstraints</h2>
(boolean or MediaTrackConstraints) audio = false;
SelfCapturePreferenceEnum selfBrowserSurface;
SystemAudioPreferenceEnum systemAudio;
SurfaceSwitchingPreferenceEnum surfaceSwitching;
};</pre>
<section>
<h2>Dictionary <a class="idlType">DisplayMediaStreamConstraints</a>
Expand Down Expand Up @@ -855,6 +897,14 @@ <h2>Dictionary <a class="idlType">DisplayMediaStreamConstraints</a>
If present, signals whether the application would like system audio
to be included among the possible audio sources offered to the user.
</dd>
<dt>
<dfn><code>surfaceSwitching</code></dfn> of type {{SurfaceSwitchingPreferenceEnum}}
</dt>
<dd>
If present, signals whether the application would like the
user agent to offer the user an option to dynamically switch
the captured [=display surface=].
</dd>
</dl>
</section>
</div>
Expand Down