From 91f89edd16722e4527ec4ab1ebe4897aed0a6538 Mon Sep 17 00:00:00 2001 From: tangchengming <445785772@qq.com> Date: Wed, 26 Feb 2025 15:19:07 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/MediationRoom.vue | 5 +++- .../mediation-page/components/VideoRoom.vue | 30 ++++++++++++++++--- 2 files changed, 30 insertions(+), 5 deletions(-) diff --git a/src/pages/mediation-page/components/MediationRoom.vue b/src/pages/mediation-page/components/MediationRoom.vue index da1e793..713fa1e 100644 --- a/src/pages/mediation-page/components/MediationRoom.vue +++ b/src/pages/mediation-page/components/MediationRoom.vue @@ -734,7 +734,7 @@ export default { let res = await window.tccc.Call.startOutboundCall({phoneNumber: this.phoneNumber, uuid: this.caseId}) this.sessionId = res.data.sessionId console.log('呼叫成功', res.data) - + this.calling = true if (res.status === 'success') { this.callingSuccess() @@ -756,11 +756,13 @@ export default { // this.getmediate_record() this.$refs.layoutContent.getmediate_record(); this.$refs.layoutContent.openRecordDialog(res); + this.queueList[this.index].status.code = 2 // 已拨打 } catch (err) { } }, // 呼叫失败 async callingFail () { try { + this.queueList[this.index].status.code = 2 // 已拨打 // let res = await api.callingFail({caseId: this.caseId,contactId: this.contactId,callingSessionId:this.sessionId}) } catch (err) { } }, @@ -782,6 +784,7 @@ export default { // 自动拨打下一个会话 nextCall() { console.log('自动拨打下一个会话') + console.log('this.queue:',this.queue, 'this.isPause:', this.isPause) if (!this.queue) return if (this.isPause) { this.isPause = false diff --git a/src/pages/mediation-page/components/VideoRoom.vue b/src/pages/mediation-page/components/VideoRoom.vue index 70b2d0f..6124909 100644 --- a/src/pages/mediation-page/components/VideoRoom.vue +++ b/src/pages/mediation-page/components/VideoRoom.vue @@ -214,8 +214,6 @@ export default { // 获取进入房间的参数 handleEnterRoom() { this.enterRoom(); - this.handleStartLocalAudio(); - this.handleStartLocalVideo(); }, async enterRoom() { console.log({ @@ -234,6 +232,9 @@ export default { }); this.installEventHandlers(); this.startGetAudioLevel(); + + this.handleStartLocalAudio(); + this.handleStartLocalVideo(); }catch (e) { console.log('视频云初始化报错!', e) throw e; @@ -241,7 +242,7 @@ export default { }, - // 本地音频 + // 开启本地音频的采集和发布 async handleStartLocalAudio() { if (this.micStatus) { return; @@ -312,10 +313,31 @@ export default { } await this.trtc.stopLocalAudio();// 停止本地麦克风的采集及发布 await this.trtc.stopLocalVideo();// 停止本地摄像头的采集、预览及发布 + this.trtc = null; + // window.location.reload(); // await this.trtc.stopScreenShare();// 停止屏幕分享 }, - + // 停止摄像头预览 + stopCamera() { + if (navigator.mediaDevices.getUserMedia) { + console.log('获取摄像头',navigator.mediaDevices.getUserMedia) + navigator.mediaDevices.getUserMedia({ video: true }) + .then(stream => { + console.log('获取摄像头-stream',stream) + if (stream) { + const tracks = stream.getTracks(); + console.log('获取摄像头-tracks',tracks) + tracks.forEach(track => track.stop()); + } + }) + .catch(error => { + console.error("Error accessing the camera.", error); + }); + } else { + console.error("getUserMedia not supported on your browser."); + } + }, // 音量 startGetAudioLevel() { this.trtc.on(TRTC.EVENT.AUDIO_VOLUME, (event) => { From b222fcd0dc9cab54e50bc0b4f41fde2ba789ac18 Mon Sep 17 00:00:00 2001 From: liuxi <357439530@qq.com> Date: Wed, 26 Feb 2025 15:33:19 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E7=AD=BE=E5=AD=97UI=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/mediation-page/components/cassWrit.vue | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/pages/mediation-page/components/cassWrit.vue b/src/pages/mediation-page/components/cassWrit.vue index 4f0d102..a9d3032 100644 --- a/src/pages/mediation-page/components/cassWrit.vue +++ b/src/pages/mediation-page/components/cassWrit.vue @@ -58,10 +58,13 @@ {{item.handleBy}} {{ $util.formatDate(item.handleTime, 'YYYY-MM-DD HH:mm:ss')}}