-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: handle device disconnection (#1174)
This PRs adds the last missing piece to the new device management API: handling device disconnections. ## What's new? ### Audio, video manager - If a device is disconnected, we deselect that device (not available in RN) - If a track ends, we update the device manager status to `disabled` - If the "default" device is replaced, we restart the device (not available in RN) ### Screenshare manager - If a track ends, we update the device manager status to `disabled` ### Speaker manager - If a device is disconnected, we deselect that device (not available in RN) ## Implementation details ### Watching for disconnected devices The `deviceIds$` Observable notifies the manager about device connections/disconnections. This Observable uses `enumerateDevices`, so it will never ask for permissions (we only need to ask for permissions if we need device labels, but we don't need them for watching disconnected devices). ### Handling track ending We add the `ended` event handler to all tracks of a media stream, if any track ends, we update the manager's status to `disabled`. ### Handling new default device If a device's `deviceId` stays the same, but it's `groupId` is changed, a device is replaced. We restart the stream if the device was previously enabled.⚠️ The PR also removed unused device helper methods, that are remainings of the old device API that's already removed, on the offchance a customer uses any of these helpers they should upgrade to the new, simlified device management API: - For JS client: https://getstream.io/video/docs/javascript/guides/camera-and-microphone/ - For React: https://getstream.io/video/docs/react/guides/camera-and-microphone/ - For RN: https://getstream.io/video/docs/reactnative/core/camera-and-microphone/
- Loading branch information
Showing
10 changed files
with
335 additions
and
142 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
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
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
Oops, something went wrong.