From 9ed1cefcd57b8d213834c04adf4548b08778274a Mon Sep 17 00:00:00 2001 From: Russell Ballestrini Date: Sun, 31 May 2026 12:48:20 -0400 Subject: [PATCH] zebra-spaces: SFU bridge + role-change notice banner MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Listeners now hear all speakers via a Pion-based audio-only SFU on proxy.uncloseai.com. Speakers publish to it; listeners subscribe and get one PC carrying every speaker's track. Mesh remains the low-latency speaker<->speaker path; SFU is the broadcast fan-out. Wiring: - sfuPublish/Unpublish for speaker role transitions - sfuSubscribe/Unsubscribe for listener role transitions - onRoleEntered + onRoleChanged + leave hooks - ontrack on the subscribe PC maps streams[0].id (= publisher pubkey hex, set as the SFU TrackLocal StreamID) -> room member uuid; audio element + meter attach to the matched member row - SSE renegotiation: SFU pushes offer when speakers come/go; browser answers via POST /answer - applyMicMode now hot-swaps the SFU publish sender's track too, so voice/music mode toggles apply over the SFU just like the mesh Notice banner — fox flagged that booted/demoted users had no visible signal. Added a #sec-notice section with .notice-banner (warn for boot/demote-to-listener, info for promote). Boot also sets wantConnected=false to prevent the WS auto-reconnect loop from rejoining into a boot loop. --- web/zebra-spaces.html | 185 +++++++++++++++++++++++++++++++++++++++--- 1 file changed, 173 insertions(+), 12 deletions(-) diff --git a/web/zebra-spaces.html b/web/zebra-spaces.html index b488673..e5ef772 100644 --- a/web/zebra-spaces.html +++ b/web/zebra-spaces.html @@ -122,6 +122,14 @@ border: 2px solid #000; padding: 0.8rem; margin-bottom: 1rem; background: #ffd; display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; } + .notice-banner { + padding: 0.7rem 0.8rem; margin-bottom: 1rem; + display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; + font-size: 0.85rem; + } + .notice-banner.warn { border: 2px solid #b00; background: #fee; color: #b00; } + .notice-banner.info { border: 2px solid #060; background: #efe; color: #060; } + .notice-banner button { margin-left: auto; } .vault-panel { border: 1px dashed #000; padding: 0.7rem; margin-top: 0.5rem; } .hidden { display: none !important; } @media (max-width: 500px) { @@ -213,6 +221,13 @@ + +