@tencent-rtc/mcp 1.4.7 → 1.6.0-beta.1
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/knowledge/bm25-cache.js +74 -0
- package/knowledge/bm25-cache.js.map +1 -0
- package/knowledge/bm25.js +148 -0
- package/knowledge/bm25.js.map +1 -0
- package/knowledge/build-index.js +70 -0
- package/knowledge/build-index.js.map +1 -0
- package/knowledge/chunker.js +168 -0
- package/knowledge/chunker.js.map +1 -0
- package/knowledge/content-loader.js +40 -0
- package/knowledge/content-loader.js.map +1 -0
- package/knowledge/doc-url-resolver.js +143 -0
- package/knowledge/doc-url-resolver.js.map +1 -0
- package/knowledge/extractors.js +26 -0
- package/knowledge/extractors.js.map +1 -0
- package/knowledge/path-meta.js +185 -0
- package/knowledge/path-meta.js.map +1 -0
- package/knowledge/search/exact-lookup.js +498 -0
- package/knowledge/search/exact-lookup.js.map +1 -0
- package/knowledge/search/filter-pool.js +105 -0
- package/knowledge/search/filter-pool.js.map +1 -0
- package/knowledge/search/product-scope-intent.js +41 -0
- package/knowledge/search/product-scope-intent.js.map +1 -0
- package/knowledge/search/requires-framework.js +82 -0
- package/knowledge/search/requires-framework.js.map +1 -0
- package/knowledge/search/search-knowledge.js +230 -0
- package/knowledge/search/search-knowledge.js.map +1 -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.js +35 -11
- package/server.js.map +1 -1
- package/tools/call/get_native_call_uikit_integration.js +2 -3
- package/tools/call/get_native_call_uikit_integration.js.map +1 -1
- package/tools/call/get_native_callkit_core_integration.js +2 -5
- package/tools/call/get_native_callkit_core_integration.js.map +1 -1
- package/tools/call/get_web_call_uikit_integration.js +2 -3
- package/tools/call/get_web_call_uikit_integration.js.map +1 -1
- package/tools/chat/get_native_chat_uikit_integration.js +2 -3
- package/tools/chat/get_native_chat_uikit_integration.js.map +1 -1
- package/tools/chat/get_web_chat_uikit_integration.js +2 -3
- package/tools/chat/get_web_chat_uikit_integration.js.map +1 -1
- package/tools/common/present_framework_choice.js +19 -13
- package/tools/common/present_framework_choice.js.map +1 -1
- package/tools/common/record_answer.js +19 -25
- package/tools/common/record_answer.js.map +1 -1
- package/tools/common/record_feedback.js +17 -30
- package/tools/common/record_feedback.js.map +1 -1
- package/tools/common/search_trtc_knowledge.js +45 -0
- package/tools/common/search_trtc_knowledge.js.map +1 -0
- package/tools/definitions/get_native_call_uikit_integration_def.js +3 -1
- package/tools/definitions/get_native_call_uikit_integration_def.js.map +1 -1
- package/tools/definitions/get_native_callkit_core_integration_def.js +5 -3
- package/tools/definitions/get_native_callkit_core_integration_def.js.map +1 -1
- package/tools/definitions/get_native_chat_uikit_integration_def.js +5 -2
- package/tools/definitions/get_native_chat_uikit_integration_def.js.map +1 -1
- package/tools/definitions/get_native_livekit_core_integration_def.js +6 -5
- package/tools/definitions/get_native_livekit_core_integration_def.js.map +1 -1
- package/tools/definitions/get_web_call_uikit_integration_def.js +4 -2
- package/tools/definitions/get_web_call_uikit_integration_def.js.map +1 -1
- package/tools/definitions/get_web_chat_uikit_integration_def.js +2 -0
- package/tools/definitions/get_web_chat_uikit_integration_def.js.map +1 -1
- package/tools/definitions/get_web_live_uikit_integration_def.js +5 -5
- package/tools/definitions/get_web_live_uikit_integration_def.js.map +1 -1
- package/tools/definitions/get_web_room_core_integration_def.js +50 -0
- package/tools/definitions/get_web_room_core_integration_def.js.map +1 -0
- package/tools/definitions/get_web_room_uikit_integration_def.js +5 -4
- package/tools/definitions/get_web_room_uikit_integration_def.js.map +1 -1
- package/tools/definitions/integration-boundary.js +6 -0
- package/tools/definitions/integration-boundary.js.map +1 -0
- package/tools/definitions/present_framework_choice_def.js +12 -10
- package/tools/definitions/present_framework_choice_def.js.map +1 -1
- package/tools/definitions/record_answer_def.js +19 -17
- package/tools/definitions/record_answer_def.js.map +1 -1
- package/tools/definitions/record_feedback_def.js +14 -13
- package/tools/definitions/record_feedback_def.js.map +1 -1
- package/tools/definitions/search_trtc_knowledge_def.js +40 -0
- package/tools/definitions/search_trtc_knowledge_def.js.map +1 -0
- package/tools/index.js +5 -36
- package/tools/index.js.map +1 -1
- package/tools/live/get_native_livekit_core_integration.js +1 -3
- package/tools/live/get_native_livekit_core_integration.js.map +1 -1
- package/tools/live/get_web_live_uikit_integration.js +2 -4
- package/tools/live/get_web_live_uikit_integration.js.map +1 -1
- package/tools/room/get_web_room_core_integration.js +48 -0
- package/tools/room/get_web_room_core_integration.js.map +1 -0
- package/tools/room/get_web_room_uikit_integration.js +2 -3
- package/tools/room/get_web_room_uikit_integration.js.map +1 -1
- package/utils/generate-structured-result.js +24 -30
- package/utils/generate-structured-result.js.map +1 -1
- package/utils/get-doc-content.js +14 -8
- package/utils/get-doc-content.js.map +1 -1
- package/utils/report-cls-client.js +18 -20
- package/utils/report-cls-client.js.map +1 -1
- package/utils/report-es-client.js +1 -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/tools/call/get_callkit_api.js +0 -33
- package/tools/call/get_callkit_api.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_web_chat_uikit_component_detail.js +0 -35
- package/tools/chat/get_web_chat_uikit_component_detail.js.map +0 -1
- package/tools/common/get_faq.js +0 -266
- package/tools/common/get_faq.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_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_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_trtc_sdk_docs_def.js +0 -32
- package/tools/definitions/get_native_trtc_sdk_docs_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_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_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/record_skill_session_def.js +0 -31
- package/tools/definitions/record_skill_session_def.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_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_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/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/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,726 @@
|
|
|
1
|
+
`LiveListStore` is the central module in `AtomicXCore` for managing live room lists and handling all aspects of live room lifecycle, including creation, entry, and state maintenance. Use `LiveListStore` to implement robust live streaming lifecycle management in your application.
|
|
2
|
+
|
|
3
|
+
## Core Features
|
|
4
|
+
- **Get live room list**: Obtain the current list of all public live rooms, supporting load by page.
|
|
5
|
+
|
|
6
|
+
- **Live stream lifecycle management**: Provides a complete process API for creation, going live, joining, leaving, and ending live stream.
|
|
7
|
+
|
|
8
|
+
- **Live stream information update**: Hosts can update publicly available information in the live streaming room at any time, such as cover and notice.
|
|
9
|
+
|
|
10
|
+
- **Real-time event monitoring**: Listen to key events such as live streaming end and users being kicked out.
|
|
11
|
+
|
|
12
|
+
- **Custom business data**: Powerful custom metadata (`MetaData`) capacity allows you to store and synchronize any business-relevant information in the room, such as live status, music info, and custom role.
|
|
13
|
+
|
|
14
|
+
## Core Concepts
|
|
15
|
+
|
|
16
|
+
Before starting integration, let's learn about several core concepts related to `LiveListStore` in the following table:
|
|
17
|
+
|
|
18
|
+
|**Core Concepts**|**Type**|**Core Responsibilities and Description**|
|
|
19
|
+
|---------|---------|---------|
|
|
20
|
+
|[LiveInfo](https://tencent-rtc.github.io/TUIKit_Flutter/api_live_live_list_store/LiveInfo-class.html)|`class`|Represents the information model of a live room. It contains live ID (`liveID`), name (`liveName`), room owner information (`liveOwner`) and custom metadata (`metaData`).|
|
|
21
|
+
|[LiveListState](https://tencent-rtc.github.io/TUIKit_Flutter/api_live_live_list_store/LiveListState-class.html)|`class`|Represents the current status of the live list module. Its core attribute `liveList` is a `ValueListenable<List<LiveInfo>>` data type, storing the fetched live stream list. `currentLive` represents the live room information where the user currently resides.|
|
|
22
|
+
|[LiveListListener](https://tencent-rtc.github.io/TUIKit_Flutter/api_live_live_list_store/LiveListListener-class.html)|`class`|Represents the global event listener for a live streaming room. It includes two callbacks, `onLiveEnded` (live streaming end) and `onKickedOutOfLive` (kicked out of live), used to process key room status updates.|
|
|
23
|
+
|[LiveListStore](https://tencent-rtc.github.io/TUIKit_Flutter/api_live_live_list_store/LiveListStore-class.html)|`class`|This is the core management class for interaction with the live list and room lifecycle. It is a Global Singleton (`shared`), responsible for all live streaming room operations such as create, join, and information update.|
|
|
24
|
+
|
|
25
|
+
## Implementation Steps
|
|
26
|
+
|
|
27
|
+
### Step 1: Integrate the Component
|
|
28
|
+
- **Live streaming**: Refer to Quick Integration with **AtomicXCore**, and complete the feature implementation for Go Live (Host) and audience viewing.
|
|
29
|
+
|
|
30
|
+
- **Voice chat room**: Refer to Quick Integration with **AtomicXCore**, and complete the feature implementation for Go Live (Host) and audience listening.
|
|
31
|
+
|
|
32
|
+
### Step 2: Implement Audience Entry to Live Room
|
|
33
|
+
|
|
34
|
+
Create a page to display a live broadcast list. This page uses `GridView` to layout live streaming room cards. When a user clicks a certain card, get the `liveID` of the room and navigate to the audience viewing page.
|
|
35
|
+
``` java
|
|
36
|
+
import 'package:flutter/material.dart';
|
|
37
|
+
import 'package:atomic_x_core/atomicxcore.dart';
|
|
38
|
+
|
|
39
|
+
/// Live stream list page
|
|
40
|
+
class LiveListPage extends StatefulWidget {
|
|
41
|
+
const LiveListPage({super.key});
|
|
42
|
+
|
|
43
|
+
@override
|
|
44
|
+
State<LiveListPage> createState() => _LiveListPageState();
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
class _LiveListPageState extends State<LiveListPage> {
|
|
48
|
+
final _liveListStore = LiveListStore.shared;
|
|
49
|
+
final ScrollController _scrollController = ScrollController();
|
|
50
|
+
bool _isLoading = false;
|
|
51
|
+
|
|
52
|
+
@override
|
|
53
|
+
void initState() {
|
|
54
|
+
super.initState();
|
|
55
|
+
_liveListStore.liveState.liveList.addListener(_onLiveListChanged);
|
|
56
|
+
_scrollController.addListener(_onScroll);
|
|
57
|
+
_fetchLiveList();
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
void _onLiveListChanged() {
|
|
61
|
+
setState(() {});
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
void _onScroll() {
|
|
65
|
+
// Load more when scrolling to the bottom
|
|
66
|
+
if (_scrollController.position.pixels >=
|
|
67
|
+
_scrollController.position.maxScrollExtent - 200) {
|
|
68
|
+
_loadMore();
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
Future<void> _fetchLiveList() async {
|
|
73
|
+
if (_isLoading) return;
|
|
74
|
+
setState(() => _isLoading = true);
|
|
75
|
+
|
|
76
|
+
final result = await _liveListStore.fetchLiveList(cursor: '', count: 20);
|
|
77
|
+
if (!result.isSuccess) {
|
|
78
|
+
debugPrint('List live stream failed: ${result.message}');
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
setState(() => _isLoading = false);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
Future<void> _loadMore() async {
|
|
85
|
+
if (_isLoading) return;
|
|
86
|
+
|
|
87
|
+
final cursor = _liveListStore.liveState.liveListCursor.value;
|
|
88
|
+
if (cursor.isEmpty) return; // no more data
|
|
89
|
+
|
|
90
|
+
setState(() => _isLoading = true);
|
|
91
|
+
await _liveListStore.fetchLiveList(cursor: cursor, count: 20);
|
|
92
|
+
setState(() => _isLoading = false);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
Future<void> _refresh() async {
|
|
96
|
+
_liveListStore.reset();
|
|
97
|
+
await _fetchLiveList();
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
// When user click certain card in the list
|
|
101
|
+
void _onLiveCardTap(LiveInfo liveInfo) {
|
|
102
|
+
// Create an audience viewing webpage and input the liveID
|
|
103
|
+
Navigator.push(
|
|
104
|
+
context,
|
|
105
|
+
MaterialPageRoute(
|
|
106
|
+
builder: (context) => YourAudiencePage(liveID: liveInfo.liveID),
|
|
107
|
+
),
|
|
108
|
+
);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
@override
|
|
112
|
+
void dispose() {
|
|
113
|
+
_liveListStore.liveState.liveList.removeListener(_onLiveListChanged);
|
|
114
|
+
_scrollController.dispose();
|
|
115
|
+
super.dispose();
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
@override
|
|
119
|
+
Widget build(BuildContext context) {
|
|
120
|
+
final liveList = _liveListStore.liveState.liveList.value;
|
|
121
|
+
|
|
122
|
+
return Scaffold(
|
|
123
|
+
appBar: AppBar(title: const Text('Live Stream List')),
|
|
124
|
+
body: RefreshIndicator(
|
|
125
|
+
onRefresh: _refresh,
|
|
126
|
+
child: liveList.isEmpty
|
|
127
|
+
? Center(
|
|
128
|
+
child: _isLoading
|
|
129
|
+
? const CircularProgressIndicator()
|
|
130
|
+
const Text('No live stream')
|
|
131
|
+
)
|
|
132
|
+
: GridView.builder(
|
|
133
|
+
controller: _scrollController,
|
|
134
|
+
padding: const EdgeInsets.all(8),
|
|
135
|
+
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
|
|
136
|
+
crossAxisCount: 2,
|
|
137
|
+
childAspectRatio: 0.75,
|
|
138
|
+
crossAxisSpacing: 8,
|
|
139
|
+
mainAxisSpacing: 8,
|
|
140
|
+
),
|
|
141
|
+
itemCount: liveList.length + (_isLoading ? 1 : 0),
|
|
142
|
+
itemBuilder: (context, index) {
|
|
143
|
+
if (index >= liveList.length) {
|
|
144
|
+
return const Center(child: CircularProgressIndicator());
|
|
145
|
+
}
|
|
146
|
+
return _buildLiveCard(liveList[index]);
|
|
147
|
+
},
|
|
148
|
+
),
|
|
149
|
+
),
|
|
150
|
+
);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
Widget _buildLiveCard(LiveInfo liveInfo) {
|
|
154
|
+
return GestureDetector(
|
|
155
|
+
onTap: () => _onLiveCardTap(liveInfo),
|
|
156
|
+
child: Card(
|
|
157
|
+
clipBehavior: Clip.antiAlias,
|
|
158
|
+
child: Column(
|
|
159
|
+
crossAxisAlignment: CrossAxisAlignment.start,
|
|
160
|
+
children: [
|
|
161
|
+
Cover image
|
|
162
|
+
Expanded(
|
|
163
|
+
child: Stack(
|
|
164
|
+
fit: StackFit.expand,
|
|
165
|
+
children: [
|
|
166
|
+
Image.network(
|
|
167
|
+
liveInfo.coverURL,
|
|
168
|
+
fit: BoxFit.cover,
|
|
169
|
+
errorBuilder: (context, error, stackTrace) {
|
|
170
|
+
return Container(color: Colors.grey[300]);
|
|
171
|
+
},
|
|
172
|
+
),
|
|
173
|
+
// Live stream tag
|
|
174
|
+
Positioned(
|
|
175
|
+
top: 8,
|
|
176
|
+
left: 8,
|
|
177
|
+
child: Container(
|
|
178
|
+
padding: const EdgeInsets.symmetric(
|
|
179
|
+
horizontal: 6,
|
|
180
|
+
vertical: 2,
|
|
181
|
+
),
|
|
182
|
+
decoration: BoxDecoration(
|
|
183
|
+
color: Colors.red,
|
|
184
|
+
borderRadius: BorderRadius.circular(4),
|
|
185
|
+
),
|
|
186
|
+
child: const Text(
|
|
187
|
+
Live streaming
|
|
188
|
+
style: TextStyle(color: Colors.white, fontSize: 10),
|
|
189
|
+
),
|
|
190
|
+
),
|
|
191
|
+
),
|
|
192
|
+
viewers
|
|
193
|
+
Positioned(
|
|
194
|
+
bottom: 8,
|
|
195
|
+
right: 8,
|
|
196
|
+
child: Container(
|
|
197
|
+
padding: const EdgeInsets.symmetric(
|
|
198
|
+
horizontal: 6,
|
|
199
|
+
vertical: 2,
|
|
200
|
+
),
|
|
201
|
+
decoration: BoxDecoration(
|
|
202
|
+
color: Colors.black54,
|
|
203
|
+
borderRadius: BorderRadius.circular(4),
|
|
204
|
+
),
|
|
205
|
+
child: Row(
|
|
206
|
+
mainAxisSize: MainAxisSize.min,
|
|
207
|
+
children: [
|
|
208
|
+
const Icon(
|
|
209
|
+
Icons.visibility,
|
|
210
|
+
color: Colors.white,
|
|
211
|
+
size: 12,
|
|
212
|
+
),
|
|
213
|
+
const SizedBox(width: 4),
|
|
214
|
+
Text(
|
|
215
|
+
'${liveInfo.totalViewerCount}',
|
|
216
|
+
style: const TextStyle(
|
|
217
|
+
color: Colors.white,
|
|
218
|
+
fontSize: 10,
|
|
219
|
+
),
|
|
220
|
+
),
|
|
221
|
+
],
|
|
222
|
+
),
|
|
223
|
+
),
|
|
224
|
+
),
|
|
225
|
+
],
|
|
226
|
+
),
|
|
227
|
+
),
|
|
228
|
+
// Live streaming information
|
|
229
|
+
Padding(
|
|
230
|
+
padding: const EdgeInsets.all(8),
|
|
231
|
+
child: Column(
|
|
232
|
+
crossAxisAlignment: CrossAxisAlignment.start,
|
|
233
|
+
children: [
|
|
234
|
+
Text(
|
|
235
|
+
liveInfo.liveName,
|
|
236
|
+
maxLines: 1,
|
|
237
|
+
overflow: TextOverflow.ellipsis,
|
|
238
|
+
style: const TextStyle(fontWeight: FontWeight.bold),
|
|
239
|
+
),
|
|
240
|
+
const SizedBox(height: 4),
|
|
241
|
+
Row(
|
|
242
|
+
children: [
|
|
243
|
+
CircleAvatar(
|
|
244
|
+
radius: 10,
|
|
245
|
+
backgroundImage: NetworkImage(
|
|
246
|
+
liveInfo.liveOwner.avatarURL,
|
|
247
|
+
),
|
|
248
|
+
),
|
|
249
|
+
const SizedBox(width: 4),
|
|
250
|
+
Expanded(
|
|
251
|
+
child: Text(
|
|
252
|
+
liveInfo.liveOwner.userName,
|
|
253
|
+
maxLines: 1,
|
|
254
|
+
overflow: TextOverflow.ellipsis,
|
|
255
|
+
style: TextStyle(
|
|
256
|
+
fontSize: 12,
|
|
257
|
+
color: Colors.grey[600],
|
|
258
|
+
),
|
|
259
|
+
),
|
|
260
|
+
),
|
|
261
|
+
],
|
|
262
|
+
),
|
|
263
|
+
],
|
|
264
|
+
),
|
|
265
|
+
),
|
|
266
|
+
],
|
|
267
|
+
),
|
|
268
|
+
),
|
|
269
|
+
);
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
/// Audience viewing webpage (placeholder)
|
|
274
|
+
class YourAudiencePage extends StatelessWidget {
|
|
275
|
+
final String liveID;
|
|
276
|
+
|
|
277
|
+
const YourAudiencePage({super.key, required this.liveID});
|
|
278
|
+
|
|
279
|
+
@override
|
|
280
|
+
Widget build(BuildContext context) {
|
|
281
|
+
return Scaffold(
|
|
282
|
+
appBar: AppBar(title: const Text('Live Streaming Room')),
|
|
283
|
+
body: Center(child: Text('Live Streaming Room: $liveID')),
|
|
284
|
+
);
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
**LiveInfo Parameters**
|
|
290
|
+
|
|
291
|
+
|**Parameter Name**|**Type**|**Description**|
|
|
292
|
+
|---------|---------|---------|
|
|
293
|
+
|`liveID`|`String`|Unique identifier of the live streaming room.|
|
|
294
|
+
|`liveName`|`String`|Title of the live streaming room.|
|
|
295
|
+
|`coverURL`|`String`|Thumbnail URL of the live streaming room.|
|
|
296
|
+
|`liveOwner`|`LiveUserInfo`|Room owner's personal info.|
|
|
297
|
+
|`totalViewerCount`|`int`|Total viewers in the live streaming room.|
|
|
298
|
+
|`categoryList`|`List<int>`|Category tag list of the live streaming room.|
|
|
299
|
+
|`notice`|`String`|Announcement information in the live streaming room.|
|
|
300
|
+
|`metaData`|`Map<String, String>`|Custom metadata for complex business scenarios.|
|
|
301
|
+
|
|
302
|
+
## Advanced Usage
|
|
303
|
+
|
|
304
|
+
### Scenario 1: Categorized Live Room List
|
|
305
|
+
|
|
306
|
+
On the live square page of the App, the top section features category tags such as "Popular," "Music," and "Gaming." When users click different tags, the live stream list below dynamically filters to show only live streaming rooms of the corresponding category, thereby helping users quickly identify content of interest.
|
|
307
|
+
|
|
308
|
+
#### How It Works
|
|
309
|
+
|
|
310
|
+
The core is to use the `categoryList` property in the `LiveInfo` model. When the host starts live streaming and sets the category, the `LiveInfo` object returned by `fetchLiveList` will contain this classification information. After your App obtains the complete live list, just perform a simple filter on the client according to the user's selected category, then refresh the UI.
|
|
311
|
+
|
|
312
|
+
#### Sample Code
|
|
313
|
+
|
|
314
|
+
The following example shows how to create a `LiveListManager` to handle data and filter logic.
|
|
315
|
+
``` java
|
|
316
|
+
import 'package:flutter/material.dart';
|
|
317
|
+
import 'package:atomic_x_core/atomicxcore.dart';
|
|
318
|
+
|
|
319
|
+
/// Live stream list data manager
|
|
320
|
+
class LiveListManager extends ChangeNotifier {
|
|
321
|
+
final _liveListStore = LiveListStore.shared;
|
|
322
|
+
List<LiveInfo> _fullLiveList = [];
|
|
323
|
+
List<LiveInfo> _filteredLiveList = [];
|
|
324
|
+
int? _selectedCategoryId;
|
|
325
|
+
|
|
326
|
+
List<LiveInfo> get filteredLiveList => _filteredLiveList;
|
|
327
|
+
int? get selectedCategoryId => _selectedCategoryId;
|
|
328
|
+
late final VoidCallback _liveListChangedListener = _onLiveListChanged;
|
|
329
|
+
|
|
330
|
+
LiveListManager() {
|
|
331
|
+
_liveListStore.liveState.liveList.addListener(_liveListChangedListener);
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
void _onLiveListChanged() {
|
|
335
|
+
_fullLiveList = _liveListStore.liveState.liveList.value;
|
|
336
|
+
_applyFilter();
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
Future<void> fetchFirstPage() async {
|
|
340
|
+
_liveListStore.reset();
|
|
341
|
+
await _liveListStore.fetchLiveList(cursor: '', count: 20);
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
/// Filter live stream list by category
|
|
345
|
+
void filterLiveList({int? categoryId}) {
|
|
346
|
+
_selectedCategoryId = categoryId;
|
|
347
|
+
_applyFilter();
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
void _applyFilter() {
|
|
351
|
+
if (_selectedCategoryId == null) {
|
|
352
|
+
// If categoryId is null, display the complete list
|
|
353
|
+
_filteredLiveList = List.from(_fullLiveList);
|
|
354
|
+
} else {
|
|
355
|
+
// Filter live streaming rooms by specified category
|
|
356
|
+
_filteredLiveList = _fullLiveList.where((liveInfo) {
|
|
357
|
+
return liveInfo.categoryList.contains(_selectedCategoryId);
|
|
358
|
+
}).toList();
|
|
359
|
+
}
|
|
360
|
+
notifyListeners();
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
@override
|
|
364
|
+
void dispose() {
|
|
365
|
+
_liveListStore.liveState.liveList.removeListener(_liveListChangedListener);
|
|
366
|
+
super.dispose();
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
```
|
|
370
|
+
``` java
|
|
371
|
+
/// Live stream list webpage with category filtering
|
|
372
|
+
class CategoryLiveListPage extends StatefulWidget {
|
|
373
|
+
const CategoryLiveListPage({super.key});
|
|
374
|
+
|
|
375
|
+
@override
|
|
376
|
+
State<CategoryLiveListPage> createState() => _CategoryLiveListPageState();
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
class _CategoryLiveListPageState extends State<CategoryLiveListPage> {
|
|
380
|
+
final _manager = LiveListManager();
|
|
381
|
+
late final VoidCallback _managerChangedListener = _onManagerChanged;
|
|
382
|
+
|
|
383
|
+
// Classification list (example)
|
|
384
|
+
final List<Map<String, dynamic>> _categories = [
|
|
385
|
+
{'id': null, 'name': 'All'},
|
|
386
|
+
{'id': 1, 'name': 'Music'},
|
|
387
|
+
{'id': 2, 'name': 'Game'},
|
|
388
|
+
{'id': 3, 'name': 'Chat'},
|
|
389
|
+
];
|
|
390
|
+
|
|
391
|
+
@override
|
|
392
|
+
void initState() {
|
|
393
|
+
super.initState();
|
|
394
|
+
_manager.addListener(_managerChangedListener);
|
|
395
|
+
_manager.fetchFirstPage();
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
void _onManagerChanged() {
|
|
399
|
+
setState(() {});
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
// When the user clicks the top category tag
|
|
403
|
+
void _onCategoryTap(int? categoryId) {
|
|
404
|
+
_manager.filterLiveList(categoryId: categoryId);
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
@override
|
|
408
|
+
void dispose() {
|
|
409
|
+
_manager.removeListener(_managerChangedListener);
|
|
410
|
+
_manager.dispose();
|
|
411
|
+
super.dispose();
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
@override
|
|
415
|
+
Widget build(BuildContext context) {
|
|
416
|
+
return Scaffold(
|
|
417
|
+
appBar: AppBar(title: const Text('Live Streaming Plaza')),
|
|
418
|
+
body: Column(
|
|
419
|
+
children: [
|
|
420
|
+
// Category tag bar
|
|
421
|
+
SizedBox(
|
|
422
|
+
height: 50,
|
|
423
|
+
child: ListView.builder(
|
|
424
|
+
scrollDirection: Axis.horizontal,
|
|
425
|
+
padding: const EdgeInsets.symmetric(horizontal: 8),
|
|
426
|
+
itemCount: _categories.length,
|
|
427
|
+
itemBuilder: (context, index) {
|
|
428
|
+
final category = _categories[index];
|
|
429
|
+
final isSelected = _manager.selectedCategoryId == category['id'];
|
|
430
|
+
return Padding(
|
|
431
|
+
padding: const EdgeInsets.symmetric(horizontal: 4),
|
|
432
|
+
child: ChoiceChip(
|
|
433
|
+
label: Text(category['name']),
|
|
434
|
+
selected: isSelected,
|
|
435
|
+
onSelected: (_) => _onCategoryTap(category['id']),
|
|
436
|
+
),
|
|
437
|
+
);
|
|
438
|
+
},
|
|
439
|
+
),
|
|
440
|
+
),
|
|
441
|
+
// Live stream list
|
|
442
|
+
Expanded(
|
|
443
|
+
child: _manager.filteredLiveList.isEmpty
|
|
444
|
+
? const Center(child: Text('No live stream'))
|
|
445
|
+
: GridView.builder(
|
|
446
|
+
padding: const EdgeInsets.all(8),
|
|
447
|
+
gridDelegate:
|
|
448
|
+
const SliverGridDelegateWithFixedCrossAxisCount(
|
|
449
|
+
crossAxisCount: 2,
|
|
450
|
+
childAspectRatio: 0.75,
|
|
451
|
+
crossAxisSpacing: 8,
|
|
452
|
+
mainAxisSpacing: 8,
|
|
453
|
+
),
|
|
454
|
+
itemCount: _manager.filteredLiveList.length,
|
|
455
|
+
itemBuilder: (context, index) {
|
|
456
|
+
final liveInfo = _manager.filteredLiveList[index];
|
|
457
|
+
return _buildLiveCard(liveInfo);
|
|
458
|
+
},
|
|
459
|
+
),
|
|
460
|
+
),
|
|
461
|
+
],
|
|
462
|
+
),
|
|
463
|
+
);
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
Widget _buildLiveCard(LiveInfo liveInfo) {
|
|
467
|
+
return Card(
|
|
468
|
+
clipBehavior: Clip.antiAlias,
|
|
469
|
+
child: Column(
|
|
470
|
+
crossAxisAlignment: CrossAxisAlignment.start,
|
|
471
|
+
children: [
|
|
472
|
+
Expanded(
|
|
473
|
+
child: Image.network(
|
|
474
|
+
liveInfo.coverURL,
|
|
475
|
+
fit: BoxFit.cover,
|
|
476
|
+
width: double.infinity,
|
|
477
|
+
errorBuilder: (context, error, stackTrace) {
|
|
478
|
+
return Container(color: Colors.grey[300]);
|
|
479
|
+
},
|
|
480
|
+
),
|
|
481
|
+
),
|
|
482
|
+
Padding(
|
|
483
|
+
padding: const EdgeInsets.all(8),
|
|
484
|
+
child: Text(
|
|
485
|
+
liveInfo.liveName,
|
|
486
|
+
maxLines: 1,
|
|
487
|
+
overflow: TextOverflow.ellipsis,
|
|
488
|
+
),
|
|
489
|
+
),
|
|
490
|
+
],
|
|
491
|
+
),
|
|
492
|
+
);
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
```
|
|
496
|
+
|
|
497
|
+
### Scenario 2: Show Product Information in Live Shopping
|
|
498
|
+
|
|
499
|
+
During e-commerce live streaming, when the host introduces a product, a product card appears below the live video for all viewers, showing the product image, name, and price in real time. When the host switches products, the product card is instantly synchronized across all audience clients.
|
|
500
|
+
|
|
501
|
+
#### How It Works
|
|
502
|
+
|
|
503
|
+
On the host side, set the current product's structured information (preferably in JSON format) to a custom key (for example, "product_info") using the `updateLiveMetaData` API. AtomicXCore will instantly sync this data to all viewers. On the audience side, subscribe to `LiveListState.currentLive` and listen for changes in metaData. When product_info updates, parse the JSON and refresh the product card UI.
|
|
504
|
+
|
|
505
|
+
#### Sample Code
|
|
506
|
+
``` java
|
|
507
|
+
import 'dart:convert';
|
|
508
|
+
import 'package:flutter/material.dart';
|
|
509
|
+
import 'package:atomic_x_core/atomicxcore.dart';
|
|
510
|
+
|
|
511
|
+
/// Product Information Model
|
|
512
|
+
class Product {
|
|
513
|
+
final String id;
|
|
514
|
+
final String name;
|
|
515
|
+
final String price;
|
|
516
|
+
final String imageUrl;
|
|
517
|
+
|
|
518
|
+
Product({
|
|
519
|
+
required this.id,
|
|
520
|
+
required this.name,
|
|
521
|
+
required this.price,
|
|
522
|
+
required this.imageUrl,
|
|
523
|
+
});
|
|
524
|
+
|
|
525
|
+
factory Product.fromJson(Map<String, dynamic> json) {
|
|
526
|
+
return Product(
|
|
527
|
+
id: json['id'] ?? '',
|
|
528
|
+
name: json['name'] ?? '',
|
|
529
|
+
price: json['price'] ?? '',
|
|
530
|
+
imageUrl: json['imageUrl'] ?? '',
|
|
531
|
+
);
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
Map<String, dynamic> toJson() {
|
|
535
|
+
return {
|
|
536
|
+
'id': id,
|
|
537
|
+
'name': name,
|
|
538
|
+
'price': price,
|
|
539
|
+
'imageUrl': imageUrl,
|
|
540
|
+
};
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
/// Host: Push product information
|
|
545
|
+
class HostProductController {
|
|
546
|
+
final _liveListStore = LiveListStore.shared;
|
|
547
|
+
|
|
548
|
+
Future<void> pushProductInfo(Product product) async {
|
|
549
|
+
final jsonString = jsonEncode(product.toJson());
|
|
550
|
+
final metaData = {'product_info': jsonString};
|
|
551
|
+
|
|
552
|
+
// Use Global Singleton liveListStore to update metaData
|
|
553
|
+
final result = await _liveListStore.updateLiveMetaData(metaData);
|
|
554
|
+
if (result.isSuccess) {
|
|
555
|
+
debugPrint('Product ${product.name} pushed successfully');
|
|
556
|
+
} else {
|
|
557
|
+
debugPrint('Product information sending failed: ${result.message}');
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
/// Client: Product card component
|
|
563
|
+
class ProductCardWidget extends StatefulWidget {
|
|
564
|
+
const ProductCardWidget({super.key});
|
|
565
|
+
|
|
566
|
+
@override
|
|
567
|
+
State<ProductCardWidget> createState() => _ProductCardWidgetState();
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
class _ProductCardWidgetState extends State<ProductCardWidget> {
|
|
571
|
+
final _liveListStore = LiveListStore.shared;
|
|
572
|
+
Product? _currentProduct;
|
|
573
|
+
String? _lastProductInfo;
|
|
574
|
+
late final VoidCallback _currentLiveChangedListener = _onCurrentLiveChanged;
|
|
575
|
+
|
|
576
|
+
@override
|
|
577
|
+
void initState() {
|
|
578
|
+
super.initState();
|
|
579
|
+
_liveListStore.liveState.currentLive.addListener(_currentLiveChangedListener);
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
void _onCurrentLiveChanged() {
|
|
583
|
+
final currentLive = _liveListStore.liveState.currentLive.value;
|
|
584
|
+
final productInfo = currentLive.metaData['product_info'];
|
|
585
|
+
|
|
586
|
+
// Check whether changed
|
|
587
|
+
if (productInfo != _lastProductInfo) {
|
|
588
|
+
_lastProductInfo = productInfo;
|
|
589
|
+
_parseProductInfo(productInfo);
|
|
590
|
+
}
|
|
591
|
+
}
|
|
592
|
+
|
|
593
|
+
void _parseProductInfo(String? jsonString) {
|
|
594
|
+
if (jsonString == null || jsonString.isEmpty) {
|
|
595
|
+
setState(() => _currentProduct = null);
|
|
596
|
+
return;
|
|
597
|
+
}
|
|
598
|
+
|
|
599
|
+
try {
|
|
600
|
+
final json = jsonDecode(jsonString) as Map<String, dynamic>;
|
|
601
|
+
final product = Product.fromJson(json);
|
|
602
|
+
setState(() => _currentProduct = product);
|
|
603
|
+
} catch (e) {
|
|
604
|
+
debugPrint('Failed to parse product information: $e');
|
|
605
|
+
}
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
@override
|
|
609
|
+
void dispose() {
|
|
610
|
+
_liveListStore.liveState.currentLive.removeListener(_currentLiveChangedListener);
|
|
611
|
+
super.dispose();
|
|
612
|
+
}
|
|
613
|
+
|
|
614
|
+
@override
|
|
615
|
+
Widget build(BuildContext context) {
|
|
616
|
+
if (_currentProduct == null) {
|
|
617
|
+
return const SizedBox.shrink();
|
|
618
|
+
}
|
|
619
|
+
|
|
620
|
+
return Container(
|
|
621
|
+
margin: const EdgeInsets.all(16),
|
|
622
|
+
padding: const EdgeInsets.all(12),
|
|
623
|
+
decoration: BoxDecoration(
|
|
624
|
+
color: Colors.white,
|
|
625
|
+
borderRadius: BorderRadius.circular(12),
|
|
626
|
+
boxShadow: [
|
|
627
|
+
BoxShadow(
|
|
628
|
+
color: Colors.black.withOpacity(0.1),
|
|
629
|
+
blurRadius: 8,
|
|
630
|
+
offset: const Offset(0, 2),
|
|
631
|
+
),
|
|
632
|
+
],
|
|
633
|
+
),
|
|
634
|
+
child: Row(
|
|
635
|
+
children: [
|
|
636
|
+
product image
|
|
637
|
+
ClipRRect(
|
|
638
|
+
borderRadius: BorderRadius.circular(8),
|
|
639
|
+
child: Image.network(
|
|
640
|
+
_currentProduct!.imageUrl,
|
|
641
|
+
width: 80,
|
|
642
|
+
height: 80,
|
|
643
|
+
fit: BoxFit.cover,
|
|
644
|
+
errorBuilder: (context, error, stackTrace) {
|
|
645
|
+
return Container(
|
|
646
|
+
width: 80,
|
|
647
|
+
height: 80,
|
|
648
|
+
color: Colors.grey[300],
|
|
649
|
+
child: const Icon(Icons.image),
|
|
650
|
+
);
|
|
651
|
+
},
|
|
652
|
+
),
|
|
653
|
+
),
|
|
654
|
+
const SizedBox(width: 12),
|
|
655
|
+
product information
|
|
656
|
+
Expanded(
|
|
657
|
+
child: Column(
|
|
658
|
+
crossAxisAlignment: CrossAxisAlignment.start,
|
|
659
|
+
mainAxisSize: MainAxisSize.min,
|
|
660
|
+
children: [
|
|
661
|
+
Text(
|
|
662
|
+
_currentProduct!.name,
|
|
663
|
+
style: const TextStyle(
|
|
664
|
+
fontSize: 14,
|
|
665
|
+
fontWeight: FontWeight.bold,
|
|
666
|
+
),
|
|
667
|
+
maxLines: 2,
|
|
668
|
+
overflow: TextOverflow.ellipsis,
|
|
669
|
+
),
|
|
670
|
+
const SizedBox(height: 4),
|
|
671
|
+
Text(
|
|
672
|
+
'¥${_currentProduct!.price}',
|
|
673
|
+
style: const TextStyle(
|
|
674
|
+
fontSize: 16,
|
|
675
|
+
color: Colors.red,
|
|
676
|
+
fontWeight: FontWeight.bold,
|
|
677
|
+
),
|
|
678
|
+
),
|
|
679
|
+
],
|
|
680
|
+
),
|
|
681
|
+
),
|
|
682
|
+
purchase button
|
|
683
|
+
ElevatedButton(
|
|
684
|
+
onPressed: () {
|
|
685
|
+
// Implement purchase logic
|
|
686
|
+
debugPrint('Purchase goods: ${_currentProduct!.name}');
|
|
687
|
+
},
|
|
688
|
+
style: ElevatedButton.styleFrom(
|
|
689
|
+
backgroundColor: Colors.orange,
|
|
690
|
+
foregroundColor: Colors.white,
|
|
691
|
+
),
|
|
692
|
+
child: const Text('Buy now'),
|
|
693
|
+
),
|
|
694
|
+
],
|
|
695
|
+
),
|
|
696
|
+
);
|
|
697
|
+
}
|
|
698
|
+
}
|
|
699
|
+
```
|
|
700
|
+
|
|
701
|
+
## API documentation
|
|
702
|
+
|
|
703
|
+
For detailed information about all public interfaces, properties and methods of [LiveListStore](https://tencent-rtc.github.io/TUIKit_Flutter/api_live_live_list_store/LiveListStore-class.html) and its related classes, please refer to the official API documentation of the [AtomicXCore](https://tencent-rtc.github.io/TUIKit_Flutter/index.html) framework. The related Store used in this document is as follows:
|
|
704
|
+
|
|
705
|
+
|**Store/Component**|**Feature Description**|**API Reference**|
|
|
706
|
+
|---------|---------|---------|
|
|
707
|
+
|**LiveCoreWidget**|The core view component for live video stream display and interaction: responsible for video stream rendering and view widget processing, supporting live streaming, audience mic connection, Host Connection (TUILiveKit), and other scenarios.|[API documentation](https://tencent-rtc.github.io/TUIKit_Flutter/api_view_live_live_core_widget/LiveCoreWidget-class.html)|
|
|
708
|
+
|**LiveCoreController**|Controller for LiveCoreWidget: used to set up live streaming ID, control preview, and perform other operations.|[API documentation](https://tencent-rtc.github.io/TUIKit_Flutter/api_view_live_live_core_widget/LiveCoreController-class.html)|
|
|
709
|
+
|**LiveListStore**|Full lifecycle management of live streaming room: create/join/leave/terminate room, query room list, modify live information (name, notice), listen to live streaming status (for example being kicked out, ended).|[API documentation](https://tencent-rtc.github.io/TUIKit_Flutter/api_live_live_list_store/LiveListStore-class.html)|
|
|
710
|
+
|
|
711
|
+
## FAQs
|
|
712
|
+
|
|
713
|
+
### What restrictions and rules apply to updateLiveMetaData?
|
|
714
|
+
|
|
715
|
+
To ensure system stability and efficiency, the usage of `metaData` follows the following rules:
|
|
716
|
+
- **Permission**: Only the room owner and admin can call the API `updateLiveMetaData`. General audience has no permission.
|
|
717
|
+
|
|
718
|
+
- **Quantity and size limit: **
|
|
719
|
+
|
|
720
|
+
- A single room supports up to **10** keys.
|
|
721
|
+
|
|
722
|
+
- The length of each key does not exceed **50 bytes**, and the length of each value does not exceed **2KB**.
|
|
723
|
+
|
|
724
|
+
- The total size of ALL values in a single room is no more than **16KB**.
|
|
725
|
+
|
|
726
|
+
- **Conflict Handling**: The update mechanism for metaData is "last write wins." If multiple administrators modify the same key in quick succession, the latest change is applied. To avoid conflicts, design your business logic so that only one person modifies a given key at a time.
|