From 9df6b3c33d9ba4ceb8ccd4fa727a99f69fddee26 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Sat, 12 Oct 2024 18:02:02 +0800 Subject: [PATCH] bugfix --- bricks/rtc.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bricks/rtc.js b/bricks/rtc.js index 62b4626..e5114f7 100644 --- a/bricks/rtc.js +++ b/bricks/rtc.js @@ -454,7 +454,7 @@ bricks.RTCP2PConnect = class { receiver.track.stop(); } }); - video.srcObject.getTracks().forEach(track => track.stop()); + video.get_stream().getTracks().forEach(track => track.stop()); var dc = this.peers[peer.id].dc; if (dc){ dc.close(); @@ -463,7 +463,8 @@ bricks.RTCP2PConnect = class { delete self.peers[peer.id]; var keys = Object.keys(self.peers); if (keys.length == 0){ - this.localVideo.srcObject.getTracks().forEach(track => track.stop()); + this.localVideo.get_stream() + .getTracks().forEach(track => track.stop()); this.local_stream.getTracks().forEach(track => track.stop()); this.local_screan.getTracks().forEach(track => track.stop()); }