@tencent-rtc/mcp 1.4.7 → 1.6.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/cursor-setting.png +0 -0
- package/index.js +0 -1
- package/knowledge/bm25-cache.js +73 -0
- package/knowledge/bm25.js +147 -0
- package/knowledge/build-index.js +69 -0
- package/knowledge/chunker.js +167 -0
- package/knowledge/content-loader.js +39 -0
- package/knowledge/doc-url-resolver.js +142 -0
- package/knowledge/extractors.js +25 -0
- package/knowledge/path-meta.js +184 -0
- package/knowledge/search/exact-lookup.js +497 -0
- package/knowledge/search/filter-pool.js +104 -0
- package/knowledge/search/product-scope-intent.js +40 -0
- package/knowledge/search/requires-framework.js +81 -0
- package/knowledge/search/search-knowledge.js +229 -0
- package/mcp-server-prompt.png +0 -0
- package/package.json +1 -1
- package/resource/_schema/feature-aliases.yaml +10 -0
- package/resource/_schema/goal-tags.yaml +72 -0
- package/resource/_schema/products.yaml +19 -0
- package/resource/_schema/trtc-intents.yaml +27 -0
- package/resource/_schema/types.yaml +43 -0
- package/resource/index/component-slugs.json +1 -0
- package/resource/index/doc-source-urls.json +1 -0
- package/resource/index/manifest.json +1 -0
- package/resource/{doc → integration}/callkit/preset/android/integration.md +34 -28
- package/resource/integration/callkit/preset/flutter/integration.md +346 -0
- package/resource/integration/callkit/preset/ios/integration.md +408 -0
- package/resource/integration/callkit/preset/react/integration.md +362 -0
- package/resource/integration/callkit/preset/vue/integration.md +356 -0
- package/resource/integration/chat/preset/android/integration.md +500 -0
- package/resource/integration/chat/preset/flutter/integration.md +370 -0
- package/resource/integration/chat/preset/ios/integration.md +566 -0
- package/resource/integration/chat/preset/react/integration.md +490 -0
- package/resource/integration/chat/preset/vue/integration.md +504 -0
- package/resource/{doc → integration}/livekit/preset/live/vue/live-list-integration.md +26 -22
- package/resource/{doc → integration}/livekit/preset/live/vue/live-player-desk-integration.md +22 -18
- package/resource/integration/livekit/preset/live/vue/live-player-h5-integration.md +309 -0
- package/resource/{doc → integration}/livekit/preset/live/vue/live-pusher-integration.md +47 -39
- package/resource/integration/roomkit/preset/vue/integration.md +562 -0
- package/resource/knowledge/callkit/core-sdk/android/answer-call.md +828 -0
- package/resource/knowledge/callkit/core-sdk/android/make-call.md +897 -0
- package/resource/knowledge/callkit/core-sdk/android/offline-push.md +363 -0
- package/resource/knowledge/callkit/core-sdk/flutter/answer-call.md +1111 -0
- package/resource/knowledge/callkit/core-sdk/flutter/make-call.md +1132 -0
- package/resource/{doc → knowledge}/callkit/core-sdk/flutter/offline-push.md +174 -151
- package/resource/knowledge/callkit/core-sdk/ios/answer-call.md +1084 -0
- package/resource/knowledge/callkit/core-sdk/ios/make-call.md +1252 -0
- package/resource/knowledge/callkit/core-sdk/ios/offline-push.md +534 -0
- package/resource/knowledge/callkit/core-sdk/uni-app/answer-call.md +953 -0
- package/resource/knowledge/callkit/core-sdk/uni-app/make-call.md +1061 -0
- package/resource/knowledge/callkit/faq/android.md +92 -0
- package/resource/{doc/callkit/faq/android-faq.md → knowledge/callkit/faq/common.md} +11 -12
- package/resource/knowledge/callkit/faq/error-code.md +67 -0
- package/resource/knowledge/callkit/faq/flutter.md +52 -0
- package/resource/knowledge/callkit/faq/ios.md +104 -0
- package/resource/knowledge/callkit/faq/web.md +74 -0
- package/resource/knowledge/callkit/preset/android/api.md +412 -0
- package/resource/knowledge/callkit/preset/flutter/api.md +22 -0
- package/resource/knowledge/callkit/preset/ios/api.md +234 -0
- package/resource/knowledge/callkit/preset/web/api.md +83 -0
- package/resource/knowledge/chat/preset/android/features/chat-setting.md +74 -0
- package/resource/knowledge/chat/preset/android/features/contact-list.md +43 -0
- package/resource/knowledge/chat/preset/android/features/conversation-list.md +117 -0
- package/resource/knowledge/chat/preset/android/features/language.md +136 -0
- package/resource/knowledge/chat/preset/android/features/message-input.md +57 -0
- package/resource/knowledge/chat/preset/android/features/message-list.md +142 -0
- package/resource/knowledge/chat/preset/android/features/search.md +64 -0
- package/resource/knowledge/chat/preset/android/features/theme.md +222 -0
- package/resource/knowledge/chat/preset/android-view/integration.md +300 -0
- package/resource/knowledge/chat/preset/flutter/features/chat-setting.md +64 -0
- package/resource/knowledge/chat/preset/flutter/features/contact-list.md +40 -0
- package/resource/knowledge/chat/preset/flutter/features/conversation-list.md +129 -0
- package/resource/knowledge/chat/preset/flutter/features/language.md +104 -0
- package/resource/knowledge/chat/preset/flutter/features/message-input.md +54 -0
- package/resource/knowledge/chat/preset/flutter/features/message-list.md +158 -0
- package/resource/knowledge/chat/preset/flutter/features/search.md +59 -0
- package/resource/knowledge/chat/preset/flutter/features/theme.md +261 -0
- package/resource/knowledge/chat/preset/ios/features/chat-setting.md +94 -0
- package/resource/knowledge/chat/preset/ios/features/contact-list.md +119 -0
- package/resource/knowledge/chat/preset/ios/features/conversation-list.md +134 -0
- package/resource/knowledge/chat/preset/ios/features/language.md +125 -0
- package/resource/knowledge/chat/preset/ios/features/message-input.md +69 -0
- package/resource/knowledge/chat/preset/ios/features/message-list.md +162 -0
- package/resource/knowledge/chat/preset/ios/features/search.md +93 -0
- package/resource/knowledge/chat/preset/ios/features/theme.md +270 -0
- package/resource/{doc/chatkit/ios → knowledge/chat/preset/ios-uikit}/integration.md +160 -158
- package/resource/knowledge/chat/preset/react/features/chat-setting.md +101 -0
- package/resource/{doc/chatkit/react/components → knowledge/chat/preset/react/features}/contact-list.md +43 -41
- package/resource/knowledge/chat/preset/react/features/conversation-actions.md +215 -0
- package/resource/knowledge/chat/preset/react/features/conversation-list.md +339 -0
- package/resource/knowledge/chat/preset/react/features/conversation-preview.md +101 -0
- package/resource/knowledge/chat/preset/react/features/conversation-search.md +61 -0
- package/resource/{doc/chatkit/react/components → knowledge/chat/preset/react/features}/message-input.md +117 -156
- package/resource/knowledge/chat/preset/react/features/message-list.md +297 -0
- package/resource/{doc/chatkit/react/components → knowledge/chat/preset/react/features}/search.md +65 -59
- package/resource/knowledge/chat/preset/react/features/theme.md +93 -0
- package/resource/knowledge/chat/preset/vue/features/chat-header.md +331 -0
- package/resource/knowledge/chat/preset/vue/features/chat-setting.md +79 -0
- package/resource/knowledge/chat/preset/vue/features/contact-list.md +277 -0
- package/resource/knowledge/chat/preset/vue/features/conversation-actions.md +234 -0
- package/resource/knowledge/chat/preset/vue/features/conversation-list.md +331 -0
- package/resource/knowledge/chat/preset/vue/features/conversation-preview.md +216 -0
- package/resource/{doc/chatkit/vue/components → knowledge/chat/preset/vue/features}/conversation-search.md +13 -13
- package/resource/knowledge/chat/preset/vue/features/message-input.md +551 -0
- package/resource/knowledge/chat/preset/vue/features/message-list.md +350 -0
- package/resource/{doc/chatkit/vue/components → knowledge/chat/preset/vue/features}/search.md +79 -73
- package/resource/knowledge/chat/preset/vue/features/theme.md +136 -0
- package/resource/knowledge/chat/urls/error-code.md +17 -0
- package/resource/knowledge/chat/urls/product.md +43 -0
- package/resource/knowledge/chat/urls/restapi.md +204 -0
- package/resource/knowledge/chat/urls/sdk/android.md +80 -0
- package/resource/knowledge/chat/urls/sdk/flutter.md +71 -0
- package/resource/knowledge/chat/urls/sdk/ios.md +80 -0
- package/resource/knowledge/chat/urls/sdk/web.md +80 -0
- package/resource/knowledge/chat/urls/webhook.md +68 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/android/AudioEffectStore.md +286 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/android/BarrageStore.md +174 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/android/BattleStore.md +329 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/android/CameraView.md +55 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/android/CoGuestStore.md +434 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/android/CoHostStore.md +362 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/android/DeviceStore.md +466 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/android/GiftStore.md +173 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/android/LikeStore.md +51 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/android/LiveAudienceStore.md +291 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/android/LiveCoreView.md +78 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/android/LiveSeatStore.md +488 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/android/LoginStore.md +219 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/AudioEffectStore.md +282 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/BarrageStore.md +212 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/BaseBeautyStore.md +153 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/BattleStore.md +312 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/CoGuestStore.md +404 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/CoHostStore.md +334 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/DeviceStore.md +426 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/GiftStore.md +166 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/LikeStore.md +52 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/LiveAudienceStore.md +281 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/LiveCoreView.md +150 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/LiveSeatStore.md +438 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/LoginStore.md +190 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/AudioEffectStore.md +291 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/BarrageStore.md +192 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/BaseBeautyStore.md +146 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/BattleStore.md +309 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/CoGuestStore.md +370 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/CoHostStore.md +339 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/DeviceStore.md +503 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/GiftStore.md +188 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/LikeStore.md +51 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/LiveAudienceStore.md +289 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/LiveCoreView.md +78 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/LiveSeatStore.md +487 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/LoginStore.md +183 -0
- package/resource/knowledge/livekit/core-sdk/api-reference/web/index.md +736 -0
- package/resource/{doc → knowledge}/livekit/core-sdk/live/android/live-audience-list.md +53 -47
- package/resource/{doc → knowledge}/livekit/core-sdk/live/android/live-audio-effect.md +28 -24
- package/resource/{doc → knowledge}/livekit/core-sdk/live/android/live-barrage.md +22 -18
- package/resource/{doc → knowledge}/livekit/core-sdk/live/android/live-base-beauty.md +17 -15
- package/resource/{doc → knowledge}/livekit/core-sdk/live/android/live-co-guest-interaction.md +19 -18
- package/resource/{doc → knowledge}/livekit/core-sdk/live/android/live-gift.md +102 -89
- package/resource/{doc → knowledge}/livekit/core-sdk/live/android/live-host-interaction.md +41 -37
- package/resource/{doc → knowledge}/livekit/core-sdk/live/android/live-integration.md +45 -43
- package/resource/{doc → knowledge}/livekit/core-sdk/live/android/live-live-list.md +23 -20
- package/resource/{doc → knowledge}/livekit/core-sdk/live/flutter/live-audience-list.md +41 -41
- package/resource/{doc → knowledge}/livekit/core-sdk/live/flutter/live-audio-effect.md +70 -69
- package/resource/{doc → knowledge}/livekit/core-sdk/live/flutter/live-barrage.md +68 -71
- package/resource/{doc → knowledge}/livekit/core-sdk/live/flutter/live-base-beauty.md +43 -47
- package/resource/{doc → knowledge}/livekit/core-sdk/live/flutter/live-co-guest-interaction.md +59 -56
- package/resource/{doc → knowledge}/livekit/core-sdk/live/flutter/live-gift.md +103 -105
- package/resource/knowledge/livekit/core-sdk/live/flutter/live-host-interaction.md +869 -0
- package/resource/{doc → knowledge}/livekit/core-sdk/live/flutter/live-integration.md +84 -87
- package/resource/{doc → knowledge}/livekit/core-sdk/live/flutter/live-live-list.md +43 -40
- package/resource/{doc → knowledge}/livekit/core-sdk/live/ios/live-audience-list.md +11 -10
- package/resource/{doc → knowledge}/livekit/core-sdk/live/ios/live-audio-effect.md +28 -24
- package/resource/{doc → knowledge}/livekit/core-sdk/live/ios/live-barrage.md +22 -18
- package/resource/{doc → knowledge}/livekit/core-sdk/live/ios/live-base-beauty.md +15 -14
- package/resource/{doc → knowledge}/livekit/core-sdk/live/ios/live-co-guest-interaction.md +19 -18
- package/resource/{doc → knowledge}/livekit/core-sdk/live/ios/live-gift.md +54 -50
- package/resource/{doc → knowledge}/livekit/core-sdk/live/ios/live-host-interaction.md +41 -37
- package/resource/{doc → knowledge}/livekit/core-sdk/live/ios/live-integration.md +40 -40
- package/resource/{doc → knowledge}/livekit/core-sdk/live/ios/live-live-list.md +19 -18
- package/resource/{doc → knowledge}/livekit/core-sdk/voice/android/voice-audience-list.md +53 -47
- package/resource/{doc → knowledge}/livekit/core-sdk/voice/android/voice-audio-effect.md +28 -24
- package/resource/{doc → knowledge}/livekit/core-sdk/voice/android/voice-barrage.md +22 -18
- package/resource/{doc → knowledge}/livekit/core-sdk/voice/android/voice-co-guest-interaction.md +41 -33
- package/resource/{doc → knowledge}/livekit/core-sdk/voice/android/voice-gift.md +94 -81
- package/resource/{doc → knowledge}/livekit/core-sdk/voice/android/voice-host-interaction.md +35 -30
- package/resource/{doc → knowledge}/livekit/core-sdk/voice/android/voice-integration.md +45 -42
- package/resource/{doc → knowledge}/livekit/core-sdk/voice/android/voice-room-list.md +23 -20
- package/resource/knowledge/livekit/core-sdk/voice/flutter/voice-audience-list.md +260 -0
- package/resource/knowledge/livekit/core-sdk/voice/flutter/voice-audio-effect.md +598 -0
- package/resource/knowledge/livekit/core-sdk/voice/flutter/voice-barrage.md +490 -0
- package/resource/{doc → knowledge}/livekit/core-sdk/voice/flutter/voice-co-guest-interaction.md +65 -59
- package/resource/knowledge/livekit/core-sdk/voice/flutter/voice-gift.md +424 -0
- package/resource/{doc → knowledge}/livekit/core-sdk/voice/flutter/voice-integration.md +69 -76
- package/resource/knowledge/livekit/core-sdk/voice/flutter/voice-room-list.md +726 -0
- package/resource/{doc → knowledge}/livekit/core-sdk/voice/ios/voice-audience-list.md +11 -10
- package/resource/{doc → knowledge}/livekit/core-sdk/voice/ios/voice-audio-effect.md +28 -24
- package/resource/{doc → knowledge}/livekit/core-sdk/voice/ios/voice-barrage.md +22 -18
- package/resource/{doc → knowledge}/livekit/core-sdk/voice/ios/voice-co-guest-interaction.md +41 -33
- package/resource/{doc → knowledge}/livekit/core-sdk/voice/ios/voice-gift.md +54 -50
- package/resource/{doc → knowledge}/livekit/core-sdk/voice/ios/voice-host-interaction.md +35 -30
- package/resource/{doc → knowledge}/livekit/core-sdk/voice/ios/voice-integration.md +49 -46
- package/resource/{doc → knowledge}/livekit/core-sdk/voice/ios/voice-room-list.md +19 -18
- package/resource/knowledge/livekit/faq/error-code.md +193 -0
- package/resource/{doc/livekit/preset/live/vue/components → knowledge/livekit/preset/live/vue/features}/barrage.md +56 -53
- package/resource/{doc/livekit/preset/live/vue/components → knowledge/livekit/preset/live/vue/features}/live-audience-list.md +22 -21
- package/resource/{doc/livekit/preset/live/vue/components → knowledge/livekit/preset/live/vue/features}/live-view.md +34 -32
- package/resource/knowledge/push/config/android.md +92 -0
- package/resource/knowledge/push/config/harmonyos.md +83 -0
- package/resource/knowledge/push/config/ios.md +254 -0
- package/resource/knowledge/push/config/react-native.md +254 -0
- package/resource/knowledge/push/config/unity.md +209 -0
- package/resource/knowledge/push/config/unreal-engine.md +194 -0
- package/resource/knowledge/push/integration/android.md +404 -0
- package/resource/knowledge/push/integration/flutter.md +465 -0
- package/resource/knowledge/push/integration/harmonyos.md +63 -0
- package/resource/knowledge/push/integration/ios.md +246 -0
- package/resource/knowledge/push/integration/react-native.md +366 -0
- package/resource/knowledge/push/integration/uni-app.md +208 -0
- package/resource/knowledge/push/integration/unity.md +389 -0
- package/resource/knowledge/push/integration/unreal-engine.md +390 -0
- package/resource/knowledge/push/overview/prepare.md +60 -0
- package/resource/knowledge/roomkit/core-sdk/android/call-user-to-room.md +241 -0
- package/resource/knowledge/roomkit/core-sdk/android/room-participant-state.md +588 -0
- package/resource/knowledge/roomkit/core-sdk/android/room-state.md +364 -0
- package/resource/knowledge/roomkit/core-sdk/android/schedule-room.md +340 -0
- package/resource/knowledge/roomkit/core-sdk/flutter/call-user-to-room.md +230 -0
- package/resource/knowledge/roomkit/core-sdk/flutter/room-participant-state.md +797 -0
- package/resource/knowledge/roomkit/core-sdk/flutter/room-state.md +325 -0
- package/resource/knowledge/roomkit/core-sdk/flutter/schedule-room.md +325 -0
- package/resource/knowledge/roomkit/core-sdk/ios/call-user-to-room.md +233 -0
- package/resource/knowledge/roomkit/core-sdk/ios/room-participant-state.md +569 -0
- package/resource/knowledge/roomkit/core-sdk/ios/room-state.md +325 -0
- package/resource/knowledge/roomkit/core-sdk/ios/schedule-room.md +322 -0
- package/resource/knowledge/roomkit/core-sdk/vue/call-user-to-room.md +221 -0
- package/resource/{doc/roomkit/vue/features → knowledge/roomkit/core-sdk/vue}/device-detection.md +49 -48
- package/resource/knowledge/roomkit/core-sdk/vue/device-state.md +461 -0
- package/resource/knowledge/roomkit/core-sdk/vue/free-beauty-panel.md +216 -0
- package/resource/knowledge/roomkit/core-sdk/vue/room-chat.md +370 -0
- package/resource/{doc/roomkit/vue/features → knowledge/roomkit/core-sdk/vue}/room-participant-state.md +61 -60
- package/resource/knowledge/roomkit/core-sdk/vue/room-state.md +280 -0
- package/resource/{doc/roomkit/vue/features → knowledge/roomkit/core-sdk/vue}/room-view.md +57 -56
- package/resource/knowledge/roomkit/core-sdk/vue/schedule-room.md +319 -0
- package/resource/knowledge/roomkit/core-sdk/vue/screen-share.md +267 -0
- package/resource/knowledge/roomkit/core-sdk/vue/virtual-background.md +261 -0
- package/resource/knowledge/roomkit/preset/android/integration.md +396 -0
- package/resource/knowledge/roomkit/preset/flutter/integration.md +404 -0
- package/resource/knowledge/roomkit/preset/ios/integration.md +369 -0
- package/resource/knowledge/roomkit/preset/react/integration.md +576 -0
- package/resource/knowledge/rtcengine/web/how_to_run_web_sdk_demo.md +44 -0
- package/resource/{doc → knowledge}/rtcengine/web/plugin/21-advanced-auto-play-policy.md +8 -2
- package/resource/{doc → knowledge}/rtcengine/web/plugin/22-advanced-audio-mixer.md +19 -1
- package/resource/{doc → knowledge}/rtcengine/web/plugin/23-advanced-support-detection.md +1 -1
- package/resource/{doc → knowledge}/rtcengine/web/plugin/24-advanced-network-quality.md +8 -8
- package/resource/{doc → knowledge}/rtcengine/web/plugin/25-advanced-device-change.md +1 -1
- package/resource/{doc → knowledge}/rtcengine/web/plugin/26-advanced-publish-cdn-stream.md +6 -6
- package/resource/{doc → knowledge}/rtcengine/web/plugin/27-advanced-small-stream.md +3 -3
- package/resource/{doc → knowledge}/rtcengine/web/plugin/29-advanced-water-mark.md +18 -0
- package/resource/{doc → knowledge}/rtcengine/web/plugin/31-advanced-plugins-overview.md +1 -1
- package/resource/{doc → knowledge}/rtcengine/web/plugin/34-advanced-proxy.md +2 -2
- package/resource/{doc → knowledge}/rtcengine/web/plugin/35-advanced-ai-denoiser.md +1 -1
- package/resource/knowledge/trtc/android/TRTCCloud.md +1915 -0
- package/resource/knowledge/trtc/android/TRTCCloudDef.md +1029 -0
- package/resource/knowledge/trtc/android/TRTCCloudListener.md +1095 -0
- package/resource/knowledge/trtc/android/TRTCStatistics.md +68 -0
- package/resource/knowledge/trtc/android/TXAudioEffectManager.md +502 -0
- package/resource/knowledge/trtc/android/TXBeautyManager.md +415 -0
- package/resource/knowledge/trtc/android/TXDeviceManager.md +169 -0
- package/resource/knowledge/trtc/android/TXLiteAVCode.md +125 -0
- package/resource/knowledge/trtc/c++/ITRTCCloud.md +2069 -0
- package/resource/knowledge/trtc/c++/ITRTCStatistics.md +73 -0
- package/resource/knowledge/trtc/c++/ITXAudioEffectManager.md +502 -0
- package/resource/knowledge/trtc/c++/ITXDeviceManager.md +391 -0
- package/resource/knowledge/trtc/c++/TRTCCloudCallback.md +1191 -0
- package/resource/knowledge/trtc/c++/TRTCTypeDef.md +931 -0
- package/resource/knowledge/trtc/c++/TXLiteAVCode.md +127 -0
- package/resource/knowledge/trtc/ios/TRTCCloud.md +2118 -0
- package/resource/knowledge/trtc/ios/TRTCCloudDef.md +975 -0
- package/resource/knowledge/trtc/ios/TRTCCloudDelegate.md +1131 -0
- package/resource/knowledge/trtc/ios/TRTCStatistics.md +68 -0
- package/resource/knowledge/trtc/ios/TXAudioEffectManager.md +423 -0
- package/resource/knowledge/trtc/ios/TXBeautyManager.md +416 -0
- package/resource/knowledge/trtc/ios/TXDeviceManager.md +387 -0
- package/resource/knowledge/trtc/ios/TXLiteAVCode.md +127 -0
- package/server-config.js +0 -1
- package/server.js +35 -12
- package/streamable-http.js +0 -1
- package/tools/call/get_native_call_uikit_integration.js +2 -4
- package/tools/call/get_native_callkit_core_integration.js +2 -6
- package/tools/call/get_web_call_uikit_integration.js +2 -4
- package/tools/chat/get_native_chat_uikit_integration.js +2 -4
- package/tools/chat/get_web_chat_uikit_integration.js +2 -4
- package/tools/common/get_usersig.js +0 -1
- package/tools/common/present_framework_choice.js +19 -14
- package/tools/common/record_answer.js +19 -26
- package/tools/common/record_feedback.js +17 -31
- package/tools/common/search_trtc_knowledge.js +44 -0
- package/tools/definitions/get_native_call_uikit_integration_def.js +3 -2
- package/tools/definitions/get_native_callkit_core_integration_def.js +5 -4
- package/tools/definitions/get_native_chat_uikit_integration_def.js +5 -3
- package/tools/definitions/get_native_livekit_core_integration_def.js +6 -6
- package/tools/definitions/get_usersig_def.js +0 -1
- package/tools/definitions/get_web_call_uikit_integration_def.js +4 -3
- package/tools/definitions/get_web_chat_uikit_integration_def.js +2 -1
- package/tools/definitions/get_web_live_uikit_integration_def.js +5 -6
- package/tools/definitions/get_web_room_core_integration_def.js +49 -0
- package/tools/definitions/get_web_room_uikit_integration_def.js +5 -5
- package/tools/definitions/integration-boundary.js +5 -0
- package/tools/definitions/present_framework_choice_def.js +12 -11
- package/tools/definitions/record_answer_def.js +19 -18
- package/tools/definitions/record_feedback_def.js +14 -14
- package/tools/definitions/search_trtc_knowledge_def.js +39 -0
- package/tools/index.js +5 -37
- package/tools/live/get_native_livekit_core_integration.js +1 -4
- package/tools/live/get_web_live_uikit_integration.js +2 -5
- package/tools/room/get_web_room_core_integration.js +47 -0
- package/tools/room/get_web_room_uikit_integration.js +2 -4
- package/utils/generate-structured-result.js +24 -31
- package/utils/generate-usersig.js +0 -1
- package/utils/get-device-identifier.js +0 -1
- package/utils/get-doc-content.js +14 -9
- package/utils/http-get.js +0 -1
- package/utils/http-post.js +0 -1
- package/utils/report-cls-client.js +18 -21
- package/utils/report-es-client.js +1 -2
- package/index.js.map +0 -1
- package/resource/doc/callkit/core-sdk/.gitkeep +0 -0
- package/resource/doc/callkit/core-sdk/android/answer-call.md +0 -852
- package/resource/doc/callkit/core-sdk/android/make-call.md +0 -954
- package/resource/doc/callkit/core-sdk/android/offline-push.md +0 -361
- package/resource/doc/callkit/core-sdk/flutter/answer-call.md +0 -1160
- package/resource/doc/callkit/core-sdk/flutter/make-call.md +0 -1205
- package/resource/doc/callkit/core-sdk/ios/answer-call.md +0 -1090
- package/resource/doc/callkit/core-sdk/ios/make-call.md +0 -1248
- package/resource/doc/callkit/core-sdk/ios/offline-push.md +0 -485
- package/resource/doc/callkit/core-sdk/uni-app/answer-call.md +0 -950
- package/resource/doc/callkit/core-sdk/uni-app/make-call.md +0 -1052
- package/resource/doc/callkit/faq/common/error-code.md +0 -47
- package/resource/doc/callkit/faq/flutter-faq.md +0 -115
- package/resource/doc/callkit/faq/ios-faq.md +0 -115
- package/resource/doc/callkit/faq/web-faq.md +0 -36
- package/resource/doc/callkit/preset/android/api.md +0 -296
- package/resource/doc/callkit/preset/flutter/api.md +0 -410
- package/resource/doc/callkit/preset/flutter/integration.md +0 -164
- package/resource/doc/callkit/preset/ios/api.md +0 -80
- package/resource/doc/callkit/preset/ios/integration.md +0 -187
- package/resource/doc/callkit/preset/react/api.md +0 -501
- package/resource/doc/callkit/preset/react/integration.md +0 -86
- package/resource/doc/callkit/preset/vue/api.md +0 -501
- package/resource/doc/callkit/preset/vue/integration.md +0 -83
- package/resource/doc/chatkit/android/faq.md +0 -111
- package/resource/doc/chatkit/android/features/theme.md +0 -219
- package/resource/doc/chatkit/android/integration.md +0 -490
- package/resource/doc/chatkit/faq/android_sdk/client-api.md +0 -281
- package/resource/doc/chatkit/faq/common/product.md +0 -7
- package/resource/doc/chatkit/faq/common/server.md +0 -44
- package/resource/doc/chatkit/faq/common/server_error_code.md +0 -74
- package/resource/doc/chatkit/faq/flutter_sdk/client-api.md +0 -199
- package/resource/doc/chatkit/faq/flutter_sdk/faq.md +0 -53
- package/resource/doc/chatkit/faq/ios_sdk/client-api.md +0 -235
- package/resource/doc/chatkit/faq/web_sdk/error_code.md +0 -47
- package/resource/doc/chatkit/faq/web_sdk/faq.md +0 -287
- package/resource/doc/chatkit/flutter/faq.md +0 -23
- package/resource/doc/chatkit/flutter/features/theme.md +0 -235
- package/resource/doc/chatkit/flutter/integration.md +0 -344
- package/resource/doc/chatkit/ios/faq.md +0 -111
- package/resource/doc/chatkit/ios/features/theme.md +0 -267
- package/resource/doc/chatkit/react/components/avatar.md +0 -104
- package/resource/doc/chatkit/react/components/chat-header.md +0 -148
- package/resource/doc/chatkit/react/components/chat-setting.md +0 -57
- package/resource/doc/chatkit/react/components/chat.md +0 -38
- package/resource/doc/chatkit/react/components/component-list.md +0 -37
- package/resource/doc/chatkit/react/components/conversation-actions.md +0 -174
- package/resource/doc/chatkit/react/components/conversation-list.md +0 -333
- package/resource/doc/chatkit/react/components/conversation-preview.md +0 -118
- package/resource/doc/chatkit/react/components/conversation-search.md +0 -60
- package/resource/doc/chatkit/react/components/message-list.md +0 -293
- package/resource/doc/chatkit/react/components/tuikit.md +0 -34
- package/resource/doc/chatkit/react/faq.md +0 -26
- package/resource/doc/chatkit/react/integration.md +0 -416
- package/resource/doc/chatkit/vue/components/avatar.md +0 -104
- package/resource/doc/chatkit/vue/components/chat-header.md +0 -148
- package/resource/doc/chatkit/vue/components/chat-setting.md +0 -62
- package/resource/doc/chatkit/vue/components/chat.md +0 -45
- package/resource/doc/chatkit/vue/components/component-list.md +0 -87
- package/resource/doc/chatkit/vue/components/contact-list.md +0 -271
- package/resource/doc/chatkit/vue/components/conversation-actions.md +0 -228
- package/resource/doc/chatkit/vue/components/conversation-list.md +0 -320
- package/resource/doc/chatkit/vue/components/conversation-preview.md +0 -213
- package/resource/doc/chatkit/vue/components/message-input.md +0 -1054
- package/resource/doc/chatkit/vue/components/message-list.md +0 -433
- package/resource/doc/chatkit/vue/components/tuikit.md +0 -31
- package/resource/doc/chatkit/vue/components/userpicker.md +0 -256
- package/resource/doc/chatkit/vue/faq.md +0 -36
- package/resource/doc/chatkit/vue/integration.md +0 -428
- package/resource/doc/livekit/core-sdk/live/flutter/live-host-interaction.md +0 -866
- package/resource/doc/livekit/faq/common/error-code.md +0 -88
- package/resource/doc/livekit/preset/live/vue/api-reference/index.md +0 -780
- package/resource/doc/livekit/preset/live/vue/components/co-guest-panel.md +0 -91
- package/resource/doc/livekit/preset/live/vue/components/live-scene-panel.md +0 -112
- package/resource/doc/livekit/preset/live/vue/components/stream-mixer.md +0 -215
- package/resource/doc/livekit/preset/live/vue/live-player-h5-integration.md +0 -300
- package/resource/doc/roomkit/faq/common/error-code.md +0 -67
- package/resource/doc/roomkit/vue/features/call-user-to-room.md +0 -220
- package/resource/doc/roomkit/vue/features/device-state.md +0 -460
- package/resource/doc/roomkit/vue/features/free-beauty-panel.md +0 -215
- package/resource/doc/roomkit/vue/features/room-chat.md +0 -369
- package/resource/doc/roomkit/vue/features/room-state.md +0 -282
- package/resource/doc/roomkit/vue/features/schedule-room.md +0 -318
- package/resource/doc/roomkit/vue/features/screen-share.md +0 -265
- package/resource/doc/roomkit/vue/features/virtual-background.md +0 -271
- package/resource/doc/roomkit/vue/integration.md +0 -315
- package/resource/doc/rtcengine/faq/common/error_code.md +0 -1
- package/resource/doc/rtcengine/faq/web_sdk/.gitkeep +0 -0
- package/resource/doc/rtcengine/web/.gitkeep +0 -0
- package/resource/doc/rtcengine/web/how_to_run_web_sdk_demo.md +0 -59
- package/resource/doc/trtc/C++/ITRTCCloud.md +0 -1970
- package/resource/doc/trtc/C++/ITRTCStatistics.md +0 -70
- package/resource/doc/trtc/C++/ITXAudioEffectManager.md +0 -469
- package/resource/doc/trtc/C++/ITXDeviceManager.md +0 -387
- package/resource/doc/trtc/C++/TRTCCloudCallback.md +0 -1082
- package/resource/doc/trtc/C++/TRTCTypeDef.md +0 -925
- package/resource/doc/trtc/C++/TXLiteAVCode.md +0 -129
- package/resource/doc/trtc/android/TRTCCloud.md +0 -1815
- package/resource/doc/trtc/android/TRTCCloudDef.md +0 -992
- package/resource/doc/trtc/android/TRTCCloudListener.md +0 -1004
- package/resource/doc/trtc/android/TRTCStatistics.md +0 -65
- package/resource/doc/trtc/android/TXAudioEffectManager.md +0 -469
- package/resource/doc/trtc/android/TXBeautyManager.md +0 -402
- package/resource/doc/trtc/android/TXDeviceManager.md +0 -173
- package/resource/doc/trtc/android/TXLiteAVCode.md +0 -127
- package/resource/doc/trtc/iOS/TRTCCloud.md +0 -2028
- package/resource/doc/trtc/iOS/TRTCCloudDef.md +0 -958
- package/resource/doc/trtc/iOS/TRTCCloudDelegate.md +0 -1046
- package/resource/doc/trtc/iOS/TRTCStatistics.md +0 -65
- package/resource/doc/trtc/iOS/TXAudioEffectManager.md +0 -397
- package/resource/doc/trtc/iOS/TXBeautyManager.md +0 -403
- package/resource/doc/trtc/iOS/TXDeviceManager.md +0 -381
- package/resource/doc/trtc/iOS/TXLiteAVCode.md +0 -130
- package/server-config.js.map +0 -1
- package/server.js.map +0 -1
- package/streamable-http.js.map +0 -1
- package/tools/call/get_callkit_api.js +0 -33
- package/tools/call/get_callkit_api.js.map +0 -1
- package/tools/call/get_native_call_uikit_integration.js.map +0 -1
- package/tools/call/get_native_callkit_core_integration.js.map +0 -1
- package/tools/call/get_web_call_uikit_integration.js.map +0 -1
- package/tools/chat/get_native_chat_uikit_feature_detail.js +0 -35
- package/tools/chat/get_native_chat_uikit_feature_detail.js.map +0 -1
- package/tools/chat/get_native_chat_uikit_integration.js.map +0 -1
- package/tools/chat/get_web_chat_uikit_component_detail.js +0 -35
- package/tools/chat/get_web_chat_uikit_component_detail.js.map +0 -1
- package/tools/chat/get_web_chat_uikit_integration.js.map +0 -1
- package/tools/common/get_faq.js +0 -266
- package/tools/common/get_faq.js.map +0 -1
- package/tools/common/get_usersig.js.map +0 -1
- package/tools/common/present_framework_choice.js.map +0 -1
- package/tools/common/record_answer.js.map +0 -1
- package/tools/common/record_feedback.js.map +0 -1
- package/tools/common/record_skill_session.js +0 -69
- package/tools/common/record_skill_session.js.map +0 -1
- package/tools/definitions/get_callkit_api_def.js +0 -29
- package/tools/definitions/get_callkit_api_def.js.map +0 -1
- package/tools/definitions/get_faq_def.js +0 -47
- package/tools/definitions/get_faq_def.js.map +0 -1
- package/tools/definitions/get_native_call_uikit_integration_def.js.map +0 -1
- package/tools/definitions/get_native_callkit_core_integration_def.js.map +0 -1
- package/tools/definitions/get_native_chat_uikit_feature_detail_def.js +0 -31
- package/tools/definitions/get_native_chat_uikit_feature_detail_def.js.map +0 -1
- package/tools/definitions/get_native_chat_uikit_integration_def.js.map +0 -1
- package/tools/definitions/get_native_livekit_core_features_def.js +0 -34
- package/tools/definitions/get_native_livekit_core_features_def.js.map +0 -1
- package/tools/definitions/get_native_livekit_core_integration_def.js.map +0 -1
- package/tools/definitions/get_native_trtc_sdk_docs_def.js +0 -32
- package/tools/definitions/get_native_trtc_sdk_docs_def.js.map +0 -1
- package/tools/definitions/get_usersig_def.js.map +0 -1
- package/tools/definitions/get_web_call_uikit_integration_def.js.map +0 -1
- package/tools/definitions/get_web_chat_uikit_component_detail_def.js +0 -31
- package/tools/definitions/get_web_chat_uikit_component_detail_def.js.map +0 -1
- package/tools/definitions/get_web_chat_uikit_integration_def.js.map +0 -1
- package/tools/definitions/get_web_live_uikit_integration_def.js.map +0 -1
- package/tools/definitions/get_web_livekit_api_def.js +0 -30
- package/tools/definitions/get_web_livekit_api_def.js.map +0 -1
- package/tools/definitions/get_web_livekit_component_detail_def.js +0 -32
- package/tools/definitions/get_web_livekit_component_detail_def.js.map +0 -1
- package/tools/definitions/get_web_room_uikit_integration_def.js.map +0 -1
- package/tools/definitions/get_web_roomkit_feature_detail_def.js +0 -31
- package/tools/definitions/get_web_roomkit_feature_detail_def.js.map +0 -1
- package/tools/definitions/get_web_trtc_sdk_api_def.js +0 -27
- package/tools/definitions/get_web_trtc_sdk_api_def.js.map +0 -1
- package/tools/definitions/get_web_trtc_sdk_integration_def.js +0 -27
- package/tools/definitions/get_web_trtc_sdk_integration_def.js.map +0 -1
- package/tools/definitions/get_web_trtc_sdk_plugin_def.js +0 -27
- package/tools/definitions/get_web_trtc_sdk_plugin_def.js.map +0 -1
- package/tools/definitions/present_framework_choice_def.js.map +0 -1
- package/tools/definitions/record_answer_def.js.map +0 -1
- package/tools/definitions/record_feedback_def.js.map +0 -1
- package/tools/definitions/record_skill_session_def.js +0 -31
- package/tools/definitions/record_skill_session_def.js.map +0 -1
- package/tools/index.js.map +0 -1
- package/tools/live/get_native_livekit_core_features.js +0 -68
- package/tools/live/get_native_livekit_core_features.js.map +0 -1
- package/tools/live/get_native_livekit_core_integration.js.map +0 -1
- package/tools/live/get_web_live_uikit_integration.js.map +0 -1
- package/tools/live/get_web_livekit_api.js +0 -33
- package/tools/live/get_web_livekit_api.js.map +0 -1
- package/tools/live/get_web_livekit_component_detail.js +0 -35
- package/tools/live/get_web_livekit_component_detail.js.map +0 -1
- package/tools/room/get_web_room_uikit_integration.js.map +0 -1
- package/tools/room/get_web_roomkit_feature_detail.js +0 -69
- package/tools/room/get_web_roomkit_feature_detail.js.map +0 -1
- package/tools/rtcengine/get_web_trtc_sdk_api.js +0 -32
- package/tools/rtcengine/get_web_trtc_sdk_api.js.map +0 -1
- package/tools/rtcengine/get_web_trtc_sdk_integration.js +0 -32
- package/tools/rtcengine/get_web_trtc_sdk_integration.js.map +0 -1
- package/tools/rtcengine/get_web_trtc_sdk_plugin.js +0 -32
- package/tools/rtcengine/get_web_trtc_sdk_plugin.js.map +0 -1
- package/tools/trtc/get_native_trtc_sdk_docs.js +0 -74
- package/tools/trtc/get_native_trtc_sdk_docs.js.map +0 -1
- package/utils/build-session-directives.js +0 -120
- package/utils/build-session-directives.js.map +0 -1
- package/utils/generate-structured-result.js.map +0 -1
- package/utils/generate-usersig.js.map +0 -1
- package/utils/get-device-identifier.js.map +0 -1
- package/utils/get-doc-content.js.map +0 -1
- package/utils/handle-framework.js +0 -9
- package/utils/handle-framework.js.map +0 -1
- package/utils/handle-state-name.js +0 -29
- package/utils/handle-state-name.js.map +0 -1
- package/utils/http-get.js.map +0 -1
- package/utils/http-post.js.map +0 -1
- package/utils/report-cls-client.js.map +0 -1
- package/utils/report-es-client.js.map +0 -1
- package/utils/report-runtime-error-cls-client.js +0 -91
- package/utils/report-runtime-error-cls-client.js.map +0 -1
- /package/resource/{doc/livekit/preset/live/vue/faq.md → knowledge/push/config/donut.md} +0 -0
- /package/resource/{doc/roomkit/vue/faq.md → knowledge/push/integration/donut.md} +0 -0
- /package/resource/{doc → knowledge}/rtcengine/web/api.md +0 -0
- /package/resource/{doc/rtcengine/faq/web/web.md → knowledge/rtcengine/web/faq.md} +0 -0
- /package/resource/{doc → knowledge}/rtcengine/web/how_to_integrated_web_sdk.md +0 -0
- /package/resource/{doc → knowledge}/rtcengine/web/plugin/20-advanced-customized-capture-rendering.md +0 -0
- /package/resource/{doc → knowledge}/rtcengine/web/plugin/28-advanced-beauty.md +0 -0
- /package/resource/{doc → knowledge}/rtcengine/web/plugin/30-advanced-cross-room-link.md +0 -0
- /package/resource/{doc → knowledge}/rtcengine/web/plugin/36-advanced-virtual-background.md +0 -0
- /package/resource/{doc → knowledge}/rtcengine/web/plugin/37-advanced-voice-changer.md +0 -0
- /package/resource/{doc → knowledge}/rtcengine/web/plugin/39-advanced-video-decoder.md +0 -0
- /package/resource/{doc → knowledge}/rtcengine/web/plugin/40-advanced-video-mixer.md +0 -0
- /package/resource/{doc → knowledge}/rtcengine/web/plugin/41-advanced-small-stream-auto-switcher.md +0 -0
- /package/resource/{doc → knowledge}/rtcengine/web/plugin/42-advanced-realtime-transcriber.md +0 -0
- /package/resource/{doc → knowledge}/rtcengine/web/plugin/43-advanced-face-detection.md +0 -0
|
@@ -1,950 +0,0 @@
|
|
|
1
|
-
This document helps you build a call-enabled **App** quickly by using the **AtomicXCore SDK** components — **DeviceState**, **CallState**, and the core widget **CallCoreView**.
|
|
2
|
-
|
|
3
|
-
## Preparation
|
|
4
|
-
|
|
5
|
-
### Step 1: Activate the Service
|
|
6
|
-
|
|
7
|
-
Follow the **Activate the Service** guide to obtain either a trial or paid version of the SDK.
|
|
8
|
-
|
|
9
|
-
### Step 2: Import AtomicXCore into the Current Project
|
|
10
|
-
|
|
11
|
-
1. **Install the component:** Open the [AtomicXCore SDK](https://ext.dcloud.net.cn/plugin?name=tuikit-atomic-x) marketplace page; click **Download Plugin and Import to HBuilderX**, select the target project, and click **Confirm**. Alternatively, download the source from the [Tencent-RTC/TUIKit_uni-app](https://github.com/Tencent-RTC/TUIKit_uni-app) repo and copy the `App/uni_modules/tuikit-atomic-x` directory into your project's `uni_modules/` folder.
|
|
12
|
-
|
|
13
|
-
2. **Configure project permissions:** Under `app-plus > distribute` in your project's `manifest.json`, make sure the following permissions are declared.
|
|
14
|
-
|
|
15
|
-
**Android (`Android` node):** Add the following entries to the `permissions` array:
|
|
16
|
-
|
|
17
|
-
```json
|
|
18
|
-
"<uses-permission android:name=\"android.permission.RECORD_AUDIO\" />",
|
|
19
|
-
"<uses-permission android:name=\"android.permission.CAMERA\"/>"
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
**iOS (`iOS` node):** Add the following entries to the `privacyDescription` object:
|
|
23
|
-
|
|
24
|
-
```json
|
|
25
|
-
"NSCameraUsageDescription" : "The app needs camera access to make calls",
|
|
26
|
-
"NSMicrophoneUsageDescription" : "The app needs microphone access to make calls"
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
Add `audio` to the `UIBackgroundModes` array to support background audio playback:
|
|
30
|
-
|
|
31
|
-
```json
|
|
32
|
-
"UIBackgroundModes" : [ "audio" ]
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
### Step 3: Implement the Login Logic
|
|
36
|
-
|
|
37
|
-
In your project, call the `login` method of `LoginState` to complete the login. **This is the prerequisite for using every feature of AtomicXCore.**
|
|
38
|
-
|
|
39
|
-
> **Important:**
|
|
40
|
-
>
|
|
41
|
-
> We recommend calling the `login` method of `LoginState` after your app's own user account has successfully logged in, so that the login flow stays clear and consistent.
|
|
42
|
-
|
|
43
|
-
```typescript
|
|
44
|
-
import { useLoginState } from "@/uni_modules/tuikit-atomic-x/state/LoginState";
|
|
45
|
-
|
|
46
|
-
const { login } = useLoginState();
|
|
47
|
-
|
|
48
|
-
const handleLogin = () => {
|
|
49
|
-
login({
|
|
50
|
-
sdkAppID: 1400000001, // Replace with your SDKAppID
|
|
51
|
-
userID: "test_001", // Replace with your UserID
|
|
52
|
-
userSig: "xxxxxxxxxx" // Use a temporary UserSig during development; when the MCP Server is configured with sdkAppID and sdkSecretKey, the tool can issue it for you
|
|
53
|
-
})
|
|
54
|
-
}
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
**Login parameter details:**
|
|
58
|
-
|
|
59
|
-
| **Parameter** | **Type** | **Description** |
|
|
60
|
-
| --- | --- | --- |
|
|
61
|
-
| `sdkAppID` | number | Obtain from the console; usually a 10-digit integer starting with `140` or `160`. |
|
|
62
|
-
| `userID` | string | Unique user ID, up to **32 bytes**, with **no special characters**; use letters and digits. Avoid simple IDs like `1` or `123` to reduce multi-device conflicts. |
|
|
63
|
-
| `userSig` | string | Authentication token. For development, generate a temporary `userSig` locally with `genTestUserSig` (see <https://github.com/Tencent-RTC/TUIKit_uni-app/blob/main/App/debug/GenerateTestUserSig.js>). When the **Tencent RTC MCP Server** is configured with `sdkAppID` and `sdkSecretKey`, the tool can auto-issue a `userSig` for you. **In production**, the business server must sign the UserSig with the secret key — never store or distribute the SecretKey on the client. |
|
|
64
|
-
|
|
65
|
-
## Implement Call Answering
|
|
66
|
-
|
|
67
|
-
### Step 1: Create the Call Page
|
|
68
|
-
|
|
69
|
-
You need a dedicated call page that is launched when a call starts. Implementation:
|
|
70
|
-
|
|
71
|
-
1. **Create the call page:** Add a new page to host the call UI and handle navigation when an incoming call arrives.
|
|
72
|
-
|
|
73
|
-
2. **Mount CallCoreView on the call page:** `CallCoreView` is the core call-view component. It automatically observes `CallState` and renders the call UI, and it supports layout switching, avatar and icon customization, and other UI customizations.
|
|
74
|
-
|
|
75
|
-
```vue
|
|
76
|
-
<call-core-view style="height: 50px; width: 50px;"></call-core-view>
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
> **Note:**
|
|
80
|
-
>
|
|
81
|
-
> `CallCoreView` is a native component and does not need an explicit `import` in the file. Just place it on the page.
|
|
82
|
-
|
|
83
|
-
**CallCoreView feature overview:**
|
|
84
|
-
|
|
85
|
-
| **Feature** | **Description** | **Reference** |
|
|
86
|
-
| --- | --- | --- |
|
|
87
|
-
| **Set layout mode** | Supports flexible layout switching. If not set, the layout adapts automatically based on the number of participants. | Switch Layout Modes |
|
|
88
|
-
| **Set avatar** | Supports custom avatars for specific users by passing avatar resource paths. | Customize Default Avatar |
|
|
89
|
-
| **Set volume-level icons** | Supports custom volume-level indicator icons for different levels. | Customize Volume Level Icons |
|
|
90
|
-
| **Set network-quality icons** | Supports custom network-quality indicator icons based on real-time network status. | Customize Network Quality Icons |
|
|
91
|
-
| **Set loading animation** | In group calls, supports a GIF animation to indicate users in the waiting state. | Customize Loading Animation |
|
|
92
|
-
|
|
93
|
-
### Step 2: Add Call Control Buttons
|
|
94
|
-
|
|
95
|
-
You can build your own buttons on top of the APIs provided by **DeviceState** and **CallState**.
|
|
96
|
-
|
|
97
|
-
- **DeviceState:** Microphone (toggle/volume), camera (toggle/switch/quality), screen sharing, and real-time device-state listening. Bind methods to button taps and watch the device state to refresh the button UI in real time.
|
|
98
|
-
- **CallState:** Core call actions such as answer, hang up, and reject. Bind methods to button taps and watch the call state so that the button display stays in sync with the current call stage.
|
|
99
|
-
- **Icon resources:** Button icons are available on GitHub. They are designed by our team for TUICallKit, are copyright-free, and can be used directly.
|
|
100
|
-
|
|
101
|
-
| **Resource** | **Description** | **Download** |
|
|
102
|
-
| --- | --- | --- |
|
|
103
|
-
| `accept.png` | Answer button icon. | [GitHub](https://github.com/Tencent-RTC/TUIKit_uni-app/blob/main/App/uni_modules/tuikit-atomic-x/static/icon/accept.png) |
|
|
104
|
-
| `hangup.png` | Hang up / reject button icon. | [GitHub](https://github.com/Tencent-RTC/TUIKit_uni-app/blob/main/App/uni_modules/tuikit-atomic-x/static/icon/hangup.png) |
|
|
105
|
-
| `camera-off.png` | Camera off. | [GitHub](https://github.com/Tencent-RTC/TUIKit_uni-app/blob/main/App/uni_modules/tuikit-atomic-x/static/icon/camera-off.png) |
|
|
106
|
-
| `camera-on.png` | Camera on. | [GitHub](https://github.com/Tencent-RTC/TUIKit_uni-app/blob/main/App/uni_modules/tuikit-atomic-x/static/icon/camera-on.png) |
|
|
107
|
-
| `mic-off.png` | Microphone off. | [GitHub](https://github.com/Tencent-RTC/TUIKit_uni-app/blob/main/App/uni_modules/tuikit-atomic-x/static/icon/mic-off.png) |
|
|
108
|
-
| `mic-on.png` | Microphone on. | [GitHub](https://github.com/Tencent-RTC/TUIKit_uni-app/blob/main/App/uni_modules/tuikit-atomic-x/static/icon/mic-on.png) |
|
|
109
|
-
| `handsfree-off.png` | Speaker off. | [GitHub](https://github.com/Tencent-RTC/TUIKit_uni-app/blob/main/App/uni_modules/tuikit-atomic-x/static/icon/handsfree-off.png) |
|
|
110
|
-
| `handsfree-on.png` | Speaker on. | [GitHub](https://github.com/Tencent-RTC/TUIKit_uni-app/blob/main/App/uni_modules/tuikit-atomic-x/static/icon/handsfree-on.png) |
|
|
111
|
-
|
|
112
|
-
**The following example shows how to add the Answer and Reject buttons:**
|
|
113
|
-
|
|
114
|
-
1. **Add the Answer button:** Bind the tap event to the `accept` method.
|
|
115
|
-
|
|
116
|
-
```vue
|
|
117
|
-
<template>
|
|
118
|
-
<view class="btn" @tap="handleAccept">
|
|
119
|
-
<image class="btn-img" :src="ACCEPT_SRC"></image>
|
|
120
|
-
<text class="btn-text">Answer</text>
|
|
121
|
-
</view>
|
|
122
|
-
</template>
|
|
123
|
-
|
|
124
|
-
<script setup lang="ts">
|
|
125
|
-
import ACCEPT_SRC from "../../../static/icon/accept.png"; // Replace with the actual icon path in your project
|
|
126
|
-
import { useCallState } from '@/uni_modules/tuikit-atomic-x/state/CallState';
|
|
127
|
-
|
|
128
|
-
const { accept } = useCallState();
|
|
129
|
-
|
|
130
|
-
const handleAccept = () => {
|
|
131
|
-
accept();
|
|
132
|
-
};
|
|
133
|
-
</script>
|
|
134
|
-
|
|
135
|
-
<style scoped>
|
|
136
|
-
.btn {
|
|
137
|
-
width: 60px;
|
|
138
|
-
margin: 10px 20px;
|
|
139
|
-
}
|
|
140
|
-
.btn-img {
|
|
141
|
-
width: 60px;
|
|
142
|
-
height: 60px;
|
|
143
|
-
border-radius: 140px;
|
|
144
|
-
}
|
|
145
|
-
.btn-text {
|
|
146
|
-
font-size: 12px;
|
|
147
|
-
color: #d5e0f2;
|
|
148
|
-
font-weight: 400;
|
|
149
|
-
text-align: center;
|
|
150
|
-
margin-top: 10px;
|
|
151
|
-
}
|
|
152
|
-
</style>
|
|
153
|
-
```
|
|
154
|
-
|
|
155
|
-
2. **Add the Reject button:** Bind the tap event to the `reject` method.
|
|
156
|
-
|
|
157
|
-
```vue
|
|
158
|
-
<template>
|
|
159
|
-
<view class="btn" @tap="handleReject">
|
|
160
|
-
<image class="btn-img" :src="REJECT_SRC"></image>
|
|
161
|
-
<text class="btn-text">Reject</text>
|
|
162
|
-
</view>
|
|
163
|
-
</template>
|
|
164
|
-
|
|
165
|
-
<script setup lang="ts">
|
|
166
|
-
import REJECT_SRC from "../../../static/icon/hangup.png"; // Replace with the actual icon path in your project
|
|
167
|
-
import { useCallState } from '@/uni_modules/tuikit-atomic-x/state/CallState';
|
|
168
|
-
|
|
169
|
-
const { reject } = useCallState();
|
|
170
|
-
|
|
171
|
-
const handleReject = () => {
|
|
172
|
-
reject();
|
|
173
|
-
};
|
|
174
|
-
</script>
|
|
175
|
-
|
|
176
|
-
<style scoped>
|
|
177
|
-
.btn {
|
|
178
|
-
margin: 10px 20px;
|
|
179
|
-
}
|
|
180
|
-
.btn-img {
|
|
181
|
-
width: 60px;
|
|
182
|
-
height: 60px;
|
|
183
|
-
border-radius: 140px;
|
|
184
|
-
}
|
|
185
|
-
.btn-text {
|
|
186
|
-
font-size: 12px;
|
|
187
|
-
color: #d5e0f2;
|
|
188
|
-
font-weight: 400;
|
|
189
|
-
text-align: center;
|
|
190
|
-
margin-top: 10px;
|
|
191
|
-
}
|
|
192
|
-
</style>
|
|
193
|
-
```
|
|
194
|
-
|
|
195
|
-
3. **Dismiss the UI when the caller cancels or you reject:** Both cases fire the `onCallEnded` event. Subscribe to it and dismiss the call UI when the call terminates.
|
|
196
|
-
|
|
197
|
-
```typescript
|
|
198
|
-
import { useCallState } from '@/uni_modules/tuikit-atomic-x/state/CallState';
|
|
199
|
-
import { useDeviceState } from '@/uni_modules/tuikit-atomic-x/state/DeviceState';
|
|
200
|
-
|
|
201
|
-
const { addCallListener } = useCallState();
|
|
202
|
-
const { closeLocalCamera, closeLocalMicrophone } = useDeviceState();
|
|
203
|
-
|
|
204
|
-
/**
|
|
205
|
-
* Initialize the call service (minimal example: handle only the call-end event and navigate back).
|
|
206
|
-
* It is recommended to invoke this on app startup.
|
|
207
|
-
*/
|
|
208
|
-
export function initCallService() {
|
|
209
|
-
addCallListener('onCallEnded', (event: string) => {
|
|
210
|
-
let res: any;
|
|
211
|
-
try {
|
|
212
|
-
res = JSON.parse(event);
|
|
213
|
-
} catch (error) {
|
|
214
|
-
console.error('[CallService] onCallEnded parse error:', error);
|
|
215
|
-
return;
|
|
216
|
-
}
|
|
217
|
-
console.log('[CallService] onCallEnded, reason:', res.reason);
|
|
218
|
-
|
|
219
|
-
// Close local devices
|
|
220
|
-
closeLocalCamera();
|
|
221
|
-
closeLocalMicrophone();
|
|
222
|
-
|
|
223
|
-
// Navigate back
|
|
224
|
-
const pages = getCurrentPages();
|
|
225
|
-
if (pages.length > 1) {
|
|
226
|
-
uni.navigateBack({ delta: 1 });
|
|
227
|
-
} else {
|
|
228
|
-
uni.redirectTo({ url: '/pages/index/index' }); // Example path; replace with the actual path in your project
|
|
229
|
-
}
|
|
230
|
-
});
|
|
231
|
-
}
|
|
232
|
-
```
|
|
233
|
-
|
|
234
|
-
### Step 3: Launch the Call UI on an Incoming Call
|
|
235
|
-
|
|
236
|
-
Subscribe to the incoming-call event (`onCallReceived`) in your project, and launch the call page when a call arrives. Implementation:
|
|
237
|
-
|
|
238
|
-
1. **Listen for the incoming-call event:** Subscribe to `onCallReceived`.
|
|
239
|
-
2. **Launch the call page:** Navigate to the call page when the event fires.
|
|
240
|
-
|
|
241
|
-
```typescript
|
|
242
|
-
import { useCallState } from '@/uni_modules/tuikit-atomic-x/state/CallState';
|
|
243
|
-
|
|
244
|
-
const { addCallListener } = useCallState();
|
|
245
|
-
|
|
246
|
-
// Call page route
|
|
247
|
-
const CALL_PAGE = '/uni_modules/tuikit-atomic-x/pages/call'; // Replace with the actual path created in Step 1
|
|
248
|
-
|
|
249
|
-
// Recommended to invoke on app startup
|
|
250
|
-
export function initCallService() {
|
|
251
|
-
addCallListener('onCallReceived', (event: string) => {
|
|
252
|
-
uni.navigateTo({
|
|
253
|
-
url: CALL_PAGE
|
|
254
|
-
});
|
|
255
|
-
});
|
|
256
|
-
}
|
|
257
|
-
```
|
|
258
|
-
|
|
259
|
-
### Step 4: Play Incoming-Call Ringtone
|
|
260
|
-
|
|
261
|
-
Subscribe to the incoming-call event (`onCallReceived`) and play a ringtone when a call arrives. Implementation:
|
|
262
|
-
|
|
263
|
-
1. **Listen for the incoming-call event:** Subscribe to `onCallReceived`.
|
|
264
|
-
2. **Play the ringtone:** Play a ringtone when the event fires; stop it when the call is connected or ended.
|
|
265
|
-
|
|
266
|
-
```typescript
|
|
267
|
-
import { watch } from 'vue';
|
|
268
|
-
import { useCallState } from '@/uni_modules/tuikit-atomic-x/state/CallState';
|
|
269
|
-
|
|
270
|
-
const { addCallListener, selfInfo } = useCallState();
|
|
271
|
-
|
|
272
|
-
/**
|
|
273
|
-
* Create or get the audio playback instance (singleton).
|
|
274
|
-
*/
|
|
275
|
-
function ensureAudioContext() {
|
|
276
|
-
if (!uni.$innerAudioContext) {
|
|
277
|
-
const ctx = uni.createInnerAudioContext();
|
|
278
|
-
ctx.onError((err: any) => {
|
|
279
|
-
console.error('[CallService] innerAudioContext onError:', err?.errCode, err?.errMsg || err);
|
|
280
|
-
});
|
|
281
|
-
uni.$innerAudioContext = ctx;
|
|
282
|
-
}
|
|
283
|
-
return uni.$innerAudioContext;
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
/**
|
|
287
|
-
* Play the ringtone.
|
|
288
|
-
* @param src - Path to the ringtone file.
|
|
289
|
-
*/
|
|
290
|
-
function playRingtone(src: string) {
|
|
291
|
-
const ctx = ensureAudioContext();
|
|
292
|
-
try {
|
|
293
|
-
ctx.stop();
|
|
294
|
-
} catch (_e) {}
|
|
295
|
-
ctx.src = src;
|
|
296
|
-
ctx.loop = true;
|
|
297
|
-
ctx.autoplay = true;
|
|
298
|
-
setTimeout(() => {
|
|
299
|
-
try {
|
|
300
|
-
ctx.play();
|
|
301
|
-
} catch (e) {
|
|
302
|
-
console.warn('[CallService] playRingtone play() error:', e);
|
|
303
|
-
}
|
|
304
|
-
}, 50);
|
|
305
|
-
}
|
|
306
|
-
|
|
307
|
-
/**
|
|
308
|
-
* Stop the ringtone.
|
|
309
|
-
*/
|
|
310
|
-
function stopRingtone() {
|
|
311
|
-
if (uni.$innerAudioContext) {
|
|
312
|
-
try {
|
|
313
|
-
uni.$innerAudioContext.loop = false;
|
|
314
|
-
uni.$innerAudioContext.stop();
|
|
315
|
-
} catch (e) {
|
|
316
|
-
console.warn('[CallService] stopRingtone error:', e);
|
|
317
|
-
}
|
|
318
|
-
}
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
export { playRingtone, stopRingtone };
|
|
322
|
-
|
|
323
|
-
// Invoke on app startup
|
|
324
|
-
export function initCallService() {
|
|
325
|
-
ensureAudioContext();
|
|
326
|
-
|
|
327
|
-
// Watch the call state: stop the ringtone when the call is connected (status === 2) or ended (status === 0)
|
|
328
|
-
watch(() => selfInfo.value, (newVal) => {
|
|
329
|
-
if (newVal?.status === 2 || newVal?.status === 0) {
|
|
330
|
-
stopRingtone();
|
|
331
|
-
}
|
|
332
|
-
}, { immediate: true, deep: true });
|
|
333
|
-
|
|
334
|
-
// Play the ringtone when an incoming call arrives
|
|
335
|
-
addCallListener('onCallReceived', () => {
|
|
336
|
-
playRingtone('/static/audio/ring.mp3');
|
|
337
|
-
});
|
|
338
|
-
|
|
339
|
-
// Stop the ringtone when the call ends
|
|
340
|
-
addCallListener('onCallEnded', () => {
|
|
341
|
-
stopRingtone();
|
|
342
|
-
});
|
|
343
|
-
}
|
|
344
|
-
```
|
|
345
|
-
|
|
346
|
-
### Step 5: Open Media Devices on Incoming Call
|
|
347
|
-
|
|
348
|
-
When an incoming call arrives, the `onCallReceived` event carries the media type. For a smoother user experience, pre-open the corresponding media devices when launching the call UI. Implementation:
|
|
349
|
-
|
|
350
|
-
1. **Listen for the incoming-call event:** Subscribe to `onCallReceived`.
|
|
351
|
-
2. **Open devices based on the media type:** For audio calls, open the microphone only; for video calls, open both microphone and camera.
|
|
352
|
-
|
|
353
|
-
```typescript
|
|
354
|
-
import { useCallState } from '@/uni_modules/tuikit-atomic-x/state/CallState';
|
|
355
|
-
import { useDeviceState } from '@/uni_modules/tuikit-atomic-x/state/DeviceState';
|
|
356
|
-
|
|
357
|
-
const { addCallListener } = useCallState();
|
|
358
|
-
const { openLocalCamera, openLocalMicrophone } = useDeviceState();
|
|
359
|
-
|
|
360
|
-
// Call page route
|
|
361
|
-
const CALL_PAGE = '/uni_modules/tuikit-atomic-x/pages/call'; // Replace with the actual path created in Step 1
|
|
362
|
-
|
|
363
|
-
// Invoke on app startup
|
|
364
|
-
export function initCallService() {
|
|
365
|
-
addCallListener('onCallReceived', (event: string) => {
|
|
366
|
-
let res: any;
|
|
367
|
-
try {
|
|
368
|
-
res = JSON.parse(event);
|
|
369
|
-
} catch (error) {
|
|
370
|
-
console.error('[CallService] onCallReceived parse error:', error);
|
|
371
|
-
return;
|
|
372
|
-
}
|
|
373
|
-
|
|
374
|
-
// Open the camera for video calls
|
|
375
|
-
if (res.mediaType === 1) {
|
|
376
|
-
openLocalCamera({ isFront: true });
|
|
377
|
-
}
|
|
378
|
-
|
|
379
|
-
// Open the microphone
|
|
380
|
-
openLocalMicrophone();
|
|
381
|
-
|
|
382
|
-
// Navigate to the call page
|
|
383
|
-
uni.navigateTo({
|
|
384
|
-
url: CALL_PAGE
|
|
385
|
-
});
|
|
386
|
-
});
|
|
387
|
-
}
|
|
388
|
-
```
|
|
389
|
-
|
|
390
|
-
### Demo Result
|
|
391
|
-
|
|
392
|
-
After completing the steps above, the "answer a call" feature is now ready to use.
|
|
393
|
-
|
|
394
|
-
## Customize the UI
|
|
395
|
-
|
|
396
|
-
`CallCoreView` provides extensive UI customization. You can freely replace avatars and indicator icons. For fast integration, download icons directly from **GitHub**. They are designed by our team for TUICallKit and are copyright-free.
|
|
397
|
-
|
|
398
|
-
### Customize Volume Level Icons
|
|
399
|
-
|
|
400
|
-
Set the `volumeLevelIcons` property of `CallCoreView` to assign icons for each volume level.
|
|
401
|
-
|
|
402
|
-
**Sample code for `volumeLevelIcons`:**
|
|
403
|
-
|
|
404
|
-
```vue
|
|
405
|
-
<template>
|
|
406
|
-
<view class="call-view-container">
|
|
407
|
-
<view :style="{ height: systemInfo?.windowHeight + 'px', width: systemInfo?.safeArea?.width + 'px' }">
|
|
408
|
-
<call-core-view
|
|
409
|
-
:style="{ height: systemInfo?.windowHeight + 'px', width: systemInfo?.safeArea?.width + 'px' }"
|
|
410
|
-
:volumeLevelIcons="volumeLevelIcons"
|
|
411
|
-
></call-core-view>
|
|
412
|
-
</view>
|
|
413
|
-
</view>
|
|
414
|
-
</template>
|
|
415
|
-
|
|
416
|
-
<script setup>
|
|
417
|
-
import { ref, onMounted } from 'vue';
|
|
418
|
-
|
|
419
|
-
const systemInfo = ref({});
|
|
420
|
-
|
|
421
|
-
/**
|
|
422
|
-
* Convert a `/static/` relative path into a local absolute path usable by the native layer.
|
|
423
|
-
*/
|
|
424
|
-
function toAbsolutePath(relativePath) {
|
|
425
|
-
if (plus && plus.io && plus.io.convertLocalFileSystemURL) {
|
|
426
|
-
return plus.io.convertLocalFileSystemURL(relativePath);
|
|
427
|
-
}
|
|
428
|
-
return relativePath;
|
|
429
|
-
}
|
|
430
|
-
|
|
431
|
-
/**
|
|
432
|
-
* Batch-convert every value in the object into an absolute path.
|
|
433
|
-
*/
|
|
434
|
-
function convertIconPaths(iconMap) {
|
|
435
|
-
const result = {};
|
|
436
|
-
Object.keys(iconMap).forEach(key => {
|
|
437
|
-
result[key] = toAbsolutePath(iconMap[key]);
|
|
438
|
-
});
|
|
439
|
-
return result;
|
|
440
|
-
}
|
|
441
|
-
|
|
442
|
-
// Volume-level icons: key is the level name, value is the local absolute path.
|
|
443
|
-
const volumeLevelIcons = ref(convertIconPaths({
|
|
444
|
-
"Mute": "/static/images/callview-self-mute.png", // Replace with the actual icon path in your project
|
|
445
|
-
"Low": "/static/images/callview-network.png" // Replace with the actual icon path in your project
|
|
446
|
-
}));
|
|
447
|
-
|
|
448
|
-
onMounted(() => {
|
|
449
|
-
uni.getSystemInfo({
|
|
450
|
-
success: (res) => {
|
|
451
|
-
systemInfo.value = res;
|
|
452
|
-
}
|
|
453
|
-
});
|
|
454
|
-
});
|
|
455
|
-
</script>
|
|
456
|
-
|
|
457
|
-
<style>
|
|
458
|
-
.call-view-container {
|
|
459
|
-
background: rgba(15, 16, 20, 0.5);
|
|
460
|
-
overflow: hidden;
|
|
461
|
-
}
|
|
462
|
-
</style>
|
|
463
|
-
```
|
|
464
|
-
|
|
465
|
-
> **Note:**
|
|
466
|
-
>
|
|
467
|
-
> Parameters that uni-app passes to the native layer only support local paths, so the relative path must be converted to an absolute local path.
|
|
468
|
-
|
|
469
|
-
**Property details:**
|
|
470
|
-
|
|
471
|
-
| **Parameter** | **Type** | **Required** | **Description** |
|
|
472
|
-
| --- | --- | --- | --- |
|
|
473
|
-
| `icons` | \[String: String\] | Yes | Mapping between volume levels and icon resources. Keys (`VolumeLevel`): `Mute` (microphone muted), `Low` (0-25], `Medium` (25-50], `High` (50-75], `Peak` (75-100]. Values (`String`): icon resource paths for each level. |
|
|
474
|
-
|
|
475
|
-
**Volume-level icons:**
|
|
476
|
-
|
|
477
|
-
| **Description** | **Download** |
|
|
478
|
-
| --- | --- |
|
|
479
|
-
| Volume indicator icon. Recommended for `Low` or `Medium` — displayed when the user's volume exceeds the configured level. | [GitHub](https://github.com/Tencent-RTC/TUIKit_uni-app/blob/main/App/static/images/callview-network.png) |
|
|
480
|
-
| Mute icon. Recommended for `Mute` — displayed when the user is muted. | [GitHub](https://github.com/Tencent-RTC/TUIKit_uni-app/blob/main/App/static/images/callview-self-mute.png) |
|
|
481
|
-
|
|
482
|
-
### Customize Network Quality Icons
|
|
483
|
-
|
|
484
|
-
Set the `networkQualityIcons` property of `CallCoreView` to assign icons for each network-quality state.
|
|
485
|
-
|
|
486
|
-
**Sample code for `networkQualityIcons`:**
|
|
487
|
-
|
|
488
|
-
```vue
|
|
489
|
-
<template>
|
|
490
|
-
<view class="call-view-container">
|
|
491
|
-
<view :style="{ height: systemInfo?.windowHeight + 'px', width: systemInfo?.safeArea?.width + 'px' }">
|
|
492
|
-
<call-core-view
|
|
493
|
-
:style="{ height: systemInfo?.windowHeight + 'px', width: systemInfo?.safeArea?.width + 'px' }"
|
|
494
|
-
:networkQualityIcons="networkQualityIcons"
|
|
495
|
-
></call-core-view>
|
|
496
|
-
</view>
|
|
497
|
-
</view>
|
|
498
|
-
</template>
|
|
499
|
-
|
|
500
|
-
<script setup>
|
|
501
|
-
import { ref, onMounted } from 'vue';
|
|
502
|
-
|
|
503
|
-
const systemInfo = ref({});
|
|
504
|
-
|
|
505
|
-
/**
|
|
506
|
-
* Convert a `/static/` relative path into a local absolute path usable by the native layer.
|
|
507
|
-
*/
|
|
508
|
-
function toAbsolutePath(relativePath) {
|
|
509
|
-
if (plus && plus.io && plus.io.convertLocalFileSystemURL) {
|
|
510
|
-
return plus.io.convertLocalFileSystemURL(relativePath);
|
|
511
|
-
}
|
|
512
|
-
return relativePath;
|
|
513
|
-
}
|
|
514
|
-
|
|
515
|
-
/**
|
|
516
|
-
* Batch-convert every value in the object into an absolute path.
|
|
517
|
-
*/
|
|
518
|
-
function convertIconPaths(iconMap) {
|
|
519
|
-
const result = {};
|
|
520
|
-
Object.keys(iconMap).forEach(key => {
|
|
521
|
-
result[key] = toAbsolutePath(iconMap[key]);
|
|
522
|
-
});
|
|
523
|
-
return result;
|
|
524
|
-
}
|
|
525
|
-
|
|
526
|
-
const networkQualityIcons = ref(convertIconPaths({
|
|
527
|
-
"BAD": "/static/images/callview-network-bad.png", // Replace with the actual icon path in your project
|
|
528
|
-
"VERY_BAD": "/static/images/callview-network-bad.png" // Replace with the actual icon path in your project
|
|
529
|
-
}));
|
|
530
|
-
|
|
531
|
-
onMounted(() => {
|
|
532
|
-
uni.getSystemInfo({
|
|
533
|
-
success: (res) => {
|
|
534
|
-
systemInfo.value = res;
|
|
535
|
-
}
|
|
536
|
-
});
|
|
537
|
-
});
|
|
538
|
-
</script>
|
|
539
|
-
|
|
540
|
-
<style>
|
|
541
|
-
.call-view-container {
|
|
542
|
-
background: rgba(15, 16, 20, 0.5);
|
|
543
|
-
overflow: hidden;
|
|
544
|
-
}
|
|
545
|
-
</style>
|
|
546
|
-
```
|
|
547
|
-
|
|
548
|
-
**`networkQualityIcons` parameter details:**
|
|
549
|
-
|
|
550
|
-
| **Parameter** | **Type** | **Required** | **Description** |
|
|
551
|
-
| --- | --- | --- | --- |
|
|
552
|
-
| `icons` | \[String: String\] | Yes | Mapping between network-quality levels and icon resources. Keys (`String`): `UNKNOWN`, `EXCELLENT`, `GOOD`, `POOR`, `BAD`, `VERY_BAD`, `DOWN`. Values (`String`): icon resource paths for each state. |
|
|
553
|
-
|
|
554
|
-
**Poor-network indicator icon:**
|
|
555
|
-
|
|
556
|
-
| **Description** | **Download** |
|
|
557
|
-
| --- | --- |
|
|
558
|
-
| Poor-network indicator icon. Recommended for `BAD`, `VERY_BAD`, or `DOWN` — displayed when the network condition is poor. | [GitHub](https://github.com/Tencent-RTC/TUIKit_uni-app/blob/main/App/static/images/callview-network-bad.png) |
|
|
559
|
-
|
|
560
|
-
### Customize Default Avatar
|
|
561
|
-
|
|
562
|
-
Set the `participantAvatars` property of `CallCoreView` to assign user avatars. We recommend watching the reactive `allParticipants` data (all participants in the call): set and display each user's avatar when it is available; show a default avatar (placeholder) when the user has no avatar or loading fails.
|
|
563
|
-
|
|
564
|
-
**Sample code for `participantAvatars`:**
|
|
565
|
-
|
|
566
|
-
```vue
|
|
567
|
-
<template>
|
|
568
|
-
<view class="call-view-container">
|
|
569
|
-
<view :style="{ height: systemInfo?.windowHeight + 'px', width: systemInfo?.safeArea?.width + 'px' }">
|
|
570
|
-
<call-core-view
|
|
571
|
-
:style="{ height: systemInfo?.windowHeight + 'px', width: systemInfo?.safeArea?.width + 'px' }"
|
|
572
|
-
:participantAvatars="participantAvatars"
|
|
573
|
-
></call-core-view>
|
|
574
|
-
</view>
|
|
575
|
-
</view>
|
|
576
|
-
</template>
|
|
577
|
-
|
|
578
|
-
<script setup>
|
|
579
|
-
import { ref, watch, onMounted } from 'vue';
|
|
580
|
-
import { useCallState } from '@/uni_modules/tuikit-atomic-x/state/CallState';
|
|
581
|
-
|
|
582
|
-
const { allParticipants } = useCallState();
|
|
583
|
-
const systemInfo = ref({});
|
|
584
|
-
const participantAvatars = ref({});
|
|
585
|
-
const avatarCache = {};
|
|
586
|
-
const DEFAULT_AVATAR_URL = "https://liteav.sdk.qcloud.com/app/res/picture/voiceroom/avatar/user_avatar1.png";
|
|
587
|
-
|
|
588
|
-
let defaultAvatarLocalPath = "";
|
|
589
|
-
let defaultAvatarReady = false;
|
|
590
|
-
|
|
591
|
-
/**
|
|
592
|
-
* Convert a relative path into a local absolute path usable by the native layer.
|
|
593
|
-
*/
|
|
594
|
-
function toAbsolutePath(relativePath) {
|
|
595
|
-
if (plus && plus.io && plus.io.convertLocalFileSystemURL) {
|
|
596
|
-
return plus.io.convertLocalFileSystemURL(relativePath);
|
|
597
|
-
}
|
|
598
|
-
return relativePath;
|
|
599
|
-
}
|
|
600
|
-
|
|
601
|
-
/**
|
|
602
|
-
* Download and cache an avatar; return the local absolute path.
|
|
603
|
-
*/
|
|
604
|
-
function downloadAvatar(url) {
|
|
605
|
-
if (avatarCache[url]) {
|
|
606
|
-
return Promise.resolve(avatarCache[url]);
|
|
607
|
-
}
|
|
608
|
-
return new Promise((resolve) => {
|
|
609
|
-
uni.downloadFile({
|
|
610
|
-
url,
|
|
611
|
-
success: (res) => {
|
|
612
|
-
if (res.statusCode === 200) {
|
|
613
|
-
const absolutePath = toAbsolutePath(res.tempFilePath);
|
|
614
|
-
avatarCache[url] = absolutePath;
|
|
615
|
-
resolve(absolutePath);
|
|
616
|
-
} else {
|
|
617
|
-
resolve(defaultAvatarLocalPath || "");
|
|
618
|
-
}
|
|
619
|
-
},
|
|
620
|
-
fail: () => {
|
|
621
|
-
resolve(defaultAvatarLocalPath || "");
|
|
622
|
-
}
|
|
623
|
-
});
|
|
624
|
-
});
|
|
625
|
-
}
|
|
626
|
-
|
|
627
|
-
// Pre-download the default avatar
|
|
628
|
-
const defaultAvatarPromise = downloadAvatar(DEFAULT_AVATAR_URL).then(localPath => {
|
|
629
|
-
defaultAvatarLocalPath = localPath;
|
|
630
|
-
defaultAvatarReady = true;
|
|
631
|
-
|
|
632
|
-
// Once the default avatar is ready, refresh participant avatars once
|
|
633
|
-
if (allParticipants.value && allParticipants.value.length > 0) {
|
|
634
|
-
updateParticipantAvatars(allParticipants.value);
|
|
635
|
-
}
|
|
636
|
-
});
|
|
637
|
-
|
|
638
|
-
/**
|
|
639
|
-
* Download avatars for the given participant list and build a { userId: localPath } map.
|
|
640
|
-
*/
|
|
641
|
-
async function updateParticipantAvatars(participants) {
|
|
642
|
-
if (!participants || participants.length === 0) {
|
|
643
|
-
participantAvatars.value = {};
|
|
644
|
-
return;
|
|
645
|
-
}
|
|
646
|
-
|
|
647
|
-
if (!defaultAvatarReady && defaultAvatarPromise) {
|
|
648
|
-
await defaultAvatarPromise;
|
|
649
|
-
}
|
|
650
|
-
|
|
651
|
-
const avatarMap = {};
|
|
652
|
-
const tasks = [];
|
|
653
|
-
participants.forEach(participant => {
|
|
654
|
-
if (participant.id && participant.avatarURL) {
|
|
655
|
-
tasks.push(
|
|
656
|
-
downloadAvatar(participant.avatarURL).then(localPath => {
|
|
657
|
-
avatarMap[participant.id] = localPath;
|
|
658
|
-
})
|
|
659
|
-
);
|
|
660
|
-
} else if (participant.id) {
|
|
661
|
-
avatarMap[participant.id] = defaultAvatarLocalPath || "";
|
|
662
|
-
}
|
|
663
|
-
});
|
|
664
|
-
await Promise.all(tasks);
|
|
665
|
-
participantAvatars.value = avatarMap;
|
|
666
|
-
}
|
|
667
|
-
|
|
668
|
-
// Watch participants and update the avatar map
|
|
669
|
-
watch(() => allParticipants.value, async (newVal) => {
|
|
670
|
-
if (!newVal) return;
|
|
671
|
-
await updateParticipantAvatars(newVal);
|
|
672
|
-
}, { immediate: true, deep: true });
|
|
673
|
-
|
|
674
|
-
onMounted(() => {
|
|
675
|
-
uni.getSystemInfo({
|
|
676
|
-
success: (res) => {
|
|
677
|
-
systemInfo.value = res;
|
|
678
|
-
}
|
|
679
|
-
});
|
|
680
|
-
});
|
|
681
|
-
</script>
|
|
682
|
-
|
|
683
|
-
<style>
|
|
684
|
-
.call-view-container {
|
|
685
|
-
background: rgba(15, 16, 20, 0.5);
|
|
686
|
-
overflow: hidden;
|
|
687
|
-
}
|
|
688
|
-
</style>
|
|
689
|
-
```
|
|
690
|
-
|
|
691
|
-
**`participantAvatars` parameter details:**
|
|
692
|
-
|
|
693
|
-
| **Parameter** | **Type** | **Required** | **Description** |
|
|
694
|
-
| --- | --- | --- | --- |
|
|
695
|
-
| `avatars` | \[String: String\] | Yes | User-avatar map. Key: the user's `userID`. Value: the absolute local path of that user's avatar resource. |
|
|
696
|
-
|
|
697
|
-
**Default avatar resource:**
|
|
698
|
-
|
|
699
|
-
| **Description** | **Download** |
|
|
700
|
-
| --- | --- |
|
|
701
|
-
| Default avatar. Recommended as a placeholder when the user's avatar fails to load or is not set. | [GitHub](https://github.com/Tencent-RTC/TUIKit_iOS/tree/main/atomic_x/Resources/AtomicX.xcassets/icon/call/default_participant_icon.imageset) |
|
|
702
|
-
|
|
703
|
-
### Customize Loading Animation
|
|
704
|
-
|
|
705
|
-
Set the `waitingAnimation` property of `CallCoreView` to display a waiting animation for users in the waiting state for a better experience.
|
|
706
|
-
|
|
707
|
-
**Sample code for `waitingAnimation`:**
|
|
708
|
-
|
|
709
|
-
```vue
|
|
710
|
-
<template>
|
|
711
|
-
<view class="call-view-container">
|
|
712
|
-
<view :style="{ height: systemInfo?.windowHeight + 'px', width: systemInfo?.safeArea?.width + 'px' }">
|
|
713
|
-
<call-core-view
|
|
714
|
-
:style="{ height: systemInfo?.windowHeight + 'px', width: systemInfo?.safeArea?.width + 'px' }"
|
|
715
|
-
:waitingAnimation="waitingAnimation"
|
|
716
|
-
></call-core-view>
|
|
717
|
-
</view>
|
|
718
|
-
</view>
|
|
719
|
-
</template>
|
|
720
|
-
|
|
721
|
-
<script setup>
|
|
722
|
-
import { ref, onMounted } from 'vue';
|
|
723
|
-
|
|
724
|
-
const systemInfo = ref({});
|
|
725
|
-
|
|
726
|
-
/**
|
|
727
|
-
* Convert a `/static/` relative path into a local absolute path usable by the native layer.
|
|
728
|
-
*/
|
|
729
|
-
function toAbsolutePath(relativePath) {
|
|
730
|
-
if (plus && plus.io && plus.io.convertLocalFileSystemURL) {
|
|
731
|
-
return plus.io.convertLocalFileSystemURL(relativePath);
|
|
732
|
-
}
|
|
733
|
-
return relativePath;
|
|
734
|
-
}
|
|
735
|
-
|
|
736
|
-
// Waiting animation GIF: pass a local absolute path to the native component for rendering
|
|
737
|
-
const waitingAnimation = ref(toAbsolutePath("/static/images/callview-loading.gif")); // Replace with the actual icon path in your project
|
|
738
|
-
|
|
739
|
-
onMounted(() => {
|
|
740
|
-
uni.getSystemInfo({
|
|
741
|
-
success: (res) => {
|
|
742
|
-
systemInfo.value = res;
|
|
743
|
-
}
|
|
744
|
-
});
|
|
745
|
-
});
|
|
746
|
-
</script>
|
|
747
|
-
|
|
748
|
-
<style>
|
|
749
|
-
.call-view-container {
|
|
750
|
-
background: rgba(15, 16, 20, 0.5);
|
|
751
|
-
overflow: hidden;
|
|
752
|
-
}
|
|
753
|
-
</style>
|
|
754
|
-
```
|
|
755
|
-
|
|
756
|
-
**`waitingAnimation` parameter details:**
|
|
757
|
-
|
|
758
|
-
| **Parameter** | **Type** | **Required** | **Description** |
|
|
759
|
-
| --- | --- | --- | --- |
|
|
760
|
-
| `path` | String | Yes | Absolute path of the GIF image resource. |
|
|
761
|
-
|
|
762
|
-
**Waiting animation:**
|
|
763
|
-
|
|
764
|
-
| **Description** | **Download** |
|
|
765
|
-
| --- | --- |
|
|
766
|
-
| User waiting animation. Recommended for group calls — displayed when the user's status is `waiting`. | [GitHub](https://github.com/Tencent-RTC/TUIKit_uni-app/blob/main/App/static/images/callview-loading.gif) |
|
|
767
|
-
|
|
768
|
-
### Add Call Duration Indicator
|
|
769
|
-
|
|
770
|
-
The call duration is exposed in real time through the `duration` field of the reactive `activeCall` data. To display it:
|
|
771
|
-
|
|
772
|
-
1. **Bind the call duration to the UI:** Bind the `activeCall.duration` field to the UI. The field is reactive and drives UI refresh automatically — no manual timer is required.
|
|
773
|
-
|
|
774
|
-
```vue
|
|
775
|
-
<template>
|
|
776
|
-
<view v-if="isConnected" class="call-timer">
|
|
777
|
-
<text class="timer-text">{{ formattedTime }}</text>
|
|
778
|
-
</view>
|
|
779
|
-
</template>
|
|
780
|
-
|
|
781
|
-
<script setup lang="ts">
|
|
782
|
-
import { computed } from 'vue';
|
|
783
|
-
import { useCallState } from '@/uni_modules/tuikit-atomic-x/state/CallState';
|
|
784
|
-
|
|
785
|
-
const { selfInfo, activeCall } = useCallState();
|
|
786
|
-
|
|
787
|
-
const isConnected = computed(() => {
|
|
788
|
-
return selfInfo.value?.status === 2;
|
|
789
|
-
});
|
|
790
|
-
|
|
791
|
-
const formattedTime = computed(() => {
|
|
792
|
-
const duration = activeCall.value?.duration ?? 0;
|
|
793
|
-
const hours = Math.floor(duration / 3600);
|
|
794
|
-
const minutes = Math.floor((duration % 3600) / 60);
|
|
795
|
-
const seconds = duration % 60;
|
|
796
|
-
const pad = (n: number) => n.toString().padStart(2, '0');
|
|
797
|
-
if (hours > 0) {
|
|
798
|
-
return `${pad(hours)}:${pad(minutes)}:${pad(seconds)}`;
|
|
799
|
-
}
|
|
800
|
-
return `${pad(minutes)}:${pad(seconds)}`;
|
|
801
|
-
});
|
|
802
|
-
</script>
|
|
803
|
-
|
|
804
|
-
<style scoped>
|
|
805
|
-
.call-timer {
|
|
806
|
-
display: flex;
|
|
807
|
-
align-items: center;
|
|
808
|
-
justify-content: center;
|
|
809
|
-
}
|
|
810
|
-
.timer-text {
|
|
811
|
-
font-size: 28rpx;
|
|
812
|
-
color: #FFFFFF;
|
|
813
|
-
font-weight: 400;
|
|
814
|
-
}
|
|
815
|
-
</style>
|
|
816
|
-
```
|
|
817
|
-
|
|
818
|
-
## More Features
|
|
819
|
-
|
|
820
|
-
### Customize User Avatar / Nickname
|
|
821
|
-
|
|
822
|
-
Before the call starts, you can use `setSelfInfo` to set your own nickname and avatar.
|
|
823
|
-
|
|
824
|
-
**Sample code for `setSelfInfo`:**
|
|
825
|
-
|
|
826
|
-
```typescript
|
|
827
|
-
import { useLoginState } from "@/uni_modules/tuikit-atomic-x/state/LoginState";
|
|
828
|
-
|
|
829
|
-
const { setSelfInfo } = useLoginState();
|
|
830
|
-
|
|
831
|
-
/**
|
|
832
|
-
* Set the personal info (nickname, avatar, etc.) of the currently logged-in user.
|
|
833
|
-
*/
|
|
834
|
-
export const setSelfUserInfo = (userID: string, nickname: string, avatarURL: string): void => {
|
|
835
|
-
setSelfInfo({
|
|
836
|
-
userProfile: {
|
|
837
|
-
userID,
|
|
838
|
-
nickname,
|
|
839
|
-
avatarURL,
|
|
840
|
-
},
|
|
841
|
-
success: () => {
|
|
842
|
-
console.log('User info set successfully');
|
|
843
|
-
},
|
|
844
|
-
fail: (errCode: number, errMsg: string) => {
|
|
845
|
-
console.error('Failed to set user info:', errCode, errMsg);
|
|
846
|
-
},
|
|
847
|
-
});
|
|
848
|
-
};
|
|
849
|
-
```
|
|
850
|
-
|
|
851
|
-
**`setSelfInfo` parameter details:**
|
|
852
|
-
|
|
853
|
-
| **Parameter** | **Type** | **Required** | **Description** |
|
|
854
|
-
| --- | --- | --- | --- |
|
|
855
|
-
| `userProfile` | UserProfile | Yes | User info struct: `userID` (the user's ID), `avatarURL` (avatar URL), `nickname` (nickname). See `UserProfile` for more fields. |
|
|
856
|
-
|
|
857
|
-
### Switch Layout Modes
|
|
858
|
-
|
|
859
|
-
`CallCoreView` ships with three built-in layout modes. Set the `layoutTemplate` property to choose one. If not specified, `CallCoreView` adapts automatically based on the number of participants: 1-on-1 defaults to `Float` mode; multi-party calls switch to `Grid` mode. The layout modes are:
|
|
860
|
-
|
|
861
|
-
| **Mode** | **Layout** | **Interaction** |
|
|
862
|
-
| --- | --- | --- |
|
|
863
|
-
| **Float** | Full-screen self-view while waiting; after connecting, full-screen remote view with a floating self-view. | The floating window can be dragged; tap it to swap with the main view. |
|
|
864
|
-
| **Grid** | All participants are tiled in a grid layout — suitable for 2+ users. Tap to enlarge a single view. | Tap a participant's view to enlarge it. |
|
|
865
|
-
| **PIP** | 1v1 always shows the remote view; multi-party uses the active-speaker strategy and full-screen the current speaker. | While waiting, the self-view is shown; after connecting, the call duration is displayed. |
|
|
866
|
-
|
|
867
|
-
**Sample code for `layoutTemplate`:**
|
|
868
|
-
|
|
869
|
-
```vue
|
|
870
|
-
<template>
|
|
871
|
-
<view class="call-view-container">
|
|
872
|
-
<view :style="{ height: systemInfo?.windowHeight + 'px', width: systemInfo?.safeArea?.width + 'px' }">
|
|
873
|
-
<call-core-view
|
|
874
|
-
:style="{ height: systemInfo?.windowHeight + 'px', width: systemInfo?.safeArea?.width + 'px' }"
|
|
875
|
-
:layoutTemplate="layoutTemplate"
|
|
876
|
-
></call-core-view>
|
|
877
|
-
</view>
|
|
878
|
-
</view>
|
|
879
|
-
</template>
|
|
880
|
-
|
|
881
|
-
<script setup>
|
|
882
|
-
import { ref, watch, onMounted } from 'vue';
|
|
883
|
-
import { useCallState } from '@/uni_modules/tuikit-atomic-x/state/CallState';
|
|
884
|
-
|
|
885
|
-
const { activeCall } = useCallState();
|
|
886
|
-
const systemInfo = ref({});
|
|
887
|
-
// Layout template: 'Float' for single floating-window layout, 'Grid' for multi-party tile layout
|
|
888
|
-
const layoutTemplate = ref("Grid");
|
|
889
|
-
|
|
890
|
-
// Switch layout automatically based on call info: Grid for multi-party / group, Float for 1-on-1
|
|
891
|
-
watch(() => activeCall.value, (newValue) => {
|
|
892
|
-
if (!newValue || !newValue.inviteeIds) {
|
|
893
|
-
return;
|
|
894
|
-
}
|
|
895
|
-
const newTemplate = (newValue.inviteeIds.length > 1 || newValue.chatGroupId !== '') ? 'Grid' : 'Float';
|
|
896
|
-
if (layoutTemplate.value !== newTemplate) {
|
|
897
|
-
layoutTemplate.value = newTemplate;
|
|
898
|
-
}
|
|
899
|
-
}, { immediate: true, deep: true });
|
|
900
|
-
|
|
901
|
-
onMounted(() => {
|
|
902
|
-
uni.getSystemInfo({
|
|
903
|
-
success: (res) => {
|
|
904
|
-
systemInfo.value = res;
|
|
905
|
-
}
|
|
906
|
-
});
|
|
907
|
-
});
|
|
908
|
-
</script>
|
|
909
|
-
|
|
910
|
-
<style>
|
|
911
|
-
.call-view-container {
|
|
912
|
-
background: rgba(15, 16, 20, 0.5);
|
|
913
|
-
overflow: hidden;
|
|
914
|
-
}
|
|
915
|
-
</style>
|
|
916
|
-
```
|
|
917
|
-
|
|
918
|
-
**`layoutTemplate` parameter details:**
|
|
919
|
-
|
|
920
|
-
| **Parameter** | **Type** | **Description** |
|
|
921
|
-
| --- | --- | --- |
|
|
922
|
-
| `layoutTemplate` | String | Layout mode of `CallCoreView`. **Float**: full-screen self-view while waiting; after connecting, full-screen remote view with a floating self-view; floating window supports drag and tap-to-swap. **Grid**: all participants tiled in a grid; suitable for 2+ users; tap to enlarge a single view. **PIP**: 1v1 always shows the remote view; multi-party uses the active-speaker strategy and full-screen the current speaker; while waiting, the self-view is shown; after connecting, the call duration is displayed. |
|
|
923
|
-
|
|
924
|
-
## FAQ
|
|
925
|
-
|
|
926
|
-
### How can I keep the screen always on during a call?
|
|
927
|
-
|
|
928
|
-
uni-app provides `uni.setScreenBrightness` for this purpose.
|
|
929
|
-
|
|
930
|
-
### How do I disable the system swipe-back-to-previous-page behavior?
|
|
931
|
-
|
|
932
|
-
- **iOS:** Set the `disableSwipeBack` property on the page. See the uni-app official documentation for details.
|
|
933
|
-
- **Android:** Intercept the system swipe gesture and the physical Back key via `onBackPress`. Sample code:
|
|
934
|
-
|
|
935
|
-
> **Note:**
|
|
936
|
-
>
|
|
937
|
-
> Intercepting the system swipe gesture and the physical Back key with this approach requires the page to use a custom navigation bar.
|
|
938
|
-
|
|
939
|
-
```vue
|
|
940
|
-
<script setup>
|
|
941
|
-
import { onBackPress } from '@dcloudio/uni-app';
|
|
942
|
-
|
|
943
|
-
// Intercept the system swipe and physical Back key to avoid accidentally exiting during a call
|
|
944
|
-
onBackPress((option) => {
|
|
945
|
-
if (option.from === 'backbutton') {
|
|
946
|
-
return true; // Returning true blocks the default back behavior
|
|
947
|
-
}
|
|
948
|
-
});
|
|
949
|
-
</script>
|
|
950
|
-
```
|