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;
|
||||
|
||||
+2
-2
@@ -6,7 +6,7 @@
|
||||
<title>ani-web</title>
|
||||
<link rel="icon" href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Crect width='64' height='64' rx='14' fill='%23f97316'/%3E%3Ctext x='32' y='45' font-family='sans-serif' font-size='42' font-weight='700' text-anchor='middle' fill='%230e0f13'%3Ea%3C/text%3E%3C/svg%3E">
|
||||
|
||||
<link rel="stylesheet" href="style.css?v=11">
|
||||
<link rel="stylesheet" href="style.css?v=12">
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
@@ -30,6 +30,6 @@
|
||||
max-age=300 in browser AND possibly in your HTTPS proxy, and a stale
|
||||
copy is exactly how users keep seeing an old UI after a deploy -->
|
||||
<script src="hls.min.js"></script>
|
||||
<script src="app.js?v=11"></script>
|
||||
<script src="app.js?v=12"></script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in new issue
Block a user