Skip to content

Commit 04fc617

Browse files
authored
perf: increase iceCandidatePoolSize to 2 to improve connection time (#158)
1 parent e2ba5f7 commit 04fc617

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/modules/StreamingClient.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import {
2424

2525
const SUCCESS_METRIC_POLLING_TIMEOUT_MS = 15000; // After this time we will stop polling for the first frame and consider the session a failure.
2626
const STATS_COLLECTION_INTERVAL_MS = 5000;
27+
const ICE_CANDIDATE_POOL_SIZE = 2; // Optimisation to speed up connection time
2728

2829
export class StreamingClient {
2930
private publicEventEmitter: PublicEventEmitter;
@@ -340,6 +341,7 @@ export class StreamingClient {
340341
private async initPeerConnection() {
341342
this.peerConnection = new RTCPeerConnection({
342343
iceServers: this.iceServers,
344+
iceCandidatePoolSize: ICE_CANDIDATE_POOL_SIZE,
343345
});
344346
// set event handlers
345347
this.peerConnection.onicecandidate = this.onIceCandidate.bind(this);

0 commit comments

Comments
 (0)