zebra-report: remove dead audioPath references — fixes leave button

Mirror of zebra-report 3bc3edf.
This commit is contained in:
russell@unturf.com 2026-06-03 23:01:14 -04:00
parent b0bb2a1be4
commit 22ecc0b5ba
No known key found for this signature in database

View file

@ -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 <audio> elements +
* clear streamMode / audioPath so a fresh entry doesn't get
* blocked by `streamMode.has(pubHex)` from the old session.
* Stops the auto-enrol retry loop too — it'd otherwise tick on
* for the next 4s firing at a dead members map. */
stopAutoEnrolRetryLoop();
autoDisableDjModeForAll();
* clear streamMode so a fresh entry doesn't get blocked by
* `streamMode.has(pubHex)` from the old session. */
for (const a of [...streamAudio.values()]){
try { a.pause(); a.removeAttribute('src'); a.load(); a.remove(); } catch(_){}
}
streamAudio.clear();
streamMode.clear();
audioPath.clear();
for (const u of [...peers.keys()]) tearPeer(u);
/* send 'bye' BEFORE closing the WS — server distinguishes a strong
* leave (user clicked leave / closed tab) from a hiccup disconnect
@ -4947,8 +4940,8 @@ logLine('', 'ready — pick a handle, type a rendezvous code, enter the space');
<footer style="margin:2.2rem auto 0;font-size:0.65rem;color:#999;line-height:1.7;word-break:break-all;font-family:monospace">
<span id="pi-seal" style="color:#777;cursor:default;user-select:none" title="">page integrity</span> &nbsp;·&nbsp; built <span class="stamp-date">2026-06-04</span><br>
md5 <span class="stamp-md5">82e9e6fecd89ae3f77c37310ef96fbb8</span><br>
sha256 <span class="stamp-sha">f61767c5df25c142f57ed75e3ecf3202ba9e83661da3c529c59cdb9892aa7b6a</span><br>
md5 <span class="stamp-md5">f117990083c5ec95421b4f44c440474c</span><br>
sha256 <span class="stamp-sha">109fc3a83bd4cb622a2542fce8466d835e276a22f753984c29ef23a5e94a8728</span><br>
<span style="color:#bbb">hashes are of this page with these two fields zeroed — to verify, blank them and re-hash</span><br>
<span style="color:#bbb">one self-contained file — <strong>save a copy</strong> and verify against these hashes; point at your own servers with ?signal= and ?turncred=, or <a href="host-your-own.html" style="color:#999">host your own community</a></span>
</footer>