1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-25 05:23:13 +03:00

Add option to set ice candidate pool size

This commit is contained in:
David Baker
2021-02-16 15:47:48 +00:00
parent c82bc35202
commit 61e19c30cb
3 changed files with 8 additions and 0 deletions

View File

@@ -180,6 +180,11 @@ function keyFromRecoverySession(session, decryptionKey) {
* @param {boolean} [opts.forceTURN]
* Optional. Whether relaying calls through a TURN server should be forced.
*
* * @param {boolean} [opts.iceCandidatePoolSize]
* Optional. Up to this many ICE candidates will be gathered when an incoming call arrives.
* Gathering does not send data to the caller, but will communicate with the configured TURN
* server. Default 0.
*
* @param {boolean} [opts.supportsCallTransfer]
* Optional. True to advertise support for call transfers to other parties on Matrix calls.
*
@@ -367,6 +372,7 @@ export function MatrixClient(opts) {
this._cryptoCallbacks = opts.cryptoCallbacks || {};
this._forceTURN = opts.forceTURN || false;
this._iceCandidatePoolSize = opts.iceCandidatePoolSize === undefined ? 0 : opts.iceCandidatePoolSize;
this._supportsCallTransfer = opts.supportsCallTransfer || false;
this._fallbackICEServerAllowed = opts.fallbackICEServerAllowed || false;

View File

@@ -142,6 +142,7 @@ export interface ICreateClientOpts {
unstableClientRelationAggregation?: boolean;
verificationMethods?: Array<any>;
forceTURN?: boolean;
iceCandidatePoolSize: number,
supportsCallTransfer?: boolean,
fallbackICEServerAllowed?: boolean;
cryptoCallbacks?: ICryptoCallbacks;

View File

@@ -1686,6 +1686,7 @@ export class MatrixCall extends EventEmitter {
const pc = new window.RTCPeerConnection({
iceTransportPolicy: this.forceTURN ? 'relay' : undefined,
iceServers: this.turnServers,
iceCandidatePoolSize: this.client._iceCandidatePoolSize,
});
// 'connectionstatechange' would be better, but firefox doesn't implement that.