From b836c97fdfeb5d1489b45fe4329fa1b67b38d93f Mon Sep 17 00:00:00 2001 From: Russell Ballestrini Date: Sun, 7 Jun 2026 20:39:24 -0400 Subject: [PATCH] zebra-spaces: user-facing notice on getUserMedia NotAllowedError (kill silent camera fail) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ticket 0002: fedora firefox shares-camera click flickered to FAILED with nothing user-visible. Telemetry showed the error but the user had no clue what to do about it. Three cases now surface a showNotice: NotAllowedError "Camera blocked by your browser..." with Firefox- specific recovery steps (lock icon → Permissions → set camera to Allow). Generic text for other UAs. NotFoundError "No camera detected." NotReadableError "Camera is in use by another application." The OverconstrainedError + saved-deviceId auto-recovery path is untouched. Doesn't fix the saved-block itself (only the user can clear it via Firefox's site permissions UI) but tells them exactly where to go. --- web/zebra-spaces.html | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/web/zebra-spaces.html b/web/zebra-spaces.html index 090f197..f805fcd 100644 --- a/web/zebra-spaces.html +++ b/web/zebra-spaces.html @@ -4633,6 +4633,26 @@ async function sfuPublishCamera(){ fsm.send('FAILED', { error: e2.message }); fsm.send('DONE'); return; } } else { + /* User-facing notice on the common "no prompt, instant fail" case. + * NotAllowedError fired without a prompt = the browser has a saved + * Block for this origin's camera permission. Tell the user how to + * unstick it — Firefox doesn't surface this in the URL bar after + * the block is saved; only by visiting site permissions does the + * user discover what's wrong. Ticket 0002. */ + if (e.name === 'NotAllowedError'){ + const ua = navigator.userAgent || ''; + const ff = /Firefox\//.test(ua); + showNotice( + ff + ? 'Camera blocked by your browser. Click the lock icon in the URL bar → "Connection secure" → "More information" → Permissions, then change "Use the camera" to Allow. Reload and try again.' + : 'Camera blocked. Click the lock or camera icon in the URL bar and allow camera access for this site, then try again.', + 'warn' + ); + } else if (e.name === 'NotFoundError'){ + showNotice('No camera detected. Connect a camera and try again.', 'warn'); + } else if (e.name === 'NotReadableError'){ + showNotice('Camera is in use by another application. Close the other app and try again.', 'warn'); + } fsm.send('FAILED', { error: e.message }); fsm.send('DONE'); return; } } @@ -8125,8 +8145,8 @@ logLine('', 'ready — pick a handle, type a rendezvous code, enter the space');