iPhone: step probes + full hls.js error stream to server
The play-probe now lands (iPhone: iOS 18.7 Safari, hls.js path, MSE ok), but the /stream XHR never reaches the server on the failing attempts — impossible under the known code path. Instrument each step (new-hls-ok / loadsource-called / attach-ok) and log EVERY hls.js error (fatal+non-fatal, with retry counter) so the client timeline is visible server-side. Also fixed JSV constant drift (was stuck at 10). events endpoint: accept hls-err, forward step/fatal/details/buffer/retry/http.
This commit is contained in:
1 parent
3df074a5fe
commit
aba266ee4b
3 files changed
+14
-5
No files matched your search
+9
-1
@@ -1,5 +1,5 @@
|
||||
// app.js — ani-web frontend: search -> detail -> play, vanilla JS + hls.js
|
||||
const JSV = 10; // bump with every app.js change; play-probe reports it so a
|
||||
const JSV = 12; // bump with every app.js change; play-probe reports it so a
|
||||
// stale-cache phone is detectable server-side
|
||||
// BASE = this page's directory, so the app works at / or behind a
|
||||
// prefixing reverse proxy (e.g. https://host/ani/)
|
||||
@@ -915,14 +915,22 @@ async function play(ep_id, ep_no) {
|
||||
timeoutRetry: { maxNumRetry: 6, retryDelayMs: 1000, maxRetryDelayMs: 20000, backoff: "linear" },
|
||||
errorRetry: { maxNumRetry: 8, retryDelayMs: 1000, maxRetryDelayMs: 20000, backoff: "linear" },
|
||||
} } });
|
||||
// iPhone debugging: log EVERY hls.js error (fatal and not) so the
|
||||
// client-side timeline is visible server-side
|
||||
hls.on(Hls.Events.ERROR, (_, data) => {
|
||||
try { postEvent({type: "hls-err", jsv: JSV, fatal: data.fatal, details: data.details,
|
||||
buffer: data.buffer || null, retry: data.retry ?? null,
|
||||
http: data.response ? data.response.code : null}); } catch {}
|
||||
if (data.fatal) {
|
||||
stopHls();
|
||||
playerFail(data.details + (data.response ? ` (HTTP ${data.response.code})` : ""));
|
||||
}
|
||||
});
|
||||
try { postEvent({type: "play-probe", jsv: JSV, step: "new-hls-ok"}); } catch {}
|
||||
hls.loadSource("/stream/" + s.token);
|
||||
try { postEvent({type: "play-probe", jsv: JSV, step: "loadsource-called"}); } catch {}
|
||||
hls.attachMedia(v);
|
||||
try { postEvent({type: "play-probe", jsv: JSV, step: "attach-ok"}); } catch {}
|
||||
}
|
||||
currentEp = {ep_id, ep_no, v};
|
||||
lastSavedPos = 0;
|
||||
|
||||
Reference in new issue
Block a user