@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
|
@@ -0,0 +1,362 @@
|
|
|
1
|
+
`GiftState` 是 `AtomicXCore` 中专门负责管理直播间礼物功能的模块。通过它,您可以为您的直播应用构建一套完整的礼物系统,实现丰富的营收和互动场景。
|
|
2
|
+
| 礼物面板 | 弹幕礼物 | 全屏礼物 |
|
|
3
|
+
| --- | --- | --- |
|
|
4
|
+
| | | |
|
|
5
|
+
|
|
6
|
+
## 核心功能
|
|
7
|
+
- **礼物列表获取**:从服务端拉取礼物面板所需的数据,包括礼物分类和礼物详情。
|
|
8
|
+
|
|
9
|
+
- **发送礼物**:观众可以向主播发送选定的礼物,并附带数量。
|
|
10
|
+
|
|
11
|
+
- **礼物事件广播**:实时接收房间内发生的礼物赠送事件,用于展示礼物动画和弹幕通知。
|
|
12
|
+
|
|
13
|
+
## 实现步骤
|
|
14
|
+
|
|
15
|
+
### 步骤1:组件集成
|
|
16
|
+
|
|
17
|
+
> **说明:**
|
|
18
|
+
>
|
|
19
|
+
|
|
20
|
+
> 使用**礼物系统**要求开通TUILiveKit **多人连麦版**、**大规模直播版**,不同套餐中可配置的礼物数量有所不同,详细参见 功能与计费说明 中的**礼物系统**说明。
|
|
21
|
+
>
|
|
22
|
+
|
|
23
|
+
- **视频直播**:请参考 快速接入 集成 **AtomicXCore**,完成接入。
|
|
24
|
+
|
|
25
|
+
- **语聊房**:请参考 快速接入 集成 **AtomicXCore**,完成接入。
|
|
26
|
+
|
|
27
|
+
### 步骤2:初始化并监听礼物事件
|
|
28
|
+
|
|
29
|
+
获取 `GiftState` 实例,并设置订阅者以接收礼物事件和礼物列表更新。
|
|
30
|
+
|
|
31
|
+
#### 实现方式:
|
|
32
|
+
1. **获取实例**:使用 `useGiftState(liveID)` 获取与当前直播间绑定的 `GiftState` 实例。
|
|
33
|
+
|
|
34
|
+
2. **订阅事件**:使用 `addGiftListener` 以订阅 `'onReceiveGift'`事件。
|
|
35
|
+
|
|
36
|
+
3. **监听状态**:监听 响应式数据`usableGifts `礼物列表,来驱动 `UI` 更新。
|
|
37
|
+
|
|
38
|
+
#### 代码示例:
|
|
39
|
+
``` typescript
|
|
40
|
+
import { useGiftState } from "@/uni_modules/tuikit-atomic-x/state/GiftState";
|
|
41
|
+
import { onMounted, watch } from 'vue';
|
|
42
|
+
|
|
43
|
+
// liveID 是语聊房的唯一标识
|
|
44
|
+
const liveID = 'your_live_id'; // 替换为实际的语聊房 liveID
|
|
45
|
+
|
|
46
|
+
// 通过 liveID 获取 GiftState 的实例
|
|
47
|
+
const { addGiftListener, usableGifts } = useGiftState(liveID);
|
|
48
|
+
|
|
49
|
+
onMounted(() => {
|
|
50
|
+
addGiftListener(liveID, 'onReceiveGift', {
|
|
51
|
+
callback: (event) => {
|
|
52
|
+
const gift = JSON.parse(event)
|
|
53
|
+
console.log('收到礼物', gift)
|
|
54
|
+
// 在此进行礼物的处理逻辑,例如 svga 格式的礼物进行播放,其他格式的进行弹窗提示
|
|
55
|
+
}
|
|
56
|
+
})
|
|
57
|
+
})
|
|
58
|
+
|
|
59
|
+
// 监听 usableGifts 的实时变更,用于驱动 UI 变更
|
|
60
|
+
watch(usableGifts, (newVal, oldVal) => {
|
|
61
|
+
console.log(newVal)
|
|
62
|
+
})
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
#### 礼物列表结构体参数
|
|
66
|
+
- `GiftCategory`**参数说明**
|
|
67
|
+
|
|
68
|
+
| **参数** | **类型** | **描述** |
|
|
69
|
+
| --- | --- | --- |
|
|
70
|
+
| `categoryID` | `string` | 礼物分类的唯一 ID。 |
|
|
71
|
+
| `name` | `string` | 礼物分类的显示名称。 |
|
|
72
|
+
| `desc` | `string` | 礼物分类的描述信息。 |
|
|
73
|
+
| `extensionInfo` | `[string: string]` | 扩展信息字段。 |
|
|
74
|
+
| `giftList` | `[string]` | 该分类下包含的 Gift 礼物对象数组。 |
|
|
75
|
+
|
|
76
|
+
- `Gift`** 参数说明**
|
|
77
|
+
|
|
78
|
+
| **参数** | **类型** | **描述** |
|
|
79
|
+
| --- | --- | --- |
|
|
80
|
+
| `giftID` | `string` | 礼物的唯一 ID。 |
|
|
81
|
+
| `name` | `string` | 礼物的显示名称。 |
|
|
82
|
+
| `desc` | `string` | 礼物的描述信息。 |
|
|
83
|
+
| `iconURL` | `string` | 礼物图标 URL。 |
|
|
84
|
+
| `resourceURL` | `string` | 礼物动画资源 URL。 |
|
|
85
|
+
| `level` | `number` | 礼物等级。 |
|
|
86
|
+
| `coins` | `number` | 礼物价格。 |
|
|
87
|
+
| `extensionInfo` | `[string: string]` | 扩展信息字段。 |
|
|
88
|
+
|
|
89
|
+
### 步骤3:获取礼物列表
|
|
90
|
+
|
|
91
|
+
调用 `refreshUsableGifts` 方法,从服务端拉取礼物数据。
|
|
92
|
+
|
|
93
|
+
#### 实现方式:
|
|
94
|
+
1. **调用接口**:在合适的时机(例如页面加载时)调用 `refreshUsableGifts()`。
|
|
95
|
+
|
|
96
|
+
2. **处理回调**:可选地处理 `success`,`fail` 回调以获知拉取结果。
|
|
97
|
+
|
|
98
|
+
3. **接收数据**:拉取成功后,通过步骤二中对 `usableGifts` 的监听,自动接收到更新后的 `usableGifts` 列表。
|
|
99
|
+
|
|
100
|
+
#### 代码示例:
|
|
101
|
+
``` typescript
|
|
102
|
+
import { useGiftState } from "@/uni_modules/tuikit-atomic-x/state/GiftState";
|
|
103
|
+
import { onMounted } from 'vue';
|
|
104
|
+
|
|
105
|
+
// liveID 是语聊房的唯一标识
|
|
106
|
+
const liveID = 'your_live_id'; // 替换为实际的语聊房 liveID
|
|
107
|
+
|
|
108
|
+
// 通过 liveID 获取 GiftState 的实例
|
|
109
|
+
const { addGiftListener, usableGifts } = useGiftState(liveID);
|
|
110
|
+
|
|
111
|
+
onMounted(() => {
|
|
112
|
+
refreshUsableGifts({
|
|
113
|
+
liveID: 'xxx', // 当前直播间的 liveID
|
|
114
|
+
success: () => {
|
|
115
|
+
console.log('礼物列表拉取成功')
|
|
116
|
+
// 成功后,state 响应式数据会自动更新
|
|
117
|
+
},
|
|
118
|
+
faile: (error) => {
|
|
119
|
+
console.log('礼物列表拉取失败', error)
|
|
120
|
+
}
|
|
121
|
+
})
|
|
122
|
+
})
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
### 步骤4:发送礼物
|
|
126
|
+
|
|
127
|
+
当用户在礼物面板选择一个礼物并点击发送时,调用 `sendGift` 接口将礼物发送出去。
|
|
128
|
+
|
|
129
|
+
#### 实现方式:
|
|
130
|
+
1. **获取参数**:从 UI 获取用户选择的 `giftID` 和发送数量 `count`。
|
|
131
|
+
|
|
132
|
+
2. **调用接口**:调用 `sendGift(giftID,count)`。
|
|
133
|
+
|
|
134
|
+
3. **处理回调**:在 `fail` 回调中处理发送失败的情况(例如余额不足提示);发送成功后的 UI 更新(动画、弹幕)应由 `'onReceiveGift'` 事件驱动。
|
|
135
|
+
|
|
136
|
+
#### 代码示例:
|
|
137
|
+
``` typescript
|
|
138
|
+
|
|
139
|
+
import { useGiftState } from "@/uni_modules/tuikit-atomic-x/state/GiftState";
|
|
140
|
+
|
|
141
|
+
// liveID 是语聊房的唯一标识
|
|
142
|
+
const liveID = 'your_live_id'; // 替换为实际的语聊房 liveID
|
|
143
|
+
|
|
144
|
+
// 通过 liveID 获取 GiftState 的实例
|
|
145
|
+
const { sendGift } = useGiftState(liveID);
|
|
146
|
+
|
|
147
|
+
// 用户发送一个礼物
|
|
148
|
+
const sendGift = () => {
|
|
149
|
+
sendGift({
|
|
150
|
+
liveID: 'xxx', // 当前直播间 liveID
|
|
151
|
+
giftID: giftID,
|
|
152
|
+
count: 1,
|
|
153
|
+
success: () => {
|
|
154
|
+
console.log('礼物 ${giftID} 发送成功')
|
|
155
|
+
},
|
|
156
|
+
fail: (error) => {
|
|
157
|
+
console.log('礼物发送失败', error)
|
|
158
|
+
// 可以在此提示用户,例如“余额不足”或“网络错误”
|
|
159
|
+
},
|
|
160
|
+
})
|
|
161
|
+
}
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
#### `sendGift`接口参数
|
|
165
|
+
| **参数名** | **类型** | **描述** |
|
|
166
|
+
| --- | --- | --- |
|
|
167
|
+
| `liveID` | `string` | 当前直播间的`liveID`。 |
|
|
168
|
+
| `giftID` | `string` | 要发送的礼物的唯一 ID。 |
|
|
169
|
+
| `count` | `number` | 发送的数量。 |
|
|
170
|
+
| `success` | `Function` | 发送成功的回调。 |
|
|
171
|
+
| `fail` | `Function` | 发送失败的回调。 |
|
|
172
|
+
|
|
173
|
+
## 功能进阶
|
|
174
|
+
|
|
175
|
+
`GiftState` 的功能高度依赖于您的业务后台服务。本章将指导您如何通过服务端配置和客户端实现,构建功能丰富、体验卓越的礼物互动系统。
|
|
176
|
+
|
|
177
|
+
### **礼物素材配置**
|
|
178
|
+
|
|
179
|
+
您需要自定义直播间可用的礼物种类、分类、名称、图标、价格以及动画效果,以满足运营需求和品牌特色。
|
|
180
|
+
|
|
181
|
+
#### **实现方式 **
|
|
182
|
+
1. **服务端配置**:使用 LiveKit 服务端 REST API 管理礼物信息、分类、多语言等。请参考 [礼物配置指引文档](https://cloud.tencent.com/document/product/647/121321)。
|
|
183
|
+
|
|
184
|
+
2. **客户端拉取**:在客户端调用 `refreshUsableGifts` 获取配置数据。
|
|
185
|
+
|
|
186
|
+
3. **UI 展示**:使用拉取到的 `[GiftCategory]` 数据填充礼物面板。
|
|
187
|
+
|
|
188
|
+
#### **配置时序图**
|
|
189
|
+
|
|
190
|
+
#### **涉及 REST API 接口一览**
|
|
191
|
+
| 接口分类 | 接口 | 请求示例 |
|
|
192
|
+
| --- | --- | --- |
|
|
193
|
+
| 礼物管理 | 添加礼物信息 | 请求示例 |
|
|
194
|
+
| 删除礼物信息 | 请求示例 | |
|
|
195
|
+
| 查询礼物信息 | 请求示例 | |
|
|
196
|
+
| 礼物分类管理 | 添加礼物分类信息 | 请求示例 |
|
|
197
|
+
| 删除指定礼物分类信息 | 请求示例 | |
|
|
198
|
+
| 获取指定礼物分类信息 | 请求示例 | |
|
|
199
|
+
| 礼物关系管理 | 添加指定礼物分类和礼物间的关系 | 请求示例 |
|
|
200
|
+
| 删除指定礼物分类和礼物间的关系 | 请求示例 | |
|
|
201
|
+
| 获取指定礼物分类下的礼物关系 | 请求示例 | |
|
|
202
|
+
| 礼物多语言管理 | 添加礼物多语言信息 | 请求示例 |
|
|
203
|
+
| 删除指定礼物多语言信息 | 请求示例 | |
|
|
204
|
+
| 获取礼物多语言信息 | 请求示例 | |
|
|
205
|
+
| 添加礼物分类多语言信息 | 请求示例 | |
|
|
206
|
+
| 删除指定礼物分类多语言信息 | 请求示例 | |
|
|
207
|
+
| 获取礼物分类多语言信息 | 请求示例 | |
|
|
208
|
+
|
|
209
|
+
### 计费与送礼扣费流程
|
|
210
|
+
|
|
211
|
+
当观众赠送礼物时,需要确保其账户余额充足,并完成实际的扣费操作,然后才能触发礼物特效的播放和广播。
|
|
212
|
+
|
|
213
|
+
#### 实现方式
|
|
214
|
+
1. **后台配置回调**:在 LiveKit 后台配置您的自建计费系统的回调 URL。参考 回调配置文档。
|
|
215
|
+
|
|
216
|
+
2. **客户端发送**:客户端调用 `sendGift`。
|
|
217
|
+
|
|
218
|
+
3. **后台交互**:LiveKit 后台调用您的回调 URL,您的计费系统执行扣费并返回结果。
|
|
219
|
+
|
|
220
|
+
4. **结果同步**:扣费成功,AtomicXCore 广播 `'onReceiveGift'` 事件。扣费失败,`sendGift` 的 `fail` 收到错误。
|
|
221
|
+
|
|
222
|
+
#### 调用流程图
|
|
223
|
+
|
|
224
|
+
#### 涉及 REST API 接口一览
|
|
225
|
+
| 接口 | 说明 | 请求示例 |
|
|
226
|
+
| --- | --- | --- |
|
|
227
|
+
| 回调配置 - 发送礼物之前回调 | 客户后台可以通过该回调决定是否通过送礼前校验等场景 | 调用示例 |
|
|
228
|
+
|
|
229
|
+
### 实现全屏礼物动画播放
|
|
230
|
+
|
|
231
|
+
当直播间有用户(包括自己)发送了“火箭”、“嘉年华”等豪华礼物时,全屏播放一个酷炫的礼物动画(例如 SVGA 动画),营造热烈的氛围。
|
|
232
|
+
|
|
233
|
+
#### 实现方式
|
|
234
|
+
|
|
235
|
+
`AtomicXCore` 本身包含礼物动画播放器,您可以根据业务需求选择并集成第三方库。以下是两种方案的对比:
|
|
236
|
+
| **对比项** | **内置方案 (SVGAPlayer)** | **高级方案 (TCEffectPlayerKit)** |
|
|
237
|
+
| --- | --- | --- |
|
|
238
|
+
| 计费 | 免费 | 付费 (需购买 License),请参见 [付费指引](https://cloud.tencent.com/document/product/616/116461) |
|
|
239
|
+
| 集成方式 | AtomicXCore 内置 | 需额外集成 TCEffectPlayerKit 并进行鉴权 |
|
|
240
|
+
| 动画格式支持 | 仅支持 SVGA | SVGA、PAG、WebP、Lottie、MP4 等多种格式 |
|
|
241
|
+
| 性能 | 建议 SVGA 文件 ≤ 10MB | 支持更大的动画文件,复杂特效/多动画并发/低端机表现更优 |
|
|
242
|
+
| 推荐场景 | 礼物动画格式统一为 SVGA,且文件大小可控 | 需要支持多种动画格式,或对动画性能/设备兼容性有更高要求 |
|
|
243
|
+
|
|
244
|
+
本章节主要演示基础方案的集成。如果您选择高级方案,请参考 [TCEffectPlayer 集成指引](https://cloud.tencent.com/document/product/616/116474)。
|
|
245
|
+
|
|
246
|
+
#### 基础方案实现:使用 SVGAPlayer
|
|
247
|
+
1. **使用 SVGAPlayer**:在您的项目中,引入 `svga-player `组件
|
|
248
|
+
|
|
249
|
+
``` typescript
|
|
250
|
+
<svga-player :url="xxx"></svga-player>
|
|
251
|
+
```
|
|
252
|
+
2. **监听礼物事件**:使用 `addGiftListener` 以订阅 `'onReceiveGift'`事件。
|
|
253
|
+
|
|
254
|
+
3. **解析并播放**:当收到 `'onReceiveGift'`事件时,检查 `gift.resourceURL`是否有效且指向一个 SVGA 文件。如果是,则将`gift.resourceURL`传给`svga-player` 进行播放
|
|
255
|
+
|
|
256
|
+
#### 代码示例
|
|
257
|
+
``` typescript
|
|
258
|
+
<template>
|
|
259
|
+
<svga-player :url="giftUrl"></svga-player>
|
|
260
|
+
</template>
|
|
261
|
+
|
|
262
|
+
<script setup lang="ts">
|
|
263
|
+
import { useGiftState } from "@/uni_modules/tuikit-atomic-x/state/GiftState";
|
|
264
|
+
import { onMounted } from 'vue';
|
|
265
|
+
|
|
266
|
+
// 通过 liveID 获取 GiftState 的实例
|
|
267
|
+
const { addGiftListener } = useGiftState(liveID);
|
|
268
|
+
const giftUrl = ref('')
|
|
269
|
+
|
|
270
|
+
onMounted(() => {
|
|
271
|
+
addGiftListener(liveID, 'onReceiveGift', {
|
|
272
|
+
callback: (event) => {
|
|
273
|
+
const gift = JSON.parse(event)
|
|
274
|
+
if( gift.resourceURL ) {
|
|
275
|
+
giftUrl.value = gift.resourceURL
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
})
|
|
279
|
+
})
|
|
280
|
+
</script>
|
|
281
|
+
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
### 在弹幕区展示礼物赠送消息
|
|
285
|
+
|
|
286
|
+
当有用户发送礼物时,不仅播放动画,同时在公屏弹幕区域显示一条系统消息,例如:“【观众昵称】送出了【礼物名称】x【数量】”,让所有观众都能看到。
|
|
287
|
+
|
|
288
|
+
#### 实现方式
|
|
289
|
+
1. **监听事件: **使用 `addGiftListener` 以订阅 `'onReceiveGift'`事件。
|
|
290
|
+
|
|
291
|
+
2. **获取弹幕 State**:使用 `useBarrageState(liveID)`获取与当前房间绑定的实例。
|
|
292
|
+
|
|
293
|
+
3. **拼接消息**:创建一条消息结构体,设置 `messageType = 'text'`,textContent 为拼接好的字符串(例如 “[`sender.userName`] 送出了 [`gift.name`] x [`count`]”)。
|
|
294
|
+
|
|
295
|
+
4. **本地插入**:调用 `barrageState`的`appendLocalTip(message: giftTip) `将消息插入本地列表。
|
|
296
|
+
|
|
297
|
+
#### 代码示例
|
|
298
|
+
``` typescript
|
|
299
|
+
import { useGiftState } from "@/uni_modules/tuikit-atomic-x/state/GiftState";
|
|
300
|
+
import { useBarrageState } from "@/uni_modules/tuikit-atomic-x/state/BarrageState";
|
|
301
|
+
import { onMounted } from 'vue';
|
|
302
|
+
|
|
303
|
+
// 通过 liveID 获取 GiftState 的实例
|
|
304
|
+
const { addGiftListener } = useGiftState(liveID);
|
|
305
|
+
// 通过 liveID 获取 BarrageState 的实例
|
|
306
|
+
const { appendLocalTip } = useBarrageState(liveID);
|
|
307
|
+
|
|
308
|
+
onMounted(() => {
|
|
309
|
+
addGiftListener(liveID, 'onReceiveGift', {
|
|
310
|
+
callback: (event) => {
|
|
311
|
+
const gift = JSON.parse(event)
|
|
312
|
+
let giftTip = {}
|
|
313
|
+
const tipText = "${ gift.sender.userName } 送出了 ${gift.name} x ${gift.count}"
|
|
314
|
+
giftTip.messageType = 'text'
|
|
315
|
+
giftTip.textContent = tipText
|
|
316
|
+
appendLocalTip({
|
|
317
|
+
liveID: 'xxx', // 当前直播间 liveID
|
|
318
|
+
message: giftTip
|
|
319
|
+
})
|
|
320
|
+
if( gift.resourceURL ) {
|
|
321
|
+
giftUrl.value = gift.resourceURL
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
})
|
|
325
|
+
})
|
|
326
|
+
</script>
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
## API 文档
|
|
330
|
+
|
|
331
|
+
关于 [GiftState](https://liteav.sdk.qcloud.com/doc/product/tuikit/atomic-x/uni-app/zh/v1.0/api/index.html#module-GiftState) 及其相关类的所有公开接口、属性和方法的详细信息,请参阅随 AtomicXCore 框架的官方 API 文档。本指南使用到的相关 Store 如下:
|
|
332
|
+
| **State** | **功能描述** | **API 文档** |
|
|
333
|
+
| --- | --- | --- |
|
|
334
|
+
| GiftState | 礼物互动:获取礼物列表,发送 / 接收礼物,监听礼物事件(含发送者、礼物详情)。 | [API 文档](https://liteav.sdk.qcloud.com/doc/product/tuikit/atomic-x/uni-app/zh/v1.0/api/index.html#module-GiftState) |
|
|
335
|
+
| BarrageState | 弹幕功能:发送文本 / 自定义弹幕,维护弹幕列表,实时监听弹幕状态。 | [API 文档](https://liteav.sdk.qcloud.com/doc/product/tuikit/atomic-x/uni-app/zh/v1.0/api/index.html#module-BarrageState) |
|
|
336
|
+
|
|
337
|
+
## 常见问题
|
|
338
|
+
|
|
339
|
+
### `GiftState` 的礼物列表是空的,我该怎么办?
|
|
340
|
+
|
|
341
|
+
您必须主动调用 `refreshUsableGifts()`来从您的业务后台拉取礼物数据。这些礼物数据需要在您的业务后台通过服务端 REST API 进行配置。
|
|
342
|
+
|
|
343
|
+
### 如何实现礼物的多语言展示(例如中文、英文)?
|
|
344
|
+
|
|
345
|
+
`GiftState` 提供了 `setLanguage(language: string)`接口。您可以在 `refreshUsableGifts` 之前调用此方法,传入目标语言代码(例如 "en" 或 "zh-CN")。服务端会根据此语言代码,返回对应语言的礼物名称和描述。
|
|
346
|
+
|
|
347
|
+
### 我调用 sendGift 发送了礼物,礼物动画为什么重复播放了两次?
|
|
348
|
+
|
|
349
|
+
`onReceiveGift` 事件是对房间内所有成员的广播(包括发送者自己)。如果您在 `sendGift` 的 `success` 成功回调里执行了一次UI操作,同时又在 `onReceiveGift` 订阅中执行了相同的 UI 操作,就会造成重复。
|
|
350
|
+
- **实践教程**:UI 的更新(例如播放动画、弹幕提示)只在 `onReceiveGift` 事件的订阅中处理。`sendGift` 的 `success` 回调仅用于处理发送失败的逻辑(例如提示用户“发送失败”或“余额不足”)。
|
|
351
|
+
|
|
352
|
+
### 礼物扣费逻辑在哪里实现?
|
|
353
|
+
|
|
354
|
+
礼物扣费逻辑完全由您的自建计费系统负责。`AtomicXCore` 通过后台回调机制与您的计费系统对接。客户端调用 `sendGift` 触发回调,您的后台服务完成扣费后,将结果返回给 `AtomicXCore` 后台,从而决定礼物事件是否广播。
|
|
355
|
+
|
|
356
|
+
### 送礼通知会被禁言或频控拦截吗?
|
|
357
|
+
|
|
358
|
+
不会。送礼通知(`'onReceiveGift'`事件)不受禁言或消息频控影响,确保可靠投递。
|
|
359
|
+
|
|
360
|
+
### 礼物动画播放卡顿怎么办?
|
|
361
|
+
|
|
362
|
+
请检查您的 `SVGA` 文件大小,基础播放器建议不要超过 10MB。如果文件过大或动画复杂,您可以考虑集成 `TUILiveKit` 提供的高级特效播放器,以获得更优的性能表现。
|
|
@@ -0,0 +1,323 @@
|
|
|
1
|
+
本文档将帮助开发者使用 `AtomicXCore SDK` 的 `LiveListState` 和 `LiveSeatState` 快速构建一个包含主播开播和观众进房功能的语聊房 `App`。
|
|
2
|
+
|
|
3
|
+
## 准备工作
|
|
4
|
+
|
|
5
|
+
### 步骤 1. 开通服务
|
|
6
|
+
|
|
7
|
+
请参见 开通服务,获取体验版或付费版 SDK。
|
|
8
|
+
|
|
9
|
+
### 步骤2. 导入 tuikit-atomic-x
|
|
10
|
+
1. **安装组件**:打开 [AtomicXCore SDK](https://ext.dcloud.net.cn/plugin?id=25488) ,单击**下载插件并导入HBuilderX**,选择需要集成的项目并单击**确定**。
|
|
11
|
+
|
|
12
|
+
2. **配置工程权限: **请在应用的 manifest.json 文件的app-plus > distribute 节点下,确保添加了以下必要的权限:
|
|
13
|
+
|
|
14
|
+
- Android 平台(`android`节点):在 `permissions` 数组中,请确保包含以下权限:
|
|
15
|
+
|
|
16
|
+
``` json
|
|
17
|
+
"<uses-permission android:name=\"android.permission.RECORD_AUDIO\" />"
|
|
18
|
+
```
|
|
19
|
+
- iOS 平台(ios 节点):在 `privacyDescription` 对象中,请确保包含以下描述:
|
|
20
|
+
|
|
21
|
+
``` json
|
|
22
|
+
"NSMicrophoneUsageDescription" : "应用需要访问您的麦克风以进行直播"
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
在 `UIBackgroundModes` 数组中,添加 `audio` 以支持后台播放音频。
|
|
26
|
+
|
|
27
|
+
``` json
|
|
28
|
+
"UIBackgroundModes" : [ "audio" ]
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### 步骤 3. 完成登录
|
|
32
|
+
|
|
33
|
+
在您的项目中调用 LoginState 中的 login 方法完成登录,**这是使用 **`AtomicXCore`** 所有功能的关键前提**。
|
|
34
|
+
|
|
35
|
+
> **重要:**
|
|
36
|
+
>
|
|
37
|
+
|
|
38
|
+
> 推荐在您 App 自身的用户账户登录成功后,再调用 LoginState 中的 login 方法,以确保登录业务逻辑的清晰和一致。
|
|
39
|
+
>
|
|
40
|
+
|
|
41
|
+
``` typescript
|
|
42
|
+
import { useLoginState } from "@/uni_modules/tuikit-atomic-x/state/LoginState";
|
|
43
|
+
|
|
44
|
+
const { login } = useLoginState();
|
|
45
|
+
|
|
46
|
+
const handleLogin = () => {
|
|
47
|
+
login({
|
|
48
|
+
sdkAppID: 1400000001, // 替换为您的 SDKAppID
|
|
49
|
+
userID: "test_001", // 替换为您的 UserID
|
|
50
|
+
userSig: "xxxxxxxxxx" // 替换为您的 UserSig
|
|
51
|
+
})
|
|
52
|
+
}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
**登录接口参数说明:**
|
|
56
|
+
| 参数 | 类型 | 说明 |
|
|
57
|
+
| --- | --- | --- |
|
|
58
|
+
| sdkAppID | number | 从 [控制台](https://console.cloud.tencent.com/trtc)获取,通常是以 `140` 或 `160` 开头的 10 位整数。 |
|
|
59
|
+
| userID | string | 当前用户的唯一 ID,仅包含英文字母、数字、连字符和下划线。为避免多端登录冲突,**请勿使用**`1`、`123`**等简单 ID**。 |
|
|
60
|
+
| userSig | string | 用于腾讯云鉴权的票据。请注意:<br>- 开发环境:您可以采用本地 `GenerateTestUserSig.genTestSig` 函数生成 userSig 或者 通过 [UserSig 辅助工具](https://console.cloud.tencent.com/im/tool-usersig) 生成临时的 UserSig。<br>- 生产环境:为了防止密钥泄露,请务必采用服务端生成 UserSig 的方式。详细信息请参考 [服务端生成 UserSig](https://cloud.tencent.com/document/product/647/17275)。<br>更多信息请参见 [如何计算及使用 UserSig](https://cloud.tencent.com/document/product/647/17275)。 |
|
|
61
|
+
|
|
62
|
+
## 搭建语音聊天室
|
|
63
|
+
|
|
64
|
+
### 步骤1:实现房主创建语聊房
|
|
65
|
+
|
|
66
|
+
房主开播流程如下,您只需执行以下几步操作,即可快速搭建一个语聊房。
|
|
67
|
+
|
|
68
|
+
#### **1. 初始化麦位 **`State`
|
|
69
|
+
|
|
70
|
+
在您的房主页面中,创建一个 `LiveSeatState` 实例。您需要监听响应式数据的变化,以实时获取麦位数据来渲染您的 `UI`。
|
|
71
|
+
``` typescript
|
|
72
|
+
import { watch } from 'vue';
|
|
73
|
+
import { useLiveSeatState } from '@/uni_modules/tuikit-atomic-x/state/LiveSeatState';
|
|
74
|
+
|
|
75
|
+
// 定义直播间 ID(需要与后续 createLive 中使用的 liveID 保持一致)
|
|
76
|
+
const liveID = 'your_live_room_id'; // 替换为您的直播间 ID
|
|
77
|
+
|
|
78
|
+
// 使用 liveID 获取 LiveSeatState 实例
|
|
79
|
+
const { seatList } = useLiveSeatState(liveID);
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
#### **2. 打开麦克风**
|
|
83
|
+
|
|
84
|
+
通过调用 `DeviceState` 的 `openLocalMicrophone` 接口打开麦克风,示例代码如下:
|
|
85
|
+
``` typescript
|
|
86
|
+
import { useDeviceState } from "@/uni_modules/tuikit-atomic-x/state/DeviceState";
|
|
87
|
+
|
|
88
|
+
const { openLocalMicrophone } = useDeviceState();
|
|
89
|
+
|
|
90
|
+
const openMic = () => {
|
|
91
|
+
openLocalMicrophone()
|
|
92
|
+
}
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
#### **3. 开始语聊**
|
|
96
|
+
|
|
97
|
+
通过调用 `LiveListState` 的 `createLive` 接口开始语聊房直播,完整示例代码如下:
|
|
98
|
+
``` typescript
|
|
99
|
+
import { useLiveListState } from '@/uni_modules/tuikit-atomic-x/state/LiveListState';
|
|
100
|
+
|
|
101
|
+
// 获取 LiveListState 实例
|
|
102
|
+
const { createLive } = useLiveListState();
|
|
103
|
+
|
|
104
|
+
// 开始直播
|
|
105
|
+
const startLive = () => {
|
|
106
|
+
createLive({
|
|
107
|
+
liveInfo: {
|
|
108
|
+
liveID: 'xxx', // 设置直播的房间 id
|
|
109
|
+
liveName: 'text', // 设置直播的房间名称
|
|
110
|
+
keepOwnerOnSeat: true, // 配置主播始终在麦位上
|
|
111
|
+
isSeatEnabled: true,
|
|
112
|
+
seatLayoutTemplateID: 70, // 麦位布局模板(例如 70 为 10 麦位模板)
|
|
113
|
+
seatMode: 'APPLY' // 上麦模式,例如申请上麦
|
|
114
|
+
maxSeatCount: 10 // 最大麦位数
|
|
115
|
+
},
|
|
116
|
+
success: () => {
|
|
117
|
+
console.log('创建直播间成功')
|
|
118
|
+
//您可以在这里进行页面的跳转
|
|
119
|
+
},
|
|
120
|
+
fail: (error) => {
|
|
121
|
+
console.log('创建直播间失败', error)
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
};
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
`LiveInfo`**参数说明:**
|
|
128
|
+
| **参数名** | **类型** | **属性** | **描述** |
|
|
129
|
+
| --- | --- | --- | --- |
|
|
130
|
+
| `liveID` | `string` | 必填 | 直播间的唯一标识符 |
|
|
131
|
+
| `liveName` | `string` | 选填 | 直播间的标题 |
|
|
132
|
+
| `notice` | `string` | 选填 | 直播间的公告信息 |
|
|
133
|
+
| `isMessageDisable` | `boolean` | 选填 | 是否禁言(`true`:是,`false`:否) |
|
|
134
|
+
| `isPublicVisible` | `boolean` | 选填 | 是否公开可见(`true`:是,`false`:否) |
|
|
135
|
+
| `isSeatEnabled` | `boolean` | 选填 | 是否启用麦位功能(`true`:是,`false`:否) |
|
|
136
|
+
| `keepOwnerOnSeat` | `boolean` | 选填 | 是否保持房主在麦位上 |
|
|
137
|
+
| `maxSeatCount` | `number` | 必填 | 最大麦位数量 |
|
|
138
|
+
| `seatMode` | `string` | 选填 | 上麦模式(`'FREE'`:自由上麦,`'APPLY'`:申请上麦) |
|
|
139
|
+
| `seatLayoutTemplateID` | `number` | 必填 | 麦位布局模板 `ID` |
|
|
140
|
+
| `coverURL` | `string` | 选填 | 直播间的封面图片地址 |
|
|
141
|
+
| `backgroundURL` | `string` | 选填 | 直播间的背景图片地址 |
|
|
142
|
+
| `activityStatus` | `number` | 选填 | 直播活动状态 |
|
|
143
|
+
| `isGiftEnabled` | `boolean` | 选填 | 是否启用礼物功能(`true`:是,`false`:否) |
|
|
144
|
+
|
|
145
|
+
#### **4. 构建麦位 UI 界面**
|
|
146
|
+
|
|
147
|
+
通过 `LiveSeatState` 实例,监听 `seatList` 的变化,以实时获取麦位数据来渲染您的界面 UI 。您可以在主播页通过以下方式监听数据:
|
|
148
|
+
``` typescript
|
|
149
|
+
import { watch } from 'vue';
|
|
150
|
+
import { useLiveSeatState } from '@/uni_modules/tuikit-atomic-x/state/LiveSeatState';
|
|
151
|
+
|
|
152
|
+
// 使用 liveID 获取 LiveSeatState 实例
|
|
153
|
+
const { seatList } = useLiveSeatState(liveID);
|
|
154
|
+
|
|
155
|
+
watch( seatList ,(newSeatList) => {
|
|
156
|
+
console.log('新的麦位列表', newSeatList)
|
|
157
|
+
// 用这个数据来维护您的 UI
|
|
158
|
+
})
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
#### **5. 结束语聊**
|
|
162
|
+
|
|
163
|
+
语聊结束后,房主可以调用 `LiveListState` 的 `endLive` 接口结束语聊,`SDK` 会处理停止推流和销毁房间的逻辑。
|
|
164
|
+
``` typescript
|
|
165
|
+
import { useLiveListState } from '@/uni_modules/tuikit-atomic-x/state/LiveListState';
|
|
166
|
+
|
|
167
|
+
// 获取 LiveListState 实例
|
|
168
|
+
const { endLive } = useLiveListState();
|
|
169
|
+
|
|
170
|
+
// 结束直播
|
|
171
|
+
const handleEndLive = () => {
|
|
172
|
+
endLive({
|
|
173
|
+
success: () => {
|
|
174
|
+
console.log('结束直播成功')
|
|
175
|
+
//您可以在这里进行页面的跳转
|
|
176
|
+
},
|
|
177
|
+
fail: (error) => {
|
|
178
|
+
console.log('结束直播失败', error)
|
|
179
|
+
}
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
### 步骤2:实现观众进入语聊房
|
|
185
|
+
|
|
186
|
+
观众进房流程如下,通过简单几步操作,即可实现观众进入语聊房
|
|
187
|
+
|
|
188
|
+
#### **1. 初始化麦位 **`State`
|
|
189
|
+
|
|
190
|
+
在您的观众页面 中,创建 `LiveSeatState` 实例,并监听 `seatList` 的变化,以渲染麦位 `UI` 。
|
|
191
|
+
``` typescript
|
|
192
|
+
import { watch } from 'vue';
|
|
193
|
+
import { useLiveSeatState } from '@/uni_modules/tuikit-atomic-x/state/LiveSeatState';
|
|
194
|
+
|
|
195
|
+
// 观众进房前,需要先获取要加入的直播间 ID(liveID)。通常有以下几种方式:
|
|
196
|
+
// 通过房间列表选择(可从 LiveListState 的 liveList 数据中获取)
|
|
197
|
+
// 使用 liveID 获取 LiveSeatState 实例
|
|
198
|
+
const { seatList } = useLiveSeatState(liveID);
|
|
199
|
+
|
|
200
|
+
watch(seatList,(newSeatList) => {
|
|
201
|
+
console.log('新的麦位列表', newSeatList)
|
|
202
|
+
// 用这个数据来维护您的 UI
|
|
203
|
+
})
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
#### **2. 进入语聊房**
|
|
207
|
+
|
|
208
|
+
通过调用 `LiveListState` 的 `joinLive` 接口加入语聊房,完整示例代码如下:
|
|
209
|
+
``` typescript
|
|
210
|
+
import { useLiveListState } from '@/uni_modules/tuikit-atomic-x/state/LiveListState';
|
|
211
|
+
|
|
212
|
+
// 获取 LiveListState 实例
|
|
213
|
+
const { joinLive } = useLiveListState();
|
|
214
|
+
|
|
215
|
+
// 加入直播
|
|
216
|
+
const handleJoinLive = () => {
|
|
217
|
+
joinLive({
|
|
218
|
+
liveID: 'xxx', // 想要加入语聊房的 liveID
|
|
219
|
+
success: () => {
|
|
220
|
+
console.log('成功进入语聊房')
|
|
221
|
+
//您可以在这里进行页面的跳转
|
|
222
|
+
},
|
|
223
|
+
fail: (error) => {
|
|
224
|
+
console.log('进入语聊房失败', error)
|
|
225
|
+
}
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
#### **3. 构建麦位 UI 界面**
|
|
231
|
+
|
|
232
|
+
观众构建麦位 UI的流程与主播完全一致,请参考主播 构建麦位 UI 界面
|
|
233
|
+
|
|
234
|
+
#### **4. 退出语聊房**
|
|
235
|
+
|
|
236
|
+
观众退出语聊房时,需要调用 `LiveListState` 的 `leaveLive` 接口来退出。
|
|
237
|
+
``` typescript
|
|
238
|
+
|
|
239
|
+
import { useLiveListState } from '@/uni_modules/tuikit-atomic-x/state/LiveListState';
|
|
240
|
+
|
|
241
|
+
// 获取 LiveListState 实例
|
|
242
|
+
const { leaveLive } = useLiveListState();
|
|
243
|
+
|
|
244
|
+
// 退出语聊房
|
|
245
|
+
const handleLeaveLive = () => {
|
|
246
|
+
leaveLive({
|
|
247
|
+
liveID: 'xxx', // 您当前加入语聊房的 liveID
|
|
248
|
+
success: () => {
|
|
249
|
+
console.log('退出语聊房成功')
|
|
250
|
+
//您可以在这里进行页面的跳转
|
|
251
|
+
},
|
|
252
|
+
fail: (error) => {
|
|
253
|
+
console.log('退出语聊房失败', error)
|
|
254
|
+
}
|
|
255
|
+
});
|
|
256
|
+
}
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
### 运行效果
|
|
260
|
+
|
|
261
|
+
完成上述步骤后,即可完成一个最基础的语聊直播场景。您可以参考 丰富语聊场景 来完善语聊场景。
|
|
262
|
+
|
|
263
|
+
## 功能进阶
|
|
264
|
+
|
|
265
|
+
### **实现麦上用户说话音浪**
|
|
266
|
+
|
|
267
|
+
在语聊房场景中,一个常见的需求是当麦上用户说话时,在其头像上显示一个波浪动画,以提示全房间用户“谁在说话”,`LiveSeatState` 提供了 `speakingUsers` 数据流,专门用于实现此功能。
|
|
268
|
+
|
|
269
|
+
#### 实现效果
|
|
270
|
+
|
|
271
|
+
在您构建的麦位 UI 界面中监听 `speakingUsers` 变化,并更新“正在说话”状态,代码示例如下
|
|
272
|
+
``` typescript
|
|
273
|
+
import { watch } from 'vue';
|
|
274
|
+
import { useLiveSeatState } from '@/uni_modules/tuikit-atomic-x/state/LiveSeatState';
|
|
275
|
+
|
|
276
|
+
// 使用 liveID 获取 LiveSeatState 实例
|
|
277
|
+
const { speakingUsers } = useLiveSeatState(liveID);
|
|
278
|
+
|
|
279
|
+
watch(speakingUsers,(newSpeaker) => {
|
|
280
|
+
console.log('正在说话的人', newSpeaker)
|
|
281
|
+
// 用这个数据和之前监听的 seatList 进行匹配来更新 UI
|
|
282
|
+
})
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
## 丰富语音聊天室场景
|
|
286
|
+
|
|
287
|
+
当您完成了基础的语音聊天室功能后,您可以参考以下功能指南来为语音聊天室添加丰富的互动玩法。
|
|
288
|
+
| **语音聊天室功能** | **功能介绍** | **功能 State** | **实现指南** |
|
|
289
|
+
| --- | --- | --- | --- |
|
|
290
|
+
| **实现观众音频连麦** | 观众申请上麦,与主播进行实时音频互动。 | [CoGuestState](https://liteav.sdk.qcloud.com/doc/product/tuikit/atomic-x/uni-app/zh/v1.0/api/index.html#module-CoGuestState) | 实现观众连麦 |
|
|
291
|
+
| **添加弹幕聊天功能** | 观众可以在语音聊天室发送和接收实时文字消息。 | [BarrageState](https://liteav.sdk.qcloud.com/doc/product/tuikit/atomic-x/uni-app/zh/v1.0/api/index.html#module-BarrageState) | 实现弹幕功能 |
|
|
292
|
+
| **构建礼物赠送系统** | 观众可以向主播赠送虚拟礼物,增加互动和趣味性。 | [GiftState](https://liteav.sdk.qcloud.com/doc/product/tuikit/atomic-x/uni-app/zh/v1.0/api/index.html#module-GiftState) | 实现礼物功能 |
|
|
293
|
+
| **添加设置音效功能** | 变声(童声 / 男声)、混响(KTV 等)、耳返调节,实时切换特效。 | [AudioEffectState](https://liteav.sdk.qcloud.com/doc/product/tuikit/atomic-x/uni-app/zh/v1.0/api/index.html#module-AudioEffectState) | 实现音效功能 |
|
|
294
|
+
|
|
295
|
+
## API 文档
|
|
296
|
+
| **State** | **功能描述** | **API 文档** |
|
|
297
|
+
| --- | --- | --- |
|
|
298
|
+
| **LiveListState** | 语音聊天室全生命周期管理:创建 / 加入 / 离开 / 销毁房间,查询房间列表,修改语音聊天室信息(名称、公告等),监听语音聊天室状态(如被踢出、结束)。 | [API 文档](https://liteav.sdk.qcloud.com/doc/product/tuikit/atomic-x/uni-app/zh/v1.0/api/index.html#module-LiveListState) |
|
|
299
|
+
| **DeviceState** | 音视频设备控制:麦克风(开关 / 音量),设备状态实时监听。 | [API 文档](https://liteav.sdk.qcloud.com/doc/product/tuikit/atomic-x/uni-app/zh/v1.0/api/index.html#module-DeviceState) |
|
|
300
|
+
| **CoGuestState** | 观众连麦管理:连麦申请 / 邀请 / 同意 / 拒绝,连麦成员权限控制(麦克风),状态同步。 | [API 文档](https://liteav.sdk.qcloud.com/doc/product/tuikit/atomic-x/uni-app/zh/v1.0/api/index.html#module-CoGuestState) |
|
|
301
|
+
| **CoHostState** | 主播跨房连线:支持多布局模板(动态网格等),发起 / 接受 / 拒绝连线,连麦主播互动管理。 | [API 文档](https://liteav.sdk.qcloud.com/doc/product/tuikit/atomic-x/uni-app/zh/v1.0/api/index.html#module-CoHostState) |
|
|
302
|
+
| **GiftState** | 礼物互动:获取礼物列表,发送 / 接收礼物,监听礼物事件(含发送者、礼物详情)。 | [API 文档](https://liteav.sdk.qcloud.com/doc/product/tuikit/atomic-x/uni-app/zh/v1.0/api/index.html#module-GiftState) |
|
|
303
|
+
| **BarrageState** | 弹幕功能:发送文本 / 自定义弹幕,维护弹幕列表,实时监听弹幕状态。 | [API 文档](https://liteav.sdk.qcloud.com/doc/product/tuikit/atomic-x/uni-app/zh/v1.0/api/index.html#module-BarrageState) |
|
|
304
|
+
| **LikeState** | 点赞互动:发送点赞,监听点赞事件,同步总点赞数。 | [API 文档](https://liteav.sdk.qcloud.com/doc/product/tuikit/atomic-x/uni-app/zh/v1.0/api/index.html#module-LikeState) |
|
|
305
|
+
| **LiveAudienceState** | 观众管理:获取实时观众列表( ID / 名称 / 头像),统计观众数量,监听观众进出事件。 | [API 文档](https://liteav.sdk.qcloud.com/doc/product/tuikit/atomic-x/uni-app/zh/v1.0/api/index.html#module-LiveAudienceState) |
|
|
306
|
+
| **AudioEffectState** | 音频特效:变声(童声 / 男声)、混响( KTV 等)、耳返调节,实时切换特效。 | [API 文档](https://liteav.sdk.qcloud.com/doc/product/tuikit/atomic-x/uni-app/zh/v1.0/api/index.html#module-AudioEffectState) |
|
|
307
|
+
|
|
308
|
+
## 常见问题
|
|
309
|
+
|
|
310
|
+
### 代码变更后,没有效果或者编译报错?
|
|
311
|
+
|
|
312
|
+
引入 uni_modules 后,需要重新制作自定义基座,详情参见 制作自定义基座流程。
|
|
313
|
+
|
|
314
|
+
### 原生能力集成问题
|
|
315
|
+
- 问题:插件调用失败或无响应。
|
|
316
|
+
|
|
317
|
+
- 解决方案:
|
|
318
|
+
|
|
319
|
+
- 必须打包自定义基座:在开发调试原生插件时,不能使用标准基座,必须通过 `HBuilderX` > 运行 > 运行到手机或模拟器 > 制作自定义基座,然后选择这个自定义基座来运行。
|
|
320
|
+
|
|
321
|
+
- 检查权限:如本文档“准备工作”中所述,`manifest.json` manifest.json必须声明相机、麦克风等权限。
|
|
322
|
+
|
|
323
|
+
- 查看原生日志:这是终极调试手段。通过 `Android Studio (Logcat)` 或 `Xcode (Console)` 查看设备的原生日志,通常能发现最直接的错误信息。
|