From 2909223deb529b98f4cbec214ad881e7b9566224 Mon Sep 17 00:00:00 2001 From: aler9 <46489434+aler9@users.noreply.github.com> Date: Wed, 30 Oct 2024 20:57:45 +0100 Subject: [PATCH] webrtc: fix using JavaScript classes from outside the server --- internal/servers/webrtc/publisher.js | 2 +- internal/servers/webrtc/reader.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/servers/webrtc/publisher.js b/internal/servers/webrtc/publisher.js index bc8a703df7b..33d0a2351e5 100644 --- a/internal/servers/webrtc/publisher.js +++ b/internal/servers/webrtc/publisher.js @@ -304,7 +304,7 @@ throw new Error(`bad status code ${res.status}`); } - this.sessionUrl = new URL(res.headers.get('location'), window.location.href).toString(); + this.sessionUrl = new URL(res.headers.get('location'), this.conf.url).toString(); return res.text(); }); diff --git a/internal/servers/webrtc/reader.js b/internal/servers/webrtc/reader.js index 8bf45cf65c3..bdb41f15dc2 100644 --- a/internal/servers/webrtc/reader.js +++ b/internal/servers/webrtc/reader.js @@ -402,7 +402,7 @@ throw new Error(`bad status code ${res.status}`); } - this.sessionUrl = new URL(res.headers.get('location'), window.location.href).toString(); + this.sessionUrl = new URL(res.headers.get('location'), this.conf.url).toString(); return res.text(); });