@tencentcloud/sdk-mcp 1.3.8 → 1.4.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/index.js +1 -1
- package/index.js.map +1 -1
- package/package.json +2 -2
- package/resource/doc/{tuicallkit/android/faq.md → callkit/faq/android-faq.md} +75 -308
- package/resource/doc/{tuicallkit/faq/common/error_code.md → callkit/faq/common/error-code.md} +2 -2
- package/resource/doc/{tuicallkit/flutter/faq.md → callkit/faq/flutter-faq.md} +83 -315
- package/resource/doc/{tuicallkit/iOS/faq.md → callkit/faq/ios-faq.md} +76 -313
- package/resource/doc/{tuicallkit/react/faq.md → callkit/faq/web-faq.md} +78 -311
- package/resource/doc/callkit/preset/android/api.md +330 -0
- package/resource/doc/callkit/preset/android/integration.md +530 -0
- package/resource/doc/callkit/preset/flutter/api.md +401 -0
- package/resource/doc/{tuicallkit → callkit/preset}/flutter/integration.md +53 -273
- package/resource/doc/callkit/preset/ios/api.md +282 -0
- package/resource/doc/{tuicallkit/iOS → callkit/preset/ios}/integration.md +39 -120
- package/resource/doc/callkit/preset/react/api.md +600 -0
- package/resource/doc/{tuicallkit → callkit/preset}/react/integration.md +6 -6
- package/resource/doc/callkit/preset/vue/api.md +600 -0
- package/resource/doc/{tuicallkit → callkit/preset}/vue/integration.md +5 -5
- package/resource/doc/{chatuikit → chatkit}/android/faq.md +29 -37
- package/resource/doc/{chatuikit → chatkit}/android/features/theme.md +22 -166
- package/resource/doc/chatkit/android/integration.md +498 -0
- package/resource/doc/chatkit/faq/android_sdk/client-api.md +280 -0
- package/resource/doc/{chatuikit → chatkit}/faq/common/product.md +4 -17
- package/resource/doc/{chatuikit → chatkit}/faq/common/server.md +1 -2
- package/resource/doc/chatkit/faq/flutter_sdk/client-api.md +183 -0
- package/resource/doc/{chatuikit → chatkit}/faq/flutter_sdk/faq.md +3 -3
- package/resource/doc/chatkit/faq/ios_sdk/client-api.md +279 -0
- package/resource/doc/{chatuikit → chatkit}/faq/web_sdk/error_code.md +1 -1
- package/resource/doc/{chatuikit → chatkit}/faq/web_sdk/faq.md +4 -4
- package/resource/doc/{chatuikit → chatkit}/flutter/features/theme.md +22 -166
- package/resource/doc/{chatuikit → chatkit}/flutter/integration.md +20 -95
- package/resource/doc/{chatuikit/iOS → chatkit/ios}/faq.md +29 -37
- package/resource/doc/{chatuikit/iOS → chatkit/ios}/features/theme.md +27 -176
- package/resource/doc/{chatuikit/iOS → chatkit/ios}/integration.md +78 -280
- package/resource/doc/{chatuikit/vue → chatkit/react}/components/avatar.md +0 -1
- package/resource/doc/{chatuikit → chatkit}/react/components/chat-header.md +7 -12
- package/resource/doc/{chatuikit → chatkit}/react/components/chat-setting.md +10 -17
- package/resource/doc/{chatuikit → chatkit}/react/components/chat.md +1 -1
- package/resource/doc/{chatuikit → chatkit}/react/components/component-list.md +0 -1
- package/resource/doc/{chatuikit → chatkit}/react/components/contact-list.md +122 -703
- package/resource/doc/chatkit/react/components/conversation-actions.md +174 -0
- package/resource/doc/chatkit/react/components/conversation-list.md +333 -0
- package/resource/doc/chatkit/react/components/conversation-preview.md +116 -0
- package/resource/doc/chatkit/react/components/conversation-search.md +57 -0
- package/resource/doc/{chatuikit → chatkit}/react/components/message-input.md +36 -186
- package/resource/doc/{chatuikit → chatkit}/react/components/message-list.md +21 -113
- package/resource/doc/chatkit/react/components/search.md +282 -0
- package/resource/doc/{chatuikit → chatkit}/react/components/tuikit.md +5 -26
- package/resource/doc/{chatuikit → chatkit}/react/integration.md +37 -104
- package/resource/doc/{chatuikit/react → chatkit/vue}/components/avatar.md +0 -1
- package/resource/doc/{chatuikit → chatkit}/vue/components/chat-header.md +7 -13
- package/resource/doc/{chatuikit → chatkit}/vue/components/chat-setting.md +13 -18
- package/resource/doc/{chatuikit → chatkit}/vue/components/chat.md +1 -2
- package/resource/doc/{chatuikit → chatkit}/vue/components/component-list.md +0 -1
- package/resource/doc/chatkit/vue/components/contact-list.md +271 -0
- package/resource/doc/chatkit/vue/components/conversation-actions.md +228 -0
- package/resource/doc/{chatuikit → chatkit}/vue/components/conversation-list.md +42 -316
- package/resource/doc/chatkit/vue/components/conversation-preview.md +213 -0
- package/resource/doc/chatkit/vue/components/conversation-search.md +50 -0
- package/resource/doc/{chatuikit → chatkit}/vue/components/message-input.md +1 -23
- package/resource/doc/{chatuikit → chatkit}/vue/components/message-list.md +23 -134
- package/resource/doc/{chatuikit → chatkit}/vue/components/search.md +73 -640
- package/resource/doc/chatkit/vue/components/tuikit.md +45 -0
- package/resource/doc/{chatuikit → chatkit}/vue/components/userpicker.md +4 -4
- package/resource/doc/{chatuikit → chatkit}/vue/faq.md +1 -1
- package/resource/doc/{chatuikit → chatkit}/vue/integration.md +53 -121
- package/resource/doc/livekit/core-sdk/live/android/api-reference/AudioEffectStore.md +283 -0
- package/resource/doc/livekit/core-sdk/live/android/api-reference/BarrageStore.md +148 -0
- package/resource/doc/livekit/core-sdk/live/android/api-reference/BattleStore.md +316 -0
- package/resource/doc/livekit/core-sdk/live/android/api-reference/CameraView.md +57 -0
- package/resource/doc/livekit/core-sdk/live/android/api-reference/CoGuestStore.md +419 -0
- package/resource/doc/livekit/core-sdk/live/android/api-reference/CoHostStore.md +325 -0
- package/resource/doc/livekit/core-sdk/live/android/api-reference/DeviceStore.md +436 -0
- package/resource/doc/livekit/core-sdk/live/android/api-reference/GiftStore.md +165 -0
- package/resource/doc/livekit/core-sdk/live/android/api-reference/LikeStore.md +49 -0
- package/resource/doc/livekit/core-sdk/live/android/api-reference/LiveAudienceStore.md +239 -0
- package/resource/doc/livekit/core-sdk/live/android/api-reference/LiveCoreView.md +74 -0
- package/resource/doc/livekit/core-sdk/live/android/api-reference/LiveSeatStore.md +417 -0
- package/resource/doc/livekit/core-sdk/live/android/api-reference/LoginStore.md +207 -0
- package/resource/doc/livekit/{live → core-sdk/live}/android/live-audience-list.md +17 -88
- package/resource/doc/livekit/{live → core-sdk/live}/android/live-audio-effect.md +34 -192
- package/resource/doc/livekit/{live → core-sdk/live}/android/live-barrage.md +26 -139
- package/resource/doc/livekit/{live → core-sdk/live}/android/live-base-beauty.md +16 -99
- package/resource/doc/livekit/{live → core-sdk/live}/android/live-co-guest-interaction.md +54 -161
- package/resource/doc/livekit/{live → core-sdk/live}/android/live-gift.md +75 -455
- package/resource/doc/livekit/{live → core-sdk/live}/android/live-host-interaction.md +91 -338
- package/resource/doc/livekit/{live → core-sdk/live}/android/live-integration.md +108 -492
- package/resource/doc/livekit/{live → core-sdk/live}/android/live-live-list.md +27 -165
- package/resource/doc/livekit/core-sdk/live/flutter/api-reference/AudioEffectStore.md +279 -0
- package/resource/doc/livekit/core-sdk/live/flutter/api-reference/BarrageStore.md +158 -0
- package/resource/doc/livekit/core-sdk/live/flutter/api-reference/BaseBeautyStore.md +155 -0
- package/resource/doc/livekit/core-sdk/live/flutter/api-reference/BattleStore.md +304 -0
- package/resource/doc/livekit/core-sdk/live/flutter/api-reference/CoGuestStore.md +394 -0
- package/resource/doc/livekit/core-sdk/live/flutter/api-reference/CoHostStore.md +303 -0
- package/resource/doc/livekit/core-sdk/live/flutter/api-reference/DeviceStore.md +410 -0
- package/resource/doc/livekit/core-sdk/live/flutter/api-reference/GiftStore.md +160 -0
- package/resource/doc/livekit/core-sdk/live/flutter/api-reference/LikeStore.md +51 -0
- package/resource/doc/livekit/core-sdk/live/flutter/api-reference/LiveAudienceStore.md +231 -0
- package/resource/doc/livekit/core-sdk/live/flutter/api-reference/LiveCoreView.md +143 -0
- package/resource/doc/livekit/core-sdk/live/flutter/api-reference/LiveSeatStore.md +375 -0
- package/resource/doc/livekit/core-sdk/live/flutter/api-reference/LoginStore.md +170 -0
- package/resource/doc/livekit/{live → core-sdk/live}/flutter/live-audience-list.md +13 -91
- package/resource/doc/livekit/{live → core-sdk/live}/flutter/live-audio-effect.md +34 -177
- package/resource/doc/livekit/{live → core-sdk/live}/flutter/live-barrage.md +18 -102
- package/resource/doc/livekit/{live → core-sdk/live}/flutter/live-base-beauty.md +24 -164
- package/resource/doc/livekit/{live → core-sdk/live}/flutter/live-co-guest-interaction.md +56 -161
- package/resource/doc/livekit/{live → core-sdk/live}/flutter/live-gift.md +66 -460
- package/resource/doc/livekit/{live → core-sdk/live}/flutter/live-host-interaction.md +117 -364
- package/resource/doc/livekit/core-sdk/live/flutter/live-integration.md +687 -0
- package/resource/doc/livekit/{live → core-sdk/live}/flutter/live-live-list.md +22 -161
- package/resource/doc/livekit/core-sdk/live/ios/api-reference/AudioEffectStore.md +287 -0
- package/resource/doc/livekit/core-sdk/live/ios/api-reference/BarrageStore.md +165 -0
- package/resource/doc/livekit/core-sdk/live/ios/api-reference/BaseBeautyStore.md +143 -0
- package/resource/doc/livekit/core-sdk/live/ios/api-reference/BattleStore.md +298 -0
- package/resource/doc/livekit/core-sdk/live/ios/api-reference/CoGuestStore.md +349 -0
- package/resource/doc/livekit/core-sdk/live/ios/api-reference/CoHostStore.md +297 -0
- package/resource/doc/livekit/core-sdk/live/ios/api-reference/DeviceStore.md +471 -0
- package/resource/doc/livekit/core-sdk/live/ios/api-reference/GiftStore.md +179 -0
- package/resource/doc/livekit/core-sdk/live/ios/api-reference/LikeStore.md +49 -0
- package/resource/doc/livekit/core-sdk/live/ios/api-reference/LiveAudienceStore.md +238 -0
- package/resource/doc/livekit/core-sdk/live/ios/api-reference/LiveCoreView.md +74 -0
- package/resource/doc/livekit/core-sdk/live/ios/api-reference/LiveSeatStore.md +412 -0
- package/resource/doc/livekit/core-sdk/live/ios/api-reference/LoginStore.md +173 -0
- package/resource/doc/livekit/{live → core-sdk/live}/ios/live-audience-list.md +23 -96
- package/resource/doc/livekit/{live → core-sdk/live}/ios/live-audio-effect.md +33 -195
- package/resource/doc/livekit/{live → core-sdk/live}/ios/live-barrage.md +35 -150
- package/resource/doc/livekit/{live → core-sdk/live}/ios/live-base-beauty.md +20 -105
- package/resource/doc/livekit/{live → core-sdk/live}/ios/live-co-guest-interaction.md +35 -140
- package/resource/doc/livekit/{live → core-sdk/live}/ios/live-gift.md +77 -457
- package/resource/doc/livekit/{live → core-sdk/live}/ios/live-host-interaction.md +70 -317
- package/resource/doc/livekit/{live → core-sdk/live}/ios/live-integration.md +90 -473
- package/resource/doc/livekit/{live → core-sdk/live}/ios/live-live-list.md +28 -163
- package/resource/doc/livekit/core-sdk/voice/android/voice-audience-list.md +264 -0
- package/resource/doc/livekit/core-sdk/voice/android/voice-audio-effect.md +226 -0
- package/resource/doc/livekit/core-sdk/voice/android/voice-barrage.md +456 -0
- package/resource/doc/livekit/core-sdk/voice/android/voice-co-guest-interaction.md +539 -0
- package/resource/doc/livekit/core-sdk/voice/android/voice-gift.md +453 -0
- package/resource/doc/livekit/core-sdk/voice/android/voice-host-interaction.md +516 -0
- package/resource/doc/livekit/core-sdk/voice/android/voice-integration.md +509 -0
- package/resource/doc/livekit/core-sdk/voice/android/voice-room-list.md +365 -0
- package/resource/doc/livekit/core-sdk/voice/flutter/voice-audience-list.md +259 -0
- package/resource/doc/livekit/core-sdk/voice/flutter/voice-audio-effect.md +596 -0
- package/resource/doc/livekit/core-sdk/voice/flutter/voice-barrage.md +494 -0
- package/resource/doc/livekit/core-sdk/voice/flutter/voice-co-guest-interaction.md +516 -0
- package/resource/doc/livekit/core-sdk/voice/flutter/voice-gift.md +418 -0
- package/resource/doc/livekit/core-sdk/voice/flutter/voice-integration.md +563 -0
- package/resource/doc/livekit/core-sdk/voice/flutter/voice-room-list.md +709 -0
- package/resource/doc/livekit/core-sdk/voice/ios/voice-audience-list.md +262 -0
- package/resource/doc/livekit/core-sdk/voice/ios/voice-audio-effect.md +211 -0
- package/resource/doc/livekit/core-sdk/voice/ios/voice-barrage.md +414 -0
- package/resource/doc/livekit/core-sdk/voice/ios/voice-co-guest-interaction.md +492 -0
- package/resource/doc/livekit/core-sdk/voice/ios/voice-gift.md +405 -0
- package/resource/doc/livekit/core-sdk/voice/ios/voice-host-interaction.md +611 -0
- package/resource/doc/livekit/core-sdk/voice/ios/voice-integration.md +478 -0
- package/resource/doc/livekit/core-sdk/voice/ios/voice-room-list.md +336 -0
- package/resource/doc/livekit/core-sdk/voice/uni-app/voice-audience-list.md +234 -0
- package/resource/doc/livekit/core-sdk/voice/uni-app/voice-audio-effect.md +218 -0
- package/resource/doc/livekit/core-sdk/voice/uni-app/voice-barrage.md +376 -0
- package/resource/doc/livekit/core-sdk/voice/uni-app/voice-co-guest-interaction.md +648 -0
- package/resource/doc/livekit/core-sdk/voice/uni-app/voice-gift.md +362 -0
- package/resource/doc/livekit/core-sdk/voice/uni-app/voice-integration.md +323 -0
- package/resource/doc/livekit/core-sdk/voice/uni-app/voice-room-list.md +470 -0
- package/resource/doc/livekit/faq/common/{error_code.md → error-code.md} +2 -3
- package/resource/doc/livekit/preset/live/vue/api-reference/index.md +780 -0
- package/resource/doc/livekit/preset/live/vue/components/barrage.md +291 -0
- package/resource/doc/livekit/{live → preset/live}/vue/components/co-guest-panel.md +9 -48
- package/resource/doc/livekit/{live → preset/live}/vue/components/live-audience-list.md +27 -145
- package/resource/doc/livekit/{live → preset/live}/vue/components/live-scene-panel.md +13 -76
- package/resource/doc/livekit/{live → preset/live}/vue/components/live-view.md +33 -224
- package/resource/doc/livekit/preset/live/vue/components/stream-mixer.md +211 -0
- package/resource/doc/livekit/preset/live/vue/faq.md +1 -0
- package/resource/doc/livekit/preset/live/vue/live-list-integration.md +244 -0
- package/resource/doc/livekit/preset/live/vue/live-player-desk-integration.md +301 -0
- package/resource/doc/livekit/preset/live/vue/live-player-h5-integration.md +307 -0
- package/resource/doc/livekit/preset/live/vue/live-pusher-integration.md +754 -0
- package/resource/doc/roomkit/android/features/call-user-to-room.md +234 -0
- package/resource/doc/roomkit/android/features/room-participant-state.md +850 -0
- package/resource/doc/roomkit/android/features/room-state.md +358 -0
- package/resource/doc/roomkit/android/features/schedule-room.md +336 -0
- package/resource/doc/roomkit/android/integration.md +433 -0
- package/resource/doc/roomkit/{common/error_code.md → faq/common/error-code.md} +1 -1
- package/resource/doc/roomkit/flutter/features/call-user-to-room.md +228 -0
- package/resource/doc/roomkit/flutter/features/room-participant-state.md +796 -0
- package/resource/doc/roomkit/flutter/features/room-state.md +324 -0
- package/resource/doc/roomkit/flutter/features/schedule-room.md +324 -0
- package/resource/doc/roomkit/flutter/integration.md +405 -0
- package/resource/doc/roomkit/ios/features/call-user-to-room.md +226 -0
- package/resource/doc/roomkit/ios/features/room-participant-state.md +821 -0
- package/resource/doc/roomkit/ios/features/room-state.md +320 -0
- package/resource/doc/roomkit/ios/features/schedule-room.md +318 -0
- package/resource/doc/roomkit/ios/integration.md +384 -0
- package/resource/doc/roomkit/vue/faq.md +1 -0
- package/resource/doc/roomkit/vue/features/call-user-to-room.md +17 -53
- package/resource/doc/roomkit/vue/features/device-detection.md +30 -48
- package/resource/doc/roomkit/vue/features/device-state.md +24 -44
- package/resource/doc/roomkit/vue/features/free-beauty-panel.md +13 -36
- package/resource/doc/roomkit/vue/features/room-chat.md +31 -89
- package/resource/doc/roomkit/vue/features/room-participant-state.md +28 -50
- package/resource/doc/roomkit/vue/features/room-state.md +25 -36
- package/resource/doc/roomkit/vue/features/room-view.md +30 -127
- package/resource/doc/roomkit/vue/features/schedule-room.md +9 -40
- package/resource/doc/roomkit/vue/features/screen-share.md +22 -90
- package/resource/doc/roomkit/vue/features/virtual-background.md +13 -34
- package/resource/doc/roomkit/vue/integration.md +118 -282
- package/resource/doc/rtcengine/faq/common/userSig.md +17 -141
- package/resource/doc/rtcengine/faq/web/web.md +15 -22
- package/resource/doc/rtcengine/web/api.md +17 -21
- package/resource/doc/rtcengine/web/how_to_integrated_web_sdk.md +4 -10
- package/resource/doc/rtcengine/web/how_to_run_web_sdk_demo.md +4 -8
- package/resource/doc/rtcengine/web/plugin/20-advanced-customized-capture-rendering.md +3 -3
- package/resource/doc/rtcengine/web/plugin/21-advanced-auto-play-policy.md +2 -3
- package/resource/doc/rtcengine/web/plugin/22-advanced-audio-mixer.md +6 -6
- package/resource/doc/rtcengine/web/plugin/23-advanced-support-detection.md +2 -2
- package/resource/doc/rtcengine/web/plugin/24-advanced-network-quality.md +2 -4
- package/resource/doc/rtcengine/web/plugin/25-advanced-device-change.md +1 -2
- package/resource/doc/rtcengine/web/plugin/26-advanced-publish-cdn-stream.md +2 -6
- package/resource/doc/rtcengine/web/plugin/27-advanced-small-stream.md +13 -14
- package/resource/doc/rtcengine/web/plugin/28-advanced-beauty.md +10 -90
- package/resource/doc/rtcengine/web/plugin/31-advanced-plugins-overview.md +5 -8
- package/resource/doc/rtcengine/web/plugin/34-advanced-proxy.md +31 -35
- package/resource/doc/rtcengine/web/plugin/35-advanced-ai-denoiser.md +0 -2
- package/resource/doc/rtcengine/web/plugin/36-advanced-virtual-background.md +7 -49
- package/resource/doc/rtcengine/web/plugin/37-advanced-voice-changer.md +1 -1
- package/resource/doc/rtcengine/web/plugin/39-advanced-video-decoder.md +0 -3
- package/resource/doc/rtcengine/web/plugin/40-advanced-video-mixer.md +20 -20
- package/resource/doc/rtcengine/web/plugin/41-advanced-small-stream-auto-switcher.md +1 -1
- package/resource/doc/rtcengine/web/plugin/42-advanced-realtime-transcriber.md +4 -4
- package/resource/doc/rtcengine/web/plugin/43-advanced-face-detection.md +3 -3
- package/resource/doc/trtc/C++/ITRTCCloud.md +718 -2847
- package/resource/doc/trtc/C++/ITRTCStatistics.md +53 -308
- package/resource/doc/trtc/C++/ITXAudioEffectManager.md +207 -1041
- package/resource/doc/trtc/C++/ITXDeviceManager.md +127 -768
- package/resource/doc/trtc/C++/TRTCCloudCallback.md +634 -2259
- package/resource/doc/trtc/C++/TRTCTypeDef.md +726 -3465
- package/resource/doc/trtc/C++/TXLiteAVCode.md +117 -916
- package/resource/doc/trtc/android/TRTCCloud.md +638 -2612
- package/resource/doc/trtc/android/TRTCCloudDef.md +769 -3697
- package/resource/doc/trtc/android/TRTCCloudListener.md +609 -2070
- package/resource/doc/trtc/android/TRTCStatistics.md +48 -278
- package/resource/doc/trtc/android/TXAudioEffectManager.md +207 -1049
- package/resource/doc/trtc/android/TXBeautyManager.md +127 -704
- package/resource/doc/trtc/android/TXDeviceManager.md +51 -318
- package/resource/doc/trtc/android/TXLiteAVCode.md +115 -900
- package/resource/doc/trtc/iOS/TRTCCloud.md +726 -2930
- package/resource/doc/trtc/iOS/TRTCCloudDelegate.md +580 -2099
- package/resource/doc/trtc/iOS/TRTCStatistics.md +48 -278
- package/resource/doc/trtc/iOS/TXAudioEffectManager.md +179 -896
- package/resource/doc/trtc/iOS/TXBeautyManager.md +128 -710
- package/resource/doc/trtc/iOS/TXDeviceManager.md +129 -772
- package/resource/doc/trtc/iOS/TXLiteAVCode.md +117 -915
- package/resource/doc/trtc/iOS/TXLiveSDKTypeDef.md +747 -3559
- package/server.js +1 -5
- package/server.js.map +1 -1
- package/tools/call/get_callkit_api.js +32 -0
- package/tools/call/get_callkit_api.js.map +1 -0
- package/tools/call/get_native_call_uikit_integration.js +34 -0
- package/tools/call/get_native_call_uikit_integration.js.map +1 -0
- package/tools/call/{get-web-call-integration.js → get_web_call_uikit_integration.js} +13 -8
- package/tools/call/get_web_call_uikit_integration.js.map +1 -0
- package/tools/chat/get_native_chat_uikit_feature_detail.js +34 -0
- package/tools/chat/get_native_chat_uikit_feature_detail.js.map +1 -0
- package/tools/chat/get_native_chat_uikit_integration.js +45 -0
- package/tools/chat/get_native_chat_uikit_integration.js.map +1 -0
- package/tools/chat/get_web_chat_uikit_component_detail.js +34 -0
- package/tools/chat/get_web_chat_uikit_component_detail.js.map +1 -0
- package/tools/chat/get_web_chat_uikit_integration.js +45 -0
- package/tools/chat/get_web_chat_uikit_integration.js.map +1 -0
- package/tools/common/get_faq.js +265 -0
- package/tools/common/get_faq.js.map +1 -0
- package/tools/common/{get-usersig.js → get_usersig.js} +6 -3
- package/tools/common/get_usersig.js.map +1 -0
- package/tools/common/present_framework_choice.js +63 -0
- package/tools/common/present_framework_choice.js.map +1 -0
- package/tools/definitions/get_callkit_api_def.js +28 -0
- package/tools/definitions/get_callkit_api_def.js.map +1 -0
- package/tools/definitions/get_faq_def.js +18 -19
- package/tools/definitions/get_faq_def.js.map +1 -1
- package/tools/definitions/get_native_call_uikit_integration_def.js +15 -18
- package/tools/definitions/get_native_call_uikit_integration_def.js.map +1 -1
- package/tools/definitions/get_native_chat_uikit_feature_detail_def.js +31 -0
- package/tools/definitions/get_native_chat_uikit_feature_detail_def.js.map +1 -0
- package/tools/definitions/get_native_chat_uikit_integration_def.js +16 -19
- package/tools/definitions/get_native_chat_uikit_integration_def.js.map +1 -1
- package/tools/definitions/get_native_livekit_core_features_def.js +33 -0
- package/tools/definitions/get_native_livekit_core_features_def.js.map +1 -0
- package/tools/definitions/get_native_livekit_core_integration_def.js +33 -0
- package/tools/definitions/get_native_livekit_core_integration_def.js.map +1 -0
- package/tools/definitions/get_native_trtc_sdk_docs_def.js +32 -0
- package/tools/definitions/get_native_trtc_sdk_docs_def.js.map +1 -0
- package/tools/definitions/get_usersig_def.js +17 -24
- package/tools/definitions/get_usersig_def.js.map +1 -1
- package/tools/definitions/get_web_call_uikit_integration_def.js +15 -7
- package/tools/definitions/get_web_call_uikit_integration_def.js.map +1 -1
- package/tools/definitions/get_web_chat_uikit_component_detail_def.js +17 -49
- package/tools/definitions/get_web_chat_uikit_component_detail_def.js.map +1 -1
- package/tools/definitions/get_web_chat_uikit_integration_def.js +16 -19
- package/tools/definitions/get_web_chat_uikit_integration_def.js.map +1 -1
- package/tools/definitions/get_web_live_uikit_integration_def.js +13 -18
- package/tools/definitions/get_web_live_uikit_integration_def.js.map +1 -1
- package/tools/definitions/get_web_livekit_api_def.js +27 -0
- package/tools/definitions/get_web_livekit_api_def.js.map +1 -0
- package/tools/definitions/get_web_livekit_component_detail_def.js +29 -0
- package/tools/definitions/get_web_livekit_component_detail_def.js.map +1 -0
- package/tools/definitions/get_web_room_uikit_integration_def.js +13 -30
- package/tools/definitions/get_web_room_uikit_integration_def.js.map +1 -1
- package/tools/definitions/get_web_roomkit_feature_detail_def.js +30 -0
- package/tools/definitions/get_web_roomkit_feature_detail_def.js.map +1 -0
- package/tools/definitions/get_web_trtc_sdk_api_def.js +25 -0
- package/tools/definitions/get_web_trtc_sdk_api_def.js.map +1 -0
- package/tools/definitions/get_web_trtc_sdk_integration_def.js +25 -0
- package/tools/definitions/get_web_trtc_sdk_integration_def.js.map +1 -0
- package/tools/definitions/get_web_trtc_sdk_plugin_def.js +25 -0
- package/tools/definitions/get_web_trtc_sdk_plugin_def.js.map +1 -0
- package/tools/definitions/present_framework_choice_def.js +23 -12
- package/tools/definitions/present_framework_choice_def.js.map +1 -1
- package/tools/index.js +47 -59
- package/tools/index.js.map +1 -1
- package/tools/live/get_native_livekit_core_features.js +65 -0
- package/tools/live/get_native_livekit_core_features.js.map +1 -0
- package/tools/live/get_native_livekit_core_integration.js +59 -0
- package/tools/live/get_native_livekit_core_integration.js.map +1 -0
- package/tools/live/get_web_live_uikit_integration.js +48 -0
- package/tools/live/get_web_live_uikit_integration.js.map +1 -0
- package/tools/live/get_web_livekit_api.js +32 -0
- package/tools/live/get_web_livekit_api.js.map +1 -0
- package/tools/live/get_web_livekit_component_detail.js +34 -0
- package/tools/live/get_web_livekit_component_detail.js.map +1 -0
- package/tools/room/{get-web-room-integration.js → get_web_room_uikit_integration.js} +13 -14
- package/tools/room/get_web_room_uikit_integration.js.map +1 -0
- package/tools/room/{get-web-room-feature-detail.js → get_web_roomkit_feature_detail.js} +30 -31
- package/tools/room/get_web_roomkit_feature_detail.js.map +1 -0
- package/tools/rtcengine/get_web_trtc_sdk_api.js +31 -0
- package/tools/rtcengine/get_web_trtc_sdk_api.js.map +1 -0
- package/tools/rtcengine/get_web_trtc_sdk_integration.js +31 -0
- package/tools/rtcengine/get_web_trtc_sdk_integration.js.map +1 -0
- package/tools/rtcengine/get_web_trtc_sdk_plugin.js +31 -0
- package/tools/rtcengine/get_web_trtc_sdk_plugin.js.map +1 -0
- package/tools/trtc/get_native_trtc_sdk_docs.js +73 -0
- package/tools/trtc/get_native_trtc_sdk_docs.js.map +1 -0
- package/utils/generate-structured-result.js +61 -17
- package/utils/generate-structured-result.js.map +1 -1
- package/utils/report-cls-client.js +12 -1
- package/utils/report-cls-client.js.map +1 -1
- package/utils/report-es-client.js +1 -1
- package/resource/doc/chatuikit/android/integration.md +0 -612
- package/resource/doc/chatuikit/android/workflow.md +0 -0
- package/resource/doc/chatuikit/faq/android_sdk/client-api.md +0 -1376
- package/resource/doc/chatuikit/faq/flutter_sdk/client-api.md +0 -860
- package/resource/doc/chatuikit/faq/ios_sdk/client-api.md +0 -1371
- package/resource/doc/chatuikit/flutter/workflow.md +0 -816
- package/resource/doc/chatuikit/iOS/workflow.md +0 -0
- package/resource/doc/chatuikit/react/components/conversation-list.md +0 -765
- package/resource/doc/chatuikit/react/components/search.md +0 -885
- package/resource/doc/chatuikit/react/create-group.md +0 -22
- package/resource/doc/chatuikit/react/init.md +0 -25
- package/resource/doc/chatuikit/react/workflow.md +0 -254
- package/resource/doc/chatuikit/uniapp-app/faq.md +0 -0
- package/resource/doc/chatuikit/uniapp-app/integration.md +0 -619
- package/resource/doc/chatuikit/uniapp-app/workflow.md +0 -576
- package/resource/doc/chatuikit/vue/components/contact-list.md +0 -679
- package/resource/doc/chatuikit/vue/components/tuikit.md +0 -110
- package/resource/doc/chatuikit/vue/create-group.md +0 -26
- package/resource/doc/chatuikit/vue/init.md +0 -35
- package/resource/doc/chatuikit/vue/workflow.md +0 -395
- package/resource/doc/livekit/live/android/workflow.md +0 -322
- package/resource/doc/livekit/live/flutter/live-integration.md +0 -1029
- package/resource/doc/livekit/live/flutter/workflow.md +0 -353
- package/resource/doc/livekit/live/ios/workflow.md +0 -352
- package/resource/doc/livekit/live/vue/components/barrage.md +0 -615
- package/resource/doc/livekit/live/vue/components/stream-mixer.md +0 -442
- package/resource/doc/livekit/live/vue/faq.md +0 -0
- package/resource/doc/livekit/live/vue/live-list-integration.md +0 -195
- package/resource/doc/livekit/live/vue/live-player-desk-integration.md +0 -293
- package/resource/doc/livekit/live/vue/live-player-h5-integration.md +0 -381
- package/resource/doc/livekit/live/vue/live-pusher-integration.md +0 -598
- package/resource/doc/livekit/live/vue/states/live-state.md +0 -2656
- package/resource/doc/livekit/live/vue/workflow.md +0 -219
- package/resource/doc/native_live/android/V2TXLiveCode_api_android.md +0 -334
- package/resource/doc/native_live/android/V2TXLiveDef_api_android.md +0 -434
- package/resource/doc/native_live/android/V2TXLivePlayerObserver_api_android.md +0 -685
- package/resource/doc/native_live/android/V2TXLivePlayer_api_android.md +0 -712
- package/resource/doc/native_live/android/V2TXLivePremier_api_android.md +0 -284
- package/resource/doc/native_live/android/V2TXLivePusherObserver_api_android.md +0 -849
- package/resource/doc/native_live/android/V2TXLivePusher_api_android.md +0 -1046
- package/resource/doc/native_live/flutter/V2TXLiveCode_api_flutter.md +0 -460
- package/resource/doc/native_live/flutter/V2TXLiveDef_api_flutter.md +0 -558
- package/resource/doc/native_live/flutter/V2TXLivePlayerObserver_api_flutter.md +0 -879
- package/resource/doc/native_live/flutter/V2TXLivePlayer_api_flutter.md +0 -668
- package/resource/doc/native_live/flutter/V2TXLivePremier_api_flutter.md +0 -456
- package/resource/doc/native_live/flutter/V2TXLivePusherObserver_api_flutter.md +0 -332
- package/resource/doc/native_live/flutter/V2TXLivePusher_api_flutter.md +0 -748
- package/resource/doc/native_live/iOS/V2TXLiveCode_api_iOS.md +0 -328
- package/resource/doc/native_live/iOS/V2TXLiveDef_api_iOS.md +0 -505
- package/resource/doc/native_live/iOS/V2TXLivePlayerObserver_api_iOS.md +0 -507
- package/resource/doc/native_live/iOS/V2TXLivePlayer_api_iOS.md +0 -676
- package/resource/doc/native_live/iOS/V2TXLivePremier_api_iOS.md +0 -284
- package/resource/doc/native_live/iOS/V2TXLivePusherObserver_api_iOS.md +0 -820
- package/resource/doc/native_live/iOS/V2TXLivePusher_api_iOS.md +0 -1065
- package/resource/doc/roomkit/vue/features/workflow.md +0 -553
- package/resource/doc/roomkit/vue/workflow.md +0 -487
- package/resource/doc/tuicallkit/android/integration.md +0 -302
- package/resource/doc/tuicallkit/android/workflow.md +0 -0
- package/resource/doc/tuicallkit/faq/android_sdk/call-observer-api.md +0 -786
- package/resource/doc/tuicallkit/faq/android_sdk/callkit-api.md +0 -663
- package/resource/doc/tuicallkit/faq/flutter_sdk/call-define-api.md +0 -932
- package/resource/doc/tuicallkit/faq/flutter_sdk/call-observer-api.md +0 -926
- package/resource/doc/tuicallkit/faq/flutter_sdk/callkit-api.md +0 -452
- package/resource/doc/tuicallkit/faq/ios_sdk/call-observer-api.md +0 -779
- package/resource/doc/tuicallkit/faq/ios_sdk/callkit-api.md +0 -635
- package/resource/doc/tuicallkit/flutter/workflow.md +0 -331
- package/resource/doc/tuicallkit/react/api.md +0 -1512
- package/resource/doc/tuicallkit/vue/api.md +0 -1512
- package/resource/doc/tuicallkit/vue/faq.md +0 -986
- package/tools/call/get-native-call-integration.js +0 -43
- package/tools/call/get-native-call-integration.js.map +0 -1
- package/tools/call/get-web-call-api.js +0 -27
- package/tools/call/get-web-call-api.js.map +0 -1
- package/tools/call/get-web-call-integration.js.map +0 -1
- package/tools/chat/get-native-chat-feature-detail.js +0 -30
- package/tools/chat/get-native-chat-feature-detail.js.map +0 -1
- package/tools/chat/get-native-chat-integration.js +0 -45
- package/tools/chat/get-native-chat-integration.js.map +0 -1
- package/tools/chat/get-web-chat-component-detail.js +0 -31
- package/tools/chat/get-web-chat-component-detail.js.map +0 -1
- package/tools/chat/get-web-chat-integration.js +0 -45
- package/tools/chat/get-web-chat-integration.js.map +0 -1
- package/tools/chat/get-web-chat-uikit-init.js +0 -28
- package/tools/chat/get-web-chat-uikit-init.js.map +0 -1
- package/tools/chat/get-web-create-group-doc.js +0 -28
- package/tools/chat/get-web-create-group-doc.js.map +0 -1
- package/tools/common/get-faq.js +0 -91
- 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 +0 -16
- package/tools/common/present-framework-choice.js.map +0 -1
- package/tools/common/record-prompt.js +0 -55
- package/tools/common/record-prompt.js.map +0 -1
- package/tools/common/record-result.js +0 -60
- package/tools/common/record-result.js.map +0 -1
- package/tools/definitions/get_native_chat_feature_detail_def.js +0 -32
- package/tools/definitions/get_native_chat_feature_detail_def.js.map +0 -1
- package/tools/definitions/get_native_live_api_def.js +0 -22
- package/tools/definitions/get_native_live_api_def.js.map +0 -1
- package/tools/definitions/get_native_live_uikit_extra_features_def.js +0 -109
- package/tools/definitions/get_native_live_uikit_extra_features_def.js.map +0 -1
- package/tools/definitions/get_native_live_uikit_integration_def.js +0 -50
- package/tools/definitions/get_native_live_uikit_integration_def.js.map +0 -1
- package/tools/definitions/get_native_live_uikit_interaction_def.js +0 -115
- package/tools/definitions/get_native_live_uikit_interaction_def.js.map +0 -1
- package/tools/definitions/get_trtc_native_api_def.js +0 -17
- package/tools/definitions/get_trtc_native_api_def.js.map +0 -1
- package/tools/definitions/get_web_call_uikit_api_def.js +0 -23
- package/tools/definitions/get_web_call_uikit_api_def.js.map +0 -1
- package/tools/definitions/get_web_chat_uikit_init_def.js +0 -23
- package/tools/definitions/get_web_chat_uikit_init_def.js.map +0 -1
- package/tools/definitions/get_web_create_group_doc_def.js +0 -18
- package/tools/definitions/get_web_create_group_doc_def.js.map +0 -1
- package/tools/definitions/get_web_live_state_detail_def.js +0 -19
- package/tools/definitions/get_web_live_state_detail_def.js.map +0 -1
- package/tools/definitions/get_web_live_uikit_component_detail_def.js +0 -27
- package/tools/definitions/get_web_live_uikit_component_detail_def.js.map +0 -1
- package/tools/definitions/get_web_room_feature_detail_def.js +0 -95
- package/tools/definitions/get_web_room_feature_detail_def.js.map +0 -1
- package/tools/definitions/record_prompt_def.js +0 -53
- package/tools/definitions/record_prompt_def.js.map +0 -1
- package/tools/definitions/record_result_def.js +0 -30
- package/tools/definitions/record_result_def.js.map +0 -1
- package/tools/live/get-native-live-uikit-integration.js +0 -101
- package/tools/live/get-native-live-uikit-integration.js.map +0 -1
- package/tools/live/get-web-live-component-detail.js +0 -31
- package/tools/live/get-web-live-component-detail.js.map +0 -1
- package/tools/live/get-web-live-state-detail.js +0 -31
- package/tools/live/get-web-live-state-detail.js.map +0 -1
- package/tools/live/get-web-live-uikit-integration.js +0 -52
- package/tools/live/get-web-live-uikit-integration.js.map +0 -1
- package/tools/live/get_native_live_uikit_extra_features.js +0 -105
- package/tools/live/get_native_live_uikit_extra_features.js.map +0 -1
- package/tools/live/get_native_live_uikit_interaction.js +0 -101
- package/tools/live/get_native_live_uikit_interaction.js.map +0 -1
- package/tools/native_live/get-native-live-api.js +0 -31
- package/tools/native_live/get-native-live-api.js.map +0 -1
- package/tools/room/get-web-room-feature-detail.js.map +0 -1
- package/tools/room/get-web-room-integration.js.map +0 -1
- package/tools/rtcengine/get-rtcengine-web-sdk-integration.js +0 -28
- package/tools/rtcengine/get-rtcengine-web-sdk-integration.js.map +0 -1
- package/tools/rtcengine/get-trtc-sdk-faq.js +0 -32
- package/tools/rtcengine/get-trtc-sdk-faq.js.map +0 -1
- package/tools/rtcengine/get-trtc-web-sdk-api.js +0 -28
- package/tools/rtcengine/get-trtc-web-sdk-api.js.map +0 -1
- package/tools/rtcengine/get-trtc-web-sdk-faq.js +0 -30
- package/tools/rtcengine/get-trtc-web-sdk-faq.js.map +0 -1
- package/tools/rtcengine/get-trtc-web-sdk-integration.js +0 -29
- package/tools/rtcengine/get-trtc-web-sdk-integration.js.map +0 -1
- package/tools/rtcengine/get-trtc-web-sdk-plugin.js +0 -45
- package/tools/rtcengine/get-trtc-web-sdk-plugin.js.map +0 -1
- package/tools/trtc/get-trtc-native-api.js +0 -31
- package/tools/trtc/get-trtc-native-api.js.map +0 -1
- package/utils/handle-component-name.js +0 -33
- package/utils/handle-component-name.js.map +0 -1
- /package/resource/doc/{rtcengine/web → callkit/core-sdk}/.gitkeep +0 -0
- /package/resource/doc/{chatuikit → chatkit}/faq/common/server_error_code.md +0 -0
- /package/resource/doc/{chatuikit → chatkit}/flutter/faq.md +0 -0
- /package/resource/doc/{chatuikit → chatkit}/react/faq.md +0 -0
|
@@ -4,14 +4,11 @@
|
|
|
4
4
|
|
|
5
5
|
一次完整的"主播连线 PK"通常包含三个核心阶段,其整体流程如下:
|
|
6
6
|
|
|
7
|
-

