@byteplus/rtc 4.45.0 → 4.46.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.d.ts CHANGED
@@ -138,6 +138,7 @@ declare enum ErrorCode {
138
138
  * @brief The user has been removed from the room because the same user joined the room on the other client.
139
139
  */
140
140
  DUPLICATE_LOGIN = "DUPLICATE_LOGIN",
141
+ INVOKED_BEFORE_CAPTURE = "INVOKED_BEFORE_CAPTURE",
141
142
 
142
143
  /**
143
144
  * @brief Enable capture repeatedly.
@@ -343,16 +344,6 @@ declare enum ErrorCode {
343
344
  */
344
345
  USER_MESSAGE_NO_CONNECTION = "USER_MESSAGE_NO_CONNECTION",
345
346
 
346
- /**
347
- * @brief Length of the message exceeds the size limit which is 64 KB.
348
- */
349
- USER_MESSAGE_EXCEED_MAX_LENGTH = "USER_MESSAGE_EXCEED_MAX_LENGTH",
350
-
351
- /**
352
- * @brief userId of the receiver is empty.
353
- */
354
- USER_MESSAGE_EMPTY_USER = "USER_MESSAGE_EMPTY_USER",
355
-
356
347
  /**
357
348
  * @brief Sending a message before login to the IM server
358
349
  */
@@ -455,7 +446,7 @@ export interface IAudioMixingManager {
455
446
  * + The mixing data of this method comes from an external file, while the mixing data of [enableAudioMixingFrame](#enableAudioMixingFrame) comes from an external cache and the audio format is PCM. These two mixing methods can coexist.
456
447
  * @region Advanced Feature
457
448
  */
458
- startAudioMixing(id: number, filePath: string, options: MixOption): Promise<void>;
449
+ startAudioMixing: (id: number, filePath: string, options: MixOption) => Promise<void>;
459
450
 
460
451
  /**
461
452
  * @brief Stop playing audio files and mixes
@@ -464,7 +455,7 @@ export interface IAudioMixingManager {
464
455
  * + After calling this method to stop playing the audio file, the audio file will be automatically uninstalled.
465
456
  * @region Advanced Feature
466
457
  */
467
- stopAudioMixing(id: number): void;
458
+ stopAudioMixing: (id: number) => void;
468
459
 
469
460
  /**
470
461
  * @brief Pause playing audio files and mixes
@@ -473,7 +464,7 @@ export interface IAudioMixingManager {
473
464
  * + After calling this method to pause playing audio files and mixing, you can call the [resumeAudioMixing](#resumeaudiomixing) method to resume playing and mixing.
474
465
  * @region Advanced Feature
475
466
  */
476
- pauseAudioMixing(id: number): void;
467
+ pauseAudioMixing: (id: number) => void;
477
468
 
478
469
  /**
479
470
  * @brief Resume playing audio files and mixing
@@ -481,7 +472,7 @@ export interface IAudioMixingManager {
481
472
  * @notes After calling the [pauseAudioMixing](#pauseaudiomixing) method to pause playing audio files and mixing, you can resume playing and mixing by calling this method.
482
473
  * @region Advanced Feature
483
474
  */
484
- resumeAudioMixing(id: number): void;
475
+ resumeAudioMixing: (id: number) => void;
485
476
 
486
477
  /**
487
478
  * @brief Preload the specified audio file into memory
@@ -496,14 +487,14 @@ export interface IAudioMixingManager {
496
487
  * + The specified audio file preloaded by calling this method can be unloaded through [unloadAudioMixing](#unloadaudiomixing).
497
488
  * @region Advanced Feature
498
489
  */
499
- preloadAudioMixing(id: number, filePath: string): Promise<void>;
490
+ preloadAudioMixing: (id: number, filePath: string) => Promise<void>;
500
491
 
501
492
  /**
502
493
  * @brief Uninstall the specified audio file
503
494
  * @param id Mix ID
504
495
  * @region Advanced Feature
505
496
  */
506
- unloadAudioMixing(id: number): void;
497
+ unloadAudioMixing: (id: number) => void;
507
498
 
508
499
  /**
509
500
  * @brief Adjust the volume of audio mixing, including audio files and PCM data.
@@ -514,7 +505,7 @@ export interface IAudioMixingManager {
514
505
  * + 400: Maximum volume (with overflow protection)
515
506
  * @region Advanced Feature
516
507
  */
517
- setAudioMixingVolume(id: number, volume: number): void;
508
+ setAudioMixingVolume: (id: number, volume: number) => void;
518
509
 
519
510
  /**
520
511
  * @brief Get volume of the audio files.
@@ -523,7 +514,7 @@ export interface IAudioMixingManager {
523
514
  * + `>0`: Successful. Volume
524
515
  * @region Advanced Feature
525
516
  */
526
- getAudioMixingVolume(id: number): number;
517
+ getAudioMixingVolume: (id: number) => number;
527
518
 
528
519
  /**
529
520
  * @brief Get audio file duration
@@ -533,7 +524,7 @@ export interface IAudioMixingManager {
533
524
  * @notes Before calling this method to obtain the length of the audio file, you need to call [preloadAudioMixing](#preloadaudiomixing) or [startAudioMixing](#startaudiomixing).
534
525
  * @region Advanced Feature
535
526
  */
536
- getAudioMixingDuration(id: number): number;
527
+ getAudioMixingDuration: (id: number) => number;
537
528
 
538
529
  /**
539
530
  * @brief Get audio file playback progress
@@ -543,7 +534,7 @@ export interface IAudioMixingManager {
543
534
  * @notes Before calling this method to get the audio file playback progress, you need to call [startAudioMixing](#startaudiomixing) to start playing the audio file.
544
535
  * @region Advanced Feature
545
536
  */
546
- getAudioMixingCurrentPosition(id: number): number;
537
+ getAudioMixingCurrentPosition: (id: number) => number;
547
538
 
548
539
  /**
549
540
  * @brief Set the starting playback position of the audio file
@@ -554,7 +545,7 @@ export interface IAudioMixingManager {
554
545
  * + Before calling this method to set the playback position of the audio file, you need to call [startAudioMixing](#startaudiomixing) to start playing the audio file.
555
546
  * @region Advanced Feature
556
547
  */
557
- setAudioMixingPosition(id: number, position: number): void;
548
+ setAudioMixingPosition: (id: number, position: number) => void;
558
549
 
559
550
  /**
560
551
  * @brief Start PCM mixing.
@@ -565,13 +556,13 @@ export interface IAudioMixingManager {
565
556
  * + To end PCM mixing, use [disableAudioMixingFrame](#disableaudiomixingframe).
566
557
  * @region Advanced Feature
567
558
  */
568
- enableAudioMixingBuffer(type: AudioMixingType): void;
559
+ enableAudioMixingBuffer: (type: AudioMixingType) => void;
569
560
 
570
561
  /**
571
562
  * @brief Disable PCM mixing.
572
563
  * @region Advanced Feature
573
564
  */
574
- disableAudioMixingBuffer(): void;
565
+ disableAudioMixingBuffer: () => void;
575
566
 
576
567
  /**
577
568
  * @brief Push PCM audio frame data for mixing
@@ -579,7 +570,7 @@ export interface IAudioMixingManager {
579
570
  * @notes Before calling this method, you must start the external audio stream mixing through [enableAudioMixingFrame](#enableaudiomixingframe).
580
571
  * @region Advanced Feature
581
572
  */
582
- pushAudioMixingBuffer(buffer: AudioBuffer): void;
573
+ pushAudioMixingBuffer: (buffer: AudioBuffer) => void;
583
574
  }
584
575
 
585
576
  /**
@@ -666,7 +657,6 @@ export interface MixOption {
666
657
  type?: AudioMixingType;
667
658
  }
668
659
  declare class EnhancedEventEmitter<EventTypes extends ValidEventTypes = string | symbol> extends EventEmitter<EventTypes> {
669
- constructor();
670
660
  safeEmit<T extends EventNames<EventTypes>>(event: T, ...args: EventArgs<EventTypes, T>): boolean;
671
661
  safeEmitAsPromise(event: string, ...args: any[]): Promise<any>;
672
662
  }
@@ -1513,6 +1503,7 @@ declare enum EngineEventsTypes {
1513
1503
  onAudioVolumeIndication = "onAudioVolumeIndication",
1514
1504
  onLocalAudioPropertiesReport = "onLocalAudioPropertiesReport",
1515
1505
  onRemoteAudioPropertiesReport = "onRemoteAudioPropertiesReport",
1506
+ onActiveSpeaker = "onActiveSpeaker",
1516
1507
 
1517
1508
  /**
1518
1509
  * @brief Callback of the state changing of audio playback devices
@@ -1559,9 +1550,47 @@ declare enum EngineEventsTypes {
1559
1550
  onNetworkQuality = "onNetworkQuality",
1560
1551
  onSimulcastSubscribeFallback = "onSimulcastSubscribeFallback",
1561
1552
  onRemoteVideoSizeChanged = "onRemoteVideoSizeChanged",
1553
+ onVideoStreamBanned = "onVideoStreamBanned",
1554
+ onAudioStreamBanned = "onAudioStreamBanned",
1562
1555
  onLocalVideoSizeChanged = "onLocalVideoSizeChanged"
1563
1556
  }
1564
1557
 
1558
+ /**
1559
+ * @brief Event of banning/unbanning video streaming
1560
+ */
1561
+ export interface VideoStreamBannedEvent {
1562
+
1563
+ /**
1564
+ * @brief The ID of the user who is banned/unbanned from publishing video stream
1565
+ */
1566
+ uid: string;
1567
+
1568
+ /**
1569
+ * @brief Video Streaming Status
1570
+ * true: Video streaming is banned
1571
+ * false: Video streaming is unbanned
1572
+ */
1573
+ banned: boolean;
1574
+ }
1575
+
1576
+ /**
1577
+ * @brief Event of banning/unbanning audio streaming
1578
+ */
1579
+ export interface AudioStreamBannedEvent {
1580
+
1581
+ /**
1582
+ * @brief The ID of the user who is banned/unbanned from publishing audio stream
1583
+ */
1584
+ uid: string;
1585
+
1586
+ /**
1587
+ * @brief Audio Streaming Status
1588
+ * true: Audio streaming is banned
1589
+ * false: Audio streaming is unbanned
1590
+ */
1591
+ banned: boolean;
1592
+ }
1593
+
1565
1594
  /**
1566
1595
  * @brief Pushing a mixed stream to CDN events
1567
1596
  */
@@ -1776,31 +1805,18 @@ export interface StreamKey {
1776
1805
  */
1777
1806
  streamIndex: StreamIndex;
1778
1807
  }
1779
- /**
1780
- * {zh}
1781
- * @brief 自动播放失败事件
1782
- */
1783
- /**
1784
- *
1808
+
1809
+ /**
1785
1810
  * @brief Event of Auto-play failure
1786
1811
  */
1787
1812
  export interface AutoPlayFailedEvent {
1788
- /**
1789
- * {zh}
1790
- * @brief 自动播放失败的流所属的用户 ID。不带此参数时表示本地流播放失败。
1791
- */
1792
- /**
1793
- *
1813
+
1814
+ /**
1794
1815
  * @brief ID of the user whose stream failed to playback automatically. Without this parameter, the notification is about the local stream.
1795
1816
  */
1796
1817
  userId?: string;
1797
- /**
1798
- * {zh}
1799
- * @brief 自动播放失败的媒体类型
1800
- * 例如,当同一用户的视频流和音频流自动播放都失败时,将触发两次 `onAutoPlayFailed` 回调,分别包含 `audio` 和 `video` 参数。
1801
- */
1802
- /**
1803
- *
1818
+
1819
+ /**
1804
1820
  * @brief Type of the media which is failed to play automatically
1805
1821
  * For example, when both audio and video streams from the same user failed to playback automatically, you would get notified by `onAutoPlayFailed` twice with the argument of `audio` and `video` respectively.
1806
1822
  */
@@ -2111,6 +2127,13 @@ export interface IEngineEvents {
2111
2127
  */
2112
2128
  [EngineEventsTypes.onRemoteAudioPropertiesReport]: (event: RemoteAudioPropertiesInfo[]) => void;
2113
2129
 
2130
+ /**
2131
+ * @brief After calling [enableAudioPropertiesReport](104478#enableaudiopropertiesreport), you will periodically receive this callback for the information of the user with the highest voice volume.
2132
+ * @param event The information of the user with the highest voice volume.
2133
+ * @region Audio Management
2134
+ */
2135
+ [EngineEventsTypes.onActiveSpeaker]: (userInfo: UserInfo) => void;
2136
+
2114
2137
  /**
2115
2138
  * @brief The current playback device has been changed successfully by calling [setAudioPlaybackDevice](104478#setAudioPlaybackDevice).
2116
2139
  * @param event Information of the media devices. See [MediaDeviceInfo](https://developer.mozilla.org/en-US/docs/Web/API/MediaDeviceInfo).
@@ -2371,6 +2394,30 @@ export interface IEngineEvents {
2371
2394
  */
2372
2395
  [EngineEventsTypes.onStreamMixingEvent]: (event: StreamMixingEvent) => void;
2373
2396
 
2397
+ /**
2398
+ * @brief The callback is triggered when the openAPI BanUserStream/UnbanUserStream is called to ban/unban the video stream of the specified user from publishing.
2399
+ * @param event
2400
+ * @notes + When the specified user in the room is banned/unbanned from sending video streams, all users in the room will receive the callback.
2401
+ * + If the banned user leaves and then enters the room, the user is still banned from publishing video stream, and all users in the room will receive the callback again.
2402
+ * + If the banned user reconnects due to connection drop, the user remains being banned, and only the banned user receives the callback.
2403
+ * + If a user is banned, other users receive this callback again when they leave and re-enter the room.
2404
+ * + Only banned/unbanned user will receive this callback if the conference mode is enabled in the console.
2405
+ * + If the room is dissolved and created again, the status in the room is cleared.
2406
+ */
2407
+ [EngineEventsTypes.onVideoStreamBanned]: (event: VideoStreamBannedEvent) => void;
2408
+
2409
+ /**
2410
+ * @brief The callback is triggered when the openAPI BanUserStream/UnbanUserStream is called to ban/unban the audio stream of the specified user from publishing.
2411
+ * @param event
2412
+ * @notes + When the specified user in the room is banned/unbanned from sending audio streams, all users in the room will receive the callback.
2413
+ * + If the banned user leaves and then enters the room, the user is still banned from publishing audio stream, and all users in the room will receive the callback again.
2414
+ * + If the banned user reconnects due to connection drop, the user remains being banned, and only the banned user receives the callback.
2415
+ * + If a user is banned, other users receive this callback again when they leave and re-enter the room.
2416
+ * + Only banned/unbanned user will receive this callback if the conference mode is enabled in the console.
2417
+ * + If the room is dissolved and created again, the status in the room is cleared.
2418
+ */
2419
+ [EngineEventsTypes.onAudioStreamBanned]: (event: AudioStreamBannedEvent) => void;
2420
+
2374
2421
  /**
2375
2422
  * @brief The callback of the actual video capturing configuration.
2376
2423
  */
@@ -2426,7 +2473,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2426
2473
  * + RTC SDK will try reconnect after losing connection to the server caused by a poor network connection. The remote user will receive [onUserJoined](104479#onuserjoined) if a visible user reconnected successfully.
2427
2474
  * @region Room Management
2428
2475
  */
2429
- joinRoom(token: string | null, roomId: string, userInfo: UserInfo, roomConfig?: RoomConfig): Promise<void>;
2476
+ joinRoom: (token: string | null, roomId: string, userInfo: UserInfo, roomConfig?: RoomConfig) => Promise<void>;
2430
2477
 
2431
2478
  /**
2432
2479
  * @brief Leave the room.
@@ -2435,7 +2482,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2435
2482
  * + You must call this API to end the call, after calling the [joinRoom](#joinroom) method to join the room. Otherwise you cannot start the next call. Repeatedly call this method have no negative impact.
2436
2483
  * @region Room Management
2437
2484
  */
2438
- leaveRoom(waitAck?: boolean): Promise<void>;
2485
+ leaveRoom: (waitAck?: boolean) => Promise<void>;
2439
2486
 
2440
2487
  /**
2441
2488
  * @hidden
@@ -2446,7 +2493,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2446
2493
  * + This API is a blocking call which will block the current thread until the SDK completes the exit logic. Therefore, do NOT to call this API directly in the callback thread. Besides do NOT wait for the execution of the main thread including this API in any callback, thus causing a deadlock.
2447
2494
  * @region Engine Management
2448
2495
  */
2449
- destroy(): void;
2496
+ destroy: () => void;
2450
2497
 
2451
2498
  /**
2452
2499
  * @brief Publishes media streams captured by camera/microphone in the current room.
@@ -2458,7 +2505,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2458
2505
  * + Call [unpublishStream](#unpublishstream) to stop publishing streams.
2459
2506
  * @region Room Management
2460
2507
  */
2461
- publishStream(mediaType: MediaType): Promise<void>;
2508
+ publishStream: (mediaType: MediaType) => Promise<void>;
2462
2509
 
2463
2510
  /**
2464
2511
  * @brief Stops publishing media streams captured by camera/microphone in the current room.
@@ -2467,7 +2514,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2467
2514
  * + After calling this API, the other users in the room will receive [onUserUnpublishStream](104479#onuserunpublishstream).
2468
2515
  * @region Room Management
2469
2516
  */
2470
- unpublishStream(mediaType: MediaType): Promise<void>;
2517
+ unpublishStream: (mediaType: MediaType) => Promise<void>;
2471
2518
 
2472
2519
  /**
2473
2520
  * @brief Publishes local screen sharing streams in the current room.
@@ -2477,7 +2524,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2477
2524
  * + Call [unpublishScreen](#unpublishscreen) to stop publishing screen sharing streams.
2478
2525
  * @region Screen Sharing
2479
2526
  */
2480
- publishScreen(mediaType: MediaType): Promise<void>;
2527
+ publishScreen: (mediaType: MediaType) => Promise<void>;
2481
2528
 
2482
2529
  /**
2483
2530
  * @brief Stops publishing local screen sharing streams in the current room.
@@ -2486,7 +2533,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2486
2533
  * + After calling this API, the other users in the room will receive [onUserUnpublishScreen](104479#onuserunpublishscreen).
2487
2534
  * @region Screen Sharing
2488
2535
  */
2489
- unpublishScreen(mediaType: MediaType): Promise<void>;
2536
+ unpublishScreen: (mediaType: MediaType) => Promise<void>;
2490
2537
 
2491
2538
  /**
2492
2539
  * @brief Subscribes to specific remote media streams captured by camera/microphone.
@@ -2496,7 +2543,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2496
2543
  * @notes You must first get the remote stream information through onUserPublishStream{@link #IRTCRoomEventHandler#onUserPublishStream} before calling this API to subscribe to streams accordingly.
2497
2544
  * @region Room Management
2498
2545
  */
2499
- subscribeStream(userId: string, mediaType: MediaType): Promise<void>;
2546
+ subscribeStream: (userId: string, mediaType: MediaType) => Promise<void>;
2500
2547
 
2501
2548
  /**
2502
2549
  * @brief Unsubscribes from specific remote media streams captured by camera/microphone.
@@ -2505,7 +2552,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2505
2552
  * @param mediaType Media stream type, used for specifying whether to unsubscribe from the audio stream or the video stream.
2506
2553
  * @region Room Management
2507
2554
  */
2508
- unsubscribeStream(userId: string, mediaType: MediaType): Promise<void>;
2555
+ unsubscribeStream: (userId: string, mediaType: MediaType) => Promise<void>;
2509
2556
 
2510
2557
  /**
2511
2558
  * @brief Subscribes to specific screen sharing media stream.
@@ -2516,7 +2563,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2516
2563
  * + The [onAudioFirstFrameDecoded](104479#onaudiofirstframedecoded)/[onVideoFirstFrameDecoded](104479#onvideofirstframedecoded) callback will be triggered after calling this API to indicate that the audio/video stream was successfully received.
2517
2564
  * @region Room Management
2518
2565
  */
2519
- subscribeScreen(userId: string, mediaType: MediaType): Promise<void>;
2566
+ subscribeScreen: (userId: string, mediaType: MediaType) => Promise<void>;
2520
2567
 
2521
2568
  /**
2522
2569
  * @brief Unsubscribes from specific screen sharing media stream.
@@ -2525,7 +2572,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2525
2572
  * @param type Media stream type, used for specifying whether to unsubscribe from the audio stream or the video stream.
2526
2573
  * @region Room Management
2527
2574
  */
2528
- unsubscribeScreen(userId: string, mediaType: MediaType): Promise<void>;
2575
+ unsubscribeScreen: (userId: string, mediaType: MediaType) => Promise<void>;
2529
2576
 
2530
2577
  /**
2531
2578
  * @brief Update Token.
@@ -2536,7 +2583,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2536
2583
  * + The user will be removed from the room when the Token expires.
2537
2584
  * @region Room Management
2538
2585
  */
2539
- updateToken(token: string): void;
2586
+ updateToken: (token: string) => void;
2540
2587
 
2541
2588
  /**
2542
2589
  * @brief Switch the microphone used for internal audio capturing.
@@ -2544,7 +2591,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2544
2591
  * @return
2545
2592
  * @notes If the internal audio capturing is on, the switch is effective once you call this API. If the internal audio capturing is off, the setting will be effective when capture starts.
2546
2593
  */
2547
- setAudioCaptureDevice(deviceId: string): Promise<void>;
2594
+ setAudioCaptureDevice: (deviceId: string) => Promise<void>;
2548
2595
 
2549
2596
  /**
2550
2597
  * @brief Switch the camera used for internal video capturing.
@@ -2554,7 +2601,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2554
2601
  * + For mobile devices, set deviceId as `"user"` to use the front camera. Set deviceId as `"environment"` to use the rear camera.
2555
2602
  * + The default camera is set by the browser.
2556
2603
  */
2557
- setVideoCaptureDevice(deviceId: string): Promise<void>;
2604
+ setVideoCaptureDevice: (deviceId: string) => Promise<void>;
2558
2605
 
2559
2606
  /**
2560
2607
  * @brief Enable internal video capture. The default state is off.
@@ -2567,7 +2614,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2567
2614
  * + Call [setVideoCaptureDevice](#setvideocapturedevice) to switch the camera used by the internal video capture module.
2568
2615
  * @region Video Management
2569
2616
  */
2570
- startVideoCapture(deviceId?: string): Promise<MediaTrackSettings>;
2617
+ startVideoCapture: (deviceId?: string) => Promise<MediaTrackSettings>;
2571
2618
 
2572
2619
  /**
2573
2620
  * @brief Enable internal video capture immediately. The default setting is off.
@@ -2578,7 +2625,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2578
2625
  * + Without calling this API the internal video capture will sustain until you destroy the engine instance.
2579
2626
  * @region Video Management
2580
2627
  */
2581
- stopVideoCapture(): Promise<void>;
2628
+ stopVideoCapture: () => Promise<void>;
2582
2629
 
2583
2630
  /**
2584
2631
  * @brief Start internal audio capture. The default is off.
@@ -2590,7 +2637,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2590
2637
  * + Once you create the engine instance, you can start internal audio capture regardless of the audio publishing state. The audio stream will start publishing only after the audio capture starts.
2591
2638
  * @region Audio Management
2592
2639
  */
2593
- startAudioCapture(deviceId?: string): Promise<void>;
2640
+ startAudioCapture: (deviceId?: string) => Promise<void>;
2594
2641
 
2595
2642
  /**
2596
2643
  * @brief Stop internal audio capture. The default is off.
@@ -2601,7 +2648,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2601
2648
  * + Without calling this API the internal audio capture will sustain until you destroy the engine instance.
2602
2649
  * @region Audio Management
2603
2650
  */
2604
- stopAudioCapture(): Promise<void>;
2651
+ stopAudioCapture: () => Promise<void>;
2605
2652
 
2606
2653
  /**
2607
2654
  * @brief Use the capture module provided by the RTC SDK to capture the current screen stream for sharing.
@@ -2612,7 +2659,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2612
2659
  * + Before calling this API, you can call [setVideoEncoderConfig](#setvideoencoderconfig) to set the capture frame rate and encoding resolution of the screen video stream.
2613
2660
  * @region Advanced Feature
2614
2661
  */
2615
- startScreenCapture(screenConfig?: ScreenConfig): Promise<void>;
2662
+ startScreenCapture: (screenConfig?: ScreenConfig) => Promise<void>;
2616
2663
 
2617
2664
  /**
2618
2665
  * @brief Stop screen sharing.
@@ -2620,7 +2667,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2620
2667
  * @notes If the stream has been published, the other users in the room will receive the [onStreamRemove](104479#onstreamremove) event after the user stop screen sharing by calling this API.
2621
2668
  * @region Advanced Feature
2622
2669
  */
2623
- stopScreenCapture(): Promise<void>;
2670
+ stopScreenCapture: () => Promise<void>;
2624
2671
 
2625
2672
  /**
2626
2673
  * @brief Bind a view to the local media stream and set the rendering mode for the rendering of the local stream
@@ -2631,7 +2678,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2631
2678
  * @notes You should bind the view after the user joins a room. This setting will sustain when the user leaves the room.
2632
2679
  * @region Video Management
2633
2680
  */
2634
- setLocalVideoPlayer(streamIndex: StreamIndex, videoPlayerOption?: Partial<VideoPlayerOption>): HTMLVideoElement | undefined;
2681
+ setLocalVideoPlayer: (streamIndex: StreamIndex, videoPlayerOption?: Partial<VideoPlayerOption>) => HTMLVideoElement | undefined;
2635
2682
 
2636
2683
  /**
2637
2684
  * @brief Bind a view to the remote media stream and set the rendering mode for the rendering of the remote stream
@@ -2642,14 +2689,14 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2642
2689
  * @notes You should bind the view after the user joins a room. This setting will sustain when the user leaves the room.
2643
2690
  * @region Video Management
2644
2691
  */
2645
- setRemoteVideoPlayer(streamIndex: StreamIndex, videoPlayerOption: VideoPlayerOption): HTMLVideoElement | undefined;
2692
+ setRemoteVideoPlayer: (streamIndex: StreamIndex, videoPlayerOption: VideoPlayerOption) => HTMLVideoElement | undefined;
2646
2693
 
2647
2694
  /**
2648
2695
  * @brief Enable or disable the mirror mode for the local video stream.
2649
2696
  * @param mirrorType Whether to turn on mirror mode.
2650
2697
  * @region Media Processing
2651
2698
  */
2652
- setLocalVideoMirrorType(mirrorType: MirrorType): void;
2699
+ setLocalVideoMirrorType: (mirrorType: MirrorType) => void;
2653
2700
 
2654
2701
  /**
2655
2702
  * @brief Sets the speaker or the earpiece as the audio playback device. The audio playback device defaults to the speaker.
@@ -2658,7 +2705,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2658
2705
  * @notes You can call this API before or after the user joins a room.
2659
2706
  * @region Audio Management
2660
2707
  */
2661
- setAudioPlaybackDevice(deviceId: string): Promise<void>;
2708
+ setAudioPlaybackDevice: (deviceId: string) => Promise<void>;
2662
2709
 
2663
2710
  /**
2664
2711
  * @brief Play audio and video stream manually.
@@ -2670,7 +2717,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2670
2717
  * @note + Call this API to start playback if the audio and/or video is not playing.
2671
2718
  * + Call this API once to start both audio and video playbacks when they do not start.
2672
2719
  */
2673
- play(userId?: string): Promise<void>;
2720
+ play: (userId?: string) => Promise<void>;
2674
2721
 
2675
2722
  /**
2676
2723
  * @brief Pause receiving remote media streams.
@@ -2681,7 +2728,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2681
2728
  * + To resume, call [resumeAllSubscribedStream](#resumeAllSubscribedStream).
2682
2729
  * @region Media Stream Transmission
2683
2730
  */
2684
- pauseAllSubscribedStream(mediaType: MediaType): Promise<void>;
2731
+ pauseAllSubscribedStream: (mediaType: MediaType) => Promise<void>;
2685
2732
 
2686
2733
  /**
2687
2734
  * @brief Resume receiving remote media streams
@@ -2691,7 +2738,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2691
2738
  * + Calling this API does not change any subscription configuration.
2692
2739
  * @region Media Transmission
2693
2740
  */
2694
- resumeAllSubscribedStream(mediaType: MediaType): Promise<void>;
2741
+ resumeAllSubscribedStream: (mediaType: MediaType) => Promise<void>;
2695
2742
 
2696
2743
  /**
2697
2744
  * @brief Send point-to-point text messages to a specified user in the room.
@@ -2702,7 +2749,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2702
2749
  * @notes Call [joinRoom](#joinroom) to join the room before calling this API.
2703
2750
  * @region Message
2704
2751
  */
2705
- sendUserMessage(userId: string, message: string): Promise<unknown> | undefined;
2752
+ sendUserMessage: (userId: string, message: string) => Promise<unknown> | undefined;
2706
2753
 
2707
2754
  /**
2708
2755
  * @brief Send point-to-point binary messages to a specified user in the room.
@@ -2713,7 +2760,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2713
2760
  * @notes Call [joinRoom](#joinroom) to join the room before calling this API.
2714
2761
  * @region Message
2715
2762
  */
2716
- sendUserBinaryMessage(userId: string, message: ArrayBuffer): Promise<unknown>;
2763
+ sendUserBinaryMessage: (userId: string, message: ArrayBuffer) => Promise<unknown>;
2717
2764
 
2718
2765
  /**
2719
2766
  * @brief Send text messaging to all other users in the room.
@@ -2722,7 +2769,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2722
2769
  * @return
2723
2770
  * @region Message
2724
2771
  */
2725
- sendRoomMessage(message: string): Promise<any> | undefined;
2772
+ sendRoomMessage: (message: string) => Promise<any> | undefined;
2726
2773
 
2727
2774
  /**
2728
2775
  * @brief Send binary messaging to all other users in the room.
@@ -2731,7 +2778,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2731
2778
  * @return
2732
2779
  * @region Message
2733
2780
  */
2734
- sendRoomBinaryMessage(message: ArrayBuffer): Promise<any> | undefined;
2781
+ sendRoomBinaryMessage: (message: ArrayBuffer) => Promise<any> | undefined;
2735
2782
 
2736
2783
  /**
2737
2784
  * @brief Send SEI message carried by video frames
@@ -2744,7 +2791,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2744
2791
  * + Users receiving the stream will receive the SEI message via [onSEIMessageReceived](104479#onseimessagereceived) once the SEI message is sent successfully.
2745
2792
  * @region Message
2746
2793
  */
2747
- sendSEIMessage(streamIndex: StreamIndex, message: Uint8Array | string, repeatCount: number): void;
2794
+ sendSEIMessage: (streamIndex: StreamIndex, message: Uint8Array | string, repeatCount: number) => void;
2748
2795
 
2749
2796
  /**
2750
2797
  * @brief Sets the video encoder configuration of the publishing streams.
@@ -2757,7 +2804,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2757
2804
  * + This API is applicable to the video stream captured by the camera, see [setScreenEncoderConfig](#setscreenencoderconfig) for setting parameters for screen sharing video stream.
2758
2805
  * @region Video Management
2759
2806
  */
2760
- setVideoEncoderConfig(descriptions: VideoEncoderConfig | VideoEncoderConfig[]): Promise<void>;
2807
+ setVideoEncoderConfig: (descriptions: VideoEncoderConfig | VideoEncoderConfig[]) => Promise<void>;
2761
2808
 
2762
2809
  /**
2763
2810
  * @type api
@@ -2768,7 +2815,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2768
2815
  * @param VideoEncoderConfig The encoding configuration of the screen-sharing stream.
2769
2816
  * @notes + We recommend that you set the encoding configuration before video capture. Otherwise, the video will be captured based on the default configuration(1080p@15fps).
2770
2817
  */
2771
- setScreenEncoderConfig(description: VideoEncoderConfig): Promise<void>;
2818
+ setScreenEncoderConfig: (description: ScreenEncoderConfig) => Promise<void>;
2772
2819
 
2773
2820
  /**
2774
2821
  * @brief Sets your expected configuration of the remote video stream that you want to subscribe to or have subscribed to.
@@ -2779,7 +2826,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2779
2826
  * + You should call this API in the room. If you want to call it before entering the room, you should set the `remoteVideoConfig` in the roomConfig` when calling [joinRoom](#joinroom).
2780
2827
  * @region Video Management
2781
2828
  */
2782
- setRemoteVideoConfig(userId: string, remoteVideoConfig: RemoteVideoConfig): Promise<void>;
2829
+ setRemoteVideoConfig: (userId: string, remoteVideoConfig: RemoteVideoConfig) => Promise<void>;
2783
2830
 
2784
2831
  /**
2785
2832
  * @region Video Management
@@ -2788,7 +2835,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2788
2835
  * @param + You must call this API before publishing the video streams.
2789
2836
  * + After enabling the simulcast mode, SDK automatically sets the encoding parameters for the video streams. For manual setting, call [setVideoEncoderConfig](#setVideoEncoderConfig).
2790
2837
  */
2791
- enableSimulcastMode(enabled: boolean): boolean;
2838
+ enableSimulcastMode: (enabled: boolean) => boolean;
2792
2839
 
2793
2840
  /**
2794
2841
  * @hidden
@@ -2802,7 +2849,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2802
2849
  * + > 0: Enable the volume prompt function and set the time interval for receiving the volume prompt callback. In milliseconds.
2803
2850
  * @region Room Management
2804
2851
  */
2805
- setAudioVolumeIndicationInterval(interval?: number): void;
2852
+ setAudioVolumeIndicationInterval: (interval?: number) => void;
2806
2853
 
2807
2854
  /**
2808
2855
  * @brief Enable audio information prompts.
@@ -2812,7 +2859,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2812
2859
  * + Get the information of the subscribed remote audio streams through [onRemoteAudioPropertiesReport](104479#onRemoteAudioPropertiesReport).
2813
2860
  * @region Audio Management
2814
2861
  */
2815
- enableAudioPropertiesReport(config?: AudioPropertiesConfig): void;
2862
+ enableAudioPropertiesReport: (config?: AudioPropertiesConfig) => void;
2816
2863
 
2817
2864
  /**
2818
2865
  * @brief Starts pushing media streams to CDN and sets the relevant configurations.
@@ -2822,7 +2869,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2822
2869
  * + Call [stopLiveTranscoding](#stoplivetranscoding) to stop pushing stream to CDN.
2823
2870
  * @region Advanced Feature
2824
2871
  */
2825
- startLiveTranscoding(transcode: LiveTranscodeConfig): Promise<void>;
2872
+ startLiveTranscoding: (transcode: LiveTranscodeConfig) => Promise<void>;
2826
2873
 
2827
2874
  /**
2828
2875
  * @brief Update configuration needed when pushing media streams to CDN.
@@ -2830,7 +2877,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2830
2877
  * @param transcode Configurations that you want to update.
2831
2878
  * @region Advanced Feature
2832
2879
  */
2833
- updateLiveTranscoding(transcode: Partial<LiveTranscodeConfig>): Promise<void>;
2880
+ updateLiveTranscoding: (transcode: Partial<LiveTranscodeConfig>) => Promise<void>;
2834
2881
 
2835
2882
  /**
2836
2883
  * @brief Stop pushing media streams to CDN
@@ -2838,7 +2885,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2838
2885
  * @return
2839
2886
  * @region Advanced Feature
2840
2887
  */
2841
- stopLiveTranscoding(): Promise<void>;
2888
+ stopLiveTranscoding: () => Promise<void>;
2842
2889
 
2843
2890
  /**
2844
2891
  * @brief Set the business ID.
@@ -2848,7 +2895,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2848
2895
  * @notes You must call this API before the [joinRoom](#joinroom) API, otherwise it will be invalid.
2849
2896
  * @region Engine Management
2850
2897
  */
2851
- setBusinessId(businessId: string): boolean;
2898
+ setBusinessId: (businessId: string) => boolean;
2852
2899
 
2853
2900
  /**
2854
2901
  * @brief Set user visibility. Visible by default.
@@ -2862,7 +2909,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2862
2909
  * - Switch from `true` to `false`: [onUserLeave](104479#onuserleave)
2863
2910
  * @region Room Management
2864
2911
  */
2865
- setUserVisibility(enable: boolean): Promise<void>;
2912
+ setUserVisibility: (enable: boolean) => Promise<void>;
2866
2913
 
2867
2914
  /**
2868
2915
  * @brief Set a custom videoTrack as the video source.
@@ -2872,7 +2919,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2872
2919
  * @return
2873
2920
  * @region Video Management
2874
2921
  */
2875
- setExternalVideoTrack(index: StreamIndex, track: MediaStreamTrack): Promise<void>;
2922
+ setExternalVideoTrack: (index: StreamIndex, track: MediaStreamTrack) => Promise<void>;
2876
2923
 
2877
2924
  /**
2878
2925
  * @brief Set a custom audioTrack as the audio source.
@@ -2882,7 +2929,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2882
2929
  * @return
2883
2930
  * @region Audio Management
2884
2931
  */
2885
- setExternalAudioTrack(index: StreamIndex, track: MediaStreamTrack): Promise<void>;
2932
+ setExternalAudioTrack: (index: StreamIndex, track: MediaStreamTrack) => Promise<void>;
2886
2933
 
2887
2934
  /**
2888
2935
  * @brief Switch the source from the internal to custom video capture.
@@ -2892,7 +2939,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2892
2939
  * @return
2893
2940
  * @region Video Management
2894
2941
  */
2895
- setVideoSourceType(index: StreamIndex, videoSourceType: VideoSourceType): Promise<void>;
2942
+ setVideoSourceType: (index: StreamIndex, videoSourceType: VideoSourceType) => Promise<void>;
2896
2943
 
2897
2944
  /**
2898
2945
  * @brief Switch the source from the internal to custom audio capture.
@@ -2902,14 +2949,14 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2902
2949
  * @return
2903
2950
  * @region Audio Management
2904
2951
  */
2905
- setAudioSourceType(index: StreamIndex, audioSourceType: AudioSourceType): Promise<void>;
2952
+ setAudioSourceType: (index: StreamIndex, audioSourceType: AudioSourceType) => Promise<void>;
2906
2953
 
2907
2954
  /**
2908
2955
  * @brief Create an audio mixing manager object
2909
2956
  * @return audio mixing manager object
2910
2957
  * @region Advanced Feature
2911
2958
  */
2912
- getAudioMixingManager(): IAudioMixingManager;
2959
+ getAudioMixingManager: () => IAudioMixingManager;
2913
2960
 
2914
2961
  /**
2915
2962
  * @brief Configure the internal audio capture. Different browser has its own default settings.
@@ -2918,7 +2965,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2918
2965
  * @note You can call this API after creating the engine. We recommend to call this API before [startAudioCapture](#startaudiocapture).
2919
2966
  * @region Audio Management
2920
2967
  */
2921
- setAudioCaptureConfig(config: TrackCaptureConfig): Promise<void>;
2968
+ setAudioCaptureConfig: (config: TrackCaptureConfig) => Promise<void>;
2922
2969
 
2923
2970
  /**
2924
2971
  * @brief Configure the internal video capture. Different browser has its own default settings.
@@ -2927,7 +2974,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2927
2974
  * @note You can call this API after creating the engine. We recommend to call this API before [startVideoCapture](#startvideocapture).
2928
2975
  * @region Video Management
2929
2976
  */
2930
- setVideoCaptureConfig(config: TrackCaptureConfig): Promise<void>;
2977
+ setVideoCaptureConfig: (config: TrackCaptureConfig) => Promise<void>;
2931
2978
 
2932
2979
  /**
2933
2980
  * @brief Log in to the RTM server.
@@ -2942,13 +2989,13 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2942
2989
  * + In the same App ID, the user ID of each user must be unique. The user will be logged out when a user with the same userID joins the room because of the error of `RTM_DUPLICATE_LOGIN`.
2943
2990
  * @region Room Management
2944
2991
  */
2945
- login(token: string | null, userId: string): Promise<void>;
2992
+ login: (token: string | null, userId: string) => Promise<void>;
2946
2993
 
2947
2994
  /**
2948
2995
  * After calling this API to logout you are not able to call APIs to send messages and server messages.
2949
2996
  * @return
2950
2997
  */
2951
- logout(): Promise<void>;
2998
+ logout: () => Promise<void>;
2952
2999
 
2953
3000
  /**
2954
3001
  * @brief Update the Token used to login. Since all tokens have a limited time-to-live, call this API to refresh the token.
@@ -2957,7 +3004,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2957
3004
  * @notes + Call this API to refresh the token after the token has expired with no need for calling [login](#login).
2958
3005
  * + You will be informed of the expiration of the token if you tried to login with an expired token or during a reconnection. If the token expired after the user has logged in, no actions need to be taken.
2959
3006
  */
2960
- updateLoginToken(token: string | null): Promise<void>;
3007
+ updateLoginToken: (token: string | null) => Promise<void>;
2961
3008
 
2962
3009
  /**
2963
3010
  * @brief Get the status of a user before sending him/her a P2P message. You can also call this API to check the status of the current user.
@@ -2965,7 +3012,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2965
3012
  * @return
2966
3013
  * @notes Call [login](104478@#login) before calling this API.
2967
3014
  */
2968
- getPeerOnlineStatus(userId: string): Promise<USER_ONLINE_STATUS>;
3015
+ getPeerOnlineStatus: (userId: string) => Promise<USER_ONLINE_STATUS>;
2969
3016
 
2970
3017
  /**
2971
3018
  * @brief Send point-to-point (P2P) text message to a user.
@@ -2975,7 +3022,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2975
3022
  * @notes + Call [login](104478@#login) before calling this API.
2976
3023
  * + The recipient must be logged into the server and will receive the text message via [EngineEventsTypes.onUserMessageReceivedOutsideRoom](104479#onUserMessageReceivedOutsideRoom) if the message has been sent successfully.
2977
3024
  */
2978
- sendUserMessageOutsideRoom(userId: string, message: string): Promise<any>;
3025
+ sendUserMessageOutsideRoom: (userId: string, message: string) => Promise<any>;
2979
3026
 
2980
3027
  /**
2981
3028
  * @brief Send point-to-point (P2P) binary message to a user.
@@ -2985,7 +3032,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2985
3032
  * + The recipient must be logged into the server and will receive the text message via [EngineEventsTypes.onUserBinaryMessageReceivedOutsideRoom](104479#onuserbinarymessagereceivedoutsideroom) if the message has been sent successfully.
2986
3033
  * @notes
2987
3034
  */
2988
- sendUserBinaryMessageOutsideRoom(userId: string, message: ArrayBuffer): Promise<any>;
3035
+ sendUserBinaryMessageOutsideRoom: (userId: string, message: ArrayBuffer) => Promise<any>;
2989
3036
 
2990
3037
  /**
2991
3038
  * @brief Set the params of the server before calling [sendServerMessage](#sendServerMessage) or [sendServerBinaryMessage](#sendserverbinarymessage) to send messages to the server.
@@ -2994,7 +3041,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2994
3041
  * @return
2995
3042
  * @notes Call [login](#login) before calling this API.
2996
3043
  */
2997
- setServerParams(signature: string, url: string): Promise<any>;
3044
+ setServerParams: (signature: string, url: string) => Promise<any>;
2998
3045
 
2999
3046
  /**
3000
3047
  * @brief Send point-to-point (P2P) text message to the server.
@@ -3002,7 +3049,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
3002
3049
  * @return
3003
3050
  * @notes
3004
3051
  */
3005
- sendServerMessage(message: string): Promise<any>;
3052
+ sendServerMessage: (message: string) => Promise<any>;
3006
3053
 
3007
3054
  /**
3008
3055
  * @brief Send point-to-point (P2P) binary message to the server.
@@ -3010,7 +3057,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
3010
3057
  * @return
3011
3058
  * @notes
3012
3059
  */
3013
- sendServerBinaryMessage(message: ArrayBuffer): Promise<any>;
3060
+ sendServerBinaryMessage: (message: ArrayBuffer) => Promise<any>;
3014
3061
 
3015
3062
  /**
3016
3063
  * @brief Start cloud proxy
@@ -3020,13 +3067,13 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
3020
3067
  * + After starting cloud proxy and connects the cloud proxy server successfully, receives [onCloudProxyConnected](104479#onCloudProxyConnected).
3021
3068
  * + To stop cloud proxy, call [stopCloudProxy](#stopCloudProxy).
3022
3069
  */
3023
- startCloudProxy(cloudProxyInfo: CloudProxyInfo): void;
3070
+ startCloudProxy: (cloudProxyInfo: CloudProxyInfo) => void;
3024
3071
 
3025
3072
  /**
3026
3073
  * @brief Stop cloud proxy
3027
3074
  * @notes To start cloud proxy, call [startCloudProxy](#startCloudProxy).
3028
3075
  */
3029
- stopCloudProxy(): void;
3076
+ stopCloudProxy: () => void;
3030
3077
 
3031
3078
  /**
3032
3079
  * @brief Starts publishing a public media stream.
@@ -3041,7 +3088,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
3041
3088
  * + Call this API with different stream ID to publish multiple public streams.
3042
3089
  * + Call [stopPushPublicStream](#stoppushpublicstream) to stop publishing the public stream.
3043
3090
  */
3044
- startPushPublicStream(publicStreamId: string, publicStreamParam: PublicStreamConfig): Promise<void>;
3091
+ startPushPublicStream: (publicStreamId: string, publicStreamParam: PublicStreamConfig) => Promise<void>;
3045
3092
 
3046
3093
  /**
3047
3094
  * @brief Update the properties of the public stream published by the current user.
@@ -3051,7 +3098,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
3051
3098
  * @param publicStreamParam The public stream's parameters.
3052
3099
  * @return
3053
3100
  */
3054
- updatePublicStreamParam(publicStreamId: string, publicStreamParam: Partial<PublicStreamConfig>): Promise<void>;
3101
+ updatePublicStreamParam: (publicStreamId: string, publicStreamParam: Partial<PublicStreamConfig>) => Promise<void>;
3055
3102
 
3056
3103
  /**
3057
3104
  * @type api
@@ -3061,7 +3108,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
3061
3108
  * The public stream must be published by the current user.
3062
3109
  * @return
3063
3110
  */
3064
- stopPushPublicStream(publicStreamId: string): Promise<void>;
3111
+ stopPushPublicStream: (publicStreamId: string) => Promise<void>;
3065
3112
 
3066
3113
  /**
3067
3114
  * @brief Subscribes to a designated public stream.
@@ -3073,7 +3120,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
3073
3120
  * + After calling this API, you will receive [onFirstPublicStreamVideoFrameDecoded](104479#onfirstpublicstreamvideoframedecoded) and [onFirstPublicStreamAudioFrameDecoded](104479#onfirstpublicstreamaudioframedecoded) once the first frame has been decoded.
3074
3121
  * + Call [stopPlayPublicStream](#stopplaypublicstream) to unsubscribing from the public stream.
3075
3122
  */
3076
- startPlayPublicStream(publicStreamId: string): Promise<void>;
3123
+ startPlayPublicStream: (publicStreamId: string) => Promise<void>;
3077
3124
 
3078
3125
  /**
3079
3126
  * @brief Unsubscribes from a designated public stream.
@@ -3081,14 +3128,14 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
3081
3128
  * @param publicStreamId The public stream's ID.
3082
3129
  * @return
3083
3130
  */
3084
- stopPlayPublicStream(publicStreamId: string): Promise<void>;
3131
+ stopPlayPublicStream: (publicStreamId: string) => Promise<void>;
3085
3132
 
3086
3133
  /**
3087
3134
  * @brief Sets the player information and rendering mode for the public stream.
3088
3135
  * @param publicStreamId The public stream's ID.
3089
3136
  * @param videoPlayerOption Player information and rendering mode.
3090
3137
  */
3091
- setPublicStreamVideoPlayer(publicStreamId: string, videoPlayerOption: Omit<VideoPlayerOption, "userId">): void;
3138
+ setPublicStreamVideoPlayer: (publicStreamId: string, videoPlayerOption: Omit<VideoPlayerOption, "userId">) => void;
3092
3139
 
3093
3140
  /**
3094
3141
  * @region Video Management
@@ -3097,16 +3144,17 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
3097
3144
  * @param filePath Image path in Http protocal; or Blob object.
3098
3145
  * The format of the image can be: JPG, PNG, or BMP.
3099
3146
  * When the ratio of the image is not the same as the video encoder configuration, the image will be resized with fixed ratio until the width and the height are no more than that of the encoder configuration.
3100
- * @return + It's recommended to call this API before stopping video capture to avoid blank frame in video recording.
3101
- * + You cannot see the image during local preview.
3147
+ * @notes + Only available to Chrome browser on Mac
3148
+ * + It's recommended to call this API before stopping video capture to avoid blank frame in video recording.
3149
+ * + You cannot see the image during local preview.
3102
3150
  */
3103
- setDummyCaptureImagePath(index: StreamIndex, filePath: string): Promise<void>;
3151
+ setDummyCaptureImagePath: (index: StreamIndex, filePath: string) => Promise<void>;
3104
3152
 
3105
3153
  /**
3106
3154
  * @brief Get the default parameters of `LiveTranscodeConfig`.
3107
3155
  * @return The default parameters of `LiveTranscodeConfig`
3108
3156
  */
3109
- defaultTranscoding(): Required<LiveTranscodeConfig>;
3157
+ defaultTranscoding: () => Required<LiveTranscodeConfig>;
3110
3158
 
3111
3159
  /**
3112
3160
  * @brief Set the fallback option for remote media stream
@@ -3118,7 +3166,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
3118
3166
  * + After you enable the fallback, you will receive [onSimulcastSubscribeFallback](104479#onsimulcastsubscribefallback) and [onRemoteVideoSizeChanged](104479#onremotevideosizechanged} when the resolution of your subscribed stream is lowered or restored.
3119
3167
  * + You can set media stream fallback using API or cloud configuration. The latter takes a higher priority.
3120
3168
  */
3121
- setSubscribeFallbackOption(option: SubscribeFallbackOption): boolean;
3169
+ setSubscribeFallbackOption: (option: SubscribeFallbackOption) => boolean;
3122
3170
 
3123
3171
  /**
3124
3172
  * @brief Set the priority of the remote user's media stream.
@@ -3129,7 +3177,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
3129
3177
  * @return + `true` Success
3130
3178
  * + `false` Failure
3131
3179
  */
3132
- setRemoteUserPriority(userId: string, priority: RemoteUserPriority): boolean;
3180
+ setRemoteUserPriority: (userId: string, priority: RemoteUserPriority) => boolean;
3133
3181
 
3134
3182
  /**
3135
3183
  * @brief Start the playback test for the local audio device. RTC will start playing the audio file specified. And RTC will notify the audio volume via the [onAudioPlaybackDeviceTestVolume](104479#onaudioplaybackdevicetestvolume) periodically.
@@ -3139,13 +3187,13 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
3139
3187
  * @notes + You can call this API whether the user is in the room.
3140
3188
  * + Call [stopAudioPlaybackDeviceTest](#stopaudioplaybackdevicetest) to stop the playback test before moving on to the other device tests.
3141
3189
  */
3142
- startAudioPlaybackDeviceTest(filePath: string, indicationInterval: number): Promise<void>;
3190
+ startAudioPlaybackDeviceTest: (filePath: string, indicationInterval: number) => Promise<void>;
3143
3191
 
3144
3192
  /**
3145
3193
  * @brief Stop the playback test for the local audio device.
3146
3194
  * @notes Call this API to stop the playback test started by calling [startAudioPlaybackDeviceTest](#startaudioplaybackdevicetest) before moving on to the other device tests.
3147
3195
  */
3148
- stopAudioPlaybackDeviceTest(): void;
3196
+ stopAudioPlaybackDeviceTest: () => void;
3149
3197
 
3150
3198
  /**
3151
3199
  * @brief Start the capture and playback test for local audio devices.
@@ -3158,26 +3206,28 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
3158
3206
  * + Call [stopAudioDevicePlayTest](#stopaudiodeviceplaytest) to stop the test, including capturing and playing the recording.
3159
3207
  * + This test performs locally and does not involve network connection testing.
3160
3208
  */
3161
- startAudioDeviceRecordTest(indicationInterval: number): Promise<void>;
3209
+ startAudioDeviceRecordTest: (indicationInterval: number) => Promise<void>;
3162
3210
 
3163
3211
  /**
3164
3212
  * @brief Call this API to stop recording in the test and start to play the recording.
3165
3213
  * @notes After calling this API, the recording starts playing during which you can call [stopAudioDevicePlayTest](#stopaudiodeviceplaytest) to stop playing.
3166
3214
  */
3167
- stopAudioDeviceRecordAndPlayTest(): void;
3215
+ stopAudioDeviceRecordAndPlayTest: () => void;
3168
3216
 
3169
3217
  /**
3170
3218
  * @brief Stop the capture and playback test for local audio devices which is started by calling [startAudioDeviceRecordTest](#startaudiodevicerecordtest).
3171
3219
  * Before the test ends by itself, you can call this API to stop the recording or playing.
3172
3220
  */
3173
- stopAudioDevicePlayTest(): void;
3221
+ stopAudioDevicePlayTest: () => void;
3174
3222
 
3175
3223
  /**
3176
3224
  * @brief Set the sound quality.
3177
3225
  * @param profile A sound quality option consists of a set of audio profiles and applying each brings a different listening experience. Choose the appropriate audio quality to meet the requirement of the scenario.
3178
3226
  * @notes We recommend to call this API before the audio capture starts.
3179
3227
  */
3180
- setAudioProfile(profile: AudioProfileType): void;
3228
+ setAudioProfile: (profile: AudioProfileType) => void;
3229
+ takeLocalSnapshot: (streamIndex: StreamIndex) => Promise<ImageData>;
3230
+ takeRemoteSnapshot: (id: string, streamIndex: StreamIndex) => Promise<ImageData>;
3181
3231
  }
3182
3232
 
3183
3233
  /**
@@ -3213,22 +3263,22 @@ export declare enum AudioSourceType {
3213
3263
  }
3214
3264
 
3215
3265
  /**
3216
- * @brief User information
3266
+ * @brief User information.
3217
3267
  */
3218
3268
  export interface UserInfo {
3219
3269
 
3220
3270
  /**
3221
- * @brief User ID, a non-empty string within 128 bytes.
3271
+ * @brief User ID. A non-empty string within 128 bytes.
3222
3272
  */
3223
3273
  userId: string;
3224
3274
 
3225
3275
  /**
3226
- * @brief ExtraInfo Additional information passed by the user, with a maximum length of 200 bytes. Callback to remote user in [onUserJoined](104479#onuserjoined).
3227
- * @notes Supports the following character set ranges
3228
- * + 26 uppercase letters A~ Z
3229
- * + 26 lowercase letters a~ z
3230
- * + 10 numbers 0~ 9
3231
- * + underscore "_", at character "@", minus, number "-"
3276
+ * @brief The additional information of the user, with a maximum length of 200 bytes. Remote users will receive the [onUserJoined](104479#onuserjoined).
3277
+ * @notes The supported character types are as follows:
3278
+ * + Uppercase letters: A~ Z
3279
+ * + Lowercase letters: a~ z
3280
+ * + Numbers: 0~ 9
3281
+ * + Symbols: underscore "_"; at sign "@"; minus sign "-"
3232
3282
  */
3233
3283
  extraInfo?: string;
3234
3284
  }
@@ -3682,6 +3732,41 @@ export interface VideoEncoderConfig {
3682
3732
  maxKbps: number;
3683
3733
  }
3684
3734
 
3735
+ /**
3736
+ * @brief The encoding configuration of the screen-sharing stream.
3737
+ */
3738
+ export interface ScreenEncoderConfig {
3739
+
3740
+ /**
3741
+ * @brief The width of the shared video (px).
3742
+ */
3743
+ width: number;
3744
+
3745
+ /**
3746
+ * @brief The height of the shared video (px).
3747
+ */
3748
+ height: number;
3749
+
3750
+ /**
3751
+ * @brief The framerate of the shared video (fps).
3752
+ */
3753
+ frameRate: number;
3754
+
3755
+ /**
3756
+ * @brief The maximum bitrate(>0/kbps). The default value is 3000kbps.
3757
+ */
3758
+ maxKbps: number;
3759
+
3760
+ /**
3761
+ * @brief Content types of the shared video.
3762
+ * - 'detail' [Default setting]:clarity first, for video content containing a mix of images and text.
3763
+ * - 'text':clarity first, for video content containing only a large amount of text.
3764
+ * - 'motion':fluency first, applicable to scenarios when video content is camera captured source, movies, videos, games.
3765
+ * @notes Only Chrome browser is supported to set the configuration.
3766
+ */
3767
+ contentHint?: "text" | "motion" | "detail";
3768
+ }
3769
+
3685
3770
  /**
3686
3771
  * @brief Internal capture configuration for video & audio. Refer to [browser documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaTrackConstraints) for more details.
3687
3772
  */
@@ -4454,7 +4539,7 @@ export interface CloudProxyConnectedEvent {
4454
4539
  declare const Config: {
4455
4540
  VERSION: string;
4456
4541
  ICE_CONFIG_REQUEST_URLS_INTERNAL: string[];
4457
- ICE_CONFIG_REQUEST_URLS: never[];
4542
+ ICE_CONFIG_REQUEST_URLS: any[];
4458
4543
  EXPECTED_ADDR: string;
4459
4544
  LOG_SERVER_URL: string;
4460
4545
  CONFIG_REQUEST_DOMAINS: string[];
@@ -4462,7 +4547,7 @@ declare const Config: {
4462
4547
  OVERSEA: boolean;
4463
4548
  };
4464
4549
  declare function setParameter(key: keyof typeof Config, value: any): void;
4465
- declare function getParameter(key: keyof typeof Config): string | boolean | string[];
4550
+ declare function getParameter(key: keyof typeof Config): string | boolean | any[];
4466
4551
  /**
4467
4552
  * @list 104477
4468
4553
  * @detail 104478
@@ -4485,7 +4570,7 @@ export interface IVERTC {
4485
4570
  * + As each IRTCEngine instance is resource consuming, we recommend creating no more than 2 engine instances on each device at the same time.
4486
4571
  * @region Engine Management
4487
4572
  */
4488
- createEngine(appId: string, config?: EngineConfig): IRTCEngine;
4573
+ createEngine: (appId: string, config?: EngineConfig) => IRTCEngine;
4489
4574
 
4490
4575
  /**
4491
4576
  * @brief Call this API to destroy the IRTCEngine instance created by [createEngine](#createengine).
@@ -4494,14 +4579,14 @@ export interface IVERTC {
4494
4579
  * + Calling this API will block the main thread until it completes the exiting process. Therefore, do not include this API in a callback. Nor wait in a callback for the execution of this API in the main thread, thus causing a deadlock.
4495
4580
  * @region Engine Management
4496
4581
  */
4497
- destroyEngine(engine: IRTCEngine): void;
4582
+ destroyEngine: (engine: IRTCEngine) => void;
4498
4583
 
4499
4584
  /**
4500
4585
  * @brief Get the current version of the SDK.
4501
4586
  * @return The current SDK version.
4502
4587
  * @region Engine Management
4503
4588
  */
4504
- getSdkVersion(): string;
4589
+ getSdkVersion: () => string;
4505
4590
 
4506
4591
  /**
4507
4592
  * @brief Call this API to enumerate media devices and their IDs, such as microphones, cameras, and headsets.
@@ -4509,7 +4594,7 @@ export interface IVERTC {
4509
4594
  * @return A list of all media devices.
4510
4595
  * @notes Only when the browser has permission to the media devices can it enumerate the full device list. Make sure the media device access is turned on before calling this API.
4511
4596
  */
4512
- enumerateDevices(): Promise<MediaDeviceInfo[]>;
4597
+ enumerateDevices: () => Promise<MediaDeviceInfo[]>;
4513
4598
 
4514
4599
  /**
4515
4600
  * @brief Call this API to request for access to video and audio devices.
@@ -4576,7 +4661,7 @@ export interface IVERTC {
4576
4661
  }
4577
4662
  declare class VERTC implements IVERTC {
4578
4663
  getSdkVersion: () => string;
4579
- createEngine: (appId: string, config?: EngineConfig | undefined) => IRTCEngine;
4664
+ createEngine: (appId: string, config?: EngineConfig) => IRTCEngine;
4580
4665
  destroyEngine: (engine: IRTCEngine) => void;
4581
4666
  enumerateDevices: () => Promise<MediaDeviceInfo[]>;
4582
4667
  enableDevices: (options?: {