Re: [mediacapture-output] The first "audiooutput" `MediaDeviceInfo` returned from `enumerateDevices()` is not the default device when the default device is not exposed (#133)

For a `MediaDeviceInfo` representing a default device that would not otherwise be exposed, perhaps the simplest solution in terms of consistency with the current spec might be to initialize only the `kind` attribute, [as for dummy "videoinput" and "audioinput" devices when their respective "information can be exposed" flags are false](https://w3c.github.io/mediacapture-main/#creating-a-device-info-object).
Some variations on this may also be considered:

A generic minimal-fingerprint `label` meaning something like "System default audio output device for this user-agent" may be useful to provide the user with some indication of what the option represents should a client app present this device in UI constructed from unfiltered set of `MediaDeviceInfo`s.  This would preferably be localized, so the precise wording would not be specified.  

Possible variations might have `deviceId` that is empty or that of the physical device (*defaultDeviceId*).  Exposing a `deviceId` not otherwise available might be seen as an advantage or disadvantage.
* A client app already may choose to add it's own UI option corresponding to `setSinkId("")` behavior.
* *defaultDeviceId* would be more similar to the other devices exposed through `enumerateDevices()` in that `setSinkId(deviceId)` would still tie output to a single physical device.  When an empty `deviceId` is used with `setSinkId()`, the audio is redirected when the user or system changes the default audio output device.  With *defaultDeviceId*, audio would [no longer be heard if the default device changes](https://w3c.github.io/mediacapture-output/#algorithms-sink-unavailable and *defaultDeviceId* is not otherwise exposed.)  I expect an empty `deviceId` would match user expectations if the `label` is "System default audio output device for this user-agent", but perhaps for *defaultDeviceId* a `label` might be along the lines of "The physical audio output device that was the default device at the time this `MediaDeviceInfo` object was created, but this label does not describe that physical device."
* *defaultDeviceId* would be a small additional fingerprint, even if that is unique to the origin, because changes in the default device would be visible across origins, even for unexposed physical devices.
* Exposing *defaultDeviceId* would only be useful if https://github.com/w3c/mediacapture-output/issues/94 were revisited because
> [If sinkId is not the empty string, and the application would not be permitted to play audio through the device identified by sinkId if it weren't the current user agent default device, reject p with a new DOMException whose name is NotAllowedError and abort these substeps.](https://w3c.github.io/mediacapture-output/#dom-htmlmediaelement-setsinkid)

Either an empty `deviceId` or an empty `label` would be sufficient to indicate that the `label` does not describe a physical device.

Perhaps similar options exist for `groupId`.

I'm favoring empty `deviceId` and `groupId`, and allowing a non-empty `label`.

-- 
GitHub Notification of comment by karlt
Please view or discuss this issue at https://github.com/w3c/mediacapture-output/issues/133#issuecomment-1271131565 using your GitHub account


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

Received on Friday, 7 October 2022 05:36:59 UTC