diff --git a/web/zebra-spaces.html b/web/zebra-spaces.html index d484a27..978325c 100644 --- a/web/zebra-spaces.html +++ b/web/zebra-spaces.html @@ -2632,6 +2632,13 @@ function handleRemoteSfuTrack(ev){ if (kind === 'screen' || kind === 'camera' || kind === 'game'){ logLine('', 'sfu ontrack: kind=' + kind + ' pub=' + pubHex + ' track=' + ev.track.kind + ' mute=' + ev.track.muted + ' state=' + ev.track.readyState); + /* Video receivers (screen / camera / game) match the audio receiver's + * playoutDelayHint so the picture stays in sync with the voice. The + * mic jitter buffer is 4s; without a matching hint on video, mouse + * clicks / mouth movement / keystrokes lead the voice by ~4s. Audio + * is more vital than video — video adapts to audio's delay, never + * the other way around. */ + try { if (ev.receiver) ev.receiver.playoutDelayHint = RECV_PLAYOUT_DELAY_SEC; } catch(_){} } /* MSID-supplant safety: the SFU re-uses the same streamID * (`shortPub-kind`) when a publisher supplants themselves. WebRTC @@ -4941,8 +4948,8 @@ logLine('', 'ready — pick a handle, type a rendezvous code, enter the space');