This repository was archived by the owner on Aug 24, 2023. It is now read-only.

Description
Hi, using the React example, there is a problem trying to use a device that was previously unplugged from the system again.
The scenario:
- you are inside the room.
- the user has two camera devices, one via USB.
- the user selects the USB and sees the video.
- the user unplugs the USB camera so the system puts the internal camera.
- the user plugs again the USB camera and appears again on the devices list.
- the user selects the USB camera.
- the user should see the video with this camera selected but instead, the video shows the internal camera.
Maybe the problem is because the example does not listen to the stream restarted event or similar because if you put in the browser console:
currentRoom.localParticipant.getTrack('camera')?.track?.mediaStreamTrack.label
currentRoom.localParticipant.videoTracks.values().next().value.track.constraints.deviceId
between steps 4 and 7, you see this data has not changed.
Is it possible the localParticipant object did not receive the update after this track change? Is this a problem from the SDK or from the React sample only?
The above scenario only works if, and only if before selecting the USB camera plugged (again) we select first the internal camera. Then we will be able to select the USB camera without a problem and see the video using it.