@byteplus/rtc 4.45.2 → 4.46.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.
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
  }
@@ -690,31 +680,44 @@ export interface AudioCodecProfile {
690
680
  chn: number;
691
681
  sr: number;
692
682
  }
683
+ /**
684
+ * 音频采集参数下发,定义参考文档:https://bytedance.feishu.cn/sheets/shtcnu2nj9ghFLWiANQb6A1snxh?sheet=7d720e
685
+ */
693
686
  export interface IEngineBAC {
694
- codec?: any;
695
- play?: AudioCodecProfile;
696
- record?: AudioCodecProfile;
687
+ codec?: {
688
+ enc_fs?: number;
689
+ };
690
+ adm?: {
691
+ play?: AudioCodecProfile;
692
+ record?: AudioCodecProfile;
693
+ };
697
694
  agc?: any;
698
695
  aec?: any;
699
696
  ans?: any;
700
697
  }
698
+ /**
699
+ * 音频编码参数下发,定义参考文档:https://bytedance.feishu.cn/sheets/shtcnu2nj9ghFLWiANQb6A1snxh?sheet=7d720e
700
+ */
701
701
  export interface IEngineANM {
702
- enc_param: {
702
+ enc_param?: {
703
703
  bitrate: number;
704
704
  chn: number;
705
+ sr: number;
705
706
  };
706
707
  }
707
708
  export interface IAudioConfig {
708
- bitrate: number;
709
- channel: number;
710
- sampleRate: number;
711
- agc: boolean;
712
- aec: boolean;
713
- ans: boolean;
709
+ bitrate?: number;
710
+ channel?: number;
711
+ playChannel?: number;
712
+ sampleRate?: number;
713
+ playbackRate?: number;
714
+ agc?: boolean;
715
+ aec?: boolean;
716
+ ans?: boolean;
714
717
  }
715
718
  declare class AudioProfileManager {
716
- engineBAC: any;
717
- engineANM: any;
719
+ engineBAC: Partial<IEngineBAC>;
720
+ engineANM: IEngineANM;
718
721
  bitrate?: number;
719
722
  sampleRate?: number;
720
723
  channel?: number;
@@ -725,6 +728,10 @@ declare class AudioProfileManager {
725
728
  private _init;
726
729
  updateEngineBAC(newProfile?: IEngineBAC): void;
727
730
  updateEngineANM(newProfile?: IEngineANM): void;
731
+ /**
732
+ * 通过setAudioProfile设置进来的预设编码参数
733
+ * @param profile AudioProfile
734
+ */
728
735
  setAudioProfile(profile: AudioProfileType): void;
729
736
  setBitrate(bitrate: number): void;
730
737
  setAEC(enable: boolean): void;
@@ -1513,6 +1520,7 @@ declare enum EngineEventsTypes {
1513
1520
  onAudioVolumeIndication = "onAudioVolumeIndication",
1514
1521
  onLocalAudioPropertiesReport = "onLocalAudioPropertiesReport",
1515
1522
  onRemoteAudioPropertiesReport = "onRemoteAudioPropertiesReport",
1523
+ onActiveSpeaker = "onActiveSpeaker",
1516
1524
 
1517
1525
  /**
1518
1526
  * @brief Callback of the state changing of audio playback devices
@@ -1559,9 +1567,47 @@ declare enum EngineEventsTypes {
1559
1567
  onNetworkQuality = "onNetworkQuality",
1560
1568
  onSimulcastSubscribeFallback = "onSimulcastSubscribeFallback",
1561
1569
  onRemoteVideoSizeChanged = "onRemoteVideoSizeChanged",
1570
+ onVideoStreamBanned = "onVideoStreamBanned",
1571
+ onAudioStreamBanned = "onAudioStreamBanned",
1562
1572
  onLocalVideoSizeChanged = "onLocalVideoSizeChanged"
1563
1573
  }
1564
1574
 
1575
+ /**
1576
+ * @brief Event of banning/unbanning video streaming
1577
+ */
1578
+ export interface VideoStreamBannedEvent {
1579
+
1580
+ /**
1581
+ * @brief The ID of the user who is banned/unbanned from publishing video stream
1582
+ */
1583
+ uid: string;
1584
+
1585
+ /**
1586
+ * @brief Video Streaming Status
1587
+ * true: Video streaming is banned
1588
+ * false: Video streaming is unbanned
1589
+ */
1590
+ banned: boolean;
1591
+ }
1592
+
1593
+ /**
1594
+ * @brief Event of banning/unbanning audio streaming
1595
+ */
1596
+ export interface AudioStreamBannedEvent {
1597
+
1598
+ /**
1599
+ * @brief The ID of the user who is banned/unbanned from publishing audio stream
1600
+ */
1601
+ uid: string;
1602
+
1603
+ /**
1604
+ * @brief Audio Streaming Status
1605
+ * true: Audio streaming is banned
1606
+ * false: Audio streaming is unbanned
1607
+ */
1608
+ banned: boolean;
1609
+ }
1610
+
1565
1611
  /**
1566
1612
  * @brief Pushing a mixed stream to CDN events
1567
1613
  */
@@ -1776,31 +1822,18 @@ export interface StreamKey {
1776
1822
  */
1777
1823
  streamIndex: StreamIndex;
1778
1824
  }
1779
- /**
1780
- * {zh}
1781
- * @brief 自动播放失败事件
1782
- */
1783
- /**
1784
- *
1825
+
1826
+ /**
1785
1827
  * @brief Event of Auto-play failure
1786
1828
  */
1787
1829
  export interface AutoPlayFailedEvent {
1788
- /**
1789
- * {zh}
1790
- * @brief 自动播放失败的流所属的用户 ID。不带此参数时表示本地流播放失败。
1791
- */
1792
- /**
1793
- *
1830
+
1831
+ /**
1794
1832
  * @brief ID of the user whose stream failed to playback automatically. Without this parameter, the notification is about the local stream.
1795
1833
  */
1796
1834
  userId?: string;
1797
- /**
1798
- * {zh}
1799
- * @brief 自动播放失败的媒体类型
1800
- * 例如,当同一用户的视频流和音频流自动播放都失败时,将触发两次 `onAutoPlayFailed` 回调,分别包含 `audio` 和 `video` 参数。
1801
- */
1802
- /**
1803
- *
1835
+
1836
+ /**
1804
1837
  * @brief Type of the media which is failed to play automatically
1805
1838
  * 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
1839
  */
@@ -2111,6 +2144,13 @@ export interface IEngineEvents {
2111
2144
  */
2112
2145
  [EngineEventsTypes.onRemoteAudioPropertiesReport]: (event: RemoteAudioPropertiesInfo[]) => void;
2113
2146
 
2147
+ /**
2148
+ * @brief After calling [enableAudioPropertiesReport](104478#enableaudiopropertiesreport), you will periodically receive this callback for the information of the user with the highest voice volume.
2149
+ * @param event The information of the user with the highest voice volume.
2150
+ * @region Audio Management
2151
+ */
2152
+ [EngineEventsTypes.onActiveSpeaker]: (userInfo: UserInfo) => void;
2153
+
2114
2154
  /**
2115
2155
  * @brief The current playback device has been changed successfully by calling [setAudioPlaybackDevice](104478#setAudioPlaybackDevice).
2116
2156
  * @param event Information of the media devices. See [MediaDeviceInfo](https://developer.mozilla.org/en-US/docs/Web/API/MediaDeviceInfo).
@@ -2371,6 +2411,30 @@ export interface IEngineEvents {
2371
2411
  */
2372
2412
  [EngineEventsTypes.onStreamMixingEvent]: (event: StreamMixingEvent) => void;
2373
2413
 
2414
+ /**
2415
+ * @brief The callback is triggered when the openAPI BanUserStream/UnbanUserStream is called to ban/unban the video stream of the specified user from publishing.
2416
+ * @param event
2417
+ * @notes + When the specified user in the room is banned/unbanned from sending video streams, all users in the room will receive the callback.
2418
+ * + 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.
2419
+ * + If the banned user reconnects due to connection drop, the user remains being banned, and only the banned user receives the callback.
2420
+ * + If a user is banned, other users receive this callback again when they leave and re-enter the room.
2421
+ * + Only banned/unbanned user will receive this callback if the conference mode is enabled in the console.
2422
+ * + If the room is dissolved and created again, the status in the room is cleared.
2423
+ */
2424
+ [EngineEventsTypes.onVideoStreamBanned]: (event: VideoStreamBannedEvent) => void;
2425
+
2426
+ /**
2427
+ * @brief The callback is triggered when the openAPI BanUserStream/UnbanUserStream is called to ban/unban the audio stream of the specified user from publishing.
2428
+ * @param event
2429
+ * @notes + When the specified user in the room is banned/unbanned from sending audio streams, all users in the room will receive the callback.
2430
+ * + 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.
2431
+ * + If the banned user reconnects due to connection drop, the user remains being banned, and only the banned user receives the callback.
2432
+ * + If a user is banned, other users receive this callback again when they leave and re-enter the room.
2433
+ * + Only banned/unbanned user will receive this callback if the conference mode is enabled in the console.
2434
+ * + If the room is dissolved and created again, the status in the room is cleared.
2435
+ */
2436
+ [EngineEventsTypes.onAudioStreamBanned]: (event: AudioStreamBannedEvent) => void;
2437
+
2374
2438
  /**
2375
2439
  * @brief The callback of the actual video capturing configuration.
2376
2440
  */
@@ -2426,7 +2490,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2426
2490
  * + 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
2491
  * @region Room Management
2428
2492
  */
2429
- joinRoom(token: string | null, roomId: string, userInfo: UserInfo, roomConfig?: RoomConfig): Promise<void>;
2493
+ joinRoom: (token: string | null, roomId: string, userInfo: UserInfo, roomConfig?: RoomConfig) => Promise<void>;
2430
2494
 
2431
2495
  /**
2432
2496
  * @brief Leave the room.
@@ -2435,7 +2499,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2435
2499
  * + 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
2500
  * @region Room Management
2437
2501
  */
2438
- leaveRoom(waitAck?: boolean): Promise<void>;
2502
+ leaveRoom: (waitAck?: boolean) => Promise<void>;
2439
2503
 
2440
2504
  /**
2441
2505
  * @hidden
@@ -2446,7 +2510,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2446
2510
  * + 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
2511
  * @region Engine Management
2448
2512
  */
2449
- destroy(): void;
2513
+ destroy: () => void;
2450
2514
 
2451
2515
  /**
2452
2516
  * @brief Publishes media streams captured by camera/microphone in the current room.
@@ -2458,7 +2522,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2458
2522
  * + Call [unpublishStream](#unpublishstream) to stop publishing streams.
2459
2523
  * @region Room Management
2460
2524
  */
2461
- publishStream(mediaType: MediaType): Promise<void>;
2525
+ publishStream: (mediaType: MediaType) => Promise<void>;
2462
2526
 
2463
2527
  /**
2464
2528
  * @brief Stops publishing media streams captured by camera/microphone in the current room.
@@ -2467,7 +2531,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2467
2531
  * + After calling this API, the other users in the room will receive [onUserUnpublishStream](104479#onuserunpublishstream).
2468
2532
  * @region Room Management
2469
2533
  */
2470
- unpublishStream(mediaType: MediaType): Promise<void>;
2534
+ unpublishStream: (mediaType: MediaType) => Promise<void>;
2471
2535
 
2472
2536
  /**
2473
2537
  * @brief Publishes local screen sharing streams in the current room.
@@ -2477,7 +2541,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2477
2541
  * + Call [unpublishScreen](#unpublishscreen) to stop publishing screen sharing streams.
2478
2542
  * @region Screen Sharing
2479
2543
  */
2480
- publishScreen(mediaType: MediaType): Promise<void>;
2544
+ publishScreen: (mediaType: MediaType) => Promise<void>;
2481
2545
 
2482
2546
  /**
2483
2547
  * @brief Stops publishing local screen sharing streams in the current room.
@@ -2486,7 +2550,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2486
2550
  * + After calling this API, the other users in the room will receive [onUserUnpublishScreen](104479#onuserunpublishscreen).
2487
2551
  * @region Screen Sharing
2488
2552
  */
2489
- unpublishScreen(mediaType: MediaType): Promise<void>;
2553
+ unpublishScreen: (mediaType: MediaType) => Promise<void>;
2490
2554
 
2491
2555
  /**
2492
2556
  * @brief Subscribes to specific remote media streams captured by camera/microphone.
@@ -2496,7 +2560,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2496
2560
  * @notes You must first get the remote stream information through onUserPublishStream{@link #IRTCRoomEventHandler#onUserPublishStream} before calling this API to subscribe to streams accordingly.
2497
2561
  * @region Room Management
2498
2562
  */
2499
- subscribeStream(userId: string, mediaType: MediaType): Promise<void>;
2563
+ subscribeStream: (userId: string, mediaType: MediaType) => Promise<void>;
2500
2564
 
2501
2565
  /**
2502
2566
  * @brief Unsubscribes from specific remote media streams captured by camera/microphone.
@@ -2505,7 +2569,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2505
2569
  * @param mediaType Media stream type, used for specifying whether to unsubscribe from the audio stream or the video stream.
2506
2570
  * @region Room Management
2507
2571
  */
2508
- unsubscribeStream(userId: string, mediaType: MediaType): Promise<void>;
2572
+ unsubscribeStream: (userId: string, mediaType: MediaType) => Promise<void>;
2509
2573
 
2510
2574
  /**
2511
2575
  * @brief Subscribes to specific screen sharing media stream.
@@ -2516,7 +2580,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2516
2580
  * + 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
2581
  * @region Room Management
2518
2582
  */
2519
- subscribeScreen(userId: string, mediaType: MediaType): Promise<void>;
2583
+ subscribeScreen: (userId: string, mediaType: MediaType) => Promise<void>;
2520
2584
 
2521
2585
  /**
2522
2586
  * @brief Unsubscribes from specific screen sharing media stream.
@@ -2525,7 +2589,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2525
2589
  * @param type Media stream type, used for specifying whether to unsubscribe from the audio stream or the video stream.
2526
2590
  * @region Room Management
2527
2591
  */
2528
- unsubscribeScreen(userId: string, mediaType: MediaType): Promise<void>;
2592
+ unsubscribeScreen: (userId: string, mediaType: MediaType) => Promise<void>;
2529
2593
 
2530
2594
  /**
2531
2595
  * @brief Update Token.
@@ -2536,7 +2600,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2536
2600
  * + The user will be removed from the room when the Token expires.
2537
2601
  * @region Room Management
2538
2602
  */
2539
- updateToken(token: string): void;
2603
+ updateToken: (token: string) => void;
2540
2604
 
2541
2605
  /**
2542
2606
  * @brief Switch the microphone used for internal audio capturing.
@@ -2544,7 +2608,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2544
2608
  * @return
2545
2609
  * @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
2610
  */
2547
- setAudioCaptureDevice(deviceId: string): Promise<void>;
2611
+ setAudioCaptureDevice: (deviceId: string) => Promise<void>;
2548
2612
 
2549
2613
  /**
2550
2614
  * @brief Switch the camera used for internal video capturing.
@@ -2554,7 +2618,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2554
2618
  * + For mobile devices, set deviceId as `"user"` to use the front camera. Set deviceId as `"environment"` to use the rear camera.
2555
2619
  * + The default camera is set by the browser.
2556
2620
  */
2557
- setVideoCaptureDevice(deviceId: string): Promise<void>;
2621
+ setVideoCaptureDevice: (deviceId: string) => Promise<void>;
2558
2622
 
2559
2623
  /**
2560
2624
  * @brief Enable internal video capture. The default state is off.
@@ -2567,7 +2631,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2567
2631
  * + Call [setVideoCaptureDevice](#setvideocapturedevice) to switch the camera used by the internal video capture module.
2568
2632
  * @region Video Management
2569
2633
  */
2570
- startVideoCapture(deviceId?: string): Promise<MediaTrackSettings>;
2634
+ startVideoCapture: (deviceId?: string) => Promise<MediaTrackSettings>;
2571
2635
 
2572
2636
  /**
2573
2637
  * @brief Enable internal video capture immediately. The default setting is off.
@@ -2578,7 +2642,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2578
2642
  * + Without calling this API the internal video capture will sustain until you destroy the engine instance.
2579
2643
  * @region Video Management
2580
2644
  */
2581
- stopVideoCapture(): Promise<void>;
2645
+ stopVideoCapture: () => Promise<void>;
2582
2646
 
2583
2647
  /**
2584
2648
  * @brief Start internal audio capture. The default is off.
@@ -2590,7 +2654,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2590
2654
  * + 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
2655
  * @region Audio Management
2592
2656
  */
2593
- startAudioCapture(deviceId?: string): Promise<void>;
2657
+ startAudioCapture: (deviceId?: string) => Promise<void>;
2594
2658
 
2595
2659
  /**
2596
2660
  * @brief Stop internal audio capture. The default is off.
@@ -2601,7 +2665,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2601
2665
  * + Without calling this API the internal audio capture will sustain until you destroy the engine instance.
2602
2666
  * @region Audio Management
2603
2667
  */
2604
- stopAudioCapture(): Promise<void>;
2668
+ stopAudioCapture: () => Promise<void>;
2605
2669
 
2606
2670
  /**
2607
2671
  * @brief Use the capture module provided by the RTC SDK to capture the current screen stream for sharing.
@@ -2612,7 +2676,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2612
2676
  * + Before calling this API, you can call [setVideoEncoderConfig](#setvideoencoderconfig) to set the capture frame rate and encoding resolution of the screen video stream.
2613
2677
  * @region Advanced Feature
2614
2678
  */
2615
- startScreenCapture(screenConfig?: ScreenConfig): Promise<void>;
2679
+ startScreenCapture: (screenConfig?: ScreenConfig) => Promise<void>;
2616
2680
 
2617
2681
  /**
2618
2682
  * @brief Stop screen sharing.
@@ -2620,7 +2684,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2620
2684
  * @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
2685
  * @region Advanced Feature
2622
2686
  */
2623
- stopScreenCapture(): Promise<void>;
2687
+ stopScreenCapture: () => Promise<void>;
2624
2688
 
2625
2689
  /**
2626
2690
  * @brief Bind a view to the local media stream and set the rendering mode for the rendering of the local stream
@@ -2631,7 +2695,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2631
2695
  * @notes You should bind the view after the user joins a room. This setting will sustain when the user leaves the room.
2632
2696
  * @region Video Management
2633
2697
  */
2634
- setLocalVideoPlayer(streamIndex: StreamIndex, videoPlayerOption?: Partial<VideoPlayerOption>): HTMLVideoElement | undefined;
2698
+ setLocalVideoPlayer: (streamIndex: StreamIndex, videoPlayerOption?: Partial<VideoPlayerOption>) => HTMLVideoElement | undefined;
2635
2699
 
2636
2700
  /**
2637
2701
  * @brief Bind a view to the remote media stream and set the rendering mode for the rendering of the remote stream
@@ -2642,14 +2706,14 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2642
2706
  * @notes You should bind the view after the user joins a room. This setting will sustain when the user leaves the room.
2643
2707
  * @region Video Management
2644
2708
  */
2645
- setRemoteVideoPlayer(streamIndex: StreamIndex, videoPlayerOption: VideoPlayerOption): HTMLVideoElement | undefined;
2709
+ setRemoteVideoPlayer: (streamIndex: StreamIndex, videoPlayerOption: VideoPlayerOption) => HTMLVideoElement | undefined;
2646
2710
 
2647
2711
  /**
2648
2712
  * @brief Enable or disable the mirror mode for the local video stream.
2649
2713
  * @param mirrorType Whether to turn on mirror mode.
2650
2714
  * @region Media Processing
2651
2715
  */
2652
- setLocalVideoMirrorType(mirrorType: MirrorType): void;
2716
+ setLocalVideoMirrorType: (mirrorType: MirrorType) => void;
2653
2717
 
2654
2718
  /**
2655
2719
  * @brief Sets the speaker or the earpiece as the audio playback device. The audio playback device defaults to the speaker.
@@ -2658,7 +2722,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2658
2722
  * @notes You can call this API before or after the user joins a room.
2659
2723
  * @region Audio Management
2660
2724
  */
2661
- setAudioPlaybackDevice(deviceId: string): Promise<void>;
2725
+ setAudioPlaybackDevice: (deviceId: string) => Promise<void>;
2662
2726
 
2663
2727
  /**
2664
2728
  * @brief Play audio and video stream manually.
@@ -2670,7 +2734,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2670
2734
  * @note + Call this API to start playback if the audio and/or video is not playing.
2671
2735
  * + Call this API once to start both audio and video playbacks when they do not start.
2672
2736
  */
2673
- play(userId?: string): Promise<void>;
2737
+ play: (userId?: string) => Promise<void>;
2674
2738
 
2675
2739
  /**
2676
2740
  * @brief Pause receiving remote media streams.
@@ -2681,7 +2745,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2681
2745
  * + To resume, call [resumeAllSubscribedStream](#resumeAllSubscribedStream).
2682
2746
  * @region Media Stream Transmission
2683
2747
  */
2684
- pauseAllSubscribedStream(mediaType: MediaType): Promise<void>;
2748
+ pauseAllSubscribedStream: (mediaType: MediaType) => Promise<void>;
2685
2749
 
2686
2750
  /**
2687
2751
  * @brief Resume receiving remote media streams
@@ -2691,47 +2755,47 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2691
2755
  * + Calling this API does not change any subscription configuration.
2692
2756
  * @region Media Transmission
2693
2757
  */
2694
- resumeAllSubscribedStream(mediaType: MediaType): Promise<void>;
2758
+ resumeAllSubscribedStream: (mediaType: MediaType) => Promise<void>;
2695
2759
 
2696
2760
  /**
2697
2761
  * @brief Send point-to-point text messages to a specified user in the room.
2698
2762
  * The recipient receives the message via [onUserMessageReceived](104479#onusermessagereceived) once the message is sent successfully.
2699
2763
  * @param userId User ID of the recipient
2700
- * @param message Text to be sent within 62KB
2764
+ * @param message Text to be sent within 64 KB
2701
2765
  * @return
2702
2766
  * @notes Call [joinRoom](#joinroom) to join the room before calling this API.
2703
2767
  * @region Message
2704
2768
  */
2705
- sendUserMessage(userId: string, message: string): Promise<unknown> | undefined;
2769
+ sendUserMessage: (userId: string, message: string) => Promise<unknown> | undefined;
2706
2770
 
2707
2771
  /**
2708
2772
  * @brief Send point-to-point binary messages to a specified user in the room.
2709
2773
  * The recipient receives the message via [onUserBinaryMessageReceived](104479#onuserbinarymessagereceived) once the message is sent successfully.
2710
2774
  * @param userId User ID of the recipient
2711
- * @param message Binary to be sent within 62KB
2775
+ * @param message Binary to be sent within 64 KB
2712
2776
  * @return
2713
2777
  * @notes Call [joinRoom](#joinroom) to join the room before calling this API.
2714
2778
  * @region Message
2715
2779
  */
2716
- sendUserBinaryMessage(userId: string, message: ArrayBuffer): Promise<unknown>;
2780
+ sendUserBinaryMessage: (userId: string, message: ArrayBuffer) => Promise<unknown>;
2717
2781
 
2718
2782
  /**
2719
2783
  * @brief Send text messaging to all other users in the room.
2720
2784
  * Users in the room will receive message via [onRoomMessageReceived](104479#onroommessagereceived) once the message is sent successfully.
2721
- * @param message Text to be sent within 62KB
2785
+ * @param message Text to be sent within 64 KB
2722
2786
  * @return
2723
2787
  * @region Message
2724
2788
  */
2725
- sendRoomMessage(message: string): Promise<any> | undefined;
2789
+ sendRoomMessage: (message: string) => Promise<any> | undefined;
2726
2790
 
2727
2791
  /**
2728
2792
  * @brief Send binary messaging to all other users in the room.
2729
2793
  * Users in the room will receive binary message via [onRoomBinaryMessageReceived](104479#onroombinarymessagereceived) once the message is sent successfully.
2730
- * @param message Binary message to be sent within 62KB
2794
+ * @param message Binary message to be sent within 64 KB
2731
2795
  * @return
2732
2796
  * @region Message
2733
2797
  */
2734
- sendRoomBinaryMessage(message: ArrayBuffer): Promise<any> | undefined;
2798
+ sendRoomBinaryMessage: (message: ArrayBuffer) => Promise<any> | undefined;
2735
2799
 
2736
2800
  /**
2737
2801
  * @brief Send SEI message carried by video frames
@@ -2744,7 +2808,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2744
2808
  * + Users receiving the stream will receive the SEI message via [onSEIMessageReceived](104479#onseimessagereceived) once the SEI message is sent successfully.
2745
2809
  * @region Message
2746
2810
  */
2747
- sendSEIMessage(streamIndex: StreamIndex, message: Uint8Array | string, repeatCount: number): void;
2811
+ sendSEIMessage: (streamIndex: StreamIndex, message: Uint8Array | string, repeatCount: number) => void;
2748
2812
 
2749
2813
  /**
2750
2814
  * @brief Sets the video encoder configuration of the publishing streams.
@@ -2757,7 +2821,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2757
2821
  * + This API is applicable to the video stream captured by the camera, see [setScreenEncoderConfig](#setscreenencoderconfig) for setting parameters for screen sharing video stream.
2758
2822
  * @region Video Management
2759
2823
  */
2760
- setVideoEncoderConfig(descriptions: VideoEncoderConfig | VideoEncoderConfig[]): Promise<void>;
2824
+ setVideoEncoderConfig: (descriptions: VideoEncoderConfig | VideoEncoderConfig[]) => Promise<void>;
2761
2825
 
2762
2826
  /**
2763
2827
  * @type api
@@ -2768,7 +2832,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2768
2832
  * @param VideoEncoderConfig The encoding configuration of the screen-sharing stream.
2769
2833
  * @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
2834
  */
2771
- setScreenEncoderConfig(description: VideoEncoderConfig): Promise<void>;
2835
+ setScreenEncoderConfig: (description: ScreenEncoderConfig) => Promise<void>;
2772
2836
 
2773
2837
  /**
2774
2838
  * @brief Sets your expected configuration of the remote video stream that you want to subscribe to or have subscribed to.
@@ -2779,7 +2843,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2779
2843
  * + 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
2844
  * @region Video Management
2781
2845
  */
2782
- setRemoteVideoConfig(userId: string, remoteVideoConfig: RemoteVideoConfig): Promise<void>;
2846
+ setRemoteVideoConfig: (userId: string, remoteVideoConfig: RemoteVideoConfig) => Promise<void>;
2783
2847
 
2784
2848
  /**
2785
2849
  * @region Video Management
@@ -2788,7 +2852,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2788
2852
  * @param + You must call this API before publishing the video streams.
2789
2853
  * + After enabling the simulcast mode, SDK automatically sets the encoding parameters for the video streams. For manual setting, call [setVideoEncoderConfig](#setVideoEncoderConfig).
2790
2854
  */
2791
- enableSimulcastMode(enabled: boolean): boolean;
2855
+ enableSimulcastMode: (enabled: boolean) => boolean;
2792
2856
 
2793
2857
  /**
2794
2858
  * @hidden
@@ -2802,7 +2866,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2802
2866
  * + > 0: Enable the volume prompt function and set the time interval for receiving the volume prompt callback. In milliseconds.
2803
2867
  * @region Room Management
2804
2868
  */
2805
- setAudioVolumeIndicationInterval(interval?: number): void;
2869
+ setAudioVolumeIndicationInterval: (interval?: number) => void;
2806
2870
 
2807
2871
  /**
2808
2872
  * @brief Enable audio information prompts.
@@ -2812,7 +2876,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2812
2876
  * + Get the information of the subscribed remote audio streams through [onRemoteAudioPropertiesReport](104479#onRemoteAudioPropertiesReport).
2813
2877
  * @region Audio Management
2814
2878
  */
2815
- enableAudioPropertiesReport(config?: AudioPropertiesConfig): void;
2879
+ enableAudioPropertiesReport: (config?: AudioPropertiesConfig) => void;
2816
2880
 
2817
2881
  /**
2818
2882
  * @brief Starts pushing media streams to CDN and sets the relevant configurations.
@@ -2822,7 +2886,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2822
2886
  * + Call [stopLiveTranscoding](#stoplivetranscoding) to stop pushing stream to CDN.
2823
2887
  * @region Advanced Feature
2824
2888
  */
2825
- startLiveTranscoding(transcode: LiveTranscodeConfig): Promise<void>;
2889
+ startLiveTranscoding: (transcode: LiveTranscodeConfig) => Promise<void>;
2826
2890
 
2827
2891
  /**
2828
2892
  * @brief Update configuration needed when pushing media streams to CDN.
@@ -2830,7 +2894,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2830
2894
  * @param transcode Configurations that you want to update.
2831
2895
  * @region Advanced Feature
2832
2896
  */
2833
- updateLiveTranscoding(transcode: Partial<LiveTranscodeConfig>): Promise<void>;
2897
+ updateLiveTranscoding: (transcode: Partial<LiveTranscodeConfig>) => Promise<void>;
2834
2898
 
2835
2899
  /**
2836
2900
  * @brief Stop pushing media streams to CDN
@@ -2838,7 +2902,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2838
2902
  * @return
2839
2903
  * @region Advanced Feature
2840
2904
  */
2841
- stopLiveTranscoding(): Promise<void>;
2905
+ stopLiveTranscoding: () => Promise<void>;
2842
2906
 
2843
2907
  /**
2844
2908
  * @brief Set the business ID.
@@ -2848,7 +2912,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2848
2912
  * @notes You must call this API before the [joinRoom](#joinroom) API, otherwise it will be invalid.
2849
2913
  * @region Engine Management
2850
2914
  */
2851
- setBusinessId(businessId: string): boolean;
2915
+ setBusinessId: (businessId: string) => boolean;
2852
2916
 
2853
2917
  /**
2854
2918
  * @brief Set user visibility. Visible by default.
@@ -2862,7 +2926,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2862
2926
  * - Switch from `true` to `false`: [onUserLeave](104479#onuserleave)
2863
2927
  * @region Room Management
2864
2928
  */
2865
- setUserVisibility(enable: boolean): Promise<void>;
2929
+ setUserVisibility: (enable: boolean) => Promise<void>;
2866
2930
 
2867
2931
  /**
2868
2932
  * @brief Set a custom videoTrack as the video source.
@@ -2872,7 +2936,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2872
2936
  * @return
2873
2937
  * @region Video Management
2874
2938
  */
2875
- setExternalVideoTrack(index: StreamIndex, track: MediaStreamTrack): Promise<void>;
2939
+ setExternalVideoTrack: (index: StreamIndex, track: MediaStreamTrack) => Promise<void>;
2876
2940
 
2877
2941
  /**
2878
2942
  * @brief Set a custom audioTrack as the audio source.
@@ -2882,7 +2946,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2882
2946
  * @return
2883
2947
  * @region Audio Management
2884
2948
  */
2885
- setExternalAudioTrack(index: StreamIndex, track: MediaStreamTrack): Promise<void>;
2949
+ setExternalAudioTrack: (index: StreamIndex, track: MediaStreamTrack) => Promise<void>;
2886
2950
 
2887
2951
  /**
2888
2952
  * @brief Switch the source from the internal to custom video capture.
@@ -2892,7 +2956,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2892
2956
  * @return
2893
2957
  * @region Video Management
2894
2958
  */
2895
- setVideoSourceType(index: StreamIndex, videoSourceType: VideoSourceType): Promise<void>;
2959
+ setVideoSourceType: (index: StreamIndex, videoSourceType: VideoSourceType) => Promise<void>;
2896
2960
 
2897
2961
  /**
2898
2962
  * @brief Switch the source from the internal to custom audio capture.
@@ -2902,14 +2966,14 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2902
2966
  * @return
2903
2967
  * @region Audio Management
2904
2968
  */
2905
- setAudioSourceType(index: StreamIndex, audioSourceType: AudioSourceType): Promise<void>;
2969
+ setAudioSourceType: (index: StreamIndex, audioSourceType: AudioSourceType) => Promise<void>;
2906
2970
 
2907
2971
  /**
2908
2972
  * @brief Create an audio mixing manager object
2909
2973
  * @return audio mixing manager object
2910
2974
  * @region Advanced Feature
2911
2975
  */
2912
- getAudioMixingManager(): IAudioMixingManager;
2976
+ getAudioMixingManager: () => IAudioMixingManager;
2913
2977
 
2914
2978
  /**
2915
2979
  * @brief Configure the internal audio capture. Different browser has its own default settings.
@@ -2918,7 +2982,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2918
2982
  * @note You can call this API after creating the engine. We recommend to call this API before [startAudioCapture](#startaudiocapture).
2919
2983
  * @region Audio Management
2920
2984
  */
2921
- setAudioCaptureConfig(config: TrackCaptureConfig): Promise<void>;
2985
+ setAudioCaptureConfig: (config: TrackCaptureConfig) => Promise<void>;
2922
2986
 
2923
2987
  /**
2924
2988
  * @brief Configure the internal video capture. Different browser has its own default settings.
@@ -2927,7 +2991,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2927
2991
  * @note You can call this API after creating the engine. We recommend to call this API before [startVideoCapture](#startvideocapture).
2928
2992
  * @region Video Management
2929
2993
  */
2930
- setVideoCaptureConfig(config: TrackCaptureConfig): Promise<void>;
2994
+ setVideoCaptureConfig: (config: TrackCaptureConfig) => Promise<void>;
2931
2995
 
2932
2996
  /**
2933
2997
  * @brief Log in to the RTM server.
@@ -2942,13 +3006,13 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2942
3006
  * + 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
3007
  * @region Room Management
2944
3008
  */
2945
- login(token: string | null, userId: string): Promise<void>;
3009
+ login: (token: string | null, userId: string) => Promise<void>;
2946
3010
 
2947
3011
  /**
2948
3012
  * After calling this API to logout you are not able to call APIs to send messages and server messages.
2949
3013
  * @return
2950
3014
  */
2951
- logout(): Promise<void>;
3015
+ logout: () => Promise<void>;
2952
3016
 
2953
3017
  /**
2954
3018
  * @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 +3021,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2957
3021
  * @notes + Call this API to refresh the token after the token has expired with no need for calling [login](#login).
2958
3022
  * + 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
3023
  */
2960
- updateLoginToken(token: string | null): Promise<void>;
3024
+ updateLoginToken: (token: string | null) => Promise<void>;
2961
3025
 
2962
3026
  /**
2963
3027
  * @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 +3029,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2965
3029
  * @return
2966
3030
  * @notes Call [login](104478@#login) before calling this API.
2967
3031
  */
2968
- getPeerOnlineStatus(userId: string): Promise<USER_ONLINE_STATUS>;
3032
+ getPeerOnlineStatus: (userId: string) => Promise<USER_ONLINE_STATUS>;
2969
3033
 
2970
3034
  /**
2971
3035
  * @brief Send point-to-point (P2P) text message to a user.
@@ -2975,7 +3039,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2975
3039
  * @notes + Call [login](104478@#login) before calling this API.
2976
3040
  * + 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
3041
  */
2978
- sendUserMessageOutsideRoom(userId: string, message: string): Promise<any>;
3042
+ sendUserMessageOutsideRoom: (userId: string, message: string) => Promise<any>;
2979
3043
 
2980
3044
  /**
2981
3045
  * @brief Send point-to-point (P2P) binary message to a user.
@@ -2985,7 +3049,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2985
3049
  * + 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
3050
  * @notes
2987
3051
  */
2988
- sendUserBinaryMessageOutsideRoom(userId: string, message: ArrayBuffer): Promise<any>;
3052
+ sendUserBinaryMessageOutsideRoom: (userId: string, message: ArrayBuffer) => Promise<any>;
2989
3053
 
2990
3054
  /**
2991
3055
  * @brief Set the params of the server before calling [sendServerMessage](#sendServerMessage) or [sendServerBinaryMessage](#sendserverbinarymessage) to send messages to the server.
@@ -2994,7 +3058,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2994
3058
  * @return
2995
3059
  * @notes Call [login](#login) before calling this API.
2996
3060
  */
2997
- setServerParams(signature: string, url: string): Promise<any>;
3061
+ setServerParams: (signature: string, url: string) => Promise<any>;
2998
3062
 
2999
3063
  /**
3000
3064
  * @brief Send point-to-point (P2P) text message to the server.
@@ -3002,7 +3066,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
3002
3066
  * @return
3003
3067
  * @notes
3004
3068
  */
3005
- sendServerMessage(message: string): Promise<any>;
3069
+ sendServerMessage: (message: string) => Promise<any>;
3006
3070
 
3007
3071
  /**
3008
3072
  * @brief Send point-to-point (P2P) binary message to the server.
@@ -3010,7 +3074,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
3010
3074
  * @return
3011
3075
  * @notes
3012
3076
  */
3013
- sendServerBinaryMessage(message: ArrayBuffer): Promise<any>;
3077
+ sendServerBinaryMessage: (message: ArrayBuffer) => Promise<any>;
3014
3078
 
3015
3079
  /**
3016
3080
  * @brief Start cloud proxy
@@ -3020,13 +3084,13 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
3020
3084
  * + After starting cloud proxy and connects the cloud proxy server successfully, receives [onCloudProxyConnected](104479#onCloudProxyConnected).
3021
3085
  * + To stop cloud proxy, call [stopCloudProxy](#stopCloudProxy).
3022
3086
  */
3023
- startCloudProxy(cloudProxyInfo: CloudProxyInfo): void;
3087
+ startCloudProxy: (cloudProxyInfo: CloudProxyInfo) => void;
3024
3088
 
3025
3089
  /**
3026
3090
  * @brief Stop cloud proxy
3027
3091
  * @notes To start cloud proxy, call [startCloudProxy](#startCloudProxy).
3028
3092
  */
3029
- stopCloudProxy(): void;
3093
+ stopCloudProxy: () => void;
3030
3094
 
3031
3095
  /**
3032
3096
  * @brief Starts publishing a public media stream.
@@ -3041,7 +3105,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
3041
3105
  * + Call this API with different stream ID to publish multiple public streams.
3042
3106
  * + Call [stopPushPublicStream](#stoppushpublicstream) to stop publishing the public stream.
3043
3107
  */
3044
- startPushPublicStream(publicStreamId: string, publicStreamParam: PublicStreamConfig): Promise<void>;
3108
+ startPushPublicStream: (publicStreamId: string, publicStreamParam: PublicStreamConfig) => Promise<void>;
3045
3109
 
3046
3110
  /**
3047
3111
  * @brief Update the properties of the public stream published by the current user.
@@ -3051,7 +3115,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
3051
3115
  * @param publicStreamParam The public stream's parameters.
3052
3116
  * @return
3053
3117
  */
3054
- updatePublicStreamParam(publicStreamId: string, publicStreamParam: Partial<PublicStreamConfig>): Promise<void>;
3118
+ updatePublicStreamParam: (publicStreamId: string, publicStreamParam: Partial<PublicStreamConfig>) => Promise<void>;
3055
3119
 
3056
3120
  /**
3057
3121
  * @type api
@@ -3061,7 +3125,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
3061
3125
  * The public stream must be published by the current user.
3062
3126
  * @return
3063
3127
  */
3064
- stopPushPublicStream(publicStreamId: string): Promise<void>;
3128
+ stopPushPublicStream: (publicStreamId: string) => Promise<void>;
3065
3129
 
3066
3130
  /**
3067
3131
  * @brief Subscribes to a designated public stream.
@@ -3073,7 +3137,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
3073
3137
  * + After calling this API, you will receive [onFirstPublicStreamVideoFrameDecoded](104479#onfirstpublicstreamvideoframedecoded) and [onFirstPublicStreamAudioFrameDecoded](104479#onfirstpublicstreamaudioframedecoded) once the first frame has been decoded.
3074
3138
  * + Call [stopPlayPublicStream](#stopplaypublicstream) to unsubscribing from the public stream.
3075
3139
  */
3076
- startPlayPublicStream(publicStreamId: string): Promise<void>;
3140
+ startPlayPublicStream: (publicStreamId: string) => Promise<void>;
3077
3141
 
3078
3142
  /**
3079
3143
  * @brief Unsubscribes from a designated public stream.
@@ -3081,14 +3145,14 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
3081
3145
  * @param publicStreamId The public stream's ID.
3082
3146
  * @return
3083
3147
  */
3084
- stopPlayPublicStream(publicStreamId: string): Promise<void>;
3148
+ stopPlayPublicStream: (publicStreamId: string) => Promise<void>;
3085
3149
 
3086
3150
  /**
3087
3151
  * @brief Sets the player information and rendering mode for the public stream.
3088
3152
  * @param publicStreamId The public stream's ID.
3089
3153
  * @param videoPlayerOption Player information and rendering mode.
3090
3154
  */
3091
- setPublicStreamVideoPlayer(publicStreamId: string, videoPlayerOption: Omit<VideoPlayerOption, "userId">): void;
3155
+ setPublicStreamVideoPlayer: (publicStreamId: string, videoPlayerOption: Omit<VideoPlayerOption, "userId">) => void;
3092
3156
 
3093
3157
  /**
3094
3158
  * @region Video Management
@@ -3097,16 +3161,17 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
3097
3161
  * @param filePath Image path in Http protocal; or Blob object.
3098
3162
  * The format of the image can be: JPG, PNG, or BMP.
3099
3163
  * 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.
3164
+ * @notes + Only available to Chrome browser on Mac
3165
+ * + It's recommended to call this API before stopping video capture to avoid blank frame in video recording.
3166
+ * + You cannot see the image during local preview.
3102
3167
  */
3103
- setDummyCaptureImagePath(index: StreamIndex, filePath: string): Promise<void>;
3168
+ setDummyCaptureImagePath: (index: StreamIndex, filePath: string) => Promise<void>;
3104
3169
 
3105
3170
  /**
3106
3171
  * @brief Get the default parameters of `LiveTranscodeConfig`.
3107
3172
  * @return The default parameters of `LiveTranscodeConfig`
3108
3173
  */
3109
- defaultTranscoding(): Required<LiveTranscodeConfig>;
3174
+ defaultTranscoding: () => Required<LiveTranscodeConfig>;
3110
3175
 
3111
3176
  /**
3112
3177
  * @brief Set the fallback option for remote media stream
@@ -3118,7 +3183,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
3118
3183
  * + 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
3184
  * + You can set media stream fallback using API or cloud configuration. The latter takes a higher priority.
3120
3185
  */
3121
- setSubscribeFallbackOption(option: SubscribeFallbackOption): boolean;
3186
+ setSubscribeFallbackOption: (option: SubscribeFallbackOption) => boolean;
3122
3187
 
3123
3188
  /**
3124
3189
  * @brief Set the priority of the remote user's media stream.
@@ -3129,7 +3194,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
3129
3194
  * @return + `true` Success
3130
3195
  * + `false` Failure
3131
3196
  */
3132
- setRemoteUserPriority(userId: string, priority: RemoteUserPriority): boolean;
3197
+ setRemoteUserPriority: (userId: string, priority: RemoteUserPriority) => boolean;
3133
3198
 
3134
3199
  /**
3135
3200
  * @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 +3204,13 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
3139
3204
  * @notes + You can call this API whether the user is in the room.
3140
3205
  * + Call [stopAudioPlaybackDeviceTest](#stopaudioplaybackdevicetest) to stop the playback test before moving on to the other device tests.
3141
3206
  */
3142
- startAudioPlaybackDeviceTest(filePath: string, indicationInterval: number): Promise<void>;
3207
+ startAudioPlaybackDeviceTest: (filePath: string, indicationInterval: number) => Promise<void>;
3143
3208
 
3144
3209
  /**
3145
3210
  * @brief Stop the playback test for the local audio device.
3146
3211
  * @notes Call this API to stop the playback test started by calling [startAudioPlaybackDeviceTest](#startaudioplaybackdevicetest) before moving on to the other device tests.
3147
3212
  */
3148
- stopAudioPlaybackDeviceTest(): void;
3213
+ stopAudioPlaybackDeviceTest: () => void;
3149
3214
 
3150
3215
  /**
3151
3216
  * @brief Start the capture and playback test for local audio devices.
@@ -3158,26 +3223,28 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
3158
3223
  * + Call [stopAudioDevicePlayTest](#stopaudiodeviceplaytest) to stop the test, including capturing and playing the recording.
3159
3224
  * + This test performs locally and does not involve network connection testing.
3160
3225
  */
3161
- startAudioDeviceRecordTest(indicationInterval: number): Promise<void>;
3226
+ startAudioDeviceRecordTest: (indicationInterval: number) => Promise<void>;
3162
3227
 
3163
3228
  /**
3164
3229
  * @brief Call this API to stop recording in the test and start to play the recording.
3165
3230
  * @notes After calling this API, the recording starts playing during which you can call [stopAudioDevicePlayTest](#stopaudiodeviceplaytest) to stop playing.
3166
3231
  */
3167
- stopAudioDeviceRecordAndPlayTest(): void;
3232
+ stopAudioDeviceRecordAndPlayTest: () => void;
3168
3233
 
3169
3234
  /**
3170
3235
  * @brief Stop the capture and playback test for local audio devices which is started by calling [startAudioDeviceRecordTest](#startaudiodevicerecordtest).
3171
3236
  * Before the test ends by itself, you can call this API to stop the recording or playing.
3172
3237
  */
3173
- stopAudioDevicePlayTest(): void;
3238
+ stopAudioDevicePlayTest: () => void;
3174
3239
 
3175
3240
  /**
3176
3241
  * @brief Set the sound quality.
3177
3242
  * @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
3243
  * @notes We recommend to call this API before the audio capture starts.
3179
3244
  */
3180
- setAudioProfile(profile: AudioProfileType): void;
3245
+ setAudioProfile: (profile: AudioProfileType) => void;
3246
+ takeLocalSnapshot: (streamIndex: StreamIndex) => Promise<ImageData>;
3247
+ takeRemoteSnapshot: (id: string, streamIndex: StreamIndex) => Promise<ImageData>;
3181
3248
  }
3182
3249
 
3183
3250
  /**
@@ -3213,22 +3280,22 @@ export declare enum AudioSourceType {
3213
3280
  }
3214
3281
 
3215
3282
  /**
3216
- * @brief User information
3283
+ * @brief User information.
3217
3284
  */
3218
3285
  export interface UserInfo {
3219
3286
 
3220
3287
  /**
3221
- * @brief User ID, a non-empty string within 128 bytes.
3288
+ * @brief User ID. A non-empty string within 128 bytes.
3222
3289
  */
3223
3290
  userId: string;
3224
3291
 
3225
3292
  /**
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 "-"
3293
+ * @brief The additional information of the user, with a maximum length of 200 bytes. Remote users will receive the [onUserJoined](104479#onuserjoined).
3294
+ * @notes The supported character types are as follows:
3295
+ * + Uppercase letters: A~ Z
3296
+ * + Lowercase letters: a~ z
3297
+ * + Numbers: 0~ 9
3298
+ * + Symbols: underscore "_"; at sign "@"; minus sign "-"
3232
3299
  */
3233
3300
  extraInfo?: string;
3234
3301
  }
@@ -3682,6 +3749,41 @@ export interface VideoEncoderConfig {
3682
3749
  maxKbps: number;
3683
3750
  }
3684
3751
 
3752
+ /**
3753
+ * @brief The encoding configuration of the screen-sharing stream.
3754
+ */
3755
+ export interface ScreenEncoderConfig {
3756
+
3757
+ /**
3758
+ * @brief The width of the shared video (px).
3759
+ */
3760
+ width: number;
3761
+
3762
+ /**
3763
+ * @brief The height of the shared video (px).
3764
+ */
3765
+ height: number;
3766
+
3767
+ /**
3768
+ * @brief The framerate of the shared video (fps).
3769
+ */
3770
+ frameRate: number;
3771
+
3772
+ /**
3773
+ * @brief The maximum bitrate(>0/kbps). The default value is 3000kbps.
3774
+ */
3775
+ maxKbps: number;
3776
+
3777
+ /**
3778
+ * @brief Content types of the shared video.
3779
+ * - 'detail' [Default setting]:clarity first, for video content containing a mix of images and text.
3780
+ * - 'text':clarity first, for video content containing only a large amount of text.
3781
+ * - 'motion':fluency first, applicable to scenarios when video content is camera captured source, movies, videos, games.
3782
+ * @notes Only Chrome browser is supported to set the configuration.
3783
+ */
3784
+ contentHint?: "text" | "motion" | "detail";
3785
+ }
3786
+
3685
3787
  /**
3686
3788
  * @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
3789
  */
@@ -4454,7 +4556,7 @@ export interface CloudProxyConnectedEvent {
4454
4556
  declare const Config: {
4455
4557
  VERSION: string;
4456
4558
  ICE_CONFIG_REQUEST_URLS_INTERNAL: string[];
4457
- ICE_CONFIG_REQUEST_URLS: never[];
4559
+ ICE_CONFIG_REQUEST_URLS: any[];
4458
4560
  EXPECTED_ADDR: string;
4459
4561
  LOG_SERVER_URL: string;
4460
4562
  CONFIG_REQUEST_DOMAINS: string[];
@@ -4462,7 +4564,7 @@ declare const Config: {
4462
4564
  OVERSEA: boolean;
4463
4565
  };
4464
4566
  declare function setParameter(key: keyof typeof Config, value: any): void;
4465
- declare function getParameter(key: keyof typeof Config): string | boolean | string[];
4567
+ declare function getParameter(key: keyof typeof Config): string | boolean | any[];
4466
4568
  /**
4467
4569
  * @list 104477
4468
4570
  * @detail 104478
@@ -4485,7 +4587,7 @@ export interface IVERTC {
4485
4587
  * + As each IRTCEngine instance is resource consuming, we recommend creating no more than 2 engine instances on each device at the same time.
4486
4588
  * @region Engine Management
4487
4589
  */
4488
- createEngine(appId: string, config?: EngineConfig): IRTCEngine;
4590
+ createEngine: (appId: string, config?: EngineConfig) => IRTCEngine;
4489
4591
 
4490
4592
  /**
4491
4593
  * @brief Call this API to destroy the IRTCEngine instance created by [createEngine](#createengine).
@@ -4494,14 +4596,14 @@ export interface IVERTC {
4494
4596
  * + 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
4597
  * @region Engine Management
4496
4598
  */
4497
- destroyEngine(engine: IRTCEngine): void;
4599
+ destroyEngine: (engine: IRTCEngine) => void;
4498
4600
 
4499
4601
  /**
4500
4602
  * @brief Get the current version of the SDK.
4501
4603
  * @return The current SDK version.
4502
4604
  * @region Engine Management
4503
4605
  */
4504
- getSdkVersion(): string;
4606
+ getSdkVersion: () => string;
4505
4607
 
4506
4608
  /**
4507
4609
  * @brief Call this API to enumerate media devices and their IDs, such as microphones, cameras, and headsets.
@@ -4509,7 +4611,7 @@ export interface IVERTC {
4509
4611
  * @return A list of all media devices.
4510
4612
  * @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
4613
  */
4512
- enumerateDevices(): Promise<MediaDeviceInfo[]>;
4614
+ enumerateDevices: () => Promise<MediaDeviceInfo[]>;
4513
4615
 
4514
4616
  /**
4515
4617
  * @brief Call this API to request for access to video and audio devices.
@@ -4576,7 +4678,7 @@ export interface IVERTC {
4576
4678
  }
4577
4679
  declare class VERTC implements IVERTC {
4578
4680
  getSdkVersion: () => string;
4579
- createEngine: (appId: string, config?: EngineConfig | undefined) => IRTCEngine;
4681
+ createEngine: (appId: string, config?: EngineConfig) => IRTCEngine;
4580
4682
  destroyEngine: (engine: IRTCEngine) => void;
4581
4683
  enumerateDevices: () => Promise<MediaDeviceInfo[]>;
4582
4684
  enableDevices: (options?: {