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'; + } } ]);