agora-electron-sdk 4.2.6 → 4.3.0-dev.1

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 (172) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/js/Private/AgoraBase.js +139 -174
  3. package/js/Private/AgoraMediaBase.js +49 -20
  4. package/js/Private/AgoraMediaPlayerTypes.js +32 -23
  5. package/js/Private/IAgoraH265Transcoder.js +39 -0
  6. package/js/Private/IAgoraMediaStreamingSource.js +32 -32
  7. package/js/Private/IAgoraMusicContentCenter.js +19 -19
  8. package/js/Private/IAgoraRhythmPlayer.js +9 -9
  9. package/js/Private/IAgoraRtcEngine.js +12 -12
  10. package/js/Private/IAgoraSpatialAudio.js +3 -31
  11. package/js/Private/extension/IAgoraH265TranscoderExtension.js +2 -0
  12. package/js/Private/impl/AgoraMediaBaseImpl.js +26 -2
  13. package/js/Private/impl/IAgoraH265TranscoderImpl.js +119 -0
  14. package/js/Private/impl/IAgoraMediaEngineImpl.js +13 -13
  15. package/js/Private/impl/IAgoraMediaPlayerImpl.js +92 -74
  16. package/js/Private/impl/IAgoraMediaPlayerSourceImpl.js +12 -2
  17. package/js/Private/impl/IAgoraMediaRecorderImpl.js +2 -2
  18. package/js/Private/impl/IAgoraMusicContentCenterImpl.js +20 -20
  19. package/js/Private/impl/IAgoraRtcEngineExImpl.js +66 -84
  20. package/js/Private/impl/IAgoraRtcEngineImpl.js +456 -440
  21. package/js/Private/impl/IAgoraSpatialAudioImpl.js +157 -181
  22. package/js/Private/impl/IAudioDeviceManagerImpl.js +22 -22
  23. package/js/Private/internal/AgoraH265TranscoderInternal.js +86 -0
  24. package/js/Private/internal/AgoraMediaBaseInternal.js +34 -0
  25. package/js/Private/internal/IrisApiEngine.js +35 -20
  26. package/js/Private/internal/LocalSpatialAudioEngineInternal.js +0 -39
  27. package/js/Private/internal/MediaPlayerInternal.js +22 -21
  28. package/js/Private/internal/MusicContentCenterInternal.js +1 -4
  29. package/js/Private/internal/RtcEngineExInternal.js +101 -134
  30. package/js/Private/ti/AgoraMediaBase-ti.js +1 -1
  31. package/js/Private/ti/IAgoraH265Transcoder-ti.js +40 -0
  32. package/js/Private/ti/IAgoraMediaPlayerSource-ti.js +4 -2
  33. package/js/Private/ti/IAgoraMusicContentCenter-ti.js +5 -5
  34. package/js/Private/ti/IAgoraRtcEngine-ti.js +12 -11
  35. package/js/Renderer/AgoraView.js +28 -14
  36. package/js/Renderer/IRenderer.js +65 -17
  37. package/js/Renderer/IRendererManager.js +230 -0
  38. package/js/Renderer/RendererCache.js +170 -0
  39. package/js/Renderer/RendererManager.js +49 -460
  40. package/js/Renderer/WebGLRenderer/index.js +82 -234
  41. package/js/Renderer/YUVCanvasRenderer/index.js +27 -147
  42. package/js/Types.js +6 -6
  43. package/js/Utils.js +37 -88
  44. package/package.json +4 -3
  45. package/scripts/clean.js +12 -0
  46. package/scripts/synclib.js +8 -2
  47. package/ts/Private/AgoraBase.ts +225 -201
  48. package/ts/Private/AgoraMediaBase.ts +63 -25
  49. package/ts/Private/AgoraMediaPlayerTypes.ts +67 -24
  50. package/ts/Private/IAgoraH265Transcoder.ts +73 -0
  51. package/ts/Private/IAgoraLog.ts +1 -0
  52. package/ts/Private/IAgoraMediaEngine.ts +12 -7
  53. package/ts/Private/IAgoraMediaPlayer.ts +47 -21
  54. package/ts/Private/IAgoraMediaPlayerSource.ts +27 -6
  55. package/ts/Private/IAgoraMediaStreamingSource.ts +38 -37
  56. package/ts/Private/IAgoraMusicContentCenter.ts +20 -20
  57. package/ts/Private/IAgoraRhythmPlayer.ts +7 -6
  58. package/ts/Private/IAgoraRtcEngine.ts +407 -364
  59. package/ts/Private/IAgoraRtcEngineEx.ts +25 -61
  60. package/ts/Private/IAgoraSpatialAudio.ts +80 -191
  61. package/ts/Private/IAudioDeviceManager.ts +27 -14
  62. package/ts/Private/extension/IAgoraH265TranscoderExtension.ts +39 -0
  63. package/ts/Private/impl/AgoraMediaBaseImpl.ts +25 -1
  64. package/ts/Private/impl/IAgoraH265TranscoderImpl.ts +152 -0
  65. package/ts/Private/impl/IAgoraMediaEngineImpl.ts +13 -13
  66. package/ts/Private/impl/IAgoraMediaPlayerImpl.ts +110 -81
  67. package/ts/Private/impl/IAgoraMediaPlayerSourceImpl.ts +17 -2
  68. package/ts/Private/impl/IAgoraMediaRecorderImpl.ts +2 -2
  69. package/ts/Private/impl/IAgoraMusicContentCenterImpl.ts +21 -21
  70. package/ts/Private/impl/IAgoraRtcEngineExImpl.ts +71 -106
  71. package/ts/Private/impl/IAgoraRtcEngineImpl.ts +589 -572
  72. package/ts/Private/impl/IAgoraSpatialAudioImpl.ts +211 -218
  73. package/ts/Private/impl/IAudioDeviceManagerImpl.ts +22 -22
  74. package/ts/Private/internal/AgoraH265TranscoderInternal.ts +97 -0
  75. package/ts/Private/internal/AgoraMediaBaseInternal.ts +15 -0
  76. package/ts/Private/internal/IrisApiEngine.ts +42 -27
  77. package/ts/Private/internal/LocalSpatialAudioEngineInternal.ts +1 -86
  78. package/ts/Private/internal/MediaPlayerInternal.ts +20 -29
  79. package/ts/Private/internal/MusicContentCenterInternal.ts +1 -5
  80. package/ts/Private/internal/RtcEngineExInternal.ts +91 -204
  81. package/ts/Private/ti/AgoraMediaBase-ti.ts +1 -1
  82. package/ts/Private/ti/IAgoraH265Transcoder-ti.ts +16 -0
  83. package/ts/Private/ti/IAgoraMediaPlayerSource-ti.ts +4 -2
  84. package/ts/Private/ti/IAgoraMusicContentCenter-ti.ts +5 -5
  85. package/ts/Private/ti/IAgoraRtcEngine-ti.ts +12 -11
  86. package/ts/Renderer/AgoraView.ts +29 -19
  87. package/ts/Renderer/IRenderer.ts +71 -22
  88. package/ts/Renderer/IRendererManager.ts +273 -19
  89. package/ts/Renderer/RendererCache.ts +167 -0
  90. package/ts/Renderer/RendererManager.ts +62 -607
  91. package/ts/Renderer/WebGLRenderer/index.ts +117 -295
  92. package/ts/Renderer/YUVCanvasRenderer/index.ts +45 -198
  93. package/ts/Types.ts +17 -194
  94. package/ts/Utils.ts +36 -100
  95. package/types/Private/AgoraBase.d.ts +219 -200
  96. package/types/Private/AgoraBase.d.ts.map +1 -1
  97. package/types/Private/AgoraMediaBase.d.ts +63 -27
  98. package/types/Private/AgoraMediaBase.d.ts.map +1 -1
  99. package/types/Private/AgoraMediaPlayerTypes.d.ts +65 -24
  100. package/types/Private/AgoraMediaPlayerTypes.d.ts.map +1 -1
  101. package/types/Private/IAgoraH265Transcoder.d.ts +28 -0
  102. package/types/Private/IAgoraH265Transcoder.d.ts.map +1 -0
  103. package/types/Private/IAgoraLog.d.ts.map +1 -1
  104. package/types/Private/IAgoraMediaEngine.d.ts +11 -6
  105. package/types/Private/IAgoraMediaEngine.d.ts.map +1 -1
  106. package/types/Private/IAgoraMediaPlayer.d.ts +42 -20
  107. package/types/Private/IAgoraMediaPlayer.d.ts.map +1 -1
  108. package/types/Private/IAgoraMediaPlayerSource.d.ts +23 -6
  109. package/types/Private/IAgoraMediaPlayerSource.d.ts.map +1 -1
  110. package/types/Private/IAgoraMediaStreamingSource.d.ts.map +1 -1
  111. package/types/Private/IAgoraMusicContentCenter.d.ts +19 -19
  112. package/types/Private/IAgoraMusicContentCenter.d.ts.map +1 -1
  113. package/types/Private/IAgoraRhythmPlayer.d.ts +6 -6
  114. package/types/Private/IAgoraRhythmPlayer.d.ts.map +1 -1
  115. package/types/Private/IAgoraRtcEngine.d.ts +329 -293
  116. package/types/Private/IAgoraRtcEngine.d.ts.map +1 -1
  117. package/types/Private/IAgoraRtcEngineEx.d.ts +21 -53
  118. package/types/Private/IAgoraRtcEngineEx.d.ts.map +1 -1
  119. package/types/Private/IAgoraSpatialAudio.d.ts +56 -167
  120. package/types/Private/IAgoraSpatialAudio.d.ts.map +1 -1
  121. package/types/Private/IAudioDeviceManager.d.ts +27 -14
  122. package/types/Private/IAudioDeviceManager.d.ts.map +1 -1
  123. package/types/Private/extension/IAgoraH265TranscoderExtension.d.ts +24 -0
  124. package/types/Private/extension/IAgoraH265TranscoderExtension.d.ts.map +1 -0
  125. package/types/Private/impl/AgoraMediaBaseImpl.d.ts +5 -1
  126. package/types/Private/impl/AgoraMediaBaseImpl.d.ts.map +1 -1
  127. package/types/Private/impl/IAgoraH265TranscoderImpl.d.ts +15 -0
  128. package/types/Private/impl/IAgoraH265TranscoderImpl.d.ts.map +1 -0
  129. package/types/Private/impl/IAgoraMediaPlayerImpl.d.ts +6 -4
  130. package/types/Private/impl/IAgoraMediaPlayerImpl.d.ts.map +1 -1
  131. package/types/Private/impl/IAgoraMediaPlayerSourceImpl.d.ts.map +1 -1
  132. package/types/Private/impl/IAgoraRtcEngineExImpl.d.ts +2 -4
  133. package/types/Private/impl/IAgoraRtcEngineExImpl.d.ts.map +1 -1
  134. package/types/Private/impl/IAgoraRtcEngineImpl.d.ts +30 -25
  135. package/types/Private/impl/IAgoraRtcEngineImpl.d.ts.map +1 -1
  136. package/types/Private/impl/IAgoraSpatialAudioImpl.d.ts +20 -22
  137. package/types/Private/impl/IAgoraSpatialAudioImpl.d.ts.map +1 -1
  138. package/types/Private/internal/AgoraH265TranscoderInternal.d.ts +14 -0
  139. package/types/Private/internal/AgoraH265TranscoderInternal.d.ts.map +1 -0
  140. package/types/Private/internal/AgoraMediaBaseInternal.d.ts +8 -0
  141. package/types/Private/internal/AgoraMediaBaseInternal.d.ts.map +1 -0
  142. package/types/Private/internal/IrisApiEngine.d.ts +5 -2
  143. package/types/Private/internal/IrisApiEngine.d.ts.map +1 -1
  144. package/types/Private/internal/LocalSpatialAudioEngineInternal.d.ts +0 -15
  145. package/types/Private/internal/LocalSpatialAudioEngineInternal.d.ts.map +1 -1
  146. package/types/Private/internal/MediaPlayerInternal.d.ts.map +1 -1
  147. package/types/Private/internal/MusicContentCenterInternal.d.ts +0 -1
  148. package/types/Private/internal/MusicContentCenterInternal.d.ts.map +1 -1
  149. package/types/Private/internal/RtcEngineExInternal.d.ts +7 -13
  150. package/types/Private/internal/RtcEngineExInternal.d.ts.map +1 -1
  151. package/types/Private/ti/IAgoraH265Transcoder-ti.d.ts +8 -0
  152. package/types/Private/ti/IAgoraH265Transcoder-ti.d.ts.map +1 -0
  153. package/types/Private/ti/IAgoraMediaPlayerSource-ti.d.ts.map +1 -1
  154. package/types/Private/ti/IAgoraRtcEngine-ti.d.ts.map +1 -1
  155. package/types/Renderer/AgoraView.d.ts +4 -4
  156. package/types/Renderer/AgoraView.d.ts.map +1 -1
  157. package/types/Renderer/IRenderer.d.ts +11 -9
  158. package/types/Renderer/IRenderer.d.ts.map +1 -1
  159. package/types/Renderer/IRendererManager.d.ts +50 -12
  160. package/types/Renderer/IRendererManager.d.ts.map +1 -1
  161. package/types/Renderer/RendererCache.d.ts +36 -0
  162. package/types/Renderer/RendererCache.d.ts.map +1 -0
  163. package/types/Renderer/RendererManager.d.ts +13 -139
  164. package/types/Renderer/RendererManager.d.ts.map +1 -1
  165. package/types/Renderer/WebGLRenderer/index.d.ts +3 -18
  166. package/types/Renderer/WebGLRenderer/index.d.ts.map +1 -1
  167. package/types/Renderer/YUVCanvasRenderer/index.d.ts +4 -10
  168. package/types/Renderer/YUVCanvasRenderer/index.d.ts.map +1 -1
  169. package/types/Types.d.ts +11 -187
  170. package/types/Types.d.ts.map +1 -1
  171. package/types/Utils.d.ts +3 -20
  172. package/types/Utils.d.ts.map +1 -1
