PSA: Chrome getUserMedia "ideal" constraint change

45 views
Skip to first unread message

Bryant Chandler

unread,
Oct 30, 2024, 4:52:51 AMOct 30
to discuss...@googlegroups.com

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.

Reply all
Reply to author
Forward
0 new messages