From fb813d279c331fb349832dc41ed1fc922842f120 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Wed, 21 Aug 2024 14:58:19 +0800 Subject: [PATCH] bugfix --- bricks/rtc.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/bricks/rtc.js b/bricks/rtc.js index 437bfc4..9f78361 100644 --- a/bricks/rtc.js +++ b/bricks/rtc.js @@ -196,6 +196,16 @@ bricks.RTCClient = class extends bricks.VBox { })); } this.peer_info = null; + if (this.pc.getLocalStreams().length > 0) { + for (let stream of this.pc.getLocalStreams()) { + if (stream.getTracks) { + for (let track of stream.getTracks()) { + track.stop(); + } + } + } + } + this.localVideo.get_stream().getTracks().forEach(track => track.stop()); } call_rejected(peer_info){