@tencent-rtc/mcp 1.2.9 → 1.3.0

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.
Files changed (54) hide show
  1. package/package.json +1 -1
  2. package/resource/doc/chatuikit/faq/common/server.md +44 -0
  3. package/resource/doc/chatuikit/faq/web_sdk/faq.md +57 -0
  4. package/resource/doc/livekit/vue/components/co-guest-panel.md +3 -3
  5. package/resource/doc/livekit/vue/components/live-view.md +4 -4
  6. package/resource/doc/livekit/vue/{components/live-list.md → live-list-integration.md} +7 -7
  7. package/resource/doc/livekit/vue/{components/live-player.md → live-player-desk-integration.md} +8 -8
  8. package/resource/doc/livekit/vue/live-player-h5-integration.md +269 -0
  9. package/resource/doc/livekit/vue/workflow.md +218 -0
  10. package/resource/doc/trtc/C++/ITRTCCloud.md +4119 -0
  11. package/resource/doc/trtc/C++/ITRTCStatistics.md +325 -0
  12. package/resource/doc/trtc/C++/ITXAudioEffectManager.md +1289 -0
  13. package/resource/doc/trtc/C++/ITXDeviceManager.md +1028 -0
  14. package/resource/doc/trtc/C++/TRTCCloudCallback.md +2650 -0
  15. package/resource/doc/trtc/C++/TRTCTypeDef.md +3600 -0
  16. package/resource/doc/trtc/C++/TXLiteAVCode.md +921 -0
  17. package/resource/doc/trtc/android/TRTCCloud.md +3782 -0
  18. package/resource/doc/trtc/android/TRTCCloudDef.md +3880 -0
  19. package/resource/doc/trtc/android/TRTCCloudListener.md +2431 -0
  20. package/resource/doc/trtc/android/TRTCStatistics.md +295 -0
  21. package/resource/doc/trtc/android/TXAudioEffectManager.md +1289 -0
  22. package/resource/doc/trtc/android/TXBeautyManager.md +979 -0
  23. package/resource/doc/trtc/android/TXDeviceManager.md +440 -0
  24. package/resource/doc/trtc/android/TXLiteAVCode.md +905 -0
  25. package/resource/doc/trtc/iOS/TRTCCloud.md +4238 -0
  26. package/resource/doc/trtc/iOS/TRTCCloudDef.md +3730 -0
  27. package/resource/doc/trtc/iOS/TRTCCloudDelegate.md +2531 -0
  28. package/resource/doc/trtc/iOS/TRTCStatistics.md +295 -0
  29. package/resource/doc/trtc/iOS/TXAudioEffectManager.md +1100 -0
  30. package/resource/doc/trtc/iOS/TXBeautyManager.md +985 -0
  31. package/resource/doc/trtc/iOS/TXDeviceManager.md +1024 -0
  32. package/resource/doc/trtc/iOS/TXLiteAVCode.md +928 -0
  33. package/tools/definitions/get_faq_def.js +4 -0
  34. package/tools/definitions/get_faq_def.js.map +1 -1
  35. package/tools/definitions/get_native_live_api_def.js +1 -1
  36. package/tools/definitions/get_trtc_native_api_def.js +16 -0
  37. package/tools/definitions/get_trtc_native_api_def.js.map +1 -0
  38. package/tools/definitions/get_web_live_uikit_component_detail_def.js +13 -8
  39. package/tools/definitions/get_web_live_uikit_component_detail_def.js.map +1 -1
  40. package/tools/definitions/get_web_live_uikit_integration_def.js +32 -0
  41. package/tools/definitions/get_web_live_uikit_integration_def.js.map +1 -0
  42. package/tools/index.js +6 -2
  43. package/tools/index.js.map +1 -1
  44. package/tools/live/get-web-live-uikit-integration.js +52 -0
  45. package/tools/live/get-web-live-uikit-integration.js.map +1 -0
  46. package/tools/trtc/get-trtc-native-api.js +31 -0
  47. package/tools/trtc/get-trtc-native-api.js.map +1 -0
  48. package/utils/generate-structured-result.js +34 -0
  49. package/utils/generate-structured-result.js.map +1 -0
  50. package/utils/handle-component-name.js +0 -8
  51. package/utils/handle-component-name.js.map +1 -1
  52. package/utils/report-cls-client.js +1 -1
  53. package/utils/report-es-client.js +1 -1
  54. /package/resource/doc/livekit/vue/{components/broadcast.md → live-pusher-integration.md} +0 -0
