@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
|
## ITRTCCloud
|
|
10
10
|
|
|
@@ -128,18 +128,15 @@ Version: 13.3
|
|
|
128
128
|
|
|
129
129
|
|Param|DESC|
|
|
130
130
|
|---------|---------|
|
|
131
|
-
|context|It is only applicable to the Android platform. The SDK internally converts it into the
|
|
131
|
+
|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.|
|
|
132
132
|
|
|
133
133
|
> **Note**
|
|
134
134
|
>
|
|
135
|
-
|
|
136
|
-
> 1. If you use ` delete ITRTCCloud* `, a compilation error will occur. Please use destroyTRTCShareInstance to release the object pointer.
|
|
135
|
+
> 1. If you use `delete ITRTCCloud*` , a compilation error will occur. Please use destroyTRTCShareInstance to release the object pointer.
|
|
137
136
|
>
|
|
138
|
-
|
|
139
|
-
> 2. On Windows, macOS, or iOS, please call the ` getTRTCShareInstance() ` API.
|
|
137
|
+
> 2. On Windows, macOS, or iOS, please call the `getTRTCShareInstance()` API.
|
|
140
138
|
>
|
|
141
|
-
|
|
142
|
-
> 3. On Android, please call the ` getTRTCShareInstance(void *context) ` API.
|
|
139
|
+
> 3. On Android, please call the `getTRTCShareInstance(void *context)` API.
|
|
143
140
|
>
|
|
144
141
|
|
|
145
142
|
## destroyTRTCShareInstance
|
|
@@ -163,31 +160,31 @@ You can use ITRTCCloudCallback to get various event notifications from the SDK,
|
|
|
163
160
|
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.
|
|
164
161
|
|
|
165
162
|
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:
|
|
166
|
-
-
|
|
163
|
+
- TRTCAppSceneVideoCall:
|
|
167
164
|
|
|
168
165
|
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.
|
|
169
166
|
|
|
170
167
|
In this scenario, each room supports up to 300 concurrent online users, and up to 50 of them can speak simultaneously.
|
|
171
|
-
-
|
|
168
|
+
- TRTCAppSceneAudioCall:
|
|
172
169
|
|
|
173
170
|
Audio call scenario. Use cases: [one-to-one audio call], [audio conferencing with up to 300 participants], [audio chat], [online Werewolf], etc.
|
|
174
171
|
|
|
175
172
|
In this scenario, each room supports up to 300 concurrent online users, and up to 50 of them can speak simultaneously.
|
|
176
|
-
-
|
|
173
|
+
- TRTCAppSceneLIVE:
|
|
177
174
|
|
|
178
175
|
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.
|
|
179
176
|
|
|
180
177
|
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).
|
|
181
|
-
-
|
|
178
|
+
- TRTCAppSceneVoiceChatRoom:
|
|
182
179
|
|
|
183
180
|
Audio chat room scenario. Use cases: [Clubhouse], [online karaoke room], [music live room], [FM radio], etc.
|
|
184
181
|
|
|
185
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).
|
|
186
183
|
|
|
187
|
-
After calling this API, you will receive the
|
|
188
|
-
- If room entry succeeded, the
|
|
184
|
+
After calling this API, you will receive the `onEnterRoom(result)` callback from ITRTCCloudCallback:
|
|
185
|
+
- 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.
|
|
189
186
|
|
|
190
|
-
- If room entry failed, the
|
|
187
|
+
- If room entry failed, the `result` parameter will be a negative number ( `result` < 0), indicating the TXLiteAVError for room entry failure.
|
|
191
188
|
|
|
192
189
|
|Param|DESC|
|
|
193
190
|
|---------|---------|
|
|
@@ -196,13 +193,10 @@ After calling this API, you will receive the ` onEnterRoom(result) ` callback fr
|
|
|
196
193
|
|
|
197
194
|
> **Note**
|
|
198
195
|
>
|
|
199
|
-
|
|
200
|
-
> 1. If ` scene ` is specified as TRTCAppSceneLIVE or TRTCAppSceneVoiceChatRoom, you must use the ` role ` field in TRTCParams to specify the role of the current user in the room.
|
|
196
|
+
> 1. If `scene` is specified as TRTCAppSceneLIVE or TRTCAppSceneVoiceChatRoom, you must use the `role` field in TRTCParams to specify the role of the current user in the room.
|
|
201
197
|
>
|
|
202
|
-
|
|
203
|
-
> 2. The same ` scene ` should be configured for all users in the same room.
|
|
198
|
+
> 2. The same `scene` should be configured for all users in the same room.
|
|
204
199
|
>
|
|
205
|
-
|
|
206
200
|
> 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.
|
|
207
201
|
>
|
|
208
202
|
|
|
@@ -212,7 +206,7 @@ After calling this API, you will receive the ` onEnterRoom(result) ` callback fr
|
|
|
212
206
|
|
|
213
207
|
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.
|
|
214
208
|
|
|
215
|
-
After resources are released, the SDK will use the
|
|
209
|
+
After resources are released, the SDK will use the `onExitRoom()` callback in ITRTCCloudCallback to notify you.
|
|
216
210
|
|
|
217
211
|
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.
|
|
218
212
|
|
|
@@ -220,45 +214,41 @@ If you need to call enterRoom again or switch to the SDK of another provider, we
|
|
|
220
214
|
|
|
221
215
|
**Switch role.**
|
|
222
216
|
|
|
223
|
-
This API is used to switch the user role between
|
|
217
|
+
This API is used to switch the user role between `anchor` and `audience` .
|
|
224
218
|
|
|
225
219
|
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.
|
|
226
220
|
|
|
227
|
-
You can use the
|
|
221
|
+
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.
|
|
228
222
|
| Param | DESC |
|
|
229
223
|
| --- | --- |
|
|
230
|
-
| role | Role, which is
|
|
224
|
+
| 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. |
|
|
231
225
|
|
|
232
226
|
> **Note**
|
|
233
227
|
>
|
|
234
|
-
|
|
235
228
|
> 1. This API is only applicable to two scenarios: live streaming (TRTCAppSceneLIVE) and audio chat room (TRTCAppSceneVoiceChatRoom).
|
|
236
229
|
>
|
|
237
|
-
|
|
238
|
-
> 2. If the ` scene ` you specify in enterRoom is TRTCAppSceneVideoCall or TRTCAppSceneAudioCall, please do not call this API.
|
|
230
|
+
> 2. If the `scene` you specify in enterRoom is TRTCAppSceneVideoCall or TRTCAppSceneAudioCall, please do not call this API.
|
|
239
231
|
>
|
|
240
232
|
|
|
241
233
|
## switchRole
|
|
242
234
|
|
|
243
235
|
**Switch role(support permission credential).**
|
|
244
236
|
|
|
245
|
-
This API is used to switch the user role between
|
|
237
|
+
This API is used to switch the user role between `anchor` and `audience` .
|
|
246
238
|
|
|
247
239
|
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.
|
|
248
240
|
|
|
249
|
-
You can use the
|
|
241
|
+
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.
|
|
250
242
|
| Param | DESC |
|
|
251
243
|
| --- | --- |
|
|
252
|
-
| privateMapKey | Permission credential used for permission control. If you want only users with the specified
|
|
253
|
-
| role | Role, which is
|
|
244
|
+
| 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>. |
|
|
245
|
+
| 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. |
|
|
254
246
|
|
|
255
247
|
> **Note**
|
|
256
248
|
>
|
|
257
|
-
|
|
258
249
|
> 1. This API is only applicable to two scenarios: live streaming (TRTCAppSceneLIVE) and audio chat room (TRTCAppSceneVoiceChatRoom).
|
|
259
250
|
>
|
|
260
|
-
|
|
261
|
-
> 2. If the ` scene ` you specify in enterRoom is TRTCAppSceneVideoCall or TRTCAppSceneAudioCall, please do not call this API.
|
|
251
|
+
> 2. If the `scene` you specify in enterRoom is TRTCAppSceneVideoCall or TRTCAppSceneAudioCall, please do not call this API.
|
|
262
252
|
>
|
|
263
253
|
|
|
264
254
|
## switchRoom
|
|
@@ -266,13 +256,13 @@ You can use the ` role ` field in TRTCParams during room entry to specify the us
|
|
|
266
256
|
**Switch room.**
|
|
267
257
|
|
|
268
258
|
This API is used to quickly switch a user from one room to another.
|
|
269
|
-
- If the user's role is
|
|
259
|
+
- If the user's role is `audience` , calling this API is equivalent to `exitRoom` (current room) + `enterRoom` (new room).
|
|
270
260
|
|
|
271
|
-
- If the user's role is
|
|
261
|
+
- 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.
|
|
272
262
|
|
|
273
|
-
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
|
|
263
|
+
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` .
|
|
274
264
|
|
|
275
|
-
The API call result will be called back through
|
|
265
|
+
The API call result will be called back through `onSwitchRoom(errCode, errMsg)` in ITRTCCloudCallback.
|
|
276
266
|
|
|
277
267
|
|Param|DESC|
|
|
278
268
|
|---------|---------|
|
|
@@ -280,14 +270,11 @@ The API call result will be called back through ` onSwitchRoom(errCode, errMsg)
|
|
|
280
270
|
|
|
281
271
|
> **Note**
|
|
282
272
|
>
|
|
283
|
-
|
|
284
|
-
> 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:
|
|
273
|
+
> 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:
|
|
285
274
|
>
|
|
286
|
-
|
|
287
|
-
> 1. If you decide to use ` strRoomId `, then set ` roomId ` to 0. If both are specified, ` roomId ` will be used.
|
|
275
|
+
> 1. If you decide to use `strRoomId` , then set `roomId` to 0. If both are specified, `roomId` will be used.
|
|
288
276
|
>
|
|
289
|
-
|
|
290
|
-
> 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.
|
|
277
|
+
> 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.
|
|
291
278
|
>
|
|
292
279
|
|
|
293
280
|
## connectOtherRoom
|
|
@@ -302,10 +289,10 @@ In other words, you can use this API to share the audio/video streams of two anc
|
|
|
302
289
|
|
|
303
290
|
The result of requesting cross-room call will be returned through the onConnectOtherRoom callback in ITRTCCloudCallback.
|
|
304
291
|
|
|
305
|
-
For example, after anchor A in room "101" uses
|
|
306
|
-
- All users in room "101" will receive the
|
|
292
|
+
For example, after anchor A in room "101" uses `connectOtherRoom()` to successfully call anchor B in room "102":
|
|
293
|
+
- 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.
|
|
307
294
|
|
|
308
|
-
- All users in room "102" will receive the
|
|
295
|
+
- 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.
|
|
309
296
|
|
|
310
297
|
For compatibility with subsequent extended fields for cross-room call, parameters in JSON format are used currently.
|
|
311
298
|
|
|
@@ -325,7 +312,7 @@ Below is the sample code:
|
|
|
325
312
|
|
|
326
313
|
Case 2: string room ID
|
|
327
314
|
|
|
328
|
-
If you use a string room ID, please be sure to replace the
|
|
315
|
+
If you use a string room ID, please be sure to replace the `roomId` in JSON with `strRoomId` , such as `{"strRoomId": "102", "userId": "userB"}`
|
|
329
316
|
|
|
330
317
|
Below is the sample code:
|
|
331
318
|
``` cpp
|
|
@@ -339,20 +326,20 @@ Below is the sample code:
|
|
|
339
326
|
|
|
340
327
|
|Param|DESC|
|
|
341
328
|
|---------|---------|
|
|
342
|
-
|param|You need to pass in a string parameter in JSON format:
|
|
329
|
+
|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
330
|
|
|
344
331
|
## disconnectOtherRoom
|
|
345
332
|
|
|
346
333
|
**Exit cross-room call.**
|
|
347
334
|
|
|
348
|
-
The result will be returned through the
|
|
335
|
+
The result will be returned through the `onDisconnectOtherRoom()` callback in ITRTCCloudCallback.
|
|
349
336
|
|
|
350
337
|
## setDefaultStreamRecvMode
|
|
351
338
|
|
|
352
339
|
**Set subscription mode (which must be set before room entry for it to take effect).**
|
|
353
340
|
|
|
354
341
|
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
|
|
342
|
+
- 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
343
|
|
|
357
344
|
- 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
345
|
|
|
@@ -362,15 +349,13 @@ In your application scenario, if there are many audio/video streams being publis
|
|
|
362
349
|
|
|
363
350
|
|Param|DESC|
|
|
364
351
|
|---------|---------|
|
|
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
|
|
352
|
+
|autoRecvAudio|true: automatic subscription to audio; false: manual subscription to audio by calling `muteRemoteAudio(false)` . Default value: true|
|
|
353
|
+
|autoRecvVideo|true: automatic subscription to video; false: manual subscription to video by calling `startRemoteView` . Default value: true|
|
|
367
354
|
|
|
368
355
|
> **Note**
|
|
369
356
|
>
|
|
370
|
-
|
|
371
357
|
> 1. The configuration takes effect only if this API is called before room entry (enterRoom).
|
|
372
358
|
>
|
|
373
|
-
|
|
374
359
|
> 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
360
|
>
|
|
376
361
|
|
|
@@ -378,11 +363,11 @@ In your application scenario, if there are many audio/video streams being publis
|
|
|
378
363
|
|
|
379
364
|
**Create room subinstance (for concurrent multi-room listen/watch).**
|
|
380
365
|
|
|
381
|
-
`
|
|
366
|
+
`TRTCCloud` was originally designed to work in the singleton mode, which limited the ability to watch concurrently in multiple rooms.
|
|
382
367
|
|
|
383
|
-
By calling this API, you can create multiple
|
|
368
|
+
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
369
|
|
|
385
|
-
However, it should be noted that your ability to publish audio and video streams in multiple
|
|
370
|
+
However, it should be noted that your ability to publish audio and video streams in multiple `TRTCCloud` instances will be limited.
|
|
386
371
|
|
|
387
372
|
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
373
|
|
|
@@ -414,23 +399,20 @@ Below is the sample code:
|
|
|
414
399
|
|
|
415
400
|
> **Note**
|
|
416
401
|
>
|
|
417
|
-
|
|
418
|
-
> 1. The same user can enter multiple rooms with different ` roomId ` values by using the same ` userId `.
|
|
402
|
+
> 1. The same user can enter multiple rooms with different `roomId` values by using the same `userId` .
|
|
419
403
|
>
|
|
420
|
-
|
|
421
|
-
> 2. Two devices cannot use the same ` userId ` to enter the same room with a specified ` roomId `.
|
|
404
|
+
> 2. Two devices cannot use the same `userId` to enter the same room with a specified `roomId` .
|
|
422
405
|
>
|
|
423
|
-
|
|
424
406
|
> 3. You can set ITRTCCloudCallback separately for different instances to get their own event notifications.
|
|
425
407
|
>
|
|
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:
|
|
408
|
+
> 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
409
|
>
|
|
429
410
|
> - 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
411
|
> - The result of camera-related API call will be based on the last time: startLocalPreview.
|
|
412
|
+
|
|
431
413
|
**Return Desc:**
|
|
432
414
|
|
|
433
|
-
`
|
|
415
|
+
`TRTCCloud` subinstance
|
|
434
416
|
|
|
435
417
|
## destroySubCloud
|
|
436
418
|
|
|
@@ -452,13 +434,13 @@ After disabling a certain upstream capability of the cross-room anchor, all user
|
|
|
452
434
|
|
|
453
435
|
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
436
|
|
|
455
|
-
The result of calling this API will be returned through the
|
|
437
|
+
The result of calling this API will be returned through the `onUpdateOtherRoomForwardMode()` callback in ITRTCCloudCallback.
|
|
456
438
|
|
|
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
|
|
439
|
+
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.
|
|
440
|
+
- 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
441
|
|
|
460
442
|
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
|
|
443
|
+
- 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
444
|
|
|
463
445
|
- 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
446
|
|
|
@@ -488,7 +470,7 @@ Case 2: string room ID
|
|
|
488
470
|
|
|
489
471
|
|Param|DESC|
|
|
490
472
|
|---------|---------|
|
|
491
|
-
|param|You need to pass in a string parameter in JSON format:
|
|
473
|
+
|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
474
|
|
|
493
475
|
## startPublishMediaStream
|
|
494
476
|
|
|
@@ -506,16 +488,12 @@ You can use the TRTCPublishMode parameter in TRTCPublishTarget to specify the pu
|
|
|
506
488
|
|
|
507
489
|
> **Note**
|
|
508
490
|
>
|
|
509
|
-
|
|
510
491
|
> 1. The SDK will send a task ID to you via the onStartPublishMediaStream callback.
|
|
511
492
|
>
|
|
512
|
-
|
|
513
493
|
> 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
494
|
>
|
|
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.
|
|
495
|
+
> 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
496
|
>
|
|
518
|
-
|
|
519
497
|
> 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
498
|
>
|
|
521
499
|
|
|
@@ -534,13 +512,10 @@ You can use this API to change the parameters of a publishing task initiated by
|
|
|
534
512
|
|
|
535
513
|
> **Note**
|
|
536
514
|
>
|
|
537
|
-
|
|
538
515
|
> 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
516
|
>
|
|
540
|
-
|
|
541
517
|
> 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
518
|
>
|
|
543
|
-
|
|
544
519
|
> 3. You can not switch output between "only audio", "only video" and "audio and video" for the same task.
|
|
545
520
|
>
|
|
546
521
|
|
|
@@ -556,11 +531,9 @@ You can use this API to stop a task initiated by startPublishMediaStream.
|
|
|
556
531
|
|
|
557
532
|
> **Note**
|
|
558
533
|
>
|
|
559
|
-
|
|
560
534
|
> 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
535
|
>
|
|
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.
|
|
536
|
+
> 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
537
|
>
|
|
565
538
|
|
|
566
539
|
## startLocalPreview
|
|
@@ -571,7 +544,7 @@ If this API is called before enterRoom, the SDK will only enable the camera and
|
|
|
571
544
|
|
|
572
545
|
If it is called after enterRoom, the SDK will enable the camera and automatically start pushing the video stream.
|
|
573
546
|
|
|
574
|
-
When the first camera video frame starts to be rendered, you will receive the
|
|
547
|
+
When the first camera video frame starts to be rendered, you will receive the `onCameraDidReady` callback in ITRTCCloudCallback.
|
|
575
548
|
|
|
576
549
|
|Param|DESC|
|
|
577
550
|
|---------|---------|
|
|
@@ -580,11 +553,10 @@ When the first camera video frame starts to be rendered, you will receive the `
|
|
|
580
553
|
|
|
581
554
|
> **Note**
|
|
582
555
|
>
|
|
583
|
-
|
|
584
|
-
> If you want to preview the camera image and adjust the beauty filter parameters through ` BeautyManager ` before going live, you can:
|
|
556
|
+
> If you want to preview the camera image and adjust the beauty filter parameters through `BeautyManager` before going live, you can:
|
|
585
557
|
>
|
|
586
|
-
> - Scheme 1. Call
|
|
587
|
-
> - Scheme 2. Call
|
|
558
|
+
> - Scheme 1. Call `startLocalPreview` before calling enterRoom.
|
|
559
|
+
> - Scheme 2. Call `startLocalPreview` and `muteLocalVideo(true)` after calling enterRoom.
|
|
588
560
|
|
|
589
561
|
## startLocalPreview
|
|
590
562
|
|
|
@@ -596,7 +568,7 @@ If this API is called before enterRoom, the SDK will only enable the camera and
|
|
|
596
568
|
|
|
597
569
|
If it is called after enterRoom, the SDK will enable the camera and automatically start pushing the video stream.
|
|
598
570
|
|
|
599
|
-
When the first camera video frame starts to be rendered, you will receive the
|
|
571
|
+
When the first camera video frame starts to be rendered, you will receive the `onCameraDidReady` callback in ITRTCCloudCallback.
|
|
600
572
|
|
|
601
573
|
|Param|DESC|
|
|
602
574
|
|---------|---------|
|
|
@@ -604,11 +576,10 @@ When the first camera video frame starts to be rendered, you will receive the `
|
|
|
604
576
|
|
|
605
577
|
> **Note**
|
|
606
578
|
>
|
|
607
|
-
|
|
608
|
-
> If you want to preview the camera image and adjust the beauty filter parameters through ` BeautyManager ` before going live, you can:
|
|
579
|
+
> If you want to preview the camera image and adjust the beauty filter parameters through `BeautyManager` before going live, you can:
|
|
609
580
|
>
|
|
610
|
-
> - Scheme 1. Call
|
|
611
|
-
> - Scheme 2. Call
|
|
581
|
+
> - Scheme 1. Call `startLocalPreview` before calling enterRoom.
|
|
582
|
+
> - Scheme 2. Call `startLocalPreview` and `muteLocalVideo(true)` after calling enterRoom.
|
|
612
583
|
|
|
613
584
|
## updateLocalView
|
|
614
585
|
|
|
@@ -624,15 +595,15 @@ When the first camera video frame starts to be rendered, you will receive the `
|
|
|
624
595
|
|
|
625
596
|
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.
|
|
626
597
|
|
|
627
|
-
This API is equivalent to the two APIs of
|
|
598
|
+
This API is equivalent to the two APIs of `startLocalPreview/stopLocalPreview` when TRTCVideoStreamTypeBig is specified, but has higher performance and response speed.
|
|
628
599
|
|
|
629
|
-
The
|
|
600
|
+
The `startLocalPreview/stopLocalPreview` APIs need to enable/disable the camera, which are hardware device-related operations, so they are very time-consuming.
|
|
630
601
|
|
|
631
|
-
In contrast,
|
|
602
|
+
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.
|
|
632
603
|
|
|
633
|
-
After local video publishing is paused, other members in the same room will receive the
|
|
604
|
+
After local video publishing is paused, other members in the same room will receive the `onUserVideoAvailable(userId, false)` callback notification.
|
|
634
605
|
|
|
635
|
-
After local video publishing is resumed, other members in the same room will receive the
|
|
606
|
+
After local video publishing is resumed, other members in the same room will receive the `onUserVideoAvailable(userId, true)` callback notification.
|
|
636
607
|
|
|
637
608
|
|Param|DESC|
|
|
638
609
|
|---------|---------|
|
|
@@ -643,7 +614,7 @@ After local video publishing is resumed, other members in the same room will rec
|
|
|
643
614
|
|
|
644
615
|
**Set placeholder image during local video pause.**
|
|
645
616
|
|
|
646
|
-
When you call
|
|
617
|
+
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.
|
|
647
618
|
|
|
648
619
|
|Param|DESC|
|
|
649
620
|
|---------|---------|
|
|
@@ -654,31 +625,27 @@ When you call ` muteLocalVideo(true) ` to pause the local video image, you can s
|
|
|
654
625
|
|
|
655
626
|
**Subscribe to remote user's video stream and bind video rendering control.**
|
|
656
627
|
|
|
657
|
-
Calling this API allows the SDK to pull the video stream of the specified
|
|
658
|
-
- If you already know the
|
|
628
|
+
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.
|
|
629
|
+
- 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.
|
|
659
630
|
|
|
660
631
|
- If you don't know which users in the room are publishing video streams, you can wait for the notification from onUserVideoAvailable after enterRoom.
|
|
661
632
|
|
|
662
633
|
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.
|
|
663
634
|
| Param | DESC |
|
|
664
635
|
| --- | --- |
|
|
665
|
-
| streamType | Video stream type of the
|
|
636
|
+
| streamType | Video stream type of the <code>userId</code> specified for watching:<br>- HD big image: TRTCVideoStreamTypeBig<br>- Smooth small image: TRTCVideoStreamTypeSmall (the remote user should enable dual-channel encoding through enableSmallVideoStream for this parameter to take effect)<br>- Substream image (usually used for screen sharing): TRTCVideoStreamTypeSub |
|
|
666
637
|
| userId | ID of the specified remote user |
|
|
667
638
|
| view | Rendering control that carries the video image |
|
|
668
639
|
|
|
669
640
|
> **Note**
|
|
670
641
|
>
|
|
671
|
-
|
|
672
642
|
> The following requires your attention:
|
|
673
643
|
>
|
|
674
|
-
|
|
675
|
-
> 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.
|
|
644
|
+
> 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.
|
|
676
645
|
>
|
|
677
|
-
|
|
678
|
-
> 2. Only when the specified ` userId ` enables dual-channel encoding through enableSmallVideoStream can the user's small image be viewed.
|
|
646
|
+
> 2. Only when the specified `userId` enables dual-channel encoding through enableSmallVideoStream can the user's small image be viewed.
|
|
679
647
|
>
|
|
680
|
-
|
|
681
|
-
> 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.
|
|
648
|
+
> 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.
|
|
682
649
|
>
|
|
683
650
|
|
|
684
651
|
## updateRemoteView
|
|
@@ -700,7 +667,7 @@ This API can be used to update the rendering control of the remote video image.
|
|
|
700
667
|
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.
|
|
701
668
|
| Param | DESC |
|
|
702
669
|
| --- | --- |
|
|
703
|
-
| streamType | Video stream type of the
|
|
670
|
+
| streamType | Video stream type of the <code>userId</code> specified for watching:<br>- HD big image: TRTCVideoStreamTypeBig<br>- Smooth small image: TRTCVideoStreamTypeSmall<br>- Substream image (usually used for screen sharing): TRTCVideoStreamTypeSub |
|
|
704
671
|
| userId | ID of the specified remote user |
|
|
705
672
|
|
|
706
673
|
## stopAllRemoteView
|
|
@@ -711,7 +678,6 @@ Calling this API will cause the SDK to stop receiving all remote video streams a
|
|
|
711
678
|
|
|
712
679
|
> **Note**
|
|
713
680
|
>
|
|
714
|
-
|
|
715
681
|
> If a substream image (screen sharing) is being displayed, it will also be stopped.
|
|
716
682
|
>
|
|
717
683
|
|
|
@@ -728,7 +694,6 @@ This API only pauses/resumes receiving the specified user's video stream but doe
|
|
|
728
694
|
|
|
729
695
|
> **Note**
|
|
730
696
|
>
|
|
731
|
-
|
|
732
697
|
> 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.
|
|
733
698
|
>
|
|
734
699
|
|
|
@@ -744,10 +709,8 @@ This API only pauses/resumes receiving all users' video streams but does not rel
|
|
|
744
709
|
|
|
745
710
|
> **Note**
|
|
746
711
|
>
|
|
747
|
-
|
|
748
712
|
> This API can be called before room entry (enterRoom), and the pause status will be reset after room exit (exitRoom).
|
|
749
713
|
>
|
|
750
|
-
|
|
751
714
|
> 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.
|
|
752
715
|
>
|
|
753
716
|
|
|
@@ -763,7 +726,6 @@ This setting can determine the quality of image viewed by remote users, which is
|
|
|
763
726
|
|
|
764
727
|
> **Note**
|
|
765
728
|
>
|
|
766
|
-
|
|
767
729
|
> 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.
|
|
768
730
|
>
|
|
769
731
|
|
|
@@ -814,9 +776,9 @@ In this way, other users in the room can choose to subscribe to the **HD big ima
|
|
|
814
776
|
|
|
815
777
|
> **Note**
|
|
816
778
|
>
|
|
817
|
-
|
|
818
779
|
> 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.
|
|
819
780
|
>
|
|
781
|
+
|
|
820
782
|
**Return Desc:**
|
|
821
783
|
|
|
822
784
|
0: success; -1: the current big image has been set to a lower quality, and it is not necessary to enable dual-channel encoding
|
|
@@ -836,7 +798,6 @@ You can use this API to select whether the image subscribed to is the big image
|
|
|
836
798
|
|
|
837
799
|
> **Note**
|
|
838
800
|
>
|
|
839
|
-
|
|
840
801
|
> To implement this feature, the target user must have enabled the dual-channel encoding mode through enableSmallVideoStream; otherwise, this API will not work.
|
|
841
802
|
>
|
|
842
803
|
|
|
@@ -854,7 +815,6 @@ You can use this API to screencapture the local video image or the primary strea
|
|
|
854
815
|
|
|
855
816
|
> **Note**
|
|
856
817
|
>
|
|
857
|
-
|
|
858
818
|
> On Windows, only video image from the TRTCSnapshotSourceTypeStream source can be screencaptured currently.
|
|
859
819
|
>
|
|
860
820
|
|
|
@@ -883,11 +843,10 @@ The SDK does not enable the mic by default. When a user wants to publish the loc
|
|
|
883
843
|
After local audio capturing and publishing is enabled, other users in the room will receive the onUserAudioAvailable(userId, true) notification.
|
|
884
844
|
| Param | DESC |
|
|
885
845
|
| --- | --- |
|
|
886
|
-
| quality | Sound quality<br>-
|
|
846
|
+
| quality | Sound quality<br>- TRTCAudioQualitySpeech - Smooth: mono channel; audio bitrate: 18 Kbps. This is suitable for audio call scenarios, such as online meeting and audio call.<br>- TRTCAudioQualityDefault - 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>- TRTCAudioQualityMusic - 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. |
|
|
887
847
|
|
|
888
848
|
> **Note**
|
|
889
849
|
>
|
|
890
|
-
|
|
891
850
|
> 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.
|
|
892
851
|
>
|
|
893
852
|
|
|
@@ -905,11 +864,11 @@ After local audio publishing is paused, other users in the room will receive the
|
|
|
905
864
|
|
|
906
865
|
After local audio publishing is resumed, other users in the room will receive the onUserAudioAvailable(userId, true) notification.
|
|
907
866
|
|
|
908
|
-
Different from stopLocalAudio,
|
|
867
|
+
Different from stopLocalAudio, `muteLocalAudio(true)` does not release the mic permission; instead, it continues to send mute packets with extremely low bitrate.
|
|
909
868
|
|
|
910
869
|
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.
|
|
911
870
|
|
|
912
|
-
Therefore,
|
|
871
|
+
Therefore, `muteLocalAudio` instead of stopLocalAudio is recommended in scenarios where the requirement for recording file quality is high.
|
|
913
872
|
|
|
914
873
|
|Param|DESC|
|
|
915
874
|
|---------|---------|
|
|
@@ -928,8 +887,7 @@ When you mute the remote audio of a specified user, the SDK will stop playing ba
|
|
|
928
887
|
|
|
929
888
|
> **Note**
|
|
930
889
|
>
|
|
931
|
-
|
|
932
|
-
> 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).
|
|
890
|
+
> 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).
|
|
933
891
|
>
|
|
934
892
|
|
|
935
893
|
## muteAllRemoteAudio
|
|
@@ -944,15 +902,14 @@ When you mute the audio of all remote users, the SDK will stop playing back all
|
|
|
944
902
|
|
|
945
903
|
> **Note**
|
|
946
904
|
>
|
|
947
|
-
|
|
948
|
-
> 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).
|
|
905
|
+
> 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).
|
|
949
906
|
>
|
|
950
907
|
|
|
951
908
|
## setRemoteAudioVolume
|
|
952
909
|
|
|
953
910
|
**Set the audio playback volume of remote user.**
|
|
954
911
|
|
|
955
|
-
You can mute the audio of a remote user through
|
|
912
|
+
You can mute the audio of a remote user through `setRemoteAudioVolume(userId, 0)` .
|
|
956
913
|
|
|
957
914
|
|Param|DESC|
|
|
958
915
|
|---------|---------|
|
|
@@ -961,7 +918,6 @@ You can mute the audio of a remote user through ` setRemoteAudioVolume(userId, 0
|
|
|
961
918
|
|
|
962
919
|
> **Note**
|
|
963
920
|
>
|
|
964
|
-
|
|
965
921
|
> If 100 is still not loud enough for you, you can set the volume to up to 150, but there may be side effects.
|
|
966
922
|
>
|
|
967
923
|
|
|
@@ -975,13 +931,12 @@ You can mute the audio of a remote user through ` setRemoteAudioVolume(userId, 0
|
|
|
975
931
|
|
|
976
932
|
> **Note**
|
|
977
933
|
>
|
|
978
|
-
|
|
979
934
|
> If 100 is still not loud enough for you, you can set the volume to up to 150, but there may be side effects.
|
|
980
935
|
>
|
|
981
936
|
|
|
982
937
|
## getAudioCaptureVolume
|
|
983
938
|
|
|
984
|
-
**Get the capturing volume of local audio
|
|
939
|
+
**Get the capturing volume of local audio.Return Desc:**
|
|
985
940
|
|
|
986
941
|
capturing volume
|
|
987
942
|
|
|
@@ -997,7 +952,6 @@ This API controls the volume of the sound ultimately delivered by the SDK to the
|
|
|
997
952
|
|
|
998
953
|
> **Note**
|
|
999
954
|
>
|
|
1000
|
-
|
|
1001
955
|
> If 100 is still not loud enough for you, you can set the volume to up to 150, but there may be side effects.
|
|
1002
956
|
>
|
|
1003
957
|
|
|
@@ -1018,7 +972,6 @@ After this feature is enabled, the SDK will return the audio volume assessment i
|
|
|
1018
972
|
|
|
1019
973
|
> **Note**
|
|
1020
974
|
>
|
|
1021
|
-
|
|
1022
975
|
> To enable this feature, call this API before calling startLocalAudio.
|
|
1023
976
|
>
|
|
1024
977
|
|
|
@@ -1038,9 +991,9 @@ The startup and completion status of the recording will be notified through loca
|
|
|
1038
991
|
|
|
1039
992
|
> **Note**
|
|
1040
993
|
>
|
|
1041
|
-
|
|
1042
994
|
> 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 ITRTCCloudCallback .
|
|
1043
995
|
>
|
|
996
|
+
|
|
1044
997
|
**Return Desc:**
|
|
1045
998
|
|
|
1046
999
|
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.
|
|
@@ -1102,10 +1055,8 @@ Update self position and orientation in the world coordinate system. The SDK wil
|
|
|
1102
1055
|
|
|
1103
1056
|
> **Note**
|
|
1104
1057
|
>
|
|
1105
|
-
|
|
1106
1058
|
> 1. The length of array should be 3.
|
|
1107
1059
|
>
|
|
1108
|
-
|
|
1109
1060
|
> 2. Please limit the calling frequency appropriately. It's recommended that the interval between two operations be at least 100ms.
|
|
1110
1061
|
>
|
|
1111
1062
|
|
|
@@ -1122,10 +1073,8 @@ Update the specified remote user's position in the world coordinate system. The
|
|
|
1122
1073
|
|
|
1123
1074
|
> **Note**
|
|
1124
1075
|
>
|
|
1125
|
-
|
|
1126
1076
|
> 1. The length of array should be 3.
|
|
1127
1077
|
>
|
|
1128
|
-
|
|
1129
1078
|
> 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.
|
|
1130
1079
|
>
|
|
1131
1080
|
|
|
@@ -1172,12 +1121,12 @@ beauty filter management class TXBeautyManager.
|
|
|
1172
1121
|
|
|
1173
1122
|
**Add watermark.**
|
|
1174
1123
|
|
|
1175
|
-
The watermark position is determined by the
|
|
1176
|
-
-
|
|
1124
|
+
The watermark position is determined by the `xOffset` , `yOffset` , and `fWidthRatio` parameters.
|
|
1125
|
+
- `xOffset` : X coordinate of watermark, which is a floating-point number between 0 and 1.
|
|
1177
1126
|
|
|
1178
|
-
-
|
|
1127
|
+
- `yOffset` : Y coordinate of watermark, which is a floating-point number between 0 and 1.
|
|
1179
1128
|
|
|
1180
|
-
-
|
|
1129
|
+
- `fWidthRatio` : watermark dimensions ratio, which is a floating-point number between 0 and 1.
|
|
1181
1130
|
|
|
1182
1131
|
|Param|DESC|
|
|
1183
1132
|
|---------|---------|
|
|
@@ -1185,7 +1134,7 @@ The watermark position is determined by the ` xOffset `, ` yOffset `, and ` fWid
|
|
|
1185
1134
|
|isVisibleOnLocalPreview|true: local preview show wartermark;false: local preview hide wartermark.only effect on win/mac.|
|
|
1186
1135
|
|nHeight|Pixel height of watermark image (this parameter will be ignored if the source data is a file path)|
|
|
1187
1136
|
|nWidth|Pixel width of watermark image (this parameter will be ignored if the source data is a file path)|
|
|
1188
|
-
|srcData|Source data of watermark image (if
|
|
1137
|
+
|srcData|Source data of watermark image (if `nullptr` is passed in, the watermark will be removed)|
|
|
1189
1138
|
|srcType|Source data type of watermark image. For more information, please see TRTCWaterMarkSrcType|
|
|
1190
1139
|
|streamType|Stream type of the watermark to be set (TRTCVideoStreamTypeBig or @@link TRTCVideoStreamTypeSub})|
|
|
1191
1140
|
|xOffset|Top-left offset on the X axis of watermark|
|
|
@@ -1193,7 +1142,6 @@ The watermark position is determined by the ` xOffset `, ` yOffset `, and ` fWid
|
|
|
1193
1142
|
|
|
1194
1143
|
> **Note**
|
|
1195
1144
|
>
|
|
1196
|
-
|
|
1197
1145
|
> This API only supports adding an image watermark to the primary stream
|
|
1198
1146
|
>
|
|
1199
1147
|
|
|
@@ -1201,7 +1149,7 @@ The watermark position is determined by the ` xOffset `, ` yOffset `, and ` fWid
|
|
|
1201
1149
|
|
|
1202
1150
|
**Get sound effect management class (TXAudioEffectManager).**
|
|
1203
1151
|
|
|
1204
|
-
`
|
|
1152
|
+
`TXAudioEffectManager` is a sound effect management API, through which you can implement the following features:
|
|
1205
1153
|
- 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.
|
|
1206
1154
|
|
|
1207
1155
|
- 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.
|
|
@@ -1210,7 +1158,7 @@ The watermark position is determined by the ` xOffset `, ` yOffset `, and ` fWid
|
|
|
1210
1158
|
|
|
1211
1159
|
- Voice changing effect: young girl, middle-aged man, heavy metal, and other effects.
|
|
1212
1160
|
|
|
1213
|
-
- 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
|
|
1161
|
+
- 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` ).
|
|
1214
1162
|
**Return Desc:**
|
|
1215
1163
|
|
|
1216
1164
|
sound effect management class TXAudioEffectManager.
|
|
@@ -1231,19 +1179,14 @@ In live music scenarios, an anchor can use this API to have the SDK capture the
|
|
|
1231
1179
|
|
|
1232
1180
|
> **Note**
|
|
1233
1181
|
>
|
|
1234
|
-
|
|
1235
|
-
> On the Windows platform, you can specify the parameter ` deviceName ` to the absolute path of an executable file (such as ` QQMuisc.exe `) of a certain application. In this case, the SDK will only capture the sound of that application (32-bit version of the SDK is supported, 64-bit version of the SDK requires Windows version 10.0.19042 or higher).
|
|
1182
|
+
> On the Windows platform, you can specify the parameter `deviceName` to the absolute path of an executable file (such as `QQMuisc.exe` ) of a certain application. In this case, the SDK will only capture the sound of that application (32-bit version of the SDK is supported, 64-bit version of the SDK requires Windows version 10.0.19042 or higher).
|
|
1236
1183
|
>
|
|
1237
|
-
|
|
1238
|
-
> You can also specify ` deviceName ` as the name of a certain speaker device to capture specific speaker sound (you can use the getDevicesList interface in TXDeviceManager to obtain the speaker devices of type TXMediaDeviceTypeSpeaker).
|
|
1184
|
+
> You can also specify `deviceName` as the name of a certain speaker device to capture specific speaker sound (you can use the getDevicesList interface in TXDeviceManager to obtain the speaker devices of type TXMediaDeviceTypeSpeaker).
|
|
1239
1185
|
>
|
|
1240
|
-
|
|
1241
|
-
> On the Windows platform, you can also specify ` deviceName ` as the process ID of a certain process (in the format of "process_xxx", where xxx is the process ID), and then the SDK will capture the sound of that process (requires Windows version 10.0.19042 or higher).
|
|
1186
|
+
> On the Windows platform, you can also specify `deviceName` as the process ID of a certain process (in the format of "process_xxx", where xxx is the process ID), and then the SDK will capture the sound of that process (requires Windows version 10.0.19042 or higher).
|
|
1242
1187
|
>
|
|
1243
|
-
|
|
1244
|
-
> Alternatively, on the Windows platform, you can specify ` deviceName ` as the process ID of a certain process to be excluded (in the format of "exclude_process_xxx", where xxx is the process ID), and then the SDK will capture all sounds except for that process (requires Windows version 10.0.19042 or higher).
|
|
1188
|
+
> Alternatively, on the Windows platform, you can specify `deviceName` as the process ID of a certain process to be excluded (in the format of "exclude_process_xxx", where xxx is the process ID), and then the SDK will capture all sounds except for that process (requires Windows version 10.0.19042 or higher).
|
|
1245
1189
|
>
|
|
1246
|
-
|
|
1247
1190
|
> About speaker device name you can see TXDeviceManager
|
|
1248
1191
|
>
|
|
1249
1192
|
|
|
@@ -1281,17 +1224,13 @@ This API can capture the content of the entire screen or a specified application
|
|
|
1281
1224
|
|
|
1282
1225
|
> **Note**
|
|
1283
1226
|
>
|
|
1284
|
-
|
|
1285
1227
|
> 1. A user can publish at most one primary stream (TRTCVideoStreamTypeBig) and one substream (TRTCVideoStreamTypeSub) at the same time.
|
|
1286
1228
|
>
|
|
1287
|
-
|
|
1288
1229
|
> 2. By default, screen sharing uses the substream image. If you want to use the primary stream for screen sharing, you need to stop camera capturing (through stopLocalPreview) in advance to avoid conflicts.
|
|
1289
1230
|
>
|
|
1290
|
-
|
|
1291
1231
|
> 3. Only one user can use the substream for screen sharing in the same room at any time; that is, only one user is allowed to enable the substream in the same room at any time.
|
|
1292
1232
|
>
|
|
1293
|
-
|
|
1294
|
-
> 4. When there is already a user in the room using the substream for screen sharing, calling this API will return the ` onError(ERR_SERVER_CENTER_ANOTHER_USER_PUSH_SUB_VIDEO) ` callback from ITRTCCloudCallback.
|
|
1233
|
+
> 4. When there is already a user in the room using the substream for screen sharing, calling this API will return the `onError(ERR_SERVER_CENTER_ANOTHER_USER_PUSH_SUB_VIDEO)` callback from ITRTCCloudCallback.
|
|
1295
1234
|
>
|
|
1296
1235
|
|
|
1297
1236
|
## stopScreenCapture
|
|
@@ -1304,7 +1243,6 @@ This API can capture the content of the entire screen or a specified application
|
|
|
1304
1243
|
|
|
1305
1244
|
> **Note**
|
|
1306
1245
|
>
|
|
1307
|
-
|
|
1308
1246
|
> Begin from v11.5 version, paused screen capture will use the last frame to output at a frame rate of 1fps.
|
|
1309
1247
|
>
|
|
1310
1248
|
|
|
@@ -1327,12 +1265,11 @@ Through this API, you can query the IDs, names, and thumbnails of sharable windo
|
|
|
1327
1265
|
|
|
1328
1266
|
> **Note**
|
|
1329
1267
|
>
|
|
1330
|
-
|
|
1331
1268
|
> 1. The returned list contains the screen and the application windows. The screen is the first element in the list. If the user has multiple displays, then each display is a sharing target.
|
|
1332
1269
|
>
|
|
1333
|
-
|
|
1334
|
-
> 2. Please do not use ` delete ITRTCScreenCaptureSourceList* ` to delete the ` SourceList `; otherwise, crashes may occur. Instead, please use the ` release ` method in ITRTCScreenCaptureSourceList to release the list.
|
|
1270
|
+
> 2. Please do not use `delete ITRTCScreenCaptureSourceList*` to delete the `SourceList` ; otherwise, crashes may occur. Instead, please use the `release` method in ITRTCScreenCaptureSourceList to release the list.
|
|
1335
1271
|
>
|
|
1272
|
+
|
|
1336
1273
|
**Return Desc:**
|
|
1337
1274
|
|
|
1338
1275
|
List of windows (including the screen)
|
|
@@ -1346,23 +1283,22 @@ After you get the sharable screens and windows through getScreenCaptureSources,
|
|
|
1346
1283
|
During the screen sharing process, you can also call this API at any time to switch the sharing target.
|
|
1347
1284
|
|
|
1348
1285
|
The following four sharing modes are supported:
|
|
1349
|
-
- Sharing the entire screen: for
|
|
1286
|
+
- Sharing the entire screen: for `source` whose `type` is TRTCScreenCaptureSourceTypeScreen in `sourceInfoList` , set `captureRect` to `{ 0, 0, 0, 0 }` .
|
|
1350
1287
|
|
|
1351
|
-
- Sharing a specified area: for
|
|
1288
|
+
- Sharing a specified area: for `source` whose `type` is TRTCScreenCaptureSourceTypeScreen in `sourceInfoList` , set `captureRect` to a non-nullptr value, e.g., `{ 100, 100, 300, 300 }` .
|
|
1352
1289
|
|
|
1353
|
-
- Sharing an entire window: for
|
|
1290
|
+
- Sharing an entire window: for `source` whose `type` is TRTCScreenCaptureSourceTypeWindow in `sourceInfoList` , set `captureRect` to `{ 0, 0, 0, 0 }` .
|
|
1354
1291
|
|
|
1355
|
-
- Sharing a specified window area: for
|
|
1292
|
+
- Sharing a specified window area: for `source` whose `type` is TRTCScreenCaptureSourceTypeWindow in `sourceInfoList` , set `captureRect` to a non-nullptr value, e.g., `{ 100, 100, 300, 300 }` .
|
|
1356
1293
|
|
|
1357
1294
|
|Param|DESC|
|
|
1358
1295
|
|---------|---------|
|
|
1359
1296
|
|captureRect|Specify the area to be captured|
|
|
1360
|
-
|property|Specify the attributes of the screen sharing target, such as capturing the cursor and highlighting the captured window. For more information, please see the definition of
|
|
1297
|
+
|property|Specify the attributes of the screen sharing target, such as capturing the cursor and highlighting the captured window. For more information, please see the definition of `TRTCScreenCaptureProperty` |
|
|
1361
1298
|
|source|Specify sharing source|
|
|
1362
1299
|
|
|
1363
1300
|
> **Note**
|
|
1364
1301
|
>
|
|
1365
|
-
|
|
1366
1302
|
> Setting the highlight border color and width parameters does not take effect on macOS.
|
|
1367
1303
|
>
|
|
1368
1304
|
|
|
@@ -1373,9 +1309,9 @@ The following four sharing modes are supported:
|
|
|
1373
1309
|
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.
|
|
1374
1310
|
|
|
1375
1311
|
Please note the differences between the following two APIs:
|
|
1376
|
-
-
|
|
1312
|
+
- setVideoEncoderParam is used to set the video encoding parameters of the primary stream image (TRTCVideoStreamTypeBig, generally for camera).
|
|
1377
1313
|
|
|
1378
|
-
-
|
|
1314
|
+
- setSubStreamEncoderParam is used to set the video encoding parameters of the substream image (TRTCVideoStreamTypeSub, generally for screen sharing).
|
|
1379
1315
|
|
|
1380
1316
|
|Param|DESC|
|
|
1381
1317
|
|---------|---------|
|
|
@@ -1405,14 +1341,11 @@ You can set the filtered windows before starting screen sharing or dynamically a
|
|
|
1405
1341
|
|
|
1406
1342
|
> **Note**
|
|
1407
1343
|
>
|
|
1408
|
-
|
|
1409
|
-
> 1. This API takes effect only if the ` type ` in TRTCScreenCaptureSourceInfo is specified as TRTCScreenCaptureSourceTypeScreen; that is, the feature of excluding specified windows works only when the entire screen is shared.
|
|
1344
|
+
> 1. This API takes effect only if the `type` in TRTCScreenCaptureSourceInfo is specified as TRTCScreenCaptureSourceTypeScreen; that is, the feature of excluding specified windows works only when the entire screen is shared.
|
|
1410
1345
|
>
|
|
1411
|
-
|
|
1412
1346
|
> 2. The windows added to the exclusion list through this API will be automatically cleared by the SDK after room exit.
|
|
1413
1347
|
>
|
|
1414
|
-
|
|
1415
|
-
> 3. On macOS, please pass in the window ID (CGWindowID), which can be obtained through the ` sourceId ` member in TRTCScreenCaptureSourceInfo.
|
|
1348
|
+
> 3. On macOS, please pass in the window ID (CGWindowID), which can be obtained through the `sourceId` member in TRTCScreenCaptureSourceInfo.
|
|
1416
1349
|
>
|
|
1417
1350
|
|
|
1418
1351
|
## removeExcludedShareWindow
|
|
@@ -1431,17 +1364,16 @@ You can set the filtered windows before starting screen sharing or dynamically a
|
|
|
1431
1364
|
|
|
1432
1365
|
**Add specified windows to the inclusion list of screen sharing (for desktop systems only).**
|
|
1433
1366
|
|
|
1434
|
-
This API takes effect only if the
|
|
1367
|
+
This API takes effect only if the `type` in TRTCScreenCaptureSourceInfo is specified as TRTCScreenCaptureSourceTypeWindow; that is, the feature of additionally including specified windows works only when a window is shared.
|
|
1435
1368
|
|
|
1436
1369
|
You can call it before or after startScreenCapture.
|
|
1437
1370
|
|
|
1438
1371
|
|Param|DESC|
|
|
1439
1372
|
|---------|---------|
|
|
1440
|
-
|windowID|Window to be shared (which is a window handle
|
|
1373
|
+
|windowID|Window to be shared (which is a window handle `HWND` on Windows)|
|
|
1441
1374
|
|
|
1442
1375
|
> **Note**
|
|
1443
1376
|
>
|
|
1444
|
-
|
|
1445
1377
|
> The windows added to the inclusion list by this method will be automatically cleared by the SDK after room exit.
|
|
1446
1378
|
>
|
|
1447
1379
|
|
|
@@ -1449,7 +1381,7 @@ You can call it before or after startScreenCapture.
|
|
|
1449
1381
|
|
|
1450
1382
|
**Remove specified windows from the inclusion list of screen sharing (for desktop systems only).**
|
|
1451
1383
|
|
|
1452
|
-
This API takes effect only if the
|
|
1384
|
+
This API takes effect only if the `type` in TRTCScreenCaptureSourceInfo is specified as TRTCScreenCaptureSourceTypeWindow.
|
|
1453
1385
|
|
|
1454
1386
|
That is, the feature of additionally including specified windows works only when a window is shared.
|
|
1455
1387
|
|
|
@@ -1461,7 +1393,7 @@ That is, the feature of additionally including specified windows works only when
|
|
|
1461
1393
|
|
|
1462
1394
|
**Remove all windows from the inclusion list of screen sharing (for desktop systems only).**
|
|
1463
1395
|
|
|
1464
|
-
This API takes effect only if the
|
|
1396
|
+
This API takes effect only if the `type` in TRTCScreenCaptureSourceInfo is specified as TRTCScreenCaptureSourceTypeWindow.
|
|
1465
1397
|
|
|
1466
1398
|
That is, the feature of additionally including specified windows works only when a window is shared.
|
|
1467
1399
|
|
|
@@ -1491,7 +1423,7 @@ We recommend you enter the following information for the TRTCVideoFrame paramete
|
|
|
1491
1423
|
|
|
1492
1424
|
- data: buffer used to carry video frame data.
|
|
1493
1425
|
|
|
1494
|
-
- length: video frame data length. If
|
|
1426
|
+
- length: video frame data length. If `pixelFormat` is set to I420, `length` can be calculated according to the following formula: `length = width * height * 3 / 2` .
|
|
1495
1427
|
|
|
1496
1428
|
- width: video image width, such as 640 px.
|
|
1497
1429
|
|
|
@@ -1508,19 +1440,14 @@ For more information, please see [Custom Capturing and Rendering](https://www.te
|
|
|
1508
1440
|
|
|
1509
1441
|
> **Note**
|
|
1510
1442
|
>
|
|
1511
|
-
|
|
1512
|
-
> 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.
|
|
1443
|
+
> 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.
|
|
1513
1444
|
>
|
|
1514
|
-
|
|
1515
1445
|
> 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.
|
|
1516
1446
|
>
|
|
1517
|
-
|
|
1518
1447
|
> 3. Please try to keep the calling interval of this API even; otherwise, problems will occur, such as unstable output frame rate of the encoder or out-of-sync audio/video.
|
|
1519
1448
|
>
|
|
1520
|
-
|
|
1521
1449
|
> 4. On iOS and macOS, video frames in TRTCVideoPixelFormat_I420 or TRTCVideoPixelFormat_BGRA32 format can be passed in currently.
|
|
1522
1450
|
>
|
|
1523
|
-
|
|
1524
1451
|
> 5. On Windows and Android, only video frames in TRTCVideoPixelFormat_I420 format can be passed in currently.
|
|
1525
1452
|
>
|
|
1526
1453
|
|
|
@@ -1538,7 +1465,6 @@ You need to use sendCustomAudioData to continuously insert the captured audio da
|
|
|
1538
1465
|
|
|
1539
1466
|
> **Note**
|
|
1540
1467
|
>
|
|
1541
|
-
|
|
1542
1468
|
> As acoustic echo cancellation (AEC) requires strict control over the audio capturing and playback time, after custom audio capturing is enabled, AEC may fail.
|
|
1543
1469
|
>
|
|
1544
1470
|
|
|
@@ -1547,7 +1473,7 @@ You need to use sendCustomAudioData to continuously insert the captured audio da
|
|
|
1547
1473
|
**Deliver captured audio data to SDK.**
|
|
1548
1474
|
|
|
1549
1475
|
We recommend you enter the following information for the TRTCAudioFrame parameter (other fields can be left empty):
|
|
1550
|
-
- audioFormat: audio data format, which can only be
|
|
1476
|
+
- audioFormat: audio data format, which can only be `TRTCAudioFrameFormatPCM` .
|
|
1551
1477
|
|
|
1552
1478
|
- 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`.**
|
|
1553
1479
|
|
|
@@ -1565,7 +1491,6 @@ For more information, please see [Custom Capturing and Rendering](https://www.te
|
|
|
1565
1491
|
|
|
1566
1492
|
> **Note**
|
|
1567
1493
|
>
|
|
1568
|
-
|
|
1569
1494
|
> Please call this API accurately at intervals of the frame length; otherwise, sound lag may occur due to uneven data delivery intervals.
|
|
1570
1495
|
>
|
|
1571
1496
|
|
|
@@ -1582,8 +1507,7 @@ After this feature is enabled, you can mix a custom audio track into the SDK thr
|
|
|
1582
1507
|
|
|
1583
1508
|
> **Note**
|
|
1584
1509
|
>
|
|
1585
|
-
|
|
1586
|
-
> If you specify both ` enablePublish ` and ` enablePlayout ` as ` false `, the custom audio track will be completely closed.
|
|
1510
|
+
> If you specify both `enablePublish` and `enablePlayout` as `false` , the custom audio track will be completely closed.
|
|
1587
1511
|
>
|
|
1588
1512
|
|
|
1589
1513
|
## mixExternalAudioFrame
|
|
@@ -1596,25 +1520,25 @@ You are expected to feed audio data into the SDK at an even pace, but we underst
|
|
|
1596
1520
|
|
|
1597
1521
|
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.
|
|
1598
1522
|
|
|
1599
|
-
The value returned by this API indicates the size (ms) of the buffer pool. For example, if
|
|
1523
|
+
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.
|
|
1600
1524
|
|
|
1601
|
-
If the value returned is
|
|
1525
|
+
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.
|
|
1602
1526
|
|
|
1603
1527
|
Fill the fields in TRTCAudioFrame as follows (other fields are not required).
|
|
1604
|
-
-
|
|
1528
|
+
- `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**.
|
|
1605
1529
|
|
|
1606
|
-
-
|
|
1530
|
+
- `sampleRate` : sample rate. Valid values: 16000, 24000, 32000, 44100, 48000
|
|
1607
1531
|
|
|
1608
|
-
-
|
|
1532
|
+
- `channel` : number of sound channels (if dual-channel is used, data is interleaved). Valid values: `1` (mono-channel); `2` (dual channel)
|
|
1609
1533
|
|
|
1610
|
-
-
|
|
1534
|
+
- `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.
|
|
1611
1535
|
|
|
1612
1536
|
|Param|DESC|
|
|
1613
1537
|
|---------|---------|
|
|
1614
1538
|
|frame|Audio data|
|
|
1615
1539
|
**Return Desc:**
|
|
1616
1540
|
|
|
1617
|
-
If the value returned is
|
|
1541
|
+
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.
|
|
1618
1542
|
|
|
1619
1543
|
## setMixExternalAudioVolume
|
|
1620
1544
|
|
|
@@ -1637,7 +1561,7 @@ When you call APIs such as sendCustomVideoData or sendCustomAudioData for custom
|
|
|
1637
1561
|
|
|
1638
1562
|
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).
|
|
1639
1563
|
|
|
1640
|
-
3. When you actually call sendCustomVideoData or sendCustomAudioData for delivery, assign the PTS timestamp recorded when the frame was captured to the
|
|
1564
|
+
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:**
|
|
1641
1565
|
|
|
1642
1566
|
Timestamp in ms
|
|
1643
1567
|
|
|
@@ -1660,7 +1584,7 @@ After it is enabled, you can get the image frame of the specified pixel format a
|
|
|
1660
1584
|
|
|
1661
1585
|
**.2 Set video data callback for third-party beauty filters.**
|
|
1662
1586
|
|
|
1663
|
-
After this callback is set, the SDK will call back the captured video frames through the
|
|
1587
|
+
After this callback is set, the SDK will call back the captured video frames through the `callback` 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.
|
|
1664
1588
|
|
|
1665
1589
|
|Param|DESC|
|
|
1666
1590
|
|---------|---------|
|
|
@@ -1671,7 +1595,7 @@ After this callback is set, the SDK will call back the captured video frames thr
|
|
|
1671
1595
|
**Set the callback of custom rendering for local video.**
|
|
1672
1596
|
|
|
1673
1597
|
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.
|
|
1674
|
-
- You can call
|
|
1598
|
+
- You can call `setLocalVideoRenderCallback(TRTCVideoPixelFormat_Unknown, TRTCVideoBufferType_Unknown, nullptr)` to stop the callback.
|
|
1675
1599
|
|
|
1676
1600
|
- On iOS, macOS, and Windows, only video frames in TRTCVideoPixelFormat_I420 or TRTCVideoPixelFormat_BGRA32 pixel format can be called back currently.
|
|
1677
1601
|
|
|
@@ -1691,7 +1615,7 @@ After this callback is set, the SDK will skip its own rendering process and call
|
|
|
1691
1615
|
**Set the callback of custom rendering for remote video.**
|
|
1692
1616
|
|
|
1693
1617
|
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.
|
|
1694
|
-
- You can call
|
|
1618
|
+
- You can call `setRemoteVideoRenderCallback(TRTCVideoPixelFormat_Unknown, TRTCVideoBufferType_Unknown, nullptr)` to stop the callback.
|
|
1695
1619
|
|
|
1696
1620
|
- On iOS, macOS, and Windows, only video frames in TRTCVideoPixelFormat_I420 or TRTCVideoPixelFormat_BGRA32 pixel format can be called back currently.
|
|
1697
1621
|
|
|
@@ -1706,9 +1630,9 @@ After this callback is set, the SDK will skip its own rendering process and call
|
|
|
1706
1630
|
|
|
1707
1631
|
> **Note**
|
|
1708
1632
|
>
|
|
1709
|
-
|
|
1710
|
-
> In actual use, you need to call ` startRemoteView(userid, nullptr) ` to get the video stream of the remote user first (set ` view ` to ` nullptr `); otherwise, there will be no data called back.
|
|
1633
|
+
> In actual use, you need to call `startRemoteView(userid, nullptr)` to get the video stream of the remote user first (set `view` to `nullptr` ); otherwise, there will be no data called back.
|
|
1711
1634
|
>
|
|
1635
|
+
|
|
1712
1636
|
**Return Desc:**
|
|
1713
1637
|
|
|
1714
1638
|
0: success; values smaller than 0: error(For more information, please see TXLiteAVError)
|
|
@@ -1718,17 +1642,16 @@ After this callback is set, the SDK will skip its own rendering process and call
|
|
|
1718
1642
|
**Set custom audio data callback.**
|
|
1719
1643
|
|
|
1720
1644
|
After this callback is set, the SDK will internally call back the audio data (in PCM format), including:
|
|
1721
|
-
-
|
|
1645
|
+
- onCapturedAudioFrame: callback of the audio data captured by the local mic
|
|
1722
1646
|
|
|
1723
|
-
-
|
|
1647
|
+
- onLocalProcessedAudioFrame: callback of the audio data captured by the local mic and preprocessed by the audio module
|
|
1724
1648
|
|
|
1725
|
-
-
|
|
1649
|
+
- onPlayAudioFrame: audio data from each remote user before audio mixing
|
|
1726
1650
|
|
|
1727
|
-
-
|
|
1651
|
+
- onMixedPlayAudioFrame: callback of the audio data that will be played back by the system after audio streams are mixed
|
|
1728
1652
|
|
|
1729
1653
|
> **Note**
|
|
1730
1654
|
>
|
|
1731
|
-
|
|
1732
1655
|
> 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.
|
|
1733
1656
|
>
|
|
1734
1657
|
|
|
@@ -1736,7 +1659,7 @@ After this callback is set, the SDK will internally call back the audio data (in
|
|
|
1736
1659
|
|
|
1737
1660
|
**Set the callback format of audio frames captured by local mic.**
|
|
1738
1661
|
|
|
1739
|
-
This API is used to set the
|
|
1662
|
+
This API is used to set the `AudioFrame` format called back by onCapturedAudioFrame:
|
|
1740
1663
|
- sampleRate: sample rate. Valid values: 16000, 32000, 44100, 48000
|
|
1741
1664
|
|
|
1742
1665
|
- channel: number of channels (if stereo is used, data is interwoven). Valid values: 1: mono channel; 2: dual channel
|
|
@@ -1745,11 +1668,11 @@ This API is used to set the ` AudioFrame ` format called back by onCapturedAudio
|
|
|
1745
1668
|
|
|
1746
1669
|
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
|
|
1747
1670
|
|
|
1748
|
-
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
|
|
1671
|
+
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` .
|
|
1749
1672
|
|
|
1750
|
-
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:
|
|
1673
|
+
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)`
|
|
1751
1674
|
|
|
1752
|
-
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
|
|
1675
|
+
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`
|
|
1753
1676
|
|
|
1754
1677
|
|Param|DESC|
|
|
1755
1678
|
|---------|---------|
|
|
@@ -1762,20 +1685,20 @@ For example, if the parameters are 48000 sample rate, dual channel, 20 ms frame
|
|
|
1762
1685
|
|
|
1763
1686
|
**Set the callback format of preprocessed local audio frames.**
|
|
1764
1687
|
|
|
1765
|
-
This API is used to set the
|
|
1688
|
+
This API is used to set the `AudioFrame` format called back by onLocalProcessedAudioFrame:
|
|
1766
1689
|
- sampleRate: sample rate. Valid values: 16000, 32000, 44100, 48000
|
|
1767
1690
|
|
|
1768
1691
|
- channel: number of channels (if stereo is used, data is interwoven). Valid values: 1: mono channel; 2: dual channel
|
|
1769
1692
|
|
|
1770
1693
|
- 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.
|
|
1771
1694
|
|
|
1772
|
-
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:
|
|
1695
|
+
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` .
|
|
1773
1696
|
|
|
1774
|
-
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
|
|
1697
|
+
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` .
|
|
1775
1698
|
|
|
1776
|
-
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:
|
|
1699
|
+
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)` .
|
|
1777
1700
|
|
|
1778
|
-
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
|
|
1701
|
+
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` .
|
|
1779
1702
|
|
|
1780
1703
|
|Param|DESC|
|
|
1781
1704
|
|---------|---------|
|
|
@@ -1788,20 +1711,20 @@ For example, if the parameters are 48000 sample rate, dual channel, 20 ms frame
|
|
|
1788
1711
|
|
|
1789
1712
|
**Set the callback format of audio frames to be played back by system.**
|
|
1790
1713
|
|
|
1791
|
-
This API is used to set the
|
|
1714
|
+
This API is used to set the `AudioFrame` format called back by onMixedPlayAudioFrame:
|
|
1792
1715
|
- sampleRate: sample rate. Valid values: 16000, 32000, 44100, 48000
|
|
1793
1716
|
|
|
1794
1717
|
- channel: number of channels (if stereo is used, data is interwoven). Valid values: 1: mono channel; 2: dual channel
|
|
1795
1718
|
|
|
1796
1719
|
- 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.
|
|
1797
1720
|
|
|
1798
|
-
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:
|
|
1721
|
+
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` .
|
|
1799
1722
|
|
|
1800
|
-
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
|
|
1723
|
+
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` .
|
|
1801
1724
|
|
|
1802
|
-
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:
|
|
1725
|
+
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)` .
|
|
1803
1726
|
|
|
1804
|
-
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
|
|
1727
|
+
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` .
|
|
1805
1728
|
|
|
1806
1729
|
|Param|DESC|
|
|
1807
1730
|
|---------|---------|
|
|
@@ -1824,7 +1747,6 @@ After you enable custom audio playback, the SDK will stop using its audio API to
|
|
|
1824
1747
|
|
|
1825
1748
|
> **Note**
|
|
1826
1749
|
>
|
|
1827
|
-
|
|
1828
1750
|
> The parameter must be set before room entry to take effect.
|
|
1829
1751
|
>
|
|
1830
1752
|
|
|
@@ -1835,15 +1757,15 @@ After you enable custom audio playback, the SDK will stop using its audio API to
|
|
|
1835
1757
|
Before calling this API, you need to first enable custom audio playback using enableCustomAudioRendering.
|
|
1836
1758
|
|
|
1837
1759
|
Fill the fields in TRTCAudioFrame as follows (other fields are not required):
|
|
1838
|
-
-
|
|
1760
|
+
- `sampleRate` : sample rate (required). Valid values: 16000, 24000, 32000, 44100, 48000
|
|
1839
1761
|
|
|
1840
|
-
-
|
|
1762
|
+
- `channel` : number of sound channels (required). `1` : mono-channel; `2` : dual-channel; if dual-channel is used, data is interleaved.
|
|
1841
1763
|
|
|
1842
|
-
-
|
|
1764
|
+
- `data` : the buffer used to get audio data. You need to allocate memory for the buffer based on the duration of an audio frame.
|
|
1843
1765
|
|
|
1844
1766
|
The PCM data obtained can have a frame duration of 10 ms or 20 ms. 20 ms is recommended.
|
|
1845
1767
|
|
|
1846
|
-
Assume that the sample rate is 48000, and sound channels mono-channel. The buffer size for a 20 ms audio frame would be
|
|
1768
|
+
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` .
|
|
1847
1769
|
|
|
1848
1770
|
|Param|DESC|
|
|
1849
1771
|
|---------|---------|
|
|
@@ -1851,13 +1773,10 @@ Assume that the sample rate is 48000, and sound channels mono-channel. The buffe
|
|
|
1851
1773
|
|
|
1852
1774
|
> **Note**
|
|
1853
1775
|
>
|
|
1854
|
-
|
|
1855
|
-
> 1. You must set ` sampleRate ` and ` channel ` in ` audioFrame `, and allocate memory for one frame of audio in advance.
|
|
1776
|
+
> 1. You must set `sampleRate` and `channel` in `audioFrame` , and allocate memory for one frame of audio in advance.
|
|
1856
1777
|
>
|
|
1857
|
-
|
|
1858
|
-
> 2. The SDK will fill the data automatically based on ` sampleRate ` and ` channel `.
|
|
1778
|
+
> 2. The SDK will fill the data automatically based on `sampleRate` and `channel` .
|
|
1859
1779
|
>
|
|
1860
|
-
|
|
1861
1780
|
> 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.
|
|
1862
1781
|
>
|
|
1863
1782
|
|
|
@@ -1867,7 +1786,7 @@ Assume that the sample rate is 48000, and sound channels mono-channel. The buffe
|
|
|
1867
1786
|
|
|
1868
1787
|
This API allows you to use TRTC's UDP channel to broadcast custom data to other users in the current room for signaling transfer.
|
|
1869
1788
|
|
|
1870
|
-
Other users in the room can receive the message through the
|
|
1789
|
+
Other users in the room can receive the message through the `onRecvCustomCmdMsg` callback in ITRTCCloudCallback.
|
|
1871
1790
|
|
|
1872
1791
|
|Param|DESC|
|
|
1873
1792
|
|---------|---------|
|
|
@@ -1878,24 +1797,19 @@ Other users in the room can receive the message through the ` onRecvCustomCmdMsg
|
|
|
1878
1797
|
|
|
1879
1798
|
> **Note**
|
|
1880
1799
|
>
|
|
1881
|
-
|
|
1882
1800
|
> 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).
|
|
1883
1801
|
>
|
|
1884
|
-
|
|
1885
1802
|
> 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).
|
|
1886
1803
|
>
|
|
1887
|
-
|
|
1888
1804
|
> 3. A client can send up to 16 KB of data in total per second.
|
|
1889
1805
|
>
|
|
1890
|
-
|
|
1891
|
-
> 4. ` reliable ` and ` ordered ` must be set to the same value (` true ` or ` false `) and cannot be set to different values currently.
|
|
1806
|
+
> 4. `reliable` and `ordered` must be set to the same value ( `true` or `false` ) and cannot be set to different values currently.
|
|
1892
1807
|
>
|
|
1893
|
-
|
|
1894
|
-
> 5. We strongly recommend you set different ` cmdID ` values for messages of different types. This can reduce message delay when orderly sending is required.
|
|
1808
|
+
> 5. We strongly recommend you set different `cmdID` values for messages of different types. This can reduce message delay when orderly sending is required.
|
|
1895
1809
|
>
|
|
1896
|
-
|
|
1897
1810
|
> 6. Currently only the anchor role is supported.
|
|
1898
1811
|
>
|
|
1812
|
+
|
|
1899
1813
|
**Return Desc:**
|
|
1900
1814
|
|
|
1901
1815
|
true: sent the message successfully; false: failed to send the message.
|
|
@@ -1914,7 +1828,7 @@ However, because the data block of the video frame header cannot be too large, w
|
|
|
1914
1828
|
|
|
1915
1829
|
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).
|
|
1916
1830
|
|
|
1917
|
-
Other users in the room can receive the message through the
|
|
1831
|
+
Other users in the room can receive the message through the `onRecvSEIMsg` callback in ITRTCCloudCallback.
|
|
1918
1832
|
|
|
1919
1833
|
|Param|DESC|
|
|
1920
1834
|
|---------|---------|
|
|
@@ -1923,27 +1837,21 @@ Other users in the room can receive the message through the ` onRecvSEIMsg ` cal
|
|
|
1923
1837
|
|
|
1924
1838
|
> **Note**
|
|
1925
1839
|
>
|
|
1926
|
-
|
|
1927
1840
|
> This API has the following restrictions:
|
|
1928
1841
|
>
|
|
1929
|
-
|
|
1930
1842
|
> 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.
|
|
1931
1843
|
>
|
|
1932
|
-
|
|
1933
1844
|
> 2. Up to 30 messages can be sent per second to all users in the room (this limit is shared with sendCustomCmdMsg).
|
|
1934
1845
|
>
|
|
1935
|
-
|
|
1936
1846
|
> 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.
|
|
1937
1847
|
>
|
|
1938
|
-
|
|
1939
1848
|
> 4. Each client can send up to 16 KB of data in total per second (this limit is shared with sendCustomCmdMsg).
|
|
1940
1849
|
>
|
|
1941
|
-
|
|
1942
|
-
> 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.
|
|
1850
|
+
> 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.
|
|
1943
1851
|
>
|
|
1944
|
-
|
|
1945
|
-
> 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.
|
|
1852
|
+
> 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.
|
|
1946
1853
|
>
|
|
1854
|
+
|
|
1947
1855
|
**Return Desc:**
|
|
1948
1856
|
|
|
1949
1857
|
true: the message is allowed and will be sent with subsequent video frames; false: the message is not allowed to be sent
|
|
@@ -1958,15 +1866,13 @@ true: the message is allowed and will be sent with subsequent video frames; fals
|
|
|
1958
1866
|
|
|
1959
1867
|
> **Note**
|
|
1960
1868
|
>
|
|
1961
|
-
|
|
1962
1869
|
> 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).
|
|
1963
1870
|
>
|
|
1964
|
-
|
|
1965
1871
|
> 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.
|
|
1966
1872
|
>
|
|
1967
|
-
|
|
1968
1873
|
> 3. Only one network speed test task is allowed to run at the same time.
|
|
1969
1874
|
>
|
|
1875
|
+
|
|
1970
1876
|
**Return Desc:**
|
|
1971
1877
|
|
|
1972
1878
|
interface call result, <0: failure
|
|
@@ -2012,11 +1918,11 @@ If compression is disabled, logs will be stored in plaintext and can be read dir
|
|
|
2012
1918
|
**Set local log storage path.**
|
|
2013
1919
|
|
|
2014
1920
|
You can use this API to change the default storage path of the SDK's local logs, which is as follows:
|
|
2015
|
-
- Windows: C:/Users/[username]/AppData/Roaming/liteav/log, i.e., under
|
|
1921
|
+
- Windows: C:/Users/[username]/AppData/Roaming/liteav/log, i.e., under `%appdata%/liteav/log` .
|
|
2016
1922
|
|
|
2017
|
-
- iOS or macOS: under
|
|
1923
|
+
- iOS or macOS: under `sandbox Documents/log` .
|
|
2018
1924
|
|
|
2019
|
-
- Android: under
|
|
1925
|
+
- Android: under `/app directory/files/log/liteav/` .
|
|
2020
1926
|
|
|
2021
1927
|
|Param|DESC|
|
|
2022
1928
|
|---------|---------|
|
|
@@ -2024,7 +1930,6 @@ You can use this API to change the default storage path of the SDK's local logs,
|
|
|
2024
1930
|
|
|
2025
1931
|
> **Note**
|
|
2026
1932
|
>
|
|
2027
|
-
|
|
2028
1933
|
> 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.
|
|
2029
1934
|
>
|
|
2030
1935
|
|
|
@@ -2061,9 +1966,9 @@ After the user exits the room, the SDK will automatically close the private encr
|
|
|
2061
1966
|
|
|
2062
1967
|
> **Note**
|
|
2063
1968
|
>
|
|
2064
|
-
|
|
2065
1969
|
> 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.
|
|
2066
1970
|
>
|
|
1971
|
+
|
|
2067
1972
|
**Return Desc:**
|
|
2068
1973
|
|
|
2069
1974
|
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.
|