diff options
| author | Adam Soltys <[email protected]> | 2026-09-26 23:51:19 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-09-26 23:51:19 -0700 |
| commit | 3395ccc44a7455a4b9de73e78ab655b38b7a827d (patch) | |
| tree | 0293fe200bb71a14178222fdbf8436852782dad6 | |
| parent | cacfabdd206b243fc3e49ea6942d8ac76f6dd198 (diff) | |
| download | coinosv3-3395ccc44a7455a4b9de73e78ab655b38b7a827d.tar.gz coinosv3-3395ccc44a7455a4b9de73e78ab655b38b7a827d.zip | |
Video previews release their media off screen; a paused player kept buffering the whole clip.
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VhUKyXKtsJ67QAFfb7QR9D
| -rw-r--r-- | src/features/messages.js | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/features/messages.js b/src/features/messages.js index bc74ba9..2b0af4a 100644 --- a/src/features/messages.js +++ b/src/features/messages.js @@ -4703,9 +4703,19 @@ export function messagesFeature(ctx) { }); v.onvolumechange = () => btn.setSound(!v.muted); // the native control's own mute keeps the button honest box.append(btn); + // Off screen, a muted preview lets go of its media entirely (a paused + // player keeps buffering the whole file — a scroll past ten clips + // streamed seventy megabytes); back in view it reattaches and plays + // from the start. A clip the reader unmuted keeps its place instead. watchPlayer(v, - () => { if (v.paused) v.play().then(() => { box._skipMorph = true; }).catch(() => {}); }, - () => { if (!v.paused) v.pause(); }); + () => { + if (!v.getAttribute('src') && !v.getAttribute('data-lazy-src')) v.setAttribute('src', url); + if (v.paused) v.play().then(() => { box._skipMorph = true; }).catch(() => {}); + }, + () => { + if (!v.paused) v.pause(); + if (v.muted && box._skipMorph) { try { v.removeAttribute('src'); v.load(); } catch {} } + }); return box; } |
