修改bug

This commit is contained in:
张运江 2025-02-26 15:19:07 +08:00
parent 8018b9745c
commit 91f89edd16
2 changed files with 30 additions and 5 deletions

View File

@ -734,7 +734,7 @@ export default {
let res = await window.tccc.Call.startOutboundCall({phoneNumber: this.phoneNumber, uuid: this.caseId}) let res = await window.tccc.Call.startOutboundCall({phoneNumber: this.phoneNumber, uuid: this.caseId})
this.sessionId = res.data.sessionId this.sessionId = res.data.sessionId
console.log('呼叫成功', res.data) console.log('呼叫成功', res.data)
this.calling = true this.calling = true
if (res.status === 'success') { if (res.status === 'success') {
this.callingSuccess() this.callingSuccess()
@ -756,11 +756,13 @@ export default {
// this.getmediate_record() // this.getmediate_record()
this.$refs.layoutContent.getmediate_record(); this.$refs.layoutContent.getmediate_record();
this.$refs.layoutContent.openRecordDialog(res); this.$refs.layoutContent.openRecordDialog(res);
this.queueList[this.index].status.code = 2 //
} catch (err) { } } catch (err) { }
}, },
// //
async callingFail () { async callingFail () {
try { try {
this.queueList[this.index].status.code = 2 //
// let res = await api.callingFail({caseId: this.caseId,contactId: this.contactId,callingSessionId:this.sessionId}) // let res = await api.callingFail({caseId: this.caseId,contactId: this.contactId,callingSessionId:this.sessionId})
} catch (err) { } } catch (err) { }
}, },
@ -782,6 +784,7 @@ export default {
// //
nextCall() { nextCall() {
console.log('自动拨打下一个会话') console.log('自动拨打下一个会话')
console.log('this.queue',this.queue, 'this.isPause', this.isPause)
if (!this.queue) return if (!this.queue) return
if (this.isPause) { if (this.isPause) {
this.isPause = false this.isPause = false

View File

@ -214,8 +214,6 @@ export default {
// //
handleEnterRoom() { handleEnterRoom() {
this.enterRoom(); this.enterRoom();
this.handleStartLocalAudio();
this.handleStartLocalVideo();
}, },
async enterRoom() { async enterRoom() {
console.log({ console.log({
@ -234,6 +232,9 @@ export default {
}); });
this.installEventHandlers(); this.installEventHandlers();
this.startGetAudioLevel(); this.startGetAudioLevel();
this.handleStartLocalAudio();
this.handleStartLocalVideo();
}catch (e) { }catch (e) {
console.log('视频云初始化报错!', e) console.log('视频云初始化报错!', e)
throw e; throw e;
@ -241,7 +242,7 @@ export default {
}, },
// //
async handleStartLocalAudio() { async handleStartLocalAudio() {
if (this.micStatus) { if (this.micStatus) {
return; return;
@ -312,10 +313,31 @@ export default {
} }
await this.trtc.stopLocalAudio();// await this.trtc.stopLocalAudio();//
await this.trtc.stopLocalVideo();// await this.trtc.stopLocalVideo();//
this.trtc = null; this.trtc = null;
// window.location.reload();
// await this.trtc.stopScreenShare();// // 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() { startGetAudioLevel() {
this.trtc.on(TRTC.EVENT.AUDIO_VOLUME, (event) => { this.trtc.on(TRTC.EVENT.AUDIO_VOLUME, (event) => {