diff options
-rw-r--r-- | ui/lib/webcam-utils.js | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/ui/lib/webcam-utils.js b/ui/lib/webcam-utils.js index e4261dfbc..9b507cd99 100644 --- a/ui/lib/webcam-utils.js +++ b/ui/lib/webcam-utils.js @@ -13,21 +13,20 @@ class WebcamUtils { const isBrave = !!window.chrome.ipcRenderer const isFirefoxOrBrave = isFirefox || isBrave try { - reject({type: 'NO_WEBCAM_FOUND'}) - // DetectRTC.load(_ => { - // if (DetectRTC.hasWebcam) { - // let environmentReady = true - // if ((isFirefoxOrBrave && isPopup) || (isPopup && !DetectRTC.isWebsiteHasWebcamPermissions)) { - // environmentReady = false - // } - // resolve({ - // permissions: DetectRTC.isWebsiteHasWebcamPermissions, - // environmentReady, - // }) - // } else { - // reject({type: 'NO_WEBCAM_FOUND'}) - // } - // }) + DetectRTC.load(_ => { + if (DetectRTC.hasWebcam) { + let environmentReady = true + if ((isFirefoxOrBrave && isPopup) || (isPopup && !DetectRTC.isWebsiteHasWebcamPermissions)) { + environmentReady = false + } + resolve({ + permissions: DetectRTC.isWebsiteHasWebcamPermissions, + environmentReady, + }) + } else { + reject({type: 'NO_WEBCAM_FOUND'}) + } + }) } catch (e) { reject({type: 'UNKNOWN_ERROR'}) } |