@@ -0,0 +1,2650 @@
1
+ # TRTC Real-Time Communication (TRTC SDK) Documentation
2
+ ## Overview
3
+ `TRTCCloudCallback.h` provides the event callback interface for TRTC Real-Time Communication (TRTC SDK) on C++.
4
+
5
+
6
+ ## ITRTCCloudCallback
7
+ <table>
8
+ <tr>
9
+ <td rowspan="1" colSpan="1" >Function List</td>
10
+
11
+ <td rowspan="1" colSpan="1" >Description</td>
12
+ </tr>
13
+
14
+ <tr>
15
+ <td rowspan="1" colSpan="1" >[onError](https://write.woa.com/document/87030021158866944)</td>
16
+
17
+ <td rowspan="1" colSpan="1" >Error event callback</td>
18
+ </tr>
19
+
20
+ <tr>
21
+ <td rowspan="1" colSpan="1" >[onWarning](https://write.woa.com/document/87030021158866944)</td>
22
+
23
+ <td rowspan="1" colSpan="1" >Warning event callback</td>
24
+ </tr>
25
+
26
+ <tr>
27
+ <td rowspan="1" colSpan="1" >[onEnterRoom](https://write.woa.com/document/87030021158866944)</td>
28
+
29
+ <td rowspan="1" colSpan="1" >Event callback for room entry success or failure</td>
30
+ </tr>
31
+
32
+ <tr>
33
+ <td rowspan="1" colSpan="1" >[onExitRoom](https://write.woa.com/document/87030021158866944)</td>
34
+
35
+ <td rowspan="1" colSpan="1" >Event callback for leaving the room</td>
36
+ </tr>
37
+
38
+ <tr>
39
+ <td rowspan="1" colSpan="1" >[onSwitchRole](https://write.woa.com/document/87030021158866944)</td>
40
+
41
+ <td rowspan="1" colSpan="1" >Event callback for switching roles</td>
42
+ </tr>
43
+
44
+ <tr>
45
+ <td rowspan="1" colSpan="1" >[onSwitchRoom](https://write.woa.com/document/87030021158866944)</td>
46
+
47
+ <td rowspan="1" colSpan="1" >Event callback for switching rooms result</td>
48
+ </tr>
49
+
50
+ <tr>
51
+ <td rowspan="1" colSpan="1" >[onConnectOtherRoom](https://write.woa.com/document/87030021158866944)</td>
52
+
53
+ <td rowspan="1" colSpan="1" >Event callback for cross-room communication request result</td>
54
+ </tr>
55
+
56
+ <tr>
57
+ <td rowspan="1" colSpan="1" >[onDisconnectOtherRoom](https://write.woa.com/document/87030021158866944)</td>
58
+
59
+ <td rowspan="1" colSpan="1" >Event callback for ending cross-room communication result</td>
60
+ </tr>
61
+
62
+ <tr>
63
+ <td rowspan="1" colSpan="1" >[onUpdateOtherRoomForwardMode](https://write.woa.com/document/87030021158866944)</td>
64
+
65
+ <td rowspan="1" colSpan="1" >Event callback for modifying cross-room broadcaster uplink capability result</td>
66
+ </tr>
67
+
68
+ <tr>
69
+ <td rowspan="1" colSpan="1" >[onRemoteUserEnterRoom](https://write.woa.com/document/87030021158866944)</td>
70
+
71
+ <td rowspan="1" colSpan="1" >A user has joined the current room</td>
72
+ </tr>
73
+
74
+ <tr>
75
+ <td rowspan="1" colSpan="1" >[onRemoteUserLeaveRoom](https://write.woa.com/document/87030021158866944)</td>
76
+
77
+ <td rowspan="1" colSpan="1" >A user has left the current room</td>
78
+ </tr>
79
+
80
+ <tr>
81
+ <td rowspan="1" colSpan="1" >[onUserVideoAvailable](https://write.woa.com/document/87030021158866944)</td>
82
+
83
+ <td rowspan="1" colSpan="1" >A remote user has started/stopped publishing the main video stream</td>
84
+ </tr>
85
+
86
+ <tr>
87
+ <td rowspan="1" colSpan="1" >[onUserSubStreamAvailable](https://write.woa.com/document/87030021158866944)</td>
88
+
89
+ <td rowspan="1" colSpan="1" >A remote user has started/stopped publishing the auxiliary video stream</td>
90
+ </tr>
91
+
92
+ <tr>
93
+ <td rowspan="1" colSpan="1" >[onUserAudioAvailable](https://write.woa.com/document/87030021158866944)</td>
94
+
95
+ <td rowspan="1" colSpan="1" >A remote user has started/stopped publishing their audio</td>
96
+ </tr>
97
+
98
+ <tr>
99
+ <td rowspan="1" colSpan="1" >[onFirstVideoFrame](https://write.woa.com/document/87030021158866944)</td>
100
+
101
+ <td rowspan="1" colSpan="1" >The SDK has started rendering the first frame of the local or remote user's video</td>
102
+ </tr>
103
+
104
+ <tr>
105
+ <td rowspan="1" colSpan="1" >[onFirstAudioFrame](https://write.woa.com/document/87030021158866944)</td>
106
+
107
+ <td rowspan="1" colSpan="1" >The SDK has started playing the remote user's first audio frame</td>
108
+ </tr>
109
+
110
+ <tr>
111
+ <td rowspan="1" colSpan="1" >[onSendFirstLocalVideoFrame](https://write.woa.com/document/87030021158866944)</td>
112
+
113
+ <td rowspan="1" colSpan="1" >The first local video frame has been published</td>
114
+ </tr>
115
+
116
+ <tr>
117
+ <td rowspan="1" colSpan="1" >[onSendFirstLocalAudioFrame](https://write.woa.com/document/87030021158866944)</td>
118
+
119
+ <td rowspan="1" colSpan="1" >The first local audio frame has been published</td>
120
+ </tr>
121
+
122
+ <tr>
123
+ <td rowspan="1" colSpan="1" >[onRemoteVideoStatusUpdated](https://write.woa.com/document/87030021158866944)</td>
124
+
125
+ <td rowspan="1" colSpan="1" >Event callback for remote video status changes</td>
126
+ </tr>
127
+
128
+ <tr>
129
+ <td rowspan="1" colSpan="1" >[onRemoteAudioStatusUpdated](https://write.woa.com/document/87030021158866944)</td>
130
+
131
+ <td rowspan="1" colSpan="1" >Event callback for remote audio status changes</td>
132
+ </tr>
133
+
134
+ <tr>
135
+ <td rowspan="1" colSpan="1" >[onUserVideoSizeChanged](https://write.woa.com/document/87030021158866944)</td>
136
+
137
+ <td rowspan="1" colSpan="1" >Callback for changes in user video size</td>
138
+ </tr>
139
+
140
+ <tr>
141
+ <td rowspan="1" colSpan="1" >[onNetworkQuality](https://write.woa.com/document/87030021158866944)</td>
142
+
143
+ <td rowspan="1" colSpan="1" >Real-time statistics callback for network quality</td>
144
+ </tr>
145
+
146
+ <tr>
147
+ <td rowspan="1" colSpan="1" >[onStatistics](https://write.woa.com/document/87030021158866944)</td>
148
+
149
+ <td rowspan="1" colSpan="1" >Real-time statistics callback for audio and video technical indicators</td>
150
+ </tr>
151
+
152
+ <tr>
153
+ <td rowspan="1" colSpan="1" >[onSpeedTestResult](https://write.woa.com/document/87030021158866944)</td>
154
+
155
+ <td rowspan="1" colSpan="1" >Callback for internet speed test results</td>
156
+ </tr>
157
+
158
+ <tr>
159
+ <td rowspan="1" colSpan="1" >[onConnectionLost](https://write.woa.com/document/87030021158866944)</td>
160
+
161
+ <td rowspan="1" colSpan="1" >The connection between the SDK and the cloud has been disconnected.</td>
162
+ </tr>
163
+
164
+ <tr>
165
+ <td rowspan="1" colSpan="1" >[onTryToReconnect](https://write.woa.com/document/87030021158866944)</td>
166
+
167
+ <td rowspan="1" colSpan="1" >The SDK is trying to reconnect to the cloud.</td>
168
+ </tr>
169
+
170
+ <tr>
171
+ <td rowspan="1" colSpan="1" >[onConnectionRecovery](https://write.woa.com/document/87030021158866944)</td>
172
+
173
+ <td rowspan="1" colSpan="1" >The connection between the SDK and the cloud has been restored.</td>
174
+ </tr>
175
+
176
+ <tr>
177
+ <td rowspan="1" colSpan="1" >[onCameraDidReady](https://write.woa.com/document/87030021158866944)</td>
178
+
179
+ <td rowspan="1" colSpan="1" >Camera is ready</td>
180
+ </tr>
181
+
182
+ <tr>
183
+ <td rowspan="1" colSpan="1" >[onMicDidReady](https://write.woa.com/document/87030021158866944)</td>
184
+
185
+ <td rowspan="1" colSpan="1" >Microphone is ready</td>
186
+ </tr>
187
+
188
+ <tr>
189
+ <td rowspan="1" colSpan="1" >[onUserVoiceVolume](https://write.woa.com/document/87030021158866944)</td>
190
+
191
+ <td rowspan="1" colSpan="1" >Callback for volume feedback</td>
192
+ </tr>
193
+
194
+ <tr>
195
+ <td rowspan="1" colSpan="1" >[onDeviceChange](https://write.woa.com/document/87030021158866944)</td>
196
+
197
+ <td rowspan="1" colSpan="1" >Local device connection status has changed (applicable only to desktop systems)</td>
198
+ </tr>
199
+
200
+ <tr>
201
+ <td rowspan="1" colSpan="1" >[onAudioDeviceCaptureVolumeChanged](https://write.woa.com/document/87030021158866944)</td>
202
+
203
+ <td rowspan="1" colSpan="1" >Current system mic capture volume has changed</td>
204
+ </tr>
205
+
206
+ <tr>
207
+ <td rowspan="1" colSpan="1" >[onAudioDevicePlayoutVolumeChanged](https://write.woa.com/document/87030021158866944)</td>
208
+
209
+ <td rowspan="1" colSpan="1" >Current system playback volume has changed</td>
210
+ </tr>
211
+
212
+ <tr>
213
+ <td rowspan="1" colSpan="1" >[onSystemAudioLoopbackError](https://write.woa.com/document/87030021158866944)</td>
214
+
215
+ <td rowspan="1" colSpan="1" >Event callback for successfully turning on system sound acquisition (applicable only to desktop systems)</td>
216
+ </tr>
217
+
218
+ <tr>
219
+ <td rowspan="1" colSpan="1" >[onTestMicVolume](https://write.woa.com/document/87030021158866944)</td>
220
+
221
+ <td rowspan="1" colSpan="1" >Volume callback while testing the microphone</td>
222
+ </tr>
223
+
224
+ <tr>
225
+ <td rowspan="1" colSpan="1" >[onTestSpeakerVolume](https://write.woa.com/document/87030021158866944)</td>
226
+
227
+ <td rowspan="1" colSpan="1" >Volume callback while testing the speaker</td>
228
+ </tr>
229
+
230
+ <tr>
231
+ <td rowspan="1" colSpan="1" >[onRecvCustomCmdMsg](https://write.woa.com/document/87030021158866944)</td>
232
+
233
+ <td rowspan="1" colSpan="1" >Receipt of a custom Definition message</td>
234
+ </tr>
235
+
236
+ <tr>
237
+ <td rowspan="1" colSpan="1" >[onMissCustomCmdMsg](https://write.woa.com/document/87030021158866944)</td>
238
+
239
+ <td rowspan="1" colSpan="1" >Event callback for lost custom Definition messages</td>
240
+ </tr>
241
+
242
+ <tr>
243
+ <td rowspan="1" colSpan="1" >[onRecvSEIMsg](https://write.woa.com/document/87030021158866944)</td>
244
+
245
+ <td rowspan="1" colSpan="1" >Callback for receiving SEI message</td>
246
+ </tr>
247
+
248
+ <tr>
249
+ <td rowspan="1" colSpan="1" >[onStartPublishing](https://write.woa.com/document/87030021158866944)</td>
250
+
251
+ <td rowspan="1" colSpan="1" >Event callback for starting to publish audio and video streams to Tencent CSS CDN</td>
252
+ </tr>
253
+
254
+ <tr>
255
+ <td rowspan="1" colSpan="1" >[onStopPublishing](https://write.woa.com/document/87030021158866944)</td>
256
+
257
+ <td rowspan="1" colSpan="1" >Event callback for stopping the publishing of audio and video streams to Tencent CSS CDN</td>
258
+ </tr>
259
+
260
+ <tr>
261
+ <td rowspan="1" colSpan="1" >[onStartPublishCDNStream](https://write.woa.com/document/87030021158866944)</td>
262
+
263
+ <td rowspan="1" colSpan="1" >Event callback for starting to publish audio and video streams to a non-Tencent Cloud CDN</td>
264
+ </tr>
265
+
266
+ <tr>
267
+ <td rowspan="1" colSpan="1" >[onStopPublishCDNStream](https://write.woa.com/document/87030021158866944)</td>
268
+
269
+ <td rowspan="1" colSpan="1" >Event callback for stopping the publishing of audio and video streams to a non-Tencent Cloud CDN</td>
270
+ </tr>
271
+
272
+ <tr>
273
+ <td rowspan="1" colSpan="1" >[onSetMixTranscodingConfig](https://write.woa.com/document/87030021158866944)</td>
274
+
275
+ <td rowspan="1" colSpan="1" >Event callback for setting the layout and transcoding parameters of Cloud Mixed Streaming</td>
276
+ </tr>
277
+
278
+ <tr>
279
+ <td rowspan="1" colSpan="1" >[onStartPublishMediaStream](https://write.woa.com/document/87030021158866944)</td>
280
+
281
+ <td rowspan="1" colSpan="1" >Event callback for starting to publish the media stream</td>
282
+ </tr>
283
+
284
+ <tr>
285
+ <td rowspan="1" colSpan="1" >[onUpdatePublishMediaStream](https://write.woa.com/document/87030021158866944)</td>
286
+
287
+ <td rowspan="1" colSpan="1" >Event callback for updating the media stream</td>
288
+ </tr>
289
+
290
+ <tr>
291
+ <td rowspan="1" colSpan="1" >[onStopPublishMediaStream](https://write.woa.com/document/87030021158866944)</td>
292
+
293
+ <td rowspan="1" colSpan="1" >Event callback for stopping the media stream</td>
294
+ </tr>
295
+
296
+ <tr>
297
+ <td rowspan="1" colSpan="1" >[onCdnStreamStateChanged](https://write.woa.com/document/87030021158866944)</td>
298
+
299
+ <td rowspan="1" colSpan="1" >RTMP/RTMPS streaming status change callback</td>
300
+ </tr>
301
+
302
+ <tr>
303
+ <td rowspan="1" colSpan="1" >[onScreenCaptureStarted](https://write.woa.com/document/87030021158866944)</td>
304
+
305
+ <td rowspan="1" colSpan="1" >Event callback for starting screen sharing</td>
306
+ </tr>
307
+
308
+ <tr>
309
+ <td rowspan="1" colSpan="1" >[onScreenCapturePaused](https://write.woa.com/document/87030021158866944)</td>
310
+
311
+ <td rowspan="1" colSpan="1" >Event callback for pausing screen sharing</td>
312
+ </tr>
313
+
314
+ <tr>
315
+ <td rowspan="1" colSpan="1" >[onScreenCaptureResumed](https://write.woa.com/document/87030021158866944)</td>
316
+
317
+ <td rowspan="1" colSpan="1" >Event callback for resuming screen sharing</td>
318
+ </tr>
319
+
320
+ <tr>
321
+ <td rowspan="1" colSpan="1" >[onScreenCaptureStoped](https://write.woa.com/document/87030021158866944)</td>
322
+
323
+ <td rowspan="1" colSpan="1" >Event callback for stopping screen sharing</td>
324
+ </tr>
325
+
326
+ <tr>
327
+ <td rowspan="1" colSpan="1" >[onScreenCaptureCovered](https://write.woa.com/document/87030021158866944)</td>
328
+
329
+ <td rowspan="1" colSpan="1" >Event callback for when the target window of screen sharing is blocked (only applicable for Windows operating system)</td>
330
+ </tr>
331
+
332
+ <tr>
333
+ <td rowspan="1" colSpan="1" >[onLocalRecordBegin](https://write.woa.com/document/87030021158866944)</td>
334
+
335
+ <td rowspan="1" colSpan="1" >Event callback for the local recording task that has started</td>
336
+ </tr>
337
+
338
+ <tr>
339
+ <td rowspan="1" colSpan="1" >[onLocalRecording](https://write.woa.com/document/87030021158866944)</td>
340
+
341
+ <td rowspan="1" colSpan="1" >Progress event callback for an ongoing local recording task</td>
342
+ </tr>
343
+
344
+ <tr>
345
+ <td rowspan="1" colSpan="1" >[onLocalRecordFragment](https://write.woa.com/document/87030021158866944)</td>
346
+
347
+ <td rowspan="1" colSpan="1" >Event callback for local recording shard</td>
348
+ </tr>
349
+
350
+ <tr>
351
+ <td rowspan="1" colSpan="1" >[onLocalRecordComplete](https://write.woa.com/document/87030021158866944)</td>
352
+
353
+ <td rowspan="1" colSpan="1" >Event callback for the local recording task that has ended</td>
354
+ </tr>
355
+
356
+ <tr>
357
+ <td rowspan="1" colSpan="1" >[onSnapshotComplete](https://write.woa.com/document/87030021158866944)</td>
358
+
359
+ <td rowspan="1" colSpan="1" >Event callback for local screenshot completion</td>
360
+ </tr>
361
+
362
+ <tr>
363
+ <td rowspan="1" colSpan="1" >[onUserEnter](https://write.woa.com/document/87030021158866944)</td>
364
+
365
+ <td rowspan="1" colSpan="1" >A host has joined the current room (deprecated)</td>
366
+ </tr>
367
+
368
+ <tr>
369
+ <td rowspan="1" colSpan="1" >[onUserExit](https://write.woa.com/document/87030021158866944)</td>
370
+
371
+ <td rowspan="1" colSpan="1" >A host has left the current room (deprecated)</td>
372
+ </tr>
373
+
374
+ <tr>
375
+ <td rowspan="1" colSpan="1" >[onAudioEffectFinished](https://write.woa.com/document/87030021158866944)</td>
376
+
377
+ <td rowspan="1" colSpan="1" >Sound effect playback has ended (deprecated)</td>
378
+ </tr>
379
+
380
+ <tr>
381
+ <td rowspan="1" colSpan="1" >[onPlayBGMBegin](https://write.woa.com/document/87030021158866944)</td>
382
+
383
+ <td rowspan="1" colSpan="1" >Start playing background music (deprecated)</td>
384
+ </tr>
385
+
386
+ <tr>
387
+ <td rowspan="1" colSpan="1" >[onPlayBGMProgress](https://write.woa.com/document/87030021158866944)</td>
388
+
389
+ <td rowspan="1" colSpan="1" >Playback progress callback for background music (deprecated)</td>
390
+ </tr>
391
+
392
+ <tr>
393
+ <td rowspan="1" colSpan="1" >[onPlayBGMComplete](https://write.woa.com/document/87030021158866944)</td>
394
+
395
+ <td rowspan="1" colSpan="1" >Background music playback has ended (deprecated)</td>
396
+ </tr>
397
+
398
+ <tr>
399
+ <td rowspan="1" colSpan="1" >[onSpeedTest](https://write.woa.com/document/87030021158866944)</td>
400
+
401
+ <td rowspan="1" colSpan="1" >Callback for server speed test results (deprecated)</td>
402
+ </tr>
403
+ </table>
404
+
405
+
406
+ ## ITRTCVideoRenderCallback
407
+ <table>
408
+ <tr>
409
+ <td rowspan="1" colSpan="1" >Function List</td>
410
+
411
+ <td rowspan="1" colSpan="1" >Description</td>
412
+ </tr>
413
+
414
+ <tr>
415
+ <td rowspan="1" colSpan="1" >[onRenderVideoFrame](https://write.woa.com/document/87030021158866944)</td>
416
+
417
+ <td rowspan="1" colSpan="1" >Self-definition video rendering callback</td>
418
+ </tr>
419
+ </table>
420
+
421
+
422
+ ## ITRTCVideoFrameCallback
423
+ <table>
424
+ <tr>
425
+ <td rowspan="1" colSpan="1" >Function List</td>
426
+
427
+ <td rowspan="1" colSpan="1" >Description</td>
428
+ </tr>
429
+
430
+ <tr>
431
+ <td rowspan="1" colSpan="1" >[onGLContextCreated](https://write.woa.com/document/87030021158866944)</td>
432
+
433
+ <td rowspan="1" colSpan="1" >Notification that the SDK's internal OpenGL environment has been created</td>
434
+ </tr>
435
+
436
+ <tr>
437
+ <td rowspan="1" colSpan="1" >[onProcessVideoFrame](https://write.woa.com/document/87030021158866944)</td>
438
+
439
+ <td rowspan="1" colSpan="1" >Video processing callback for integrating third-party beauty components</td>
440
+ </tr>
441
+
442
+ <tr>
443
+ <td rowspan="1" colSpan="1" >[onGLContextDestroy](https://write.woa.com/document/87030021158866944)</td>
444
+
445
+ <td rowspan="1" colSpan="1" >Notification that the SDK's internal OpenGL environment has been destroyed</td>
446
+ </tr>
447
+ </table>
448
+
449
+
450
+ ## ITRTCAudioFrameCallback
451
+ <table>
452
+ <tr>
453
+ <td rowspan="1" colSpan="1" >Function List</td>
454
+
455
+ <td rowspan="1" colSpan="1" >Description</td>
456
+ </tr>
457
+
458
+ <tr>
459
+ <td rowspan="1" colSpan="1" >[onCapturedAudioFrame](https://write.woa.com/document/87030021158866944)</td>
460
+
461
+ <td rowspan="1" colSpan="1" >Local audio data callback after preprocessing by the audio module</td>
462
+ </tr>
463
+
464
+ <tr>
465
+ <td rowspan="1" colSpan="1" >[onLocalProcessedAudioFrame](https://write.woa.com/document/87030021158866944)</td>
466
+
467
+ <td rowspan="1" colSpan="1" >Local audio data callback after preprocessing, sound-effect processing, and mixing BGM by the audio module</td>
468
+ </tr>
469
+
470
+ <tr>
471
+ <td rowspan="1" colSpan="1" >[onPlayAudioFrame](https://write.woa.com/document/87030021158866944)</td>
472
+
473
+ <td rowspan="1" colSpan="1" >Audio data of each remote user before mixing</td>
474
+ </tr>
475
+
476
+ <tr>
477
+ <td rowspan="1" colSpan="1" >[onMixedPlayAudioFrame](https://write.woa.com/document/87030021158866944)</td>
478
+
479
+ <td rowspan="1" colSpan="1" >Callback of mixed audio data before final submission to the system for playback</td>
480
+ </tr>
481
+
482
+ <tr>
483
+ <td rowspan="1" colSpan="1" >[onMixedAllAudioFrame](https://write.woa.com/document/87030021158866944)</td>
484
+
485
+ <td rowspan="1" colSpan="1" >Audio data mixed by the SDK (including collected and to-be-played audio)</td>
486
+ </tr>
487
+ </table>
488
+
489
+
490
+ ## ITRTCLogCallback
491
+ <table>
492
+ <tr>
493
+ <td rowspan="1" colSpan="1" >Function List</td>
494
+
495
+ <td rowspan="1" colSpan="1" >Description</td>
496
+ </tr>
497
+
498
+ <tr>
499
+ <td rowspan="1" colSpan="1" >[onLog](https://write.woa.com/document/87030021158866944)</td>
500
+
501
+ <td rowspan="1" colSpan="1" >Local LOG printing callback</td>
502
+ </tr>
503
+ </table>
504
+
505
+
506
+ ## onError
507
+
508
+
509
+
510
+ #### Error event callback
511
+
512
+ Error events indicate unrecoverable errors thrown by the SDK, such as room entry failure or device startup failure.
513
+
514
+ Reference document: [Error Code Table](https://cloud.tencent.com/document/product/647/38308)
515
+ <table>
516
+ <tr>
517
+ <td rowspan="1" colSpan="1" >Parameters</td>
518
+
519
+ <td rowspan="1" colSpan="1" >Description</td>
520
+ </tr>
521
+
522
+ <tr>
523
+ <td rowspan="1" colSpan="1" >errCode</td>
524
+
525
+ <td rowspan="1" colSpan="1" >Error Code</td>
526
+ </tr>
527
+
528
+ <tr>
529
+ <td rowspan="1" colSpan="1" >errMsg</td>
530
+
531
+ <td rowspan="1" colSpan="1" >Error Message</td>
532
+ </tr>
533
+
534
+ <tr>
535
+ <td rowspan="1" colSpan="1" >extInfo</td>
536
+
537
+ <td rowspan="1" colSpan="1" >Expand Information Field, some error codes may carry additional information to help pinpoint issues</td>
538
+ </tr>
539
+ </table>
540
+
541
+
542
+ ## onWarning
543
+
544
+
545
+
546
+ #### Warning event callback
547
+
548
+ Warning events indicate prompt issues thrown by the SDK, such as video stuttering or high CPU utilization.
549
+
550
+ Reference document: [Error Code Table](https://cloud.tencent.com/document/product/647/38308)
551
+ <table>
552
+ <tr>
553
+ <td rowspan="1" colSpan="1" >Parameters</td>
554
+
555
+ <td rowspan="1" colSpan="1" >Description</td>
556
+ </tr>
557
+
558
+ <tr>
559
+ <td rowspan="1" colSpan="1" >extInfo</td>
560
+
561
+ <td rowspan="1" colSpan="1" >Expand Information Field, some warning codes may carry additional information to help pinpoint issues</td>
562
+ </tr>
563
+
564
+ <tr>
565
+ <td rowspan="1" colSpan="1" >warningCode</td>
566
+
567
+ <td rowspan="1" colSpan="1" >Warning Codes</td>
568
+ </tr>
569
+
570
+ <tr>
571
+ <td rowspan="1" colSpan="1" >warningMsg</td>
572
+
573
+ <td rowspan="1" colSpan="1" >Warning Information</td>
574
+ </tr>
575
+ </table>
576
+
577
+
578
+ ## onEnterRoom
579
+
580
+
581
+
582
+ #### Event callback for room entry success or failure
583
+
584
+ After calling the enterRoom() interface in TRTCCloud to perform the room entry operation, you will receive the onEnterRoom(result) callback from ITRTCCloudCallback:
585
+ - If the entry is successful, the result will be a positive number (result > 0), representing the time taken to enter the room, in milliseconds (ms).
586
+
587
+ - If the entry fails, the result will be a negative number (result < 0), representing the error code of the failure reason.
588
+
589
+
590
+ For the meaning of error codes of room entry failure, please see [Error Code Table](https://cloud.tencent.com/document/product/647/38308).
591
+ <table>
592
+ <tr>
593
+ <td rowspan="1" colSpan="1" >Parameters</td>
594
+
595
+ <td rowspan="1" colSpan="1" >Description</td>
596
+ </tr>
597
+
598
+ <tr>
599
+ <td rowspan="1" colSpan="1" >result</td>
600
+
601
+ <td rowspan="1" colSpan="1" >When result > 0, it means the time taken to enter the room (ms). When result < 0, it means the error code for entering the room.</td>
602
+ </tr>
603
+ </table>
604
+
605
+
606
+ > **Note**
607
+ >
608
+
609
+ > 1. In versions before Ver6.6, only successful room entry would throw the onEnterRoom(result) callback; failure would be thrown by the onError() callback.
610
+ >
611
+
612
+ > 2. In versions after Ver6.6: regardless of success or failure, the onEnterRoom(result) callback will be thrown, and room entry failure will also throw the onError() callback.
613
+ >
614
+
615
+
616
+ ## onExitRoom
617
+
618
+
619
+
620
+ #### Event callback for leaving the room
621
+
622
+ Calling the exitRoom interface in TRTCCloud will execute the related logic of leaving the room, such as releasing audio/video device resources and codec resources.
623
+
624
+ After all resources occupied by the SDK are released, the SDK will trigger the onExitRoom() callback to notify you.
625
+
626
+
627
+
628
+ If you want to call enterRoom again or switch to another audio and video SDK, please wait for the onExitRoom callback before performing related operations. Otherwise, you may encounter various abnormal issues, such as the camera and microphone equipment being forcibly occupied.
629
+ <table>
630
+ <tr>
631
+ <td rowspan="1" colSpan="1" >Parameters</td>
632
+
633
+ <td rowspan="1" colSpan="1" >Description</td>
634
+ </tr>
635
+
636
+ <tr>
637
+ <td rowspan="1" colSpan="1" >reason</td>
638
+
639
+ <td rowspan="1" colSpan="1" >Reasons for leaving the room: 0: Actively call exitRoom to leave the room; 1: Kicked out of the current room by the server; 2: The entire current room is dissolved.</td>
640
+ </tr>
641
+ </table>
642
+
643
+
644
+ ## onSwitchRole
645
+
646
+
647
+
648
+ #### Event callback for switching roles
649
+
650
+ Calling the switchRole() interface in TRTCCloud will switch the roles of anchor and audience. This operation will involve a circuit switching process, and once the SDK completes the switch, it will trigger the onSwitchRole() event callback.
651
+ <table>
652
+ <tr>
653
+ <td rowspan="1" colSpan="1" >Parameters</td>
654
+
655
+ <td rowspan="1" colSpan="1" >Description</td>
656
+ </tr>
657
+
658
+ <tr>
659
+ <td rowspan="1" colSpan="1" >errCode</td>
660
+
661
+ <td rowspan="1" colSpan="1" >Error Code, ERR_NULL represents successful switching. For others, please refer to [ Error Code ](https://cloud.tencent.com/document/product/647/32257).</td>
662
+ </tr>
663
+
664
+ <tr>
665
+ <td rowspan="1" colSpan="1" >errMsg</td>
666
+
667
+ <td rowspan="1" colSpan="1" >Error message.</td>
668
+ </tr>
669
+ </table>
670
+
671
+
672
+ ## onSwitchRoom
673
+
674
+
675
+
676
+ #### Event callback for switching rooms result
677
+
678
+ Calling the switchRoom() interface in TRTCCloud allows the user to quickly switch from one room to another. After the SDK completes the switch, it will trigger the onSwitchRoom() event callback.
679
+ <table>
680
+ <tr>
681
+ <td rowspan="1" colSpan="1" >Parameters</td>
682
+
683
+ <td rowspan="1" colSpan="1" >Description</td>
684
+ </tr>
685
+
686
+ <tr>
687
+ <td rowspan="1" colSpan="1" >errCode</td>
688
+
689
+ <td rowspan="1" colSpan="1" >Error Code, ERR_NULL represents successful switching. For others, please refer to [ Error Code ](https://cloud.tencent.com/document/product/647/32257).</td>
690
+ </tr>
691
+
692
+ <tr>
693
+ <td rowspan="1" colSpan="1" >errMsg</td>
694
+
695
+ <td rowspan="1" colSpan="1" >Error message.</td>
696
+ </tr>
697
+ </table>
698
+
699
+
700
+ ## onConnectOtherRoom
701
+
702
+
703
+
704
+ #### Event callback for cross-room communication request result
705
+
706
+ Calling the connectOtherRoom() interface in TRTCCloud will initiate a video call between broadcasters in two different rooms, which is the so-called “Host PK” feature.
707
+
708
+ The caller will receive the onConnectOtherRoom() callback to learn whether the cross-room communication is successful
709
+
710
+ If successful, all users in both rooms will receive the onUserVideoAvailable() callback from the PK anchor in the other room.
711
+ <table>
712
+ <tr>
713
+ <td rowspan="1" colSpan="1" >Parameters</td>
714
+
715
+ <td rowspan="1" colSpan="1" >Description</td>
716
+ </tr>
717
+
718
+ <tr>
719
+ <td rowspan="1" colSpan="1" >errCode</td>
720
+
721
+ <td rowspan="1" colSpan="1" >Error Code, ERR_NULL represents successful switching. For others, please refer to [ Error Code ](https://cloud.tencent.com/document/product/647/32257).</td>
722
+ </tr>
723
+
724
+ <tr>
725
+ <td rowspan="1" colSpan="1" >errMsg</td>
726
+
727
+ <td rowspan="1" colSpan="1" >Error message.</td>
728
+ </tr>
729
+
730
+ <tr>
731
+ <td rowspan="1" colSpan="1" >userId</td>
732
+
733
+ <td rowspan="1" colSpan="1" >User ID of the anchor in the other room for cross-room communication.</td>
734
+ </tr>
735
+ </table>
736
+
737
+
738
+ ## onDisconnectOtherRoom
739
+
740
+
741
+
742
+ #### Event callback for ending cross-room communication result
743
+
744
+ ## onUpdateOtherRoomForwardMode
745
+
746
+
747
+
748
+ #### Event callback for modifying cross-room broadcaster uplink capability result
749
+
750
+ ## onRemoteUserEnterRoom
751
+
752
+
753
+
754
+ #### A user has joined the current room
755
+
756
+ For performance considerations, the behavior of this notification differs in two different TRTC application scenarios (i.e., AppScene, specified by the second parameter when calling enterRoom):
757
+ - Live streaming scenarios (TRTCAppSceneLIVE and TRTCAppSceneVoiceChatRoom): In this scenario, users are divided into anchors and audience roles. This notification is only triggered when an anchor enters the room; it is not triggered when an audience member enters.
758
+
759
+ - Call scenarios (TRTCAppSceneVideoCall and TRTCAppSceneAudioCall): In this scenario, there is no role distinction among users (they can all be considered anchors). This notification is triggered when any user enters the room.
760
+
761
+ <table>
762
+ <tr>
763
+ <td rowspan="1" colSpan="1" >Parameters</td>
764
+
765
+ <td rowspan="1" colSpan="1" >Description</td>
766
+ </tr>
767
+
768
+ <tr>
769
+ <td rowspan="1" colSpan="1" >userId</td>
770
+
771
+ <td rowspan="1" colSpan="1" >User Identifier of the remote user.</td>
772
+ </tr>
773
+ </table>
774
+
775
+
776
+ > **Note**
777
+ >
778
+
779
+ > 1. The event callbacks onRemoteUserEnterRoom and onRemoteUserLeaveRoom are only applicable for maintaining the "user list" in the current room. The presence of these callbacks does not necessarily imply video streams.
780
+ >
781
+
782
+ > 2. To display the remote screen, please listen for the onUserVideoAvailable() event callback, which indicates whether a specific user has video footage.
783
+ >
784
+
785
+
786
+ ## onRemoteUserLeaveRoom
787
+
788
+
789
+
790
+ #### A user has left the current room
791
+
792
+ Corresponding to onRemoteUserEnterRoom, the behavior of this notification differs in two different application scenarios (i.e., AppScene, specified by the second parameter when calling enterRoom):
793
+ - Live streaming scenarios (TRTCAppSceneLIVE and TRTCAppSceneVoiceChatRoom): This notification is only triggered when an anchor leaves the room; it is not triggered when an audience member leaves.
794
+
795
+ - Call scenarios (TRTCAppSceneVideoCall and TRTCAppSceneAudioCall): In this scenario, there is no role distinction among users. This notification is triggered when any user leaves.
796
+
797
+ <table>
798
+ <tr>
799
+ <td rowspan="1" colSpan="1" >Parameters</td>
800
+
801
+ <td rowspan="1" colSpan="1" >Description</td>
802
+ </tr>
803
+
804
+ <tr>
805
+ <td rowspan="1" colSpan="1" >reason</td>
806
+
807
+ <td rowspan="1" colSpan="1" >Reason for leaving: 0 indicates the user left the room voluntarily, 1 indicates a timeout exit, 2 indicates the user was kicked out of the room, and 3 indicates the anchor switched to audience mode and left the room.</td>
808
+ </tr>
809
+
810
+ <tr>
811
+ <td rowspan="1" colSpan="1" >userId</td>
812
+
813
+ <td rowspan="1" colSpan="1" >User Identifier of the remote user.</td>
814
+ </tr>
815
+ </table>
816
+
817
+
818
+ ## onUserVideoAvailable
819
+
820
+
821
+
822
+ #### A remote user has started/stopped publishing the main video stream
823
+
824
+ **The primary video** is generally used to carry the camera's video feed. When you receive the onUserVideoAvailable(userId, true) notification, it indicates that video frames are available for playback on this channel.
825
+
826
+ At this point, you need to call the [startRemoteView](https://write.woa.com/document/87030026264555520) interface to subscribe to the user's remote screen. Upon successful subscription, you will continue to receive the user's first frame rendering callback onFirstVideoFrame(userId).
827
+
828
+
829
+
830
+ When you receive the onUserVideoAvailable(userId, false) notification, it means that the remote video on this channel has been turned off. The shutdown may be due to the user invoking [muteLocalVideo](https://write.woa.com/document/87030026264555520) or [stopLocalPreview](https://write.woa.com/document/87030026264555520).
831
+ <table>
832
+ <tr>
833
+ <td rowspan="1" colSpan="1" >Parameters</td>
834
+
835
+ <td rowspan="1" colSpan="1" >Description</td>
836
+ </tr>
837
+
838
+ <tr>
839
+ <td rowspan="1" colSpan="1" >available</td>
840
+
841
+ <td rowspan="1" colSpan="1" >Whether the user has published (or cancelled publishing) the Main Road Picture, true: published; false: cancelled.</td>
842
+ </tr>
843
+
844
+ <tr>
845
+ <td rowspan="1" colSpan="1" >userId</td>
846
+
847
+ <td rowspan="1" colSpan="1" >User Identifier of the remote user.</td>
848
+ </tr>
849
+ </table>
850
+
851
+
852
+ ## onUserSubStreamAvailable
853
+
854
+
855
+
856
+ #### A remote user has started/stopped publishing the auxiliary video stream
857
+
858
+ "Auxiliary Road Picture" is generally used to carry the screen sharing content. When you receive the onUserSubStreamAvailable(userId, true) notification, it indicates that video frames are available for playback on this channel.
859
+
860
+ At this point, you need to call the [startRemoteView](https://write.woa.com/document/87030026264555520) interface to subscribe to the user's remote screen. Upon successful subscription, you will continue to receive the user's first frame rendering callback onFirstVideoFrame(userId).
861
+ <table>
862
+ <tr>
863
+ <td rowspan="1" colSpan="1" >Parameters</td>
864
+
865
+ <td rowspan="1" colSpan="1" >Description</td>
866
+ </tr>
867
+
868
+ <tr>
869
+ <td rowspan="1" colSpan="1" >available</td>
870
+
871
+ <td rowspan="1" colSpan="1" >Whether the user has published (or cancelled publishing) the auxiliary video content, true: published; false: cancelled.</td>
872
+ </tr>
873
+
874
+ <tr>
875
+ <td rowspan="1" colSpan="1" >userId</td>
876
+
877
+ <td rowspan="1" colSpan="1" >User Identifier of the remote user.</td>
878
+ </tr>
879
+ </table>
880
+
881
+
882
+ > **Note**
883
+ >
884
+
885
+ > The function used to display the auxiliary road picture is [startRemoteView](https://write.woa.com/document/87030026264555520), not startRemoteSubStreamView. The latter has been deprecated.
886
+ >
887
+
888
+
889
+ ## onUserAudioAvailable
890
+
891
+
892
+
893
+ #### A remote user has started/stopped publishing their audio
894
+
895
+ When you receive the onUserAudioAvailable(userId, true) notification, it means the user has published their audio. At this time, the SDK behaves as follows:
896
+ - In Automatic Subscription Mode, you do not need to take any action; the SDK will automatically play the user's audio.
897
+
898
+ - In manual subscription mode, you can use [muteRemoteAudio](https://write.woa.com/document/87030026264555520)(userid, false) to play the user's audio.
899
+
900
+ <table>
901
+ <tr>
902
+ <td rowspan="1" colSpan="1" >Parameters</td>
903
+
904
+ <td rowspan="1" colSpan="1" >Description</td>
905
+ </tr>
906
+
907
+ <tr>
908
+ <td rowspan="1" colSpan="1" >available</td>
909
+
910
+ <td rowspan="1" colSpan="1" >Whether the user has published (or cancelled publishing) their audio, true: published; false: cancelled.</td>
911
+ </tr>
912
+
913
+ <tr>
914
+ <td rowspan="1" colSpan="1" >userId</td>
915
+
916
+ <td rowspan="1" colSpan="1" >User Identifier of the remote user.</td>
917
+ </tr>
918
+ </table>
919
+
920
+
921
+ > **Note**
922
+ >
923
+
924
+ > The SDK uses automatic subscription mode by default. You can set it to manual subscription by calling [setDefaultStreamRecvMode](https://write.woa.com/document/87030026264555520), but this must be done before you enter the room.
925
+ >
926
+
927
+
928
+ ## onFirstVideoFrame
929
+
930
+
931
+
932
+ #### The SDK has started rendering the first frame of the local or remote user's video
933
+
934
+ The SDK triggers this event when rendering the first video frame of the local or remote user. You can use the userId parameter in the callback event to determine whether the event is from "Local" or "Remote".
935
+ - If userId is empty, it means the SDK has started rendering your local video footage, but you must have called [startLocalPreview](https://write.woa.com/document/87030026264555520) or [startScreenCapture](https://write.woa.com/document/87030026264555520).
936
+
937
+ - If userId is not empty, it means the SDK has started rendering the remote user's video footage. However, you must have called [startRemoteView](https://write.woa.com/document/87030026264555520) to subscribe to the user's video footage.
938
+
939
+ <table>
940
+ <tr>
941
+ <td rowspan="1" colSpan="1" >Parameters</td>
942
+
943
+ <td rowspan="1" colSpan="1" >Description</td>
944
+ </tr>
945
+
946
+ <tr>
947
+ <td rowspan="1" colSpan="1" >height</td>
948
+
949
+ <td rowspan="1" colSpan="1" >Height of the video footage.</td>
950
+ </tr>
951
+
952
+ <tr>
953
+ <td rowspan="1" colSpan="1" >streamType</td>
954
+
955
+ <td rowspan="1" colSpan="1" >Video stream type: Main is generally used for carrying camera footage, while Sub is generally used for carrying screen sharing footage.</td>
956
+ </tr>
957
+
958
+ <tr>
959
+ <td rowspan="1" colSpan="1" >userId</td>
960
+
961
+ <td rowspan="1" colSpan="1" >The user identifier of local or remote. If userId is empty, it means your local first video frame has arrived. If userId is not empty, it means the remote user's first video frame has arrived.</td>
962
+ </tr>
963
+
964
+ <tr>
965
+ <td rowspan="1" colSpan="1" >width</td>
966
+
967
+ <td rowspan="1" colSpan="1" >Width of the video footage.</td>
968
+ </tr>
969
+ </table>
970
+
971
+
972
+ > **Note**
973
+ >
974
+
975
+ > 1. The local first video frame event callback is triggered only after you call [startLocalPreview](https://write.woa.com/document/87030026264555520) or [startScreenCapture](https://write.woa.com/document/87030026264555520).
976
+ >
977
+
978
+ > 2. The remote user's first video frame event callback is triggered only after you call [startRemoteView](https://write.woa.com/document/87030026264555520) or startRemoteSubStreamView.
979
+ >
980
+
981
+
982
+ ## onFirstAudioFrame
983
+
984
+
985
+
986
+ #### The SDK has started playing the remote user's first audio frame
987
+
988
+ The SDK will throw this event when playing the remote user's first frame of audio. The first frame event of local audio is not thrown for now.
989
+ <table>
990
+ <tr>
991
+ <td rowspan="1" colSpan="1" >Parameters</td>
992
+
993
+ <td rowspan="1" colSpan="1" >Description</td>
994
+ </tr>
995
+
996
+ <tr>
997
+ <td rowspan="1" colSpan="1" >userId</td>
998
+
999
+ <td rowspan="1" colSpan="1" >User Identifier of the remote user.</td>
1000
+ </tr>
1001
+ </table>
1002
+
1003
+
1004
+ ## onSendFirstLocalVideoFrame
1005
+
1006
+
1007
+
1008
+ #### The first local video frame has been published
1009
+
1010
+ After successfully joining the room and starting local video capture via [startLocalPreview](https://write.woa.com/document/87030026264555520) or [startScreenCapture](https://write.woa.com/document/87030026264555520) (the order of starting capture and joining the room does not matter), the SDK will start video encoding and publish the local video data to the cloud using its network module. Once the SDK successfully sends the first frame of local video data to the cloud, the onSendFirstLocalVideoFrame event callback will be triggered.
1011
+ <table>
1012
+ <tr>
1013
+ <td rowspan="1" colSpan="1" >Parameters</td>
1014
+
1015
+ <td rowspan="1" colSpan="1" >Description</td>
1016
+ </tr>
1017
+
1018
+ <tr>
1019
+ <td rowspan="1" colSpan="1" >streamType</td>
1020
+
1021
+ <td rowspan="1" colSpan="1" >Video stream type: Main is generally used for carrying camera footage, while Sub is generally used for carrying screen sharing footage.</td>
1022
+ </tr>
1023
+ </table>
1024
+
1025
+
1026
+ ## onSendFirstLocalAudioFrame
1027
+
1028
+
1029
+
1030
+ #### The first local audio frame has been published
1031
+
1032
+ After successfully joining the room and starting local audio capture via [startLocalAudio](https://write.woa.com/document/87030026264555520) (the order of starting capture and joining the room does not matter), the SDK will start audio encoding and publish the local audio data to the cloud using its network module. Once the SDK successfully sends the first frame of local audio data to the cloud, the onSendFirstLocalAudioFrame event callback will be triggered.
1033
+
1034
+ ## onRemoteVideoStatusUpdated
1035
+
1036
+
1037
+
1038
+ #### Event callback for remote video status changes
1039
+
1040
+ You can use this event callback to obtain the playback status of each remote video stream (including three states: Playing, Loading, and Stopped) for corresponding UI display.
1041
+ <table>
1042
+ <tr>
1043
+ <td rowspan="1" colSpan="1" >Parameters</td>
1044
+
1045
+ <td rowspan="1" colSpan="1" >Description</td>
1046
+ </tr>
1047
+
1048
+ <tr>
1049
+ <td rowspan="1" colSpan="1" >extrainfo</td>
1050
+
1051
+ <td rowspan="1" colSpan="1" >Additional Information.</td>
1052
+ </tr>
1053
+
1054
+ <tr>
1055
+ <td rowspan="1" colSpan="1" >reason</td>
1056
+
1057
+ <td rowspan="1" colSpan="1" >Reasons for video status changes.</td>
1058
+ </tr>
1059
+
1060
+ <tr>
1061
+ <td rowspan="1" colSpan="1" >status</td>
1062
+
1063
+ <td rowspan="1" colSpan="1" >Video Status: Including Playing, Loading, and Stopped states.</td>
1064
+ </tr>
1065
+
1066
+ <tr>
1067
+ <td rowspan="1" colSpan="1" >streamType</td>
1068
+
1069
+ <td rowspan="1" colSpan="1" >Video stream type: Main is generally used for carrying camera footage, while Sub is generally used for carrying screen sharing footage.</td>
1070
+ </tr>
1071
+
1072
+ <tr>
1073
+ <td rowspan="1" colSpan="1" >userId</td>
1074
+
1075
+ <td rowspan="1" colSpan="1" >User identifier.</td>
1076
+ </tr>
1077
+ </table>
1078
+
1079
+
1080
+ ## onRemoteAudioStatusUpdated
1081
+
1082
+
1083
+
1084
+ #### Event callback for remote audio status changes
1085
+
1086
+ You can use this event callback to obtain the playback status of each remote audio stream (including three states: Playing, Loading, and Stopped) for corresponding UI display.
1087
+ <table>
1088
+ <tr>
1089
+ <td rowspan="1" colSpan="1" >Parameters</td>
1090
+
1091
+ <td rowspan="1" colSpan="1" >Description</td>
1092
+ </tr>
1093
+
1094
+ <tr>
1095
+ <td rowspan="1" colSpan="1" >extrainfo</td>
1096
+
1097
+ <td rowspan="1" colSpan="1" >Additional Information.</td>
1098
+ </tr>
1099
+
1100
+ <tr>
1101
+ <td rowspan="1" colSpan="1" >reason</td>
1102
+
1103
+ <td rowspan="1" colSpan="1" >Reasons for audio status changes.</td>
1104
+ </tr>
1105
+
1106
+ <tr>
1107
+ <td rowspan="1" colSpan="1" >status</td>
1108
+
1109
+ <td rowspan="1" colSpan="1" >Audio Status: Including Playing, Loading, and Stopped states.</td>
1110
+ </tr>
1111
+
1112
+ <tr>
1113
+ <td rowspan="1" colSpan="1" >userId</td>
1114
+
1115
+ <td rowspan="1" colSpan="1" >User identifier.</td>
1116
+ </tr>
1117
+ </table>
1118
+
1119
+
1120
+ ## onUserVideoSizeChanged
1121
+
1122
+
1123
+
1124
+ #### Callback for changes in user video size
1125
+
1126
+ When you receive the onUserVideoSizeChanged(userId, streamtype, newWidth, newHeight) notification, it indicates that the video size has changed, possibly because the user has called setVideoEncoderParam or setSubStreamEncoderParam to reset the video dimensions.
1127
+ <table>
1128
+ <tr>
1129
+ <td rowspan="1" colSpan="1" >Parameters</td>
1130
+
1131
+ <td rowspan="1" colSpan="1" >Description</td>
1132
+ </tr>
1133
+
1134
+ <tr>
1135
+ <td rowspan="1" colSpan="1" >newHeight</td>
1136
+
1137
+ <td rowspan="1" colSpan="1" >The height of the video stream (in pixels).</td>
1138
+ </tr>
1139
+
1140
+ <tr>
1141
+ <td rowspan="1" colSpan="1" >newWidth</td>
1142
+
1143
+ <td rowspan="1" colSpan="1" >The width of the video stream (in pixels).</td>
1144
+ </tr>
1145
+
1146
+ <tr>
1147
+ <td rowspan="1" colSpan="1" >streamType</td>
1148
+
1149
+ <td rowspan="1" colSpan="1" >Video stream type: Main is generally used for carrying camera footage, while Sub is generally used for carrying screen sharing footage.</td>
1150
+ </tr>
1151
+
1152
+ <tr>
1153
+ <td rowspan="1" colSpan="1" >userId</td>
1154
+
1155
+ <td rowspan="1" colSpan="1" >User identifier.</td>
1156
+ </tr>
1157
+ </table>
1158
+
1159
+
1160
+ ## onNetworkQuality
1161
+
1162
+
1163
+
1164
+ #### Real-time statistics callback for network quality
1165
+
1166
+ This statistical callback is thrown every 2 seconds to notify the SDK of the perceived current network's uplink and downlink quality.
1167
+
1168
+ The SDK uses a set of proprietary algorithms to assess the current network's latency, bandwidth, and stability, and calculates an evaluation result: An evaluation result of 1 (Excellent) indicates that the current network condition is very good, while a result of 6 (Down) indicates that the current network cannot support normal calls on TRTC.
1169
+ <table>
1170
+ <tr>
1171
+ <td rowspan="1" colSpan="1" >Parameters</td>
1172
+
1173
+ <td rowspan="1" colSpan="1" >Description</td>
1174
+ </tr>
1175
+
1176
+ <tr>
1177
+ <td rowspan="1" colSpan="1" >localQuality</td>
1178
+
1179
+ <td rowspan="1" colSpan="1" >Uplink network quality.</td>
1180
+ </tr>
1181
+
1182
+ <tr>
1183
+ <td rowspan="1" colSpan="1" >remoteQuality</td>
1184
+
1185
+ <td rowspan="1" colSpan="1" >Downlink network quality, represents the data quality finally gathered at the client-end after the data stream travels through a complete transmission link from "remote-end -> cloud -> client-end". Thus, the downlink network quality represents the result influenced by both the remote uplink and the client downlink.</td>
1186
+ </tr>
1187
+ </table>
1188
+
1189
+
1190
+ > **Note**
1191
+ >
1192
+
1193
+ > It is temporarily impossible to assess the remote user's uplink quality through this interface alone.
1194
+ >
1195
+
1196
+
1197
+ ## onStatistics
1198
+
1199
+
1200
+
1201
+ #### Real-time statistics callback for audio and video technical indicators
1202
+
1203
+ This statistical callback is thrown every 2 seconds, notifying the SDK internal audio, video, and network-related technical indicators. This information is listed in [TRTCStatistics](https://write.woa.com/document/87030057818304512):
1204
+ - Video statistical information: Video resolution, frame rate (FPS), and bitrate information.
1205
+
1206
+ - Audio statistical information: Audio sample rate, channel, and bitrate information.
1207
+
1208
+ - Network Statistics: Network Latency (RTT), Packet Loss Rate (loss), Upstream Traffic (sentBytes), Downstream Traffic (receivedBytes), and other information from a round-trip (SDK > Cloud > SDK).
1209
+
1210
+ <table>
1211
+ <tr>
1212
+ <td rowspan="1" colSpan="1" >Parameters</td>
1213
+
1214
+ <td rowspan="1" colSpan="1" >Description</td>
1215
+ </tr>
1216
+
1217
+ <tr>
1218
+ <td rowspan="1" colSpan="1" >statistics</td>
1219
+
1220
+ <td rowspan="1" colSpan="1" >Statistics including local and remote user statistics, for details refer to [TRTCStatistics](https://write.woa.com/document/87030057818304512).</td>
1221
+ </tr>
1222
+ </table>
1223
+
1224
+
1225
+ > **Note**
1226
+ >
1227
+
1228
+ > If you just need to know the current network quality and do not want to spend too much time studying this statistical callback, it is recommended to use [onNetworkQuality](https://write.woa.com/document/87030021158866944) to solve the problem.
1229
+ >
1230
+
1231
+
1232
+ ## onSpeedTestResult
1233
+
1234
+
1235
+
1236
+ #### Callback for internet speed test results
1237
+
1238
+ This statistical callback is triggered by startSpeedTest.
1239
+ <table>
1240
+ <tr>
1241
+ <td rowspan="1" colSpan="1" >Parameters</td>
1242
+
1243
+ <td rowspan="1" colSpan="1" >Description</td>
1244
+ </tr>
1245
+
1246
+ <tr>
1247
+ <td rowspan="1" colSpan="1" >result</td>
1248
+
1249
+ <td rowspan="1" colSpan="1" >Internet Speed Test results, including packet loss, round-trip delay, upstream and downstream bandwidth rates; for details, refer to [TRTCSpeedTestResult](https://write.woa.com/document/87030132707430400).</td>
1250
+ </tr>
1251
+ </table>
1252
+
1253
+
1254
+ ## onConnectionLost
1255
+
1256
+
1257
+
1258
+ #### The connection between the SDK and the cloud has been disconnected.
1259
+
1260
+ The SDK will throw this event callback when the connection to the cloud is disconnected. The main reasons for disconnection are network unavailability or network switching, such as when the user enters an elevator during a call.
1261
+
1262
+ After throwing this event, the SDK will attempt to re-establish the connection with the cloud. During the reconnection process, it will throw [onTryToReconnect](https://write.woa.com/document/87030021158866944), and once the connection is restored, it will throw [onConnectionRecovery](https://write.woa.com/document/87030021158866944).
1263
+
1264
+ Thus, the SDK will switch among the following three connection-related events in the following manner:
1265
+
1266
+ ![](https://qcloudimg.tencent-cloud.cn/raw/fb3c40a4fca55b0010d385cf3b2472cd.png)
1267
+
1268
+ ## onTryToReconnect
1269
+
1270
+
1271
+
1272
+ #### The SDK is trying to reconnect to the cloud.
1273
+
1274
+ The SDK will throw [onConnectionLost](https://write.woa.com/document/87030021158866944) when the connection to the cloud is disconnected, then it will attempt to re-establish the connection with the cloud and throw this event. Once the connection is restored, it will throw [onConnectionRecovery](https://write.woa.com/document/87030021158866944).
1275
+
1276
+ ## onConnectionRecovery
1277
+
1278
+
1279
+
1280
+ #### The connection between the SDK and the cloud has been restored.
1281
+
1282
+ The SDK will throw [onConnectionLost](https://write.woa.com/document/87030021158866944) when the connection to the cloud is disconnected. It will then attempt to re-establish the connection and throw [onTryToReconnect](https://write.woa.com/document/87030021158866944). Once the connection is restored, this event callback will be triggered.
1283
+
1284
+ ## onCameraDidReady
1285
+
1286
+
1287
+
1288
+ #### Camera is ready
1289
+
1290
+ When you call startLocalPreivew, the SDK will attempt to enable the camera. If successful, this event will be thrown.
1291
+
1292
+ If enabling the camera fails, it is most likely because the current application does not have access permissions to the camera or the camera is currently being used exclusively by another application.
1293
+
1294
+ You can capture the [onError](https://write.woa.com/document/87030021158866944) event callback to understand these exceptional conditions and prompt users through the UI interface.
1295
+
1296
+ ## onMicDidReady
1297
+
1298
+
1299
+
1300
+ #### Microphone is ready
1301
+
1302
+ When you call [startLocalAudio](https://write.woa.com/document/87030026264555520), the SDK will attempt to enable the microphone. If successful, this event will be thrown.
1303
+
1304
+ If enabling the microphone fails, it is most likely because the current application does not have access permissions to the microphone or the microphone is currently being used exclusively by another application.
1305
+
1306
+ You can capture the [onError](https://write.woa.com/document/87030021158866944) event callback to understand these exceptional conditions and prompt users through the UI interface.
1307
+
1308
+ ## onUserVoiceVolume
1309
+
1310
+
1311
+
1312
+ #### Callback for volume feedback
1313
+
1314
+ The SDK can assess the volume of each audio stream and periodically trigger this event callback. You can provide corresponding UI indications based on the volume, such as `waveform chart` or `volume slider`.
1315
+
1316
+ To implement this feature, you need to call [enableAudioVolumeEvaluation](https://write.woa.com/document/87030026264555520) to enable this capability and set the time interval for event triggers.
1317
+
1318
+ It is important to note that, regardless of whether anyone is speaking in the current room, the SDK will periodically trigger this event callback at the interval you set.
1319
+ <table>
1320
+ <tr>
1321
+ <td rowspan="1" colSpan="1" >Parameters</td>
1322
+
1323
+ <td rowspan="1" colSpan="1" >Description</td>
1324
+ </tr>
1325
+
1326
+ <tr>
1327
+ <td rowspan="1" colSpan="1" >totalVolume</td>
1328
+
1329
+ <td rowspan="1" colSpan="1" >The total volume level of all remote users, with a range of 0 to 100.</td>
1330
+ </tr>
1331
+
1332
+ <tr>
1333
+ <td rowspan="1" colSpan="1" >userVolumes</td>
1334
+
1335
+ <td rowspan="1" colSpan="1" >It is an array that holds the volume levels of all speaking users, with a range of 0 to 100.</td>
1336
+ </tr>
1337
+ </table>
1338
+
1339
+
1340
+ > **Note**
1341
+ >
1342
+
1343
+ > userVolumes is an array. For each element in the array, if the userId is empty, it represents the volume level collected by the local microphone. If the userId is not empty, it represents the volume level of remote users.
1344
+ >
1345
+
1346
+
1347
+ ## onDeviceChange
1348
+
1349
+
1350
+
1351
+ #### Local device connection status has changed (applicable only to desktop systems)
1352
+
1353
+ When local devices (including camera, microphone, and speaker) are plugged in or unplugged, the SDK will trigger this event callback.
1354
+ <table>
1355
+ <tr>
1356
+ <td rowspan="1" colSpan="1" >Parameters</td>
1357
+
1358
+ <td rowspan="1" colSpan="1" >Description</td>
1359
+ </tr>
1360
+
1361
+ <tr>
1362
+ <td rowspan="1" colSpan="1" >deviceId</td>
1363
+
1364
+ <td rowspan="1" colSpan="1" >Device ID.</td>
1365
+ </tr>
1366
+
1367
+ <tr>
1368
+ <td rowspan="1" colSpan="1" >deviceType</td>
1369
+
1370
+ <td rowspan="1" colSpan="1" >Device Type. 0: Microphone device; 1: Speaker device; 2: Camera device.</td>
1371
+ </tr>
1372
+
1373
+ <tr>
1374
+ <td rowspan="1" colSpan="1" >state</td>
1375
+
1376
+ <td rowspan="1" colSpan="1" >On/Off status, 0: Device added; 1: Device removed; 2: Device enabled.</td>
1377
+ </tr>
1378
+ </table>
1379
+
1380
+
1381
+ ## onAudioDeviceCaptureVolumeChanged
1382
+
1383
+
1384
+
1385
+ #### Current system mic capture volume has changed
1386
+
1387
+ On desktop operating systems like Mac or Windows, users can find the sound settings panel in the settings center and set the microphone's capture volume level.
1388
+
1389
+ The larger the microphone capture volume set by the user, the larger the original volume of the sound captured by the microphone will be; conversely, the smaller it will be.
1390
+
1391
+ On some models of keyboards and laptops, users can also mute the microphone by pressing the `Disable Microphone` button (the icon is a `Microphone` with a slash representing disable).
1392
+
1393
+
1394
+
1395
+ When the user sets the microphone capture volume of the operating system through the system settings interface or shortcut keys on the keyboard, the SDK will trigger this event.
1396
+ <table>
1397
+ <tr>
1398
+ <td rowspan="1" colSpan="1" >Parameters</td>
1399
+
1400
+ <td rowspan="1" colSpan="1" >Description</td>
1401
+ </tr>
1402
+
1403
+ <tr>
1404
+ <td rowspan="1" colSpan="1" >muted</td>
1405
+
1406
+ <td rowspan="1" colSpan="1" >Is the microphone disabled by the user: true for disabled, false for enabled.</td>
1407
+ </tr>
1408
+
1409
+ <tr>
1410
+ <td rowspan="1" colSpan="1" >volume</td>
1411
+
1412
+ <td rowspan="1" colSpan="1" >System capture volume, range 0 - 100, can be adjusted by dragging on the sound settings panel of the system.</td>
1413
+ </tr>
1414
+ </table>
1415
+
1416
+
1417
+ > **Note**
1418
+ >
1419
+
1420
+ > You need to call the [enableAudioVolumeEvaluation](https://write.woa.com/document/87030026264555520) interface and set the interval greater than 0 to enable this event callback, set the interval to 0 to disable this event callback.
1421
+ >
1422
+
1423
+
1424
+ ## onAudioDevicePlayoutVolumeChanged
1425
+
1426
+
1427
+
1428
+ #### Current system playback volume has changed
1429
+
1430
+ On desktop operating systems like Mac or Windows, users can find the sound settings panel in the settings center and set the system playback volume.
1431
+
1432
+ On some models of keyboards and laptops, users can also mute the system by pressing the "Mute" button (the icon is a speaker with a slash representing disable).
1433
+
1434
+
1435
+
1436
+ When the user sets the system playback volume through the system settings interface or shortcut keys on the keyboard, the SDK will trigger this event.
1437
+ <table>
1438
+ <tr>
1439
+ <td rowspan="1" colSpan="1" >Parameters</td>
1440
+
1441
+ <td rowspan="1" colSpan="1" >Description</td>
1442
+ </tr>
1443
+
1444
+ <tr>
1445
+ <td rowspan="1" colSpan="1" >muted</td>
1446
+
1447
+ <td rowspan="1" colSpan="1" >Is the system muted by the user: true for muted, false for restored.</td>
1448
+ </tr>
1449
+
1450
+ <tr>
1451
+ <td rowspan="1" colSpan="1" >volume</td>
1452
+
1453
+ <td rowspan="1" colSpan="1" >System playback volume, range 0 - 100. Users can adjust it by dragging on the system's sound settings panel.</td>
1454
+ </tr>
1455
+ </table>
1456
+
1457
+
1458
+ > **Note**
1459
+ >
1460
+
1461
+ > You need to call the [enableAudioVolumeEvaluation](https://write.woa.com/document/87030026264555520) interface and set the interval greater than 0 to enable this event callback, set the interval to 0 to disable this event callback.
1462
+ >
1463
+
1464
+
1465
+ ## onSystemAudioLoopbackError
1466
+
1467
+
1468
+
1469
+ #### Event callback for successfully turning on system sound acquisition (applicable only to desktop systems)
1470
+
1471
+ On macOS, you can call [startSystemAudioLoopback](https://write.woa.com/document/87030026264555520) to install an audio driver on the current system, allowing the SDK to capture the sound played by the macOS system.
1472
+
1473
+ On Windows, you can call [startSystemAudioLoopback](https://write.woa.com/document/87030026264555520) to let the SDK capture the sound played by the Windows system.
1474
+
1475
+ When used for film teaching or music live streaming, the teacher can use this feature to allow the SDK to capture the sound played in the movie, so that students in the same room can hear the movie's sound.
1476
+
1477
+ The SDK will throw an event callback with the result of whether the system sound capture was successfully enabled, and you need to pay attention to the error code in the parameters.
1478
+ <table>
1479
+ <tr>
1480
+ <td rowspan="1" colSpan="1" >Parameters</td>
1481
+
1482
+ <td rowspan="1" colSpan="1" >Description</td>
1483
+ </tr>
1484
+
1485
+ <tr>
1486
+ <td rowspan="1" colSpan="1" >err</td>
1487
+
1488
+ <td rowspan="1" colSpan="1" >ERR_NULL indicates success, any other value indicates failure.</td>
1489
+ </tr>
1490
+ </table>
1491
+
1492
+
1493
+ ## onTestMicVolume
1494
+
1495
+
1496
+
1497
+ #### Volume callback while testing the microphone
1498
+
1499
+ When you call [startMicDeviceTest](https://write.woa.com/document/87030115247763456) to test if the microphone is working properly, the SDK will continuously throw this callback. The parameter volume represents the volume level currently captured by the microphone.
1500
+
1501
+ If there are fluctuations in volume during the test, it indicates that the microphone is in good condition; if the volume value remains at 0, it indicates that the microphone is abnormal and the user should be prompted to replace it.
1502
+ <table>
1503
+ <tr>
1504
+ <td rowspan="1" colSpan="1" >Parameters</td>
1505
+
1506
+ <td rowspan="1" colSpan="1" >Description</td>
1507
+ </tr>
1508
+
1509
+ <tr>
1510
+ <td rowspan="1" colSpan="1" >volume</td>
1511
+
1512
+ <td rowspan="1" colSpan="1" >The volume value captured by the microphone, range 0 - 100.</td>
1513
+ </tr>
1514
+ </table>
1515
+
1516
+
1517
+ ## onTestSpeakerVolume
1518
+
1519
+
1520
+
1521
+ #### Volume callback while testing the speaker
1522
+
1523
+ When you call [startSpeakerDeviceTest](https://write.woa.com/document/87030115247763456) to test if the speaker is working properly, the SDK will continuously throw this callback.
1524
+
1525
+ The parameter volume represents the volume level of the sound the SDK submits to the system speaker for playback. If this value continues to change but the user reports hearing no sound, it indicates a problem with the speaker.
1526
+ <table>
1527
+ <tr>
1528
+ <td rowspan="1" colSpan="1" >Parameters</td>
1529
+
1530
+ <td rowspan="1" colSpan="1" >Description</td>
1531
+ </tr>
1532
+
1533
+ <tr>
1534
+ <td rowspan="1" colSpan="1" >volume</td>
1535
+
1536
+ <td rowspan="1" colSpan="1" >The volume of the sound the SDK submits to the speaker for playback, range 0 - 100.</td>
1537
+ </tr>
1538
+ </table>
1539
+
1540
+
1541
+ ## onRecvCustomCmdMsg
1542
+
1543
+
1544
+
1545
+ #### Receipt of a custom Definition message
1546
+
1547
+ When a user in a room uses [sendCustomCmdMsg](https://write.woa.com/document/87030026264555520) to send a Definition UDP Message, other users in the room can receive the message through the onRecvCustomCmdMsg event callback.
1548
+ <table>
1549
+ <tr>
1550
+ <td rowspan="1" colSpan="1" >Parameters</td>
1551
+
1552
+ <td rowspan="1" colSpan="1" >Description</td>
1553
+ </tr>
1554
+
1555
+ <tr>
1556
+ <td rowspan="1" colSpan="1" >cmdID</td>
1557
+
1558
+ <td rowspan="1" colSpan="1" >Command ID.</td>
1559
+ </tr>
1560
+
1561
+ <tr>
1562
+ <td rowspan="1" colSpan="1" >message</td>
1563
+
1564
+ <td rowspan="1" colSpan="1" >Message Data.</td>
1565
+ </tr>
1566
+
1567
+ <tr>
1568
+ <td rowspan="1" colSpan="1" >seq</td>
1569
+
1570
+ <td rowspan="1" colSpan="1" >Message serial number.</td>
1571
+ </tr>
1572
+
1573
+ <tr>
1574
+ <td rowspan="1" colSpan="1" >userId</td>
1575
+
1576
+ <td rowspan="1" colSpan="1" >User identifier.</td>
1577
+ </tr>
1578
+ </table>
1579
+
1580
+
1581
+ ## onMissCustomCmdMsg
1582
+
1583
+
1584
+
1585
+ #### Event callback for lost custom Definition messages
1586
+
1587
+ When you use [sendCustomCmdMsg](https://write.woa.com/document/87030026264555520) to send a Definition UDP message, even if reliable transmission is set, it cannot guarantee 100% message delivery, but the probability of message loss is very low and meets conventional reliability requirements.
1588
+
1589
+ After setting reliable transmission on the sender side, the SDK will notify the number of lost Definition messages during the past time period (usually 5 seconds) through this callback.
1590
+ <table>
1591
+ <tr>
1592
+ <td rowspan="1" colSpan="1" >Parameters</td>
1593
+
1594
+ <td rowspan="1" colSpan="1" >Description</td>
1595
+ </tr>
1596
+
1597
+ <tr>
1598
+ <td rowspan="1" colSpan="1" >cmdID</td>
1599
+
1600
+ <td rowspan="1" colSpan="1" >Command ID.</td>
1601
+ </tr>
1602
+
1603
+ <tr>
1604
+ <td rowspan="1" colSpan="1" >errCode</td>
1605
+
1606
+ <td rowspan="1" colSpan="1" >Error code.</td>
1607
+ </tr>
1608
+
1609
+ <tr>
1610
+ <td rowspan="1" colSpan="1" >missed</td>
1611
+
1612
+ <td rowspan="1" colSpan="1" >Number of lost messages.</td>
1613
+ </tr>
1614
+
1615
+ <tr>
1616
+ <td rowspan="1" colSpan="1" >userId</td>
1617
+
1618
+ <td rowspan="1" colSpan="1" >User identifier.</td>
1619
+ </tr>
1620
+ </table>
1621
+
1622
+
1623
+ > **Note**
1624
+ >
1625
+
1626
+ > Only if reliable transmission is set on the sender side can the receiver receive the message loss callback.
1627
+ >
1628
+
1629
+
1630
+ ## onRecvSEIMsg
1631
+
1632
+
1633
+
1634
+ #### Callback for receiving SEI message
1635
+
1636
+ When a user in the room sends an SEI message through the video frame using [sendSEIMsg](https://write.woa.com/document/87030026264555520), other users in the room can receive the message via the onRecvSEIMsg event callback.
1637
+ <table>
1638
+ <tr>
1639
+ <td rowspan="1" colSpan="1" >Parameters</td>
1640
+
1641
+ <td rowspan="1" colSpan="1" >Description</td>
1642
+ </tr>
1643
+
1644
+ <tr>
1645
+ <td rowspan="1" colSpan="1" >message</td>
1646
+
1647
+ <td rowspan="1" colSpan="1" >Data.</td>
1648
+ </tr>
1649
+
1650
+ <tr>
1651
+ <td rowspan="1" colSpan="1" >userId</td>
1652
+
1653
+ <td rowspan="1" colSpan="1" >User identifier.</td>
1654
+ </tr>
1655
+ </table>
1656
+
1657
+
1658
+ ## onStartPublishing
1659
+
1660
+
1661
+
1662
+ #### Event callback for starting to publish audio and video streams to Tencent CSS CDN
1663
+
1664
+ When you call startPublishing to start publishing audio and video streams to the Tencent CSS CDN, the SDK will immediately synchronize this command to the cloud server.
1665
+
1666
+ The SDK will then receive the processing results from the cloud server and notify you of the execution results of the command through this event callback.
1667
+ <table>
1668
+ <tr>
1669
+ <td rowspan="1" colSpan="1" >Parameters</td>
1670
+
1671
+ <td rowspan="1" colSpan="1" >Description</td>
1672
+ </tr>
1673
+
1674
+ <tr>
1675
+ <td rowspan="1" colSpan="1" >err</td>
1676
+
1677
+ <td rowspan="1" colSpan="1" >0 indicates success, other values indicate failure.</td>
1678
+ </tr>
1679
+
1680
+ <tr>
1681
+ <td rowspan="1" colSpan="1" >errMsg</td>
1682
+
1683
+ <td rowspan="1" colSpan="1" >Specific error reasons.</td>
1684
+ </tr>
1685
+ </table>
1686
+
1687
+
1688
+ ## onStopPublishing
1689
+
1690
+
1691
+
1692
+ #### Event callback for stopping the publishing of audio and video streams to Tencent CSS CDN
1693
+
1694
+ When you call stopPublishing to stop publishing audio and video streams to the Tencent CSS CDN, the SDK will immediately synchronize this command to the cloud server.
1695
+
1696
+ The SDK will then receive the processing results from the cloud server and notify you of the execution results of the command through this event callback.
1697
+ <table>
1698
+ <tr>
1699
+ <td rowspan="1" colSpan="1" >Parameters</td>
1700
+
1701
+ <td rowspan="1" colSpan="1" >Description</td>
1702
+ </tr>
1703
+
1704
+ <tr>
1705
+ <td rowspan="1" colSpan="1" >err</td>
1706
+
1707
+ <td rowspan="1" colSpan="1" >0 indicates success, other values indicate failure.</td>
1708
+ </tr>
1709
+
1710
+ <tr>
1711
+ <td rowspan="1" colSpan="1" >errMsg</td>
1712
+
1713
+ <td rowspan="1" colSpan="1" >Specific error reasons.</td>
1714
+ </tr>
1715
+ </table>
1716
+
1717
+
1718
+ ## onStartPublishCDNStream
1719
+
1720
+
1721
+
1722
+ #### Event callback for starting to publish audio and video streams to a non-Tencent Cloud CDN
1723
+
1724
+ When you call startPublishCDNStream to start publishing audio and video streams to a non-Tencent CSS CDN, the SDK will immediately synchronize this command to the cloud server. The SDK will then receive the processing results from the cloud server and notify you of the execution results of the command through this event callback.
1725
+ <table>
1726
+ <tr>
1727
+ <td rowspan="1" colSpan="1" >Parameters</td>
1728
+
1729
+ <td rowspan="1" colSpan="1" >Description</td>
1730
+ </tr>
1731
+
1732
+ <tr>
1733
+ <td rowspan="1" colSpan="1" >err</td>
1734
+
1735
+ <td rowspan="1" colSpan="1" >0 indicates success, other values indicate failure.</td>
1736
+ </tr>
1737
+
1738
+ <tr>
1739
+ <td rowspan="1" colSpan="1" >errMsg</td>
1740
+
1741
+ <td rowspan="1" colSpan="1" >Specific error reasons.</td>
1742
+ </tr>
1743
+ </table>
1744
+
1745
+
1746
+ > **Note**
1747
+ >
1748
+
1749
+ > When you receive a successful event callback, it only indicates that your publishing command has been synchronized to the Tencent Cloud backend server, but if the target CDN provider's server does not accept the video stream, it may still result in a publishing failure.
1750
+ >
1751
+
1752
+
1753
+ ## onStopPublishCDNStream
1754
+
1755
+
1756
+
1757
+ #### Event callback for stopping the publishing of audio and video streams to a non-Tencent Cloud CDN
1758
+
1759
+ When you call stopPublishCDNStream to stop publishing audio and video streams to a non-Tencent CSS CDN, the SDK will immediately synchronize this command to the cloud server. The SDK will then receive the processing results from the cloud server and notify you of the execution results of the command through this event callback.
1760
+ <table>
1761
+ <tr>
1762
+ <td rowspan="1" colSpan="1" >Parameters</td>
1763
+
1764
+ <td rowspan="1" colSpan="1" >Description</td>
1765
+ </tr>
1766
+
1767
+ <tr>
1768
+ <td rowspan="1" colSpan="1" >err</td>
1769
+
1770
+ <td rowspan="1" colSpan="1" >0 indicates success, other values indicate failure.</td>
1771
+ </tr>
1772
+
1773
+ <tr>
1774
+ <td rowspan="1" colSpan="1" >errMsg</td>
1775
+
1776
+ <td rowspan="1" colSpan="1" >Specific error reasons.</td>
1777
+ </tr>
1778
+ </table>
1779
+
1780
+
1781
+ ## onSetMixTranscodingConfig
1782
+
1783
+
1784
+
1785
+ #### Event callback for setting the layout and transcoding parameters of Cloud Mixed Streaming
1786
+
1787
+ When you call setMixTranscodingConfig to adjust the layout and transcoding parameters of cloud mixed streaming, the SDK will immediately sync this adjustment command to the cloud server. The SDK will then receive the process results from the cloud server and notify you of the execution results through this event callback.
1788
+ <table>
1789
+ <tr>
1790
+ <td rowspan="1" colSpan="1" >Parameters</td>
1791
+
1792
+ <td rowspan="1" colSpan="1" >Description</td>
1793
+ </tr>
1794
+
1795
+ <tr>
1796
+ <td rowspan="1" colSpan="1" >err</td>
1797
+
1798
+ <td rowspan="1" colSpan="1" >Error code: 0 indicates success, other values indicate failure.</td>
1799
+ </tr>
1800
+
1801
+ <tr>
1802
+ <td rowspan="1" colSpan="1" >errMsg</td>
1803
+
1804
+ <td rowspan="1" colSpan="1" >Specific error reason.</td>
1805
+ </tr>
1806
+ </table>
1807
+
1808
+
1809
+ ## onStartPublishMediaStream
1810
+
1811
+
1812
+
1813
+ #### Event callback for starting to publish the media stream
1814
+
1815
+ When you call [startPublishMediaStream](https://write.woa.com/document/87030026264555520) to start publishing the media stream to TRTC backend services, the SDK will immediately sync this command to the cloud server. The SDK will then receive the process results from the cloud server and notify you of the execution results through this event callback.
1816
+ <table>
1817
+ <tr>
1818
+ <td rowspan="1" colSpan="1" >Parameters</td>
1819
+
1820
+ <td rowspan="1" colSpan="1" >Description</td>
1821
+ </tr>
1822
+
1823
+ <tr>
1824
+ <td rowspan="1" colSpan="1" >code</td>
1825
+
1826
+ <td rowspan="1" colSpan="1" >Callback result, 0 indicates success, other values indicate failure.</td>
1827
+ </tr>
1828
+
1829
+ <tr>
1830
+ <td rowspan="1" colSpan="1" >extraInfo</td>
1831
+
1832
+ <td rowspan="1" colSpan="1" >Expand information field, some error codes may carry additional information to help locate the problem.</td>
1833
+ </tr>
1834
+
1835
+ <tr>
1836
+ <td rowspan="1" colSpan="1" >message</td>
1837
+
1838
+ <td rowspan="1" colSpan="1" >Specific callback information.</td>
1839
+ </tr>
1840
+
1841
+ <tr>
1842
+ <td rowspan="1" colSpan="1" >taskId</td>
1843
+
1844
+ <td rowspan="1" colSpan="1" >When the request is successful, the TRTC backend will provide the taskId of this task in the callback. Subsequently, you can use this taskId in combination with [updatePublishMediaStream](https://write.woa.com/document/87030026264555520) and [stopPublishMediaStream](https://write.woa.com/document/87030026264555520) to update and stop.</td>
1845
+ </tr>
1846
+ </table>
1847
+
1848
+
1849
+ ## onUpdatePublishMediaStream
1850
+
1851
+
1852
+
1853
+ #### Event callback for updating the media stream
1854
+
1855
+ When you call the media stream publishing interface ([updatePublishMediaStream](https://write.woa.com/document/87030026264555520)) to start updating the media stream to the TRTC backend services, the SDK will immediately sync this command to the cloud server. The SDK will then receive the process results from the cloud server and notify you of the execution results through this event callback.
1856
+ <table>
1857
+ <tr>
1858
+ <td rowspan="1" colSpan="1" >Parameters</td>
1859
+
1860
+ <td rowspan="1" colSpan="1" >Description</td>
1861
+ </tr>
1862
+
1863
+ <tr>
1864
+ <td rowspan="1" colSpan="1" >code</td>
1865
+
1866
+ <td rowspan="1" colSpan="1" >Callback result, 0 indicates success, other values indicate failure.</td>
1867
+ </tr>
1868
+
1869
+ <tr>
1870
+ <td rowspan="1" colSpan="1" >extraInfo</td>
1871
+
1872
+ <td rowspan="1" colSpan="1" >Expand information field, some error codes may carry additional information to help locate the problem.</td>
1873
+ </tr>
1874
+
1875
+ <tr>
1876
+ <td rowspan="1" colSpan="1" >message</td>
1877
+
1878
+ <td rowspan="1" colSpan="1" >Specific callback information.</td>
1879
+ </tr>
1880
+
1881
+ <tr>
1882
+ <td rowspan="1" colSpan="1" >taskId</td>
1883
+
1884
+ <td rowspan="1" colSpan="1" >The taskId you provide when calling the media stream publishing interface ([updatePublishMediaStream](https://write.woa.com/document/87030026264555520)) will be brought back to you through this callback, to identify which update request this callback belongs to.</td>
1885
+ </tr>
1886
+ </table>
1887
+
1888
+
1889
+ ## onStopPublishMediaStream
1890
+
1891
+
1892
+
1893
+ #### Event callback for stopping the media stream
1894
+
1895
+ When you call stop publishing media stream ([stopPublishMediaStream](https://write.woa.com/document/87030026264555520)) to stop the media stream to TRTC backend service, the SDK will immediately synchronize this command to the cloud server. Subsequently, the SDK will receive the process results from the cloud server and notify you of the execution results of the command through this event callback.
1896
+ <table>
1897
+ <tr>
1898
+ <td rowspan="1" colSpan="1" >Parameters</td>
1899
+
1900
+ <td rowspan="1" colSpan="1" >Description</td>
1901
+ </tr>
1902
+
1903
+ <tr>
1904
+ <td rowspan="1" colSpan="1" >code</td>
1905
+
1906
+ <td rowspan="1" colSpan="1" >Callback result, 0 indicates success, other values indicate failure.</td>
1907
+ </tr>
1908
+
1909
+ <tr>
1910
+ <td rowspan="1" colSpan="1" >extraInfo</td>
1911
+
1912
+ <td rowspan="1" colSpan="1" >Expand information field, some error codes may carry additional information to help locate the problem.</td>
1913
+ </tr>
1914
+
1915
+ <tr>
1916
+ <td rowspan="1" colSpan="1" >message</td>
1917
+
1918
+ <td rowspan="1" colSpan="1" >Specific callback information.</td>
1919
+ </tr>
1920
+
1921
+ <tr>
1922
+ <td rowspan="1" colSpan="1" >taskId</td>
1923
+
1924
+ <td rowspan="1" colSpan="1" >The taskId you passed in when you called stop publishing media stream ([stopPublishMediaStream](https://write.woa.com/document/87030026264555520)) will be brought back to you through this callback, identifying which stop request this callback belongs to.</td>
1925
+ </tr>
1926
+ </table>
1927
+
1928
+
1929
+ ## onCdnStreamStateChanged
1930
+
1931
+
1932
+
1933
+ #### RTMP/RTMPS streaming status change callback
1934
+
1935
+ When you call [startPublishMediaStream](https://write.woa.com/document/87030026264555520) to start publishing media stream to TRTC backend service, the SDK will immediately synchronize this command to the cloud service.
1936
+
1937
+ If you set the URL configuration for publishing audio and video streaming to Tencent or third-party CDN in the target stream configuration ([TRTCPublishTarget](https://write.woa.com/document/87030132707430400)), the specific RTMP or RTMPS streaming status will be synchronized to you through this callback.
1938
+ <table>
1939
+ <tr>
1940
+ <td rowspan="1" colSpan="1" >Parameters</td>
1941
+
1942
+ <td rowspan="1" colSpan="1" >Description</td>
1943
+ </tr>
1944
+
1945
+ <tr>
1946
+ <td rowspan="1" colSpan="1" >cdnUrl</td>
1947
+
1948
+ <td rowspan="1" colSpan="1" >The URL you passed in through the target stream configuration ([TRTCPublishTarget](https://write.woa.com/document/87030132707430400)) when you called [startPublishMediaStream](https://write.woa.com/document/87030026264555520) will be synchronized to you through this callback when the streaming status changes.</td>
1949
+ </tr>
1950
+
1951
+ <tr>
1952
+ <td rowspan="1" colSpan="1" >code</td>
1953
+
1954
+ <td rowspan="1" colSpan="1" >Stream Push Result, 0 means success, other values indicate an error.</td>
1955
+ </tr>
1956
+
1957
+ <tr>
1958
+ <td rowspan="1" colSpan="1" >extraInfo</td>
1959
+
1960
+ <td rowspan="1" colSpan="1" >Expand information field, some error codes may carry additional information to help locate the problem.</td>
1961
+ </tr>
1962
+
1963
+ <tr>
1964
+ <td rowspan="1" colSpan="1" >message</td>
1965
+
1966
+ <td rowspan="1" colSpan="1" >Specific Stream Push Information.</td>
1967
+ </tr>
1968
+
1969
+ <tr>
1970
+ <td rowspan="1" colSpan="1" >status</td>
1971
+
1972
+ <td rowspan="1" colSpan="1" >Streaming Status.<br>- 0: Streaming not started or already ended. This status is returned when you call [stopPublishMediaStream](https://write.woa.com/document/87030026264555520).<br>- 1: Connecting to TRTC server and CDN server. If not immediately successful, TRTC backend service will retry multiple times and return this status (callback every 5s). If successful, it enters status 2; if server error occurs or streaming is not successful within 60 seconds, it enters status 4.<br>- 2: CDN streaming is in progress. This status is returned when streaming is successful.<br>- 3: TRTC server and CDN server streaming interruption, recovering. When CDN has an issue or streaming briefly interrupts, the TRTC backend service will automatically attempt to recover streaming and return this status (callback every 5 seconds). If streaming recovers successfully, it will transition to status 2; if server error occurs or recovery fails within 60 seconds, it will transition to status 4.<br>- 4: TRTC server and CDN server streaming interrupted, and recovery or connection timeout. At this point, streaming failed, you can call [updatePublishMediaStream](https://write.woa.com/document/87030026264555520) again to attempt streaming.<br>- 5: Disconnecting TRTC server and CDN server. When you call [stopPublishMediaStream](https://write.woa.com/document/87030026264555520), the TRTC backend service will transition to status 5 and then status 0.</td>
1973
+ </tr>
1974
+ </table>
1975
+
1976
+
1977
+ ## onScreenCaptureStarted
1978
+
1979
+
1980
+
1981
+ #### Event callback for starting screen sharing
1982
+
1983
+ When you start screen sharing through [startScreenCapture](https://write.woa.com/document/87030026264555520) or related interfaces, the SDK will trigger this event callback.
1984
+
1985
+ ## onScreenCapturePaused
1986
+
1987
+
1988
+
1989
+ #### Event callback for pausing screen sharing
1990
+
1991
+ When you pause screen sharing through [pauseScreenCapture](https://write.woa.com/document/87030026264555520), the SDK will trigger this event callback.
1992
+ <table>
1993
+ <tr>
1994
+ <td rowspan="1" colSpan="1" >Parameters</td>
1995
+
1996
+ <td rowspan="1" colSpan="1" >Description</td>
1997
+ </tr>
1998
+
1999
+ <tr>
2000
+ <td rowspan="1" colSpan="1" >reason</td>
2001
+
2002
+ <td rowspan="1" colSpan="1" >Reason.<br>- 0: User-initiated pause.<br>- 1: Note that the meaning of this field slightly differs on MAC and Windows platforms. Screen window not visible pause (Mac). Pause due to setting screen sharing parameters (Windows).<br>- 2: Pause due to screen sharing window being minimized (Windows only).<br>- 3: Pause due to screen sharing window being hidden (Windows only).</td>
2003
+ </tr>
2004
+ </table>
2005
+
2006
+
2007
+ ## onScreenCaptureResumed
2008
+
2009
+
2010
+
2011
+ #### Event callback for resuming screen sharing
2012
+
2013
+ When you resume screen sharing through [resumeScreenCapture](https://write.woa.com/document/87030026264555520), the SDK will trigger this event callback.
2014
+ <table>
2015
+ <tr>
2016
+ <td rowspan="1" colSpan="1" >Parameters</td>
2017
+
2018
+ <td rowspan="1" colSpan="1" >Description</td>
2019
+ </tr>
2020
+
2021
+ <tr>
2022
+ <td rowspan="1" colSpan="1" >reason</td>
2023
+
2024
+ <td rowspan="1" colSpan="1" >Reason for recovery.<br>- 0: User-initiated recovery.<br>- 1: Note that the meaning of this field slightly differs between MAC and Windows platforms. For MAC, the screen window becomes visible again to resume sharing. For Windows, the screen sharing parameters are automatically restored after configuration.<br>- 2: Indicates that the screen sharing window is restored from being minimized (Windows only).<br>- 3: Indicates that the screen sharing window is restored from being hidden (Windows only).</td>
2025
+ </tr>
2026
+ </table>
2027
+
2028
+
2029
+ ## onScreenCaptureStoped
2030
+
2031
+
2032
+
2033
+ #### Event callback for stopping screen sharing
2034
+
2035
+ When you stop screen sharing by calling [stopScreenCapture](https://write.woa.com/document/87030026264555520), the SDK will trigger this event callback.
2036
+ <table>
2037
+ <tr>
2038
+ <td rowspan="1" colSpan="1" >Parameters</td>
2039
+
2040
+ <td rowspan="1" colSpan="1" >Description</td>
2041
+ </tr>
2042
+
2043
+ <tr>
2044
+ <td rowspan="1" colSpan="1" >reason</td>
2045
+
2046
+ <td rowspan="1" colSpan="1" >Stop Reason, 0: User proactively stopped; 1: Screen window closed causing stop; 2: Indicates a change in the display screen status for screen sharing (e.g., interface unplugged, change in projection mode, etc.).</td>
2047
+ </tr>
2048
+ </table>
2049
+
2050
+
2051
+ ## onScreenCaptureCovered
2052
+
2053
+
2054
+
2055
+ #### Event callback for when the target window of screen sharing is blocked (only applicable for Windows operating system)
2056
+
2057
+ When the target window for screen sharing is occluded and cannot be captured normally, the SDK will throw this event callback. Upon receiving this event callback, you can prompt the user to move the occluding window through some UI changes.
2058
+
2059
+ ## onLocalRecordBegin
2060
+
2061
+
2062
+
2063
+ #### Event callback for the local recording task that has started
2064
+
2065
+ When you start a local media recording task by calling [startLocalRecording](https://write.woa.com/document/87030026264555520), the SDK will trigger this event callback to notify you whether the recording task has successfully started.
2066
+ <table>
2067
+ <tr>
2068
+ <td rowspan="1" colSpan="1" >Parameters</td>
2069
+
2070
+ <td rowspan="1" colSpan="1" >Description</td>
2071
+ </tr>
2072
+
2073
+ <tr>
2074
+ <td rowspan="1" colSpan="1" >errCode</td>
2075
+
2076
+ <td rowspan="1" colSpan="1" >Status Code.<br>- 0: Recording task started successfully.<br>- -1: Internal error caused the recording task to fail to start.<br>- -2: Incorrect file suffix name (e.g., unsupported recording format).<br>- -6: Recording has already started, needs to stop recording first.<br>- -7: Recording file already exists, needs to delete the file first.<br>- -8: No write permission in the recording directory, please check directory permissions.</td>
2077
+ </tr>
2078
+
2079
+ <tr>
2080
+ <td rowspan="1" colSpan="1" >storagePath</td>
2081
+
2082
+ <td rowspan="1" colSpan="1" >CFS path for recording.</td>
2083
+ </tr>
2084
+ </table>
2085
+
2086
+
2087
+ ## onLocalRecording
2088
+
2089
+
2090
+
2091
+ #### Progress event callback for an ongoing local recording task
2092
+
2093
+ After you successfully start a local media recording task by calling [startLocalRecording](https://write.woa.com/document/87030026264555520), the SDK will periodically trigger this event callback.
2094
+
2095
+ You can capture this event callback to know the health status of the recording task.
2096
+
2097
+ You can set the interval for this event callback when you call [startLocalRecording](https://write.woa.com/document/87030026264555520).
2098
+ <table>
2099
+ <tr>
2100
+ <td rowspan="1" colSpan="1" >Parameters</td>
2101
+
2102
+ <td rowspan="1" colSpan="1" >Description</td>
2103
+ </tr>
2104
+
2105
+ <tr>
2106
+ <td rowspan="1" colSpan="1" >duration</td>
2107
+
2108
+ <td rowspan="1" colSpan="1" >The cumulative recorded duration in milliseconds.</td>
2109
+ </tr>
2110
+
2111
+ <tr>
2112
+ <td rowspan="1" colSpan="1" >storagePath</td>
2113
+
2114
+ <td rowspan="1" colSpan="1" >CFS path for recording.</td>
2115
+ </tr>
2116
+ </table>
2117
+
2118
+
2119
+ ## onLocalRecordFragment
2120
+
2121
+
2122
+
2123
+ #### Event callback for local recording shard
2124
+
2125
+ When you enable shard recording, each completed shard will trigger a callback through this interface.
2126
+ <table>
2127
+ <tr>
2128
+ <td rowspan="1" colSpan="1" >Parameters</td>
2129
+
2130
+ <td rowspan="1" colSpan="1" >Description</td>
2131
+ </tr>
2132
+
2133
+ <tr>
2134
+ <td rowspan="1" colSpan="1" >storagePath</td>
2135
+
2136
+ <td rowspan="1" colSpan="1" >Shard CFS path.</td>
2137
+ </tr>
2138
+ </table>
2139
+
2140
+
2141
+ ## onLocalRecordComplete
2142
+
2143
+
2144
+
2145
+ #### Event callback for the local recording task that has ended
2146
+
2147
+ When you call [stopLocalRecording](https://write.woa.com/document/87030026264555520) to stop the local media recording task, the SDK will trigger this event callback to notify you of the final result of the recording task.
2148
+ <table>
2149
+ <tr>
2150
+ <td rowspan="1" colSpan="1" >Parameters</td>
2151
+
2152
+ <td rowspan="1" colSpan="1" >Description</td>
2153
+ </tr>
2154
+
2155
+ <tr>
2156
+ <td rowspan="1" colSpan="1" >errCode</td>
2157
+
2158
+ <td rowspan="1" colSpan="1" >Status Code.<br>- 0: Successfully ended the recording task.<br>- -1: Recording failed.<br>- -2: Changing resolution or switching between portrait and landscape mode caused the recording to end.<br>- -3: The recording duration is too short, or no video or audio data was captured. Please check the recording duration, or whether audio and video capture is enabled.</td>
2159
+ </tr>
2160
+
2161
+ <tr>
2162
+ <td rowspan="1" colSpan="1" >storagePath</td>
2163
+
2164
+ <td rowspan="1" colSpan="1" >CFS path for recording.</td>
2165
+ </tr>
2166
+ </table>
2167
+
2168
+
2169
+ ## onSnapshotComplete
2170
+
2171
+
2172
+
2173
+ #### Event callback for local screenshot completion
2174
+ <table>
2175
+ <tr>
2176
+ <td rowspan="1" colSpan="1" >Parameters</td>
2177
+
2178
+ <td rowspan="1" colSpan="1" >Description</td>
2179
+ </tr>
2180
+
2181
+ <tr>
2182
+ <td rowspan="1" colSpan="1" >bmp</td>
2183
+
2184
+ <td rowspan="1" colSpan="1" >Screenshot result, if bmp is null it means the screenshot operation failed.</td>
2185
+ </tr>
2186
+
2187
+ <tr>
2188
+ <td rowspan="1" colSpan="1" >data</td>
2189
+
2190
+ <td rowspan="1" colSpan="1" >Screenshot data, nullptr means the screenshot failed.</td>
2191
+ </tr>
2192
+
2193
+ <tr>
2194
+ <td rowspan="1" colSpan="1" >format</td>
2195
+
2196
+ <td rowspan="1" colSpan="1" >Screenshot data format, currently only supports TRTCVideoPixelFormat_BGRA32.</td>
2197
+ </tr>
2198
+
2199
+ <tr>
2200
+ <td rowspan="1" colSpan="1" >height</td>
2201
+
2202
+ <td rowspan="1" colSpan="1" >Height of the screenshot.</td>
2203
+ </tr>
2204
+
2205
+ <tr>
2206
+ <td rowspan="1" colSpan="1" >length</td>
2207
+
2208
+ <td rowspan="1" colSpan="1" >Length of the screenshot data, for BGRA32, length = width * height * 4.</td>
2209
+ </tr>
2210
+
2211
+ <tr>
2212
+ <td rowspan="1" colSpan="1" >type</td>
2213
+
2214
+ <td rowspan="1" colSpan="1" >Video stream type.</td>
2215
+ </tr>
2216
+
2217
+ <tr>
2218
+ <td rowspan="1" colSpan="1" >userId</td>
2219
+
2220
+ <td rowspan="1" colSpan="1" >User Identifier, if userId is an empty string, it means the local screen was captured.</td>
2221
+ </tr>
2222
+
2223
+ <tr>
2224
+ <td rowspan="1" colSpan="1" >width</td>
2225
+
2226
+ <td rowspan="1" colSpan="1" >Width of the screenshot.</td>
2227
+ </tr>
2228
+ </table>
2229
+
2230
+
2231
+ > **Note**
2232
+ >
2233
+
2234
+ > The parameters for the C++ interface and the Java interface across all platforms are different. The C++ interface uses 7 parameters to describe a screenshot, while the Java interface uses only one Bitmap to describe a screenshot.
2235
+ >
2236
+
2237
+
2238
+ ## onUserEnter
2239
+
2240
+
2241
+
2242
+ #### A host has joined the current room (deprecated)
2243
+
2244
+ @deprecated Starting from the new version, it is recommended to use [onRemoteUserEnterRoom](https://write.woa.com/document/87030021158866944) instead.
2245
+
2246
+ ## onUserExit
2247
+
2248
+
2249
+
2250
+ #### A host has left the current room (deprecated)
2251
+
2252
+ @deprecated Starting from the new version, it is recommended to use [onRemoteUserLeaveRoom](https://write.woa.com/document/87030021158866944) instead.
2253
+
2254
+ ## onAudioEffectFinished
2255
+
2256
+
2257
+
2258
+ #### Sound effect playback has ended (deprecated)
2259
+
2260
+ @deprecated Starting from the new version, it is recommended to use the [ITXAudioEffectManager](https://write.woa.com/document/87030074293530624) interface instead.
2261
+
2262
+ In the new interface, background music and sound effects are no longer distinguished and are unified with [startPlayMusic](https://write.woa.com/document/87030074293530624) instead.
2263
+
2264
+ ## onPlayBGMBegin
2265
+
2266
+
2267
+
2268
+ #### Start playing background music (deprecated)
2269
+
2270
+ @deprecated Starting from the new version, it is recommended to use the [ITXMusicPlayObserver](https://write.woa.com/document/87030074293530624) interface instead.
2271
+
2272
+ In the new interface, background music and sound effects are no longer distinguished and are unified with [startPlayMusic](https://write.woa.com/document/87030074293530624) instead.
2273
+
2274
+ ## onPlayBGMProgress
2275
+
2276
+
2277
+
2278
+ #### Playback progress callback for background music (deprecated)
2279
+
2280
+ @deprecated Starting from the new version, it is recommended to use the [ITXMusicPlayObserver](https://write.woa.com/document/87030074293530624) interface instead.
2281
+
2282
+ In the new interface, background music and sound effects are no longer distinguished and are unified with [startPlayMusic](https://write.woa.com/document/87030074293530624) instead.
2283
+
2284
+ ## onPlayBGMComplete
2285
+
2286
+
2287
+
2288
+ #### Background music playback has ended (deprecated)
2289
+
2290
+ @deprecated Starting from the new version, it is recommended to use the [ITXMusicPlayObserver](https://write.woa.com/document/87030074293530624) interface instead.
2291
+
2292
+ In the new interface, background music and sound effects are no longer distinguished and are unified with [startPlayMusic](https://write.woa.com/document/87030074293530624) instead.
2293
+
2294
+ ## onSpeedTest
2295
+
2296
+
2297
+
2298
+ #### Callback for server speed test results (deprecated)
2299
+
2300
+ @deprecated Starting from the new version, it is recommended to use the [onSpeedTestResult](https://write.woa.com/document/87030021158866944) interface instead.
2301
+
2302
+ ## onRenderVideoFrame
2303
+
2304
+
2305
+
2306
+ #### Self-definition video rendering callback
2307
+
2308
+ When you set a local or remote self-definition video rendering callback, the SDK will deliver the video frames, originally intended for the rendering controls, to you through this callback interface for self-definition rendering.
2309
+ <table>
2310
+ <tr>
2311
+ <td rowspan="1" colSpan="1" >Parameters</td>
2312
+
2313
+ <td rowspan="1" colSpan="1" >Description</td>
2314
+ </tr>
2315
+
2316
+ <tr>
2317
+ <td rowspan="1" colSpan="1" >frame</td>
2318
+
2319
+ <td rowspan="1" colSpan="1" >Information on video frames to be rendered.</td>
2320
+ </tr>
2321
+
2322
+ <tr>
2323
+ <td rowspan="1" colSpan="1" >streamType</td>
2324
+
2325
+ <td rowspan="1" colSpan="1" >Frequency stream type: Main (generally used for carrying camera footage) and Sub (generally used for carrying screen sharing footage).</td>
2326
+ </tr>
2327
+
2328
+ <tr>
2329
+ <td rowspan="1" colSpan="1" >userId</td>
2330
+
2331
+ <td rowspan="1" colSpan="1" >UserId of the video source. If it's a local video callback (setLocalVideoRenderDelegate), this parameter can be ignored.</td>
2332
+ </tr>
2333
+ </table>
2334
+
2335
+
2336
+ ## onGLContextCreated
2337
+
2338
+
2339
+
2340
+ #### Notification that the SDK's internal OpenGL environment has been created
2341
+
2342
+ ## onProcessVideoFrame
2343
+
2344
+
2345
+
2346
+ #### Video processing callback for integrating third-party beauty components
2347
+
2348
+ If you have purchased a third-party beauty filter component, you need to set the third-party beauty filter callback in TRTCCloud. TRTC will then deliver the video frames that need preprocessing through this callback interface.
2349
+
2350
+ You can then hand over the video frames from TRTC to the third-party beauty filter component for image processing. Since the data is readable and writable, the results from the third-party beauty filter can be synchronized back to TRTC for subsequent encoding and transmission.
2351
+
2352
+
2353
+
2354
+ Scenario 1: The beauty filter component generates a new texture on its own.
2355
+
2356
+ If the beauty filter component you are using generates a new texture (to carry the processed image) during the image processing, please set dstFrame.textureId to the new texture ID in the callback function:
2357
+ ``` cpp
2358
+ int onProcessVideoFrame(TRTCVideoFrame * srcFrame, TRTCVideoFrame *dstFrame) {
2359
+ dstFrame->textureId = mFURenderer.onDrawFrameSingleInput(srcFrame->textureId);
2360
+ return 0;
2361
+ }
2362
+ ```
2363
+
2364
+ Scenario 2: The beauty filter component requires you to provide the target texture.
2365
+
2366
+ If the third-party beauty filter module does not generate a new texture but requires an input texture and an output texture, you can consider the following solution:
2367
+ ``` cpp
2368
+ int onProcessVideoFrame(TRTCVideoFrame *srcFrame, TRTCVideoFrame *dstFrame) {
2369
+ thirdparty_process(srcFrame->textureId, srcFrame->width, srcFrame->height, dstFrame->textureId);
2370
+ return 0;
2371
+ }
2372
+ ```
2373
+ <table>
2374
+ <tr>
2375
+ <td rowspan="1" colSpan="1" >Parameters</td>
2376
+
2377
+ <td rowspan="1" colSpan="1" >Description</td>
2378
+ </tr>
2379
+
2380
+ <tr>
2381
+ <td rowspan="1" colSpan="1" >dstFrame</td>
2382
+
2383
+ <td rowspan="1" colSpan="1" >Used to receive video frames processed by the third-party beauty filter.</td>
2384
+ </tr>
2385
+
2386
+ <tr>
2387
+ <td rowspan="1" colSpan="1" >srcFrame</td>
2388
+
2389
+ <td rowspan="1" colSpan="1" >Used to carry camera footage collected by TRTC.</td>
2390
+ </tr>
2391
+ </table>
2392
+
2393
+
2394
+ > **Note**
2395
+ >
2396
+
2397
+ > Currently supports only OpenGL texture schemes (PC supports only TRTCVideoBufferType_Buffer format).
2398
+ >
2399
+
2400
+
2401
+ ## onGLContextDestroy
2402
+
2403
+
2404
+
2405
+ #### Notification that the SDK's internal OpenGL environment has been destroyed
2406
+
2407
+ ## onCapturedAudioFrame
2408
+
2409
+
2410
+
2411
+ #### Local audio data callback after preprocessing by the audio module
2412
+
2413
+ After you set the audio data self-definition callback, the SDK will deliver the freshly collected and preprocessed (ANS, AEC, AGC) data to you in PCM format through this interface callback.
2414
+ - The time frame length of the audio callback from this interface is fixed at 0.02s, in PCM format.
2415
+
2416
+ - The formula to convert time frame length to byte frame length is ` Sampling Rate × Time Frame Length × Number of Channels × Sampling Point Width `.
2417
+
2418
+ - For example, with TRTC's default audio recording format of 48000 sampling rate, mono channel, and 16-bit sampling point width, the byte frame length is ` 48000 × 0.02s × 1 × 16bit = 15360bit = 1920 bytes `.
2419
+
2420
+ <table>
2421
+ <tr>
2422
+ <td rowspan="1" colSpan="1" >Parameters</td>
2423
+
2424
+ <td rowspan="1" colSpan="1" >Description</td>
2425
+ </tr>
2426
+
2427
+ <tr>
2428
+ <td rowspan="1" colSpan="1" >frame</td>
2429
+
2430
+ <td rowspan="1" colSpan="1" >Audio data frame in PCM format.</td>
2431
+ </tr>
2432
+ </table>
2433
+
2434
+
2435
+ > **Note**
2436
+ >
2437
+
2438
+ > 1. Please avoid any time-consuming operations in this callback function, as the SDK processes one frame of audio data every 20ms. If your processing time exceeds 20ms, it will cause sound anomalies.
2439
+ >
2440
+
2441
+ > 2. The audio data from this interface callback is read-write, meaning you can modify the audio data synchronously within the callback function, but ensure that the processing time is efficient.
2442
+ >
2443
+
2444
+ > 3. The audio data callback from this interface has undergone preprocessing (ANS, AEC, AGC) but does ** not include ** background music, sound effects, reverb, etc., with low latency.
2445
+ >
2446
+
2447
+
2448
+ ## onLocalProcessedAudioFrame
2449
+
2450
+
2451
+
2452
+ #### Local audio data callback after preprocessing, sound-effect processing, and mixing BGM by the audio module
2453
+
2454
+ After you set the audio data self-definition callback, the SDK will deliver the freshly collected and preprocessed audio data, processed with sound effects and mixed BGM, in PCM format through this interface callback before final network encoding.
2455
+ - The time frame length of the audio callback from this interface is fixed at 0.02s, in PCM format.
2456
+
2457
+ - The formula to convert time frame length to byte frame length is ` Sampling Rate × Time Frame Length × Number of Channels × Sampling Point Width `.
2458
+
2459
+ - Taking TRTC's default audio recording format as an example: 48000 sampling rate, mono, 16 sampling point width, the byte frame length is ` 48000 × 0.02s × 1 × 16bit = 15360bit = 1920 bytes `.
2460
+
2461
+
2462
+
2463
+
2464
+ Special note:
2465
+
2466
+ You can achieve the signaling transmission purpose by setting the ` TRTCAudioFrame.extraData ` field in the interface. Since the data block at the head of the audio frame cannot be too large, it is recommended that when you write ` extraData `, try to control the signaling to be within a few bytes. If it exceeds 100 bytes, the written data will not be sent.
2467
+
2468
+
2469
+
2470
+ Other users in the room can receive data through the callback field [ITRTCAudioFrameCallback](https://write.woa.com/document/87030021158866944) in `onRemoteUserAudioFrame` from `TRTCAudioFrame.extraData`.
2471
+ <table>
2472
+ <tr>
2473
+ <td rowspan="1" colSpan="1" >Parameters</td>
2474
+
2475
+ <td rowspan="1" colSpan="1" >Description</td>
2476
+ </tr>
2477
+
2478
+ <tr>
2479
+ <td rowspan="1" colSpan="1" >frame</td>
2480
+
2481
+ <td rowspan="1" colSpan="1" >Audio data frame in PCM format.</td>
2482
+ </tr>
2483
+ </table>
2484
+
2485
+
2486
+ > **Note**
2487
+ >
2488
+
2489
+ > 1. Please avoid any time-consuming operations in this callback function, as the SDK processes one frame of audio data every 20ms. If your processing time exceeds 20ms, it will cause sound anomalies.
2490
+ >
2491
+
2492
+ > 2. The audio data from this interface callback is read-write, meaning you can modify the audio data synchronously within the callback function, but ensure that the processing time is efficient.
2493
+ >
2494
+
2495
+ > 3. The data from this callback interface has undergone preprocessing (ANS, AEC, AGC), sound effects and mixed BGM processing, resulting in higher sound delay compared to [ onCapturedAudioFrame ](https://write.woa.com/document/87030021158866944).
2496
+ >
2497
+
2498
+
2499
+ ## onPlayAudioFrame
2500
+
2501
+
2502
+
2503
+ #### Audio data of each remote user before mixing
2504
+
2505
+ After you set the audio data self-definition callback, the SDK will deliver the raw data of each remote source to you in PCM format through this interface callback before final mixing.
2506
+ - The time frame length of the audio callback from this interface is fixed at 0.02s, in PCM format.
2507
+
2508
+ - The formula to convert time frame length to byte frame length is ` Sampling Rate × Time Frame Length × Number of Channels × Sampling Point Width `.
2509
+
2510
+ - Taking TRTC's default audio recording format as an example: 48000 sampling rate, mono, 16 sampling point width, the byte frame length is ` 48000 × 0.02s × 1 × 16bit = 15360bit = 1920 bytes `.
2511
+
2512
+ <table>
2513
+ <tr>
2514
+ <td rowspan="1" colSpan="1" >Parameters</td>
2515
+
2516
+ <td rowspan="1" colSpan="1" >Description</td>
2517
+ </tr>
2518
+
2519
+ <tr>
2520
+ <td rowspan="1" colSpan="1" >frame</td>
2521
+
2522
+ <td rowspan="1" colSpan="1" >Audio data frame in PCM format.</td>
2523
+ </tr>
2524
+
2525
+ <tr>
2526
+ <td rowspan="1" colSpan="1" >userId</td>
2527
+
2528
+ <td rowspan="1" colSpan="1" >User identifier.</td>
2529
+ </tr>
2530
+ </table>
2531
+
2532
+
2533
+ > **Note**
2534
+ >
2535
+
2536
+ > The audio data from this callback interface is read-only and cannot be modified.
2537
+ >
2538
+
2539
+
2540
+ ## onMixedPlayAudioFrame
2541
+
2542
+
2543
+
2544
+ #### Callback of mixed audio data before final submission to the system for playback
2545
+
2546
+ After you set the audio data self-definition callback, the SDK will deliver the mixed audio data of each audio track to you in PCM format through this interface callback before submitting it for system playback.
2547
+ - The time frame length of the audio callback from this interface is fixed at 0.02s, in PCM format.
2548
+
2549
+ - The formula to convert time frame length to byte frame length is ` Sampling Rate × Time Frame Length × Number of Channels × Sampling Point Width `.
2550
+
2551
+ - For example, with TRTC's default audio recording format of 48000 sampling rate, mono channel, and 16-bit sampling point width, the byte frame length is ` 48000 × 0.02s × 1 × 16bit = 15360bit = 1920 bytes `.
2552
+
2553
+ <table>
2554
+ <tr>
2555
+ <td rowspan="1" colSpan="1" >Parameters</td>
2556
+
2557
+ <td rowspan="1" colSpan="1" >Description</td>
2558
+ </tr>
2559
+
2560
+ <tr>
2561
+ <td rowspan="1" colSpan="1" >frame</td>
2562
+
2563
+ <td rowspan="1" colSpan="1" >Audio data frame in PCM format.</td>
2564
+ </tr>
2565
+ </table>
2566
+
2567
+
2568
+ > **Note**
2569
+ >
2570
+
2571
+ > 1. Please avoid any time-consuming operations in this callback function, as the SDK processes one frame of audio data every 20ms. If your processing time exceeds 20ms, it will cause sound anomalies.
2572
+ >
2573
+
2574
+ > 2. The audio data from this interface callback is read-write, meaning you can modify the audio data synchronously within the callback function, but ensure that the processing time is efficient.
2575
+ >
2576
+
2577
+ > 3. This interface callback delivers the mixed data of each audio track to be played, but it does not include ear return audio data.
2578
+ >
2579
+
2580
+
2581
+ ## onMixedAllAudioFrame
2582
+
2583
+
2584
+
2585
+ #### Audio data mixed by the SDK (including collected and to-be-played audio)
2586
+
2587
+ After you set the audio data self-definition callback, the SDK will mix all the collected and to-be-played audio data and deliver it to you in PCM format through this interface callback for your self-definition recording.
2588
+ - The time frame length of the audio callback from this interface is fixed at 0.02s, in PCM format.
2589
+
2590
+ - The formula to convert time frame length to byte frame length is ` Sampling Rate × Time Frame Length × Number of Channels × Sampling Point Width `.
2591
+
2592
+ - For example, with TRTC's default audio recording format of 48000 sampling rate, mono channel, and 16-bit sampling point width, the byte frame length is ` 48000 × 0.02s × 1 × 16bit = 15360bit = 1920 bytes `.
2593
+
2594
+ <table>
2595
+ <tr>
2596
+ <td rowspan="1" colSpan="1" >Parameters</td>
2597
+
2598
+ <td rowspan="1" colSpan="1" >Description</td>
2599
+ </tr>
2600
+
2601
+ <tr>
2602
+ <td rowspan="1" colSpan="1" >frame</td>
2603
+
2604
+ <td rowspan="1" colSpan="1" >Audio data frame in PCM format.</td>
2605
+ </tr>
2606
+ </table>
2607
+
2608
+
2609
+ > **Note**
2610
+ >
2611
+
2612
+ > 1. This interface callback delivers the mixed data of all audio data from the SDK, including: local audio after 3A preprocessing, special effects overlay, and background music mixing; all remote audio; but not including ear return audio.
2613
+ >
2614
+
2615
+ > 2. The audio data from this interface callback does not support modification.
2616
+ >
2617
+
2618
+
2619
+ ## onLog
2620
+
2621
+
2622
+
2623
+ #### Local LOG printing callback
2624
+
2625
+ If you wish to capture the SDK's local log printing behavior, you can set a log callback, allowing the SDK to send all logs to you through this callback interface.
2626
+ <table>
2627
+ <tr>
2628
+ <td rowspan="1" colSpan="1" >Parameters</td>
2629
+
2630
+ <td rowspan="1" colSpan="1" >Description</td>
2631
+ </tr>
2632
+
2633
+ <tr>
2634
+ <td rowspan="1" colSpan="1" >level</td>
2635
+
2636
+ <td rowspan="1" colSpan="1" >For log levels, please refer to TRTC_LOG_LEVEL.</td>
2637
+ </tr>
2638
+
2639
+ <tr>
2640
+ <td rowspan="1" colSpan="1" >log</td>
2641
+
2642
+ <td rowspan="1" colSpan="1" >Log content.</td>
2643
+ </tr>
2644
+
2645
+ <tr>
2646
+ <td rowspan="1" colSpan="1" >module</td>
2647
+
2648
+ <td rowspan="1" colSpan="1" >Reserved field; currently has no specific meaning and is fixed at TXLiteAVSDK.</td>
2649
+ </tr>
2650
+ </table>