Skip to content

Commit

Permalink
Fix issues with relative path
Browse files Browse the repository at this point in the history
  • Loading branch information
ehfd authored Sep 21, 2024
1 parent 5d6b8c5 commit 4550c88
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions addons/gst-web/src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -369,10 +369,12 @@ if (audioElement === null) {

// WebRTC entrypoint, connect to the signalling server
/*global WebRTCDemoSignalling, WebRTCDemo*/
var pathname = window.location.pathname;
pathname = pathname.slice(0, pathname.lastIndexOf("/") + 1);
var protocol = (location.protocol == "http:" ? "ws://" : "wss://");
var signalling = new WebRTCDemoSignalling(new URL(protocol + window.location.host + "/" + app.appName + "/signalling/"));
var signalling = new WebRTCDemoSignalling(new URL(protocol + window.location.host + pathname + app.appName + "/signalling/"));
var webrtc = new WebRTCDemo(signalling, videoElement, 1);
var audio_signalling = new WebRTCDemoSignalling(new URL(protocol + window.location.host + "/" + app.appName + "/signalling/"));
var audio_signalling = new WebRTCDemoSignalling(new URL(protocol + window.location.host + pathname + app.appName + "/signalling/"));
var audio_webrtc = new WebRTCDemo(audio_signalling, audioElement, 3);

// Function to add timestamp to logs.
Expand Down

0 comments on commit 4550c88

Please sign in to comment.