From 0a8674b59271421e50a34d70735d17ab69326359 Mon Sep 17 00:00:00 2001 From: yujiaxinwt <1157613664@qq.com> Date: Wed, 25 Oct 2023 09:58:21 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=BF=9E=E7=BB=AD=E6=9D=A5?= =?UTF-8?q?=E5=9B=9E=E5=88=87=E6=8D=A2=E6=B5=8F=E8=A7=88=E5=99=A8=E9=A1=B5?= =?UTF-8?q?=E7=AD=BE=EF=BC=8C=E6=91=84=E5=83=8F=E5=A4=B4=E7=94=BB=E9=9D=A2?= =?UTF-8?q?=E8=8A=B1=E5=B1=8F=E9=97=AE=E9=A2=98=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sdk/src/CameraPlayer.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sdk/src/CameraPlayer.js b/sdk/src/CameraPlayer.js index 9c6ba58..1cf153c 100644 --- a/sdk/src/CameraPlayer.js +++ b/sdk/src/CameraPlayer.js @@ -154,10 +154,12 @@ export default class CameraPlayer { } stopCameraVideo() { - if(this.videoStream) { - this.stopVideo = true; - this.video.pause(); + this.stopVideo = true; + if (this.video.srcObject) { this.video.srcObject.getTracks().forEach(track => track.stop()); + } + this.video.srcObject = null; + if (this.videoStream) { this.videoStream.stop(); } } -- Gitee