Fix: Ensure absolute URL is used for stream in FloatingVideo component to resolve relative URLs in WorkerGlobalScope.
Some checks failed
CI Pipeline / prepare (push) Waiting to run
CI Pipeline / docker (amd64, ubuntu-24.04) (push) Blocked by required conditions
CI Pipeline / docker (arm64, ubuntu-24.04-arm) (push) Blocked by required conditions
CI Pipeline / create-manifest (push) Blocked by required conditions
Build and Push Multi-Arch Docker Image / build-and-push (push) Waiting to run
Frontend Tests / test (push) Has been cancelled

This commit is contained in:
SergeantPanda 2026-03-31 10:35:17 -05:00
parent 344ff78c79
commit 1d41433ddc

View file

@ -313,10 +313,17 @@ export default function FloatingVideo() {
return;
}
// mpegts.js workers run in WorkerGlobalScope where relative URLs are
// not resolved against the page origin. Always pass an absolute URL.
const absoluteStreamUrl =
streamUrl.startsWith('/') && typeof window !== 'undefined'
? `${window.location.origin}${streamUrl}`
: streamUrl;
const player = mpegts.createPlayer(
{
type: 'mpegts',
url: streamUrl,
url: absoluteStreamUrl,
isLive: true,
cors: true,
},