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

How do I switch cameras? #14

Open
chengkiang opened this issue Jan 22, 2021 · 1 comment
Open

How do I switch cameras? #14

chengkiang opened this issue Jan 22, 2021 · 1 comment

Comments

@chengkiang
Copy link

If I have multiple webcams/video inputs, how do I specify which one to use? Right now, it defaults to the first one found.

@pdivita
Copy link

pdivita commented Feb 8, 2021

I had the same problem.
Fixed adding a function to my local copy of webcam-easy.js
Added this function:

set selectedDeviceId(value) {
    this._selectedDeviceId = value;
}

I call that function with the new id:

webcam.selectedDeviceId = otherWebcamDeviceId;
webcam.start();

Don't know if this is the cleanest solution (because the original variable was private probably for one reason) but works for me.

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