From 57d85508dae69e36e4e6bd1fccf97017cec2d04a Mon Sep 17 00:00:00 2001 From: "xie.bx" Date: Fri, 25 Nov 2022 16:49:04 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=86=E9=A2=91=E8=81=8A=E5=A4=A9=E5=8A=9F?= =?UTF-8?q?=E8=83=BD-=E5=BC=80=E5=8F=91=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- im-ui/src/components/chat/ChatPrivateVideo.vue | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/im-ui/src/components/chat/ChatPrivateVideo.vue b/im-ui/src/components/chat/ChatPrivateVideo.vue index c63f6ad..7fc652d 100644 --- a/im-ui/src/components/chat/ChatPrivateVideo.vue +++ b/im-ui/src/components/chat/ChatPrivateVideo.vue @@ -48,7 +48,11 @@ state: 'NOT_CONNECTED', candidates: [], configuration: { - + iceServers: [{ + 'urls': 'turn:www.boxim.online:3478', + 'credential': "admin123", + 'username': "admin" + }] } } }, @@ -134,6 +138,8 @@ }, handleMessage(msg) { if (msg.type == this.$enums.MESSAGE_TYPE.RTC_ACCEPT) { + console.log("接收answer") + console.log(msg.content) this.peerConnection.setRemoteDescription(new RTCSessionDescription(JSON.parse(msg.content))); // 关闭等待提示 this.loading = false; @@ -170,6 +176,8 @@ call() { this.peerConnection.createOffer((offer) => { this.peerConnection.setLocalDescription(offer); + console.log("发送offer") + console.log(offer) this.$http({ url: `/webrtc/private/call?uid=${this.friend.id}`, method: 'post', @@ -185,8 +193,12 @@ }, accept(offer) { + console.log("接收到offer") + console.log(offer) this.peerConnection.setRemoteDescription(new RTCSessionDescription(offer)); this.peerConnection.createAnswer((answer) => { + console.log("发送answer") + console.log(answer) this.peerConnection.setLocalDescription(answer); this.$http({ url: `/webrtc/private/accept?uid=${this.friend.id}`,