From 36401ac2038c03c78f6f5bfea90d05f7493ccd0c Mon Sep 17 00:00:00 2001 From: Christophe Besson Date: Thu, 17 Sep 2026 13:41:57 +0200 Subject: docs(hub): say what the subtitle track's mode effect was measured to do MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The comment claimed a appended after playback started is not shown by its `default` attribute. Chrome shows it: in a headless run the TextTrack read back "showing" before the effect had touched it, with its cues already parsed. The effect stays, for the two reasons that are true — `default` says nothing about turning subtitles off again, and an explicitly assigned mode means the same thing in every engine — but the reason written beside it was not one of them. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01UGY17EPph5LsLzePPXhUVc --- .../meshbay-hub/src/meshbay_hub/static/video-player.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'packages/meshbay-hub/src') diff --git a/packages/meshbay-hub/src/meshbay_hub/static/video-player.js b/packages/meshbay-hub/src/meshbay_hub/static/video-player.js index 5725fc4..a150512 100644 --- a/packages/meshbay-hub/src/meshbay_hub/static/video-player.js +++ b/packages/meshbay-hub/src/meshbay_hub/static/video-player.js @@ -1122,11 +1122,15 @@ function VideoPlayer({ entry, transportRef, gekRef, onClose, onDownload }) { } }, [entry, transportRef, gekRef]); - // A added to a media element after it started playing is not shown - // by the `default` attribute — that one is read when the element is first - // parsed, and by then this track did not exist. The mode has to be set on - // the live TextTrack, which only appears once the element has adopted the - // child preact just rendered. + // The mode is set here rather than left to the `default` attribute. + // + // Chrome does honour `default` on a track appended long after playback + // started — measured in a headless run, where the TextTrack read back + // "showing" before this effect had touched it, and its cues were parsed. + // That was worth checking and is not what this exists for: `default` has + // nothing to say about turning subtitles *off* again, which is the other + // half of this effect, and a mode assigned here means the same thing in + // every engine whatever each one decides the attribute implies. useEffect(() => { const v = videoRef.current; if (!v) return; -- cgit v1.2.3