diff options
| -rw-r--r-- | packages/meshbay-hub/src/meshbay_hub/static/video-player.js | 14 |
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; |