aboutsummaryrefslogtreecommitdiffstats
path: root/tools/feed-media-views-test.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-10-03 15:52:38 -0700
committerAdam Soltys <[email protected]>2026-10-03 15:52:38 -0700
commit141779ab97efad6abefaec0545bba5330fd1e12d (patch)
tree32024b5cb022d0a001e618bd05040304af4a124b /tools/feed-media-views-test.js
parent6488806b840c009278f4ae16de9e079ea4b892bc (diff)
downloadcoinosv3-141779ab97efad6abefaec0545bba5330fd1e12d.tar.gz
coinosv3-141779ab97efad6abefaec0545bba5330fd1e12d.zip
Video frames from bytes, not from a CORS player; pager clips load plainly again
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 <[email protected]> Claude-Session: https://claude.ai/code/session_01ULQZS9MQa6iAsXnrJUD9Du
Diffstat (limited to 'tools/feed-media-views-test.js')
-rw-r--r--tools/feed-media-views-test.js2
1 files changed, 1 insertions, 1 deletions
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());