aboutsummaryrefslogtreecommitdiffstats
path: root/tools/video-fallback-test.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-10-18 06:05:25 -0700
committerAdam Soltys <[email protected]>2026-10-18 06:05:25 -0700
commit4807f138feba04a60292886a196d614e2254810b (patch)
treed9e7ee76fc61381ea9c5916050ed0d9f1553da73 /tools/video-fallback-test.js
parentb9297719d294779a2ea14c77a67975308bace65c (diff)
downloadcoinosv3-4807f138feba04a60292886a196d614e2254810b.tar.gz
coinosv3-4807f138feba04a60292886a196d614e2254810b.zip
Clips too big to play as they are (past 1080p, over the data budget, unmeasurable) stream as HLS from vmedia and play by themselves instead of waiting behind a tap-to-play cover; with Data Saver or a slow link the cover stays.
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013ZDf1cyCQLkfjftYhymZAg
Diffstat (limited to 'tools/video-fallback-test.js')
-rw-r--r--tools/video-fallback-test.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/video-fallback-test.js b/tools/video-fallback-test.js
index 85250c0..93726e1 100644
--- a/tools/video-fallback-test.js
+++ b/tools/video-fallback-test.js
@@ -37,6 +37,12 @@ const server = Bun.serve({ port: 0, fetch: (req) => {
} });
const browser = await puppeteer.launch({ executablePath: '/usr/bin/google-chrome', headless: 'new', args: ['--no-sandbox', '--autoplay-policy=no-user-gesture-required'] });
const page = await browser.newPage();
+// a browser without HLS of its own (Firefox): a clip too big to play as it
+// is waits for a tap here, rather than streaming (video-hls-play-test)
+await page.evaluateOnNewDocument(() => {
+ const can = HTMLMediaElement.prototype.canPlayType;
+ HTMLMediaElement.prototype.canPlayType = function (t) { return /mpegurl/i.test(t) ? '' : can.call(this, t); };
+});
await page.setRequestInterception(true);
const asked = []; // [kind, clip url]
page.on('request', (r) => {