aboutsummaryrefslogtreecommitdiffstats
path: root/tools/video-unmute-test.js
diff options
context:
space:
mode:
Diffstat (limited to 'tools/video-unmute-test.js')
-rw-r--r--tools/video-unmute-test.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/video-unmute-test.js b/tools/video-unmute-test.js
index 16cb56f..fec3955 100644
--- a/tools/video-unmute-test.js
+++ b/tools/video-unmute-test.js
@@ -16,6 +16,10 @@ const server = Bun.serve({ port: 5302, fetch(req) {
// Hold autoplay until after repaint to make the race deterministic.
window.IntersectionObserver = undefined;
const t = key => key;
+ // what videoNode reaches for outside the slice: no cached stills or sizes,
+ // and no clip over the data budget
+ const videoThumbs = new Map(), videoInfo = new Map(), tappedClips = new Set();
+ const feedMedia = () => null, rememberVideo = () => {}, probeVideo = async () => {}, videoHeavy = () => false, heavyLabel = () => '';
${dom}
${video}
const url = '/clip.webm';
@@ -24,6 +28,8 @@ const server = Bun.serve({ port: 5302, fetch(req) {
const originalButton = live.querySelector('button');
const fresh = videoNode(url);
morph(live, fresh);
+ // (a clip loads nothing until it comes into view; this one is in view)
+ live.querySelector('video').preload = 'auto';
window.test = { live, fresh, originalButton, rebuild() {
const next = videoNode(url); live.replaceWith(next); return next.querySelector('video').muted;
} };