PSA: Chrome getUserMedia "ideal" Constraint Change

247 views
Skip to first unread message

Bryant Chandler

unread,
Oct 28, 2024, 1:24:46 PMOct 28
to blink-dev

PSA: We're updating how Chrome handles device selection when getUserMedia is called with an "ideal" constraint for the device ID. This change is being rolled out by Finch. It can be temporarily disabled by disabling chrome://flags/#camera-mic-preview and chrome://flags/#get-user-media-deferred-device-settings-selection.

What's changing?

Currently, when you use an "ideal" constraint for a device ID, Chrome prioritizes this preference when requesting camera or microphone access. With this change, if the user has previously expressed a device preference (through the new permission bubble), Chrome will prioritize the user's preference over the "ideal" constraint provided in your code. This aims to improve user experience by respecting the user's explicit device choice.

If your application needs to use a specific camera or microphone, you should switch from using "ideal" constraints to using "exact" constraints for the device ID. This ensures that your application will always get the specified device if available.

How to test this change:

  1. Enable the chrome://flags/#camera-mic-preview and chrome://flags/#get-user-media-deferred-device-settings-selection flags in Chrome.

  2. Use a website that calls getUserMedia with an "ideal" device ID constraint.

  3. Observe the new permission bubble, which allows users to select their preferred devices.

Streamzz

unread,
Oct 29, 2024, 4:25:00 PMOct 29
to blink-dev, Bryant Chandler
The test flags are available in Chrome desktop 130. The test flags are not available in Chrome mobile 130. Please advise for mobile.

"This communication is confidential and may contain privileged and/or copyright material. If you are not the intended recipient you must not use, disclose, copy or retain it. If you have received it in error please immediately notify me by return email, delete the emails and destroy any hard copies. Soul Machines Limited does not guarantee the integrity of this communication, or that it is free from errors, viruses or interference."

Please consider the environment before printing this email.

Reply all
Reply to author
Forward
0 new messages