Phone PWA: no backdrop blurs over video, cap auto quality at 480p on touch phones

This commit is contained in:
Jonathan Sykes
2026-10-14 08:23:23 +08:00
parent c0c472f3ef
commit 4fa33e9810
2 changed files with 13 additions and 2 deletions

View File

@@ -3032,9 +3032,13 @@ function chooseQuality() {
const match = qs.find((q) => q.label === pref);
if (match) return match;
}
// auto: best quality at or below 720p, else the lowest available.
// auto: best quality at or below 720p (480p on touch phones, where a lossy
// link rebuffers the picture while the separate audio keeps playing),
// else the lowest available.
let cap = 720;
try { if (matchMedia('(pointer: coarse)').matches && Math.min(screen.width, screen.height) < 600) cap = 480; } catch {}
const sorted = [...qs].sort((a, b) => b.height - a.height);
return sorted.find((q) => q.height <= 720) || sorted[sorted.length - 1];
return sorted.find((q) => q.height <= cap) || sorted[sorted.length - 1];
}
function buildQualityMenu() {