Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A conflict with the enumerateDevices if you have several camera devices #23

Open
Madriix opened this issue Jun 1, 2022 · 2 comments
Open

Comments

@Madriix
Copy link

Madriix commented Jun 1, 2022

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
Copy link
Author

Madriix commented Jun 1, 2022

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

@miroslavpejic85
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants