语音通话展示

This commit is contained in:
2022-02-21 13:24:52 +08:00
parent f4b06bbf01
commit 31ff366457
4 changed files with 25 additions and 11 deletions

View File

@@ -73,7 +73,9 @@
// 关闭麦克风
micOff: false,
// 关闭扬声器
volumeOff: false
volumeOff: false,
// 通话时长
duration: 0
}
},
onLoad(e) {
@@ -84,7 +86,7 @@
// 进入页面开启外呼
if (this.isCall) {
CallLib.startSingleCall(this.targetId, this.mediaType, '');
if (this.mediaType == 1) {
if (this.mediaType == '1') {
const session = CallLib.getCurrentCallSession()
setTimeout(() => {
CallLib.setVideoView(session.mine.userId, this.$refs.bigVideoView.ref, 0, false)
@@ -136,8 +138,11 @@
const messageContent = {
objectName: 'RC:InfoNtf',
userInfo: this.$store.getters.sender,
message: String(this.mediaType),
extra: '这里传接通和时长信息',
message: JSON.stringify({
mediaType: this.mediaType,
connected: this.connected,
duration: this.duration
})
}
const sentTime = 0 // 消息的发送时间
IMLib.insertOutgoingMessage(conversationType, targetId, sentStatus, messageContent, sentTime,
@@ -175,7 +180,7 @@
// 设置链接状态
this.connected = true
// 视频通话,才开摄像头
if (this.mediaType == 1) {
if (this.mediaType == '1') {
const session = CallLib.getCurrentCallSession()
setTimeout(() => {
CallLib.setVideoView(session.targetId, this.$refs.bigVideoView.ref, 0, false)