diff --git a/public/js/marhun-photo-capture.js b/public/js/marhun-photo-capture.js index 9c1913e7..ed29df11 100644 --- a/public/js/marhun-photo-capture.js +++ b/public/js/marhun-photo-capture.js @@ -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);