@tencentcloud/sdk-mcp 1.3.9 → 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/vue/faq.md → callkit/faq/web-faq.md} +78 -311
- package/resource/doc/callkit/preset/android/api.md +330 -0
- package/resource/doc/{tuicallkit → callkit/preset}/android/integration.md +63 -420
- 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/{chatuikit → chatkit}/android/integration.md +30 -126
- 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/{live → core-sdk/live}/flutter/live-integration.md +160 -543
- 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/{voice → core-sdk/voice}/android/voice-audience-list.md +17 -88
- package/resource/doc/livekit/{voice → core-sdk/voice}/android/voice-audio-effect.md +34 -192
- package/resource/doc/livekit/{voice → core-sdk/voice}/android/voice-barrage.md +26 -139
- package/resource/doc/livekit/{voice → core-sdk/voice}/android/voice-co-guest-interaction.md +53 -262
- package/resource/doc/livekit/{voice → core-sdk/voice}/android/voice-gift.md +75 -455
- package/resource/doc/livekit/{voice → core-sdk/voice}/android/voice-host-interaction.md +60 -272
- package/resource/doc/livekit/{voice → core-sdk/voice}/android/voice-integration.md +63 -440
- package/resource/doc/livekit/{voice → core-sdk/voice}/android/voice-room-list.md +23 -151
- package/resource/doc/livekit/{voice → core-sdk/voice}/flutter/voice-audience-list.md +13 -91
- package/resource/doc/livekit/{voice → core-sdk/voice}/flutter/voice-audio-effect.md +34 -177
- package/resource/doc/livekit/{voice → core-sdk/voice}/flutter/voice-barrage.md +18 -102
- package/resource/doc/livekit/{voice → core-sdk/voice}/flutter/voice-co-guest-interaction.md +44 -201
- package/resource/doc/livekit/{voice → core-sdk/voice}/flutter/voice-gift.md +66 -460
- package/resource/doc/livekit/{voice → core-sdk/voice}/flutter/voice-integration.md +57 -419
- package/resource/doc/livekit/{voice → core-sdk/voice}/flutter/voice-room-list.md +24 -157
- package/resource/doc/livekit/{voice → core-sdk/voice}/ios/voice-audience-list.md +23 -96
- package/resource/doc/livekit/{voice → core-sdk/voice}/ios/voice-audio-effect.md +33 -195
- package/resource/doc/livekit/{voice → core-sdk/voice}/ios/voice-barrage.md +35 -150
- package/resource/doc/livekit/{voice → core-sdk/voice}/ios/voice-co-guest-interaction.md +45 -254
- package/resource/doc/livekit/{voice → core-sdk/voice}/ios/voice-gift.md +77 -457
- package/resource/doc/livekit/{voice → core-sdk/voice}/ios/voice-host-interaction.md +52 -261
- package/resource/doc/livekit/core-sdk/voice/ios/voice-integration.md +478 -0
- package/resource/doc/livekit/{voice → core-sdk/voice}/ios/voice-room-list.md +36 -167
- package/resource/doc/livekit/{voice → core-sdk/voice}/uni-app/voice-audience-list.md +15 -45
- package/resource/doc/livekit/{voice → core-sdk/voice}/uni-app/voice-audio-effect.md +23 -137
- package/resource/doc/livekit/{voice → core-sdk/voice}/uni-app/voice-barrage.md +25 -131
- package/resource/doc/livekit/{voice → core-sdk/voice}/uni-app/voice-co-guest-interaction.md +70 -366
- package/resource/doc/livekit/{voice → core-sdk/voice}/uni-app/voice-gift.md +70 -424
- package/resource/doc/livekit/core-sdk/voice/uni-app/voice-integration.md +323 -0
- package/resource/doc/livekit/{voice → core-sdk/voice}/uni-app/voice-room-list.md +24 -116
- 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 +21 -80
- 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 -34
- 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 -41
- 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 -46
- 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 -61
- 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/workflow.md +0 -713
- 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/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/livekit/voice/android/workflow.md +0 -333
- package/resource/doc/livekit/voice/flutter/workflow.md +0 -359
- package/resource/doc/livekit/voice/ios/voice-integration.md +0 -853
- package/resource/doc/livekit/voice/ios/workflow.md +0 -358
- package/resource/doc/livekit/voice/uni-app/voice-integration.md +0 -613
- package/resource/doc/livekit/voice/uni-app/workflow.md +0 -369
- 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 -733
- package/resource/doc/tuicallkit/android/workflow.md +0 -432
- 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/react/faq.md +0 -986
- package/resource/doc/tuicallkit/vue/api.md +0 -1512
- 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/present-scenario-choice.js +0 -16
- package/tools/common/present-scenario-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 -75
- package/tools/definitions/get_native_live_uikit_integration_def.js.map +0 -1
- package/tools/definitions/get_native_live_uikit_interaction_def.js +0 -63
- 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 -92
- package/tools/definitions/get_web_room_feature_detail_def.js.map +0 -1
- package/tools/definitions/present_scenario_choice_def.js +0 -53
- package/tools/definitions/present_scenario_choice_def.js.map +0 -1
- package/tools/definitions/record_prompt_def.js +0 -58
- package/tools/definitions/record_prompt_def.js.map +0 -1
- package/tools/definitions/record_result_def.js +0 -46
- package/tools/definitions/record_result_def.js.map +0 -1
- package/tools/live/get-native-live-uikit-integration.js +0 -177
- 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 -194
- 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**,并完成 **LiveCoreView** 的接入。
|
|
15
12
|
|
|
16
13
|
### 步骤2:实现跨房连线
|
|
17
14
|
|
|
@@ -20,7 +17,6 @@
|
|
|
20
17
|
#### 邀请方(主播 A)实现
|
|
21
18
|
1. **发起连线邀请**
|
|
22
19
|
|
|
23
|
-
|
|
24
20
|
当主播A在界面上选择目标主播B并发起连线时,调用 `requestHostConnection` 方法。
|
|
25
21
|
|
|
26
22
|
``` kotlin
|
|
@@ -28,28 +24,28 @@
|
|
|
28
24
|
import io.trtc.tuikit.atomicxcore.api.CompletionHandler
|
|
29
25
|
import io.trtc.tuikit.atomicxcore.api.live.CoHostLayoutTemplate
|
|
30
26
|
import io.trtc.tuikit.atomicxcore.api.live.CoHostStore
|
|
31
|
-
|
|
27
|
+
|
|
32
28
|
// 主播A的Activity
|
|
33
29
|
class AnchorAActivity : AppCompatActivity() {
|
|
34
30
|
private val liveId = "主播A的房间ID"
|
|
35
31
|
private val coHostStore = CoHostStore.create(liveId)
|
|
36
|
-
|
|
32
|
+
|
|
37
33
|
// 用户点击"连线"按钮,并选择了主播B
|
|
38
34
|
fun inviteHostB(targetHostLiveId: String) {
|
|
39
35
|
val layout = CoHostLayoutTemplate.HOST_DYNAMIC_GRID // 选择一个布局模板
|
|
40
36
|
val timeout = 30 // 邀请超时时间(秒)
|
|
41
|
-
|
|
37
|
+
|
|
42
38
|
coHostStore.requestHostConnection(
|
|
43
39
|
targetHostLiveID = targetHostLiveId,
|
|
44
40
|
layoutTemplate = layout,
|
|
45
41
|
timeout = timeout,
|
|
46
42
|
extraInfo = null,
|
|
47
43
|
completion = object : CompletionHandler {
|
|
48
|
-
override fun onSuccess() {
|
|
44
|
+
override fun onSuccess() {
|
|
49
45
|
println("连线邀请已发送,等待对方处理...")
|
|
50
46
|
}
|
|
51
|
-
|
|
52
|
-
override fun onFailure(code: Int, desc: String) {
|
|
47
|
+
|
|
48
|
+
override fun onFailure(code: Int, desc: String) {
|
|
53
49
|
println("邀请发送失败: $desc")
|
|
54
50
|
}
|
|
55
51
|
}
|
|
@@ -59,7 +55,6 @@
|
|
|
59
55
|
```
|
|
60
56
|
2. **监听邀请结果**
|
|
61
57
|
|
|
62
|
-
|
|
63
58
|
通过 `CoHostListener` 的回调方法,您可以接收到主播 B 的处理结果。
|
|
64
59
|
|
|
65
60
|
``` java
|
|
@@ -68,7 +63,7 @@
|
|
|
68
63
|
import io.trtc.tuikit.atomicxcore.api.live.CoHostListener
|
|
69
64
|
import io.trtc.tuikit.atomicxcore.api.live.CoHostStore
|
|
70
65
|
import io.trtc.tuikit.atomicxcore.api.live.SeatUserInfo
|
|
71
|
-
|
|
66
|
+
|
|
72
67
|
class AnchorAActivity : AppCompatActivity() {
|
|
73
68
|
private val liveId = "主播A的房间ID"
|
|
74
69
|
private val coHostStore = CoHostStore.create(liveId)
|
|
@@ -76,20 +71,20 @@
|
|
|
76
71
|
override fun onCoHostRequestAccepted(invitee: SeatUserInfo) {
|
|
77
72
|
println("主播 ${invitee.userName} 同意了你的连线邀请")
|
|
78
73
|
}
|
|
79
|
-
|
|
74
|
+
|
|
80
75
|
override fun onCoHostRequestRejected(invitee: SeatUserInfo) {
|
|
81
76
|
println("主播 ${invitee.userName} 拒绝了你的邀请")
|
|
82
77
|
}
|
|
83
|
-
|
|
84
|
-
override fun onCoHostRequestTimeout(inviter: SeatUserInfo, invitee: SeatUserInfo) {
|
|
78
|
+
|
|
79
|
+
override fun onCoHostRequestTimeout(inviter: SeatUserInfo, invitee: SeatUserInfo) {
|
|
85
80
|
println("邀请超时,对方未回应")
|
|
86
81
|
}
|
|
87
82
|
}
|
|
88
|
-
|
|
83
|
+
|
|
89
84
|
override fun onCreate(savedInstanceState: Bundle?) {
|
|
90
85
|
super.onCreate(savedInstanceState)
|
|
91
86
|
setContentView(R.layout.activity_anchor_a)
|
|
92
|
-
|
|
87
|
+
|
|
93
88
|
// 初始化CoHostStore
|
|
94
89
|
coHostStore.addCoHostListener(coHostListener)
|
|
95
90
|
}
|
|
@@ -99,7 +94,6 @@
|
|
|
99
94
|
#### 受邀方(主播 B)实现
|
|
100
95
|
1. **接收连线邀请**
|
|
101
96
|
|
|
102
|
-
|
|
103
97
|
通过 `CoHostListener`,主播B可以监听到来自主播A的邀请。
|
|
104
98
|
|
|
105
99
|
``` kotlin
|
|
@@ -107,12 +101,12 @@
|
|
|
107
101
|
import io.trtc.tuikit.atomicxcore.api.live.CoHostListener
|
|
108
102
|
import io.trtc.tuikit.atomicxcore.api.live.CoHostStore
|
|
109
103
|
import io.trtc.tuikit.atomicxcore.api.live.SeatUserInfo
|
|
110
|
-
|
|
104
|
+
|
|
111
105
|
// 主播B的Activity
|
|
112
106
|
class AnchorBActivity : AppCompatActivity() {
|
|
113
107
|
private val liveId = "主播B的房间ID"
|
|
114
108
|
private val coHostStore = CoHostStore.create(liveId)
|
|
115
|
-
|
|
109
|
+
|
|
116
110
|
private val coHostListener = object : CoHostListener() {
|
|
117
111
|
override fun onCoHostRequestReceived(inviter: SeatUserInfo, extensionInfo: String) {
|
|
118
112
|
println("收到主播 ${inviter.userName} 的连线邀请")
|
|
@@ -124,7 +118,6 @@
|
|
|
124
118
|
```
|
|
125
119
|
2. **响应连线邀请**
|
|
126
120
|
|
|
127
|
-
|
|
128
121
|
当主播B在弹出的对话框中做出选择后,调用相应的方法。
|
|
129
122
|
|
|
130
123
|
``` kotlin
|
|
@@ -132,7 +125,7 @@
|
|
|
132
125
|
fun acceptInvitation(fromHostLiveId: String) {
|
|
133
126
|
coHostStore.acceptHostConnection(fromHostLiveID = fromHostLiveId, completion = null)
|
|
134
127
|
}
|
|
135
|
-
|
|
128
|
+
|
|
136
129
|
fun rejectInvitation(fromHostLiveId: String) {
|
|
137
130
|
coHostStore.rejectHostConnection(fromHostLiveID = fromHostLiveId, completion = null)
|
|
138
131
|
}
|
|
@@ -145,7 +138,6 @@
|
|
|
145
138
|
#### 挑战方(例如主播 A)实现
|
|
146
139
|
1. **发起 PK 挑战**
|
|
147
140
|
|
|
148
|
-
|
|
149
141
|
当主播 A 点击** PK** 按钮时,调用 `requestBattle` 方法。
|
|
150
142
|
|
|
151
143
|
``` kotlin
|
|
@@ -153,7 +145,7 @@
|
|
|
153
145
|
class AnchorAActivity : AppCompatActivity() {
|
|
154
146
|
private val liveId = "主播A的房间ID"
|
|
155
147
|
private val battleStore = BattleStore.create(liveId)
|
|
156
|
-
|
|
148
|
+
|
|
157
149
|
fun startPK(opponentUserId: String) {
|
|
158
150
|
val config = BattleConfig(duration = 300) // PK持续5分钟
|
|
159
151
|
battleStore.requestBattle(
|
|
@@ -167,7 +159,6 @@
|
|
|
167
159
|
```
|
|
168
160
|
2. **监听 PK 状态**
|
|
169
161
|
|
|
170
|
-
|
|
171
162
|
通过 `BattleListener` 监听 PK 的开始、结束等关键事件。
|
|
172
163
|
|
|
173
164
|
``` java
|
|
@@ -175,7 +166,7 @@
|
|
|
175
166
|
class AnchorAActivity : AppCompatActivity() {
|
|
176
167
|
private val liveId = "主播A的房间ID"
|
|
177
168
|
private val battleStore = BattleStore.create(liveId)
|
|
178
|
-
|
|
169
|
+
|
|
179
170
|
private val battleListener = object : BattleListener() {
|
|
180
171
|
override fun onBattleStarted(
|
|
181
172
|
battleInfo: BattleInfo,
|
|
@@ -184,12 +175,12 @@
|
|
|
184
175
|
) {
|
|
185
176
|
println("PK 开始")
|
|
186
177
|
}
|
|
187
|
-
|
|
178
|
+
|
|
188
179
|
override fun onBattleEnded(battleInfo: BattleInfo, reason: BattleEndedReason?) {
|
|
189
180
|
println("PK 结束")
|
|
190
181
|
}
|
|
191
182
|
}
|
|
192
|
-
|
|
183
|
+
|
|
193
184
|
override fun onCreate(savedInstanceState: Bundle?) {
|
|
194
185
|
super.onCreate(savedInstanceState)
|
|
195
186
|
// ... 其他初始化代码 ...
|
|
@@ -201,7 +192,6 @@
|
|
|
201
192
|
#### 应战方(主播 B)实现
|
|
202
193
|
1. **接收 PK 挑战**
|
|
203
194
|
|
|
204
|
-
|
|
205
195
|
通过 `BattleListener` 监听到 PK 邀请。
|
|
206
196
|
|
|
207
197
|
``` kotlin
|
|
@@ -209,7 +199,7 @@
|
|
|
209
199
|
class AnchorBActivity : AppCompatActivity() {
|
|
210
200
|
private val liveId = "主播B的房间ID"
|
|
211
201
|
private val battleStore = BattleStore.create(liveId)
|
|
212
|
-
|
|
202
|
+
|
|
213
203
|
private val battleListener = object : BattleListener() {
|
|
214
204
|
override fun onBattleRequestReceived(battleID: String, inviter: SeatUserInfo, invitee: SeatUserInfo) {
|
|
215
205
|
println("收到主播 ${inviter.userName} 的PK挑战")
|
|
@@ -217,7 +207,7 @@
|
|
|
217
207
|
// showPKChallengeDialog(battleID, inviter)
|
|
218
208
|
}
|
|
219
209
|
}
|
|
220
|
-
|
|
210
|
+
|
|
221
211
|
override fun onCreate(savedInstanceState: Bundle?) {
|
|
222
212
|
super.onCreate(savedInstanceState)
|
|
223
213
|
// ... 其他初始化代码 ...
|
|
@@ -227,7 +217,6 @@
|
|
|
227
217
|
```
|
|
228
218
|
2. **响应 PK 挑战**
|
|
229
219
|
|
|
230
|
-
|
|
231
220
|
当主播 B 做出选择后,调用相应的方法。
|
|
232
221
|
|
|
233
222
|
``` kotlin
|
|
@@ -236,7 +225,7 @@
|
|
|
236
225
|
fun acceptPK(battleId: String) {
|
|
237
226
|
battleStore.acceptBattle(battleID = battleId, completion = null)
|
|
238
227
|
}
|
|
239
|
-
|
|
228
|
+
|
|
240
229
|
// 用户点击"拒绝挑战"
|
|
241
230
|
fun rejectPK(battleId: String) {
|
|
242
231
|
battleStore.rejectBattle(battleID = battleId, completion = null)
|
|
@@ -245,10 +234,7 @@
|
|
|
245
234
|
|
|
246
235
|
### 运行效果
|
|
247
236
|
|
|
248
|
-
当您集成以上功能实现后,请分别使用主播 A 和主播 B 进行对应操作,运行效果如下,您可以参考下一章节
|
|
249
|
-
|
|
250
|
-

|
|
251
|
-
|
|
237
|
+
当您集成以上功能实现后,请分别使用主播 A 和主播 B 进行对应操作,运行效果如下,您可以参考下一章节 完善 UI 细节 来定制您想要的 UI 逻辑。
|
|
252
238
|
|
|
253
239
|
## 完善 UI 细节
|
|
254
240
|
|
|
@@ -258,18 +244,14 @@
|
|
|
258
244
|
|
|
259
245
|
#### 实现效果
|
|
260
246
|
|
|
261
|
-

|
|
262
|
-
|
|
263
|
-
|
|
264
247
|
#### 实现方式
|
|
265
248
|
- **步骤1**:创建前景视图 (**CustomSeatView**),该视图用于在视频流上方显示用户信息。
|
|
266
|
-
|
|
267
249
|
|
|
268
250
|
> **提示:**
|
|
269
|
-
>
|
|
251
|
+
>
|
|
270
252
|
|
|
271
253
|
> 您也可以参考 TUILiveKit 开源项目中的 [widgets](https://github.com/Tencent-RTC/TUIKit_Android/tree/main/live/tuilivekit/src/main/java/com/trtc/uikit/livekit/features/anchorboardcast/view/cohost/widgets) 目录下文件来了解完整的实现逻辑。
|
|
272
|
-
>
|
|
254
|
+
>
|
|
273
255
|
|
|
274
256
|
``` kotlin
|
|
275
257
|
import android.content.Context
|
|
@@ -277,26 +259,26 @@
|
|
|
277
259
|
import android.view.Gravity
|
|
278
260
|
import android.widget.LinearLayout
|
|
279
261
|
import android.widget.TextView
|
|
280
|
-
|
|
262
|
+
|
|
281
263
|
// 自定义的用户信息悬浮视图(前景)
|
|
282
264
|
class CustomSeatView(context: Context) : LinearLayout(context) {
|
|
283
265
|
private val nameLabel: TextView
|
|
284
|
-
|
|
266
|
+
|
|
285
267
|
init {
|
|
286
268
|
orientation = VERTICAL
|
|
287
269
|
setBackgroundColor(Color.parseColor("#80000000")) // 半透明黑色背景
|
|
288
|
-
|
|
270
|
+
|
|
289
271
|
nameLabel = TextView(context).apply {
|
|
290
272
|
setTextColor(Color.WHITE)
|
|
291
273
|
textSize = 14f
|
|
292
274
|
gravity = Gravity.CENTER
|
|
293
275
|
}
|
|
294
|
-
|
|
276
|
+
|
|
295
277
|
addView(nameLabel)
|
|
296
278
|
val layoutParams = nameLabel.layoutParams as LayoutParams
|
|
297
279
|
layoutParams.setMargins(5, 0, 5, 5)
|
|
298
280
|
}
|
|
299
|
-
|
|
281
|
+
|
|
300
282
|
fun setUserName(userName: String) {
|
|
301
283
|
nameLabel.text = userName
|
|
302
284
|
}
|
|
@@ -310,21 +292,21 @@
|
|
|
310
292
|
import android.view.Gravity
|
|
311
293
|
import android.widget.ImageView
|
|
312
294
|
import android.widget.LinearLayout
|
|
313
|
-
|
|
295
|
+
|
|
314
296
|
// 自定义的头像占位视图(背景)
|
|
315
297
|
class CustomAvatarView(context: Context) : LinearLayout(context) {
|
|
316
298
|
private val avatarImageView: ImageView
|
|
317
|
-
|
|
299
|
+
|
|
318
300
|
init {
|
|
319
301
|
orientation = VERTICAL
|
|
320
302
|
gravity = Gravity.CENTER
|
|
321
303
|
setBackgroundColor(Color.TRANSPARENT)
|
|
322
|
-
|
|
304
|
+
|
|
323
305
|
avatarImageView = ImageView(context).apply {
|
|
324
306
|
setColorFilter(Color.GRAY)
|
|
325
307
|
scaleType = ImageView.ScaleType.CENTER_CROP
|
|
326
308
|
}
|
|
327
|
-
|
|
309
|
+
|
|
328
310
|
addView(avatarImageView)
|
|
329
311
|
val layoutParams = avatarImageView.layoutParams as LayoutParams
|
|
330
312
|
layoutParams.width = 120 // 60dp
|
|
@@ -340,12 +322,12 @@
|
|
|
340
322
|
import androidx.appcompat.app.AppCompatActivity
|
|
341
323
|
import io.trtc.tuikit.atomicxcore.api.view.VideoViewAdapter
|
|
342
324
|
import io.trtc.tuikit.atomicxcore.api.view.ViewLayer
|
|
343
|
-
|
|
325
|
+
|
|
344
326
|
// 1. 在您的Activity中,实现 VideoViewAdapter 接口
|
|
345
327
|
class YourActivity : AppCompatActivity(), VideoViewAdapter {
|
|
346
|
-
|
|
328
|
+
|
|
347
329
|
// ... 其他代码 ...
|
|
348
|
-
|
|
330
|
+
|
|
349
331
|
// 2. 完整实现接口方法,处理两种 viewLayer
|
|
350
332
|
override fun createCoHostView(coHostUser: TUIRoomDefine.SeatFullInfo?, viewLayer: ViewLayer?): View? {
|
|
351
333
|
val seatInfo = coHostUser ?: return null
|
|
@@ -353,7 +335,7 @@
|
|
|
353
335
|
if (userId.isNullOrEmpty()) {
|
|
354
336
|
return null
|
|
355
337
|
}
|
|
356
|
-
|
|
338
|
+
|
|
357
339
|
return when (viewLayer) {
|
|
358
340
|
ViewLayer.FOREGROUND -> {
|
|
359
341
|
val seatView = CustomSeatView(this)
|
|
@@ -372,72 +354,15 @@
|
|
|
372
354
|
```
|
|
373
355
|
|
|
374
356
|
#### **参数说明**:
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
<tr>
|
|
385
|
-
<td rowspan="1" colSpan="1" >`seatInfo`</td>
|
|
386
|
-
|
|
387
|
-
<td rowspan="1" colSpan="1" >`SeatFullInfo?`</td>
|
|
388
|
-
|
|
389
|
-
<td rowspan="1" colSpan="1" >麦位信息对象,包含麦上用户的详细信息</td>
|
|
390
|
-
</tr>
|
|
391
|
-
|
|
392
|
-
<tr>
|
|
393
|
-
<td rowspan="1" colSpan="1" >`seatInfo.userId`</td>
|
|
394
|
-
|
|
395
|
-
<td rowspan="1" colSpan="1" >`String`</td>
|
|
396
|
-
|
|
397
|
-
<td rowspan="1" colSpan="1" >麦上用户的 ID</td>
|
|
398
|
-
</tr>
|
|
399
|
-
|
|
400
|
-
<tr>
|
|
401
|
-
<td rowspan="1" colSpan="1" >`seatInfo.userName`</td>
|
|
402
|
-
|
|
403
|
-
<td rowspan="1" colSpan="1" >`String`</td>
|
|
404
|
-
|
|
405
|
-
<td rowspan="1" colSpan="1" >麦上用户的昵称</td>
|
|
406
|
-
</tr>
|
|
407
|
-
|
|
408
|
-
<tr>
|
|
409
|
-
<td rowspan="1" colSpan="1" >`seatInfo.userAvatar`</td>
|
|
410
|
-
|
|
411
|
-
<td rowspan="1" colSpan="1" >`String`</td>
|
|
412
|
-
|
|
413
|
-
<td rowspan="1" colSpan="1" >麦上用户的头像 URL</td>
|
|
414
|
-
</tr>
|
|
415
|
-
|
|
416
|
-
<tr>
|
|
417
|
-
<td rowspan="1" colSpan="1" >`seatInfo.userMicrophoneStatus`</td>
|
|
418
|
-
|
|
419
|
-
<td rowspan="1" colSpan="1" >`DeviceStatus`</td>
|
|
420
|
-
|
|
421
|
-
<td rowspan="1" colSpan="1" >麦上用户的麦克风状态</td>
|
|
422
|
-
</tr>
|
|
423
|
-
|
|
424
|
-
<tr>
|
|
425
|
-
<td rowspan="1" colSpan="1" >`seatInfo.userCameraStatus `</td>
|
|
426
|
-
|
|
427
|
-
<td rowspan="1" colSpan="1" >`DeviceStatus`</td>
|
|
428
|
-
|
|
429
|
-
<td rowspan="1" colSpan="1" >麦上用户的摄像头状态</td>
|
|
430
|
-
</tr>
|
|
431
|
-
|
|
432
|
-
<tr>
|
|
433
|
-
<td rowspan="1" colSpan="1" >`viewLayer`</td>
|
|
434
|
-
|
|
435
|
-
<td rowspan="1" colSpan="1" >`ViewLayer`</td>
|
|
436
|
-
|
|
437
|
-
<td rowspan="1" colSpan="1" >视图层级枚举<br>- `FOREGROUND` 表示前景挂件视图,始终显示在视频画面的最上层<br>- `BACKGROUND` 表示背景挂件视图,位于前景视图下层,仅在对应用户没有视频流(例如未开摄像头)的情况下显示,通常用于展示用户的默认头像或占位图</td>
|
|
438
|
-
</tr>
|
|
439
|
-
</table>
|
|
440
|
-
|
|
357
|
+
| **参数** | **类型** | **说明** |
|
|
358
|
+
| --- | --- | --- |
|
|
359
|
+
| `seatInfo` | `SeatFullInfo?` | 麦位信息对象,包含麦上用户的详细信息 |
|
|
360
|
+
| `seatInfo.userId` | `String` | 麦上用户的 ID |
|
|
361
|
+
| `seatInfo.userName` | `String` | 麦上用户的昵称 |
|
|
362
|
+
| `seatInfo.userAvatar` | `String` | 麦上用户的头像 URL |
|
|
363
|
+
| `seatInfo.userMicrophoneStatus` | `DeviceStatus` | 麦上用户的麦克风状态 |
|
|
364
|
+
| `seatInfo.userCameraStatus ` | `DeviceStatus` | 麦上用户的摄像头状态 |
|
|
365
|
+
| `viewLayer` | `ViewLayer` | 视图层级枚举<br>- `FOREGROUND` 表示前景挂件视图,始终显示在视频画面的最上层<br>- `BACKGROUND` 表示背景挂件视图,位于前景视图下层,仅在对应用户没有视频流(例如未开摄像头)的情况下显示,通常用于展示用户的默认头像或占位图 |
|
|
441
366
|
|
|
442
367
|
### 实现 PK 用户视图的分数展示
|
|
443
368
|
|
|
@@ -445,9 +370,6 @@
|
|
|
445
370
|
|
|
446
371
|
#### **实现效果**
|
|
447
372
|
|
|
448
|
-

|
|
449
|
-
|
|
450
|
-
|
|
451
373
|
#### 实现方式
|
|
452
374
|
- **步骤1**:创建自定义 PK 用户视图,您可以参考 TUILiveKit 开源项目中的 [BattleMemberInfoView.kt](https://github.com/Tencent-RTC/TUIKit_Android/blob/main/live/tuilivekit/src/main/java/com/trtc/uikit/livekit/features/anchorboardcast/view/battle/widgets/BattleMemberInfoView.kt) 文件来了解完整的实现逻辑。
|
|
453
375
|
|
|
@@ -462,54 +384,54 @@
|
|
|
462
384
|
import kotlinx.coroutines.CoroutineScope
|
|
463
385
|
import kotlinx.coroutines.Dispatchers
|
|
464
386
|
import kotlinx.coroutines.launch
|
|
465
|
-
|
|
387
|
+
|
|
466
388
|
// 自定义PK 用户视图
|
|
467
389
|
class CustomBattleUserView(
|
|
468
390
|
context: Context,
|
|
469
391
|
private val liveId: String,
|
|
470
392
|
private val battleUser: BattleUser
|
|
471
393
|
) : LinearLayout(context) {
|
|
472
|
-
|
|
394
|
+
|
|
473
395
|
private lateinit var scoreView: LinearLayout
|
|
474
396
|
private lateinit var scoreLabel: TextView
|
|
475
397
|
private val battleStore: BattleStore
|
|
476
|
-
|
|
398
|
+
|
|
477
399
|
init {
|
|
478
400
|
orientation = VERTICAL
|
|
479
401
|
gravity = Gravity.BOTTOM or Gravity.END
|
|
480
402
|
setBackgroundColor(Color.TRANSPARENT)
|
|
481
403
|
isClickable = false
|
|
482
|
-
|
|
404
|
+
|
|
483
405
|
battleStore = BattleStore.create(liveId)
|
|
484
|
-
|
|
406
|
+
|
|
485
407
|
// UI 布局
|
|
486
408
|
setupUI()
|
|
487
409
|
// 订阅分数变化
|
|
488
410
|
subscribeBattleState()
|
|
489
411
|
}
|
|
490
|
-
|
|
412
|
+
|
|
491
413
|
private fun setupUI() {
|
|
492
414
|
scoreView = LinearLayout(context).apply {
|
|
493
415
|
setBackgroundColor(Color.parseColor("#66000000"))
|
|
494
416
|
orientation = VERTICAL
|
|
495
417
|
gravity = Gravity.CENTER
|
|
496
418
|
}
|
|
497
|
-
|
|
419
|
+
|
|
498
420
|
scoreLabel = TextView(context).apply {
|
|
499
421
|
setTextColor(Color.WHITE)
|
|
500
422
|
textSize = 14f
|
|
501
423
|
gravity = Gravity.CENTER
|
|
502
424
|
}
|
|
503
|
-
|
|
425
|
+
|
|
504
426
|
scoreView.addView(scoreLabel)
|
|
505
427
|
addView(scoreView)
|
|
506
|
-
|
|
428
|
+
|
|
507
429
|
val layoutParams = scoreView.layoutParams as LayoutParams
|
|
508
430
|
layoutParams.width = LayoutParams.WRAP_CONTENT
|
|
509
431
|
layoutParams.height = 48 // 24dp
|
|
510
432
|
layoutParams.setMargins(0, 0, 10, 10)
|
|
511
433
|
}
|
|
512
|
-
|
|
434
|
+
|
|
513
435
|
// 订阅 PK 分数变化
|
|
514
436
|
private fun subscribeBattleState() {
|
|
515
437
|
CoroutineScope(Dispatchers.Main).launch {
|
|
@@ -527,83 +449,30 @@
|
|
|
527
449
|
``` kotlin
|
|
528
450
|
// 1. 让您的Activity实现 VideoViewAdapter 接口
|
|
529
451
|
class YourActivity : AppCompatActivity(), VideoViewAdapter {
|
|
530
|
-
|
|
452
|
+
|
|
531
453
|
override fun createBattleView(battleUser: BattleUser?): View? {
|
|
532
454
|
battleUser ?: return null
|
|
533
455
|
// CustomBattleUserView 是您自定义的PK用户信息视图
|
|
534
456
|
return CustomBattleUserView(this, liveId, battleUser)
|
|
535
457
|
}
|
|
536
|
-
|
|
458
|
+
|
|
537
459
|
}
|
|
538
460
|
```
|
|
539
461
|
|
|
540
462
|
#### **参数说明**:
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
<tr>
|
|
551
|
-
<td rowspan="1" colSpan="1" >`battleUser`</td>
|
|
552
|
-
|
|
553
|
-
<td rowspan="1" colSpan="1" >`BattleUser?`</td>
|
|
554
|
-
|
|
555
|
-
<td rowspan="1" colSpan="1" >PK 用户信息对象</td>
|
|
556
|
-
</tr>
|
|
557
|
-
|
|
558
|
-
<tr>
|
|
559
|
-
<td rowspan="1" colSpan="1" >`battleUser.roomId`</td>
|
|
560
|
-
|
|
561
|
-
<td rowspan="1" colSpan="1" >`String`</td>
|
|
562
|
-
|
|
563
|
-
<td rowspan="1" colSpan="1" >PK 的房间 ID</td>
|
|
564
|
-
</tr>
|
|
565
|
-
|
|
566
|
-
<tr>
|
|
567
|
-
<td rowspan="1" colSpan="1" >`battleUser.userId`</td>
|
|
568
|
-
|
|
569
|
-
<td rowspan="1" colSpan="1" >`String`</td>
|
|
570
|
-
|
|
571
|
-
<td rowspan="1" colSpan="1" >PK 用户 ID</td>
|
|
572
|
-
</tr>
|
|
573
|
-
|
|
574
|
-
<tr>
|
|
575
|
-
<td rowspan="1" colSpan="1" >`battleUser.userName`</td>
|
|
576
|
-
|
|
577
|
-
<td rowspan="1" colSpan="1" >`String`</td>
|
|
578
|
-
|
|
579
|
-
<td rowspan="1" colSpan="1" >PK 用户昵称</td>
|
|
580
|
-
</tr>
|
|
581
|
-
|
|
582
|
-
<tr>
|
|
583
|
-
<td rowspan="1" colSpan="1" >`battleUser.avatarUrl`</td>
|
|
584
|
-
|
|
585
|
-
<td rowspan="1" colSpan="1" >`String`</td>
|
|
586
|
-
|
|
587
|
-
<td rowspan="1" colSpan="1" >PK 用户头像地址</td>
|
|
588
|
-
</tr>
|
|
589
|
-
|
|
590
|
-
<tr>
|
|
591
|
-
<td rowspan="1" colSpan="1" >`battleUser.score`</td>
|
|
592
|
-
|
|
593
|
-
<td rowspan="1" colSpan="1" >`int`</td>
|
|
594
|
-
|
|
595
|
-
<td rowspan="1" colSpan="1" >PK 分数</td>
|
|
596
|
-
</tr>
|
|
597
|
-
</table>
|
|
598
|
-
|
|
463
|
+
| **参数** | **类型** | **说明** |
|
|
464
|
+
| --- | --- | --- |
|
|
465
|
+
| `battleUser` | `BattleUser?` | PK 用户信息对象 |
|
|
466
|
+
| `battleUser.roomId` | `String` | PK 的房间 ID |
|
|
467
|
+
| `battleUser.userId` | `String` | PK 用户 ID |
|
|
468
|
+
| `battleUser.userName` | `String` | PK 用户昵称 |
|
|
469
|
+
| `battleUser.avatarUrl` | `String` | PK 用户头像地址 |
|
|
470
|
+
| `battleUser.score` | `int` | PK 分数 |
|
|
599
471
|
|
|
600
472
|
### 实现视频流画面上的 PK 状态显示
|
|
601
473
|
|
|
602
474
|
#### **实现效果**
|
|
603
475
|
|
|
604
|
-

|
|
605
|
-
|
|
606
|
-
|
|
607
476
|
#### **实现方式**
|
|
608
477
|
- **步骤1:**创建自定义 PK 全局视图 **CustomBattleContainerView**,您可以参考 TUILiveKit 开源项目中的 [BattleInfoView.kt](https://github.com/Tencent-RTC/TUIKit_Android/blob/main/live/tuilivekit/src/main/java/com/trtc/uikit/livekit/features/anchorboardcast/view/battle/widgets/BattleInfoView.kt) 文件来实现,即可实现同样的效果。
|
|
609
478
|
|
|
@@ -625,162 +494,49 @@
|
|
|
625
494
|
通常在**直播主播 PK 场景**下,会将主播收到的礼物价值与 PK 数值挂钩(例如:观众送 "火箭" 礼物,主播 PK 分数增加 500 分),您可以通过我们的 REST API,轻松实现直播 PK 场景下的分数实时更新。
|
|
626
495
|
|
|
627
496
|
> **重要说明:**
|
|
628
|
-
>
|
|
497
|
+
>
|
|
629
498
|
|
|
630
499
|
> LiveKit 后台的 PK 分数系统采用纯数值计算和累加机制,所以您需要根据自身的运营策略和业务需求,在调用更新接口前完成 PK 分数的计算,您可以参考如下的 PK 分数计算示例:
|
|
631
|
-
>
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
<td rowspan="1" colSpan="1" >示例</td>
|
|
639
|
-
</tr>
|
|
640
|
-
|
|
641
|
-
<tr>
|
|
642
|
-
<td rowspan="1" colSpan="1" >基础礼物</td>
|
|
643
|
-
|
|
644
|
-
<td rowspan="1" colSpan="1" >礼物价值 × 5</td>
|
|
645
|
-
|
|
646
|
-
<td rowspan="1" colSpan="1" >10元礼物 → 50分</td>
|
|
647
|
-
</tr>
|
|
648
|
-
|
|
649
|
-
<tr>
|
|
650
|
-
<td rowspan="1" colSpan="1" >中级礼物</td>
|
|
651
|
-
|
|
652
|
-
<td rowspan="1" colSpan="1" >礼物价值 × 8</td>
|
|
653
|
-
|
|
654
|
-
<td rowspan="1" colSpan="1" >50元礼物 → 400分</td>
|
|
655
|
-
</tr>
|
|
656
|
-
|
|
657
|
-
<tr>
|
|
658
|
-
<td rowspan="1" colSpan="1" >高级礼物</td>
|
|
659
|
-
|
|
660
|
-
<td rowspan="1" colSpan="1" >礼物价值 × 12</td>
|
|
661
|
-
|
|
662
|
-
<td rowspan="1" colSpan="1" >100元礼物 → 1200分</td>
|
|
663
|
-
</tr>
|
|
664
|
-
|
|
665
|
-
<tr>
|
|
666
|
-
<td rowspan="1" colSpan="1" >特效礼物</td>
|
|
667
|
-
|
|
668
|
-
<td rowspan="1" colSpan="1" >固定高分数</td>
|
|
669
|
-
|
|
670
|
-
<td rowspan="1" colSpan="1" >520元礼物 → 1314分<br></td>
|
|
671
|
-
</tr>
|
|
672
|
-
</table>
|
|
673
|
-
|
|
674
|
-
|
|
500
|
+
>
|
|
501
|
+
| 礼物类型 | 分数计算规则 | 示例 |
|
|
502
|
+
| --- | --- | --- |
|
|
503
|
+
| 基础礼物 | 礼物价值 × 5 | 10元礼物 → 50分 |
|
|
504
|
+
| 中级礼物 | 礼物价值 × 8 | 50元礼物 → 400分 |
|
|
505
|
+
| 高级礼物 | 礼物价值 × 12 | 100元礼物 → 1200分 |
|
|
506
|
+
| 特效礼物 | 固定高分数 | 520元礼物 → 1314分 |
|
|
675
507
|
|
|
676
508
|
#### REST API 调用流程
|
|
677
509
|
|
|
678
|
-

|
|
679
|
-
|
|
680
|
-
|
|
681
510
|
#### 关键流程说明
|
|
682
511
|
1. **获取 PK 状态**:
|
|
683
512
|
|
|
684
|
-
- 回调配置:您可以通过配置
|
|
513
|
+
- 回调配置:您可以通过配置 PK 状态回调,由 LiveKit 后台在 PK 开始、结束时,主动通知您的系统 PK 状态。
|
|
685
514
|
|
|
686
|
-
- 主动查询:您的后台服务可主动调用
|
|
515
|
+
- 主动查询:您的后台服务可主动调用 PK 状态查询 接口,随时查询当前 PK 状态。
|
|
687
516
|
|
|
688
517
|
2. **PK分数计算**:您的后台服务根据业务规则(如上述示例),计算 PK 分数增量。
|
|
689
518
|
|
|
690
|
-
3. **PK分数更新**:您的后台服务调用
|
|
519
|
+
3. **PK分数更新**:您的后台服务调用 修改 PK 分数 接口,向 LiveKit 后台更新 PK 分数。
|
|
691
520
|
|
|
692
521
|
4. **LiveKit后台 同步客户端**:LiveKit 后台自动将更新后的 PK 分数同步到所有客户端。
|
|
693
522
|
|
|
694
|
-
|
|
695
523
|
#### 涉及的 REST API 接口
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
<td rowspan="1" colSpan="1" >请求示例</td>
|
|
703
|
-
</tr>
|
|
704
|
-
|
|
705
|
-
<tr>
|
|
706
|
-
<td rowspan="1" colSpan="1" >主动接口 - 查询 PK 状态</td>
|
|
707
|
-
|
|
708
|
-
<td rowspan="1" colSpan="1" >可根据此接口查询当前房间是否在 PK</td>
|
|
709
|
-
|
|
710
|
-
<td rowspan="1" colSpan="1" >[请求示例](https://write.woa.com/document/169572228815638528)</td>
|
|
711
|
-
</tr>
|
|
712
|
-
|
|
713
|
-
<tr>
|
|
714
|
-
<td rowspan="1" colSpan="1" >主动接口 - 修改 PK 分数</td>
|
|
715
|
-
|
|
716
|
-
<td rowspan="1" colSpan="1" >将计算后的 PK 数值通过此接口更新</td>
|
|
717
|
-
|
|
718
|
-
<td rowspan="1" colSpan="1" >[请求示例](https://write.woa.com/document/169571965752266752)</td>
|
|
719
|
-
</tr>
|
|
720
|
-
|
|
721
|
-
<tr>
|
|
722
|
-
<td rowspan="1" colSpan="1" >回调配置 - PK 开始时回调</td>
|
|
723
|
-
|
|
724
|
-
<td rowspan="1" colSpan="1" >客户后台可以通过该回调及时知晓 PK 开启</td>
|
|
725
|
-
|
|
726
|
-
<td rowspan="1" colSpan="1" >[回调示例](https://write.woa.com/document/170122621675196416)</td>
|
|
727
|
-
</tr>
|
|
728
|
-
|
|
729
|
-
<tr>
|
|
730
|
-
<td rowspan="1" colSpan="1" >回调配置 - PK 结束时回调</td>
|
|
731
|
-
|
|
732
|
-
<td rowspan="1" colSpan="1" >客户后台可以通过该回调及时知晓 PK 结束</td>
|
|
733
|
-
|
|
734
|
-
<td rowspan="1" colSpan="1" >[回调示例](https://write.woa.com/document/170123212271988736)</td>
|
|
735
|
-
</tr>
|
|
736
|
-
</table>
|
|
737
|
-
|
|
524
|
+
| 接口 | 功能描述 | 请求示例 |
|
|
525
|
+
| --- | --- | --- |
|
|
526
|
+
| 主动接口 - 查询 PK 状态 | 可根据此接口查询当前房间是否在 PK | 请求示例 |
|
|
527
|
+
| 主动接口 - 修改 PK 分数 | 将计算后的 PK 数值通过此接口更新 | 请求示例 |
|
|
528
|
+
| 回调配置 - PK 开始时回调 | 客户后台可以通过该回调及时知晓 PK 开启 | 回调示例 |
|
|
529
|
+
| 回调配置 - PK 结束时回调 | 客户后台可以通过该回调及时知晓 PK 结束 | 回调示例 |
|
|
738
530
|
|
|
739
531
|
## API 文档
|
|
740
532
|
|
|
741
533
|
关于 [CoHostStore](https://tencent-rtc.github.io/TUIKit_Android/-atomic-x%20-core%20-a-p-i/io.trtc.tuikit.atomicxcore.api.live/-co-host-store/index.html) 及其相关类的所有公开接口、属性和方法的详细信息,请参阅随 [AtomicXCore](https://tencent-rtc.github.io/TUIKit_Android/index.html) 框架的官方 API 文档。本指南使用到的相关 Store 如下:
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
<td rowspan="1" colSpan="1" >API 文档</td>
|
|
749
|
-
</tr>
|
|
750
|
-
|
|
751
|
-
<tr>
|
|
752
|
-
<td rowspan="1" colSpan="1" >LiveCoreView</td>
|
|
753
|
-
|
|
754
|
-
<td rowspan="1" colSpan="1" >直播视频流展示与交互的核心视图组件:负责视频流渲染和视图挂件处理,支持主播直播、观众连麦、主播连线等场景。</td>
|
|
755
|
-
|
|
756
|
-
<td rowspan="1" colSpan="1" >[API 文档](https://tencent-rtc.github.io/TUIKit_Android/-atomic-x%20-core%20-a-p-i/io.trtc.tuikit.atomicxcore.api.view/-live-core-view/index.html)</td>
|
|
757
|
-
</tr>
|
|
758
|
-
|
|
759
|
-
<tr>
|
|
760
|
-
<td rowspan="1" colSpan="1" >DeviceStore</td>
|
|
761
|
-
|
|
762
|
-
<td rowspan="1" colSpan="1" >音视频设备控制:麦克风(开关 / 音量)、摄像头(开关 / 切换 / 画质)、屏幕共享,设备状态实时监听。</td>
|
|
763
|
-
|
|
764
|
-
<td rowspan="1" colSpan="1" >[API 文档](https://tencent-rtc.github.io/TUIKit_Android/-atomic-x%20-core%20-a-p-i/io.trtc.tuikit.atomicxcore.api.device/-device-store/index.html)</td>
|
|
765
|
-
</tr>
|
|
766
|
-
|
|
767
|
-
<tr>
|
|
768
|
-
<td rowspan="1" colSpan="1" >CoHostStore</td>
|
|
769
|
-
|
|
770
|
-
<td rowspan="1" colSpan="1" >主播跨房连线:支持多布局模板(动态网格等),发起 / 接受 / 拒绝连线,连麦主播互动管理。</td>
|
|
771
|
-
|
|
772
|
-
<td rowspan="1" colSpan="1" >[API 文档](https://tencent-rtc.github.io/TUIKit_Android/-atomic-x%20-core%20-a-p-i/io.trtc.tuikit.atomicxcore.api.live/-co-host-store/index.html)</td>
|
|
773
|
-
</tr>
|
|
774
|
-
|
|
775
|
-
<tr>
|
|
776
|
-
<td rowspan="1" colSpan="1" >BattleStore</td>
|
|
777
|
-
|
|
778
|
-
<td rowspan="1" colSpan="1" >主播 PK 对战:发起 PK(配置时长 / 对手),管理 PK 状态(开始 / 结束),同步分数,监听对战结果。</td>
|
|
779
|
-
|
|
780
|
-
<td rowspan="1" colSpan="1" >[API 文档](https://tencent-rtc.github.io/TUIKit_Android/-atomic-x%20-core%20-a-p-i/io.trtc.tuikit.atomicxcore.api.live/-battle-store/index.html)</td>
|
|
781
|
-
</tr>
|
|
782
|
-
</table>
|
|
783
|
-
|
|
534
|
+
| Store/Component | 功能描述 | API 文档 |
|
|
535
|
+
| --- | --- | --- |
|
|
536
|
+
| LiveCoreView | 直播视频流展示与交互的核心视图组件:负责视频流渲染和视图挂件处理,支持主播直播、观众连麦、主播连线等场景。 | [API 文档](https://tencent-rtc.github.io/TUIKit_Android/-atomic-x%20-core%20-a-p-i/io.trtc.tuikit.atomicxcore.api.view/-live-core-view/index.html) |
|
|
537
|
+
| DeviceStore | 音视频设备控制:麦克风(开关 / 音量)、摄像头(开关 / 切换 / 画质)、屏幕共享,设备状态实时监听。 | [API 文档](https://tencent-rtc.github.io/TUIKit_Android/-atomic-x%20-core%20-a-p-i/io.trtc.tuikit.atomicxcore.api.device/-device-store/index.html) |
|
|
538
|
+
| CoHostStore | 主播跨房连线:支持多布局模板(动态网格等),发起 / 接受 / 拒绝连线,连麦主播互动管理。 | [API 文档](https://tencent-rtc.github.io/TUIKit_Android/-atomic-x%20-core%20-a-p-i/io.trtc.tuikit.atomicxcore.api.live/-co-host-store/index.html) |
|
|
539
|
+
| BattleStore | 主播 PK 对战:发起 PK(配置时长 / 对手),管理 PK 状态(开始 / 结束),同步分数,监听对战结果。 | [API 文档](https://tencent-rtc.github.io/TUIKit_Android/-atomic-x%20-core%20-a-p-i/io.trtc.tuikit.atomicxcore.api.live/-battle-store/index.html) |
|
|
784
540
|
|
|
785
541
|
## 常见问题
|
|
786
542
|
|
|
@@ -789,7 +545,6 @@
|
|
|
789
545
|
|
|
790
546
|
- 检查网络连接是否通畅,邀请信令有30秒的默认超时时间。
|
|
791
547
|
|
|
792
|
-
|
|
793
548
|
### 连线或PK过程中,一方主播网络断开或App崩溃了怎么办?
|
|
794
549
|
|
|
795
550
|
**CoHostStore** 和 **BattleStore** 内部都有心跳和超时检测机制。如果一方异常退出,另一方会通过 **onCoHostUserLeft** 或 **onUserExitBattle** 等事件收到通知,您可以根据这些事件来处理UI,例如提示"对方已掉线"并结束互动。
|
|
@@ -803,8 +558,6 @@
|
|
|
803
558
|
|
|
804
559
|
- **灵活适配规则**:后端改配置(例如调整礼物对应分数、加成分数)即可适配业务变化,无需改前端,降低迭代成本。
|
|
805
560
|
|
|
806
|
-
|
|
807
561
|
### 如何管理通过 `VideoViewAdapter` 添加的自定义视图的生命周期和事件?
|
|
808
562
|
|
|
809
563
|
**LiveCoreView** 会自动管理您通过适配器方法返回视图的添加和移除,您无需手动处理。如果需要在自定义视图中处理用户交互(例如点击事件),请在创建视图时为其添加相应的事件即可。
|
|
810
|
-
|