1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-09-01 21:21:58 +03:00

Use TURN servers when placing/receiving calls.

This commit is contained in:
Kegan Dougal
2015-07-17 13:36:58 +01:00
parent 1232f6ce3c
commit 8727dd1e34
2 changed files with 28 additions and 9 deletions

View File

@@ -25,9 +25,12 @@ function MatrixCall(opts) {
this.webRtc = opts.webRtc;
this.URL = opts.URL;
// Array of Objects with urls, username, credential keys
this.turnServers = opts.turnServers || [{
urls: [MatrixCall.FALLBACK_STUN_SERVER]
}];
this.turnServers = opts.turnServers || [];
if (this.turnServers.length === 0) {
this.turnServers.push({
urls: [MatrixCall.FALLBACK_STUN_SERVER]
});
};
utils.forEach(this.turnServers, function(server) {
utils.checkObjectHasKeys(server, ["urls"]);
});
@@ -899,7 +902,8 @@ module.exports.createNewMatrixCall = function(client, roomId) {
webRtc: webRtc,
client: client,
URL: w.URL,
roomId: roomId
roomId: roomId,
turnServers: client.getTurnServers()
};
return new MatrixCall(opts);
};