zebra-report: drop play button for listeners — autoplay WebRTC
Mirror of zebra-report 9eb5b82.
This commit is contained in:
parent
4891a90be0
commit
cef405c204
1 changed files with 5 additions and 29 deletions
|
|
@ -3843,18 +3843,9 @@ function updateScreenShareUI(){
|
|||
function updateRoleUI(){
|
||||
$('sec-listener-actions').classList.toggle('hidden', myRole !== 'listener');
|
||||
updateScreenShareUI();
|
||||
/* Listener mute-button repurposed as the audio-unlock gesture +
|
||||
* local output toggle. Enabled regardless of micStream so a
|
||||
* listener can tap it to provide the user gesture mobile browsers
|
||||
* demand before unmuted audio is allowed. Speakers/cohosts/host
|
||||
* still get the original self-mic-mute behavior (enabled by
|
||||
* ensureMicAndUI once the mic is live). */
|
||||
const btn = $('btn-mute');
|
||||
if (myRole === 'listener'){
|
||||
btn.disabled = false;
|
||||
btn.textContent = listenerOutputMuted ? 'play' : 'mute';
|
||||
btn.className = listenerOutputMuted ? '' : 'invert';
|
||||
}
|
||||
/* Listeners have no mic — mute button stays disabled. WebRTC
|
||||
* playback is autoplayed by attachSfuTrack the same way speakers
|
||||
* get their inbound mesh/SFU audio; no second-gesture button. */
|
||||
}
|
||||
|
||||
/* ==================================================================
|
||||
|
|
@ -4635,21 +4626,6 @@ function applyMuteState(){
|
|||
if (mm){ mm.muted = muted; renderRoom(); }
|
||||
}
|
||||
$('btn-mute').addEventListener('click', () => {
|
||||
/* Listener path: this click is the user gesture mobile browsers
|
||||
* demand before unmuted audio is allowed. attachSfuTrack already
|
||||
* called play() for every WebRTC audio element on attach — that
|
||||
* call may have silently been rejected (Firefox Android ages out
|
||||
* the entry-button gesture grace fast). Re-fire play() on each
|
||||
* existing element inside THIS gesture; one of these tries is
|
||||
* the one that actually unblocks the speaker output. */
|
||||
if (myRole === 'listener'){
|
||||
listenerOutputMuted = !listenerOutputMuted;
|
||||
activateListenerAudio();
|
||||
const btn = $('btn-mute');
|
||||
btn.textContent = listenerOutputMuted ? 'play' : 'mute';
|
||||
btn.className = listenerOutputMuted ? '' : 'invert';
|
||||
return;
|
||||
}
|
||||
if (!micStream) return;
|
||||
muted = !muted;
|
||||
try { sessionStorage.setItem(MUTE_STATE_KEY, muted ? '1' : '0'); } catch(_){}
|
||||
|
|
@ -4904,8 +4880,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-04</span><br>
|
||||
md5 <span class="stamp-md5">eb8d6716640c8f73eb3e30d53969e2ae</span><br>
|
||||
sha256 <span class="stamp-sha">37e8cee05cb38fa982ab9ef6a2504c10001cd7a7ca6c5d791cc00e2a036a1efd</span><br>
|
||||
md5 <span class="stamp-md5">627a038a99648b35f87e7ad75f3d057a</span><br>
|
||||
sha256 <span class="stamp-sha">a3ea7e91b1a8ed05a02414bd86ab4a4cd9968f8ec7f2bf9521f24ccc41783c29</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