You've already forked matrix-js-sdk
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:
@@ -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);
|
||||
};
|
||||
|
Reference in New Issue
Block a user