@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
|
@@ -0,0 +1,1111 @@
|
|
|
1
|
+
This document will guide you through integrating the **AtomicXCore SDK** components: **DeviceStore**, **CallStore**, and the core widget **CallCoreView** to quickly implement call answering functionality.
|
|
2
|
+
|
|
3
|
+
## Core Features
|
|
4
|
+
|
|
5
|
+
To build multi-party audio/video call scenarios with **AtomicXCore**, use these three core modules:
|
|
6
|
+
|
|
7
|
+
|Module|Description|
|
|
8
|
+
|---------|---------|
|
|
9
|
+
|[CallCoreView](https://liteav.sdk.qcloud.com/doc/product/tuikit/atomic-x/flutter/v1.0/en/api_view_call_call_core_view/CallCoreView-class.html)|Core call view widget. Automatically listens to CallStore data and renders the call UI, with automatic layout switching for 1-on-1 and group calls.|
|
|
10
|
+
|[CallStore](https://liteav.sdk.qcloud.com/doc/product/tuikit/atomic-x/flutter/v1.0/en/api_call_call_store/CallStore-class.html)|Manages the call lifecycle, including dialing, answering, rejecting, and hanging up. Provides real-time participant audio/video status, call duration, call history, and other data.|
|
|
11
|
+
|[DeviceStore](https://liteav.sdk.qcloud.com/doc/product/tuikit/atomic-x/flutter/v1.0/en/api_device_device_store/DeviceStore-class.html)|Controls audio/video devices: microphone (toggle/volume), camera (toggle/switch/quality), screen sharing, and real-time device status monitoring.|
|
|
12
|
+
|
|
13
|
+
## Getting Started
|
|
14
|
+
|
|
15
|
+
### Step 1: Activate the Service
|
|
16
|
+
|
|
17
|
+
Visit Activate the Service to obtain either a trial or paid version of the SDK.
|
|
18
|
+
|
|
19
|
+
### Step 2: Integrate the SDK
|
|
20
|
+
|
|
21
|
+
**Install the package:** In your project root, run:
|
|
22
|
+
``` bash
|
|
23
|
+
flutter pub add atomic_x_core
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
### Step 3: Initialization and Login
|
|
27
|
+
|
|
28
|
+
#### Android Configuration
|
|
29
|
+
1. Because the SDK uses Java reflection internally, you must add certain SDK classes to your Proguard keep list.
|
|
30
|
+
|
|
31
|
+
- Edit your project's `build.gradle.kts` (or `build.gradle`) in the `android/app/` directory to enable Proguard rules:
|
|
32
|
+
|
|
33
|
+
``` java
|
|
34
|
+
android {
|
|
35
|
+
buildTypes {
|
|
36
|
+
release {
|
|
37
|
+
isMinifyEnabled = true
|
|
38
|
+
proguardFiles(
|
|
39
|
+
getDefaultProguardFile("proguard-android.txt"),
|
|
40
|
+
"proguard-rules.pro"
|
|
41
|
+
)
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
```
|
|
46
|
+
``` java
|
|
47
|
+
android {
|
|
48
|
+
buildTypes {
|
|
49
|
+
release {
|
|
50
|
+
minifyEnabled true
|
|
51
|
+
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
```
|
|
56
|
+
- Create a `proguard-rules.pro` file in your `android/app` directory and add:
|
|
57
|
+
|
|
58
|
+
``` java
|
|
59
|
+
-keep class com.tencent.** { *; }
|
|
60
|
+
```
|
|
61
|
+
2. (Optional) To use CallKit's floating window feature outside the app, enable system Picture-in-Picture.
|
|
62
|
+
|
|
63
|
+
In your `AndroidManifest.xml`, set `android:supportsPictureInPicture="true"` for `MainActivity`:
|
|
64
|
+
|
|
65
|
+
``` xml
|
|
66
|
+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
|
67
|
+
<application>
|
|
68
|
+
<activity
|
|
69
|
+
android:name=".MainActivity"
|
|
70
|
+
android:supportsPictureInPicture="true"
|
|
71
|
+
</activity>
|
|
72
|
+
</application>
|
|
73
|
+
</manifest>
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
#### iOS Configuration
|
|
77
|
+
|
|
78
|
+
Since tencent_rtc_sdk uses Flutter FFI, Xcode's symbol stripping during Release builds may remove TRTC C symbols, causing `symbol not found` errors. To fix:
|
|
79
|
+
1. In Xcode Build Settings, set **Deployment Postprocessing** to **Yes**.
|
|
80
|
+
|
|
81
|
+
2. Set **Strip Style** for Release to **Non-Global Symbols**.
|
|
82
|
+
|
|
83
|
+
#### Initialize and Log in
|
|
84
|
+
|
|
85
|
+
To start the call service, initialize `CallStore` and log in the user. On successful login, `CallStore` will sync user info and enter the ready state. See the flowchart and sample code below:
|
|
86
|
+
|
|
87
|
+
``` java
|
|
88
|
+
import 'package:atomic_x_core/atomicxcore.dart';
|
|
89
|
+
import 'package:rtc_room_engine/api/call/tui_call_engine.dart';
|
|
90
|
+
|
|
91
|
+
Future<void> _login() async {
|
|
92
|
+
int sdkAppId = 1400000001; // Replace with your SDKAppID
|
|
93
|
+
String userId = 'test_001'; // Replace with your UserID
|
|
94
|
+
String userSig = 'xxxxxxxxxxx'; // Replace with your UserSig
|
|
95
|
+
|
|
96
|
+
CallStore.shared;
|
|
97
|
+
final result = await LoginStore.shared.login(sdkAppId, userId, userSig);
|
|
98
|
+
TUICallEngine.instance.init(sdkAppId, userId, userSig);
|
|
99
|
+
if (result.isSuccess) {
|
|
100
|
+
// Login successful
|
|
101
|
+
debugPrint('login success');
|
|
102
|
+
} else {
|
|
103
|
+
// Login failed
|
|
104
|
+
debugPrint('login failed, code: ${result.code}, message: ${result.message}');
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
```
|
|
108
|
+
| Parameter | Type | Description |
|
|
109
|
+
| --- | --- | --- |
|
|
110
|
+
| userId | String | Unique ID for the current user. Only letters, numbers, hyphens, and underscores are allowed. To prevent conflicts with multi-device login, avoid using simple IDs like <code>1</code> or <code>123</code>. |
|
|
111
|
+
| sdkAppId | int | Obtain from the <a href="https://trtc.io/login?fro=gt&s_url=https%3A%2F%2Fconsole.trtc.io%2F">console</a>. Usually a 10-digit integer starting with 140 or 160. |
|
|
112
|
+
| userSig | String | Authentication token for TRTC.<br>- <strong>Development</strong>: Generate userSig locally using <a href="https://github.com/Tencent-RTC/TUIKit_Flutter/blob/main/call/example/lib/debug/generate_test_user_sig.dart">GenerateTestUserSig.genTestUserSig</a> or via the <a href="https://console.trtc.io/usersig">UserSig Tool</a> for temporary userSig.<br>- <strong>Production</strong>: Always generate userSig server-side to prevent secret key leakage. See Server-side UserSig Generation.<br>For details, refer to How to calculate and use UserSig. |
|
|
113
|
+
|
|
114
|
+
## Implement Call Answering
|
|
115
|
+
|
|
116
|
+
**You must be logged in before you can answer a call.** Follow these six steps to implement the call answering feature.
|
|
117
|
+
|
|
118
|
+
### Step 1: Create the Call Page
|
|
119
|
+
|
|
120
|
+
Create a call page that is shown when an incoming call arrives.
|
|
121
|
+
1. **Create the call page:** Implement a `StatefulWidget` to host the call page and manage navigation for incoming calls.
|
|
122
|
+
|
|
123
|
+
2. **Add CallCoreView widget to the call page:** The core call UI requires a controller and automatically listens to **CallStore** data. It will render the UI and adapt layouts for both 1-on-1 and group calls.
|
|
124
|
+
|
|
125
|
+
``` java
|
|
126
|
+
import 'package:flutter/material.dart';
|
|
127
|
+
import 'package:atomic_x_core/atomicxcore.dart';
|
|
128
|
+
|
|
129
|
+
// 1. Create Call Page Widget
|
|
130
|
+
class CallPage extends StatefulWidget {
|
|
131
|
+
const CallPage({super.key});
|
|
132
|
+
|
|
133
|
+
@override
|
|
134
|
+
State<CallPage> createState() => _CallPageState();
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
class _CallPageState extends State<CallPage> {
|
|
138
|
+
late CallCoreController controller;
|
|
139
|
+
|
|
140
|
+
@override
|
|
141
|
+
void initState() {
|
|
142
|
+
super.initState();
|
|
143
|
+
controller = CallCoreController.create();
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
@override
|
|
147
|
+
Widget build(BuildContext context) {
|
|
148
|
+
// 2. Add CallCoreView widget to Call Page
|
|
149
|
+
return CallCoreView(controller: controller);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
**CallCoreView Widget Feature Overview:**
|
|
155
|
+
|
|
156
|
+
|Feature|Description|Reference Doc|
|
|
157
|
+
|---------|---------|---------|
|
|
158
|
+
|Set Layout Mode|Supports flexible layout mode switching. If unset, layout automatically adapts based on participant count.|Switch Layout Mode|
|
|
159
|
+
|Set Avatar|Supports custom avatars for specific users via resource path.|Customize Default Avatar|
|
|
160
|
+
|Set Volume Indicator Icon|Supports custom volume indicator icons for different volume levels.|Customize Volume Indicator Icon|
|
|
161
|
+
|Set Network Indicator Icon|Supports real-time network quality indicator icons.|Customize Network Indicator Icon|
|
|
162
|
+
|Set Waiting Animation for Pending Users|In group calls, supports GIF animation for users in waiting state.|Customize Loading Animation|
|
|
163
|
+
|
|
164
|
+
### Step 2: Add Answer and Reject Buttons
|
|
165
|
+
|
|
166
|
+
Use the APIs from [DeviceStore](https://liteav.sdk.qcloud.com/doc/product/tuikit/atomic-x/flutter/v1.0/en/api_device_device_store/DeviceStore-class.html) and [CallStore](https://liteav.sdk.qcloud.com/doc/product/tuikit/atomic-x/flutter/v1.0/en/api_call_call_store/CallStore-class.html) to customize your buttons.
|
|
167
|
+
- **DeviceStore Overview:** Microphone (toggle/volume), camera (toggle/switch/quality), screen sharing, and real-time device monitoring. Bind method calls to button taps and listen for device state changes to update button UI dynamically.
|
|
168
|
+
|
|
169
|
+
- **CallStore Overview:** Core call controls (answer, hang up, reject). Bind method calls to button taps and listen for call state changes to sync button display with call status.
|
|
170
|
+
|
|
171
|
+
- **Icon Resource Download:** Button icons are available on [GitHub](https://github.com/iveshzf/TUIKit_Flutter/tree/main/call/assets/images). These icons are custom-designed for TUICallKit and are free to use.
|
|
172
|
+
|
|
173
|
+
|Icons:|||||||||
|
|
174
|
+
|---------|---------|---------|---------|---------|---------|---------|---------|---------|
|
|
175
|
+
|
|
176
|
+
1. **Add Answer and Reject Buttons:** Create a button bar at the bottom and add "Answer" and "Reject" buttons. Bind their tap events to the [accept](https://liteav.sdk.qcloud.com/doc/product/tuikit/atomic-x/flutter/v1.0/en/api_call_call_store/CallStore/accept.html) and [reject](https://liteav.sdk.qcloud.com/doc/product/tuikit/atomic-x/flutter/v1.0/en/api_call_call_store/CallStore/reject.html) methods.
|
|
177
|
+
|
|
178
|
+
``` java
|
|
179
|
+
import 'package:flutter/material.dart';
|
|
180
|
+
import 'package:atomic_x_core/atomicxcore.dart';
|
|
181
|
+
|
|
182
|
+
// Answer and Reject Buttons Widget
|
|
183
|
+
class AcceptRejectButtons extends StatelessWidget {
|
|
184
|
+
const AcceptRejectButtons({super.key});
|
|
185
|
+
|
|
186
|
+
@override
|
|
187
|
+
Widget build(BuildContext context) {
|
|
188
|
+
return Row(
|
|
189
|
+
children: [
|
|
190
|
+
// Answer Button
|
|
191
|
+
_buildAcceptButton(),
|
|
192
|
+
// Reject Button
|
|
193
|
+
_buildRejectButton(),
|
|
194
|
+
],
|
|
195
|
+
);
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
// Answer Button
|
|
199
|
+
Widget _buildAcceptButton() {
|
|
200
|
+
return GestureDetector(
|
|
201
|
+
onTap: () {
|
|
202
|
+
// Call accept API to answer the call
|
|
203
|
+
CallStore.shared.accept();
|
|
204
|
+
},
|
|
205
|
+
child: Container(
|
|
206
|
+
width: 60,
|
|
207
|
+
height: 60,
|
|
208
|
+
decoration: const BoxDecoration(
|
|
209
|
+
color: Colors.green,
|
|
210
|
+
shape: BoxShape.circle,
|
|
211
|
+
),
|
|
212
|
+
child: const Icon(
|
|
213
|
+
Icons.call,
|
|
214
|
+
color: Colors.white,
|
|
215
|
+
size: 30,
|
|
216
|
+
),
|
|
217
|
+
),
|
|
218
|
+
);
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
// Reject Button
|
|
222
|
+
Widget _buildRejectButton() {
|
|
223
|
+
return GestureDetector(
|
|
224
|
+
onTap: () {
|
|
225
|
+
// Call reject API to reject the call
|
|
226
|
+
CallStore.shared.reject();
|
|
227
|
+
},
|
|
228
|
+
child: Container(
|
|
229
|
+
width: 60,
|
|
230
|
+
height: 60,
|
|
231
|
+
decoration: const BoxDecoration(
|
|
232
|
+
color: Colors.red,
|
|
233
|
+
shape: BoxShape.circle,
|
|
234
|
+
),
|
|
235
|
+
child: const Icon(
|
|
236
|
+
Icons.call_end,
|
|
237
|
+
color: Colors.white,
|
|
238
|
+
size: 30,
|
|
239
|
+
),
|
|
240
|
+
),
|
|
241
|
+
);
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
```
|
|
245
|
+
2. **Destroy the UI when the caller cancels or the callee rejects:** When the caller cancels the call or the callee rejects, the [onCallEnded](https://liteav.sdk.qcloud.com/doc/product/tuikit/atomic-x/flutter/v1.0/en/api_call_call_store/CallEventListener/onCallEnded.html) event fires. Listen for this event and close the call UI when the call ends.
|
|
246
|
+
|
|
247
|
+
``` java
|
|
248
|
+
import 'package:atomic_x_core/atomicxcore.dart';
|
|
249
|
+
import 'package:flutter/cupertino.dart';
|
|
250
|
+
|
|
251
|
+
void addListener() {
|
|
252
|
+
CallEventListener listener = CallEventListener(
|
|
253
|
+
onCallEnded: (callId, mediaType, reason, userId) {
|
|
254
|
+
Navigator.of(context).pop();
|
|
255
|
+
}
|
|
256
|
+
);
|
|
257
|
+
CallStore.shared.addListener(listener);
|
|
258
|
+
}
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
**onCallEnded Event Parameter Details:**
|
|
262
|
+
|
|
263
|
+
| Parameter | Type | Description |
|
|
264
|
+
| --- | --- | --- |
|
|
265
|
+
| callId | String | Unique identifier for this call. |
|
|
266
|
+
| mediaType | <a href="https://liteav.sdk.qcloud.com/doc/product/tuikit/atomic-x/flutter/v1.0/en/api_call_call_store/CallMediaType.html">CallMediaType</a> | Type of call, either audio or video.<br>- <code>CallMediaType.video</code>: Video call.<br>- <code>CallMediaType.audio</code>: Audio call. |
|
|
267
|
+
| reason | <a href="https://liteav.sdk.qcloud.com/doc/product/tuikit/atomic-x/flutter/v1.0/en/api_call_call_store/CallEndReason.html">CallEndReason</a> | Reason for call ending.<br>- <code>unknown</code>: Unknown.<br>- <code>hangup</code>: User hung up.<br>- <code>reject</code>: Callee rejected.<br>- <code>noResponse</code>: Callee did not answer in time.<br>- <code>offline</code>: Callee offline.<br>- <code>lineBusy</code>: Callee busy.<br>- <code>canceled</code>: Caller canceled before callee answered.<br>- <code>otherDeviceAccepted</code>: Answered on another device.<br>- <code>otherDeviceReject</code>: Rejected on another device.<br>- <code>endByServer</code>: Ended by server. |
|
|
268
|
+
| userId | String | User ID responsible for ending the call. |
|
|
269
|
+
|
|
270
|
+
### Step 3: Request Microphone and Camera Permissions
|
|
271
|
+
|
|
272
|
+
Check audio/video permissions before starting a call. If permissions are missing, prompt the user to grant them.
|
|
273
|
+
1. **Android Permission Declaration:**
|
|
274
|
+
|
|
275
|
+
Declare microphone and camera permissions in your `AndroidManifest.xml`:
|
|
276
|
+
|
|
277
|
+
``` xml
|
|
278
|
+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
|
279
|
+
<!-- Microphone permission -->
|
|
280
|
+
<uses-permission android:name="android.permission.RECORD_AUDIO" />
|
|
281
|
+
<!-- Camera permission -->
|
|
282
|
+
<uses-permission android:name="android.permission.CAMERA" />
|
|
283
|
+
</manifest>
|
|
284
|
+
```
|
|
285
|
+
2. **iOS Permission Declaration:**
|
|
286
|
+
|
|
287
|
+
Add these entries to your iOS project's `Info.plist`:
|
|
288
|
+
|
|
289
|
+
``` xml
|
|
290
|
+
<key>NSCameraUsageDescription</key>
|
|
291
|
+
<string>CallingApp needs access to your camera to record video with visuals</string>
|
|
292
|
+
<key>NSMicrophoneUsageDescription</key>
|
|
293
|
+
<string>CallingApp needs access to your microphone to record video with audio</string>
|
|
294
|
+
```
|
|
295
|
+
3. **Request Permissions Dynamically:** We recommend using the `permission_handler` plugin for runtime permission requests.
|
|
296
|
+
|
|
297
|
+
``` bash
|
|
298
|
+
flutter pub add permission_handler
|
|
299
|
+
```
|
|
300
|
+
``` java
|
|
301
|
+
import 'package:permission_handler/permission_handler.dart';
|
|
302
|
+
|
|
303
|
+
// Request audio/video permissions
|
|
304
|
+
Future<bool> requestCallPermissions() async {
|
|
305
|
+
// Request microphone and camera permissions
|
|
306
|
+
Map<Permission, PermissionStatus> statuses = await [
|
|
307
|
+
Permission.microphone,
|
|
308
|
+
Permission.camera,
|
|
309
|
+
].request();
|
|
310
|
+
|
|
311
|
+
// Check permission status
|
|
312
|
+
bool micGranted = statuses[Permission.microphone]?.isGranted ?? false;
|
|
313
|
+
bool cameraGranted = statuses[Permission.camera]?.isGranted ?? false;
|
|
314
|
+
|
|
315
|
+
if (micGranted && cameraGranted) {
|
|
316
|
+
// Permissions granted
|
|
317
|
+
return true;
|
|
318
|
+
} else {
|
|
319
|
+
// Some permissions denied, prompt user to enable
|
|
320
|
+
return false;
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
```
|
|
324
|
+
|
|
325
|
+
### Step 4: Handle Incoming Call Notifications
|
|
326
|
+
|
|
327
|
+
Listen to the current user's call status and play a ringtone or vibrate on incoming calls. Stop notifications after the call is answered or hung up.
|
|
328
|
+
1. **Data Layer Subscription:** Subscribe to `CallStore.shared.state.selfInfo` to reactively track the logged-in user's info.
|
|
329
|
+
|
|
330
|
+
2. **Play or Stop Notifications:** If `selfInfo.status` is `CallParticipantStatus.waiting`, play ringtone/vibration; if `CallParticipantStatus.accept`, stop the notification.
|
|
331
|
+
|
|
332
|
+
``` java
|
|
333
|
+
CallStore.shared.state.selfInfo.addListener(() {
|
|
334
|
+
CallParticipantInfo info = CallStore.shared.state.selfInfo.value;
|
|
335
|
+
if (info.status == CallParticipantStatus.accept || info.status == CallParticipantStatus.none) {
|
|
336
|
+
// Stop ringtone
|
|
337
|
+
return;
|
|
338
|
+
}
|
|
339
|
+
if (info.status == CallParticipantStatus.waiting) {
|
|
340
|
+
// Play ringtone
|
|
341
|
+
}
|
|
342
|
+
});
|
|
343
|
+
```
|
|
344
|
+
|
|
345
|
+
### Step 5: Open Media Devices for Incoming Calls
|
|
346
|
+
|
|
347
|
+
When an incoming call arrives, get the media type from [onCallReceived](https://liteav.sdk.qcloud.com/doc/product/tuikit/atomic-x/flutter/v1.0/en/api_call_call_store/CallEventListener/onCallReceived.html). For a smoother experience, pre-open relevant media devices when showing the call UI.
|
|
348
|
+
1. **Listen to Incoming Call Event:** Subscribe to the `onCallReceived` event.
|
|
349
|
+
|
|
350
|
+
2. **Open Devices According to Media Type:** For audio calls, open only the microphone; for video calls, open both microphone and camera.
|
|
351
|
+
|
|
352
|
+
``` java
|
|
353
|
+
import 'package:atomic_x_core/atomicxcore.dart';
|
|
354
|
+
|
|
355
|
+
CallEventListener? callListener;
|
|
356
|
+
|
|
357
|
+
void initCallListener() {
|
|
358
|
+
// 1. Listen for incoming call event
|
|
359
|
+
callListener = CallEventListener(
|
|
360
|
+
onCallReceived: (callId, mediaType, userData) {
|
|
361
|
+
// 2. Open devices based on media type
|
|
362
|
+
openDeviceForMediaType(mediaType);
|
|
363
|
+
},
|
|
364
|
+
);
|
|
365
|
+
if (callListener != null) {
|
|
366
|
+
CallStore.shared.addListener(callListener!);
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
void openDeviceForMediaType(CallMediaType? mediaType) {
|
|
371
|
+
if (mediaType == null) return;
|
|
372
|
+
DeviceStore.shared.openLocalMicrophone();
|
|
373
|
+
if (mediaType == CallMediaType.video) {
|
|
374
|
+
final isFrontCamera = DeviceStore.shared.state.isFrontCamera.value;
|
|
375
|
+
DeviceStore.shared.openLocalCamera(isFrontCamera);
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
```
|
|
379
|
+
|
|
380
|
+
**onCallReceived Event Details:**
|
|
381
|
+
|
|
382
|
+
| Parameter | Type | Description |
|
|
383
|
+
| --- | --- | --- |
|
|
384
|
+
| callId | String | Unique identifier for this call. |
|
|
385
|
+
| mediaType | <a href="https://liteav.sdk.qcloud.com/doc/product/tuikit/atomic-x/flutter/v1.0/en/api_call_call_store/CallMediaType.html">CallMediaType</a> | Call type: audio or video.<br>- <code>CallMediaType.video</code>: Video call.<br>- <code>CallMediaType.audio</code>: Audio call. |
|
|
386
|
+
|
|
387
|
+
**openLocalCamera API Parameter Details:**
|
|
388
|
+
|
|
389
|
+
| Parameter Name | Type | Required | Description |
|
|
390
|
+
| --- | --- | --- | --- |
|
|
391
|
+
| isFront | bool | Yes | Whether to open the front camera:<br>- <code>true</code>: Open front camera.<br>- <code>false</code>: Open rear camera. |
|
|
392
|
+
| completion | <a href="https://liteav.sdk.qcloud.com/doc/product/tuikit/atomic-x/flutter/v1.0/en/api_define/CompletionHandler-class.html">CompletionHandler</a> | No | Completion callback for camera open result. Returns error code and message if opening fails. |
|
|
393
|
+
|
|
394
|
+
**openLocalMicrophone API Parameter Details:**
|
|
395
|
+
|
|
396
|
+
|Parameter Name|Type|Required|Description|
|
|
397
|
+
|---------|---------|---------|---------|
|
|
398
|
+
|completion|[CompletionHandler](https://liteav.sdk.qcloud.com/doc/product/tuikit/atomic-x/flutter/v1.0/en/api_define/CompletionHandler-class.html)|No|Completion callback for microphone open result. Returns error code and message if opening fails.|
|
|
399
|
+
|
|
400
|
+
### Step 6: Launch Call UI on Incoming Call
|
|
401
|
+
|
|
402
|
+
After subscribing to the [onCallReceived](https://liteav.sdk.qcloud.com/doc/product/tuikit/atomic-x/flutter/v1.0/en/api_call_call_store/CallEventListener/onCallReceived.html) event, launch the call page:
|
|
403
|
+
``` java
|
|
404
|
+
import 'package:atomic_x_core/atomicxcore.dart';
|
|
405
|
+
import 'package:flutter/material.dart';
|
|
406
|
+
|
|
407
|
+
CallEventListener? callListener;
|
|
408
|
+
|
|
409
|
+
void addListener(BuildContext context) {
|
|
410
|
+
callListener = CallEventListener(
|
|
411
|
+
onCallReceived: (callId, mediaType, userData) {
|
|
412
|
+
// Launch call page (using Navigator)
|
|
413
|
+
Navigator.push(
|
|
414
|
+
context,
|
|
415
|
+
MaterialPageRoute(builder: (context) => const CallPage()),
|
|
416
|
+
);
|
|
417
|
+
},
|
|
418
|
+
);
|
|
419
|
+
if (callListener != null) {
|
|
420
|
+
CallStore.shared.addListener(callListener!);
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
```
|
|
424
|
+
|
|
425
|
+
### Demo Result
|
|
426
|
+
|
|
427
|
+
Once you complete these six steps, your "answer a call" feature will look like this:
|
|
428
|
+
|
|
429
|
+
## Integrate Offline Push
|
|
430
|
+
|
|
431
|
+
To receive call invitations while offline, follow the instructions in Integrate Offline Push.
|
|
432
|
+
|
|
433
|
+
## Customize the UI
|
|
434
|
+
|
|
435
|
+
**CallCoreView** supports extensive UI customization. You can freely replace avatar and volume indicator icons. For fast integration, download these icons from [GitHub](https://github.com/Tencent-RTC/TUIKit_Flutter/tree/main/atomic-x/call_assets). All icons are custom-designed for TUICallKit and are copyright-free.
|
|
436
|
+
|
|
437
|
+
### Custom Volume Indicator Icons
|
|
438
|
+
|
|
439
|
+
Use the [volumeIcons](https://liteav.sdk.qcloud.com/doc/product/tuikit/atomic-x/flutter/v1.0/en/api_view_call_call_core_view/CallCoreView/volumeIcons.html) parameter in **CallCoreView** to set icons for various volume levels.
|
|
440
|
+
|
|
441
|
+
- **Sample Code:**
|
|
442
|
+
|
|
443
|
+
``` java
|
|
444
|
+
Widget _buildCallCoreView() {
|
|
445
|
+
Map<VolumeLevel, Image> volumeIcons = {
|
|
446
|
+
VolumeLevel.mute : Image.asset(''), // Icon for each volume level
|
|
447
|
+
};
|
|
448
|
+
return CallCoreView(
|
|
449
|
+
controller: CallCoreController.create(),
|
|
450
|
+
volumeIcons: volumeIcons,
|
|
451
|
+
);
|
|
452
|
+
}
|
|
453
|
+
```
|
|
454
|
+
- **volumeIcons Parameter Details:**
|
|
455
|
+
|
|
456
|
+
| Parameter | Type | Required | Description |
|
|
457
|
+
| --- | --- | --- | --- |
|
|
458
|
+
| volumeIcons | Map | No | Maps volume levels to icon resources.<br>VolumeLevel keys:<br>- <code>VolumeLevel.mute</code>: Microphone muted.<br>- <code>VolumeLevel.low</code>: Volume (0-25]<br>- <code>VolumeLevel.medium</code>: Volume (25-50]<br>- <code>VolumeLevel.high</code>: Volume (50-75]<br>- <code>VolumeLevel.peak</code>: Volume (75-100].<br>Image values: Icon for each level. |
|
|
459
|
+
|
|
460
|
+
- **Volume Indicator Icons:**
|
|
461
|
+
|
|
462
|
+
|Icon|Description|
|
|
463
|
+
|---------|---------|
|
|
464
|
+
||Volume indicator icon.Recommended for `VolumeLevel.low` or `VolumeLevel.medium`. Display when user volume exceeds this level.|
|
|
465
|
+
||Mute icon.Recommended for `VolumeLevel.mute`. Display when user is muted.|
|
|
466
|
+
|
|
467
|
+
### Custom Network Indicator Icons
|
|
468
|
+
|
|
469
|
+
Use the [networkQualityIcons](https://liteav.sdk.qcloud.com/doc/product/tuikit/atomic-x/flutter/v1.0/en/api_view_call_call_core_view/CallCoreView/networkQualityIcons.html) parameter to set icons for different network states.
|
|
470
|
+
|
|
471
|
+
- **Sample Code:**
|
|
472
|
+
|
|
473
|
+
``` java
|
|
474
|
+
Widget _buildCallCoreView() {
|
|
475
|
+
Map<NetworkQuality, Image> networkQualityIcons = {
|
|
476
|
+
NetworkQuality.bad : Image.asset(''), // Icon for each network quality level
|
|
477
|
+
};
|
|
478
|
+
return CallCoreView(
|
|
479
|
+
controller: CallCoreController.create(),
|
|
480
|
+
networkQualityIcons: networkQualityIcons,
|
|
481
|
+
);
|
|
482
|
+
}
|
|
483
|
+
```
|
|
484
|
+
- **networkQualityIcons Parameter Details:**
|
|
485
|
+
|
|
486
|
+
| Parameter | Type | Required | Description |
|
|
487
|
+
| --- | --- | --- | --- |
|
|
488
|
+
| networkQualityIcons | Map | No | Maps network quality levels to icon resources.<br>NetworkQuality keys:<br>- <code>NetworkQuality.unknown</code>: Unknown.<br>- <code>NetworkQuality.excellent</code>: Excellent.<br>- <code>NetworkQuality.good</code>: Good.<br>- <code>NetworkQuality.poor</code>: Poor.<br>- <code>NetworkQuality.bad</code>: Bad.<br>- <code>NetworkQuality.veryBad</code>: Very bad.<br>- <code>NetworkQuality.down</code>: Disconnected.<br>Image values: Icon for each state. \\| |
|
|
489
|
+
|
|
490
|
+
- **Poor Network Indicator Icon:**
|
|
491
|
+
|
|
492
|
+
|Icon|Description|
|
|
493
|
+
|---------|---------|
|
|
494
|
+
||Poor network indicator. Recommended for `NetworkQuality.bad`, `NetworkQuality.veryBad`, or `NetworkQuality.down`. Display when connection is poor. |
|
|
495
|
+
|
|
496
|
+
### Custom Default Avatar
|
|
497
|
+
|
|
498
|
+
Use the [defaultAvatar](https://liteav.sdk.qcloud.com/doc/product/tuikit/atomic-x/flutter/v1.0/en/api_view_call_call_core_view/CallCoreView/defaultAvatar.html) parameter to set a default avatar for users. Listen to [allParticipants](https://liteav.sdk.qcloud.com/doc/product/tuikit/atomic-x/flutter/v1.0/en/api_call_call_store/CallState/allParticipants.html) for participant avatars. If unavailable or loading fails, show the default avatar.
|
|
499
|
+
- **Sample Code:**
|
|
500
|
+
|
|
501
|
+
``` java
|
|
502
|
+
Widget _buildCallCoreView() {
|
|
503
|
+
Image defaultAvatarImage = Image.asset(''); // Default user avatar image
|
|
504
|
+
return CallCoreView(
|
|
505
|
+
controller: CallCoreController.create(),
|
|
506
|
+
defaultAvatar: defaultAvatarImage,
|
|
507
|
+
);
|
|
508
|
+
}
|
|
509
|
+
```
|
|
510
|
+
- **defaultAvatar Parameter Details:**
|
|
511
|
+
|
|
512
|
+
|Parameter|Type|Required|Description|
|
|
513
|
+
|---------|---------|---------|---------|
|
|
514
|
+
|defaultAvatar|Image|No|Default user avatar.|
|
|
515
|
+
|
|
516
|
+
- **Default Avatar Resource:**
|
|
517
|
+
|
|
518
|
+
|Icon|Description|
|
|
519
|
+
|---------|---------|
|
|
520
|
+
||Default avatar.Recommended when loading fails or no avatar is set.|
|
|
521
|
+
|
|
522
|
+
### Custom Loading Animation
|
|
523
|
+
|
|
524
|
+
Use the [loadingAnimation](https://liteav.sdk.qcloud.com/doc/product/tuikit/atomic-x/flutter/v1.0/en/api_view_call_call_core_view/CallCoreView/loadingAnimation.html) parameter to set a waiting animation for users in pending state.
|
|
525
|
+
|
|
526
|
+
- **Sample Code:**
|
|
527
|
+
|
|
528
|
+
``` java
|
|
529
|
+
Widget _buildCallCoreView() {
|
|
530
|
+
Image loading = Image.asset(''); // Default loading animation resource
|
|
531
|
+
return CallCoreView(
|
|
532
|
+
controller: CallCoreController.create(),
|
|
533
|
+
loadingAnimation: loading,
|
|
534
|
+
);
|
|
535
|
+
}
|
|
536
|
+
```
|
|
537
|
+
- **loadingAnimation Parameter Details:**
|
|
538
|
+
|
|
539
|
+
|Parameter|Type|Required|Description|
|
|
540
|
+
|---------|---------|---------|---------|
|
|
541
|
+
|loadingAnimation|Image|No|GIF image resource.|
|
|
542
|
+
|
|
543
|
+
- **Waiting Animation:**
|
|
544
|
+
|
|
545
|
+
|Icon|Description|
|
|
546
|
+
|---------|---------|
|
|
547
|
+
||Waiting animation for users.Recommended for group calls; display when user status is waiting.|
|
|
548
|
+
|
|
549
|
+
### Add Call Duration Indicator
|
|
550
|
+
|
|
551
|
+
Call duration updates in real time via [activeCall](https://liteav.sdk.qcloud.com/doc/product/tuikit/atomic-x/flutter/v1.0/en/api_call_call_store/CallState/activeCall.html)`duration`. To display call duration:
|
|
552
|
+
1. **Subscribe to Data:** Listen to `CallStore.shared.state.activeCall` for the current active call.
|
|
553
|
+
|
|
554
|
+
2. **Bind Call Duration:** Bind the `activeCall.duration` field to a UI widget. This is reactive and auto-updates the UI—no manual timer needed.
|
|
555
|
+
|
|
556
|
+
``` java
|
|
557
|
+
import 'package:atomic_x_core/atomicxcore.dart';
|
|
558
|
+
import 'package:flutter/material.dart';
|
|
559
|
+
|
|
560
|
+
class TimerWidget extends StatelessWidget {
|
|
561
|
+
final double? fontSize;
|
|
562
|
+
final FontWeight? fontWeight;
|
|
563
|
+
|
|
564
|
+
const TimerWidget({
|
|
565
|
+
super.key,
|
|
566
|
+
this.fontSize,
|
|
567
|
+
this.fontWeight,
|
|
568
|
+
});
|
|
569
|
+
|
|
570
|
+
@override
|
|
571
|
+
Widget build(BuildContext context) {
|
|
572
|
+
return ValueListenableBuilder(
|
|
573
|
+
valueListenable: CallStore.shared.state.selfInfo,
|
|
574
|
+
builder: (context, info, child) {
|
|
575
|
+
if (info.status == CallParticipantStatus.accept) {
|
|
576
|
+
return ValueListenableBuilder(
|
|
577
|
+
valueListenable: CallStore.shared.state.activeCall,
|
|
578
|
+
builder: (context, activeCall, child) {
|
|
579
|
+
return Text(
|
|
580
|
+
formatDuration(activeCall.duration.toInt()),
|
|
581
|
+
style: TextStyle(
|
|
582
|
+
fontSize: fontSize,
|
|
583
|
+
fontWeight: fontWeight,
|
|
584
|
+
),
|
|
585
|
+
);
|
|
586
|
+
},
|
|
587
|
+
);
|
|
588
|
+
} else {
|
|
589
|
+
return Container();
|
|
590
|
+
}
|
|
591
|
+
}
|
|
592
|
+
);
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
String formatDuration(int timeCount) {
|
|
596
|
+
int hour = timeCount ~/ 3600;
|
|
597
|
+
int minute = (timeCount % 3600) ~/ 60;
|
|
598
|
+
String minuteShow = minute <= 9 ? "0$minute" : "$minute";
|
|
599
|
+
int second = timeCount % 60;
|
|
600
|
+
String secondShow = second <= 9 ? "0$second" : "$second";
|
|
601
|
+
|
|
602
|
+
if (hour > 0) {
|
|
603
|
+
String hourShow = hour <= 9 ? "0$hour" : "$hour";
|
|
604
|
+
return '$hourShow:$minuteShow:$secondShow';
|
|
605
|
+
} else {
|
|
606
|
+
return '$minuteShow:$secondShow';
|
|
607
|
+
}
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
}
|
|
611
|
+
```
|
|
612
|
+
|
|
613
|
+
> **Note:**
|
|
614
|
+
>
|
|
615
|
+
|
|
616
|
+
> For more reactive call state data, see [CallState](https://liteav.sdk.qcloud.com/doc/product/tuikit/atomic-x/flutter/v1.0/en/api_call_call_store/CallState-class.html).
|
|
617
|
+
>
|
|
618
|
+
|
|
619
|
+
## More Features
|
|
620
|
+
|
|
621
|
+
### Set Avatar and Nickname
|
|
622
|
+
|
|
623
|
+
Before the call starts, use [setSelfInfo](https://liteav.sdk.qcloud.com/doc/product/tuikit/atomic-x/flutter/v1.0/en/api_login_login_store/LoginStore/setSelfInfo.html) to set your nickname and avatar.
|
|
624
|
+
- **Sample Code:**
|
|
625
|
+
|
|
626
|
+
``` java
|
|
627
|
+
UserProfile profile = UserProfile(
|
|
628
|
+
userID: "", // Your UserId
|
|
629
|
+
avatarURL: "", // Avatar URL
|
|
630
|
+
nickname: "", // Nickname to set
|
|
631
|
+
);
|
|
632
|
+
CompletionHandler result = await LoginStore.shared.setSelfInfo(userInfo: profile);
|
|
633
|
+
if (result.errorCode == 0) {
|
|
634
|
+
print("setSelfInfo success");
|
|
635
|
+
} else {
|
|
636
|
+
print("setSelfInfo failed");
|
|
637
|
+
}
|
|
638
|
+
```
|
|
639
|
+
- **setSelfInfo API Parameter Details:**
|
|
640
|
+
|
|
641
|
+
| Parameter | Type | Required | Description |
|
|
642
|
+
| --- | --- | --- | --- |
|
|
643
|
+
| userProfile | <a href="https://liteav.sdk.qcloud.com/doc/product/tuikit/atomic-x/flutter/v1.0/en/api_login_login_store/UserProfile-class.html">UserProfile</a> | Yes | User info struct:<br>- <code>userID</code> (String): User ID.<br>- <code>avatarURL</code> (String): Avatar URL.<br>- <code>nickname</code> (String): Nickname.<br>See <a href="https://liteav.sdk.qcloud.com/doc/product/tuikit/atomic-x/flutter/v1.0/en/api_login_login_store/UserProfile-class.html">UserProfile</a> for more fields. |
|
|
644
|
+
| completion | CompletionHandler | No | Completion callback for result. |
|
|
645
|
+
|
|
646
|
+
### Switch Layout Modes
|
|
647
|
+
|
|
648
|
+
Use [setLayoutTemplate](https://liteav.sdk.qcloud.com/doc/product/tuikit/atomic-x/flutter/v1.0/en/api_view_call_call_core_view/CallCoreController/setLayoutTemplate.html) for flexible layout switching. If unset, **CallCoreView** adapts automatically: 1-on-1 calls use `Float` mode, group calls use `Grid` mode.
|
|
649
|
+
| <strong>Float Mode</strong> | <strong>Grid Mode</strong> | <strong>PIP Mode</strong> |
|
|
650
|
+
| --- | --- | --- |
|
|
651
|
+
| | | |
|
|
652
|
+
| - <strong>Layout:</strong> Full screen self-view while waiting; after connecting, full screen remote view with self-view as a floating window.<br>- <strong>Interaction:</strong> Floating window supports drag and click-to-swap with the main view. | - <strong>Layout:</strong> Grid layout for all participants, suitable for 2+ users. Supports click-to-enlarge.<br>- <strong>Interaction:</strong> Click any participant's view to enlarge. | - <strong>Layout:</strong> 1v1 shows fixed remote view; multi-party uses active speaker strategy with full screen for the current speaker.<br>- <strong>Interaction:</strong> Waiting state shows self-view; after connecting, call duration is displayed. |
|
|
653
|
+
|
|
654
|
+
- **Sample Code:**
|
|
655
|
+
|
|
656
|
+
``` java
|
|
657
|
+
CallCoreController controller = CallCoreController.create();
|
|
658
|
+
CallLayoutTemplate template = CallLayoutTemplate.float;
|
|
659
|
+
controller.setLayoutTemplate(template);
|
|
660
|
+
```
|
|
661
|
+
- **setLayoutTemplate API Parameter Details:**
|
|
662
|
+
|
|
663
|
+
| Parameter | Type | Required | Description |
|
|
664
|
+
| --- | --- | --- | --- |
|
|
665
|
+
| template | <a href="https://liteav.sdk.qcloud.com/doc/product/tuikit/atomic-x/flutter/v1.0/en/api_view_call_call_core_view/CallLayoutTemplate.html">CallLayoutTemplate</a> | Yes | Layout mode for CallCoreView:<br>- <code>CallLayoutTemplate.float</code>: Full-screen self-view while waiting, full-screen remote after answering, self-view floating window.<br>- <code>CallLayoutTemplate.grid</code>: Grid layout for all participants, tap to enlarge.<br>- <code>CallLayoutTemplate.pip</code>: 1-on-1 always shows remote; group calls auto-fullscreen active speaker. |
|
|
666
|
+
|
|
667
|
+
### Set Default Call Timeout
|
|
668
|
+
|
|
669
|
+
When making a call via [calls](https://liteav.sdk.qcloud.com/doc/product/tuikit/atomic-x/flutter/v1.0/en/api_call_call_store/CallStore/calls.html), specify the timeout using [CallParams](https://liteav.sdk.qcloud.com/doc/product/tuikit/atomic-x/flutter/v1.0/en/api_call_call_store/CallParams-class.html)`timeout`.
|
|
670
|
+
``` java
|
|
671
|
+
void startCall(List<String> userIdList, CallMediaType mediaType) {
|
|
672
|
+
CallParams params = CallParams(
|
|
673
|
+
timeout: 30, // Set call waiting timeout
|
|
674
|
+
);
|
|
675
|
+
|
|
676
|
+
CallStore.shared.calls(userIdList, mediaType, params);
|
|
677
|
+
}
|
|
678
|
+
```
|
|
679
|
+
|
|
680
|
+
**calls API Parameter Details:**
|
|
681
|
+
| Parameter | Type | Required | Description |
|
|
682
|
+
| --- | --- | --- | --- |
|
|
683
|
+
| userIdList | List | Yes | List of target user IDs. |
|
|
684
|
+
| mediaType | <a href="https://liteav.sdk.qcloud.com/doc/product/tuikit/atomic-x/flutter/v1.0/en/api_call_call_store/CallMediaType.html">CallMediaType</a> | Yes | Call type: audio or video.<br>- <code>CallMediaType.video</code>: Video call.<br>- <code>CallMediaType.audio</code>: Audio call. |
|
|
685
|
+
| params | <a href="https://liteav.sdk.qcloud.com/doc/product/tuikit/atomic-x/flutter/v1.0/en/api_call_call_store/CallParams-class.html">CallParams</a> | No | Call extension parameters:<br>- <code>roomId</code> (String): Room ID (optional, auto-assigned if unset).<br>- <code>timeout</code> (int): Call timeout in seconds.<br>- <code>userData</code> (String): Custom data.<br>- <code>chatGroupId</code> (String): Chat group ID for group calls.<br>- <code>isEphemeralCall</code> (bool): Encrypted call (no call record). |
|
|
686
|
+
|
|
687
|
+
### Implement In-App Floating Window
|
|
688
|
+
|
|
689
|
+
If the call UI is covered (e.g., user navigates away), create a draggable floating window in the app. This window should show key call status (such as duration and remote info) and allow users to quickly return to the full call UI, enhancing multitasking.
|
|
690
|
+
``` java
|
|
691
|
+
_buildPipWindowWidget() {
|
|
692
|
+
final pipWidth = MediaQuery.of(context).size.width;
|
|
693
|
+
final pipHeight = MediaQuery.of(context).size.height;
|
|
694
|
+
final scale = pipWidth / originWidth;
|
|
695
|
+
CallCoreController controller = CallCoreController.create();
|
|
696
|
+
controller.setLayoutTemplate(CallLayoutTemplate.pip);
|
|
697
|
+
return Scaffold(
|
|
698
|
+
body: SizedBox(
|
|
699
|
+
width: pipWidth,
|
|
700
|
+
height: pipHeight,
|
|
701
|
+
child: Container(
|
|
702
|
+
width: pipWidth,
|
|
703
|
+
height: pipHeight,
|
|
704
|
+
decoration: const BoxDecoration(color: Colors.transparent),
|
|
705
|
+
child: MediaQuery(
|
|
706
|
+
data: MediaQuery.of(context).copyWith(
|
|
707
|
+
size: Size(originWidth ?? pipWidth, originHeight ?? pipHeight)
|
|
708
|
+
),
|
|
709
|
+
child: ClipRect(
|
|
710
|
+
child: Transform.scale(
|
|
711
|
+
scale: scale,
|
|
712
|
+
alignment: Alignment.center,
|
|
713
|
+
child: OverflowBox(
|
|
714
|
+
maxWidth: originWidth,
|
|
715
|
+
maxHeight: originHeight,
|
|
716
|
+
alignment: Alignment.center,
|
|
717
|
+
child: CallCoreView(
|
|
718
|
+
controller: controller,
|
|
719
|
+
),
|
|
720
|
+
),
|
|
721
|
+
),
|
|
722
|
+
),
|
|
723
|
+
),
|
|
724
|
+
),
|
|
725
|
+
),
|
|
726
|
+
);
|
|
727
|
+
}
|
|
728
|
+
```
|
|
729
|
+
|
|
730
|
+
### Implement Android Picture-in-Picture Outside App
|
|
731
|
+
|
|
732
|
+
Picture-in-Picture requires Android 8.0 (API 26) or later.
|
|
733
|
+
1. **MainActivity Configuration**
|
|
734
|
+
|
|
735
|
+
Listen for the MainActivity lifecycle. When `enablePictureInPicture` is true, automatically enter PiP when the app goes to background.
|
|
736
|
+
|
|
737
|
+
``` java
|
|
738
|
+
import android.app.PictureInPictureParams
|
|
739
|
+
import android.content.pm.PackageManager
|
|
740
|
+
import android.os.Build
|
|
741
|
+
import android.util.Log
|
|
742
|
+
import android.util.Rational
|
|
743
|
+
import io.flutter.embedding.android.FlutterActivity
|
|
744
|
+
import io.flutter.embedding.engine.FlutterEngine
|
|
745
|
+
import io.flutter.plugin.common.MethodChannel
|
|
746
|
+
|
|
747
|
+
class MainActivity : FlutterActivity() {
|
|
748
|
+
companion object {
|
|
749
|
+
private const val TAG = "MainActivity"
|
|
750
|
+
private const val CHANNEL = "atomic_x/pip"
|
|
751
|
+
}
|
|
752
|
+
|
|
753
|
+
private var enablePictureInPicture = false
|
|
754
|
+
|
|
755
|
+
override fun configureFlutterEngine(flutterEngine: FlutterEngine) {
|
|
756
|
+
super.configureFlutterEngine(flutterEngine)
|
|
757
|
+
|
|
758
|
+
MethodChannel(flutterEngine.dartExecutor.binaryMessenger, CHANNEL).setMethodCallHandler { call, result ->
|
|
759
|
+
when (call.method) {
|
|
760
|
+
"enablePictureInPicture" -> {
|
|
761
|
+
val enable = call.argument<Boolean>("enable") ?: false
|
|
762
|
+
val success = enablePIP(enable)
|
|
763
|
+
result.success(success)
|
|
764
|
+
}
|
|
765
|
+
"enterPictureInPicture" -> {
|
|
766
|
+
val success = enterPIP()
|
|
767
|
+
result.success(success)
|
|
768
|
+
}
|
|
769
|
+
else -> result.notImplemented()
|
|
770
|
+
}
|
|
771
|
+
}
|
|
772
|
+
}
|
|
773
|
+
|
|
774
|
+
override fun onUserLeaveHint() {
|
|
775
|
+
super.onUserLeaveHint()
|
|
776
|
+
// Automatically enter PiP when user presses Home
|
|
777
|
+
if (enablePictureInPicture) {
|
|
778
|
+
enterPIP()
|
|
779
|
+
}
|
|
780
|
+
}
|
|
781
|
+
|
|
782
|
+
private fun enablePIP(enable: Boolean): Boolean {
|
|
783
|
+
Log.i(TAG, "enablePictureInPicture: $enable")
|
|
784
|
+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O &&
|
|
785
|
+
packageManager.hasSystemFeature(PackageManager.FEATURE_PICTURE_IN_PICTURE)) {
|
|
786
|
+
enablePictureInPicture = enable
|
|
787
|
+
return true
|
|
788
|
+
}
|
|
789
|
+
return false
|
|
790
|
+
}
|
|
791
|
+
|
|
792
|
+
private fun enterPIP(): Boolean {
|
|
793
|
+
if (!enablePictureInPicture) return false
|
|
794
|
+
|
|
795
|
+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
|
796
|
+
try {
|
|
797
|
+
val aspectRatio = Rational(9, 16)
|
|
798
|
+
val params = PictureInPictureParams.Builder()
|
|
799
|
+
.setAspectRatio(aspectRatio)
|
|
800
|
+
.build()
|
|
801
|
+
return enterPictureInPictureMode(params)
|
|
802
|
+
} catch (e: Exception) {
|
|
803
|
+
Log.e(TAG, "enterPIP failed: ${e.message}")
|
|
804
|
+
}
|
|
805
|
+
}
|
|
806
|
+
return false
|
|
807
|
+
}
|
|
808
|
+
}
|
|
809
|
+
```
|
|
810
|
+
2. **AndroidManifest Configuration**
|
|
811
|
+
|
|
812
|
+
Add PiP support to MainActivity:
|
|
813
|
+
|
|
814
|
+
``` xml
|
|
815
|
+
<activity
|
|
816
|
+
android:name=".MainActivity"
|
|
817
|
+
android:exported="true"
|
|
818
|
+
android:launchMode="singleTop"
|
|
819
|
+
android:taskAffinity=""
|
|
820
|
+
android:theme="@style/LaunchTheme"
|
|
821
|
+
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
|
|
822
|
+
android:hardwareAccelerated="true"
|
|
823
|
+
android:windowSoftInputMode="adjustResize"
|
|
824
|
+
android:supportsPictureInPicture="true">
|
|
825
|
+
<meta-data
|
|
826
|
+
android:name="io.flutter.embedding.android.NormalTheme"
|
|
827
|
+
android:resource="@style/NormalTheme"
|
|
828
|
+
/>
|
|
829
|
+
<intent-filter>
|
|
830
|
+
<action android:name="android.intent.action.MAIN"/>
|
|
831
|
+
<category android:name="android.intent.category.LAUNCHER"/>
|
|
832
|
+
</intent-filter>
|
|
833
|
+
</activity>
|
|
834
|
+
```
|
|
835
|
+
3. **Dart Layer Configuration**
|
|
836
|
+
|
|
837
|
+
``` java
|
|
838
|
+
import 'package:flutter/services.dart';
|
|
839
|
+
|
|
840
|
+
class PipManager {
|
|
841
|
+
static const MethodChannel _channel = MethodChannel('atomic_x/pip');
|
|
842
|
+
|
|
843
|
+
/// Enable/disable PiP
|
|
844
|
+
static Future<bool> enablePictureInPicture(bool enable) async {
|
|
845
|
+
try {
|
|
846
|
+
final result = await _channel.invokeMethod<bool>('enablePictureInPicture', {'enable': enable});
|
|
847
|
+
return result ?? false;
|
|
848
|
+
} catch (e) {
|
|
849
|
+
return false;
|
|
850
|
+
}
|
|
851
|
+
}
|
|
852
|
+
|
|
853
|
+
/// Enter PiP mode immediately
|
|
854
|
+
static Future<bool> enterPictureInPicture() async {
|
|
855
|
+
try {
|
|
856
|
+
final result = await _channel.invokeMethod<bool>('enterPictureInPicture');
|
|
857
|
+
return result ?? false;
|
|
858
|
+
} catch (e) {
|
|
859
|
+
return false;
|
|
860
|
+
}
|
|
861
|
+
}
|
|
862
|
+
}
|
|
863
|
+
```
|
|
864
|
+
|
|
865
|
+
Enable PiP before the call starts; disable PiP after the call ends.
|
|
866
|
+
|
|
867
|
+
### Implement iOS Picture-in-Picture Outside App
|
|
868
|
+
|
|
869
|
+
iOS supports system PiP with the underlying TRTC engine. When the app goes to background, the call view floats above other apps as a PiP window, letting users multitask.
|
|
870
|
+
|
|
871
|
+
> **Note:**
|
|
872
|
+
>
|
|
873
|
+
|
|
874
|
+
> Add `Background Modes` in Xcode's `Signing & Capabilities` and check `Audio, AirPlay, and Picture in Picture`.
|
|
875
|
+
>
|
|
876
|
+
|
|
877
|
+
> Requires iOS 15.0 or later.
|
|
878
|
+
>
|
|
879
|
+
|
|
880
|
+
1. **Enable PiP**
|
|
881
|
+
|
|
882
|
+
``` java
|
|
883
|
+
import 'package:tencent_rtc_sdk/trtc_cloud.dart';
|
|
884
|
+
|
|
885
|
+
TRTCCloud.sharedInstance().then((trtcCloud) {
|
|
886
|
+
trtcCloud.callExperimentalAPI('''
|
|
887
|
+
{
|
|
888
|
+
"api": "configPictureInPicture",
|
|
889
|
+
"params": {
|
|
890
|
+
"enable": true,
|
|
891
|
+
"cameraBackgroundCapture": true,
|
|
892
|
+
"canvas": {
|
|
893
|
+
"width": 720,
|
|
894
|
+
"height": 1280,
|
|
895
|
+
"backgroundColor": "#111111"
|
|
896
|
+
},
|
|
897
|
+
"regions": [
|
|
898
|
+
{
|
|
899
|
+
"userId": "remoteUserId",
|
|
900
|
+
"userName": "",
|
|
901
|
+
"width": 1.0,
|
|
902
|
+
"height": 1.0,
|
|
903
|
+
"x": 0.0,
|
|
904
|
+
"y": 0.0,
|
|
905
|
+
"fillMode": 0,
|
|
906
|
+
"streamType": "high",
|
|
907
|
+
"backgroundColor": "#111111",
|
|
908
|
+
"backgroundImage": "file:///path/to/avatar.png"
|
|
909
|
+
},
|
|
910
|
+
{
|
|
911
|
+
"userId": "localUserId",
|
|
912
|
+
"userName": "",
|
|
913
|
+
"width": 0.333,
|
|
914
|
+
"height": 0.333,
|
|
915
|
+
"x": 0.65,
|
|
916
|
+
"y": 0.05,
|
|
917
|
+
"fillMode": 0,
|
|
918
|
+
"streamType": "high",
|
|
919
|
+
"backgroundColor": "#111111"
|
|
920
|
+
}
|
|
921
|
+
]
|
|
922
|
+
}
|
|
923
|
+
}
|
|
924
|
+
''');
|
|
925
|
+
});
|
|
926
|
+
```
|
|
927
|
+
2. **Disable PiP**
|
|
928
|
+
|
|
929
|
+
``` java
|
|
930
|
+
import 'package:tencent_rtc_sdk/trtc_cloud.dart';
|
|
931
|
+
|
|
932
|
+
TRTCCloud.sharedInstance().then((trtcCloud) {
|
|
933
|
+
trtcCloud.callExperimentalAPI('''
|
|
934
|
+
{
|
|
935
|
+
"api": "configPictureInPicture",
|
|
936
|
+
"params": {
|
|
937
|
+
"enable": false
|
|
938
|
+
}
|
|
939
|
+
}
|
|
940
|
+
''');
|
|
941
|
+
});
|
|
942
|
+
```
|
|
943
|
+
|
|
944
|
+
### Enable Background Audio/Video Capture
|
|
945
|
+
|
|
946
|
+
To ensure your app can capture audio/video while in the background (e.g., screen lock or app switch), configure Android and iOS as follows:
|
|
947
|
+
|
|
948
|
+
#### Android Configuration
|
|
949
|
+
1. **Permissions and Service (**`AndroidManifest.xml`**):** Android 9.0+ requires foreground service permissions; Android 14+ requires explicit service type for microphone/camera.
|
|
950
|
+
|
|
951
|
+
``` java
|
|
952
|
+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
|
953
|
+
|
|
954
|
+
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
|
|
955
|
+
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_CAMERA" />
|
|
956
|
+
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_MICROPHONE" />
|
|
957
|
+
|
|
958
|
+
<application>
|
|
959
|
+
<service
|
|
960
|
+
android:name=".CallForegroundService"
|
|
961
|
+
android:enabled="true"
|
|
962
|
+
android:exported="false"
|
|
963
|
+
android:foregroundServiceType="camera|microphone" />
|
|
964
|
+
</application>
|
|
965
|
+
</manifest>
|
|
966
|
+
```
|
|
967
|
+
2. **Create Foreground Service Class (**`CallForegroundService`**):**
|
|
968
|
+
|
|
969
|
+
``` java
|
|
970
|
+
import android.app.Notification
|
|
971
|
+
import android.app.NotificationChannel
|
|
972
|
+
import android.app.NotificationManager
|
|
973
|
+
import android.app.Service
|
|
974
|
+
import android.content.Context
|
|
975
|
+
import android.content.Intent
|
|
976
|
+
import android.os.Build
|
|
977
|
+
import android.os.IBinder
|
|
978
|
+
import androidx.core.app.NotificationCompat
|
|
979
|
+
|
|
980
|
+
class CallForegroundService : Service() {
|
|
981
|
+
companion object {
|
|
982
|
+
private const val NOTIFICATION_ID = 1001
|
|
983
|
+
private const val CHANNEL_ID = "call_foreground_channel"
|
|
984
|
+
|
|
985
|
+
fun start(context: Context) {
|
|
986
|
+
val intent = Intent(context, CallForegroundService::class.java)
|
|
987
|
+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
|
988
|
+
context.startForegroundService(intent)
|
|
989
|
+
} else {
|
|
990
|
+
context.startService(intent)
|
|
991
|
+
}
|
|
992
|
+
}
|
|
993
|
+
|
|
994
|
+
fun stop(context: Context) {
|
|
995
|
+
val intent = Intent(context, CallForegroundService::class.java)
|
|
996
|
+
context.stopService(intent)
|
|
997
|
+
}
|
|
998
|
+
}
|
|
999
|
+
|
|
1000
|
+
override fun onCreate() {
|
|
1001
|
+
super.onCreate()
|
|
1002
|
+
createNotificationChannel()
|
|
1003
|
+
// Start foreground notification to ensure background capture permission
|
|
1004
|
+
startForeground(NOTIFICATION_ID, createNotification())
|
|
1005
|
+
}
|
|
1006
|
+
|
|
1007
|
+
override fun onBind(intent: Intent?): IBinder? = null
|
|
1008
|
+
|
|
1009
|
+
private fun createNotification(): Notification {
|
|
1010
|
+
return NotificationCompat.Builder(this, CHANNEL_ID)
|
|
1011
|
+
.setContentTitle("In Call")
|
|
1012
|
+
.setContentText("App is running in background to maintain call")
|
|
1013
|
+
.setSmallIcon(android.R.drawable.ic_menu_call) // Replace with your app icon
|
|
1014
|
+
.setPriority(NotificationCompat.PRIORITY_HIGH)
|
|
1015
|
+
.build()
|
|
1016
|
+
}
|
|
1017
|
+
|
|
1018
|
+
private fun createNotificationChannel() {
|
|
1019
|
+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
|
1020
|
+
val channel = NotificationChannel(
|
|
1021
|
+
CHANNEL_ID,
|
|
1022
|
+
"Call Keep-Alive Service",
|
|
1023
|
+
NotificationManager.IMPORTANCE_HIGH
|
|
1024
|
+
)
|
|
1025
|
+
val manager = getSystemService(NotificationManager::class.java)
|
|
1026
|
+
manager.createNotificationChannel(channel)
|
|
1027
|
+
}
|
|
1028
|
+
}
|
|
1029
|
+
}
|
|
1030
|
+
```
|
|
1031
|
+
|
|
1032
|
+
#### iOS Configuration
|
|
1033
|
+
|
|
1034
|
+
**Steps:** In Xcode:
|
|
1035
|
+
1. Select your project `Target` → `Signing & Capabilities`.
|
|
1036
|
+
|
|
1037
|
+
2. Click `+ Capability`.
|
|
1038
|
+
|
|
1039
|
+
3. Add `Background Modes`.
|
|
1040
|
+
|
|
1041
|
+
4. Check:
|
|
1042
|
+
|
|
1043
|
+
- `Audio, AirPlay, and Picture in Picture` (for audio and PiP)
|
|
1044
|
+
|
|
1045
|
+
- `Voice over IP` (for VoIP)
|
|
1046
|
+
|
|
1047
|
+
- `Remote notifications` (optional, for offline push)
|
|
1048
|
+
|
|
1049
|
+
Your `Info.plist` will automatically include:
|
|
1050
|
+
|
|
1051
|
+
``` xml
|
|
1052
|
+
<key>UIBackgroundModes</key>
|
|
1053
|
+
<array>
|
|
1054
|
+
<string>audio</string>
|
|
1055
|
+
<string>voip</string>
|
|
1056
|
+
<string>remote-notification</string>
|
|
1057
|
+
</array>
|
|
1058
|
+
```
|
|
1059
|
+
- **Configure Audio Session (AVAudioSession):**
|
|
1060
|
+
|
|
1061
|
+
Set up the audio session before the call starts—ideally in the call UI's `viewDidLoad`, before dialing, or before answering.
|
|
1062
|
+
|
|
1063
|
+
``` swift
|
|
1064
|
+
import AVFoundation
|
|
1065
|
+
|
|
1066
|
+
/**
|
|
1067
|
+
* Configure audio session for background audio capture.
|
|
1068
|
+
*
|
|
1069
|
+
* Recommended scenarios:
|
|
1070
|
+
* 1. In call UI's viewDidLoad
|
|
1071
|
+
* 2. Before making a call (calls)
|
|
1072
|
+
* 3. Before answering a call (accept)
|
|
1073
|
+
*/
|
|
1074
|
+
private func start() {
|
|
1075
|
+
let audioSession = AVAudioSession.sharedInstance()
|
|
1076
|
+
do {
|
|
1077
|
+
// Set audio session category to play and record
|
|
1078
|
+
// .allowBluetooth: Supports Bluetooth headset
|
|
1079
|
+
// .allowBluetoothA2DP: Supports high-quality Bluetooth audio (A2DP)
|
|
1080
|
+
try audioSession.setCategory(.playAndRecord, options: [.allowBluetooth, .allowBluetoothA2DP])
|
|
1081
|
+
|
|
1082
|
+
// Activate audio session
|
|
1083
|
+
try audioSession.setActive(true)
|
|
1084
|
+
} catch {
|
|
1085
|
+
// Audio session configuration failed
|
|
1086
|
+
}
|
|
1087
|
+
}
|
|
1088
|
+
```
|
|
1089
|
+
|
|
1090
|
+
> **Note:**
|
|
1091
|
+
>
|
|
1092
|
+
|
|
1093
|
+
> Call `start()` via MethodChannel at the appropriate time in your app to enable background keep-alive.
|
|
1094
|
+
>
|
|
1095
|
+
|
|
1096
|
+
## FAQ
|
|
1097
|
+
|
|
1098
|
+
### iOS Release Build [symbol not found] Error?
|
|
1099
|
+
|
|
1100
|
+
Since tencent_rtc_sdk uses Flutter FFI, Xcode's symbol stripping during Release builds may remove TRTC C symbols and cause `symbol not found` errors. To resolve:
|
|
1101
|
+
1. In Build Settings, set **Deployment Postprocessing** to **Yes**.
|
|
1102
|
+
|
|
1103
|
+
2. Set **Strip Style** for Release to **Non-Global Symbols**.
|
|
1104
|
+
|
|
1105
|
+
### If the callee goes offline and then comes online within the call invitation timeout, will they receive the incoming call event?
|
|
1106
|
+
|
|
1107
|
+
For single calls, if the callee comes online within the timeout, they will receive the call invitation. For group calls, if the callee comes online within the timeout, up to 20 unprocessed group messages will be pulled; if there is a call invitation, the incoming call event is triggered.
|
|
1108
|
+
|
|
1109
|
+
## Contact Us
|
|
1110
|
+
|
|
1111
|
+
If you have questions or suggestions during integration or usage, join our [Telegram](https://t.me/+Lmw2MSqW6ethMGM1) technical group or [Contact Us](https://trtc.io/contact) for support.
|