jhuckaby/webcamjs — pull request #35 by carvilsi (2014-10-09 20:03:22+00:00)
Title: choosing camera device

Allows to choose a camera device.
Useful with mobile devices with front and back camera or PC with more than one camera attached.

In the "init" function we try to list and store on array "cameraIDs" all IDs of video devices, in your code you can check the length of this array and select one camera ID by "cameraID" variable before call "attach" function.

Something like that:

```
// webcam set, as usual
Webcam.set({
width: 150,
height: 150,
dest_width: 150,
dest_height: 130,
image_format: 'jpeg',
jpeg_quality: 90,
force_flash: false
});

// selecting camera device
if (Webcam.cameraIDs.length > 1) {
Webcam.cameraID = 1;
}

// attach, as usual
Webcam.attach('#camara');
```