-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: cover some device selection edge cases (#1604)
This PR fixes some edge cases around device selection: ### Selecting the `default` device Chrome allows requesting user media with device id `default`. For the purposes of the SDK, we treat this device as if it didn't existed, and filter it out of device lists. However, it was still possible to select it manually. Now device id `default` is filtered out of media requests, so even if it is selected manually, it is replaced with an actual device id when device is unmuted. ### Selecting non-existing device id Previously, selecting non-existing device (e.g. `call.camera.select('nonsense')`) resulted in the default device being selected. That could be a nasty surprise for a user. Now, either `select` method will throw (if device is already unmuted) or enabling the device will throw later. This takes us to the final change: ### Error handler for device selectors `onError` callback added to audio and video device selectors, since `select` method can now throw in a rare case that the device list is stale.
- Loading branch information
1 parent
36181d5
commit a8fc0ea
Showing
6 changed files
with
76 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 18 additions & 11 deletions
29
packages/react-sdk/src/components/DeviceSettings/DeviceSelectorAudio.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 16 additions & 11 deletions
27
packages/react-sdk/src/components/DeviceSettings/DeviceSelectorVideo.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters