@byteplus/rtc 4.43.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
  */
@@ -369,7 +374,7 @@ declare enum ErrorCode {
369
374
  START_PUBLIC_STREAM_BEFORE_JOIN = "START_PUBLIC_STREAM_BEFORE_JOIN",
370
375
 
371
376
  /**
372
- * @brief Reconnection with the server fails and SDK will no longer automatically retry. <br>
377
+ * @brief Reconnection with the server fails and SDK will no longer automatically retry.
373
378
  * Please leave room first and join room again, or contact technical support.
374
379
  */
375
380
  RECONNECT_FAILED = "RECONNECT_FAILED"
@@ -437,16 +442,16 @@ declare enum AudioMixingError {
437
442
  export interface IAudioMixingManager {
438
443
 
439
444
  /**
440
- * @brief Start playing audio files and mixes. <br>
441
- * 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>
442
- * @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.
443
448
  * If this method is repeatedly called with the same ID, the previous mix stops and the next mix starts.
444
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.
445
- * @param config Mix Sound configuration <br>
450
+ * @param config Mix Sound configuration.
446
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.
447
452
  * @return
448
- * @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>
449
- * + 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.
450
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.
451
456
  * @region Advanced Feature
452
457
  */
@@ -455,7 +460,7 @@ export interface IAudioMixingManager {
455
460
  /**
456
461
  * @brief Stop playing audio files and mixes
457
462
  * @param id ID of the mixing
458
- * @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.
459
464
  * + After calling this method to stop playing the audio file, the audio file will be automatically uninstalled.
460
465
  * @region Advanced Feature
461
466
  */
@@ -464,8 +469,8 @@ export interface IAudioMixingManager {
464
469
  /**
465
470
  * @brief Pause playing audio files and mixes
466
471
  * @param id ID of the mixing
467
- * @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>
468
- * + 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.
469
474
  * @region Advanced Feature
470
475
  */
471
476
  pauseAudioMixing(id: number): void;
@@ -473,21 +478,21 @@ export interface IAudioMixingManager {
473
478
  /**
474
479
  * @brief Resume playing audio files and mixing
475
480
  * @param id Mixing ID
476
- * @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.
477
482
  * @region Advanced Feature
478
483
  */
479
484
  resumeAudioMixing(id: number): void;
480
485
 
481
486
  /**
482
487
  * @brief Preload the specified audio file into memory
483
- * @param id Mix ID. For identifying the mix, please ensure that the mix ID is unique. <br>
484
- * If this method is called repeatedly with the same ID, the latter overrides the previous. <br>
485
- * 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.
486
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.
487
- * @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.
488
493
  * @return
489
- * @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>
490
- * + 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.
491
496
  * + The specified audio file preloaded by calling this method can be unloaded through [unloadAudioMixing](#unloadaudiomixing).
492
497
  * @region Advanced Feature
493
498
  */
@@ -503,9 +508,9 @@ export interface IAudioMixingManager {
503
508
  /**
504
509
  * @brief Adjust the volume of audio mixing, including audio files and PCM data.
505
510
  * @param id Mixing ID
506
- * @param volume The ratio of the mixing volume to the original volume. The range is `[0, 400]`. The recommended range is `[0, 100]`. <br>
507
- * + 0: Mute <br>
508
- * + 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
509
514
  * + 400: Maximum volume (with overflow protection)
510
515
  * @region Advanced Feature
511
516
  */
@@ -514,9 +519,8 @@ export interface IAudioMixingManager {
514
519
  /**
515
520
  * @brief Get volume of the audio files.
516
521
  * @param id Audio mix id
517
- * @return <br>
518
- * + `0`: Failure<br>
519
- * + `>0`: Successful. Volume<br>
522
+ * @return + `0`: Failure
523
+ * + `>0`: Successful. Volume
520
524
  * @region Advanced Feature
521
525
  */
522
526
  getAudioMixingVolume(id: number): number;
@@ -524,8 +528,7 @@ export interface IAudioMixingManager {
524
528
  /**
525
529
  * @brief Get audio file duration
526
530
  * @param id Mix ID
527
- * @return <br>
528
- * + > 0: Success, audio file duration, in milliseconds. <br>
531
+ * @return + > 0: Success, audio file duration, in milliseconds.
529
532
  * + < 0: Failure
530
533
  * @notes Before calling this method to obtain the length of the audio file, you need to call [preloadAudioMixing](#preloadaudiomixing) or [startAudioMixing](#startaudiomixing).
531
534
  * @region Advanced Feature
@@ -535,8 +538,7 @@ export interface IAudioMixingManager {
535
538
  /**
536
539
  * @brief Get audio file playback progress
537
540
  * @param id Mix ID
538
- * @return <br>
539
- * + > 0: Success, audio file playback progress, in milliseconds. <br>
541
+ * @return + > 0: Success, audio file playback progress, in milliseconds.
540
542
  * + < 0: Failed
541
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.
542
544
  * @region Advanced Feature
@@ -546,20 +548,20 @@ export interface IAudioMixingManager {
546
548
  /**
547
549
  * @brief Set the starting playback position of the audio file
548
550
  * @param id Mixing ID
549
- * @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.
550
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.
551
- * @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.
552
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.
553
555
  * @region Advanced Feature
554
556
  */
555
557
  setAudioMixingPosition(id: number, position: number): void;
556
558
 
557
559
  /**
558
- * @brief Start PCM mixing. <br>
560
+ * @brief Start PCM mixing.
559
561
  * To mix multiple PCM audio data, call this API multiple times with different ids.
560
- * @param type Mixing type <br>
562
+ * @param type Mixing type.
561
563
  * Whether the PCM data is mixed locally and sent to the remotes.
562
- * @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.
563
565
  * + To end PCM mixing, use [disableAudioMixingFrame](#disableaudiomixingframe).
564
566
  * @region Advanced Feature
565
567
  */
@@ -574,7 +576,7 @@ export interface IAudioMixingManager {
574
576
  /**
575
577
  * @brief Push PCM audio frame data for mixing
576
578
  * @param buffer Refer to [Browser documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioBuffer)
577
- * @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).
578
580
  * @region Advanced Feature
579
581
  */
580
582
  pushAudioMixingBuffer(buffer: AudioBuffer): void;
@@ -652,8 +654,8 @@ export interface MixOption {
652
654
 
653
655
  /**
654
656
  * @brief Mix playback times
655
- * @notes + Play_count < = 0: Infinite loop <br>
656
- * + Play_count == 1: Play once (default) <br>
657
+ * @notes + Play_count < = 0: Infinite loop
658
+ * + Play_count == 1: Play once (default)
657
659
  * + Play_count > 1: Play play_count times
658
660
  */
659
661
  playCount: number;
@@ -670,36 +672,17 @@ declare class EnhancedEventEmitter<EventTypes extends ValidEventTypes = string |
670
672
  }
671
673
 
672
674
  /**
673
- * @brief Information of media device
675
+ * @brief Information and state of a media device.
674
676
  */
675
- export interface RTCDevice {
677
+ export interface DeviceInfo {
676
678
 
677
679
  /**
678
- * @brief Device ID
679
- * Refer to the [browser documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaDeviceInfo)
680
+ * @brief Information of a media device. See [MediaDeviceInfo](https://developer.mozilla.org/en-US/docs/Web/API/MediaDeviceInfo).
680
681
  */
681
- deviceId: MediaDeviceInfo["deviceId"];
682
+ mediaDeviceInfo: MediaDeviceInfo;
682
683
 
683
684
  /**
684
- * @brief Device type
685
- * Refer to the [browser documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaDeviceInfo)
686
- */
687
- deviceType: MediaDeviceInfo["kind"];
688
-
689
- /**
690
- * @brief Device information
691
- * Refer to the [browser documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaDeviceInfo)
692
- */
693
- deviceInfo: MediaDeviceInfo;
694
-
695
- /**
696
- * @brief Device label
697
- * Refer to the [browser documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaDeviceInfo)
698
- */
699
- deviceName: MediaDeviceInfo["label"];
700
-
701
- /**
702
- * @brief Device state
685
+ * @brief Device state.
703
686
  */
704
687
  deviceState: "active" | "inactive";
705
688
  }
@@ -750,6 +733,53 @@ declare class AudioProfileManager {
750
733
  getOpusConfigStr(): string;
751
734
  get config(): IAudioConfig;
752
735
  }
736
+ declare enum StreamMixingEventType {
737
+
738
+ /**
739
+ * @brief Request a start to push the mixed stream to CDN.
740
+ */
741
+ START = 1,
742
+
743
+ /**
744
+ * @brief Success.
745
+ */
746
+ START_SUCCESS = 2,
747
+
748
+ /**
749
+ * @brief Failure.
750
+ */
751
+ START_FAILED = 3,
752
+
753
+ /**
754
+ * @brief Request a configuration update.
755
+ */
756
+ UPDATE = 4,
757
+
758
+ /**
759
+ * @brief Push the mixed stream after the configuration update.
760
+ */
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
+ }
753
783
  /**
754
784
  * @brief Cloud proxy informatio
755
785
  */
@@ -1009,6 +1039,7 @@ export interface LocalAudioStats {
1009
1039
  numChannels: number;
1010
1040
 
1011
1041
  /**
1042
+ * @hidden
1012
1043
  * @brief Sample rate of sending
1013
1044
  */
1014
1045
  sentSampleRate?: number;
@@ -1025,6 +1056,7 @@ export interface LocalVideoStats {
1025
1056
  sentKBitrate: number;
1026
1057
 
1027
1058
  /**
1059
+ * @hidden
1028
1060
  * @brief Frame rate of the source video
1029
1061
  */
1030
1062
  inputFrameRate?: number;
@@ -1045,11 +1077,13 @@ export interface LocalVideoStats {
1045
1077
  rendererOutputFrameRate?: number;
1046
1078
 
1047
1079
  /**
1080
+ * @hidden
1048
1081
  * @brief Target bitrate
1049
1082
  */
1050
1083
  targetKBitrate?: number;
1051
1084
 
1052
1085
  /**
1086
+ * @hidden
1053
1087
  * @brief Target frame rate
1054
1088
  */
1055
1089
  targetFrameRate?: number;
@@ -1070,6 +1104,7 @@ export interface LocalVideoStats {
1070
1104
  rtt: number;
1071
1105
 
1072
1106
  /**
1107
+ * @hidden
1073
1108
  * @brief Bitrate of encoding
1074
1109
  */
1075
1110
  encodedBitrate?: number;
@@ -1159,11 +1194,13 @@ export interface RemoteAudioStats {
1159
1194
  stallDuration?: number;
1160
1195
 
1161
1196
  /**
1197
+ * @hidden
1162
1198
  * @brief End-to-end delay, unit: ms
1163
1199
  */
1164
1200
  e2eDelay: number;
1165
1201
 
1166
1202
  /**
1203
+ * @hidden
1167
1204
  * @brief Sample rate of the playback
1168
1205
  */
1169
1206
  playoutSampleRate?: number;
@@ -1200,6 +1237,7 @@ export interface RemoteAudioStats {
1200
1237
  receivedSampleRate: number;
1201
1238
 
1202
1239
  /**
1240
+ * @hidden
1203
1241
  * @brief Video frozen rate
1204
1242
  */
1205
1243
  frozenRate?: number;
@@ -1215,11 +1253,13 @@ export interface RemoteAudioStats {
1215
1253
  concealmentEvent: number;
1216
1254
 
1217
1255
  /**
1256
+ * @hidden
1218
1257
  * @brief Sample rate of decoding
1219
1258
  */
1220
1259
  decSampleRate?: number;
1221
1260
 
1222
1261
  /**
1262
+ * @hidden
1223
1263
  * @brief Decoding duration, unit: s
1224
1264
  */
1225
1265
  decDuration?: number;
@@ -1256,6 +1296,7 @@ export interface RemoteVideoStats {
1256
1296
  decoderOutputFrameRate: number;
1257
1297
 
1258
1298
  /**
1299
+ * @hidden
1259
1300
  * @brief Frame rate of rendering
1260
1301
  */
1261
1302
  rendererOutputFrameRate?: number;
@@ -1271,6 +1312,7 @@ export interface RemoteVideoStats {
1271
1312
  stallDuration?: number;
1272
1313
 
1273
1314
  /**
1315
+ * @hidden
1274
1316
  * @brief End-to-end delay, unit: ms
1275
1317
  */
1276
1318
  e2eDelay: number;
@@ -1291,11 +1333,13 @@ export interface RemoteVideoStats {
1291
1333
  rtt: number;
1292
1334
 
1293
1335
  /**
1336
+ * @hidden
1294
1337
  * @brief Video frozen rate
1295
1338
  */
1296
1339
  frozenRate?: number;
1297
1340
 
1298
1341
  /**
1342
+ * @hidden
1299
1343
  * @brief Video index
1300
1344
  */
1301
1345
  videoIndex?: number;
@@ -1383,16 +1427,10 @@ declare enum EngineEventsTypes {
1383
1427
  * @brief Connection state changes.
1384
1428
  */
1385
1429
  onConnectionStateChanged = "onConnectionStateChanged",
1386
-
1387
- /**
1388
- * @brief A new media stream in the room
1389
- */
1390
- onStreamAdd = "onStreamAdd",
1391
-
1392
- /**
1393
- * @brief A media stream in the room has been stopped.
1394
- */
1395
- onStreamRemove = "onStreamRemove",
1430
+ onUserPublishStream = "onUserPublishStream",
1431
+ onUserUnpublishStream = "onUserUnpublishStream",
1432
+ onUserPublishScreen = "onUserPublishScreen",
1433
+ onUserUnpublishScreen = "onUserUnpublishScreen",
1396
1434
 
1397
1435
  /**
1398
1436
  * @brief Receiving a broadcasting message in the room
@@ -1414,16 +1452,6 @@ declare enum EngineEventsTypes {
1414
1452
  */
1415
1453
  onUserBinaryMessageReceived = "onUserBinaryMessageReceived",
1416
1454
 
1417
- /**
1418
- * @brief A visible user in the room mutes his/her audio.
1419
- */
1420
- onUserMuteAudio = "onUserMuteAudio",
1421
-
1422
- /**
1423
- * @brief A visible user in the room mutes his/her video.
1424
- */
1425
- onUserMuteVideo = "onUserMuteVideo",
1426
-
1427
1455
  /**
1428
1456
  * @brief The first video frame has been rendered successfully.
1429
1457
  */
@@ -1455,9 +1483,14 @@ declare enum EngineEventsTypes {
1455
1483
  onFirstPublicStreamAudioFrameDecoded = "onFirstPublicStreamAudioFrameDecoded",
1456
1484
 
1457
1485
  /**
1458
- * @brief The state of the media device changes.
1486
+ * @brief The state of the video media device changes.
1459
1487
  */
1460
- onMediaDeviceStateChanged = "onMediaDeviceStateChanged",
1488
+ onVideoDeviceStateChanged = "onVideoDeviceStateChanged",
1489
+
1490
+ /**
1491
+ * @brief The state of the audio media device changes.
1492
+ */
1493
+ onAudioDeviceStateChanged = "onAudioDeviceStateChanged",
1461
1494
 
1462
1495
  /**
1463
1496
  * @brief Callback including the state of the remote media stream
@@ -1512,6 +1545,7 @@ declare enum EngineEventsTypes {
1512
1545
  * @brief The state of pushing streams to CDN
1513
1546
  */
1514
1547
  onLiveTranscodingResult = "onLiveTranscodingResult",
1548
+ onStreamMixingEvent = "onStreamMixingEvent",
1515
1549
  onAudioPlaybackDeviceTestVolume = "onAudioPlaybackDeviceTestVolume",
1516
1550
  onSEIMessageReceived = "onSEIMessageReceived",
1517
1551
  onError = "onError",
@@ -1521,7 +1555,31 @@ declare enum EngineEventsTypes {
1521
1555
  onTokenWillExpire = "onTokenWillExpire",
1522
1556
  onCloudProxyConnected = "onCloudProxyConnected",
1523
1557
  onPushPublicStreamResult = "onPushPublicStreamResult",
1524
- 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;
1525
1583
  }
1526
1584
 
1527
1585
  /**
@@ -1562,22 +1620,6 @@ export interface onSEIMessageReceivedEvent {
1562
1620
  remoteStreamKey: RemoteStreamKey;
1563
1621
  }
1564
1622
 
1565
- /**
1566
- * @brief User mutes audio or video.
1567
- */
1568
- export interface UserMuteEvent {
1569
-
1570
- /**
1571
- * @brief User information, refer to [UserInfo](#userinfo) for more details.
1572
- */
1573
- userInfo: UserInfo;
1574
-
1575
- /**
1576
- * @brief Details of disabling audio or video.
1577
- */
1578
- muteState: MuteState;
1579
- }
1580
-
1581
1623
  /**
1582
1624
  * @brief The connection state changes.
1583
1625
  */
@@ -1653,58 +1695,58 @@ export interface AudioMixingStateChangedEvent {
1653
1695
  }
1654
1696
 
1655
1697
  /**
1656
- * @brief Information about local audio <br>
1698
+ * @brief Information about local audio
1657
1699
  */
1658
1700
  export interface LocalAudioPropertiesInfo {
1659
1701
 
1660
1702
  /**
1661
- * @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.
1662
1704
  */
1663
1705
  streamIndex: StreamIndex;
1664
1706
 
1665
1707
  /**
1666
1708
  * @type keytype
1667
- * @brief Audio information <br>
1709
+ * @brief Audio information
1668
1710
  */
1669
1711
  audioPropertiesInfo: AudioPropertiesInfo;
1670
1712
  }
1671
1713
 
1672
1714
  /**
1673
- * @brief Information about remote audio <br>
1715
+ * @brief Information about remote audio
1674
1716
  */
1675
1717
  export interface RemoteAudioPropertiesInfo {
1676
1718
 
1677
1719
  /**
1678
- * @brief Information about remote stream <br>
1720
+ * @brief Information about remote stream
1679
1721
  */
1680
1722
  streamKey: StreamKey;
1681
1723
 
1682
1724
  /**
1683
- * @brief Information about remote audio properties <br>
1725
+ * @brief Information about remote audio properties
1684
1726
  */
1685
1727
  audioPropertiesInfo: AudioPropertiesInfo;
1686
1728
  }
1687
1729
 
1688
1730
  /**
1689
- * @brief Audio information <br>
1731
+ * @brief Audio information
1690
1732
  */
1691
1733
  export interface AudioPropertiesInfo {
1692
1734
 
1693
1735
  /**
1694
- * @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>
1695
- * - [0, 25]: Silence <br>
1696
- * - [26, 75]: Low volume <br>
1697
- * - [76, 204]: Medium volume <br>
1698
- * - [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
1699
1741
  */
1700
1742
  linearVolume: number;
1701
1743
 
1702
1744
  /**
1703
- * @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>
1704
- * - [-127, -60]: Silence <br>
1705
- * - [-59, -40]: Low volume <br>
1706
- * - [-39, -20]: Medium volume <br>
1707
- * - [-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
1708
1750
  */
1709
1751
  nonlinearVolume: number;
1710
1752
  }
@@ -1725,10 +1767,42 @@ export interface StreamKey {
1725
1767
  userId: string;
1726
1768
 
1727
1769
  /**
1728
- * @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.
1729
1771
  */
1730
1772
  streamIndex: StreamIndex;
1731
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
+ }
1732
1806
 
1733
1807
  /**
1734
1808
  * @list 104477
@@ -1765,47 +1839,80 @@ export interface IEngineEvents {
1765
1839
  [EngineEventsTypes.onConnectionStateChanged]: (event: ConnectionStateChangeEvent) => void;
1766
1840
 
1767
1841
  /**
1768
- * @brief A new stream added into the room.
1769
- * @param event
1770
- * @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.
1771
1844
  */
1772
- [EngineEventsTypes.onStreamAdd]: (event: {
1845
+ [EngineEventsTypes.onUserPublishStream]: (event: {
1773
1846
 
1774
1847
  /**
1775
- * @brief `stream` object.
1848
+ * @brief ID of the remote user who published the stream
1776
1849
  */
1777
- stream: RTCStream;
1850
+ userId: string;
1851
+
1852
+ /**
1853
+ * @brief Remote stream type
1854
+ */
1855
+ mediaType: MediaType;
1778
1856
  }) => void;
1779
1857
 
1780
1858
  /**
1781
- * @brief Users will receive this event when a user in the room pauses/ resumes publishing audio stream.
1782
- * @param event
1783
- * @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.
1784
1861
  */
1785
- [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;
1786
1879
 
1787
1880
  /**
1788
- * @brief Users will receive this event when a user in the room pauses/ resumes publishing video stream.
1789
- * @region Room Management Event
1790
- * @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.
1791
1883
  */
1792
- [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;
1793
1896
 
1794
1897
  /**
1795
- * @brief Users will receive this event when a user in the room pauses/ resumes publishing audio stream.
1796
- * @param event
1797
- * @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.
1798
1900
  */
1799
- [EngineEventsTypes.onStreamRemove]: (event: {
1901
+ [EngineEventsTypes.onUserUnpublishScreen]: (event: {
1902
+
1903
+ /**
1904
+ * @brief ID of the remote user who removed the stream
1905
+ */
1906
+ userId: string;
1800
1907
 
1801
1908
  /**
1802
- * @brief Media stream
1803
- */
1804
- stream: RTCStream;
1909
+ * @brief Remote stream type
1910
+ */
1911
+ mediaType: MediaType;
1805
1912
 
1806
1913
  /**
1807
- * @brief Reason
1808
- */
1914
+ * @brief The reason for the removal
1915
+ */
1809
1916
  reason: StreamRemoveReason;
1810
1917
  }) => void;
1811
1918
 
@@ -1831,11 +1938,16 @@ export interface IEngineEvents {
1831
1938
  [EngineEventsTypes.onAudioFirstFrameDecoded]: (event: onAudioFirstFrameDecodedEvent) => void;
1832
1939
 
1833
1940
  /**
1834
- * @brief Event of media device state changing
1835
- * @param event Media device and its state
1836
- * @region Engine Management Event
1941
+ * @brief Event of video device state changing.
1942
+ * @param event Information and state of a media device.
1837
1943
  */
1838
- [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;
1839
1951
 
1840
1952
  /**
1841
1953
  * @brief Failure of automatically playing
@@ -1852,13 +1964,13 @@ export interface IEngineEvents {
1852
1964
  [EngineEventsTypes.onTrackEnded]: (event: {
1853
1965
 
1854
1966
  /**
1855
- * @brief Type of the trac
1856
- */
1967
+ * @brief Type of the trac
1968
+ */
1857
1969
  kind: string;
1858
1970
 
1859
1971
  /**
1860
- * @brief Whether it is a screen-sharing stream.
1861
- */
1972
+ * @brief Whether it is a screen-sharing stream.
1973
+ */
1862
1974
  isScreen: boolean;
1863
1975
  }) => void;
1864
1976
 
@@ -1870,13 +1982,13 @@ export interface IEngineEvents {
1870
1982
  [EngineEventsTypes.onRoomMessageReceived]: (event: {
1871
1983
 
1872
1984
  /**
1873
- * @brief userID of the message sender.
1874
- */
1985
+ * @brief userID of the message sender.
1986
+ */
1875
1987
  userId: string;
1876
1988
 
1877
1989
  /**
1878
- * @brief Contents of the message.
1879
- */
1990
+ * @brief Contents of the message.
1991
+ */
1880
1992
  message: any;
1881
1993
  }) => void;
1882
1994
 
@@ -1888,13 +2000,13 @@ export interface IEngineEvents {
1888
2000
  [EngineEventsTypes.onRoomBinaryMessageReceived]: (event: {
1889
2001
 
1890
2002
  /**
1891
- * @brief userID of the message sender
1892
- */
2003
+ * @brief userID of the message sender
2004
+ */
1893
2005
  userId: string;
1894
2006
 
1895
2007
  /**
1896
- * @brief Contents of the message
1897
- */
2008
+ * @brief Contents of the message
2009
+ */
1898
2010
  message: ArrayBuffer;
1899
2011
  }) => void;
1900
2012
 
@@ -1949,27 +2061,26 @@ export interface IEngineEvents {
1949
2061
  }) => void;
1950
2062
 
1951
2063
  /**
1952
- * @brief After calling [enableAudioPropertiesReport](104478#enableAudioPropertiesReport), you will periodically receive this callback for the information about local audio. <br>
1953
- * Local audio includes the microphone audio and the screen audio captured using RTC SDK internal mechanisms. <br>
1954
- * @param event Information about local audio. <br>
1955
- * @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
1956
2068
  */
1957
2069
  [EngineEventsTypes.onLocalAudioPropertiesReport]: (event: LocalAudioPropertiesInfo[]) => void;
1958
2070
 
1959
2071
  /**
1960
- * @brief After calling [enableAudioPropertiesReport](104478#enableAudioPropertiesReport), you will periodically receive this callback for the information about the subscribed remote audio streams. <br>
1961
- * The remote audio streams includes the microphone audio and screen audio collected using the RTC SDK internal mechanism/custom mechanism. <br>
1962
- * @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.
1963
2075
  * @region Audio Management
1964
2076
  */
1965
2077
  [EngineEventsTypes.onRemoteAudioPropertiesReport]: (event: RemoteAudioPropertiesInfo[]) => void;
1966
2078
 
1967
2079
  /**
1968
2080
  * @brief The current playback device has been changed successfully by calling [setAudioPlaybackDevice](104478#setAudioPlaybackDevice).
1969
- * @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.
1970
- * @region Audio Management Event
2081
+ * @param event Information of the media devices. See [MediaDeviceInfo](https://developer.mozilla.org/en-US/docs/Web/API/MediaDeviceInfo).
1971
2082
  */
1972
- [EngineEventsTypes.onAudioPlaybackDeviceChanged]: (event: RTCDevice) => void;
2083
+ [EngineEventsTypes.onAudioPlaybackDeviceChanged]: (event: MediaDeviceInfo) => void;
1973
2084
 
1974
2085
  /**
1975
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).
@@ -2079,6 +2190,8 @@ export interface IEngineEvents {
2079
2190
  [EngineEventsTypes.onAutoplayFailed]: (event: PlayerEvent) => void;
2080
2191
 
2081
2192
  /**
2193
+ * @hidden
2194
+ * @deprecated since 4.44, use onStreamMixingEvent instead.
2082
2195
  * @brief Result of the Pushing stream to CDN
2083
2196
  * @param event
2084
2197
  * @region Advanced Feature Event
@@ -2176,6 +2289,60 @@ export interface IEngineEvents {
2176
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.
2177
2290
  */
2178
2291
  [EngineEventsTypes.onAudioPlaybackDeviceTestVolume]: (volume: number) => void;
2292
+
2293
+ /**
2294
+ * @brief The callback reports the network quality of the local user every 2s after the user enters the room.
2295
+ */
2296
+ [EngineEventsTypes.onNetworkQuality]: (
2297
+
2298
+ /**
2299
+ * @brief Upstream network quality
2300
+ */
2301
+ uplinkNetworkQuality: NetworkQuality,
2302
+
2303
+ /**
2304
+ * @brief Downstream network quality
2305
+ */
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;
2179
2346
  }
2180
2347
 
2181
2348
  /**
@@ -2185,142 +2352,176 @@ export interface IEngineEvents {
2185
2352
  export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2186
2353
 
2187
2354
  /**
2188
- * @brief Join the room. <br>
2189
- * Call this method to join the room and make audio & video calls with other users in the room. <br>
2190
- * @param token Dynamic key. It is used for authentication and verification of users entering the room. <br>
2191
- * 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>
2192
- * Apps with different AppIDs are not interoperable. <br>
2193
- * 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>
2194
- * @param roomId The ID of the room to be added. <br>
2195
- * 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>
2196
- * 1. 26 capital letters A~ Z. <br>
2197
- * 2. 26 lowercase letters a~ z. <br>
2198
- * 3. 10 numbers 0~ 9. <br>
2199
- * 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 "-".
2200
2367
  * @param userInfo User information.
2201
2368
  * @param roomConfig Room parameter configuration, set the room mode and whether to automatically publish or subscribe to the flow.
2202
2369
  * @return
2203
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`.
2204
- * + 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>
2205
- * + 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.
2206
2373
  * @region Room Management
2207
2374
  */
2208
- 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>;
2209
2376
 
2210
2377
  /**
2211
- * @brief Leave the room. <br>
2212
- * The user calls this API to leave the room, end the call process, and release all call-related resources. <br>
2213
- * @notes + After visible users leave the room, other users in the room will receive [onUserLeave](104479#onuserleave) callback notification. <br>
2214
- * + 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.
2215
2382
  * @region Room Management
2216
2383
  */
2217
2384
  leaveRoom(waitAck?: boolean): Promise<void>;
2218
2385
 
2219
2386
  /**
2220
2387
  * @brief Destroy engine
2221
- * Destroy the engine instances created by calling [createEngine](#createengine) and release all related resources <br>
2222
- * @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>
2223
- * + Calling this API will destroy all memory related to this `RTCEngine` instance, and stop any interaction with the media server. <br>
2224
- * + 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.
2225
2392
  * @region Engine Management
2226
2393
  */
2227
2394
  destroy(): void;
2228
2395
 
2229
2396
  /**
2230
- * @brief Start publishing media streams.
2231
- * @return
2232
- * @notes + Call this API to publish media streams only when you have disabled Auto-Publish when calling [joinRoom](#joinroom).
2233
- * + An invisible user can not publish media streams. Call [setUserVisibility](#setuservisibility) to change the visibility of a user.
2234
- * + Users can only publish media streams in one room at the same time. Call [publishScreen](#publishscreen) to start screen sharing.
2235
- * + After publishing media streams by calling this API, other users in the room will be informed via [onStreamAdd](104479#onstreamadd).
2236
- * @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
2237
2405
  */
2238
- publish(): Promise<void>;
2406
+ publishStream(mediaType: MediaType): Promise<void>;
2239
2407
 
2240
2408
  /**
2241
- * @brief Stops publishing local media streams in the room.
2242
- * @return
2243
- * @notes + Call this API to stop publishing either started by calling [publish](#publish) or enabling Auto-Publish.
2244
- * + After stopping publishing media streams by calling this API, other users in the room will be informed via [onStreamRemove](104479#onstreamremove).
2245
- * @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
2246
2414
  */
2247
- unpublish(): Promise<void>;
2415
+ unpublishStream(mediaType: MediaType): Promise<void>;
2248
2416
 
2249
2417
  /**
2250
- * @brief Subscribe to media streams in the room. <br>
2251
- * Call this API to subscribe to media streams in the room regardless of subscription mode, either Auto or Manual. <br>
2252
- * Call this API to update the properties and configurations of the stream you have already subscribed to.
2253
- * @param userId User ID of the publisher of the subscribed media stream
2254
- * @param mediaType Mainstream or screen-sharing stream.
2255
- * @param streamType Media stream type to be subscribed to.
2256
- * @param configure Subscription configuration of video streams.
2257
- * @return
2258
- * @notes + Get the media stream information in the room from [onStreamAdd](104479#onstreamadd) and [onStreamRemove](104479#onstreamremove). <br>
2259
- * + 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.
2260
- * @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
2261
2424
  */
2262
- subscribeUserStream(userId: string, mediaType: SubscribeMediaType, streamType?: StreamIndex, configure?: SubscribeVideoConfig): Promise<void>;
2425
+ publishScreen(mediaType: MediaType): Promise<void>;
2263
2426
 
2264
2427
  /**
2265
- * @brief Stop subscribing to media streams in the room. <br>
2266
- * You can call this API to unsubscribe to media streams regardless of automatic or manual subscription mode. <br>
2267
- * @param userId User ID of the publisher of the subscribed media stream
2268
- * @param isScreen Whether the stream unsubscribed is a screen-sharing stream. <br>
2269
- * @return
2270
- * @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.
2271
- * @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
2433
+ */
2434
+ unpublishScreen(mediaType: MediaType): Promise<void>;
2435
+
2436
+ /**
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
2272
2464
  */
2273
- unSubscribe(userId: string, isScreen: boolean): Promise<void>;
2465
+ subscribeScreen(userId: string, mediaType: MediaType): Promise<void>;
2274
2466
 
2275
2467
  /**
2276
- * @brief Update Token. <br>
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.
2277
2478
  * You will receive [onTokenWillExpire](104479#ontokenwillexpire) 30 s before the Token expires. Call this API to submit a new Token.
2278
- * @param token A valid token <br>
2279
- * @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>
2280
- * + 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.
2281
2482
  * + The user will be removed from the room when the Token expires.
2282
2483
  * @region Room Management
2283
2484
  */
2284
2485
  updateToken(token: string): void;
2285
2486
 
2286
2487
  /**
2287
- * @brief Switch the microphone used for internal audio capture <br>
2288
- * @param deviceId
2289
- * @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
2290
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.
2291
2492
  */
2292
- switchMicrophone(deviceId: string): Promise<void>;
2493
+ setAudioCaptureDevice(deviceId: string): Promise<void>;
2293
2494
 
2294
2495
  /**
2295
- * @brief Switch the camera used for internal video capture <br>
2296
- * The default camera to be used depends on the web browser.
2297
- * @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.
2298
2498
  * @return
2299
- * @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.
2300
- * @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.
2301
2502
  */
2302
- switchCamera(deviceId: string): Promise<void>;
2503
+ setVideoCaptureDevice(deviceId: string): Promise<void>;
2303
2504
 
2304
2505
  /**
2305
2506
  * @brief Enable internal video capture. The default state is off.
2306
2507
  * Internal video capture refers to: capturing video using the built-in module.
2307
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.
2308
- * @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.
2309
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`.
2310
- * @notes + Call [stopVideoCapture](#stopvideocapture) to stop the internal video capture. Otherwise, the internal video capture will sustain until you destroy the engine instance.<br>
2311
- * + 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>
2312
- * + 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.
2313
2514
  * @region Video Management
2314
2515
  */
2315
2516
  startVideoCapture(deviceId?: string): Promise<MediaTrackSettings>;
2316
2517
 
2317
2518
  /**
2318
- * @brief Enable internal video capture immediately. The default setting is off. <br>
2519
+ * @brief Enable internal video capture immediately. The default setting is off.
2319
2520
  * Internal video capture refers to: capturing video using the built-in module.
2320
- * 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.
2321
2522
  * @return
2322
- * @notes + Call [startVideoCapture](#startvideocapture) to enable the internal video capture. <br>
2323
- * + 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.
2324
2525
  * @region Video Management
2325
2526
  */
2326
2527
  stopVideoCapture(): Promise<void>;
@@ -2329,21 +2530,21 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2329
2530
  * @brief Start internal audio capture. The default is off.
2330
2531
  * Internal audio capture refers to: capturing audio using the built-in module.
2331
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.
2332
- * @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.
2333
2534
  * @return
2334
- * @notes + Call [stopAudioCapture](#stopaudiocapture) to stop the internal audio capture. Otherwise, the internal audio capture will sustain until you destroy the engine instance. <br>
2335
- * + 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.
2336
2537
  * @region Audio Management
2337
2538
  */
2338
2539
  startAudioCapture(deviceId?: string): Promise<void>;
2339
2540
 
2340
2541
  /**
2341
- * @brief Stop internal audio capture. The default is off. <br>
2542
+ * @brief Stop internal audio capture. The default is off.
2342
2543
  * Internal audio capture refers to: capturing audio using the built-in module.
2343
- * 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.
2344
2545
  * @return
2345
- * @notes + Call [startAudioCapture](#startaudiocapture) to enable the internal audio capture. <br>
2346
- * + 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.
2347
2548
  * @region Audio Management
2348
2549
  */
2349
2550
  stopAudioCapture(): Promise<void>;
@@ -2352,9 +2553,9 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2352
2553
  * @brief Use the capture module provided by the RTC SDK to capture the current screen stream for sharing.
2353
2554
  * @param screenConfig Specify properties for the sharing screen.
2354
2555
  * @return
2355
- * @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>
2356
- * + To turn off screen video source capture, call [stopScreenVideoCapture](#stopScreenVideoCapture). <br>
2357
- * + 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.
2358
2559
  * @region Advanced Feature
2359
2560
  */
2360
2561
  startScreenCapture(screenConfig?: ScreenConfig): Promise<void>;
@@ -2367,26 +2568,6 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2367
2568
  */
2368
2569
  stopScreenCapture(): Promise<void>;
2369
2570
 
2370
- /**
2371
- * @brief Publish screen-sharing streams.
2372
- * @return
2373
- * @notes + You must join the room before you can call this API. <br>
2374
- * + This API is only available to visible users.
2375
- * + After the call, the remote receives the [onStreamAdd](104479#onstreamadd) callback. <br>
2376
- * + Call [unpublishScreen](#unpublishscreen) to unpublish.
2377
- * @region Advanced Feature
2378
- */
2379
- publishScreen(): Promise<void>;
2380
-
2381
- /**
2382
- * @brief Stop publishing screen-sharing streams.
2383
- * @return
2384
- * @notes + To start publishing, call [publishScreen](#publishscreen). <br>
2385
- * + After the call, the remote receives the [onStreamRemove](104479#onstreamremove) callback.
2386
- * @region Advanced Feature
2387
- */
2388
- unpublishScreen(): Promise<void>;
2389
-
2390
2571
  /**
2391
2572
  * @brief Bind a view to the local media stream and set the rendering mode for the rendering of the local stream
2392
2573
  * Listen to `onPlayerEvent` for the state after binding a view to the local video stream.
@@ -2410,15 +2591,15 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2410
2591
  setRemoteVideoPlayer(streamIndex: StreamIndex, videoPlayerOption: VideoPlayerOption): HTMLVideoElement | undefined;
2411
2592
 
2412
2593
  /**
2413
- * @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.
2414
2595
  * @param mirrorType Whether to turn on mirror mode.
2415
2596
  * @region Media Processing
2416
2597
  */
2417
2598
  setLocalVideoMirrorType(mirrorType: MirrorType): void;
2418
2599
 
2419
2600
  /**
2420
- * @brief Sets the speaker or the earpiece as the audio playback device. The audio playback device defaults to the speaker. <br>
2421
- * @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.
2422
2603
  * @return
2423
2604
  * @notes You can call this API before or after the user joins a room.
2424
2605
  * @region Audio Management
@@ -2434,39 +2615,16 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2434
2615
  */
2435
2616
  play(userId: string): Promise<void>;
2436
2617
 
2437
- /**
2438
- * @brief Enable/ Disable the transmission of the local audio stream.
2439
- * 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.
2440
- * @param muteState An identifier denoting whether the local audio stream is sending.
2441
- * @return
2442
- * @notes + Calling this API toggles the transmission state of the local audio streams instead of the capture state.
2443
- * + 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.
2444
- * @region Media Transmission
2445
- */
2446
- muteLocalAudio(muteState: MuteState): Promise<boolean>;
2447
-
2448
- /**
2449
- * @brief Enable/ Disable the transmission of the local video stream. The video stream is not sending by default.
2450
- * Call this API to start sending local video streams when using either internal capture module or custom video source. <br>
2451
- * 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.
2452
- * @param muteState An identifier denoting whether the local video stream is sending
2453
- * @return Sending state of the local video stream
2454
- * @notes + This API only controls the sending state of the local video stream and does not affect the local video acquisition state.
2455
- * + 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.
2456
- * @region Media Transmission
2457
- */
2458
- muteLocalVideo(muteState: MuteState): Promise<boolean>;
2459
-
2460
2618
  /**
2461
2619
  * @brief Pause receiving remote media streams.
2462
2620
  * @param mediaType Media stream type subscribed to.
2463
2621
  * @return
2464
- * @notes + Calling this API does not change the capture state and the transmission state of the remote clients. <br>
2465
- * + 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.
2466
2624
  * + To resume, call [resumeAllSubscribedStream](#resumeAllSubscribedStream).
2467
2625
  * @region Media Stream Transmission
2468
2626
  */
2469
- pauseAllSubscribedStream(mediaType: PauseResumeControlMediaType): Promise<void>;
2627
+ pauseAllSubscribedStream(mediaType: MediaType): Promise<void>;
2470
2628
 
2471
2629
  /**
2472
2630
  * @brief Resume receiving remote media streams
@@ -2476,43 +2634,43 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2476
2634
  * + Calling this API does not change any subscription configuration.
2477
2635
  * @region Media Transmission
2478
2636
  */
2479
- resumeAllSubscribedStream(mediaType: PauseResumeControlMediaType): Promise<void>;
2637
+ resumeAllSubscribedStream(mediaType: MediaType): Promise<void>;
2480
2638
 
2481
2639
  /**
2482
- * @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.
2483
2641
  * The recipient receives the message via [onUserMessageReceived](104479#onusermessagereceived) once the message is sent successfully.
2484
2642
  * @param userId User ID of the recipient
2485
- * @param message Text to be sent within 62KB<br>
2643
+ * @param message Text to be sent within 62KB
2486
2644
  * @return
2487
- * @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.
2488
2646
  * @region Message
2489
2647
  */
2490
2648
  sendUserMessage(userId: string, message: string): Promise<unknown> | undefined;
2491
2649
 
2492
2650
  /**
2493
- * @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.
2494
2652
  * The recipient receives the message via [onUserBinaryMessageReceived](104479#onuserbinarymessagereceived) once the message is sent successfully.
2495
2653
  * @param userId User ID of the recipient
2496
- * @param message Binary to be sent within 62KB<br>
2654
+ * @param message Binary to be sent within 62KB
2497
2655
  * @return
2498
- * @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.
2499
2657
  * @region Message
2500
2658
  */
2501
2659
  sendUserBinaryMessage(userId: string, message: ArrayBuffer): Promise<unknown>;
2502
2660
 
2503
2661
  /**
2504
- * @brief Send text messaging to all other users in the room.<br>
2662
+ * @brief Send text messaging to all other users in the room.
2505
2663
  * Users in the room will receive message via [onRoomMessageReceived](104479#onroommessagereceived) once the message is sent successfully.
2506
- * @param message Text to be sent within 62KB<br>
2664
+ * @param message Text to be sent within 62KB
2507
2665
  * @return
2508
2666
  * @region Message
2509
2667
  */
2510
2668
  sendRoomMessage(message: string): Promise<any> | undefined;
2511
2669
 
2512
2670
  /**
2513
- * @brief Send binary messaging to all other users in the room.<br>
2671
+ * @brief Send binary messaging to all other users in the room.
2514
2672
  * Users in the room will receive binary message via [onRoomBinaryMessageReceived](104479#onroombinarymessagereceived) once the message is sent successfully.
2515
- * @param message Binary message to be sent within 62KB<br>
2673
+ * @param message Binary message to be sent within 62KB
2516
2674
  * @return
2517
2675
  * @region Message
2518
2676
  */
@@ -2522,7 +2680,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2522
2680
  * @brief Send SEI message carried by video frames
2523
2681
  * @param streamIndex
2524
2682
  * @param message SEI message within 4kb. Empty message or message exceeding this size will not be sent with respective error prompt.
2525
- * @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].
2526
2684
  * Calling this API to add SEI data to consecutive `repeatCount` video frames starting from the current one.
2527
2685
  * @notes + Call this API to add SEI message to the video frame captured by the internal video capture module.
2528
2686
  * + SDK will abandon the SEI message if no video frame in 2s after you call this API.
@@ -2532,21 +2690,44 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2532
2690
  sendSEIMessage(streamIndex: StreamIndex, message: Uint8Array | string, repeatCount: number): void;
2533
2691
 
2534
2692
  /**
2535
- * @region Video Management
2536
2693
  * @brief Sets the video encoder configuration of the publishing streams.
2537
- * @param streamIndex
2538
- * @param descriptions The max parameters of the video stream.
2539
- * 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.
2540
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.
2541
- * @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
2542
2723
  */
2543
- setVideoEncoderConfig(streamIndex: StreamIndex, descriptions: VideoEncoderConfig | VideoEncoderConfig[]): Promise<void>;
2724
+ setRemoteVideoConfig(userId: string, remoteVideoConfig: RemoteVideoConfig): Promise<void>;
2544
2725
 
2545
2726
  /**
2546
2727
  * @region Video Management
2547
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.
2548
2729
  * @param enabled
2549
- * @param + You must call this API before publishing the video streams. <br>
2730
+ * @param + You must call this API before publishing the video streams.
2550
2731
  * + After enabling the simulcast mode, SDK automatically sets the encoding parameters for the video streams. For manual setting, call [setVideoEncoderConfig](#setVideoEncoderConfig).
2551
2732
  */
2552
2733
  enableSimulcastMode(enabled: boolean): boolean;
@@ -2554,22 +2735,22 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2554
2735
  /**
2555
2736
  * @hidden
2556
2737
  * @deprecated since 4.42, use enableAudioPropertiesReport instead
2557
- * @brief Turn on/off volume prompts. Off by default. <br>
2738
+ * @brief Turn on/off volume prompts. Off by default.
2558
2739
  * Call this API to set the report period of the volume information of local user and each subscribed user.
2559
2740
  * Local client will get informed of the the volume of local user and each subscribed users via [onAudioVolumeIndication](104479#onaudiovolumeindication).
2560
- * @param interval The time interval for receiving a volume prompt callback <br>
2561
- * It is recommended to set to greater than or equal to 200 milliseconds; when less than 10 milliseconds, the behavior is undefined. <br>
2562
- * + ≤ 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.
2563
2744
  * + > 0: Enable the volume prompt function and set the time interval for receiving the volume prompt callback. In milliseconds.
2564
2745
  * @region Room Management
2565
2746
  */
2566
2747
  setAudioVolumeIndicationInterval(interval?: number): void;
2567
2748
 
2568
2749
  /**
2569
- * @brief Enable audio information prompts. <br>
2570
- * @param config Audio information prompts-related configurations. <br>
2571
- * @notes With the prompt on, you can: <br>
2572
- * + 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).
2573
2754
  * + Get the information of the subscribed remote audio streams through [onRemoteAudioPropertiesReport](104479#onRemoteAudioPropertiesReport).
2574
2755
  * @region Audio Management
2575
2756
  */
@@ -2586,7 +2767,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2586
2767
  startLiveTranscoding(transcode: LiveTranscodeConfig): Promise<void>;
2587
2768
 
2588
2769
  /**
2589
- * @brief Update configuration needed when pushing media streams to CDN. <br>
2770
+ * @brief Update configuration needed when pushing media streams to CDN.
2590
2771
  * After calling [startLiveTranscoding](#startlivetranscoding) to enable the function of pushing streams to CDN, you can call this API to update the relevant configurations.
2591
2772
  * @param transcode Configurations that you want to update.
2592
2773
  * @region Advanced Feature
@@ -2602,25 +2783,25 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2602
2783
  stopLiveTranscoding(): Promise<void>;
2603
2784
 
2604
2785
  /**
2605
- * @brief Set the business ID. <br>
2786
+ * @brief Set the business ID.
2606
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.
2607
2788
  * @param businessId Your customized businessId
2608
2789
  * BusinessId is a tag, and you can customize its granularity.
2609
- * @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.
2610
2791
  * @region Engine Management
2611
2792
  */
2612
2793
  setBusinessId(businessId: string): boolean;
2613
2794
 
2614
2795
  /**
2615
- * @brief Set user visibility. Visible by default. <br>
2796
+ * @brief Set user visibility. Visible by default.
2616
2797
  * @param enable Visibility of the user in the room:
2617
- * + `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.
2618
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.
2619
2800
  * @return
2620
- * @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.
2621
2802
  * + When you call this API, the other users in the room will be informed via the related callback:
2622
- * - Switch from `false` to `true`: [onUserJoined](104479#onuserjoined)<br>
2623
- * - 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)
2624
2805
  * @region Room Management
2625
2806
  */
2626
2807
  setUserVisibility(enable: boolean): Promise<void>;
@@ -2689,11 +2870,11 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2689
2870
  setVideoCaptureConfig(config: TrackCaptureConfig): Promise<void>;
2690
2871
 
2691
2872
  /**
2692
- * @brief Log in to the RTM server. <br>
2873
+ * @brief Log in to the RTM server.
2693
2874
  * Call this method before users within the same `appID` can communicate with each other via messages.
2694
- * @param token Dynamic key. It is used for authentication and verification of users entering the room. <br>
2695
- * 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>
2696
- * 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.
2697
2878
  * @param userInfo User information.
2698
2879
  * @return
2699
2880
  * @notes
@@ -2774,9 +2955,9 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2774
2955
  /**
2775
2956
  * @brief Start cloud proxy
2776
2957
  * @param cloudProxyInfo cloud proxy informarion list.
2777
- * @notes + Call this API before joining the room.<br>
2778
- * + Start pre-call network detection after starting cloud proxy. <br>
2779
- * + 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).
2780
2961
  * + To stop cloud proxy, call [stopCloudProxy](#stopCloudProxy).
2781
2962
  */
2782
2963
  startCloudProxy(cloudProxyInfo: CloudProxyInfo): void;
@@ -2856,7 +3037,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2856
3037
  * @param filePath Image path in Http protocal; or Blob object.
2857
3038
  * The format of the image can be: JPG, PNG, or BMP.
2858
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.
2859
- * @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.
2860
3041
  * + You cannot see the image during local preview.
2861
3042
  */
2862
3043
  setDummyCaptureImagePath(index: StreamIndex, filePath: string): Promise<void>;
@@ -2867,6 +3048,29 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2867
3048
  */
2868
3049
  defaultTranscoding(): Required<LiveTranscodeConfig>;
2869
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
+
2870
3074
  /**
2871
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.
2872
3076
  * @param filePath Specify the path of the audio file for the playback test, including *.wav and *.mp3.
@@ -2891,15 +3095,15 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2891
3095
  * @notes + You can call this API whether the user is in a room.
2892
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.
2893
3097
  * + You must stop the test before starting another test for audio devices.
2894
- * + 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.
2895
3099
  * + This test performs locally and does not involve network connection testing.
2896
3100
  */
2897
3101
  startAudioDeviceRecordTest(indicationInterval: number): Promise<void>;
2898
3102
 
2899
3103
  /**
2900
3104
  * @brief Call this API to stop recording in the test and start to play the recording.
2901
- * @notes After calling this API, the recording starts playing during which you can call [stopAudioDeviceRecordTest](#stopaudiodevicerecordtest) to stop playing.
2902
- */
3105
+ * @notes After calling this API, the recording starts playing during which you can call [stopAudioDevicePlayTest](#stopaudiodeviceplaytest) to stop playing.
3106
+ */
2903
3107
  stopAudioDeviceRecordAndPlayTest(): void;
2904
3108
 
2905
3109
  /**
@@ -2960,7 +3164,7 @@ export interface UserInfo {
2960
3164
 
2961
3165
  /**
2962
3166
  * @brief ExtraInfo Additional information passed by the user, with a maximum length of 200 bytes. Callback to remote user in [onUserJoined](104479#onuserjoined).
2963
- * @notes Supports the following character set ranges <br>
3167
+ * @notes Supports the following character set ranges
2964
3168
  * + 26 uppercase letters A~ Z
2965
3169
  * + 26 lowercase letters a~ z
2966
3170
  * + 10 numbers 0~ 9
@@ -2985,7 +3189,7 @@ export declare enum UserOfflineReason {
2985
3189
  DROPPED = 1,
2986
3190
 
2987
3191
  /**
2988
- * @brief The remote client calls `setUserVisibility` to turn invisible.<br>
3192
+ * @brief The remote client calls `setUserVisibility` to turn invisible.
2989
3193
  */
2990
3194
  SWITCH_TO_INVISIBLE = 2,
2991
3195
 
@@ -3012,26 +3216,31 @@ export interface RoomConfig {
3012
3216
  * @brief Enable/disable auto-subscribe audio. Enable by default.
3013
3217
  * Call publish[104481#publish] to publish media streams if you disable `isAutoPublish`.
3014
3218
  */
3015
- isAutoPublish: boolean;
3219
+ isAutoPublish?: boolean;
3016
3220
 
3017
3221
  /**
3018
3222
  * @brief Enable/disable auto-subscribe audio. Enable by default.
3019
3223
  * Call subscribeUserStream, unsubscribe to revise the subscription.
3020
3224
  */
3021
- isAutoSubscribeAudio: boolean;
3225
+ isAutoSubscribeAudio?: boolean;
3022
3226
 
3023
3227
  /**
3024
3228
  * @brief Enable/disable auto-subscribe video. Enable by default.
3025
3229
  * Call subscribeUserStream, unsubscribe to revise the subscription.
3026
3230
  */
3027
- isAutoSubscribeVideo: boolean;
3231
+ isAutoSubscribeVideo?: boolean;
3028
3232
 
3029
3233
  /**
3030
- * @brief Room profile<br>
3234
+ * @brief Room profile
3031
3235
  * Choose an appropriate room-profile option to meet the requirement of the scenario for media encoding algorithm, video profiles, and network configurations.
3032
3236
  * Call [setAudioProfile](104478#setaudioprofile) to choose an audio quality option.
3033
3237
  */
3034
- roomProfileType: RoomProfileType;
3238
+ roomProfileType?: RoomProfileType;
3239
+
3240
+ /**
3241
+ * @brief Expected configuration of remote video stream.
3242
+ */
3243
+ remoteVideoConfig?: RemoteVideoConfig;
3035
3244
  }
3036
3245
 
3037
3246
  /**
@@ -3071,22 +3280,6 @@ export interface SubscribeConfig {
3071
3280
  subAudio: boolean;
3072
3281
  }
3073
3282
 
3074
- /**
3075
- * @brief Transmission/Playback state of the media stream
3076
- */
3077
- export declare enum MuteState {
3078
-
3079
- /**
3080
- * @brief Disable
3081
- */
3082
- MUTE_STATE_OFF = 0,
3083
-
3084
- /**
3085
- * @brief Enable
3086
- */
3087
- MUTE_STATE_ON = 1
3088
- }
3089
-
3090
3283
  /**
3091
3284
  * @brief Result of updating subscription
3092
3285
  */
@@ -3135,27 +3328,6 @@ export declare enum MirrorMode {
3135
3328
  MIRROR_MODE_ON = 1
3136
3329
  }
3137
3330
 
3138
- /**
3139
- * @brief Media stream type
3140
- */
3141
- export declare enum PauseResumeControlMediaType {
3142
-
3143
- /**
3144
- * @brief Audio
3145
- */
3146
- RTC_PAUSE_RESUME_CONTROL_AUDIO = 0,
3147
-
3148
- /**
3149
- * @brief Video
3150
- */
3151
- RTC_PAUSE_RESUME_CONTROL_VIDEO = 1,
3152
-
3153
- /**
3154
- * @brief Both video and audio
3155
- */
3156
- RTC_PAUSE_RESUME_CONTROL_AUDIO_AND_VIDEO = 2
3157
- }
3158
-
3159
3331
  /**
3160
3332
  * @brief Player information and rendering mode
3161
3333
  */
@@ -3172,7 +3344,7 @@ export interface VideoPlayerOption {
3172
3344
  renderMode?: VideoRenderMode;
3173
3345
 
3174
3346
  /**
3175
- * @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
3176
3348
  * + 26 uppercase letters A~ Z
3177
3349
  * + 26 lowercase letters a~ z
3178
3350
  * + 10 numbers 0~ 9
@@ -3187,14 +3359,14 @@ export interface VideoPlayerOption {
3187
3359
  export declare enum VideoRenderMode {
3188
3360
 
3189
3361
  /**
3190
- * @brief Windows fill priority. <br>
3191
- * 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.
3192
3364
  */
3193
3365
  RENDER_MODE_HIDDEN = 0,
3194
3366
 
3195
3367
  /**
3196
- * @brief All video frame contents are fit to display in the window. <br>
3197
- * 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.
3198
3370
  */
3199
3371
  RENDER_MODE_FIT = 1
3200
3372
  }
@@ -3232,45 +3404,32 @@ export declare enum StreamIndex {
3232
3404
  }
3233
3405
 
3234
3406
  /**
3235
- * @brief Type of the media stream subscribed to
3407
+ * @brief Media stream type
3236
3408
  */
3237
- export declare enum SubscribeMediaType {
3238
-
3239
- /**
3240
- * @brief Audio only
3241
- */
3242
- AUDIO_ONLY = 0,
3409
+ export declare enum MediaType {
3243
3410
 
3244
3411
  /**
3245
- * @brief Video only
3412
+ * @brief Controls audio only
3246
3413
  */
3247
- VIDEO_ONLY = 1,
3414
+ AUDIO = 1,
3248
3415
 
3249
3416
  /**
3250
- * @brief Both video and audio
3417
+ * @brief Controls video only
3251
3418
  */
3252
- AUDIO_AND_VIDEO = 2,
3419
+ VIDEO = 2,
3253
3420
 
3254
3421
  /**
3255
- * @brief Neither audio nor video
3422
+ * @brief Controls both audio and video
3256
3423
  */
3257
- NONE = 3
3424
+ AUDIO_AND_VIDEO = 3
3258
3425
  }
3259
3426
 
3260
3427
  /**
3261
3428
  * @brief Subscription configuration of video streams
3262
3429
  */
3263
- export interface SubscribeVideoConfig {
3264
-
3265
- /**
3266
- * @brief videoIndex Quality level of the video stream subscribed to. <br>
3267
- * 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>
3268
- */
3269
- videoIndex: number;
3270
- }
3271
3430
 
3272
3431
  /**
3273
- * @brief Stream property. <br>
3432
+ * @brief Stream property.
3274
3433
  */
3275
3434
  export interface RTCStream {
3276
3435
 
@@ -3295,45 +3454,45 @@ export interface RTCStream {
3295
3454
  hasAudio: boolean;
3296
3455
 
3297
3456
  /**
3298
- * @brief Properties of the video stream. <br>
3457
+ * @brief Properties of the video stream.
3299
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.
3300
3459
  */
3301
3460
  videoStreamDescriptions?: VideoStreamDescription[];
3302
3461
  }
3303
3462
 
3304
3463
  /**
3305
- * @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.
3306
3465
  *
3307
3466
  */
3308
3467
  export declare enum StreamRemoveReason {
3309
3468
 
3310
3469
  /**
3311
- * @brief The remote user stops publishing the stream. <br>
3470
+ * @brief The remote user stops publishing the stream.
3312
3471
  */
3313
3472
  STREAM_REMOVE_REASON_UNPUBLISH = 0,
3314
3473
 
3315
3474
  /**
3316
- * @brief The remote user failed to publish the stream. <br>
3475
+ * @brief The remote user failed to publish the stream.
3317
3476
  */
3318
3477
  STREAM_REMOVE_REASON_PUBLISH_FAILED = 1,
3319
3478
 
3320
3479
  /**
3321
- * @brief Keep alive failed. <br>
3480
+ * @brief Keep alive failed.
3322
3481
  */
3323
3482
  STREAM_REMOVE_REASON_KEEP_LIVE_FAILED = 2,
3324
3483
 
3325
3484
  /**
3326
- * @brief The remote user is disconnected. <br>
3485
+ * @brief The remote user is disconnected.
3327
3486
  */
3328
3487
  STREAM_REMOVE_REASON_CLIENT_DISCONNECTED = 3,
3329
3488
 
3330
3489
  /**
3331
- * @brief The remote user republishes the stream. <br>
3490
+ * @brief The remote user republishes the stream.
3332
3491
  */
3333
3492
  STREAM_REMOVE_REASON_REPUBLISH = 4,
3334
3493
 
3335
3494
  /**
3336
- * @brief Other reasons. <br>
3495
+ * @brief Other reasons.
3337
3496
  */
3338
3497
  STREAM_REMOVE_REASON_OTHER = 5
3339
3498
  }
@@ -3422,7 +3581,9 @@ export interface AudioVolumeInfo {
3422
3581
  export interface ScreenConfig {
3423
3582
 
3424
3583
  /**
3425
- * @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.
3426
3587
  */
3427
3588
  enableAudio?: boolean;
3428
3589
  }
@@ -3475,22 +3636,22 @@ export declare enum MirrorType {
3475
3636
  }
3476
3637
 
3477
3638
  /**
3478
- * @brief Configuration related to audio information prompt. <br>
3639
+ * @brief Configuration related to audio information prompt.
3479
3640
  */
3480
3641
  export interface AudioPropertiesConfig {
3481
3642
 
3482
3643
  /**
3483
- * @brief Prompt interval in ms, the default value is 100. <br>
3484
- * + `<= 0`: Turn off prompt <br>
3485
- * + `(0,100]`: Invalid interval value, and will be automatically reset to 100ms. <br>
3486
- * + `> 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
3487
3648
  */
3488
3649
  interval?: number;
3489
3650
 
3490
3651
  /**
3491
- * @brief Whether to keep audio information prompt on when you are not on the video/audio call webpage. The default setting is `true`. <br>
3492
- * + true: Keep the prompt on <br>
3493
- * + 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
3494
3655
  */
3495
3656
  enableInBackground?: boolean;
3496
3657
  }
@@ -3667,17 +3828,17 @@ export interface LiveTranscodeLayoutRegion {
3667
3828
  h: number;
3668
3829
 
3669
3830
  /**
3670
- * @brief The view mode to be set. See the following options: <br>
3671
- * + 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>
3672
- * + 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.
3673
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.
3674
3835
  */
3675
3836
  renderMode?: number;
3676
3837
 
3677
3838
  /**
3678
- * @brief The content to be set. The default value is 0. See the following options: <br>
3679
- * + 0: Push both audio and video stream. <br>
3680
- * + 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.
3681
3842
  * + 2: Push video stream only.
3682
3843
  */
3683
3844
  contentControl?: number;
@@ -3699,17 +3860,17 @@ export interface LiveTranscodeLayoutRegion {
3699
3860
  export interface RemoteStreamKey {
3700
3861
 
3701
3862
  /**
3702
- * @brief Room identification
3863
+ * @brief Room ID
3703
3864
  */
3704
3865
  roomId: string;
3705
3866
 
3706
3867
  /**
3707
- * @brief User identification
3868
+ * @brief User ID
3708
3869
  */
3709
3870
  userId: string;
3710
3871
 
3711
3872
  /**
3712
- * @brief Mainstream or screen-sharing stream. Refer to [StreamIndex](#streamIndex) for details.
3873
+ * @brief Mainstream or screen-sharing stream.
3713
3874
  */
3714
3875
  streamIndex: StreamIndex;
3715
3876
  }
@@ -3842,7 +4003,7 @@ export interface PublicStreamConfig {
3842
4003
  fps?: number;
3843
4004
 
3844
4005
  /**
3845
- * @brief Bitrate, unit: kbps<br>
4006
+ * @brief Bitrate, unit: kbps
3846
4007
  */
3847
4008
  kBitRate: number;
3848
4009
  };
@@ -3875,7 +4036,165 @@ export interface PublicStreamConfig {
3875
4036
  }
3876
4037
 
3877
4038
  /**
3878
- * @brief Room profile<br>
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
3879
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.
3880
4199
  * Call [setAudioProfile](104478#setaudioprofile) to choose an audio quality option if it is necessary.
3881
4200
  */
@@ -3883,12 +4202,12 @@ export declare enum RoomProfileType {
3883
4202
 
3884
4203
  /**
3885
4204
  * @brief Default mode for video/audio calls, such as voice chat room
3886
- */
4205
+ */
3887
4206
  communication = 0,
3888
4207
 
3889
4208
  /**
3890
4209
  * @brief For 1 v.s. 1 audio and video calls
3891
- */
4210
+ */
3892
4211
  chat = 5,
3893
4212
 
3894
4213
  /**
@@ -3925,42 +4244,42 @@ export declare enum AudioProfileType {
3925
4244
  default = 0,
3926
4245
 
3927
4246
  /**
3928
- * @brief Smooth <br>
3929
- * Sample rate: 16 KHz<br>
3930
- * Mono-channel<br>
4247
+ * @brief Smooth
4248
+ * Sample rate: 16 KHz
4249
+ * Mono-channel
3931
4250
  * Encoding birrate: 24 Kpbs
3932
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.
3933
4252
  */
3934
4253
  fluent = 1,
3935
4254
 
3936
4255
  /**
3937
- * @brief Mono-channel standard <br>
3938
- * Sample rate: 48 KHz<br>
3939
- * Encoding bitrate: 48 Kpbs<br>
4256
+ * @brief Mono-channel standard
4257
+ * Sample rate: 48 KHz
4258
+ * Encoding bitrate: 48 Kpbs
3940
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.
3941
4260
  */
3942
4261
  standard = 2,
3943
4262
 
3944
4263
  /**
3945
- * @brief Dual-channel music <br>
3946
- * Sample rate: 48 KHz<br>
3947
- * Encoding birrate: 128 Kpbs<br>
3948
- * 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. <br>
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.
3949
4268
  * Not recommended for game Apps.
3950
4269
  */
3951
4270
  hd = 3,
3952
4271
 
3953
4272
  /**
3954
- * @brief Dual-channel standard <br>
3955
- * Sample rate: 48 KHz<br>
4273
+ * @brief Dual-channel standard
4274
+ * Sample rate: 48 KHz
3956
4275
  * Encoding birrate: 80 Kpbs
3957
4276
  */
3958
4277
  standardStereo = 4,
3959
4278
 
3960
4279
  /**
3961
- * @brief Mono-channel music <br>
3962
- * Sample rate: 48 KHz<br>
3963
- * Encoding birrate: 128 Kpbs<br>
4280
+ * @brief Mono-channel music
4281
+ * Sample rate: 48 KHz
4282
+ * Encoding birrate: 128 Kpbs
3964
4283
  */
3965
4284
  hdMono = 5
3966
4285
  }
@@ -3998,6 +4317,7 @@ export interface UserBinaryMessageEvent {
3998
4317
  }
3999
4318
 
4000
4319
  /**
4320
+ * @hidden
4001
4321
  * @brief Event during pushing stream to CDN
4002
4322
  */
4003
4323
  export interface LiveTranscodingResultEvent {
@@ -4082,12 +4402,12 @@ export interface IVERTC {
4082
4402
  getSdkVersion(): string;
4083
4403
 
4084
4404
  /**
4085
- * @brief Call this API to enumerate media devices and their IDs, such as microphone, camera, and headset.
4086
- * 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).
4087
4407
  * @return A list of all media devices.
4088
- * @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.
4089
4409
  */
4090
- getDevices(): Promise<RTCDevice[]>;
4410
+ enumerateDevices(): Promise<MediaDeviceInfo[]>;
4091
4411
 
4092
4412
  /**
4093
4413
  * @brief Call this API to request for access to video and audio devices.
@@ -4114,27 +4434,27 @@ export interface IVERTC {
4114
4434
 
4115
4435
  /**
4116
4436
  * @brief Call this API to enumerate microphone devices.
4117
- * 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).
4118
4438
  * @return A list including all microphone devices.
4119
- * @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.
4120
4440
  */
4121
- getMicrophones: () => Promise<RTCDevice[]>;
4441
+ enumerateAudioCaptureDevices: () => Promise<MediaDeviceInfo[]>;
4122
4442
 
4123
4443
  /**
4124
- * @brief Call this API to enumerate audio and video devices and their IDs, such as microphone, camera, and headset.
4125
- * 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).
4126
4446
  * @return A list including all camera devices.
4127
- * @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.
4128
4448
  */
4129
- getCameras: () => Promise<RTCDevice[]>;
4449
+ enumerateVideoCaptureDevices: () => Promise<MediaDeviceInfo[]>;
4130
4450
 
4131
4451
  /**
4132
4452
  * @brief Call this API to enumerate audio playback devices and their IDs, such as speakers and headsets.
4133
- * 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).
4134
4454
  * @return A list including all audio playback devices.
4135
- * @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.
4136
4456
  */
4137
- getAudioPlayback: () => Promise<RTCDevice[]>;
4457
+ enumerateAudioPlaybackDevices: () => Promise<MediaDeviceInfo[]>;
4138
4458
 
4139
4459
  /**
4140
4460
  * @brief Call this API to check whether the browser is supported.
@@ -4156,7 +4476,7 @@ declare class VERTC implements IVERTC {
4156
4476
  getSdkVersion: () => string;
4157
4477
  createEngine: (appId: string) => IRTCEngine;
4158
4478
  destroyEngine: (engine: IRTCEngine) => void;
4159
- getDevices: () => Promise<RTCDevice[]>;
4479
+ enumerateDevices: () => Promise<MediaDeviceInfo[]>;
4160
4480
  enableDevices: (options?: {
4161
4481
  video: boolean;
4162
4482
  audio: boolean;
@@ -4164,9 +4484,9 @@ declare class VERTC implements IVERTC {
4164
4484
  video: boolean;
4165
4485
  audio: boolean;
4166
4486
  }>;
4167
- getMicrophones: () => Promise<RTCDevice[]>;
4168
- getCameras: () => Promise<RTCDevice[]>;
4169
- getAudioPlayback: () => Promise<RTCDevice[]>;
4487
+ enumerateAudioCaptureDevices: () => Promise<MediaDeviceInfo[]>;
4488
+ enumerateVideoCaptureDevices: () => Promise<MediaDeviceInfo[]>;
4489
+ enumerateAudioPlaybackDevices: () => Promise<MediaDeviceInfo[]>;
4170
4490
  getParameter: typeof getParameter;
4171
4491
  setParameter: typeof setParameter;
4172
4492
  isSupported: () => Promise<boolean>;