@tencent-rtc/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/chunker.js +83 -54
- package/knowledge/path-meta.js +179 -26
- package/knowledge/search/exact-lookup.js +153 -0
- 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 +235 -58
- 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/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-config.js +7 -4
- 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/is-valid-sdkappid.js +4 -0
- 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,204 @@
|
|
|
1
|
+
## Feature Overview
|
|
2
|
+
|
|
3
|
+
**TUILiveKit** is a comprehensive live-streaming component. Once integrated, it allows you to quickly implement the following key functional modules for your Android application:
|
|
4
|
+
|
|
5
|
+
|**Host Prepare Page**|**Host Streaming Page**|**Live Stream List**|**Audience Viewing Page**|
|
|
6
|
+
|---------|---------|---------|---------|
|
|
7
|
+
|||||
|
|
8
|
+
|
|
9
|
+
## **Preparations**
|
|
10
|
+
|
|
11
|
+
### Activate Service
|
|
12
|
+
|
|
13
|
+
Before using **TUILiveKit**, please refer to Activate Service to get the TUILiveKit trial version or activate the paid version.
|
|
14
|
+
|
|
15
|
+
### Environment Requirements
|
|
16
|
+
- **Xcode**: Requires **Xcode 15** or a later version.
|
|
17
|
+
|
|
18
|
+
- **iOS**: Supports devices running **iOS 14.0** or a later version.
|
|
19
|
+
|
|
20
|
+
- **CocoaPods environment**: A CocoaPods environment must be installed. If you haven't installed it, please refer to the [CocoaPods installation guide](https://guides.cocoapods.org/using/getting-started.html), or follow these steps:
|
|
21
|
+
|
|
22
|
+
- **Install CocoaPods using gem**: execute the `sudo gem install cocoapods` command in the terminal to install.
|
|
23
|
+
|
|
24
|
+
> **Note:**
|
|
25
|
+
>
|
|
26
|
+
> During the `sudo gem install cocoapods` installation process, you may be prompted to enter your computer's password. Enter the administrator password as prompted.
|
|
27
|
+
>
|
|
28
|
+
|
|
29
|
+
## Code Integration
|
|
30
|
+
|
|
31
|
+
### Step 1. Import Components Via CocoaPods
|
|
32
|
+
1. **Add Pod dependency:**
|
|
33
|
+
|
|
34
|
+
- **If your project already has a Podfile.**
|
|
35
|
+
|
|
36
|
+
Add the `pod 'TUILiveKit'` dependency in your project's `Podfile` file. For example:
|
|
37
|
+
|
|
38
|
+
``` ruby
|
|
39
|
+
target 'YourProjectTarget' do
|
|
40
|
+
# Other existing Pod dependencies...
|
|
41
|
+
# Add pod 'TUILiveKit' dependency
|
|
42
|
+
pod 'TUILiveKit'
|
|
43
|
+
|
|
44
|
+
end
|
|
45
|
+
```
|
|
46
|
+
- **If your project does not have a Podfile.**
|
|
47
|
+
|
|
48
|
+
Switch to your **.xcodeproj** directory using the `cd` command in the terminal, then execute pod init to create the **Podfile**. After creation, add the `pod 'TUILiveKit'` dependency to your **Podfile**. For example:
|
|
49
|
+
|
|
50
|
+
``` bash
|
|
51
|
+
# If your project directory is /Users/yourusername/Projects/YourProject
|
|
52
|
+
|
|
53
|
+
# 1. cd to your .xcodeproj project directory
|
|
54
|
+
cd /Users/yourusername/Projects/YourProject
|
|
55
|
+
|
|
56
|
+
# 2. Execute pod init. This command will generate a Podfile in your project directory.
|
|
57
|
+
pod init
|
|
58
|
+
|
|
59
|
+
# 3. Add pod 'TUILiveKit' dependency in the generated Podfile file
|
|
60
|
+
target 'YourProjectTarget' do
|
|
61
|
+
# Add pod 'TUILiveKit' dependency
|
|
62
|
+
pod 'TUILiveKit'
|
|
63
|
+
|
|
64
|
+
end
|
|
65
|
+
```
|
|
66
|
+
2. **Install components**:
|
|
67
|
+
|
|
68
|
+
`cd` to the directory containing the **Podfile** in the terminal, then execute the following command to install the component.
|
|
69
|
+
|
|
70
|
+
``` bash
|
|
71
|
+
pod install
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### Step 2. Project Configuration (Device Permissions)
|
|
75
|
+
|
|
76
|
+
To use the audio/video features, your application needs to obtain permissions for the microphone and camera. Please add the following two entries to your application's `Info.plist` file, and provide corresponding usage descriptions. These descriptions will be displayed to the user when the system requests permission:
|
|
77
|
+
``` bash
|
|
78
|
+
<key>NSCameraUsageDescription</key>
|
|
79
|
+
<string>TUILiveKit needs camera access to enable video recording with picture</string>
|
|
80
|
+
<key>NSMicrophoneUsageDescription</key>
|
|
81
|
+
<string>TUILiveKit needs microphone permission to enable sound in recorded videos</string>
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## Complete Login
|
|
85
|
+
|
|
86
|
+
After code integration, the next step is to complete the login. All **TUILiveKit** features require a successful login to function properly, so ensure your parameters are configured correctly.
|
|
87
|
+
|
|
88
|
+
> **Note:**
|
|
89
|
+
>
|
|
90
|
+
> In the example code, the login API is called directly. However, in a real-world application, it is highly recommended that you call the **TUILiveKit** login service only after your own user authentication and other internal login processes are complete. This prevents potential business logic confusion or data inconsistency caused by calling the login service too early, and it better aligns with your existing user management system.
|
|
91
|
+
>
|
|
92
|
+
|
|
93
|
+
【Swift】
|
|
94
|
+
``` swift
|
|
95
|
+
//
|
|
96
|
+
// AppDelegate.swift
|
|
97
|
+
//
|
|
98
|
+
|
|
99
|
+
// 1. Import AtomicXCore
|
|
100
|
+
import AtomicXCore
|
|
101
|
+
|
|
102
|
+
// 2. The example code completes login in didFinishLaunchingWithOptions. Recommendation for you: call the login service after completing your own login service.
|
|
103
|
+
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
|
|
104
|
+
|
|
105
|
+
// 3. Call the login API
|
|
106
|
+
LoginStore.shared.login(sdkAppID: 1400000001, // replace with the SDKAppID from the service console
|
|
107
|
+
userID: "denny", // replace with your UserID
|
|
108
|
+
userSig: "xxxxxxxxxxx") { [weak self] result in
|
|
109
|
+
// You can calculate a UserSig in the console and fill it in this location
|
|
110
|
+
print("login success")
|
|
111
|
+
|
|
112
|
+
guard let self = self else { return }
|
|
113
|
+
switch result {
|
|
114
|
+
case .success():
|
|
115
|
+
print("login success")
|
|
116
|
+
case .failure(let err):
|
|
117
|
+
print("login failed. code: \(err.code), error:\(err.message)")
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
return true
|
|
122
|
+
}
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
**Login API Parameter Description**
|
|
126
|
+
| Parameter | Type | Description |
|
|
127
|
+
| --- | --- | --- |
|
|
128
|
+
| SDKAppID | Int | Get this from <a href="https://console.trtc.io/app">TRTC console > Application management</a>. |
|
|
129
|
+
| UserID | String | The unique ID for the current user. Must contain only English letters, numbers, hyphens, and underscores. |
|
|
130
|
+
| userSig | String | A ticket for Tencent Cloud authentication. Please note:<br>- <strong>Development Environment</strong>: You can use the local <code>GenerateTestUserSig.genTestSig</code> function to generate a UserSig or generate a temporary UserSig via the <a href="https://console.trtc.io/usersig">UserSig Generation Tool</a>.<br>- <strong>Production Environment</strong>: To prevent key leakage, you must use a server-side method to generate UserSig. For details, see Generating UserSig on the Server.<br>For more information, see <a href="https://www.tencentcloud.com/document/product/647/35166">How to Calculate and Use UserSig</a>. |
|
|
131
|
+
|
|
132
|
+
## Handling Login Exceptions (Optional)
|
|
133
|
+
|
|
134
|
+
`LoginStore` offers login status callbacks to help you handle exceptions, including "**Kicked Offline**" and "**Signature Expired"**:
|
|
135
|
+
- **Kicked Offline**: If a user is kicked offline while logged in, the SDK triggers the onKickedOffline callback. Prompt the user in your UI and call LoginStore.shared.login to re-login.
|
|
136
|
+
|
|
137
|
+
- **Signature Expired:** If the onUserSigExpired callback is triggered, the user's userSig has expired. If their login state is still valid on your backend, request a new userSig and call LoginStore.shared.login to refresh their login.
|
|
138
|
+
|
|
139
|
+
【Swift】
|
|
140
|
+
``` java
|
|
141
|
+
// YourLoginService represents the business module responsible for login
|
|
142
|
+
class YourLoginService: NSObject {
|
|
143
|
+
private var cancelableSet: Set<AnyCancellable> = []
|
|
144
|
+
|
|
145
|
+
// Listen to login status callback
|
|
146
|
+
func subscribeLoginStatus() {
|
|
147
|
+
LoginStore.shared.loginEventPublisher
|
|
148
|
+
.receive(on: RunLoop.main)
|
|
149
|
+
.sink { [weak self] loginEvent in
|
|
150
|
+
guard let self = self else { return }
|
|
151
|
+
switch loginEvent {
|
|
152
|
+
case .kickedOffline: // User kicked offline callback
|
|
153
|
+
// Your business code: UI prompt user, then log in again
|
|
154
|
+
break
|
|
155
|
+
case .loginExpired: // User signature expired callback
|
|
156
|
+
// Your business code: If the current user is still logged in on your backend,
|
|
157
|
+
// you can have your app request a new userSig from your backend and call LoginStore.shared.login to renew the login status.
|
|
158
|
+
break
|
|
159
|
+
default:
|
|
160
|
+
break
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
.store(in: &self.cancelableSet)
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
## Next Steps
|
|
169
|
+
|
|
170
|
+
Congratulations! You have successfully integrated the **TUILiveKit** component and completed the login. You can now implement features such as host streaming, viewer watching, and the live stream list. Please refer to the table below for integration guides:
|
|
171
|
+
| <strong>Feature</strong> | <strong>Description</strong> | <strong>Integration Guide</strong> |
|
|
172
|
+
| --- | --- | --- |
|
|
173
|
+
| <strong>Video Live Streaming</strong> | Includes a full suite of features such as host broadcasting, audience viewing, interactive co-hosting, beauty filters, gifts, and bullet chat. | - Host Broadcasting<br>- Audience Viewing |
|
|
174
|
+
| <strong>Voice Chat Room</strong> | Includes complete business logic such as mic seat management, background music (BGM), gift interactivity, and voice room control. | - Host Broadcasting<br>- Audience Viewing |
|
|
175
|
+
| <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 |
|
|
176
|
+
|
|
177
|
+
## FAQs
|
|
178
|
+
|
|
179
|
+
### After executing pod install, why can't I find the latest version of TUILiveKit locally?
|
|
180
|
+
|
|
181
|
+
If you are unable to install the latest version of TUILiveKit, please follow these steps:
|
|
182
|
+
1. In the directory where the **Podfile** is located, delete `Podfile.lock` and `Pods`. You can choose to delete them manually or execute the following command in the terminal:
|
|
183
|
+
|
|
184
|
+
``` bash
|
|
185
|
+
// cd to the directory where Podfile is located
|
|
186
|
+
|
|
187
|
+
rm -rf Pods/
|
|
188
|
+
rm Podfile.lock
|
|
189
|
+
```
|
|
190
|
+
2. In the directory where Podfile is located, execute `pod install --repo-update`
|
|
191
|
+
|
|
192
|
+
``` bash
|
|
193
|
+
// cd to the directory where Podfile is located
|
|
194
|
+
|
|
195
|
+
pod install --repo-update
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
### Do I need to call the login method every time I enter a room?
|
|
199
|
+
|
|
200
|
+
No. You usually only need to complete one `TUILogin.login` call. We recommend associating `TUILogin.login` and `TUILogin.logout` with your own application's login business logic.
|
|
201
|
+
|
|
202
|
+
### Is there a sample configuration for the Podfile that I can refer to?
|
|
203
|
+
|
|
204
|
+
You can refer to the [GitHub TUILiveKit Example](https://github.com/Tencent-RTC/TUIKit_iOS/blob/main/application/Podfile) project `Podfile` sample file.
|
|
@@ -37,7 +37,6 @@ Create a **live-list.vue** file in your project and add the following code to em
|
|
|
37
37
|
|
|
38
38
|
> **Note:**
|
|
39
39
|
>
|
|
40
|
-
|
|
41
40
|
> You can copy the code below directly into your project, or check the [Live Stream List](https://github.com/Tencent-RTC/TUILiveKit/blob/main/Web/web-vite-vue3/src/TUILiveKit/LiveListView.vue) for the full source code.
|
|
42
41
|
>
|
|
43
42
|
|
|
@@ -84,7 +83,6 @@ onMounted(async () => {
|
|
|
84
83
|
|
|
85
84
|
> **Note:**
|
|
86
85
|
>
|
|
87
|
-
|
|
88
86
|
> To enable navigation from the Live Stream List to a specific live room, see the Specify Live Room section below.
|
|
89
87
|
>
|
|
90
88
|
|
|
@@ -96,7 +94,6 @@ After running the following command, open your browser and visit your local addr
|
|
|
96
94
|
|
|
97
95
|
> **Tip:**
|
|
98
96
|
>
|
|
99
|
-
|
|
100
97
|
> Once the command completes, enter your local address in the browser (for example, `http://localhost:5173/live-list`; your port number may differ based on your project setup) to view the Live Stream List page.
|
|
101
98
|
>
|
|
102
99
|
|
|
@@ -44,7 +44,6 @@ Create a `live-player.vue` file in your project. Copy and paste the following co
|
|
|
44
44
|
|
|
45
45
|
> **Note:**
|
|
46
46
|
>
|
|
47
|
-
|
|
48
47
|
> You can use the code below directly, or refer to [Audience Viewing](https://github.com/Tencent-RTC/TUILiveKit/blob/main/Web/web-vite-vue3/src/TUILiveKit/component/LivePlayer/LivePlayerPC.vue) for the full source.
|
|
49
48
|
>
|
|
50
49
|
|
|
@@ -137,7 +136,6 @@ Open your terminal, navigate to your project directory, and run the following co
|
|
|
137
136
|
|
|
138
137
|
> **Note:**
|
|
139
138
|
>
|
|
140
|
-
|
|
141
139
|
> After the command runs successfully, enter your local access URL in your browser (for example, `http://localhost:5173/live-player`; the port may vary based on your setup) to access the viewer page.
|
|
142
140
|
>
|
|
143
141
|
|
|
@@ -158,7 +156,6 @@ npm run dev
|
|
|
158
156
|
|
|
159
157
|
> **Tips:**
|
|
160
158
|
>
|
|
161
|
-
|
|
162
159
|
> Use different **userID** for hosting and viewing. If the same user ID logs in on multiple devices, the later login will force the earlier device offline (**kick offline**).
|
|
163
160
|
>
|
|
164
161
|
|
|
@@ -172,7 +169,6 @@ To enable navigation from the Live Stream List or homepage to the live room, con
|
|
|
172
169
|
|
|
173
170
|
> **Note:**
|
|
174
171
|
>
|
|
175
|
-
|
|
176
172
|
> In the code below, `live-player.vue` refers to the sample file created in Step 3.
|
|
177
173
|
>
|
|
178
174
|
|
|
@@ -289,7 +285,6 @@ export { useCustomizedAutoPlayDialog };
|
|
|
289
285
|
|
|
290
286
|
> **Note:**
|
|
291
287
|
>
|
|
292
|
-
|
|
293
288
|
> Make sure to install the required `@tencentcloud/tuiroom-engine-js` package.
|
|
294
289
|
>
|
|
295
290
|
|
|
@@ -44,7 +44,6 @@ Create a **live-player.vue** file in your project. Copy the following code to in
|
|
|
44
44
|
|
|
45
45
|
> **Note:**
|
|
46
46
|
>
|
|
47
|
-
|
|
48
47
|
> You can copy the code below directly into your project, or visit [Audience Viewing](https://github.com/Tencent-RTC/TUILiveKit/blob/main/Web/web-vite-vue3/src/TUILiveKit/component/LivePlayer/LivePlayerH5.vue) for more detailed source code.
|
|
49
48
|
>
|
|
50
49
|
|
|
@@ -138,7 +137,6 @@ Open your terminal, navigate to your project directory, and run the following co
|
|
|
138
137
|
|
|
139
138
|
> **Note:**
|
|
140
139
|
>
|
|
141
|
-
|
|
142
140
|
> After running the command, enter the local access address in your browser’s address bar (refer to your project configuration, for example `http://localhost:5173/live-player`; the actual port may vary) to view the viewer page.
|
|
143
141
|
>
|
|
144
142
|
|
|
@@ -159,7 +157,6 @@ npm run dev
|
|
|
159
157
|
|
|
160
158
|
> **Important:**
|
|
161
159
|
>
|
|
162
|
-
|
|
163
160
|
> Use different **User IDs** for hosting and viewing. Otherwise, the device that logs in later will forcibly log out the device that logged in first (i.e., "kicked offline").
|
|
164
161
|
>
|
|
165
162
|
|
|
@@ -169,7 +166,6 @@ Refer to Step 3 in the quick integration above. Enter the corresponding `liveId`
|
|
|
169
166
|
|
|
170
167
|
> **Note:**
|
|
171
168
|
>
|
|
172
|
-
|
|
173
169
|
> To update your personal information, use the `setSelfInfo` method in the sample code from Step 3.
|
|
174
170
|
>
|
|
175
171
|
|
|
@@ -179,7 +175,6 @@ To enable navigation from the live stream list (or homepage) to the live room, c
|
|
|
179
175
|
|
|
180
176
|
> **Note:**
|
|
181
177
|
>
|
|
182
|
-
|
|
183
178
|
> The `live-player.vue` file in the following code sample corresponds to the sample file created in Step 3.
|
|
184
179
|
>
|
|
185
180
|
|
|
@@ -295,7 +290,6 @@ export { useCustomizedAutoPlayDialog };
|
|
|
295
290
|
|
|
296
291
|
> **Note:**
|
|
297
292
|
>
|
|
298
|
-
|
|
299
293
|
> Install the required `@tencentcloud/tuiroom-engine-js` package.
|
|
300
294
|
>
|
|
301
295
|
|
|
@@ -47,7 +47,6 @@ Create a `live-pusher.vue` file in your project. Copy the code below into your n
|
|
|
47
47
|
|
|
48
48
|
> **Note:**
|
|
49
49
|
>
|
|
50
|
-
|
|
51
50
|
> You can copy the code below directly into your project, or visit the [Live Start Page](https://github.com/Tencent-RTC/TUILiveKit/blob/main/Web/web-vite-vue3/src/TUILiveKit/LivePusherView.vue) for the full source code.
|
|
52
51
|
>
|
|
53
52
|
|
|
@@ -158,6 +157,8 @@ onMounted(async () => {
|
|
|
158
157
|
<style scoped>.custom-live-pusher,.left-panel{flex-direction:column;display:flex}.custom-live-pusher,.live-title{color:var(--text-color-primary)}.live-controls,.tools-section,.top-controls{backdrop-filter:blur(10px)}*{box-sizing:border-box;margin:0;padding:0}:global(::before){box-sizing:border-box;margin:0;padding:0}.layout-label,.template-options{margin-bottom:16px}:global(body){line-height:1.6;color:var(--text-color-primary);background:var(--bg-color-default)}.custom-live-pusher{height:100vh;width:100vw;background:linear-gradient(135deg,var(--bg-color-default) 0,var(--bg-color-function) 100%);overflow:hidden}.top-controls{display:flex;justify-content:space-between;align-items:center;padding:12px 20px;background:var(--bg-color-operate);border-bottom:1px solid var(--stroke-color-primary);z-index:100;min-height:60px}.live-title{font-size:18px;font-weight:600;text-shadow:0 2px 4px var(--shadow-color)}.audience-count{font-size:14px;color:var(--text-color-error);background:var(--uikit-color-red-1);padding:6px 12px;border-radius:20px;border:1px solid var(--uikit-color-red-3)}.live-controls,.tools-section{background:var(--bg-color-operate)}.main-content{display:flex;flex:1;height:calc(100vh - 60px);gap:16px;padding:16px;overflow:hidden}.left-panel{width:320px;gap:16px;flex-shrink:0}.panel-title{font-size:16px;font-weight:600;color:var(--text-color-primary);margin-bottom:12px;text-align:left}.audience-section,.message-section,.scene-section{display:flex;flex-direction:column;background:var(--bg-color-operate);border-radius:12px;border:1px solid var(--stroke-color-primary);padding:16px;overflow:hidden}.scene-section{flex:1;min-height:0}.message-section{flex:1;min-height:0}.message-section :deep(input),.message-section :deep(textarea){text-align:left}.tools-section{border-radius:12px;padding:16px;border:1px solid var(--stroke-color-primary)}.center-panel{display:flex;flex-direction:column;flex:1;gap:16px;min-width:0}.stream-section{display:flex;flex-direction:column;flex:1;min-height:0;background:var(--bg-color-operate);border-radius:12px;border:1px solid var(--stroke-color-primary);overflow:hidden}.stream-header{display:flex;justify-content:space-between;align-items:center;padding:22px;border-bottom:1px solid var(--stroke-color-primary)}.stream-title{display:flex;align-items:center;gap:8px;font-size:18px;font-weight:500;color:var(--text-color-primary)}.stream-audience{font-size:14px;color:var(--text-color-primary)}.live-controls{display:flex;justify-content:space-between;align-items:center;padding:16px;border-radius:12px;border:1px solid var(--stroke-color-primary);gap:16px}.live-controls button{padding:18px 20px}.right-panel{display:flex;flex-direction:column;width:320px;gap:16px;flex-shrink:0}.center-panel>.live-controls,.left-panel>*,.right-panel>*{background:var(--bg-color-operate);border-radius:12px;border:1px solid var(--stroke-color-primary);overflow:hidden}.left-panel>*{padding:16px}.left-panel>.panel-title,.scene-section>.panel-title,.audience-section>.panel-title,.message-section>.panel-title{padding:0;background:transparent;border:none;border-radius:0}.custom-icon-container,.device-setting{padding:8px 12px;background:var(--bg-color-function)}.stream-section :deep(>*:last-child){flex:1;min-height:300px}.bottom-panel,.device-setting{align-items:center;display:flex}.custom-icon-container:hover,.option-card:hover{border-color:var(--stroke-color-primary);background:var(--list-color-hover)}.bottom-panel{gap:16px;flex:1}.device-setting{gap:8px;border-radius:8px;border:1px solid var(--stroke-color-secondary)}.device-icon{cursor:pointer;color:var(--text-color-primary);transition:color .2s}.device-icon:hover{color:var(--text-color-link)}.device-slider{width:80px}.custom-icon-container{display:flex;align-items:center;gap:6px;border-radius:8px;border:1px solid var(--stroke-color-secondary);cursor:pointer;transition:.2s;position:relative}.custom-icon-container.disabled{opacity:.5;cursor:not-allowed}.custom-icon-container.disabled:hover{background:var(--bg-color-function);border-color:var(--stroke-color-secondary)}.custom-icon{width:16px;height:16px;display:inline-block;background-size:contain;background-repeat:no-repeat;background-position:center}.custom-text{font-size:12px;color:var(--text-color-secondary);white-space:nowrap}.unread-count{position:absolute;top:-4px;right:-4px;background:var(--text-color-error);color:var(--text-color-button);border-radius:10px;padding:2px 6px;font-size:10px;font-weight:600;min-width:16px;text-align:center;line-height:1}.layout-label,.option-info h4{color:var(--text-color-primary)}.layout-dialog{max-width:600px}.layout-label{font-size:16px;font-weight:600}.options-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(120px,1fr));gap:12px}.option-card{padding:16px;background:var(--bg-color-function);border:2px solid var(--stroke-color-secondary);border-radius:8px;cursor:pointer;transition:.2s;text-align:center}.option-card.active{border-color:var(--text-color-link);background:var(--bg-color-operate)}.option-info h4{margin:8px 0 0;font-size:12px}.option-icon{width:32px;height:32px;margin:0 auto;color:var(--text-color-secondary)}.co-guest-dialog{max-width:500px}.co-guest-panel{min-height:300px}</style>
|
|
159
158
|
```
|
|
160
159
|
|
|
160
|
+
### Core API Parameter Descriptions
|
|
161
|
+
|
|
161
162
|
##### **createLive**
|
|
162
163
|
|
|
163
164
|
Creates a new live room and sets its basic information.
|
|
@@ -188,7 +189,6 @@ Start your first live stream.
|
|
|
188
189
|
|
|
189
190
|
> **Note:**
|
|
190
191
|
>
|
|
191
|
-
|
|
192
192
|
> After running the above command, open your browser and enter the local address (for example, `http://localhost:5173/live-pusher`; the port may vary by project) to view the live start page.
|
|
193
193
|
>
|
|
194
194
|
|
|
@@ -201,20 +201,17 @@ Start your first live stream.
|
|
|
201
201
|
|
|
202
202
|
Integrate our Audience Viewing (Web Desktop Browser) or Audience Viewing (H5 Mobile Browser) page to watch the live stream.
|
|
203
203
|
|
|
204
|
-
> **Important Tip
|
|
204
|
+
> **Important Tip::**
|
|
205
205
|
>
|
|
206
|
-
|
|
207
|
-
> Use different **userID **for streaming and viewing: The host and audience must use **different** userID. If the same **userID** is used, the second device to log in will force the first device offline.
|
|
206
|
+
> Use different **userID** for streaming and viewing: The host and audience must use **different** userID. If the same **userID** is used, the second device to log in will force the first device offline.
|
|
208
207
|
>
|
|
209
208
|
|
|
210
209
|
## Advanced Feature Integration
|
|
211
210
|
|
|
212
211
|
> **Note:**
|
|
213
212
|
>
|
|
214
|
-
|
|
215
213
|
> All advanced features below are extensions based on the `live-pusher.vue` sample file created in Step 3.
|
|
216
214
|
>
|
|
217
|
-
|
|
218
215
|
> Depending on your requirements, add the following code snippets to the appropriate sections of `live-pusher.vue` (either in the template or script) to enable each feature.
|
|
219
216
|
>
|
|
220
217
|
|
|
@@ -623,7 +620,6 @@ function handleCancel() {
|
|
|
623
620
|
|
|
624
621
|
> **Note:**
|
|
625
622
|
>
|
|
626
|
-
|
|
627
623
|
> You must set the streaming direction **before starting the live stream**; you cannot switch directions during a live session.
|
|
628
624
|
>
|
|
629
625
|
|
|
@@ -737,8 +733,7 @@ You can also customize the **audience viewing page** UI as needed. In addition t
|
|
|
737
733
|
|
|
738
734
|
|**Category**|**Feature**|**Description**|**Component Customization Guide**|
|
|
739
735
|
|---------|---------|---------|---------|
|
|
740
|
-
|**
|
|
741
|
-
|**Online Audience**|Customize audience info display|**Supports:** - **Show/hide audience level.** - **Customize font and color of audience info.** - **Replace icon style as needed.**|Video Source Editing Canvas|
|
|
736
|
+
|**Online Audience**|Customize audience info display|**Supports:** - **Show/hide audience level.** - **Customize font and color of audience info.** - **Replace icon style as needed.**|Adjust Live Video Widget|
|
|
742
737
|
|**Message List**|Customize live comments area display|**Supports:** - **Show/hide chat input area.** - **Customize chat bubble style, audience level, etc.**|Live Comments Component|
|
|
743
738
|
|
|
744
739
|
## Next Steps
|
|
@@ -67,7 +67,6 @@ Authentication is required to access all TUIRoomKit features. Call conference.lo
|
|
|
67
67
|
|
|
68
68
|
> **Note:**
|
|
69
69
|
>
|
|
70
|
-
|
|
71
70
|
> Make sure to use the generated UserSig in your configuration. In production, generate UserSig on your server and have the client request a dynamic UserSig from your business server for authentication as needed. See [How to calculate UserSig for production](https://trtc.io/document/35166).
|
|
72
71
|
>
|
|
73
72
|
|
|
@@ -299,7 +298,6 @@ const enterDualMeeting = async (bizOrderId: string) => {
|
|
|
299
298
|
|
|
300
299
|
> **Note:**
|
|
301
300
|
>
|
|
302
|
-
|
|
303
301
|
> The `conference.createAndJoinRoom` API handles: "If the room does not exist, create it (become host); if it exists, join it (become participant)", resolving state conflicts under high concurrency.
|
|
304
302
|
>
|
|
305
303
|
|
|
@@ -320,7 +318,6 @@ await conference.leaveRoom();
|
|
|
320
318
|
|
|
321
319
|
> **Note:**
|
|
322
320
|
>
|
|
323
|
-
|
|
324
321
|
> When the host leaves the room or closes the web page, the room is not automatically ended. Other participants can continue using TUIRoomKit features. The system will automatically reclaim room resources 6 hours after the scheduled end time, provided the room is empty.
|
|
325
322
|
>
|
|
326
323
|
|
|
@@ -335,7 +332,6 @@ await conference.endRoom();
|
|
|
335
332
|
|
|
336
333
|
> **Note:**
|
|
337
334
|
>
|
|
338
|
-
|
|
339
335
|
> `endRoom()` must be called by the host after successfully Entered Room. Calling as a non-host or before Enter Room will result in an error.
|
|
340
336
|
>
|
|
341
337
|
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
---
|
|
2
|
+
product: 'Call'
|
|
3
|
+
tech_stack: 'callengine'
|
|
4
|
+
framework: 'web'
|
|
5
|
+
doc_kind: 'best_practice'
|
|
6
|
+
title: 'TUICallEngine call invitation handling and signaling (Web)'
|
|
7
|
+
keywords: ['ON_CALL_RECEIVED', 'call invitation', '@trtc/call-engine-lite-js', 'TUICallEngine.calls', 'userData', 'callMediaType', 'accept', 'reject', 'TIM.EVENT.MESSAGE_RECEIVED', 'custom signaling message']
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# TUICallEngine Web: call invitation reception and signaling notes
|
|
11
|
+
|
|
12
|
+
Applicable package: **`@trtc/call-engine-lite-js`** (TUICallEngine Web SDK).
|
|
13
|
+
|
|
14
|
+
## 1) How do I receive an incoming call invitation?
|
|
15
|
+
|
|
16
|
+
**At the application layer, listen to `TUICallEvent.ON_CALL_RECEIVED` instead of parsing TRTC signaling or IM custom messages yourself.**
|
|
17
|
+
|
|
18
|
+
```javascript
|
|
19
|
+
import { TUICallEngine, TUICallEvent } from '@trtc/call-engine-lite-js';
|
|
20
|
+
|
|
21
|
+
const tuiCallEngine = TUICallEngine.createInstance({ SDKAppID: xxx, tim: timInstance });
|
|
22
|
+
await tuiCallEngine.login({ userID, userSig });
|
|
23
|
+
|
|
24
|
+
tuiCallEngine.on(TUICallEvent.ON_CALL_RECEIVED, (event) => {
|
|
25
|
+
console.log('Incoming call', event);
|
|
26
|
+
// Show your incoming-call UI, then call accept() or reject()
|
|
27
|
+
});
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### `ON_CALL_RECEIVED` event fields
|
|
31
|
+
|
|
32
|
+
| Field | Type | Description |
|
|
33
|
+
|---------|---------|---------|
|
|
34
|
+
| callerId | String | The inviter (caller) user ID. |
|
|
35
|
+
| calleeIdList | Array<String> | Other invited users in the same invitation. |
|
|
36
|
+
| isFromGroup | Boolean | Whether this invitation is from a group call. |
|
|
37
|
+
| inviteData | Object | Invitation payload object. |
|
|
38
|
+
| inviteID | String | Invitation ID for this invitation session. |
|
|
39
|
+
| userData | String | Extension string passed through invitation signaling. |
|
|
40
|
+
| callId | String | Unique call ID of this session. |
|
|
41
|
+
| roomID | Number | Audio/video room ID used by this call. |
|
|
42
|
+
| callMediaType | Number | Call media type (audio or video). |
|
|
43
|
+
| callRole | String | Role enum (caller or callee). |
|
|
44
|
+
|
|
45
|
+
## 2) Which parameters are used when sending an invitation with `calls`?
|
|
46
|
+
|
|
47
|
+
The caller starts an invitation via **`TUICallEngine.calls()`**:
|
|
48
|
+
|
|
49
|
+
```javascript
|
|
50
|
+
await tuiCallEngine.calls({
|
|
51
|
+
userIDList: ['user_bob'],
|
|
52
|
+
type: 2, // 1 = audio, 2 = video (CallMediaType)
|
|
53
|
+
userData: '{"ext":"info"}', // Optional string extension
|
|
54
|
+
timeout: 30, // Seconds, default is 30
|
|
55
|
+
roomID: 123456, // Numeric room ID, range [1, 2147483647]
|
|
56
|
+
strRoomID: '', // String room ID
|
|
57
|
+
chatGroupID: '', // Required for multi-user calls in a Chat group
|
|
58
|
+
offlinePushInfo: { /* ... */ },
|
|
59
|
+
});
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## 3) In Chat-integrated audio/video calls, how do I interpret custom message fields for call status rendering?
|
|
63
|
+
|
|
64
|
+
| **Question** | **Rule** |
|
|
65
|
+
|---------|---------|
|
|
66
|
+
| How to detect “call initiated” | `actionType = 1` and `cmd = 'videoCall'` or `'audioCall'` |
|
|
67
|
+
| How to detect “call answered” | `actionType = 3` |
|
|
68
|
+
| How to detect “call ended” and get call duration | `actionType = 1` and `cmd = 'hangup'`; read duration from `call_end` (seconds) |
|
|
69
|
+
| How to detect “call canceled” | `actionType = 2` |
|
|
70
|
+
| How to detect “call rejected” | `actionType = 4` |
|
|
71
|
+
| How to detect “rejected due to callee busy” | `actionType = 4` and `cmd = 'line_busy'` |
|
|
72
|
+
| How callee detects “timeout with no answer” | `actionType = 5` |
|
|
73
|
+
|
|
74
|
+
## 4) Best-practice summary
|
|
75
|
+
|
|
76
|
+
1. **Only** listen to `TUICallEvent.ON_CALL_RECEIVED`, then respond with `accept()` or `reject()`.
|
|
77
|
+
2. **Do not** parse call invitations from `TIM.EVENT.MESSAGE_RECEIVED` manually.
|
|
78
|
+
3. Use **`userData` (string)** for extension data: caller writes it, callee reads it from event payload.
|
|
79
|
+
4. **`businessID` and low-level payload format** are internal SDK details; do not invent undocumented structures.
|
|
80
|
+
5. In **`@trtc/call-engine-lite-js` 4.x+**, pass custom content via `userData`; there is **no `customData` field**.
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
---
|
|
2
|
+
product: 'Call'
|
|
3
|
+
tech_stack: 'callengine'
|
|
4
|
+
framework: 'web'
|
|
5
|
+
doc_kind: 'best_practice'
|
|
6
|
+
title: 'TUICallEngine Web log level control with setLogLevel'
|
|
7
|
+
keywords: ['setLogLevel', 'console logs', 'disable logs', 'log level']
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## TUICallEngine log level control
|
|
11
|
+
|
|
12
|
+
Web TUICallEngine provides `setLogLevel` to control browser console output.
|
|
13
|
+
|
|
14
|
+
### Log levels
|
|
15
|
+
|
|
16
|
+
- `0`: verbose level (more logs, useful during integration)
|
|
17
|
+
- `1`: key level (default)
|
|
18
|
+
- `2`: warning level (warnings + errors)
|
|
19
|
+
- `3`: error level (errors only)
|
|
20
|
+
- `4`: silent level (no logs)
|
|
21
|
+
|
|
22
|
+
### Reference
|
|
23
|
+
|
|
24
|
+
- [TUICallEngine setLogLevel](https://web.sdk.qcloud.com/component/trtccalling/doc/TUICallEngine/web/en/TUICallEngine.html#setLogLevel)
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
---
|
|
2
|
+
product: 'Call'
|
|
3
|
+
tech_stack: 'callkit'
|
|
4
|
+
framework: 'web'
|
|
5
|
+
doc_kind: 'best_practice'
|
|
6
|
+
title: 'TUICallKit Web Initiating Audio/Video Calls: call vs calls, Parameter Format and Examples'
|
|
7
|
+
keywords: ['TUICallKit initiating audio/video calls', 'difference between call and calls methods', 'how to pass the userIDList parameter', 'what do type parameter values 1 and 2 represent', 'TUICallKit vue', 'TUICallKit React']
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## Best Practices (Conclusion First)
|
|
11
|
+
1. Web TUICallKit **v4.x must use `calls`** to initiate one-to-one/multi-party calls. `call` and `groupCall` apply only to versions before v4.0.0 and are no longer supported starting from v4.0.0.
|
|
12
|
+
2. You must complete `init` before initiating a call; otherwise, the call may fail or the state may become abnormal.
|
|
13
|
+
3. It is recommended to use the `CallMediaType` enum constants for `type`. Using numeric literals (1/2) as the primary approach is not recommended.
|
|
14
|
+
4. `userIDList` must be an array (pass a single-element array even for one-to-one calls). Pass `chatGroupID` only when you need to integrate with a Chat group.
|
|
15
|
+
|
|
16
|
+
### Initialization Example (v4.x, React)
|
|
17
|
+
``` javascript
|
|
18
|
+
import { TUICallKitAPI } from "@trtc/calls-uikit-react";
|
|
19
|
+
|
|
20
|
+
TUICallKitAPI.init({ SDKAppID, userID, userSig });
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
### Legacy Initialization Example (before v4.0.0)
|
|
24
|
+
``` javascript
|
|
25
|
+
import { TUICallKitServer } from "@tencentcloud/call-uikit-react";
|
|
26
|
+
|
|
27
|
+
TUICallKitServer.init({ SDKAppID, userID, userSig });
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Common Misconceptions (Anti-patterns)
|
|
31
|
+
- Continuing to call `call` / `groupCall` in v4.x.
|
|
32
|
+
- Writing a one-to-one call using the `userID` field instead of `userIDList`.
|
|
33
|
+
- Mixing `roomID` and `strRoomID` (the two are mutually exclusive and not interoperable).
|
|
34
|
+
- Using numeric literals for `type` long-term instead of the `CallMediaType` enum constants.
|
|
35
|
+
|
|
36
|
+
## Usage Example of the v4.x calls API
|
|
37
|
+
Initiate a one-to-one or multi-party call.
|
|
38
|
+
``` javascript
|
|
39
|
+
try {
|
|
40
|
+
await TUICallKitAPI.calls({
|
|
41
|
+
userIDList: ['jack', 'tom'],
|
|
42
|
+
type: CallMediaType.VIDEO_CALL
|
|
43
|
+
});
|
|
44
|
+
} catch (error: any) {
|
|
45
|
+
console.error(`[TUICallKit] Failed to call the groupCall API. Reason:${error}`);
|
|
46
|
+
}
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
The parameters are shown in the table below:
|
|
50
|
+
| Parameter | Type | Required | Description |
|
|
51
|
+
| --- | --- | --- | --- |
|
|
52
|
+
| userIDList | Array<String> | Yes | The list of users being called. |
|
|
53
|
+
| type | CallMediaType| Yes | The media type of the call.<br>Backward compatible with older versions: audio call (type = 1), video call (type = 2). |
|
|
54
|
+
| chatGroupID | String | Yes | The group ID of the Chat group when used together with Chat. |
|
|
55
|
+
| roomID | Number | No | Numeric room ID, in the range [1, 2147483647]. |
|
|
56
|
+
| strRoomID | String | No | String room ID. <strong>Supported in v3.3.1+</strong><br>1. roomID and strRoomID are mutually exclusive. If you choose strRoomID, roomID must be set to 0. If both are provided, the SDK gives priority to roomID.<br>2. Do not mix roomID and strRoomID, because they are not interoperable. For example, the number 123 and the string "123" are two completely different rooms. |
|
|
57
|
+
| timeout | Number | No | Call timeout duration. Default: 30s, unit: seconds. Range: 10s ~ 600s. If 0 is passed, it defaults to 30s. |
|
|
58
|
+
| userData | String | No | A custom extension field when initiating a call. The called user receives this parameter in the ON_CALL_RECEIVED event. |
|
|
59
|
+
| <a href="https://cloud.tencent.com/document/product/647/81015#offlinePushInfo">offlinePushInfo</a> | Object | No | Custom offline message push parameters. |
|
|
60
|
+
|
|
61
|
+
### CallMediaType Call Types
|
|
62
|
+
|CallMediaType Type|Description|
|
|
63
|
+
|---------|---------|
|
|
64
|
+
|CallMediaType.AUDIO|Audio call.|
|
|
65
|
+
|CallMediaType.VIDEO|Video call.|
|
|
66
|
+
|
|
67
|
+
## Usage Examples of the `call` and `groupCall` APIs in Lower Versions (v2.x/v3.x)
|
|
68
|
+
|
|
69
|
+
### call: Initiate a One-to-One Call
|
|
70
|
+
``` javascript
|
|
71
|
+
import { TUICallKitServer, TUICallType } from '@tencentcloud/call-uikit-react';
|
|
72
|
+
try {
|
|
73
|
+
await TUICallKitServer.call({
|
|
74
|
+
userID: 'mike', // username being called
|
|
75
|
+
type: TUICallType.VIDEO_CALL,
|
|
76
|
+
});
|
|
77
|
+
} catch (error: any) {
|
|
78
|
+
console.error(`[TUICallKit] Call failed. Reason: ${error}`);
|
|
79
|
+
}
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
The parameters are shown in the table below:
|
|
83
|
+
| Parameter | Type | Required | Description |
|
|
84
|
+
| --- | --- | --- | --- |
|
|
85
|
+
| userID | String | Yes | The user ID being called. |
|
|
86
|
+
| type | TUICallType | Yes | The media type of the call.<br>Backward compatible with older versions: audio call (type = 1), video call (type = 2). |
|
|
87
|
+
| roomID | Number | No | Numeric room ID, in the range [1, 2147483647]. |
|
|
88
|
+
| strRoomID | String | No | String room ID. <strong>Supported in v3.3.1+</strong><br>1. roomID and strRoomID are mutually exclusive. If you choose strRoomID, roomID must be set to 0. If both are provided, the SDK gives priority to roomID.<br>2. Do not mix roomID and strRoomID, because they are not interoperable. For example, the number 123 and the string "123" are two completely different rooms. |
|
|
89
|
+
| timeout | Number | No | Call timeout duration. Default: 30s, unit: seconds. Range: 10s ~ 600s. If 0 is passed, it defaults to 30s. |
|
|
90
|
+
| userData | String | No | A custom extension field when initiating a call. The called user receives this parameter in the ON_CALL_RECEIVED event. |
|
|
91
|
+
| offlinePushInfo | Object | No | Custom offline message push parameters. |
|
|
92
|
+
|
|
93
|
+
### groupCall: Initiate a Multi-party Call
|
|
94
|
+
``` javascript
|
|
95
|
+
try {
|
|
96
|
+
await TUICallKitServer.groupCall({
|
|
97
|
+
userIDList: ['jack', 'tom'],
|
|
98
|
+
groupID: "xxx",
|
|
99
|
+
type: TUICallType.VIDEO_CALL
|
|
100
|
+
});
|
|
101
|
+
} catch (error: any) {
|
|
102
|
+
console.error(`[TUICallKit] Failed to call the groupCall API. Reason:${error}`);
|
|
103
|
+
}
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
The parameters are shown in the table below:
|
|
107
|
+
| Parameter | Type | Required | Description |
|
|
108
|
+
| --- | --- | --- | --- |
|
|
109
|
+
| userIDList| Array<String> | Yes | The user IDs being called. |
|
|
110
|
+
| type | TUICallType | Yes | The media type of the call.<br>Backward compatible with older versions: audio call (type = 1), video call (type = 2). |
|
|
111
|
+
| groupID | String | Yes | The call group ID. See the documentation for how to create a groupID. |
|
|
112
|
+
| roomID | Number | No | Numeric room ID, in the range [1, 2147483647]. |
|
|
113
|
+
| strRoomID | String | No | String room ID. <strong>Supported in v3.3.1+</strong><br>1. roomID and strRoomID are mutually exclusive. If you choose strRoomID, roomID must be set to 0. If both are provided, the SDK gives priority to roomID.<br>2. Do not mix roomID and strRoomID, because they are not interoperable. For example, the number 123 and the string "123" are two completely different rooms. |
|
|
114
|
+
| timeout | Number | No | Call timeout duration. Default: 30s, unit: seconds. Range: 10s ~ 600s. If 0 is passed, it defaults to 30s. |
|
|
115
|
+
| userData | String | No | A custom extension field when initiating a call. The called user receives this parameter in the ON_CALL_RECEIVED event. |
|
|
116
|
+
| offlinePushInfo | Object | No | Custom offline message push parameters. |
|