agora-electron-sdk 4.3.2 → 4.4.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 (100) hide show
  1. package/gulpfile.js +3 -1
  2. package/js/AgoraSdk.js +4 -4
  3. package/js/Private/AgoraBase.js +367 -326
  4. package/js/Private/AgoraMediaBase.js +265 -76
  5. package/js/Private/AgoraMediaPlayerTypes.js +12 -30
  6. package/js/Private/IAgoraH265Transcoder.js +2 -5
  7. package/js/Private/IAgoraLog.js +2 -5
  8. package/js/Private/IAgoraMediaEngine.js +2 -5
  9. package/js/Private/IAgoraMediaPlayer.js +4 -10
  10. package/js/Private/IAgoraMediaRecorder.js +2 -5
  11. package/js/Private/IAgoraMediaStreamingSource.js +2 -5
  12. package/js/Private/IAgoraMusicContentCenter.js +21 -68
  13. package/js/Private/IAgoraRhythmPlayer.js +2 -5
  14. package/js/Private/IAgoraRtcEngine.js +76 -130
  15. package/js/Private/IAgoraRtcEngineEx.js +5 -28
  16. package/js/Private/IAgoraSpatialAudio.js +6 -15
  17. package/js/Private/IAudioDeviceManager.js +2 -5
  18. package/js/Private/impl/AgoraMediaBaseImpl.js +11 -14
  19. package/js/Private/impl/IAgoraH265TranscoderImpl.js +43 -46
  20. package/js/Private/impl/IAgoraMediaEngineImpl.js +155 -172
  21. package/js/Private/impl/IAgoraMediaPlayerImpl.js +534 -546
  22. package/js/Private/impl/IAgoraMediaRecorderImpl.js +26 -29
  23. package/js/Private/impl/IAgoraMusicContentCenterImpl.js +218 -251
  24. package/js/Private/impl/IAgoraRtcEngineExImpl.js +434 -436
  25. package/js/Private/impl/IAgoraRtcEngineImpl.js +2445 -2423
  26. package/js/Private/impl/IAgoraSpatialAudioImpl.js +167 -170
  27. package/js/Private/impl/IAudioDeviceManagerImpl.js +232 -235
  28. package/js/Private/internal/AgoraH265TranscoderInternal.js +33 -57
  29. package/js/Private/internal/AgoraMediaBaseInternal.js +9 -28
  30. package/js/Private/internal/AudioDeviceManagerInternal.js +24 -44
  31. package/js/Private/internal/IrisApiEngine.js +94 -145
  32. package/js/Private/internal/LocalSpatialAudioEngineInternal.js +3 -23
  33. package/js/Private/internal/MediaEngineInternal.js +69 -94
  34. package/js/Private/internal/MediaPlayerInternal.js +105 -125
  35. package/js/Private/internal/MediaRecorderInternal.js +37 -64
  36. package/js/Private/internal/MusicContentCenterInternal.js +92 -129
  37. package/js/Private/internal/RtcEngineExInternal.js +213 -243
  38. package/js/Private/ti/AgoraBase-ti.js +2 -2
  39. package/js/Private/ti/AgoraMediaBase-ti.js +2 -2
  40. package/js/Private/ti/AgoraMediaPlayerTypes-ti.js +1 -1
  41. package/js/Private/ti/IAgoraH265Transcoder-ti.js +2 -2
  42. package/js/Private/ti/IAgoraLog-ti.js +1 -1
  43. package/js/Private/ti/IAgoraMediaEngine-ti.js +1 -1
  44. package/js/Private/ti/IAgoraMediaPlayer-ti.js +2 -2
  45. package/js/Private/ti/IAgoraMediaPlayerSource-ti.js +2 -2
  46. package/js/Private/ti/IAgoraMediaRecorder-ti.js +1 -1
  47. package/js/Private/ti/IAgoraMediaStreamingSource-ti.js +1 -1
  48. package/js/Private/ti/IAgoraMusicContentCenter-ti.js +2 -2
  49. package/js/Private/ti/IAgoraRhythmPlayer-ti.js +1 -1
  50. package/js/Private/ti/IAgoraRtcEngine-ti.js +7 -7
  51. package/js/Private/ti/IAgoraRtcEngineEx-ti.js +1 -1
  52. package/js/Private/ti/IAgoraSpatialAudio-ti.js +1 -1
  53. package/js/Private/ti/IAudioDeviceManager-ti.js +1 -1
  54. package/js/Renderer/AgoraView.js +100 -145
  55. package/js/Renderer/IRenderer.js +43 -53
  56. package/js/Renderer/IRendererManager.js +106 -132
  57. package/js/Renderer/RendererCache.js +63 -96
  58. package/js/Renderer/RendererManager.js +35 -69
  59. package/js/Renderer/WebGLRenderer/index.js +77 -106
  60. package/js/Renderer/YUVCanvasRenderer/index.js +18 -40
  61. package/js/Utils.js +45 -64
  62. package/package.json +9 -7
  63. package/scripts/checkElectron.js +41 -0
  64. package/scripts/downloadPrebuild.js +56 -24
  65. package/scripts/synclib.js +6 -6
  66. package/ts/Private/AgoraBase.ts +269 -4
  67. package/ts/Private/AgoraMediaBase.ts +343 -1
  68. package/ts/Private/IAgoraMediaEngine.ts +3 -3
  69. package/ts/Private/IAgoraRtcEngine.ts +130 -119
  70. package/ts/Private/IAgoraRtcEngineEx.ts +14 -9
  71. package/ts/Private/impl/IAgoraRtcEngineExImpl.ts +30 -0
  72. package/ts/Private/impl/IAgoraRtcEngineImpl.ts +181 -61
  73. package/ts/Private/internal/IrisApiEngine.ts +3 -7
  74. package/ts/Private/internal/MediaEngineInternal.ts +0 -1
  75. package/ts/Private/internal/RtcEngineExInternal.ts +8 -4
  76. package/ts/Private/ti/IAgoraRtcEngine-ti.ts +5 -5
  77. package/ts/Renderer/IRenderer.ts +1 -2
  78. package/ts/Renderer/IRendererManager.ts +21 -12
  79. package/ts/Utils.ts +15 -0
  80. package/types/Private/AgoraBase.d.ts +264 -8
  81. package/types/Private/AgoraBase.d.ts.map +1 -1
  82. package/types/Private/AgoraMediaBase.d.ts +336 -1
  83. package/types/Private/AgoraMediaBase.d.ts.map +1 -1
  84. package/types/Private/IAgoraMediaEngine.d.ts +3 -3
  85. package/types/Private/IAgoraRtcEngine.d.ts +106 -116
  86. package/types/Private/IAgoraRtcEngine.d.ts.map +1 -1
  87. package/types/Private/IAgoraRtcEngineEx.d.ts +10 -10
  88. package/types/Private/IAgoraRtcEngineEx.d.ts.map +1 -1
  89. package/types/Private/impl/IAgoraRtcEngineExImpl.d.ts +3 -1
  90. package/types/Private/impl/IAgoraRtcEngineExImpl.d.ts.map +1 -1
  91. package/types/Private/impl/IAgoraRtcEngineImpl.d.ts +13 -5
  92. package/types/Private/impl/IAgoraRtcEngineImpl.d.ts.map +1 -1
  93. package/types/Private/internal/IrisApiEngine.d.ts.map +1 -1
  94. package/types/Private/internal/MediaEngineInternal.d.ts.map +1 -1
  95. package/types/Private/internal/RtcEngineExInternal.d.ts +1 -0
  96. package/types/Private/internal/RtcEngineExInternal.d.ts.map +1 -1
  97. package/types/Renderer/IRenderer.d.ts.map +1 -1
  98. package/types/Renderer/IRendererManager.d.ts.map +1 -1
  99. package/types/Utils.d.ts +4 -0
  100. package/types/Utils.d.ts.map +1 -1
