mediasoup-sfu-webrtc-video-rooms icon indicating copy to clipboard operation
mediasoup-sfu-webrtc-video-rooms copied to clipboard

A conflict with the enumerateDevices if you have several camera devices

Open Madriix opened this issue 2 years ago • 2 comments

Hi

alt text

On Chrome I have several cameras, the Avermedia is a video card that broadcasts DTT channels on a computer instead of television. There's Manycam, that's my test webcam device. I have another camera, it's not plugged in, it's a real webcam.

I noticed that the Avermedia is always first, therefore it very often selects the Avermedia by default.

Here's how the conflict unfolds:

  1. I turn on my camera (it selects the Manycam well)
  2. If I want to turn the camera back on, this time it still selects Avermedia, but I would like it to select Manycam

As a result, customers cannot turn on their webcam if they have multiple devices

Do you have an idea to solve this?

Salutations

Madriix avatar Jun 01 '22 06:06 Madriix

I partially solved the problem. Here is what I did:

  1. On Firefox everything is fine, but not on Chrome. I put a menu to choose the webcam device (but I haven't yet to choose the audio). Each time a client starts his webcam, then from time to time by default it offers him a popup with Sweetalert2 to choose the webcam. As soon as he ticks, he updates the "videoSelect" live and the camera starts with it.

  2. I also removed "stream.getTracks()" here: https://github.com/Dirvann/mediasoup-sfu-webrtc-video-rooms/blob/master/public/index.js#L111 because the enumerateDevices on Firefox it doesn't show device names with "device.label" they are empty, and removing the getTracks fixes the problem.

It should be noted that I use the entire mediasoup-sfu-webrtc-video-rooms system except index.html and index.js which are heavily modified

Madriix avatar Jun 01 '22 15:06 Madriix

You could use the local.storage to save you index -> deviceId you have selected, then reuse it, if it doesn't find it (device removed) use the default.

miroslavpejic85 avatar Aug 12 '22 12:08 miroslavpejic85