From dd88273b7dd5eb9126e827c219ea9220613eee3c Mon Sep 17 00:00:00 2001 From: blue <825657193@qq.com> Date: Wed, 26 Jun 2024 23:24:06 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=91=BC=E5=8F=AB=E6=96=B9=E5=A6=82?= =?UTF-8?q?=E6=9E=9C=E6=B2=A1=E6=9C=89=E6=91=84=E5=83=8F=E5=A4=B4=EF=BC=8C?= =?UTF-8?q?=E4=B8=8D=E5=85=81=E8=AE=B8=E5=8F=91=E8=B5=B7=E5=91=BC=E5=8F=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- im-ui/src/components/rtc/RtcPrivateVideo.vue | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/im-ui/src/components/rtc/RtcPrivateVideo.vue b/im-ui/src/components/rtc/RtcPrivateVideo.vue index 0c63a72..eebdc73 100644 --- a/im-ui/src/components/rtc/RtcPrivateVideo.vue +++ b/im-ui/src/components/rtc/RtcPrivateVideo.vue @@ -114,7 +114,7 @@ // 启动心跳 this.startHeartBeat(); // 打开摄像头 - this.openStream().finally(() => { + this.openStream().then(() => { this.webrtc.setStream(this.localStream); this.webrtc.createOffer().then((offer) => { // 发起呼叫 @@ -127,6 +127,9 @@ this.close(); }) }) + }).catch(()=>{ + // 呼叫方必须能打开摄像头,否则无法正常建立连接 + this.close(); }) }, onAccept() {