@@ -33,6 +33,9 @@ import {
33
33
  EncryptionConfig,
34
34
  EncryptionErrorType,
35
35
  ErrorCodeType,
36
+ FaceShapeArea,
37
+ FaceShapeAreaOptions,
38
+ FaceShapeBeautyOptions,
36
39
  FocalLengthInfo,
37
40
  HeadphoneEqualizerPreset,
38
41
  IAudioEncodedFrameObserver,
@@ -68,6 +71,7 @@ import {
68
71
  ScreenScenarioType,
69
72
  SegmentationProperty,
70
73
  SenderOptions,
74
+ SimulcastConfig,
71
75
  SimulcastStreamConfig,
72
76
  SimulcastStreamMode,
73
77
  SpatialAudioParams,
@@ -84,6 +88,7 @@ import {
84
88
  VideoCodecType,
85
89
  VideoContentHint,
86
90
  VideoDenoiserOptions,
91
+ VideoDimensions,
87
92
  VideoEncoderConfiguration,
88
93
  VideoFormat,
89
94
  VideoLayout,
@@ -95,6 +100,7 @@ import {
95
100
  VideoSubscriptionOptions,
96
101
  VideoTranscoderError,
97
102
  VirtualBackgroundSource,
103
+ VoiceAiTunerType,
98
104
  VoiceBeautifierPreset,
99
105
  VoiceConversionPreset,
100
106
  WatermarkOptions,
@@ -105,6 +111,7 @@ import {
105
111
  import {
106
112
  ContentInspectConfig,
107
113
  ContentInspectResult,
114
+ ExtensionContext,
108
115
  IAudioSpectrumObserver,
109
116
  MediaSourceType,
110
117
  RawAudioFrameOpModeType,
@@ -358,6 +365,30 @@ export enum StreamFallbackOptions {
358
365
  * @ignore
359
366
  */
360
367
  StreamFallbackOptionAudioOnly = 2,
368
+ /**
369
+ * @ignore
370
+ */
371
+ StreamFallbackOptionVideoStreamLayer1 = 3,
372
+ /**
373
+ * @ignore
374
+ */
375
+ StreamFallbackOptionVideoStreamLayer2 = 4,
376
+ /**
377
+ * @ignore
378
+ */
379
+ StreamFallbackOptionVideoStreamLayer3 = 5,
380
+ /**
381
+ * @ignore
382
+ */
383
+ StreamFallbackOptionVideoStreamLayer4 = 6,
384
+ /**
385
+ * @ignore
386
+ */
387
+ StreamFallbackOptionVideoStreamLayer5 = 7,
388
+ /**
389
+ * @ignore
390
+ */
391
+ StreamFallbackOptionVideoStreamLayer6 = 8,
361
392
  }
362
393
 
363
394
  /**
@@ -472,6 +503,10 @@ export class LocalVideoStats {
472
503
  * 1: Hardware encoding is applied for acceleration.
473
504
  */
474
505
  hwEncoderAccelerating?: number;
506
+ /**
507
+ * @ignore
508
+ */
509
+ simulcastDimensions?: VideoDimensions[];
475
510
  }
476
511
 
477
512
  /**
@@ -584,6 +619,10 @@ export class RemoteVideoStats {
584
619
  * The bitrate (Kbps) of the remote video received since the last count.
585
620
  */
586
621
  receivedBitrate?: number;
622
+ /**
623
+ * @ignore
624
+ */
625
+ decoderInputFrameRate?: number;
587
626
  /**
588
627
  * The frame rate (fps) of decoding the remote video.
589
628
  */
@@ -1206,6 +1245,10 @@ export class ChannelMediaOptions {
1206
1245
  * Whether the audio stream being published is filtered according to the volume algorithm: true : The audio stream is filtered. If the audio stream filter is not enabled, this setting does not takes effect. false : The audio stream is not filtered. If you need to enable this function, contact.
1207
1246
  */
1208
1247
  isAudioFilterable?: boolean;
1248
+ /**
1249
+ * @ignore
1250
+ */
1251
+ parameters?: string;
1209
1252
  }
1210
1253
 
1211
1254
  /**
@@ -1383,10 +1426,10 @@ export interface IRtcEngineEventHandler {
1383
1426
  /**
1384
1427
  * Occurs when a user leaves a channel.
1385
1428
  *
1386
- * 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.
1429
+ * You can obtain information such as the total duration of a call, and the data traffic that the SDK transmits and receives.
1387
1430
  *
1388
1431
  * @param connection The connection information. See RtcConnection.
1389
- * @param stats The statistics of the call. See RtcStats.
1432
+ * @param stats Call statistics. See RtcStats.
1390
1433
  */
1391
1434
  onLeaveChannel?(connection: RtcConnection, stats: RtcStats): void;
1392
1435
 
@@ -1460,7 +1503,7 @@ export interface IRtcEngineEventHandler {
1460
1503
  /**
1461
1504
  * Reports the last mile network quality of each user in the channel.
1462
1505
  *
1463
- * This callback reports the last mile network conditions of each user in the channel. Last mile refers to the connection between the local device and Agora's edge server. The SDK triggers this callback once every two seconds. If a channel includes multiple users, the SDK triggers this callback as many times. txQuality is Unknown when the user is not sending a stream; rxQuality is Unknown when the user is not receiving a stream.
1506
+ * This callback reports the last mile network conditions of each user in the channel. Last mile refers to the connection between the local device and Agora's edge server. The SDK triggers this callback once every two seconds. If a channel includes multiple users, the SDK triggers this callback as many times. This callback provides feedback on network quality through sending and receiving broadcast packets within the channel. Excessive broadcast packets can lead to broadcast storms. To prevent broadcast storms from causing a large amount of data transmission within the channel, this callback supports feedback on the network quality of up to 4 remote hosts simultaneously by default. txQuality is Unknown when the user is not sending a stream; rxQuality is Unknown when the user is not receiving a stream.
1464
1507
  *
1465
1508
  * @param connection The connection information. See RtcConnection.
1466
1509
  * @param remoteUid The user ID. The network quality of the user with this user ID is reported. If the uid is 0, the local network quality is reported.
@@ -1615,6 +1658,8 @@ export interface IRtcEngineEventHandler {
1615
1658
  /**
1616
1659
  * Occurs when the renderer receives the first frame of the remote video.
1617
1660
  *
1661
+ * This callback is only triggered when the video frame is rendered by the SDK; it will not be triggered if the user employs custom video rendering.You need to implement this independently using methods outside the SDK.
1662
+ *
1618
1663
  * @param connection The connection information. See RtcConnection.
1619
1664
  * @param remoteUid The user ID of the remote user sending the video stream.
1620
1665
  * @param width The width (px) of the video stream.
@@ -1762,7 +1807,7 @@ export interface IRtcEngineEventHandler {
1762
1807
  * @param connection The connection information. See RtcConnection.
1763
1808
  * @param stats The statistics of the local video stream. See LocalVideoStats.
1764
1809
  */
1765
- onLocalVideoStats?(source: VideoSourceType, stats: LocalVideoStats): void;
1810
+ onLocalVideoStats?(connection: RtcConnection, stats: LocalVideoStats): void;
1766
1811
 
1767
1812
  /**
1768
1813
  * Reports the statistics of the video stream sent by each remote users.
@@ -2076,9 +2121,7 @@ export interface IRtcEngineEventHandler {
2076
2121
  ): void;
2077
2122
 
2078
2123
  /**
2079
- * Occurs when the user role switches during the interactive live streaming.
2080
- *
2081
- * The SDK triggers this callback when the local user switches their user role by calling setClientRole after joining the channel.
2124
+ * Occurs when the user role or the audience latency level changes.
2082
2125
  *
2083
2126
  * @param connection The connection information. See RtcConnection.
2084
2127
  * @param oldRole Role that the user switches from: ClientRoleType.
@@ -2093,9 +2136,9 @@ export interface IRtcEngineEventHandler {
2093
2136
  ): void;
2094
2137
 
2095
2138
  /**
2096
- * Occurs when the user role switching fails in the interactive live streaming.
2139
+ * Occurs when switching a user role fails.
2097
2140
  *
2098
- * In the live broadcasting channel profile, when the local user calls setClientRole to switch the user role after joining the channel but the switch fails, the SDK triggers this callback to report the reason for the failure and the current user role.
2141
+ * This callback informs you about the reason for failing to switching and your current user role.
2099
2142
  *
2100
2143
  * @param connection The connection information. See RtcConnection.
2101
2144
  * @param reason The reason for a user role switch failure. See ClientRoleChangeFailedReason.
@@ -2463,55 +2506,29 @@ export interface IRtcEngineEventHandler {
2463
2506
  ): void;
2464
2507
 
2465
2508
  /**
2466
- * The event callback of the extension.
2467
- *
2468
- * To listen for events while the extension is running, you need to register this callback.
2469
- *
2470
- * @param provider The name of the extension provider.
2471
- * @param extension The name of the extension.
2472
- * @param key The key of the extension.
2473
- * @param value The value of the extension key.
2509
+ * @ignore
2474
2510
  */
2475
- onExtensionEvent?(
2476
- provider: string,
2477
- extension: string,
2511
+ onExtensionEventWithContext?(
2512
+ context: ExtensionContext,
2478
2513
  key: string,
2479
2514
  value: string
2480
2515
  ): void;
2481
2516
 
2482
2517
  /**
2483
- * Occurs when the extension is enabled.
2484
- *
2485
- * The extension triggers this callback after it is successfully enabled.
2486
- *
2487
- * @param provider The name of the extension provider.
2488
- * @param extension The name of the extension.
2518
+ * @ignore
2489
2519
  */
2490
- onExtensionStarted?(provider: string, extension: string): void;
2520
+ onExtensionStartedWithContext?(context: ExtensionContext): void;
2491
2521
 
2492
2522
  /**
2493
- * Occurs when the extension is disabled.
2494
- *
2495
- * The extension triggers this callback after it is successfully destroyed.
2496
- *
2497
- * @param provider The name of the extension provider.
2498
- * @param extension The name of the extension.
2523
+ * @ignore
2499
2524
  */
2500
- onExtensionStopped?(provider: string, extension: string): void;
2525
+ onExtensionStoppedWithContext?(context: ExtensionContext): void;
2501
2526
 
2502
2527
  /**
2503
- * Occurs when the extension runs incorrectly.
2504
- *
2505
- * In case of extension enabling failure or runtime errors, the extension triggers this callback and reports the error code along with the reasons.
2506
- *
2507
- * @param provider The name of the extension provider.
2508
- * @param extension The name of the extension.
2509
- * @param error Error code. For details, see the extension documentation provided by the extension provider.
2510
- * @param message Reason. For details, see the extension documentation provided by the extension provider.
2528
+ * @ignore
2511
2529
  */
2512
- onExtensionError?(
2513
- provider: string,
2514
- extension: string,
2530
+ onExtensionErrorWithContext?(
2531
+ context: ExtensionContext,
2515
2532
  error: number,
2516
2533
  message: string
2517
2534
  ): void;
@@ -2693,6 +2710,10 @@ export enum MaxMetadataSizeType {
2693
2710
  * Media metadata.
2694
2711
  */
2695
2712
  export class Metadata {
2713
+ /**
2714
+ * @ignore
2715
+ */
2716
+ channelId?: string;
2696
2717
  /**
2697
2718
  * The user ID.
2698
2719
  * For the recipient: The ID of the remote user who sent the Metadata.
@@ -2902,8 +2923,6 @@ export abstract class IRtcEngine {
2902
2923
  * Creates and initializes IRtcEngine.
2903
2924
  *
2904
2925
  * All called methods provided by the IRtcEngine class are executed asynchronously. Agora recommends calling these methods in the same thread.
2905
- * Before calling other APIs, you must call createAgoraRtcEngine and initialize to create and initialize the IRtcEngine object.
2906
- * The SDK supports creating only one IRtcEngine instance for an app.
2907
2926
  *
2908
2927
  * @param context Configurations for the IRtcEngine instance. See RtcEngineContext.
2909
2928
  *
@@ -2968,7 +2987,6 @@ export abstract class IRtcEngine {
2968
2987
  * All lowercase English letters: a to z.
2969
2988
  * All uppercase English letters: A to Z.
2970
2989
  * All numeric characters: 0 to 9.
2971
- * Space
2972
2990
  * "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", "{", "}", "|", "~", ","
2973
2991
  * @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 onJoinChannelSuccess returns it in the callback. Your application must record and maintain the returned user ID, because the SDK does not do so.
2974
2992
  *
@@ -3023,7 +3041,6 @@ export abstract class IRtcEngine {
3023
3041
  * All lowercase English letters: a to z.
3024
3042
  * All uppercase English letters: A to Z.
3025
3043
  * All numeric characters: 0 to 9.
3026
- * Space
3027
3044
  * "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", "{", "}", "|", "~", ","
3028
3045
  * @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 onJoinChannelSuccess returns it in the callback. Your application must record and maintain the returned user ID, because the SDK does not do so.
3029
3046
  * @param options The channel media options. See ChannelMediaOptions.
@@ -3063,8 +3080,7 @@ export abstract class IRtcEngine {
3063
3080
  /**
3064
3081
  * Sets channel options and leaves the channel.
3065
3082
  *
3066
- * If you call release immediately after calling this method, the SDK does not trigger the onLeaveChannel callback.
3067
- * If you have called joinChannelEx to join multiple channels, calling this method will leave the channels when calling joinChannel and joinChannelEx at the same time. This method will release all resources related to the session, leave the channel, that is, hang up or exit the call. This method can be called whether or not a call is currently in progress. After joining the channel, you must call this method or to end the call, otherwise, the next call cannot be started. This method call is asynchronous. When this method returns, it does not necessarily mean that the user has left the channel. After actually leaving the channel, the local user triggers the onLeaveChannel callback; after the user in the communication scenario and the host in the live streaming scenario leave the channel, the remote user triggers the onUserOffline callback.
3083
+ * After calling this method, the SDK terminates the audio and video interaction, leaves the current channel, and releases all resources related to the session. After joining the channel, you must call this method to end the call; otherwise, the next call cannot be started. If you have called joinChannelEx to join multiple channels, calling this method will leave all the channels you joined. This method call is asynchronous. When this method returns, it does not necessarily mean that the user has left the channel.
3068
3084
  *
3069
3085
  * @param options The options for leaving the channel. See LeaveChannelOptions.
3070
3086
  *
@@ -3095,15 +3111,12 @@ export abstract class IRtcEngine {
3095
3111
  /**
3096
3112
  * Sets the channel profile.
3097
3113
  *
3098
- * After initializing the SDK, the default channel profile is the live streaming profile. You can call this method to set the channel profile. The Agora SDK differentiates channel profiles and applies optimization algorithms accordingly. For example, it prioritizes smoothness and low latency for a video call and prioritizes video quality for interactive live video streaming.
3099
- * To ensure the quality of real-time communication, Agora recommends that all users in a channel use the same channel profile.
3100
- * This method must be called and set before joinChannel, and cannot be set again after joining the channel.
3101
- * The default video encoding bitrate are different in different channel profiles. See setVideoEncoderConfiguration.
3114
+ * You can call this method to set the channel profile. The SDK adopts different optimization strategies for different channel profiles. For example, in a live streaming scenario, the SDK prioritizes video quality. After initializing the SDK, the default channel profile is the live streaming profile.
3102
3115
  *
3103
3116
  * @param profile The channel profile. See ChannelProfileType.
3104
3117
  *
3105
3118
  * @returns
3106
- * 0(ERR_OK): Success.
3119
+ * 0: Success.
3107
3120
  * < 0: Failure.
3108
3121
  * -2: The parameter is invalid.
3109
3122
  * -7: The SDK is not initialized.
@@ -3111,14 +3124,11 @@ export abstract class IRtcEngine {
3111
3124
  abstract setChannelProfile(profile: ChannelProfileType): number;
3112
3125
 
3113
3126
  /**
3114
- * Sets the user role and level in an interactive live streaming channel.
3127
+ * Set the user role and the audience latency level in a live streaming scenario.
3115
3128
  *
3116
- * In the interactive live streaming profile, the SDK sets the user role as audience by default. You can call this method to set the user role as host. You can call this method either before or after joining a channel. If you call this method to set the user's role as the host before joining the channel and set the local video property through the setupLocalVideo method, the local video preview is automatically enabled when the user joins the channel. If you call this method to switch the user role after joining a channel, the SDK automatically does the following:
3117
- * Calls muteLocalAudioStream and muteLocalVideoStream to change the publishing state.
3118
- * Triggers onClientRoleChanged on the local client.
3119
- * Triggers onUserJoined or onUserOffline on the remote client. This method applies to the interactive live streaming profile (the profile parameter of setChannelProfile is set as ChannelProfileLiveBroadcasting) only.
3129
+ * By default,the SDK sets the user role as audience. You can call this method to set the user role as host. The user role (roles) determines the users' permissions at the SDK level, including whether they can publish audio and video streams in a channel.
3120
3130
  *
3121
- * @param role The user role in the interactive live streaming. See ClientRoleType.
3131
+ * @param role The user role. See ClientRoleType. If you set the user role as an audience member, you cannot publish audio and video streams in the channel. If you want to publish media streams in a channel during live streaming, ensure you set the user role as broadcaster.
3122
3132
  * @param options The detailed options of a user, including the user level. See ClientRoleOptions.
3123
3133
  *
3124
3134
  * @returns
@@ -3277,6 +3287,38 @@ export abstract class IRtcEngine {
3277
3287
  type?: MediaSourceType
3278
3288
  ): number;
3279
3289
 
3290
+ /**
3291
+ * @ignore
3292
+ */
3293
+ abstract setFaceShapeBeautyOptions(
3294
+ enabled: boolean,
3295
+ options: FaceShapeBeautyOptions,
3296
+ type?: MediaSourceType
3297
+ ): number;
3298
+
3299
+ /**
3300
+ * @ignore
3301
+ */
3302
+ abstract setFaceShapeAreaOptions(
3303
+ options: FaceShapeAreaOptions,
3304
+ type?: MediaSourceType
3305
+ ): number;
3306
+
3307
+ /**
3308
+ * @ignore
3309
+ */
3310
+ abstract getFaceShapeBeautyOptions(
3311
+ type?: MediaSourceType
3312
+ ): FaceShapeBeautyOptions;
3313
+
3314
+ /**
3315
+ * @ignore
3316
+ */
3317
+ abstract getFaceShapeAreaOptions(
3318
+ shapeArea: FaceShapeArea,
3319
+ type?: MediaSourceType
3320
+ ): FaceShapeAreaOptions;
3321
+
3280
3322
  /**
3281
3323
  * Sets low-light enhancement.
3282
3324
  *
@@ -3581,9 +3623,9 @@ export abstract class IRtcEngine {
3581
3623
  /**
3582
3624
  * Stops or resumes subscribing to the video streams of all remote users.
3583
3625
  *
3584
- * After successfully calling this method, the local user stops or resumes subscribing to the audio streams of all remote users, including all subsequent users. By default, the SDK subscribes to the video streams of all remote users when joining a channel. To modify this behavior, you can set autoSubscribeVideo to false when calling joinChannel to join the channel, which will cancel the subscription to the video streams of all users upon joining the channel.
3626
+ * After successfully calling this method, the local user stops or resumes subscribing to the video streams of all remote users, including all subsequent users. By default, the SDK subscribes to the video streams of all remote users when joining a channel. To modify this behavior, you can set autoSubscribeVideo to false when calling joinChannel to join the channel, which will cancel the subscription to the video streams of all users upon joining the channel.
3585
3627
  *
3586
- * @param mute Whether to stop subscribing to the video streams of all remote users. true : Stop subscribing to the video streams of all remote users. false : (Default) Subscribe to the audio streams of all remote users by default.
3628
+ * @param mute Whether to stop subscribing to the video streams of all remote users. true : Stop subscribing to the video streams of all remote users. false : (Default) Subscribe to the video streams of all remote users by default.
3587
3629
  *
3588
3630
  * @returns
3589
3631
  * 0: Success.
@@ -4610,6 +4652,11 @@ export abstract class IRtcEngine {
4610
4652
  */
4611
4653
  abstract setHeadphoneEQParameters(lowGain: number, highGain: number): number;
4612
4654
 
4655
+ /**
4656
+ * @ignore
4657
+ */
4658
+ abstract enableVoiceAITuner(enabled: boolean, type: VoiceAiTunerType): number;
4659
+
4613
4660
  /**
4614
4661
  * Sets the log file.
4615
4662
  *
@@ -4781,6 +4828,11 @@ export abstract class IRtcEngine {
4781
4828
  streamConfig?: SimulcastStreamConfig
4782
4829
  ): number;
4783
4830
 
4831
+ /**
4832
+ * @ignore
4833
+ */
4834
+ abstract setSimulcastConfig(simulcastConfig: SimulcastConfig): number;
4835
+
4784
4836
  /**
4785
4837
  * Sets whether to enable the local playback of external audio source.
4786
4838
  *
@@ -4976,7 +5028,11 @@ export abstract class IRtcEngine {
4976
5028
  /**
4977
5029
  * Whether to mute the recording signal.
4978
5030
  *
4979
- * @param mute true : The media file is muted. false : (Default) Do not mute the recording signal. If you have already called adjustRecordingSignalVolume to adjust the volume, then when you call this method and set it to true, the SDK will record the current volume and mute it. To restore the previous volume, call this method again and set it to false.
5031
+ * If you have already called adjustRecordingSignalVolume to adjust the recording signal volume, when you call this method and set it to true, the SDK behaves as follows:
5032
+ * Records the adjusted volume.
5033
+ * Mutes the recording signal. When you call this method again and set it to false, the recording signal volume will be restored to the volume recorded by the SDK before muting.
5034
+ *
5035
+ * @param mute true : Mute the recording signal. false : (Default) Do not mute the recording signal.
4980
5036
  *
4981
5037
  * @returns
4982
5038
  * 0: Success.
@@ -5153,8 +5209,6 @@ export abstract class IRtcEngine {
5153
5209
  * Enables in-ear monitoring.
5154
5210
  *
5155
5211
  * This method enables or disables in-ear monitoring.
5156
- * Users must use earphones (wired or Bluetooth) to hear the in-ear monitoring effect.
5157
- * You can call this method either before or after joining a channel.
5158
5212
  *
5159
5213
  * @param enabled Enables or disables in-ear monitoring. true : Enables in-ear monitoring. false : (Default) Disables in-ear monitoring.
5160
5214
  * @param includeAudioFilters The audio filter types of in-ear monitoring. See EarMonitoringFilterType.
@@ -5252,7 +5306,7 @@ export abstract class IRtcEngine {
5252
5306
  *
5253
5307
  * @returns
5254
5308
  * If the method call is successful, the video track ID is returned as the unique identifier of the video track.
5255
- * If the method call fails, a negative value is returned.
5309
+ * If the method call fails, 0xffffffff is returned.
5256
5310
  */
5257
5311
  abstract createCustomVideoTrack(): number;
5258
5312
 
@@ -5455,7 +5509,7 @@ export abstract class IRtcEngine {
5455
5509
  *
5456
5510
  * @param displayId The display ID of the screen to be shared. For the Windows platform, if you need to simultaneously share two screens (main screen and secondary screen), you can set displayId to -1 when calling this method.
5457
5511
  * @param regionRect (Optional) Sets the relative location of the region to the screen. Pass in nil to share the entire screen.
5458
- * @param captureParams Screen sharing configurations. The default video dimension is 1920 x 1080, that is, 2,073,600 pixels. Agora uses the value of this parameter to calculate the charges. See ScreenCaptureParameters.
5512
+ * @param captureParams Screen sharing configurations. The default video dimension is 1920 x 1080, that is, 2,073,600 pixels. Agora uses the value of this parameter to calculate the charges. See ScreenCaptureParameters. The video properties of the screen sharing stream only need to be set through this parameter, and are unrelated to setVideoEncoderConfiguration.
5459
5513
  *
5460
5514
  * @returns
5461
5515
  * 0: Success.
@@ -5553,7 +5607,7 @@ export abstract class IRtcEngine {
5553
5607
  *
5554
5608
  * Call this method after starting screen sharing or window sharing.
5555
5609
  *
5556
- * @param captureParams The screen sharing encoding parameters. The default video resolution is 1920 × 1080, that is, 2,073,600 pixels. Agora uses the value of this parameter to calculate the charges. See ScreenCaptureParameters.
5610
+ * @param captureParams The screen sharing encoding parameters. The default video resolution is 1920 × 1080, that is, 2,073,600 pixels. Agora uses the value of this parameter to calculate the charges. See ScreenCaptureParameters. The video properties of the screen sharing stream only need to be set through this parameter, and are unrelated to setVideoEncoderConfiguration.
5557
5611
  *
5558
5612
  * @returns
5559
5613
  * 0: Success.
@@ -5826,8 +5880,6 @@ export abstract class IRtcEngine {
5826
5880
  /**
5827
5881
  * Gets the current connection state of the SDK.
5828
5882
  *
5829
- * You can call this method either before or after joining a channel.
5830
- *
5831
5883
  * @returns
5832
5884
  * The current connection state. See ConnectionStateType.
5833
5885
  */
@@ -5867,41 +5919,6 @@ export abstract class IRtcEngine {
5867
5919
  userPriority: PriorityType
5868
5920
  ): number;
5869
5921
 
5870
- /**
5871
- * Sets the built-in encryption mode.
5872
- *
5873
- * Deprecated: Use enableEncryption instead. The SDK supports built-in encryption schemes, AES-128-GCM is supported by default. Call this method to use other encryption modes. All users in the same channel must use the same encryption mode and secret. Refer to the information related to the AES encryption algorithm on the differences between the encryption modes. Before calling this method, please call setEncryptionSecret to enable the built-in encryption function.
5874
- *
5875
- * @param encryptionMode The following encryption modes:
5876
- * " aes-128-xts ": 128-bit AES encryption, XTS mode.
5877
- * " aes-128-ecb ": 128-bit AES encryption, ECB mode.
5878
- * " aes-256-xts ": 256-bit AES encryption, XTS mode.
5879
- * " sm4-128-ecb ": 128-bit SM4 encryption, ECB mode.
5880
- * " aes-128-gcm ": 128-bit AES encryption, GCM mode.
5881
- * " aes-256-gcm ": 256-bit AES encryption, GCM mode.
5882
- * "": When this parameter is set as null, the encryption mode is set as " aes-128-gcm " by default.
5883
- *
5884
- * @returns
5885
- * 0: Success.
5886
- * < 0: Failure.
5887
- */
5888
- abstract setEncryptionMode(encryptionMode: string): number;
5889
-
5890
- /**
5891
- * Enables built-in encryption with an encryption password before users join a channel.
5892
- *
5893
- * Deprecated: Use enableEncryption instead. Before joining the channel, you need to call this method to set the secret parameter to enable the built-in encryption. All users in the same channel should use the same secret. The secret is automatically cleared once a user leaves the channel. If you do not specify the secret or secret is set as null, the built-in encryption is disabled.
5894
- * Do not use this method for Media Push.
5895
- * For optimal transmission, ensure that the encrypted data size does not exceed the original data size + 16 bytes. 16 bytes is the maximum padding size for AES encryption.
5896
- *
5897
- * @param secret The encryption password.
5898
- *
5899
- * @returns
5900
- * 0: Success.
5901
- * < 0: Failure.
5902
- */
5903
- abstract setEncryptionSecret(secret: string): number;
5904
-
5905
5922
  /**
5906
5923
  * Enables or disables the built-in encryption.
5907
5924
  *
@@ -5922,8 +5939,6 @@ export abstract class IRtcEngine {
5922
5939
  /**
5923
5940
  * Creates a data stream.
5924
5941
  *
5925
- * Creates a data stream. Each user can create up to five data streams in a single channel.
5926
- *
5927
5942
  * @param config The configurations for the data stream. See DataStreamConfig.
5928
5943
  *
5929
5944
  * @returns
@@ -6104,10 +6119,9 @@ export abstract class IRtcEngine {
6104
6119
  /**
6105
6120
  * Registers a user account.
6106
6121
  *
6107
- * Once registered, the user account can be used to identify the local user when the user joins the channel. After the registration is successful, the user account can identify the identity of the local user, and the user can use it to join the channel. After the user successfully registers a user account, the SDK triggers the onLocalUserRegistered callback on the local client, reporting the user ID and account of the local user. This method is optional. To join a channel with a user account, you can choose either of the following ways:
6108
- * Call registerLocalUserAccount to create a user account, and then call joinChannelWithUserAccount to join the channel.
6109
- * Call the joinChannelWithUserAccount method to join the channel. The difference between the two ways is that the time elapsed between calling the registerLocalUserAccount method and joining the channel is shorter than directly calling joinChannelWithUserAccount.
6110
- * Ensure that you set the userAccount parameter; otherwise, this method does not take effect.
6122
+ * Once registered, the user account can be used to identify the local user when the user joins the channel. After the registration is successful, the user account can identify the identity of the local user, and the user can use it to join the channel. This method is optional. If you want to join a channel using a user account, you can choose one of the following methods:
6123
+ * Call the registerLocalUserAccount method to register a user account, and then call the joinChannelWithUserAccount method to join a channel, which can shorten the time it takes to enter the channel.
6124
+ * Call the joinChannelWithUserAccount method to join a channel.
6111
6125
  * Ensure that the userAccount is unique in the channel.
6112
6126
  * 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.
6113
6127
  *
@@ -6138,7 +6152,6 @@ export abstract class IRtcEngine {
6138
6152
  * All lowercase English letters: a to z.
6139
6153
  * All uppercase English letters: A to Z.
6140
6154
  * All numeric characters: 0 to 9.
6141
- * Space
6142
6155
  * "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", "{", "}", "|", "~", ","
6143
6156
  * @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 follows(89 in total):
6144
6157
  * The 26 lowercase English letters: a to z.
@@ -6178,7 +6191,6 @@ export abstract class IRtcEngine {
6178
6191
  * All lowercase English letters: a to z.
6179
6192
  * All uppercase English letters: A to Z.
6180
6193
  * All numeric characters: 0 to 9.
6181
- * Space
6182
6194
  * "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", "{", "}", "|", "~", ","
6183
6195
  * @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 follows(89 in total):
6184
6196
  * The 26 lowercase English letters: a to z.
@@ -6202,7 +6214,7 @@ export abstract class IRtcEngine {
6202
6214
  /**
6203
6215
  * Gets the user information by passing in the user account.
6204
6216
  *
6205
- * After a remote user joins the channel, the SDK gets the user ID and account of the remote user, caches them in a mapping table object, and triggers the onUserInfoUpdated callback on the local client. After receiving the callback, you can call this method to get the user account of the remote user from the UserInfo object by passing in the user ID.
6217
+ * After a remote user joins the channel, the SDK gets the UID and user account of the remote user, caches them in a mapping table object, and triggers the onUserInfoUpdated callback on the local client. After receiving the callback, you can call this method and pass in the user account to get the UID of the remote user from the UserInfo object.
6206
6218
  *
6207
6219
  * @param userAccount The user account.
6208
6220
  *
@@ -6215,7 +6227,7 @@ export abstract class IRtcEngine {
6215
6227
  /**
6216
6228
  * Gets the user information by passing in the user ID.
6217
6229
  *
6218
- * After a remote user joins the channel, the SDK gets the user ID and account of the remote user, caches them in a mapping table object, and triggers the onUserInfoUpdated callback on the local client. After receiving the callback, you can call this method to get the user account of the remote user from the UserInfo object by passing in the user ID.
6230
+ * After a remote user joins the channel, the SDK gets the UID and user account of the remote user, caches them in a mapping table object, and triggers the onUserInfoUpdated callback on the local client. After receiving the callback, you can call this method and passi in the UID.to get the user account of the specified user from the UserInfo object.
6219
6231
  *
6220
6232
  * @param uid The user ID.
6221
6233
  *
@@ -6310,7 +6322,7 @@ export abstract class IRtcEngine {
6310
6322
  /**
6311
6323
  * Starts pushing media streams to the CDN directly.
6312
6324
  *
6313
- * Aogra does not support pushing media streams to one URL repeatedly. Media options Agora does not support setting the value of publishCameraTrack and publishCustomVideoTrack as true, or the value of publishMicrophoneTrack and publishCustomAudioTrack as true at the same time. When choosing media setting options (DirectCdnStreamingMediaOptions), you can refer to the following examples: If you want to push audio and video streams published by the host to the CDN, the media setting options should be set as follows: publishCustomAudioTrack is set as true and call the pushAudioFrame method publishCustomVideoTrack is set as true and call the pushVideoFrame method publishCameraTrack is set as false (the default value) publishMicrophoneTrack is set as false (the default value) As of v4.2.0, Agora SDK supports audio-only live streaming. You can set publishCustomAudioTrack or publishMicrophoneTrack in DirectCdnStreamingMediaOptions as true and call pushAudioFrame to push audio streams. Agora only supports pushing one audio and video streams or one audio streams to CDN.
6325
+ * Aogra does not support pushing media streams to one URL repeatedly. Media options Agora does not support setting the value of publishCameraTrack and publishCustomVideoTrack as true, or the value of publishMicrophoneTrack and publishCustomAudioTrack as true at the same time. When choosing media setting options (DirectCdnStreamingMediaOptions), you can refer to the following examples: If you want to push audio and video streams captured by the host from a custom source, the media setting options should be set as follows: publishCustomAudioTrack is set as true and call the pushAudioFrame method publishCustomVideoTrack is set as true and call the pushVideoFrame method publishCameraTrack is set as false (the default value) publishMicrophoneTrack is set as false (the default value) As of v4.2.0, Agora SDK supports audio-only live streaming. You can set publishCustomAudioTrack or publishMicrophoneTrack in DirectCdnStreamingMediaOptions as true and call pushAudioFrame to push audio streams. Agora only supports pushing one audio and video streams or one audio streams to CDN.
6314
6326
  *
6315
6327
  * @param eventHandler See onDirectCdnStreamingStateChanged and onDirectCdnStreamingStats.
6316
6328
  * @param publishUrl The CDN live streaming URL.
@@ -6737,7 +6749,6 @@ export abstract class IRtcEngine {
6737
6749
  * All lowercase English letters: a to z.
6738
6750
  * All uppercase English letters: A to Z.
6739
6751
  * All numeric characters: 0 to 9.
6740
- * Space
6741
6752
  * "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", "{", "}", "|", "~", ","
6742
6753
  * @param uid The user ID of the remote user.
6743
6754
  */
@@ -5,6 +5,7 @@ import {
5
5
  DataStreamConfig,
6
6
  EncryptionConfig,
7
7
  LiveTranscoding,
8
+ SimulcastConfig,
8
9
  SimulcastStreamConfig,
9
10
  SimulcastStreamMode,
10
11
  SpatialAudioParams,
@@ -77,9 +78,9 @@ export abstract class IRtcEngineEx extends IRtcEngine {
77
78
  /**
78
79
  * Sets channel options and leaves the channel.
79
80
  *
80
- * This method lets the user leave the channel, for example, by hanging up or exiting the call. After calling joinChannelEx to join the channel, this method must be called to end the call before starting the next call. This method can be called whether or not a call is currently in progress. This method releases all resources related to the session. This method call is asynchronous. When this method returns, it does not necessarily mean that the user has left the channel. After you leave the channel, the SDK triggers the onLeaveChannel callback. After actually leaving the channel, the local user triggers the onLeaveChannel callback; after the user in the communication scenario and the host in the live streaming scenario leave the channel, the remote user triggers the onUserOffline callback.
81
- * If you call release immediately after calling this method, the SDK does not trigger the onLeaveChannel callback.
82
- * If you want to leave the channels that you joined by calling joinChannel and joinChannelEx, call the leaveChannel method.
81
+ * After calling this method, the SDK terminates the audio and video interaction, leaves the current channel, and releases all resources related to the session. After calling joinChannelEx to join a channel, you must call this method to end the call, otherwise, the next call cannot be started.
82
+ * This method call is asynchronous. When this method returns, it does not necessarily mean that the user has left the channel.
83
+ * If you call leaveChannel, you will leave all the channels you have joined by calling joinChannel or joinChannelEx.
83
84
  *
84
85
  * @param connection The connection information. See RtcConnection.
85
86
  * @param options The options for leaving the channel. See LeaveChannelOptions. This parameter only supports the stopMicrophoneRecording member in the LeaveChannelOptions settings; setting other members does not take effect.
@@ -259,9 +260,9 @@ export abstract class IRtcEngineEx extends IRtcEngine {
259
260
  /**
260
261
  * Stops or resumes subscribing to the video streams of all remote users.
261
262
  *
262
- * After successfully calling this method, the local user stops or resumes subscribing to the audio streams of all remote users, including all subsequent users.
263
+ * After successfully calling this method, the local user stops or resumes subscribing to the video streams of all remote users, including all subsequent users.
263
264
  *
264
- * @param mute Whether to stop subscribing to the video streams of all remote users. true : Stop subscribing to the video streams of all remote users. false : (Default) Subscribe to the audio streams of all remote users by default.
265
+ * @param mute Whether to stop subscribing to the video streams of all remote users. true : Stop subscribing to the video streams of all remote users. false : (Default) Subscribe to the video streams of all remote users by default.
265
266
  * @param connection The connection information. See RtcConnection.
266
267
  *
267
268
  * @returns
@@ -507,8 +508,6 @@ export abstract class IRtcEngineEx extends IRtcEngine {
507
508
  /**
508
509
  * Gets the current connection state of the SDK.
509
510
  *
510
- * You can call this method either before or after joining a channel.
511
- *
512
511
  * @param connection The connection information. See RtcConnection.
513
512
  *
514
513
  * @returns
@@ -538,8 +537,6 @@ export abstract class IRtcEngineEx extends IRtcEngine {
538
537
  /**
539
538
  * Creates a data stream.
540
539
  *
541
- * Creates a data stream. Each user can create up to five data streams in a single channel.
542
- *
543
540
  * @param config The configurations for the data stream. See DataStreamConfig.
544
541
  * @param connection The connection information. See RtcConnection.
545
542
  *
@@ -855,6 +852,14 @@ export abstract class IRtcEngineEx extends IRtcEngine {
855
852
  connection: RtcConnection
856
853
  ): number;
857
854
 
855
+ /**
856
+ * @ignore
857
+ */
858
+ abstract setSimulcastConfigEx(
859
+ simulcastConfig: SimulcastConfig,
860
+ connection: RtcConnection
861
+ ): number;
862
+
858
863
  /**
859
864
  * @ignore
860
865
  */