@byteplus/rtc 4.42.1 → 4.44.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
@@ -14,6 +14,11 @@ declare enum ErrorCode {
14
14
  */
15
15
  INVALID_PARAMS = "INVALID_PARAMS",
16
16
 
17
+ /**
18
+ * @brief You are not in the room when trying to publish/unpublish or subscribe/unsubscribe stream
19
+ */
20
+ INVOKED_BEFORE_JOIN_ROOM = "INVOKED_BEFORE_JOIN_ROOM",
21
+
17
22
  /**
18
23
  * @brief Invalid Token
19
24
  */
@@ -123,7 +128,6 @@ declare enum ErrorCode {
123
128
  * @brief Users have been removed from the room because the administrator dismissed the room by calling OpenAPI.
124
129
  */
125
130
  ROOM_DISMISS = "ROOM_DISMISS",
126
- /** Token过期被踢出房间 */
127
131
 
128
132
  /**
129
133
  * @brief Token expired. Call `joinRoom` to rejoin with a valid Token.
@@ -367,7 +371,13 @@ declare enum ErrorCode {
367
371
  /**
368
372
  * @brief The user publishes a public stream before joining room.
369
373
  */
370
- START_PUBLIC_STREAM_BEFORE_JOIN = "START_PUBLIC_STREAM_BEFORE_JOIN"
374
+ START_PUBLIC_STREAM_BEFORE_JOIN = "START_PUBLIC_STREAM_BEFORE_JOIN",
375
+
376
+ /**
377
+ * @brief Reconnection with the server fails and SDK will no longer automatically retry.
378
+ * Please leave room first and join room again, or contact technical support.
379
+ */
380
+ RECONNECT_FAILED = "RECONNECT_FAILED"
371
381
  }
372
382
  declare enum AudioMixingError {
373
383
 
@@ -432,16 +442,16 @@ declare enum AudioMixingError {
432
442
  export interface IAudioMixingManager {
433
443
 
434
444
  /**
435
- * @brief Start playing audio files and mixes. <br>
436
- * This method can be called many times by passing in different IDs and filepath to realize simultaneous playback of multiple mixing files and mixing overlay.<br>
437
- * @param id Mix ID. For identifying the mix, please ensure that the mix ID is unique. <br>
445
+ * @brief Start playing audio files and mixes.
446
+ * This method can be called many times by passing in different IDs and filepath to realize simultaneous playback of multiple mixing files and mixing overlay.
447
+ * @param id Mix ID. For identifying the mix, please ensure that the mix ID is unique.
438
448
  * If this method is repeatedly called with the same ID, the previous mix stops and the next mix starts.
439
449
  * @param filePath Specify the file path either the absolute path of a local file or the url of online audio. Files with the extension of mp3 and aac are supported.
440
- * @param config Mix Sound configuration <br>
450
+ * @param config Mix Sound configuration.
441
451
  * You can set the number of times the mix is played, whether the mix is played locally, and whether the mix is sent to the remote end. For details.
442
452
  * @return
443
- * @notes + If you have already loaded the sound effect into memory through [preloadAudioMixing](#preloadaudiomixing), make sure that the ID here is the same as the ID set by [preloadAudioMixing](#preloadaudiomixing). <br>
444
- * + After you start playing the audio file and mixing, you can call the [stopAudioMixing](#stopaudiomixing) method to stop playing the audio file. <br>
453
+ * @notes + If you have already loaded the sound effect into memory through [preloadAudioMixing](#preloadaudiomixing), make sure that the ID here is the same as the ID set by [preloadAudioMixing](#preloadaudiomixing).
454
+ * + After you start playing the audio file and mixing, you can call the [stopAudioMixing](#stopaudiomixing) method to stop playing the audio file.
445
455
  * + 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.
446
456
  * @region Advanced Feature
447
457
  */
@@ -450,7 +460,7 @@ export interface IAudioMixingManager {
450
460
  /**
451
461
  * @brief Stop playing audio files and mixes
452
462
  * @param id ID of the mixing
453
- * @notes + After calling [startAudioMixing](#startaudiomixing) method to start playing audio files and mixes, you can call this method to stop playing audio files and mixes. <br>
463
+ * @notes + After calling [startAudioMixing](#startaudiomixing) method to start playing audio files and mixes, you can call this method to stop playing audio files and mixes.
454
464
  * + After calling this method to stop playing the audio file, the audio file will be automatically uninstalled.
455
465
  * @region Advanced Feature
456
466
  */
@@ -459,8 +469,8 @@ export interface IAudioMixingManager {
459
469
  /**
460
470
  * @brief Pause playing audio files and mixes
461
471
  * @param id ID of the mixing
462
- * @notes + After calling [startAudioMixing](#startaudiomixing) method to start playing audio files and mixes, you can call this method to pause playing audio files and mixes. <br>
463
- * + After calling this method to pause playing audio files and mixing, you can call the [resumeAudioMixing](#resumeaudiomixing) method to resume playing and mixing. <br>
472
+ * @notes + After calling [startAudioMixing](#startaudiomixing) method to start playing audio files and mixes, you can call this method to pause playing audio files and mixes.
473
+ * + After calling this method to pause playing audio files and mixing, you can call the [resumeAudioMixing](#resumeaudiomixing) method to resume playing and mixing.
464
474
  * @region Advanced Feature
465
475
  */
466
476
  pauseAudioMixing(id: number): void;
@@ -468,21 +478,21 @@ export interface IAudioMixingManager {
468
478
  /**
469
479
  * @brief Resume playing audio files and mixing
470
480
  * @param id Mixing ID
471
- * @notes After calling the [pauseAudioMixing](#pauseaudiomixing) method to pause playing audio files and mixing, you can resume playing and mixing by calling this method. <br>
481
+ * @notes After calling the [pauseAudioMixing](#pauseaudiomixing) method to pause playing audio files and mixing, you can resume playing and mixing by calling this method.
472
482
  * @region Advanced Feature
473
483
  */
474
484
  resumeAudioMixing(id: number): void;
475
485
 
476
486
  /**
477
487
  * @brief Preload the specified audio file into memory
478
- * @param id Mix ID. For identifying the mix, please ensure that the mix ID is unique. <br>
479
- * If this method is called repeatedly with the same ID, the latter overrides the previous. <br>
480
- * If you call [startAudioMixing](#startaudiomixing) and then call this method with the same ID, the previous mix stopped, and then the next mix was loaded. <br>
488
+ * @param id Mix ID. For identifying the mix, please ensure that the mix ID is unique.
489
+ * If this method is called repeatedly with the same ID, the latter overrides the previous.
490
+ * If you call [startAudioMixing](#startaudiomixing) and then call this method with the same ID, the previous mix stopped, and then the next mix was loaded.
481
491
  * After calling this method with an ID to preload A.mp3, if you need to call [startAudioMixing](#startaudiomixing) to play B.mp3 with the same ID, please call [unloadAudioMixing](#unloadaudiomixing) to uninstall A.mp3 first, otherwise you will report an error AUDIO_MIXING_ERROR_LOAD_CONFLICT.
482
- * @param filePath Used for mixing file paths. It can be the absolute path of the local file or the url of the online audio. <br>
492
+ * @param filePath Used for mixing file paths. It can be the absolute path of the local file or the url of the online audio.
483
493
  * @return
484
- * @notes + When you need to play an audio file frequently, call this method to preload the file. When playing, you can only load the file once to reduce CPU usage. <br>
485
- * + This method pre-loads the specified audio file, and only calling [startAudioMixing](#startaudiomixing) API can you start playing the specified audio file. <br>
494
+ * @notes + When you need to play an audio file frequently, call this method to preload the file. When playing, you can only load the file once to reduce CPU usage.
495
+ * + This method pre-loads the specified audio file, and only calling [startAudioMixing](#startaudiomixing) API can you start playing the specified audio file.
486
496
  * + The specified audio file preloaded by calling this method can be unloaded through [unloadAudioMixing](#unloadaudiomixing).
487
497
  * @region Advanced Feature
488
498
  */
@@ -498,9 +508,9 @@ export interface IAudioMixingManager {
498
508
  /**
499
509
  * @brief Adjust the volume of audio mixing, including audio files and PCM data.
500
510
  * @param id Mixing ID
501
- * @param volume The ratio of the mixing volume to the original volume. The range is `[0, 400]`. The recommended range is `[0, 100]`. <br>
502
- * + 0: Mute <br>
503
- * + 100: Original volume <br>
511
+ * @param volume The ratio of the mixing volume to the original volume. The range is `[0, 400]`. The recommended range is `[0, 100]`.
512
+ * + 0: Mute
513
+ * + 100: Original volume
504
514
  * + 400: Maximum volume (with overflow protection)
505
515
  * @region Advanced Feature
506
516
  */
@@ -509,9 +519,8 @@ export interface IAudioMixingManager {
509
519
  /**
510
520
  * @brief Get volume of the audio files.
511
521
  * @param id Audio mix id
512
- * @return <br>
513
- * + `0`: Failure<br>
514
- * + `>0`: Successful. Volume<br>
522
+ * @return + `0`: Failure
523
+ * + `>0`: Successful. Volume
515
524
  * @region Advanced Feature
516
525
  */
517
526
  getAudioMixingVolume(id: number): number;
@@ -519,8 +528,7 @@ export interface IAudioMixingManager {
519
528
  /**
520
529
  * @brief Get audio file duration
521
530
  * @param id Mix ID
522
- * @return <br>
523
- * + > 0: Success, audio file duration, in milliseconds. <br>
531
+ * @return + > 0: Success, audio file duration, in milliseconds.
524
532
  * + < 0: Failure
525
533
  * @notes Before calling this method to obtain the length of the audio file, you need to call [preloadAudioMixing](#preloadaudiomixing) or [startAudioMixing](#startaudiomixing).
526
534
  * @region Advanced Feature
@@ -530,8 +538,7 @@ export interface IAudioMixingManager {
530
538
  /**
531
539
  * @brief Get audio file playback progress
532
540
  * @param id Mix ID
533
- * @return <br>
534
- * + > 0: Success, audio file playback progress, in milliseconds. <br>
541
+ * @return + > 0: Success, audio file playback progress, in milliseconds.
535
542
  * + < 0: Failed
536
543
  * @notes Before calling this method to get the audio file playback progress, you need to call [startAudioMixing](#startaudiomixing) to start playing the audio file.
537
544
  * @region Advanced Feature
@@ -541,20 +548,20 @@ export interface IAudioMixingManager {
541
548
  /**
542
549
  * @brief Set the starting playback position of the audio file
543
550
  * @param id Mixing ID
544
- * @param position The starting playback position of the audio file in milliseconds.<br>
551
+ * @param position The starting playback position of the audio file in milliseconds.
545
552
  * Call [getAudioMixingDuration](#getAudioMixingDuration) to get the duration of the audio file. The value of `position` must not be greater than the duration of the audio file.
546
- * @notes + This method allows you to play an audio file from a specified position as appropriate, without having to play an audio file in its entirety from the beginning to finish. <br>
553
+ * @notes + This method allows you to play an audio file from a specified position as appropriate, without having to play an audio file in its entirety from the beginning to finish.
547
554
  * + 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.
548
555
  * @region Advanced Feature
549
556
  */
550
557
  setAudioMixingPosition(id: number, position: number): void;
551
558
 
552
559
  /**
553
- * @brief Start PCM mixing. <br>
560
+ * @brief Start PCM mixing.
554
561
  * To mix multiple PCM audio data, call this API multiple times with different ids.
555
- * @param type Mixing type <br>
562
+ * @param type Mixing type.
556
563
  * Whether the PCM data is mixed locally and sent to the remotes.
557
- * @notes + After this API, you must call [pushAudioMixingFrame](#pushaudiomixingframe) to start mixing. <br>
564
+ * @notes + After this API, you must call [pushAudioMixingFrame](#pushaudiomixingframe) to start mixing.
558
565
  * + To end PCM mixing, use [disableAudioMixingFrame](#disableaudiomixingframe).
559
566
  * @region Advanced Feature
560
567
  */
@@ -569,7 +576,7 @@ export interface IAudioMixingManager {
569
576
  /**
570
577
  * @brief Push PCM audio frame data for mixing
571
578
  * @param buffer Refer to [Browser documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioBuffer)
572
- * @notes Before calling this method, you must start the external audio stream mixing through [enableAudioMixingFrame](#enableaudiomixingframe). <br>
579
+ * @notes Before calling this method, you must start the external audio stream mixing through [enableAudioMixingFrame](#enableaudiomixingframe).
573
580
  * @region Advanced Feature
574
581
  */
575
582
  pushAudioMixingBuffer(buffer: AudioBuffer): void;
@@ -647,8 +654,8 @@ export interface MixOption {
647
654
 
648
655
  /**
649
656
  * @brief Mix playback times
650
- * @notes + Play_count < = 0: Infinite loop <br>
651
- * + Play_count == 1: Play once (default) <br>
657
+ * @notes + Play_count < = 0: Infinite loop
658
+ * + Play_count == 1: Play once (default)
652
659
  * + Play_count > 1: Play play_count times
653
660
  */
654
661
  playCount: number;
@@ -665,38 +672,136 @@ declare class EnhancedEventEmitter<EventTypes extends ValidEventTypes = string |
665
672
  }
666
673
 
667
674
  /**
668
- * @brief Information of media device
675
+ * @brief Information and state of a media device.
669
676
  */
670
- export interface RTCDevice {
677
+ export interface DeviceInfo {
678
+
679
+ /**
680
+ * @brief Information of a media device. See [MediaDeviceInfo](https://developer.mozilla.org/en-US/docs/Web/API/MediaDeviceInfo).
681
+ */
682
+ mediaDeviceInfo: MediaDeviceInfo;
683
+
684
+ /**
685
+ * @brief Device state.
686
+ */
687
+ deviceState: "active" | "inactive";
688
+ }
689
+ export interface AudioCodecProfile {
690
+ chn: number;
691
+ sr: number;
692
+ }
693
+ export interface IEngineBAC {
694
+ codec?: any;
695
+ play?: AudioCodecProfile;
696
+ record?: AudioCodecProfile;
697
+ agc?: any;
698
+ aec?: any;
699
+ ans?: any;
700
+ }
701
+ export interface IEngineANM {
702
+ enc_param: {
703
+ bitrate: number;
704
+ chn: number;
705
+ };
706
+ }
707
+ export interface IAudioConfig {
708
+ bitrate: number;
709
+ channel: number;
710
+ sampleRate: number;
711
+ agc: boolean;
712
+ aec: boolean;
713
+ ans: boolean;
714
+ }
715
+ declare class AudioProfileManager {
716
+ engineBAC: any;
717
+ engineANM: any;
718
+ bitrate?: number;
719
+ sampleRate?: number;
720
+ channel: number;
721
+ aec: boolean;
722
+ agc: boolean;
723
+ ans: boolean;
724
+ constructor();
725
+ private _init;
726
+ updateEngineBAC(newProfile?: IEngineBAC): void;
727
+ updateEngineANM(newProfile?: IEngineANM): void;
728
+ setAudioProfile(profile: AudioProfileType): void;
729
+ setBitrate(bitrate: number): void;
730
+ setAEC(enable: boolean): void;
731
+ setAGC(enable: boolean): void;
732
+ setANS(enable: boolean): void;
733
+ getOpusConfigStr(): string;
734
+ get config(): IAudioConfig;
735
+ }
736
+ declare enum StreamMixingEventType {
671
737
 
672
738
  /**
673
- * @brief Device ID
674
- * Refer to the [browser documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaDeviceInfo)
739
+ * @brief Request a start to push the mixed stream to CDN.
675
740
  */
676
- deviceId: MediaDeviceInfo["deviceId"];
741
+ START = 1,
677
742
 
678
743
  /**
679
- * @brief Device type
680
- * Refer to the [browser documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaDeviceInfo)
744
+ * @brief Success.
681
745
  */
682
- deviceType: MediaDeviceInfo["kind"];
746
+ START_SUCCESS = 2,
683
747
 
684
748
  /**
685
- * @brief Device information
686
- * Refer to the [browser documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaDeviceInfo)
749
+ * @brief Failure.
687
750
  */
688
- deviceInfo: MediaDeviceInfo;
751
+ START_FAILED = 3,
689
752
 
690
753
  /**
691
- * @brief Device label
692
- * Refer to the [browser documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaDeviceInfo)
754
+ * @brief Request a configuration update.
693
755
  */
694
- deviceName: MediaDeviceInfo["label"];
756
+ UPDATE = 4,
695
757
 
696
758
  /**
697
- * @brief Device state
759
+ * @brief Push the mixed stream after the configuration update.
698
760
  */
699
- deviceState: "active" | "inactive";
761
+ UPDATE_SUCCESS = 5,
762
+
763
+ /**
764
+ * @brief Fail to update the configuration.
765
+ */
766
+ UPDATE_FAILED = 6,
767
+
768
+ /**
769
+ * @brief Request a stop to push the mixed stream to CDN.
770
+ */
771
+ STOP = 7,
772
+
773
+ /** Pushing the mixed stream to CDN is stopped.
774
+ * @brief
775
+ */
776
+ STOP_SUCCESS = 8,
777
+
778
+ /**
779
+ * @brief Fail to stop pushing the mixed stream to CDN.
780
+ */
781
+ STOP_FAILED = 9
782
+ }
783
+ /**
784
+ * @brief Cloud proxy informatio
785
+ */
786
+ export interface CloudProxyInfo {
787
+
788
+ /**
789
+ * @brief The cloud proxy IP of log report
790
+ */
791
+ logProxy: string;
792
+
793
+ /**
794
+ * @brief The cloud proxy IP of the access
795
+ */
796
+ accessProxy: string;
797
+
798
+ /**
799
+ * @brief The cloud proxy IP of RTC admin control
800
+ */
801
+ configProxy: string;
802
+ }
803
+ export interface RTCContext {
804
+ audioProfileManager: AudioProfileManager;
700
805
  }
701
806
 
702
807
  /**
@@ -809,7 +914,12 @@ export interface onVideoFirstFrameDecodedEvent {
809
914
  /**
810
915
  * Event related to decoding the first video frame of the public stream.
811
916
  */
812
- export declare type PublicStreamVideoFirstFrameDecodedEvent = Omit<onVideoFirstFrameDecodedEvent, "userId"> & {
917
+ export declare type PublicStreamVideoFirstFrameDecodedEvent = Omit<
918
+
919
+ /**
920
+ * @brief Event related to the decoding of the first video frame.
921
+ */
922
+ onVideoFirstFrameDecodedEvent, "userId"> & {
813
923
 
814
924
  /**
815
925
  * @brief The public stream's ID.
@@ -929,6 +1039,7 @@ export interface LocalAudioStats {
929
1039
  numChannels: number;
930
1040
 
931
1041
  /**
1042
+ * @hidden
932
1043
  * @brief Sample rate of sending
933
1044
  */
934
1045
  sentSampleRate?: number;
@@ -945,6 +1056,7 @@ export interface LocalVideoStats {
945
1056
  sentKBitrate: number;
946
1057
 
947
1058
  /**
1059
+ * @hidden
948
1060
  * @brief Frame rate of the source video
949
1061
  */
950
1062
  inputFrameRate?: number;
@@ -965,11 +1077,13 @@ export interface LocalVideoStats {
965
1077
  rendererOutputFrameRate?: number;
966
1078
 
967
1079
  /**
1080
+ * @hidden
968
1081
  * @brief Target bitrate
969
1082
  */
970
1083
  targetKBitrate?: number;
971
1084
 
972
1085
  /**
1086
+ * @hidden
973
1087
  * @brief Target frame rate
974
1088
  */
975
1089
  targetFrameRate?: number;
@@ -990,6 +1104,7 @@ export interface LocalVideoStats {
990
1104
  rtt: number;
991
1105
 
992
1106
  /**
1107
+ * @hidden
993
1108
  * @brief Bitrate of encoding
994
1109
  */
995
1110
  encodedBitrate?: number;
@@ -1079,11 +1194,13 @@ export interface RemoteAudioStats {
1079
1194
  stallDuration?: number;
1080
1195
 
1081
1196
  /**
1197
+ * @hidden
1082
1198
  * @brief End-to-end delay, unit: ms
1083
1199
  */
1084
1200
  e2eDelay: number;
1085
1201
 
1086
1202
  /**
1203
+ * @hidden
1087
1204
  * @brief Sample rate of the playback
1088
1205
  */
1089
1206
  playoutSampleRate?: number;
@@ -1120,6 +1237,7 @@ export interface RemoteAudioStats {
1120
1237
  receivedSampleRate: number;
1121
1238
 
1122
1239
  /**
1240
+ * @hidden
1123
1241
  * @brief Video frozen rate
1124
1242
  */
1125
1243
  frozenRate?: number;
@@ -1135,11 +1253,13 @@ export interface RemoteAudioStats {
1135
1253
  concealmentEvent: number;
1136
1254
 
1137
1255
  /**
1256
+ * @hidden
1138
1257
  * @brief Sample rate of decoding
1139
1258
  */
1140
1259
  decSampleRate?: number;
1141
1260
 
1142
1261
  /**
1262
+ * @hidden
1143
1263
  * @brief Decoding duration, unit: s
1144
1264
  */
1145
1265
  decDuration?: number;
@@ -1176,6 +1296,7 @@ export interface RemoteVideoStats {
1176
1296
  decoderOutputFrameRate: number;
1177
1297
 
1178
1298
  /**
1299
+ * @hidden
1179
1300
  * @brief Frame rate of rendering
1180
1301
  */
1181
1302
  rendererOutputFrameRate?: number;
@@ -1191,6 +1312,7 @@ export interface RemoteVideoStats {
1191
1312
  stallDuration?: number;
1192
1313
 
1193
1314
  /**
1315
+ * @hidden
1194
1316
  * @brief End-to-end delay, unit: ms
1195
1317
  */
1196
1318
  e2eDelay: number;
@@ -1211,11 +1333,13 @@ export interface RemoteVideoStats {
1211
1333
  rtt: number;
1212
1334
 
1213
1335
  /**
1336
+ * @hidden
1214
1337
  * @brief Video frozen rate
1215
1338
  */
1216
1339
  frozenRate?: number;
1217
1340
 
1218
1341
  /**
1342
+ * @hidden
1219
1343
  * @brief Video index
1220
1344
  */
1221
1345
  videoIndex?: number;
@@ -1303,16 +1427,10 @@ declare enum EngineEventsTypes {
1303
1427
  * @brief Connection state changes.
1304
1428
  */
1305
1429
  onConnectionStateChanged = "onConnectionStateChanged",
1306
-
1307
- /**
1308
- * @brief A new media stream in the room
1309
- */
1310
- onStreamAdd = "onStreamAdd",
1311
-
1312
- /**
1313
- * @brief A media stream in the room has been stopped.
1314
- */
1315
- onStreamRemove = "onStreamRemove",
1430
+ onUserPublishStream = "onUserPublishStream",
1431
+ onUserUnpublishStream = "onUserUnpublishStream",
1432
+ onUserPublishScreen = "onUserPublishScreen",
1433
+ onUserUnpublishScreen = "onUserUnpublishScreen",
1316
1434
 
1317
1435
  /**
1318
1436
  * @brief Receiving a broadcasting message in the room
@@ -1334,16 +1452,6 @@ declare enum EngineEventsTypes {
1334
1452
  */
1335
1453
  onUserBinaryMessageReceived = "onUserBinaryMessageReceived",
1336
1454
 
1337
- /**
1338
- * @brief A visible user in the room mutes his/her audio.
1339
- */
1340
- onUserMuteAudio = "onUserMuteAudio",
1341
-
1342
- /**
1343
- * @brief A visible user in the room mutes his/her video.
1344
- */
1345
- onUserMuteVideo = "onUserMuteVideo",
1346
-
1347
1455
  /**
1348
1456
  * @brief The first video frame has been rendered successfully.
1349
1457
  */
@@ -1375,9 +1483,14 @@ declare enum EngineEventsTypes {
1375
1483
  onFirstPublicStreamAudioFrameDecoded = "onFirstPublicStreamAudioFrameDecoded",
1376
1484
 
1377
1485
  /**
1378
- * @brief The state of the media device changes.
1486
+ * @brief The state of the video media device changes.
1487
+ */
1488
+ onVideoDeviceStateChanged = "onVideoDeviceStateChanged",
1489
+
1490
+ /**
1491
+ * @brief The state of the audio media device changes.
1379
1492
  */
1380
- onMediaDeviceStateChanged = "onMediaDeviceStateChanged",
1493
+ onAudioDeviceStateChanged = "onAudioDeviceStateChanged",
1381
1494
 
1382
1495
  /**
1383
1496
  * @brief Callback including the state of the remote media stream
@@ -1432,6 +1545,7 @@ declare enum EngineEventsTypes {
1432
1545
  * @brief The state of pushing streams to CDN
1433
1546
  */
1434
1547
  onLiveTranscodingResult = "onLiveTranscodingResult",
1548
+ onStreamMixingEvent = "onStreamMixingEvent",
1435
1549
  onAudioPlaybackDeviceTestVolume = "onAudioPlaybackDeviceTestVolume",
1436
1550
  onSEIMessageReceived = "onSEIMessageReceived",
1437
1551
  onError = "onError",
@@ -1441,7 +1555,31 @@ declare enum EngineEventsTypes {
1441
1555
  onTokenWillExpire = "onTokenWillExpire",
1442
1556
  onCloudProxyConnected = "onCloudProxyConnected",
1443
1557
  onPushPublicStreamResult = "onPushPublicStreamResult",
1444
- onPublicStreamSEIMessageReceived = "onPublicStreamSEIMessageReceived"
1558
+ onPublicStreamSEIMessageReceived = "onPublicStreamSEIMessageReceived",
1559
+ onNetworkQuality = "onNetworkQuality",
1560
+ onSimulcastSubscribeFallback = "onSimulcastSubscribeFallback",
1561
+ onRemoteVideoSizeChanged = "onRemoteVideoSizeChanged"
1562
+ }
1563
+
1564
+ /**
1565
+ * @brief Pushing a mixed stream to CDN events
1566
+ */
1567
+ export interface StreamMixingEvent {
1568
+
1569
+ /**
1570
+ * @brief The types. See [StreamMixingEventType](104481#streammixingeventtype).
1571
+ */
1572
+ event: StreamMixingEventType;
1573
+
1574
+ /**
1575
+ * @brief The error codes. See [StreamMixingEventErrorCode](104480#streammixingeventerrorcode).
1576
+ */
1577
+ error: StreamMixingEventErrorCode;
1578
+
1579
+ /**
1580
+ * @brief The detailed error messages.
1581
+ */
1582
+ message: string;
1445
1583
  }
1446
1584
 
1447
1585
  /**
@@ -1482,22 +1620,6 @@ export interface onSEIMessageReceivedEvent {
1482
1620
  remoteStreamKey: RemoteStreamKey;
1483
1621
  }
1484
1622
 
1485
- /**
1486
- * @brief User mutes audio or video.
1487
- */
1488
- export interface UserMuteEvent {
1489
-
1490
- /**
1491
- * @brief User information, refer to [UserInfo](#userinfo) for more details.
1492
- */
1493
- userInfo: UserInfo;
1494
-
1495
- /**
1496
- * @brief Details of disabling audio or video.
1497
- */
1498
- muteState: MuteState;
1499
- }
1500
-
1501
1623
  /**
1502
1624
  * @brief The connection state changes.
1503
1625
  */
@@ -1573,58 +1695,58 @@ export interface AudioMixingStateChangedEvent {
1573
1695
  }
1574
1696
 
1575
1697
  /**
1576
- * @brief Information about local audio <br>
1698
+ * @brief Information about local audio
1577
1699
  */
1578
1700
  export interface LocalAudioPropertiesInfo {
1579
1701
 
1580
1702
  /**
1581
- * @brief Indicates whether the audio is captured by microphone or from screen sharing. <br>
1703
+ * @brief Indicates whether the audio is captured by microphone or from screen sharing.
1582
1704
  */
1583
1705
  streamIndex: StreamIndex;
1584
1706
 
1585
1707
  /**
1586
1708
  * @type keytype
1587
- * @brief Audio information <br>
1709
+ * @brief Audio information
1588
1710
  */
1589
1711
  audioPropertiesInfo: AudioPropertiesInfo;
1590
1712
  }
1591
1713
 
1592
1714
  /**
1593
- * @brief Information about remote audio <br>
1715
+ * @brief Information about remote audio
1594
1716
  */
1595
1717
  export interface RemoteAudioPropertiesInfo {
1596
1718
 
1597
1719
  /**
1598
- * @brief Information about remote stream <br>
1720
+ * @brief Information about remote stream
1599
1721
  */
1600
1722
  streamKey: StreamKey;
1601
1723
 
1602
1724
  /**
1603
- * @brief Information about remote audio properties <br>
1725
+ * @brief Information about remote audio properties
1604
1726
  */
1605
1727
  audioPropertiesInfo: AudioPropertiesInfo;
1606
1728
  }
1607
1729
 
1608
1730
  /**
1609
- * @brief Audio information <br>
1731
+ * @brief Audio information
1610
1732
  */
1611
1733
  export interface AudioPropertiesInfo {
1612
1734
 
1613
1735
  /**
1614
- * @brief linear volume. The value is in linear relation to the original volume. The higher the value, the higher the volume. The range is [0,255]. <br>
1615
- * - [0, 25]: Silence <br>
1616
- * - [26, 75]: Low volume <br>
1617
- * - [76, 204]: Medium volume <br>
1618
- * - [205, 255]: High volume <br>
1736
+ * @brief linear volume. The value is in linear relation to the original volume. The higher the value, the higher the volume. The range is [0,255].
1737
+ * - [0, 25]: Silence
1738
+ * - [26, 75]: Low volume
1739
+ * - [76, 204]: Medium volume
1740
+ * - [205, 255]: High volume
1619
1741
  */
1620
1742
  linearVolume: number;
1621
1743
 
1622
1744
  /**
1623
- * @brief non-linear volume in dB. The value is in proportion to the log value of the original volume. You can use the value to recognize the Active Speaker in the room. The range is [-127, 0]. <br>
1624
- * - [-127, -60]: Silence <br>
1625
- * - [-59, -40]: Low volume <br>
1626
- * - [-39, -20]: Medium volume <br>
1627
- * - [-19, 0]: High volume <br>
1745
+ * @brief non-linear volume in dB. The value is in proportion to the log value of the original volume. You can use the value to recognize the Active Speaker in the room. The range is [-127, 0].
1746
+ * - [-127, -60]: Silence
1747
+ * - [-59, -40]: Low volume
1748
+ * - [-39, -20]: Medium volume
1749
+ * - [-19, 0]: High volume
1628
1750
  */
1629
1751
  nonlinearVolume: number;
1630
1752
  }
@@ -1645,10 +1767,42 @@ export interface StreamKey {
1645
1767
  userId: string;
1646
1768
 
1647
1769
  /**
1648
- * @brief Indicates whether the audio is captured by microphone or from screen sharing. <br>
1770
+ * @brief Indicates whether the audio is captured by microphone or from screen sharing.
1649
1771
  */
1650
1772
  streamIndex: StreamIndex;
1651
1773
  }
1774
+ declare enum StreamMixingEventErrorCode {
1775
+
1776
+ /**
1777
+ * @brief Success.
1778
+ */
1779
+ ERR_OK = 0,
1780
+
1781
+ /**
1782
+ * @brief Failure. Invalid configuration parameters.
1783
+ */
1784
+ ERR_PARAM_INVALID = 1,
1785
+
1786
+ /**
1787
+ * @brief RTC connection failure. The RTC server will be auto-reconnected.
1788
+ */
1789
+ ERR_FRAME_TIMEOUT = 2,
1790
+
1791
+ /**
1792
+ * @brief Errors occur during stream mixing. Please retry your request.
1793
+ */
1794
+ ERR_POSTPROCESS = 3,
1795
+
1796
+ /**
1797
+ * @brief Failure. Please wait for a re-push.
1798
+ */
1799
+ ERR_PUSH_CDN = 4,
1800
+
1801
+ /**
1802
+ * @brief Other unknown errors.
1803
+ */
1804
+ ERR_UNKNOWN = 9999
1805
+ }
1652
1806
 
1653
1807
  /**
1654
1808
  * @list 104477
@@ -1685,35 +1839,80 @@ export interface IEngineEvents {
1685
1839
  [EngineEventsTypes.onConnectionStateChanged]: (event: ConnectionStateChangeEvent) => void;
1686
1840
 
1687
1841
  /**
1688
- * @brief A new stream added into the room.
1689
- * @param event `stream` object.
1690
- * @region Room Management Event
1842
+ * @brief Callback on new media streams captured by camera/microphone in the room.
1843
+ * @notes You will receive this callback after a remote user successfully publishes media streams captured by camera/microphone in the room with [publishStream](#publishstream). Then you can choose whether to call [subscribeStream](#subscribeStream) to subscribe to the streams or not.
1691
1844
  */
1692
- [EngineEventsTypes.onStreamAdd]: (event: {
1693
- stream: RTCStream;
1845
+ [EngineEventsTypes.onUserPublishStream]: (event: {
1846
+
1847
+ /**
1848
+ * @brief ID of the remote user who published the stream
1849
+ */
1850
+ userId: string;
1851
+
1852
+ /**
1853
+ * @brief Remote stream type
1854
+ */
1855
+ mediaType: MediaType;
1694
1856
  }) => void;
1695
1857
 
1696
1858
  /**
1697
- * @brief Users will receive this event when a user in the room pauses/ resumes publishing audio stream.
1698
- * @param event
1699
- * @region Room Management Event
1859
+ * @brief Callback on removal of remote media stream captured by camera/microphone.
1860
+ * @notes You will receive this callback after a remote user successfully unpublishes media streams captured by camera/microphone in the room with [publishStream](#publishstream). Then you can choose whether to call [unsubscribeStream](#unsubscribeStream) to unsubscribe from the streams or not.
1700
1861
  */
1701
- [EngineEventsTypes.onUserMuteAudio]: (event: UserMuteEvent) => void;
1862
+ [EngineEventsTypes.onUserUnpublishStream]: (event: {
1863
+
1864
+ /**
1865
+ * @brief ID of the remote user who removed the stream
1866
+ */
1867
+ userId: string;
1868
+
1869
+ /**
1870
+ * @brief Remote stream type
1871
+ */
1872
+ mediaType: MediaType;
1873
+
1874
+ /**
1875
+ * @brief The reason for the removal
1876
+ */
1877
+ reason: StreamRemoveReason;
1878
+ }) => void;
1702
1879
 
1703
1880
  /**
1704
- * @brief Users will receive this event when a user in the room pauses/ resumes publishing video stream.
1705
- * @region Room Management Event
1706
- * @param event
1881
+ * @brief Callback on new screen sharing media streams from remote users in the room.
1882
+ * @notes You will receive this callback after a remote user successfully published screen sharing streams in the room with [publishScreen](#publishscreen). Then you can choose whether to call [subscribeScreen](#subscribeScreen) to subscribe to the streams or not.
1707
1883
  */
1708
- [EngineEventsTypes.onUserMuteVideo]: (event: UserMuteEvent) => void;
1884
+ [EngineEventsTypes.onUserPublishScreen]: (event: {
1885
+
1886
+ /**
1887
+ * @brief ID of the remote user who published the stream
1888
+ */
1889
+ userId: string;
1890
+
1891
+ /**
1892
+ * @brief Remote stream type
1893
+ */
1894
+ mediaType: MediaType;
1895
+ }) => void;
1709
1896
 
1710
1897
  /**
1711
- * @brief Users will receive this event when a user in the room pauses/ resumes publishing audio stream.
1712
- * @param event <li>stream: media stream</li><li>reason</li>.
1713
- * @region Room Management Event
1898
+ * @brief Callback on removal of screen sharing media streams from remote users in the room.
1899
+ * @notes You will receive this callback after a remote user successfully unpublishes media streams captured by camera/microphone in the room with [publishScreen](#publishscreen). Then you can choose whether to call [unsubscribeScreen](#unsubscribeScreen) to unsubscribe from the streams or not.
1714
1900
  */
1715
- [EngineEventsTypes.onStreamRemove]: (event: {
1716
- stream: RTCStream;
1901
+ [EngineEventsTypes.onUserUnpublishScreen]: (event: {
1902
+
1903
+ /**
1904
+ * @brief ID of the remote user who removed the stream
1905
+ */
1906
+ userId: string;
1907
+
1908
+ /**
1909
+ * @brief Remote stream type
1910
+ */
1911
+ mediaType: MediaType;
1912
+
1913
+ /**
1914
+ * @brief The reason for the removal
1915
+ */
1717
1916
  reason: StreamRemoveReason;
1718
1917
  }) => void;
1719
1918
 
@@ -1739,11 +1938,16 @@ export interface IEngineEvents {
1739
1938
  [EngineEventsTypes.onAudioFirstFrameDecoded]: (event: onAudioFirstFrameDecodedEvent) => void;
1740
1939
 
1741
1940
  /**
1742
- * @brief Event of media device state changing
1743
- * @param event Media device and its state
1744
- * @region Engine Management Event
1941
+ * @brief Event of video device state changing.
1942
+ * @param event Information and state of a media device.
1745
1943
  */
1746
- [EngineEventsTypes.onMediaDeviceStateChanged]: (event: RTCDevice) => void;
1944
+ [EngineEventsTypes.onVideoDeviceStateChanged]: (event: DeviceInfo) => void;
1945
+
1946
+ /**
1947
+ * @brief Event of audio device state changing.
1948
+ * @param event Information and state of a media device.
1949
+ */
1950
+ [EngineEventsTypes.onAudioDeviceStateChanged]: (event: DeviceInfo) => void;
1747
1951
 
1748
1952
  /**
1749
1953
  * @brief Failure of automatically playing
@@ -1754,31 +1958,55 @@ export interface IEngineEvents {
1754
1958
 
1755
1959
  /**
1756
1960
  * @brief Event of media track ending
1757
- * @param event <li>kind: string Type of the track</li><li>isScreen: boolean Whether it is a screen-sharing stream</li>
1961
+ * @param event
1758
1962
  * @region Video Management Event
1759
1963
  */
1760
1964
  [EngineEventsTypes.onTrackEnded]: (event: {
1965
+
1966
+ /**
1967
+ * @brief Type of the trac
1968
+ */
1761
1969
  kind: string;
1970
+
1971
+ /**
1972
+ * @brief Whether it is a screen-sharing stream.
1973
+ */
1762
1974
  isScreen: boolean;
1763
1975
  }) => void;
1764
1976
 
1765
1977
  /**
1766
1978
  * @brief Event of receiving a broadcast text message in the room
1767
- * @param event <li>userId: string userID of the message sender</li><li>message: Contents of the message</li>
1979
+ * @param event
1768
1980
  * @region Message Event
1769
1981
  */
1770
1982
  [EngineEventsTypes.onRoomMessageReceived]: (event: {
1983
+
1984
+ /**
1985
+ * @brief userID of the message sender.
1986
+ */
1771
1987
  userId: string;
1988
+
1989
+ /**
1990
+ * @brief Contents of the message.
1991
+ */
1772
1992
  message: any;
1773
1993
  }) => void;
1774
1994
 
1775
1995
  /**
1776
1996
  * @brief Event of receiving a broadcast binary message in the room
1777
- * @param event <li>userId: string userID of the message sender</li><li>message: any Contents of the message</li>
1997
+ * @param event
1778
1998
  * @region Message Event
1779
1999
  */
1780
2000
  [EngineEventsTypes.onRoomBinaryMessageReceived]: (event: {
2001
+
2002
+ /**
2003
+ * @brief userID of the message sender
2004
+ */
1781
2005
  userId: string;
2006
+
2007
+ /**
2008
+ * @brief Contents of the message
2009
+ */
1782
2010
  message: ArrayBuffer;
1783
2011
  }) => void;
1784
2012
 
@@ -1811,7 +2039,7 @@ export interface IEngineEvents {
1811
2039
  [EngineEventsTypes.onLocalStreamStats]: (stats: LocalStreamStats) => void;
1812
2040
 
1813
2041
  /**
1814
- * @brief Subscribed public stream's statistics and network condition, reference period 2s.
2042
+ * @brief This 2 s periodical callback notifies information of the public stream after calling [startPlayPublicStream](104478#startplaypublicstream).
1815
2043
  * @param stats
1816
2044
  */
1817
2045
  [EngineEventsTypes.onPublicStreamStats]: (stats: PublicStreamStats) => void;
@@ -1821,69 +2049,88 @@ export interface IEngineEvents {
1821
2049
  * @deprecated since 4.42, use onLocalAudioPropertiesReport and onRemoteAudioPropertiesReport instead.
1822
2050
  * @brief Volume of each of the users in the room
1823
2051
  * If the user has not joined a room, the list will only include volume of `local_user`.
1824
- * @param event Active user in the room and his/her volume.
2052
+ * @param event
1825
2053
  * @region Room Event
1826
2054
  */
1827
2055
  [EngineEventsTypes.onAudioVolumeIndication]: (event: {
2056
+
2057
+ /**
2058
+ * @brief Active user in the room and his/her volume.
2059
+ */
1828
2060
  speakers: AudioVolumeInfo[];
1829
2061
  }) => void;
1830
2062
 
1831
2063
  /**
1832
- * @brief After calling [enableAudioPropertiesReport](104478#enableAudioPropertiesReport), you will periodically receive this callback for the information about local audio. <br>
1833
- * Local audio includes the microphone audio and the screen audio captured using RTC SDK internal mechanisms. <br>
1834
- * @param event Information about local audio. <br>
1835
- * @region Audio Managment <br>
2064
+ * @brief After calling [enableAudioPropertiesReport](104478#enableAudioPropertiesReport), you will periodically receive this callback for the information about local audio.
2065
+ * Local audio includes the microphone audio and the screen audio captured using RTC SDK internal mechanisms.
2066
+ * @param event Information about local audio.
2067
+ * @region Audio Managment
1836
2068
  */
1837
2069
  [EngineEventsTypes.onLocalAudioPropertiesReport]: (event: LocalAudioPropertiesInfo[]) => void;
1838
2070
 
1839
2071
  /**
1840
- * @brief After calling [enableAudioPropertiesReport](104478#enableAudioPropertiesReport), you will periodically receive this callback for the information about the subscribed remote audio streams. <br>
1841
- * The remote audio streams includes the microphone audio and screen audio collected using the RTC SDK internal mechanism/custom mechanism. <br>
1842
- * @param event Information about remote audio. <br>
2072
+ * @brief After calling [enableAudioPropertiesReport](104478#enableAudioPropertiesReport), you will periodically receive this callback for the information about the subscribed remote audio streams.
2073
+ * The remote audio streams includes the microphone audio and screen audio collected using the RTC SDK internal mechanism/custom mechanism.
2074
+ * @param event Information about remote audio.
1843
2075
  * @region Audio Management
1844
2076
  */
1845
2077
  [EngineEventsTypes.onRemoteAudioPropertiesReport]: (event: RemoteAudioPropertiesInfo[]) => void;
1846
2078
 
1847
2079
  /**
1848
2080
  * @brief The current playback device has been changed successfully by calling [setAudioPlaybackDevice](104478#setAudioPlaybackDevice).
1849
- * @param event Information of the media devices. Refer to the [official documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaDeviceInfo) for more details.
1850
- * @region Audio Management Event
2081
+ * @param event Information of the media devices. See [MediaDeviceInfo](https://developer.mozilla.org/en-US/docs/Web/API/MediaDeviceInfo).
1851
2082
  */
1852
- [EngineEventsTypes.onAudioPlaybackDeviceChanged]: (event: RTCDevice) => void;
2083
+ [EngineEventsTypes.onAudioPlaybackDeviceChanged]: (event: MediaDeviceInfo) => void;
1853
2084
 
1854
2085
  /**
1855
2086
  * @brief The remote clients in the room will be informed of the state change via this event after the publisher starts audio capture by calling [startAudioCapture](104478#startAudioCapture).
1856
- * @param event `userId: string` The publisher who starts the internal audio capture
2087
+ * @param event
1857
2088
  * @region Audio Management Event
1858
2089
  */
1859
2090
  [EngineEventsTypes.onUserStartAudioCapture]: (event: {
2091
+
2092
+ /**
2093
+ * @brief The publisher who starts the internal audio capture
2094
+ */
1860
2095
  userId: string;
1861
2096
  }) => void;
1862
2097
 
1863
2098
  /**
1864
2099
  * @brief The remote clients in the room will be informed of the state change via this event after the publisher stops audio capture by calling [stopAudioCapture](104478#stopAudioCapture).
1865
- * @param event `userId: string` userId of the publisher who stops the internal audio capture
2100
+ * @param event
1866
2101
  * @region Room Management Event
1867
2102
  */
1868
2103
  [EngineEventsTypes.onUserStopAudioCapture]: (event: {
2104
+
2105
+ /**
2106
+ * @brief The userId of the publisher who stops the internal audio capture.
2107
+ */
1869
2108
  userId: string;
1870
2109
  }) => void;
1871
2110
 
1872
2111
  /**
1873
2112
  * @brief The remote clients in the room will be informed of the state change via this event after the publisher starts video capture by calling [startVideoCapture](104478#startVideoCapture).
1874
- * @param event `userId: string` userId of the publisher who starts the internal video capture
2113
+ * @param event
1875
2114
  * @region Room Management Event
1876
2115
  */
1877
2116
  [EngineEventsTypes.onUserStartVideoCapture]: (event: {
2117
+
2118
+ /**
2119
+ * @brief The userId of the publisher who starts the internal video capture.
2120
+ */
1878
2121
  userId: string;
1879
2122
  }) => void;
1880
2123
 
1881
2124
  /**
1882
2125
  The remote clients in the room will be informed of the state change via this event after the publisher stops video capture by calling [stopVideoCapture](104478#stopVideoCapture).
1883
- * @param event `userId: string` userId of the publisher who stops the internal video capture
2126
+ * @param event
1884
2127
  * @region Room Management Event
1885
2128
  */
1886
2129
  [EngineEventsTypes.onUserStopVideoCapture]: (event: {
2130
+
2131
+ /**
2132
+ * @brief The userId of the publisher who stops the internal video capture.
2133
+ */
1887
2134
  userId: string;
1888
2135
  }) => void;
1889
2136
 
@@ -1896,22 +2143,42 @@ export interface IEngineEvents {
1896
2143
 
1897
2144
  /**
1898
2145
  * @brief Result of the Auto-Subscription
1899
- * @param event <li>`userId: string` userId of the publisher to be subscribed</li><li>`isScreen: boolean` Wether it is a screen-sharing stream</li><li>`state: SubscribeState` </li>
2146
+ * @param event
1900
2147
  * @region Room Management Event
1901
2148
  */
1902
2149
  [EngineEventsTypes.onAutoSubscribeResult]: (event: {
2150
+
2151
+ /**
2152
+ * @brief The userId of the publisher to be subscribed
2153
+ */
1903
2154
  userId: string;
2155
+
2156
+ /**
2157
+ * @brief Wether it is a screen-sharing stream
2158
+ */
1904
2159
  isScreen: boolean;
2160
+
2161
+ /**
2162
+ * @brief Subscription state.
2163
+ */
1905
2164
  state: SubscribeState;
1906
2165
  }) => void;
1907
2166
 
1908
2167
  /**
1909
2168
  * @brief Result of Auto-publishing. You will receive this event if you enable Auto-publish when calling `joinRoom`
1910
- * @param event <li>`isScreen: boolean` Wether it is a screen-sharing stream </li><li>`state: PublishState` </li>
2169
+ * @param event
1911
2170
  * @region Room Management Event
1912
2171
  */
1913
2172
  [EngineEventsTypes.onAutoPublishResult]: (event: {
2173
+
2174
+ /**
2175
+ * @brief Wether it is a screen-sharing stream
2176
+ */
1914
2177
  isScreen: boolean;
2178
+
2179
+ /**
2180
+ * @brief Publish state.
2181
+ */
1915
2182
  state: PublishState;
1916
2183
  }) => void;
1917
2184
 
@@ -1923,6 +2190,8 @@ export interface IEngineEvents {
1923
2190
  [EngineEventsTypes.onAutoplayFailed]: (event: PlayerEvent) => void;
1924
2191
 
1925
2192
  /**
2193
+ * @hidden
2194
+ * @deprecated since 4.44, use onStreamMixingEvent instead.
1926
2195
  * @brief Result of the Pushing stream to CDN
1927
2196
  * @param event
1928
2197
  * @region Advanced Feature Event
@@ -1931,11 +2200,15 @@ export interface IEngineEvents {
1931
2200
 
1932
2201
  /**
1933
2202
  * @brief event of error
1934
- * @param event The reason why the current user has been removed from the room.
2203
+ * @param event
1935
2204
  * @region Room Management Event
1936
2205
  */
1937
2206
  [EngineEventsTypes.onError]: (event: {
1938
- errorCode: ErrorCode.DUPLICATE_LOGIN | ErrorCode.RTM_DUPLICATE_LOGIN | ErrorCode.RTM_TOKEN_ERROR | ErrorCode.EXPIRED_TOKEN;
2207
+
2208
+ /**
2209
+ * @brief The reason why the current user has been removed from the room.
2210
+ */
2211
+ errorCode: ErrorCode.DUPLICATE_LOGIN | ErrorCode.RTM_DUPLICATE_LOGIN | ErrorCode.RTM_TOKEN_ERROR | ErrorCode.EXPIRED_TOKEN | ErrorCode.RECONNECT_FAILED;
1939
2212
  }) => void;
1940
2213
 
1941
2214
  /**
@@ -2005,6 +2278,7 @@ export interface IEngineEvents {
2005
2278
 
2006
2279
  /**
2007
2280
  * @brief Callback of the successful rendering of the first video frame of the public stream.
2281
+ * Refer to [startPlayPublicStream](104478#startplaypublicstream) for details about subscribing to a public stream.
2008
2282
  * @param event
2009
2283
  */
2010
2284
  [EngineEventsTypes.onFirstPublicStreamVideoFrameRendered]: (event: PublicStreamAudioFirstFrameDecodedEvent) => void;
@@ -2015,28 +2289,61 @@ export interface IEngineEvents {
2015
2289
  * @notes Start an audio-device test by calling [startAudioPlaybackDeviceTest](104478#startaudioplaybackdevicetest) or [startAudioDeviceRecordTest](104478#startaudiodevicerecordtest) will register this callback for regular notification on playing volume. You can set the time interval between each callback by passing a proper value when calling the API above.
2016
2290
  */
2017
2291
  [EngineEventsTypes.onAudioPlaybackDeviceTestVolume]: (volume: number) => void;
2018
- }
2019
-
2020
- /**
2021
- * @brief Cloud proxy informatio
2022
- */
2023
- export interface CloudProxyInfo {
2024
2292
 
2025
2293
  /**
2026
- * @brief The cloud proxy IP of log report
2294
+ * @brief The callback reports the network quality of the local user every 2s after the user enters the room.
2027
2295
  */
2028
- logProxy: string;
2296
+ [EngineEventsTypes.onNetworkQuality]: (
2029
2297
 
2030
2298
  /**
2031
- * @brief The cloud proxy IP of the access
2299
+ * @brief Upstream network quality
2032
2300
  */
2033
- accessProxy: string;
2301
+ uplinkNetworkQuality: NetworkQuality,
2034
2302
 
2035
2303
  /**
2036
- * @brief The cloud proxy IP of RTC admin control
2304
+ * @brief Downstream network quality
2037
2305
  */
2038
- configProxy: string;
2039
- }
2306
+ downlinkNetworkQuality: NetworkQuality) => void;
2307
+
2308
+ /**
2309
+ * @brief Receives this callback when fallback happens or the stream recovers from fallback.
2310
+ * @param event Information about stream switching
2311
+ */
2312
+ [EngineEventsTypes.onSimulcastSubscribeFallback]: (event: RemoteStreamSwitch) => void;
2313
+
2314
+ /**
2315
+ * @brief When the resolution of remote video changes, users who subscribed to the stream will receive this callback.
2316
+ */
2317
+ [EngineEventsTypes.onRemoteVideoSizeChanged]: (
2318
+
2319
+ /**
2320
+ * @brief Information of the remote stream
2321
+ */
2322
+ key: RemoteStreamKey,
2323
+
2324
+ /**
2325
+ * @brief Information of video frame
2326
+ */
2327
+ info: {
2328
+
2329
+ /**
2330
+ * @brief Width(pixel)
2331
+ */
2332
+ width: number;
2333
+
2334
+ /**
2335
+ * @brief Height(pixel)
2336
+ */
2337
+ height: number;
2338
+ }) => void;
2339
+
2340
+ /**
2341
+ * @brief Pushing a mixed stream to CDN events
2342
+ * @param event
2343
+ * @region Push to CDN
2344
+ */
2345
+ [EngineEventsTypes.onStreamMixingEvent]: (event: StreamMixingEvent) => void;
2346
+ }
2040
2347
 
2041
2348
  /**
2042
2349
  * @list 104477
@@ -2045,142 +2352,176 @@ export interface CloudProxyInfo {
2045
2352
  export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2046
2353
 
2047
2354
  /**
2048
- * @brief Join the room. <br>
2049
- * Call this method to join the room and make audio & video calls with other users in the room. <br>
2050
- * @param token Dynamic key. It is used for authentication and verification of users entering the room. <br>
2051
- * You need to bring Token to enter the room. When testing, you can use the console to generate temporary tokens. The official launch requires the use of the key SDK to generate and issue tokens at your server level. <br>
2052
- * Apps with different AppIDs are not interoperable. <br>
2053
- * Make sure that the AppID used to generate the Token is the same as the AppID used to create the engine, otherwise it will cause the join room to fail. <br>
2054
- * @param roomId The ID of the room to be added. <br>
2055
- * The room ID is a non-empty string with a length of less than 128 bytes, and the following character set ranges are supported: <br>
2056
- * 1. 26 capital letters A~ Z. <br>
2057
- * 2. 26 lowercase letters a~ z. <br>
2058
- * 3. 10 numbers 0~ 9. <br>
2059
- * 4. Underscore "_", the at sign "@", and the minus sign "-". <br>
2355
+ * @brief Join the room.
2356
+ * Call this method to join the room and make audio & video calls with other users in the room.
2357
+ * @param token Dynamic key. It is used for authentication and verification of users entering the room.
2358
+ * You need to bring Token to enter the room. When testing, you can use the console to generate temporary tokens. The official launch requires the use of the key SDK to generate and issue tokens at your server level.
2359
+ * Apps with different AppIDs are not interoperable.
2360
+ * Make sure that the AppID used to generate the Token is the same as the AppID used to create the engine, otherwise it will cause the join room to fail.
2361
+ * @param roomId The ID of the room to be added.
2362
+ * The room ID is a non-empty string with a length of less than 128 bytes, and the following character set ranges are supported:
2363
+ * 1. 26 capital letters A~ Z.
2364
+ * 2. 26 lowercase letters a~ z.
2365
+ * 3. 10 numbers 0~ 9.
2366
+ * 4. Underscore "_", the at sign "@", and the minus sign "-".
2060
2367
  * @param userInfo User information.
2061
2368
  * @param roomConfig Room parameter configuration, set the room mode and whether to automatically publish or subscribe to the flow.
2062
2369
  * @return
2063
2370
  * @notes + In the same room with the same App ID, the user ID of each user must be unique. The user will be kicked out of the room when a user with the same userID joins the room because of the error of `DUPLICATE_LOGIN`.
2064
- * + Remote users will receive [onUserJoined](104479#onuserjoined) callback when a visible user joins the room. Call [setUserVisibility](#setuservisibility) to switch the visibility of the user. <br>
2065
- * + 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. <br>
2371
+ * + Remote users will receive [onUserJoined](104479#onuserjoined) callback when a visible user joins the room. Call [setUserVisibility](#setuservisibility) to switch the visibility of the user.
2372
+ * + 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.
2066
2373
  * @region Room Management
2067
2374
  */
2068
- joinRoom(token: string | null, roomId: string, userInfo: UserInfo, roomConfig: RoomConfig): Promise<void>;
2375
+ joinRoom(token: string | null, roomId: string, userInfo: UserInfo, roomConfig?: RoomConfig): Promise<void>;
2069
2376
 
2070
2377
  /**
2071
- * @brief Leave the room. <br>
2072
- * The user calls this API to leave the room, end the call process, and release all call-related resources. <br>
2073
- * @notes + After visible users leave the room, other users in the room will receive [onUserLeave](104479#onuserleave) callback notification. <br>
2074
- * + 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. <br>
2378
+ * @brief Leave the room.
2379
+ * The user calls this API to leave the room, end the call process, and release all call-related resources.
2380
+ * @notes + After visible users leave the room, other users in the room will receive [onUserLeave](104479#onuserleave) callback notification.
2381
+ * + 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.
2075
2382
  * @region Room Management
2076
2383
  */
2077
2384
  leaveRoom(waitAck?: boolean): Promise<void>;
2078
2385
 
2079
2386
  /**
2080
2387
  * @brief Destroy engine
2081
- * Destroy the engine instances created by calling [createEngine](#createengine) and release all related resources <br>
2082
- * @notes + Make sure that the business scenarios related to the `RTCEngine` instances that need to be destroyed are all finished before calling this API. <br>
2083
- * + Calling this API will destroy all memory related to this `RTCEngine` instance, and stop any interaction with the media server. <br>
2084
- * + 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. <br>
2388
+ * Destroy the engine instances created by calling [createEngine](#createengine) and release all related resources.
2389
+ * @notes + Make sure that the business scenarios related to the `RTCEngine` instances that need to be destroyed are all finished before calling this API.
2390
+ * + Calling this API will destroy all memory related to this `RTCEngine` instance, and stop any interaction with the media server.
2391
+ * + 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.
2085
2392
  * @region Engine Management
2086
2393
  */
2087
2394
  destroy(): void;
2088
2395
 
2089
2396
  /**
2090
- * @brief Start publishing media streams.
2091
- * @return
2092
- * @notes + Call this API to publish media streams only when you have disabled Auto-Publish when calling [joinRoom](#joinroom).
2093
- * + An invisible user can not publish media streams. Call [setUserVisibility](#setuservisibility) to change the visibility of a user.
2094
- * + Users can only publish media streams in one room at the same time. Call [publishScreen](#publishscreen) to start screen sharing.
2095
- * + After publishing media streams by calling this API, other users in the room will be informed via [onStreamAdd](104479#onstreamadd).
2096
- * @region Media Transmission
2397
+ * @brief Publishes media streams captured by camera/microphone in the current room.
2398
+ * @param mediaType Media stream type, used for specifying whether to publish audio stream or video stream.
2399
+ * @notes + Streams are not published automatically in multi-room mode by default, you need to call this API to publish streams manually. <br>
2400
+ * + An invisible user cannot publish media streams. Call [setUserVisibility](#setuservisibility) to change your visibility in the room. <br>
2401
+ * + Call [publishScreen](#publishscreen) to start screen sharing. <br>
2402
+ * + After you call this API, the other users in the room will receive [onUserPublishStream](104479#onuserpublishstream). Those who successfully received your streams will receive [onAudioFirstFrameDecoded](104479#onaudiofirstframedecoded)/[onVideoFirstFrameDecoded](104479#onvideofirstframedecoded) at the same time. <br>
2403
+ * + Call [unpublishStream](#unpublishstream) to stop publishing streams.
2404
+ * @region Room Management
2097
2405
  */
2098
- publish(): Promise<void>;
2406
+ publishStream(mediaType: MediaType): Promise<void>;
2099
2407
 
2100
2408
  /**
2101
- * @brief Stops publishing local media streams in the room.
2102
- * @return
2103
- * @notes + Call this API to stop publishing either started by calling [publish](#publish) or enabling Auto-Publish.
2104
- * + After stopping publishing media streams by calling this API, other users in the room will be informed via [onStreamRemove](104479#onstreamremove).
2105
- * @region Media Transmission
2409
+ * @brief Stops publishing media streams captured by camera/microphone in the current room.
2410
+ * @param mediaType Media stream type, used for specifying whether to stop publishing audio stream or video stream.
2411
+ * @notes + After calling [publishStream](#publishstream), call this API to stop publishing streams. <br>
2412
+ * + After calling this API, the other users in the room will receive [onUserUnpublishStream](104479#onuserunpublishstream).
2413
+ * @region Room Management
2106
2414
  */
2107
- unpublish(): Promise<void>;
2415
+ unpublishStream(mediaType: MediaType): Promise<void>;
2108
2416
 
2109
2417
  /**
2110
- * @brief Subscribe to media streams in the room. <br>
2111
- * Call this API to subscribe to media streams in the room regardless of subscription mode, either Auto or Manual. <br>
2112
- * Call this API to update the properties and configurations of the stream you have already subscribed to.
2113
- * @param userId User ID of the publisher of the subscribed media stream
2114
- * @param mediaType Mainstream or screen-sharing stream.
2115
- * @param streamType Media stream type to be subscribed to.
2116
- * @param configure Subscription configuration of video streams.
2117
- * @return
2118
- * @notes + Get the media stream information in the room from [onStreamAdd](104479#onstreamadd) and [onStreamRemove](104479#onstreamremove). <br>
2119
- * + You can update the subscription configuration by calling the API even after calling [pauseAllSubscribedStream](#pauseallsubscribedstream) to pause streaming. Call [resumeAllSubscribedStream](#resumeallsubscribedstream) to resume streaming and apply the changes.
2120
- * @region Media Transmission
2418
+ * @brief Publishes local screen sharing streams in the current room.
2419
+ * @param mediaType Media stream type, used for specifying whether to publish audio stream or video stream.
2420
+ * @notes + An invisible user cannot publish media streams. Call [setUserVisibility](#setuservisibility) to change your visibility in the room. <br>
2421
+ * + After you called this API, the other users in the room will receive [onUserPublishScreen](104479#onuserpublishscreen). Those who successfully received your streams will receive [onAudioFirstFrameDecoded](104479#onaudiofirstframedecoded)/[onVideoFirstFrameDecoded](104479#onvideofirstframedecoded) at the same time. <br>
2422
+ * + Call [unpublishScreen](#unpublishscreen) to stop publishing screen sharing streams.
2423
+ * @region Screen Sharing
2121
2424
  */
2122
- subscribeUserStream(userId: string, mediaType: SubscribeMediaType, streamType?: StreamIndex, configure?: SubscribeVideoConfig): Promise<void>;
2425
+ publishScreen(mediaType: MediaType): Promise<void>;
2123
2426
 
2124
2427
  /**
2125
- * @brief Stop subscribing to media streams in the room. <br>
2126
- * You can call this API to unsubscribe to media streams regardless of automatic or manual subscription mode. <br>
2127
- * @param userId User ID of the publisher of the subscribed media stream
2128
- * @param isScreen Whether the stream unsubscribed is a screen-sharing stream. <br>
2129
- * @return
2130
- * @notes Call this API regardless of whether the media stream is subscribed to or not. When the `userId` is invalid or unsubscribed, the SDK will ignore the request without any negative effect.
2131
- * @region Media Transmission
2428
+ * @brief Stops publishing local screen sharing streams in the current room.
2429
+ * @param mediaType Media stream type, used for specifying whether to stop publishing audio stream or video stream.
2430
+ * @notes + After calling [publishScreen](#publishscreen), call this API to stop publishing streams. <br>
2431
+ * + After calling this API, the other users in the room will receive [onUserUnpublishScreen](104479#onuserunpublishscreen).
2432
+ * @region Screen Sharing
2132
2433
  */
2133
- unSubscribe(userId: string, isScreen: boolean): Promise<void>;
2434
+ unpublishScreen(mediaType: MediaType): Promise<void>;
2134
2435
 
2135
2436
  /**
2136
- * @brief Update Token. <br>
2437
+ * @brief Subscribes to specific remote media streams captured by camera/microphone. <br>
2438
+ * You can call this API in both automatic subscription mode and manual subscription mode.
2439
+ * @param userId The ID of the remote user who published the target audio/video stream.
2440
+ * @param mediaType Media stream type, used for specifying whether to subscribe to the audio stream or the video stream.
2441
+ * @notes + You must first get the remote stream information through onUserPublishStream{@link #IRTCRoomEventHandler#onUserPublishStream} before calling this API to subscribe to streams accordingly. <br>
2442
+ * + 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. <br>
2443
+ * @region Room Management
2444
+ */
2445
+ subscribeStream(userId: string, mediaType: MediaType): Promise<void>;
2446
+
2447
+ /**
2448
+ * @brief Unsubscribes from specific remote media streams captured by camera/microphone. <br>
2449
+ * You can call this API in both automatic subscription mode and manual subscription mode.
2450
+ * @param userId The ID of the remote user who published the target audio/video stream.
2451
+ * @param mediaType Media stream type, used for specifying whether to unsubscribe from the audio stream or the video stream.
2452
+ * @region Room Management
2453
+ */
2454
+ unsubscribeStream(userId: string, mediaType: MediaType): Promise<void>;
2455
+
2456
+ /**
2457
+ * @brief Subscribes to specific screen sharing media stream. <br>
2458
+ * You can call this API in both automatic subscription mode and manual subscription mode.
2459
+ * @param userId The ID of the remote user who published the target screen audio/video stream.
2460
+ * @param mediaType Media stream type, used for specifying whether to subscribe to the audio stream or the video stream.
2461
+ * @notes + You must first get the remote stream information through [onUserPublishScreen](104479#onuserpublishscreen) before calling this API to subscribe to streams accordingly. <br>
2462
+ * + 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. <br>
2463
+ * @region Room Management
2464
+ */
2465
+ subscribeScreen(userId: string, mediaType: MediaType): Promise<void>;
2466
+
2467
+ /**
2468
+ * @brief Unsubscribes from specific screen sharing media stream. <br>
2469
+ * You can call this API in both automatic subscription mode and manual subscription mode.
2470
+ * @param uid The ID of the remote user who published the target screen audio/video stream.
2471
+ * @param type Media stream type, used for specifying whether to unsubscribe from the audio stream or the video stream.
2472
+ * @region Room Management
2473
+ */
2474
+ unsubscribeScreen(userId: string, mediaType: MediaType): Promise<void>;
2475
+
2476
+ /**
2477
+ * @brief Update Token.
2137
2478
  * You will receive [onTokenWillExpire](104479#ontokenwillexpire) 30 s before the Token expires. Call this API to submit a new Token.
2138
- * @param token A valid token <br>
2139
- * @notes + If you call [joinRoom](#joinroom) with an expired token, the joining will fail with an error code `INVALID_TOKEN`. And you need to obtain a valid token and call this API to update the token. <br>
2140
- * + If joining a room failed because the token expired, call this API with an updated token. And then RTC SDK will automatically rejoin the room without calling [joinRoom](#joinroom) again. <br>
2479
+ * @param token A valid token.
2480
+ * @notes + If you call [joinRoom](#joinroom) with an expired token, the joining will fail with an error code `INVALID_TOKEN`. And you need to obtain a valid token and call this API to update the token.
2481
+ * + If joining a room failed because the token expired, call this API with an updated token. And then RTC SDK will automatically rejoin the room without calling [joinRoom](#joinroom) again.
2141
2482
  * + The user will be removed from the room when the Token expires.
2142
2483
  * @region Room Management
2143
2484
  */
2144
2485
  updateToken(token: string): void;
2145
2486
 
2146
2487
  /**
2147
- * @brief Switch the microphone used for internal audio capture <br>
2148
- * @param deviceId
2149
- * @region Device Management
2488
+ * @brief Switch the microphone used for internal audio capturing.
2489
+ * @param deviceId Device ID. Call [enumerateDevices](#enumeratedevices) to get the device list.
2490
+ * @return
2150
2491
  * @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.
2151
2492
  */
2152
- switchMicrophone(deviceId: string): Promise<void>;
2493
+ setAudioCaptureDevice(deviceId: string): Promise<void>;
2153
2494
 
2154
2495
  /**
2155
- * @brief Switch the camera used for internal video capture <br>
2156
- * The default camera to be used depends on the web browser.
2157
- * @param deviceId ID of the device need to enable which you can call [getDevices](#getdevices) to obtain.
2496
+ * @brief Switch the camera used for internal video capturing.
2497
+ * @param deviceId Device ID. Call [enumerateDevices](#enumeratedevices) to get the device list.
2158
2498
  * @return
2159
- * @notes If the internal video capturing is on, the switch is effective once you call this API. If the internal video capturing is off, the setting will be effective when capture starts.
2160
- * @region Device Management
2499
+ * @notes + If the internal video capturing is on, the switch is effective once you call this API. If the internal video capturing is off, the setting will be effective when capture starts.
2500
+ * + For mobile devices, set deviceId as `"user"` to use the front camera. Set deviceId as `"environment"` to use the rear camera.
2501
+ * + The default camera is set by the browser.
2161
2502
  */
2162
- switchCamera(deviceId: string): Promise<void>;
2503
+ setVideoCaptureDevice(deviceId: string): Promise<void>;
2163
2504
 
2164
2505
  /**
2165
2506
  * @brief Enable internal video capture. The default state is off.
2166
2507
  * Internal video capture refers to: capturing video using the built-in module.
2167
2508
  * The remote clients in the room will be informed of the state change via [onUserStartVideoCapture](104479#onuserstartvideocapture) after the publisher starts video capture by calling this API.
2168
- * @param deviceId ID of the device need to enable which you can call [getDevices](#getdevices) to obtain.
2509
+ * @param deviceId ID of the device need to enable which you can call [enumerateDevices](#enumeratedevices) to obtain.
2169
2510
  * @return The actual effective video capture parameters. See [MediaTrackSettings](https://developer.mozilla.org/en-US/docs/Web/API/MediaTrackConstraints). Pay attention to the properties: `frameRate`, `height`, and `width`.
2170
- * @notes + Call [stopVideoCapture](#stopvideocapture) to stop the internal video capture. Otherwise, the internal video capture will sustain until you destroy the engine instance.<br>
2171
- * + Once you create the engine instance, you can start internal video capture regardless of the video publishing state. The video stream will start publishing only after the video capture starts. <br>
2172
- * + Call [switchCamera](#switchcamera) to switch the camera used by the internal video capture module.<br>
2511
+ * @notes + Call [stopVideoCapture](#stopvideocapture) to stop the internal video capture. Otherwise, the internal video capture will sustain until you destroy the engine instance.
2512
+ * + Once you create the engine instance, you can start internal video capture regardless of the video publishing state. The video stream will start publishing only after the video capture starts.
2513
+ * + Call [setVideoCaptureDevice](#setvideocapturedevice) to switch the camera used by the internal video capture module.
2173
2514
  * @region Video Management
2174
2515
  */
2175
2516
  startVideoCapture(deviceId?: string): Promise<MediaTrackSettings>;
2176
2517
 
2177
2518
  /**
2178
- * @brief Enable internal video capture immediately. The default setting is off. <br>
2519
+ * @brief Enable internal video capture immediately. The default setting is off.
2179
2520
  * Internal video capture refers to: capturing video using the built-in module.
2180
- * The remote clients in the room will be informed of the state change via [onUserStopVideoCapture](104479#onuserstopvideocapture) after the publisher stops video capture by calling this API.<br>
2521
+ * The remote clients in the room will be informed of the state change via [onUserStopVideoCapture](104479#onuserstopvideocapture) after the publisher stops video capture by calling this API.
2181
2522
  * @return
2182
- * @notes + Call [startVideoCapture](#startvideocapture) to enable the internal video capture. <br>
2183
- * + Without calling this API the internal video capture will sustain until you destroy the engine instance.<br>
2523
+ * @notes + Call [startVideoCapture](#startvideocapture) to enable the internal video capture.
2524
+ * + Without calling this API the internal video capture will sustain until you destroy the engine instance.
2184
2525
  * @region Video Management
2185
2526
  */
2186
2527
  stopVideoCapture(): Promise<void>;
@@ -2189,21 +2530,21 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2189
2530
  * @brief Start internal audio capture. The default is off.
2190
2531
  * Internal audio capture refers to: capturing audio using the built-in module.
2191
2532
  * The remote clients in the room will be informed of the state change via [onUserStartAudioCapture](104479#onuserstartaudiocapture) after the publisher starts audio capture by calling this API.
2192
- * @param deviceId ID of the device need to enable which you can call [getDevices](#getdevices) to obtain.
2533
+ * @param deviceId ID of the device need to enable which you can call [enumerateDevices](#enumeratedevices) to obtain.
2193
2534
  * @return
2194
- * @notes + Call [stopAudioCapture](#stopaudiocapture) to stop the internal audio capture. Otherwise, the internal audio capture will sustain until you destroy the engine instance. <br>
2195
- * + 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. <br>
2535
+ * @notes + Call [stopAudioCapture](#stopaudiocapture) to stop the internal audio capture. Otherwise, the internal audio capture will sustain until you destroy the engine instance.
2536
+ * + 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.
2196
2537
  * @region Audio Management
2197
2538
  */
2198
2539
  startAudioCapture(deviceId?: string): Promise<void>;
2199
2540
 
2200
2541
  /**
2201
- * @brief Stop internal audio capture. The default is off. <br>
2542
+ * @brief Stop internal audio capture. The default is off.
2202
2543
  * Internal audio capture refers to: capturing audio using the built-in module.
2203
- * The remote clients in the room will be informed of the state change via [onUserStopAudioCapture](104479#onuserstopaudiocapture) after stopping audio capture by calling this API.<br>
2544
+ * The remote clients in the room will be informed of the state change via [onUserStopAudioCapture](104479#onuserstopaudiocapture) after stopping audio capture by calling this API.
2204
2545
  * @return
2205
- * @notes + Call [startAudioCapture](#startaudiocapture) to enable the internal audio capture. <br>
2206
- * + Without calling this API the internal audio capture will sustain until you destroy the engine instance.<br>
2546
+ * @notes + Call [startAudioCapture](#startaudiocapture) to enable the internal audio capture.
2547
+ * + Without calling this API the internal audio capture will sustain until you destroy the engine instance.
2207
2548
  * @region Audio Management
2208
2549
  */
2209
2550
  stopAudioCapture(): Promise<void>;
@@ -2212,9 +2553,9 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2212
2553
  * @brief Use the capture module provided by the RTC SDK to capture the current screen stream for sharing.
2213
2554
  * @param screenConfig Specify properties for the sharing screen.
2214
2555
  * @return
2215
- * @notes + Call this API will start screen stream video capture but will not publish the captured video. Publishing a screen-sharing stream by calling [publishScreen](#publishScreen). <br>
2216
- * + To turn off screen video source capture, call [stopScreenVideoCapture](#stopScreenVideoCapture). <br>
2217
- * + Before calling this API, you can call [setVideoEncoderConfig](#setvideoencoderconfig) to set the capture frame rate and encoding resolution of the screen video stream. <br>
2556
+ * @notes + Call this API will start screen stream video capture but will not publish the captured video. Publishing a screen-sharing stream by calling [publishScreen](#publishScreen).
2557
+ * + To turn off screen video source capture, call [stopScreenVideoCapture](#stopScreenVideoCapture).
2558
+ * + Before calling this API, you can call [setVideoEncoderConfig](#setvideoencoderconfig) to set the capture frame rate and encoding resolution of the screen video stream.
2218
2559
  * @region Advanced Feature
2219
2560
  */
2220
2561
  startScreenCapture(screenConfig?: ScreenConfig): Promise<void>;
@@ -2227,26 +2568,6 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2227
2568
  */
2228
2569
  stopScreenCapture(): Promise<void>;
2229
2570
 
2230
- /**
2231
- * @brief Publish screen-sharing streams.
2232
- * @return
2233
- * @notes + You must join the room before you can call this API. <br>
2234
- * + This API is only available to visible users.
2235
- * + After the call, the remote receives the [onStreamAdd](104479#onstreamadd) callback. <br>
2236
- * + Call [unpublishScreen](#unpublishscreen) to unpublish.
2237
- * @region Advanced Feature
2238
- */
2239
- publishScreen(): Promise<void>;
2240
-
2241
- /**
2242
- * @brief Stop publishing screen-sharing streams.
2243
- * @return
2244
- * @notes + To start publishing, call [publishScreen](#publishscreen). <br>
2245
- * + After the call, the remote receives the [onStreamRemove](104479#onstreamremove) callback.
2246
- * @region Advanced Feature
2247
- */
2248
- unpublishScreen(): Promise<void>;
2249
-
2250
2571
  /**
2251
2572
  * @brief Bind a view to the local media stream and set the rendering mode for the rendering of the local stream
2252
2573
  * Listen to `onPlayerEvent` for the state after binding a view to the local video stream.
@@ -2270,15 +2591,15 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2270
2591
  setRemoteVideoPlayer(streamIndex: StreamIndex, videoPlayerOption: VideoPlayerOption): HTMLVideoElement | undefined;
2271
2592
 
2272
2593
  /**
2273
- * @brief Enable or disable the mirror mode for the local video stream. <br>
2594
+ * @brief Enable or disable the mirror mode for the local video stream.
2274
2595
  * @param mirrorType Whether to turn on mirror mode.
2275
2596
  * @region Media Processing
2276
2597
  */
2277
2598
  setLocalVideoMirrorType(mirrorType: MirrorType): void;
2278
2599
 
2279
2600
  /**
2280
- * @brief Sets the speaker or the earpiece as the audio playback device. The audio playback device defaults to the speaker. <br>
2281
- * @param deviceId ID of the audio playback device. Call [getDevices](#getdevices) to get device ID.
2601
+ * @brief Sets the speaker or the earpiece as the audio playback device. The audio playback device defaults to the speaker.
2602
+ * @param deviceId ID of the audio playback device. Call [enumerateDevices](#enumeratedevices) to get device ID.
2282
2603
  * @return
2283
2604
  * @notes You can call this API before or after the user joins a room.
2284
2605
  * @region Audio Management
@@ -2294,39 +2615,16 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2294
2615
  */
2295
2616
  play(userId: string): Promise<void>;
2296
2617
 
2297
- /**
2298
- * @brief Enable/ Disable the transmission of the local audio stream.
2299
- * Remote users in the room will be informed via [onUserMuteAudio](104479#onusermuteaudio) after the visible user changes the transmission state of the audio streams by calling this API.
2300
- * @param muteState An identifier denoting whether the local audio stream is sending.
2301
- * @return
2302
- * @notes + Calling this API toggles the transmission state of the local audio streams instead of the capture state.
2303
- * + You can enable audio transmission regardless of the audio capture state. Enable the transmission before capture, thus the audio stream can be sent once the capture starts.
2304
- * @region Media Transmission
2305
- */
2306
- muteLocalAudio(muteState: MuteState): Promise<boolean>;
2307
-
2308
- /**
2309
- * @brief Enable/ Disable the transmission of the local video stream. The video stream is not sending by default.
2310
- * Call this API to start sending local video streams when using either internal capture module or custom video source. <br>
2311
- * Remote users in the room will be informed via [onUserMuteAudio](104479#onusermuteaudio) after the visible user changes the transmission state of the video streams by calling this API.
2312
- * @param muteState An identifier denoting whether the local video stream is sending
2313
- * @return Sending state of the local video stream
2314
- * @notes + This API only controls the sending state of the local video stream and does not affect the local video acquisition state.
2315
- * + You can enable video transmission regardless of the video capture state. Enable the transmission before capture, thus the video stream can be sent once the capture starts.
2316
- * @region Media Transmission
2317
- */
2318
- muteLocalVideo(muteState: MuteState): Promise<boolean>;
2319
-
2320
2618
  /**
2321
2619
  * @brief Pause receiving remote media streams.
2322
2620
  * @param mediaType Media stream type subscribed to.
2323
2621
  * @return
2324
- * @notes + Calling this API does not change the capture state and the transmission state of the remote clients. <br>
2325
- * + Calling this API does not cancel the subscription or change any subscription configuration. <br>
2622
+ * @notes + Calling this API does not change the capture state and the transmission state of the remote clients.
2623
+ * + Calling this API does not cancel the subscription or change any subscription configuration.
2326
2624
  * + To resume, call [resumeAllSubscribedStream](#resumeAllSubscribedStream).
2327
2625
  * @region Media Stream Transmission
2328
2626
  */
2329
- pauseAllSubscribedStream(mediaType: PauseResumeControlMediaType): Promise<void>;
2627
+ pauseAllSubscribedStream(mediaType: MediaType): Promise<void>;
2330
2628
 
2331
2629
  /**
2332
2630
  * @brief Resume receiving remote media streams
@@ -2336,43 +2634,43 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2336
2634
  * + Calling this API does not change any subscription configuration.
2337
2635
  * @region Media Transmission
2338
2636
  */
2339
- resumeAllSubscribedStream(mediaType: PauseResumeControlMediaType): Promise<void>;
2637
+ resumeAllSubscribedStream(mediaType: MediaType): Promise<void>;
2340
2638
 
2341
2639
  /**
2342
- * @brief Send point-to-point text messages to a specified user in the room.<br>
2640
+ * @brief Send point-to-point text messages to a specified user in the room.
2343
2641
  * The recipient receives the message via [onUserMessageReceived](104479#onusermessagereceived) once the message is sent successfully.
2344
2642
  * @param userId User ID of the recipient
2345
- * @param message Text to be sent within 62KB<br>
2643
+ * @param message Text to be sent within 62KB
2346
2644
  * @return
2347
- * @notes Call [joinRoom](#joinroom) to join the room before calling this API. <br>
2645
+ * @notes Call [joinRoom](#joinroom) to join the room before calling this API.
2348
2646
  * @region Message
2349
2647
  */
2350
2648
  sendUserMessage(userId: string, message: string): Promise<unknown> | undefined;
2351
2649
 
2352
2650
  /**
2353
- * @brief Send point-to-point binary messages to a specified user in the room.<br>
2651
+ * @brief Send point-to-point binary messages to a specified user in the room.
2354
2652
  * The recipient receives the message via [onUserBinaryMessageReceived](104479#onuserbinarymessagereceived) once the message is sent successfully.
2355
2653
  * @param userId User ID of the recipient
2356
- * @param message Binary to be sent within 62KB<br>
2654
+ * @param message Binary to be sent within 62KB
2357
2655
  * @return
2358
- * @notes Call [joinRoom](#joinroom) to join the room before calling this API. <br>
2656
+ * @notes Call [joinRoom](#joinroom) to join the room before calling this API.
2359
2657
  * @region Message
2360
2658
  */
2361
2659
  sendUserBinaryMessage(userId: string, message: ArrayBuffer): Promise<unknown>;
2362
2660
 
2363
2661
  /**
2364
- * @brief Send text messaging to all other users in the room.<br>
2662
+ * @brief Send text messaging to all other users in the room.
2365
2663
  * Users in the room will receive message via [onRoomMessageReceived](104479#onroommessagereceived) once the message is sent successfully.
2366
- * @param message Text to be sent within 62KB<br>
2664
+ * @param message Text to be sent within 62KB
2367
2665
  * @return
2368
2666
  * @region Message
2369
2667
  */
2370
2668
  sendRoomMessage(message: string): Promise<any> | undefined;
2371
2669
 
2372
2670
  /**
2373
- * @brief Send binary messaging to all other users in the room.<br>
2671
+ * @brief Send binary messaging to all other users in the room.
2374
2672
  * Users in the room will receive binary message via [onRoomBinaryMessageReceived](104479#onroombinarymessagereceived) once the message is sent successfully.
2375
- * @param message Binary message to be sent within 62KB<br>
2673
+ * @param message Binary message to be sent within 62KB
2376
2674
  * @return
2377
2675
  * @region Message
2378
2676
  */
@@ -2382,7 +2680,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2382
2680
  * @brief Send SEI message carried by video frames
2383
2681
  * @param streamIndex
2384
2682
  * @param message SEI message within 4kb. Empty message or message exceeding this size will not be sent with respective error prompt.
2385
- * @param repeatCount Number of message sending repetitions. The value range is [0,30]. <br>
2683
+ * @param repeatCount Number of message sending repetitions. The value range is [0,30].
2386
2684
  * Calling this API to add SEI data to consecutive `repeatCount` video frames starting from the current one.
2387
2685
  * @notes + Call this API to add SEI message to the video frame captured by the internal video capture module.
2388
2686
  * + SDK will abandon the SEI message if no video frame in 2s after you call this API.
@@ -2392,21 +2690,44 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2392
2690
  sendSEIMessage(streamIndex: StreamIndex, message: Uint8Array | string, repeatCount: number): void;
2393
2691
 
2394
2692
  /**
2395
- * @region Video Management
2396
2693
  * @brief Sets the video encoder configuration of the publishing streams.
2397
- * @param streamIndex
2398
- * @param descriptions The max parameters of the video stream.
2399
- * When you call [enableSimulcastMode](#enableSimulcastMode) and enable simulcasting, you can call this API to set the parameters of the multiple video streams. The length of `descriptions` is no more than 3. The code rate of the parameters must be in descending order.
2694
+ * @param descriptions List of configurations for multiple streams. You should note that the resolution you set is the maximum resolution of each stream.
2695
+ * You can set parameters for up to 3 streams, SDK will always take the value of the first 3 streams when parameters for more streams are set.
2696
+ * The code rate of the parameters must be in descending order.
2400
2697
  * When the resolution of the max stream is in [540P, 1080P], you can simulcast 3 streams; when in [270P, 450P], you can simulcast 2 streams; when in [0, 180P], you can not enable simulcast.
2401
- * @notes For the video stream captured by the camera, the default value is 360P, 15FPS; for the screen-sharing stream, the default value is 1080P, 15FPS.
2698
+ * @notes <br>
2699
+ * + For the video stream captured by the camera, the default value is 360P, 15FPS; for the screen-sharing stream, the default value is 1080P, 15FPS.
2700
+ * + Before calling this API to set parameters for multiple video streams, the largest resolution of published streams is 640px × 360px with a frame rate of 15fps by default. <br>
2701
+ * + This API is applicable to the video stream captured by the camera, see [setScreenEncoderConfig](#setscreenencoderconfig) for setting parameters for screen sharing video stream.
2702
+ * @region Video Management
2703
+ */
2704
+ setVideoEncoderConfig(descriptions: VideoEncoderConfig | VideoEncoderConfig[]): Promise<void>;
2705
+
2706
+ /**
2707
+ * @brief Video publisher call this API to set the expected configurations for the screen sharing video stream, including resolution, frame rate, bitrate, scale mode, and fallback strategy in poor network conditions.
2708
+ * @param description You expected configurations for screen sharing video stream.
2709
+ * @notes Before calling this API, a screen video stream with a default resolution of 1920px × 1080px and a frame rate of 15fps will be published.
2710
+ * @region Screen Shareing Management
2711
+ */
2712
+ setScreenEncoderConfig(description: VideoEncoderConfig): Promise<void>;
2713
+
2714
+ /**
2715
+ * @brief Sets your expected configuration of the remote video stream that you want to subscribe to or have subscribed to.
2716
+ * @param userId The ID of the target stream publisher
2717
+ * @param remoteVideoConfig Your expected configuration, see RemoteVideoConfig{@link #RemoteVideoConfig}.
2718
+ * @notes <br>
2719
+ * + This API only works after the publisher calls [enableSimulcastMode](#enablesimulcastmode) to enable publishing multiple video streams, in which case the subscriber will receive a stream that is closest to the set configuration. <br>
2720
+ * + If you don't call this API after the publisher enables the function of publishing multiple streams, you will receive by default the video stream with the largest resolution set by the publisher. <br>
2721
+ * + 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). <br>
2722
+ * @region Video Management
2402
2723
  */
2403
- setVideoEncoderConfig(streamIndex: StreamIndex, descriptions: VideoEncoderConfig | VideoEncoderConfig[]): Promise<void>;
2724
+ setRemoteVideoConfig(userId: string, remoteVideoConfig: RemoteVideoConfig): Promise<void>;
2404
2725
 
2405
2726
  /**
2406
2727
  * @region Video Management
2407
2728
  * @brief Enables the simulcast mode of the video stream captured by the camera at the publishing end.imulcasting, including resolution, frame rate, bitrate, scale mode, fallback strategy under poor network conditions.
2408
2729
  * @param enabled
2409
- * @param + You must call this API before publishing the video streams. <br>
2730
+ * @param + You must call this API before publishing the video streams.
2410
2731
  * + After enabling the simulcast mode, SDK automatically sets the encoding parameters for the video streams. For manual setting, call [setVideoEncoderConfig](#setVideoEncoderConfig).
2411
2732
  */
2412
2733
  enableSimulcastMode(enabled: boolean): boolean;
@@ -2414,22 +2735,22 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2414
2735
  /**
2415
2736
  * @hidden
2416
2737
  * @deprecated since 4.42, use enableAudioPropertiesReport instead
2417
- * @brief Turn on/off volume prompts. Off by default. <br>
2738
+ * @brief Turn on/off volume prompts. Off by default.
2418
2739
  * Call this API to set the report period of the volume information of local user and each subscribed user.
2419
2740
  * Local client will get informed of the the volume of local user and each subscribed users via [onAudioVolumeIndication](104479#onaudiovolumeindication).
2420
- * @param interval The time interval for receiving a volume prompt callback <br>
2421
- * It is recommended to set to greater than or equal to 200 milliseconds; when less than 10 milliseconds, the behavior is undefined. <br>
2422
- * + ≤ 0: Disable the volume prompt function. <br>
2741
+ * @param interval The time interval for receiving a volume prompt callback.
2742
+ * It is recommended to set to greater than or equal to 200 milliseconds; when less than 10 milliseconds, the behavior is undefined.
2743
+ * + ≤ 0: Disable the volume prompt function.
2423
2744
  * + > 0: Enable the volume prompt function and set the time interval for receiving the volume prompt callback. In milliseconds.
2424
2745
  * @region Room Management
2425
2746
  */
2426
2747
  setAudioVolumeIndicationInterval(interval?: number): void;
2427
2748
 
2428
2749
  /**
2429
- * @brief Enable audio information prompts. <br>
2430
- * @param config Audio information prompts-related configurations. <br>
2431
- * @notes With the prompt on, you can: <br>
2432
- * + Get the information of the audio stream captured by the local microphone and screen audio stream through [onLocalAudioPropertiesReport](104479#onLocalAudioPropertiesReport). <br>
2750
+ * @brief Enable audio information prompts.
2751
+ * @param config Audio information prompts-related configurations.
2752
+ * @notes With the prompt on, you can:
2753
+ * + Get the information of the audio stream captured by the local microphone and screen audio stream through [onLocalAudioPropertiesReport](104479#onLocalAudioPropertiesReport).
2433
2754
  * + Get the information of the subscribed remote audio streams through [onRemoteAudioPropertiesReport](104479#onRemoteAudioPropertiesReport).
2434
2755
  * @region Audio Management
2435
2756
  */
@@ -2446,7 +2767,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2446
2767
  startLiveTranscoding(transcode: LiveTranscodeConfig): Promise<void>;
2447
2768
 
2448
2769
  /**
2449
- * @brief Update configuration needed when pushing media streams to CDN. <br>
2770
+ * @brief Update configuration needed when pushing media streams to CDN.
2450
2771
  * After calling [startLiveTranscoding](#startlivetranscoding) to enable the function of pushing streams to CDN, you can call this API to update the relevant configurations.
2451
2772
  * @param transcode Configurations that you want to update.
2452
2773
  * @region Advanced Feature
@@ -2462,25 +2783,25 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2462
2783
  stopLiveTranscoding(): Promise<void>;
2463
2784
 
2464
2785
  /**
2465
- * @brief Set the business ID. <br>
2786
+ * @brief Set the business ID.
2466
2787
  * You can use businessId to distinguish different business scenarios. You can customize your businessId to serve as a sub AppId, which can share and refine the function of the AppId, but it does not need authentication.
2467
2788
  * @param businessId Your customized businessId
2468
2789
  * BusinessId is a tag, and you can customize its granularity.
2469
- * @notes You must call this API before the [joinRoom](#joinroom) API, otherwise it will be invalid. <br>
2790
+ * @notes You must call this API before the [joinRoom](#joinroom) API, otherwise it will be invalid.
2470
2791
  * @region Engine Management
2471
2792
  */
2472
2793
  setBusinessId(businessId: string): boolean;
2473
2794
 
2474
2795
  /**
2475
- * @brief Set user visibility. Visible by default. <br>
2796
+ * @brief Set user visibility. Visible by default.
2476
2797
  * @param enable Visibility of the user in the room:
2477
- * + `true`: The user can publish media streams. And the other users in the room get informed of the behaviors of the user, such as Joining room, starting video capture, and Leaving room.<br>
2798
+ * + `true`: The user can publish media streams. And the other users in the room get informed of the behaviors of the user, such as Joining room, starting video capture, and Leaving room.
2478
2799
  * + `false`: The user cannot publish media streams. And the other users in the room do not get informed of the behaviors of the user, such as joining, starting video capture, or leaving.
2479
2800
  * @return
2480
- * @notes + You can call this API whether the user is in a room or not. <br>
2801
+ * @notes + You can call this API whether the user is in a room or not.
2481
2802
  * + When you call this API, the other users in the room will be informed via the related callback:
2482
- * - Switch from `false` to `true`: [onUserJoined](104479#onuserjoined)<br>
2483
- * - Switch from `true` to `false`: [onUserLeave](104479#onuserleave) <br>
2803
+ * - Switch from `false` to `true`: [onUserJoined](104479#onuserjoined)
2804
+ * - Switch from `true` to `false`: [onUserLeave](104479#onuserleave)
2484
2805
  * @region Room Management
2485
2806
  */
2486
2807
  setUserVisibility(enable: boolean): Promise<void>;
@@ -2549,11 +2870,11 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2549
2870
  setVideoCaptureConfig(config: TrackCaptureConfig): Promise<void>;
2550
2871
 
2551
2872
  /**
2552
- * @brief Log in to the RTM server. <br>
2873
+ * @brief Log in to the RTM server.
2553
2874
  * Call this method before users within the same `appID` can communicate with each other via messages.
2554
- * @param token Dynamic key. It is used for authentication and verification of users entering the room. <br>
2555
- * You need to bring Token to enter the room. When testing, you can use the console to generate temporary tokens. The official launch requires the use of the key SDK to generate and issue tokens at your server level. <br>
2556
- * Apps with different AppIDs are not interoperable. <br>
2875
+ * @param token Dynamic key. It is used for authentication and verification of users entering the room.
2876
+ * You need to bring Token to enter the room. When testing, you can use the console to generate temporary tokens. The official launch requires the use of the key SDK to generate and issue tokens at your server level.
2877
+ * Apps with different AppIDs are not interoperable.
2557
2878
  * @param userInfo User information.
2558
2879
  * @return
2559
2880
  * @notes
@@ -2634,9 +2955,9 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2634
2955
  /**
2635
2956
  * @brief Start cloud proxy
2636
2957
  * @param cloudProxyInfo cloud proxy informarion list.
2637
- * @notes + Call this API before joining the room.<br>
2638
- * + Start pre-call network detection after starting cloud proxy. <br>
2639
- * + After starting cloud proxy and connects the cloud proxy server successfully, receives [onCloudProxyConnected](104479#onCloudProxyConnected). <br>
2958
+ * @notes + Call this API before joining the room.
2959
+ * + Start pre-call network detection after starting cloud proxy.
2960
+ * + After starting cloud proxy and connects the cloud proxy server successfully, receives [onCloudProxyConnected](104479#onCloudProxyConnected).
2640
2961
  * + To stop cloud proxy, call [stopCloudProxy](#stopCloudProxy).
2641
2962
  */
2642
2963
  startCloudProxy(cloudProxyInfo: CloudProxyInfo): void;
@@ -2716,7 +3037,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2716
3037
  * @param filePath Image path in Http protocal; or Blob object.
2717
3038
  * The format of the image can be: JPG, PNG, or BMP.
2718
3039
  * 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.
2719
- * @return + It's recommended to call this API before stopping video capture to avoid blank frame in video recording. <br>
3040
+ * @return + It's recommended to call this API before stopping video capture to avoid blank frame in video recording.
2720
3041
  * + You cannot see the image during local preview.
2721
3042
  */
2722
3043
  setDummyCaptureImagePath(index: StreamIndex, filePath: string): Promise<void>;
@@ -2727,6 +3048,29 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2727
3048
  */
2728
3049
  defaultTranscoding(): Required<LiveTranscodeConfig>;
2729
3050
 
3051
+ /**
3052
+ * @brief Set the fallback option for remote media stream
3053
+ * Fallback:to enable media stream fallback or to subscribe to only audio stream under poor network conditions to ensure smooth communication.
3054
+ * @param option Fallback options for subscribed media stream
3055
+ * @return + `true` Success
3056
+ * + `false` Failure
3057
+ * @notes + You must call this API before joining the room.
3058
+ * + 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.
3059
+ * + You can set media stream fallback using API or cloud configuration. The latter takes a higher priority.
3060
+ */
3061
+ setSubscribeFallbackOption(option: SubscribeFallbackOption): boolean;
3062
+
3063
+ /**
3064
+ * @brief Set the priority of the remote user's media stream.
3065
+ * Use this API with [setSubscribeFallbackOption](#setsubscribefallbackoption).
3066
+ * With video stream fallback enabled and user priority specified, the stream quality of higher priority user is the last to be compromised.
3067
+ * @param userId The ID of the remote user
3068
+ * @param priority The priority of the remote user's media stream
3069
+ * @return + `true` Success
3070
+ * + `false` Failure
3071
+ */
3072
+ setRemoteUserPriority(userId: string, priority: RemoteUserPriority): boolean;
3073
+
2730
3074
  /**
2731
3075
  * @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.
2732
3076
  * @param filePath Specify the path of the audio file for the playback test, including *.wav and *.mp3.
@@ -2751,15 +3095,15 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2751
3095
  * @notes + You can call this API whether the user is in a room.
2752
3096
  * + The audio capturing will stop and begins to play the recording in 30 s after calling this API. Before that, call [stopAudioDeviceRecordAndPlayTest](#stopaudiodevicerecordandplayTest) to stop capturing and start playing the recording.
2753
3097
  * + You must stop the test before starting another test for audio devices.
2754
- * + Call [stopAudioDeviceRecordTest](#stopaudiodevicerecordtest) to stop the test, including capturing and playing the recording.
3098
+ * + Call [stopAudioDevicePlayTest](#stopaudiodeviceplaytest) to stop the test, including capturing and playing the recording.
2755
3099
  * + This test performs locally and does not involve network connection testing.
2756
3100
  */
2757
3101
  startAudioDeviceRecordTest(indicationInterval: number): Promise<void>;
2758
3102
 
2759
3103
  /**
2760
3104
  * @brief Call this API to stop recording in the test and start to play the recording.
2761
- * @notes After calling this API, the recording starts playing during which you can call [stopAudioDeviceRecordTest](#stopaudiodevicerecordtest) to stop playing.
2762
- */
3105
+ * @notes After calling this API, the recording starts playing during which you can call [stopAudioDevicePlayTest](#stopaudiodeviceplaytest) to stop playing.
3106
+ */
2763
3107
  stopAudioDeviceRecordAndPlayTest(): void;
2764
3108
 
2765
3109
  /**
@@ -2767,6 +3111,13 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2767
3111
  * Before the test ends by itself, you can call this API to stop the recording or playing.
2768
3112
  */
2769
3113
  stopAudioDevicePlayTest(): void;
3114
+
3115
+ /**
3116
+ * @brief Set the sound quality.
3117
+ * @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.
3118
+ * @notes We recommend to call this API before the audio capture starts.
3119
+ */
3120
+ setAudioProfile(profile: AudioProfileType): void;
2770
3121
  }
2771
3122
 
2772
3123
  /**
@@ -2813,7 +3164,7 @@ export interface UserInfo {
2813
3164
 
2814
3165
  /**
2815
3166
  * @brief ExtraInfo Additional information passed by the user, with a maximum length of 200 bytes. Callback to remote user in [onUserJoined](104479#onuserjoined).
2816
- * @notes Supports the following character set ranges <br>
3167
+ * @notes Supports the following character set ranges
2817
3168
  * + 26 uppercase letters A~ Z
2818
3169
  * + 26 lowercase letters a~ z
2819
3170
  * + 10 numbers 0~ 9
@@ -2838,7 +3189,7 @@ export declare enum UserOfflineReason {
2838
3189
  DROPPED = 1,
2839
3190
 
2840
3191
  /**
2841
- * @brief The remote client calls `setUserVisibility` to turn invisible.<br>
3192
+ * @brief The remote client calls `setUserVisibility` to turn invisible.
2842
3193
  */
2843
3194
  SWITCH_TO_INVISIBLE = 2,
2844
3195
 
@@ -2865,19 +3216,31 @@ export interface RoomConfig {
2865
3216
  * @brief Enable/disable auto-subscribe audio. Enable by default.
2866
3217
  * Call publish[104481#publish] to publish media streams if you disable `isAutoPublish`.
2867
3218
  */
2868
- isAutoPublish: boolean;
3219
+ isAutoPublish?: boolean;
2869
3220
 
2870
3221
  /**
2871
3222
  * @brief Enable/disable auto-subscribe audio. Enable by default.
2872
3223
  * Call subscribeUserStream, unsubscribe to revise the subscription.
2873
3224
  */
2874
- isAutoSubscribeAudio: boolean;
3225
+ isAutoSubscribeAudio?: boolean;
2875
3226
 
2876
3227
  /**
2877
3228
  * @brief Enable/disable auto-subscribe video. Enable by default.
2878
3229
  * Call subscribeUserStream, unsubscribe to revise the subscription.
2879
3230
  */
2880
- isAutoSubscribeVideo: boolean;
3231
+ isAutoSubscribeVideo?: boolean;
3232
+
3233
+ /**
3234
+ * @brief Room profile
3235
+ * Choose an appropriate room-profile option to meet the requirement of the scenario for media encoding algorithm, video profiles, and network configurations.
3236
+ * Call [setAudioProfile](104478#setaudioprofile) to choose an audio quality option.
3237
+ */
3238
+ roomProfileType?: RoomProfileType;
3239
+
3240
+ /**
3241
+ * @brief Expected configuration of remote video stream.
3242
+ */
3243
+ remoteVideoConfig?: RemoteVideoConfig;
2881
3244
  }
2882
3245
 
2883
3246
  /**
@@ -2917,22 +3280,6 @@ export interface SubscribeConfig {
2917
3280
  subAudio: boolean;
2918
3281
  }
2919
3282
 
2920
- /**
2921
- * @brief Transmission/Playback state of the media stream
2922
- */
2923
- export declare enum MuteState {
2924
-
2925
- /**
2926
- * @brief Enable
2927
- */
2928
- MUTE_STATE_OFF = 0,
2929
-
2930
- /**
2931
- * @brief Disable
2932
- */
2933
- MUTE_STATE_ON = 1
2934
- }
2935
-
2936
3283
  /**
2937
3284
  * @brief Result of updating subscription
2938
3285
  */
@@ -2981,27 +3328,6 @@ export declare enum MirrorMode {
2981
3328
  MIRROR_MODE_ON = 1
2982
3329
  }
2983
3330
 
2984
- /**
2985
- * @brief Media stream type
2986
- */
2987
- export declare enum PauseResumeControlMediaType {
2988
-
2989
- /**
2990
- * @brief Audio
2991
- */
2992
- RTC_PAUSE_RESUME_CONTROL_AUDIO = 0,
2993
-
2994
- /**
2995
- * @brief Video
2996
- */
2997
- RTC_PAUSE_RESUME_CONTROL_VIDEO = 1,
2998
-
2999
- /**
3000
- * @brief Both video and audio
3001
- */
3002
- RTC_PAUSE_RESUME_CONTROL_AUDIO_AND_VIDEO = 2
3003
- }
3004
-
3005
3331
  /**
3006
3332
  * @brief Player information and rendering mode
3007
3333
  */
@@ -3018,7 +3344,7 @@ export interface VideoPlayerOption {
3018
3344
  renderMode?: VideoRenderMode;
3019
3345
 
3020
3346
  /**
3021
- * @brief User ID, a non-empty string within 128 bytes. Use the following character set ranges <br>
3347
+ * @brief User ID, a non-empty string within 128 bytes. Use the following character set ranges
3022
3348
  * + 26 uppercase letters A~ Z
3023
3349
  * + 26 lowercase letters a~ z
3024
3350
  * + 10 numbers 0~ 9
@@ -3033,14 +3359,14 @@ export interface VideoPlayerOption {
3033
3359
  export declare enum VideoRenderMode {
3034
3360
 
3035
3361
  /**
3036
- * @brief Windows fill priority. <br>
3037
- * Scale the video frame at the original equal ratio until the window is filled with video. If the video frame aspect ratio is different from that of the window, the over-brims of the video frame will not be displayed. <br>
3362
+ * @brief Windows fill priority.
3363
+ * Scale the video frame at the original equal ratio until the window is filled with video. If the video frame aspect ratio is different from that of the window, the over-brims of the video frame will not be displayed.
3038
3364
  */
3039
3365
  RENDER_MODE_HIDDEN = 0,
3040
3366
 
3041
3367
  /**
3042
- * @brief All video frame contents are fit to display in the window. <br>
3043
- * Scale the video frame at the original equal ratio until the whole video frame has been displayed in the window. If the video frame aspect ratio is different from that of the window, the area on the window that is not filled by the video frame will be blacked out. <br>
3368
+ * @brief All video frame contents are fit to display in the window.
3369
+ * Scale the video frame at the original equal ratio until the whole video frame has been displayed in the window. If the video frame aspect ratio is different from that of the window, the area on the window that is not filled by the video frame will be blacked out.
3044
3370
  */
3045
3371
  RENDER_MODE_FIT = 1
3046
3372
  }
@@ -3078,45 +3404,32 @@ export declare enum StreamIndex {
3078
3404
  }
3079
3405
 
3080
3406
  /**
3081
- * @brief Type of the media stream subscribed to
3407
+ * @brief Media stream type
3082
3408
  */
3083
- export declare enum SubscribeMediaType {
3084
-
3085
- /**
3086
- * @brief Audio only
3087
- */
3088
- AUDIO_ONLY = 0,
3409
+ export declare enum MediaType {
3089
3410
 
3090
3411
  /**
3091
- * @brief Video only
3412
+ * @brief Controls audio only
3092
3413
  */
3093
- VIDEO_ONLY = 1,
3414
+ AUDIO = 1,
3094
3415
 
3095
3416
  /**
3096
- * @brief Both video and audio
3417
+ * @brief Controls video only
3097
3418
  */
3098
- AUDIO_AND_VIDEO = 2,
3419
+ VIDEO = 2,
3099
3420
 
3100
3421
  /**
3101
- * @brief Neither audio nor video
3422
+ * @brief Controls both audio and video
3102
3423
  */
3103
- NONE = 3
3424
+ AUDIO_AND_VIDEO = 3
3104
3425
  }
3105
3426
 
3106
3427
  /**
3107
3428
  * @brief Subscription configuration of video streams
3108
3429
  */
3109
- export interface SubscribeVideoConfig {
3110
-
3111
- /**
3112
- * @brief videoIndex Quality level of the video stream subscribed to. <br>
3113
- * In Simulcast mode, use a number to specify the expected quality of the video stream to be subscribed to. In Simulcast mode, a video has a diversity of encoded qualities that ranking from 0 to 3. Call [setVideoEncoderConfig](#setvideoencoderconfig) to enable Simulcast mode on the publisher's clients. <br>
3114
- */
3115
- videoIndex: number;
3116
- }
3117
3430
 
3118
3431
  /**
3119
- * @brief Stream property. <br>
3432
+ * @brief Stream property.
3120
3433
  */
3121
3434
  export interface RTCStream {
3122
3435
 
@@ -3141,45 +3454,45 @@ export interface RTCStream {
3141
3454
  hasAudio: boolean;
3142
3455
 
3143
3456
  /**
3144
- * @brief Properties of the video stream. <br>
3457
+ * @brief Properties of the video stream.
3145
3458
  * When a remote user calls the [setVideoEncoderConfig](#setvideoencoderconfig) API to publish multiple configured video streams, this will contain attribute information for all video streams published by the user.
3146
3459
  */
3147
3460
  videoStreamDescriptions?: VideoStreamDescription[];
3148
3461
  }
3149
3462
 
3150
3463
  /**
3151
- * @brief The reason for the removal of the remote stream in the room. <br>
3464
+ * @brief The reason for the removal of the remote stream in the room.
3152
3465
  *
3153
3466
  */
3154
3467
  export declare enum StreamRemoveReason {
3155
3468
 
3156
3469
  /**
3157
- * @brief The remote user stops publishing the stream. <br>
3470
+ * @brief The remote user stops publishing the stream.
3158
3471
  */
3159
3472
  STREAM_REMOVE_REASON_UNPUBLISH = 0,
3160
3473
 
3161
3474
  /**
3162
- * @brief The remote user failed to publish the stream. <br>
3475
+ * @brief The remote user failed to publish the stream.
3163
3476
  */
3164
3477
  STREAM_REMOVE_REASON_PUBLISH_FAILED = 1,
3165
3478
 
3166
3479
  /**
3167
- * @brief Keep alive failed. <br>
3480
+ * @brief Keep alive failed.
3168
3481
  */
3169
3482
  STREAM_REMOVE_REASON_KEEP_LIVE_FAILED = 2,
3170
3483
 
3171
3484
  /**
3172
- * @brief The remote user is disconnected. <br>
3485
+ * @brief The remote user is disconnected.
3173
3486
  */
3174
3487
  STREAM_REMOVE_REASON_CLIENT_DISCONNECTED = 3,
3175
3488
 
3176
3489
  /**
3177
- * @brief The remote user republishes the stream. <br>
3490
+ * @brief The remote user republishes the stream.
3178
3491
  */
3179
3492
  STREAM_REMOVE_REASON_REPUBLISH = 4,
3180
3493
 
3181
3494
  /**
3182
- * @brief Other reasons. <br>
3495
+ * @brief Other reasons.
3183
3496
  */
3184
3497
  STREAM_REMOVE_REASON_OTHER = 5
3185
3498
  }
@@ -3268,7 +3581,9 @@ export interface AudioVolumeInfo {
3268
3581
  export interface ScreenConfig {
3269
3582
 
3270
3583
  /**
3271
- * @brief Set `true` for capturing the system audio when the user is using Chrome on Windows.
3584
+ * @brief Whether to display the enable audio option when sharing screen.
3585
+ * • On Windows, you can share the system audio through sharing the entire screen, and share audio from a tab through sharing a Chrome tab.
3586
+ * • On macOS, you can only share audio from a tab through sharing a Chrome tab.
3272
3587
  */
3273
3588
  enableAudio?: boolean;
3274
3589
  }
@@ -3321,22 +3636,22 @@ export declare enum MirrorType {
3321
3636
  }
3322
3637
 
3323
3638
  /**
3324
- * @brief Configuration related to audio information prompt. <br>
3639
+ * @brief Configuration related to audio information prompt.
3325
3640
  */
3326
3641
  export interface AudioPropertiesConfig {
3327
3642
 
3328
3643
  /**
3329
- * @brief Prompt interval in ms, the default value is 100. <br>
3330
- * + `<= 0`: Turn off prompt <br>
3331
- * + `(0,100]`: Invalid interval value, and will be automatically reset to 100ms. <br>
3332
- * + `> 100`: The actual value of interval <br>
3644
+ * @brief Prompt interval in ms, the default value is 100.
3645
+ * + `<= 0`: Turn off prompt
3646
+ * + `(0,100]`: Invalid interval value, and will be automatically reset to 100ms.
3647
+ * + `> 100`: The actual value of interval
3333
3648
  */
3334
3649
  interval?: number;
3335
3650
 
3336
3651
  /**
3337
- * @brief Whether to keep audio information prompt on when you are not on the video/audio call webpage. The default setting is `true`. <br>
3338
- * + true: Keep the prompt on <br>
3339
- * + false: Disable the prompt <br>
3652
+ * @brief Whether to keep audio information prompt on when you are not on the video/audio call webpage. The default setting is `true`.
3653
+ * + true: Keep the prompt on
3654
+ * + false: Disable the prompt
3340
3655
  */
3341
3656
  enableInBackground?: boolean;
3342
3657
  }
@@ -3446,7 +3761,7 @@ export interface LiveTranscodeAudioConfig {
3446
3761
  channels: number;
3447
3762
 
3448
3763
  /**
3449
- * @brief The AAC profile to be set. The value must be `LC`, `HEv1`, ` or 'HEv2`. The default value is `LC`.
3764
+ * @brief The AAC profile to be set. The value must be `LC`, `HEv1`, or `HEv2`. The default value is `LC`.
3450
3765
  */
3451
3766
  AACProfile: "LC" | "HEv1" | "HEv2";
3452
3767
  }
@@ -3513,17 +3828,17 @@ export interface LiveTranscodeLayoutRegion {
3513
3828
  h: number;
3514
3829
 
3515
3830
  /**
3516
- * @brief The view mode to be set. See the following options: <br>
3517
- * + 1: Fill and Crop. The video is enlarged or shrunk with fixed aspect ratio, and completely fills the windows. The region of the video which exceeds the window will be cropped. <br>
3518
- * + 2: Fit. The video is enlarged or shrunk with fixed aspect ratio, and is shown completely in the windows. The region of the window, which is not filled with video, is filled with black background. <br>
3831
+ * @brief The view mode to be set. See the following options:
3832
+ * + 1: Fill and Crop. The video is enlarged or shrunk with fixed aspect ratio, and completely fills the windows. The region of the video which exceeds the window will be cropped.
3833
+ * + 2: Fit. The video is enlarged or shrunk with fixed aspect ratio, and is shown completely in the windows. The region of the window, which is not filled with video, is filled with black background.
3519
3834
  * + 3: Stretch. The video's aspect ratio is changed as it's automatically stretched to completely fill the bounding box it's contained in, but the whole image is visible.
3520
3835
  */
3521
3836
  renderMode?: number;
3522
3837
 
3523
3838
  /**
3524
- * @brief The content to be set. The default value is 0. See the following options: <br>
3525
- * + 0: Push both audio and video stream. <br>
3526
- * + 1: Push audio stream only. <br>
3839
+ * @brief The content to be set. The default value is 0. See the following options:
3840
+ * + 0: Push both audio and video stream.
3841
+ * + 1: Push audio stream only.
3527
3842
  * + 2: Push video stream only.
3528
3843
  */
3529
3844
  contentControl?: number;
@@ -3545,17 +3860,17 @@ export interface LiveTranscodeLayoutRegion {
3545
3860
  export interface RemoteStreamKey {
3546
3861
 
3547
3862
  /**
3548
- * @brief Room identification
3863
+ * @brief Room ID
3549
3864
  */
3550
3865
  roomId: string;
3551
3866
 
3552
3867
  /**
3553
- * @brief User identification
3868
+ * @brief User ID
3554
3869
  */
3555
3870
  userId: string;
3556
3871
 
3557
3872
  /**
3558
- * @brief Mainstream or screen-sharing stream. Refer to [StreamIndex](#streamIndex) for details.
3873
+ * @brief Mainstream or screen-sharing stream.
3559
3874
  */
3560
3875
  streamIndex: StreamIndex;
3561
3876
  }
@@ -3688,7 +4003,7 @@ export interface PublicStreamConfig {
3688
4003
  fps?: number;
3689
4004
 
3690
4005
  /**
3691
- * @brief Bitrate, unit: kbps<br>
4006
+ * @brief Bitrate, unit: kbps
3692
4007
  */
3693
4008
  kBitRate: number;
3694
4009
  };
@@ -3720,6 +4035,255 @@ export interface PublicStreamConfig {
3720
4035
  };
3721
4036
  }
3722
4037
 
4038
+ /**
4039
+ * @brief Configuration of remote video stream
4040
+ */
4041
+ export interface RemoteVideoConfig {
4042
+
4043
+ /**
4044
+ * @brief Width of the video frame in px
4045
+ */
4046
+ width: number;
4047
+
4048
+ /**
4049
+ * @brief Width of the video frame in px
4050
+ */
4051
+ height: number;
4052
+ }
4053
+
4054
+ /**
4055
+ * @brief Fallback options for subscribed media stream
4056
+ */
4057
+ export declare enum SubscribeFallbackOption {
4058
+
4059
+ /**
4060
+ * @brief Default setting. Media stream fallback is disabled.
4061
+ */
4062
+ DISABLE = 0,
4063
+
4064
+ /**
4065
+ * @brief When the downstream network quality is bad, the video stream fallbacks to stream of lower resolution and then to voice only. See [Media Stream Fallback](https://www.volcengine.com/docs/6348/70137) for fallback rules.
4066
+ * This setting takes effect only when the publisher enables simulcast mode through [EnableSimulcastMode](104478#enablesimulcastmode).
4067
+ */
4068
+ VIDEO_STREAM_LOW = 1,
4069
+
4070
+ /**
4071
+ * @brief When the downstream network quality is bad, the video stream fallbacks to voice only.
4072
+ * If you enables simulcast mode on the publisher, this option is not recommended as it might impair user experience.
4073
+ */
4074
+ AUDIO_ONLY = 2
4075
+ }
4076
+
4077
+ /**
4078
+ * @brief priority of the remote user
4079
+ */
4080
+ export declare enum RemoteUserPriority {
4081
+
4082
+ /**
4083
+ * @brief Low. Default value.
4084
+ */
4085
+ LOW = 0,
4086
+
4087
+ /**
4088
+ * @brief The remote user's priority is medium.
4089
+ */
4090
+ MEDIUM = 100,
4091
+
4092
+ /**
4093
+ * @brief The remote user's priority is high.
4094
+ */
4095
+ HIGH = 200
4096
+ }
4097
+
4098
+ /**
4099
+ * @brief Network quality.
4100
+ */
4101
+ export declare enum NetworkQuality {
4102
+
4103
+ /**
4104
+ * @brief Unknown.
4105
+ */
4106
+ UNKNOWN = 0,
4107
+
4108
+ /**
4109
+ * @brief The network quality is excellent.
4110
+ */
4111
+ EXCELLENT = 1,
4112
+
4113
+ /**
4114
+ * @brief The quality is good, but the bitrate is lower than Excellent.
4115
+ */
4116
+ GOOD = 2,
4117
+
4118
+ /**
4119
+ * @brief Users experience slightly impaired communication.
4120
+ */
4121
+ POOR = 3,
4122
+
4123
+ /**
4124
+ * @brief Users can communicate with each other, but not smoothly. It is recommended to lower sampling rate, frame rate, or remind the user through UI to switch to a voice call.
4125
+ */
4126
+ BAD = 4,
4127
+
4128
+ /**
4129
+ * @brief Network quality is very bad, users can barely communicate. It is recommended to notify users of poor network connection through UI.
4130
+ */
4131
+ VBAD = 5
4132
+ }
4133
+
4134
+ /**
4135
+ * @brief Information of stream switching due to a subscribed media stream fallback.
4136
+ */
4137
+ export interface RemoteStreamSwitch {
4138
+
4139
+ /**
4140
+ * @brief User Id of the remote publisher
4141
+ */
4142
+ userId: string;
4143
+
4144
+ /**
4145
+ * @brief Whether it is a screen-sharing stream
4146
+ */
4147
+ isScreen: boolean;
4148
+
4149
+ /**
4150
+ * @brief The index of original video stream
4151
+ */
4152
+ beforeVideoIndex: number;
4153
+
4154
+ /**
4155
+ * @brief The index of current video stream
4156
+ */
4157
+ afterVideoIndex: number;
4158
+
4159
+ /**
4160
+ * @brief Whether it is a video stream before stream switching.
4161
+ */
4162
+ beforeEnable: boolean;
4163
+
4164
+ /**
4165
+ * @brief Whether it is a video stream after stream switching.
4166
+ */
4167
+ afterEnable: boolean;
4168
+
4169
+ /**
4170
+ * @brief Reason for media stream fallback or recovery
4171
+ */
4172
+ reason: FallbackOrRecoverReason;
4173
+ }
4174
+
4175
+ /**
4176
+ * @brief The reason for media stream fallback or recovery
4177
+ */
4178
+ export declare enum FallbackOrRecoverReason {
4179
+
4180
+ /**
4181
+ * @brief Default value. Other reasons.
4182
+ */
4183
+ Unknown = -1,
4184
+
4185
+ /**
4186
+ * @brief Subscribed media stream falls back due to low bandwidth.
4187
+ */
4188
+ SubscribeFallbackByBandwidth = 0,
4189
+
4190
+ /**
4191
+ * @brief Subscribed media stream recovers from the fallback due to bandwidth increase.
4192
+ */
4193
+ SubscribeRecoverByBandwidth = 2
4194
+ }
4195
+
4196
+ /**
4197
+ * @brief Room profile
4198
+ * While calling [joinRoom](104478#joinroom) choose an appropriate room-profile option to meet the requirement of the scenario for media encoding algorithm, video profiles, and network configurations.
4199
+ * Call [setAudioProfile](104478#setaudioprofile) to choose an audio quality option if it is necessary.
4200
+ */
4201
+ export declare enum RoomProfileType {
4202
+
4203
+ /**
4204
+ * @brief Default mode for video/audio calls, such as voice chat room
4205
+ */
4206
+ communication = 0,
4207
+
4208
+ /**
4209
+ * @brief For 1 v.s. 1 audio and video calls
4210
+ */
4211
+ chat = 5,
4212
+
4213
+ /**
4214
+ * @brief Audio and video chat for 3 or more people
4215
+ */
4216
+ chatRoom = 6,
4217
+
4218
+ /**
4219
+ * @brief For the event of co-hosting during live streaming broadcast
4220
+ */
4221
+ coHost = 9,
4222
+
4223
+ /**
4224
+ * @brief For meeting Apps installed on terminals of meeting rooms
4225
+ */
4226
+ meeting = 16,
4227
+
4228
+ /**
4229
+ * @brief For the online classrooms and lectures that over 9 participants can join the audio and video chat.
4230
+ */
4231
+ classRoom = 18
4232
+ }
4233
+
4234
+ /**
4235
+ * @brief Audio quality
4236
+ * Call [setAudioProfile](104478#setaudioprofile) to choose an audio quality option.
4237
+ */
4238
+ export declare enum AudioProfileType {
4239
+
4240
+ /**
4241
+ * @brief Default sound quality
4242
+ * The sound quality configuration of RoomProfileType{@link #RoomProfileType} set by the server or client side
4243
+ */
4244
+ default = 0,
4245
+
4246
+ /**
4247
+ * @brief Smooth
4248
+ * Sample rate: 16 KHz
4249
+ * Mono-channel
4250
+ * Encoding birrate: 24 Kpbs
4251
+ * Fluent priority, low power consumption, and low traffic consumption, suitable for most game scenarios, such as team-wide voice chat, group-wide voice chat, nation-wide voice chat.
4252
+ */
4253
+ fluent = 1,
4254
+
4255
+ /**
4256
+ * @brief Mono-channel standard
4257
+ * Sample rate: 48 KHz
4258
+ * Encoding bitrate: 48 Kpbs
4259
+ * For scenarios requiring distinct voice, you can choose this mode, which achieves balanced latency, consumption, and network packets. It is suitable for educational Apps and the online Mafia Games.
4260
+ */
4261
+ standard = 2,
4262
+
4263
+ /**
4264
+ * @brief Dual-channel music
4265
+ * Sample rate: 48 KHz
4266
+ * Encoding birrate: 128 Kpbs
4267
+ * This mode provides high-resolution audio at a cost of high latency, consumption, and large network packets. It is suitable for entertainment Apps such as co-hosting and online talent contests.
4268
+ * Not recommended for game Apps.
4269
+ */
4270
+ hd = 3,
4271
+
4272
+ /**
4273
+ * @brief Dual-channel standard
4274
+ * Sample rate: 48 KHz
4275
+ * Encoding birrate: 80 Kpbs
4276
+ */
4277
+ standardStereo = 4,
4278
+
4279
+ /**
4280
+ * @brief Mono-channel music
4281
+ * Sample rate: 48 KHz
4282
+ * Encoding birrate: 128 Kpbs
4283
+ */
4284
+ hdMono = 5
4285
+ }
4286
+
3723
4287
  /**
3724
4288
  * @brief Point-to-point text message
3725
4289
  */
@@ -3753,6 +4317,7 @@ export interface UserBinaryMessageEvent {
3753
4317
  }
3754
4318
 
3755
4319
  /**
4320
+ * @hidden
3756
4321
  * @brief Event during pushing stream to CDN
3757
4322
  */
3758
4323
  export interface LiveTranscodingResultEvent {
@@ -3793,9 +4358,10 @@ declare const Config: {
3793
4358
  EXPECTED_ADDR: string;
3794
4359
  LOG_SERVER_URL: string;
3795
4360
  CONFIG_REQUEST_DOMAINS: string[];
4361
+ DEVICE_ID: string;
3796
4362
  };
3797
4363
  declare function setParameter(key: keyof typeof Config, value: any): void;
3798
- declare function getParameter(key: keyof typeof Config): string | string[] | never[];
4364
+ declare function getParameter(key: keyof typeof Config): string | string[];
3799
4365
  /**
3800
4366
  * @list 104477
3801
4367
  * @detail 104478
@@ -3807,10 +4373,10 @@ declare function getParameter(key: keyof typeof Config): string | string[] | nev
3807
4373
  export interface IVERTC {
3808
4374
 
3809
4375
  /**
3810
- * @brief Call this API to create an IRTCEngine instance that provides RTC service. <br>
3811
- * Call this API before calling any other APIs within the RTC SDK.<br>
4376
+ * @brief Call this API to create an IRTCEngine instance that provides RTC service.
4377
+ * Call this API before calling any other APIs within the RTC SDK.
3812
4378
  * Calling this API repeatedly will create multiple IRTCEngine instances.
3813
- * @param appId A unique identifier for each application. You can apply appIDs on the RTC console. <br>
4379
+ * @param appId A unique identifier for each application. You can apply appIDs on the RTC console.
3814
4380
  * Instances generated by different AppIDs are independent in RTC service. Users served by one AppID cannot communicate with users served by another AppID.
3815
4381
  * @return Return an `IRTCEngine` instance if you call this API successfully.
3816
4382
  * @notes + Call [destroyEngine](#destroyengine) respectively to destroy each IRTCEngine instance.
@@ -3822,7 +4388,7 @@ export interface IVERTC {
3822
4388
  /**
3823
4389
  * @brief Call this API to destroy the IRTCEngine instance created by [createEngine](#createengine).
3824
4390
  * @param engine By calling this API, this `IRTCEngine` instance and resource related will be wiped from memory. And any interaction with the media server will end.
3825
- * @notes + Before calling this API, ensure all business scenarios related to this `IRTCEngine` instance have ended. <br>
4391
+ * @notes + Before calling this API, ensure all business scenarios related to this `IRTCEngine` instance have ended.
3826
4392
  * + 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.
3827
4393
  * @region Engine Management
3828
4394
  */
@@ -3836,22 +4402,30 @@ export interface IVERTC {
3836
4402
  getSdkVersion(): string;
3837
4403
 
3838
4404
  /**
3839
- * @brief Call this API to enumerate media devices and their IDs, such as microphone, camera, and headset.
3840
- * Call this API to get deviceIds used to specify the device when calling [setAudioPlaybackDevice](#setaudioplaybackdevice), [startVideoCapture](#startvideocapture), and [startAudioCapture](#startaudiocapture).
4405
+ * @brief Call this API to enumerate media devices and their IDs, such as microphones, cameras, and headsets.
4406
+ * Call this API to get deviceId used to specify the device when calling [setAudioPlaybackDevice](#setaudioplaybackdevice), [startVideoCapture](#startvideocapture), and [startAudioCapture](#startaudiocapture).
3841
4407
  * @return A list of all media devices.
3842
- * @region Device Management
4408
+ * @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.
3843
4409
  */
3844
- getDevices(): Promise<RTCDevice[]>;
4410
+ enumerateDevices(): Promise<MediaDeviceInfo[]>;
3845
4411
 
3846
4412
  /**
3847
4413
  * @brief Call this API to request for access to video and audio devices.
3848
4414
  * @param options The device type you need
3849
- * <li>`video: boolean` Video devices<li>`audio:boolean` Audio devices</li>
3850
- * @return <li>`video: boolean` Video devices<li>`audio:boolean` Audio devices</li>
4415
+ * @return + `video: boolean` Video devices
4416
+ * + `audio:boolean` Audio devices
3851
4417
  * @region Device Management
3852
4418
  */
3853
4419
  enableDevices: (options?: {
4420
+
4421
+ /**
4422
+ * @brief Video devices
4423
+ */
3854
4424
  video: boolean;
4425
+
4426
+ /**
4427
+ * @brief Audio devices
4428
+ */
3855
4429
  audio: boolean;
3856
4430
  }) => Promise<{
3857
4431
  video: boolean;
@@ -3860,33 +4434,32 @@ export interface IVERTC {
3860
4434
 
3861
4435
  /**
3862
4436
  * @brief Call this API to enumerate microphone devices.
3863
- * Call this API to get Device IDs used to specify the device when calling [startAudioCapture](#startaudiocapture).
4437
+ * Call this API to get Device IDs used to specify the device when calling [startAudioCapture](#startaudiocapture).
3864
4438
  * @return A list including all microphone devices.
3865
- * @region Device Management
4439
+ * @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.
3866
4440
  */
3867
- getMicrophones: () => Promise<RTCDevice[]>;
4441
+ enumerateAudioCaptureDevices: () => Promise<MediaDeviceInfo[]>;
3868
4442
 
3869
4443
  /**
3870
- * @brief Call this API to enumerate audio and video devices and their IDs, such as microphone, camera, and headset.
3871
- * Call this API to get Device IDs used to specify the device when calling [startVideoCapture](#startvideocapture).
4444
+ * @brief Call this API to enumerate audio and video devices and their IDs, such as microphones, cameras, and headsets.
4445
+ * Call this API to get Device IDs used to specify the device when calling [startVideoCapture](#startvideocapture).
3872
4446
  * @return A list including all camera devices.
3873
- * @region Device Management
4447
+ * @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.
3874
4448
  */
3875
- getCameras: () => Promise<RTCDevice[]>;
4449
+ enumerateVideoCaptureDevices: () => Promise<MediaDeviceInfo[]>;
3876
4450
 
3877
4451
  /**
3878
4452
  * @brief Call this API to enumerate audio playback devices and their IDs, such as speakers and headsets.
3879
- * Call this API to get Device IDs used to specify the device when calling [setAudioPlaybackDevice](#setaudioplaybackdevice).
4453
+ * Call this API to get Device IDs used to specify the device when calling [setAudioPlaybackDevice](#setaudioplaybackdevice).
3880
4454
  * @return A list including all audio playback devices.
3881
- * @region Device Management
4455
+ * @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.
3882
4456
  */
3883
- getAudioPlayback: () => Promise<RTCDevice[]>;
4457
+ enumerateAudioPlaybackDevices: () => Promise<MediaDeviceInfo[]>;
3884
4458
 
3885
4459
  /**
3886
4460
  * @brief Call this API to check whether the browser is supported.
3887
- * @return
3888
- * + `True`: Supported
3889
- * - `False`: Not Supported
4461
+ * @return + `True`: Supported
4462
+ * + `False`: Not Supported
3890
4463
  * @region Engine Management
3891
4464
  */
3892
4465
  isSupported: () => Promise<boolean>;
@@ -3894,7 +4467,7 @@ export interface IVERTC {
3894
4467
  /**
3895
4468
  * @brief Gets the codec type supported by current browser.
3896
4469
  * If you have enabled vp8 codec, you can call the API to check whether the current browser supports vp8 encoding type before entering the room.
3897
- * @return 当前浏览器支持的编解码类型
4470
+ * @return Codec types supported by the current browser
3898
4471
  * @region Engine Management
3899
4472
  */
3900
4473
  getSupportedCodecs: () => Promise<string[]>;
@@ -3903,7 +4476,7 @@ declare class VERTC implements IVERTC {
3903
4476
  getSdkVersion: () => string;
3904
4477
  createEngine: (appId: string) => IRTCEngine;
3905
4478
  destroyEngine: (engine: IRTCEngine) => void;
3906
- getDevices: () => Promise<RTCDevice[]>;
4479
+ enumerateDevices: () => Promise<MediaDeviceInfo[]>;
3907
4480
  enableDevices: (options?: {
3908
4481
  video: boolean;
3909
4482
  audio: boolean;
@@ -3911,9 +4484,9 @@ declare class VERTC implements IVERTC {
3911
4484
  video: boolean;
3912
4485
  audio: boolean;
3913
4486
  }>;
3914
- getMicrophones: () => Promise<RTCDevice[]>;
3915
- getCameras: () => Promise<RTCDevice[]>;
3916
- getAudioPlayback: () => Promise<RTCDevice[]>;
4487
+ enumerateAudioCaptureDevices: () => Promise<MediaDeviceInfo[]>;
4488
+ enumerateVideoCaptureDevices: () => Promise<MediaDeviceInfo[]>;
4489
+ enumerateAudioPlaybackDevices: () => Promise<MediaDeviceInfo[]>;
3917
4490
  getParameter: typeof getParameter;
3918
4491
  setParameter: typeof setParameter;
3919
4492
  isSupported: () => Promise<boolean>;