Add urlToJanus function to Server class

This commit is contained in:
Isaac Connor
2023-05-11 10:13:04 -04:00
parent 8676da6ead
commit 2a2c192562

View File

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