Opt for the last device assumed as doccamera when using Firefox

This commit is contained in:
afiq.hamzah
2023-02-13 15:28:59 +08:00
parent 1f62281709
commit 25e0efa1d8
+11 -3
View File
@@ -106,9 +106,17 @@ function marhunPhotoCapturerFactory(modal_selector) {
return marhun_camera_config_firefox.includes(camera.deviceId);
});
if(filteredCameraFirefox.length > 0){
return filteredCameraFirefox.at(-1);
}
let isfirefox = navigator.userAgent.toLowerCase().indexOf('firefox') > -1;
if(isfirefox){
if(filteredCameraFirefox.length > 0){
return filteredCameraFirefox.splice(-1);
}
const filteredCameraFirefoxLastDevice = available_cameras.splice(-1);
return filteredCameraFirefoxLastDevice;
}
// Get the first available priority referencing to env
return filteredCameraChrome.at(-1);