修改bug
This commit is contained in:
parent
8018b9745c
commit
91f89edd16
@ -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
|
||||||
|
|||||||
@ -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) => {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user