From 2b1d0ca26e7a1e37661213d9f699d136de3014ff Mon Sep 17 00:00:00 2001 From: thePR0M3TH3AN <53631862+PR0M3TH3AN@users.noreply.github.com> Date: Sat, 27 Sep 2025 12:43:47 -0400 Subject: [PATCH] Verify CDN playback before marking healthy --- js/app.js | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/js/app.js b/js/app.js index b25a7562..decabe6b 100644 --- a/js/app.js +++ b/js/app.js @@ -4561,8 +4561,30 @@ class bitvidApp { return { outcome: "opaque" }; } + if (!response.ok) { + const fallback = await this.probeUrlWithVideoElement(trimmed); + if (fallback && fallback.outcome) { + return fallback; + } + return { + outcome: "bad", + status: response.status, + }; + } + + const playbackCheck = await this.probeUrlWithVideoElement(trimmed); + if (playbackCheck && playbackCheck.outcome) { + if (playbackCheck.outcome === "ok") { + return { + ...playbackCheck, + status: response.status, + }; + } + return playbackCheck; + } + return { - outcome: response.ok ? "ok" : "bad", + outcome: "ok", status: response.status, }; }