webcam-easy icon indicating copy to clipboard operation
webcam-easy copied to clipboard

How do I switch cameras?

Open chengkiang opened this issue 4 years ago • 1 comments

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

chengkiang avatar Jan 22 '21 10:01 chengkiang

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.

pdivita avatar Feb 08 '21 13:02 pdivita