dragonflight/services/mam-api
Zac Gaetano d3ad2397fb fix(playout): serve preview m3u8 via /api to bypass the proxy's static cache
Root cause of the persistent black preview, fully isolated: ZAMPP1's nginx
serves the live .m3u8 fresh on every request (no-store works there), but
the PUBLIC reverse proxy (159.112.211.103 -> ZAMPP1) caches the static
.m3u8 by path with a multi-second TTL, ignoring both the origin's no-store
and query params. hls.js reloads the playlist ~every second, always landing
inside that TTL, so it sees the live playlist as never advancing
("live playlist MISSED" forever), never establishes the timeline, and never
loads a fragment -> readyState 0 (black). Proven: rapid reads via ZAMPP1
localhost advance (404->405); the same rapid reads via the public URL are
stuck; query-busting doesn't help (proxy caches by path).

Fix: serve the playlist through GET /api/v1/playout/channels/:id/hls/index.m3u8
instead of the static /media/live path. /api/ is not proxy-cached (the live
status poll already updates fine through it), so hls.js always gets the fresh
live edge. Segment (.ts) lines are rewritten to absolute /media/live/<id>/
URLs so they still load from the static path (immutable; caching them is
correct). ProgramMonitor points hls.js at the /api playlist and sends the
session cookie (xhrSetup withCredentials) since /api is auth-gated.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-31 15:57:41 -04:00
..
src fix(playout): serve preview m3u8 via /api to bypass the proxy's static cache 2026-05-31 15:57:41 -04:00
test fix(mam-api): harden TOTP login flow + tighten Google domain check 2026-05-30 12:52:53 +00:00
.env.example add services/mam-api/.env.example 2026-04-07 21:58:24 -04:00
.gitignore add services/mam-api/.gitignore 2026-04-07 21:58:24 -04:00
Dockerfile feat: SDK deployment UI, proxy encoding global settings, S3 env fallback 2026-05-23 02:58:32 +00:00
package-lock.json fix(mam-api): TRUST_PROXY boot warning + CSRF integration tests + bounded rate-limit map 2026-05-27 15:03:35 -04:00
package.json feat(mam-api,web-ui): Google OAuth (OIDC) sign-in 2026-05-30 02:51:59 +00:00