diff --git a/web/zebra-spaces.html b/web/zebra-spaces.html index 6a60d78..cef736f 100644 --- a/web/zebra-spaces.html +++ b/web/zebra-spaces.html @@ -4136,14 +4136,10 @@ async function startStream(uuid, pubHex){ } a.src = wantUrl; const onPlaying = () => { - audioPath.set(uuid, 'dj'); - applyAudioMute(); logLine('', 'stream on for '+pubHex.slice(0,12)+' — DJ mode (~2s delay, glitch-free)'); }; const onFail = (why) => { - audioPath.set(uuid, 'rtc'); - streamMode.delete(pubHex); // allow next auto-enrol pass to retry - applyAudioMute(); + streamMode.delete(pubHex); // allow next toggle attempt to retry logLine('err', 'stream for '+pubHex.slice(0,12)+' '+why+' — staying on live WebRTC'); }; a.addEventListener('playing', onPlaying, { once: true }); @@ -4161,8 +4157,10 @@ function stopStream(uuid){ try { a.pause(); } catch(_){} try { a.removeAttribute('src'); a.load(); } catch(_){} } - audioPath.set(uuid, 'rtc'); - applyAudioMute(); + /* re-enable the WebRTC audio for this peer in case we'd muted it + * while DJ mode was active. */ + const w = remoteAudio.get(uuid); + if (w) try { w.muted = false; } catch(_){} } function toggleStreamFor(uuid, pubHex){ if (streamMode.has(pubHex)){ @@ -4886,18 +4884,13 @@ $('btn-leave').addEventListener('click', async () => { try { sessionStorage.removeItem(ACTIVE_CAM_KEY); } catch(_){} if (sigReconnect){ clearTimeout(sigReconnect); sigReconnect = null; } /* tear down ALL DJ-mode HTTP streams + their