@tencentcloud/sdk-mcp 1.6.3 → 1.6.5
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 +0 -4
- package/knowledge/build-index.js +1 -1
- package/knowledge/chunker.js +81 -52
- package/knowledge/path-meta.js +181 -21
- package/knowledge/search/exact-lookup.js +166 -0
- package/knowledge/search/filter-pool.js +73 -19
- package/knowledge/search/product-scope-intent.js +2 -2
- package/knowledge/search/requires-framework.js +1 -1
- package/knowledge/search/search-knowledge.js +234 -57
- package/package.json +1 -1
- package/resource/_schema/feature-aliases.yaml +1 -0
- package/resource/integration/callkit/preset/android/integration.md +3 -5
- package/resource/integration/callkit/preset/flutter/integration.md +2 -3
- package/resource/integration/callkit/preset/ios/integration.md +2 -5
- package/resource/integration/callkit/preset/react/integration.md +12 -26
- package/resource/integration/callkit/preset/vue/integration.md +17 -33
- package/resource/integration/chat/preset/android/integration.md +44 -14
- package/resource/integration/chat/preset/flutter/integration.md +54 -13
- package/resource/integration/chat/preset/ios/integration.md +42 -6
- package/resource/integration/chat/preset/react/integration.md +30 -28
- package/resource/integration/chat/preset/uni-app/integration.md +101 -40
- package/resource/integration/chat/preset/vue/integration.md +62 -28
- package/resource/integration/livekit/preset/live/android/live-audience-integration.md +133 -0
- package/resource/integration/livekit/preset/live/android/live-host-integration.md +225 -0
- package/resource/integration/livekit/preset/live/android/live-list-integration.md +278 -0
- package/resource/integration/livekit/preset/live/android/prepare-integration.md +271 -0
- package/resource/integration/livekit/preset/live/ios/live-audience-integration.md +207 -0
- package/resource/integration/livekit/preset/live/ios/live-host-integration.md +358 -0
- package/resource/integration/livekit/preset/live/ios/live-list-integration.md +246 -0
- package/resource/integration/livekit/preset/live/ios/prepare-integration.md +218 -0
- package/resource/integration/livekit/preset/live/vue/live-list-integration.md +4 -7
- package/resource/integration/livekit/preset/live/vue/live-player-desk-integration.md +5 -12
- package/resource/integration/livekit/preset/live/vue/live-player-h5-integration.md +4 -11
- package/resource/integration/livekit/preset/live/vue/live-pusher-integration.md +250 -482
- package/resource/integration/roomkit/preset/vue/integration.md +399 -106
- package/resource/knowledge/callkit/best-practice/web/callengine-invitation.md +80 -0
- package/resource/knowledge/callkit/best-practice/web/callengine-log-control.md +20 -0
- package/resource/knowledge/callkit/best-practice/web/callkit-call-vs-calls.md +116 -0
- package/resource/knowledge/callkit/core-sdk/android/answer-call.md +11 -15
- package/resource/knowledge/callkit/core-sdk/android/make-call.md +10 -13
- package/resource/knowledge/callkit/core-sdk/android/offline-push.md +2 -4
- package/resource/knowledge/callkit/core-sdk/flutter/answer-call.md +10 -17
- package/resource/knowledge/callkit/core-sdk/flutter/make-call.md +11 -17
- package/resource/knowledge/callkit/core-sdk/flutter/offline-push.md +11 -20
- package/resource/knowledge/callkit/core-sdk/ios/answer-call.md +10 -15
- package/resource/knowledge/callkit/core-sdk/ios/make-call.md +9 -14
- package/resource/knowledge/callkit/core-sdk/ios/offline-push.md +12 -18
- package/resource/knowledge/callkit/core-sdk/miniprogram/call-engine.md +390 -0
- package/resource/knowledge/callkit/core-sdk/miniprogram/call-event.md +317 -0
- package/resource/knowledge/callkit/core-sdk/uni-app/answer-call.md +16 -22
- package/resource/knowledge/callkit/core-sdk/uni-app/make-call.md +17 -23
- package/resource/knowledge/callkit/core-sdk/web/call-engine.md +39 -0
- package/resource/knowledge/callkit/core-sdk/web/call-event.md +341 -0
- package/resource/knowledge/callkit/core-sdk/web/callengine-api-overview.md +39 -0
- package/resource/knowledge/callkit/faq/android.md +1 -5
- package/resource/knowledge/callkit/faq/common.md +10 -12
- package/resource/knowledge/callkit/faq/ios.md +5 -7
- package/resource/knowledge/callkit/faq/uniapp-app.md +7 -7
- package/resource/knowledge/callkit/faq/uniapp-miniprogram.md +9 -12
- package/resource/knowledge/callkit/faq/web.md +2 -12
- package/resource/knowledge/callkit/preset/android/api.md +5 -8
- package/resource/knowledge/callkit/preset/ios/api.md +4 -6
- package/resource/knowledge/callkit/preset/miniprogram/api.md +295 -0
- package/resource/knowledge/callkit/preset/react/api.md +622 -0
- package/resource/knowledge/callkit/preset/react/uikit-api-reference.md +475 -0
- package/resource/knowledge/callkit/preset/vue/api.md +622 -0
- package/resource/knowledge/callkit/preset/vue/uikit-api-reference.md +587 -0
- package/resource/knowledge/callkit/preset/web/api.md +1 -1
- package/resource/knowledge/chat/best-practice/web/image-message-url-handling.md +16 -0
- package/resource/knowledge/chat/preset/android/features/chat-setting.md +1 -1
- package/resource/knowledge/chat/preset/android/features/conversation-list.md +0 -1
- package/resource/knowledge/chat/preset/android/features/language.md +2 -4
- package/resource/knowledge/chat/preset/android/features/message-input.md +1 -1
- package/resource/knowledge/chat/preset/android/features/message-list.md +1 -2
- package/resource/knowledge/chat/preset/android/features/search.md +0 -1
- package/resource/knowledge/chat/preset/android/features/theme.md +1 -1
- package/resource/knowledge/chat/preset/android-view/integration.md +35 -10
- package/resource/knowledge/chat/preset/flutter/features/conversation-list.md +0 -1
- package/resource/knowledge/chat/preset/flutter/features/language.md +1 -1
- package/resource/knowledge/chat/preset/flutter/features/message-list.md +0 -1
- package/resource/knowledge/chat/preset/flutter/features/search.md +4 -5
- package/resource/knowledge/chat/preset/flutter/features/theme.md +1 -1
- package/resource/knowledge/chat/preset/ios/features/chat-setting.md +1 -1
- package/resource/knowledge/chat/preset/ios/features/conversation-list.md +0 -1
- package/resource/knowledge/chat/preset/ios/features/language.md +2 -5
- package/resource/knowledge/chat/preset/ios/features/message-list.md +0 -1
- package/resource/knowledge/chat/preset/ios/features/search.md +0 -1
- package/resource/knowledge/chat/preset/ios/features/theme.md +1 -1
- package/resource/knowledge/chat/preset/ios-uikit/integration.md +57 -166
- package/resource/knowledge/chat/preset/react/features/chat-setting.md +0 -1
- package/resource/knowledge/chat/preset/react/features/conversation-actions.md +3 -3
- package/resource/knowledge/chat/preset/react/features/conversation-list.md +3 -3
- package/resource/knowledge/chat/preset/react/features/conversation-preview.md +1 -1
- package/resource/knowledge/chat/preset/react/features/message-input.md +2 -3
- package/resource/knowledge/chat/preset/react/features/search.md +0 -1
- package/resource/knowledge/chat/preset/vue/features/chat-header.md +1 -1
- package/resource/knowledge/chat/preset/vue/features/chat-setting.md +3 -4
- package/resource/knowledge/chat/preset/vue/features/conversation-list.md +4 -4
- package/resource/knowledge/chat/preset/vue/features/conversation-preview.md +1 -1
- package/resource/knowledge/chat/preset/vue/features/message-input.md +2 -2
- package/resource/knowledge/chat/preset/vue/features/message-list.md +2 -2
- package/resource/knowledge/chat/preset/vue/features/search.md +0 -1
- package/resource/knowledge/chat/preset/vue/features/theme.md +4 -4
- package/resource/knowledge/livekit/core-sdk/api-reference/android/AudioEffectStore.md +0 -7
- package/resource/knowledge/livekit/core-sdk/api-reference/android/BarrageStore.md +2 -5
- package/resource/knowledge/livekit/core-sdk/api-reference/android/BattleStore.md +12 -15
- package/resource/knowledge/livekit/core-sdk/api-reference/android/CameraView.md +0 -1
- package/resource/knowledge/livekit/core-sdk/api-reference/android/CoGuestStore.md +0 -5
- package/resource/knowledge/livekit/core-sdk/api-reference/android/CoHostStore.md +0 -3
- package/resource/knowledge/livekit/core-sdk/api-reference/android/DeviceStore.md +0 -2
- package/resource/knowledge/livekit/core-sdk/api-reference/android/GiftStore.md +2 -4
- package/resource/knowledge/livekit/core-sdk/api-reference/android/LikeStore.md +0 -2
- package/resource/knowledge/livekit/core-sdk/api-reference/android/LiveAudienceStore.md +0 -2
- package/resource/knowledge/livekit/core-sdk/api-reference/android/LiveCoreView.md +0 -1
- package/resource/knowledge/livekit/core-sdk/api-reference/android/LiveSeatStore.md +2 -4
- package/resource/knowledge/livekit/core-sdk/api-reference/android/LoginStore.md +1 -3
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/AudioEffectStore.md +0 -7
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/BarrageStore.md +3 -6
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/BaseBeautyStore.md +0 -1
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/BattleStore.md +12 -15
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/CoGuestStore.md +0 -5
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/CoHostStore.md +0 -3
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/DeviceStore.md +0 -2
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/GiftStore.md +2 -4
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/LikeStore.md +0 -2
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/LiveAudienceStore.md +0 -2
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/LiveCoreView.md +0 -1
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/LiveSeatStore.md +2 -4
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/LoginStore.md +1 -3
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/AudioEffectStore.md +0 -7
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/BarrageStore.md +2 -5
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/BaseBeautyStore.md +0 -1
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/BattleStore.md +3 -6
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/CoGuestStore.md +0 -5
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/CoHostStore.md +0 -3
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/DeviceStore.md +0 -2
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/GiftStore.md +2 -4
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/LikeStore.md +0 -2
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/LiveAudienceStore.md +0 -2
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/LiveCoreView.md +0 -1
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/LiveSeatStore.md +2 -4
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/LoginStore.md +1 -3
- package/resource/knowledge/livekit/core-sdk/api-reference/vue/capability-matrix.md +82 -0
- package/resource/knowledge/livekit/core-sdk/{voice/android/voice-audio-effect.md → features/android/audio-effect.md} +2 -4
- package/resource/knowledge/livekit/core-sdk/{live/android/live-barrage.md → features/android/barrage.md} +1 -1
- package/resource/knowledge/livekit/core-sdk/{live/android/live-base-beauty.md → features/android/base-beauty.md} +1 -1
- package/resource/knowledge/livekit/core-sdk/{voice/android/voice-gift.md → features/android/gift.md} +2 -3
- package/resource/knowledge/livekit/core-sdk/{live/android/live-live-list.md → features/android/live-list.md} +1 -1
- package/resource/knowledge/livekit/core-sdk/{live/flutter/live-audio-effect.md → features/flutter/audio-effect.md} +0 -2
- package/resource/knowledge/livekit/core-sdk/{voice/flutter/voice-barrage.md → features/flutter/barrage.md} +3 -3
- package/resource/knowledge/livekit/core-sdk/{voice/flutter/voice-gift.md → features/flutter/gift.md} +2 -2
- package/resource/knowledge/livekit/core-sdk/{voice/flutter/voice-room-list.md → features/flutter/live-list.md} +1 -1
- package/resource/knowledge/livekit/core-sdk/{voice/ios/voice-audience-list.md → features/ios/audience-list.md} +1 -1
- package/resource/knowledge/livekit/core-sdk/{voice/ios/voice-audio-effect.md → features/ios/audio-effect.md} +1 -3
- package/resource/knowledge/livekit/core-sdk/{voice/ios/voice-barrage.md → features/ios/barrage.md} +2 -2
- package/resource/knowledge/livekit/core-sdk/{live/ios/live-base-beauty.md → features/ios/base-beauty.md} +1 -1
- package/resource/knowledge/livekit/core-sdk/{live/ios/live-gift.md → features/ios/gift.md} +8 -9
- package/resource/knowledge/livekit/core-sdk/{live/ios/live-live-list.md → features/ios/live-list.md} +2 -2
- package/resource/knowledge/livekit/core-sdk/{voice/uni-app/voice-audio-effect.md → features/uni-app/audio-effect.md} +2 -3
- package/resource/knowledge/livekit/core-sdk/{voice/uni-app/voice-barrage.md → features/uni-app/barrage.md} +2 -2
- package/resource/knowledge/livekit/core-sdk/features/uni-app/base-beauty.md +145 -0
- package/resource/knowledge/livekit/core-sdk/{voice/uni-app/voice-gift.md → features/uni-app/gift.md} +6 -7
- package/resource/knowledge/livekit/core-sdk/{voice/uni-app/voice-room-list.md → features/uni-app/live-list.md} +1 -1
- package/resource/knowledge/livekit/core-sdk/live/android/{live-co-guest-interaction.md → co-guest-interaction.md} +2 -3
- package/resource/knowledge/livekit/core-sdk/live/android/{live-host-interaction.md → host-interaction.md} +2 -4
- package/resource/knowledge/livekit/core-sdk/live/android/{live-integration.md → integration.md} +6 -9
- package/resource/knowledge/livekit/core-sdk/live/flutter/{live-host-interaction.md → host-interaction.md} +1 -3
- package/resource/knowledge/livekit/core-sdk/live/flutter/{live-integration.md → integration.md} +1 -6
- package/resource/knowledge/livekit/core-sdk/live/ios/{live-co-guest-interaction.md → co-guest-interaction.md} +2 -3
- package/resource/knowledge/livekit/core-sdk/live/ios/{live-host-interaction.md → host-interaction.md} +3 -5
- package/resource/knowledge/livekit/core-sdk/live/ios/{live-integration.md → integration.md} +7 -10
- package/resource/knowledge/livekit/core-sdk/live/uni-app/co-guest-interaction.md +561 -0
- package/resource/knowledge/livekit/core-sdk/live/uni-app/host-interaction.md +323 -0
- package/resource/knowledge/livekit/core-sdk/live/uni-app/integration.md +312 -0
- package/resource/knowledge/livekit/core-sdk/voice/android/{voice-co-guest-interaction.md → co-guest-interaction.md} +3 -3
- package/resource/knowledge/livekit/core-sdk/voice/android/{voice-host-interaction.md → host-interaction.md} +2 -4
- package/resource/knowledge/livekit/core-sdk/voice/android/{voice-integration.md → integration.md} +11 -14
- package/resource/knowledge/livekit/core-sdk/voice/flutter/{voice-co-guest-interaction.md → co-guest-interaction.md} +0 -1
- package/resource/knowledge/livekit/core-sdk/voice/flutter/{voice-integration.md → integration.md} +1 -4
- package/resource/knowledge/livekit/core-sdk/voice/ios/{voice-co-guest-interaction.md → co-guest-interaction.md} +3 -3
- package/resource/knowledge/livekit/core-sdk/voice/ios/{voice-host-interaction.md → host-interaction.md} +2 -4
- package/resource/knowledge/livekit/core-sdk/voice/ios/{voice-integration.md → integration.md} +7 -10
- package/resource/knowledge/livekit/core-sdk/voice/uni-app/{voice-co-guest-interaction.md → co-guest-interaction.md} +6 -6
- package/resource/knowledge/livekit/core-sdk/voice/uni-app/{voice-integration.md → integration.md} +6 -7
- package/resource/knowledge/livekit/preset/live/vue/features/barrage.md +2 -3
- package/resource/knowledge/livekit/preset/live/vue/features/live-audience-list.md +1 -1
- package/resource/knowledge/livekit/preset/live/vue/features/live-view.md +1 -1
- package/resource/knowledge/push/api-reference/android.md +337 -0
- package/resource/knowledge/push/api-reference/donut.md +190 -0
- package/resource/knowledge/push/api-reference/flutter.md +176 -0
- package/resource/knowledge/push/api-reference/harmonyos.md +140 -0
- package/resource/knowledge/push/api-reference/ios.md +537 -0
- package/resource/knowledge/push/api-reference/react-native.md +154 -0
- package/resource/knowledge/push/api-reference/uni-app.md +148 -0
- package/resource/knowledge/push/api-reference/unity.md +119 -0
- package/resource/knowledge/push/api-reference/unreal-engine.md +123 -0
- package/resource/knowledge/push/config/android/fcm.md +1 -8
- package/resource/knowledge/push/config/android/honor.md +3 -7
- package/resource/knowledge/push/config/android/huawei.md +0 -5
- package/resource/knowledge/push/config/android/meizu.md +0 -5
- package/resource/knowledge/push/config/android/oppo.md +0 -4
- package/resource/knowledge/push/config/android/vivo.md +0 -4
- package/resource/knowledge/push/config/android/xiaomi.md +0 -2
- package/resource/knowledge/push/config/donut.md +33 -46
- package/resource/knowledge/push/config/harmonyos.md +6 -9
- package/resource/knowledge/push/config/ios.md +2 -9
- package/resource/knowledge/push/config/react-native.md +17 -25
- package/resource/knowledge/push/config/unity.md +16 -24
- package/resource/knowledge/push/config/unreal-engine.md +16 -24
- package/resource/knowledge/push/integration/android.md +21 -21
- package/resource/knowledge/push/integration/donut.md +24 -34
- package/resource/knowledge/push/integration/flutter.md +12 -1
- package/resource/knowledge/push/integration/harmonyos.md +2 -1
- package/resource/knowledge/push/integration/ios.md +16 -10
- package/resource/knowledge/push/integration/react-native.md +10 -14
- package/resource/knowledge/push/integration/uni-app.md +10 -6
- package/resource/knowledge/push/integration/unity.md +19 -22
- package/resource/knowledge/push/integration/unreal-engine.md +7 -9
- package/resource/knowledge/push/overview/prepare.md +2 -2
- package/resource/knowledge/roomkit/core-sdk/android/capability-matrix.md +46 -0
- package/resource/knowledge/roomkit/core-sdk/android/unsupported-features.md +82 -0
- package/resource/knowledge/roomkit/core-sdk/flutter/capability-matrix.md +46 -0
- package/resource/knowledge/roomkit/core-sdk/flutter/room-participant-state.md +1 -1
- package/resource/knowledge/roomkit/core-sdk/flutter/unsupported-features.md +82 -0
- package/resource/knowledge/roomkit/core-sdk/ios/capability-matrix.md +46 -0
- package/resource/knowledge/roomkit/core-sdk/ios/room-state.md +1 -1
- package/resource/knowledge/roomkit/core-sdk/ios/unsupported-features.md +82 -0
- package/resource/knowledge/roomkit/core-sdk/vue/call-user-to-room.md +1 -1
- package/resource/knowledge/roomkit/core-sdk/vue/device-state.md +0 -4
- package/resource/knowledge/roomkit/core-sdk/vue/free-beauty-panel.md +2 -5
- package/resource/knowledge/roomkit/core-sdk/vue/room-chat.md +0 -3
- package/resource/knowledge/roomkit/core-sdk/vue/room-participant-state.md +0 -2
- package/resource/knowledge/roomkit/core-sdk/vue/room-state.md +2 -6
- package/resource/knowledge/roomkit/core-sdk/vue/room-view.md +0 -1
- package/resource/knowledge/roomkit/core-sdk/vue/schedule-room.md +1 -1
- package/resource/knowledge/roomkit/core-sdk/vue/screen-share.md +2 -4
- package/resource/knowledge/roomkit/core-sdk/vue/virtual-background.md +2 -3
- package/resource/knowledge/roomkit/preset/android/integration.md +14 -16
- package/resource/knowledge/roomkit/preset/flutter/integration.md +9 -17
- package/resource/knowledge/roomkit/preset/ios/integration.md +9 -17
- package/resource/knowledge/roomkit/preset/react/integration.md +0 -4
- package/resource/knowledge/trtc/android/TRTCCloud.md +97 -180
- package/resource/knowledge/trtc/android/TRTCCloudDef.md +20 -20
- package/resource/knowledge/trtc/android/TRTCCloudListener.md +43 -77
- package/resource/knowledge/trtc/android/TRTCStatistics.md +1 -1
- package/resource/knowledge/trtc/android/TXAudioEffectManager.md +4 -24
- package/resource/knowledge/trtc/android/TXDeviceManager.md +2 -2
- package/resource/knowledge/trtc/android/TXLiteAVCode.md +1 -1
- package/resource/knowledge/trtc/c++/ITRTCCloud.md +96 -189
- package/resource/knowledge/trtc/c++/ITRTCStatistics.md +1 -1
- package/resource/knowledge/trtc/c++/ITXAudioEffectManager.md +1 -21
- package/resource/knowledge/trtc/c++/ITXDeviceManager.md +4 -6
- package/resource/knowledge/trtc/c++/TRTCCloudCallback.md +42 -76
- package/resource/knowledge/trtc/c++/TRTCTypeDef.md +18 -19
- package/resource/knowledge/trtc/c++/TXLiteAVCode.md +1 -1
- package/resource/knowledge/trtc/ios/TRTCCloud.md +95 -181
- package/resource/knowledge/trtc/ios/TRTCCloudDelegate.md +43 -78
- package/resource/knowledge/trtc/ios/TRTCStatistics.md +1 -1
- package/resource/knowledge/trtc/ios/TXAudioEffectManager.md +1 -20
- package/resource/knowledge/trtc/ios/TXDeviceManager.md +4 -6
- package/resource/knowledge/trtc/ios/TXLiteAVCode.md +1 -1
- package/resource/knowledge/trtc/ios/TXLiveSDKTypeDef.md +20 -20
- package/server-config.js +7 -4
- package/server.js +2 -2
- package/tools/common/finalize_answer.js +1 -1
- package/tools/common/present_framework_choice.js +2 -2
- package/tools/common/search_trtc_knowledge.js +3 -3
- package/tools/common/submit_feedback.js +1 -1
- package/tools/definitions/get_native_live_uikit_integration_def.js +60 -0
- package/tools/definitions/get_native_livekit_core_integration_def.js +1 -1
- package/tools/definitions/present_framework_choice_def.js +2 -2
- package/tools/definitions/search_trtc_knowledge_def.js +5 -5
- package/tools/index.js +2 -0
- package/tools/live/get_native_live_uikit_integration.js +69 -0
- package/tools/live/get_native_livekit_core_integration.js +6 -6
- package/utils/is-valid-sdkappid.js +4 -0
- package/utils/report-cls-client.js +1 -1
- package/utils/report-es-client.js +1 -1
- package/resource/index/component-slugs.json +0 -1
- package/resource/index/doc-source-urls.json +0 -1
- package/resource/index/manifest.json +0 -1
- package/resource/knowledge/livekit/core-sdk/live/android/live-audio-effect.md +0 -229
- package/resource/knowledge/livekit/core-sdk/live/android/live-gift.md +0 -459
- package/resource/knowledge/livekit/core-sdk/live/flutter/live-barrage.md +0 -506
- package/resource/knowledge/livekit/core-sdk/live/flutter/live-gift.md +0 -427
- package/resource/knowledge/livekit/core-sdk/live/flutter/live-live-list.md +0 -726
- package/resource/knowledge/livekit/core-sdk/live/ios/live-audience-list.md +0 -265
- package/resource/knowledge/livekit/core-sdk/live/ios/live-audio-effect.md +0 -214
- package/resource/knowledge/livekit/core-sdk/live/ios/live-barrage.md +0 -427
- package/resource/knowledge/livekit/core-sdk/voice/android/voice-audience-list.md +0 -272
- package/resource/knowledge/livekit/core-sdk/voice/android/voice-barrage.md +0 -486
- package/resource/knowledge/livekit/core-sdk/voice/android/voice-room-list.md +0 -523
- package/resource/knowledge/livekit/core-sdk/voice/flutter/voice-audience-list.md +0 -262
- package/resource/knowledge/livekit/core-sdk/voice/flutter/voice-audio-effect.md +0 -600
- package/resource/knowledge/livekit/core-sdk/voice/ios/voice-gift.md +0 -411
- package/resource/knowledge/livekit/core-sdk/voice/ios/voice-room-list.md +0 -404
- /package/resource/knowledge/livekit/core-sdk/api-reference/{web → vue}/index.md +0 -0
- /package/resource/knowledge/livekit/core-sdk/{live/android/live-audience-list.md → features/android/audience-list.md} +0 -0
- /package/resource/knowledge/livekit/core-sdk/{live/flutter/live-audience-list.md → features/flutter/audience-list.md} +0 -0
- /package/resource/knowledge/livekit/core-sdk/{live/flutter/live-base-beauty.md → features/flutter/base-beauty.md} +0 -0
- /package/resource/knowledge/livekit/core-sdk/{voice/uni-app/voice-audience-list.md → features/uni-app/audience-list.md} +0 -0
- /package/resource/knowledge/livekit/core-sdk/live/flutter/{live-co-guest-interaction.md → co-guest-interaction.md} +0 -0
|
@@ -0,0 +1,323 @@
|
|
|
1
|
+
**AtomicXCore** 提供了 [CoHostState](https://liteav.sdk.qcloud.com/doc/product/tuikit/atomic-x/uni-app/zh/v1.0/api/index.html#module-CoHostState) 核心模块,用于处理**跨房连线**。本文档将指导您如何组合使用该工具,来完成直播场景下连线的完整流程。
|
|
2
|
+
|
|
3
|
+
## 核心场景
|
|
4
|
+
|
|
5
|
+
一次完整的“主播连线”通常包含两个核心阶段,其整体流程如下:
|
|
6
|
+
|
|
7
|
+
## 实现步骤
|
|
8
|
+
|
|
9
|
+
### 步骤1:组件集成
|
|
10
|
+
|
|
11
|
+
请参考 开播与观看 集成 **AtomicXCore**,并完成 **LiveCoreView** 的接入。
|
|
12
|
+
|
|
13
|
+
### 步骤2:实现跨房连线
|
|
14
|
+
|
|
15
|
+
此步骤的目标是让两个主播的画面出现在同一个视图中,我们将使用 [CoHostState](https://liteav.sdk.qcloud.com/doc/product/tuikit/atomic-x/uni-app/zh/v1.0/api/index.html#module-CoHostState) 来完成。
|
|
16
|
+
|
|
17
|
+
#### 邀请方(主播 A)实现
|
|
18
|
+
1. **发起连线邀请**
|
|
19
|
+
|
|
20
|
+
当主播 A 在界面上选择目标主播 B 并发起连线时,调用 `requestHostConnection` 方法。
|
|
21
|
+
|
|
22
|
+
``` typescript
|
|
23
|
+
import { useCoHostState } from "@/uni_modules/tuikit-atomic-x/state/CoHostState"
|
|
24
|
+
|
|
25
|
+
const liveID = 'xxx' // 主播 A 的房间 ID
|
|
26
|
+
//通过 liveID 获取 CoHostState 的实例
|
|
27
|
+
const { requestHostConnection } = useCoHostState(liveID)
|
|
28
|
+
|
|
29
|
+
// 用户点击“连线”按钮,并选择了主播B
|
|
30
|
+
const inviteHostB = (targetHostLiveId: string) => {
|
|
31
|
+
requestHostConnection({
|
|
32
|
+
liveID, // 主播 A 的房间 ID
|
|
33
|
+
targetHostLiveID: targetHostLiveID, // 主播 B 的房间 ID
|
|
34
|
+
layoutTemplate: 'HOST_DYNAMIC_GRID', // 选择一个布局模版
|
|
35
|
+
timeout: 30, // 邀请超时时间
|
|
36
|
+
success: () => {
|
|
37
|
+
console.log("连线邀请已发送,等待对方处理...")
|
|
38
|
+
},
|
|
39
|
+
fail: (error) => {
|
|
40
|
+
console.log("邀请发送失败", error)
|
|
41
|
+
// 可以在这里进行弹窗提示
|
|
42
|
+
}
|
|
43
|
+
})
|
|
44
|
+
}
|
|
45
|
+
```
|
|
46
|
+
2. **监听邀请结果**
|
|
47
|
+
|
|
48
|
+
通过 `addCoHostListener` 订阅对应的事件,您可以接收到主播 B 的处理结果。
|
|
49
|
+
|
|
50
|
+
``` typescript
|
|
51
|
+
import { useCoHostState } from "@/uni_modules/tuikit-atomic-x/state/CoHostState"
|
|
52
|
+
import { onMounted } from 'vue';
|
|
53
|
+
|
|
54
|
+
const liveID = 'xxx' // 主播 A 的房间 ID
|
|
55
|
+
//通过 liveID 获取 CoHostState 的实例
|
|
56
|
+
const { addCoHostListener } = useCoHostState(liveID)
|
|
57
|
+
|
|
58
|
+
onMounted(() => {
|
|
59
|
+
addCoHostListener(liveID, 'onCoHostRequestAccepted', (event) => {
|
|
60
|
+
const result = JSON.parse(event)
|
|
61
|
+
console.log('主播同意了您的连线邀请')
|
|
62
|
+
})
|
|
63
|
+
addCoHostListener(liveID, 'onCoHostRequestRejected', (event) => {
|
|
64
|
+
const result = JSON.parse(event)
|
|
65
|
+
console.log('主播拒绝了您的连线邀请')
|
|
66
|
+
})
|
|
67
|
+
addCoHostListener(liveID, 'onCoHostRequestTimeout', () => {
|
|
68
|
+
console.log('邀请超时,对方未回应')
|
|
69
|
+
})
|
|
70
|
+
})
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
#### 受邀方(主播 B)实现
|
|
74
|
+
1. **接收连线邀请**
|
|
75
|
+
|
|
76
|
+
通过 `addCoHostListener` 订阅 `onCoHostRequestReceived` 事件,主播 B 可以监听到来自主播 A 的邀请。
|
|
77
|
+
|
|
78
|
+
``` typescript
|
|
79
|
+
import { useCoHostState } from "@/uni_modules/tuikit-atomic-x/state/CoHostState"
|
|
80
|
+
import { onMounted } from 'vue';
|
|
81
|
+
|
|
82
|
+
const liveID = 'xxx' // 主播 B 的房间 ID
|
|
83
|
+
//通过 liveID 获取 CoHostState 的实例
|
|
84
|
+
const { addCoHostListener } = useCoHostState(liveID)
|
|
85
|
+
|
|
86
|
+
onMounted(() => {
|
|
87
|
+
addCoHostListener(liveID, 'onCoHostRequestReceived', (event) => {
|
|
88
|
+
const result = JSON.parse(event)
|
|
89
|
+
console.log('收到连线邀请')
|
|
90
|
+
// 可以在这里进行弹窗提示
|
|
91
|
+
})
|
|
92
|
+
})
|
|
93
|
+
```
|
|
94
|
+
2. **响应连线邀请**
|
|
95
|
+
|
|
96
|
+
当主播 B 在弹出的对话框中做出选择后,调用相应的方法。
|
|
97
|
+
|
|
98
|
+
``` typescript
|
|
99
|
+
import { useCoHostState } from "@/uni_modules/tuikit-atomic-x/state/CoHostState"
|
|
100
|
+
import { onMounted } from 'vue';
|
|
101
|
+
|
|
102
|
+
const liveID = 'xxx' // 主播 B 的房间 ID
|
|
103
|
+
//通过 liveID 获取 CoHostState 的实例
|
|
104
|
+
const { acceptHostConnection, rejectHostConnection } = useCoHostState(liveID)
|
|
105
|
+
|
|
106
|
+
const acceptInvitation = () => {
|
|
107
|
+
acceptHostConnection({
|
|
108
|
+
liveID,
|
|
109
|
+
fromHostLiveId: 'xxx' // 从 onCoHostRequestReceived 事件中获取该数据
|
|
110
|
+
})
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
const rejectInvitation = () => {
|
|
114
|
+
rejectHostConnection({
|
|
115
|
+
liveID,
|
|
116
|
+
fromHostLiveId: 'xxx' // 从 onCoHostRequestReceived 事件中获取该数据
|
|
117
|
+
})
|
|
118
|
+
}
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
### 运行效果
|
|
122
|
+
|
|
123
|
+
当您集成以上功能实现后,请分别使用主播 A 和主播 B 进行对应操作,运行效果如下,您可以参考下一章节 完善 UI 细节 来定制您想要的 UI 逻辑。
|
|
124
|
+
|
|
125
|
+
## 完善 UI 细节
|
|
126
|
+
|
|
127
|
+
您可以通过修改源码的方式,在视频流画面上添加自定义视图,用于显示昵称、头像等信息,或在他们关闭摄像头时提供占位图,以优化视觉体验。
|
|
128
|
+
|
|
129
|
+
### 实现视频流画面的昵称显示
|
|
130
|
+
|
|
131
|
+
#### 实现效果
|
|
132
|
+
|
|
133
|
+
#### 实现方式
|
|
134
|
+
- 创建自定义 UI 覆盖层组件 (`ParticipantOverlay.vue`)
|
|
135
|
+
|
|
136
|
+
这个组件是我们的“UI 贴纸”,它只负责根据数据渲染 UI,不关心视频。
|
|
137
|
+
|
|
138
|
+
- 在您的 `components` 目录下,创建一个新文件 `ParticipantOverlay.vue`。
|
|
139
|
+
|
|
140
|
+
- 将以下代码复制到文件中。
|
|
141
|
+
|
|
142
|
+
``` typescript
|
|
143
|
+
<template>
|
|
144
|
+
<view class="overlay-container">
|
|
145
|
+
<!-- 遍历 seatList,为每个麦位成员创建独立的UI容器 -->
|
|
146
|
+
<view
|
|
147
|
+
v-for="participant in seatList"
|
|
148
|
+
:key="participant.userInfo.userID"
|
|
149
|
+
class="participant-ui-container"
|
|
150
|
+
:style="getParticipantStyle(participant)"
|
|
151
|
+
>
|
|
152
|
+
<!-- 条件渲染:根据摄像头状态显示不同UI -->
|
|
153
|
+
<!-- 1. 当摄像头关闭时,显示居中的头像和昵称 -->
|
|
154
|
+
<view v-if="participant.userInfo.cameraStatus === 'OFF'" class="avatar-placeholder">
|
|
155
|
+
<image class="avatar-image" :src="participant.userInfo.userAvatar || '/static/default-avatar.png'" mode="aspectFill"></image>
|
|
156
|
+
<text class="avatar-name">{{ participant.userInfo.userName || participant.userInfo.userID }}</text>
|
|
157
|
+
</view>
|
|
158
|
+
<!-- 2. 当摄像头开启时,显示左下角的昵称条 -->
|
|
159
|
+
<view v-if="participant.userInfo.cameraStatus === 'ON'" class="nickname-bar">
|
|
160
|
+
<text class="nickname-text">{{ participant.userInfo.userName || participant.userInfo.userID }}</text>
|
|
161
|
+
</view>
|
|
162
|
+
</view>
|
|
163
|
+
</view>
|
|
164
|
+
</template>
|
|
165
|
+
<script setup>
|
|
166
|
+
import { computed } from 'vue';
|
|
167
|
+
// 1. 接收来自父组件的核心数据:seatList 和 scale
|
|
168
|
+
const props = defineProps({
|
|
169
|
+
seatList: {
|
|
170
|
+
type: Array,
|
|
171
|
+
default: () => []
|
|
172
|
+
},
|
|
173
|
+
scale: {
|
|
174
|
+
type: Object,
|
|
175
|
+
default: () => ({ scaleX: 1, scaleY: 1 })
|
|
176
|
+
}
|
|
177
|
+
});
|
|
178
|
+
|
|
179
|
+
// 2. 定义一个方法来计算每个成员UI容器的精确位置和大小
|
|
180
|
+
const getParticipantStyle = (participant) => {
|
|
181
|
+
if (!participant || !participant.region) return {};
|
|
182
|
+
return {
|
|
183
|
+
position: 'absolute',
|
|
184
|
+
left: `${participant.region.x * props.scale.scaleX}px`,
|
|
185
|
+
top: `${participant.region.y * props.scale.scaleY}px`,
|
|
186
|
+
width: `${participant.region.w * props.scale.scaleX}px`,
|
|
187
|
+
height: `${participant.region.h * props.scale.scaleY}px`,
|
|
188
|
+
};
|
|
189
|
+
};
|
|
190
|
+
</script>
|
|
191
|
+
|
|
192
|
+
<style scoped>
|
|
193
|
+
.overlay-container {
|
|
194
|
+
pointer-events: none;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
.participant-ui-container {
|
|
198
|
+
overflow: hidden;
|
|
199
|
+
}
|
|
200
|
+
.avatar-placeholder {
|
|
201
|
+
display: flex;
|
|
202
|
+
flex-direction: column;
|
|
203
|
+
justify-content: center;
|
|
204
|
+
align-items: center;
|
|
205
|
+
background-color: #2E323A;
|
|
206
|
+
}
|
|
207
|
+
.avatar-image {
|
|
208
|
+
width: 160rpx;
|
|
209
|
+
height: 160rpx;
|
|
210
|
+
border-radius: 80rpx;
|
|
211
|
+
}
|
|
212
|
+
.avatar-name {
|
|
213
|
+
margin-top: 20rpx;
|
|
214
|
+
font-size: 28rpx;
|
|
215
|
+
color: #FFFFFF;
|
|
216
|
+
}
|
|
217
|
+
.nickname-bar {
|
|
218
|
+
position: absolute;
|
|
219
|
+
left: 10rpx;
|
|
220
|
+
bottom: 10rpx;
|
|
221
|
+
background-color: rgba(0, 0, 0, 0.5);
|
|
222
|
+
padding: 4rpx 16rpx;
|
|
223
|
+
border-radius: 20rpx;
|
|
224
|
+
}
|
|
225
|
+
.nickname-text {
|
|
226
|
+
color: #FFFFFF;
|
|
227
|
+
font-size: 24rpx;
|
|
228
|
+
}
|
|
229
|
+
</style>
|
|
230
|
+
```
|
|
231
|
+
- **步骤 2**:在直播间页面中组合所有组件
|
|
232
|
+
|
|
233
|
+
这是将视频层和 `UI` 层“叠”在一起的关键步骤,同时需要解决 `nvue` 的布局问题。
|
|
234
|
+
|
|
235
|
+
- 打开您的直播间页面文件
|
|
236
|
+
|
|
237
|
+
- 按照以下结构和样式进行修改。
|
|
238
|
+
|
|
239
|
+
``` typescript
|
|
240
|
+
<template>
|
|
241
|
+
<view class="page-container">
|
|
242
|
+
<view class="live-container">
|
|
243
|
+
<!-- 底层:视频渲染层 -->
|
|
244
|
+
<LiveCoreView
|
|
245
|
+
:liveID="xxx" // 对应直播间的 liveID
|
|
246
|
+
:viewType="xxx" // 主播端: PUSH_VIEW, 观众端: PLAY_VIEW
|
|
247
|
+
class="video-layer"
|
|
248
|
+
/>
|
|
249
|
+
<!-- 上层:自定义UI覆盖层 -->
|
|
250
|
+
<ParticipantOverlay
|
|
251
|
+
:seatList="seatList"
|
|
252
|
+
:scale="scale"
|
|
253
|
+
class="ui-layer"
|
|
254
|
+
/>
|
|
255
|
+
</view>
|
|
256
|
+
<!-- 页面的其他UI,如底部的操作栏 -->
|
|
257
|
+
<!-- <view class="bottom-controls">...</view> -->
|
|
258
|
+
</view>
|
|
259
|
+
</template>
|
|
260
|
+
|
|
261
|
+
<script setup>
|
|
262
|
+
import { ref, onMounted } from 'vue';
|
|
263
|
+
import ParticipantOverlay from '@/components/ParticipantOverlay.vue';
|
|
264
|
+
import { useLiveSeatState } from '@/uni_modules/tuikit-atomic-x/state/LiveSeatState';
|
|
265
|
+
const liveID = 'xxx' // 当前直播间的 liveID
|
|
266
|
+
const { seatList } = useLiveSeatState(liveID);
|
|
267
|
+
const scale = ref({ scaleX: 1, scaleY: 1 });
|
|
268
|
+
|
|
269
|
+
onMounted(() => {
|
|
270
|
+
// 在此获取并设置正确的 scale 值。
|
|
271
|
+
// 这是保证UI对齐的关键。请根据您的项目实际逻辑实现。
|
|
272
|
+
// 示例:
|
|
273
|
+
const { windowWidth } = uni.getSystemInfoSync();
|
|
274
|
+
const designWidth = 750; // rpx 设计稿宽度
|
|
275
|
+
scale.value.scaleX = windowWidth / designWidth;
|
|
276
|
+
scale.value.scaleY = scale.value.scaleX;
|
|
277
|
+
});
|
|
278
|
+
</script>
|
|
279
|
+
|
|
280
|
+
<style scoped>
|
|
281
|
+
.page-container {
|
|
282
|
+
flex: 1;
|
|
283
|
+
background-color: #000;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
.live-container {
|
|
287
|
+
flex: 1;
|
|
288
|
+
position: relative;
|
|
289
|
+
}
|
|
290
|
+
.video-layer,
|
|
291
|
+
.ui-layer {
|
|
292
|
+
position: absolute;
|
|
293
|
+
top: 0;
|
|
294
|
+
left: 0;
|
|
295
|
+
right: 0;
|
|
296
|
+
bottom: 0;
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
.video-layer {
|
|
300
|
+
z-index: 1;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
.ui-layer {
|
|
304
|
+
z-index: 2;
|
|
305
|
+
}
|
|
306
|
+
</style>
|
|
307
|
+
```
|
|
308
|
+
|
|
309
|
+
## API 文档
|
|
310
|
+
|
|
311
|
+
关于 [CoHostState](https://liteav.sdk.qcloud.com/doc/product/tuikit/atomic-x/uni-app/zh/v1.0/api/index.html#module-CoHostState) 及其相关类的所有公开接口、属性和方法的详细信息,请您参阅 AtomicXCore 框架的官方 API 文档。本指南使用到的相关 Store 如下:
|
|
312
|
+
|
|
313
|
+
|**State**|**功能描述**|**API 文档**|
|
|
314
|
+
|---------|---------|---------|
|
|
315
|
+
|DeviceState|音视频设备控制:麦克风(开关 / 音量)、摄像头(开关 / 切换 / 画质)、屏幕共享,设备状态实时监听。|[API 文档](https://liteav.sdk.qcloud.com/doc/product/tuikit/atomic-x/uni-app/zh/v1.0/api/index.html#module-DeviceState)|
|
|
316
|
+
|CoHostState|主播跨房连线:支持多布局模板(动态网格等),发起 / 接受 / 拒绝连线,连麦主播互动管理。|[API 文档](https://liteav.sdk.qcloud.com/doc/product/tuikit/atomic-x/uni-app/zh/v1.0/api/index.html#module-CoHostState)|
|
|
317
|
+
|
|
318
|
+
## 常见问题
|
|
319
|
+
|
|
320
|
+
### **为什么发起了连线邀请,对方却没收到?**
|
|
321
|
+
- 请检查 `targetHostLiveID` 是否正确,并且对方直播间处于正常开播状态。
|
|
322
|
+
|
|
323
|
+
- 检查网络连接是否通畅,邀请信令有30秒的默认超时时间。
|
|
@@ -0,0 +1,312 @@
|
|
|
1
|
+
本文档将帮助您使用 **AtomicXCore SDK** 的核心组件 **LiveCoreView**,快速构建一个包含主播开播和观众观看功能的基础直播 App。
|
|
2
|
+
|
|
3
|
+
## **核心功能**
|
|
4
|
+
|
|
5
|
+
**LiveCoreView** 是一个专为直播场景设计的轻量级 `UI` 组件,是您构建直播场景的核心,它封装了所有复杂的底层直播技术(例如推拉流、连麦、音视频渲染)。您可以将 LiveCoreView 作为直播画面的“画布”,专注于上层 UI 与交互的开发。
|
|
6
|
+
|
|
7
|
+
通过下方的视图层级示意图,您可以直观了解 **LiveCoreView** 在直播界面中的位置和作用:
|
|
8
|
+
|
|
9
|
+
## 准备工作
|
|
10
|
+
|
|
11
|
+
### 步骤1:开通服务
|
|
12
|
+
|
|
13
|
+
请参见 开通服务,获取体验版或付费版 SDK。
|
|
14
|
+
|
|
15
|
+
### 步骤2:在当前项目中导入 AtomicXCore
|
|
16
|
+
1. **安装组件**:打开 [AtomicXCore SDK](https://ext.dcloud.net.cn/plugin) ,单击**下载插件并导入 HBuilderX**,选择需要集成的项目并单击**确定**。
|
|
17
|
+
|
|
18
|
+
2. **配置工程权限:** 请在应用的 manifest.json 文件的 app-plus > distribute 节点下,确保添加了以下必要的权限:
|
|
19
|
+
|
|
20
|
+
- Android 平台(`android` 节点):在 `permissions` 数组中,请确保包含以下权限:
|
|
21
|
+
|
|
22
|
+
``` json
|
|
23
|
+
"<uses-permission android:name=\"android.permission.RECORD_AUDIO\" />",
|
|
24
|
+
"<uses-permission android:name=\"android.permission.CAMERA\"/>"
|
|
25
|
+
```
|
|
26
|
+
- iOS 平台(ios 节点):在 `privacyDescription` 对象中,请确保包含以下描述:
|
|
27
|
+
|
|
28
|
+
``` json
|
|
29
|
+
"NSCameraUsageDescription" : "应用需要访问您的相机以进行直播",
|
|
30
|
+
"NSMicrophoneUsageDescription" : "应用需要访问您的麦克风以进行直播"
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
在 `UIBackgroundModes` 数组中,添加 `audio` 以支持后台播放音频。
|
|
34
|
+
|
|
35
|
+
``` json
|
|
36
|
+
"UIBackgroundModes" : [ "audio" ]
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### 步骤3:实现登录逻辑
|
|
40
|
+
|
|
41
|
+
在您的项目中调用 LoginState 中的 login 方法完成登录,**这是使用** `AtomicXCore` **所有功能的关键前提**。
|
|
42
|
+
|
|
43
|
+
> **重要:**
|
|
44
|
+
>
|
|
45
|
+
> 推荐在您 App 自身的用户账户登录成功后,再调用 LoginState 中的 login 方法,以确保登录业务逻辑的清晰和一致。
|
|
46
|
+
>
|
|
47
|
+
|
|
48
|
+
``` typescript
|
|
49
|
+
import { useLoginState } from "@/uni_modules/tuikit-atomic-x/state/LoginState";
|
|
50
|
+
|
|
51
|
+
const { login } = useLoginState();
|
|
52
|
+
|
|
53
|
+
const handleLogin = () => {
|
|
54
|
+
login({
|
|
55
|
+
sdkAppID: 1400000001, // 替换为您的 SDKAppID
|
|
56
|
+
userID: "test_001", // 替换为您的 UserID
|
|
57
|
+
userSig: "xxxxxxxxxx" // 替换为您的 UserSig
|
|
58
|
+
})
|
|
59
|
+
}
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
**登录接口参数说明:**
|
|
63
|
+
| <strong>参数</strong> | <strong>类型</strong> | <strong>说明</strong> |
|
|
64
|
+
| --- | --- | --- |
|
|
65
|
+
| sdkAppID | number | 从 <a href="https://console.cloud.tencent.com/trtc">控制台</a> 获取,通常是以 <code>140</code> 或 <code>160</code> 开头的 10 位整数。 |
|
|
66
|
+
| userID | string | 当前用户的唯一 ID,仅包含英文字母、数字、连字符和下划线。为避免多端登录冲突,<strong>请勿使用</strong> <code>1</code>、<code>123</code> <strong>等简单 ID</strong>。 |
|
|
67
|
+
| userSig | string | 用于腾讯云鉴权的票据。请注意:<br>- 开发环境:您可以采用本地 <code>GenerateTestUserSig.genTestSig</code> 函数生成 userSig 或者通过 <a href="https://console.cloud.tencent.com/im/tool-usersig">UserSig 辅助工具</a> 生成临时的 UserSig。<br>- 生产环境:为了防止密钥泄露,请务必采用服务端生成 UserSig 的方式。详细信息请参考 <a href="https://cloud.tencent.com/document/product/647/17275">服务端生成 UserSig</a>。<br>更多信息请参见 <a href="https://cloud.tencent.com/document/product/647/17275">如何计算及使用 UserSig</a>。 |
|
|
68
|
+
|
|
69
|
+
## 搭建基础直播间
|
|
70
|
+
|
|
71
|
+
### 步骤1:实现主播视频开播
|
|
72
|
+
|
|
73
|
+
主播开播流程如下,您只需执行以下几步操作,即可快速搭建主播视频直播。
|
|
74
|
+
|
|
75
|
+
1. **初始化主播推流的视图**
|
|
76
|
+
|
|
77
|
+
在您的主播页中,引入 `LiveCoreView` 组件,将 `viewType` 指定为 `PUSH_VIEW`(推流视图), 并且为组件绑定当前直播 ID。
|
|
78
|
+
|
|
79
|
+
``` typescript
|
|
80
|
+
<live-core-view :viewType="PUSH_VIEW" :liveID="xxx"></live-core-view>
|
|
81
|
+
```
|
|
82
|
+
2. **打开摄像头和麦克风**
|
|
83
|
+
|
|
84
|
+
通过调用 `DeviceState` 的 `openLocalCamera、openLocalMicrophone` 接口打开摄像头和麦克风,**您无需做额外操作,LiveCoreView 会自动预览当前摄像头的视频流**,示例代码如下:
|
|
85
|
+
|
|
86
|
+
``` typescript
|
|
87
|
+
import { useDeviceState } from "@/uni_modules/tuikit-atomic-x/state/DeviceState";
|
|
88
|
+
import { onMounted } from 'vue';
|
|
89
|
+
const { openLocalCamera, openLocalMicrophone } = useDeviceState();
|
|
90
|
+
onMounted(() => {
|
|
91
|
+
openLocalMicrophone();
|
|
92
|
+
openLocalCamera({ isFront: true });
|
|
93
|
+
})
|
|
94
|
+
```
|
|
95
|
+
3. **开始直播**
|
|
96
|
+
|
|
97
|
+
通过调用 `LiveListState` 的 `createLive` 接口开始视频直播,完整示例代码如下:
|
|
98
|
+
|
|
99
|
+
``` typescript
|
|
100
|
+
import { useLiveListState } from "@/uni_modules/tuikit-atomic-x/state/LiveListState";
|
|
101
|
+
|
|
102
|
+
const { createLive } = useLiveListState();
|
|
103
|
+
|
|
104
|
+
// 开始直播
|
|
105
|
+
const startLive = () => {
|
|
106
|
+
createLive({
|
|
107
|
+
liveInfo: {
|
|
108
|
+
liveID: 'xxx', // 设置直播的房间 id
|
|
109
|
+
liveName: 'text', // 设置直播的房间名称
|
|
110
|
+
seatLayoutTemplateID: 600, // 配置布局模板,默认:600 动态宫格布局
|
|
111
|
+
keepOwnerOnSeat: true, // 配置主播始终在麦位上
|
|
112
|
+
},
|
|
113
|
+
success: () => {
|
|
114
|
+
console.log('创建直播间成功')
|
|
115
|
+
//您可以在这里进行页面的跳转
|
|
116
|
+
},
|
|
117
|
+
fail: (error) => {
|
|
118
|
+
console.log('创建直播间失败', error)
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
};
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
`LiveInfo` **参数说明:**
|
|
125
|
+
|
|
126
|
+
|**参数名**|**类型**|**属性**|**描述**|
|
|
127
|
+
|---------|---------|---------|---------|
|
|
128
|
+
|`liveID`|`string`|必填|直播间的唯一标识符|
|
|
129
|
+
|`liveName`|`string`|选填|直播间的标题|
|
|
130
|
+
|`notice`|`string`|选填|直播间的公告信息|
|
|
131
|
+
|`isMessageDisable`|`boolean`|选填|是否禁言(`true`:是,`false`:否)|
|
|
132
|
+
|`isPublicVisible`|`boolean`|选填|是否公开可见(`true`:是,`false`:否)|
|
|
133
|
+
|`isSeatEnabled`|`boolean`|选填|是否启用麦位功能(`true`:是,`false`:否)|
|
|
134
|
+
|`keepOwnerOnSeat`|`boolean`|选填|是否保持房主在麦位上|
|
|
135
|
+
|`maxSeatCount`|`number`|选填|最大麦位数量|
|
|
136
|
+
|`seatMode`|`string`|选填|上麦模式(`'FREE'`:自由上麦,`'APPLY'`:申请上麦)|
|
|
137
|
+
|`seatLayoutTemplateID`|`number`|必填|麦位布局模板 `ID`|
|
|
138
|
+
|`coverURL`|`string`|选填|直播间的封面图片地址|
|
|
139
|
+
|`backgroundURL`|`string`|选填|直播间的背景图片地址|
|
|
140
|
+
|`activityStatus`|`number`|选填|直播活动状态|
|
|
141
|
+
|`isGiftEnabled`|`boolean`|选填|是否启用礼物功能(`true`:是,`false`:否)|
|
|
142
|
+
|
|
143
|
+
4. **结束直播**
|
|
144
|
+
|
|
145
|
+
直播结束后,主播可以调用 **LiveListState** 的 `endLive` 接口结束直播。SDK 会处理停止推流和销毁房间的逻辑。
|
|
146
|
+
|
|
147
|
+
``` typescript
|
|
148
|
+
import { useLiveListState } from "@/uni_modules/tuikit-atomic-x/state/LiveListState";
|
|
149
|
+
import { useDeviceState } from "@/uni_modules/tuikit-atomic-x/state/DeviceState";
|
|
150
|
+
const { endLive } = useLiveListState();
|
|
151
|
+
const { closeLocalCamera, closeLocalMicrophone } = useDeviceState();
|
|
152
|
+
|
|
153
|
+
const stopLive = () => {
|
|
154
|
+
endLive({
|
|
155
|
+
success: () => {
|
|
156
|
+
// 关闭本地设备
|
|
157
|
+
closeLocalCamera();
|
|
158
|
+
closeLocalMicrophone()
|
|
159
|
+
},
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
### 步骤2:实现观众进房观看
|
|
165
|
+
|
|
166
|
+
观众观看流程如下,通过简单几步操作,即可实现观众观看直播。
|
|
167
|
+
|
|
168
|
+
1. **实现观众拉流页面**
|
|
169
|
+
|
|
170
|
+
在您的观众页中,引入 `LiveCoreView` 组件,将 `viewType` 指定为 `PLAY_VIEW`(拉流视图), 并且为组件绑定当前直播 ID。
|
|
171
|
+
|
|
172
|
+
``` typescript
|
|
173
|
+
<live-core-view :viewType="PLAY_VIEW" :liveID="xxx"></live-core-view>
|
|
174
|
+
```
|
|
175
|
+
2. **进入直播间观看**
|
|
176
|
+
|
|
177
|
+
通过调用 **LiveListState** 的 `joinLive` 接口加入直播,**您无需做额外操作,LiveCoreView 会自动播放当前房间的视频流**,完整示例代码如下:
|
|
178
|
+
|
|
179
|
+
``` typescript
|
|
180
|
+
import { useLiveListState } from "@/uni_modules/tuikit-atomic-x/state/LiveListState";
|
|
181
|
+
|
|
182
|
+
const { joinLive } = useLiveListState();
|
|
183
|
+
|
|
184
|
+
// 加入直播
|
|
185
|
+
const handleJoinLive = () => {
|
|
186
|
+
joinLive({
|
|
187
|
+
liveID: 'xxx', // 与主播开播同样的 liveID
|
|
188
|
+
success: () => {
|
|
189
|
+
console.log('加入直播间成功')
|
|
190
|
+
//您可以在这里进行页面的跳转
|
|
191
|
+
},
|
|
192
|
+
fail: (error) => {
|
|
193
|
+
console.log('加入直播间失败', error)
|
|
194
|
+
}
|
|
195
|
+
})
|
|
196
|
+
}
|
|
197
|
+
```
|
|
198
|
+
3. **退出直播**
|
|
199
|
+
|
|
200
|
+
观众退出直播间时,需要调用 **LiveListState** 的 `leaveLive` 接口退出直播。SDK 会自动停止拉流并退出房间。
|
|
201
|
+
|
|
202
|
+
``` typescript
|
|
203
|
+
import { useLiveListState } from "@/uni_modules/tuikit-atomic-x/state/LiveListState";
|
|
204
|
+
|
|
205
|
+
const { leaveLive } = useLiveListState();
|
|
206
|
+
|
|
207
|
+
// 离开直播
|
|
208
|
+
const exitLive = () => {
|
|
209
|
+
leaveLive({
|
|
210
|
+
success: () => {
|
|
211
|
+
console.log('离开直播间成功')
|
|
212
|
+
//您可以在这里进行页面的跳转
|
|
213
|
+
},
|
|
214
|
+
fail: (error) => {
|
|
215
|
+
console.log('离开直播间失败', error)
|
|
216
|
+
}
|
|
217
|
+
})
|
|
218
|
+
}
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
### 步骤3:监听直播事件
|
|
222
|
+
|
|
223
|
+
在观众加入直播间后,您还需要处理一些房间内的“被动”事件。例如,主播主动结束了直播,或者观众因为违规等原因被踢出房间。如果不监听这些事件,观众端 UI 可能会停留在黑屏页面,影响用户体验。
|
|
224
|
+
|
|
225
|
+
您可以通过订阅 `LiveListState` 提供的 `addLiveListListener` 来实现事件监听。
|
|
226
|
+
``` typescript
|
|
227
|
+
import { useLiveListState } from "@/uni_modules/tuikit-atomic-x/state/LiveListState";
|
|
228
|
+
import { onMounted } from 'vue';
|
|
229
|
+
const { addLiveListListener } = useLiveListState()
|
|
230
|
+
|
|
231
|
+
onMounted(() => {
|
|
232
|
+
addLiveListListener('onLiveEnded',
|
|
233
|
+
(event) => {
|
|
234
|
+
const res = JSON.parse(event)
|
|
235
|
+
console.log("直播结束", res)
|
|
236
|
+
// 在这里处理直播间结束后的相关逻辑,例如关闭当前页面
|
|
237
|
+
}
|
|
238
|
+
)
|
|
239
|
+
addLiveListListener( 'onKickedOutOfLive',
|
|
240
|
+
(event) => {
|
|
241
|
+
const res = JSON.parse(event)
|
|
242
|
+
console.log("被踢出房间", res.reason)
|
|
243
|
+
// 可以根据被踢出房间的原因进行弹窗提示
|
|
244
|
+
}
|
|
245
|
+
)
|
|
246
|
+
})
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
### 运行效果
|
|
250
|
+
|
|
251
|
+
集成 **LiveCoreView** 后,您将得到一个纯净的视频渲染视图,它已具备完整的直播业务能力,但没有任何交互 UI。您可以参考下一章节 丰富直播场景 来完善直播场景。
|
|
252
|
+
|
|
253
|
+
## 丰富直播场景
|
|
254
|
+
|
|
255
|
+
当您完成了基础的直播功能后,您可以参考以下功能指南来为直播添加丰富的互动玩法。
|
|
256
|
+
|
|
257
|
+
|**直播功能**|**功能介绍**|**功能 States**|**实现指南**|
|
|
258
|
+
|---------|---------|---------|---------|
|
|
259
|
+
|**实现观众音视频连线**|观众申请上麦,与主播进行实时视频互动。|[CoGuestState](https://liteav.sdk.qcloud.com/doc/product/tuikit/atomic-x/uni-app/zh/v1.0/api/index.html#module-CoGuestState)|实现观众连线|
|
|
260
|
+
|**实现主播跨房连线**|两个不同房间的主播进行连线,实现互动|[CoHostState](https://liteav.sdk.qcloud.com/doc/product/tuikit/atomic-x/uni-app/zh/v1.0/api/index.html#module-CoHostState)|实现主播连线|
|
|
261
|
+
|**添加弹幕聊天功能**|观众可以在直播间发送和接收实时文字消息。|[BarrageState](https://liteav.sdk.qcloud.com/doc/product/tuikit/atomic-x/uni-app/zh/v1.0/api/index.html#module-BarrageState)|实现弹幕功能|
|
|
262
|
+
|**构建礼物赠送系统**|观众可以向主播赠送虚拟礼物,增加互动和趣味性。|[GiftState](https://liteav.sdk.qcloud.com/doc/product/tuikit/atomic-x/uni-app/zh/v1.0/api/index.html#module-GiftState)|实现礼物功能|
|
|
263
|
+
|
|
264
|
+
## API 文档
|
|
265
|
+
|
|
266
|
+
|**State**|**功能描述**|**API 文档**|
|
|
267
|
+
|---------|---------|---------|
|
|
268
|
+
|**LiveListState**|直播间全生命周期管理:创建 / 加入 / 离开 / 销毁房间,查询房间列表,修改直播信息(名称、公告等),监听直播状态(例如被踢出、结束)。|[API 文档](https://liteav.sdk.qcloud.com/doc/product/tuikit/atomic-x/uni-app/zh/v1.0/api/index.html#module-LiveListState)|
|
|
269
|
+
|**DeviceState**|音视频设备控制:麦克风(开关 / 音量)、摄像头(开关 / 切换 / 画质)、屏幕共享,设备状态实时监听。|[API 文档](https://liteav.sdk.qcloud.com/doc/product/tuikit/atomic-x/uni-app/zh/v1.0/api/index.html#module-DeviceState)|
|
|
270
|
+
|**CoGuestState**|观众连麦管理:连麦申请 / 邀请 / 同意 / 拒绝,连麦成员权限控制(麦克风 / 摄像头),状态同步。|[API 文档](https://liteav.sdk.qcloud.com/doc/product/tuikit/atomic-x/uni-app/zh/v1.0/api/index.html#module-CoGuestState)|
|
|
271
|
+
|**CoHostState**|主播跨房连线:支持多布局模板(动态网格等),发起 / 接受 / 拒绝连线,连麦主播互动管理。|[API 文档](https://liteav.sdk.qcloud.com/doc/product/tuikit/atomic-x/uni-app/zh/v1.0/api/index.html#module-CoHostState)|
|
|
272
|
+
|**GiftState**|礼物互动:获取礼物列表,发送 / 接收礼物,监听礼物事件(含发送者、礼物详情)。|[API 文档](https://liteav.sdk.qcloud.com/doc/product/tuikit/atomic-x/uni-app/zh/v1.0/api/index.html#module-GiftState)|
|
|
273
|
+
|**BarrageState**|弹幕功能:发送文本 / 自定义弹幕,维护弹幕列表,实时监听弹幕状态。|[API 文档](https://liteav.sdk.qcloud.com/doc/product/tuikit/atomic-x/uni-app/zh/v1.0/api/index.html#module-BarrageState)|
|
|
274
|
+
|**LikeState**|点赞互动:发送点赞,监听点赞事件,同步总点赞数。|[API 文档](https://liteav.sdk.qcloud.com/doc/product/tuikit/atomic-x/uni-app/zh/v1.0/api/index.html#module-LikeState)|
|
|
275
|
+
|**LiveAudienceState**|观众管理:获取实时观众列表(ID / 名称 / 头像),统计观众数量,监听观众进出事件。|[API 文档](https://liteav.sdk.qcloud.com/doc/product/tuikit/atomic-x/uni-app/zh/v1.0/api/index.html#module-LiveAudienceState)|
|
|
276
|
+
|**AudioEffectState**|音频特效:变声(童声 / 男声)、混响(KTV 等)、耳返调节,实时切换特效。|[API 文档](https://liteav.sdk.qcloud.com/doc/product/tuikit/atomic-x/uni-app/zh/v1.0/api/index.html#module-AudioEffectState)|
|
|
277
|
+
|**BaseBeautyState**|基础美颜:调节磨皮 / 美白 / 红润(0-100 级),重置美颜状态,同步效果参数。|[API 文档](https://liteav.sdk.qcloud.com/doc/product/tuikit/atomic-x/uni-app/zh/v1.0/api/index.html#module-BaseBeautyState)|
|
|
278
|
+
|
|
279
|
+
## 常见问题
|
|
280
|
+
|
|
281
|
+
在使用 **AtomicXCore** 这样的原生能力 SDK 时,开发者经常会遇到 uni-app 跨端开发本身的一些共性问题,以下是一些常见问题及其解决方案,可以帮助您规避许多常见的“坑”。
|
|
282
|
+
|
|
283
|
+
### 跨端兼容性问题
|
|
284
|
+
- 问题:原生组件层级最高,遮挡弹窗。
|
|
285
|
+
|
|
286
|
+
- 原因:像 `<video>`, `<map>`, `<live-player>` `LiveCoreView` 这类组件,是由原生渲染的,层级永远高于 WebView 渲染的普通组件。
|
|
287
|
+
|
|
288
|
+
- 解决方案:
|
|
289
|
+
|
|
290
|
+
- 使用 `cover-view`:uni-app 提供了 `cover-view` 和 `cover-image`,它们可以覆盖在原生组件之上,但样式支持有限。
|
|
291
|
+
|
|
292
|
+
- 切换到 `nvue`:如果页面交互复杂,需要大量元素覆盖在原生组件上,建议将整个页面用 `nvue` 来编写。`nvue` 的所有组件都是原生渲染,不存在层级问题。
|
|
293
|
+
|
|
294
|
+
### nvue 与 vue 的抉择问题
|
|
295
|
+
- 问题:不知道什么时候该用 `nvue`,什么时候用 `vue`。
|
|
296
|
+
|
|
297
|
+
- 选型建议:
|
|
298
|
+
|
|
299
|
+
- 默认用 `vue`:适合绝大多数业务和 UI 复杂的页面。
|
|
300
|
+
|
|
301
|
+
- 当遇到长列表滑动卡顿、复杂动画掉帧、需要覆盖原生组件等性能或层级问题时,再考虑将该页面重构为 `nvue`。直播、地图这类页面是 nvue 的绝佳应用场景。
|
|
302
|
+
|
|
303
|
+
### 原生能力集成问题
|
|
304
|
+
- 问题:插件调用失败或无响应。
|
|
305
|
+
|
|
306
|
+
- 解决方案:
|
|
307
|
+
|
|
308
|
+
- 必须打包自定义基座:在开发调试原生插件时,不能使用标准基座,必须通过 `HBuilderX` > 运行 > 运行到手机或模拟器 > 制作自定义基座,然后选择这个自定义基座来运行。
|
|
309
|
+
|
|
310
|
+
- 检查权限:如本文档“准备工作”中所述,`manifest.json` 必须声明相机、麦克风等权限。
|
|
311
|
+
|
|
312
|
+
- 查看原生日志:这是终极调试手段。通过 `Android Studio (Logcat)` 或 `Xcode (Console)` 查看设备的原生日志,通常能发现最直接的错误信息。
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
**AtomicXCore** 提供了 [CoGuestStore](https://tencent-rtc.github.io/TUIKit_Android/-atomic-x%20-core%20-a-p-i/io.trtc.tuikit.atomicxcore.api.live/-co-guest-store/index.html) 和 [LiveSeatStore](https://tencent-rtc.github.io/TUIKit_Android/-atomic-x%20-core%20-a-p-i/io.trtc.tuikit.atomicxcore.api.live/-live-seat-store/index.html) 模块,用于管理观众连麦的完整业务流程。您无需关心复杂的状态同步和信令交互,只需调用几个简单的方法,即可为您的直播添加强大的观众与主播音视频互动功能。本文档将指导您如何使用 `CoGuestStore
|
|
1
|
+
**AtomicXCore** 提供了 [CoGuestStore](https://tencent-rtc.github.io/TUIKit_Android/-atomic-x%20-core%20-a-p-i/io.trtc.tuikit.atomicxcore.api.live/-co-guest-store/index.html) 和 [LiveSeatStore](https://tencent-rtc.github.io/TUIKit_Android/-atomic-x%20-core%20-a-p-i/io.trtc.tuikit.atomicxcore.api.live/-live-seat-store/index.html) 模块,用于管理观众连麦的完整业务流程。您无需关心复杂的状态同步和信令交互,只需调用几个简单的方法,即可为您的直播添加强大的观众与主播音视频互动功能。本文档将指导您如何使用 `CoGuestStore` 和 `LiveSeatStore` 在 `Android` 应用中快速实现语音连麦功能。
|
|
2
2
|
|
|
3
3
|
## 核心场景
|
|
4
4
|
|
|
@@ -515,10 +515,10 @@ seatStore.moveUserToSeat("userC",
|
|
|
515
515
|
|
|
516
516
|
### 如何在 UI 上实时刷新麦位信息(例如是否有人、是否静音)?
|
|
517
517
|
|
|
518
|
-
您应该订阅 `LiveSeatState` 中的 `seatList`
|
|
518
|
+
您应该订阅 `LiveSeatState` 中的 `seatList` 属性,它是一个 `List<SeatInfo>` 数组类型的响应式数据,每当数组变化时都会通知您重新渲染麦位列表。遍历此数组,您可以:
|
|
519
519
|
- 通过 `seatInfo.userInfo` 来获取麦位上用户信息。
|
|
520
520
|
|
|
521
|
-
- 通过 `seatInfo.isLocked
|
|
521
|
+
- 通过 `seatInfo.isLocked` 判断麦位是否被锁定。
|
|
522
522
|
|
|
523
523
|
- 通过 `seatInfo.userInfo.microphoneStatus` 判断麦上用户的麦克风状态。
|
|
524
524
|
|