From 35908cf8982993a229590a00b98b96219b65bd86 Mon Sep 17 00:00:00 2001 From: Russell Ballestrini Date: Wed, 3 Jun 2026 12:24:50 -0400 Subject: [PATCH] zebra-spaces: remember screen-share across refresh, one-click resume banner MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Camera silently auto-resumes on refresh (getUserMedia keeps the permission grant); screen-share couldn't because getDisplayMedia requires transient activation — a fresh user gesture. The previous attempt fired in a setTimeout after welcome, which has no gesture, so the browser instantly returned NotAllowedError. We then dropped screen-state tracking entirely. This time: track ACTIVE_SCREEN_KEY in sessionStorage when sfuPublishScreen succeeds; on welcome, if the user can speak AND the key is set, unhide #sec-screen-resume — a banner with a single 'resume screen share' button. The button click is the gesture; its handler calls sfuPublishScreen() synchronously, and getDisplayMedia is the first await inside, so the transient-activation flag is preserved through the chain (same shape as the regular 'share screen' button, which proves the mechanic works every day). UX: - Camera: silent resume on welcome (unchanged) - Screen: banner appears, user taps once, picker opens - Mobile: getDisplayMedia missing — the resume button rejects with a logLine error and self-clears the key (handled by .catch on the resume click) Key clears on explicit unshare + on demote to listener + on rejection, so the banner doesn't linger after the underlying state changes. --- web/zebra-spaces.html | 48 +++++++++++++++++++++++++++++++++++++------ 1 file changed, 42 insertions(+), 6 deletions(-) diff --git a/web/zebra-spaces.html b/web/zebra-spaces.html index 492ef41..8939a2c 100644 --- a/web/zebra-spaces.html +++ b/web/zebra-spaces.html @@ -731,6 +731,12 @@ try { +