You can use restrictions to specify which camera to use, and you can display both of them on the same page. To indicate which camera to use, see the following snippet (works only on Chrome 30+):
getUserMedia({ video: { mandatory: { sourceId: webcamId, ... } }, successCallback, failCallback);
webcamId you can get:
MediaStreamTrack.getSources(function(sources){ var cams = _.filter(sources, function(e){ //only return video elements return e.kind === 'video'; }); var camIds = _.map(cams, function (e) { // return only ids return e.id; }); });
In the above snippet, I used the underscore filter and map methods.
Additional information on:
source share