zebra-spaces: prime audioCtx on first interaction anywhere (fix desktop auto-rejoin regression)
Fox 2026-06-05: "speaker on firefox chrome was hard restarted and cannot hear host" / "host is working phone listeners hear host, speaker does not see hosts mic open or waveform." Root cause: desktop auto-rejoin reaches joinSpace() without a click, so primeAudioOnGesture() never fires. Chrome (Fedora especially) leaves audioCtx suspended until a real user gesture, and the fire-and-forget audioCtx.resume() inside attachAudioStreamViaWorklet silently fails outside one. Worklet reports "started" but the destination renders nothing, the meter analyser pulls no samples → no audio, no waveform, no mic-open indicator (the indicator IS the waveform). Pre-zero-click-auto-rejoin, the manual entry button always primed audio; the regression arrived with that convenience. Now: install a document-wide one-shot click/keydown/touchstart listener that calls primeAudioOnGesture() on first interaction anywhere. Zero-click auto-rejoin convenience preserved — any later page click engages audio for the rest of the session. Listener self-unregisters after firing so we don't repeatedly spawn silent oscillators. Idempotent — primeAudioOnGesture's audioCtx check makes re-runs safe.
This commit is contained in:
parent
999e772c20
commit
61d456d113
1 changed files with 30 additions and 2 deletions
|
|
@ -7365,6 +7365,34 @@ $('rdv-code').addEventListener('keydown', e=>{
|
|||
if(e.key==='Enter'){ e.preventDefault(); primeAudioOnGesture(); joinSpace(); }
|
||||
});
|
||||
|
||||
/* Desktop auto-rejoin (below) reaches joinSpace() without a click, so
|
||||
* the entry-button gesture never fires. Chrome (Fedora especially)
|
||||
* leaves audioCtx suspended until a real user gesture, and the
|
||||
* fire-and-forget audioCtx.resume() inside attachAudioStreamViaWorklet
|
||||
* silently fails outside a gesture → no audio, no waveform, no
|
||||
* mic-open indicator. Fox 2026-06-05: "speaker on firefox chrome was
|
||||
* hard restarted and cannot hear host."
|
||||
*
|
||||
* Document-wide one-shot listener: on first interaction anywhere (any
|
||||
* click, any keydown), prime audio. Idempotent — primeAudioOnGesture()
|
||||
* is safe to re-run because it checks `audioCtx` and only resumes if
|
||||
* suspended. Unregisters itself after firing so we don't repeatedly
|
||||
* spawn silent oscillators. */
|
||||
(function installFirstGesturePrimer(){
|
||||
let primed = false;
|
||||
function prime(){
|
||||
if (primed) return;
|
||||
primed = true;
|
||||
try { primeAudioOnGesture(); } catch(e){ logLine('err','first-gesture prime: '+e.message); }
|
||||
document.removeEventListener('click', prime, true);
|
||||
document.removeEventListener('keydown', prime, true);
|
||||
document.removeEventListener('touchstart', prime, true);
|
||||
}
|
||||
document.addEventListener('click', prime, true);
|
||||
document.addEventListener('keydown', prime, true);
|
||||
document.addEventListener('touchstart', prime, true);
|
||||
})();
|
||||
|
||||
/* ?code=… autofills the rendezvous code (used by the share URL). The code
|
||||
* stays in the URL so a refresh keeps you in the same space; if you want
|
||||
* to leave it cleanly, hit the leave button or close the tab. */
|
||||
|
|
@ -7504,8 +7532,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> · built <span class="stamp-date">2026-06-05</span><br>
|
||||
md5 <span class="stamp-md5">7728cca3f32432a3b21a633d303261a6</span><br>
|
||||
sha256 <span class="stamp-sha">4d1e388864b2f7673158985e3e9a3442c96439132bca62f04ae8be0694affe39</span><br>
|
||||
md5 <span class="stamp-md5">9aca7c642e3a0f7ea5ea104cc114cbde</span><br>
|
||||
sha256 <span class="stamp-sha">c295a568dfcf5df8567bce78e5ab90503bcec52fa9ae3a64d433000803dabc2d</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>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue