Report client fingerprint on playback failure

showStreamError + playerFail now POST the failing browser's UA,
hls.js presence, MSE support and native-HLS capability to the
events table — a broken mobile browser becomes diagnosable from
the server side instead of by guessing.
This commit is contained in:
jozamudi committed 2026-08-31 19:57:57 +00:00
1 parent 8f6d4dcf77
commit be47ced521
2 files changed
+12 -3

No files matched your search

+10 -1
View File
@@ -70,6 +70,15 @@ function toast(msg, action) {
function showStreamError(msg, retry) {
// visible overlay + Retry — never leave a silent spinner (this is what
// an unplayable browser used to hit: 'HLS not supported' under the overlay)
// + report the client's capabilities so a failing browser is diagnosable
// from server.log instead of by guesswork
try {
postEvent({type: "client-fail", msg,
ua: navigator.userAgent,
hls_lib: typeof window.Hls,
mse: (window.Hls && Hls.isSupported) ? Hls.isSupported() : null,
native_hls: document.createElement("video").canPlayType("application/vnd.apple.mpegurl") || "none"});
} catch {}
playerOverlay("Stream error: " + msg, retry || (() => { if (currentEp) play(currentEp.ep_id, currentEp.ep_no); }), "Retry");
}
@@ -752,7 +761,7 @@ function playerFail(msg) {
// the last 10s save when they leave
savePos();
const { ep_id, ep_no } = currentEp;
postEvent({type: "error", detail: msg, ep_id, ep: ep_no, lang});
postEvent({type: "error", detail: msg, ep_id, ep: ep_no, lang, ua: navigator.userAgent});
playerOverlay("Playback failed: " + msg, () => play(ep_id, ep_no));
}