diff --git a/static/app.js b/static/app.js index 18ce665..9c2b47e 100644 --- a/static/app.js +++ b/static/app.js @@ -696,7 +696,12 @@ async function play(ep_id, ep_no) { document.getElementById("player").replaceChildren(v); playerOverlay("Loading\u2026"); if (!window.Hls || !Hls.isSupported()) throw new Error("HLS not supported in this browser"); - hls = new Hls(); + // the upstream CDN occasionally stalls on segment bytes (0 bytes for + // 10s+). hls.js's default 5s time-to-first-byte abort would drop the XHR + // before our proxy's 12s upstream attempt (+300ms retry) can answer with + // its 502 — keep TTFT past the proxy timeout so slow-but-alive segments + // finish, and the proxy's retry path gets a chance + hls = new Hls({ fragLoadPolicy: { default: { maxTimeToFirstByteMs: 15000, maxNumRetry: 8 } } }); hls.on(Hls.Events.ERROR, (_, data) => { if (data.fatal) { stopHls();