From 2a2c192562aea83dced7cd52dd8abd27a3784457 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Thu, 11 May 2023 10:13:04 -0400 Subject: [PATCH] Add urlToJanus function to Server class --- web/js/Server.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/web/js/Server.js b/web/js/Server.js index dcd3714b4..526c050a4 100644 --- a/web/js/Server.js +++ b/web/js/Server.js @@ -54,6 +54,13 @@ var Server = function() { const url = this.urlToApi() + (arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''); return fetch(url + '?' + auth_relay + (arguments.length > 1 && arguments[1] !== undefined ? '&'+arguments[1] : '')); } + }, + { + key: 'urlToJanus', + value: function urlToJanus() { + const port = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; + return (location.protocol=='https:'? 'https:' : this.Protocol+':') + '//' + this.Hostname + '/janus'; + } } ]);