@tencent-rtc/mcp 1.6.7 → 1.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +25 -0
- package/README.md +53 -39
- package/knowledge/build-index.js +31 -4
- package/knowledge/chunker.js +82 -14
- package/knowledge/chunking-policy.js +100 -0
- package/knowledge/content-loader.js +3 -1
- package/knowledge/frontmatter-meta.js +167 -0
- package/knowledge/path-meta.js +28 -6
- package/knowledge/search/exact-lookup.js +9 -227
- package/knowledge/search/filter-pool.js +17 -26
- package/knowledge/search/framework-fallback.js +22 -0
- package/knowledge/search/intent-router.js +13 -0
- package/knowledge/search/query-normalizer.js +129 -0
- package/knowledge/search/search-core.js +391 -0
- package/knowledge/search/search-knowledge.js +351 -323
- package/knowledge/search/search-message.js +87 -0
- package/knowledge/search/search-pass.js +428 -0
- package/knowledge/search/search-types.js +1 -0
- package/knowledge/search/url-row-scorer.js +258 -0
- package/package.json +1 -1
- package/resource/_schema/feature-aliases.yaml +1 -0
- package/resource/_schema/query-normalization.yaml +9 -0
- package/resource/index/manifest.json +1 -1
- package/resource/integration/callkit/preset/android/integration.md +3 -14
- package/resource/integration/callkit/preset/flutter/integration.md +1 -12
- package/resource/integration/callkit/preset/ios/integration.md +2 -12
- package/resource/integration/callkit/preset/react/integration.md +1 -14
- package/resource/integration/callkit/preset/vue/integration.md +1 -14
- package/resource/integration/chat/preset/android/integration.md +6 -13
- package/resource/integration/chat/preset/flutter/integration.md +1 -8
- package/resource/integration/chat/preset/ios/integration.md +4 -12
- package/resource/integration/chat/preset/react/integration.md +6 -16
- package/resource/integration/chat/preset/vue/integration.md +0 -9
- package/resource/integration/livekit/preset/live/android/live-audience-integration.md +2 -6
- package/resource/integration/livekit/preset/live/android/live-host-integration.md +1 -11
- package/resource/integration/livekit/preset/live/android/live-list-integration.md +2 -6
- package/resource/integration/livekit/preset/live/android/prepare-integration.md +2 -7
- package/resource/integration/livekit/preset/live/ios/live-audience-integration.md +2 -7
- package/resource/integration/livekit/preset/live/ios/live-host-integration.md +1 -13
- package/resource/integration/livekit/preset/live/ios/live-list-integration.md +2 -10
- package/resource/integration/livekit/preset/live/ios/prepare-integration.md +3 -8
- package/resource/integration/livekit/preset/live/vue/live-list-integration.md +0 -4
- package/resource/integration/livekit/preset/live/vue/live-player-desk-integration.md +1 -5
- package/resource/integration/livekit/preset/live/vue/live-player-h5-integration.md +2 -7
- package/resource/integration/livekit/preset/live/vue/live-pusher-integration.md +2 -8
- package/resource/integration/roomkit/preset/vue/integration.md +0 -11
- package/resource/knowledge/callkit/best-practice/callkit-miniprogram/uniapp-shrink.md +60 -0
- package/resource/knowledge/callkit/best-practice/common/call-autoplay-blocked.md +77 -0
- package/resource/knowledge/callkit/best-practice/common/call-message-in-chat.md +78 -0
- package/resource/knowledge/callkit/best-practice/common/call-vs-calls.md +110 -0
- package/resource/knowledge/callkit/best-practice/common/callengine-call-flow.md +123 -0
- package/resource/knowledge/callkit/best-practice/common/callengine-log-level.md +67 -0
- package/resource/knowledge/callkit/best-practice/common/callkit-get-engine-instance.md +81 -0
- package/resource/knowledge/callkit/best-practice/common/callkit-get-roomid.md +78 -0
- package/resource/knowledge/callkit/best-practice/common/callkit-limitations.md +37 -0
- package/resource/knowledge/callkit/best-practice/common/callkit-user-register-and-kicked.md +98 -0
- package/resource/knowledge/callkit/core-sdk/android/answer-call.md +0 -7
- package/resource/knowledge/callkit/core-sdk/android/make-call.md +0 -8
- package/resource/knowledge/callkit/core-sdk/android/offline-push.md +1 -9
- package/resource/knowledge/callkit/core-sdk/flutter/answer-call.md +2 -8
- package/resource/knowledge/callkit/core-sdk/flutter/make-call.md +2 -8
- package/resource/knowledge/callkit/core-sdk/flutter/offline-push.md +1 -16
- package/resource/knowledge/callkit/core-sdk/ios/answer-call.md +0 -8
- package/resource/knowledge/callkit/core-sdk/ios/make-call.md +0 -8
- package/resource/knowledge/callkit/core-sdk/ios/offline-push.md +0 -11
- package/resource/knowledge/callkit/core-sdk/uni-app/answer-call.md +178 -200
- package/resource/knowledge/callkit/core-sdk/uni-app/make-call.md +195 -217
- package/resource/knowledge/callkit/faq/android.md +4 -14
- package/resource/knowledge/callkit/faq/common.md +0 -2
- package/resource/knowledge/callkit/faq/error-code.md +2 -4
- package/resource/knowledge/callkit/faq/ios.md +1 -4
- package/resource/knowledge/callkit/preset/android/api.md +0 -6
- package/resource/knowledge/callkit/preset/ios/api.md +0 -4
- package/resource/knowledge/callkit/preset/react/api.md +3 -4
- package/resource/knowledge/callkit/preset/vue/api.md +3 -4
- package/resource/knowledge/chat/best-practice/common/avchatroom-message-loss-diagnosis.md +65 -0
- package/resource/knowledge/chat/best-practice/common/group-conversation-cleanup-on-system-notice.md +62 -0
- package/resource/knowledge/chat/best-practice/common/image-message-url-lifecycle.md +59 -0
- package/resource/knowledge/chat/best-practice/common/login-repeat-2025-diagnosis.md +61 -0
- package/resource/knowledge/chat/best-practice/common/message-read-report-and-receipt.md +64 -0
- package/resource/knowledge/chat/best-practice/common/message-receive-event.md +65 -0
- package/resource/knowledge/chat/best-practice/common/message-risk-error-and-render.md +65 -0
- package/resource/knowledge/chat/best-practice/common/message-unread-count.md +71 -0
- package/resource/knowledge/chat/best-practice/miniprogram/audio-message-send.md +113 -0
- package/resource/knowledge/chat/best-practice/miniprogram/login-timeout-2801-diagnosis.md +63 -0
- package/resource/knowledge/chat/best-practice/miniprogram/media-upload-fail-diagnosis.md +64 -0
- package/resource/knowledge/chat/best-practice/web/audio-message-send.md +118 -0
- package/resource/knowledge/chat/preset/android/features/chat-setting.md +0 -5
- package/resource/knowledge/chat/preset/android/features/contact-list.md +0 -7
- package/resource/knowledge/chat/preset/android/features/conversation-list.md +0 -6
- package/resource/knowledge/chat/preset/android/features/language.md +0 -8
- package/resource/knowledge/chat/preset/android/features/message-input.md +0 -6
- package/resource/knowledge/chat/preset/android/features/message-list.md +0 -8
- package/resource/knowledge/chat/preset/android/features/search.md +0 -7
- package/resource/knowledge/chat/preset/android/features/theme.md +0 -4
- package/resource/knowledge/chat/preset/android-view/integration.md +0 -6
- package/resource/knowledge/chat/preset/flutter/features/chat-setting.md +0 -4
- package/resource/knowledge/chat/preset/flutter/features/contact-list.md +0 -9
- package/resource/knowledge/chat/preset/flutter/features/conversation-list.md +0 -7
- package/resource/knowledge/chat/preset/flutter/features/language.md +0 -5
- package/resource/knowledge/chat/preset/flutter/features/message-input.md +0 -6
- package/resource/knowledge/chat/preset/flutter/features/message-list.md +0 -8
- package/resource/knowledge/chat/preset/flutter/features/search.md +0 -5
- package/resource/knowledge/chat/preset/flutter/features/theme.md +0 -4
- package/resource/knowledge/chat/preset/ios/features/chat-setting.md +0 -5
- package/resource/knowledge/chat/preset/ios/features/contact-list.md +0 -5
- package/resource/knowledge/chat/preset/ios/features/conversation-list.md +0 -7
- package/resource/knowledge/chat/preset/ios/features/language.md +1 -8
- package/resource/knowledge/chat/preset/ios/features/message-input.md +0 -6
- package/resource/knowledge/chat/preset/ios/features/message-list.md +0 -8
- package/resource/knowledge/chat/preset/ios/features/search.md +0 -5
- package/resource/knowledge/chat/preset/ios/features/theme.md +0 -4
- package/resource/knowledge/chat/preset/ios-uikit/integration.md +0 -6
- package/resource/knowledge/chat/preset/react/features/contact-list.md +0 -23
- package/resource/knowledge/chat/preset/react/features/conversation-actions.md +2 -11
- package/resource/knowledge/chat/preset/react/features/conversation-list.md +4 -26
- package/resource/knowledge/chat/preset/react/features/conversation-preview.md +0 -6
- package/resource/knowledge/chat/preset/react/features/search.md +0 -1
- package/resource/knowledge/chat/preset/react/features/theme.md +0 -1
- package/resource/knowledge/chat/preset/vue/features/contact-list.md +3 -9
- package/resource/knowledge/chat/preset/vue/features/conversation-actions.md +0 -3
- package/resource/knowledge/chat/preset/vue/features/conversation-list.md +2 -13
- package/resource/knowledge/chat/preset/vue/features/conversation-preview.md +2 -3
- package/resource/knowledge/chat/preset/vue/features/conversation-search.md +1 -0
- package/resource/knowledge/chat/preset/vue/features/search.md +4 -3
- package/resource/knowledge/chat/urls/sdk/web.md +1 -1
- package/resource/knowledge/livekit/best-practice/android/voice-room-anchor-start.md +120 -0
- package/resource/knowledge/livekit/best-practice/common/admin-take-seat.md +73 -0
- package/resource/knowledge/livekit/best-practice/common/audience-leave-live.md +81 -0
- package/resource/knowledge/livekit/best-practice/common/voice-room-no-audio-troubleshoot.md +100 -0
- package/resource/knowledge/livekit/best-practice/common/voice-room-seat-list-change.md +65 -0
- package/resource/knowledge/livekit/best-practice/flutter/voice-room-anchor-start.md +122 -0
- package/resource/knowledge/livekit/best-practice/ios/voice-room-anchor-start.md +126 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/android/AudioEffectStore.md +0 -7
- package/resource/knowledge/livekit/core-sdk/api-reference/android/BarrageStore.md +0 -3
- package/resource/knowledge/livekit/core-sdk/api-reference/android/BattleStore.md +0 -3
- package/resource/knowledge/livekit/core-sdk/api-reference/android/CameraView.md +0 -1
- package/resource/knowledge/livekit/core-sdk/api-reference/android/CoGuestStore.md +0 -5
- package/resource/knowledge/livekit/core-sdk/api-reference/android/CoHostStore.md +0 -3
- package/resource/knowledge/livekit/core-sdk/api-reference/android/DeviceStore.md +0 -2
- package/resource/knowledge/livekit/core-sdk/api-reference/android/GiftStore.md +0 -2
- package/resource/knowledge/livekit/core-sdk/api-reference/android/LikeStore.md +0 -2
- package/resource/knowledge/livekit/core-sdk/api-reference/android/LiveAudienceStore.md +0 -2
- package/resource/knowledge/livekit/core-sdk/api-reference/android/LiveCoreView.md +0 -1
- package/resource/knowledge/livekit/core-sdk/api-reference/android/LiveSeatStore.md +0 -2
- package/resource/knowledge/livekit/core-sdk/api-reference/android/LoginStore.md +0 -2
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/AudioEffectStore.md +0 -7
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/BarrageStore.md +0 -3
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/BaseBeautyStore.md +0 -1
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/BattleStore.md +0 -3
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/CoGuestStore.md +0 -5
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/CoHostStore.md +0 -3
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/DeviceStore.md +0 -2
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/GiftStore.md +0 -2
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/LikeStore.md +0 -2
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/LiveAudienceStore.md +0 -2
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/LiveCoreView.md +0 -1
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/LiveSeatStore.md +0 -2
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/LoginStore.md +1 -3
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/AudioEffectStore.md +0 -7
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/BarrageStore.md +0 -3
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/BaseBeautyStore.md +0 -1
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/BattleStore.md +0 -3
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/CoGuestStore.md +0 -5
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/CoHostStore.md +0 -3
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/DeviceStore.md +0 -2
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/GiftStore.md +0 -2
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/LikeStore.md +0 -2
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/LiveAudienceStore.md +0 -2
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/LiveCoreView.md +0 -1
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/LiveSeatStore.md +0 -2
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/LoginStore.md +0 -2
- package/resource/knowledge/livekit/core-sdk/features/android/audience-list.md +2 -2
- package/resource/knowledge/livekit/core-sdk/features/android/audio-effect.md +2 -3
- package/resource/knowledge/livekit/core-sdk/features/android/barrage.md +2 -2
- package/resource/knowledge/livekit/core-sdk/features/android/base-beauty.md +2 -2
- package/resource/knowledge/livekit/core-sdk/features/android/gift.md +2 -7
- package/resource/knowledge/livekit/core-sdk/features/android/live-list.md +3 -4
- package/resource/knowledge/livekit/core-sdk/features/flutter/audience-list.md +2 -2
- package/resource/knowledge/livekit/core-sdk/features/flutter/audio-effect.md +2 -4
- package/resource/knowledge/livekit/core-sdk/features/flutter/barrage.md +2 -2
- package/resource/knowledge/livekit/core-sdk/features/flutter/base-beauty.md +0 -2
- package/resource/knowledge/livekit/core-sdk/features/flutter/gift.md +2 -7
- package/resource/knowledge/livekit/core-sdk/features/flutter/live-list.md +3 -2
- package/resource/knowledge/livekit/core-sdk/features/ios/audience-list.md +2 -2
- package/resource/knowledge/livekit/core-sdk/features/ios/audio-effect.md +2 -4
- package/resource/knowledge/livekit/core-sdk/features/ios/barrage.md +2 -2
- package/resource/knowledge/livekit/core-sdk/features/ios/base-beauty.md +2 -2
- package/resource/knowledge/livekit/core-sdk/features/ios/gift.md +2 -7
- package/resource/knowledge/livekit/core-sdk/features/ios/live-list.md +3 -4
- package/resource/knowledge/livekit/core-sdk/live/android/co-guest-interaction.md +0 -3
- package/resource/knowledge/livekit/core-sdk/live/android/host-interaction.md +0 -4
- package/resource/knowledge/livekit/core-sdk/live/android/integration.md +1 -4
- package/resource/knowledge/livekit/core-sdk/live/flutter/co-guest-interaction.md +1 -3
- package/resource/knowledge/livekit/core-sdk/live/flutter/host-interaction.md +0 -1
- package/resource/knowledge/livekit/core-sdk/live/flutter/integration.md +1 -4
- package/resource/knowledge/livekit/core-sdk/live/ios/co-guest-interaction.md +0 -3
- package/resource/knowledge/livekit/core-sdk/live/ios/host-interaction.md +0 -3
- package/resource/knowledge/livekit/core-sdk/live/ios/integration.md +1 -4
- package/resource/knowledge/livekit/core-sdk/voice/android/co-guest-interaction.md +0 -2
- package/resource/knowledge/livekit/core-sdk/voice/android/host-interaction.md +0 -5
- package/resource/knowledge/livekit/core-sdk/voice/android/integration.md +1 -4
- package/resource/knowledge/livekit/core-sdk/voice/flutter/co-guest-interaction.md +1 -4
- package/resource/knowledge/livekit/core-sdk/voice/flutter/integration.md +3 -6
- package/resource/knowledge/livekit/core-sdk/voice/ios/co-guest-interaction.md +0 -2
- package/resource/knowledge/livekit/core-sdk/voice/ios/host-interaction.md +0 -4
- package/resource/knowledge/livekit/core-sdk/voice/ios/integration.md +1 -4
- package/resource/knowledge/livekit/faq/error-code.md +0 -1
- package/resource/knowledge/livekit/preset/live/vue/features/barrage.md +2 -3
- package/resource/knowledge/livekit/preset/live/vue/features/live-audience-list.md +3 -3
- package/resource/knowledge/livekit/preset/live/vue/features/live-view.md +3 -3
- package/resource/knowledge/push/api-reference/android.md +0 -1
- package/resource/knowledge/push/api-reference/harmonyos.md +0 -2
- package/resource/knowledge/push/api-reference/react-native.md +3 -5
- package/resource/knowledge/push/api-reference/uni-app.md +3 -5
- package/resource/knowledge/push/api-reference/unity.md +0 -1
- package/resource/knowledge/push/api-reference/unreal-engine.md +0 -1
- package/resource/knowledge/push/config/android.md +0 -24
- package/resource/knowledge/push/config/harmonyos.md +0 -1
- package/resource/knowledge/push/config/ios.md +0 -3
- package/resource/knowledge/push/config/react-native.md +0 -29
- package/resource/knowledge/push/config/unity.md +1 -24
- package/resource/knowledge/push/config/unreal-engine.md +1 -24
- package/resource/knowledge/push/integration/android.md +0 -14
- package/resource/knowledge/push/integration/flutter.md +0 -19
- package/resource/knowledge/push/integration/harmonyos.md +0 -2
- package/resource/knowledge/push/integration/ios.md +0 -3
- package/resource/knowledge/push/integration/react-native.md +0 -24
- package/resource/knowledge/push/integration/uni-app.md +1 -11
- package/resource/knowledge/push/integration/unity.md +0 -9
- package/resource/knowledge/push/integration/unreal-engine.md +1 -17
- package/resource/knowledge/roomkit/best-practice/common/room-ghost-member.md +70 -0
- package/resource/knowledge/roomkit/best-practice/common/room-limit-and-multi.md +83 -0
- package/resource/knowledge/roomkit/best-practice/common/room-screen-share-preview.md +83 -0
- package/resource/knowledge/roomkit/best-practice/common/room-status-after-all-leave.md +69 -0
- package/resource/knowledge/roomkit/best-practice/vue/room-uikit-vs-atomicx.md +111 -0
- package/resource/knowledge/roomkit/core-sdk/android/call-user-to-room.md +0 -4
- package/resource/knowledge/roomkit/core-sdk/android/room-participant-state.md +0 -4
- package/resource/knowledge/roomkit/core-sdk/android/room-state.md +0 -4
- package/resource/knowledge/roomkit/core-sdk/android/schedule-room.md +1 -5
- package/resource/knowledge/roomkit/core-sdk/ios/call-user-to-room.md +0 -4
- package/resource/knowledge/roomkit/core-sdk/ios/room-participant-state.md +0 -4
- package/resource/knowledge/roomkit/core-sdk/ios/room-state.md +0 -4
- package/resource/knowledge/roomkit/core-sdk/ios/schedule-room.md +1 -5
- package/resource/knowledge/roomkit/core-sdk/vue/call-user-to-room.md +1 -1
- package/resource/knowledge/roomkit/core-sdk/vue/device-state.md +0 -6
- package/resource/knowledge/roomkit/core-sdk/vue/free-beauty-panel.md +0 -9
- package/resource/knowledge/roomkit/core-sdk/vue/room-chat.md +0 -11
- package/resource/knowledge/roomkit/core-sdk/vue/room-participant-state.md +1 -5
- package/resource/knowledge/roomkit/core-sdk/vue/room-state.md +1 -8
- package/resource/knowledge/roomkit/core-sdk/vue/room-view.md +0 -3
- package/resource/knowledge/roomkit/core-sdk/vue/screen-share.md +0 -3
- package/resource/knowledge/roomkit/core-sdk/vue/virtual-background.md +0 -5
- package/resource/knowledge/roomkit/preset/android/integration.md +0 -4
- package/resource/knowledge/roomkit/preset/flutter/integration.md +1 -13
- package/resource/knowledge/roomkit/preset/ios/integration.md +0 -6
- package/resource/knowledge/roomkit/preset/react/integration.md +0 -16
- package/resource/knowledge/rtcengine/web/api.md +1 -8
- package/resource/knowledge/rtcengine/web/faq.md +3 -5
- package/resource/knowledge/rtcengine/web/how_to_integrated_web_sdk.md +0 -6
- package/resource/knowledge/rtcengine/web/plugin/20-advanced-customized-capture-rendering.md +1 -1
- package/resource/knowledge/rtcengine/web/plugin/21-advanced-auto-play-policy.md +1 -1
- package/resource/knowledge/rtcengine/web/plugin/26-advanced-publish-cdn-stream.md +1 -1
- package/resource/knowledge/rtcengine/web/plugin/27-advanced-small-stream.md +1 -1
- package/resource/knowledge/rtcengine/web/plugin/30-advanced-cross-room-link.md +2 -0
- package/resource/knowledge/rtcengine/web/plugin/31-advanced-plugins-overview.md +1 -3
- package/resource/knowledge/rtcengine/web/plugin/34-advanced-proxy.md +2 -4
- package/resource/knowledge/rtcengine/web/plugin/36-advanced-virtual-background.md +0 -4
- package/resource/knowledge/rtcengine/web/plugin/39-advanced-video-decoder.md +1 -1
- package/resource/knowledge/trtc/android/TRTCCloud.md +8 -56
- package/resource/knowledge/trtc/android/TRTCCloudDef.md +6 -7
- package/resource/knowledge/trtc/android/TRTCCloudListener.md +1 -18
- package/resource/knowledge/trtc/android/TXAudioEffectManager.md +0 -14
- package/resource/knowledge/trtc/android/TXDeviceManager.md +0 -1
- package/resource/knowledge/trtc/android/TXLiteAVCode.md +1 -1
- package/resource/knowledge/trtc/c++/ITRTCCloud.md +7 -59
- package/resource/knowledge/trtc/c++/ITXAudioEffectManager.md +0 -14
- package/resource/knowledge/trtc/c++/ITXDeviceManager.md +0 -4
- package/resource/knowledge/trtc/c++/TRTCCloudCallback.md +1 -19
- package/resource/knowledge/trtc/c++/TRTCTypeDef.md +6 -7
- package/resource/knowledge/trtc/c++/TXLiteAVCode.md +1 -1
- package/resource/knowledge/trtc/ios/TRTCCloud.md +9 -60
- package/resource/knowledge/trtc/ios/TRTCCloudDef.md +6 -7
- package/resource/knowledge/trtc/ios/TRTCCloudDelegate.md +1 -19
- package/resource/knowledge/trtc/ios/TXAudioEffectManager.md +0 -13
- package/resource/knowledge/trtc/ios/TXDeviceManager.md +0 -4
- package/resource/knowledge/trtc/ios/TXLiteAVCode.md +1 -1
- package/server.js +27 -22
- package/tools/common/finalize_answer.js +9 -1
- package/tools/common/search_trtc_knowledge.js +3 -1
- package/tools/definitions/finalize_answer_def.js +2 -2
- package/tools/definitions/integration-boundary.js +2 -1
- package/tools/definitions/search_trtc_knowledge_def.js +2 -1
- package/utils/report-cls-client.js +3 -3
- package/utils/report-es-client.js +1 -1
- package/cursor-setting.png +0 -0
- package/mcp-server-prompt.png +0 -0
- package/resource/knowledge/callkit/best-practice/web/callengine-invitation.md +0 -80
- package/resource/knowledge/callkit/best-practice/web/callengine-log-control.md +0 -24
- package/resource/knowledge/callkit/best-practice/web/callkit-call-vs-calls.md +0 -116
- package/resource/knowledge/callkit/preset/react/uikit-api-reference.md +0 -445
- package/resource/knowledge/callkit/preset/vue/uikit-api-reference.md +0 -465
- package/resource/knowledge/chat/best-practice/web/image-message-url-handling.md +0 -16
- package/resource/knowledge/roomkit/core-sdk/flutter/call-user-to-room.md +0 -230
- package/resource/knowledge/roomkit/core-sdk/flutter/room-participant-state.md +0 -797
- package/resource/knowledge/roomkit/core-sdk/flutter/room-state.md +0 -325
- package/resource/knowledge/roomkit/core-sdk/flutter/schedule-room.md +0 -325
|
@@ -1,54 +1,40 @@
|
|
|
1
|
-
|
|
1
|
+
This document helps you quickly build an **app** with calling capabilities using the **AtomicXCore SDK** components **DeviceState**, **CallState**, and the core view component **CallCoreView**.
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
>
|
|
5
|
-
|
|
6
|
-
> 我们为您提供了全新的 AI 集成方式,只需要描述您的需求,即可自动生成集成代码,大幅提升开发效率。
|
|
7
|
-
>
|
|
8
|
-
|
|
9
|
-
> 点击这里,立即体验 AI 集成
|
|
10
|
-
>
|
|
11
|
-
|
|
12
|
-
## 准备工作
|
|
13
|
-
|
|
14
|
-
### 步骤1:开通服务
|
|
3
|
+
## Prerequisites
|
|
15
4
|
|
|
16
|
-
|
|
5
|
+
### Step 1: Activate the service
|
|
17
6
|
|
|
18
|
-
###
|
|
19
|
-
1.
|
|
7
|
+
### Step 2: Import AtomicXCore into your project
|
|
8
|
+
1. **Install the component**: open the [AtomicXCore SDK](https://ext.dcloud.net.cn/plugin) page, click **Download plugin and import into HBuilderX**, select the target project, and click **Confirm**.
|
|
20
9
|
|
|
21
|
-
|
|
10
|
+
You can also download the source code from [GitHub](https://github.com/Tencent-RTC/TUIKit_uni-app) and copy the `App/uni_modules/tuikit-atomic-x` directory into your project's `uni_modules/` folder.
|
|
22
11
|
|
|
23
|
-
2.
|
|
12
|
+
2. **Configure project permissions:** in your application's `manifest.json` file, under the `app-plus > distribute` node, make sure the following required permissions are added:
|
|
24
13
|
|
|
25
|
-
- Android
|
|
14
|
+
- Android platform (`Android` node): make sure the following permissions are included in the `permissions` array:
|
|
26
15
|
|
|
27
16
|
``` json
|
|
28
17
|
"<uses-permission android:name=\"android.permission.RECORD_AUDIO\" />",
|
|
29
18
|
"<uses-permission android:name=\"android.permission.CAMERA\"/>"
|
|
30
19
|
```
|
|
31
|
-
- iOS
|
|
20
|
+
- iOS platform (`iOS` node): make sure the following descriptions are included in the `privacyDescription` object:
|
|
32
21
|
|
|
33
22
|
``` json
|
|
34
|
-
"NSCameraUsageDescription" : "
|
|
35
|
-
"NSMicrophoneUsageDescription" : "
|
|
23
|
+
"NSCameraUsageDescription" : "The app needs access to your camera for calls",
|
|
24
|
+
"NSMicrophoneUsageDescription" : "The app needs access to your microphone for calls"
|
|
36
25
|
```
|
|
37
26
|
|
|
38
|
-
|
|
27
|
+
Add `audio` to the `UIBackgroundModes` array to support background audio playback.
|
|
39
28
|
|
|
40
29
|
``` json
|
|
41
30
|
"UIBackgroundModes" : [ "audio" ]
|
|
42
31
|
```
|
|
43
32
|
|
|
44
|
-
###
|
|
33
|
+
### Step 3: Implement the login logic
|
|
45
34
|
|
|
46
|
-
|
|
35
|
+
Call the [login](https://liteav.sdk.qcloud.com/doc/product/tuikit/atomic-x/uni-app/zh/v1.0/api/index.html#login) method on LoginState in your project to sign in. **This is a mandatory prerequisite for using any feature of** `AtomicXCore`.
|
|
47
36
|
|
|
48
|
-
>
|
|
49
|
-
>
|
|
50
|
-
|
|
51
|
-
> 推荐在您 App 自身的用户账户登录成功后,再调用 LoginState 中的 login 方法,以确保登录业务逻辑的清晰和一致。
|
|
37
|
+
> We recommend calling the `login` method on `LoginState` only after your app's own user account has signed in successfully, so that the login business logic stays clean and consistent.
|
|
52
38
|
>
|
|
53
39
|
|
|
54
40
|
``` typescript
|
|
@@ -58,78 +44,78 @@ const { login } = useLoginState();
|
|
|
58
44
|
|
|
59
45
|
const handleLogin = () => {
|
|
60
46
|
login({
|
|
61
|
-
sdkAppID: 1400000001, //
|
|
62
|
-
userID: "test_001", //
|
|
63
|
-
userSig: "xxxxxxxxxx" //
|
|
47
|
+
sdkAppID: 1400000001, // Replace with your SDKAppID
|
|
48
|
+
userID: "test_001", // Replace with your UserID
|
|
49
|
+
userSig: "xxxxxxxxxx" // Replace with your UserSig
|
|
64
50
|
})
|
|
65
51
|
}
|
|
66
52
|
```
|
|
67
53
|
|
|
68
|
-
|
|
69
|
-
| <strong
|
|
54
|
+
**Login parameters:**
|
|
55
|
+
| <strong>Parameter</strong> | <strong>Type</strong> | <strong>Description</strong> |
|
|
70
56
|
| --- | --- | --- |
|
|
71
|
-
| sdkAppID | number |
|
|
72
|
-
| userID | string |
|
|
73
|
-
| userSig | string |
|
|
57
|
+
| sdkAppID | number | Obtained from the <a href="https://console.cloud.tencent.com/trtc">Console</a>. It is typically a 10-digit integer starting with <code>140</code> or <code>160</code>. |
|
|
58
|
+
| userID | string | The unique ID of the current user. Only letters, digits, hyphens, and underscores are allowed. To avoid multi-endpoint login conflicts, <strong>do not use</strong> simple IDs such as <code>1</code> or <code>123</code>. |
|
|
59
|
+
| userSig | string | The ticket used for Tencent Cloud authentication. Please note:<br>- Development environment: you can use the local <code>GenerateTestUserSig.genTestSig</code> function to generate a userSig, or generate a temporary UserSig with the <a href="https://console.cloud.tencent.com/im/tool-usersig">UserSig helper tool</a>.<br>- Production environment: to prevent key leakage, always generate the UserSig on the server side. See <a href="https://cloud.tencent.com/document/product/647/17275">Server-side UserSig generation</a> for details.<br>For more information, see <a href="https://cloud.tencent.com/document/product/647/17275">How to compute and use UserSig</a>. |
|
|
74
60
|
|
|
75
|
-
##
|
|
61
|
+
## Make your first call
|
|
76
62
|
|
|
77
|
-
###
|
|
63
|
+
### Step 1: Create the call view
|
|
78
64
|
|
|
79
|
-
|
|
80
|
-
1.
|
|
65
|
+
You need to create a call page that is brought to the foreground when a call is initiated. Do the following:
|
|
66
|
+
1. **Create a call page**: create a new page to act as the host page for the call, responsible for the navigation logic triggered by an incoming or outgoing call.
|
|
81
67
|
|
|
82
|
-
2.
|
|
68
|
+
2. **Bind CallCoreView to the call page**: `CallCoreView` is the core view component of the call UI. It automatically listens to **CallState** and renders the video/audio views, and provides UI customization capabilities such as layout switching and avatar/icon configuration.
|
|
83
69
|
|
|
84
70
|
``` html
|
|
85
71
|
<call-core-view style="height: 50px; width: 50px;"></call-core-view>
|
|
86
72
|
```
|
|
87
73
|
|
|
88
|
-
>
|
|
74
|
+
> **Note:**
|
|
89
75
|
>
|
|
90
76
|
|
|
91
|
-
> **CallCoreView
|
|
77
|
+
> **CallCoreView** is a native component and does not need to be **imported** separately in the file. Simply mount it on the page to use it.
|
|
92
78
|
>
|
|
93
79
|
|
|
94
|
-
**CallCoreView
|
|
80
|
+
**CallCoreView features:**
|
|
95
81
|
|
|
96
|
-
|
|
82
|
+
|**Feature**|**Description**|**Reference**|
|
|
97
83
|
|---------|---------|---------|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
84
|
+
|**Set the layout mode**|Freely switch between layout modes. If not set, the layout is auto-selected based on the number of participants.|Switch the layout mode|
|
|
85
|
+
|**Set the avatar**|Customize the avatar for a specific user by passing in the avatar resource path.|Customize the default avatar|
|
|
86
|
+
|**Set the volume indicator icon**|Configure personalized volume indicator icons for different volume levels.|Customize the volume indicator icon|
|
|
87
|
+
|**Set the network indicator icon**|Configure the corresponding network indicator icon based on real-time network quality.|Customize the network indicator icon|
|
|
88
|
+
|**Set the waiting animation for callees**|In multi-party call scenarios, pass in a GIF image path to show an animation for users in the "waiting to answer" state.|Customize the loading animation|
|
|
103
89
|
|
|
104
|
-
###
|
|
90
|
+
### Step 2: Add call control buttons
|
|
105
91
|
|
|
106
|
-
|
|
107
|
-
- **DeviceState
|
|
92
|
+
You can add your own buttons based on the APIs provided by **DeviceState** and **CallState**.
|
|
93
|
+
- **DeviceState features:** microphone (on/off, volume), camera (on/off, switch, quality), screen sharing, and real-time device state listening. It is recommended to bind these methods to your button click events, and refresh the button UI in real time by listening to device state changes.
|
|
108
94
|
|
|
109
|
-
- **CallState
|
|
95
|
+
- **CallState features:** core call control capabilities such as answering, hanging up, and rejecting calls. It is recommended to bind these methods to your button click events, and listen to call state changes to keep the button state in sync with the current call phase.
|
|
110
96
|
|
|
111
|
-
-
|
|
97
|
+
- **Icon assets download:** you can download button icons directly from [GitHub](https://github.com/Tencent-RTC/TUIKit_uni-app/tree/main/App). These icons are designed by our designers specifically for TUICallKit and are free from copyright issues.
|
|
112
98
|
|
|
113
|
-
| <strong
|
|
99
|
+
| <strong>Icons:</strong> | | | | | | | | |
|
|
114
100
|
| --- | --- | --- | --- | --- | --- | --- | --- | --- |
|
|
115
101
|
|
|
116
|
-
|
|
102
|
+
The following example shows how to add a hangup button, a microphone toggle button, and a camera toggle button:
|
|
117
103
|
|
|
118
|
-
1.
|
|
104
|
+
1. **Add the hangup button**: create and add a hangup button. On tap, call [hangup](https://liteav.sdk.qcloud.com/doc/product/tuikit/atomic-x/uni-app/zh/v1.0/api/index.html#hangup) and destroy the view.
|
|
119
105
|
|
|
120
106
|
``` typescript
|
|
121
107
|
<template>
|
|
122
108
|
<view class="btn" @tap="handleHangup">
|
|
123
109
|
<image class="btn-img" :style="[style]" :src="HANGUP_SRC"></image>
|
|
124
110
|
<text class="btn-text" v-if="isShowText">
|
|
125
|
-
|
|
111
|
+
Hang up
|
|
126
112
|
</text>
|
|
127
113
|
</view>
|
|
128
114
|
</template>
|
|
129
115
|
|
|
130
116
|
<script setup lang="ts">
|
|
131
117
|
import { computed } from "vue";
|
|
132
|
-
import HANGUP_SRC from "../../../static/icon/hangup.png"; //
|
|
118
|
+
import HANGUP_SRC from "../../../static/icon/hangup.png"; // Replace with the actual icon path in your project
|
|
133
119
|
import {
|
|
134
120
|
useCallState
|
|
135
121
|
} from '@/uni_modules/tuikit-atomic-x/state/CallState';
|
|
@@ -155,7 +141,7 @@ const handleLogin = () => {
|
|
|
155
141
|
|
|
156
142
|
const handleHangup = () => {
|
|
157
143
|
hangup();
|
|
158
|
-
//
|
|
144
|
+
// Call the hangup API in the click handler and destroy the page
|
|
159
145
|
};
|
|
160
146
|
</script>
|
|
161
147
|
|
|
@@ -180,21 +166,21 @@ const handleLogin = () => {
|
|
|
180
166
|
</style>
|
|
181
167
|
|
|
182
168
|
```
|
|
183
|
-
2.
|
|
169
|
+
2. **Add the microphone toggle button:** create and add a microphone toggle button. On tap, call [openLocalMicrophone](https://liteav.sdk.qcloud.com/doc/product/tuikit/atomic-x/uni-app/zh/v1.0/api/index.html#openLocalMicrophone) or [closeLocalMicrophone](https://liteav.sdk.qcloud.com/doc/product/tuikit/atomic-x/uni-app/zh/v1.0/api/index.html#closeLocalMicrophone), and listen to the microphone state to update the button text in real time.
|
|
184
170
|
|
|
185
171
|
``` typescript
|
|
186
172
|
<template>
|
|
187
173
|
<view class="btn" @tap="handleMic">
|
|
188
174
|
<image class="btn-img" :src="microphoneStatus === DeviceStatus.ON "></image>
|
|
189
175
|
<text class="btn-text">
|
|
190
|
-
{{ microphoneStatus === DeviceStatus.ON ? '
|
|
176
|
+
{{ microphoneStatus === DeviceStatus.ON ? 'Microphone on' : 'Microphone off' }}
|
|
191
177
|
</text>
|
|
192
178
|
</view>
|
|
193
179
|
</template>
|
|
194
180
|
|
|
195
181
|
<script setup lang="ts">
|
|
196
|
-
import MIC_ON_SRC from "../../../static/icon/mic-on.png"; //
|
|
197
|
-
import MIC_OFF_SRC from "../../../static/icon/mic-off.png"; //
|
|
182
|
+
import MIC_ON_SRC from "../../../static/icon/mic-on.png"; // Replace with the actual icon path in your project
|
|
183
|
+
import MIC_OFF_SRC from "../../../static/icon/mic-off.png"; // Replace with the actual icon path in your project
|
|
198
184
|
import {
|
|
199
185
|
useDeviceState,
|
|
200
186
|
DeviceStatus
|
|
@@ -205,7 +191,7 @@ const handleLogin = () => {
|
|
|
205
191
|
closeLocalMicrophone,
|
|
206
192
|
} = useDeviceState()
|
|
207
193
|
|
|
208
|
-
//
|
|
194
|
+
// Toggle the microphone in the click handler
|
|
209
195
|
const handleMic = () => {
|
|
210
196
|
if (microphoneStatus.value === DeviceStatus.ON) {
|
|
211
197
|
closeLocalMicrophone();
|
|
@@ -235,21 +221,21 @@ const handleLogin = () => {
|
|
|
235
221
|
}
|
|
236
222
|
</style>
|
|
237
223
|
```
|
|
238
|
-
3.
|
|
224
|
+
3. **Add the camera toggle button:** create and add a camera toggle button. On tap, call [openLocalCamera](https://liteav.sdk.qcloud.com/doc/product/tuikit/atomic-x/uni-app/zh/v1.0/api/index.html#openLocalCamera) or [closeLocalCamera](https://liteav.sdk.qcloud.com/doc/product/tuikit/atomic-x/uni-app/zh/v1.0/api/index.html#closeLocalCamera), and listen to the camera state to update the button text in real time.
|
|
239
225
|
|
|
240
226
|
``` typescript
|
|
241
227
|
<template>
|
|
242
228
|
<div class="btn" @tap="handleCamera">
|
|
243
229
|
<image class="btn-img" :src="cameraStatus === DeviceStatus.ON "></image>
|
|
244
230
|
<text class="btn-text">
|
|
245
|
-
{{cameraStatus === DeviceStatus.ON ? '
|
|
231
|
+
{{cameraStatus === DeviceStatus.ON ? 'Camera on' : 'Camera off'}}
|
|
246
232
|
</text>
|
|
247
233
|
</div>
|
|
248
234
|
</template>
|
|
249
235
|
|
|
250
236
|
<script setup lang="ts">
|
|
251
|
-
import CAMERA_ON_SRC from "../../../static/icon/camera-on.png"; //
|
|
252
|
-
import CAMERA_OFF_SRC from "../../../static/icon/camera-off.png"; //
|
|
237
|
+
import CAMERA_ON_SRC from "../../../static/icon/camera-on.png"; // Replace with the actual icon path in your project
|
|
238
|
+
import CAMERA_OFF_SRC from "../../../static/icon/camera-off.png"; // Replace with the actual icon path in your project
|
|
253
239
|
import {
|
|
254
240
|
useDeviceState,
|
|
255
241
|
DeviceStatus
|
|
@@ -261,7 +247,7 @@ const handleLogin = () => {
|
|
|
261
247
|
isFrontCamera,
|
|
262
248
|
} = useDeviceState()
|
|
263
249
|
|
|
264
|
-
//
|
|
250
|
+
// Camera button click handler
|
|
265
251
|
const handleCamera = () => {
|
|
266
252
|
if (cameraStatus.value === DeviceStatus.ON) {
|
|
267
253
|
closeLocalCamera()
|
|
@@ -292,14 +278,14 @@ const handleLogin = () => {
|
|
|
292
278
|
</style>
|
|
293
279
|
```
|
|
294
280
|
|
|
295
|
-
###
|
|
281
|
+
### Step 3: Initiate a call
|
|
296
282
|
|
|
297
|
-
|
|
298
|
-
1.
|
|
283
|
+
After the `calls` API succeeds, navigate to the call view. We also recommend enabling the microphone (and camera for video calls) automatically according to the media type for a better call experience. Implement it as follows:
|
|
284
|
+
1. **Initiate a call:** call [calls](https://liteav.sdk.qcloud.com/doc/product/tuikit/atomic-x/uni-app/zh/v1.0/api/index.html#calls) to start a call.
|
|
299
285
|
|
|
300
|
-
2.
|
|
286
|
+
2. **Turn on media devices:** after the call is initiated successfully, turn on the microphone, and for video calls also turn on the camera.
|
|
301
287
|
|
|
302
|
-
3.
|
|
288
|
+
3. **Show the call view:** navigate to the call view once the call is initiated successfully.
|
|
303
289
|
|
|
304
290
|
``` typescript
|
|
305
291
|
<script setup lang="ts">
|
|
@@ -311,46 +297,46 @@ const handleLogin = () => {
|
|
|
311
297
|
const { openLocalCamera, openLocalMicrophone } = useDeviceState();
|
|
312
298
|
|
|
313
299
|
const calleeUserID = ref('');
|
|
314
|
-
const mediaType = ref(1); // 0:
|
|
300
|
+
const mediaType = ref(1); // 0: audio, 1: video
|
|
315
301
|
|
|
316
302
|
const startCall = () => {
|
|
317
303
|
const userID = calleeUserID.value.trim();
|
|
318
304
|
if (!userID) {
|
|
319
|
-
uni.showToast({ icon: 'none', title: '
|
|
305
|
+
uni.showToast({ icon: 'none', title: 'Please enter the callee user ID' });
|
|
320
306
|
return;
|
|
321
307
|
}
|
|
322
308
|
|
|
323
|
-
// 1.
|
|
309
|
+
// 1. Turn on local devices
|
|
324
310
|
if (mediaType.value === 1) {
|
|
325
311
|
openLocalCamera({ isFront: true });
|
|
326
312
|
}
|
|
327
313
|
openLocalMicrophone();
|
|
328
314
|
|
|
329
|
-
// 2.
|
|
315
|
+
// 2. Initiate the call
|
|
330
316
|
calls({
|
|
331
317
|
participantIds: [userID],
|
|
332
318
|
mediaType: mediaType.value,
|
|
333
319
|
success: () => {
|
|
334
|
-
console.log('
|
|
320
|
+
console.log('Call initiated successfully');
|
|
335
321
|
uni.navigateTo({
|
|
336
|
-
url: '/uni_modules/tuikit-atomic-x/pages/call?layoutTemplate=Float' //
|
|
322
|
+
url: '/uni_modules/tuikit-atomic-x/pages/call?layoutTemplate=Float' // Example path; replace with the actual call page path you created in Step 1
|
|
337
323
|
});
|
|
338
324
|
},
|
|
339
325
|
fail: (code: number, message: string) => {
|
|
340
|
-
console.error('
|
|
341
|
-
uni.showToast({ icon: 'none', title:
|
|
326
|
+
console.error('Failed to initiate call:', code, message);
|
|
327
|
+
uni.showToast({ icon: 'none', title: `Call failed: ${message}` });
|
|
342
328
|
}
|
|
343
329
|
});
|
|
344
330
|
};
|
|
345
331
|
</script>
|
|
346
332
|
```
|
|
347
333
|
|
|
348
|
-
###
|
|
334
|
+
### Step 4: End the call
|
|
349
335
|
|
|
350
|
-
|
|
351
|
-
1.
|
|
336
|
+
Whether you call `hangup` or the remote party ends the call, the `onCallEnded` event is triggered. We recommend listening to this event and closing the current view when it fires (i.e., when the call ends). Implement it as follows:
|
|
337
|
+
1. **Listen to the call-ended event**: listen to `onCallEnded`.
|
|
352
338
|
|
|
353
|
-
2.
|
|
339
|
+
2. **Destroy the call view**: when `onCallEnded` fires, destroy the call view.
|
|
354
340
|
|
|
355
341
|
``` typescript
|
|
356
342
|
import { useCallState } from '@/uni_modules/tuikit-atomic-x/state/CallState';
|
|
@@ -360,7 +346,8 @@ const handleLogin = () => {
|
|
|
360
346
|
const { closeLocalCamera, closeLocalMicrophone } = useDeviceState();
|
|
361
347
|
|
|
362
348
|
/**
|
|
363
|
-
*
|
|
349
|
+
* Initialize the call service (minimal example: handle only the call-ended event and pop the page).
|
|
350
|
+
* Call this during application startup.
|
|
364
351
|
*/
|
|
365
352
|
export function initCallService() {
|
|
366
353
|
addCallListener('onCallEnded', (event: string) => {
|
|
@@ -374,43 +361,43 @@ const handleLogin = () => {
|
|
|
374
361
|
|
|
375
362
|
console.log('[CallService] onCallEnded, reason:', res.reason);
|
|
376
363
|
|
|
377
|
-
//
|
|
364
|
+
// Close local devices
|
|
378
365
|
closeLocalCamera();
|
|
379
366
|
closeLocalMicrophone();
|
|
380
367
|
|
|
381
|
-
//
|
|
368
|
+
// Navigate back
|
|
382
369
|
const pages = getCurrentPages();
|
|
383
370
|
if (pages.length > 1) {
|
|
384
371
|
uni.navigateBack({ delta: 1 });
|
|
385
372
|
} else {
|
|
386
|
-
uni.redirectTo({ url: '/pages/index/index' }); //
|
|
373
|
+
uni.redirectTo({ url: '/pages/index/index' }); // Example path; adjust to your actual project path
|
|
387
374
|
}
|
|
388
375
|
});
|
|
389
376
|
}
|
|
390
377
|
```
|
|
391
378
|
|
|
392
|
-
|
|
379
|
+
**`onCallEnded` event parameters:**
|
|
393
380
|
|
|
394
|
-
| <strong
|
|
381
|
+
| <strong>Parameter</strong> | <strong>Type</strong> | <strong>Description</strong> |
|
|
395
382
|
| --- | --- | --- |
|
|
396
|
-
| callId | String |
|
|
397
|
-
| mediaType | CallMediaType |
|
|
398
|
-
| reason | CallEndReason |
|
|
399
|
-
| userId | String |
|
|
383
|
+
| callId | String | The unique identifier of this call. |
|
|
384
|
+
| mediaType | CallMediaType | The media type of the call, indicating whether it is an audio or video call.<br>- <code>CallMediaType.Video</code>: video call.<br>- <code>CallMediaType.Audio</code>: audio call. |
|
|
385
|
+
| reason | CallEndReason | The reason the call ended.<br>- <code>Unknown</code>: unknown reason.<br>- <code>Hangup</code>: normal hangup; the user actively hung up.<br>- <code>Reject</code>: the callee rejected the call.<br>- <code>Busy</code>: the callee is busy on another call.<br>- <code>Cancel</code>: the caller canceled the call before the callee answered. |
|
|
386
|
+
| userId | String | The user ID that triggered the end. |
|
|
400
387
|
|
|
401
|
-
###
|
|
388
|
+
### Result
|
|
402
389
|
|
|
403
|
-
|
|
390
|
+
After the 5 steps above, the "Make a call" flow looks as follows:
|
|
404
391
|
|
|
405
|
-
##
|
|
392
|
+
## Customize the UI
|
|
406
393
|
|
|
407
|
-
**CallCoreView**
|
|
394
|
+
**CallCoreView** offers comprehensive UI customization, allowing you to freely replace icons such as avatars and volume indicators. **To speed up integration, you can download the assets directly from **[GitHub](https://github.com/Tencent-RTC/TUIKit_uni-app/blob/main/App/uni_modules/tuikit-atomic-x/static/icon/handsfree-on.png)**. These icons are designed by our designers specifically for TUICallKit and are free from copyright issues.**
|
|
408
395
|
|
|
409
|
-
###
|
|
396
|
+
### Customize the volume indicator icon
|
|
410
397
|
|
|
411
|
-
|
|
398
|
+
You can configure different volume-level indicator icons via the `volumeLevelIcons` property of the **CallCoreView** component.
|
|
412
399
|
|
|
413
|
-
`volumeLevelIcons
|
|
400
|
+
Example code for the `volumeLevelIcons` property:
|
|
414
401
|
``` typescript
|
|
415
402
|
<template>
|
|
416
403
|
<view class="call-view-container">
|
|
@@ -429,7 +416,7 @@ const handleLogin = () => {
|
|
|
429
416
|
const systemInfo = ref({});
|
|
430
417
|
|
|
431
418
|
/**
|
|
432
|
-
*
|
|
419
|
+
* Convert a /static/ relative path to a local absolute path usable by the native layer
|
|
433
420
|
*/
|
|
434
421
|
function toAbsolutePath(relativePath) {
|
|
435
422
|
if (plus && plus.io && plus.io.convertLocalFileSystemURL) {
|
|
@@ -439,7 +426,7 @@ const handleLogin = () => {
|
|
|
439
426
|
}
|
|
440
427
|
|
|
441
428
|
/**
|
|
442
|
-
*
|
|
429
|
+
* Convert all values of an icon map to absolute paths in a batch
|
|
443
430
|
*/
|
|
444
431
|
function convertIconPaths(iconMap) {
|
|
445
432
|
const result = {};
|
|
@@ -449,10 +436,10 @@ const handleLogin = () => {
|
|
|
449
436
|
return result;
|
|
450
437
|
}
|
|
451
438
|
|
|
452
|
-
//
|
|
439
|
+
// Volume-level icons: keys are level names, values are local absolute paths of the icons
|
|
453
440
|
const volumeLevelIcons = ref(convertIconPaths({
|
|
454
|
-
"Mute": "/static/images/callview-self-mute.png", //
|
|
455
|
-
"Low": "/static/images/callview-network.png" //
|
|
441
|
+
"Mute": "/static/images/callview-self-mute.png", // Replace with the actual icon path in your project
|
|
442
|
+
"Low": "/static/images/callview-network.png" // Replace with the actual icon path in your project
|
|
456
443
|
}));
|
|
457
444
|
|
|
458
445
|
onMounted(() => {
|
|
@@ -472,30 +459,27 @@ const handleLogin = () => {
|
|
|
472
459
|
</style>
|
|
473
460
|
```
|
|
474
461
|
|
|
475
|
-
>
|
|
476
|
-
>
|
|
477
|
-
|
|
478
|
-
> uni-app 传递给原生层的参数只支持本地路径,因此需要将相对路径转化为本地路径。
|
|
462
|
+
> uni-app only supports local paths for parameters passed to the native layer, so relative paths must be converted to local paths.
|
|
479
463
|
>
|
|
480
464
|
|
|
481
|
-
-
|
|
465
|
+
- **Property parameter details:**
|
|
482
466
|
|
|
483
|
-
| <strong
|
|
467
|
+
| <strong>Parameter</strong> | <strong>Type</strong> | <strong>Required</strong> | <strong>Description</strong> |
|
|
484
468
|
| --- | --- | --- | --- |
|
|
485
|
-
| icons | [String: String] |
|
|
469
|
+
| icons | [String: String] | Yes | The mapping between volume levels and icon resources. Structure:<br>- key (VolumeLevel) indicates the volume level:<br>- <code>Mute</code>: microphone is off (muted).<br>- <code>Low</code>: volume range (0-25].<br>- <code>Medium</code>: volume range (25-50].<br>- <code>High</code>: volume range (50-75].<br>- <code>Peak</code>: volume range (75-100].<br>- Value (String) is the icon resource path for the corresponding volume level. |
|
|
486
470
|
|
|
487
|
-
-
|
|
471
|
+
- **Volume indicator icons:**
|
|
488
472
|
|
|
489
|
-
| <strong
|
|
473
|
+
| <strong>Icon</strong> | <strong>Description</strong> |
|
|
490
474
|
| --- | --- |
|
|
491
|
-
| |
|
|
492
|
-
| |
|
|
475
|
+
| | [Meaning] Volume indicator icon.<br>[Recommended usage] Set this icon at the <code>Low</code> or <code>Medium</code> level; it is displayed when the user's volume is above the corresponding level. |
|
|
476
|
+
| | [Meaning] Mute icon.<br>[Recommended usage] Set this icon at the <code>Mute</code> level; it is displayed when the user is muted. |
|
|
493
477
|
|
|
494
|
-
###
|
|
478
|
+
### Customize the network indicator icon
|
|
495
479
|
|
|
496
|
-
|
|
480
|
+
You can configure the network indicator icons for different network states via the `networkQualityIcons` property of the **CallCoreView** component.
|
|
497
481
|
|
|
498
|
-
- `networkQualityIcons
|
|
482
|
+
- Example code for the `networkQualityIcons` property:
|
|
499
483
|
|
|
500
484
|
``` typescript
|
|
501
485
|
|
|
@@ -516,7 +500,7 @@ const handleLogin = () => {
|
|
|
516
500
|
const systemInfo = ref({});
|
|
517
501
|
|
|
518
502
|
/**
|
|
519
|
-
*
|
|
503
|
+
* Convert a /static/ relative path to a local absolute path usable by the native layer
|
|
520
504
|
*/
|
|
521
505
|
function toAbsolutePath(relativePath) {
|
|
522
506
|
if (plus && plus.io && plus.io.convertLocalFileSystemURL) {
|
|
@@ -526,7 +510,7 @@ const handleLogin = () => {
|
|
|
526
510
|
}
|
|
527
511
|
|
|
528
512
|
/**
|
|
529
|
-
*
|
|
513
|
+
* Convert all values of an icon map to absolute paths in a batch
|
|
530
514
|
*/
|
|
531
515
|
function convertIconPaths(iconMap) {
|
|
532
516
|
const result = {};
|
|
@@ -537,8 +521,8 @@ const handleLogin = () => {
|
|
|
537
521
|
}
|
|
538
522
|
|
|
539
523
|
const networkQualityIcons = ref(convertIconPaths({
|
|
540
|
-
"BAD": "/static/images/callview-network-bad.png", //
|
|
541
|
-
"VERY_BAD": "/static/images/callview-network-bad.png" //
|
|
524
|
+
"BAD": "/static/images/callview-network-bad.png", // Replace with the actual icon path in your project
|
|
525
|
+
"VERY_BAD": "/static/images/callview-network-bad.png" // Replace with the actual icon path in your project
|
|
542
526
|
}));
|
|
543
527
|
|
|
544
528
|
onMounted(() => {
|
|
@@ -557,23 +541,23 @@ const handleLogin = () => {
|
|
|
557
541
|
}
|
|
558
542
|
</style>
|
|
559
543
|
```
|
|
560
|
-
- `networkQualityIcons
|
|
544
|
+
- `networkQualityIcons` parameter details:
|
|
561
545
|
|
|
562
|
-
| <strong
|
|
546
|
+
| <strong>Parameter</strong> | <strong>Type</strong> | <strong>Required</strong> | <strong>Description</strong> |
|
|
563
547
|
| --- | --- | --- | --- |
|
|
564
|
-
| icons | [String: String] |
|
|
548
|
+
| icons | [String: String] | Yes | The mapping between network quality and icon resources. Structure:<br>- Key (String): the network quality level:<br>- <code>UNKNOWN</code>: unknown network state.<br>- <code>EXCELLENT</code>: excellent network.<br>- <code>GOOD</code>: good network.<br>- <code>POOR</code>: poor network.<br>- <code>BAD</code>: bad network.<br>- <code>VERY_BAD</code>: very bad network.<br>- <code>DOWN</code>: network disconnected.<br>- Value (String): the icon resource path for the corresponding network state. |
|
|
565
549
|
|
|
566
|
-
-
|
|
550
|
+
- **Poor-network indicator icon:**
|
|
567
551
|
|
|
568
|
-
| <strong
|
|
552
|
+
| <strong>Icon</strong> | <strong>Description</strong> |
|
|
569
553
|
| --- | --- |
|
|
570
|
-
| |
|
|
554
|
+
| | [Meaning] Poor-network indicator icon.<br>[Recommended usage] Set this icon at the <code>BAD</code>, <code>VERY_BAD</code>, or <code>DOWN</code> level; it is displayed when the network is poor. |
|
|
571
555
|
|
|
572
|
-
###
|
|
556
|
+
### Customize the default avatar
|
|
573
557
|
|
|
574
|
-
|
|
558
|
+
You can set the `participantAvatars` property of **CallCoreView** to configure user avatars. We recommend listening to the reactive `allParticipants` (all call participants): when a user's avatar is available, set and display it; if the user has no avatar or loading fails, fall back to a default avatar (placeholder).
|
|
575
559
|
|
|
576
|
-
`participantAvatars
|
|
560
|
+
Example code for the `participantAvatars` property:
|
|
577
561
|
``` typescript
|
|
578
562
|
<template>
|
|
579
563
|
<view class="call-view-container">
|
|
@@ -601,7 +585,7 @@ const handleLogin = () => {
|
|
|
601
585
|
let defaultAvatarReady = false;
|
|
602
586
|
|
|
603
587
|
/**
|
|
604
|
-
*
|
|
588
|
+
* Convert a relative path to a local absolute path usable by the native layer
|
|
605
589
|
*/
|
|
606
590
|
function toAbsolutePath(relativePath) {
|
|
607
591
|
if (plus && plus.io && plus.io.convertLocalFileSystemURL) {
|
|
@@ -611,7 +595,7 @@ const handleLogin = () => {
|
|
|
611
595
|
}
|
|
612
596
|
|
|
613
597
|
/**
|
|
614
|
-
*
|
|
598
|
+
* Download and cache the avatar; return the local absolute path
|
|
615
599
|
*/
|
|
616
600
|
function downloadAvatar(url) {
|
|
617
601
|
if (avatarCache[url]) {
|
|
@@ -636,18 +620,18 @@ const handleLogin = () => {
|
|
|
636
620
|
});
|
|
637
621
|
}
|
|
638
622
|
|
|
639
|
-
//
|
|
623
|
+
// Pre-download the default avatar
|
|
640
624
|
const defaultAvatarPromise = downloadAvatar(DEFAULT_AVATAR_URL).then(localPath => {
|
|
641
625
|
defaultAvatarLocalPath = localPath;
|
|
642
626
|
defaultAvatarReady = true;
|
|
643
|
-
//
|
|
627
|
+
// After the default avatar is ready, refresh participant avatars once
|
|
644
628
|
if (allParticipants.value && allParticipants.value.length > 0) {
|
|
645
629
|
updateParticipantAvatars(allParticipants.value);
|
|
646
630
|
}
|
|
647
631
|
});
|
|
648
632
|
|
|
649
633
|
/**
|
|
650
|
-
*
|
|
634
|
+
* Given the participant list, download avatars and build a { userId: localPath } map
|
|
651
635
|
*/
|
|
652
636
|
async function updateParticipantAvatars(participants) {
|
|
653
637
|
if (!participants || participants.length === 0) {
|
|
@@ -674,7 +658,7 @@ const handleLogin = () => {
|
|
|
674
658
|
participantAvatars.value = avatarMap;
|
|
675
659
|
}
|
|
676
660
|
|
|
677
|
-
//
|
|
661
|
+
// Watch participant changes and update the avatar map
|
|
678
662
|
watch(() => allParticipants.value, async (newVal) => {
|
|
679
663
|
if (!newVal) return;
|
|
680
664
|
await updateParticipantAvatars(newVal);
|
|
@@ -696,23 +680,23 @@ const handleLogin = () => {
|
|
|
696
680
|
}
|
|
697
681
|
</style>
|
|
698
682
|
```
|
|
699
|
-
- `participantAvatars
|
|
683
|
+
- `participantAvatars` parameter details:
|
|
700
684
|
|
|
701
|
-
| <strong
|
|
685
|
+
| <strong>Parameter</strong> | <strong>Type</strong> | <strong>Required</strong> | <strong>Description</strong> |
|
|
702
686
|
| --- | --- | --- | --- |
|
|
703
|
-
| avatars | [String: String] |
|
|
687
|
+
| avatars | [String: String] | Yes | The user avatar map. Structure:<br>- Key: the user's userID.<br>- Value: the absolute path of the user's avatar resource. |
|
|
704
688
|
|
|
705
|
-
-
|
|
689
|
+
- **Default avatar asset:**
|
|
706
690
|
|
|
707
|
-
| <strong
|
|
691
|
+
| <strong>Icon</strong> | <strong>Description</strong> |
|
|
708
692
|
| --- | --- |
|
|
709
|
-
| |
|
|
693
|
+
| | [Meaning] Default avatar.<br>[Recommended usage] When a user's avatar fails to load or is not available, set this as their default avatar. |
|
|
710
694
|
|
|
711
|
-
###
|
|
695
|
+
### Customize the loading animation
|
|
712
696
|
|
|
713
|
-
|
|
697
|
+
You can set the `waitingAnimation` property of **CallCoreView** to configure a waiting animation for waiting users for a better experience.
|
|
714
698
|
|
|
715
|
-
- `waitingAnimation
|
|
699
|
+
- Example code for the `waitingAnimation` property:
|
|
716
700
|
|
|
717
701
|
``` typescript
|
|
718
702
|
<template>
|
|
@@ -732,7 +716,7 @@ const handleLogin = () => {
|
|
|
732
716
|
const systemInfo = ref({});
|
|
733
717
|
|
|
734
718
|
/**
|
|
735
|
-
*
|
|
719
|
+
* Convert a /static/ relative path to a local absolute path usable by the native layer
|
|
736
720
|
*/
|
|
737
721
|
function toAbsolutePath(relativePath) {
|
|
738
722
|
if (plus && plus.io && plus.io.convertLocalFileSystemURL) {
|
|
@@ -741,8 +725,8 @@ const handleLogin = () => {
|
|
|
741
725
|
return relativePath;
|
|
742
726
|
}
|
|
743
727
|
|
|
744
|
-
//
|
|
745
|
-
const waitingAnimation = ref(toAbsolutePath("/static/images/callview-loading.gif")); //
|
|
728
|
+
// Waiting animation GIF: pass a local absolute path for the native component to render
|
|
729
|
+
const waitingAnimation = ref(toAbsolutePath("/static/images/callview-loading.gif")); // Replace with the actual icon path in your project
|
|
746
730
|
|
|
747
731
|
onMounted(() => {
|
|
748
732
|
uni.getSystemInfo({
|
|
@@ -760,23 +744,23 @@ const handleLogin = () => {
|
|
|
760
744
|
}
|
|
761
745
|
</style>
|
|
762
746
|
```
|
|
763
|
-
- `waitingAnimation
|
|
747
|
+
- `waitingAnimation` parameter details:
|
|
764
748
|
|
|
765
|
-
|
|
749
|
+
|**Parameter**|**Type**|**Required**|**Description**|
|
|
766
750
|
|---------|---------|---------|---------|
|
|
767
|
-
|path|String
|
|
751
|
+
|path|String|Yes|The absolute path of the GIF image resource.|
|
|
768
752
|
|
|
769
|
-
-
|
|
753
|
+
- **Waiting-to-answer animation:**
|
|
770
754
|
|
|
771
|
-
| <strong
|
|
755
|
+
| <strong>Icon</strong> | <strong>Description</strong> |
|
|
772
756
|
| --- | --- |
|
|
773
|
-
| |
|
|
757
|
+
| | [Meaning] Waiting-to-answer animation for a user.<br>[Recommended usage] Animation used in group calls. Once configured, this animation is displayed when the user is in the "waiting to answer" state. |
|
|
774
758
|
|
|
775
|
-
###
|
|
759
|
+
### Add a call duration indicator
|
|
776
760
|
|
|
777
|
-
|
|
761
|
+
The call duration is available in real time via the `duration` field on the reactive `activeCall` data. To show the call duration in real time:
|
|
778
762
|
|
|
779
|
-
|
|
763
|
+
**Bind the call duration data**: bind the `activeCall.duration` field to the UI. This field is reactive and drives the UI to update automatically, so you do not need to maintain a timer manually.
|
|
780
764
|
``` typescript
|
|
781
765
|
<template>
|
|
782
766
|
<view v-if="isConnected" class="call-timer">
|
|
@@ -822,12 +806,12 @@ const handleLogin = () => {
|
|
|
822
806
|
</style>
|
|
823
807
|
```
|
|
824
808
|
|
|
825
|
-
##
|
|
809
|
+
## More features
|
|
826
810
|
|
|
827
|
-
###
|
|
811
|
+
### Customize the user's avatar and nickname
|
|
828
812
|
|
|
829
|
-
|
|
830
|
-
-
|
|
813
|
+
Before a call starts, you can set your own nickname and avatar via the `setSelfInfo` method.
|
|
814
|
+
- Example code for `setSelfInfo`:
|
|
831
815
|
|
|
832
816
|
``` typescript
|
|
833
817
|
import { useLoginState } from "@/uni_modules/tuikit-atomic-x/state/LoginState";
|
|
@@ -835,7 +819,7 @@ const handleLogin = () => {
|
|
|
835
819
|
const { setSelfInfo } = useLoginState();
|
|
836
820
|
|
|
837
821
|
/**
|
|
838
|
-
*
|
|
822
|
+
* Set the profile (nickname, avatar, etc.) of the currently signed-in user
|
|
839
823
|
*/
|
|
840
824
|
export const setSelfUserInfo = (userID: string, nickname: string, avatarURL: string): void => {
|
|
841
825
|
setSelfInfo({
|
|
@@ -845,29 +829,26 @@ const handleLogin = () => {
|
|
|
845
829
|
avatarURL,
|
|
846
830
|
},
|
|
847
831
|
success: () => {
|
|
848
|
-
console.log('
|
|
832
|
+
console.log('User profile set successfully');
|
|
849
833
|
},
|
|
850
834
|
fail: (errCode: number, errMsg: string) => {
|
|
851
|
-
console.error('
|
|
835
|
+
console.error('Failed to set user profile:', errCode, errMsg);
|
|
852
836
|
},
|
|
853
837
|
});
|
|
854
838
|
};
|
|
855
839
|
```
|
|
856
|
-
-
|
|
840
|
+
- `setSelfInfo` parameter details:
|
|
857
841
|
|
|
858
|
-
| <strong
|
|
842
|
+
| <strong>Parameter</strong> | <strong>Type</strong> | <strong>Required</strong> | <strong>Description</strong> |
|
|
859
843
|
| --- | --- | --- | --- |
|
|
860
|
-
| userProfile | UserProfile |
|
|
844
|
+
| userProfile | UserProfile | Yes | The user profile struct:<br>- <code>userID</code>: the user's ID.<br>- <code>avatarURL</code>: the URL of the user's avatar.<br>- <code>nickname</code>: the user's nickname.<br>For more fields, see UserProfile. |
|
|
861
845
|
|
|
862
|
-
###
|
|
846
|
+
### Switch the layout mode
|
|
863
847
|
|
|
864
|
-
**CallCoreView**
|
|
865
|
-
| <strong>
|
|
866
|
-
| --- | --- | --- |
|
|
867
|
-
| | | |
|
|
868
|
-
| - <strong>布局逻辑:</strong>呼叫等待时全屏显示己方画面;接通后全屏显示对方画面,己方画面以悬浮小窗展示。<br>- <strong>交互特性:</strong>支持小窗拖拽移动,点击小窗可实现大小画面互换。 | - <strong>布局逻辑:</strong>所有成员画面呈网格状平铺排列成宫格模式布局,适用 2 人以上通话,支持点击放大画面功能。<br>- <strong>交互特性:</strong>支持点击特定成员画面放大查看。 | - <strong>布局逻辑:</strong>1 v 1 场景固定显示对方画面,多人场景:采用当前发言者(Active Speaker) 策略,自动识别并全屏展示正在说话的用户。<br>- <strong>交互特性:</strong>等待时显示自己的画面,接通后还会显示通话计时。 |
|
|
848
|
+
**CallCoreView** provides three built-in layout modes. You can set the `layoutTemplate` property to choose the layout. If not set, **CallCoreView** auto-selects the layout based on the number of participants: `Float` is the default for 1-vs-1 scenarios, and it automatically switches to `Grid` for multi-party calls. The layout modes are described below:
|
|
849
|
+
| - <strong>Layout logic:</strong> during outgoing ringing, the local view is shown full-screen; after the call is connected, the remote view is shown full-screen and the local view becomes a floating small window.<br>- <strong>Interaction:</strong> supports dragging the small window; tap the small window to swap the main and small views. | - <strong>Layout logic:</strong> all participants' views are tiled in a grid layout. Suitable for calls with 2 or more participants; tap a specific view to enlarge it.<br>- <strong>Interaction:</strong> tap a specific participant's view to enlarge it. | - <strong>Layout logic:</strong> in 1-vs-1 scenarios, the remote view is always shown. In multi-party scenarios, the Active Speaker strategy is used to automatically detect and show the current speaker in full screen.<br>- <strong>Interaction:</strong> the local view is shown while waiting; after the call is connected, the call duration is also displayed. |
|
|
869
850
|
|
|
870
|
-
- `layoutTemplate
|
|
851
|
+
- Example code for the `layoutTemplate` property:
|
|
871
852
|
|
|
872
853
|
``` typescript
|
|
873
854
|
<template>
|
|
@@ -888,10 +869,10 @@ const handleLogin = () => {
|
|
|
888
869
|
const { activeCall } = useCallState();
|
|
889
870
|
|
|
890
871
|
const systemInfo = ref({});
|
|
891
|
-
//
|
|
872
|
+
// Layout template: 'Float' for 1v1 floating layout, 'Grid' for multi-party grid layout
|
|
892
873
|
const layoutTemplate = ref("Grid");
|
|
893
874
|
|
|
894
|
-
//
|
|
875
|
+
// Automatically switch the layout based on call info: use Grid for multi-party or group chats, Float for 1v1
|
|
895
876
|
watch(() => activeCall.value, (newValue) => {
|
|
896
877
|
if (!newValue || !newValue.inviteeIds) {
|
|
897
878
|
return;
|
|
@@ -919,15 +900,15 @@ const handleLogin = () => {
|
|
|
919
900
|
</style>
|
|
920
901
|
|
|
921
902
|
```
|
|
922
|
-
- `layoutTemplate
|
|
903
|
+
- `layoutTemplate` parameter details:
|
|
923
904
|
|
|
924
|
-
| <strong
|
|
905
|
+
| <strong>Parameter</strong> | <strong>Type</strong> | <strong>Description</strong> |
|
|
925
906
|
| --- | --- | --- |
|
|
926
|
-
| <code>layoutTemplate</code> | String | CallCoreView
|
|
907
|
+
| <code>layoutTemplate</code> | String | Layout mode of CallCoreView.<br>- Float:<br>- Layout logic: during outgoing ringing, the local view is shown full-screen; after the call is connected, the remote view is shown full-screen and the local view becomes a floating small window.<br>- Interaction: supports dragging the small window; tap the small window to swap the main and small views.<br>- Grid:<br>- Layout logic: all participants' views are tiled in a grid layout. Suitable for calls with 2 or more participants; tap a specific view to enlarge it.<br>- Interaction: tap a specific participant's view to enlarge it.<br>- PIP:<br>- Layout logic: in 1v1 scenarios, the remote view is always shown. In multi-party scenarios, the Active Speaker strategy is used to automatically detect and show the current speaker in full screen.<br>- Interaction: the local view is shown while waiting; after the call is connected, the call duration is also displayed. |
|
|
927
908
|
|
|
928
|
-
###
|
|
909
|
+
### Set the default call timeout
|
|
929
910
|
|
|
930
|
-
|
|
911
|
+
When starting a call via [calls](https://liteav.sdk.qcloud.com/doc/product/tuikit/atomic-x/uni-app/zh/v1.0/api/index.html#calls), you can specify the wait timeout via the `timeout` field of the `CallParams` configuration. Example:
|
|
931
912
|
``` typescript
|
|
932
913
|
<script setup>
|
|
933
914
|
import { ref } from 'vue';
|
|
@@ -936,12 +917,12 @@ import { useCallState } from '@/uni_modules/tuikit-atomic-x/state/CallState';
|
|
|
936
917
|
const { calls } = useCallState();
|
|
937
918
|
|
|
938
919
|
const calleeUserID = ref('');
|
|
939
|
-
const mediaType = ref(1); // 0:
|
|
920
|
+
const mediaType = ref(1); // 0: audio, 1: video
|
|
940
921
|
|
|
941
922
|
const startCall = () => {
|
|
942
923
|
const userID = calleeUserID.value.trim();
|
|
943
924
|
if (!userID) {
|
|
944
|
-
uni.showToast({ icon: 'none', title: '
|
|
925
|
+
uni.showToast({ icon: 'none', title: 'Please enter the callee user ID' });
|
|
945
926
|
return;
|
|
946
927
|
}
|
|
947
928
|
calls({
|
|
@@ -951,29 +932,29 @@ const startCall = () => {
|
|
|
951
932
|
timeout: 30
|
|
952
933
|
},
|
|
953
934
|
success: () => {
|
|
954
|
-
console.log('
|
|
935
|
+
console.log('Call initiated successfully');
|
|
955
936
|
uni.navigateTo({
|
|
956
|
-
url: '/uni_modules/tuikit-atomic-x/pages/call?layoutTemplate=Float' //
|
|
937
|
+
url: '/uni_modules/tuikit-atomic-x/pages/call?layoutTemplate=Float' // Example path; replace with the actual call page path you created in Step 1
|
|
957
938
|
});
|
|
958
939
|
},
|
|
959
940
|
fail: (code, message) => {
|
|
960
|
-
console.error('
|
|
961
|
-
uni.showToast({ icon: 'none', title:
|
|
941
|
+
console.error('Failed to initiate call:', code, message);
|
|
942
|
+
uni.showToast({ icon: 'none', title: `Call failed: ${message}` });
|
|
962
943
|
}
|
|
963
944
|
});
|
|
964
945
|
};
|
|
965
946
|
</script>
|
|
966
947
|
|
|
967
948
|
```
|
|
968
|
-
| <strong
|
|
949
|
+
| <strong>Parameter</strong> | <strong>Type</strong> | <strong>Required</strong> | <strong>Description</strong> |
|
|
969
950
|
| --- | --- | --- | --- |
|
|
970
|
-
| participantIds | Array |
|
|
971
|
-
| mediaType | CallMediaType |
|
|
972
|
-
| params | CallParams |
|
|
951
|
+
| participantIds | Array | Yes | The list of target userIds. |
|
|
952
|
+
| mediaType | CallMediaType | Yes | The media type of the call, indicating whether it is an audio or video call.<br>- <code>CallMediaType.Video</code>: video call.<br>- <code>CallMediaType.Audio</code>: audio call. |
|
|
953
|
+
| params | CallParams | No | Extended call parameters, such as room ID, call invitation timeout, etc.<br>- <code>roomId</code> (String): the room ID. Optional; if not specified, the server assigns one automatically.<br>- <code>timeout</code> (Int): call timeout in seconds.<br>- <code>userData</code> (String): user-defined data.<br>- <code>chatGroupId</code> (String): the Chat group ID, used for group call scenarios.<br>- <code>isEphemeralCall</code> (Boolean): whether the call is ephemeral (does not produce a call record). |
|
|
973
954
|
|
|
974
|
-
###
|
|
955
|
+
### Play the ringback tone while waiting
|
|
975
956
|
|
|
976
|
-
|
|
957
|
+
You can listen to your own call state, play a ringtone while waiting for the callee to answer, and stop the ringtone when the call is answered or ended.
|
|
977
958
|
``` typescript
|
|
978
959
|
import { watch } from 'vue';
|
|
979
960
|
import { useCallState } from '@/uni_modules/tuikit-atomic-x/state/CallState';
|
|
@@ -1012,11 +993,11 @@ function stopRingtone() {
|
|
|
1012
993
|
}
|
|
1013
994
|
|
|
1014
995
|
export { playRingtone, stopRingtone };
|
|
1015
|
-
//
|
|
996
|
+
// It is recommended to call this function during application initialization
|
|
1016
997
|
export function initCallService() {
|
|
1017
998
|
ensureAudioContext();
|
|
1018
999
|
|
|
1019
|
-
//
|
|
1000
|
+
// Stop the ringtone when the call is connected (status=2) or ended (status=0)
|
|
1020
1001
|
watch(() => selfInfo.value, (newVal) => {
|
|
1021
1002
|
if (newVal?.status === 2 || newVal?.status === 0) {
|
|
1022
1003
|
stopRingtone();
|
|
@@ -1025,36 +1006,33 @@ export function initCallService() {
|
|
|
1025
1006
|
}
|
|
1026
1007
|
```
|
|
1027
1008
|
|
|
1028
|
-
##
|
|
1029
|
-
|
|
1030
|
-
恭喜您,已经完成了"拨打一通电话",接下来,您可参考 接听第一通电话 实现接听电话功能。
|
|
1009
|
+
## Next step
|
|
1031
1010
|
|
|
1032
|
-
|
|
1011
|
+
Congratulations, you have completed "Make a call". Next, you can .
|
|
1033
1012
|
|
|
1034
|
-
|
|
1013
|
+
## FAQ
|
|
1035
1014
|
|
|
1036
|
-
|
|
1015
|
+
### How can I keep the screen always on during a call?
|
|
1037
1016
|
|
|
1038
|
-
|
|
1017
|
+
uni-app provides an official API for this: [uni.setScreenBrightness](https://uniapp.dcloud.net.cn/api/system/brightness.html).
|
|
1039
1018
|
|
|
1040
|
-
|
|
1019
|
+
### How can I disable the system back-swipe gesture on the previous page?
|
|
1041
1020
|
|
|
1042
|
-
|
|
1021
|
+
On iOS, you can disable it by setting the `disableSwipeBack` property on the page. See the [official uni-app documentation](https://uniapp.dcloud.net.cn/collocation/pages.html) for details.
|
|
1043
1022
|
|
|
1044
|
-
|
|
1045
|
-
>
|
|
1023
|
+
On Android, you can intercept both the back-swipe gesture and the physical back button via `onBackPress`. Example:
|
|
1046
1024
|
|
|
1047
|
-
>
|
|
1025
|
+
> When using this approach to intercept the system back-swipe and physical back button, make sure the page uses a [custom navigation bar](https://uniapp.dcloud.net.cn/collocation/pages.html#customnav).
|
|
1048
1026
|
>
|
|
1049
1027
|
|
|
1050
1028
|
``` typescript
|
|
1051
1029
|
<script setup>
|
|
1052
1030
|
import { onBackPress } from '@dcloudio/uni-app'
|
|
1053
1031
|
|
|
1054
|
-
//
|
|
1032
|
+
// Intercept the system back-swipe and physical back button to prevent accidental exit during a call
|
|
1055
1033
|
onBackPress((option) => {
|
|
1056
1034
|
if (option.from === 'backbutton') {
|
|
1057
|
-
return true; //
|
|
1035
|
+
return true; // Return true to block the default back behavior
|
|
1058
1036
|
}
|
|
1059
1037
|
});
|
|
1060
1038
|
</script>
|