From fd4761288ad3bad354eefb0a999a53a1db7d7a31 Mon Sep 17 00:00:00 2001 From: Noah Petherbridge Date: Thu, 17 Aug 2023 19:36:33 -0700 Subject: [PATCH] Bugfix for device picker on Firefox for Android --- web/static/js/BareRTC.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/web/static/js/BareRTC.js b/web/static/js/BareRTC.js index bc00ec1..f3ed62d 100644 --- a/web/static/js/BareRTC.js +++ b/web/static/js/BareRTC.js @@ -1418,7 +1418,7 @@ const app = Vue.createApp({ // the devices and no big deal. // - If they had given permission before, we can present a nicer experience // for them and enumerate their devices before they go on originally. - if (!changeCamera) { + if (!changeCamera && !force) { // Initial broadcast: did they select device IDs? this.getDevices(); } @@ -1501,7 +1501,6 @@ const app = Vue.createApp({ return; } - if (this.webcam.gettingDevices) return; this.webcam.gettingDevices = true; navigator.mediaDevices.enumerateDevices().then(devices => { @@ -1510,7 +1509,9 @@ const app = Vue.createApp({ devices.forEach(device => { // If we can't get the device label, disregard it. // It can happen if the user has not yet granted permission. - if (!device.label) return; + if (!device.label) { + return; + }; if (device.kind === 'videoinput') { // console.log(`Video device ${device.deviceId} ${device.label}`);