set array of turnservers

This commit is contained in:
Matthew Hodgson 2022-09-26 01:07:24 +01:00
parent eab87e5157
commit 3d7852a469
2 changed files with 3 additions and 3 deletions

View File

@ -562,11 +562,11 @@ export class Session {
async _updateTurnServers() {
const turnServerData = await this._hsApi.getTurnServer().response();
this._callHandler.setTurnServers({
this._callHandler.setTurnServers([{
urls: turnServerData.uris,
username: turnServerData.username,
credential: turnServerData.password,
});
}]);
if (turnServerData.ttl > 0) {
setTimeout(this._updateTurnServers, turnServerData.ttl * 1000);
}

View File

@ -75,7 +75,7 @@ export class CallHandler implements RoomStateHandler {
this._loadCallEntries(callEntries, txn);
}
async setTurnServers(turnServers: RTCIceServer) {
async setTurnServers(turnServers: RTCIceServer[]) {
this.options.turnServers = turnServers;
this.groupCallOptions.turnServers = turnServers;
// TODO: we should update any ongoing peerconnections if the TURN server details have changed