From 7adb8cdf7b1a405c58ad9c51c901d852c29dd2ad Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Sat, 3 Oct 2026 15:36:58 -0700 Subject: Pager: a large clip shows its frame under the tap-to-play cover The slide's poster was fixed when the pager was built, and a clip over budget held no source, so a clip whose frame was kept a moment later (or never) was a black screen with a button. Now the kept frame is looked up as a slide comes near; without one, the clip's first frame is loaded under the cover (only the start of the file, when it leads with its index or is served in ranges) and kept for next time. A tap plays it from the start. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01ULQZS9MQa6iAsXnrJUD9Du --- tools/feed-media-views-test.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'tools') diff --git a/tools/feed-media-views-test.js b/tools/feed-media-views-test.js index 0811520..9181904 100644 --- a/tools/feed-media-views-test.js +++ b/tools/feed-media-views-test.js @@ -198,7 +198,10 @@ try { st = await pagerState(); check('the 50 MB clip waits for a tap, saying what it costs', st.src === 'c.mp4' && await page.evaluate(() => { const s = document.querySelectorAll('.mp-slide')[2]; const b = s.querySelector('.vid-heavy'); - return !!b && /50 MB/.test(b.textContent) && !s.querySelector('video').getAttribute('src'); }), JSON.stringify(st)); + return !!b && /50 MB/.test(b.textContent) && !/^[^#]*$/.test(s.querySelector('video').getAttribute('src') || '#'); }), JSON.stringify(st)); + check('...over a picture of it (the kept frame, or the first frame itself)', await waitFor(() => { + const v = document.querySelectorAll('.mp-slide')[2].querySelector('video'); + return (v.getAttribute('poster') || '').startsWith('blob:') || (/#t=/.test(v.getAttribute('src') || '') && v.readyState >= 2); }, 5000)); await shot('heavy'); await page.evaluate(() => document.querySelectorAll('.mp-slide')[2].querySelector('.vid-heavy').click()); check('a tap plays it', await waitFor(() => { const v = document.querySelectorAll('.media-pager video')[2]; return !v.paused && v.currentTime > 0; }, 6000)); -- cgit v1.2.3