Update marhun camera implementation
- add implementation to use camera with groupId if cameras with device label are unavailable
This commit is contained in:
Vendored
+12
-2
@@ -117,8 +117,18 @@ function marhunPhotoCapturerFactory(modal_selector) {
|
||||
}
|
||||
|
||||
function composeConstraint(camera) {
|
||||
var constraints = { deviceId: { exact: camera.deviceId } };
|
||||
return navigator.mediaDevices.getUserMedia({ video: constraints });
|
||||
|
||||
if(camera.deviceId !== ''){
|
||||
constraints = { deviceId: { exact: camera.deviceId } };
|
||||
return navigator.mediaDevices.getUserMedia({ video: constraints });
|
||||
}
|
||||
|
||||
|
||||
if(camera.groupId !== ''){
|
||||
constraints= { groupId: { exact: camera.groupId } };
|
||||
return navigator.mediaDevices.getUserMedia({ video: constraints });
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return getCameraList()
|
||||
|
||||
Reference in New Issue
Block a user