mirror of
https://github.com/Dispatcharr/Dispatcharr.git
synced 2026-07-17 16:50:53 +00:00
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
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:
parent
344ff78c79
commit
1d41433ddc
1 changed files with 8 additions and 1 deletions
|
|
@ -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,
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue