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

Selecting new device after unplugged/plugged it #129

@felixzapata

Description

@felixzapata

Hi, using the React example, there is a problem trying to use a device that was previously unplugged from the system again.

The scenario:

  1. you are inside the room.
  2. the user has two camera devices, one via USB.
  3. the user selects the USB and sees the video.
  4. the user unplugs the USB camera so the system puts the internal camera.
  5. the user plugs again the USB camera and appears again on the devices list.
  6. the user selects the USB camera.
  7. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions