diff --git a/addons/gst-web/src/app.js b/addons/gst-web/src/app.js index cfdfdbc9..e98b29a3 100644 --- a/addons/gst-web/src/app.js +++ b/addons/gst-web/src/app.js @@ -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.