@tencent-rtc/mcp 1.6.4 → 1.6.6
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/knowledge/chunker.js +83 -54
- package/knowledge/path-meta.js +179 -26
- package/knowledge/search/exact-lookup.js +168 -10
- package/knowledge/search/filter-pool.js +73 -19
- package/knowledge/search/product-scope-intent.js +2 -2
- package/knowledge/search/requires-framework.js +2 -2
- package/knowledge/search/search-knowledge.js +247 -61
- package/package.json +1 -1
- package/resource/index/manifest.json +1 -1
- package/resource/integration/callkit/preset/android/integration.md +2 -4
- package/resource/integration/callkit/preset/flutter/integration.md +4 -5
- package/resource/integration/callkit/preset/ios/integration.md +1 -4
- package/resource/integration/callkit/preset/react/integration.md +13 -20
- package/resource/integration/callkit/preset/vue/integration.md +14 -21
- package/resource/integration/chat/preset/android/integration.md +6 -9
- package/resource/integration/chat/preset/flutter/integration.md +9 -12
- package/resource/integration/chat/preset/ios/integration.md +2 -4
- package/resource/integration/chat/preset/react/integration.md +0 -10
- package/resource/integration/livekit/preset/live/android/live-audience-integration.md +129 -0
- package/resource/integration/livekit/preset/live/android/live-host-integration.md +219 -0
- package/resource/integration/livekit/preset/live/android/live-list-integration.md +261 -0
- package/resource/integration/livekit/preset/live/android/prepare-integration.md +254 -0
- package/resource/integration/livekit/preset/live/ios/live-audience-integration.md +202 -0
- package/resource/integration/livekit/preset/live/ios/live-host-integration.md +369 -0
- package/resource/integration/livekit/preset/live/ios/live-list-integration.md +229 -0
- package/resource/integration/livekit/preset/live/ios/prepare-integration.md +204 -0
- package/resource/integration/livekit/preset/live/vue/live-list-integration.md +0 -3
- package/resource/integration/livekit/preset/live/vue/live-player-desk-integration.md +0 -5
- package/resource/integration/livekit/preset/live/vue/live-player-h5-integration.md +0 -6
- package/resource/integration/livekit/preset/live/vue/live-pusher-integration.md +5 -10
- package/resource/integration/roomkit/preset/vue/integration.md +0 -4
- package/resource/knowledge/callkit/best-practice/web/callengine-invitation.md +80 -0
- package/resource/knowledge/callkit/best-practice/web/callengine-log-control.md +24 -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 +7 -8
- package/resource/knowledge/callkit/core-sdk/android/make-call.md +5 -7
- package/resource/knowledge/callkit/core-sdk/android/offline-push.md +3 -5
- package/resource/knowledge/callkit/core-sdk/flutter/answer-call.md +2 -6
- package/resource/knowledge/callkit/core-sdk/flutter/make-call.md +2 -6
- package/resource/knowledge/callkit/core-sdk/flutter/offline-push.md +4 -9
- package/resource/knowledge/callkit/core-sdk/ios/answer-call.md +1 -4
- package/resource/knowledge/callkit/core-sdk/ios/make-call.md +8 -11
- package/resource/knowledge/callkit/core-sdk/ios/offline-push.md +17 -23
- package/resource/knowledge/callkit/core-sdk/web/call-engine.md +33 -0
- package/resource/knowledge/callkit/core-sdk/web/call-event.md +327 -0
- package/resource/knowledge/callkit/core-sdk/web/callengine-api-overview.md +33 -0
- package/resource/knowledge/callkit/faq/android.md +0 -2
- package/resource/knowledge/callkit/faq/error-code.md +0 -2
- package/resource/knowledge/callkit/faq/flutter.md +2 -2
- package/resource/knowledge/callkit/faq/ios.md +3 -5
- package/resource/knowledge/callkit/faq/web.md +2 -3
- package/resource/knowledge/callkit/preset/android/api.md +2 -5
- package/resource/knowledge/callkit/preset/ios/api.md +0 -2
- package/resource/knowledge/callkit/preset/react/api.md +445 -0
- package/resource/knowledge/callkit/preset/react/uikit-api-reference.md +445 -0
- package/resource/knowledge/callkit/preset/vue/api.md +465 -0
- package/resource/knowledge/callkit/preset/vue/uikit-api-reference.md +465 -0
- 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 +1 -1
- package/resource/knowledge/chat/preset/android/features/language.md +0 -1
- package/resource/knowledge/chat/preset/android/features/message-input.md +1 -1
- package/resource/knowledge/chat/preset/android/features/message-list.md +2 -3
- 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 +3 -11
- package/resource/knowledge/chat/preset/flutter/features/conversation-list.md +0 -1
- package/resource/knowledge/chat/preset/flutter/features/message-list.md +1 -2
- package/resource/knowledge/chat/preset/flutter/features/search.md +5 -6
- package/resource/knowledge/chat/preset/flutter/features/theme.md +2 -2
- package/resource/knowledge/chat/preset/ios/features/chat-setting.md +1 -1
- package/resource/knowledge/chat/preset/ios/features/conversation-list.md +1 -2
- package/resource/knowledge/chat/preset/ios/features/message-list.md +1 -2
- package/resource/knowledge/chat/preset/ios/features/search.md +0 -1
- package/resource/knowledge/chat/preset/ios-uikit/integration.md +13 -15
- package/resource/knowledge/chat/preset/react/features/conversation-list.md +5 -5
- 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/react/features/theme.md +0 -1
- package/resource/knowledge/chat/urls/sdk/android.md +3 -3
- package/resource/knowledge/chat/urls/sdk/flutter.md +3 -3
- package/resource/knowledge/chat/urls/sdk/ios.md +3 -3
- package/resource/knowledge/chat/urls/sdk/web.md +3 -3
- package/resource/knowledge/livekit/core-sdk/api-reference/android/AudioEffectStore.md +7 -14
- package/resource/knowledge/livekit/core-sdk/api-reference/android/BarrageStore.md +5 -8
- package/resource/knowledge/livekit/core-sdk/api-reference/android/BattleStore.md +15 -18
- package/resource/knowledge/livekit/core-sdk/api-reference/android/CameraView.md +1 -2
- package/resource/knowledge/livekit/core-sdk/api-reference/android/CoGuestStore.md +15 -20
- package/resource/knowledge/livekit/core-sdk/api-reference/android/CoHostStore.md +10 -13
- package/resource/knowledge/livekit/core-sdk/api-reference/android/DeviceStore.md +2 -4
- package/resource/knowledge/livekit/core-sdk/api-reference/android/GiftStore.md +4 -6
- package/resource/knowledge/livekit/core-sdk/api-reference/android/LikeStore.md +2 -4
- package/resource/knowledge/livekit/core-sdk/api-reference/android/LiveAudienceStore.md +2 -4
- package/resource/knowledge/livekit/core-sdk/api-reference/android/LiveCoreView.md +1 -2
- package/resource/knowledge/livekit/core-sdk/api-reference/android/LiveSeatStore.md +8 -10
- package/resource/knowledge/livekit/core-sdk/api-reference/android/LoginStore.md +5 -7
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/AudioEffectStore.md +7 -14
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/BarrageStore.md +6 -9
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/BaseBeautyStore.md +1 -2
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/BattleStore.md +15 -18
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/CoGuestStore.md +15 -20
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/CoHostStore.md +10 -13
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/DeviceStore.md +2 -4
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/GiftStore.md +4 -6
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/LikeStore.md +2 -4
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/LiveAudienceStore.md +2 -4
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/LiveCoreView.md +1 -2
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/LiveSeatStore.md +8 -10
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/LoginStore.md +3 -5
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/AudioEffectStore.md +7 -14
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/BarrageStore.md +5 -8
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/BaseBeautyStore.md +1 -2
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/BattleStore.md +6 -9
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/CoGuestStore.md +5 -10
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/CoHostStore.md +3 -6
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/DeviceStore.md +2 -4
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/GiftStore.md +4 -6
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/LikeStore.md +2 -4
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/LiveAudienceStore.md +2 -4
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/LiveCoreView.md +1 -2
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/LiveSeatStore.md +4 -6
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/LoginStore.md +3 -5
- package/resource/knowledge/livekit/core-sdk/api-reference/{web → vue}/index.md +24 -24
- package/resource/knowledge/livekit/core-sdk/{voice/android/voice-audio-effect.md → features/android/audio-effect.md} +1 -2
- package/resource/knowledge/livekit/core-sdk/{live/android/live-gift.md → features/android/gift.md} +2 -3
- package/resource/knowledge/livekit/core-sdk/{voice/android/voice-room-list.md → features/android/live-list.md} +2 -4
- 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} +2 -2
- package/resource/knowledge/livekit/core-sdk/{live/flutter/live-gift.md → features/flutter/gift.md} +2 -3
- 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 -2
- 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/{live/ios/live-base-beauty.md → features/ios/base-beauty.md} +2 -2
- package/resource/knowledge/livekit/core-sdk/{voice/ios/voice-gift.md → features/ios/gift.md} +2 -3
- package/resource/knowledge/livekit/core-sdk/{voice/ios/voice-room-list.md → features/ios/live-list.md} +2 -4
- package/resource/knowledge/livekit/core-sdk/live/android/{live-co-guest-interaction.md → co-guest-interaction.md} +0 -1
- package/resource/knowledge/livekit/core-sdk/live/android/{live-host-interaction.md → host-interaction.md} +5 -7
- package/resource/knowledge/livekit/core-sdk/live/android/{live-integration.md → integration.md} +3 -6
- package/resource/knowledge/livekit/core-sdk/live/flutter/{live-co-guest-interaction.md → co-guest-interaction.md} +1 -1
- package/resource/knowledge/livekit/core-sdk/live/flutter/{live-host-interaction.md → host-interaction.md} +0 -2
- package/resource/knowledge/livekit/core-sdk/live/flutter/{live-integration.md → integration.md} +1 -4
- package/resource/knowledge/livekit/core-sdk/live/ios/{live-co-guest-interaction.md → co-guest-interaction.md} +0 -1
- package/resource/knowledge/livekit/core-sdk/live/ios/{live-host-interaction.md → host-interaction.md} +2 -4
- package/resource/knowledge/livekit/core-sdk/live/ios/{live-integration.md → integration.md} +2 -5
- package/resource/knowledge/livekit/core-sdk/voice/android/{voice-host-interaction.md → host-interaction.md} +3 -5
- package/resource/knowledge/livekit/core-sdk/voice/android/{voice-integration.md → integration.md} +3 -6
- package/resource/knowledge/livekit/core-sdk/voice/flutter/{voice-co-guest-interaction.md → co-guest-interaction.md} +1 -2
- package/resource/knowledge/livekit/core-sdk/voice/flutter/{voice-integration.md → integration.md} +6 -9
- package/resource/knowledge/livekit/core-sdk/voice/ios/{voice-co-guest-interaction.md → co-guest-interaction.md} +2 -2
- package/resource/knowledge/livekit/core-sdk/voice/ios/{voice-host-interaction.md → host-interaction.md} +4 -6
- package/resource/knowledge/livekit/core-sdk/voice/ios/{voice-integration.md → integration.md} +1 -4
- package/resource/knowledge/livekit/preset/live/vue/features/barrage.md +0 -2
- package/resource/knowledge/push/api-reference/android.md +123 -0
- package/resource/knowledge/push/api-reference/flutter.md +176 -0
- package/resource/knowledge/push/api-reference/harmonyos.md +138 -0
- package/resource/knowledge/push/api-reference/ios.md +176 -0
- package/resource/knowledge/push/api-reference/react-native.md +147 -0
- package/resource/knowledge/push/api-reference/uni-app.md +147 -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.md +4 -7
- package/resource/knowledge/push/config/harmonyos.md +0 -3
- package/resource/knowledge/push/config/ios.md +12 -20
- package/resource/knowledge/push/config/react-native.md +18 -26
- package/resource/knowledge/push/config/unity.md +20 -28
- package/resource/knowledge/push/config/unreal-engine.md +21 -29
- package/resource/knowledge/push/integration/android.md +6 -8
- package/resource/knowledge/push/integration/flutter.md +6 -9
- package/resource/knowledge/push/integration/harmonyos.md +1 -0
- package/resource/knowledge/push/integration/ios.md +7 -9
- package/resource/knowledge/push/integration/react-native.md +9 -13
- package/resource/knowledge/push/integration/uni-app.md +7 -7
- package/resource/knowledge/push/integration/unity.md +10 -13
- package/resource/knowledge/push/integration/unreal-engine.md +6 -9
- package/resource/knowledge/push/overview/prepare.md +2 -2
- package/resource/knowledge/roomkit/core-sdk/android/call-user-to-room.md +3 -3
- package/resource/knowledge/roomkit/core-sdk/android/capability-matrix.md +46 -0
- package/resource/knowledge/roomkit/core-sdk/android/room-participant-state.md +1 -1
- package/resource/knowledge/roomkit/core-sdk/android/room-state.md +2 -2
- package/resource/knowledge/roomkit/core-sdk/android/schedule-room.md +6 -6
- package/resource/knowledge/roomkit/core-sdk/android/unsupported-features.md +79 -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 +79 -0
- package/resource/knowledge/roomkit/core-sdk/ios/capability-matrix.md +46 -0
- package/resource/knowledge/roomkit/core-sdk/ios/room-participant-state.md +1 -1
- package/resource/knowledge/roomkit/core-sdk/ios/unsupported-features.md +79 -0
- package/resource/knowledge/roomkit/preset/android/integration.md +5 -7
- package/resource/knowledge/roomkit/preset/flutter/integration.md +2 -7
- package/resource/knowledge/roomkit/preset/ios/integration.md +3 -9
- package/resource/knowledge/roomkit/preset/react/integration.md +12 -16
- package/resource/knowledge/trtc/android/TRTCCloud.md +154 -238
- package/resource/knowledge/trtc/android/TRTCCloudDef.md +133 -134
- package/resource/knowledge/trtc/android/TRTCCloudListener.md +86 -120
- package/resource/knowledge/trtc/android/TRTCStatistics.md +10 -10
- package/resource/knowledge/trtc/android/TXAudioEffectManager.md +10 -30
- package/resource/knowledge/trtc/android/TXBeautyManager.md +25 -25
- package/resource/knowledge/trtc/android/TXDeviceManager.md +2 -2
- package/resource/knowledge/trtc/android/TXLiteAVCode.md +12 -12
- package/resource/knowledge/trtc/c++/ITRTCCloud.md +166 -261
- package/resource/knowledge/trtc/c++/ITRTCStatistics.md +12 -12
- package/resource/knowledge/trtc/c++/ITXAudioEffectManager.md +10 -30
- package/resource/knowledge/trtc/c++/ITXDeviceManager.md +9 -11
- package/resource/knowledge/trtc/c++/TRTCCloudCallback.md +96 -130
- package/resource/knowledge/trtc/c++/TRTCTypeDef.md +122 -123
- package/resource/knowledge/trtc/c++/TXLiteAVCode.md +12 -12
- package/resource/knowledge/trtc/ios/TRTCCloud.md +168 -255
- package/resource/knowledge/trtc/ios/TRTCCloudDef.md +124 -125
- package/resource/knowledge/trtc/ios/TRTCCloudDelegate.md +89 -124
- package/resource/knowledge/trtc/ios/TRTCStatistics.md +10 -10
- package/resource/knowledge/trtc/ios/TXAudioEffectManager.md +9 -28
- package/resource/knowledge/trtc/ios/TXBeautyManager.md +25 -25
- package/resource/knowledge/trtc/ios/TXDeviceManager.md +9 -11
- package/resource/knowledge/trtc/ios/TXLiteAVCode.md +12 -12
- package/server.js +21 -21
- 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 +61 -0
- package/tools/definitions/get_native_livekit_core_integration_def.js +3 -3
- 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/report-cls-client.js +1 -1
- package/utils/report-es-client.js +1 -1
- package/resource/knowledge/callkit/preset/web/api.md +0 -83
- package/resource/knowledge/livekit/core-sdk/live/android/live-audio-effect.md +0 -226
- package/resource/knowledge/livekit/core-sdk/live/android/live-live-list.md +0 -438
- package/resource/knowledge/livekit/core-sdk/live/flutter/live-barrage.md +0 -490
- 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 -264
- package/resource/knowledge/livekit/core-sdk/live/ios/live-audio-effect.md +0 -216
- package/resource/knowledge/livekit/core-sdk/live/ios/live-gift.md +0 -407
- package/resource/knowledge/livekit/core-sdk/live/ios/live-live-list.md +0 -349
- package/resource/knowledge/livekit/core-sdk/voice/android/voice-audience-list.md +0 -269
- package/resource/knowledge/livekit/core-sdk/voice/android/voice-barrage.md +0 -456
- package/resource/knowledge/livekit/core-sdk/voice/android/voice-gift.md +0 -455
- package/resource/knowledge/livekit/core-sdk/voice/flutter/voice-audience-list.md +0 -260
- package/resource/knowledge/livekit/core-sdk/voice/flutter/voice-audio-effect.md +0 -598
- package/resource/knowledge/livekit/core-sdk/voice/flutter/voice-gift.md +0 -424
- package/resource/knowledge/livekit/core-sdk/voice/ios/voice-barrage.md +0 -408
- /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/android/live-barrage.md → features/android/barrage.md} +0 -0
- /package/resource/knowledge/livekit/core-sdk/{live/android/live-base-beauty.md → features/android/base-beauty.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/{live/ios/live-barrage.md → features/ios/barrage.md} +0 -0
- /package/resource/knowledge/livekit/core-sdk/voice/android/{voice-co-guest-interaction.md → co-guest-interaction.md} +0 -0
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
**TUILiveKit**'s audience viewing page provides users with various and convenient live streaming and interaction features, enabling quick integration into your application to meet diverse audience needs.
|
|
2
|
+
|
|
3
|
+
## Feature Overview
|
|
4
|
+
- **Live streaming:** Clear and smooth viewing of the host's real-time live stream.
|
|
5
|
+
|
|
6
|
+
- **Interactive co-guest:** Apply for mic connection to interact with the host via audio and video.
|
|
7
|
+
|
|
8
|
+
- **Live information:** View the live streaming room title, description, and audience list, etc.
|
|
9
|
+
|
|
10
|
+
- **Live interactive:** Send a gift (with animation effects and host notification), like (with animation and real-time statistics), and interact via bullet screen.
|
|
11
|
+
|
|
12
|
+
| <strong>Live Streaming</strong> | <strong>Interactive co-guest</strong> | <strong>Live Information</strong> | <strong>Live Interactive</strong> |
|
|
13
|
+
| --- | --- | --- | --- |
|
|
14
|
+
| | ### | | |
|
|
15
|
+
|
|
16
|
+
## Quick Start
|
|
17
|
+
|
|
18
|
+
### Step 1. Activate the Service
|
|
19
|
+
|
|
20
|
+
Refer to the Activate Service document to get the `TUILiveKit` trial version or activate the paid version.
|
|
21
|
+
|
|
22
|
+
### Step 2. Code Integration
|
|
23
|
+
|
|
24
|
+
Refer to Preparations guide to integrate the TUILiveKit SDK.
|
|
25
|
+
|
|
26
|
+
### Step 3. Add an Audience Viewing view
|
|
27
|
+
|
|
28
|
+
In your viewer watching **Activity**, initialize and add the `AudienceView` viewer watching view.
|
|
29
|
+
|
|
30
|
+
【Kotlin】
|
|
31
|
+
``` java
|
|
32
|
+
|
|
33
|
+
import android.os.Bundle
|
|
34
|
+
import android.util.Log
|
|
35
|
+
import androidx.appcompat.app.AppCompatActivity
|
|
36
|
+
import com.trtc.uikit.livekit.features.audienceview.AudienceView
|
|
37
|
+
import com.trtc.uikit.livekit.features.audienceview.AudienceViewDefine.AudienceViewListener
|
|
38
|
+
import io.trtc.tuikit.atomicxcore.api.live.LiveInfo
|
|
39
|
+
|
|
40
|
+
class AudienceActivity : AppCompatActivity() {
|
|
41
|
+
lateinit var audienceView: AudienceView
|
|
42
|
+
lateinit var listener: AudienceViewListener
|
|
43
|
+
|
|
44
|
+
override fun onCreate(savedInstanceState: Bundle?) {
|
|
45
|
+
super.onCreate(savedInstanceState)
|
|
46
|
+
// 1. Create AudienceView
|
|
47
|
+
audienceView = AudienceView(this)
|
|
48
|
+
val roomId = "live_1236666"
|
|
49
|
+
// 2. Initialize AudienceView
|
|
50
|
+
audienceView.init(this, roomId)
|
|
51
|
+
|
|
52
|
+
// 3. (Optional) Add AudienceContainerView event listeners
|
|
53
|
+
listener = object : AudienceViewListener {
|
|
54
|
+
|
|
55
|
+
override fun onLiveEnded(roomId: String, ownerName: String, ownerAvatarUrl: String) {
|
|
56
|
+
finishAndRemoveTask()
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
override fun onClickFloatWindow() {
|
|
60
|
+
// Picture-in-picture button click event. You can handle this event according to your business needs. Here's a code example: Clicking the picture-in-picture button will switch the current page to picture-in-picture mode.
|
|
61
|
+
enterPictureInPictureMode()
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
override fun onClickCloseButton(liveInfo: LiveInfo) {
|
|
65
|
+
Log.i("TAG", "onClickCloseButton liveInfo: $liveInfo")
|
|
66
|
+
finishAndRemoveTask()
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
audienceView.addListener(listener)
|
|
70
|
+
// 4. Add AudienceContainerView to the interface
|
|
71
|
+
setContentView(audienceView)
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
override fun onDestroy() {
|
|
75
|
+
// 5. (Optional) If you added event listeners, you need to remove the listeners when the page is destroyed.
|
|
76
|
+
audienceView.removeListener(listener)
|
|
77
|
+
super.onDestroy()
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### Step 4. Navigate to the **Audience Viewing** view
|
|
83
|
+
|
|
84
|
+
Usually in the live stream list, use the following code example when you need to jump to the viewer watching page:
|
|
85
|
+
|
|
86
|
+
【Kotlin】
|
|
87
|
+
``` java
|
|
88
|
+
fun startActivity(context: Context) {
|
|
89
|
+
val intent = Intent(context, YourAudienceActivity::class.java)
|
|
90
|
+
context.startActivity(intent)
|
|
91
|
+
}
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
## Customize Your UI Layout
|
|
95
|
+
|
|
96
|
+
### Customize the `AudienceView` Feature Area
|
|
97
|
+
- Customize the audience interface by referring to the Core Audience Page Modify the UI styles and add your business components in AudienceView.
|
|
98
|
+
|
|
99
|
+
- Customize video-slot widgets by referring to Adjust Live Streaming Widgets. Modify the UI of nameplates, avatar decorations, and other elements on the video slot in AudienceView.
|
|
100
|
+
|
|
101
|
+
### Text Customization (String Resources)
|
|
102
|
+
|
|
103
|
+
TUILiveKit uses standard **Android XML resource files** to manage the text displayed in the UI. You can directly modify the strings that need adjustment via the XML file:
|
|
104
|
+
|
|
105
|
+
### Icon Customization (Drawable Resources)
|
|
106
|
+
|
|
107
|
+
TUILiveKit uses the standard **Android drawable resource** folder to manage the image resources for the UI. You can quickly change the custom icons by replacing the resource files. When replacing, ensure that the new file names are consistent with the original file names.
|
|
108
|
+
|
|
109
|
+
## Next Steps
|
|
110
|
+
|
|
111
|
+
Congratulations! You have successfully integrated **Audience Viewing**. Next, you can implement features such as **host streaming**, **live stream list** and **gift system**. Please refer to the table below:
|
|
112
|
+
| <strong>Feature</strong> | <strong>Description</strong> | <strong>Integration Guide</strong> |
|
|
113
|
+
| --- | --- | --- |
|
|
114
|
+
| <strong>Host Streaming</strong> | The complete workflow for a host to start a stream, including pre-stream setup and various in-stream interactions. | Host Streaming |
|
|
115
|
+
| <strong>Live Stream List</strong> | Display the live stream list interface and features, including the live stream list and room information display. | Live Stream List |
|
|
116
|
+
| <strong>Gift System</strong> | Support custom gift asset configuration, billing system integration, and gift-sending in PK scenarios. | Gift System |
|
|
117
|
+
|
|
118
|
+
## FAQs
|
|
119
|
+
|
|
120
|
+
### Why is the video screen black when a viewer selects video co-hosting?
|
|
121
|
+
|
|
122
|
+
Please go to **App Info > Permissions > Camera** and check if the **camera permission** is enabled. Refer to the image below:
|
|
123
|
+
|
|
124
|
+
### Why can't other viewers in the live room see the barrage content sent by a viewer?
|
|
125
|
+
- **Reason 1**: First check the network connection to ensure the viewer's device network is normal.
|
|
126
|
+
|
|
127
|
+
- **Reason 2**: The viewer has been **muted (banned)** by the host and cannot send barrage.
|
|
128
|
+
|
|
129
|
+
- **Reason 3**: The viewer's barrage content involves **keyword blocking**. Please confirm whether the content sent by the viewer complies with the live room rules.
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
TUILiveKit’s host go-live page delivers a **fully featured, ready-to-use interface** for live streaming scenarios. It streamlines the process of building essential host live streaming functionality, allowing you to integrate the go-live workflow efficiently without the complexity of custom UI or logic development.
|
|
2
|
+
|
|
3
|
+
## Feature Overview
|
|
4
|
+
- **Pre-Live Preview:** Enables hosts to personalize settings before going live, including room name, cover image, video preview, beauty filter adjustment, audio effects, and layout templates.
|
|
5
|
+
|
|
6
|
+
- **Co-hosting Interaction:** Facilitates real-time collaboration between the host and audience, as well as with other hosts in separate live rooms during the stream.
|
|
7
|
+
|
|
8
|
+
- **Audience Engagement:** Provides interactive features such as live comments and virtual gifts to enhance audience participation.
|
|
9
|
+
|
|
10
|
+
- **Live Room Management:** Displays the list of online users and offers tools for managing the live room, including muting and removing users.
|
|
11
|
+
|
|
12
|
+
|**Pre-stream Setup**|**Co-Host Interaction**|**Audience Interaction**|**Live Room Management**|
|
|
13
|
+
|---------|---------|---------|---------|
|
|
14
|
+
|||||
|
|
15
|
+
|
|
16
|
+
## Quick Integration
|
|
17
|
+
|
|
18
|
+
### Step 1. Activate the Service
|
|
19
|
+
|
|
20
|
+
Refer to the Activate Service document to get the `TUILiveKit` trial version or activate the paid version.
|
|
21
|
+
|
|
22
|
+
### Step 2. Integrate the SDK
|
|
23
|
+
|
|
24
|
+
Refer to Preparations guide to integrate the `TUILiveKit` SDK.
|
|
25
|
+
|
|
26
|
+
### Step 3. Add the Pre-Live Preparation Page
|
|
27
|
+
|
|
28
|
+
The `AnchorPrepareView` component provides built-in camera preview, audio and layout settings, and other configuration options. Instantiate and display `AnchorPrepareView` as shown below:
|
|
29
|
+
|
|
30
|
+
【Kotlin】
|
|
31
|
+
``` java
|
|
32
|
+
import android.os.Bundle
|
|
33
|
+
import androidx.appcompat.app.AppCompatActivity
|
|
34
|
+
import com.trtc.uikit.livekit.features.anchorprepare.AnchorPrepareView
|
|
35
|
+
import com.trtc.uikit.livekit.features.anchorprepare.AnchorPrepareViewListener
|
|
36
|
+
|
|
37
|
+
class AnchorActivity : AppCompatActivity() {
|
|
38
|
+
private val TAG = "AnchorActivity"
|
|
39
|
+
|
|
40
|
+
lateinit var anchorPrepareView: AnchorPrepareView
|
|
41
|
+
private val anchorPrepareViewListener = object : AnchorPrepareViewListener {
|
|
42
|
+
override fun onClickStartButton() {
|
|
43
|
+
// Click the "Start Live Stream" button on the preview screen to trigger
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
override fun onClickBackButton() {
|
|
47
|
+
// Triggered by clicking the back button in the preview interface
|
|
48
|
+
finishAndRemoveTask()
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
override fun onCreate(savedInstanceState: Bundle?) {
|
|
52
|
+
super.onCreate(savedInstanceState)
|
|
53
|
+
// 1. Create and initialize AnchorPrepareView
|
|
54
|
+
anchorPrepareView = AnchorPrepareView(this)
|
|
55
|
+
anchorPrepareView.init("live_1236666", null)
|
|
56
|
+
anchorPrepareView.addAnchorPrepareViewListener(anchorPrepareViewListener)
|
|
57
|
+
|
|
58
|
+
// 2. Add AnchorPrepareView to the UI
|
|
59
|
+
setContentView(anchorPrepareView)
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### Step 4. Add the Host Streaming Page
|
|
65
|
+
|
|
66
|
+
The `AnchorView` component includes audio/video streaming, audience co-hosting, live interaction, and live room management. Instantiate and display `AnchorView` as shown below:
|
|
67
|
+
|
|
68
|
+
【Kotlin】
|
|
69
|
+
``` java
|
|
70
|
+
|
|
71
|
+
import android.os.Bundle
|
|
72
|
+
import androidx.appcompat.app.AppCompatActivity
|
|
73
|
+
import com.trtc.uikit.livekit.features.anchorprepare.AnchorPrepareView
|
|
74
|
+
import com.trtc.uikit.livekit.features.anchorprepare.AnchorPrepareViewListener
|
|
75
|
+
import com.trtc.uikit.livekit.features.anchorprepare.LiveStreamPrivacyStatus
|
|
76
|
+
import com.trtc.uikit.livekit.features.anchorview.AnchorState
|
|
77
|
+
import com.trtc.uikit.livekit.features.anchorview.AnchorView
|
|
78
|
+
import com.trtc.uikit.livekit.features.anchorview.AnchorViewListener
|
|
79
|
+
import com.trtc.uikit.livekit.features.anchorview.RoomBehavior
|
|
80
|
+
import io.trtc.tuikit.atomicxcore.api.live.LiveInfo
|
|
81
|
+
import io.trtc.tuikit.atomicxcore.api.live.SeatLayoutTemplate
|
|
82
|
+
|
|
83
|
+
class AnchorActivity : AppCompatActivity() {
|
|
84
|
+
private val TAG = "AnchorActivity"
|
|
85
|
+
|
|
86
|
+
lateinit var anchorPrepareView: AnchorPrepareView
|
|
87
|
+
private val anchorPrepareViewListener = object : AnchorPrepareViewListener {
|
|
88
|
+
override fun onClickStartButton() {
|
|
89
|
+
// Complete the switch from the preparation page to the streamer's live broadcast page.
|
|
90
|
+
initAnchorView()
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
override fun onClickBackButton() {
|
|
94
|
+
finishAndRemoveTask()
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
override fun onCreate(savedInstanceState: Bundle?) {
|
|
98
|
+
super.onCreate(savedInstanceState)
|
|
99
|
+
// 1. Create and initialize AnchorPrepareView
|
|
100
|
+
anchorPrepareView = AnchorPrepareView(this)
|
|
101
|
+
anchorPrepareView.init("live_1236666", null)
|
|
102
|
+
anchorPrepareView.addAnchorPrepareViewListener(anchorPrepareViewListener)
|
|
103
|
+
|
|
104
|
+
// 2. Add AnchorPrepareView to the UI
|
|
105
|
+
setContentView(anchorPrepareView)
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
val anchorViewListener = object : AnchorViewListener {
|
|
109
|
+
override fun onEndLiving(state: AnchorState) {
|
|
110
|
+
finishAndRemoveTask()
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
override fun onClickFloatWindow() {
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
fun initAnchorView() {
|
|
118
|
+
// 1. Create AnchorView
|
|
119
|
+
val anchorView = AnchorView(this)
|
|
120
|
+
|
|
121
|
+
// 2. Initialize AnchorView, where liveInfo is the live stream information and anchorPrepareView is your preparation page before starting your broadcast.
|
|
122
|
+
val liveInfo = LiveInfo()
|
|
123
|
+
liveInfo.liveID = "live_1236666"
|
|
124
|
+
liveInfo.liveName = anchorPrepareView.getState()?.roomName?.value ?: ""
|
|
125
|
+
liveInfo.isPublicVisible = anchorPrepareView.getState()?.liveMode?.value == LiveStreamPrivacyStatus.PUBLIC
|
|
126
|
+
liveInfo.coverURL = anchorPrepareView.getState()?.coverURL?.value ?: ""
|
|
127
|
+
liveInfo.seatTemplate = SeatLayoutTemplate.VideoDynamicGrid9Seats
|
|
128
|
+
|
|
129
|
+
// Entering a room:
|
|
130
|
+
// RoomBehavior.CREATE_ROOM: The streamer creates a room
|
|
131
|
+
// RoomBehavior.ENTER_ROOM: The streamer enters a live stream room created by the server-side REST API
|
|
132
|
+
anchorView.init(liveInfo, anchorPrepareView.getCoreView(), RoomBehavior.CREATE_ROOM, null)
|
|
133
|
+
anchorView.addAnchorViewListener(anchorViewListener)
|
|
134
|
+
|
|
135
|
+
// 3. Add AnchorView to the page
|
|
136
|
+
setContentView(anchorView)
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
## Customize Your UI Layout
|
|
142
|
+
|
|
143
|
+
TUILiveKit offers flexible customization for go-live and streaming pages. Adjust layouts and feature visibility to match your business requirements.
|
|
144
|
+
|
|
145
|
+
### Select a Live Streaming Layout Template
|
|
146
|
+
|
|
147
|
+
TUILiveKit provides **four live streaming layout templates**. Use the **"Layout"** option on the host go-live page to choose your preferred style.
|
|
148
|
+
|
|
149
|
+
#### Layout Template Overview
|
|
150
|
+
|
|
151
|
+
|Layout Type|**Dynamic Grid Layout**|**Floating Window Layout**|**Fixed Grid Layout**|**Fixed Floating Window Layout**|
|
|
152
|
+
|---------|---------|---------|---------|---------|
|
|
153
|
+
|Template ID|`VideoDynamicGrid9Seats`|`VideoDynamicFloat7Seats`|`VideoFixedGrid9Seats`|`VideoFixedFloat7Seats`|
|
|
154
|
+
|Description|Default layout. Grid size adjusts dynamically based on the number of co-hosts.|Co-hosts are displayed as floating windows.|Fixed number of co-hosts, each guest occupies a dedicated grid slot.|Fixed number of co-hosts, guests shown in fixed floating windows.|
|
|
155
|
+
|Preview|||||
|
|
156
|
+
|
|
157
|
+
### Customize the Preparation Page
|
|
158
|
+
|
|
159
|
+
Use the API from the `prepareView` instance created in Step 3 to control the visibility of the operation area or individual features on the preparation page.
|
|
160
|
+
``` java
|
|
161
|
+
import android.os.Bundle
|
|
162
|
+
import androidx.appcompat.app.AppCompatActivity
|
|
163
|
+
import com.trtc.uikit.livekit.features.anchorprepare.AnchorPrepareView
|
|
164
|
+
|
|
165
|
+
class AnchorActivity : AppCompatActivity() {
|
|
166
|
+
|
|
167
|
+
lateinit var anchorPrepareView: AnchorPrepareView
|
|
168
|
+
override fun onCreate(savedInstanceState: Bundle?) {
|
|
169
|
+
super.onCreate(savedInstanceState)
|
|
170
|
+
anchorPrepareView = AnchorPrepareView(this)
|
|
171
|
+
anchorPrepareView.init("live_1235858", null)
|
|
172
|
+
|
|
173
|
+
// 1. Customize the feature area - for example: hide the entire feature menu
|
|
174
|
+
anchorPrepareView.disableFeatureMenu(true)
|
|
175
|
+
|
|
176
|
+
setContentView(anchorPrepareView)
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
|**API**|**Description**|
|
|
182
|
+
|---------|---------|
|
|
183
|
+
|`disableFeatureMenu(true)`|Hide the entire feature menu|
|
|
184
|
+
|`disableMenuBeautyButton(true)`|Hide the beauty filter button|
|
|
185
|
+
|`disableMenuAudioEffectButton(true)`|Hide the audio effect button|
|
|
186
|
+
|`disableMenuSwitchCameraButton(true)`|Hide the camera switch button|
|
|
187
|
+
|
|
188
|
+
### Customize the Host Streaming Page UI
|
|
189
|
+
- See the Host Core Page documentation to customize the host UI in `AnchorView` and add custom business modules.
|
|
190
|
+
|
|
191
|
+
- See Adjust Video Live Widgets to modify video slot widgets (such as updating name or avatar) in `AnchorView`.
|
|
192
|
+
|
|
193
|
+
### Customize Texts
|
|
194
|
+
|
|
195
|
+
TUILiveKit uses Android-standard `XML` resource files to manage UI text. Modify any required text directly in the XML files.
|
|
196
|
+
|
|
197
|
+
### Customize Icons
|
|
198
|
+
|
|
199
|
+
TUILiveKit manages UI image assets in the Android `drawable` resource folder. To update interface icons, replace the resource files with your custom icons—ensure file names remain unchanged.
|
|
200
|
+
|
|
201
|
+
## Next Steps
|
|
202
|
+
|
|
203
|
+
Once you’ve integrated the **host go-live** feature, you can add additional capabilities such as **audience viewing**, **live stream list**, and **gift system**. See below for integration guides:
|
|
204
|
+
|
|
205
|
+
|**Feature**|**Description**|**Integration Guide**|
|
|
206
|
+
|---------|---------|---------|
|
|
207
|
+
|**Audience Viewing**|Allows audience members to join the host’s live room to watch the stream. Supports audience co-hosting, live room info, online audience list, live comments, and more.|Audience Viewing|
|
|
208
|
+
|**Live Stream List**|Displays the live stream list page and features, including the stream list and room details.|Live Stream List|
|
|
209
|
+
|**Gift System**|Supports custom gift asset configuration, billing integration, PK mode interaction, and more.|Gift System|
|
|
210
|
+
|
|
211
|
+
## FAQs
|
|
212
|
+
|
|
213
|
+
### No video after going live?
|
|
214
|
+
|
|
215
|
+
Navigate to **App Info > Permissions > Camera** and ensure camera access is enabled. See the screenshot below:
|
|
216
|
+
|
|
217
|
+
### Unable to go live after clicking the go-live button and seeing a "Not Logged In" prompt?
|
|
218
|
+
|
|
219
|
+
See the Login Guide and confirm your login functionality is integrated.
|
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
## Feature Preview
|
|
2
|
+
|
|
3
|
+
This document provides a detailed introduction to the **Live Stream List Page** in TUILiveKit. You can directly integrate our pre-built live stream list page into your existing project, or deeply customize the page style, layout, and features according to your specific needs.
|
|
4
|
+
- **Double-Column Waterfall Flow**: Default view, simultaneously displaying previews for 2 live rooms.
|
|
5
|
+
|
|
6
|
+
- **Single-Column Waterfall Flow**: Default view, simultaneously displaying a preview for 1 live room.
|
|
7
|
+
|
|
8
|
+
| <strong>Double-Column Waterfall Flow</strong> | <strong>Single-Column Waterfall Flow</strong> |
|
|
9
|
+
| --- | --- |
|
|
10
|
+
| | ### |
|
|
11
|
+
|
|
12
|
+
> **Note:**
|
|
13
|
+
>
|
|
14
|
+
> When previewing live room screens, the preview duration is counted into the viewer's audio/video duration. For detailed billing information, please refer to [Pricing](https://www.tencentcloud.com/document/product/647/66078).
|
|
15
|
+
>
|
|
16
|
+
|
|
17
|
+
## Quick Start
|
|
18
|
+
|
|
19
|
+
### Step 1. Activate the Service
|
|
20
|
+
|
|
21
|
+
Refer to the Activate Service document to enable the Free trial or official package.
|
|
22
|
+
|
|
23
|
+
### Step 2. Code Integration
|
|
24
|
+
|
|
25
|
+
Refer to Preparations guide to integrate the TUILiveKit SDK.
|
|
26
|
+
|
|
27
|
+
### Step 3. Add the Live Stream List Page
|
|
28
|
+
|
|
29
|
+
The **LiveListView** component is a dedicated view for displaying the live stream list. It automatically pulls the live room list, supports different display styles (**single-column** and **double-column**).
|
|
30
|
+
|
|
31
|
+
【Kotlin】
|
|
32
|
+
``` java
|
|
33
|
+
import android.content.Context
|
|
34
|
+
import android.os.Bundle
|
|
35
|
+
import androidx.appcompat.app.AppCompatActivity
|
|
36
|
+
import com.trtc.uikit.livekit.features.livelist.LiveListView
|
|
37
|
+
import com.trtc.uikit.livekit.features.livelist.Style
|
|
38
|
+
|
|
39
|
+
class YourActivity : AppCompatActivity() {
|
|
40
|
+
override fun onCreate(savedInstanceState: Bundle?) {
|
|
41
|
+
super.onCreate(savedInstanceState)
|
|
42
|
+
// 1. Create and initialize waterfall layout view
|
|
43
|
+
val view = createLiveListView(this)
|
|
44
|
+
// 2. Add the created LiveListView to your Activity or Fragment
|
|
45
|
+
setContentView(view)
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
fun createLiveListView(context: Context): LiveListView {
|
|
49
|
+
val liveListView = LiveListView(context)
|
|
50
|
+
// This code is a two-column waterfall layout initialization example. If you need to use a single column waterfall layout, change the initialization code to liveListView.init(this, Style.SINGLE_COLUMN)
|
|
51
|
+
liveListView.init(this, Style.DOUBLE_COLUMN)
|
|
52
|
+
return liveListView
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
【Java】
|
|
58
|
+
``` java
|
|
59
|
+
import android.content.Context;
|
|
60
|
+
import android.os.Bundle;
|
|
61
|
+
|
|
62
|
+
import androidx.appcompat.app.AppCompatActivity;
|
|
63
|
+
|
|
64
|
+
import com.trtc.uikit.livekit.features.livelist.LiveListView;
|
|
65
|
+
import com.trtc.uikit.livekit.features.livelist.Style;
|
|
66
|
+
|
|
67
|
+
public class YourActivity extends AppCompatActivity {
|
|
68
|
+
|
|
69
|
+
@Override
|
|
70
|
+
protected void onCreate(Bundle savedInstanceState) {
|
|
71
|
+
super.onCreate(savedInstanceState);
|
|
72
|
+
// 1. Create and initialize waterfall layout view
|
|
73
|
+
LiveListView view = createLiveListView(this);
|
|
74
|
+
// 2. Add the created LiveListView to your Activity or Fragment
|
|
75
|
+
setContentView(view);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
private LiveListView createLiveListView(Context context) {
|
|
79
|
+
LiveListView liveListView = new LiveListView(context);
|
|
80
|
+
// This code is a two-column waterfall layout initialization example. If you need to use a single column waterfall layout, change the initialization code to liveListView.init(this, Style.SINGLE_COLUMN, null, null);
|
|
81
|
+
liveListView.init(this, Style.DOUBLE_COLUMN, null, null);
|
|
82
|
+
return liveListView;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### Step 4. Navigate to the Audience Viewing Page
|
|
88
|
+
|
|
89
|
+
You can customize the page navigation by setting a click listener. For audience viewing page implementation, see Audience Viewing:
|
|
90
|
+
|
|
91
|
+
**Example Code**:
|
|
92
|
+
|
|
93
|
+
【Kotlin】
|
|
94
|
+
``` java
|
|
95
|
+
fun createLiveListView(context: Context): LiveListView {
|
|
96
|
+
val liveListView = LiveListView(context)
|
|
97
|
+
// This code is a two-column waterfall layout initialization example. If you need to use a single column waterfall layout, change the initialization code to liveListView.init(this, Style.SINGLE_COLUMN)
|
|
98
|
+
liveListView.init(this, Style.DOUBLE_COLUMN)
|
|
99
|
+
|
|
100
|
+
liveListView.setOnItemClickListener { view, liveInfo ->
|
|
101
|
+
click live list item to redirect to audience viewing page
|
|
102
|
+
val intent = Intent(context, YourAudienceActivity::class.java)
|
|
103
|
+
intent.putExtra("liveId", liveInfo.roomId)
|
|
104
|
+
context.startActivity(intent)
|
|
105
|
+
}
|
|
106
|
+
return liveListView
|
|
107
|
+
}
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
【Java】
|
|
111
|
+
``` java
|
|
112
|
+
private LiveListView createLiveListView(Context context) {
|
|
113
|
+
LiveListView liveListView = new LiveListView(context);
|
|
114
|
+
// This code is a two-column waterfall layout initialization example. If you need to use a single column waterfall layout, change the initialization code to liveListView.init(this, Style.SINGLE_COLUMN, null, null);
|
|
115
|
+
liveListView.init(this, Style.DOUBLE_COLUMN, null, null);
|
|
116
|
+
|
|
117
|
+
liveListView.setOnItemClickListener((view, liveInfo) -> {
|
|
118
|
+
click live list item to redirect to audience viewing page
|
|
119
|
+
Intent intent = new Intent(context, YourAudienceActivity.class);
|
|
120
|
+
intent.putExtra("liveId", liveInfo.roomId);
|
|
121
|
+
context.startActivity(intent);
|
|
122
|
+
});
|
|
123
|
+
return liveListView;
|
|
124
|
+
}
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
## Customize Your UI Layout
|
|
128
|
+
|
|
129
|
+
**TUILiveKit** provides flexible interfaces to customize the live list waterfall component. You can customize the data source and list item styles according to your business needs.
|
|
130
|
+
|
|
131
|
+
### Customize Data Source
|
|
132
|
+
|
|
133
|
+
If your backend has a separate live list data, you can customize the data source by implementing the `LiveListDataSource` interface instead of using the component's default list data.
|
|
134
|
+
|
|
135
|
+
【Kotlin】
|
|
136
|
+
``` java
|
|
137
|
+
// 1. Import dependency
|
|
138
|
+
import com.trtc.uikit.livekit.features.livelist.LiveListDataSource;
|
|
139
|
+
|
|
140
|
+
// 2. Customize the data source by implementing LiveListDataSource
|
|
141
|
+
val dataSource = object : LiveListDataSource {
|
|
142
|
+
override fun fetchLiveList(param: FetchLiveListParam,callback: LiveListCallback) {
|
|
143
|
+
// Connect to your own business backend and return data to the UI component in the following format
|
|
144
|
+
val liveInfoList = mutableListOf<TUILiveListManager.LiveInfo>()
|
|
145
|
+
val liveInfo = TUILiveListManager.LiveInfo().apply {
|
|
146
|
+
roomInfo = TUIRoomDefine.RoomInfo().apply {
|
|
147
|
+
roomId = "live_123456"
|
|
148
|
+
name = "live_123456"
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
liveInfoList.add(liveInfo)
|
|
152
|
+
val cursor = "aabbccdd"
|
|
153
|
+
callback.onSuccess(cursor, liveInfoList)
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
// 3. Import a custom dataSource during initialization
|
|
158
|
+
liveListView.init(this, Style.DOUBLE_COLUMN, dataSource = dataSource)
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
【Java】
|
|
162
|
+
``` java
|
|
163
|
+
// 1. Import dependency
|
|
164
|
+
import com.trtc.uikit.livekit.features.livelist.LiveListDataSource;
|
|
165
|
+
|
|
166
|
+
// 2. Customize the data source by implementing LiveListDataSource
|
|
167
|
+
LiveListDataSource dataSource = (param, callback) -> {
|
|
168
|
+
// Connect to your own business backend and return data to the UI component in the following format
|
|
169
|
+
List<TUILiveListManager.LiveInfo> liveInfoList = new ArrayList<>();
|
|
170
|
+
TUILiveListManager.LiveInfo liveInfo = new TUILiveListManager.LiveInfo();
|
|
171
|
+
liveInfo.roomInfo = new TUIRoomDefine.RoomInfo();
|
|
172
|
+
liveInfo.roomInfo.roomId = "live_123456";
|
|
173
|
+
liveInfo.roomInfo.name = "live_123456";
|
|
174
|
+
liveInfoList.add(liveInfo);
|
|
175
|
+
String cursor = "aabbccdd";
|
|
176
|
+
callback.onSuccess(cursor, liveInfoList);
|
|
177
|
+
};
|
|
178
|
+
|
|
179
|
+
// 3. Import a custom dataSource during initialization
|
|
180
|
+
liveListView.init(this, Style.DOUBLE_COLUMN, null, dataSource);
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
### Custom View
|
|
184
|
+
|
|
185
|
+
The bottom of the waterfall list items displays the video stream or live cover by default. If you need to customize the UI elements at the top of the list items (such as the host's avatar, live title, etc.), you can do so by implementing the `LiveListViewAdapter` interface.
|
|
186
|
+
|
|
187
|
+
【Kotlin】
|
|
188
|
+
``` java
|
|
189
|
+
// 1. Import dependency
|
|
190
|
+
import com.trtc.uikit.livekit.features.livelist.LiveListViewAdapter;
|
|
191
|
+
|
|
192
|
+
// 2. Implement LiveListViewAdapter to customize widgets
|
|
193
|
+
val liveListViewAdapter = object : LiveListViewAdapter {
|
|
194
|
+
override fun createLiveInfoView(liveInfo: TUILiveListManager.LiveInfo): View {
|
|
195
|
+
// Custom view
|
|
196
|
+
val widgetView = YourView(context)
|
|
197
|
+
widgetView.init(liveInfo)
|
|
198
|
+
return widgetView
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
override fun updateLiveInfoView(view: View, liveInfo: TUILiveListManager.LiveInfo) {
|
|
202
|
+
// Refresh the bound data in the view
|
|
203
|
+
val widgetView = view as YourView
|
|
204
|
+
widgetView.updateLiveInfoView(liveInfo)
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
// 3. Import a custom liveListViewAdapter during initialization
|
|
209
|
+
liveListView.init(this, Style.DOUBLE_COLUMN, adapter = liveListViewAdapter)
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
【Java】
|
|
213
|
+
``` java
|
|
214
|
+
// 1. Import dependency
|
|
215
|
+
import com.trtc.uikit.livekit.features.livelist.LiveListViewAdapter;
|
|
216
|
+
|
|
217
|
+
// 2. Implement LiveListViewAdapter to customize widgets
|
|
218
|
+
LiveListViewAdapter liveListViewAdapter = new LiveListViewAdapter() {
|
|
219
|
+
@Override
|
|
220
|
+
public View createLiveInfoView(TUILiveListManager.LiveInfo liveInfo) {
|
|
221
|
+
// Custom view
|
|
222
|
+
CustomView widgetView = new CustomView(context);
|
|
223
|
+
widgetView.init(liveInfo);
|
|
224
|
+
return widgetView;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
@Override
|
|
228
|
+
public void updateLiveInfoView(View view, TUILiveListManager.LiveInfo liveInfo) {
|
|
229
|
+
// Refresh the bound data in the view
|
|
230
|
+
CustomView widgetView = (CustomView) view;
|
|
231
|
+
widgetView.updateLiveInfoView(liveInfo);
|
|
232
|
+
}
|
|
233
|
+
};
|
|
234
|
+
|
|
235
|
+
// 3. Import a custom liveListViewAdapter during initialization
|
|
236
|
+
liveListView.init(this, Style.DOUBLE_COLUMN, liveListViewAdapter, null);
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
## Next Steps
|
|
240
|
+
|
|
241
|
+
Congratulations! You have successfully integrated the **Live Stream List** feature. Next, you can implement features such as **Host Live Streaming** and **Audience Viewing**. Please refer to the table below:
|
|
242
|
+
| <strong>Feature</strong> | <strong>Description</strong> | <strong>Integration Guide</strong> |
|
|
243
|
+
| --- | --- | --- |
|
|
244
|
+
| <strong>Host Streaming</strong> | The complete workflow for a host to start a stream, including pre-stream setup and various in-stream interactions. | Host Streaming |
|
|
245
|
+
| <strong>Audience Viewing</strong> | Audience can watch live streaming after entering the anchor's live streaming room, with features like audience mic connection, live room information, online audience, and bullet screen display. | Audience Viewing |
|
|
246
|
+
|
|
247
|
+
## FAQs
|
|
248
|
+
|
|
249
|
+
### What should I do if the page shows no live streams after integrating the live list feature?
|
|
250
|
+
|
|
251
|
+
If you see a blank page, you need to check if you have completed the Complete Login. To test this feature, you can use two devices: one device to start a broadcast, and the other on the live list page to pull the list of ongoing live streams.
|
|
252
|
+
|
|
253
|
+
### What is the difference between single-column and double-column waterfall flows?
|
|
254
|
+
|
|
255
|
+
A single-column waterfall flow previews one live room at a time, while a double-column waterfall flow previews two live rooms simultaneously. You can choose the appropriate layout based on your design requirements.
|
|
256
|
+
|
|
257
|
+
### Is there a charge for previewing live streams?
|
|
258
|
+
|
|
259
|
+
Yes, the duration of previewing a live room is counted towards the audience's audio/video duration, which is a paid service. For detailed
|
|
260
|
+
|
|
261
|
+
Pricing, you can refer to the relevant content in the documentation.
|