diff --git a/src/client.js b/src/client.js index 343b3f2b3..5e224a5bf 100644 --- a/src/client.js +++ b/src/client.js @@ -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; diff --git a/src/matrix.ts b/src/matrix.ts index 82a137176..fca83f209 100644 --- a/src/matrix.ts +++ b/src/matrix.ts @@ -142,6 +142,7 @@ export interface ICreateClientOpts { unstableClientRelationAggregation?: boolean; verificationMethods?: Array; forceTURN?: boolean; + iceCandidatePoolSize: number, supportsCallTransfer?: boolean, fallbackICEServerAllowed?: boolean; cryptoCallbacks?: ICryptoCallbacks; diff --git a/src/webrtc/call.ts b/src/webrtc/call.ts index 47c55cc36..19437f099 100644 --- a/src/webrtc/call.ts +++ b/src/webrtc/call.ts @@ -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.