@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
|
@@ -4,7 +4,7 @@ Module: TRTCCloud @ TXLiteAVSDK
|
|
|
4
4
|
|
|
5
5
|
Function: TRTC's main feature API
|
|
6
6
|
|
|
7
|
-
Version: 13.
|
|
7
|
+
Version: 13.4
|
|
8
8
|
|
|
9
9
|
## TRTCCloud
|
|
10
10
|
|
|
@@ -120,11 +120,10 @@ Version: 13.3
|
|
|
120
120
|
|
|
121
121
|
|Param|DESC|
|
|
122
122
|
|---------|---------|
|
|
123
|
-
|context|It is only applicable to the Android platform. The SDK internally converts it into the
|
|
123
|
+
|context|It is only applicable to the Android platform. The SDK internally converts it into the `ApplicationContext` of Android to call the Android system API.|
|
|
124
124
|
|
|
125
125
|
> **Note**
|
|
126
126
|
>
|
|
127
|
-
|
|
128
127
|
> 1. Please use destroySharedInstance to release the object pointer.
|
|
129
128
|
>
|
|
130
129
|
|
|
@@ -146,9 +145,9 @@ You can use TRTCCloudListener to get various event notifications from the SDK, s
|
|
|
146
145
|
|
|
147
146
|
**Set the queue that drives the TRTCCloudListener event callback.**
|
|
148
147
|
|
|
149
|
-
If you do not specify a
|
|
148
|
+
If you do not specify a `listenerHandler` , the SDK will use `MainQueue` as the queue for driving TRTCCloudListener event callbacks by default.
|
|
150
149
|
|
|
151
|
-
In other words, if you do not set the
|
|
150
|
+
In other words, if you do not set the `listenerHandler` attribute, all callback functions in TRTCCloudListener will be driven by `MainQueue` .
|
|
152
151
|
|
|
153
152
|
|Param|DESC|
|
|
154
153
|
|---------|---------|
|
|
@@ -156,8 +155,7 @@ In other words, if you do not set the ` listenerHandler ` attribute, all callbac
|
|
|
156
155
|
|
|
157
156
|
> **Note**
|
|
158
157
|
>
|
|
159
|
-
|
|
160
|
-
> If you specify a ` listenerHandler `, please do not manipulate the UI in the TRTCCloudListener callback function; otherwise, thread safety issues will occur.
|
|
158
|
+
> If you specify a `listenerHandler` , please do not manipulate the UI in the TRTCCloudListener callback function; otherwise, thread safety issues will occur.
|
|
161
159
|
>
|
|
162
160
|
|
|
163
161
|
## enterRoom
|
|
@@ -167,31 +165,31 @@ In other words, if you do not set the ` listenerHandler ` attribute, all callbac
|
|
|
167
165
|
All TRTC users need to enter a room before they can "publish" or "subscribe to" audio/video streams. "Publishing" refers to pushing their own streams to the cloud, and "subscribing to" refers to pulling the streams of other users in the room from the cloud.
|
|
168
166
|
|
|
169
167
|
When calling this API, you need to specify your application scenario (TRTCAppScene) to get the best audio/video transfer experience. We provide the following four scenarios for your choice:
|
|
170
|
-
-
|
|
168
|
+
- TRTC_APP_SCENE_VIDEOCALL:
|
|
171
169
|
|
|
172
170
|
Video call scenario. Use cases: [one-to-one video call], [video conferencing with up to 300 participants], [online medical diagnosis], [small class], [video interview], etc.
|
|
173
171
|
|
|
174
172
|
In this scenario, each room supports up to 300 concurrent online users, and up to 50 of them can speak simultaneously.
|
|
175
|
-
-
|
|
173
|
+
- TRTC_APP_SCENE_AUDIOCALL:
|
|
176
174
|
|
|
177
175
|
Audio call scenario. Use cases: [one-to-one audio call], [audio conferencing with up to 300 participants], [audio chat], [online Werewolf], etc.
|
|
178
176
|
|
|
179
177
|
In this scenario, each room supports up to 300 concurrent online users, and up to 50 of them can speak simultaneously.
|
|
180
|
-
-
|
|
178
|
+
- TRTC_APP_SCENE_LIVE:
|
|
181
179
|
|
|
182
180
|
Live streaming scenario. Use cases: [low-latency video live streaming], [interactive classroom for up to 100,000 participants], [live video competition], [video dating room], [remote training], [large-scale conferencing], etc.
|
|
183
181
|
|
|
184
182
|
In this scenario, each room supports up to 100,000 concurrent online users, but you should specify the user roles: anchor (TRTCRoleAnchor) or audience (TRTCRoleAudience).
|
|
185
|
-
-
|
|
183
|
+
- TRTC_APP_SCENE_VOICE_CHATROOM:
|
|
186
184
|
|
|
187
185
|
Audio chat room scenario. Use cases: [Clubhouse], [online karaoke room], [music live room], [FM radio], etc.
|
|
188
186
|
|
|
189
187
|
In this scenario, each room supports up to 100,000 concurrent online users, but you should specify the user roles: anchor (TRTCRoleAnchor) or audience (TRTCRoleAudience).
|
|
190
188
|
|
|
191
|
-
After calling this API, you will receive the
|
|
192
|
-
- If room entry succeeded, the
|
|
189
|
+
After calling this API, you will receive the `onEnterRoom(result)` callback from TRTCCloudListener:
|
|
190
|
+
- If room entry succeeded, the `result` parameter will be a positive number ( `result` > 0), indicating the time in milliseconds (ms) between function call and room entry.
|
|
193
191
|
|
|
194
|
-
- If room entry failed, the
|
|
192
|
+
- If room entry failed, the `result` parameter will be a negative number ( `result` < 0), indicating the TXLiteAVError for room entry failure.
|
|
195
193
|
|
|
196
194
|
|Param|DESC|
|
|
197
195
|
|---------|---------|
|
|
@@ -200,13 +198,10 @@ After calling this API, you will receive the ` onEnterRoom(result) ` callback fr
|
|
|
200
198
|
|
|
201
199
|
> **Note**
|
|
202
200
|
>
|
|
203
|
-
|
|
204
|
-
> 1. If ` scene ` is specified as TRTC_APP_SCENE_LIVE or TRTC_APP_SCENE_VOICE_CHATROOM, you must use the ` role ` field in TRTCParams to specify the role of the current user in the room.
|
|
201
|
+
> 1. If `scene` is specified as TRTC_APP_SCENE_LIVE or TRTC_APP_SCENE_VOICE_CHATROOM, you must use the `role` field in TRTCParams to specify the role of the current user in the room.
|
|
205
202
|
>
|
|
206
|
-
|
|
207
|
-
> 2. The same ` scene ` should be configured for all users in the same room.
|
|
203
|
+
> 2. The same `scene` should be configured for all users in the same room.
|
|
208
204
|
>
|
|
209
|
-
|
|
210
205
|
> 3. Please try to ensure that enterRoom and exitRoom are used in pair; that is, please make sure that "the previous room is exited before the next room is entered"; otherwise, many issues may occur.
|
|
211
206
|
>
|
|
212
207
|
|
|
@@ -216,7 +211,7 @@ After calling this API, you will receive the ` onEnterRoom(result) ` callback fr
|
|
|
216
211
|
|
|
217
212
|
Calling this API will allow the user to leave the current audio or video room and release the camera, mic, speaker, and other device resources.
|
|
218
213
|
|
|
219
|
-
After resources are released, the SDK will use the
|
|
214
|
+
After resources are released, the SDK will use the `onExitRoom()` callback in TRTCCloudListener to notify you.
|
|
220
215
|
|
|
221
216
|
If you need to call enterRoom again or switch to the SDK of another provider, we recommend you wait until you receive the onExitRoom callback, so as to avoid the problem of the camera or mic being occupied.
|
|
222
217
|
|
|
@@ -224,45 +219,41 @@ If you need to call enterRoom again or switch to the SDK of another provider, we
|
|
|
224
219
|
|
|
225
220
|
**Switch role.**
|
|
226
221
|
|
|
227
|
-
This API is used to switch the user role between
|
|
222
|
+
This API is used to switch the user role between `anchor` and `audience` .
|
|
228
223
|
|
|
229
224
|
As video live rooms and audio chat rooms need to support an audience of up to 100,000 concurrent online users, the rule "only anchors can publish their audio/video streams" has been set. Therefore, when some users want to publish their streams (so that they can interact with anchors), they need to switch their role to "anchor" first.
|
|
230
225
|
|
|
231
|
-
You can use the
|
|
226
|
+
You can use the `role` field in TRTCParams during room entry to specify the user role in advance or use the `switchRole` API to switch roles after room entry.
|
|
232
227
|
| Param | DESC |
|
|
233
228
|
| --- | --- |
|
|
234
|
-
| role | Role, which is
|
|
229
|
+
| role | Role, which is <code>anchor</code> by default:<br>- TRTCRoleAnchor: anchor, who can publish their audio/video streams. Up to 50 anchors are allowed to publish streams at the same time in one room.<br>- TRTCRoleAudience: audience, who cannot publish their audio/video streams, but can only watch streams of anchors in the room. If they want to publish their streams, they need to switch to the "anchor" role first through switchRole. One room supports an audience of up to 100,000 concurrent online users. |
|
|
235
230
|
|
|
236
231
|
> **Note**
|
|
237
232
|
>
|
|
238
|
-
|
|
239
233
|
> 1. This API is only applicable to two scenarios: live streaming (TRTC_APP_SCENE_LIVE) and audio chat room (TRTC_APP_SCENE_VOICE_CHATROOM).
|
|
240
234
|
>
|
|
241
|
-
|
|
242
|
-
> 2. If the ` scene ` you specify in enterRoom is TRTC_APP_SCENE_VIDEOCALL or TRTC_APP_SCENE_AUDIOCALL, please do not call this API.
|
|
235
|
+
> 2. If the `scene` you specify in enterRoom is TRTC_APP_SCENE_VIDEOCALL or TRTC_APP_SCENE_AUDIOCALL, please do not call this API.
|
|
243
236
|
>
|
|
244
237
|
|
|
245
238
|
## switchRole
|
|
246
239
|
|
|
247
240
|
**Switch role(support permission credential).**
|
|
248
241
|
|
|
249
|
-
This API is used to switch the user role between
|
|
242
|
+
This API is used to switch the user role between `anchor` and `audience` .
|
|
250
243
|
|
|
251
244
|
As video live rooms and audio chat rooms need to support an audience of up to 100,000 concurrent online users, the rule "only anchors can publish their audio/video streams" has been set. Therefore, when some users want to publish their streams (so that they can interact with anchors), they need to switch their role to "anchor" first.
|
|
252
245
|
|
|
253
|
-
You can use the
|
|
246
|
+
You can use the `role` field in TRTCParams during room entry to specify the user role in advance or use the `switchRole` API to switch roles after room entry.
|
|
254
247
|
| Param | DESC |
|
|
255
248
|
| --- | --- |
|
|
256
|
-
| privateMapKey | Permission credential used for permission control. If you want only users with the specified
|
|
257
|
-
| role | Role, which is
|
|
249
|
+
| privateMapKey | Permission credential used for permission control. If you want only users with the specified <code>userId</code> values to enter a room or push streams, you need to use <code>privateMapKey</code> to restrict the permission.<br>- We recommend you use this parameter only if you have high security requirements. For more information, please see <a href="https://www.tencentcloud.com/document/product/647/35157">Enabling Advanced Permission Control</a>. |
|
|
250
|
+
| role | Role, which is <code>anchor</code> by default:<br>- TRTCRoleAnchor: anchor, who can publish their audio/video streams. Up to 50 anchors are allowed to publish streams at the same time in one room.<br>- TRTCRoleAudience: audience, who cannot publish their audio/video streams, but can only watch streams of anchors in the room. If they want to publish their streams, they need to switch to the "anchor" role first through switchRole. One room supports an audience of up to 100,000 concurrent online users. |
|
|
258
251
|
|
|
259
252
|
> **Note**
|
|
260
253
|
>
|
|
261
|
-
|
|
262
254
|
> 1. This API is only applicable to two scenarios: live streaming (TRTC_APP_SCENE_LIVE) and audio chat room (TRTC_APP_SCENE_VOICE_CHATROOM).
|
|
263
255
|
>
|
|
264
|
-
|
|
265
|
-
> 2. If the ` scene ` you specify in enterRoom is TRTC_APP_SCENE_VIDEOCALL or TRTC_APP_SCENE_AUDIOCALL, please do not call this API.
|
|
256
|
+
> 2. If the `scene` you specify in enterRoom is TRTC_APP_SCENE_VIDEOCALL or TRTC_APP_SCENE_AUDIOCALL, please do not call this API.
|
|
266
257
|
>
|
|
267
258
|
|
|
268
259
|
## switchRoom
|
|
@@ -270,13 +261,13 @@ You can use the ` role ` field in TRTCParams during room entry to specify the us
|
|
|
270
261
|
**Switch room.**
|
|
271
262
|
|
|
272
263
|
This API is used to quickly switch a user from one room to another.
|
|
273
|
-
- If the user's role is
|
|
264
|
+
- If the user's role is `audience` , calling this API is equivalent to `exitRoom` (current room) + `enterRoom` (new room).
|
|
274
265
|
|
|
275
|
-
- If the user's role is
|
|
266
|
+
- If the user's role is `anchor` , the API will retain the current audio/video publishing status while switching the room; therefore, during the room switch, camera preview and sound capturing will not be interrupted.
|
|
276
267
|
|
|
277
|
-
This API is suitable for the online education scenario where the supervising teacher can perform fast room switch across multiple rooms. In this scenario, using
|
|
268
|
+
This API is suitable for the online education scenario where the supervising teacher can perform fast room switch across multiple rooms. In this scenario, using `switchRoom` can get better smoothness and use less code than `exitRoom + enterRoom` .
|
|
278
269
|
|
|
279
|
-
The API call result will be called back through
|
|
270
|
+
The API call result will be called back through `onSwitchRoom(errCode, errMsg)` in TRTCCloudListener.
|
|
280
271
|
|
|
281
272
|
|Param|DESC|
|
|
282
273
|
|---------|---------|
|
|
@@ -284,14 +275,11 @@ The API call result will be called back through ` onSwitchRoom(errCode, errMsg)
|
|
|
284
275
|
|
|
285
276
|
> **Note**
|
|
286
277
|
>
|
|
287
|
-
|
|
288
|
-
> Due to the requirement for compatibility with legacy versions of the SDK, the ` config ` parameter contains both ` roomId ` and ` strRoomId ` parameters. You should pay special attention as detailed below when specifying these two parameters:
|
|
278
|
+
> Due to the requirement for compatibility with legacy versions of the SDK, the `config` parameter contains both `roomId` and `strRoomId` parameters. You should pay special attention as detailed below when specifying these two parameters:
|
|
289
279
|
>
|
|
290
|
-
|
|
291
|
-
> 1. If you decide to use ` strRoomId `, then set ` roomId ` to 0. If both are specified, ` roomId ` will be used.
|
|
280
|
+
> 1. If you decide to use `strRoomId` , then set `roomId` to 0. If both are specified, `roomId` will be used.
|
|
292
281
|
>
|
|
293
|
-
|
|
294
|
-
> 2. All rooms need to use either ` strRoomId ` or ` roomId ` at the same time. They cannot be mixed; otherwise, there will be many unexpected bugs.
|
|
282
|
+
> 2. All rooms need to use either `strRoomId` or `roomId` at the same time. They cannot be mixed; otherwise, there will be many unexpected bugs.
|
|
295
283
|
>
|
|
296
284
|
|
|
297
285
|
## ConnectOtherRoom
|
|
@@ -306,10 +294,10 @@ In other words, you can use this API to share the audio/video streams of two anc
|
|
|
306
294
|
|
|
307
295
|
The result of requesting cross-room call will be returned through the onConnectOtherRoom callback in TRTCCloudListener.
|
|
308
296
|
|
|
309
|
-
For example, after anchor A in room "101" uses
|
|
310
|
-
- All users in room "101" will receive the
|
|
297
|
+
For example, after anchor A in room "101" uses `connectOtherRoom()` to successfully call anchor B in room "102":
|
|
298
|
+
- All users in room "101" will receive the `onRemoteUserEnterRoom(B)` and `onUserVideoAvailable(B,true)` event callbacks of anchor B; that is, all users in room "101" can subscribe to the audio/video streams of anchor B.
|
|
311
299
|
|
|
312
|
-
- All users in room "102" will receive the
|
|
300
|
+
- All users in room "102" will receive the `onRemoteUserEnterRoom(A)` and `onUserVideoAvailable(A,true)` event callbacks of anchor A; that is, all users in room "102" can subscribe to the audio/video streams of anchor A.
|
|
313
301
|
|
|
314
302
|
For compatibility with subsequent extended fields for cross-room call, parameters in JSON format are used currently.
|
|
315
303
|
|
|
@@ -327,7 +315,7 @@ Below is the sample code:
|
|
|
327
315
|
|
|
328
316
|
Case 2: string room ID
|
|
329
317
|
|
|
330
|
-
If you use a string room ID, please be sure to replace the
|
|
318
|
+
If you use a string room ID, please be sure to replace the `roomId` in JSON with `strRoomId` , such as `{"strRoomId": "102", "userId": "userB"}`
|
|
331
319
|
|
|
332
320
|
Below is the sample code:
|
|
333
321
|
``` java
|
|
@@ -339,20 +327,20 @@ Below is the sample code:
|
|
|
339
327
|
|
|
340
328
|
|Param|DESC|
|
|
341
329
|
|---------|---------|
|
|
342
|
-
|param|You need to pass in a string parameter in JSON format:
|
|
330
|
+
|param|You need to pass in a string parameter in JSON format: `roomId` represents the room ID in numeric format, `strRoomId` represents the room ID in string format, and `userId` represents the user ID of the target anchor.|
|
|
343
331
|
|
|
344
332
|
## DisconnectOtherRoom
|
|
345
333
|
|
|
346
334
|
**Exit cross-room call.**
|
|
347
335
|
|
|
348
|
-
The result will be returned through the
|
|
336
|
+
The result will be returned through the `onDisconnectOtherRoom()` callback in TRTCCloudListener.
|
|
349
337
|
|
|
350
338
|
## setDefaultStreamRecvMode
|
|
351
339
|
|
|
352
340
|
**Set subscription mode (which must be set before room entry for it to take effect).**
|
|
353
341
|
|
|
354
342
|
You can switch between the "automatic subscription" and "manual subscription" modes through this API:
|
|
355
|
-
- Automatic subscription: this is the default mode, where the user will immediately receive the audio/video streams in the room after room entry, so that the audio will be automatically played back, and the video will be automatically decoded (you still need to bind the rendering control through the
|
|
343
|
+
- Automatic subscription: this is the default mode, where the user will immediately receive the audio/video streams in the room after room entry, so that the audio will be automatically played back, and the video will be automatically decoded (you still need to bind the rendering control through the `startRemoteView` API).
|
|
356
344
|
|
|
357
345
|
- Manual subscription: after room entry, the user needs to manually call the startRemoteView API to start subscribing to and decoding the video stream and call the muteRemoteAudio (false) API to start playing back the audio stream.
|
|
358
346
|
|
|
@@ -362,15 +350,13 @@ In your application scenario, if there are many audio/video streams being publis
|
|
|
362
350
|
|
|
363
351
|
|Param|DESC|
|
|
364
352
|
|---------|---------|
|
|
365
|
-
|autoRecvAudio|true: automatic subscription to audio; false: manual subscription to audio by calling
|
|
366
|
-
|autoRecvVideo|true: automatic subscription to video; false: manual subscription to video by calling
|
|
353
|
+
|autoRecvAudio|true: automatic subscription to audio; false: manual subscription to audio by calling `muteRemoteAudio(false)` . Default value: true|
|
|
354
|
+
|autoRecvVideo|true: automatic subscription to video; false: manual subscription to video by calling `startRemoteView` . Default value: true|
|
|
367
355
|
|
|
368
356
|
> **Note**
|
|
369
357
|
>
|
|
370
|
-
|
|
371
358
|
> 1. The configuration takes effect only if this API is called before room entry (enterRoom).
|
|
372
359
|
>
|
|
373
|
-
|
|
374
360
|
> 2. In the automatic subscription mode, if the user does not call startRemoteView to subscribe to the video stream after room entry, the SDK will automatically stop subscribing to the video stream in order to reduce the traffic consumption.
|
|
375
361
|
>
|
|
376
362
|
|
|
@@ -378,11 +364,11 @@ In your application scenario, if there are many audio/video streams being publis
|
|
|
378
364
|
|
|
379
365
|
**Create room subinstance (for concurrent multi-room listen/watch).**
|
|
380
366
|
|
|
381
|
-
`
|
|
367
|
+
`TRTCCloud` was originally designed to work in the singleton mode, which limited the ability to watch concurrently in multiple rooms.
|
|
382
368
|
|
|
383
|
-
By calling this API, you can create multiple
|
|
369
|
+
By calling this API, you can create multiple `TRTCCloud` instances, so that you can enter multiple different rooms at the same time to listen/watch audio/video streams.
|
|
384
370
|
|
|
385
|
-
However, it should be noted that your ability to publish audio and video streams in multiple
|
|
371
|
+
However, it should be noted that your ability to publish audio and video streams in multiple `TRTCCloud` instances will be limited.
|
|
386
372
|
|
|
387
373
|
This feature is mainly used in the "super small class" use case in the online education scenario to break the limit that "only up to 50 users can publish their audio/video streams simultaneously in one TRTC room".
|
|
388
374
|
|
|
@@ -414,23 +400,20 @@ Below is the sample code:
|
|
|
414
400
|
|
|
415
401
|
> **Note**
|
|
416
402
|
>
|
|
417
|
-
|
|
418
|
-
> 1. The same user can enter multiple rooms with different ` roomId ` values by using the same ` userId `.
|
|
403
|
+
> 1. The same user can enter multiple rooms with different `roomId` values by using the same `userId` .
|
|
419
404
|
>
|
|
420
|
-
|
|
421
|
-
> 2. Two devices cannot use the same ` userId ` to enter the same room with a specified ` roomId `.
|
|
405
|
+
> 2. Two devices cannot use the same `userId` to enter the same room with a specified `roomId` .
|
|
422
406
|
>
|
|
423
|
-
|
|
424
407
|
> 3. You can set TRTCCloudListener separately for different instances to get their own event notifications.
|
|
425
408
|
>
|
|
426
|
-
|
|
427
|
-
> 4. The same user can push streams in multiple ` TRTCCloud ` instances at the same time, and can also call APIs related to local audio/video in the sub instance. But need to pay attention to:
|
|
409
|
+
> 4. The same user can push streams in multiple `TRTCCloud` instances at the same time, and can also call APIs related to local audio/video in the sub instance. But need to pay attention to:
|
|
428
410
|
>
|
|
429
411
|
> - Audio needs to be collected by the microphone or custom data at the same time in all instances, and the result of API calls related to the audio device will be based on the last time;
|
|
430
412
|
> - The result of camera-related API call will be based on the last time: startLocalPreview.
|
|
413
|
+
|
|
431
414
|
**Return Desc:**
|
|
432
415
|
|
|
433
|
-
`
|
|
416
|
+
`TRTCCloud` subinstance
|
|
434
417
|
|
|
435
418
|
## destroySubCloud
|
|
436
419
|
|
|
@@ -452,13 +435,13 @@ After disabling a certain upstream capability of the cross-room anchor, all user
|
|
|
452
435
|
|
|
453
436
|
Note that this API can only be called by the anchor who is conducting the cross-room call, and the restrictions set by this API will be reset when the cross-room call is interrupted or the corresponding anchor leaves the room.
|
|
454
437
|
|
|
455
|
-
The result of calling this API will be returned through the
|
|
438
|
+
The result of calling this API will be returned through the `onUpdateOtherRoomForwardMode()` callback in TRTCCloudListener.
|
|
456
439
|
|
|
457
|
-
For example, in room "101", there is anchor A and audience B, and in room "102", there is anchor C who publishes audio/video streams normally. Anchor A calls
|
|
458
|
-
- At this time, both anchor A and audience B will receive the
|
|
440
|
+
For example, in room "101", there is anchor A and audience B, and in room "102", there is anchor C who publishes audio/video streams normally. Anchor A calls `connectOtherRoom()` to make a cross-room call with anchor C.
|
|
441
|
+
- At this time, both anchor A and audience B will receive the `onRemoteUserEnterRoom(C)` , `onUserVideoAvailable(C,true)` , and `onUserAudioAvailable(C,true)` event callbacks, and can subscribe to the audio/video streams of anchor C.
|
|
459
442
|
|
|
460
443
|
Later, anchor A calls this API to disable the audio publishing capability of anchor C in the current room.
|
|
461
|
-
- After that, the audio stream of anchor C will no longer be published to room "101", and both anchor A and audience B will receive the
|
|
444
|
+
- After that, the audio stream of anchor C will no longer be published to room "101", and both anchor A and audience B will receive the `onUserAudioAvailable(C,false)` event callback, and cannot subscribe to the audio stream of anchor C by calling `muteRemoteAudio(C,false)` .
|
|
462
445
|
|
|
463
446
|
- The video stream of anchor C will not be affected. The other audience members in Room 102 will not be affected and can subscribe to the audio stream of anchor C normally.
|
|
464
447
|
|
|
@@ -488,7 +471,7 @@ Case 2: string room ID
|
|
|
488
471
|
|
|
489
472
|
|Param|DESC|
|
|
490
473
|
|---------|---------|
|
|
491
|
-
|param|You need to pass in a string parameter in JSON format:
|
|
474
|
+
|param|You need to pass in a string parameter in JSON format: `roomId` represents the room ID in numeric format, `strRoomId` represents the room ID in string format, and `userId` represents the user ID of the target anchor. `muteAudio` , `muteVideo` and `muteSubStream` are optional, representing whether to prohibit or allow the cross-room anchor to publish audio/video/sub-stream.|
|
|
492
475
|
|
|
493
476
|
## startPublishMediaStream
|
|
494
477
|
|
|
@@ -506,16 +489,12 @@ You can use the TRTCPublishMode parameter in TRTCPublishTarget to specify the pu
|
|
|
506
489
|
|
|
507
490
|
> **Note**
|
|
508
491
|
>
|
|
509
|
-
|
|
510
492
|
> 1. The SDK will send a task ID to you via the onStartPublishMediaStream callback.
|
|
511
493
|
>
|
|
512
|
-
|
|
513
494
|
> 2. You can start a publishing task only once and cannot initiate two tasks that use the same publishing mode and publishing cdn url. Note the task ID returned, which you need to pass to updatePublishMediaStream to modify the publishing parameters or stopPublishMediaStream to stop the task.
|
|
514
495
|
>
|
|
515
|
-
|
|
516
|
-
> 3. You can specify up to 10 CDN URLs in ` target `. You will be charged only once for transcoding even if you relay to multiple CDNs.
|
|
496
|
+
> 3. You can specify up to 10 CDN URLs in `target` . You will be charged only once for transcoding even if you relay to multiple CDNs.
|
|
517
497
|
>
|
|
518
|
-
|
|
519
498
|
> 4. To avoid causing errors, do not specify the same URLs for different publishing tasks executed at the same time. We recommend you add "sdkappid_roomid_userid_main" to URLs to distinguish them from one another and avoid application conflicts.
|
|
520
499
|
>
|
|
521
500
|
|
|
@@ -534,13 +513,10 @@ You can use this API to change the parameters of a publishing task initiated by
|
|
|
534
513
|
|
|
535
514
|
> **Note**
|
|
536
515
|
>
|
|
537
|
-
|
|
538
516
|
> 1. You can use this API to add or remove CDN URLs to publish to (you can publish to up to 10 CDNs at a time). To avoid causing errors, do not specify the same URLs for different tasks executed at the same time.
|
|
539
517
|
>
|
|
540
|
-
|
|
541
518
|
> 2. You can use this API to switch a relaying task to transcoding or vice versa. For example, in cross-room communication, you can first call startPublishMediaStream to relay to a CDN. When the anchor requests cross-room communication, call this API, passing in the task ID to switch the relaying task to a transcoding task. This can ensure that the live stream and CDN playback are not interrupted (you need to keep the encoding parameters consistent).
|
|
542
519
|
>
|
|
543
|
-
|
|
544
520
|
> 3. You can not switch output between "only audio", "only video" and "audio and video" for the same task.
|
|
545
521
|
>
|
|
546
522
|
|
|
@@ -556,11 +532,9 @@ You can use this API to stop a task initiated by startPublishMediaStream.
|
|
|
556
532
|
|
|
557
533
|
> **Note**
|
|
558
534
|
>
|
|
559
|
-
|
|
560
535
|
> 1. If the task ID is not saved to your backend, you can call startPublishMediaStream again when an anchor re-enters the room after abnormal exit. The publishing will fail, but the TRTC backend will return the task ID to you.
|
|
561
536
|
>
|
|
562
|
-
|
|
563
|
-
> 2. If ` taskId ` is left empty, the TRTC backend will end all tasks you started through startPublishMediaStream. You can leave it empty if you have started only one task or want to stop all publishing tasks started by you.
|
|
537
|
+
> 2. If `taskId` is left empty, the TRTC backend will end all tasks you started through startPublishMediaStream. You can leave it empty if you have started only one task or want to stop all publishing tasks started by you.
|
|
564
538
|
>
|
|
565
539
|
|
|
566
540
|
## startLocalPreview
|
|
@@ -571,7 +545,7 @@ If this API is called before enterRoom, the SDK will only enable the camera and
|
|
|
571
545
|
|
|
572
546
|
If it is called after enterRoom, the SDK will enable the camera and automatically start pushing the video stream.
|
|
573
547
|
|
|
574
|
-
When the first camera video frame starts to be rendered, you will receive the
|
|
548
|
+
When the first camera video frame starts to be rendered, you will receive the `onCameraDidReady` callback in TRTCCloudListener.
|
|
575
549
|
|
|
576
550
|
|Param|DESC|
|
|
577
551
|
|---------|---------|
|
|
@@ -580,11 +554,10 @@ When the first camera video frame starts to be rendered, you will receive the `
|
|
|
580
554
|
|
|
581
555
|
> **Note**
|
|
582
556
|
>
|
|
583
|
-
|
|
584
|
-
> If you want to preview the camera image and adjust the beauty filter parameters through ` BeautyManager ` before going live, you can:
|
|
557
|
+
> If you want to preview the camera image and adjust the beauty filter parameters through `BeautyManager` before going live, you can:
|
|
585
558
|
>
|
|
586
|
-
> - Scheme 1. Call
|
|
587
|
-
> - Scheme 2. Call
|
|
559
|
+
> - Scheme 1. Call `startLocalPreview` before calling enterRoom.
|
|
560
|
+
> - Scheme 2. Call `startLocalPreview` and `muteLocalVideo(true)` after calling enterRoom.
|
|
588
561
|
|
|
589
562
|
## updateLocalView
|
|
590
563
|
|
|
@@ -600,15 +573,15 @@ When the first camera video frame starts to be rendered, you will receive the `
|
|
|
600
573
|
|
|
601
574
|
This API can pause (or resume) publishing the local video image. After the pause, other users in the same room will not be able to see the local image.
|
|
602
575
|
|
|
603
|
-
This API is equivalent to the two APIs of
|
|
576
|
+
This API is equivalent to the two APIs of `startLocalPreview/stopLocalPreview` when TRTCVideoStreamTypeBig is specified, but has higher performance and response speed.
|
|
604
577
|
|
|
605
|
-
The
|
|
578
|
+
The `startLocalPreview/stopLocalPreview` APIs need to enable/disable the camera, which are hardware device-related operations, so they are very time-consuming.
|
|
606
579
|
|
|
607
|
-
In contrast,
|
|
580
|
+
In contrast, `muteLocalVideo` only needs to pause or allow the data stream at the software level, so it is more efficient and more suitable for scenarios where frequent enabling/disabling are needed.
|
|
608
581
|
|
|
609
|
-
After local video publishing is paused, other members in the same room will receive the
|
|
582
|
+
After local video publishing is paused, other members in the same room will receive the `onUserVideoAvailable(userId, false)` callback notification.
|
|
610
583
|
|
|
611
|
-
After local video publishing is resumed, other members in the same room will receive the
|
|
584
|
+
After local video publishing is resumed, other members in the same room will receive the `onUserVideoAvailable(userId, true)` callback notification.
|
|
612
585
|
|
|
613
586
|
|Param|DESC|
|
|
614
587
|
|---------|---------|
|
|
@@ -619,7 +592,7 @@ After local video publishing is resumed, other members in the same room will rec
|
|
|
619
592
|
|
|
620
593
|
**Set placeholder image during local video pause.**
|
|
621
594
|
|
|
622
|
-
When you call
|
|
595
|
+
When you call `muteLocalVideo(true)` to pause the local video image, you can set a placeholder image by calling this API. Then, other users in the room will see this image instead of a black screen.
|
|
623
596
|
|
|
624
597
|
|Param|DESC|
|
|
625
598
|
|---------|---------|
|
|
@@ -630,31 +603,27 @@ When you call ` muteLocalVideo(true) ` to pause the local video image, you can s
|
|
|
630
603
|
|
|
631
604
|
**Subscribe to remote user's video stream and bind video rendering control.**
|
|
632
605
|
|
|
633
|
-
Calling this API allows the SDK to pull the video stream of the specified
|
|
634
|
-
- If you already know the
|
|
606
|
+
Calling this API allows the SDK to pull the video stream of the specified `userId` and render it to the rendering control specified by the `view` parameter. You can set the display mode of the video image through setRemoteRenderParams.
|
|
607
|
+
- If you already know the `userId` of a user who has a video stream in the room, you can directly call `startRemoteView` to subscribe to the user's video image.
|
|
635
608
|
|
|
636
609
|
- If you don't know which users in the room are publishing video streams, you can wait for the notification from onUserVideoAvailable after enterRoom.
|
|
637
610
|
|
|
638
611
|
Calling this API only starts pulling the video stream, and the image needs to be loaded and buffered at this time. After the buffering is completed, you will receive a notification from onFirstVideoFrame.
|
|
639
612
|
| Param | DESC |
|
|
640
613
|
| --- | --- |
|
|
641
|
-
| streamType | Video stream type of the
|
|
614
|
+
| streamType | Video stream type of the <code>userId</code> specified for watching:<br>- HD big image: TRTC_VIDEO_STREAM_TYPE_BIG<br>- Smooth small image: TRTC_VIDEO_STREAM_TYPE_SMALL (the remote user should enable dual-channel encoding through enableEncSmallVideoStream for this parameter to take effect)<br>- Substream image (usually used for screen sharing): TRTC_VIDEO_STREAM_TYPE_SUB |
|
|
642
615
|
| userId | ID of the specified remote user |
|
|
643
616
|
| view | Rendering control that carries the video image |
|
|
644
617
|
|
|
645
618
|
> **Note**
|
|
646
619
|
>
|
|
647
|
-
|
|
648
620
|
> The following requires your attention:
|
|
649
621
|
>
|
|
650
|
-
|
|
651
|
-
> 1. The SDK supports watching the big image and substream image or small image and substream image of a ` userId ` at the same time, but does not support watching the big image and small image at the same time.
|
|
622
|
+
> 1. The SDK supports watching the big image and substream image or small image and substream image of a `userId` at the same time, but does not support watching the big image and small image at the same time.
|
|
652
623
|
>
|
|
653
|
-
|
|
654
|
-
> 2. Only when the specified ` userId ` enables dual-channel encoding through enableEncSmallVideoStream can the user's small image be viewed.
|
|
624
|
+
> 2. Only when the specified `userId` enables dual-channel encoding through enableEncSmallVideoStream can the user's small image be viewed.
|
|
655
625
|
>
|
|
656
|
-
|
|
657
|
-
> 3. If the small image of the specified ` userId ` does not exist, the SDK will switch to the big image of the user by default.
|
|
626
|
+
> 3. If the small image of the specified `userId` does not exist, the SDK will switch to the big image of the user by default.
|
|
658
627
|
>
|
|
659
628
|
|
|
660
629
|
## updateRemoteView
|
|
@@ -676,7 +645,7 @@ This API can be used to update the rendering control of the remote video image.
|
|
|
676
645
|
Calling this API will cause the SDK to stop receiving the user's video stream and release the decoding and rendering resources for the stream.
|
|
677
646
|
| Param | DESC |
|
|
678
647
|
| --- | --- |
|
|
679
|
-
| streamType | Video stream type of the
|
|
648
|
+
| streamType | Video stream type of the <code>userId</code> specified for watching:<br>- HD big image: TRTC_VIDEO_STREAM_TYPE_BIG<br>- Smooth small image: TRTC_VIDEO_STREAM_TYPE_SMALL<br>- Substream image (usually used for screen sharing): TRTC_VIDEO_STREAM_TYPE_SUB |
|
|
680
649
|
| userId | ID of the specified remote user |
|
|
681
650
|
|
|
682
651
|
## stopAllRemoteView
|
|
@@ -687,7 +656,6 @@ Calling this API will cause the SDK to stop receiving all remote video streams a
|
|
|
687
656
|
|
|
688
657
|
> **Note**
|
|
689
658
|
>
|
|
690
|
-
|
|
691
659
|
> If a substream image (screen sharing) is being displayed, it will also be stopped.
|
|
692
660
|
>
|
|
693
661
|
|
|
@@ -704,7 +672,6 @@ This API only pauses/resumes receiving the specified user's video stream but doe
|
|
|
704
672
|
|
|
705
673
|
> **Note**
|
|
706
674
|
>
|
|
707
|
-
|
|
708
675
|
> This API can be called before room entry (enterRoom), and the pause status will be reset after room exit (exitRoom). After calling this API to pause receiving the video stream from a specific user, simply calling the startRemoteView API will not be able to play the video from that user. You need to call muteRemoteVideoStream(false) or muteAllRemoteVideoStreams(false) to resume it.
|
|
709
676
|
>
|
|
710
677
|
|
|
@@ -720,10 +687,8 @@ This API only pauses/resumes receiving all users' video streams but does not rel
|
|
|
720
687
|
|
|
721
688
|
> **Note**
|
|
722
689
|
>
|
|
723
|
-
|
|
724
690
|
> This API can be called before room entry (enterRoom), and the pause status will be reset after room exit (exitRoom).
|
|
725
691
|
>
|
|
726
|
-
|
|
727
692
|
> After calling this interface to pause receiving video streams from all users, simply calling the startRemoteView interface will not be able to play the video from a specific user. You need to call muteRemoteVideoStream(false) or muteAllRemoteVideoStreams(false) to resume it.
|
|
728
693
|
>
|
|
729
694
|
|
|
@@ -739,7 +704,6 @@ This setting can determine the quality of image viewed by remote users, which is
|
|
|
739
704
|
|
|
740
705
|
> **Note**
|
|
741
706
|
>
|
|
742
|
-
|
|
743
707
|
> Begin from v11.5 version, the encoding output resolution will be aligned according to width 8 and height 2 bytes, and will be adjusted downward, eg: input resolution 540x960, actual encoding output resolution 536x960.
|
|
744
708
|
>
|
|
745
709
|
|
|
@@ -790,9 +754,9 @@ In this way, other users in the room can choose to subscribe to the **HD big ima
|
|
|
790
754
|
|
|
791
755
|
> **Note**
|
|
792
756
|
>
|
|
793
|
-
|
|
794
757
|
> Dual-channel encoding will consume more CPU resources and network bandwidth; therefore, this feature can be enabled on macOS, Windows, or high-spec tablets, but is not recommended for phones.
|
|
795
758
|
>
|
|
759
|
+
|
|
796
760
|
**Return Desc:**
|
|
797
761
|
|
|
798
762
|
0: success; -1: the current big image has been set to a lower quality, and it is not necessary to enable dual-channel encoding
|
|
@@ -812,7 +776,6 @@ You can use this API to select whether the image subscribed to is the big image
|
|
|
812
776
|
|
|
813
777
|
> **Note**
|
|
814
778
|
>
|
|
815
|
-
|
|
816
779
|
> To implement this feature, the target user must have enabled the dual-channel encoding mode through enableEncSmallVideoStream; otherwise, this API will not work.
|
|
817
780
|
>
|
|
818
781
|
|
|
@@ -830,7 +793,6 @@ You can use this API to screencapture the local video image or the primary strea
|
|
|
830
793
|
|
|
831
794
|
> **Note**
|
|
832
795
|
>
|
|
833
|
-
|
|
834
796
|
> On Windows, only video image from the TRTC_SNAPSHOT_SOURCE_TYPE_STREAM source can be screencaptured currently.
|
|
835
797
|
>
|
|
836
798
|
|
|
@@ -871,11 +833,10 @@ The SDK does not enable the mic by default. When a user wants to publish the loc
|
|
|
871
833
|
After local audio capturing and publishing is enabled, other users in the room will receive the onUserAudioAvailable(userId, true) notification.
|
|
872
834
|
| Param | DESC |
|
|
873
835
|
| --- | --- |
|
|
874
|
-
| quality | Sound quality<br>-
|
|
836
|
+
| quality | Sound quality<br>- TRTC_AUDIO_QUALITY_SPEECH - Smooth: mono channel; audio bitrate: 18 Kbps. This is suitable for audio call scenarios, such as online meeting and audio call.<br>- TRTC_AUDIO_QUALITY_DEFAULT - Default: mono channel; audio bitrate: 50 Kbps. This is the default sound quality of the SDK and recommended if there are no special requirements.<br>- TRTC_AUDIO_QUALITY_MUSIC - HD: dual channel + full band; audio bitrate: 128 Kbps. This is suitable for scenarios where Hi-Fi music transfer is required, such as online karaoke and music live streaming. |
|
|
875
837
|
|
|
876
838
|
> **Note**
|
|
877
839
|
>
|
|
878
|
-
|
|
879
840
|
> This API will check the mic permission. If the current application does not have permission to use the mic, the SDK will automatically ask the user to grant the mic permission.
|
|
880
841
|
>
|
|
881
842
|
|
|
@@ -893,11 +854,11 @@ After local audio publishing is paused, other users in the room will receive the
|
|
|
893
854
|
|
|
894
855
|
After local audio publishing is resumed, other users in the room will receive the onUserAudioAvailable(userId, true) notification.
|
|
895
856
|
|
|
896
|
-
Different from stopLocalAudio,
|
|
857
|
+
Different from stopLocalAudio, `muteLocalAudio(true)` does not release the mic permission; instead, it continues to send mute packets with extremely low bitrate.
|
|
897
858
|
|
|
898
859
|
This is very suitable for scenarios that require on-cloud recording, as video file formats such as MP4 have a high requirement for audio continuity, while an MP4 recording file cannot be played back smoothly if stopLocalAudio is used.
|
|
899
860
|
|
|
900
|
-
Therefore,
|
|
861
|
+
Therefore, `muteLocalAudio` instead of stopLocalAudio is recommended in scenarios where the requirement for recording file quality is high.
|
|
901
862
|
|
|
902
863
|
|Param|DESC|
|
|
903
864
|
|---------|---------|
|
|
@@ -916,8 +877,7 @@ When you mute the remote audio of a specified user, the SDK will stop playing ba
|
|
|
916
877
|
|
|
917
878
|
> **Note**
|
|
918
879
|
>
|
|
919
|
-
|
|
920
|
-
> This API works when called either before or after room entry (enterRoom), and the mute status will be reset to ` false ` after room exit (exitRoom).
|
|
880
|
+
> This API works when called either before or after room entry (enterRoom), and the mute status will be reset to `false` after room exit (exitRoom).
|
|
921
881
|
>
|
|
922
882
|
|
|
923
883
|
## muteAllRemoteAudio
|
|
@@ -932,8 +892,7 @@ When you mute the audio of all remote users, the SDK will stop playing back all
|
|
|
932
892
|
|
|
933
893
|
> **Note**
|
|
934
894
|
>
|
|
935
|
-
|
|
936
|
-
> This API works when called either before or after room entry (enterRoom), and the mute status will be reset to ` false ` after room exit (exitRoom).
|
|
895
|
+
> This API works when called either before or after room entry (enterRoom), and the mute status will be reset to `false` after room exit (exitRoom).
|
|
937
896
|
>
|
|
938
897
|
|
|
939
898
|
## setAudioRoute
|
|
@@ -956,7 +915,7 @@ If audio route is set to the speaker, the volume is relatively high, so there is
|
|
|
956
915
|
|
|
957
916
|
**Set the audio playback volume of remote user.**
|
|
958
917
|
|
|
959
|
-
You can mute the audio of a remote user through
|
|
918
|
+
You can mute the audio of a remote user through `setRemoteAudioVolume(userId, 0)` .
|
|
960
919
|
|
|
961
920
|
|Param|DESC|
|
|
962
921
|
|---------|---------|
|
|
@@ -965,7 +924,6 @@ You can mute the audio of a remote user through ` setRemoteAudioVolume(userId, 0
|
|
|
965
924
|
|
|
966
925
|
> **Note**
|
|
967
926
|
>
|
|
968
|
-
|
|
969
927
|
> If 100 is still not loud enough for you, you can set the volume to up to 150, but there may be side effects.
|
|
970
928
|
>
|
|
971
929
|
|
|
@@ -979,13 +937,12 @@ You can mute the audio of a remote user through ` setRemoteAudioVolume(userId, 0
|
|
|
979
937
|
|
|
980
938
|
> **Note**
|
|
981
939
|
>
|
|
982
|
-
|
|
983
940
|
> If 100 is still not loud enough for you, you can set the volume to up to 150, but there may be side effects.
|
|
984
941
|
>
|
|
985
942
|
|
|
986
943
|
## getAudioCaptureVolume
|
|
987
944
|
|
|
988
|
-
**Get the capturing volume of local audio
|
|
945
|
+
**Get the capturing volume of local audio.Return Desc:**
|
|
989
946
|
|
|
990
947
|
capturing volume
|
|
991
948
|
|
|
@@ -1001,7 +958,6 @@ This API controls the volume of the sound ultimately delivered by the SDK to the
|
|
|
1001
958
|
|
|
1002
959
|
> **Note**
|
|
1003
960
|
>
|
|
1004
|
-
|
|
1005
961
|
> If 100 is still not loud enough for you, you can set the volume to up to 150, but there may be side effects.
|
|
1006
962
|
>
|
|
1007
963
|
|
|
@@ -1022,7 +978,6 @@ After this feature is enabled, the SDK will return the audio volume assessment i
|
|
|
1022
978
|
|
|
1023
979
|
> **Note**
|
|
1024
980
|
>
|
|
1025
|
-
|
|
1026
981
|
> To enable this feature, call this API before calling startLocalAudio.
|
|
1027
982
|
>
|
|
1028
983
|
|
|
@@ -1042,9 +997,9 @@ The startup and completion status of the recording will be notified through loca
|
|
|
1042
997
|
|
|
1043
998
|
> **Note**
|
|
1044
999
|
>
|
|
1045
|
-
|
|
1046
1000
|
> Since version 11.5, the results of audio recording have been changed to be notified through asynchronous callbacks instead of return values. Please refer to the relevant callbacks of TRTCCloudListener .
|
|
1047
1001
|
>
|
|
1002
|
+
|
|
1048
1003
|
**Return Desc:**
|
|
1049
1004
|
|
|
1050
1005
|
0: success; -1: audio recording has been started; -2: failed to create file or directory; -3: the audio format of the specified file extension is not supported.
|
|
@@ -1106,10 +1061,8 @@ Update self position and orientation in the world coordinate system. The SDK wil
|
|
|
1106
1061
|
|
|
1107
1062
|
> **Note**
|
|
1108
1063
|
>
|
|
1109
|
-
|
|
1110
1064
|
> 1. The length of array should be 3.
|
|
1111
1065
|
>
|
|
1112
|
-
|
|
1113
1066
|
> 2. Please limit the calling frequency appropriately. It's recommended that the interval between two operations be at least 100ms.
|
|
1114
1067
|
>
|
|
1115
1068
|
|
|
@@ -1126,10 +1079,8 @@ Update the specified remote user's position in the world coordinate system. The
|
|
|
1126
1079
|
|
|
1127
1080
|
> **Note**
|
|
1128
1081
|
>
|
|
1129
|
-
|
|
1130
1082
|
> 1. The length of array should be 3.
|
|
1131
1083
|
>
|
|
1132
|
-
|
|
1133
1084
|
> 2. Please limit the calling frequency appropriately. It's recommended that the interval between two operations of the same remote user be at least 100ms.
|
|
1134
1085
|
>
|
|
1135
1086
|
|
|
@@ -1176,7 +1127,7 @@ beauty filter management class TXBeautyManager.
|
|
|
1176
1127
|
|
|
1177
1128
|
**Add watermark.**
|
|
1178
1129
|
|
|
1179
|
-
The watermark position is determined by the
|
|
1130
|
+
The watermark position is determined by the `rect` parameter, which is a quadruple in the format of (x, y, width, height).
|
|
1180
1131
|
- x: X coordinate of watermark, which is a floating-point number between 0 and 1.
|
|
1181
1132
|
|
|
1182
1133
|
- y: Y coordinate of watermark, which is a floating-point number between 0 and 1.
|
|
@@ -1187,27 +1138,26 @@ The watermark position is determined by the ` rect ` parameter, which is a quadr
|
|
|
1187
1138
|
|
|
1188
1139
|
Sample parameter:
|
|
1189
1140
|
|
|
1190
|
-
If the encoding resolution of the current video is 540x960, and the
|
|
1141
|
+
If the encoding resolution of the current video is 540x960, and the `rect` parameter is set to (0.1, 0.1, 0.2, 0.0),
|
|
1191
1142
|
|
|
1192
|
-
then the coordinates of the top-left point of the watermark will be (540 * 0.1, 960 * 0.1), i.e., (54, 96), the watermark width will be
|
|
1143
|
+
then the coordinates of the top-left point of the watermark will be (540 * 0.1, 960 * 0.1), i.e., (54, 96), the watermark width will be `540 * 0.2 = 108 px` , and the watermark height will be calculated automatically by the SDK based on the watermark image's aspect ratio.
|
|
1193
1144
|
|
|
1194
1145
|
|Param|DESC|
|
|
1195
1146
|
|---------|---------|
|
|
1196
1147
|
|image|Watermark image, which must be a PNG image with transparent background|
|
|
1197
|
-
|rect|Unified coordinates of the watermark relative to the encoded resolution. Value range of
|
|
1148
|
+
|rect|Unified coordinates of the watermark relative to the encoded resolution. Value range of `x` , `y` , `width` , and `height` : 0–1.|
|
|
1198
1149
|
|streamType|Specify for which image to set the watermark. For more information, please see TRTCVideoStreamType.|
|
|
1199
1150
|
|
|
1200
1151
|
> **Note**
|
|
1201
1152
|
>
|
|
1202
|
-
|
|
1203
|
-
> If you want to set watermarks for both the primary image (generally for the camera) and the substream image (generally for screen sharing), you need to call this API twice with ` streamType ` set to different values.
|
|
1153
|
+
> If you want to set watermarks for both the primary image (generally for the camera) and the substream image (generally for screen sharing), you need to call this API twice with `streamType` set to different values.
|
|
1204
1154
|
>
|
|
1205
1155
|
|
|
1206
1156
|
## getAudioEffectManager
|
|
1207
1157
|
|
|
1208
1158
|
**Get sound effect management class (TXAudioEffectManager).**
|
|
1209
1159
|
|
|
1210
|
-
`
|
|
1160
|
+
`TXAudioEffectManager` is a sound effect management API, through which you can implement the following features:
|
|
1211
1161
|
- Background music: both online music and local music can be played back with various features such as speed adjustment, pitch adjustment, original voice, accompaniment, and loop.
|
|
1212
1162
|
|
|
1213
1163
|
- In-ear monitoring: the sound captured by the mic is played back in the headphones in real time, which is generally used for music live streaming.
|
|
@@ -1216,7 +1166,7 @@ then the coordinates of the top-left point of the watermark will be (540 * 0.1,
|
|
|
1216
1166
|
|
|
1217
1167
|
- Voice changing effect: young girl, middle-aged man, heavy metal, and other effects.
|
|
1218
1168
|
|
|
1219
|
-
- Short sound effect: short sound effect files such as applause and laughter are supported (for files less than 10 seconds in length, please set the
|
|
1169
|
+
- Short sound effect: short sound effect files such as applause and laughter are supported (for files less than 10 seconds in length, please set the `isShortFile` parameter to `true` ).
|
|
1220
1170
|
**Return Desc:**
|
|
1221
1171
|
|
|
1222
1172
|
sound effect management class TXAudioEffectManager.
|
|
@@ -1233,16 +1183,12 @@ In live music scenarios, an anchor can use this API to have the SDK capture the
|
|
|
1233
1183
|
|
|
1234
1184
|
> **Note**
|
|
1235
1185
|
>
|
|
1236
|
-
|
|
1237
1186
|
> 1. This interface only works on Android API 29 and above.
|
|
1238
1187
|
>
|
|
1239
|
-
|
|
1240
1188
|
> 2. You need to use this interface to enable system sound capture first, and it will take effect only when you call startScreenCapture to enable screen sharing.
|
|
1241
1189
|
>
|
|
1242
|
-
|
|
1243
|
-
> 3. You need to add a foreground service to ensure that the system sound capture is not silenced, and set ` android:foregroundServiceType="mediaProjection" `.
|
|
1190
|
+
> 3. You need to add a foreground service to ensure that the system sound capture is not silenced, and set `android:foregroundServiceType="mediaProjection"` .
|
|
1244
1191
|
>
|
|
1245
|
-
|
|
1246
1192
|
> 4. The SDK only capture audio of applications that satisfies the capture strategy and audio usage. Currently, the audio usage captured by the SDK includes USAGE_MEDIA, USAGE_GAME.
|
|
1247
1193
|
>
|
|
1248
1194
|
|
|
@@ -1277,21 +1223,17 @@ Video encoding parameters recommended for screen sharing on Android (TRTCVideoEn
|
|
|
1277
1223
|
|
|
1278
1224
|
|Param|DESC|
|
|
1279
1225
|
|---------|---------|
|
|
1280
|
-
|encParams|Encoding parameters. For more information, please see TRTCCloudDef#TRTCVideoEncParam. If
|
|
1281
|
-
|shareParams|For more information, please see TRTCCloudDef#TRTCScreenShareParams. You can use the
|
|
1226
|
+
|encParams|Encoding parameters. For more information, please see TRTCCloudDef#TRTCVideoEncParam. If `encParams` is set to `null` , the SDK will automatically use the previously set encoding parameter.|
|
|
1227
|
+
|shareParams|For more information, please see TRTCCloudDef#TRTCScreenShareParams. You can use the `floatingView` parameter to pop up a floating window (you can also use Android's `WindowManager` parameter to configure automatic pop-up).|
|
|
1282
1228
|
|
|
1283
1229
|
> **Note**
|
|
1284
1230
|
>
|
|
1285
|
-
|
|
1286
1231
|
> Starting from Android 14 version, if you do not need to use the screen sharing function, you need to remove the permissions of the screen sharing front-end service in AndroidManifest.xml in your project, as follows:
|
|
1287
1232
|
>
|
|
1288
|
-
|
|
1289
1233
|
> <uses-permission android:name="android.permission.FOREGROUND_SERVICE_MEDIA_PROJECTION" tools:node="remove" />
|
|
1290
1234
|
>
|
|
1291
|
-
|
|
1292
1235
|
> If you need to use the screen sharing feature, you need to fill in the Play Console Statement as required by Google. The reference document is as follows:
|
|
1293
1236
|
>
|
|
1294
|
-
|
|
1295
1237
|
> https://support.google.com/googleplay/android-developer/answer/13392821
|
|
1296
1238
|
>
|
|
1297
1239
|
|
|
@@ -1305,7 +1247,6 @@ Video encoding parameters recommended for screen sharing on Android (TRTCVideoEn
|
|
|
1305
1247
|
|
|
1306
1248
|
> **Note**
|
|
1307
1249
|
>
|
|
1308
|
-
|
|
1309
1250
|
> Begin from v11.5 version, paused screen capture will use the last frame to output at a frame rate of 1fps.
|
|
1310
1251
|
>
|
|
1311
1252
|
|
|
@@ -1320,9 +1261,9 @@ Video encoding parameters recommended for screen sharing on Android (TRTCVideoEn
|
|
|
1320
1261
|
This API can set the image quality of screen sharing (i.e., the substream) viewed by remote users, which is also the image quality of screen sharing in on-cloud recording files.
|
|
1321
1262
|
|
|
1322
1263
|
Please note the differences between the following two APIs:
|
|
1323
|
-
-
|
|
1264
|
+
- setVideoEncoderParam is used to set the video encoding parameters of the primary stream image (TRTC_VIDEO_STREAM_TYPE_BIG, generally for camera).
|
|
1324
1265
|
|
|
1325
|
-
-
|
|
1266
|
+
- setSubStreamEncoderParam is used to set the video encoding parameters of the substream image (TRTC_VIDEO_STREAM_TYPE_SUB, generally for screen sharing).
|
|
1326
1267
|
|
|
1327
1268
|
|Param|DESC|
|
|
1328
1269
|
|---------|---------|
|
|
@@ -1356,18 +1297,15 @@ For more information, please see [Custom Capturing and Rendering](https://www.te
|
|
|
1356
1297
|
|
|
1357
1298
|
|Param|DESC|
|
|
1358
1299
|
|---------|---------|
|
|
1359
|
-
|frame|Video data. If the memory-based delivery scheme is used, please set the
|
|
1300
|
+
|frame|Video data. If the memory-based delivery scheme is used, please set the `data` field; if the video memory-based delivery scheme is used, please set the `TRTCTexture` field. For `bufferType` , TRTC_VIDEO_BUFFER_TYPE_TEXTURE is recommended; for `pixelFormat` , TRTC_VIDEO_PIXEL_FORMAT_Texture_2D is recommended. Refer to TRTCVideoFrame for more supported formats.|
|
|
1360
1301
|
|streamType|Specify video stream type (TRTC_VIDEO_STREAM_TYPE_BIG: HD big image; TRTC_VIDEO_STREAM_TYPE_SUB: substream image).|
|
|
1361
1302
|
|
|
1362
1303
|
> **Note**
|
|
1363
1304
|
>
|
|
1364
|
-
|
|
1365
|
-
> 1. We recommend you call the generateCustomPTS API to get the ` timestamp ` value of a video frame immediately after capturing it, so as to achieve the best audio/video sync effect.
|
|
1305
|
+
> 1. We recommend you call the generateCustomPTS API to get the `timestamp` value of a video frame immediately after capturing it, so as to achieve the best audio/video sync effect.
|
|
1366
1306
|
>
|
|
1367
|
-
|
|
1368
1307
|
> 2. The video frame rate eventually encoded by the SDK is not determined by the frequency at which you call this API, but by the FPS you set in setVideoEncoderParam.
|
|
1369
1308
|
>
|
|
1370
|
-
|
|
1371
1309
|
> 3. Please try to keep the calling interval of this API even; otherwise, problems will be caused, such as unstable output frame rate of the encoder or out-of-sync audio/video.
|
|
1372
1310
|
>
|
|
1373
1311
|
|
|
@@ -1385,7 +1323,6 @@ You need to use sendCustomAudioData to continuously insert the captured audio da
|
|
|
1385
1323
|
|
|
1386
1324
|
> **Note**
|
|
1387
1325
|
>
|
|
1388
|
-
|
|
1389
1326
|
> As acoustic echo cancellation (AEC) requires strict control over the audio capturing and playback time, after custom audio capturing is enabled, AEC may fail.
|
|
1390
1327
|
>
|
|
1391
1328
|
|
|
@@ -1394,7 +1331,7 @@ You need to use sendCustomAudioData to continuously insert the captured audio da
|
|
|
1394
1331
|
**Deliver captured audio data to SDK.**
|
|
1395
1332
|
|
|
1396
1333
|
We recommend you enter the following information for the TRTCAudioFrame parameter (other fields can be left empty):
|
|
1397
|
-
- audioFormat: audio data format, which can only be
|
|
1334
|
+
- audioFormat: audio data format, which can only be `TRTCAudioFrameFormatPCM` .
|
|
1398
1335
|
|
|
1399
1336
|
- data: audio frame buffer. Audio frame data must be in PCM format, and it supports a frame length of 5–100 ms (20 ms is recommended). Length calculation method: **for example, if the sample rate is 48000, then the frame length for mono channel will be `48000 * 0.02s * 1 * 16 bit = 15360 bit = 1920 bytes`.**
|
|
1400
1337
|
|
|
@@ -1412,7 +1349,6 @@ For more information, please see [Custom Capturing and Rendering](https://www.te
|
|
|
1412
1349
|
|
|
1413
1350
|
> **Note**
|
|
1414
1351
|
>
|
|
1415
|
-
|
|
1416
1352
|
> Please call this API accurately at intervals of the frame length; otherwise, sound lag may occur due to uneven data delivery intervals.
|
|
1417
1353
|
>
|
|
1418
1354
|
|
|
@@ -1429,8 +1365,7 @@ After this feature is enabled, you can mix a custom audio track into the SDK thr
|
|
|
1429
1365
|
|
|
1430
1366
|
> **Note**
|
|
1431
1367
|
>
|
|
1432
|
-
|
|
1433
|
-
> If you specify both ` enablePublish ` and ` enablePlayout ` as ` false `, the custom audio track will be completely closed.
|
|
1368
|
+
> If you specify both `enablePublish` and `enablePlayout` as `false` , the custom audio track will be completely closed.
|
|
1434
1369
|
>
|
|
1435
1370
|
|
|
1436
1371
|
## mixExternalAudioFrame
|
|
@@ -1443,25 +1378,25 @@ You are expected to feed audio data into the SDK at an even pace, but we underst
|
|
|
1443
1378
|
|
|
1444
1379
|
Given this, we have provided a buffer pool in the SDK, which can cache the audio data you pass in to reduce the fluctuations in intervals between API calls.
|
|
1445
1380
|
|
|
1446
|
-
The value returned by this API indicates the size (ms) of the buffer pool. For example, if
|
|
1381
|
+
The value returned by this API indicates the size (ms) of the buffer pool. For example, if `50` is returned, it indicates that the buffer pool has 50 ms of audio data. As long as you call this API again within 50 ms, the SDK can make sure that continuous audio data is mixed.
|
|
1447
1382
|
|
|
1448
|
-
If the value returned is
|
|
1383
|
+
If the value returned is `100` or greater, you can wait after an audio frame is played to call the API again. If the value returned is smaller than `100` , then there isn’t enough data in the buffer pool, and you should feed more audio data into the SDK until the data in the buffer pool is above the safety level.
|
|
1449
1384
|
|
|
1450
1385
|
Fill the fields in TRTCAudioFrame as follows (other fields are not required).
|
|
1451
|
-
-
|
|
1386
|
+
- `data` : audio frame buffer. Audio frames must be in PCM format. Each frame can be 5-100 ms (20 ms is recommended) in duration. Assume that the sample rate is 48000, and sound channels mono-channel. Then the **frame size would be 48000 x 0.02s x 1 x 16 bit = 15360 bit = 1920 bytes**.
|
|
1452
1387
|
|
|
1453
|
-
-
|
|
1388
|
+
- `sampleRate` : sample rate. Valid values: 16000, 24000, 32000, 44100, 48000
|
|
1454
1389
|
|
|
1455
|
-
-
|
|
1390
|
+
- `channel` : number of sound channels (if dual-channel is used, data is interleaved). Valid values: `1` (mono-channel); `2` (dual channel)
|
|
1456
1391
|
|
|
1457
|
-
-
|
|
1392
|
+
- `timestamp` : timestamp (ms). Set it to the timestamp when audio frames are captured, which you can obtain by calling generateCustomPTS after getting an audio frame.
|
|
1458
1393
|
|
|
1459
1394
|
|Param|DESC|
|
|
1460
1395
|
|---------|---------|
|
|
1461
1396
|
|frame|Audio data|
|
|
1462
1397
|
**Return Desc:**
|
|
1463
1398
|
|
|
1464
|
-
If the value returned is
|
|
1399
|
+
If the value returned is `0` or greater, the value represents the current size of the buffer pool; if the value returned is smaller than `0` , it means that an error occurred. `-1` indicates that you didn’t call enableMixExternalAudioFrame to enable custom audio tracks.
|
|
1465
1400
|
|
|
1466
1401
|
## setMixExternalAudioVolume
|
|
1467
1402
|
|
|
@@ -1484,7 +1419,7 @@ When you call APIs such as sendCustomVideoData or sendCustomAudioData for custom
|
|
|
1484
1419
|
|
|
1485
1420
|
2. Then, send the video or audio frame to the preprocessing module you use (such as a third-party beauty filter or sound effect component).
|
|
1486
1421
|
|
|
1487
|
-
3. When you actually call sendCustomVideoData or sendCustomAudioData for delivery, assign the PTS timestamp recorded when the frame was captured to the
|
|
1422
|
+
3. When you actually call sendCustomVideoData or sendCustomAudioData for delivery, assign the PTS timestamp recorded when the frame was captured to the `timestamp` field in TRTCVideoFrame or TRTCAudioFrame.**Return Desc:**
|
|
1488
1423
|
|
|
1489
1424
|
Timestamp in ms
|
|
1490
1425
|
|
|
@@ -1492,12 +1427,12 @@ Timestamp in ms
|
|
|
1492
1427
|
|
|
1493
1428
|
**Set video data callback for third-party beauty filters.**
|
|
1494
1429
|
|
|
1495
|
-
After this callback is set, the SDK will call back the captured video frames through the
|
|
1430
|
+
After this callback is set, the SDK will call back the captured video frames through the `listener` you set and use them for further processing by a third-party beauty filter component. Then, the SDK will encode and send the processed video frames.
|
|
1496
1431
|
| Param | DESC |
|
|
1497
1432
|
| --- | --- |
|
|
1498
|
-
| bufferType | Specify the format of the data called back. Currently, it supports:<br>-
|
|
1433
|
+
| bufferType | Specify the format of the data called back. Currently, it supports:<br>- TRTC_VIDEO_BUFFER_TYPE_TEXTURE: suitable when <code>pixelFormat</code> is set to TRTC_VIDEO_PIXEL_FORMAT_Texture_2D.<br>- TRTC_VIDEO_BUFFER_TYPE_BYTE_BUFFER: suitable when <code>pixelFormat</code> is set to TRTC_VIDEO_PIXEL_FORMAT_I420.<br>- TRTC_VIDEO_BUFFER_TYPE_BYTE_ARRAY: suitable when <code>pixelFormat</code> is set to TRTC_VIDEO_PIXEL_FORMAT_I420. |
|
|
1499
1434
|
| listener | Custom preprocessing callback. For more information, please see TRTCVideoFrameListener |
|
|
1500
|
-
| pixelFormat | Specify the format of the pixel called back. Currently, it supports:<br>-
|
|
1435
|
+
| pixelFormat | Specify the format of the pixel called back. Currently, it supports:<br>- TRTC_VIDEO_PIXEL_FORMAT_Texture_2D: video memory-based texture scheme.<br>- TRTC_VIDEO_PIXEL_FORMAT_I420: memory-based data scheme. |
|
|
1501
1436
|
**Return Desc:**
|
|
1502
1437
|
|
|
1503
1438
|
0: success; values smaller than 0: error(For more information, please see TXLiteAVError)
|
|
@@ -1507,16 +1442,16 @@ After this callback is set, the SDK will call back the captured video frames thr
|
|
|
1507
1442
|
**Set the callback of custom rendering for local video.**
|
|
1508
1443
|
|
|
1509
1444
|
After this callback is set, the SDK will skip its own rendering process and call back the captured data. Therefore, you need to complete image rendering on your own.
|
|
1510
|
-
-
|
|
1445
|
+
- `pixelFormat` specifies the format of the data called back. Currently, Texture2D, I420, and RGBA formats are supported.
|
|
1511
1446
|
|
|
1512
|
-
-
|
|
1447
|
+
- `bufferType` specifies the buffer type. `BYTE_BUFFER` is suitable for the JNI layer, while `BYTE_ARRAY` can be used in direct operations at the Java layer.
|
|
1513
1448
|
|
|
1514
1449
|
For more information, please see [Custom Capturing and Rendering](https://www.tencentcloud.com/document/product/647/35158).
|
|
1515
1450
|
| Param | DESC |
|
|
1516
1451
|
| --- | --- |
|
|
1517
|
-
| bufferType | Specify the data structure of the video frame:<br>-
|
|
1452
|
+
| bufferType | Specify the data structure of the video frame:<br>- TRTC_VIDEO_BUFFER_TYPE_TEXTURE: suitable when <code>pixelFormat</code> is set to TRTC_VIDEO_PIXEL_FORMAT_Texture_2D.<br>- TRTC_VIDEO_BUFFER_TYPE_BYTE_BUFFER: suitable when <code>pixelFormat</code> is set to TRTC_VIDEO_PIXEL_FORMAT_I420 or TRTC_VIDEO_PIXEL_FORMAT_RGBA.<br>- TRTC_VIDEO_BUFFER_TYPE_BYTE_ARRAY: suitable when <code>pixelFormat</code> is set to TRTC_VIDEO_PIXEL_FORMAT_I420 or TRTC_VIDEO_PIXEL_FORMAT_RGBA. |
|
|
1518
1453
|
| listener | Callback of custom video rendering. The callback is returned once for each video frame |
|
|
1519
|
-
| pixelFormat | Specify the format of the video frame, such as:<br>-
|
|
1454
|
+
| pixelFormat | Specify the format of the video frame, such as:<br>- TRTC_VIDEO_PIXEL_FORMAT_Texture_2D: OpenGL texture format, which is suitable for GPU processing and has a high processing efficiency.<br>- TRTC_VIDEO_PIXEL_FORMAT_I420: standard I420 format, which is suitable for CPU processing and has a poor processing efficiency.<br>- TRTC_VIDEO_PIXEL_FORMAT_RGBA: RGBA format, which is suitable for CPU processing and has a poor processing efficiency. |
|
|
1520
1455
|
**Return Desc:**
|
|
1521
1456
|
|
|
1522
1457
|
0: success; values smaller than 0: error(For more information, please see TXLiteAVError)
|
|
@@ -1526,9 +1461,9 @@ For more information, please see [Custom Capturing and Rendering](https://www.te
|
|
|
1526
1461
|
**Set the callback of custom rendering for remote video.**
|
|
1527
1462
|
|
|
1528
1463
|
After this callback is set, the SDK will skip its own rendering process and call back the captured data. Therefore, you need to complete image rendering on your own.
|
|
1529
|
-
-
|
|
1464
|
+
- `pixelFormat` specifies the format of the called back data, such as NV12, I420, and 32BGRA.
|
|
1530
1465
|
|
|
1531
|
-
-
|
|
1466
|
+
- `bufferType` specifies the buffer type. `PixelBuffer` has the highest efficiency, while `NSData` makes the SDK perform a memory conversion internally, which will result in extra performance loss.
|
|
1532
1467
|
|
|
1533
1468
|
For more information, please see [Custom Capturing and Rendering](https://www.tencentcloud.com/document/product/647/35158).
|
|
1534
1469
|
|
|
@@ -1541,9 +1476,9 @@ For more information, please see [Custom Capturing and Rendering](https://www.te
|
|
|
1541
1476
|
|
|
1542
1477
|
> **Note**
|
|
1543
1478
|
>
|
|
1544
|
-
|
|
1545
|
-
> Before this API is called, ` startRemoteView(nil) ` needs to be called to get the video stream of the remote user (` view ` can be set to ` nil ` for this end); otherwise, there will be no data called back.
|
|
1479
|
+
> Before this API is called, `startRemoteView(nil)` needs to be called to get the video stream of the remote user ( `view` can be set to `nil` for this end); otherwise, there will be no data called back.
|
|
1546
1480
|
>
|
|
1481
|
+
|
|
1547
1482
|
**Return Desc:**
|
|
1548
1483
|
|
|
1549
1484
|
0: success; values smaller than 0: error(For more information, please see TXLiteAVError)
|
|
@@ -1553,17 +1488,16 @@ For more information, please see [Custom Capturing and Rendering](https://www.te
|
|
|
1553
1488
|
**Set custom audio data callback.**
|
|
1554
1489
|
|
|
1555
1490
|
After this callback is set, the SDK will internally call back the audio data (in PCM format), including:
|
|
1556
|
-
-
|
|
1491
|
+
- onCapturedAudioFrame: callback of the audio data captured by the local mic
|
|
1557
1492
|
|
|
1558
|
-
-
|
|
1493
|
+
- onLocalProcessedAudioFrame: callback of the audio data captured by the local mic and preprocessed by the audio module
|
|
1559
1494
|
|
|
1560
|
-
-
|
|
1495
|
+
- onRemoteUserAudioFrame: audio data from each remote user before audio mixing
|
|
1561
1496
|
|
|
1562
|
-
-
|
|
1497
|
+
- onMixedPlayAudioFrame: callback of the audio data that will be played back by the system after audio streams are mixed
|
|
1563
1498
|
|
|
1564
1499
|
> **Note**
|
|
1565
1500
|
>
|
|
1566
|
-
|
|
1567
1501
|
> Setting the callback to null indicates to stop the custom audio callback, while setting it to a non-null value indicates to start the custom audio callback.
|
|
1568
1502
|
>
|
|
1569
1503
|
|
|
@@ -1571,7 +1505,7 @@ After this callback is set, the SDK will internally call back the audio data (in
|
|
|
1571
1505
|
|
|
1572
1506
|
**Set the callback format of audio frames captured by local mic.**
|
|
1573
1507
|
|
|
1574
|
-
This API is used to set the
|
|
1508
|
+
This API is used to set the `AudioFrame` format called back by onCapturedAudioFrame:
|
|
1575
1509
|
- sampleRate: sample rate. Valid values: 16000, 32000, 44100, 48000
|
|
1576
1510
|
|
|
1577
1511
|
- channel: number of channels (if stereo is used, data is interwoven). Valid values: 1: mono channel; 2: dual channel
|
|
@@ -1580,11 +1514,11 @@ This API is used to set the ` AudioFrame ` format called back by onCapturedAudio
|
|
|
1580
1514
|
|
|
1581
1515
|
If you want to calculate the callback frame length in milliseconds, the formula for converting the number of milliseconds into the number of sample points is as follows: number of sample points = number of milliseconds * sample rate / 1000
|
|
1582
1516
|
|
|
1583
|
-
For example, if you want to call back the data of 20 ms frame length with 48000 sample rate, then the number of sample points should be entered as
|
|
1517
|
+
For example, if you want to call back the data of 20 ms frame length with 48000 sample rate, then the number of sample points should be entered as `960 = 20 * 48000 / 1000` .
|
|
1584
1518
|
|
|
1585
|
-
Note that the frame length of the final callback is in bytes, and the calculation formula for converting the number of sample points into the number of bytes is as follows:
|
|
1519
|
+
Note that the frame length of the final callback is in bytes, and the calculation formula for converting the number of sample points into the number of bytes is as follows: `number of bytes = number of sample points * number of channels * 2 (bit width)`
|
|
1586
1520
|
|
|
1587
|
-
For example, if the parameters are 48000 sample rate, dual channel, 20 ms frame length, and 960 sample points, then the number of bytes is
|
|
1521
|
+
For example, if the parameters are 48000 sample rate, dual channel, 20 ms frame length, and 960 sample points, then the number of bytes is `3840 = 960 * 2 * 2`
|
|
1588
1522
|
|
|
1589
1523
|
|Param|DESC|
|
|
1590
1524
|
|---------|---------|
|
|
@@ -1597,20 +1531,20 @@ For example, if the parameters are 48000 sample rate, dual channel, 20 ms frame
|
|
|
1597
1531
|
|
|
1598
1532
|
**Set the callback format of preprocessed local audio frames.**
|
|
1599
1533
|
|
|
1600
|
-
This API is used to set the
|
|
1534
|
+
This API is used to set the `AudioFrame` format called back by onLocalProcessedAudioFrame:
|
|
1601
1535
|
- sampleRate: sample rate. Valid values: 16000, 32000, 44100, 48000
|
|
1602
1536
|
|
|
1603
1537
|
- channel: number of channels (if stereo is used, data is interwoven). Valid values: 1: mono channel; 2: dual channel
|
|
1604
1538
|
|
|
1605
1539
|
- samplesPerCall: number of sample points, which defines the frame length of the callback data. The frame length must be an integer multiple of 10 ms.
|
|
1606
1540
|
|
|
1607
|
-
If you want to calculate the callback frame length in milliseconds, the formula for converting the number of milliseconds into the number of sample points is as follows:
|
|
1541
|
+
If you want to calculate the callback frame length in milliseconds, the formula for converting the number of milliseconds into the number of sample points is as follows: `number of sample points = number of milliseconds * sample rate / 1000` .
|
|
1608
1542
|
|
|
1609
|
-
For example, if you want to call back the data of 20 ms frame length with 48000 sample rate, then the number of sample points should be entered as
|
|
1543
|
+
For example, if you want to call back the data of 20 ms frame length with 48000 sample rate, then the number of sample points should be entered as `960 = 20 * 48000 / 1000` .
|
|
1610
1544
|
|
|
1611
|
-
Note that the frame length of the final callback is in bytes, and the calculation formula for converting the number of sample points into the number of bytes is as follows:
|
|
1545
|
+
Note that the frame length of the final callback is in bytes, and the calculation formula for converting the number of sample points into the number of bytes is as follows: `number of bytes = number of sample points * number of channels * 2 (bit width)` .
|
|
1612
1546
|
|
|
1613
|
-
For example, if the parameters are 48000 sample rate, dual channel, 20 ms frame length, and 960 sample points, then the number of bytes is
|
|
1547
|
+
For example, if the parameters are 48000 sample rate, dual channel, 20 ms frame length, and 960 sample points, then the number of bytes is `3840 = 960 * 2 * 2` .
|
|
1614
1548
|
|
|
1615
1549
|
|Param|DESC|
|
|
1616
1550
|
|---------|---------|
|
|
@@ -1623,20 +1557,20 @@ For example, if the parameters are 48000 sample rate, dual channel, 20 ms frame
|
|
|
1623
1557
|
|
|
1624
1558
|
**Set the callback format of audio frames to be played back by system.**
|
|
1625
1559
|
|
|
1626
|
-
This API is used to set the
|
|
1560
|
+
This API is used to set the `AudioFrame` format called back by onMixedPlayAudioFrame:
|
|
1627
1561
|
- sampleRate: sample rate. Valid values: 16000, 32000, 44100, 48000
|
|
1628
1562
|
|
|
1629
1563
|
- channel: number of channels (if stereo is used, data is interwoven). Valid values: 1: mono channel; 2: dual channel
|
|
1630
1564
|
|
|
1631
1565
|
- samplesPerCall: number of sample points, which defines the frame length of the callback data. The frame length must be an integer multiple of 10 ms.
|
|
1632
1566
|
|
|
1633
|
-
If you want to calculate the callback frame length in milliseconds, the formula for converting the number of milliseconds into the number of sample points is as follows:
|
|
1567
|
+
If you want to calculate the callback frame length in milliseconds, the formula for converting the number of milliseconds into the number of sample points is as follows: `number of sample points = number of milliseconds * sample rate / 1000` .
|
|
1634
1568
|
|
|
1635
|
-
For example, if you want to call back the data of 20 ms frame length with 48000 sample rate, then the number of sample points should be entered as
|
|
1569
|
+
For example, if you want to call back the data of 20 ms frame length with 48000 sample rate, then the number of sample points should be entered as `960 = 20 * 48000 / 1000` .
|
|
1636
1570
|
|
|
1637
|
-
Note that the frame length of the final callback is in bytes, and the calculation formula for converting the number of sample points into the number of bytes is as follows:
|
|
1571
|
+
Note that the frame length of the final callback is in bytes, and the calculation formula for converting the number of sample points into the number of bytes is as follows: `number of bytes = number of sample points * number of channels * 2 (bit width)` .
|
|
1638
1572
|
|
|
1639
|
-
For example, if the parameters are 48000 sample rate, dual channel, 20 ms frame length, and 960 sample points, then the number of bytes is
|
|
1573
|
+
For example, if the parameters are 48000 sample rate, dual channel, 20 ms frame length, and 960 sample points, then the number of bytes is `3840 = 960 * 2 * 2` .
|
|
1640
1574
|
|
|
1641
1575
|
|Param|DESC|
|
|
1642
1576
|
|---------|---------|
|
|
@@ -1659,7 +1593,6 @@ After you enable custom audio playback, the SDK will stop using its audio API to
|
|
|
1659
1593
|
|
|
1660
1594
|
> **Note**
|
|
1661
1595
|
>
|
|
1662
|
-
|
|
1663
1596
|
> The parameter must be set before room entry to take effect.
|
|
1664
1597
|
>
|
|
1665
1598
|
|
|
@@ -1670,15 +1603,15 @@ After you enable custom audio playback, the SDK will stop using its audio API to
|
|
|
1670
1603
|
Before calling this API, you need to first enable custom audio playback using enableCustomAudioRendering.
|
|
1671
1604
|
|
|
1672
1605
|
Fill the fields in TRTCAudioFrame as follows (other fields are not required):
|
|
1673
|
-
-
|
|
1606
|
+
- `sampleRate` : sample rate (required). Valid values: 16000, 24000, 32000, 44100, 48000
|
|
1674
1607
|
|
|
1675
|
-
-
|
|
1608
|
+
- `channel` : number of sound channels (required). `1` : mono-channel; `2` : dual-channel; if dual-channel is used, data is interleaved.
|
|
1676
1609
|
|
|
1677
|
-
-
|
|
1610
|
+
- `data` : the buffer used to get audio data. You need to allocate memory for the buffer based on the duration of an audio frame.
|
|
1678
1611
|
|
|
1679
1612
|
The PCM data obtained can have a frame duration of 10 ms or 20 ms. 20 ms is recommended.
|
|
1680
1613
|
|
|
1681
|
-
Assume that the sample rate is 48000, and sound channels mono-channel. The buffer size for a 20 ms audio frame would be
|
|
1614
|
+
Assume that the sample rate is 48000, and sound channels mono-channel. The buffer size for a 20 ms audio frame would be `48000 x 0.02s x 1 x 16 bit = 15360 bit = 1920 bytes` .
|
|
1682
1615
|
|
|
1683
1616
|
|Param|DESC|
|
|
1684
1617
|
|---------|---------|
|
|
@@ -1686,13 +1619,10 @@ Assume that the sample rate is 48000, and sound channels mono-channel. The buffe
|
|
|
1686
1619
|
|
|
1687
1620
|
> **Note**
|
|
1688
1621
|
>
|
|
1689
|
-
|
|
1690
|
-
> 1. You must set ` sampleRate ` and ` channel ` in ` audioFrame `, and allocate memory for one frame of audio in advance.
|
|
1622
|
+
> 1. You must set `sampleRate` and `channel` in `audioFrame` , and allocate memory for one frame of audio in advance.
|
|
1691
1623
|
>
|
|
1692
|
-
|
|
1693
|
-
> 2. The SDK will fill the data automatically based on ` sampleRate ` and ` channel `.
|
|
1624
|
+
> 2. The SDK will fill the data automatically based on `sampleRate` and `channel` .
|
|
1694
1625
|
>
|
|
1695
|
-
|
|
1696
1626
|
> 3. We recommend that you use the system’s audio playback thread to drive the calling of this API, so that it is called each time the playback of an audio frame is complete.
|
|
1697
1627
|
>
|
|
1698
1628
|
|
|
@@ -1702,7 +1632,7 @@ Assume that the sample rate is 48000, and sound channels mono-channel. The buffe
|
|
|
1702
1632
|
|
|
1703
1633
|
This API allows you to use TRTC's UDP channel to broadcast custom data to other users in the current room for signaling transfer.
|
|
1704
1634
|
|
|
1705
|
-
Other users in the room can receive the message through the
|
|
1635
|
+
Other users in the room can receive the message through the `onRecvCustomCmdMsg` callback in TRTCCloudListener.
|
|
1706
1636
|
|
|
1707
1637
|
|Param|DESC|
|
|
1708
1638
|
|---------|---------|
|
|
@@ -1713,24 +1643,19 @@ Other users in the room can receive the message through the ` onRecvCustomCmdMsg
|
|
|
1713
1643
|
|
|
1714
1644
|
> **Note**
|
|
1715
1645
|
>
|
|
1716
|
-
|
|
1717
1646
|
> 1. Up to 30 messages can be sent per second to all users in the room (this is not supported for web and mini program currently. this limit is shared with sendSEIMsg).
|
|
1718
1647
|
>
|
|
1719
|
-
|
|
1720
1648
|
> 2. A packet can contain up to 1 KB of data; if the threshold is exceeded, the packet is very likely to be discarded by the intermediate router or server.(this limit is shared with sendSEIMsg).
|
|
1721
1649
|
>
|
|
1722
|
-
|
|
1723
1650
|
> 3. A client can send up to 16 KB of data in total per second.
|
|
1724
1651
|
>
|
|
1725
|
-
|
|
1726
|
-
> 4. ` reliable ` and ` ordered ` must be set to the same value (` true ` or ` false `) and cannot be set to different values currently.
|
|
1652
|
+
> 4. `reliable` and `ordered` must be set to the same value ( `true` or `false` ) and cannot be set to different values currently.
|
|
1727
1653
|
>
|
|
1728
|
-
|
|
1729
|
-
> 5. We strongly recommend you set different ` cmdID ` values for messages of different types. This can reduce message delay when orderly sending is required.
|
|
1654
|
+
> 5. We strongly recommend you set different `cmdID` values for messages of different types. This can reduce message delay when orderly sending is required.
|
|
1730
1655
|
>
|
|
1731
|
-
|
|
1732
1656
|
> 6. Currently only the anchor role is supported.
|
|
1733
1657
|
>
|
|
1658
|
+
|
|
1734
1659
|
**Return Desc:**
|
|
1735
1660
|
|
|
1736
1661
|
true: sent the message successfully; false: failed to send the message.
|
|
@@ -1749,7 +1674,7 @@ However, because the data block of the video frame header cannot be too large, w
|
|
|
1749
1674
|
|
|
1750
1675
|
The most common use is to embed the custom timestamp into video frames through this API so as to implement a perfect alignment between the message and video image (such as between the teaching material and video signal in the education scenario).
|
|
1751
1676
|
|
|
1752
|
-
Other users in the room can receive the message through the
|
|
1677
|
+
Other users in the room can receive the message through the `onRecvSEIMsg` callback in TRTCCloudListener.
|
|
1753
1678
|
|
|
1754
1679
|
|Param|DESC|
|
|
1755
1680
|
|---------|---------|
|
|
@@ -1758,27 +1683,21 @@ Other users in the room can receive the message through the ` onRecvSEIMsg ` cal
|
|
|
1758
1683
|
|
|
1759
1684
|
> **Note**
|
|
1760
1685
|
>
|
|
1761
|
-
|
|
1762
1686
|
> This API has the following restrictions:
|
|
1763
1687
|
>
|
|
1764
|
-
|
|
1765
1688
|
> 1. The data will not be instantly sent after this API is called; instead, it will be inserted into the next video frame after the API call.
|
|
1766
1689
|
>
|
|
1767
|
-
|
|
1768
1690
|
> 2. Up to 30 messages can be sent per second to all users in the room (this limit is shared with sendCustomCmdMsg).
|
|
1769
1691
|
>
|
|
1770
|
-
|
|
1771
1692
|
> 3. Each packet can be up to 1 KB (this limit is shared with sendCustomCmdMsg). If a large amount of data is sent, the video bitrate will increase, which may reduce the video quality or even cause lagging.
|
|
1772
1693
|
>
|
|
1773
|
-
|
|
1774
1694
|
> 4. Each client can send up to 16 KB of data in total per second (this limit is shared with sendCustomCmdMsg).
|
|
1775
1695
|
>
|
|
1776
|
-
|
|
1777
|
-
> 5. If multiple times of sending is required (i.e., ` repeatCount ` > 1), the data will be inserted into subsequent ` repeatCount ` video frames in a row for sending, which will increase the video bitrate.
|
|
1696
|
+
> 5. If multiple times of sending is required (i.e., `repeatCount` > 1), the data will be inserted into subsequent `repeatCount` video frames in a row for sending, which will increase the video bitrate.
|
|
1778
1697
|
>
|
|
1779
|
-
|
|
1780
|
-
> 6. If ` repeatCount ` is greater than 1, the data will be sent for multiple times, and the same message may be received multiple times in the onRecvSEIMsg callback; therefore, deduplication is required.
|
|
1698
|
+
> 6. If `repeatCount` is greater than 1, the data will be sent for multiple times, and the same message may be received multiple times in the onRecvSEIMsg callback; therefore, deduplication is required.
|
|
1781
1699
|
>
|
|
1700
|
+
|
|
1782
1701
|
**Return Desc:**
|
|
1783
1702
|
|
|
1784
1703
|
true: the message is allowed and will be sent with subsequent video frames; false: the message is not allowed to be sent
|
|
@@ -1793,15 +1712,13 @@ true: the message is allowed and will be sent with subsequent video frames; fals
|
|
|
1793
1712
|
|
|
1794
1713
|
> **Note**
|
|
1795
1714
|
>
|
|
1796
|
-
|
|
1797
1715
|
> 1. The speed measurement process will incur a small amount of basic service fees, See [Purchase Guide > Base Services](https://intl.cloud.tencent.com/document/product/647/34610).
|
|
1798
1716
|
>
|
|
1799
|
-
|
|
1800
1717
|
> 2. Please perform the Network speed test before room entry, because if performed after room entry, the test will affect the normal audio/video transfer, and its result will be inaccurate due to interference in the room.
|
|
1801
1718
|
>
|
|
1802
|
-
|
|
1803
1719
|
> 3. Only one network speed test task is allowed to run at the same time.
|
|
1804
1720
|
>
|
|
1721
|
+
|
|
1805
1722
|
**Return Desc:**
|
|
1806
1723
|
|
|
1807
1724
|
interface call result, <0: failure
|
|
@@ -1847,11 +1764,11 @@ If compression is disabled, logs will be stored in plaintext and can be read dir
|
|
|
1847
1764
|
**Set local log storage path.**
|
|
1848
1765
|
|
|
1849
1766
|
You can use this API to change the default storage path of the SDK's local logs, which is as follows:
|
|
1850
|
-
- Windows: C:/Users/[username]/AppData/Roaming/liteav/log, i.e., under
|
|
1767
|
+
- Windows: C:/Users/[username]/AppData/Roaming/liteav/log, i.e., under `%appdata%/liteav/log` .
|
|
1851
1768
|
|
|
1852
|
-
- iOS or macOS: under
|
|
1769
|
+
- iOS or macOS: under `sandbox Documents/log` .
|
|
1853
1770
|
|
|
1854
|
-
- Android: under
|
|
1771
|
+
- Android: under `/app directory/files/log/liteav/` .
|
|
1855
1772
|
|
|
1856
1773
|
|Param|DESC|
|
|
1857
1774
|
|---------|---------|
|
|
@@ -1859,7 +1776,6 @@ You can use this API to change the default storage path of the SDK's local logs,
|
|
|
1859
1776
|
|
|
1860
1777
|
> **Note**
|
|
1861
1778
|
>
|
|
1862
|
-
|
|
1863
1779
|
> Please be sure to call this API before all other APIs and make sure that the directory you specify exists and your application has read/write permissions of the directory.
|
|
1864
1780
|
>
|
|
1865
1781
|
|
|
@@ -1885,7 +1801,7 @@ This API is used to adjust the position of the dashboard in the video rendering
|
|
|
1885
1801
|
|
|
1886
1802
|
|Param|DESC|
|
|
1887
1803
|
|---------|---------|
|
|
1888
|
-
|margin|Inner margin of the dashboard. It should be noted that this is based on the percentage of
|
|
1804
|
+
|margin|Inner margin of the dashboard. It should be noted that this is based on the percentage of `parentView` . Value range: [0, 1]|
|
|
1889
1805
|
|userId|User ID|
|
|
1890
1806
|
|
|
1891
1807
|
## callExperimentalAPI
|
|
@@ -1907,9 +1823,9 @@ After the user exits the room, the SDK will automatically close the private encr
|
|
|
1907
1823
|
|
|
1908
1824
|
> **Note**
|
|
1909
1825
|
>
|
|
1910
|
-
|
|
1911
1826
|
> TRTC has built-in encryption for media streams before transmission. After private encryption of media streams is enabled, it will be re-encrypted with the key and initial vector you pass in.
|
|
1912
1827
|
>
|
|
1828
|
+
|
|
1913
1829
|
**Return Desc:**
|
|
1914
1830
|
|
|
1915
1831
|
Interface call result, 0: Method call succeeded, -1: The incoming parameter is invalid, -2: Your subscription has expired. If you want to renew it, Please go to purchase the [TRTC Professional Edition](https://console.trtc.io/subscription/buy/rtc), and [contact us](https://trtc.io/zh/contact) for review before use.
|