@@ -14,7 +14,6 @@ import {
14
14
  CaptureBrightnessLevelType,
15
15
  ChannelMediaRelayConfiguration,
16
16
  ChannelMediaRelayError,
17
- ChannelMediaRelayEvent,
18
17
  ChannelMediaRelayState,
19
18
  ChannelProfileType,
20
19
  ClientRoleChangeFailedReason,
@@ -40,10 +39,10 @@ import {
40
39
  LiveTranscoding,
41
40
  LocalAccessPointConfiguration,
42
41
  LocalAudioStats,
43
- LocalAudioStreamError,
42
+ LocalAudioStreamReason,
44
43
  LocalAudioStreamState,
45
44
  LocalTranscoderConfiguration,
46
- LocalVideoStreamError,
45
+ LocalVideoStreamReason,
47
46
  LocalVideoStreamState,
48
47
  LowlightEnhanceOptions,
49
48
  MediaTraceEvent,
@@ -58,7 +57,7 @@ import {
58
57
  RemoteVideoState,
59
58
  RemoteVideoStateReason,
60
59
  RtcStats,
61
- RtmpStreamPublishErrorType,
60
+ RtmpStreamPublishReason,
62
61
  RtmpStreamPublishState,
63
62
  RtmpStreamingEvent,
64
63
  ScreenCaptureParameters,
@@ -84,8 +83,10 @@ import {
84
83
  VideoDenoiserOptions,
85
84
  VideoEncoderConfiguration,
86
85
  VideoFormat,
86
+ VideoLayout,
87
87
  VideoMirrorModeType,
88
88
  VideoOrientation,
89
+ VideoQoePreferenceType,
89
90
  VideoRenderingTracingInfo,
90
91
  VideoStreamType,
91
92
  VideoSubscriptionOptions,
@@ -107,6 +108,7 @@ import {
107
108
  RenderModeType,
108
109
  VideoSourceType,
109
110
  } from './AgoraMediaBase';
111
+ import { IH265Transcoder } from './IAgoraH265Transcoder';
110
112
  import { LogConfig, LogFilterType, LogLevel } from './IAgoraLog';
111
113
  import { AudioMixingDualMonoMode, IMediaEngine } from './IAgoraMediaEngine';
112
114
  import { IMediaPlayer } from './IAgoraMediaPlayer';
@@ -114,7 +116,7 @@ import { IMediaRecorder } from './IAgoraMediaRecorder';
114
116
  import { IMusicContentCenter } from './IAgoraMusicContentCenter';
115
117
  import {
116
118
  AgoraRhythmPlayerConfig,
117
- RhythmPlayerErrorType,
119
+ RhythmPlayerReason,
118
120
  RhythmPlayerStateType,
119
121
  } from './IAgoraRhythmPlayer';
120
122
  import { RtcConnection } from './IAgoraRtcEngineEx';
@@ -1113,6 +1115,10 @@ export class ChannelMediaOptions {
1113
1115
  * Whether to publish the local transcoded video: true : Publish the local transcoded video. false : Do not publish the local transcoded video.
1114
1116
  */
1115
1117
  publishTranscodedVideoTrack?: boolean;
1118
+ /**
1119
+ * @ignore
1120
+ */
1121
+ publishMixedAudioTrack?: boolean;
1116
1122
  /**
1117
1123
  * Whether to automatically subscribe to all remote audio streams when the user joins a channel: true : Subscribe to all remote audio streams. false : Do not automatically subscribe to any remote audio streams.
1118
1124
  */
@@ -1251,6 +1257,10 @@ export class LeaveChannelOptions {
1251
1257
 
1252
1258
  /**
1253
1259
  * The SDK uses the IRtcEngineEventHandler interface to send event notifications to your app. Your app can get those notifications through methods that inherit this interface.
1260
+ *
1261
+ * All methods in this interface have default (empty) implementation. You can choose to inherit events related to your app scenario.
1262
+ * In the callbacks, avoid implementing time-consuming tasks or calling APIs that may cause thread blocking (such as sendMessage). Otherwise, the SDK may not work properly.
1263
+ * The SDK no longer catches exceptions in the code logic that developers implement themselves in IRtcEngineEventHandler class. You need to handle this exception yourself, otherwise the app may crash when the exception occurs.
1254
1264
  */
1255
1265
  export interface IRtcEngineEventHandler {
1256
1266
  /**
@@ -1296,7 +1306,7 @@ export interface IRtcEngineEventHandler {
1296
1306
  /**
1297
1307
  * Reports an error during SDK runtime.
1298
1308
  *
1299
- * This callback indicates that an error (concerning network or media) occurs during SDK runtime. In most cases, the SDK cannot fix the issue and resume running. The SDK requires the application to take action or informs the user about the issue.
1309
+ * This callback indicates that an error (concerning network or media) occurs during SDK runtime. In most cases, the SDK cannot fix the issue and resume running. The SDK requires the app to take action or informs the user about the issue.
1300
1310
  *
1301
1311
  * @param err Error code. See ErrorCodeType.
1302
1312
  * @param msg The error message.
@@ -1354,7 +1364,7 @@ export interface IRtcEngineEventHandler {
1354
1364
  /**
1355
1365
  * Occurs when a user leaves a channel.
1356
1366
  *
1357
- * This callback notifies the app that the user leaves the channel by calling leaveChannel. From this callback, the app can get information such as the call duration and quality statistics.
1367
+ * This callback notifies the app that the user leaves the channel by calling leaveChannel. From this callback, the app can get information such as the call duration and statistics.
1358
1368
  *
1359
1369
  * @param connection The connection information. See RtcConnection.
1360
1370
  * @param stats The statistics of the call. See RtcStats.
@@ -1378,7 +1388,7 @@ export interface IRtcEngineEventHandler {
1378
1388
  *
1379
1389
  * @param deviceId The device ID.
1380
1390
  * @param deviceType The device type. See MediaDeviceType.
1381
- * @param deviceState Media device states.
1391
+ * @param deviceState The device state. See MediaDeviceStateType.
1382
1392
  */
1383
1393
  onAudioDeviceStateChanged?(
1384
1394
  deviceId: string,
@@ -1422,7 +1432,7 @@ export interface IRtcEngineEventHandler {
1422
1432
  *
1423
1433
  * @param deviceId The device ID.
1424
1434
  * @param deviceType Media device types. See MediaDeviceType.
1425
- * @param deviceState Media device states.
1435
+ * @param deviceState Media device states. See MediaDeviceStateType.
1426
1436
  */
1427
1437
  onVideoDeviceStateChanged?(
1428
1438
  deviceId: string,
@@ -1516,7 +1526,6 @@ export interface IRtcEngineEventHandler {
1516
1526
  * The remote user stops sending the video stream and re-sends it after 15 seconds. Reasons for such an interruption include:
1517
1527
  * The remote user leaves the channel.
1518
1528
  * The remote user drops offline.
1519
- * The remote user calls muteLocalVideoStream to stop sending the video stream.
1520
1529
  * The remote user calls disableVideo to disable video.
1521
1530
  *
1522
1531
  * @param connection The connection information. See RtcConnection.
@@ -1555,18 +1564,18 @@ export interface IRtcEngineEventHandler {
1555
1564
  /**
1556
1565
  * Occurs when the local video stream state changes.
1557
1566
  *
1558
- * When the state of the local video stream changes (including the state of the video capture and encoding), the SDK triggers this callback to report the current state. This callback indicates the state of the local video stream, including camera capturing and video encoding, and allows you to troubleshoot issues when exceptions occur. The SDK triggers the onLocalVideoStateChanged callback with the state code of LocalVideoStreamStateFailed and error code of LocalVideoStreamErrorCaptureFailure in the following situations:
1567
+ * When the state of the local video stream changes (including the state of the video capture and encoding), the SDK triggers this callback to report the current state. This callback indicates the state of the local video stream, including camera capturing and video encoding, and allows you to troubleshoot issues when exceptions occur. The SDK triggers the onLocalVideoStateChanged callback with the state code of LocalVideoStreamStateFailed and error code of LocalVideoStreamReasonCaptureFailure in the following situations:
1559
1568
  * The app switches to the background, and the system gets the camera resource.
1560
- * The camera starts normally, but does not output video frames for four consecutive seconds. When the camera outputs the captured video frames, if the video frames are the same for 15 consecutive frames, the SDK triggers the onLocalVideoStateChanged callback with the state code of LocalVideoStreamStateCapturing and error code of LocalVideoStreamErrorCaptureFailure. Note that the video frame duplication detection is only available for video frames with a resolution greater than 200 × 200, a frame rate greater than or equal to 10 fps, and a bitrate less than 20 Kbps. For some device models, the SDK does not trigger this callback when the state of the local video changes while the local video capturing device is in use, so you have to make your own timeout judgment.
1569
+ * The camera starts normally, but does not output video frames for four consecutive seconds. When the camera outputs the captured video frames, if the video frames are the same for 15 consecutive frames, the SDK triggers the onLocalVideoStateChanged callback with the state code of LocalVideoStreamStateCapturing and error code of LocalVideoStreamReasonCaptureFailure. Note that the video frame duplication detection is only available for video frames with a resolution greater than 200 × 200, a frame rate greater than or equal to 10 fps, and a bitrate less than 20 Kbps. For some device models, the SDK does not trigger this callback when the state of the local video changes while the local video capturing device is in use, so you have to make your own timeout judgment.
1561
1570
  *
1562
1571
  * @param source The type of the video source. See VideoSourceType.
1563
1572
  * @param state The state of the local video, see LocalVideoStreamState.
1564
- * @param error The detailed error information, see LocalVideoStreamError.
1573
+ * @param reason The reasons for changes in local video state. See LocalVideoStreamReason.
1565
1574
  */
1566
1575
  onLocalVideoStateChanged?(
1567
1576
  source: VideoSourceType,
1568
1577
  state: LocalVideoStreamState,
1569
- error: LocalVideoStreamError
1578
+ reason: LocalVideoStreamReason
1570
1579
  ): void;
1571
1580
 
1572
1581
  /**
@@ -1711,24 +1720,24 @@ export interface IRtcEngineEventHandler {
1711
1720
  ): void;
1712
1721
 
1713
1722
  /**
1714
- * Reports the statistics of the local audio stream.
1723
+ * Reports the transport-layer statistics of each remote audio stream.
1715
1724
  *
1716
- * The SDK triggers this callback once every two seconds.
1725
+ * The SDK triggers this callback once every two seconds for each remote user who is sending audio streams. If a channel includes multiple remote users, the SDK triggers this callback as many times.
1717
1726
  *
1718
1727
  * @param connection The connection information. See RtcConnection.
1719
- * @param stats Local audio statistics. See LocalAudioStats.
1728
+ * @param stats The statistics of the received remote audio streams. See RemoteAudioStats.
1720
1729
  */
1721
- onLocalAudioStats?(connection: RtcConnection, stats: LocalAudioStats): void;
1730
+ onRemoteAudioStats?(connection: RtcConnection, stats: RemoteAudioStats): void;
1722
1731
 
1723
1732
  /**
1724
- * Reports the transport-layer statistics of each remote audio stream.
1733
+ * Reports the statistics of the local audio stream.
1725
1734
  *
1726
- * The SDK triggers this callback once every two seconds for each remote user who is sending audio streams. If a channel includes multiple remote users, the SDK triggers this callback as many times.
1735
+ * The SDK triggers this callback once every two seconds.
1727
1736
  *
1728
1737
  * @param connection The connection information. See RtcConnection.
1729
- * @param stats The statistics of the received remote audio streams. See RemoteAudioStats.
1738
+ * @param stats Local audio statistics. See LocalAudioStats.
1730
1739
  */
1731
- onRemoteAudioStats?(connection: RtcConnection, stats: RemoteAudioStats): void;
1740
+ onLocalAudioStats?(connection: RtcConnection, stats: LocalAudioStats): void;
1732
1741
 
1733
1742
  /**
1734
1743
  * Reports the statistics of the local video stream.
@@ -1813,7 +1822,7 @@ export interface IRtcEngineEventHandler {
1813
1822
  */
1814
1823
  onRhythmPlayerStateChanged?(
1815
1824
  state: RhythmPlayerStateType,
1816
- errorCode: RhythmPlayerErrorType
1825
+ reason: RhythmPlayerReason
1817
1826
  ): void;
1818
1827
 
1819
1828
  /**
@@ -1874,7 +1883,7 @@ export interface IRtcEngineEventHandler {
1874
1883
  * @param connection The connection information. See RtcConnection.
1875
1884
  * @param uid The ID of the remote user sending the message.
1876
1885
  * @param streamId The stream ID of the received message.
1877
- * @param code The error code.
1886
+ * @param code ErrorCodeType The error code.
1878
1887
  * @param missed The number of lost messages.
1879
1888
  * @param cached Number of incoming cached messages when the data stream is interrupted.
1880
1889
  */
@@ -1932,21 +1941,6 @@ export interface IRtcEngineEventHandler {
1932
1941
  elapsed: number
1933
1942
  ): void;
1934
1943
 
1935
- /**
1936
- * Occurs when the SDK receives the first audio frame from a specific remote user.
1937
- *
1938
- * Deprecated: Use onRemoteAudioStateChanged instead.
1939
- *
1940
- * @param connection The connection information. See RtcConnection.
1941
- * @param userId The user ID of the remote user.
1942
- * @param elapsed The time elapsed (ms) from the local user calling joinChannel until the SDK triggers this callback.
1943
- */
1944
- onFirstRemoteAudioFrame?(
1945
- connection: RtcConnection,
1946
- userId: number,
1947
- elapsed: number
1948
- ): void;
1949
-
1950
1944
  /**
1951
1945
  * Occurs when the SDK decodes the first remote audio frame for playback.
1952
1946
  *
@@ -1968,6 +1962,21 @@ export interface IRtcEngineEventHandler {
1968
1962
  elapsed: number
1969
1963
  ): void;
1970
1964
 
1965
+ /**
1966
+ * Occurs when the SDK receives the first audio frame from a specific remote user.
1967
+ *
1968
+ * Deprecated: Use onRemoteAudioStateChanged instead.
1969
+ *
1970
+ * @param connection The connection information. See RtcConnection.
1971
+ * @param userId The user ID of the remote user.
1972
+ * @param elapsed The time elapsed (ms) from the local user calling joinChannel until the SDK triggers this callback.
1973
+ */
1974
+ onFirstRemoteAudioFrame?(
1975
+ connection: RtcConnection,
1976
+ userId: number,
1977
+ elapsed: number
1978
+ ): void;
1979
+
1971
1980
  /**
1972
1981
  * Occurs when the local audio stream state changes.
1973
1982
  *
@@ -1975,12 +1984,12 @@ export interface IRtcEngineEventHandler {
1975
1984
  *
1976
1985
  * @param connection The connection information. See RtcConnection.
1977
1986
  * @param state The state of the local audio. See LocalAudioStreamState.
1978
- * @param error Local audio state error codes. See LocalAudioStreamError.
1987
+ * @param reason Reasons for local audio state changes. See LocalAudioStreamReason.
1979
1988
  */
1980
1989
  onLocalAudioStateChanged?(
1981
1990
  connection: RtcConnection,
1982
1991
  state: LocalAudioStreamState,
1983
- error: LocalAudioStreamError
1992
+ reason: LocalAudioStreamReason
1984
1993
  ): void;
1985
1994
 
1986
1995
  /**
@@ -2080,7 +2089,7 @@ export interface IRtcEngineEventHandler {
2080
2089
  /**
2081
2090
  * Reports the volume change of the audio device or app.
2082
2091
  *
2083
- * Occurs when the volume on the playback device, audio capture device, or the volume in the application changes.
2092
+ * Occurs when the volume on the playback device, audio capture device, or the volume of the app changes.
2084
2093
  *
2085
2094
  * @param deviceType The device type. See MediaDeviceType.
2086
2095
  * @param volume The volume value. The range is [0, 255].
@@ -2099,12 +2108,12 @@ export interface IRtcEngineEventHandler {
2099
2108
  *
2100
2109
  * @param url The URL address where the state of the Media Push changes.
2101
2110
  * @param state The current state of the Media Push. See RtmpStreamPublishState.
2102
- * @param errCode The detailed error information for the Media Push. See RtmpStreamPublishErrorType.
2111
+ * @param reason Reasons for the changes in the Media Push status. See RtmpStreamPublishReason.
2103
2112
  */
2104
2113
  onRtmpStreamingStateChanged?(
2105
2114
  url: string,
2106
2115
  state: RtmpStreamPublishState,
2107
- errCode: RtmpStreamPublishErrorType
2116
+ reason: RtmpStreamPublishReason
2108
2117
  ): void;
2109
2118
 
2110
2119
  /**
@@ -2118,7 +2127,7 @@ export interface IRtcEngineEventHandler {
2118
2127
  /**
2119
2128
  * Occurs when the publisher's transcoding is updated.
2120
2129
  *
2121
- * When the LiveTranscoding class in the method updates, the SDK triggers the onTranscodingUpdated callback to report the update information. If you call the method to set the LiveTranscoding class for the first time, the SDK does not trigger this callback.
2130
+ * When the LiveTranscoding class in the startRtmpStreamWithTranscoding method updates, the SDK triggers the onTranscodingUpdated callback to report the update information. If you call the startRtmpStreamWithTranscoding method to set the LiveTranscoding class for the first time, the SDK does not trigger this callback.
2122
2131
  */
2123
2132
  onTranscodingUpdated?(): void;
2124
2133
 
@@ -2151,22 +2160,20 @@ export interface IRtcEngineEventHandler {
2151
2160
  code: ChannelMediaRelayError
2152
2161
  ): void;
2153
2162
 
2154
- /**
2155
- * Reports events during the media stream relay.
2156
- *
2157
- * Deprecated: This callback is deprecated.
2158
- *
2159
- * @param code The event code of channel media relay. See ChannelMediaRelayEvent.
2160
- */
2161
- onChannelMediaRelayEvent?(code: ChannelMediaRelayEvent): void;
2162
-
2163
2163
  /**
2164
2164
  * @ignore
2165
2165
  */
2166
2166
  onLocalPublishFallbackToAudioOnly?(isFallbackOrRecover: boolean): void;
2167
2167
 
2168
2168
  /**
2169
- * @ignore
2169
+ * Occurs when the remote media stream falls back to the audio-only stream due to poor network conditions or switches back to the video stream after the network conditions improve.
2170
+ *
2171
+ * If you call setRemoteSubscribeFallbackOption and set option to StreamFallbackOptionAudioOnly, the SDK triggers this callback in the following situations:
2172
+ * The downstream network condition is poor, and the subscribed video stream is downgraded to audio-only stream.
2173
+ * The downstream network condition has improved, and the subscribed stream has been restored to video stream. Once the remote media stream switches to the low-quality video stream due to weak network conditions, you can monitor the stream switch between a high-quality and low-quality stream in the onRemoteVideoStats callback.
2174
+ *
2175
+ * @param uid The user ID of the remote user.
2176
+ * @param isFallbackOrRecover true : The subscribed media stream falls back to audio-only due to poor network conditions. false : The subscribed media stream switches back to the video stream after the network conditions improve.
2170
2177
  */
2171
2178
  onRemoteSubscribeFallbackToAudioOnly?(
2172
2179
  uid: number,
@@ -2297,6 +2304,45 @@ export interface IRtcEngineEventHandler {
2297
2304
  */
2298
2305
  onUserInfoUpdated?(uid: number, info: UserInfo): void;
2299
2306
 
2307
+ /**
2308
+ * @ignore
2309
+ */
2310
+ onUserAccountUpdated?(
2311
+ connection: RtcConnection,
2312
+ remoteUid: number,
2313
+ remoteUserAccount: string
2314
+ ): void;
2315
+
2316
+ /**
2317
+ * Video frame rendering event callback.
2318
+ *
2319
+ * After calling the startMediaRenderingTracing method or joining the channel, the SDK triggers this callback to report the events of video frame rendering and the indicators during the rendering process. Developers can optimize the indicators to improve the efficiency of the first video frame rendering.
2320
+ *
2321
+ * @param connection The connection information. See RtcConnection.
2322
+ * @param uid The user ID.
2323
+ * @param currentEvent The current video frame rendering event. See MediaTraceEvent.
2324
+ * @param tracingInfo The indicators during the video frame rendering process. Developers need to reduce the value of indicators as much as possible in order to improve the efficiency of the first video frame rendering. See VideoRenderingTracingInfo.
2325
+ */
2326
+ onVideoRenderingTracingResult?(
2327
+ connection: RtcConnection,
2328
+ uid: number,
2329
+ currentEvent: MediaTraceEvent,
2330
+ tracingInfo: VideoRenderingTracingInfo
2331
+ ): void;
2332
+
2333
+ /**
2334
+ * Occurs when there's an error during the local video mixing.
2335
+ *
2336
+ * When you fail to call startLocalVideoTranscoder or updateLocalTranscoderConfiguration, the SDK triggers this callback to report the reason.
2337
+ *
2338
+ * @param stream The video streams that cannot be mixed during video mixing. See TranscodingVideoStream.
2339
+ * @param error The reason for local video mixing error. See VideoTranscoderError.
2340
+ */
2341
+ onLocalVideoTranscoderError?(
2342
+ stream: TranscodingVideoStream,
2343
+ error: VideoTranscoderError
2344
+ ): void;
2345
+
2300
2346
  /**
2301
2347
  * @ignore
2302
2348
  */
@@ -2373,6 +2419,18 @@ export interface IRtcEngineEventHandler {
2373
2419
  elapseSinceLastState: number
2374
2420
  ): void;
2375
2421
 
2422
+ /**
2423
+ * @ignore
2424
+ */
2425
+ onTranscodedStreamLayoutInfo?(
2426
+ connection: RtcConnection,
2427
+ uid: number,
2428
+ width: number,
2429
+ height: number,
2430
+ layoutCount: number,
2431
+ layoutlist: VideoLayout[]
2432
+ ): void;
2433
+
2376
2434
  /**
2377
2435
  * The event callback of the extension.
2378
2436
  *
@@ -2430,41 +2488,7 @@ export interface IRtcEngineEventHandler {
2430
2488
  /**
2431
2489
  * @ignore
2432
2490
  */
2433
- onUserAccountUpdated?(
2434
- connection: RtcConnection,
2435
- remoteUid: number,
2436
- userAccount: string
2437
- ): void;
2438
-
2439
- /**
2440
- * Occurs when there's an error during the local video mixing.
2441
- *
2442
- * When you fail to call startLocalVideoTranscoder or updateLocalTranscoderConfiguration, the SDK triggers this callback to report the reason.
2443
- *
2444
- * @param stream The video streams that cannot be mixed during video mixing. See TranscodingVideoStream.
2445
- * @param error The reason for local video mixing error. See VideoTranscoderError.
2446
- */
2447
- onLocalVideoTranscoderError?(
2448
- stream: TranscodingVideoStream,
2449
- error: VideoTranscoderError
2450
- ): void;
2451
-
2452
- /**
2453
- * Video frame rendering event callback.
2454
- *
2455
- * After calling the startMediaRenderingTracing method or joining the channel, the SDK triggers this callback to report the events of video frame rendering and the indicators during the rendering process. Developers can optimize the indicators to improve the efficiency of the first video frame rendering.
2456
- *
2457
- * @param connection The connection information. See RtcConnection.
2458
- * @param uid The user ID.
2459
- * @param currentEvent The current video frame rendering event. See MediaTraceEvent.
2460
- * @param tracingInfo The indicators during the video frame rendering process. Developers need to reduce the value of indicators as much as possible in order to improve the efficiency of the first video frame rendering. See VideoRenderingTracingInfo.
2461
- */
2462
- onVideoRenderingTracingResult?(
2463
- connection: RtcConnection,
2464
- uid: number,
2465
- currentEvent: MediaTraceEvent,
2466
- tracingInfo: VideoRenderingTracingInfo
2467
- ): void;
2491
+ onSetRtmFlagResult?(connection: RtcConnection, code: number): void;
2468
2492
  }
2469
2493
 
2470
2494
  /**
@@ -2563,7 +2587,7 @@ export class RtcEngineContext {
2563
2587
  */
2564
2588
  license?: string;
2565
2589
  /**
2566
- * The audio scenarios. See AudioScenarioType. Under different audio scenarios, the device uses different volume types.
2590
+ * The audio scenarios. Under different audio scenarios, the device uses different volume types. See AudioScenarioType.
2567
2591
  */
2568
2592
  audioScenario?: AudioScenarioType;
2569
2593
  /**
@@ -2573,7 +2597,7 @@ export class RtcEngineContext {
2573
2597
  /**
2574
2598
  * The SDK log files are: agorasdk.log, agorasdk.1.log, agorasdk.2.log, agorasdk.3.log, and agorasdk.4.log.
2575
2599
  * The API call log files are: agoraapi.log, agoraapi.1.log, agoraapi.2.log, agoraapi.3.log, and agoraapi.4.log.
2576
- * The default size for each SDK log file is 1,024 KB; the default size for each API call log file is 2,048 KB. These log files are encoded in UTF-8.
2600
+ * The default size of each SDK log file and API log file is 2,048 KB. These log files are encoded in UTF-8.
2577
2601
  * The SDK writes the latest logs in agorasdk.log or agoraapi.log.
2578
2602
  * When agorasdk.log is full, the SDK processes the log files in the following order:
2579
2603
  * Delete the agorasdk.4.log file (if any).
@@ -2671,33 +2695,33 @@ export interface IMetadataObserver {
2671
2695
  }
2672
2696
 
2673
2697
  /**
2674
- * The CDN streaming error.
2698
+ * Reasons for the changes in CDN streaming status.
2675
2699
  */
2676
- export enum DirectCdnStreamingError {
2700
+ export enum DirectCdnStreamingReason {
2677
2701
  /**
2678
2702
  * 0: No error.
2679
2703
  */
2680
- DirectCdnStreamingErrorOk = 0,
2704
+ DirectCdnStreamingReasonOk = 0,
2681
2705
  /**
2682
2706
  * 1: A general error; no specific reason. You can try to push the media stream again.
2683
2707
  */
2684
- DirectCdnStreamingErrorFailed = 1,
2708
+ DirectCdnStreamingReasonFailed = 1,
2685
2709
  /**
2686
2710
  * 2: An error occurs when pushing audio streams. For example, the local audio capture device is not working properly, is occupied by another process, or does not get the permission required.
2687
2711
  */
2688
- DirectCdnStreamingErrorAudioPublication = 2,
2712
+ DirectCdnStreamingReasonAudioPublication = 2,
2689
2713
  /**
2690
2714
  * 3: An error occurs when pushing video streams. For example, the local video capture device is not working properly, is occupied by another process, or does not get the permission required.
2691
2715
  */
2692
- DirectCdnStreamingErrorVideoPublication = 3,
2716
+ DirectCdnStreamingReasonVideoPublication = 3,
2693
2717
  /**
2694
2718
  * 4: Fails to connect to the CDN.
2695
2719
  */
2696
- DirectCdnStreamingErrorNetConnect = 4,
2720
+ DirectCdnStreamingReasonNetConnect = 4,
2697
2721
  /**
2698
2722
  * 5: The URL is already being used. Use a new URL for streaming.
2699
2723
  */
2700
- DirectCdnStreamingErrorBadName = 5,
2724
+ DirectCdnStreamingReasonBadName = 5,
2701
2725
  }
2702
2726
 
2703
2727
  /**
@@ -2762,12 +2786,12 @@ export interface IDirectCdnStreamingEventHandler {
2762
2786
  * When the host directly pushes streams to the CDN, if the streaming state changes, the SDK triggers this callback to report the changed streaming state, error codes, and other information. You can troubleshoot issues by referring to this callback.
2763
2787
  *
2764
2788
  * @param state The current CDN streaming state. See DirectCdnStreamingState.
2765
- * @param error The CDN streaming error. See DirectCdnStreamingError.
2789
+ * @param reason Reasons for changes in the status of CDN streaming. See DirectCdnStreamingReason.
2766
2790
  * @param message The information about the changed streaming state.
2767
2791
  */
2768
2792
  onDirectCdnStreamingStateChanged?(
2769
2793
  state: DirectCdnStreamingState,
2770
- error: DirectCdnStreamingError,
2794
+ reason: DirectCdnStreamingReason,
2771
2795
  message: string
2772
2796
  ): void;
2773
2797
 
@@ -2843,17 +2867,6 @@ export class ExtensionInfo {
2843
2867
  * IRtcEngine provides the main methods that your app can call. Before calling other APIs, you must call createAgoraRtcEngine to create an IRtcEngine object.
2844
2868
  */
2845
2869
  export abstract class IRtcEngine {
2846
- /**
2847
- * Releases the IRtcEngine instance.
2848
- *
2849
- * This method releases all resources used by the Agora SDK. Use this method for apps in which users occasionally make voice or video calls. When users do not make calls, you can free up resources for other operations. After a successful method call, you can no longer use any method or callback in the SDK anymore. If you want to use the real-time communication functions again, you must call createAgoraRtcEngine and initialize to create a new IRtcEngine instance.
2850
- * This method can be called synchronously. You need to wait for the resource of IRtcEngine to be released before performing other operations (for example, create a new IRtcEngine object). Therefore, Agora recommends calling this method in the child thread to avoid blocking the main thread.
2851
- * Besides, Agora does not recommend you calling release in any callback of the SDK. Otherwise, the SDK cannot release the resources until the callbacks return results, which may result in a deadlock.
2852
- *
2853
- * @param sync Whether the method is called synchronously: true : Synchronous call. false : Asynchronous call. Currently this method only supports synchronous calls. Do not set this parameter to this value.
2854
- */
2855
- abstract release(sync?: boolean): void;
2856
-
2857
2870
  /**
2858
2871
  * Creates and initializes IRtcEngine.
2859
2872
  *
@@ -2901,6 +2914,15 @@ export abstract class IRtcEngine {
2901
2914
  */
2902
2915
  abstract queryCodecCapability(): { codecInfo: CodecCapInfo[]; size: number };
2903
2916
 
2917
+ /**
2918
+ * Queries device score.
2919
+ *
2920
+ * @returns
2921
+ * >0: The method call succeeeds, the value is the current device's score, the range is [0,100], the larger the value, the stronger the device capability. Most devices are rated between 60 and 100.
2922
+ * < 0: Failure.
2923
+ */
2924
+ abstract queryDeviceScore(): number;
2925
+
2904
2926
  /**
2905
2927
  * Preloads a channel with token, channelId, and uid.
2906
2928
  *
@@ -2955,7 +2977,7 @@ export abstract class IRtcEngine {
2955
2977
  * All numeric characters: 0 to 9.
2956
2978
  * Space
2957
2979
  * "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", "{", "}", "|", "~", ","
2958
- * @param userAccount The user account. This parameter is used to identify the user in the channel for real-time audio and video engagement. You need to set and manage user accounts yourself and ensure that each user account in the same channel is unique. The maximum length of this parameter is 255 bytes. Ensure that you set this parameter and do not set it as NULL. Supported characters are (89 in total):
2980
+ * @param userAccount The user account. This parameter is used to identify the user in the channel for real-time audio and video engagement. You need to set and manage user accounts yourself and ensure that each user account in the same channel is unique. The maximum length of this parameter is 255 bytes. Ensure that you set this parameter and do not set it as null. Supported characters are (89 in total):
2959
2981
  * The 26 lowercase English letters: a to z.
2960
2982
  * The 26 uppercase English letters: A to Z.
2961
2983
  * All numeric characters: 0 to 9.
@@ -3006,7 +3028,7 @@ export abstract class IRtcEngine {
3006
3028
  * All numeric characters: 0 to 9.
3007
3029
  * Space
3008
3030
  * "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", "{", "}", "|", "~", ","
3009
- * @param uid The user ID. This parameter is used to identify the user in the channel for real-time audio and video interaction. You need to set and manage user IDs yourself, and ensure that each user ID in the same channel is unique. This parameter is a 32-bit unsigned integer. The value range is 1 to 2 32 -1. If the user ID is not assigned (or set to 0), the SDK assigns a random user ID and returns it in the onJoinChannelSuccess callback. Your application must record and maintain the returned user ID, because the SDK does not do so.
3031
+ * @param uid The user ID. This parameter is used to identify the user in the channel for real-time audio and video interaction. You need to set and manage user IDs yourself, and ensure that each user ID in the same channel is unique. This parameter is a 32-bit unsigned integer. The value range is 1 to 2 32 -1. If the user ID is not assigned (or set to 0), the SDK assigns a random user ID and returns it in the onJoinChannelSuccess callback. Your app must record and maintain the returned user ID, because the SDK does not do so.
3010
3032
  * @param options The channel media options. See ChannelMediaOptions.
3011
3033
  *
3012
3034
  * @returns
@@ -3058,8 +3080,7 @@ export abstract class IRtcEngine {
3058
3080
  /**
3059
3081
  * Renews the token.
3060
3082
  *
3061
- * The SDK triggers the onTokenPrivilegeWillExpire callback.
3062
- * The onConnectionStateChanged callback reports ConnectionChangedTokenExpired (9).
3083
+ * The SDK triggers the onTokenPrivilegeWillExpire callback. onConnectionStateChanged The ConnectionChangedTokenExpired callback reports (9).
3063
3084
  *
3064
3085
  * @param token The new token.
3065
3086
  *
@@ -3178,7 +3199,7 @@ export abstract class IRtcEngine {
3178
3199
  * Enables the local video preview and specifies the video source for the preview.
3179
3200
  *
3180
3201
  * You can call this method to enable local video preview. Call this method after the following:
3181
- * Call setView to initialize the local preview.
3202
+ * Call setupLocalVideo to initialize the local preview.
3182
3203
  * Call enableVideo to enable the video module.
3183
3204
  * The local preview enables the mirror mode by default.
3184
3205
  * After the local video preview is enabled, if you call leaveChannel to exit the channel, the local preview remains until you call stopPreview to disable it.
@@ -3208,9 +3229,7 @@ export abstract class IRtcEngine {
3208
3229
  /**
3209
3230
  * Starts the last mile network probe test.
3210
3231
  *
3211
- * This method starts the last-mile network probe test before joining a channel to get the uplink and downlink last mile network statistics, including the bandwidth, packet loss, jitter, and round-trip time (RTT). Once this method is enabled, the SDK returns the following callbacks: onLastmileQuality : The SDK triggers this callback within two seconds depending on the network conditions. This callback rates the network conditions and is more closely linked to the user experience. onLastmileProbeResult : The SDK triggers this callback within 30 seconds depending on the network conditions. This callback returns the real-time statistics of the network conditions and is more objective. This method applies to the following scenarios:
3212
- * Before a user joins a channel, call this method to check the uplink network quality.
3213
- * In a live streaming channel, call this method to check the uplink network quality before an audience member switches to a host.
3232
+ * This method starts the last-mile network probe test before joining a channel to get the uplink and downlink last mile network statistics, including the bandwidth, packet loss, jitter, and round-trip time (RTT). Once this method is enabled, the SDK returns the following callbacks: onLastmileQuality : The SDK triggers this callback within two seconds depending on the network conditions. This callback rates the network conditions and is more closely linked to the user experience. onLastmileProbeResult : The SDK triggers this callback within 30 seconds depending on the network conditions. This callback returns the real-time statistics of the network conditions and is more objective. This method must be called before joining the channel, and is used to judge and predict whether the current uplink network quality is good enough.
3214
3233
  * Do not call other methods before receiving the onLastmileQuality and onLastmileProbeResult callbacks. Otherwise, the callbacks may be interrupted.
3215
3234
  * A host should not call this method after joining a channel (when in a call).
3216
3235
  *
@@ -3234,7 +3253,7 @@ export abstract class IRtcEngine {
3234
3253
  /**
3235
3254
  * Sets the video encoder configuration.
3236
3255
  *
3237
- * Sets the encoder configuration for the local video. You can call this method either before or after joining a channel. If the user does not need to reset the video encoding properties after joining the channel, Agora recommends calling this method before enableVideo to reduce the time to render the first video frame.
3256
+ * Sets the encoder configuration for the local video. Each configuration profile corresponds to a set of video parameters, including the resolution, frame rate, and bitrate. The config specified in this method is the maximum value under ideal network conditions. If the video engine cannot render the video using the specified config due to unreliable network conditions, the parameters further down the list are considered until a successful configuration is found. You can call this method either before or after joining a channel. If the user does not need to reset the video encoding properties after joining the channel, Agora recommends calling this method before enableVideo to reduce the time to render the first video frame.
3238
3257
  *
3239
3258
  * @param config Video profile. See VideoEncoderConfiguration.
3240
3259
  *
@@ -3382,6 +3401,7 @@ export abstract class IRtcEngine {
3382
3401
  *
3383
3402
  * This method initializes the video view of a remote stream on the local device. It affects only the video view that the local user sees. Call this method to bind the remote video stream to a video view and to set the rendering and mirror modes of the video view. You need to specify the ID of the remote user in this method. If the remote user ID is unknown to the application, set it after the app receives the onUserJoined callback. To unbind the remote user from the view, set the view parameter to NULL. Once the remote user leaves the channel, the SDK unbinds the remote user.
3384
3403
  * If you use the Agora recording function, the recording client joins the channel as a placeholder client, triggering the onUserJoined callback. Do not bind the placeholder client to the app view because the placeholder client does not send any video streams. If your app does not recognize the placeholder client, bind the remote user to the view when the SDK triggers the onFirstRemoteVideoDecoded callback.
3404
+ * If you want to stop rendering the view, set view to null and then call this method again to stop rendering and clear the rendering cache.
3385
3405
  *
3386
3406
  * @param canvas The remote video view and settings. See VideoCanvas.
3387
3407
  *
@@ -3394,8 +3414,9 @@ export abstract class IRtcEngine {
3394
3414
  /**
3395
3415
  * Initializes the local video view.
3396
3416
  *
3397
- * This method initializes the video view of a local stream on the local device. It affects only the video view that the local user sees, not the published local video stream. Call this method to bind the local video stream to a video view (view) and to set the rendering and mirror modes of the video view. After initialization, call this method to set the local video and then join the channel. The local video still binds to the view after you leave the channel. To unbind the local video from the view, set the view parameter as NULL.
3417
+ * This method initializes the video view of a local stream on the local device. It affects only the video view that the local user sees, not the published local video stream. Call this method to bind the local video stream to a video view (view) and to set the rendering and mirror modes of the video view. After initialization, call this method to set the local video and then join the channel. The local video still binds to the view after you leave the channel. To unbind the local video from the view, set the view parameter as null. In real-time interactive scenarios, if you need to simultaneously view multiple preview frames in the local video preview, and each frame is at a different observation position along the video link, you can repeatedly call this method to set different view s and set different observation positions for each view. For example, by setting the video source to the camera and then configuring two view s with position setting to PositionPostCapturerOrigin and PositionPostCapturer, you can simultaneously preview the raw, unprocessed video frame and the video frame that has undergone preprocessing (image enhancement effects, virtual background, watermark) in the local video preview.
3398
3418
  * You can call this method either before or after joining a channel.
3419
+ * If you want to stop rendering the view, set view to null and then call this method again to stop rendering and clear the rendering cache.
3399
3420
  *
3400
3421
  * @param canvas The local video view and settings. See VideoCanvas.
3401
3422
  *
@@ -3428,9 +3449,17 @@ export abstract class IRtcEngine {
3428
3449
  * @returns
3429
3450
  * 0: Success.
3430
3451
  * < 0: Failure.
3452
+ * -1: A general error occurs (no specified reason).
3453
+ * -4: Video application scenarios are not supported. Possible reasons include that you use the Voice SDK instead of the Video SDK.
3454
+ * -7: The IRtcEngine object has not been initialized. You need to initialize the IRtcEngine object before calling this method.
3431
3455
  */
3432
3456
  abstract setVideoScenario(scenarioType: VideoApplicationScenarioType): number;
3433
3457
 
3458
+ /**
3459
+ * @ignore
3460
+ */
3461
+ abstract setVideoQoEPreference(qoePreference: VideoQoePreferenceType): number;
3462
+
3434
3463
  /**
3435
3464
  * Enables the audio module.
3436
3465
  *
@@ -3449,7 +3478,7 @@ export abstract class IRtcEngine {
3449
3478
  * Disables the audio module.
3450
3479
  *
3451
3480
  * This method disables the internal engine and can be called anytime after initialization. It is still valid after one leaves channel.
3452
- * This method resets the internal engine and takes some time to take effect. Agora recommends using the following API methods to control the audio modules separately: enableLocalAudio : Whether to enable the microphone to create the local audio stream. muteLocalAudioStream : Whether to publish the local audio stream. muteRemoteAudioStream : Whether to subscribe and play the remote audio stream. muteAllRemoteAudioStreams : Whether to subscribe to and play all remote audio streams.
3481
+ * This method resets the internal engine and takes some time to take effect. Agora recommends using the following API methods to control the audio modules separately: enableLocalAudio : Whether to enable the microphone to create the local audio stream. enableLoopbackRecording : Whether to enable loopback audio capturing. muteLocalAudioStream : Whether to publish the local audio stream. muteRemoteAudioStream : Whether to subscribe and play the remote audio stream. muteAllRemoteAudioStreams : Whether to subscribe to and play all remote audio streams.
3453
3482
  *
3454
3483
  * @returns
3455
3484
  * 0: Success.
@@ -3461,10 +3490,11 @@ export abstract class IRtcEngine {
3461
3490
  * Sets the audio profile and audio scenario.
3462
3491
  *
3463
3492
  * You can call this method either before or after joining a channel.
3493
+ * Due to iOS system restrictions, some audio routes cannot be recognized in call volume mode. Therefore, if you need to use an external sound card, it is recommended to set the audio scenario to AudioScenarioGameStreaming (3). In this scenario, the SDK will switch to media volume to avoid this issue.
3464
3494
  * In scenarios requiring high-quality audio, such as online music tutoring, Agora recommends you set profile as AudioProfileMusicHighQuality (4) and scenario as AudioScenarioGameStreaming (3).
3465
3495
  *
3466
3496
  * @param profile The audio profile, including the sampling rate, bitrate, encoding mode, and the number of channels. See AudioProfileType.
3467
- * @param scenario The audio scenarios. See AudioScenarioType. Under different audio scenarios, the device uses different volume types.
3497
+ * @param scenario The audio scenarios. Under different audio scenarios, the device uses different volume types. See AudioScenarioType.
3468
3498
  *
3469
3499
  * @returns
3470
3500
  * 0: Success.
@@ -3478,9 +3508,10 @@ export abstract class IRtcEngine {
3478
3508
  /**
3479
3509
  * Sets audio scenarios.
3480
3510
  *
3481
- * You can call this method either before or after joining a channel.
3511
+ * Due to iOS system restrictions, some audio routes cannot be recognized in call volume mode. Therefore, if you need to use an external sound card, it is recommended to set the audio scenario to AudioScenarioGameStreaming (3). In this scenario, the SDK will switch to media volume to avoid this issue.
3512
+ * You can call this method either before or after joining a channel.
3482
3513
  *
3483
- * @param scenario The audio scenarios. See AudioScenarioType. Under different audio scenarios, the device uses different volume types.
3514
+ * @param scenario The audio scenarios. Under different audio scenarios, the device uses different volume types. See AudioScenarioType.
3484
3515
  *
3485
3516
  * @returns
3486
3517
  * 0: Success.
@@ -3568,7 +3599,7 @@ export abstract class IRtcEngine {
3568
3599
  /**
3569
3600
  * Enables/Disables the local video capture.
3570
3601
  *
3571
- * This method disables or re-enables the local video capture, and does not affect receiving the remote video stream. After calling enableVideo, the local video capture is enabled by default. You can call enableLocalVideo (false) to disable the local video capture. If you want to re-enable the local video capture, call enableLocalVideo (true). After the local video capturer is successfully disabled or re-enabled, the SDK triggers the onRemoteVideoStateChanged callback on the remote client.
3602
+ * This method disables or re-enables the local video capture, and does not affect receiving the remote video stream. After calling enableVideo, the local video capture is enabled by default. If you call enableLocalVideo (false) to disable local video capture within the channel, it also simultaneously stops publishing the video stream within the channel. If you want to restart video catpure, you can call enableLocalVideo (true) and then call updateChannelMediaOptions to set the options parameter to publish the locally captured video stream in the channel. After the local video capturer is successfully disabled or re-enabled, the SDK triggers the onRemoteVideoStateChanged callback on the remote client.
3572
3603
  * You can call this method either before or after joining a channel.
3573
3604
  * This method enables the internal engine and is valid after leaving the channel.
3574
3605
  *
@@ -3600,6 +3631,21 @@ export abstract class IRtcEngine {
3600
3631
  */
3601
3632
  abstract setDefaultMuteAllRemoteVideoStreams(mute: boolean): number;
3602
3633
 
3634
+ /**
3635
+ * Sets the default video stream type to subscribe to.
3636
+ *
3637
+ * The SDK defaults to enabling low-quality video stream adaptive mode (AutoSimulcastStream) on the sender side, which means the sender does not actively send low-quality video stream. The receiver can initiate a low-quality video stream request by calling this method, and the sender will automatically start sending low-quality video stream upon receiving the request. By default, users receive the high-quality video stream. Call this method if you want to switch to the low-quality video stream. The SDK will dynamically adjust the size of the corresponding video stream based on the size of the video window to save bandwidth and computing resources. The default aspect ratio of the low-quality video stream is the same as that of the high-quality video stream. According to the current aspect ratio of the high-quality video stream, the system will automatically allocate the resolution, frame rate, and bitrate of the low-quality video stream. Under limited network conditions, if the publisher does not disable the dual-stream mode using enableDualStreamMode (false), the receiver can choose to receive either the high-quality video stream, or the low-quality video stream. The high-quality video stream has a higher resolution and bitrate, while the low-quality video stream has a lower resolution and bitrate.
3638
+ * Call this method before joining a channel. The SDK does not support changing the default subscribed video stream type after joining a channel.
3639
+ * If you call both this method and setRemoteVideoStreamType, the setting of setRemoteVideoStreamType takes effect.
3640
+ *
3641
+ * @param streamType The default video-stream type. See VideoStreamType.
3642
+ *
3643
+ * @returns
3644
+ * 0: Success.
3645
+ * < 0: Failure.
3646
+ */
3647
+ abstract setRemoteDefaultVideoStreamType(streamType: VideoStreamType): number;
3648
+
3603
3649
  /**
3604
3650
  * Stops or resumes subscribing to the video stream of a specified user.
3605
3651
  *
@@ -3615,12 +3661,12 @@ export abstract class IRtcEngine {
3615
3661
  abstract muteRemoteVideoStream(uid: number, mute: boolean): number;
3616
3662
 
3617
3663
  /**
3618
- * Sets the stream type of the remote video.
3664
+ * Sets the video stream type to subscribe to.
3619
3665
  *
3620
- * Under limited network conditions, if the publisher has not disabled the dual-stream mode using enableDualStreamMode (false), the receiver can choose to receive either the high-quality video stream or the low-quality video stream. The high-quality video stream has a higher resolution and bitrate, and the low-quality video stream has a lower resolution and bitrate. By default, users receive the high-quality video stream. Call this method if you want to switch to the low-quality video stream. This method allows the app to adjust the corresponding video stream type based on the size of the video window to reduce the bandwidth and resources. The aspect ratio of the low-quality video stream is the same as the high-quality video stream. Once the resolution of the high-quality video stream is set, the system automatically sets the resolution, frame rate, and bitrate of the low-quality video stream. By default, the SDK enables the low-quality video stream auto mode on the sending end (it does not actively send the low-quality video stream). The host identity receiver can initiate a low-quality video stream application at the receiving end by calling this method (the call to this method by the audience receiver does not take effect). After receiving the application, the sending end automatically switches to the low-quality video stream mode. You can call this method either before or after joining a channel. If you call both setRemoteVideoStreamType and setRemoteDefaultVideoStreamType, the setting of setRemoteVideoStreamType takes effect.
3666
+ * Under limited network conditions, if the publisher does not disable the dual-stream mode using enableDualStreamMode (false), the receiver can choose to receive either the high-quality video stream, or the low-quality video stream. The high-quality video stream has a higher resolution and bitrate, while the low-quality video stream has a lower resolution and bitrate. By default, users receive the high-quality video stream. Call this method if you want to switch to the low-quality video stream. The SDK will dynamically adjust the size of the corresponding video stream based on the size of the video window to save bandwidth and computing resources. The default aspect ratio of the low-quality video stream is the same as that of the high-quality video stream. According to the current aspect ratio of the high-quality video stream, the system will automatically allocate the resolution, frame rate, and bitrate of the low-quality video stream. The SDK defaults to enabling low-quality video stream adaptive mode (AutoSimulcastStream) on the sender side, which means the sender does not actively send low-quality video stream. The receiver can initiate a low-quality video stream request by calling this method, and the sender will automatically start sending low-quality video stream upon receiving the request. You can call this method either before or after joining a channel. If you call both setRemoteVideoStreamType and setRemoteDefaultVideoStreamType, the setting of setRemoteVideoStreamType takes effect.
3621
3667
  *
3622
3668
  * @param uid The user ID.
3623
- * @param streamType The video stream type: VideoStreamType.
3669
+ * @param streamType The video stream type, see VideoStreamType.
3624
3670
  *
3625
3671
  * @returns
3626
3672
  * 0: Success.
@@ -3655,21 +3701,6 @@ export abstract class IRtcEngine {
3655
3701
  options: VideoSubscriptionOptions
3656
3702
  ): number;
3657
3703
 
3658
- /**
3659
- * Sets the default stream type of subscrption for remote video streams.
3660
- *
3661
- * By default, the SDK enables the low-quality video stream auto mode on the sending end (it does not actively send the low-quality video stream). The host identity receiver can initiate a low-quality video stream application at the receiving end by calling this method (the call to this method by the audience receiver does not take effect). After receiving the application, the sending end automatically switches to the low-quality video stream mode. Under limited network conditions, if the publisher has not disabled the dual-stream mode using enableDualStreamMode (false), the receiver can choose to receive either the high-quality video stream or the low-video stream. The high-quality video stream has a higher resolution and bitrate, and the low-quality video stream has a lower resolution and bitrate. By default, users receive the high-quality video stream. Call this method if you want to switch to the low-quality video stream. This method allows the app to adjust the corresponding video stream type based on the size of the video window to reduce the bandwidth and resources. The aspect ratio of the low-quality video stream is the same as the high-quality video stream. Once the resolution of the high-quality video stream is set, the system automatically sets the resolution, frame rate, and bitrate of the low-quality video stream.
3662
- * Call this method before joining a channel. The SDK does not support changing the default subscribed video stream type after joining a channel.
3663
- * If you call both this method and setRemoteVideoStreamType, the SDK applies the settings in the setRemoteVideoStreamType method.
3664
- *
3665
- * @param streamType The default video-stream type. See VideoStreamType.
3666
- *
3667
- * @returns
3668
- * 0: Success.
3669
- * < 0: Failure.
3670
- */
3671
- abstract setRemoteDefaultVideoStreamType(streamType: VideoStreamType): number;
3672
-
3673
3704
  /**
3674
3705
  * Set the blocklist of subscriptions for audio streams.
3675
3706
  *
@@ -3761,7 +3792,7 @@ export abstract class IRtcEngine {
3761
3792
  *
3762
3793
  * @param interval Sets the time interval between two consecutive volume indications:
3763
3794
  * ≤ 0: Disables the volume indication.
3764
- * > 0: Time interval (ms) between two consecutive volume indications. The lowest value is 50.
3795
+ * > 0: Time interval (ms) between two consecutive volume indications. Ensure this parameter is set to a value greater than 10, otherwise you will not receive the onAudioVolumeIndication callback. Agora recommends that this value is set as greater than 100.
3765
3796
  * @param smooth The smoothing factor that sets the sensitivity of the audio volume indicator. The value ranges between 0 and 10. The recommended value is 3. The greater the value, the more sensitive the indicator.
3766
3797
  * @param reportVad true : Enables the voice activity detection of the local user. Once it is enabled, the vad parameter of the onAudioVolumeIndication callback reports the voice activity status of the local user. false : (Default) Disables the voice activity detection of the local user. Once it is disabled, the vad parameter of the onAudioVolumeIndication callback does not report the voice activity status of the local user, except for the scenario where the engine automatically detects the voice activity of the local user.
3767
3798
  *
@@ -3847,9 +3878,9 @@ export abstract class IRtcEngine {
3847
3878
  * Starts playing the music file.
3848
3879
  *
3849
3880
  * This method mixes the specified local or online audio file with the audio from the microphone, or replaces the microphone's audio with the specified local or remote audio file. A successful method call triggers the onAudioMixingStateChanged (AudioMixingStatePlaying) callback. When the audio mixing file playback finishes, the SDK triggers the onAudioMixingStateChanged (AudioMixingStateStopped) callback on the local client.
3850
- * For the audio file formats supported by this method, see What formats of audio files does the Agora RTC SDK support.
3851
3881
  * You can call this method either before or after joining a channel. If you need to call startAudioMixing multiple times, ensure that the time interval between calling this method is more than 500 ms.
3852
3882
  * If the local music file does not exist, the SDK does not support the file format, or the the SDK cannot access the music file URL, the SDK reports 701.
3883
+ * For the audio file formats supported by this method, see What formats of audio files does the Agora RTC SDK support.
3853
3884
  *
3854
3885
  * @param filePath File path:
3855
3886
  * Windows: The absolute path or URL address (including the suffixes of the filename) of the audio effect file. For example : C:\music\audio.mp4.
@@ -4089,9 +4120,7 @@ export abstract class IRtcEngine {
4089
4120
  /**
4090
4121
  * Preloads a specified audio effect file into the memory.
4091
4122
  *
4092
- * To ensure smooth communication, It is recommended that you limit the size of the audio effect file. You can call this method to preload the audio effect before calling joinChannel.
4093
- * This method does not support online audio effect files.
4094
- * For the audio file formats supported by this method, see What formats of audio files does the Agora RTC SDK support.
4123
+ * To ensure smooth communication, It is recommended that you limit the size of the audio effect file. You can call this method to preload the audio effect before calling joinChannel. For the audio file formats supported by this method, see What formats of audio files does the Agora RTC SDK support.
4095
4124
  *
4096
4125
  * @param soundId The audio effect ID. The ID of each audio effect file is unique.
4097
4126
  * @param filePath File path:
@@ -4635,7 +4664,7 @@ export abstract class IRtcEngine {
4635
4664
  * Deprecated: Use the logConfig parameter in initialize instead. By default, the SDK generates five SDK log files and five API call log files with the following rules:
4636
4665
  * The SDK log files are: agorasdk.log, agorasdk.1.log, agorasdk.2.log, agorasdk.3.log, and agorasdk.4.log.
4637
4666
  * The API call log files are: agoraapi.log, agoraapi.1.log, agoraapi.2.log, agoraapi.3.log, and agoraapi.4.log.
4638
- * The default size for each SDK log file is 1,024 KB; the default size for each API call log file is 2,048 KB. These log files are encoded in UTF-8.
4667
+ * The default size of each SDK log file and API log file is 2,048 KB. These log files are encoded in UTF-8.
4639
4668
  * The SDK writes the latest logs in agorasdk.log or agoraapi.log.
4640
4669
  * When agorasdk.log is full, the SDK processes the log files in the following order:
4641
4670
  * Delete the agorasdk.4.log file (if any).
@@ -4664,6 +4693,7 @@ export abstract class IRtcEngine {
4664
4693
  * After initializing the local video view, you can call this method to update its rendering and mirror modes. It affects only the video view that the local user sees, not the published local video stream.
4665
4694
  * Ensure that you have called the setupLocalVideo method to initialize the local video view before calling this method.
4666
4695
  * During a call, you can call this method as many times as necessary to update the display mode of the local video view.
4696
+ * This method only takes effect on the primary camera (PrimaryCameraSource). In scenarios involving custom video capture or the use of alternative video sources, you need to use setupLocalVideo instead of this method.
4667
4697
  *
4668
4698
  * @param renderMode The local video display mode. See RenderModeType.
4669
4699
  * @param mirrorMode The mirror mode of the local video view. See VideoMirrorModeType. If you use a front camera, the SDK enables the mirror mode by default; if you use a rear camera, the SDK disables the mirror mode by default.
@@ -4712,7 +4742,7 @@ export abstract class IRtcEngine {
4712
4742
  abstract setLocalVideoMirrorMode(mirrorMode: VideoMirrorModeType): number;
4713
4743
 
4714
4744
  /**
4715
- * Enables or disables the dual-stream mode on the sender and sets the low-quality video stream.
4745
+ * Sets the dual-stream mode on the sender side and the low-quality video stream.
4716
4746
  *
4717
4747
  * Deprecated: This method is deprecated as of v4.2.0. Use setDualStreamMode instead. You can call this method to enable or disable the dual-stream mode on the publisher side. Dual streams are a pairing of a high-quality video stream and a low-quality video stream:
4718
4748
  * High-quality video stream: High bitrate, high resolution.
@@ -4722,7 +4752,7 @@ export abstract class IRtcEngine {
4722
4752
  * You can call this method either before or after joining a channel.
4723
4753
  *
4724
4754
  * @param enabled Whether to enable dual-stream mode: true : Enable dual-stream mode. false : (Default) Disable dual-stream mode.
4725
- * @param streamConfig The configuration of the low-quality video stream. See SimulcastStreamConfig.
4755
+ * @param streamConfig The configuration of the low-quality video stream. See SimulcastStreamConfig. When setting mode to DisableSimulcastStream, setting streamConfig will not take effect.
4726
4756
  *
4727
4757
  * @returns
4728
4758
  * 0: Success.
@@ -4734,13 +4764,13 @@ export abstract class IRtcEngine {
4734
4764
  ): number;
4735
4765
 
4736
4766
  /**
4737
- * Sets dual-stream mode configuration on the sender, and sets the low-quality video stream.
4767
+ * Sets dual-stream mode configuration on the sender side.
4738
4768
  *
4739
- * The SDK enables the low-quality video stream auto mode on the sender side by default (it does not actively sending low-quality video streams). The host identity receiver can initiate a low-quality video stream application at the receiving end by calling setRemoteVideoStreamType. After receiving the application, the sending end automatically switches to the low-quality video stream mode.
4740
- * If you want to modify this behavior, you can call this method and modify the mode to DisableSimulcastStream (never send low-quality video streams) or EnableSimulcastStream (always send low-quality video streams).
4769
+ * The SDK defaults to enabling low-quality video stream adaptive mode (AutoSimulcastStream) on the sender side, which means the sender does not actively send low-quality video stream. The receiver can initiate a low-quality video stream request by calling setRemoteVideoStreamType, and the sender then automatically starts sending low-quality video stream upon receiving the request.
4770
+ * If you want to modify this behavior, you can call this method and set mode to DisableSimulcastStream (never send low-quality video streams) or EnableSimulcastStream (always send low-quality video streams).
4741
4771
  * If you want to restore the default behavior after making changes, you can call this method again with mode set to AutoSimulcastStream. The difference and connection between this method and enableDualStreamMode is as follows:
4742
- * When calling this method and setting mode to DisableSimulcastStream, it has the same effect as calling and setting enabled to false.
4743
- * When calling this method and setting mode to EnableSimulcastStream, it has the same effect as calling and setting enabled to true.
4772
+ * When calling this method and setting mode to DisableSimulcastStream, it has the same effect as calling enableDualStreamMode and setting enabled to false.
4773
+ * When calling this method and setting mode to EnableSimulcastStream, it has the same effect as calling enableDualStreamMode and setting enabled to true.
4744
4774
  * Both methods can be called before and after joining a channel. If both methods are used, the settings in the method called later takes precedence.
4745
4775
  *
4746
4776
  * @param mode The mode in which the video stream is sent. See SimulcastStreamMode.
@@ -4756,7 +4786,16 @@ export abstract class IRtcEngine {
4756
4786
  ): number;
4757
4787
 
4758
4788
  /**
4759
- * @ignore
4789
+ * Sets whether to enable the local playback of external audio source.
4790
+ *
4791
+ * Ensure you have called the createCustomAudioTrack method to create a custom audio track before calling this method. After calling this method to enable the local playback of external audio source, if you need to stop local playback, you can call this method again and set enabled to false. You can call adjustCustomAudioPlayoutVolume to adjust the local playback volume of the custom audio track.
4792
+ *
4793
+ * @param trackId The audio track ID. Set this parameter to the custom audio track ID returned in createCustomAudioTrack.
4794
+ * @param enabled Whether to play the external audio source: true : Play the external audio source. false : (Default) Do not play the external source.
4795
+ *
4796
+ * @returns
4797
+ * 0: Success.
4798
+ * < 0: Failure.
4760
4799
  */
4761
4800
  abstract enableCustomAudioLocalPlayback(
4762
4801
  trackId: number,
@@ -4859,7 +4898,7 @@ export abstract class IRtcEngine {
4859
4898
  * Sets the audio data format reported by onPlaybackAudioFrameBeforeMixing.
4860
4899
  *
4861
4900
  * @param sampleRate The sample rate (Hz) of the audio data, which can be set as 8000, 16000, 32000, 44100, or 48000.
4862
- * @param channel The number of channels of the external audio source, which can be set as 1 (Mono) or 2 (Stereo).
4901
+ * @param channel The number of channels of the audio data, which can be set as 1 (Mono) or 2 (Stereo).
4863
4902
  *
4864
4903
  * @returns
4865
4904
  * 0: Success.
@@ -4988,7 +5027,15 @@ export abstract class IRtcEngine {
4988
5027
  abstract setLocalPublishFallbackOption(option: StreamFallbackOptions): number;
4989
5028
 
4990
5029
  /**
4991
- * @ignore
5030
+ * Sets the fallback option for the subscribed video stream based on the network conditions.
5031
+ *
5032
+ * An unstable network affects the audio and video quality in a video call or interactive live video streaming. If option is set as StreamFallbackOptionVideoStreamLow or StreamFallbackOptionAudioOnly, the SDK automatically switches the video from a high-quality stream to a low-quality stream or disables the video when the downlink network conditions cannot support both audio and video to guarantee the quality of the audio. Meanwhile, the SDK continuously monitors network quality and resumes subscribing to audio and video streams when the network quality improves. When the subscribed video stream falls back to an audio-only stream, or recovers from an audio-only stream to an audio-video stream, the SDK triggers the onRemoteSubscribeFallbackToAudioOnly callback. Ensure that you call this method before joining a channel.
5033
+ *
5034
+ * @param option Fallback options for the subscribed stream. See STREAM_FALLBACK_OPTIONS.
5035
+ *
5036
+ * @returns
5037
+ * 0: Success.
5038
+ * < 0: Failure.
4992
5039
  */
4993
5040
  abstract setRemoteSubscribeFallbackOption(
4994
5041
  option: StreamFallbackOptions
@@ -5004,40 +5051,113 @@ export abstract class IRtcEngine {
5004
5051
  ): number;
5005
5052
 
5006
5053
  /**
5007
- * Enables loopback audio capturing.
5054
+ * Enables or disables extensions.
5008
5055
  *
5009
- * If you enable loopback audio capturing, the output of the sound card is mixed into the audio stream sent to the other end.
5010
- * macOS does not support loopback audio capture of the default sound card. If you need to use this function, use a virtual sound card and pass its name to the deviceName parameter. Agora recommends using AgoraALD as the virtual sound card for audio capturing.
5011
- * You can call this method either before or after joining a channel.
5056
+ * To call this method, call it immediately after initializing the IRtcEngine object.
5057
+ * If you want to enable multiple extensions, you need to call this method multiple times.
5058
+ * The data processing order of different extensions in the SDK is determined by the order in which the extensions are enabled. That is, the extension that is enabled first will process the data first.
5012
5059
  *
5013
- * @param enabled Whether to enable loopback audio capturing. true : Enable loopback audio capturing. false : (Default) Disable loopback audio capturing.
5014
- * @param deviceName macOS: The device name of the virtual sound card. The default value is set to NULL, which means using AgoraALD for loopback audio capturing.
5015
- * Windows: The device name of the sound card. The default is set to NULL, which means the SDK uses the sound card of your device for loopback audio capturing.
5060
+ * @param provider The name of the extension provider.
5061
+ * @param extension The name of the extension.
5062
+ * @param enable Whether to enable the extension: true : Enable the extension. false : Disable the extension.
5063
+ * @param type Type of media source. See MediaSourceType. In this method, this parameter supports only the following two settings:
5064
+ * The default value is UnknownMediaSource.
5065
+ * If you want to use the second camera to capture video, set this parameter to SecondaryCameraSource.
5016
5066
  *
5017
5067
  * @returns
5018
5068
  * 0: Success.
5019
5069
  * < 0: Failure.
5070
+ * -3: The extension library is not loaded. Agora recommends that you check the storage location or the name of the dynamic library.
5020
5071
  */
5021
- abstract enableLoopbackRecording(
5022
- enabled: boolean,
5023
- deviceName?: string
5072
+ abstract enableExtension(
5073
+ provider: string,
5074
+ extension: string,
5075
+ enable?: boolean,
5076
+ type?: MediaSourceType
5024
5077
  ): number;
5025
5078
 
5026
5079
  /**
5027
- * Adjusts the volume of the signal captured by the sound card.
5080
+ * Sets the properties of the extension.
5028
5081
  *
5029
- * After calling enableLoopbackRecording to enable loopback audio capturing, you can call this method to adjust the volume of the signal captured by the sound card.
5082
+ * After enabling the extension, you can call this method to set the properties of the extension.
5030
5083
  *
5031
- * @param volume Audio mixing volume. The value ranges between 0 and 100. The default value is 100, which means the original volume.
5084
+ * @param provider The name of the extension provider.
5085
+ * @param extension The name of the extension.
5086
+ * @param key The key of the extension.
5087
+ * @param value The value of the extension key.
5088
+ * @param type Type of media source. See MediaSourceType. In this method, this parameter supports only the following two settings:
5089
+ * The default value is UnknownMediaSource.
5090
+ * If you want to use the second camera to capture video, set this parameter to SecondaryCameraSource.
5032
5091
  *
5033
5092
  * @returns
5034
5093
  * 0: Success.
5035
5094
  * < 0: Failure.
5036
5095
  */
5037
- abstract adjustLoopbackSignalVolume(volume: number): number;
5096
+ abstract setExtensionProperty(
5097
+ provider: string,
5098
+ extension: string,
5099
+ key: string,
5100
+ value: string,
5101
+ type?: MediaSourceType
5102
+ ): number;
5038
5103
 
5039
5104
  /**
5040
- * @ignore
5105
+ * Gets detailed information on the extensions.
5106
+ *
5107
+ * @param provider The name of the extension provider.
5108
+ * @param extension The name of the extension.
5109
+ * @param key The key of the extension.
5110
+ * @param bufLen Maximum length of the JSON string indicating the extension property. The maximum value is 512 bytes.
5111
+ * @param type Source type of the extension. See MediaSourceType.
5112
+ *
5113
+ * @returns
5114
+ * The extension information, if the method call succeeds.
5115
+ * An empty string, if the method call fails.
5116
+ */
5117
+ abstract getExtensionProperty(
5118
+ provider: string,
5119
+ extension: string,
5120
+ key: string,
5121
+ bufLen: number,
5122
+ type?: MediaSourceType
5123
+ ): string;
5124
+
5125
+ /**
5126
+ * Enables loopback audio capturing.
5127
+ *
5128
+ * If you enable loopback audio capturing, the output of the sound card is mixed into the audio stream sent to the other end.
5129
+ * macOS does not support loopback audio capture of the default sound card. If you need to use this function, use a virtual sound card and pass its name to the deviceName parameter. Agora recommends using AgoraALD as the virtual sound card for audio capturing.
5130
+ * You can call this method either before or after joining a channel.
5131
+ * If you call the disableAudio method to disable the audio module, audio capturing will be disabled as well. If you need to enable audio capturing, call the enableAudio method to enable the audio module and then call the enableLoopbackRecording method.
5132
+ *
5133
+ * @param enabled Sets whether to enable loopback audio capturing. true : Enable loopback audio capturing. false : (Default) Disable loopback audio capturing.
5134
+ * @param deviceName macOS: The device name of the virtual sound card. The default value is set to NULL, which means using AgoraALD for loopback audio capturing.
5135
+ * Windows: The device name of the sound card. The default is set to NULL, which means the SDK uses the sound card of your device for loopback audio capturing.
5136
+ *
5137
+ * @returns
5138
+ * 0: Success.
5139
+ * < 0: Failure.
5140
+ */
5141
+ abstract enableLoopbackRecording(
5142
+ enabled: boolean,
5143
+ deviceName?: string
5144
+ ): number;
5145
+
5146
+ /**
5147
+ * Adjusts the volume of the signal captured by the sound card.
5148
+ *
5149
+ * After calling enableLoopbackRecording to enable loopback audio capturing, you can call this method to adjust the volume of the signal captured by the sound card.
5150
+ *
5151
+ * @param volume Audio mixing volume. The value ranges between 0 and 100. The default value is 100, which means the original volume.
5152
+ *
5153
+ * @returns
5154
+ * 0: Success.
5155
+ * < 0: Failure.
5156
+ */
5157
+ abstract adjustLoopbackSignalVolume(volume: number): number;
5158
+
5159
+ /**
5160
+ * @ignore
5041
5161
  */
5042
5162
  abstract getLoopbackRecordingVolume(): number;
5043
5163
 
@@ -5064,13 +5184,12 @@ export abstract class IRtcEngine {
5064
5184
  /**
5065
5185
  * Sets the volume of the in-ear monitor.
5066
5186
  *
5067
- * Users must use wired earphones to hear their own voices.
5068
- * You can call this method either before or after joining a channel.
5069
- *
5070
- * @param volume The volume of the in-ear monitor. The value ranges between 0 and 100. The default value is 100.
5187
+ * You can call this method either before or after joining a channel.
5071
5188
  *
5072
- * @returns
5073
- * < 0: Failure.
5189
+ * @param volume The volume of the in-ear monitor. The value range is [0,400].
5190
+ * 0: Mute.
5191
+ * 100: (Default) The original volume.
5192
+ * 400: Four times the original volume.
5074
5193
  */
5075
5194
  abstract setInEarMonitoringVolume(volume: number): number;
5076
5195
 
@@ -5131,78 +5250,6 @@ export abstract class IRtcEngine {
5131
5250
  type?: MediaSourceType
5132
5251
  ): number;
5133
5252
 
5134
- /**
5135
- * Enables or disables extensions.
5136
- *
5137
- * To call this method, call it immediately after initializing the IRtcEngine object.
5138
- * If you want to enable multiple extensions, you need to call this method multiple times.
5139
- * The data processing order of different extensions in the SDK is determined by the order in which the extensions are enabled. That is, the extension that is enabled first will process the data first.
5140
- *
5141
- * @param provider The name of the extension provider.
5142
- * @param extension The name of the extension.
5143
- * @param enable Whether to enable the extension: true : Enable the extension. false : Disable the extension.
5144
- * @param type Type of media source. See MediaSourceType. In this method, this parameter supports only the following two settings:
5145
- * The default value is UnknownMediaSource.
5146
- * If you want to use the second camera to capture video, set this parameter to SecondaryCameraSource.
5147
- *
5148
- * @returns
5149
- * 0: Success.
5150
- * < 0: Failure.
5151
- * -3: The extension library is not loaded. Agora recommends that you check the storage location or the name of the dynamic library.
5152
- */
5153
- abstract enableExtension(
5154
- provider: string,
5155
- extension: string,
5156
- enable?: boolean,
5157
- type?: MediaSourceType
5158
- ): number;
5159
-
5160
- /**
5161
- * Sets the properties of the extension.
5162
- *
5163
- * After enabling the extension, you can call this method to set the properties of the extension.
5164
- *
5165
- * @param provider The name of the extension provider.
5166
- * @param extension The name of the extension.
5167
- * @param key The key of the extension.
5168
- * @param value The value of the extension key.
5169
- * @param type Type of media source. See MediaSourceType. In this method, this parameter supports only the following two settings:
5170
- * The default value is UnknownMediaSource.
5171
- * If you want to use the second camera to capture video, set this parameter to SecondaryCameraSource.
5172
- *
5173
- * @returns
5174
- * 0: Success.
5175
- * < 0: Failure.
5176
- */
5177
- abstract setExtensionProperty(
5178
- provider: string,
5179
- extension: string,
5180
- key: string,
5181
- value: string,
5182
- type?: MediaSourceType
5183
- ): number;
5184
-
5185
- /**
5186
- * Gets detailed information on the extensions.
5187
- *
5188
- * @param provider The name of the extension provider.
5189
- * @param extension The name of the extension.
5190
- * @param key The key of the extension.
5191
- * @param bufLen Maximum length of the JSON string indicating the extension property. The maximum value is 512 bytes.
5192
- * @param type Source type of the extension. See MediaSourceType.
5193
- *
5194
- * @returns
5195
- * The extension information, if the method call succeeds.
5196
- * An empty string, if the method call fails.
5197
- */
5198
- abstract getExtensionProperty(
5199
- provider: string,
5200
- extension: string,
5201
- key: string,
5202
- bufLen: number,
5203
- type?: MediaSourceType
5204
- ): string;
5205
-
5206
5253
  /**
5207
5254
  * @ignore
5208
5255
  */
@@ -5211,12 +5258,12 @@ export abstract class IRtcEngine {
5211
5258
  ): number;
5212
5259
 
5213
5260
  /**
5214
- * Creates a customized video track.
5261
+ * Creates a custom video track.
5215
5262
  *
5216
- * When you need to publish multiple custom captured videos in the channel, you can refer to the following steps:
5263
+ * To publish a custom video source, see the following steps:
5217
5264
  * Call this method to create a video track and get the video track ID.
5218
- * In each channel's ChannelMediaOptions, set the customVideoTrackId parameter to the ID of the video track you want to publish, and set publishCustomVideoTrack to true.
5219
- * If you call pushVideoFrame, and specify customVideoTrackId as the videoTrackId set in step 2, you can publish the corresponding custom video source in multiple channels.
5265
+ * Call joinChannel to join the channel. In ChannelMediaOptions, set customVideoTrackId to the video track ID that you want to publish, and set publishCustomVideoTrack to true.
5266
+ * Call pushVideoFrame and specify videoTrackId as the video track ID set in step 2. You can then publish the corresponding custom video source in the channel.
5220
5267
  *
5221
5268
  * @returns
5222
5269
  * If the method call is successful, the video track ID is returned as the unique identifier of the video track.
@@ -5523,22 +5570,6 @@ export abstract class IRtcEngine {
5523
5570
  */
5524
5571
  abstract startScreenCapture(captureParams: ScreenCaptureParameters2): number;
5525
5572
 
5526
- /**
5527
- * Starts screen capture.
5528
- *
5529
- * This method, as well as startScreenCaptureByDisplayId and startScreenCaptureByWindowId, all have the capability to start screen capture, with the following differences: startScreenCaptureByDisplayId and startScreenCaptureByWindowId only support capturing video from a single screen or window. By calling this method and specifying the sourceType parameter, you can capture multiple video streams used for local video mixing or multi-channel publishing.
5530
- * If you call this method to start screen capture, Agora recommends that you call stopScreenCaptureBySourceType to stop the capture and avoid using stopScreenCapture.
5531
- *
5532
- * @param sourceType The type of the video source. See VideoSourceType.
5533
- * Windows supports up to four screen capture video streams.
5534
- * macOS supports only one screen capture video stream. You can only set this parameter to VideoSourceScreen (2).
5535
- * @param config The configuration of the captured screen. See ScreenCaptureConfiguration.
5536
- */
5537
- abstract startScreenCaptureBySourceType(
5538
- sourceType: VideoSourceType,
5539
- config: ScreenCaptureConfiguration
5540
- ): number;
5541
-
5542
5573
  /**
5543
5574
  * @ignore
5544
5575
  */
@@ -5573,20 +5604,6 @@ export abstract class IRtcEngine {
5573
5604
  */
5574
5605
  abstract stopScreenCapture(): number;
5575
5606
 
5576
- /**
5577
- * Stops screen capture.
5578
- *
5579
- * After calling startScreenCaptureBySourceType to start capturing video from one or more screens, you can call this method and set the sourceType parameter to stop capturing from the specified screens.
5580
- * If you call startScreenCaptureByWindowId or startScreenCaptureByDisplayId to start screen capture, Agora recommends that you call stopScreenCapture to stop the capture and do not use this one.
5581
- *
5582
- * @param sourceType The type of the video source. See VideoSourceType.
5583
- *
5584
- * @returns
5585
- * 0: Success.
5586
- * < 0: Failure.
5587
- */
5588
- abstract stopScreenCaptureBySourceType(sourceType: VideoSourceType): number;
5589
-
5590
5607
  /**
5591
5608
  * Retrieves the call ID.
5592
5609
  *
@@ -5647,9 +5664,9 @@ export abstract class IRtcEngine {
5647
5664
  * @returns
5648
5665
  * 0: Success.
5649
5666
  * < 0: Failure.
5650
- * -2: The URL is null or the string length is 0.
5667
+ * -2: The URL or configuration of transcoding is invalid; check your URL and transcoding configurations.
5651
5668
  * -7: The SDK is not initialized before calling this method.
5652
- * -19: The Media Push URL is already in use, use another URL instead.
5669
+ * -19: The Media Push URL is already in use; use another URL instead.
5653
5670
  */
5654
5671
  abstract startRtmpStreamWithoutTranscoding(url: string): number;
5655
5672
 
@@ -5667,9 +5684,9 @@ export abstract class IRtcEngine {
5667
5684
  * @returns
5668
5685
  * 0: Success.
5669
5686
  * < 0: Failure.
5670
- * -2: The URL is null or the string length is 0.
5687
+ * -2: The URL or configuration of transcoding is invalid; check your URL and transcoding configurations.
5671
5688
  * -7: The SDK is not initialized before calling this method.
5672
- * -19: The Media Push URL is already in use, use another URL instead.
5689
+ * -19: The Media Push URL is already in use; use another URL instead.
5673
5690
  */
5674
5691
  abstract startRtmpStreamWithTranscoding(
5675
5692
  url: string,
@@ -5689,19 +5706,6 @@ export abstract class IRtcEngine {
5689
5706
  */
5690
5707
  abstract updateRtmpTranscoding(transcoding: LiveTranscoding): number;
5691
5708
 
5692
- /**
5693
- * Stops pushing media streams to a CDN.
5694
- *
5695
- * Agora recommends that you use the server-side Media Push function. You can call this method to stop the live stream on the specified CDN address. This method can stop pushing media streams to only one CDN address at a time, so if you need to stop pushing streams to multiple addresses, call this method multiple times. After you call this method, the SDK triggers the onRtmpStreamingStateChanged callback on the local client to report the state of the streaming.
5696
- *
5697
- * @param url The address of Media Push. The format is RTMP or RTMPS. The character length cannot exceed 1024 bytes. Special characters such as Chinese characters are not supported.
5698
- *
5699
- * @returns
5700
- * 0: Success.
5701
- * < 0: Failure.
5702
- */
5703
- abstract stopRtmpStream(url: string): number;
5704
-
5705
5709
  /**
5706
5710
  * Starts the local video mixing.
5707
5711
  *
@@ -5740,10 +5744,27 @@ export abstract class IRtcEngine {
5740
5744
  config: LocalTranscoderConfiguration
5741
5745
  ): number;
5742
5746
 
5747
+ /**
5748
+ * Stops pushing media streams to a CDN.
5749
+ *
5750
+ * Agora recommends that you use the server-side Media Push function. You can call this method to stop the live stream on the specified CDN address. This method can stop pushing media streams to only one CDN address at a time, so if you need to stop pushing streams to multiple addresses, call this method multiple times. After you call this method, the SDK triggers the onRtmpStreamingStateChanged callback on the local client to report the state of the streaming.
5751
+ *
5752
+ * @param url The address of Media Push. The format is RTMP or RTMPS. The character length cannot exceed 1024 bytes. Special characters such as Chinese characters are not supported.
5753
+ *
5754
+ * @returns
5755
+ * 0: Success.
5756
+ * < 0: Failure.
5757
+ */
5758
+ abstract stopRtmpStream(url: string): number;
5759
+
5743
5760
  /**
5744
5761
  * Stops the local video mixing.
5745
5762
  *
5746
5763
  * After calling startLocalVideoTranscoder, call this method if you want to stop the local video mixing.
5764
+ *
5765
+ * @returns
5766
+ * 0: Success.
5767
+ * < 0: Failure.
5747
5768
  */
5748
5769
  abstract stopLocalVideoTranscoder(): number;
5749
5770
 
@@ -5755,6 +5776,10 @@ export abstract class IRtcEngine {
5755
5776
  * @param sourceType The type of the video source. See VideoSourceType.
5756
5777
  * On the desktop platforms, you can capture video from up to 4 cameras.
5757
5778
  * @param config The configuration of the video capture. See CameraCapturerConfiguration.
5779
+ *
5780
+ * @returns
5781
+ * 0: Success.
5782
+ * < 0: Failure.
5758
5783
  */
5759
5784
  abstract startCameraCapture(
5760
5785
  sourceType: VideoSourceType,
@@ -5814,8 +5839,7 @@ export abstract class IRtcEngine {
5814
5839
  /**
5815
5840
  * Adds event handlers
5816
5841
  *
5817
- * The SDK uses the IRtcEngineEventHandler class to send callbacks to the app. The app inherits the methods of this class to receive these callbacks. All methods in this class have default (empty) implementations. Therefore, apps only need to inherits callbacks according to the scenarios. In the callbacks, avoid time-consuming tasks or calling APIs that can block the thread, such as the sendStreamMessage method.
5818
- * Otherwise, the SDK may not work properly.
5842
+ * The SDK uses the IRtcEngineEventHandler class to send callbacks to the app. The app inherits the methods of this class to receive these callbacks. All methods in this class have default (empty) implementations. Therefore, apps only need to inherits callbacks according to the scenarios. In the callbacks, avoid time-consuming tasks or calling APIs that can block the thread, such as the sendStreamMessage method. Otherwise, the SDK may not work properly.
5819
5843
  *
5820
5844
  * @param eventHandler Callback events to be added. See IRtcEngineEventHandler.
5821
5845
  *
@@ -5917,8 +5941,7 @@ export abstract class IRtcEngine {
5917
5941
  * Sends data stream messages to all users in a channel. The SDK has the following restrictions on this method:
5918
5942
  * Up to 30 packets can be sent per second in a channel with each packet having a maximum size of 1 KB.
5919
5943
  * Each client can send up to 6 KB of data per second.
5920
- * Each user can have up to five data streams simultaneously. A successful method call triggers the onStreamMessage callback on the remote client, from which the remote user gets the stream message.
5921
- * A failed method call triggers the onStreamMessageError callback on the remote client.
5944
+ * Each user can have up to five data streams simultaneously. A successful method call triggers the onStreamMessage callback on the remote client, from which the remote user gets the stream message. A failed method call triggers the onStreamMessageError callback on the remote client.
5922
5945
  * Ensure that you call createDataStream to create a data channel before calling this method.
5923
5946
  * In live streaming scenarios, this method only applies to hosts.
5924
5947
  *
@@ -5947,7 +5970,6 @@ export abstract class IRtcEngine {
5947
5970
  * If you only want to add a watermark to the media push, you can call this method or the method.
5948
5971
  * This method supports adding a watermark image in the PNG file format only. Supported pixel formats of the PNG image are RGBA, RGB, Palette, Gray, and Alpha_gray.
5949
5972
  * If the dimensions of the PNG image differ from your settings in this method, the image will be cropped or zoomed to conform to your settings.
5950
- * If you have enabled the local video preview by calling the startPreview method, you can use the visibleInPreview member to set whether or not the watermark is visible in the preview.
5951
5973
  * If you have enabled the mirror mode for the local video, the watermark on the local video is also mirrored. To avoid mirroring the watermark, Agora recommends that you do not use the mirror and watermark functions for the local video at the same time. You can implement the watermark function in your application layer.
5952
5974
  *
5953
5975
  * @param watermarkUrl The local file path of the watermark image to be added. This method supports adding a watermark image from the local absolute or relative file path.
@@ -6045,7 +6067,7 @@ export abstract class IRtcEngine {
6045
6067
  */
6046
6068
  abstract startAudioFrameDump(
6047
6069
  channelId: string,
6048
- userId: number,
6070
+ uid: number,
6049
6071
  location: string,
6050
6072
  uuid: string,
6051
6073
  passwd: string,
@@ -6058,7 +6080,7 @@ export abstract class IRtcEngine {
6058
6080
  */
6059
6081
  abstract stopAudioFrameDump(
6060
6082
  channelId: string,
6061
- userId: number,
6083
+ uid: number,
6062
6084
  location: string
6063
6085
  ): number;
6064
6086
 
@@ -6093,7 +6115,7 @@ export abstract class IRtcEngine {
6093
6115
  * To ensure smooth communication, use the same parameter type to identify the user. For example, if a user joins the channel with a user ID, then ensure all the other users use the user ID too. The same applies to the user account. If a user joins the channel with the Agora Web SDK, ensure that the ID of the user is set to the same parameter type.
6094
6116
  *
6095
6117
  * @param appId The App ID of your project on Agora Console.
6096
- * @param userAccount The user account. This parameter is used to identify the user in the channel for real-time audio and video engagement. You need to set and manage user accounts yourself and ensure that each user account in the same channel is unique. The maximum length of this parameter is 255 bytes. Ensure that you set this parameter and do not set it as NULL. Supported characters are as follow(89 in total):
6118
+ * @param userAccount The user account. This parameter is used to identify the user in the channel for real-time audio and video engagement. You need to set and manage user accounts yourself and ensure that each user account in the same channel is unique. The maximum length of this parameter is 255 bytes. Ensure that you set this parameter and do not set it as null. Supported characters are as follow(89 in total):
6097
6119
  * The 26 lowercase English letters: a to z.
6098
6120
  * The 26 uppercase English letters: A to Z.
6099
6121
  * All numeric characters: 0 to 9.
@@ -6120,7 +6142,7 @@ export abstract class IRtcEngine {
6120
6142
  * All numeric characters: 0 to 9.
6121
6143
  * Space
6122
6144
  * "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", "{", "}", "|", "~", ","
6123
- * @param userAccount The user account. This parameter is used to identify the user in the channel for real-time audio and video engagement. You need to set and manage user accounts yourself and ensure that each user account in the same channel is unique. The maximum length of this parameter is 255 bytes. Ensure that you set this parameter and do not set it as NULL. Supported characters are (89 in total):
6145
+ * @param userAccount The user account. This parameter is used to identify the user in the channel for real-time audio and video engagement. You need to set and manage user accounts yourself and ensure that each user account in the same channel is unique. The maximum length of this parameter is 255 bytes. Ensure that you set this parameter and do not set it as null. Supported characters are (89 in total):
6124
6146
  * The 26 lowercase English letters: a to z.
6125
6147
  * The 26 uppercase English letters: A to Z.
6126
6148
  * All numeric characters: 0 to 9.
@@ -6160,7 +6182,7 @@ export abstract class IRtcEngine {
6160
6182
  * All numeric characters: 0 to 9.
6161
6183
  * Space
6162
6184
  * "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", "{", "}", "|", "~", ","
6163
- * @param userAccount The user account. This parameter is used to identify the user in the channel for real-time audio and video engagement. You need to set and manage user accounts yourself and ensure that each user account in the same channel is unique. The maximum length of this parameter is 255 bytes. Ensure that you set this parameter and do not set it as NULL. Supported characters are (89 in total):
6185
+ * @param userAccount The user account. This parameter is used to identify the user in the channel for real-time audio and video engagement. You need to set and manage user accounts yourself and ensure that each user account in the same channel is unique. The maximum length of this parameter is 255 bytes. Ensure that you set this parameter and do not set it as null. Supported characters are (89 in total):
6164
6186
  * The 26 lowercase English letters: a to z.
6165
6187
  * The 26 uppercase English letters: A to Z.
6166
6188
  * All numeric characters: 0 to 9.
@@ -6188,7 +6210,7 @@ export abstract class IRtcEngine {
6188
6210
  *
6189
6211
  * @returns
6190
6212
  * A pointer to the UserInfo instance, if the method call succeeds.
6191
- * If the call fails, returns NULL.
6213
+ * If the call fails, returns null.
6192
6214
  */
6193
6215
  abstract getUserInfoByUserAccount(userAccount: string): UserInfo;
6194
6216
 
@@ -6201,7 +6223,7 @@ export abstract class IRtcEngine {
6201
6223
  *
6202
6224
  * @returns
6203
6225
  * A pointer to the UserInfo instance, if the method call succeeds.
6204
- * If the call fails, returns NULL.
6226
+ * If the call fails, returns null.
6205
6227
  */
6206
6228
  abstract getUserInfoByUid(uid: number): UserInfo;
6207
6229
 
@@ -6230,47 +6252,6 @@ export abstract class IRtcEngine {
6230
6252
  configuration: ChannelMediaRelayConfiguration
6231
6253
  ): number;
6232
6254
 
6233
- /**
6234
- * Starts relaying media streams across channels. This method can be used to implement scenarios such as co-host across channels.
6235
- *
6236
- * Deprecated: This method is deprecated. Use startOrUpdateChannelMediaRelay instead. After a successful method call, the SDK triggers the onChannelMediaRelayStateChanged and onChannelMediaRelayEvent callbacks, and these callbacks return the state and events of the media stream relay.
6237
- * If the onChannelMediaRelayStateChanged callback returns RelayStateRunning (2) and RelayOk (0), and the onChannelMediaRelayEvent callback returns RelayEventPacketSentToDestChannel (4), it means that the SDK starts relaying media streams between the source channel and the target channel.
6238
- * If the onChannelMediaRelayStateChanged callback returns RelayStateFailure (3), an exception occurs during the media stream relay.
6239
- * Call this method after joining the channel.
6240
- * This method takes effect only when you are a host in a live streaming channel.
6241
- * After a successful method call, if you want to call this method again, ensure that you call the stopChannelMediaRelay method to quit the current relay.
6242
- * The relaying media streams across channels function needs to be enabled by contacting.
6243
- * Agora does not support string user accounts in this API.
6244
- *
6245
- * @param configuration The configuration of the media stream relay. See ChannelMediaRelayConfiguration.
6246
- *
6247
- * @returns
6248
- * 0: Success.
6249
- * < 0: Failure.
6250
- * -1: A general error occurs (no specified reason).
6251
- * -2: The parameter is invalid.
6252
- * -7: The method call was rejected. It may be because the SDK has not been initialized successfully, or the user role is not a host.
6253
- * -8: Internal state error. Probably because the user is not a broadcaster.
6254
- */
6255
- abstract startChannelMediaRelay(
6256
- configuration: ChannelMediaRelayConfiguration
6257
- ): number;
6258
-
6259
- /**
6260
- * Updates the channels for media stream relay.
6261
- *
6262
- * Deprecated: This method is deprecated. Use startOrUpdateChannelMediaRelay instead. After the media relay starts, if you want to relay the media stream to more channels, or leave the current relay channel, you can call this method. After a successful method call, the SDK triggers the onChannelMediaRelayEvent callback with the RelayEventPacketUpdateDestChannel (7) state code. Call the method after successfully calling the startChannelMediaRelay method and receiving onChannelMediaRelayStateChanged (RelayStateRunning, RelayOk); otherwise, the method call fails.
6263
- *
6264
- * @param configuration The configuration of the media stream relay. See ChannelMediaRelayConfiguration.
6265
- *
6266
- * @returns
6267
- * 0: Success.
6268
- * < 0: Failure.
6269
- */
6270
- abstract updateChannelMediaRelay(
6271
- configuration: ChannelMediaRelayConfiguration
6272
- ): number;
6273
-
6274
6255
  /**
6275
6256
  * Stops the media stream relay. Once the relay stops, the host quits all the target channels.
6276
6257
  *
@@ -6308,9 +6289,6 @@ export abstract class IRtcEngine {
6308
6289
  * Sets the audio profile of the audio streams directly pushed to the CDN by the host.
6309
6290
  *
6310
6291
  * @param profile The audio profile, including the sampling rate, bitrate, encoding mode, and the number of channels. See AudioProfileType.
6311
- *
6312
- * @returns
6313
- * < 0: Failure.
6314
6292
  */
6315
6293
  abstract setDirectCdnStreamingAudioConfiguration(
6316
6294
  profile: AudioProfileType
@@ -6424,7 +6402,7 @@ export abstract class IRtcEngine {
6424
6402
  /**
6425
6403
  * Adjusts the volume of the custom audio track played remotely.
6426
6404
  *
6427
- * Ensure you have called the createCustomAudioTrack method to create a custom audio track before calling this method. If you want to change the volume of the audio to be published, you need to call this method again.
6405
+ * Ensure you have called the createCustomAudioTrack method to create a custom audio track before calling this method. If you want to change the volume of the audio played remotely, you need to call this method again.
6428
6406
  *
6429
6407
  * @param trackId The audio track ID. Set this parameter to the custom audio track ID returned in createCustomAudioTrack.
6430
6408
  * @param volume The volume of the audio source. The value can range from 0 to 100. 0 means mute; 100 means the original volume.
@@ -6612,6 +6590,66 @@ export abstract class IRtcEngine {
6612
6590
  */
6613
6591
  abstract isFeatureAvailableOnDevice(type: FeatureType): boolean;
6614
6592
 
6593
+ /**
6594
+ * Starts screen capture.
6595
+ *
6596
+ * This method, as well as startScreenCaptureByDisplayId and startScreenCaptureByWindowId, can all be used to enable screen capture, with the following differences: startScreenCaptureByDisplayId and startScreenCaptureByWindowId only support capturing video from a single screen or window. By calling this method and specifying the sourceType parameter, you can capture multiple video streams used for local video mixing or multi-channel publishing.
6597
+ * If you call this method to start screen capture, Agora recommends that you call stopScreenCaptureBySourceType to stop the capture and avoid using stopScreenCapture.
6598
+ *
6599
+ * @param sourceType The type of the video source. See VideoSourceType.
6600
+ * Windows supports up to four screen capture video streams.
6601
+ * macOS supports only one screen capture video stream. You can only set this parameter to VideoSourceScreen (2).
6602
+ * @param config The configuration of the captured screen. See ScreenCaptureConfiguration.
6603
+ *
6604
+ * @returns
6605
+ * 0: Success.
6606
+ * < 0: Failure.
6607
+ */
6608
+ abstract startScreenCaptureBySourceType(
6609
+ sourceType: VideoSourceType,
6610
+ config: ScreenCaptureConfiguration
6611
+ ): number;
6612
+
6613
+ /**
6614
+ * Stops screen capture.
6615
+ *
6616
+ * After calling startScreenCaptureBySourceType to start capturing video from one or more screens, you can call this method and set the sourceType parameter to stop capturing from the specified screens.
6617
+ * If you call startScreenCaptureByWindowId or startScreenCaptureByDisplayId to start screen capture, Agora recommends that you call stopScreenCapture to stop the capture and do not use this one.
6618
+ *
6619
+ * @param sourceType The type of the video source. See VideoSourceType.
6620
+ *
6621
+ * @returns
6622
+ * 0: Success.
6623
+ * < 0: Failure.
6624
+ */
6625
+ abstract stopScreenCaptureBySourceType(sourceType: VideoSourceType): number;
6626
+
6627
+ /**
6628
+ * Releases the IRtcEngine instance.
6629
+ *
6630
+ * This method releases all resources used by the Agora SDK. Use this method for apps in which users occasionally make voice or video calls. When users do not make calls, you can free up resources for other operations. After a successful method call, you can no longer use any method or callback in the SDK anymore. If you want to use the real-time communication functions again, you must call createAgoraRtcEngine and initialize to create a new IRtcEngine instance.
6631
+ * This method can be called synchronously. You need to wait for the resource of IRtcEngine to be released before performing other operations (for example, create a new IRtcEngine object). Therefore, Agora recommends calling this method in the child thread to avoid blocking the main thread.
6632
+ * Besides, Agora does not recommend you calling release in any callback of the SDK. Otherwise, the SDK cannot release the resources until the callbacks return results, which may result in a deadlock.
6633
+ *
6634
+ * @param sync Whether the method is called synchronously: true : Synchronous call. false : Asynchronous call. Currently this method only supports synchronous calls. Do not set this parameter to this value.
6635
+ */
6636
+ abstract release(sync?: boolean): void;
6637
+
6638
+ /**
6639
+ * Enables the local video preview.
6640
+ *
6641
+ * You can call this method to enable local video preview. Call this method after the following:
6642
+ * Call setupLocalVideo to initialize the local preview.
6643
+ * Call enableVideo to enable the video module.
6644
+ * The local preview enables the mirror mode by default.
6645
+ * After the local video preview is enabled, if you call leaveChannel to exit the channel, the local preview remains until you call stopPreview to disable it.
6646
+ *
6647
+ * @returns
6648
+ * 0: Success.
6649
+ * < 0: Failure.
6650
+ */
6651
+ abstract startPreviewWithoutSourceType(): number;
6652
+
6615
6653
  /**
6616
6654
  * Gets the IAudioDeviceManager object to manage audio devices.
6617
6655
  *
@@ -6656,6 +6694,11 @@ export abstract class IRtcEngine {
6656
6694
  */
6657
6695
  abstract getLocalSpatialAudioEngine(): ILocalSpatialAudioEngine;
6658
6696
 
6697
+ /**
6698
+ * @ignore
6699
+ */
6700
+ abstract getH265Transcoder(): IH265Transcoder;
6701
+
6659
6702
  /**
6660
6703
  * Sends media metadata.
6661
6704
  *
@@ -6754,7 +6797,7 @@ export enum QualityReportFormatType {
6754
6797
  */
6755
6798
  export enum MediaDeviceStateType {
6756
6799
  /**
6757
- * @ignore
6800
+ * 0: The device is ready for use.
6758
6801
  */
6759
6802
  MediaDeviceStateIdle = 0,
6760
6803
  /**