From 141779ab97efad6abefaec0545bba5330fd1e12d Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Sat, 3 Oct 2026 15:52:38 -0700 Subject: Video frames from bytes, not from a CORS player; pager clips load plainly again MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Regression from 6488806: pager clips were loaded crossorigin so their frame could be kept, and on a phone the large clip's slide went black. Some hosts (Primal's R2 bucket) send CORS headers only to a request with an Origin and don't Vary on it, so a copy the browser cached from a plain player load answers a later CORS load without them, and it fails. The same thing made the size probe fail for any clip that had played in the feed. - Pager clips load plainly again; the still under a tap-to-play cover is restored on every return. - The probe (and its HEAD) go past the browser cache (no-store). - A clip's frame is now made from bytes: the opening of the file (index plus about 1 MB, no-store) decoded from a blob and kept as a JPEG — for tiles and as the pager's poster. No CORS player anywhere. Files whose index trails, or hosts whose bytes can't be read, keep the plain player still (shown, not kept). - Kept frames are 480 px wide (were 270) and capped at 600. - Probe failures are stored as failedAt, so earlier failures are asked again at once. - Test: an R2-style host, its clip cached by a plain load first, is still measured and its frame kept (failed before this change). Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_01ULQZS9MQa6iAsXnrJUD9Du --- tools/feed-media-views-test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tools/feed-media-views-test.js') diff --git a/tools/feed-media-views-test.js b/tools/feed-media-views-test.js index dee807c..52fa810 100644 --- a/tools/feed-media-views-test.js +++ b/tools/feed-media-views-test.js @@ -168,7 +168,7 @@ try { check('Videos shows a grid of the vertical clips, not the pager yet', await waitFor(() => document.querySelectorAll('.media-grid .media-tile.video').length === 3, 8000) && await page.evaluate(() => !document.querySelector('.media-pager'))); check('every tile gets a thumbnail — the 50 MB one too, with its cost as a badge', await waitFor(() => - [...document.querySelectorAll('.media-tile video')].filter((v) => v.getAttribute('src')).length === 3 + [...document.querySelectorAll('.media-tile.video')].filter((t) => (t.querySelector('img')?.src || '').startsWith('blob:') || t.querySelector('video')?.getAttribute('src')).length === 3 && [...document.querySelectorAll('.media-tile-badge')].some((x) => /50 MB/.test(x.textContent)), 8000)); await shot('video-grid'); await page.evaluate(() => document.querySelector('.media-grid .media-tile.video').click()); -- cgit v1.2.3