No specific video constraints
This request grants access to all connected video devices. To optimize quality or select a particular camera, consider adding explicit video constraints. This will also prevent selecting unintended devices.
Description
GetUserMedia or GetDisplayMedia API have 2 goals:
- Authorizing the browser to access a device
- Get the stream from this device
When no constraint is set it could lead to selecting the wrong device (eg: virtual or system default) which might not be the one the user wants. Not adding constraints allows getting a different level of quality, depending on the device or browser default settings (such as mono or stereo for a microphone).
In this case, there’s a getUserMedia for video only that has no constraints for the video.
What do we do here?
We check if there are getUserMedia requests that have the minimal constraints set like {video: true} except and by discarding the first request done for a domain.
Notes
The first getUserMedia for a domain is discarded in this check because it is mainly used to authorize the devices for enumerating the devices and collecting the device labels.
Our suggestions
- Consider adding constraints to your calls for getUserMedia