From 973de2db558e055983d9f1df180449f967670a38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0imon=20Brandner?= Date: Sat, 24 Apr 2021 12:56:28 +0200 Subject: [PATCH] stopAllMedia() before deleteAllFeeds() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Šimon Brandner --- src/webrtc/call.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/webrtc/call.ts b/src/webrtc/call.ts index 247aa0134..12cd0e99b 100644 --- a/src/webrtc/call.ts +++ b/src/webrtc/call.ts @@ -1466,12 +1466,13 @@ export class MatrixCall extends EventEmitter { this.inviteTimeout = null; } + // Order is important here: first we stopAllMedia() and only then we can deleteAllFeeds() + this.stopAllMedia(); this.deleteAllFeeds(); this.hangupParty = hangupParty; this.hangupReason = hangupReason; this.setState(CallState.Ended); - this.stopAllMedia(); if (this.peerConn && this.peerConn.signalingState !== 'closed') { this.peerConn.close(); }