@tencent-rtc/mcp 1.6.4 → 1.6.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/knowledge/chunker.js +83 -54
- package/knowledge/path-meta.js +179 -26
- package/knowledge/search/exact-lookup.js +168 -10
- package/knowledge/search/filter-pool.js +73 -19
- package/knowledge/search/product-scope-intent.js +2 -2
- package/knowledge/search/requires-framework.js +2 -2
- package/knowledge/search/search-knowledge.js +247 -61
- package/package.json +1 -1
- package/resource/index/manifest.json +1 -1
- package/resource/integration/callkit/preset/android/integration.md +2 -4
- package/resource/integration/callkit/preset/flutter/integration.md +4 -5
- package/resource/integration/callkit/preset/ios/integration.md +1 -4
- package/resource/integration/callkit/preset/react/integration.md +13 -20
- package/resource/integration/callkit/preset/vue/integration.md +14 -21
- package/resource/integration/chat/preset/android/integration.md +6 -9
- package/resource/integration/chat/preset/flutter/integration.md +9 -12
- package/resource/integration/chat/preset/ios/integration.md +2 -4
- package/resource/integration/chat/preset/react/integration.md +0 -10
- package/resource/integration/livekit/preset/live/android/live-audience-integration.md +129 -0
- package/resource/integration/livekit/preset/live/android/live-host-integration.md +219 -0
- package/resource/integration/livekit/preset/live/android/live-list-integration.md +261 -0
- package/resource/integration/livekit/preset/live/android/prepare-integration.md +254 -0
- package/resource/integration/livekit/preset/live/ios/live-audience-integration.md +202 -0
- package/resource/integration/livekit/preset/live/ios/live-host-integration.md +369 -0
- package/resource/integration/livekit/preset/live/ios/live-list-integration.md +229 -0
- package/resource/integration/livekit/preset/live/ios/prepare-integration.md +204 -0
- package/resource/integration/livekit/preset/live/vue/live-list-integration.md +0 -3
- package/resource/integration/livekit/preset/live/vue/live-player-desk-integration.md +0 -5
- package/resource/integration/livekit/preset/live/vue/live-player-h5-integration.md +0 -6
- package/resource/integration/livekit/preset/live/vue/live-pusher-integration.md +5 -10
- package/resource/integration/roomkit/preset/vue/integration.md +0 -4
- package/resource/knowledge/callkit/best-practice/web/callengine-invitation.md +80 -0
- package/resource/knowledge/callkit/best-practice/web/callengine-log-control.md +24 -0
- package/resource/knowledge/callkit/best-practice/web/callkit-call-vs-calls.md +116 -0
- package/resource/knowledge/callkit/core-sdk/android/answer-call.md +7 -8
- package/resource/knowledge/callkit/core-sdk/android/make-call.md +5 -7
- package/resource/knowledge/callkit/core-sdk/android/offline-push.md +3 -5
- package/resource/knowledge/callkit/core-sdk/flutter/answer-call.md +2 -6
- package/resource/knowledge/callkit/core-sdk/flutter/make-call.md +2 -6
- package/resource/knowledge/callkit/core-sdk/flutter/offline-push.md +4 -9
- package/resource/knowledge/callkit/core-sdk/ios/answer-call.md +1 -4
- package/resource/knowledge/callkit/core-sdk/ios/make-call.md +8 -11
- package/resource/knowledge/callkit/core-sdk/ios/offline-push.md +17 -23
- package/resource/knowledge/callkit/core-sdk/web/call-engine.md +33 -0
- package/resource/knowledge/callkit/core-sdk/web/call-event.md +327 -0
- package/resource/knowledge/callkit/core-sdk/web/callengine-api-overview.md +33 -0
- package/resource/knowledge/callkit/faq/android.md +0 -2
- package/resource/knowledge/callkit/faq/error-code.md +0 -2
- package/resource/knowledge/callkit/faq/flutter.md +2 -2
- package/resource/knowledge/callkit/faq/ios.md +3 -5
- package/resource/knowledge/callkit/faq/web.md +2 -3
- package/resource/knowledge/callkit/preset/android/api.md +2 -5
- package/resource/knowledge/callkit/preset/ios/api.md +0 -2
- package/resource/knowledge/callkit/preset/react/api.md +445 -0
- package/resource/knowledge/callkit/preset/react/uikit-api-reference.md +445 -0
- package/resource/knowledge/callkit/preset/vue/api.md +465 -0
- package/resource/knowledge/callkit/preset/vue/uikit-api-reference.md +465 -0
- package/resource/knowledge/chat/best-practice/web/image-message-url-handling.md +16 -0
- package/resource/knowledge/chat/preset/android/features/chat-setting.md +1 -1
- package/resource/knowledge/chat/preset/android/features/conversation-list.md +1 -1
- package/resource/knowledge/chat/preset/android/features/language.md +0 -1
- package/resource/knowledge/chat/preset/android/features/message-input.md +1 -1
- package/resource/knowledge/chat/preset/android/features/message-list.md +2 -3
- package/resource/knowledge/chat/preset/android/features/search.md +0 -1
- package/resource/knowledge/chat/preset/android/features/theme.md +1 -1
- package/resource/knowledge/chat/preset/android-view/integration.md +3 -11
- package/resource/knowledge/chat/preset/flutter/features/conversation-list.md +0 -1
- package/resource/knowledge/chat/preset/flutter/features/message-list.md +1 -2
- package/resource/knowledge/chat/preset/flutter/features/search.md +5 -6
- package/resource/knowledge/chat/preset/flutter/features/theme.md +2 -2
- package/resource/knowledge/chat/preset/ios/features/chat-setting.md +1 -1
- package/resource/knowledge/chat/preset/ios/features/conversation-list.md +1 -2
- package/resource/knowledge/chat/preset/ios/features/message-list.md +1 -2
- package/resource/knowledge/chat/preset/ios/features/search.md +0 -1
- package/resource/knowledge/chat/preset/ios-uikit/integration.md +13 -15
- package/resource/knowledge/chat/preset/react/features/conversation-list.md +5 -5
- package/resource/knowledge/chat/preset/react/features/message-input.md +2 -3
- package/resource/knowledge/chat/preset/react/features/search.md +0 -1
- package/resource/knowledge/chat/preset/react/features/theme.md +0 -1
- package/resource/knowledge/chat/urls/sdk/android.md +3 -3
- package/resource/knowledge/chat/urls/sdk/flutter.md +3 -3
- package/resource/knowledge/chat/urls/sdk/ios.md +3 -3
- package/resource/knowledge/chat/urls/sdk/web.md +3 -3
- package/resource/knowledge/livekit/core-sdk/api-reference/android/AudioEffectStore.md +7 -14
- package/resource/knowledge/livekit/core-sdk/api-reference/android/BarrageStore.md +5 -8
- package/resource/knowledge/livekit/core-sdk/api-reference/android/BattleStore.md +15 -18
- package/resource/knowledge/livekit/core-sdk/api-reference/android/CameraView.md +1 -2
- package/resource/knowledge/livekit/core-sdk/api-reference/android/CoGuestStore.md +15 -20
- package/resource/knowledge/livekit/core-sdk/api-reference/android/CoHostStore.md +10 -13
- package/resource/knowledge/livekit/core-sdk/api-reference/android/DeviceStore.md +2 -4
- package/resource/knowledge/livekit/core-sdk/api-reference/android/GiftStore.md +4 -6
- package/resource/knowledge/livekit/core-sdk/api-reference/android/LikeStore.md +2 -4
- package/resource/knowledge/livekit/core-sdk/api-reference/android/LiveAudienceStore.md +2 -4
- package/resource/knowledge/livekit/core-sdk/api-reference/android/LiveCoreView.md +1 -2
- package/resource/knowledge/livekit/core-sdk/api-reference/android/LiveSeatStore.md +8 -10
- package/resource/knowledge/livekit/core-sdk/api-reference/android/LoginStore.md +5 -7
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/AudioEffectStore.md +7 -14
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/BarrageStore.md +6 -9
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/BaseBeautyStore.md +1 -2
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/BattleStore.md +15 -18
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/CoGuestStore.md +15 -20
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/CoHostStore.md +10 -13
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/DeviceStore.md +2 -4
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/GiftStore.md +4 -6
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/LikeStore.md +2 -4
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/LiveAudienceStore.md +2 -4
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/LiveCoreView.md +1 -2
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/LiveSeatStore.md +8 -10
- package/resource/knowledge/livekit/core-sdk/api-reference/flutter/LoginStore.md +3 -5
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/AudioEffectStore.md +7 -14
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/BarrageStore.md +5 -8
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/BaseBeautyStore.md +1 -2
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/BattleStore.md +6 -9
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/CoGuestStore.md +5 -10
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/CoHostStore.md +3 -6
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/DeviceStore.md +2 -4
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/GiftStore.md +4 -6
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/LikeStore.md +2 -4
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/LiveAudienceStore.md +2 -4
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/LiveCoreView.md +1 -2
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/LiveSeatStore.md +4 -6
- package/resource/knowledge/livekit/core-sdk/api-reference/ios/LoginStore.md +3 -5
- package/resource/knowledge/livekit/core-sdk/api-reference/{web → vue}/index.md +24 -24
- package/resource/knowledge/livekit/core-sdk/{voice/android/voice-audio-effect.md → features/android/audio-effect.md} +1 -2
- package/resource/knowledge/livekit/core-sdk/{live/android/live-gift.md → features/android/gift.md} +2 -3
- package/resource/knowledge/livekit/core-sdk/{voice/android/voice-room-list.md → features/android/live-list.md} +2 -4
- package/resource/knowledge/livekit/core-sdk/{live/flutter/live-audio-effect.md → features/flutter/audio-effect.md} +0 -2
- package/resource/knowledge/livekit/core-sdk/{voice/flutter/voice-barrage.md → features/flutter/barrage.md} +2 -2
- package/resource/knowledge/livekit/core-sdk/{live/flutter/live-gift.md → features/flutter/gift.md} +2 -3
- package/resource/knowledge/livekit/core-sdk/{voice/flutter/voice-room-list.md → features/flutter/live-list.md} +1 -1
- package/resource/knowledge/livekit/core-sdk/{voice/ios/voice-audience-list.md → features/ios/audience-list.md} +1 -2
- package/resource/knowledge/livekit/core-sdk/{voice/ios/voice-audio-effect.md → features/ios/audio-effect.md} +1 -3
- package/resource/knowledge/livekit/core-sdk/{live/ios/live-base-beauty.md → features/ios/base-beauty.md} +2 -2
- package/resource/knowledge/livekit/core-sdk/{voice/ios/voice-gift.md → features/ios/gift.md} +2 -3
- package/resource/knowledge/livekit/core-sdk/{voice/ios/voice-room-list.md → features/ios/live-list.md} +2 -4
- package/resource/knowledge/livekit/core-sdk/live/android/{live-co-guest-interaction.md → co-guest-interaction.md} +0 -1
- package/resource/knowledge/livekit/core-sdk/live/android/{live-host-interaction.md → host-interaction.md} +5 -7
- package/resource/knowledge/livekit/core-sdk/live/android/{live-integration.md → integration.md} +3 -6
- package/resource/knowledge/livekit/core-sdk/live/flutter/{live-co-guest-interaction.md → co-guest-interaction.md} +1 -1
- package/resource/knowledge/livekit/core-sdk/live/flutter/{live-host-interaction.md → host-interaction.md} +0 -2
- package/resource/knowledge/livekit/core-sdk/live/flutter/{live-integration.md → integration.md} +1 -4
- package/resource/knowledge/livekit/core-sdk/live/ios/{live-co-guest-interaction.md → co-guest-interaction.md} +0 -1
- package/resource/knowledge/livekit/core-sdk/live/ios/{live-host-interaction.md → host-interaction.md} +2 -4
- package/resource/knowledge/livekit/core-sdk/live/ios/{live-integration.md → integration.md} +2 -5
- package/resource/knowledge/livekit/core-sdk/voice/android/{voice-host-interaction.md → host-interaction.md} +3 -5
- package/resource/knowledge/livekit/core-sdk/voice/android/{voice-integration.md → integration.md} +3 -6
- package/resource/knowledge/livekit/core-sdk/voice/flutter/{voice-co-guest-interaction.md → co-guest-interaction.md} +1 -2
- package/resource/knowledge/livekit/core-sdk/voice/flutter/{voice-integration.md → integration.md} +6 -9
- package/resource/knowledge/livekit/core-sdk/voice/ios/{voice-co-guest-interaction.md → co-guest-interaction.md} +2 -2
- package/resource/knowledge/livekit/core-sdk/voice/ios/{voice-host-interaction.md → host-interaction.md} +4 -6
- package/resource/knowledge/livekit/core-sdk/voice/ios/{voice-integration.md → integration.md} +1 -4
- package/resource/knowledge/livekit/preset/live/vue/features/barrage.md +0 -2
- package/resource/knowledge/push/api-reference/android.md +123 -0
- package/resource/knowledge/push/api-reference/flutter.md +176 -0
- package/resource/knowledge/push/api-reference/harmonyos.md +138 -0
- package/resource/knowledge/push/api-reference/ios.md +176 -0
- package/resource/knowledge/push/api-reference/react-native.md +147 -0
- package/resource/knowledge/push/api-reference/uni-app.md +147 -0
- package/resource/knowledge/push/api-reference/unity.md +119 -0
- package/resource/knowledge/push/api-reference/unreal-engine.md +123 -0
- package/resource/knowledge/push/config/android.md +4 -7
- package/resource/knowledge/push/config/harmonyos.md +0 -3
- package/resource/knowledge/push/config/ios.md +12 -20
- package/resource/knowledge/push/config/react-native.md +18 -26
- package/resource/knowledge/push/config/unity.md +20 -28
- package/resource/knowledge/push/config/unreal-engine.md +21 -29
- package/resource/knowledge/push/integration/android.md +6 -8
- package/resource/knowledge/push/integration/flutter.md +6 -9
- package/resource/knowledge/push/integration/harmonyos.md +1 -0
- package/resource/knowledge/push/integration/ios.md +7 -9
- package/resource/knowledge/push/integration/react-native.md +9 -13
- package/resource/knowledge/push/integration/uni-app.md +7 -7
- package/resource/knowledge/push/integration/unity.md +10 -13
- package/resource/knowledge/push/integration/unreal-engine.md +6 -9
- package/resource/knowledge/push/overview/prepare.md +2 -2
- package/resource/knowledge/roomkit/core-sdk/android/call-user-to-room.md +3 -3
- package/resource/knowledge/roomkit/core-sdk/android/capability-matrix.md +46 -0
- package/resource/knowledge/roomkit/core-sdk/android/room-participant-state.md +1 -1
- package/resource/knowledge/roomkit/core-sdk/android/room-state.md +2 -2
- package/resource/knowledge/roomkit/core-sdk/android/schedule-room.md +6 -6
- package/resource/knowledge/roomkit/core-sdk/android/unsupported-features.md +79 -0
- package/resource/knowledge/roomkit/core-sdk/flutter/capability-matrix.md +46 -0
- package/resource/knowledge/roomkit/core-sdk/flutter/room-participant-state.md +1 -1
- package/resource/knowledge/roomkit/core-sdk/flutter/unsupported-features.md +79 -0
- package/resource/knowledge/roomkit/core-sdk/ios/capability-matrix.md +46 -0
- package/resource/knowledge/roomkit/core-sdk/ios/room-participant-state.md +1 -1
- package/resource/knowledge/roomkit/core-sdk/ios/unsupported-features.md +79 -0
- package/resource/knowledge/roomkit/preset/android/integration.md +5 -7
- package/resource/knowledge/roomkit/preset/flutter/integration.md +2 -7
- package/resource/knowledge/roomkit/preset/ios/integration.md +3 -9
- package/resource/knowledge/roomkit/preset/react/integration.md +12 -16
- package/resource/knowledge/trtc/android/TRTCCloud.md +154 -238
- package/resource/knowledge/trtc/android/TRTCCloudDef.md +133 -134
- package/resource/knowledge/trtc/android/TRTCCloudListener.md +86 -120
- package/resource/knowledge/trtc/android/TRTCStatistics.md +10 -10
- package/resource/knowledge/trtc/android/TXAudioEffectManager.md +10 -30
- package/resource/knowledge/trtc/android/TXBeautyManager.md +25 -25
- package/resource/knowledge/trtc/android/TXDeviceManager.md +2 -2
- package/resource/knowledge/trtc/android/TXLiteAVCode.md +12 -12
- package/resource/knowledge/trtc/c++/ITRTCCloud.md +166 -261
- package/resource/knowledge/trtc/c++/ITRTCStatistics.md +12 -12
- package/resource/knowledge/trtc/c++/ITXAudioEffectManager.md +10 -30
- package/resource/knowledge/trtc/c++/ITXDeviceManager.md +9 -11
- package/resource/knowledge/trtc/c++/TRTCCloudCallback.md +96 -130
- package/resource/knowledge/trtc/c++/TRTCTypeDef.md +122 -123
- package/resource/knowledge/trtc/c++/TXLiteAVCode.md +12 -12
- package/resource/knowledge/trtc/ios/TRTCCloud.md +168 -255
- package/resource/knowledge/trtc/ios/TRTCCloudDef.md +124 -125
- package/resource/knowledge/trtc/ios/TRTCCloudDelegate.md +89 -124
- package/resource/knowledge/trtc/ios/TRTCStatistics.md +10 -10
- package/resource/knowledge/trtc/ios/TXAudioEffectManager.md +9 -28
- package/resource/knowledge/trtc/ios/TXBeautyManager.md +25 -25
- package/resource/knowledge/trtc/ios/TXDeviceManager.md +9 -11
- package/resource/knowledge/trtc/ios/TXLiteAVCode.md +12 -12
- package/server.js +21 -21
- package/tools/common/finalize_answer.js +1 -1
- package/tools/common/present_framework_choice.js +2 -2
- package/tools/common/search_trtc_knowledge.js +3 -3
- package/tools/common/submit_feedback.js +1 -1
- package/tools/definitions/get_native_live_uikit_integration_def.js +61 -0
- package/tools/definitions/get_native_livekit_core_integration_def.js +3 -3
- package/tools/definitions/present_framework_choice_def.js +2 -2
- package/tools/definitions/search_trtc_knowledge_def.js +5 -5
- package/tools/index.js +2 -0
- package/tools/live/get_native_live_uikit_integration.js +69 -0
- package/tools/live/get_native_livekit_core_integration.js +6 -6
- package/utils/report-cls-client.js +1 -1
- package/utils/report-es-client.js +1 -1
- package/resource/knowledge/callkit/preset/web/api.md +0 -83
- package/resource/knowledge/livekit/core-sdk/live/android/live-audio-effect.md +0 -226
- package/resource/knowledge/livekit/core-sdk/live/android/live-live-list.md +0 -438
- package/resource/knowledge/livekit/core-sdk/live/flutter/live-barrage.md +0 -490
- package/resource/knowledge/livekit/core-sdk/live/flutter/live-live-list.md +0 -726
- package/resource/knowledge/livekit/core-sdk/live/ios/live-audience-list.md +0 -264
- package/resource/knowledge/livekit/core-sdk/live/ios/live-audio-effect.md +0 -216
- package/resource/knowledge/livekit/core-sdk/live/ios/live-gift.md +0 -407
- package/resource/knowledge/livekit/core-sdk/live/ios/live-live-list.md +0 -349
- package/resource/knowledge/livekit/core-sdk/voice/android/voice-audience-list.md +0 -269
- package/resource/knowledge/livekit/core-sdk/voice/android/voice-barrage.md +0 -456
- package/resource/knowledge/livekit/core-sdk/voice/android/voice-gift.md +0 -455
- package/resource/knowledge/livekit/core-sdk/voice/flutter/voice-audience-list.md +0 -260
- package/resource/knowledge/livekit/core-sdk/voice/flutter/voice-audio-effect.md +0 -598
- package/resource/knowledge/livekit/core-sdk/voice/flutter/voice-gift.md +0 -424
- package/resource/knowledge/livekit/core-sdk/voice/ios/voice-barrage.md +0 -408
- /package/resource/knowledge/livekit/core-sdk/{live/android/live-audience-list.md → features/android/audience-list.md} +0 -0
- /package/resource/knowledge/livekit/core-sdk/{live/android/live-barrage.md → features/android/barrage.md} +0 -0
- /package/resource/knowledge/livekit/core-sdk/{live/android/live-base-beauty.md → features/android/base-beauty.md} +0 -0
- /package/resource/knowledge/livekit/core-sdk/{live/flutter/live-audience-list.md → features/flutter/audience-list.md} +0 -0
- /package/resource/knowledge/livekit/core-sdk/{live/flutter/live-base-beauty.md → features/flutter/base-beauty.md} +0 -0
- /package/resource/knowledge/livekit/core-sdk/{live/ios/live-barrage.md → features/ios/barrage.md} +0 -0
- /package/resource/knowledge/livekit/core-sdk/voice/android/{voice-co-guest-interaction.md → co-guest-interaction.md} +0 -0
|
@@ -4,7 +4,7 @@ Module: TRTCCloud @ TXLiteAVSDK
|
|
|
4
4
|
|
|
5
5
|
Function: TRTC's main feature API
|
|
6
6
|
|
|
7
|
-
Version: 13.
|
|
7
|
+
Version: 13.4
|
|
8
8
|
|
|
9
9
|
## TRTCCloud
|
|
10
10
|
|
|
@@ -133,7 +133,6 @@ Version: 13.3
|
|
|
133
133
|
|
|
134
134
|
> **Note**
|
|
135
135
|
>
|
|
136
|
-
|
|
137
136
|
> 1. Please use destroySharedInstance to release the object pointer.
|
|
138
137
|
>
|
|
139
138
|
|
|
@@ -155,14 +154,13 @@ You can use TRTCCloudDelegate to get various event notifications from the SDK, s
|
|
|
155
154
|
|
|
156
155
|
**Set the queue that drives the TRTCCloudDelegate event callback.**
|
|
157
156
|
|
|
158
|
-
If you do not specify a
|
|
157
|
+
If you do not specify a `delegateQueue` , the SDK will use `MainQueue` as the queue for driving TRTCCloudDelegate event callbacks by default.
|
|
159
158
|
|
|
160
|
-
In other words, if you do not set the
|
|
159
|
+
In other words, if you do not set the `delegateQueue` attribute, all callback functions in TRTCCloudDelegate will be driven by `MainQueue` .
|
|
161
160
|
|
|
162
161
|
> **Note**
|
|
163
162
|
>
|
|
164
|
-
|
|
165
|
-
> If you specify a ` delegateQueue `, please do not manipulate the UI in the TRTCCloudDelegate callback function; otherwise, thread safety issues will occur.
|
|
163
|
+
> If you specify a `delegateQueue` , please do not manipulate the UI in the TRTCCloudDelegate callback function; otherwise, thread safety issues will occur.
|
|
166
164
|
>
|
|
167
165
|
|
|
168
166
|
## enterRoom:appScene:
|
|
@@ -172,31 +170,31 @@ In other words, if you do not set the ` delegateQueue ` attribute, all callback
|
|
|
172
170
|
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.
|
|
173
171
|
|
|
174
172
|
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:
|
|
175
|
-
-
|
|
173
|
+
- TRTCAppSceneVideoCall:
|
|
176
174
|
|
|
177
175
|
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.
|
|
178
176
|
|
|
179
177
|
In this scenario, each room supports up to 300 concurrent online users, and up to 50 of them can speak simultaneously.
|
|
180
|
-
-
|
|
178
|
+
- TRTCAppSceneAudioCall:
|
|
181
179
|
|
|
182
180
|
Audio call scenario. Use cases: [one-to-one audio call], [audio conferencing with up to 300 participants], [audio chat], [online Werewolf], etc.
|
|
183
181
|
|
|
184
182
|
In this scenario, each room supports up to 300 concurrent online users, and up to 50 of them can speak simultaneously.
|
|
185
|
-
-
|
|
183
|
+
- TRTCAppSceneLIVE:
|
|
186
184
|
|
|
187
185
|
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.
|
|
188
186
|
|
|
189
187
|
In this scenario, each room supports up to 100,000 concurrent online users, but you should specify the user roles: anchor (TRTCRoleAnchor) or audience (TRTCRoleAudience).
|
|
190
|
-
-
|
|
188
|
+
- TRTCAppSceneVoiceChatRoom:
|
|
191
189
|
|
|
192
190
|
Audio chat room scenario. Use cases: [Clubhouse], [online karaoke room], [music live room], [FM radio], etc.
|
|
193
191
|
|
|
194
192
|
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).
|
|
195
193
|
|
|
196
|
-
After calling this API, you will receive the
|
|
197
|
-
- If room entry succeeded, the
|
|
194
|
+
After calling this API, you will receive the `onEnterRoom(result)` callback from TRTCCloudDelegate:
|
|
195
|
+
- 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.
|
|
198
196
|
|
|
199
|
-
- If room entry failed, the
|
|
197
|
+
- If room entry failed, the `result` parameter will be a negative number ( `result` < 0), indicating the TXLiteAVError for room entry failure.
|
|
200
198
|
|
|
201
199
|
|Param|DESC|
|
|
202
200
|
|---------|---------|
|
|
@@ -205,13 +203,10 @@ After calling this API, you will receive the ` onEnterRoom(result) ` callback fr
|
|
|
205
203
|
|
|
206
204
|
> **Note**
|
|
207
205
|
>
|
|
208
|
-
|
|
209
|
-
> 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.
|
|
206
|
+
> 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.
|
|
210
207
|
>
|
|
211
|
-
|
|
212
|
-
> 2. The same ` scene ` should be configured for all users in the same room.
|
|
208
|
+
> 2. The same `scene` should be configured for all users in the same room.
|
|
213
209
|
>
|
|
214
|
-
|
|
215
210
|
> 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.
|
|
216
211
|
>
|
|
217
212
|
|
|
@@ -221,7 +216,7 @@ After calling this API, you will receive the ` onEnterRoom(result) ` callback fr
|
|
|
221
216
|
|
|
222
217
|
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.
|
|
223
218
|
|
|
224
|
-
After resources are released, the SDK will use the
|
|
219
|
+
After resources are released, the SDK will use the `onExitRoom()` callback in TRTCCloudDelegate to notify you.
|
|
225
220
|
|
|
226
221
|
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.
|
|
227
222
|
|
|
@@ -229,45 +224,41 @@ If you need to call enterRoom again or switch to the SDK of another provider, we
|
|
|
229
224
|
|
|
230
225
|
**Switch role.**
|
|
231
226
|
|
|
232
|
-
This API is used to switch the user role between
|
|
227
|
+
This API is used to switch the user role between `anchor` and `audience` .
|
|
233
228
|
|
|
234
229
|
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.
|
|
235
230
|
|
|
236
|
-
You can use the
|
|
231
|
+
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.
|
|
237
232
|
| Param | DESC |
|
|
238
233
|
| --- | --- |
|
|
239
|
-
| role | Role, which is
|
|
234
|
+
| 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. |
|
|
240
235
|
|
|
241
236
|
> **Note**
|
|
242
237
|
>
|
|
243
|
-
|
|
244
238
|
> 1. This API is only applicable to two scenarios: live streaming (TRTCAppSceneLIVE) and audio chat room (TRTCAppSceneVoiceChatRoom).
|
|
245
239
|
>
|
|
246
|
-
|
|
247
|
-
> 2. If the ` scene ` you specify in enterRoom is TRTCAppSceneVideoCall or TRTCAppSceneAudioCall, please do not call this API.
|
|
240
|
+
> 2. If the `scene` you specify in enterRoom is TRTCAppSceneVideoCall or TRTCAppSceneAudioCall, please do not call this API.
|
|
248
241
|
>
|
|
249
242
|
|
|
250
243
|
## switchRole:privateMapKey:
|
|
251
244
|
|
|
252
245
|
**Switch role(support permission credential).**
|
|
253
246
|
|
|
254
|
-
This API is used to switch the user role between
|
|
247
|
+
This API is used to switch the user role between `anchor` and `audience` .
|
|
255
248
|
|
|
256
249
|
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.
|
|
257
250
|
|
|
258
|
-
You can use the
|
|
251
|
+
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.
|
|
259
252
|
| Param | DESC |
|
|
260
253
|
| --- | --- |
|
|
261
|
-
| privateMapKey | Permission credential used for permission control. If you want only users with the specified
|
|
262
|
-
| role | Role, which is
|
|
254
|
+
| 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>. |
|
|
255
|
+
| 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. |
|
|
263
256
|
|
|
264
257
|
> **Note**
|
|
265
258
|
>
|
|
266
|
-
|
|
267
259
|
> 1. This API is only applicable to two scenarios: live streaming (TRTCAppSceneLIVE) and audio chat room (TRTCAppSceneVoiceChatRoom).
|
|
268
260
|
>
|
|
269
|
-
|
|
270
|
-
> 2. If the ` scene ` you specify in enterRoom is TRTCAppSceneVideoCall or TRTCAppSceneAudioCall, please do not call this API.
|
|
261
|
+
> 2. If the `scene` you specify in enterRoom is TRTCAppSceneVideoCall or TRTCAppSceneAudioCall, please do not call this API.
|
|
271
262
|
>
|
|
272
263
|
|
|
273
264
|
## switchRoom:
|
|
@@ -275,13 +266,13 @@ You can use the ` role ` field in TRTCParams during room entry to specify the us
|
|
|
275
266
|
**Switch room.**
|
|
276
267
|
|
|
277
268
|
This API is used to quickly switch a user from one room to another.
|
|
278
|
-
- If the user's role is
|
|
269
|
+
- If the user's role is `audience` , calling this API is equivalent to `exitRoom` (current room) + `enterRoom` (new room).
|
|
279
270
|
|
|
280
|
-
- If the user's role is
|
|
271
|
+
- 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.
|
|
281
272
|
|
|
282
|
-
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
|
|
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 `switchRoom` can get better smoothness and use less code than `exitRoom + enterRoom` .
|
|
283
274
|
|
|
284
|
-
The API call result will be called back through
|
|
275
|
+
The API call result will be called back through `onSwitchRoom(errCode, errMsg)` in TRTCCloudDelegate.
|
|
285
276
|
|
|
286
277
|
|Param|DESC|
|
|
287
278
|
|---------|---------|
|
|
@@ -289,14 +280,11 @@ The API call result will be called back through ` onSwitchRoom(errCode, errMsg)
|
|
|
289
280
|
|
|
290
281
|
> **Note**
|
|
291
282
|
>
|
|
292
|
-
|
|
293
|
-
> 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:
|
|
283
|
+
> 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:
|
|
294
284
|
>
|
|
295
|
-
|
|
296
|
-
> 1. If you decide to use ` strRoomId `, then set ` roomId ` to 0. If both are specified, ` roomId ` will be used.
|
|
285
|
+
> 1. If you decide to use `strRoomId` , then set `roomId` to 0. If both are specified, `roomId` will be used.
|
|
297
286
|
>
|
|
298
|
-
|
|
299
|
-
> 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.
|
|
287
|
+
> 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.
|
|
300
288
|
>
|
|
301
289
|
|
|
302
290
|
## connectOtherRoom:
|
|
@@ -311,10 +299,10 @@ In other words, you can use this API to share the audio/video streams of two anc
|
|
|
311
299
|
|
|
312
300
|
The result of requesting cross-room call will be returned through the onConnectOtherRoom callback in TRTCCloudDelegate.
|
|
313
301
|
|
|
314
|
-
For example, after anchor A in room "101" uses
|
|
315
|
-
- All users in room "101" will receive the
|
|
302
|
+
For example, after anchor A in room "101" uses `connectOtherRoom()` to successfully call anchor B in room "102":
|
|
303
|
+
- All users in room "101" will receive the `onRemoteUserEnterRoom(B)` and `onUserVideoAvailable(B,YES)` event callbacks of anchor B; that is, all users in room "101" can subscribe to the audio/video streams of anchor B.
|
|
316
304
|
|
|
317
|
-
- All users in room "102" will receive the
|
|
305
|
+
- All users in room "102" will receive the `onRemoteUserEnterRoom(A)` and `onUserVideoAvailable(A,YES)` event callbacks of anchor A; that is, all users in room "102" can subscribe to the audio/video streams of anchor A.
|
|
318
306
|
|
|
319
307
|
For compatibility with subsequent extended fields for cross-room call, parameters in JSON format are used currently.
|
|
320
308
|
|
|
@@ -334,7 +322,7 @@ Below is the sample code:
|
|
|
334
322
|
|
|
335
323
|
Case 2: string room ID
|
|
336
324
|
|
|
337
|
-
If you use a string room ID, please be sure to replace the
|
|
325
|
+
If you use a string room ID, please be sure to replace the `roomId` in JSON with `strRoomId` , such as `{"strRoomId": "102", "userId": "userB"}`
|
|
338
326
|
|
|
339
327
|
Below is the sample code:
|
|
340
328
|
``` objectivec
|
|
@@ -348,20 +336,20 @@ Below is the sample code:
|
|
|
348
336
|
|
|
349
337
|
|Param|DESC|
|
|
350
338
|
|---------|---------|
|
|
351
|
-
|param|You need to pass in a string parameter in JSON format:
|
|
339
|
+
|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.|
|
|
352
340
|
|
|
353
341
|
## disconnectOtherRoom
|
|
354
342
|
|
|
355
343
|
**Exit cross-room call.**
|
|
356
344
|
|
|
357
|
-
The result will be returned through the
|
|
345
|
+
The result will be returned through the `onDisconnectOtherRoom()` callback in TRTCCloudDelegate.
|
|
358
346
|
|
|
359
347
|
## setDefaultStreamRecvMode:video:
|
|
360
348
|
|
|
361
349
|
**Set subscription mode (which must be set before room entry for it to take effect).**
|
|
362
350
|
|
|
363
351
|
You can switch between the "automatic subscription" and "manual subscription" modes through this API:
|
|
364
|
-
- 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
|
|
352
|
+
- 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).
|
|
365
353
|
|
|
366
354
|
- 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 (NO) API to start playing back the audio stream.
|
|
367
355
|
|
|
@@ -371,15 +359,13 @@ In your application scenario, if there are many audio/video streams being publis
|
|
|
371
359
|
|
|
372
360
|
|Param|DESC|
|
|
373
361
|
|---------|---------|
|
|
374
|
-
|autoRecvAudio|YES: automatic subscription to audio; NO: manual subscription to audio by calling
|
|
375
|
-
|autoRecvVideo|YES: automatic subscription to video; NO: manual subscription to video by calling
|
|
362
|
+
|autoRecvAudio|YES: automatic subscription to audio; NO: manual subscription to audio by calling `muteRemoteAudio(NO)` . Default value: YES|
|
|
363
|
+
|autoRecvVideo|YES: automatic subscription to video; NO: manual subscription to video by calling `startRemoteView` . Default value: YES|
|
|
376
364
|
|
|
377
365
|
> **Note**
|
|
378
366
|
>
|
|
379
|
-
|
|
380
367
|
> 1. The configuration takes effect only if this API is called before room entry (enterRoom).
|
|
381
368
|
>
|
|
382
|
-
|
|
383
369
|
> 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.
|
|
384
370
|
>
|
|
385
371
|
|
|
@@ -387,11 +373,11 @@ In your application scenario, if there are many audio/video streams being publis
|
|
|
387
373
|
|
|
388
374
|
**Create room subinstance (for concurrent multi-room listen/watch).**
|
|
389
375
|
|
|
390
|
-
`
|
|
376
|
+
`TRTCCloud` was originally designed to work in the singleton mode, which limited the ability to watch concurrently in multiple rooms.
|
|
391
377
|
|
|
392
|
-
By calling this API, you can create multiple
|
|
378
|
+
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.
|
|
393
379
|
|
|
394
|
-
However, it should be noted that your ability to publish audio and video streams in multiple
|
|
380
|
+
However, it should be noted that your ability to publish audio and video streams in multiple `TRTCCloud` instances will be limited.
|
|
395
381
|
|
|
396
382
|
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".
|
|
397
383
|
|
|
@@ -423,23 +409,20 @@ Below is the sample code:
|
|
|
423
409
|
|
|
424
410
|
> **Note**
|
|
425
411
|
>
|
|
426
|
-
|
|
427
|
-
> 1. The same user can enter multiple rooms with different ` roomId ` values by using the same ` userId `.
|
|
412
|
+
> 1. The same user can enter multiple rooms with different `roomId` values by using the same `userId` .
|
|
428
413
|
>
|
|
429
|
-
|
|
430
|
-
> 2. Two devices cannot use the same ` userId ` to enter the same room with a specified ` roomId `.
|
|
414
|
+
> 2. Two devices cannot use the same `userId` to enter the same room with a specified `roomId` .
|
|
431
415
|
>
|
|
432
|
-
|
|
433
416
|
> 3. You can set TRTCCloudDelegate separately for different instances to get their own event notifications.
|
|
434
417
|
>
|
|
435
|
-
|
|
436
|
-
> 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:
|
|
418
|
+
> 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:
|
|
437
419
|
>
|
|
438
420
|
> - 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;
|
|
439
421
|
> - The result of camera-related API call will be based on the last time: startLocalPreview.
|
|
422
|
+
|
|
440
423
|
**Return Desc:**
|
|
441
424
|
|
|
442
|
-
`
|
|
425
|
+
`TRTCCloud` subinstance
|
|
443
426
|
|
|
444
427
|
## destroySubCloud:
|
|
445
428
|
|
|
@@ -461,13 +444,13 @@ After disabling a certain upstream capability of the cross-room anchor, all user
|
|
|
461
444
|
|
|
462
445
|
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.
|
|
463
446
|
|
|
464
|
-
The result of calling this API will be returned through the
|
|
447
|
+
The result of calling this API will be returned through the `onUpdateOtherRoomForwardMode()` callback in TRTCCloudDelegate.
|
|
465
448
|
|
|
466
|
-
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
|
|
467
|
-
- At this time, both anchor A and audience B will receive the
|
|
449
|
+
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.
|
|
450
|
+
- At this time, both anchor A and audience B will receive the `onRemoteUserEnterRoom(C)` , `onUserVideoAvailable(C,YES)` , and `onUserAudioAvailable(C,YES)` event callbacks, and can subscribe to the audio/video streams of anchor C.
|
|
468
451
|
|
|
469
452
|
Later, anchor A calls this API to disable the audio publishing capability of anchor C in the current room.
|
|
470
|
-
- 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
|
|
453
|
+
- 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,NO)` event callback, and cannot subscribe to the audio stream of anchor C by calling `muteRemoteAudio(C,NO)` .
|
|
471
454
|
|
|
472
455
|
- 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.
|
|
473
456
|
|
|
@@ -497,7 +480,7 @@ Case 2: string room ID
|
|
|
497
480
|
|
|
498
481
|
|Param|DESC|
|
|
499
482
|
|---------|---------|
|
|
500
|
-
|param|You need to pass in a string parameter in JSON format:
|
|
483
|
+
|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.|
|
|
501
484
|
|
|
502
485
|
## startPublishMediaStream:encoderParam:mixingConfig:
|
|
503
486
|
|
|
@@ -515,16 +498,12 @@ You can use the TRTCPublishMode parameter in TRTCPublishTarget to specify the pu
|
|
|
515
498
|
|
|
516
499
|
> **Note**
|
|
517
500
|
>
|
|
518
|
-
|
|
519
501
|
> 1. The SDK will send a task ID to you via the onStartPublishMediaStream callback.
|
|
520
502
|
>
|
|
521
|
-
|
|
522
503
|
> 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.
|
|
523
504
|
>
|
|
524
|
-
|
|
525
|
-
> 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.
|
|
505
|
+
> 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.
|
|
526
506
|
>
|
|
527
|
-
|
|
528
507
|
> 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.
|
|
529
508
|
>
|
|
530
509
|
|
|
@@ -543,13 +522,10 @@ You can use this API to change the parameters of a publishing task initiated by
|
|
|
543
522
|
|
|
544
523
|
> **Note**
|
|
545
524
|
>
|
|
546
|
-
|
|
547
525
|
> 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.
|
|
548
526
|
>
|
|
549
|
-
|
|
550
527
|
> 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).
|
|
551
528
|
>
|
|
552
|
-
|
|
553
529
|
> 3. You can not switch output between "only audio", "only video" and "audio and video" for the same task.
|
|
554
530
|
>
|
|
555
531
|
|
|
@@ -565,11 +541,9 @@ You can use this API to stop a task initiated by startPublishMediaStream.
|
|
|
565
541
|
|
|
566
542
|
> **Note**
|
|
567
543
|
>
|
|
568
|
-
|
|
569
544
|
> 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.
|
|
570
545
|
>
|
|
571
|
-
|
|
572
|
-
> 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.
|
|
546
|
+
> 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.
|
|
573
547
|
>
|
|
574
548
|
|
|
575
549
|
## startLocalPreview:view:
|
|
@@ -580,7 +554,7 @@ If this API is called before enterRoom, the SDK will only enable the camera and
|
|
|
580
554
|
|
|
581
555
|
If it is called after enterRoom, the SDK will enable the camera and automatically start pushing the video stream.
|
|
582
556
|
|
|
583
|
-
When the first camera video frame starts to be rendered, you will receive the
|
|
557
|
+
When the first camera video frame starts to be rendered, you will receive the `onCameraDidReady` callback in TRTCCloudDelegate.
|
|
584
558
|
|
|
585
559
|
|Param|DESC|
|
|
586
560
|
|---------|---------|
|
|
@@ -589,11 +563,10 @@ When the first camera video frame starts to be rendered, you will receive the `
|
|
|
589
563
|
|
|
590
564
|
> **Note**
|
|
591
565
|
>
|
|
592
|
-
|
|
593
|
-
> If you want to preview the camera image and adjust the beauty filter parameters through ` BeautyManager ` before going live, you can:
|
|
566
|
+
> If you want to preview the camera image and adjust the beauty filter parameters through `BeautyManager` before going live, you can:
|
|
594
567
|
>
|
|
595
|
-
> - Scheme 1. Call
|
|
596
|
-
> - Scheme 2. Call
|
|
568
|
+
> - Scheme 1. Call `startLocalPreview` before calling enterRoom.
|
|
569
|
+
> - Scheme 2. Call `startLocalPreview` and `muteLocalVideo(YES)` after calling enterRoom.
|
|
597
570
|
|
|
598
571
|
## startLocalPreview:
|
|
599
572
|
|
|
@@ -605,7 +578,7 @@ If this API is called before enterRoom, the SDK will only enable the camera and
|
|
|
605
578
|
|
|
606
579
|
If it is called after enterRoom, the SDK will enable the camera and automatically start pushing the video stream.
|
|
607
580
|
|
|
608
|
-
When the first camera video frame starts to be rendered, you will receive the
|
|
581
|
+
When the first camera video frame starts to be rendered, you will receive the `onCameraDidReady` callback in TRTCCloudDelegate.
|
|
609
582
|
|
|
610
583
|
|Param|DESC|
|
|
611
584
|
|---------|---------|
|
|
@@ -613,11 +586,10 @@ When the first camera video frame starts to be rendered, you will receive the `
|
|
|
613
586
|
|
|
614
587
|
> **Note**
|
|
615
588
|
>
|
|
616
|
-
|
|
617
|
-
> If you want to preview the camera image and adjust the beauty filter parameters through ` BeautyManager ` before going live, you can:
|
|
589
|
+
> If you want to preview the camera image and adjust the beauty filter parameters through `BeautyManager` before going live, you can:
|
|
618
590
|
>
|
|
619
|
-
> - Scheme 1. Call
|
|
620
|
-
> - Scheme 2. Call
|
|
591
|
+
> - Scheme 1. Call `startLocalPreview` before calling enterRoom.
|
|
592
|
+
> - Scheme 2. Call `startLocalPreview` and `muteLocalVideo(YES)` after calling enterRoom.
|
|
621
593
|
|
|
622
594
|
## updateLocalView:
|
|
623
595
|
|
|
@@ -633,15 +605,15 @@ When the first camera video frame starts to be rendered, you will receive the `
|
|
|
633
605
|
|
|
634
606
|
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.
|
|
635
607
|
|
|
636
|
-
This API is equivalent to the two APIs of
|
|
608
|
+
This API is equivalent to the two APIs of `startLocalPreview/stopLocalPreview` when TRTCVideoStreamTypeBig is specified, but has higher performance and response speed.
|
|
637
609
|
|
|
638
|
-
The
|
|
610
|
+
The `startLocalPreview/stopLocalPreview` APIs need to enable/disable the camera, which are hardware device-related operations, so they are very time-consuming.
|
|
639
611
|
|
|
640
|
-
In contrast,
|
|
612
|
+
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.
|
|
641
613
|
|
|
642
|
-
After local video publishing is paused, other members in the same room will receive the
|
|
614
|
+
After local video publishing is paused, other members in the same room will receive the `onUserVideoAvailable(userId, NO)` callback notification.
|
|
643
615
|
|
|
644
|
-
After local video publishing is resumed, other members in the same room will receive the
|
|
616
|
+
After local video publishing is resumed, other members in the same room will receive the `onUserVideoAvailable(userId, YES)` callback notification.
|
|
645
617
|
|
|
646
618
|
|Param|DESC|
|
|
647
619
|
|---------|---------|
|
|
@@ -652,7 +624,7 @@ After local video publishing is resumed, other members in the same room will rec
|
|
|
652
624
|
|
|
653
625
|
**Set placeholder image during local video pause.**
|
|
654
626
|
|
|
655
|
-
When you call
|
|
627
|
+
When you call `muteLocalVideo(YES)` 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.
|
|
656
628
|
|
|
657
629
|
|Param|DESC|
|
|
658
630
|
|---------|---------|
|
|
@@ -663,31 +635,27 @@ When you call ` muteLocalVideo(YES) ` to pause the local video image, you can se
|
|
|
663
635
|
|
|
664
636
|
**Subscribe to remote user's video stream and bind video rendering control.**
|
|
665
637
|
|
|
666
|
-
Calling this API allows the SDK to pull the video stream of the specified
|
|
667
|
-
- If you already know the
|
|
638
|
+
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.
|
|
639
|
+
- 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.
|
|
668
640
|
|
|
669
641
|
- If you don't know which users in the room are publishing video streams, you can wait for the notification from onUserVideoAvailable after enterRoom.
|
|
670
642
|
|
|
671
643
|
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.
|
|
672
644
|
| Param | DESC |
|
|
673
645
|
| --- | --- |
|
|
674
|
-
| streamType | Video stream type of the
|
|
646
|
+
| 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 enableEncSmallVideoStream for this parameter to take effect)<br>- Substream image (usually used for screen sharing): TRTCVideoStreamTypeSub |
|
|
675
647
|
| userId | ID of the specified remote user |
|
|
676
648
|
| view | Rendering control that carries the video image |
|
|
677
649
|
|
|
678
650
|
> **Note**
|
|
679
651
|
>
|
|
680
|
-
|
|
681
652
|
> The following requires your attention:
|
|
682
653
|
>
|
|
683
|
-
|
|
684
|
-
> 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.
|
|
654
|
+
> 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.
|
|
685
655
|
>
|
|
686
|
-
|
|
687
|
-
> 2. Only when the specified ` userId ` enables dual-channel encoding through enableEncSmallVideoStream can the user's small image be viewed.
|
|
656
|
+
> 2. Only when the specified `userId` enables dual-channel encoding through enableEncSmallVideoStream can the user's small image be viewed.
|
|
688
657
|
>
|
|
689
|
-
|
|
690
|
-
> 3. If the small image of the specified ` userId ` does not exist, the SDK will switch to the big image of the user by default.
|
|
658
|
+
> 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.
|
|
691
659
|
>
|
|
692
660
|
|
|
693
661
|
## updateRemoteView:streamType:forUser:
|
|
@@ -709,7 +677,7 @@ This API can be used to update the rendering control of the remote video image.
|
|
|
709
677
|
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.
|
|
710
678
|
| Param | DESC |
|
|
711
679
|
| --- | --- |
|
|
712
|
-
| streamType | Video stream type of the
|
|
680
|
+
| 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 |
|
|
713
681
|
| userId | ID of the specified remote user |
|
|
714
682
|
|
|
715
683
|
## stopAllRemoteView
|
|
@@ -720,7 +688,6 @@ Calling this API will cause the SDK to stop receiving all remote video streams a
|
|
|
720
688
|
|
|
721
689
|
> **Note**
|
|
722
690
|
>
|
|
723
|
-
|
|
724
691
|
> If a substream image (screen sharing) is being displayed, it will also be stopped.
|
|
725
692
|
>
|
|
726
693
|
|
|
@@ -737,7 +704,6 @@ This API only pauses/resumes receiving the specified user's video stream but doe
|
|
|
737
704
|
|
|
738
705
|
> **Note**
|
|
739
706
|
>
|
|
740
|
-
|
|
741
707
|
> 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(NO) or muteAllRemoteVideoStreams(NO) to resume it.
|
|
742
708
|
>
|
|
743
709
|
|
|
@@ -753,10 +719,8 @@ This API only pauses/resumes receiving all users' video streams but does not rel
|
|
|
753
719
|
|
|
754
720
|
> **Note**
|
|
755
721
|
>
|
|
756
|
-
|
|
757
722
|
> This API can be called before room entry (enterRoom), and the pause status will be reset after room exit (exitRoom).
|
|
758
723
|
>
|
|
759
|
-
|
|
760
724
|
> 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(NO) or muteAllRemoteVideoStreams(NO) to resume it.
|
|
761
725
|
>
|
|
762
726
|
|
|
@@ -772,7 +736,6 @@ This setting can determine the quality of image viewed by remote users, which is
|
|
|
772
736
|
|
|
773
737
|
> **Note**
|
|
774
738
|
>
|
|
775
|
-
|
|
776
739
|
> 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.
|
|
777
740
|
>
|
|
778
741
|
|
|
@@ -823,9 +786,9 @@ In this way, other users in the room can choose to subscribe to the **HD big ima
|
|
|
823
786
|
|
|
824
787
|
> **Note**
|
|
825
788
|
>
|
|
826
|
-
|
|
827
789
|
> 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.
|
|
828
790
|
>
|
|
791
|
+
|
|
829
792
|
**Return Desc:**
|
|
830
793
|
|
|
831
794
|
0: success; -1: the current big image has been set to a lower quality, and it is not necessary to enable dual-channel encoding
|
|
@@ -845,7 +808,6 @@ You can use this API to select whether the image subscribed to is the big image
|
|
|
845
808
|
|
|
846
809
|
> **Note**
|
|
847
810
|
>
|
|
848
|
-
|
|
849
811
|
> To implement this feature, the target user must have enabled the dual-channel encoding mode through enableEncSmallVideoStream; otherwise, this API will not work.
|
|
850
812
|
>
|
|
851
813
|
|
|
@@ -863,7 +825,6 @@ You can use this API to screencapture the local video image or the primary strea
|
|
|
863
825
|
|
|
864
826
|
> **Note**
|
|
865
827
|
>
|
|
866
|
-
|
|
867
828
|
> On Windows, only video image from the TRTCSnapshotSourceTypeStream source can be screencaptured currently.
|
|
868
829
|
>
|
|
869
830
|
|
|
@@ -904,11 +865,10 @@ The SDK does not enable the mic by default. When a user wants to publish the loc
|
|
|
904
865
|
After local audio capturing and publishing is enabled, other users in the room will receive the onUserAudioAvailable(userId, YES) notification.
|
|
905
866
|
| Param | DESC |
|
|
906
867
|
| --- | --- |
|
|
907
|
-
| quality | Sound quality<br>-
|
|
868
|
+
| 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. |
|
|
908
869
|
|
|
909
870
|
> **Note**
|
|
910
871
|
>
|
|
911
|
-
|
|
912
872
|
> 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.
|
|
913
873
|
>
|
|
914
874
|
|
|
@@ -926,11 +886,11 @@ After local audio publishing is paused, other users in the room will receive the
|
|
|
926
886
|
|
|
927
887
|
After local audio publishing is resumed, other users in the room will receive the onUserAudioAvailable(userId, YES) notification.
|
|
928
888
|
|
|
929
|
-
Different from stopLocalAudio,
|
|
889
|
+
Different from stopLocalAudio, `muteLocalAudio(YES)` does not release the mic permission; instead, it continues to send mute packets with extremely low bitrate.
|
|
930
890
|
|
|
931
891
|
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.
|
|
932
892
|
|
|
933
|
-
Therefore,
|
|
893
|
+
Therefore, `muteLocalAudio` instead of stopLocalAudio is recommended in scenarios where the requirement for recording file quality is high.
|
|
934
894
|
|
|
935
895
|
|Param|DESC|
|
|
936
896
|
|---------|---------|
|
|
@@ -949,8 +909,7 @@ When you mute the remote audio of a specified user, the SDK will stop playing ba
|
|
|
949
909
|
|
|
950
910
|
> **Note**
|
|
951
911
|
>
|
|
952
|
-
|
|
953
|
-
> This API works when called either before or after room entry (enterRoom), and the mute status will be reset to ` NO ` after room exit (exitRoom).
|
|
912
|
+
> This API works when called either before or after room entry (enterRoom), and the mute status will be reset to `NO` after room exit (exitRoom).
|
|
954
913
|
>
|
|
955
914
|
|
|
956
915
|
## muteAllRemoteAudio:
|
|
@@ -965,8 +924,7 @@ When you mute the audio of all remote users, the SDK will stop playing back all
|
|
|
965
924
|
|
|
966
925
|
> **Note**
|
|
967
926
|
>
|
|
968
|
-
|
|
969
|
-
> This API works when called either before or after room entry (enterRoom), and the mute status will be reset to ` NO ` after room exit (exitRoom).
|
|
927
|
+
> This API works when called either before or after room entry (enterRoom), and the mute status will be reset to `NO` after room exit (exitRoom).
|
|
970
928
|
>
|
|
971
929
|
|
|
972
930
|
## setAudioRoute:
|
|
@@ -989,7 +947,7 @@ If audio route is set to the speaker, the volume is relatively high, so there is
|
|
|
989
947
|
|
|
990
948
|
**Set the audio playback volume of remote user.**
|
|
991
949
|
|
|
992
|
-
You can mute the audio of a remote user through
|
|
950
|
+
You can mute the audio of a remote user through `setRemoteAudioVolume(userId, 0)` .
|
|
993
951
|
|
|
994
952
|
|Param|DESC|
|
|
995
953
|
|---------|---------|
|
|
@@ -998,7 +956,6 @@ You can mute the audio of a remote user through ` setRemoteAudioVolume(userId, 0
|
|
|
998
956
|
|
|
999
957
|
> **Note**
|
|
1000
958
|
>
|
|
1001
|
-
|
|
1002
959
|
> If 100 is still not loud enough for you, you can set the volume to up to 150, but there may be side effects.
|
|
1003
960
|
>
|
|
1004
961
|
|
|
@@ -1012,13 +969,12 @@ You can mute the audio of a remote user through ` setRemoteAudioVolume(userId, 0
|
|
|
1012
969
|
|
|
1013
970
|
> **Note**
|
|
1014
971
|
>
|
|
1015
|
-
|
|
1016
972
|
> If 100 is still not loud enough for you, you can set the volume to up to 150, but there may be side effects.
|
|
1017
973
|
>
|
|
1018
974
|
|
|
1019
975
|
## getAudioCaptureVolume
|
|
1020
976
|
|
|
1021
|
-
**Get the capturing volume of local audio
|
|
977
|
+
**Get the capturing volume of local audio.Return Desc:**
|
|
1022
978
|
|
|
1023
979
|
capturing volume
|
|
1024
980
|
|
|
@@ -1034,7 +990,6 @@ This API controls the volume of the sound ultimately delivered by the SDK to the
|
|
|
1034
990
|
|
|
1035
991
|
> **Note**
|
|
1036
992
|
>
|
|
1037
|
-
|
|
1038
993
|
> If 100 is still not loud enough for you, you can set the volume to up to 150, but there may be side effects.
|
|
1039
994
|
>
|
|
1040
995
|
|
|
@@ -1055,7 +1010,6 @@ After this feature is enabled, the SDK will return the audio volume assessment i
|
|
|
1055
1010
|
|
|
1056
1011
|
> **Note**
|
|
1057
1012
|
>
|
|
1058
|
-
|
|
1059
1013
|
> To enable this feature, call this API before calling startLocalAudio.
|
|
1060
1014
|
>
|
|
1061
1015
|
|
|
@@ -1075,9 +1029,9 @@ The startup and completion status of the recording will be notified through loca
|
|
|
1075
1029
|
|
|
1076
1030
|
> **Note**
|
|
1077
1031
|
>
|
|
1078
|
-
|
|
1079
1032
|
> 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 TRTCCloudDelegate .
|
|
1080
1033
|
>
|
|
1034
|
+
|
|
1081
1035
|
**Return Desc:**
|
|
1082
1036
|
|
|
1083
1037
|
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.
|
|
@@ -1139,10 +1093,8 @@ Update self position and orientation in the world coordinate system. The SDK wil
|
|
|
1139
1093
|
|
|
1140
1094
|
> **Note**
|
|
1141
1095
|
>
|
|
1142
|
-
|
|
1143
1096
|
> 1. The length of array should be 3.
|
|
1144
1097
|
>
|
|
1145
|
-
|
|
1146
1098
|
> 2. Please limit the calling frequency appropriately. It's recommended that the interval between two operations be at least 100ms.
|
|
1147
1099
|
>
|
|
1148
1100
|
|
|
@@ -1159,10 +1111,8 @@ Update the specified remote user's position in the world coordinate system. The
|
|
|
1159
1111
|
|
|
1160
1112
|
> **Note**
|
|
1161
1113
|
>
|
|
1162
|
-
|
|
1163
1114
|
> 1. The length of array should be 3.
|
|
1164
1115
|
>
|
|
1165
|
-
|
|
1166
1116
|
> 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.
|
|
1167
1117
|
>
|
|
1168
1118
|
|
|
@@ -1209,7 +1159,7 @@ beauty filter management class TXBeautyManager.
|
|
|
1209
1159
|
|
|
1210
1160
|
**Add watermark.**
|
|
1211
1161
|
|
|
1212
|
-
The watermark position is determined by the
|
|
1162
|
+
The watermark position is determined by the `rect` parameter, which is a quadruple in the format of (x, y, width, height).
|
|
1213
1163
|
- x: X coordinate of watermark, which is a floating-point number between 0 and 1.
|
|
1214
1164
|
|
|
1215
1165
|
- y: Y coordinate of watermark, which is a floating-point number between 0 and 1.
|
|
@@ -1220,27 +1170,26 @@ The watermark position is determined by the ` rect ` parameter, which is a quadr
|
|
|
1220
1170
|
|
|
1221
1171
|
Sample parameter:
|
|
1222
1172
|
|
|
1223
|
-
If the encoding resolution of the current video is 540x960, and the
|
|
1173
|
+
If the encoding resolution of the current video is 540x960, and the `rect` parameter is set to (0.1, 0.1, 0.2, 0.0),
|
|
1224
1174
|
|
|
1225
|
-
then the coordinates of the top-left point of the watermark will be (540 * 0.1, 960 * 0.1), i.e., (54, 96), the watermark width will be
|
|
1175
|
+
then the coordinates of the top-left point of the watermark will be (540 * 0.1, 960 * 0.1), i.e., (54, 96), the watermark width will be `540 * 0.2 = 108 px` , and the watermark height will be calculated automatically by the SDK based on the watermark image's aspect ratio.
|
|
1226
1176
|
|
|
1227
1177
|
|Param|DESC|
|
|
1228
1178
|
|---------|---------|
|
|
1229
1179
|
|image|Watermark image, which must be a PNG image with transparent background|
|
|
1230
|
-
|rect|Unified coordinates of the watermark relative to the encoded resolution. Value range of
|
|
1180
|
+
|rect|Unified coordinates of the watermark relative to the encoded resolution. Value range of `x` , `y` , `width` , and `height` : 0–1.|
|
|
1231
1181
|
|streamType|Specify for which image to set the watermark. For more information, please see TRTCVideoStreamType.|
|
|
1232
1182
|
|
|
1233
1183
|
> **Note**
|
|
1234
1184
|
>
|
|
1235
|
-
|
|
1236
|
-
> If you want to set watermarks for both the primary image (generally for the camera) and the substream image (generally for screen sharing), you need to call this API twice with ` streamType ` set to different values.
|
|
1185
|
+
> If you want to set watermarks for both the primary image (generally for the camera) and the substream image (generally for screen sharing), you need to call this API twice with `streamType` set to different values.
|
|
1237
1186
|
>
|
|
1238
1187
|
|
|
1239
1188
|
## getAudioEffectManager
|
|
1240
1189
|
|
|
1241
1190
|
**Get sound effect management class (TXAudioEffectManager).**
|
|
1242
1191
|
|
|
1243
|
-
`
|
|
1192
|
+
`TXAudioEffectManager` is a sound effect management API, through which you can implement the following features:
|
|
1244
1193
|
- 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.
|
|
1245
1194
|
|
|
1246
1195
|
- 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.
|
|
@@ -1249,7 +1198,7 @@ then the coordinates of the top-left point of the watermark will be (540 * 0.1,
|
|
|
1249
1198
|
|
|
1250
1199
|
- Voice changing effect: young girl, middle-aged man, heavy metal, and other effects.
|
|
1251
1200
|
|
|
1252
|
-
- 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
|
|
1201
|
+
- 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 `YES` ).
|
|
1253
1202
|
**Return Desc:**
|
|
1254
1203
|
|
|
1255
1204
|
sound effect management class TXAudioEffectManager.
|
|
@@ -1264,11 +1213,9 @@ In use cases such as video teaching or music live streaming, the teacher can use
|
|
|
1264
1213
|
|
|
1265
1214
|
> **Note**
|
|
1266
1215
|
>
|
|
1267
|
-
|
|
1268
1216
|
> 1. This feature needs to install a virtual audio device plugin on the user's macOS system. After the installation is completed, the SDK will capture sound from the installed virtual device.
|
|
1269
1217
|
>
|
|
1270
|
-
|
|
1271
|
-
> 2. The SDK will automatically download the appropriate plugin from the internet for installation, but the download may be slow. If you want to speed up this process, you can package the virtual audio plugin file into the ` Resources ` directory of your app bundle.
|
|
1218
|
+
> 2. The SDK will automatically download the appropriate plugin from the internet for installation, but the download may be slow. If you want to speed up this process, you can package the virtual audio plugin file into the `Resources` directory of your app bundle.
|
|
1272
1219
|
>
|
|
1273
1220
|
|
|
1274
1221
|
## stopSystemAudioLoopback
|
|
@@ -1310,7 +1257,7 @@ Video encoding parameters recommended for screen sharing on iPhone (TRTCVideoEnc
|
|
|
1310
1257
|
|
|
1311
1258
|
|Param|DESC|
|
|
1312
1259
|
|---------|---------|
|
|
1313
|
-
|encParams|Video encoding parameters for screen sharing. We recommend you use the above configuration.If you set
|
|
1260
|
+
|encParams|Video encoding parameters for screen sharing. We recommend you use the above configuration.If you set `encParams` to `nil` , the SDK will use the video encoding parameters you set before calling the startScreenCapture API.|
|
|
1314
1261
|
|streamType|Channel used for screen sharing, which can be the primary stream (TRTCVideoStreamTypeBig) or substream (TRTCVideoStreamTypeSub).|
|
|
1315
1262
|
|
|
1316
1263
|
## startScreenCaptureByReplaykit:encParam:appGroup:
|
|
@@ -1334,8 +1281,8 @@ Video encoding parameters recommended for screen sharing on iPhone (TRTCVideoEnc
|
|
|
1334
1281
|
|
|
1335
1282
|
| Param | DESC |
|
|
1336
1283
|
| --- | --- |
|
|
1337
|
-
| appGroup | Specify the
|
|
1338
|
-
| encParams | Video encoding parameters for screen sharing. We recommend you use the above configuration.<br>If you set
|
|
1284
|
+
| appGroup | Specify the <code>Application Group Identifier</code> shared by your application and the screen sharing process. You can specify this parameter as <code>nil</code> , but we recommend you set it as instructed in the documentation for higher reliability. |
|
|
1285
|
+
| encParams | Video encoding parameters for screen sharing. We recommend you use the above configuration.<br>If you set <code>encParams</code> to <code>nil</code> , the SDK will use the video encoding parameters you set before calling the <code>startScreenCapture</code> API. |
|
|
1339
1286
|
| streamType | Channel used for screen sharing, which can be the primary stream (TRTCVideoStreamTypeBig) or substream (TRTCVideoStreamTypeSub). |
|
|
1340
1287
|
|
|
1341
1288
|
## startScreenCapture:streamType:encParam:
|
|
@@ -1352,17 +1299,13 @@ This API can capture the content of the entire screen or a specified application
|
|
|
1352
1299
|
|
|
1353
1300
|
> **Note**
|
|
1354
1301
|
>
|
|
1355
|
-
|
|
1356
1302
|
> 1. A user can publish at most one primary stream (TRTCVideoStreamTypeBig) and one substream (TRTCVideoStreamTypeSub) at the same time.
|
|
1357
1303
|
>
|
|
1358
|
-
|
|
1359
1304
|
> 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.
|
|
1360
1305
|
>
|
|
1361
|
-
|
|
1362
1306
|
> 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.
|
|
1363
1307
|
>
|
|
1364
|
-
|
|
1365
|
-
> 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 TRTCCloudDelegate.
|
|
1308
|
+
> 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 TRTCCloudDelegate.
|
|
1366
1309
|
>
|
|
1367
1310
|
|
|
1368
1311
|
## stopScreenCapture
|
|
@@ -1375,7 +1318,6 @@ This API can capture the content of the entire screen or a specified application
|
|
|
1375
1318
|
|
|
1376
1319
|
> **Note**
|
|
1377
1320
|
>
|
|
1378
|
-
|
|
1379
1321
|
> Begin from v11.5 version, paused screen capture will use the last frame to output at a frame rate of 1fps.
|
|
1380
1322
|
>
|
|
1381
1323
|
|
|
@@ -1398,9 +1340,9 @@ Through this API, you can query the IDs, names, and thumbnails of sharable windo
|
|
|
1398
1340
|
|
|
1399
1341
|
> **Note**
|
|
1400
1342
|
>
|
|
1401
|
-
|
|
1402
1343
|
> 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.
|
|
1403
1344
|
>
|
|
1345
|
+
|
|
1404
1346
|
**Return Desc:**
|
|
1405
1347
|
|
|
1406
1348
|
List of windows (including the screen)
|
|
@@ -1417,7 +1359,7 @@ During the screen sharing process, you can also call this API at any time to swi
|
|
|
1417
1359
|
|---------|---------|
|
|
1418
1360
|
|capturesCursor|Whether to capture mouse cursor|
|
|
1419
1361
|
|highlight|Whether to highlight the window being shared|
|
|
1420
|
-
|rect|Specify the area to be captured (set this parameter to
|
|
1362
|
+
|rect|Specify the area to be captured (set this parameter to `CGRectZero` : when the sharing target is a window, the entire window will be shared, and when the sharing target is the desktop, the entire desktop will be shared)|
|
|
1421
1363
|
|screenSource|Specify sharing source|
|
|
1422
1364
|
|
|
1423
1365
|
## setSubStreamEncoderParam:
|
|
@@ -1427,9 +1369,9 @@ During the screen sharing process, you can also call this API at any time to swi
|
|
|
1427
1369
|
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.
|
|
1428
1370
|
|
|
1429
1371
|
Please note the differences between the following two APIs:
|
|
1430
|
-
-
|
|
1372
|
+
- setVideoEncoderParam is used to set the video encoding parameters of the primary stream image (TRTCVideoStreamTypeBig, generally for camera).
|
|
1431
1373
|
|
|
1432
|
-
-
|
|
1374
|
+
- setSubStreamEncoderParam is used to set the video encoding parameters of the substream image (TRTCVideoStreamTypeSub, generally for screen sharing).
|
|
1433
1375
|
|
|
1434
1376
|
|Param|DESC|
|
|
1435
1377
|
|---------|---------|
|
|
@@ -1459,14 +1401,11 @@ You can set the filtered windows before starting screen sharing or dynamically a
|
|
|
1459
1401
|
|
|
1460
1402
|
> **Note**
|
|
1461
1403
|
>
|
|
1462
|
-
|
|
1463
|
-
> 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.
|
|
1404
|
+
> 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.
|
|
1464
1405
|
>
|
|
1465
|
-
|
|
1466
1406
|
> 2. The windows added to the exclusion list through this API will be automatically cleared by the SDK after room exit.
|
|
1467
1407
|
>
|
|
1468
|
-
|
|
1469
|
-
> 3. On macOS, please pass in the window ID (CGWindowID), which can be obtained through the ` sourceId ` member in TRTCScreenCaptureSourceInfo.
|
|
1408
|
+
> 3. On macOS, please pass in the window ID (CGWindowID), which can be obtained through the `sourceId` member in TRTCScreenCaptureSourceInfo.
|
|
1470
1409
|
>
|
|
1471
1410
|
|
|
1472
1411
|
## removeExcludedShareWindow:
|
|
@@ -1485,17 +1424,16 @@ You can set the filtered windows before starting screen sharing or dynamically a
|
|
|
1485
1424
|
|
|
1486
1425
|
**Add specified windows to the inclusion list of screen sharing (for desktop systems only).**
|
|
1487
1426
|
|
|
1488
|
-
This API takes effect only if the
|
|
1427
|
+
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.
|
|
1489
1428
|
|
|
1490
1429
|
You can call it before or after startScreenCapture.
|
|
1491
1430
|
|
|
1492
1431
|
|Param|DESC|
|
|
1493
1432
|
|---------|---------|
|
|
1494
|
-
|windowID|Window to be shared (which is a window handle
|
|
1433
|
+
|windowID|Window to be shared (which is a window handle `HWND` on Windows)|
|
|
1495
1434
|
|
|
1496
1435
|
> **Note**
|
|
1497
1436
|
>
|
|
1498
|
-
|
|
1499
1437
|
> The windows added to the inclusion list by this method will be automatically cleared by the SDK after room exit.
|
|
1500
1438
|
>
|
|
1501
1439
|
|
|
@@ -1503,7 +1441,7 @@ You can call it before or after startScreenCapture.
|
|
|
1503
1441
|
|
|
1504
1442
|
**Remove specified windows from the inclusion list of screen sharing (for desktop systems only).**
|
|
1505
1443
|
|
|
1506
|
-
This API takes effect only if the
|
|
1444
|
+
This API takes effect only if the `type` in TRTCScreenCaptureSourceInfo is specified as TRTCScreenCaptureSourceTypeWindow.
|
|
1507
1445
|
|
|
1508
1446
|
That is, the feature of additionally including specified windows works only when a window is shared.
|
|
1509
1447
|
|
|
@@ -1515,7 +1453,7 @@ That is, the feature of additionally including specified windows works only when
|
|
|
1515
1453
|
|
|
1516
1454
|
**Remove all windows from the inclusion list of screen sharing (for desktop systems only).**
|
|
1517
1455
|
|
|
1518
|
-
This API takes effect only if the
|
|
1456
|
+
This API takes effect only if the `type` in TRTCScreenCaptureSourceInfo is specified as TRTCScreenCaptureSourceTypeWindow.
|
|
1519
1457
|
|
|
1520
1458
|
That is, the feature of additionally including specified windows works only when a window is shared.
|
|
1521
1459
|
|
|
@@ -1545,30 +1483,27 @@ We recommend you enter the following information for the TRTCVideoFrame paramete
|
|
|
1545
1483
|
|
|
1546
1484
|
- pixelBuffer: common video data format on iOS/macOS.
|
|
1547
1485
|
|
|
1548
|
-
- data: raw video data format, which is used if
|
|
1486
|
+
- data: raw video data format, which is used if `bufferType` is `NSData` .
|
|
1549
1487
|
|
|
1550
1488
|
- timestamp (ms): Set it to the timestamp when video frames are captured, which you can obtain by calling generateCustomPTS after getting a video frame.
|
|
1551
1489
|
|
|
1552
|
-
- width: video image length, which needs to be set if
|
|
1490
|
+
- width: video image length, which needs to be set if `bufferType` is `NSData` .
|
|
1553
1491
|
|
|
1554
|
-
- height: video image width, which needs to be set if
|
|
1492
|
+
- height: video image width, which needs to be set if `bufferType` is `NSData` .
|
|
1555
1493
|
|
|
1556
1494
|
For more information, please see [Custom Capturing and Rendering](https://www.tencentcloud.com/document/product/647/35158).
|
|
1557
1495
|
|
|
1558
1496
|
|Param|DESC|
|
|
1559
1497
|
|---------|---------|
|
|
1560
|
-
|frame|Video data. For
|
|
1498
|
+
|frame|Video data. For `bufferType` , TRTCVideoBufferType_PixelBuffer is recommended; for `pixelFormat` , TRTCVideoPixelFormat_NV12 is recommended. Refer to TRTCVideoFrame for more supported formats.|
|
|
1561
1499
|
|streamType|Specify video stream type (TRTCVideoStreamTypeBig: HD big image; TRTCVideoStreamTypeSub: substream image).|
|
|
1562
1500
|
|
|
1563
1501
|
> **Note**
|
|
1564
1502
|
>
|
|
1565
|
-
|
|
1566
|
-
> 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.
|
|
1503
|
+
> 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.
|
|
1567
1504
|
>
|
|
1568
|
-
|
|
1569
1505
|
> 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.
|
|
1570
1506
|
>
|
|
1571
|
-
|
|
1572
1507
|
> 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.
|
|
1573
1508
|
>
|
|
1574
1509
|
|
|
@@ -1586,7 +1521,6 @@ You need to use sendCustomAudioData to continuously insert the captured audio da
|
|
|
1586
1521
|
|
|
1587
1522
|
> **Note**
|
|
1588
1523
|
>
|
|
1589
|
-
|
|
1590
1524
|
> As acoustic echo cancellation (AEC) requires strict control over the audio capturing and playback time, after custom audio capturing is enabled, AEC may fail.
|
|
1591
1525
|
>
|
|
1592
1526
|
|
|
@@ -1595,7 +1529,7 @@ You need to use sendCustomAudioData to continuously insert the captured audio da
|
|
|
1595
1529
|
**Deliver captured audio data to SDK.**
|
|
1596
1530
|
|
|
1597
1531
|
We recommend you enter the following information for the TRTCAudioFrame parameter (other fields can be left empty):
|
|
1598
|
-
- audioFormat: audio data format, which can only be
|
|
1532
|
+
- audioFormat: audio data format, which can only be `TRTCAudioFrameFormatPCM` .
|
|
1599
1533
|
|
|
1600
1534
|
- 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`.**
|
|
1601
1535
|
|
|
@@ -1613,7 +1547,6 @@ For more information, please see [Custom Capturing and Rendering](https://www.te
|
|
|
1613
1547
|
|
|
1614
1548
|
> **Note**
|
|
1615
1549
|
>
|
|
1616
|
-
|
|
1617
1550
|
> Please call this API accurately at intervals of the frame length; otherwise, sound lag may occur due to uneven data delivery intervals.
|
|
1618
1551
|
>
|
|
1619
1552
|
|
|
@@ -1630,8 +1563,7 @@ After this feature is enabled, you can mix a custom audio track into the SDK thr
|
|
|
1630
1563
|
|
|
1631
1564
|
> **Note**
|
|
1632
1565
|
>
|
|
1633
|
-
|
|
1634
|
-
> If you specify both ` enablePublish ` and ` enablePlayout ` as ` NO `, the custom audio track will be completely closed.
|
|
1566
|
+
> If you specify both `enablePublish` and `enablePlayout` as `NO` , the custom audio track will be completely closed.
|
|
1635
1567
|
>
|
|
1636
1568
|
|
|
1637
1569
|
## mixExternalAudioFrame:
|
|
@@ -1644,25 +1576,25 @@ You are expected to feed audio data into the SDK at an even pace, but we underst
|
|
|
1644
1576
|
|
|
1645
1577
|
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.
|
|
1646
1578
|
|
|
1647
|
-
The value returned by this API indicates the size (ms) of the buffer pool. For example, if
|
|
1579
|
+
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.
|
|
1648
1580
|
|
|
1649
|
-
If the value returned is
|
|
1581
|
+
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.
|
|
1650
1582
|
|
|
1651
1583
|
Fill the fields in TRTCAudioFrame as follows (other fields are not required).
|
|
1652
|
-
-
|
|
1584
|
+
- `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**.
|
|
1653
1585
|
|
|
1654
|
-
-
|
|
1586
|
+
- `sampleRate` : sample rate. Valid values: 16000, 24000, 32000, 44100, 48000
|
|
1655
1587
|
|
|
1656
|
-
-
|
|
1588
|
+
- `channel` : number of sound channels (if dual-channel is used, data is interleaved). Valid values: `1` (mono-channel); `2` (dual channel)
|
|
1657
1589
|
|
|
1658
|
-
-
|
|
1590
|
+
- `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.
|
|
1659
1591
|
|
|
1660
1592
|
|Param|DESC|
|
|
1661
1593
|
|---------|---------|
|
|
1662
1594
|
|frame|Audio data|
|
|
1663
1595
|
**Return Desc:**
|
|
1664
1596
|
|
|
1665
|
-
If the value returned is
|
|
1597
|
+
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.
|
|
1666
1598
|
|
|
1667
1599
|
## setMixExternalAudioVolume:playoutVolume:
|
|
1668
1600
|
|
|
@@ -1685,7 +1617,7 @@ When you call APIs such as sendCustomVideoData or sendCustomAudioData for custom
|
|
|
1685
1617
|
|
|
1686
1618
|
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).
|
|
1687
1619
|
|
|
1688
|
-
3. When you actually call sendCustomVideoData or sendCustomAudioData for delivery, assign the PTS timestamp recorded when the frame was captured to the
|
|
1620
|
+
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:**
|
|
1689
1621
|
|
|
1690
1622
|
Timestamp in ms
|
|
1691
1623
|
|
|
@@ -1693,7 +1625,7 @@ Timestamp in ms
|
|
|
1693
1625
|
|
|
1694
1626
|
**Set video data callback for third-party beauty filters.**
|
|
1695
1627
|
|
|
1696
|
-
After this callback is set, the SDK will call back the captured video frames through the
|
|
1628
|
+
After this callback is set, the SDK will call back the captured video frames through the `delegate` 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.
|
|
1697
1629
|
|
|
1698
1630
|
|Param|DESC|
|
|
1699
1631
|
|---------|---------|
|
|
@@ -1709,15 +1641,15 @@ After this callback is set, the SDK will call back the captured video frames thr
|
|
|
1709
1641
|
**Set the callback of custom rendering for local video.**
|
|
1710
1642
|
|
|
1711
1643
|
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.
|
|
1712
|
-
-
|
|
1644
|
+
- `pixelFormat` specifies the format of the called back data, such as NV12, I420, and 32BGRA.
|
|
1713
1645
|
|
|
1714
|
-
-
|
|
1646
|
+
- `bufferType` specifies the buffer type. `PixelBuffer` has the highest efficiency, while `NSData` makes the SDK perform a memory conversion internally, which will result in extra performance loss.
|
|
1715
1647
|
|
|
1716
1648
|
For more information, please see [Custom Capturing and Rendering](https://www.tencentcloud.com/document/product/647/35158).
|
|
1717
1649
|
|
|
1718
1650
|
|Param|DESC|
|
|
1719
1651
|
|---------|---------|
|
|
1720
|
-
|bufferType|PixelBuffer: this can be directly converted to
|
|
1652
|
+
|bufferType|PixelBuffer: this can be directly converted to `UIImage` by using `imageWithCVImageBuffer` ; NSData: this is memory-mapped video data.|
|
|
1721
1653
|
|delegate|Callback for custom rendering|
|
|
1722
1654
|
|pixelFormat|Specify the format of the pixel called back|
|
|
1723
1655
|
**Return Desc:**
|
|
@@ -1729,24 +1661,24 @@ For more information, please see [Custom Capturing and Rendering](https://www.te
|
|
|
1729
1661
|
**Set the callback of custom rendering for remote video.**
|
|
1730
1662
|
|
|
1731
1663
|
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.
|
|
1732
|
-
-
|
|
1664
|
+
- `pixelFormat` specifies the format of the called back data, such as NV12, I420, and 32BGRA.
|
|
1733
1665
|
|
|
1734
|
-
-
|
|
1666
|
+
- `bufferType` specifies the buffer type. `PixelBuffer` has the highest efficiency, while `NSData` makes the SDK perform a memory conversion internally, which will result in extra performance loss.
|
|
1735
1667
|
|
|
1736
1668
|
For more information, please see [Custom Capturing and Rendering](https://www.tencentcloud.com/document/product/647/35158).
|
|
1737
1669
|
|
|
1738
1670
|
|Param|DESC|
|
|
1739
1671
|
|---------|---------|
|
|
1740
|
-
|bufferType|PixelBuffer: this can be directly converted to
|
|
1672
|
+
|bufferType|PixelBuffer: this can be directly converted to `UIImage` by using `imageWithCVImageBuffer` ; NSData: this is memory-mapped video data.|
|
|
1741
1673
|
|delegate|Callback for custom rendering|
|
|
1742
1674
|
|pixelFormat|Specify the format of the pixel called back|
|
|
1743
1675
|
|userId|ID of the specified remote user|
|
|
1744
1676
|
|
|
1745
1677
|
> **Note**
|
|
1746
1678
|
>
|
|
1747
|
-
|
|
1748
|
-
> Before this API is called, ` startRemoteView(nil) ` needs to be called to get the video stream of the remote user (` view ` can be set to ` nil ` for this end); otherwise, there will be no data called back.
|
|
1679
|
+
> Before this API is called, `startRemoteView(nil)` needs to be called to get the video stream of the remote user ( `view` can be set to `nil` for this end); otherwise, there will be no data called back.
|
|
1749
1680
|
>
|
|
1681
|
+
|
|
1750
1682
|
**Return Desc:**
|
|
1751
1683
|
|
|
1752
1684
|
0: success; values smaller than 0: error
|
|
@@ -1756,17 +1688,16 @@ For more information, please see [Custom Capturing and Rendering](https://www.te
|
|
|
1756
1688
|
**Set custom audio data callback.**
|
|
1757
1689
|
|
|
1758
1690
|
After this callback is set, the SDK will internally call back the audio data (in PCM format), including:
|
|
1759
|
-
-
|
|
1691
|
+
- onCapturedAudioFrame: callback of the audio data captured by the local mic
|
|
1760
1692
|
|
|
1761
|
-
-
|
|
1693
|
+
- onLocalProcessedAudioFrame: callback of the audio data captured by the local mic and preprocessed by the audio module
|
|
1762
1694
|
|
|
1763
|
-
-
|
|
1695
|
+
- onRemoteUserAudioFrame: audio data from each remote user before audio mixing
|
|
1764
1696
|
|
|
1765
|
-
-
|
|
1697
|
+
- onMixedPlayAudioFrame: callback of the audio data that will be played back by the system after audio streams are mixed
|
|
1766
1698
|
|
|
1767
1699
|
> **Note**
|
|
1768
1700
|
>
|
|
1769
|
-
|
|
1770
1701
|
> 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.
|
|
1771
1702
|
>
|
|
1772
1703
|
|
|
@@ -1774,7 +1705,7 @@ After this callback is set, the SDK will internally call back the audio data (in
|
|
|
1774
1705
|
|
|
1775
1706
|
**Set the callback format of audio frames captured by local mic.**
|
|
1776
1707
|
|
|
1777
|
-
This API is used to set the
|
|
1708
|
+
This API is used to set the `AudioFrame` format called back by onCapturedAudioFrame:
|
|
1778
1709
|
- sampleRate: sample rate. Valid values: 16000, 32000, 44100, 48000
|
|
1779
1710
|
|
|
1780
1711
|
- channel: number of channels (if stereo is used, data is interwoven). Valid values: 1: mono channel; 2: dual channel
|
|
@@ -1783,11 +1714,11 @@ This API is used to set the ` AudioFrame ` format called back by onCapturedAudio
|
|
|
1783
1714
|
|
|
1784
1715
|
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
|
|
1785
1716
|
|
|
1786
|
-
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
|
|
1717
|
+
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` .
|
|
1787
1718
|
|
|
1788
|
-
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:
|
|
1719
|
+
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)`
|
|
1789
1720
|
|
|
1790
|
-
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
|
|
1721
|
+
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`
|
|
1791
1722
|
|
|
1792
1723
|
|Param|DESC|
|
|
1793
1724
|
|---------|---------|
|
|
@@ -1800,20 +1731,20 @@ For example, if the parameters are 48000 sample rate, dual channel, 20 ms frame
|
|
|
1800
1731
|
|
|
1801
1732
|
**Set the callback format of preprocessed local audio frames.**
|
|
1802
1733
|
|
|
1803
|
-
This API is used to set the
|
|
1734
|
+
This API is used to set the `AudioFrame` format called back by onLocalProcessedAudioFrame:
|
|
1804
1735
|
- sampleRate: sample rate. Valid values: 16000, 32000, 44100, 48000
|
|
1805
1736
|
|
|
1806
1737
|
- channel: number of channels (if stereo is used, data is interwoven). Valid values: 1: mono channel; 2: dual channel
|
|
1807
1738
|
|
|
1808
1739
|
- 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.
|
|
1809
1740
|
|
|
1810
|
-
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:
|
|
1741
|
+
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` .
|
|
1811
1742
|
|
|
1812
|
-
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
|
|
1743
|
+
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` .
|
|
1813
1744
|
|
|
1814
|
-
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:
|
|
1745
|
+
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)` .
|
|
1815
1746
|
|
|
1816
|
-
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
|
|
1747
|
+
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` .
|
|
1817
1748
|
|
|
1818
1749
|
|Param|DESC|
|
|
1819
1750
|
|---------|---------|
|
|
@@ -1826,20 +1757,20 @@ For example, if the parameters are 48000 sample rate, dual channel, 20 ms frame
|
|
|
1826
1757
|
|
|
1827
1758
|
**Set the callback format of audio frames to be played back by system.**
|
|
1828
1759
|
|
|
1829
|
-
This API is used to set the
|
|
1760
|
+
This API is used to set the `AudioFrame` format called back by onMixedPlayAudioFrame:
|
|
1830
1761
|
- sampleRate: sample rate. Valid values: 16000, 32000, 44100, 48000
|
|
1831
1762
|
|
|
1832
1763
|
- channel: number of channels (if stereo is used, data is interwoven). Valid values: 1: mono channel; 2: dual channel
|
|
1833
1764
|
|
|
1834
1765
|
- 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.
|
|
1835
1766
|
|
|
1836
|
-
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:
|
|
1767
|
+
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` .
|
|
1837
1768
|
|
|
1838
|
-
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
|
|
1769
|
+
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` .
|
|
1839
1770
|
|
|
1840
|
-
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:
|
|
1771
|
+
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)` .
|
|
1841
1772
|
|
|
1842
|
-
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
|
|
1773
|
+
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` .
|
|
1843
1774
|
|
|
1844
1775
|
|Param|DESC|
|
|
1845
1776
|
|---------|---------|
|
|
@@ -1862,7 +1793,6 @@ After you enable custom audio playback, the SDK will stop using its audio API to
|
|
|
1862
1793
|
|
|
1863
1794
|
> **Note**
|
|
1864
1795
|
>
|
|
1865
|
-
|
|
1866
1796
|
> The parameter must be set before room entry to take effect.
|
|
1867
1797
|
>
|
|
1868
1798
|
|
|
@@ -1873,15 +1803,15 @@ After you enable custom audio playback, the SDK will stop using its audio API to
|
|
|
1873
1803
|
Before calling this API, you need to first enable custom audio playback using enableCustomAudioRendering.
|
|
1874
1804
|
|
|
1875
1805
|
Fill the fields in TRTCAudioFrame as follows (other fields are not required):
|
|
1876
|
-
-
|
|
1806
|
+
- `sampleRate` : sample rate (required). Valid values: 16000, 24000, 32000, 44100, 48000
|
|
1877
1807
|
|
|
1878
|
-
-
|
|
1808
|
+
- `channel` : number of sound channels (required). `1` : mono-channel; `2` : dual-channel; if dual-channel is used, data is interleaved.
|
|
1879
1809
|
|
|
1880
|
-
-
|
|
1810
|
+
- `data` : the buffer used to get audio data. You need to allocate memory for the buffer based on the duration of an audio frame.
|
|
1881
1811
|
|
|
1882
1812
|
The PCM data obtained can have a frame duration of 10 ms or 20 ms. 20 ms is recommended.
|
|
1883
1813
|
|
|
1884
|
-
Assume that the sample rate is 48000, and sound channels mono-channel. The buffer size for a 20 ms audio frame would be
|
|
1814
|
+
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` .
|
|
1885
1815
|
|
|
1886
1816
|
|Param|DESC|
|
|
1887
1817
|
|---------|---------|
|
|
@@ -1889,13 +1819,10 @@ Assume that the sample rate is 48000, and sound channels mono-channel. The buffe
|
|
|
1889
1819
|
|
|
1890
1820
|
> **Note**
|
|
1891
1821
|
>
|
|
1892
|
-
|
|
1893
|
-
> 1. You must set ` sampleRate ` and ` channel ` in ` audioFrame `, and allocate memory for one frame of audio in advance.
|
|
1822
|
+
> 1. You must set `sampleRate` and `channel` in `audioFrame` , and allocate memory for one frame of audio in advance.
|
|
1894
1823
|
>
|
|
1895
|
-
|
|
1896
|
-
> 2. The SDK will fill the data automatically based on ` sampleRate ` and ` channel `.
|
|
1824
|
+
> 2. The SDK will fill the data automatically based on `sampleRate` and `channel` .
|
|
1897
1825
|
>
|
|
1898
|
-
|
|
1899
1826
|
> 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.
|
|
1900
1827
|
>
|
|
1901
1828
|
|
|
@@ -1905,7 +1832,7 @@ Assume that the sample rate is 48000, and sound channels mono-channel. The buffe
|
|
|
1905
1832
|
|
|
1906
1833
|
This API allows you to use TRTC's UDP channel to broadcast custom data to other users in the current room for signaling transfer.
|
|
1907
1834
|
|
|
1908
|
-
Other users in the room can receive the message through the
|
|
1835
|
+
Other users in the room can receive the message through the `onRecvCustomCmdMsg` callback in TRTCCloudDelegate.
|
|
1909
1836
|
|
|
1910
1837
|
|Param|DESC|
|
|
1911
1838
|
|---------|---------|
|
|
@@ -1916,24 +1843,19 @@ Other users in the room can receive the message through the ` onRecvCustomCmdMsg
|
|
|
1916
1843
|
|
|
1917
1844
|
> **Note**
|
|
1918
1845
|
>
|
|
1919
|
-
|
|
1920
1846
|
> 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).
|
|
1921
1847
|
>
|
|
1922
|
-
|
|
1923
1848
|
> 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).
|
|
1924
1849
|
>
|
|
1925
|
-
|
|
1926
1850
|
> 3. A client can send up to 16 KB of data in total per second.
|
|
1927
1851
|
>
|
|
1928
|
-
|
|
1929
|
-
> 4. ` reliable ` and ` ordered ` must be set to the same value (` YES ` or ` NO `) and cannot be set to different values currently.
|
|
1852
|
+
> 4. `reliable` and `ordered` must be set to the same value ( `YES` or `NO` ) and cannot be set to different values currently.
|
|
1930
1853
|
>
|
|
1931
|
-
|
|
1932
|
-
> 5. We strongly recommend you set different ` cmdID ` values for messages of different types. This can reduce message delay when orderly sending is required.
|
|
1854
|
+
> 5. We strongly recommend you set different `cmdID` values for messages of different types. This can reduce message delay when orderly sending is required.
|
|
1933
1855
|
>
|
|
1934
|
-
|
|
1935
1856
|
> 6. Currently only the anchor role is supported.
|
|
1936
1857
|
>
|
|
1858
|
+
|
|
1937
1859
|
**Return Desc:**
|
|
1938
1860
|
|
|
1939
1861
|
YES: sent the message successfully; NO: failed to send the message.
|
|
@@ -1952,7 +1874,7 @@ However, because the data block of the video frame header cannot be too large, w
|
|
|
1952
1874
|
|
|
1953
1875
|
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).
|
|
1954
1876
|
|
|
1955
|
-
Other users in the room can receive the message through the
|
|
1877
|
+
Other users in the room can receive the message through the `onRecvSEIMsg` callback in TRTCCloudDelegate.
|
|
1956
1878
|
|
|
1957
1879
|
|Param|DESC|
|
|
1958
1880
|
|---------|---------|
|
|
@@ -1961,27 +1883,21 @@ Other users in the room can receive the message through the ` onRecvSEIMsg ` cal
|
|
|
1961
1883
|
|
|
1962
1884
|
> **Note**
|
|
1963
1885
|
>
|
|
1964
|
-
|
|
1965
1886
|
> This API has the following restrictions:
|
|
1966
1887
|
>
|
|
1967
|
-
|
|
1968
1888
|
> 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.
|
|
1969
1889
|
>
|
|
1970
|
-
|
|
1971
1890
|
> 2. Up to 30 messages can be sent per second to all users in the room (this limit is shared with sendCustomCmdMsg).
|
|
1972
1891
|
>
|
|
1973
|
-
|
|
1974
1892
|
> 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.
|
|
1975
1893
|
>
|
|
1976
|
-
|
|
1977
1894
|
> 4. Each client can send up to 16 KB of data in total per second (this limit is shared with sendCustomCmdMsg).
|
|
1978
1895
|
>
|
|
1979
|
-
|
|
1980
|
-
> 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.
|
|
1896
|
+
> 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.
|
|
1981
1897
|
>
|
|
1982
|
-
|
|
1983
|
-
> 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.
|
|
1898
|
+
> 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.
|
|
1984
1899
|
>
|
|
1900
|
+
|
|
1985
1901
|
**Return Desc:**
|
|
1986
1902
|
|
|
1987
1903
|
YES: the message is allowed and will be sent with subsequent video frames; NO: the message is not allowed to be sent
|
|
@@ -1996,15 +1912,13 @@ YES: the message is allowed and will be sent with subsequent video frames; NO: t
|
|
|
1996
1912
|
|
|
1997
1913
|
> **Note**
|
|
1998
1914
|
>
|
|
1999
|
-
|
|
2000
1915
|
> 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).
|
|
2001
1916
|
>
|
|
2002
|
-
|
|
2003
1917
|
> 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.
|
|
2004
1918
|
>
|
|
2005
|
-
|
|
2006
1919
|
> 3. Only one network speed test task is allowed to run at the same time.
|
|
2007
1920
|
>
|
|
1921
|
+
|
|
2008
1922
|
**Return Desc:**
|
|
2009
1923
|
|
|
2010
1924
|
interface call result, <0: failure
|
|
@@ -2050,11 +1964,11 @@ If compression is disabled, logs will be stored in plaintext and can be read dir
|
|
|
2050
1964
|
**Set local log storage path.**
|
|
2051
1965
|
|
|
2052
1966
|
You can use this API to change the default storage path of the SDK's local logs, which is as follows:
|
|
2053
|
-
- Windows: C:/Users/[username]/AppData/Roaming/liteav/log, i.e., under
|
|
1967
|
+
- Windows: C:/Users/[username]/AppData/Roaming/liteav/log, i.e., under `%appdata%/liteav/log` .
|
|
2054
1968
|
|
|
2055
|
-
- iOS or macOS: under
|
|
1969
|
+
- iOS or macOS: under `sandbox Documents/log` .
|
|
2056
1970
|
|
|
2057
|
-
- Android: under
|
|
1971
|
+
- Android: under `/app directory/files/log/liteav/` .
|
|
2058
1972
|
|
|
2059
1973
|
|Param|DESC|
|
|
2060
1974
|
|---------|---------|
|
|
@@ -2062,7 +1976,6 @@ You can use this API to change the default storage path of the SDK's local logs,
|
|
|
2062
1976
|
|
|
2063
1977
|
> **Note**
|
|
2064
1978
|
>
|
|
2065
|
-
|
|
2066
1979
|
> 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.
|
|
2067
1980
|
>
|
|
2068
1981
|
|
|
@@ -2088,7 +2001,7 @@ This API is used to adjust the position of the dashboard in the video rendering
|
|
|
2088
2001
|
|
|
2089
2002
|
|Param|DESC|
|
|
2090
2003
|
|---------|---------|
|
|
2091
|
-
|margin|Inner margin of the dashboard. It should be noted that this is based on the percentage of
|
|
2004
|
+
|margin|Inner margin of the dashboard. It should be noted that this is based on the percentage of `parentView` . Value range: [0, 1]|
|
|
2092
2005
|
|userId|User ID|
|
|
2093
2006
|
|
|
2094
2007
|
## callExperimentalAPI:
|
|
@@ -2110,9 +2023,9 @@ After the user exits the room, the SDK will automatically close the private encr
|
|
|
2110
2023
|
|
|
2111
2024
|
> **Note**
|
|
2112
2025
|
>
|
|
2113
|
-
|
|
2114
2026
|
> 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.
|
|
2115
2027
|
>
|
|
2028
|
+
|
|
2116
2029
|
**Return Desc:**
|
|
2117
2030
|
|
|
2118
2031
|
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.
|