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

Works on the demo site, but not on my app until I found a chrome bug :) #89

Open
Bappy1988 opened this issue Jun 6, 2020 · 0 comments

Comments

@Bappy1988
Copy link

Bappy1988 commented Jun 6, 2020

So I've found what appears to be a bug in Chrome. In order to enumerate the list of audio devices, you need to allow access to both your Microphones and your Cameras.

I've just lost an hour trying to figure out why the DetectRTC sample page listed all 10 of my audio input devices but my own app only listed 'Microphone 1'

If you're only interested in capturing audio, you need to request permission for cameras as well as microphones or the list doesn't evaluate properly.

I appreciate that the 'how to fix labels' section does state that you need to make a getUserMedia call, but it doesn't highlight that you need to request video in order to get accurate audio device data.

if (DetectRTC.MediaDevices[0] && DetectRTC.MediaDevices[0].isCustomLabel) {
    // it seems that we did not make getUserMedia request yet
    navigator.mediaDevices.getUserMedia({
        audio: true,
        video: true
    })

could easily be tweaked to make that clear;

if (DetectRTC.MediaDevices[0] && DetectRTC.MediaDevices[0].isCustomLabel) {
    // it seems that we did not make getUserMedia request yet
    navigator.mediaDevices.getUserMedia({
        audio: true,
        video: true //must request video even if you only want audio as chrome will not evaluate audio devices correctly otherwise.
    })

I get this isn't a bug in your project but it's info that would help use it so thought I'd share :)

@Bappy1988 Bappy1988 changed the title Works on the demo site, but not on my app Works on the demo site, but not on my app until I found a chrome bug :) Jun 6, 2020
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

1 participant