优化音视频通话

This commit is contained in:
cc
2026-02-06 17:56:44 +08:00
parent 3389a8eaa9
commit 946cff6c52
5 changed files with 208 additions and 162 deletions

View File

@@ -361,23 +361,8 @@
)
currentConversationID.value = conversationID
}
// #ifdef APP-PLUS
CallLib.init({})
CallLib.onCallReceived(res => {
console.log(
'Engine:OnCallReceived=>' + '监听通话呼入, 目标id=>',
res.data
)
if (res.data.targetId) {
navigateTo('/pages/room/incom', {
type: res.data.extra,
userID: res.data.targetId
})
}
})
// #endif
</script>
<style scoped lang="scss" src="./style/index.scss"></style>

View File

@@ -6,6 +6,11 @@
import { computed, ref } from 'vue'
import { type IConversationModel } from '@tencentcloud/chat-uikit-engine-lite'
import { navigateTo } from '../../../../../utils/router'
import TUIChatEngine, {
TUIConversationService,
TUIFriendService,
TUIChatService
} from '@tencentcloud/chat-uikit-engine-lite'
const props = withDefaults(
defineProps<{
@@ -39,11 +44,34 @@
emits('onDialogPopupShowOrHide', true)
if (isType.value) {
navigateTo('/pages/room/incom', {
type: 'call',
userID: data.userID
})
let params ={
to: props.currentConversation.conversationID,
conversationType: TUIChatEngine.TYPES.CONV_C2C,
payload: {
text: "拨打语音"
}
}
console.log('params: ',params);
// TUIChatService.sendTextMessage(params)
navigateTo('/pages/room/incom', {
type: 'call',
userID: data.userID
})
} else {
let params ={
to: props.currentConversation.conversationID,
conversationType: TUIChatEngine.TYPES.CONV_C2C,
payload: {
text: "拨打视频"
}
}
// TUIChatService.sendTextMessage(params)
uni.setStorageSync('room-parameters', {
callType: 'out',
mediaType: 'video',
targetId: data.userID,
callSelect: 'single',
});
navigateTo('/pages/room/room')
}
}