Re: [mediacapture-screen-share] Handling of contradictory hints (#276)

My concerns:
1. Throwing on options that some browsers may parse and others may not adds unnecessary web compat headaches
2. A parsing requirement would make implementations non-conformant (these are optional to implement modulo [#290](https://github.com/w3c/mediacapture-screen-share/issues/290))
3. "Preferences" are generally understood to be just that — saved and not tailored to every single use of them
4. A preference "conflict" in one browser may make sense in another

E.g. I would *prefer* a mint on my pillow, but don't cancel my scuba diving trip over it.

Since preferences are optional to implement, behavior should match that of non-implementing browsers. E.g.

> ```js
> // 1.
> // Audio generally not requested, but system-audio marked as desired.
> navigator.mediaDevices.getDisplayMedia({
>   audio: false,
>   systemAudio: "include",
> });
> ```

...should act the same as `navigator.mediaDevices.getDisplayMedia()`.

> ```js
> // 2.
> // Audio requested, including an explicit request for system-audio,
> // but monitors asked to be excluded. (Monitors are the surface type
> // associated with system-audio.)
> navigator.mediaDevices.getDisplayMedia({
>   audio: true,
>   systemAudio: "include",
>   monitorTypeSurfaces: "exclude"
> });

Since [systemAudio](https://w3c.github.io/mediacapture-screen-share/#idl-def-SystemAudioPreferenceEnum.include) is a sub-option _"for [monitor](https://w3c.github.io/mediacapture-screen-share/#dfn-monitor) [display surfaces](https://w3c.github.io/mediacapture-screen-share/#dfn-display-surface)."_ there's no logical conflict. I want zero apples, all green.

> ```js
> // 3.
> // Application requested monitors to be displayed most prominently,
> // while simultaneously asking for monitors to not be offered.
> navigator.mediaDevices.getDisplayMedia({
>   video: {
>     displaySurface: "monitor"
>   },
>   monitorTypeSurfaces: "exclude"
> });
> ```

Since _"The user agent MAY use the presence of the [displaySurface](https://w3c.github.io/mediacapture-screen-share/#dfn-displaysurface) constraint and its value to influence the presentation"_ there's no logical conflict. Monitor types will be excluded IF this browser supports it, and put up front if not and _that_ is supported.

Not every combination needs to be useful as long as it's deterministic.

-- 
GitHub Notification of comment by jan-ivar
Please view or discuss this issue at https://github.com/w3c/mediacapture-screen-share/issues/276#issuecomment-1852791755 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Tuesday, 12 December 2023 20:50:39 UTC