Skip to content

Commit

Permalink
Merge pull request #3147 from matrix-org/dbkr/stop_ice_timer_on_termi…
Browse files Browse the repository at this point in the history
…nate

Stop the ICE disconnected timer on call terminate
  • Loading branch information
dbkr authored Feb 13, 2023
2 parents c67325b + f346fcb commit abc9c9d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/webrtc/call.ts
Original file line number Diff line number Diff line change
@@ -2174,6 +2174,7 @@ export class MatrixCall extends TypedEventEmitter<CallEvent, CallEventHandlerMap
// chrome doesn't implement any of the 'onstarted' events yet
if (["connected", "completed"].includes(this.peerConn?.iceConnectionState ?? "")) {
clearTimeout(this.iceDisconnectedTimeout);
this.iceDisconnectedTimeout = undefined;
this.state = CallState.Connected;

if (!this.callLengthInterval && !this.callStartTime) {
@@ -2546,6 +2547,10 @@ export class MatrixCall extends TypedEventEmitter<CallEvent, CallEventHandlerMap
clearTimeout(this.inviteTimeout);
this.inviteTimeout = undefined;
}
if (this.iceDisconnectedTimeout !== undefined) {
clearTimeout(this.iceDisconnectedTimeout);
this.iceDisconnectedTimeout = undefined;
}
if (this.callLengthInterval) {
clearInterval(this.callLengthInterval);
this.callLengthInterval = undefined;

0 comments on commit abc9c9d

Please sign in to comment.