aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristophe Besson <cbesson@gmail.com>2026-09-17 13:41:57 +0200
committerChristophe Besson <cbesson@gmail.com>2026-09-17 13:41:57 +0200
commit36401ac2038c03c78f6f5bfea90d05f7493ccd0c (patch)
tree28537ea9c7404954398cff0dc2b98bfbda64e5a6
parentad4ca3229002997934ccb5b2eaeb553c13b8888f (diff)
downloadmeshbay-36401ac2038c03c78f6f5bfea90d05f7493ccd0c.tar.gz
docs(hub): say what the subtitle track's mode effect was measured to do
The comment claimed a <track> 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 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UGY17EPph5LsLzePPXhUVc
-rw-r--r--packages/meshbay-hub/src/meshbay_hub/static/video-player.js14
1 files changed, 9 insertions, 5 deletions
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 <track> 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;