|
|
8
|
-
|
|
9
|
-
|
|
10
7
|
## 实现步骤
|
|
11
8
|
|
|
12
9
|
### 步骤1:组件集成
|
|
13
10
|
|
|
14
|
-
请参考
|
|
11
|
+
请参考 开始直播 集成 **AtomicXCore**,并完成 **LiveCoreWidget** 的接入。
|
|
15
12
|
|
|
16
13
|
### 步骤2:实现跨房连线
|
|
17
14
|
|
|
@@ -20,51 +17,50 @@
|
|
|
20
17
|
#### 邀请方(主播 A)实现
|
|
21
18
|
1. **发起连线邀请**
|
|
22
19
|
|
|
23
|
-
|
|
24
20
|
当主播A在界面上选择目标主播 B 并发起连线时,调用 `requestHostConnection` 方法。
|
|
25
21
|
|
|
26
22
|
``` java
|
|
27
23
|
import 'package:atomic_x_core/atomicxcore.dart';
|
|
28
|
-
|
|
24
|
+
|
|
29
25
|
// 主播A的页面
|
|
30
26
|
class AnchorAPage extends StatefulWidget {
|
|
31
27
|
final String liveId;
|
|
32
|
-
|
|
28
|
+
|
|
33
29
|
const AnchorAPage({Key? key, required this.liveId}) : super(key: key);
|
|
34
|
-
|
|
30
|
+
|
|
35
31
|
@override
|
|
36
32
|
State<AnchorAPage> createState() => _AnchorAPageState();
|
|
37
33
|
}
|
|
38
|
-
|
|
34
|
+
|
|
39
35
|
class _AnchorAPageState extends State<AnchorAPage> {
|
|
40
36
|
late final CoHostStore _coHostStore;
|
|
41
37
|
late final CoHostListener _coHostListener;
|
|
42
|
-
|
|
38
|
+
|
|
43
39
|
@override
|
|
44
40
|
void initState() {
|
|
45
41
|
super.initState();
|
|
46
42
|
_coHostStore = CoHostStore.create(widget.liveId);
|
|
47
43
|
_setupListeners();
|
|
48
44
|
}
|
|
49
|
-
|
|
45
|
+
|
|
50
46
|
// 用户点击"连线"按钮,并选择了主播B
|
|
51
47
|
Future<void> inviteHostB(String targetHostLiveId) async {
|
|
52
48
|
final layout = CoHostLayoutTemplate.hostDynamicGrid; // 选择一个布局模板
|
|
53
49
|
const timeout = 30; // 邀请超时时间(秒)
|
|
54
|
-
|
|
50
|
+
|
|
55
51
|
final result = await _coHostStore.requestHostConnection(
|
|
56
52
|
targetHostLiveID: targetHostLiveId,
|
|
57
53
|
layoutTemplate: layout,
|
|
58
54
|
timeout: timeout,
|
|
59
55
|
);
|
|
60
|
-
|
|
56
|
+
|
|
61
57
|
if (result.isSuccess) {
|
|
62
58
|
print('连线邀请已发送,等待对方处理...');
|
|
63
59
|
} else {
|
|
64
60
|
print('邀请发送失败: ${result.errorMessage}');
|
|
65
61
|
}
|
|
66
62
|
}
|
|
67
|
-
|
|
63
|
+
|
|
68
64
|
@override
|
|
69
65
|
void dispose() {
|
|
70
66
|
_coHostStore.removeCoHostListener(_coHostListener);
|
|
@@ -74,7 +70,6 @@
|
|
|
74
70
|
```
|
|
75
71
|
2. **监听邀请结果**
|
|
76
72
|
|
|
77
|
-
|
|
78
73
|
通过 `CoHostListener`,您可以接收到主播 B 的处理结果。
|
|
79
74
|
|
|
80
75
|
``` java
|
|
@@ -104,33 +99,32 @@
|
|
|
104
99
|
#### 受邀方(主播 B)实现
|
|
105
100
|
1. **接收连线邀请**
|
|
106
101
|
|
|
107
|
-
|
|
108
102
|
通过 `CoHostListener`,主播B可以监听到来自主播 A 的邀请。
|
|
109
103
|
|
|
110
104
|
``` java
|
|
111
105
|
import 'package:atomic_x_core/atomicxcore.dart';
|
|
112
|
-
|
|
106
|
+
|
|
113
107
|
// 主播B的页面
|
|
114
108
|
class AnchorBPage extends StatefulWidget {
|
|
115
109
|
final String liveId;
|
|
116
|
-
|
|
110
|
+
|
|
117
111
|
const AnchorBPage({Key? key, required this.liveId}) : super(key: key);
|
|
118
|
-
|
|
112
|
+
|
|
119
113
|
@override
|
|
120
114
|
State<AnchorBPage> createState() => _AnchorBPageState();
|
|
121
115
|
}
|
|
122
|
-
|
|
116
|
+
|
|
123
117
|
class _AnchorBPageState extends State<AnchorBPage> {
|
|
124
118
|
late final CoHostStore _coHostStore;
|
|
125
119
|
late final CoHostListener _coHostListener;
|
|
126
|
-
|
|
120
|
+
|
|
127
121
|
@override
|
|
128
122
|
void initState() {
|
|
129
123
|
super.initState();
|
|
130
124
|
_coHostStore = CoHostStore.create(widget.liveId);
|
|
131
125
|
_setupListeners();
|
|
132
126
|
}
|
|
133
|
-
|
|
127
|
+
|
|
134
128
|
// 在初始化时设置监听
|
|
135
129
|
void _setupListeners() {
|
|
136
130
|
_coHostListener = CoHostListener(
|
|
@@ -141,7 +135,7 @@
|
|
|
141
135
|
);
|
|
142
136
|
_coHostStore.addCoHostListener(_coHostListener);
|
|
143
137
|
}
|
|
144
|
-
|
|
138
|
+
|
|
145
139
|
@override
|
|
146
140
|
void dispose() {
|
|
147
141
|
_coHostStore.removeCoHostListener(_coHostListener);
|
|
@@ -151,7 +145,6 @@
|
|
|
151
145
|
```
|
|
152
146
|
2. **响应连线邀请**
|
|
153
147
|
|
|
154
|
-
|
|
155
148
|
当主播 B 在弹出的对话框中做出选择后,调用相应的方法。
|
|
156
149
|
|
|
157
150
|
``` java
|
|
@@ -164,7 +157,7 @@
|
|
|
164
157
|
print('接受连线失败: ${result.errorMessage}');
|
|
165
158
|
}
|
|
166
159
|
}
|
|
167
|
-
|
|
160
|
+
|
|
168
161
|
Future<void> rejectInvitation(String fromHostLiveId) async {
|
|
169
162
|
final result = await _coHostStore.rejectHostConnection(fromHostLiveId);
|
|
170
163
|
if (result.isSuccess) {
|
|
@@ -182,14 +175,13 @@
|
|
|
182
175
|
#### 挑战方(例如主播 A)实现
|
|
183
176
|
1. **发起 PK 挑战**
|
|
184
177
|
|
|
185
|
-
|
|
186
178
|
当主播 A 点击"PK"按钮时,调用 `requestBattle` 方法。
|
|
187
179
|
|
|
188
180
|
``` java
|
|
189
181
|
// _AnchorAPageState 的一部分
|
|
190
182
|
late final BattleStore _battleStore;
|
|
191
183
|
late final BattleListener _battleListener;
|
|
192
|
-
|
|
184
|
+
|
|
193
185
|
@override
|
|
194
186
|
void initState() {
|
|
195
187
|
super.initState();
|
|
@@ -198,7 +190,7 @@
|
|
|
198
190
|
_setupListeners();
|
|
199
191
|
_setupBattleListeners();
|
|
200
192
|
}
|
|
201
|
-
|
|
193
|
+
|
|
202
194
|
Future<void> startPK(String opponentUserId) async {
|
|
203
195
|
final config = BattleConfig(duration: 300); // PK 持续 5 分钟
|
|
204
196
|
final result = await _battleStore.requestBattle(
|
|
@@ -206,7 +198,7 @@
|
|
|
206
198
|
userIDList: [opponentUserId],
|
|
207
199
|
timeout: 30,
|
|
208
200
|
);
|
|
209
|
-
|
|
201
|
+
|
|
210
202
|
if (result.isSuccess) {
|
|
211
203
|
print('PK 请求已发送,battleID: ${result.battleID}');
|
|
212
204
|
} else {
|
|
@@ -216,7 +208,6 @@
|
|
|
216
208
|
```
|
|
217
209
|
2. **监听 PK 状态**
|
|
218
210
|
|
|
219
|
-
|
|
220
211
|
通过 `BattleListener` 监听 PK 的开始、结束等关键事件。
|
|
221
212
|
|
|
222
213
|
``` java
|
|
@@ -238,7 +229,7 @@
|
|
|
238
229
|
);
|
|
239
230
|
_battleStore.addBattleListener(_battleListener);
|
|
240
231
|
}
|
|
241
|
-
|
|
232
|
+
|
|
242
233
|
@override
|
|
243
234
|
void dispose() {
|
|
244
235
|
_coHostStore.removeCoHostListener(_coHostListener);
|
|
@@ -250,7 +241,6 @@
|
|
|
250
241
|
#### 应战方(主播 B)实现
|
|
251
242
|
1. **接收 PK 挑战**
|
|
252
243
|
|
|
253
|
-
|
|
254
244
|
通过 `BattleListener` 监听到 PK 邀请。
|
|
255
245
|
|
|
256
246
|
``` java
|
|
@@ -274,7 +264,6 @@
|
|
|
274
264
|
```
|
|
275
265
|
2. **响应 PK 挑战**
|
|
276
266
|
|
|
277
|
-
|
|
278
267
|
当主播 B 做出选择后,调用相应的方法。
|
|
279
268
|
|
|
280
269
|
``` java
|
|
@@ -288,7 +277,7 @@
|
|
|
288
277
|
print('接受 PK 失败: ${result.errorMessage}');
|
|
289
278
|
}
|
|
290
279
|
}
|
|
291
|
-
|
|
280
|
+
|
|
292
281
|
// 用户点击"拒绝挑战"
|
|
293
282
|
Future<void> rejectPK(String battleId) async {
|
|
294
283
|
final result = await _battleStore.rejectBattle(battleId);
|
|
@@ -302,10 +291,7 @@
|
|
|
302
291
|
|
|
303
292
|
### 运行效果
|
|
304
293
|
|
|
305
|
-
当您集成以上功能实现后,请分别使用主播 A 和主播 B 进行对应操作,运行效果如下,您可以参考下一章节
|
|
306
|
-
|
|
307
|
-

|
|
308
|
-
|
|
294
|
+
当您集成以上功能实现后,请分别使用主播 A 和主播 B 进行对应操作,运行效果如下,您可以参考下一章节 完善 UI 细节 来定制 UI 逻辑。
|
|
309
295
|
|
|
310
296
|
## 完善 UI 细节
|
|
311
297
|
|
|
@@ -315,32 +301,28 @@
|
|
|
315
301
|
|
|
316
302
|
#### 实现效果
|
|
317
303
|
|
|
318
|
-

|
|
319
|
-
|
|
320
|
-
|
|
321
304
|
#### 实现方式
|
|
322
305
|
- **步骤1**:创建前景视图 (**CustomCoHostForegroundView**),该视图用于在视频流上方显示用户信息。
|
|
323
|
-
|
|
324
306
|
|
|
325
307
|
> **提示:**
|
|
326
|
-
>
|
|
308
|
+
>
|
|
327
309
|
|
|
328
310
|
> 您也可以参考 TUILiveKit 开源项目中的 [co_host_foreground_widget.dart](https://github.com/Tencent-RTC/TUIKit_Flutter/blob/main/live/livekit/lib/live_stream/features/decorations/co_host/co_host_foreground_widget.dart) 和 [co_host_background_widget.dart](https://github.com/Tencent-RTC/TUIKit_Flutter/blob/main/live/livekit/lib/live_stream/features/decorations/co_host/co_host_background_widget.dart) 文件来了解完整的实现逻辑。
|
|
329
|
-
>
|
|
311
|
+
>
|
|
330
312
|
|
|
331
313
|
``` java
|
|
332
314
|
import 'package:flutter/material.dart';
|
|
333
315
|
import 'package:rtc_room_engine/rtc_room_engine.dart';
|
|
334
|
-
|
|
316
|
+
|
|
335
317
|
/// 自定义的连线主播信息悬浮视图(前景)
|
|
336
318
|
class CustomCoHostForegroundView extends StatelessWidget {
|
|
337
319
|
final SeatFullInfo seatInfo;
|
|
338
|
-
|
|
320
|
+
|
|
339
321
|
const CustomCoHostForegroundView({
|
|
340
|
-
Key? key,
|
|
322
|
+
Key? key,
|
|
341
323
|
required this.seatInfo,
|
|
342
324
|
}) : super(key: key);
|
|
343
|
-
|
|
325
|
+
|
|
344
326
|
@override
|
|
345
327
|
Widget build(BuildContext context) {
|
|
346
328
|
return Container(
|
|
@@ -372,16 +354,16 @@
|
|
|
372
354
|
``` java
|
|
373
355
|
import 'package:flutter/material.dart';
|
|
374
356
|
import 'package:rtc_room_engine/rtc_room_engine.dart';
|
|
375
|
-
|
|
357
|
+
|
|
376
358
|
/// 自定义的连线主播头像占位视图(背景)
|
|
377
359
|
class CustomCoHostBackgroundView extends StatelessWidget {
|
|
378
360
|
final SeatFullInfo seatInfo;
|
|
379
|
-
|
|
361
|
+
|
|
380
362
|
const CustomCoHostBackgroundView({
|
|
381
|
-
Key? key,
|
|
363
|
+
Key? key,
|
|
382
364
|
required this.seatInfo,
|
|
383
365
|
}) : super(key: key);
|
|
384
|
-
|
|
366
|
+
|
|
385
367
|
@override
|
|
386
368
|
Widget build(BuildContext context) {
|
|
387
369
|
final avatarUrl = seatInfo.userInfo.avatarUrl;
|
|
@@ -419,7 +401,7 @@
|
|
|
419
401
|
),
|
|
420
402
|
);
|
|
421
403
|
}
|
|
422
|
-
|
|
404
|
+
|
|
423
405
|
Widget _buildDefaultAvatar() {
|
|
424
406
|
return Container(
|
|
425
407
|
width: 60,
|
|
@@ -436,40 +418,40 @@
|
|
|
436
418
|
import 'package:flutter/material.dart';
|
|
437
419
|
import 'package:atomic_x_core/atomicxcore.dart';
|
|
438
420
|
import 'package:rtc_room_engine/rtc_room_engine.dart';
|
|
439
|
-
|
|
421
|
+
|
|
440
422
|
/// 带有自定义连线视图的直播页面
|
|
441
423
|
class CustomCoHostLiveWidget extends StatefulWidget {
|
|
442
424
|
final String liveId;
|
|
443
|
-
|
|
425
|
+
|
|
444
426
|
const CustomCoHostLiveWidget({
|
|
445
|
-
Key? key,
|
|
427
|
+
Key? key,
|
|
446
428
|
required this.liveId,
|
|
447
429
|
}) : super(key: key);
|
|
448
|
-
|
|
430
|
+
|
|
449
431
|
@override
|
|
450
432
|
State<CustomCoHostLiveWidget> createState() => _CustomCoHostLiveWidgetState();
|
|
451
433
|
}
|
|
452
|
-
|
|
434
|
+
|
|
453
435
|
class _CustomCoHostLiveWidgetState extends State<CustomCoHostLiveWidget> {
|
|
454
436
|
late LiveCoreController _controller;
|
|
455
|
-
|
|
437
|
+
|
|
456
438
|
@override
|
|
457
439
|
void initState() {
|
|
458
440
|
super.initState();
|
|
459
441
|
_controller = LiveCoreController.create();
|
|
460
442
|
_controller.setLiveID(widget.liveId);
|
|
461
443
|
}
|
|
462
|
-
|
|
444
|
+
|
|
463
445
|
@override
|
|
464
446
|
void dispose() {
|
|
465
447
|
_controller.dispose();
|
|
466
448
|
super.dispose();
|
|
467
449
|
}
|
|
468
|
-
|
|
450
|
+
|
|
469
451
|
/// 构建连线主播的自定义视图
|
|
470
452
|
Widget _buildCoHostWidget(
|
|
471
|
-
BuildContext context,
|
|
472
|
-
SeatFullInfo seatFullInfo,
|
|
453
|
+
BuildContext context,
|
|
454
|
+
SeatFullInfo seatFullInfo,
|
|
473
455
|
ViewLayer viewLayer,
|
|
474
456
|
) {
|
|
475
457
|
if (viewLayer == ViewLayer.foreground) {
|
|
@@ -480,7 +462,7 @@
|
|
|
480
462
|
return CustomCoHostBackgroundView(seatInfo: seatFullInfo);
|
|
481
463
|
}
|
|
482
464
|
}
|
|
483
|
-
|
|
465
|
+
|
|
484
466
|
@override
|
|
485
467
|
Widget build(BuildContext context) {
|
|
486
468
|
return Scaffold(
|
|
@@ -496,56 +478,13 @@
|
|
|
496
478
|
```
|
|
497
479
|
|
|
498
480
|
#### **参数说明**:
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
</tr>
|
|
507
|
-
|
|
508
|
-
<tr>
|
|
509
|
-
<td rowspan="1" colSpan="1" >`seatFullInfo`</td>
|
|
510
|
-
|
|
511
|
-
<td rowspan="1" colSpan="1" >`SeatFullInfo`</td>
|
|
512
|
-
|
|
513
|
-
<td rowspan="1" colSpan="1" >麦位信息对象,包含麦上用户的详细信息</td>
|
|
514
|
-
</tr>
|
|
515
|
-
|
|
516
|
-
<tr>
|
|
517
|
-
<td rowspan="1" colSpan="1" >`seatFullInfo.userInfo.userId`</td>
|
|
518
|
-
|
|
519
|
-
<td rowspan="1" colSpan="1" >`String`</td>
|
|
520
|
-
|
|
521
|
-
<td rowspan="1" colSpan="1" >麦上用户的 ID</td>
|
|
522
|
-
</tr>
|
|
523
|
-
|
|
524
|
-
<tr>
|
|
525
|
-
<td rowspan="1" colSpan="1" >`seatFullInfo.userInfo.userName`</td>
|
|
526
|
-
|
|
527
|
-
<td rowspan="1" colSpan="1" >`String`</td>
|
|
528
|
-
|
|
529
|
-
<td rowspan="1" colSpan="1" >麦上用户的昵称</td>
|
|
530
|
-
</tr>
|
|
531
|
-
|
|
532
|
-
<tr>
|
|
533
|
-
<td rowspan="1" colSpan="1" >`seatFullInfo.userInfo.avatarUrl`</td>
|
|
534
|
-
|
|
535
|
-
<td rowspan="1" colSpan="1" >`String`</td>
|
|
536
|
-
|
|
537
|
-
<td rowspan="1" colSpan="1" >麦上用户的头像 URL</td>
|
|
538
|
-
</tr>
|
|
539
|
-
|
|
540
|
-
<tr>
|
|
541
|
-
<td rowspan="1" colSpan="1" >`viewLayer`</td>
|
|
542
|
-
|
|
543
|
-
<td rowspan="1" colSpan="1" >`ViewLayer`</td>
|
|
544
|
-
|
|
545
|
-
<td rowspan="1" colSpan="1" >视图层级枚举<br>`ViewLayer.foreground` 表示前景挂件视图,始终显示在视频画面的最上层<br>`ViewLayer.background` 表示背景挂件视图,位于前景视图下层,仅在对应用户没有视频流(例如未开摄像头)的情况下显示,通常用于展示用户的默认头像或占位图</td>
|
|
546
|
-
</tr>
|
|
547
|
-
</table>
|
|
548
|
-
|
|
481
|
+
| **参数** | **类型** | **说明** |
|
|
482
|
+
| --- | --- | --- |
|
|
483
|
+
| `seatFullInfo` | `SeatFullInfo` | 麦位信息对象,包含麦上用户的详细信息 |
|
|
484
|
+
| `seatFullInfo.userInfo.userId` | `String` | 麦上用户的 ID |
|
|
485
|
+
| `seatFullInfo.userInfo.userName` | `String` | 麦上用户的昵称 |
|
|
486
|
+
| `seatFullInfo.userInfo.avatarUrl` | `String` | 麦上用户的头像 URL |
|
|
487
|
+
| `viewLayer` | `ViewLayer` | 视图层级枚举<br>`ViewLayer.foreground` 表示前景挂件视图,始终显示在视频画面的最上层<br>`ViewLayer.background` 表示背景挂件视图,位于前景视图下层,仅在对应用户没有视频流(例如未开摄像头)的情况下显示,通常用于展示用户的默认头像或占位图 |
|
|
549
488
|
|
|
550
489
|
### 实现 PK 用户视图的分数展示
|
|
551
490
|
|
|
@@ -553,9 +492,6 @@
|
|
|
553
492
|
|
|
554
493
|
#### **实现效果**
|
|
555
494
|
|
|
556
|
-

|
|
557
|
-
|
|
558
|
-
|
|
559
495
|
#### 实现方式
|
|
560
496
|
- **步骤1**:创建自定义 PK 用户视图,您可以参考 TUILiveKit 开源项目中的 [battle_member_info_widget.dart](https://github.com/Tencent-RTC/TUIKit_Flutter/blob/main/live/livekit/lib/live_stream/features/decorations/battle/battle_member_info_widget.dart) 文件来了解完整的实现逻辑。
|
|
561
497
|
|
|
@@ -563,45 +499,45 @@
|
|
|
563
499
|
import 'package:flutter/material.dart';
|
|
564
500
|
import 'package:atomic_x_core/atomicxcore.dart';
|
|
565
501
|
import 'package:rtc_room_engine/rtc_room_engine.dart';
|
|
566
|
-
|
|
502
|
+
|
|
567
503
|
/// 自定义 PK 用户视图
|
|
568
504
|
class CustomBattleUserView extends StatefulWidget {
|
|
569
505
|
final String liveId;
|
|
570
506
|
final TUIBattleUser battleUser;
|
|
571
|
-
|
|
507
|
+
|
|
572
508
|
const CustomBattleUserView({
|
|
573
509
|
Key? key,
|
|
574
510
|
required this.liveId,
|
|
575
511
|
required this.battleUser,
|
|
576
512
|
}) : super(key: key);
|
|
577
|
-
|
|
513
|
+
|
|
578
514
|
@override
|
|
579
515
|
State<CustomBattleUserView> createState() => _CustomBattleUserViewState();
|
|
580
516
|
}
|
|
581
|
-
|
|
517
|
+
|
|
582
518
|
class _CustomBattleUserViewState extends State<CustomBattleUserView> {
|
|
583
519
|
late final BattleStore _battleStore;
|
|
584
520
|
late final VoidCallback _scoreChangedListener = _onScoreChanged;
|
|
585
521
|
int _score = 0;
|
|
586
|
-
|
|
522
|
+
|
|
587
523
|
@override
|
|
588
524
|
void initState() {
|
|
589
525
|
super.initState();
|
|
590
526
|
_battleStore = BattleStore.create(widget.liveId);
|
|
591
527
|
_subscribeBattleState();
|
|
592
528
|
}
|
|
593
|
-
|
|
529
|
+
|
|
594
530
|
/// 订阅 PK 分数变化
|
|
595
531
|
void _subscribeBattleState() {
|
|
596
532
|
_battleStore.battleState.battleScore.addListener(_scoreChangedListener);
|
|
597
533
|
// 初始化分数
|
|
598
534
|
_updateScore(_battleStore.battleState.battleScore.value);
|
|
599
535
|
}
|
|
600
|
-
|
|
536
|
+
|
|
601
537
|
void _onScoreChanged() {
|
|
602
538
|
_updateScore(_battleStore.battleState.battleScore.value);
|
|
603
539
|
}
|
|
604
|
-
|
|
540
|
+
|
|
605
541
|
void _updateScore(Map<String, int> battleScore) {
|
|
606
542
|
final score = battleScore[widget.battleUser.userId] ?? 0;
|
|
607
543
|
if (mounted && score != _score) {
|
|
@@ -610,13 +546,13 @@
|
|
|
610
546
|
});
|
|
611
547
|
}
|
|
612
548
|
}
|
|
613
|
-
|
|
549
|
+
|
|
614
550
|
@override
|
|
615
551
|
void dispose() {
|
|
616
552
|
_battleStore.battleState.battleScore.removeListener(_scoreChangedListener);
|
|
617
553
|
super.dispose();
|
|
618
554
|
}
|
|
619
|
-
|
|
555
|
+
|
|
620
556
|
@override
|
|
621
557
|
Widget build(BuildContext context) {
|
|
622
558
|
return IgnorePointer(
|
|
@@ -649,36 +585,36 @@
|
|
|
649
585
|
import 'package:flutter/material.dart';
|
|
650
586
|
import 'package:atomic_x_core/atomicxcore.dart';
|
|
651
587
|
import 'package:rtc_room_engine/rtc_room_engine.dart';
|
|
652
|
-
|
|
588
|
+
|
|
653
589
|
/// 带有自定义 PK 视图的直播页面
|
|
654
590
|
class CustomBattleLiveWidget extends StatefulWidget {
|
|
655
591
|
final String liveId;
|
|
656
|
-
|
|
592
|
+
|
|
657
593
|
const CustomBattleLiveWidget({
|
|
658
|
-
Key? key,
|
|
594
|
+
Key? key,
|
|
659
595
|
required this.liveId,
|
|
660
596
|
}) : super(key: key);
|
|
661
|
-
|
|
597
|
+
|
|
662
598
|
@override
|
|
663
599
|
State<CustomBattleLiveWidget> createState() => _CustomBattleLiveWidgetState();
|
|
664
600
|
}
|
|
665
|
-
|
|
601
|
+
|
|
666
602
|
class _CustomBattleLiveWidgetState extends State<CustomBattleLiveWidget> {
|
|
667
603
|
late LiveCoreController _controller;
|
|
668
|
-
|
|
604
|
+
|
|
669
605
|
@override
|
|
670
606
|
void initState() {
|
|
671
607
|
super.initState();
|
|
672
608
|
_controller = LiveCoreController.create();
|
|
673
609
|
_controller.setLiveID(widget.liveId);
|
|
674
610
|
}
|
|
675
|
-
|
|
611
|
+
|
|
676
612
|
@override
|
|
677
613
|
void dispose() {
|
|
678
614
|
_controller.dispose();
|
|
679
615
|
super.dispose();
|
|
680
616
|
}
|
|
681
|
-
|
|
617
|
+
|
|
682
618
|
/// 构建 PK 用户的自定义视图
|
|
683
619
|
Widget _buildBattleWidget(BuildContext context, TUIBattleUser battleUser) {
|
|
684
620
|
return CustomBattleUserView(
|
|
@@ -686,7 +622,7 @@
|
|
|
686
622
|
battleUser: battleUser,
|
|
687
623
|
);
|
|
688
624
|
}
|
|
689
|
-
|
|
625
|
+
|
|
690
626
|
@override
|
|
691
627
|
Widget build(BuildContext context) {
|
|
692
628
|
return Scaffold(
|
|
@@ -702,72 +638,19 @@
|
|
|
702
638
|
```
|
|
703
639
|
|
|
704
640
|
#### **参数说明**:
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
<tr>
|
|
715
|
-
<td rowspan="1" colSpan="1" >`battleUser`</td>
|
|
716
|
-
|
|
717
|
-
<td rowspan="1" colSpan="1" >`TUIBattleUser`</td>
|
|
718
|
-
|
|
719
|
-
<td rowspan="1" colSpan="1" >PK 用户信息对象</td>
|
|
720
|
-
</tr>
|
|
721
|
-
|
|
722
|
-
<tr>
|
|
723
|
-
<td rowspan="1" colSpan="1" >`battleUser.roomId`</td>
|
|
724
|
-
|
|
725
|
-
<td rowspan="1" colSpan="1" >`String`</td>
|
|
726
|
-
|
|
727
|
-
<td rowspan="1" colSpan="1" >PK 的房间 ID</td>
|
|
728
|
-
</tr>
|
|
729
|
-
|
|
730
|
-
<tr>
|
|
731
|
-
<td rowspan="1" colSpan="1" >`battleUser.userId`</td>
|
|
732
|
-
|
|
733
|
-
<td rowspan="1" colSpan="1" >`String`</td>
|
|
734
|
-
|
|
735
|
-
<td rowspan="1" colSpan="1" >PK 用户 ID</td>
|
|
736
|
-
</tr>
|
|
737
|
-
|
|
738
|
-
<tr>
|
|
739
|
-
<td rowspan="1" colSpan="1" >`battleUser.userName`</td>
|
|
740
|
-
|
|
741
|
-
<td rowspan="1" colSpan="1" >`String`</td>
|
|
742
|
-
|
|
743
|
-
<td rowspan="1" colSpan="1" >PK 用户昵称</td>
|
|
744
|
-
</tr>
|
|
745
|
-
|
|
746
|
-
<tr>
|
|
747
|
-
<td rowspan="1" colSpan="1" >`battleUser.avatarUrl`</td>
|
|
748
|
-
|
|
749
|
-
<td rowspan="1" colSpan="1" >`String`</td>
|
|
750
|
-
|
|
751
|
-
<td rowspan="1" colSpan="1" >PK 用户头像地址</td>
|
|
752
|
-
</tr>
|
|
753
|
-
|
|
754
|
-
<tr>
|
|
755
|
-
<td rowspan="1" colSpan="1" >`battleUser.score`</td>
|
|
756
|
-
|
|
757
|
-
<td rowspan="1" colSpan="1" >`int`</td>
|
|
758
|
-
|
|
759
|
-
<td rowspan="1" colSpan="1" >PK 分数</td>
|
|
760
|
-
</tr>
|
|
761
|
-
</table>
|
|
762
|
-
|
|
641
|
+
| **参数** | **类型** | **说明** |
|
|
642
|
+
| --- | --- | --- |
|
|
643
|
+
| `battleUser` | `TUIBattleUser` | PK 用户信息对象 |
|
|
644
|
+
| `battleUser.roomId` | `String` | PK 的房间 ID |
|
|
645
|
+
| `battleUser.userId` | `String` | PK 用户 ID |
|
|
646
|
+
| `battleUser.userName` | `String` | PK 用户昵称 |
|
|
647
|
+
| `battleUser.avatarUrl` | `String` | PK 用户头像地址 |
|
|
648
|
+
| `battleUser.score` | `int` | PK 分数 |
|
|
763
649
|
|
|
764
650
|
### 实现视频流画面上的 PK 状态显示
|
|
765
651
|
|
|
766
652
|
#### **实现效果**
|
|
767
653
|
|
|
768
|
-

|
|
769
|
-
|
|
770
|
-
|
|
771
654
|
#### **实现方式**
|
|
772
655
|
- **步骤1:**创建自定义 PK 全局视图 **CustomBattleContainerView**,您可以参考 TUILiveKit 开源项目中的 [battle_info_widget.dart](https://github.com/Tencent-RTC/TUIKit_Flutter/blob/main/live/livekit/lib/live_stream/features/decorations/battle/battle_info_widget.dart) 文件来实现,即可实现同样的效果。
|
|
773
656
|
|
|
@@ -776,42 +659,42 @@
|
|
|
776
659
|
``` java
|
|
777
660
|
import 'package:flutter/material.dart';
|
|
778
661
|
import 'package:atomic_x_core/atomicxcore.dart';
|
|
779
|
-
|
|
662
|
+
|
|
780
663
|
/// 带有自定义 PK 容器视图的直播页面
|
|
781
664
|
class CustomBattleContainerLiveWidget extends StatefulWidget {
|
|
782
665
|
final String liveId;
|
|
783
|
-
|
|
666
|
+
|
|
784
667
|
const CustomBattleContainerLiveWidget({
|
|
785
|
-
Key? key,
|
|
668
|
+
Key? key,
|
|
786
669
|
required this.liveId,
|
|
787
670
|
}) : super(key: key);
|
|
788
|
-
|
|
671
|
+
|
|
789
672
|
@override
|
|
790
673
|
State<CustomBattleContainerLiveWidget> createState() => _CustomBattleContainerLiveWidgetState();
|
|
791
674
|
}
|
|
792
|
-
|
|
675
|
+
|
|
793
676
|
class _CustomBattleContainerLiveWidgetState extends State<CustomBattleContainerLiveWidget> {
|
|
794
677
|
late LiveCoreController _controller;
|
|
795
|
-
|
|
678
|
+
|
|
796
679
|
@override
|
|
797
680
|
void initState() {
|
|
798
681
|
super.initState();
|
|
799
682
|
_controller = LiveCoreController.create();
|
|
800
683
|
_controller.setLiveID(widget.liveId);
|
|
801
684
|
}
|
|
802
|
-
|
|
685
|
+
|
|
803
686
|
@override
|
|
804
687
|
void dispose() {
|
|
805
688
|
_controller.dispose();
|
|
806
689
|
super.dispose();
|
|
807
690
|
}
|
|
808
|
-
|
|
691
|
+
|
|
809
692
|
/// 构建 PK 容器视图
|
|
810
693
|
Widget _buildBattleContainerWidget(BuildContext context) {
|
|
811
694
|
// CustomBattleContainerView 是您自定义的 PK 全局视图
|
|
812
695
|
return CustomBattleContainerView(liveId: widget.liveId);
|
|
813
696
|
}
|
|
814
|
-
|
|
697
|
+
|
|
815
698
|
@override
|
|
816
699
|
Widget build(BuildContext context) {
|
|
817
700
|
return Scaffold(
|
|
@@ -839,7 +722,7 @@ class FullCustomLiveWidget extends StatefulWidget {
|
|
|
839
722
|
final String liveId;
|
|
840
723
|
|
|
841
724
|
const FullCustomLiveWidget({
|
|
842
|
-
Key? key,
|
|
725
|
+
Key? key,
|
|
843
726
|
required this.liveId,
|
|
844
727
|
}) : super(key: key);
|
|
845
728
|
|
|
@@ -865,8 +748,8 @@ class _FullCustomLiveWidgetState extends State<FullCustomLiveWidget> {
|
|
|
865
748
|
|
|
866
749
|
/// 构建连线主播的自定义视图
|
|
867
750
|
Widget _buildCoHostWidget(
|
|
868
|
-
BuildContext context,
|
|
869
|
-
SeatFullInfo seatFullInfo,
|
|
751
|
+
BuildContext context,
|
|
752
|
+
SeatFullInfo seatFullInfo,
|
|
870
753
|
ViewLayer viewLayer,
|
|
871
754
|
) {
|
|
872
755
|
if (viewLayer == ViewLayer.foreground) {
|
|
@@ -912,178 +795,51 @@ class _FullCustomLiveWidgetState extends State<FullCustomLiveWidget> {
|
|
|
912
795
|
通常在**直播主播 PK 场景**下,会将主播收到的礼物价值与 PK 数值挂钩(例如:观众送 "火箭" 礼物,主播 PK 分数增加 500 分),您可以通过我们的 REST API,轻松实现直播 PK 场景下的分数实时更新。
|
|
913
796
|
|
|
914
797
|
> **重要说明:**
|
|
915
|
-
>
|
|
798
|
+
>
|
|
916
799
|
|
|
917
800
|
> LiveKit 后台的 PK 分数系统采用纯数值计算和累加机制,所以您需要根据自身的运营策略和业务需求,调用更新接口前完成 PK 分数的计算,您可以参考如下的 PK 分数计算示例:
|
|
918
|
-
>
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
<td rowspan="1" colSpan="1" >**示例**</td>
|
|
926
|
-
</tr>
|
|
927
|
-
|
|
928
|
-
<tr>
|
|
929
|
-
<td rowspan="1" colSpan="1" >基础礼物</td>
|
|
930
|
-
|
|
931
|
-
<td rowspan="1" colSpan="1" >礼物价值 × 5</td>
|
|
932
|
-
|
|
933
|
-
<td rowspan="1" colSpan="1" >10元礼物 → 50分</td>
|
|
934
|
-
</tr>
|
|
935
|
-
|
|
936
|
-
<tr>
|
|
937
|
-
<td rowspan="1" colSpan="1" >中级礼物</td>
|
|
938
|
-
|
|
939
|
-
<td rowspan="1" colSpan="1" >礼物价值 × 8</td>
|
|
940
|
-
|
|
941
|
-
<td rowspan="1" colSpan="1" >50元礼物 → 400分</td>
|
|
942
|
-
</tr>
|
|
943
|
-
|
|
944
|
-
<tr>
|
|
945
|
-
<td rowspan="1" colSpan="1" >高级礼物</td>
|
|
946
|
-
|
|
947
|
-
<td rowspan="1" colSpan="1" >礼物价值 × 12</td>
|
|
948
|
-
|
|
949
|
-
<td rowspan="1" colSpan="1" >100元礼物 → 1200分</td>
|
|
950
|
-
</tr>
|
|
951
|
-
|
|
952
|
-
<tr>
|
|
953
|
-
<td rowspan="1" colSpan="1" >特效礼物</td>
|
|
954
|
-
|
|
955
|
-
<td rowspan="1" colSpan="1" >固定高分数</td>
|
|
956
|
-
|
|
957
|
-
<td rowspan="1" colSpan="1" >520元礼物 → 1314分</td>
|
|
958
|
-
</tr>
|
|
959
|
-
</table>
|
|
960
|
-
|
|
961
|
-
|
|
801
|
+
>
|
|
802
|
+
| ** 礼物类型** | **分数计算规则** | **示例** |
|
|
803
|
+
| --- | --- | --- |
|
|
804
|
+
| 基础礼物 | 礼物价值 × 5 | 10元礼物 → 50分 |
|
|
805
|
+
| 中级礼物 | 礼物价值 × 8 | 50元礼物 → 400分 |
|
|
806
|
+
| 高级礼物 | 礼物价值 × 12 | 100元礼物 → 1200分 |
|
|
807
|
+
| 特效礼物 | 固定高分数 | 520元礼物 → 1314分 |
|
|
962
808
|
|
|
963
809
|
#### REST API 调用流程
|
|
964
810
|
|
|
965
|
-

|
|
966
|
-
|
|
967
|
-
|
|
968
811
|
#### 关键流程说明
|
|
969
812
|
1. **获取 PK 状态**:
|
|
970
813
|
|
|
971
|
-
- 回调配置:您可以通过配置
|
|
814
|
+
- 回调配置:您可以通过配置 PK 状态回调,由 LiveKit 后台在 PK 开始、结束时,主动通知您的系统 PK 状态。
|
|
972
815
|
|
|
973
|
-
- 主动查询:您的后台服务可主动调用
|
|
816
|
+
- 主动查询:您的后台服务可主动调用 PK 状态查询 接口,随时查询当前 PK 状态。
|
|
974
817
|
|
|
975
818
|
2. **PK 分数计算**:您的后台服务根据业务规则(如上述示例),计算 PK 分数增量。
|
|
976
819
|
|
|
977
|
-
3. **PK 分数更新**:您的后台服务调用
|
|
820
|
+
3. **PK 分数更新**:您的后台服务调用 修改 PK 分数 接口,向 LiveKit 后台更新 PK 分数。
|
|
978
821
|
|
|
979
822
|
4. **LiveKit 后台同步到客户端**:LiveKit 后台自动将更新后的 PK 分数同步到所有客户端。
|
|
980
823
|
|
|
981
|
-
|
|
982
824
|
#### 涉及的 REST API 接口
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
<td rowspan="1" colSpan="1" >**请求示例**</td>
|
|
990
|
-
</tr>
|
|
991
|
-
|
|
992
|
-
<tr>
|
|
993
|
-
<td rowspan="1" colSpan="1" >主动接口 - 查询 PK 状态</td>
|
|
994
|
-
|
|
995
|
-
<td rowspan="1" colSpan="1" >可根据此接口查询当前房间是否在 PK</td>
|
|
996
|
-
|
|
997
|
-
<td rowspan="1" colSpan="1" >[请求示例](https://write.woa.com/document/169572228815638528)</td>
|
|
998
|
-
</tr>
|
|
999
|
-
|
|
1000
|
-
<tr>
|
|
1001
|
-
<td rowspan="1" colSpan="1" >主动接口 - 修改 PK 分数</td>
|
|
1002
|
-
|
|
1003
|
-
<td rowspan="1" colSpan="1" >将计算后的 PK 数值通过此接口更新</td>
|
|
1004
|
-
|
|
1005
|
-
<td rowspan="1" colSpan="1" >[请求示例](https://write.woa.com/document/169571965752266752)</td>
|
|
1006
|
-
</tr>
|
|
1007
|
-
|
|
1008
|
-
<tr>
|
|
1009
|
-
<td rowspan="1" colSpan="1" >回调配置 - PK 开始时回调</td>
|
|
1010
|
-
|
|
1011
|
-
<td rowspan="1" colSpan="1" >客户后台可以通过该回调及时知晓 PK 开启</td>
|
|
1012
|
-
|
|
1013
|
-
<td rowspan="1" colSpan="1" >[回调示例](https://write.woa.com/document/170122621675196416)</td>
|
|
1014
|
-
</tr>
|
|
1015
|
-
|
|
1016
|
-
<tr>
|
|
1017
|
-
<td rowspan="1" colSpan="1" >回调配置 - PK 结束时回调</td>
|
|
1018
|
-
|
|
1019
|
-
<td rowspan="1" colSpan="1" >客户后台可以通过该回调及时知晓 PK 结束</td>
|
|
1020
|
-
|
|
1021
|
-
<td rowspan="1" colSpan="1" >[回调示例](https://write.woa.com/document/170123212271988736)</td>
|
|
1022
|
-
</tr>
|
|
1023
|
-
</table>
|
|
1024
|
-
|
|
825
|
+
| **接口** | **功能描述** | **请求示例** |
|
|
826
|
+
| --- | --- | --- |
|
|
827
|
+
| 主动接口 - 查询 PK 状态 | 可根据此接口查询当前房间是否在 PK | 请求示例 |
|
|
828
|
+
| 主动接口 - 修改 PK 分数 | 将计算后的 PK 数值通过此接口更新 | 请求示例 |
|
|
829
|
+
| 回调配置 - PK 开始时回调 | 客户后台可以通过该回调及时知晓 PK 开启 | 回调示例 |
|
|
830
|
+
| 回调配置 - PK 结束时回调 | 客户后台可以通过该回调及时知晓 PK 结束 | 回调示例 |
|
|
1025
831
|
|
|
1026
832
|
## API 文档
|
|
1027
833
|
|
|
1028
834
|
关于 [CoHostStore](https://pub.dev/documentation/atomic_x_core/latest/api_live_co_host_store/CoHostStore-class.html) 及其相关类的所有公开接口、属性和方法的详细信息,请参阅随 [AtomicXCore](https://tencent-rtc.github.io/TUIKit_Flutter/index.html) 框架的官方 API 文档。本指南使用到的相关 Store 如下:
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
<tr>
|
|
1039
|
-
<td rowspan="1" colSpan="1" >**LiveCoreWidget**</td>
|
|
1040
|
-
|
|
1041
|
-
<td rowspan="1" colSpan="1" >直播视频流展示与交互的核心视图组件:负责视频流渲染和视图挂件处理,支持主播直播、观众连麦、主播连线等场景。</td>
|
|
1042
|
-
|
|
1043
|
-
<td rowspan="1" colSpan="1" >[API 文档](https://tencent-rtc.github.io/TUIKit_Flutter/api_view_live_live_core_widget/LiveCoreWidget-class.html)</td>
|
|
1044
|
-
</tr>
|
|
1045
|
-
|
|
1046
|
-
<tr>
|
|
1047
|
-
<td rowspan="1" colSpan="1" >**LiveCoreController**</td>
|
|
1048
|
-
|
|
1049
|
-
<td rowspan="1" colSpan="1" >LiveCoreWidget 的控制器:用于设置直播 ID、控制预览等操作。</td>
|
|
1050
|
-
|
|
1051
|
-
<td rowspan="1" colSpan="1" >[API 文档](https://tencent-rtc.github.io/TUIKit_Flutter/api_view_live_live_core_widget/LiveCoreController-class.html)</td>
|
|
1052
|
-
</tr>
|
|
1053
|
-
|
|
1054
|
-
<tr>
|
|
1055
|
-
<td rowspan="1" colSpan="1" >**VideoWidgetBuilder**</td>
|
|
1056
|
-
|
|
1057
|
-
<td rowspan="1" colSpan="1" >视频视图适配器:用于自定义连线主播、PK 用户、PK 容器等场景的视频流挂件视图。</td>
|
|
1058
|
-
|
|
1059
|
-
<td rowspan="1" colSpan="1" >[API 文档](https://tencent-rtc.github.io/TUIKit_Flutter/api_view_live_live_core_widget/VideoWidgetBuilder-class.html)</td>
|
|
1060
|
-
</tr>
|
|
1061
|
-
|
|
1062
|
-
<tr>
|
|
1063
|
-
<td rowspan="1" colSpan="1" >**DeviceStore**</td>
|
|
1064
|
-
|
|
1065
|
-
<td rowspan="1" colSpan="1" >音视频设备控制:麦克风(开关 / 音量)、摄像头(开关 / 切换 / 画质)、屏幕共享,设备状态实时监听。</td>
|
|
1066
|
-
|
|
1067
|
-
<td rowspan="1" colSpan="1" >[API 文档](https://tencent-rtc.github.io/TUIKit_Flutter/api_device_device_store/DeviceStore-class.html)</td>
|
|
1068
|
-
</tr>
|
|
1069
|
-
|
|
1070
|
-
<tr>
|
|
1071
|
-
<td rowspan="1" colSpan="1" >**CoHostStore**</td>
|
|
1072
|
-
|
|
1073
|
-
<td rowspan="1" colSpan="1" >主播跨房连线:支持多布局模板(动态网格等),发起 / 接受 / 拒绝连线,连麦主播互动管理。</td>
|
|
1074
|
-
|
|
1075
|
-
<td rowspan="1" colSpan="1" >[API 文档](https://tencent-rtc.github.io/TUIKit_Flutter/api_live_co_host_store/api_live_co_host_store-library.html)</td>
|
|
1076
|
-
</tr>
|
|
1077
|
-
|
|
1078
|
-
<tr>
|
|
1079
|
-
<td rowspan="1" colSpan="1" >**BattleStore**</td>
|
|
1080
|
-
|
|
1081
|
-
<td rowspan="1" colSpan="1" >主播 PK 对战:发起 PK(配置时长 / 对手),管理 PK 状态(开始 / 结束),同步分数,监听对战结果。</td>
|
|
1082
|
-
|
|
1083
|
-
<td rowspan="1" colSpan="1" >[API 文档](https://tencent-rtc.github.io/TUIKit_Flutter/api_live_battle_store/BattleStore-class.html)</td>
|
|
1084
|
-
</tr>
|
|
1085
|
-
</table>
|
|
1086
|
-
|
|
835
|
+
| **Store/Component** | **功能描述** | **API 文档** |
|
|
836
|
+
| --- | --- | --- |
|
|
837
|
+
| **LiveCoreWidget** | 直播视频流展示与交互的核心视图组件:负责视频流渲染和视图挂件处理,支持主播直播、观众连麦、主播连线等场景。 | [API 文档](https://tencent-rtc.github.io/TUIKit_Flutter/api_view_live_live_core_widget/LiveCoreWidget-class.html) |
|
|
838
|
+
| **LiveCoreController** | LiveCoreWidget 的控制器:用于设置直播 ID、控制预览等操作。 | [API 文档](https://tencent-rtc.github.io/TUIKit_Flutter/api_view_live_live_core_widget/LiveCoreController-class.html) |
|
|
839
|
+
| **VideoWidgetBuilder** | 视频视图适配器:用于自定义连线主播、PK 用户、PK 容器等场景的视频流挂件视图。 | [API 文档](https://tencent-rtc.github.io/TUIKit_Flutter/api_view_live_live_core_widget/VideoWidgetBuilder-class.html) |
|
|
840
|
+
| **DeviceStore** | 音视频设备控制:麦克风(开关 / 音量)、摄像头(开关 / 切换 / 画质)、屏幕共享,设备状态实时监听。 | [API 文档](https://tencent-rtc.github.io/TUIKit_Flutter/api_device_device_store/DeviceStore-class.html) |
|
|
841
|
+
| **CoHostStore** | 主播跨房连线:支持多布局模板(动态网格等),发起 / 接受 / 拒绝连线,连麦主播互动管理。 | [API 文档](https://tencent-rtc.github.io/TUIKit_Flutter/api_live_co_host_store/api_live_co_host_store-library.html) |
|
|
842
|
+
| **BattleStore** | 主播 PK 对战:发起 PK(配置时长 / 对手),管理 PK 状态(开始 / 结束),同步分数,监听对战结果。 | [API 文档](https://tencent-rtc.github.io/TUIKit_Flutter/api_live_battle_store/BattleStore-class.html) |
|
|
1087
843
|
|
|
1088
844
|
## 常见问题
|
|
1089
845
|
|
|
@@ -1092,7 +848,6 @@ class _FullCustomLiveWidgetState extends State<FullCustomLiveWidget> {
|
|
|
1092
848
|
|
|
1093
849
|
- 检查网络连接是否通畅,邀请信令有30秒的默认超时时间。
|
|
1094
850
|
|
|
1095
|
-
|
|
1096
851
|
### 连线或 PK 过程中,一方主播网络断开或 App 崩溃了怎么办?
|
|
1097
852
|
|
|
1098
853
|
**CoHostStore** 和 **BattleStore** 内部都有心跳和超时检测机制。如果一方异常退出,另一方会通过 **onCoHostUserLeft** 或 **onUserExitBattle** 等事件收到通知,您可以根据这些事件来处理UI,例如提示"对方已掉线"并结束互动。
|
|
@@ -1106,8 +861,6 @@ class _FullCustomLiveWidgetState extends State<FullCustomLiveWidget> {
|
|
|
1106
861
|
|
|
1107
862
|
- **灵活适配规则**:后端改配置(例如调整礼物对应分数、加成分数)即可适配业务变化,无需改前端,降低迭代成本。
|
|
1108
863
|
|
|
1109
|
-
|
|
1110
864
|
### 如何管理通过 `VideoWidgetBuilder` 添加的自定义视图的生命周期和事件?
|
|
1111
865
|
|
|
1112
866
|
**LiveCoreWidget** 会自动管理您通过 `coHostWidgetBuilder`、`battleWidgetBuilder`、`battleContainerWidgetBuilder` 回调返回视图的添加和移除,您无需手动处理。如果需要在自定义视图中处理用户交互(例如点击事件),请在创建视图时为其添加相应的事件即可。
|
|
1113
|
-
|