@byteplus/rtc 4.58.4 → 4.60.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
@@ -60,7 +60,7 @@ declare const Config: {
60
60
  VIDEO_STALL_DATA: number;
61
61
  AUDIO_STALL_DATA: number;
62
62
  IOS_SAFARI_ORIENTATION: boolean;
63
- FALLBACK_ENCODE_CODEC: string;
63
+ BLACK_FRAME_LIFETIME: number;
64
64
  };
65
65
  declare const _default: VERTC;
66
66
  declare enum AudioMixingError {
@@ -330,6 +330,10 @@ declare enum EngineEventsTypes {
330
330
  onUserMessageReceivedOutsideRoom = "onUserMessageReceivedOutsideRoom",
331
331
  onUserBinaryMessageReceivedOutsideRoom = "onUserBinaryMessageReceivedOutsideRoom",
332
332
  onTokenWillExpire = "onTokenWillExpire",
333
+ onTokenPublishPrivilegeWillExpire = "onTokenPublishPrivilegeWillExpire",
334
+ onTokenPublishPrivilegeDidExpired = "onTokenPublishPrivilegeDidExpired",
335
+ onTokenSubscribePrivilegeWillExpire = "onTokenSubscribePrivilegeWillExpire",
336
+ onTokenSubscribePrivilegeDidExpired = "onTokenSubscribePrivilegeDidExpired",
333
337
  onCloudProxyConnected = "onCloudProxyConnected",
334
338
  onPushPublicStreamResult = "onPushPublicStreamResult",
335
339
  onPublicStreamSEIMessageReceived = "onPublicStreamSEIMessageReceived",
@@ -350,7 +354,8 @@ declare enum EngineEventsTypes {
350
354
  onPublishRetry = "onPublishRetry",
351
355
  onSubscribeRetry = "onSubscribeRetry",
352
356
  onPublishResult = "onPublishResult",
353
- onSubscribeResult = "onSubscribeResult"
357
+ onSubscribeResult = "onSubscribeResult",
358
+ onSEIStreamUpdate = "onSEIStreamUpdate"
354
359
  }
355
360
  declare enum ErrorCode {
356
361
 
@@ -360,7 +365,7 @@ declare enum ErrorCode {
360
365
  INVALID_ENGINE = "INVALID_ENGINE",
361
366
 
362
367
  /**
363
- * @brief Generally used error code in the majority of features.. Triggered when you call any API with invalid parameters. Please refer to the API documentation and pass in the correct parameters.
368
+ * @brief Generally used error code. Triggered when you call any API with invalid parameters. Please refer to the API documentation and pass in the correct parameters.
364
369
  */
365
370
  INVALID_PARAMS = "INVALID_PARAMS",
366
371
 
@@ -489,6 +494,16 @@ declare enum ErrorCode {
489
494
  */
490
495
  TOKEN_EXPIRED = "TOKEN_EXPIRED",
491
496
 
497
+ /**
498
+ * @brief Token expired. Call `updateToken` to update publishing permission with the new token.
499
+ */
500
+ TOKEN_NO_PUBLISH_PERMISSION = "TOKEN_NO_PUBLISH_PERMISSION",
501
+
502
+ /**
503
+ * @brief Token expired. Call `updateToken` to update subscription permission with the new token.
504
+ */
505
+ TOKEN_NO_SUBSCRIBE_PERMISSION = "TOKEN_NO_SUBSCRIBE_PERMISSION",
506
+
492
507
  /**
493
508
  * @brief The user has been removed from the room because the same user joined the room on the other client. Triggered through the `onError` callback.
494
509
  */
@@ -544,7 +559,8 @@ declare enum ErrorCode {
544
559
  * @brief Operation not supported. Triggered when you call `startAudioDeviceRecordTest` or `setAudioPlaybackDevice` if the browser does not support audio device test or audio capture.
545
560
  */
546
561
  NOT_SUPPORTED = "NOT_SUPPORTED",
547
- /**
562
+
563
+ /**
548
564
  * @hidden no use
549
565
  */
550
566
  INTERRUPT = "INTERRUPT",
@@ -805,6 +821,20 @@ declare enum ErrorCode {
805
821
  */
806
822
  USER_FORBIDDEN = "USER_FORBIDDEN"
807
823
  }
824
+ declare enum SEIStreamEventType {
825
+
826
+ /**
827
+ * @brief A black frame video stream is published from the remote user.
828
+ * In the voice call scenario, when a remote user sends SEI data by calling [sendSEIMessage](104478#sendseimessage), the SDK will publish a black frame video stream and trigger this callback.
829
+ */
830
+ BLACK = 0,
831
+
832
+ /**
833
+ * @brief The black frame video stream is removed. The triggers for this callback include:
834
+ * <ul><li> When the remote user starts camera capture, switching from voice call to video call, the black frame video stream stops publishing. </li><li> When the remote user calls [setVideoSourceType](104478#setvideosourcetype) to switch to custom video capture, black frame video stream stops publishing. </li><li> If no SEI data is sent within 1 minute after the remote user calls [sendSEIMessage](104478#sendseimessage), the black frame video stream stops publishing. </li></ul>
835
+ */
836
+ NORMAL = 1
837
+ }
808
838
  declare enum StreamMixingEventErrorCode {
809
839
 
810
840
  /**
@@ -1025,6 +1055,22 @@ export declare enum AudioReportMode {
1025
1055
  AUDIOMIXING = 1
1026
1056
  }
1027
1057
 
1058
+ /**
1059
+ * @brief User priority in the audio selection
1060
+ */
1061
+ export declare enum AudioSelectionPriority {
1062
+
1063
+ /**
1064
+ * @brief Normal whether the stream can be subscribed is determined by the result of audio selection.
1065
+ */
1066
+ DEFAULT = 0,
1067
+
1068
+ /**
1069
+ * @brief Hight priority with which the stream can skip the audio selection and always be subscribable.
1070
+ */
1071
+ HIGH = 1
1072
+ }
1073
+
1028
1074
  /**
1029
1075
  * @brief Audio source type
1030
1076
  */
@@ -1112,7 +1158,8 @@ export declare enum FallbackOrRecoverReason {
1112
1158
  }
1113
1159
 
1114
1160
  /**
1115
- * @brief Forward stream error code.
1161
+ * @detail errorcode
1162
+ * @brief Forward stream error code. Returned through the [onForwardStreamError]({{callback}}#onForwardStreamError) callback.
1116
1163
  */
1117
1164
  export declare enum ForwardStreamError {
1118
1165
 
@@ -1453,7 +1500,6 @@ export declare enum StreamIndex {
1453
1500
 
1454
1501
  /**
1455
1502
  * @brief The reason for the removal of the remote stream in the room.
1456
- *
1457
1503
  */
1458
1504
  export declare enum StreamRemoveReason {
1459
1505
 
@@ -1485,7 +1531,12 @@ export declare enum StreamRemoveReason {
1485
1531
  /**
1486
1532
  * @brief Other reasons.
1487
1533
  */
1488
- STREAM_REMOVE_REASON_OTHER = 5
1534
+ STREAM_REMOVE_REASON_OTHER = 5,
1535
+
1536
+ /**
1537
+ * @brief token lose publish priviledge.
1538
+ */
1539
+ STREAM_REMOVE_REASON_TOKEN_PRIVILEGE_EXPIRED = 6
1489
1540
  }
1490
1541
 
1491
1542
  /**
@@ -1966,7 +2017,7 @@ export interface IAudioMixingManager {
1966
2017
  * @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.
1967
2018
  * @param config Mix Sound configuration.
1968
2019
  * 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.
1969
- * @return
2020
+ * @return `LOAD_RESOURCES_FAILED`: Loading resource failed. Please pass in the correct resource path.
1970
2021
  * @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).
1971
2022
  * + After you start playing the audio file and mixing, you can call the [stopAudioMixing](#stopaudiomixing) method to stop playing the audio file.
1972
2023
  * + The mixing data of this method comes from an external file, while the mixing data of [enableAudioMixingBuffer](#enableaudiomixingbuffer) comes from an external cache and the audio format is PCM. These two mixing methods can coexist.
@@ -2011,7 +2062,7 @@ export interface IAudioMixingManager {
2011
2062
  * 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.
2012
2063
  * 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.
2013
2064
  * @param filePath Used for mixing file paths. It can be the absolute path of the local file or the url of the online audio.
2014
- * @return
2065
+ * @return `LOAD_RESOURCES_FAILED`: Loading resource failed. Please pass in the correct resource path.
2015
2066
  * @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.
2016
2067
  * + This method pre-loads the specified audio file, and only calling [startAudioMixing](#startaudiomixing) API can you start playing the specified audio file.
2017
2068
  * + The specified audio file preloaded by calling this method can be unloaded through [unloadAudioMixing](#unloadaudiomixing).
@@ -2430,7 +2481,6 @@ export interface IEngineEvents {
2430
2481
  [EngineEventsTypes.onLocalStreamStats]: (stats: LocalStreamStats) => void;
2431
2482
 
2432
2483
  /**
2433
- * @hidden
2434
2484
  * @brief This 2 s periodical callback notifies information of the public stream after calling [startPlayPublicStream](104478#startplaypublicstream).
2435
2485
  * @param stats
2436
2486
  * @group Public Stream
@@ -2551,6 +2601,16 @@ export interface IEngineEvents {
2551
2601
  */
2552
2602
  [EngineEventsTypes.onSEIMessageReceived]: (event: onSEIMessageEvent) => void;
2553
2603
 
2604
+ /**
2605
+ * @brief Stream update event of stream that contains SEI information.
2606
+ * In a voice call scenario, when a remote user calls [sendSEIMessage](104478#sendseimessage) to send SEI data via the black frame video stream, the stream's sending status will be notified to the local user through this event callback.
2607
+ * If the video frame carrying SEI data is a black frame, you do not need to render the video frame.
2608
+ * @param event Stream containing SEI information update event.
2609
+ * @group Message
2610
+ * @order 61
2611
+ */
2612
+ [EngineEventsTypes.onSEIStreamUpdate]: (event: onSEIStreamUpdateEvent) => void;
2613
+
2554
2614
  /**
2555
2615
  * @brief Result of the Auto-Subscription
2556
2616
  * @param event
@@ -2656,13 +2716,68 @@ export interface IEngineEvents {
2656
2716
  [EngineEventsTypes.onUserBinaryMessageReceivedOutsideRoom]: (event: UserBinaryMessageEvent) => void;
2657
2717
 
2658
2718
  /**
2659
- * @brief You will receive this callback 30 s before the Token expires.
2660
- * Call [updateToken](104478#updatetoken) to submit a new Token。The user will be removed from the room when the Token expires.
2719
+ * @brief You will receive this callback 30 seconds before the Token expires.
2720
+ * Call [updateToken](104478#updatetoken) to submit a new Token. The user will be removed from the room when the Token expires.
2661
2721
  * @group Room Management
2662
2722
  * @order 45
2663
2723
  */
2664
2724
  [EngineEventsTypes.onTokenWillExpire]: () => void;
2665
2725
 
2726
+ /**
2727
+ * @brief This callback will be triggered 30 seconds before the token publishing permission expires.
2728
+ * Upon receiving this callback, call [updateToken](104478#updatetoken) to update the token.
2729
+ * @notes If the Token is not updated in time, the publishing permission will expire and the stream that is being published will stop. The publisher will receive the [onTokenPublishPrivilegeDidExpired](104479#ontokenpublishprivilegedidexpired) callback, and the remote user will receive the [onUserUnpublishStream](104479#onuserunpublishstream)/[onUserUnpublishScreen](104479#onuserunpublishscreen) callback, with the reason being `STREAM_REMOVE_REASON_TOKEN_PRIVILEGE_EXPIRED`.
2730
+ * @group Room Management
2731
+ * @order 50
2732
+ */
2733
+ [EngineEventsTypes.onTokenPublishPrivilegeWillExpire]: () => void;
2734
+
2735
+ /**
2736
+ * @brief This callback is triggered when the token publishing permission expires. Call [updateToken](104478#updatetoken) to update the Token.
2737
+ * @group Room Management
2738
+ * @order 51
2739
+ */
2740
+ [EngineEventsTypes.onTokenPublishPrivilegeDidExpired]: (e: {
2741
+
2742
+ /**
2743
+ * @brief The `TOKEN_NO_PUBLISH_PERMISSION` error code.
2744
+ */
2745
+ errorCode?: ErrorCode;
2746
+
2747
+ /**
2748
+ * @brief Error message.
2749
+ */
2750
+ message?: String;
2751
+ }) => void;
2752
+
2753
+ /**
2754
+ * @brief This callback will be triggered 30 seconds before the token subscription permission expires.
2755
+ * Upon receiving this callback, call [updateToken](104478#updatetoken) to update the token.
2756
+ * @notes If the Token is not updated in time after receiving this callback, the streams that have been subscribed to will be unsubscribed once the token subscription permission expires, and the subscriber will receive the [onTokenSubscribePrivilegeDidExpired](104479#ontokensubscribeprivilegedidexpired) callback.
2757
+ * Also, attempts to subscribe to new streams will fail, returning an error code `TOKEN_NO_SUBSCRIBE_PERMISSION`, indicating that the token subscription permission has expired.
2758
+ * @group Room Management
2759
+ * @order 55
2760
+ */
2761
+ [EngineEventsTypes.onTokenSubscribePrivilegeWillExpire]: () => void;
2762
+
2763
+ /**
2764
+ * @brief This callback is triggered when the token subscription permission expires. Call [updateToken](104478#updatetoken) to update the Token.
2765
+ * @group Room Management
2766
+ * @order 56
2767
+ */
2768
+ [EngineEventsTypes.onTokenSubscribePrivilegeDidExpired]: (e: {
2769
+
2770
+ /**
2771
+ * @brief The `TOKEN_NO_SUBSCRIBE_PERMISSION` error code.
2772
+ */
2773
+ errorCode?: ErrorCode;
2774
+
2775
+ /**
2776
+ * @brief Error message.
2777
+ */
2778
+ message?: String;
2779
+ }) => void;
2780
+
2666
2781
  /**
2667
2782
  * @brief Receives the callback when you call [startCloudProxy](104478#startcloudproxy) to start cloud proxy, and the SDK connects the proxy server successfully.
2668
2783
  * @param event
@@ -2670,7 +2785,6 @@ export interface IEngineEvents {
2670
2785
  [EngineEventsTypes.onCloudProxyConnected]: (event: CloudProxyConnectedEvent) => void;
2671
2786
 
2672
2787
  /**
2673
- * @hidden
2674
2788
  * @brief Callback of the result of publishing the public stream.
2675
2789
  * After calling [startPushPublicStream](104478#startpushpublicstream), you will be informed of the result through this callback.
2676
2790
  * @param event
@@ -2680,7 +2794,6 @@ export interface IEngineEvents {
2680
2794
  [EngineEventsTypes.onPushPublicStreamResult]: (event: PublicStreamResultEvent) => void;
2681
2795
 
2682
2796
  /**
2683
- * @hidden
2684
2797
  * @brief Callback of the SEI carried by the public video stream.
2685
2798
  * You will receive SEI by this callback if the public stream you subscribed to by calling [startPlayPublicStream](104478#startplaypublicstream) is carrying SEI.
2686
2799
  * @param event
@@ -2693,7 +2806,6 @@ export interface IEngineEvents {
2693
2806
  [EngineEventsTypes.onPublicStreamSEIMessageReceived]: (event: PublicStreamSEIMessageEvent) => void;
2694
2807
 
2695
2808
  /**
2696
- * @hidden
2697
2809
  * @brief Callback of the successful decoding of the first video frame of the public stream.
2698
2810
  * Refer to [startPlayPublicStream](104478#startplaypublicstream) for details about subscribing to a public stream.
2699
2811
  * @param event
@@ -2703,7 +2815,6 @@ export interface IEngineEvents {
2703
2815
  [EngineEventsTypes.onFirstPublicStreamVideoFrameDecoded]: (event: PublicStreamVideoFirstFrameDecodedEvent) => void;
2704
2816
 
2705
2817
  /**
2706
- * @hidden
2707
2818
  * @brief Callback of the successful decoding of the first audio frame of the public stream.
2708
2819
  * Refer to [startPlayPublicStream](104478#startplaypublicstream) for details about subscribing to a public stream.
2709
2820
  * @param event
@@ -2713,7 +2824,6 @@ export interface IEngineEvents {
2713
2824
  [EngineEventsTypes.onFirstPublicStreamAudioFrameDecoded]: (event: PublicStreamAudioFirstFrameDecodedEvent) => void;
2714
2825
 
2715
2826
  /**
2716
- * @hidden
2717
2827
  * @brief Callback of the successful rendering of the first video frame of the public stream.
2718
2828
  * Refer to [startPlayPublicStream](104478#startplaypublicstream) for details about subscribing to a public stream.
2719
2829
  * @param event
@@ -2910,12 +3020,18 @@ export interface IEngineEvents {
2910
3020
  screen: boolean;
2911
3021
  }) => void;
2912
3022
 
3023
+ /**
3024
+ * @hidden
3025
+ */
2913
3026
  [EngineEventsTypes.onPublishResult]: (e: {
2914
3027
  isScreen: boolean;
2915
3028
  isAutoPublish: boolean;
2916
3029
  errorCode?: ErrorCode;
2917
3030
  }) => void;
2918
3031
 
3032
+ /**
3033
+ * @hidden
3034
+ */
2919
3035
  [EngineEventsTypes.onSubscribeResult]: (e: {
2920
3036
  userId: string;
2921
3037
  isScreen: boolean;
@@ -2946,8 +3062,11 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2946
3062
  * @param roomId The Room ID. The string must conform to the regular expression: `[a-zA-Z0-9_@\-\.]{1,128}`.
2947
3063
  * @param userInfo User information.
2948
3064
  * @param roomConfig Room parameter configuration, set the room mode and whether to automatically publish or subscribe to the flow.
2949
- * @return The error code `ErrorCode.ROOM_FORBIDDEN` indicates that the user failed to enter the room because the room has been banned.
2950
- * The error code `ErrorCode.USER_FORBIDDEN` indicates that the user failed to enter the room because the user has been banned.
3065
+ * @return + `INVALID_TOKEN`: Failed to enter the room due to using an expired or invalid token.
3066
+ * + `JOIN_ROOM_FAILED`: Failed to enter the room. Please refer to the corresponding message for specific reasons.
3067
+ * + `REPEAT_JOIN`: Join the same room repeatedly.
3068
+ * + `ROOM_FORBIDDEN`: Failed to enter the room because the room has been banned.
3069
+ * + `USER_FORBIDDEN`: Failed to enter the room because the user has been banned.
2951
3070
  * @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`.
2952
3071
  * + 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.
2953
3072
  * + By default, the user is visible in an RTC room. Joining fails when the number of users in an RTC room reaches the upper limit. To avoid this, call [setUserVisibility](#setuservisibility) to change the visibility of the audience users to false by considering the capacity for the invisible users is much larger than that for visible users. An RTC room can accommodate a maximum of 50 visible users, and 30 media streams can be published simultaneously. For more information, see [Room Capability](257549).
@@ -2984,6 +3103,9 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2984
3103
  * + Call [publishScreen](#publishscreen) to start screen sharing.
2985
3104
  * + After you call this API, the other users in the room will receive [onUserPublishStream](104479#onuserpublishstream).
2986
3105
  * + Call [unpublishStream](#unpublishstream) to stop publishing streams.
3106
+ * @return + `NO_PUBLISH_PERMISSION`: No permission to publish streams. Please call [setUserVisibility](#setuservisibility) to switch the user to be visible first.
3107
+ * + `TOKEN_NO_PUBLISH_PERMISSION`: The Token has no publishing permission or the publishing permission has expired, call [updateToke](#updatetoken) to update the Token's publishing permission.
3108
+ * + `PUBLISH_FAILED`: Failed to publish a stream. Please check the returned message for the specific reason.
2987
3109
  * @group Audio & Video Transport
2988
3110
  * @order 0
2989
3111
  */
@@ -3005,6 +3127,9 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
3005
3127
  * @notes + An invisible user cannot publish media streams. Call [setUserVisibility](#setuservisibility) to change your visibility in the room.
3006
3128
  * + After you called this API, the other users in the room will receive [onUserPublishScreen](104479#onuserpublishscreen).
3007
3129
  * + Call [unpublishScreen](#unpublishscreen) to stop publishing screen sharing streams.
3130
+ * @return + `NO_PUBLISH_PERMISSION`: No permission to publish streams. Please call [setUserVisibility](#setuservisibility) to switch the user to be visible first.
3131
+ * + `TOKEN_NO_PUBLISH_PERMISSION`: The Token has no publishing permission or the publishing permission has expired, call [updateToke](#updatetoken) to update the Token's publishing permission.
3132
+ * + `PUBLISH_FAILED`: Failed to publish a stream. Please check the returned message for the specific reason.
3008
3133
  * @group Screen Sharing
3009
3134
  * @order 10
3010
3135
  */
@@ -3025,8 +3150,9 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
3025
3150
  * You can call this API in both automatic subscription mode and manual subscription mode.
3026
3151
  * @param userId The ID of the remote user who published the target audio/video stream.
3027
3152
  * @param mediaType Media stream type, used for specifying whether to subscribe to the audio stream or the video stream.
3028
- * @notes You must first get the remote stream
3029
- * information through [onUserPublishStream](104479#onuserpublishstream) before calling this API to subscribe to streams accordingly.
3153
+ * @notes You must first get the remote stream information through [onUserPublishStream](104479#onuserpublishstream) before calling this API to subscribe to streams accordingly.
3154
+ * @return + `STREAM_NOT_EXIST`: The target stream does not exist. Please enter the correct ID or make sure that the target stream is in the room.
3155
+ * + `TOKEN_NO_SUBSCRIBE_PERMISSION`: The Token has no subscription permission or the subscription permission has expired, call [updateToke](#updatetoken) to update the Token's subscription permission.
3030
3156
  * @group Audio & Video Transport
3031
3157
  * @order 5
3032
3158
  */
@@ -3037,6 +3163,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
3037
3163
  * You can call this API in both automatic subscription mode and manual subscription mode.
3038
3164
  * @param userId The ID of the remote user who published the target audio/video stream.
3039
3165
  * @param mediaType Media stream type, used for specifying whether to unsubscribe from the audio stream or the video stream.
3166
+ * @return `STREAM_NOT_EXIST`: The target stream does not exist. Please enter the correct ID or make sure that the target stream is in the room.
3040
3167
  * @group Audio & Video Transport
3041
3168
  * @order 6
3042
3169
  */
@@ -3048,6 +3175,8 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
3048
3175
  * @param userId The ID of the remote user who published the target screen audio/video stream.
3049
3176
  * @param mediaType Media stream type, used for specifying whether to subscribe to the audio stream or the video stream.
3050
3177
  * @notes You must first get the remote stream information through [onUserPublishScreen](104479#onuserpublishscreen) before calling this API to subscribe to streams accordingly.
3178
+ * @return + `STREAM_NOT_EXIST`: The target stream does not exist. Please enter the correct ID or make sure that the target stream is in the room.
3179
+ * + `TOKEN_NO_SUBSCRIBE_PERMISSION`: The Token has no subscription permission or the subscription permission has expired, call [updateToke](#updatetoken) to update the Token's subscription permission.
3051
3180
  * @group Screen Sharing
3052
3181
  * @order 15
3053
3182
  */
@@ -3065,15 +3194,17 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
3065
3194
 
3066
3195
  /**
3067
3196
  * @brief Update Token.
3068
- * You will receive [onTokenWillExpire](104479#ontokenwillexpire) 30 s before the Token expires. Call this API to submit a new Token.
3197
+ * You will receive [onTokenWillExpire](104479#ontokenwillexpire) 30 s before the Token expires. Call this API to submit a new Token.
3069
3198
  * @param token A valid token.
3070
3199
  * @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.
3071
3200
  * + 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.
3072
3201
  * + The user will be removed from the room when the Token expires.
3202
+ * @return + `UPDATE_TOKEN_WITH_INVALID_TOKEN`: Invalid Token.
3203
+ * + `UPDATE_TOKEN_BEFORE_JOIN`: The user has not joined a room yet. Please make sure the user is already in the room.
3073
3204
  * @group Room Management
3074
3205
  * @order 5
3075
3206
  */
3076
- updateToken: (token: string) => void;
3207
+ updateToken: (token: string) => Promise<void>;
3077
3208
 
3078
3209
  /**
3079
3210
  * @brief Switch the microphone used for internal audio capturing.
@@ -3103,6 +3234,10 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
3103
3234
  * 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.
3104
3235
  * @param deviceId ID of the capture device which you need to pass in to avoid exceptions such as no screen or a screen that is not the desired one. You can call [enumerateDevices](#enumeratedevices) to obtain the list of devices.
3105
3236
  * @return The actual effective video capture parameters. See [MediaTrackSettings](https://developer.mozilla.org/en-US/docs/Web/API/MediaTrackSettings). Pay attention to the properties: `frameRate`, `height`, and `width`.
3237
+ * The following error codes may be returned.
3238
+ * + `REPEAT_CAPTURE`: Capture has already started.
3239
+ * + `GET_VIDEO_TRACK_FAILED`: Capture failed. Please check if there are available capture devices or if they are being used by other apps.
3240
+ * + `STREAM_TYPE_NOT_MATCH`: Wrong stream type. Triggered when you call internal capture APIs after switch to the custom stream source with setVideoSourceType.
3106
3241
  * @notes + Call [stopVideoCapture](#stopvideocapture) to stop the internal video capture. Otherwise, the internal video capture will sustain until you destroy the engine instance.
3107
3242
  * + 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.
3108
3243
  * + Call [setVideoCaptureDevice](#setvideocapturedevice) to switch the camera used by the internal video capture module.
@@ -3115,7 +3250,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
3115
3250
  * @brief Enable internal video capture immediately. The default setting is off.
3116
3251
  * Internal video capture refers to: capturing video using the built-in module.
3117
3252
  * 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.
3118
- * @return
3253
+ * @return `STREAM_TYPE_NOT_MATCH`: Wrong stream type. Triggered when you call internal capture APIs after switch to the custom stream source with setVideoSourceType.
3119
3254
  * @notes + Call [startVideoCapture](#startvideocapture) to enable the internal video capture.
3120
3255
  * + Without calling this API the internal video capture will sustain until you destroy the engine instance.
3121
3256
  * @group Video Management
@@ -3129,6 +3264,10 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
3129
3264
  * 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.
3130
3265
  * @param deviceId ID of the capture device which you need to pass in to avoid exceptions such as no sound. You can call [enumerateDevices](#enumeratedevices) to obtain the list of devices.
3131
3266
  * @return The actual effective audio capture parameters. See [MediaTrackSettings](https://developer.mozilla.org/en-US/docs/Web/API/MediaTrackSettings).
3267
+ * The following error codes may be returned.
3268
+ * + `REPEAT_CAPTURE`: Capture has already started.
3269
+ * + `GET_AUDIO_TRACK_FAILED`: Capture failed. Please check if there are available capture devices or if they are being used by other apps.
3270
+ * + `STREAM_TYPE_NOT_MATCH`: Wrong stream type. Triggered when you call internal capture APIs after switch to the custom stream source with setAudioSourceType.
3132
3271
  * @notes + Call [stopAudioCapture](#stopaudiocapture) to stop the internal audio capture. Otherwise, the internal audio capture will sustain until you destroy the engine instance.
3133
3272
  * + 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.
3134
3273
  * @group Audio Management
@@ -3140,7 +3279,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
3140
3279
  * @brief Stop internal audio capture. The default is off.
3141
3280
  * Internal audio capture refers to: capturing audio using the built-in module.
3142
3281
  * 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.
3143
- * @return
3282
+ * @return `STREAM_TYPE_NOT_MATCH`: Wrong stream type. Triggered when you call internal capture APIs after switch to the custom stream source with setAudioSourceType.
3144
3283
  * @notes + Call [startAudioCapture](#startaudiocapture) to enable the internal audio capture.
3145
3284
  * + Without calling this API the internal audio capture will sustain until you destroy the engine instance.
3146
3285
  * @group Audio Management
@@ -3154,6 +3293,11 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
3154
3293
  * @param optionsOrAudioDeviceId When using a single parameter, both audio and video device IDs can be set simultaneously. When using two parameters, the audio device's ID can be set.
3155
3294
  * @param videoDeviceId Video device's ID.
3156
3295
  * @return The actual audio and video capture parameters that take effect. Refer to [MediaTrackSettings](https://developer.mozilla.org/en-US/docs/Web/API/MediaTrackSettings). Pay attention to the properties: `deviceId`, `channelCount`, `sampleRate`, `frameRate`, `height` and `width`.
3296
+ * The following error codes may be returned.
3297
+ * + `REPEAT_CAPTURE`: Capture has already started.
3298
+ * + `GET_AUDIO_TRACK_FAILED`: Audio capture failed. Please check if there are available capture devices or if they are being used by other apps.
3299
+ * + `GET_VIDEO_TRACK_FAILED`: Video capture failed. Please check if there are available capture devices or if they are being used by other apps.
3300
+ * + `STREAM_TYPE_NOT_MATCH`: Wrong stream type. Triggered when you call internal capture APIs after switch to the custom stream source with setAudioSourceType or setVideoSourceType.
3157
3301
  * @notes + The audio and video capture can be published using [publishStream](#publishstream) and unpublished using [unPublishStream](#unpublishstream).
3158
3302
  * + The method cannot be called simultaneously with [startVideoCapture](#startvideocapture) / [startAudioCapture](#startaudiocapture).
3159
3303
  * + If either the camera or the microphone fails to complete the capture when calling this method, the audio and video capture will fail.
@@ -3197,10 +3341,10 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
3197
3341
  /**
3198
3342
  * @brief Use the capture module provided by the RTC SDK to capture the current screen stream for sharing.
3199
3343
  * @param screenConfig Specify properties for the sharing screen.
3200
- * @return
3344
+ * @return `GET_SCREEN_TRACK_FAILED`: Capture failed.
3201
3345
  * @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).
3202
- * + To turn off screen video source capture, call [stopScreenCapture](#stopscreencapture).
3203
- * + Before calling this API, you can call [setScreenEncoderConfig](#setscreenencoderconfig) to set the capture frame rate and encoding resolution of the screen video stream.
3346
+ * + To turn off screen video source capture, call [stopScreenCapture](#stopscreencapture).
3347
+ * + Before calling this API, you can call [setScreenEncoderConfig](#setscreenencoderconfig) to set the capture frame rate and encoding resolution of the screen video stream.
3204
3348
  * @group Screen Sharing
3205
3349
  * @order 0
3206
3350
  */
@@ -3228,8 +3372,8 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
3228
3372
 
3229
3373
  /**
3230
3374
  * @brief Bind a view to the remote media stream and set the rendering mode for the rendering of the remote stream
3231
- * It's recommended to call this API and bind a view once the event of [onUserPublishStream](104479#onuserpublishstream)/[onUserPublishScreen](104479#onuserpublishscreen) is triggered.
3232
- * Call this API again with a blank view to unbind the view from the remote video stream.
3375
+ * It is recommended to call this API and bind a view once the event of [onUserPublishStream](104479#onuserpublishstream)/[onUserPublishScreen](104479#onuserpublishscreen) is triggered.
3376
+ * Call this API again with a blank view to unbind the view from the remote video stream.
3233
3377
  * @param streamIndex Video stream properties
3234
3378
  * @param videoPlayerOption View information and rendering mode. Starting from version 4.56, you can set the rotation angle of the remote video rendering using `rotation`.
3235
3379
  * @notes You should bind the view after the user joins a room. This setting will sustain when the user leaves the room.
@@ -3249,7 +3393,8 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
3249
3393
  /**
3250
3394
  * @brief Sets the speaker or the earpiece as the audio playback device. The audio playback device defaults to the speaker.
3251
3395
  * @param deviceId ID of the audio playback device. Call [enumerateDevices](#enumeratedevices) to get device ID.
3252
- * @return
3396
+ * @return + `INVALID_DEVICE_ID`: Invalid device ID.
3397
+ * + `NOT_SUPPORTED`: The browser does not support audio device test or audio capture.
3253
3398
  * @notes You can call this API before or after the user joins a room.
3254
3399
  * @group Audio Management
3255
3400
  * @order 1
@@ -3299,7 +3444,11 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
3299
3444
  * The recipient receives the message via [onUserMessageReceived](104479#onusermessagereceived) once the message is sent successfully.
3300
3445
  * @param userId User ID of the recipient
3301
3446
  * @param message Text to be sent within 64 KB
3302
- * @return
3447
+ * @return + `USER_MESSAGE_TIMEOUT`: P2P message failed to be sent due to a timeout.
3448
+ * + `USER_MESSAGE_BROKEN`: P2P message failed to be sent due to a the broken channel.
3449
+ * + `USER_MESSAGE_NO_RECEIVER`: No receiver. Please make sure you pass in the right userId.
3450
+ * + `USER_MESSAGE_NOT_JOIN`: The sender has not joined any room.
3451
+ * + `USER_MESSAGE_UNKNOWN`: Unknown error.
3303
3452
  * @notes Call [joinRoom](#joinroom) to join the room before calling this API.
3304
3453
  * @group Message
3305
3454
  * @order 0
@@ -3311,7 +3460,11 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
3311
3460
  * The recipient receives the message via [onUserBinaryMessageReceived](104479#onuserbinarymessagereceived) once the message is sent successfully.
3312
3461
  * @param userId User ID of the recipient
3313
3462
  * @param message Binary to be sent within 64 KB
3314
- * @return
3463
+ * @return + `USER_MESSAGE_TIMEOUT`: P2P message failed to be sent due to a timeout.
3464
+ * + `USER_MESSAGE_BROKEN`: P2P message failed to be sent due to a the broken channel.
3465
+ * + `USER_MESSAGE_NO_RECEIVER`: No receiver. Please make sure you pass in the right userId.
3466
+ * + `USER_MESSAGE_NOT_JOIN`: The sender has not joined any room.
3467
+ * + `USER_MESSAGE_UNKNOWN`: Unknown error.
3315
3468
  * @notes Call [joinRoom](#joinroom) to join the room before calling this API.
3316
3469
  * @group Message
3317
3470
  * @order 1
@@ -3339,14 +3492,21 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
3339
3492
  sendRoomBinaryMessage: (message: ArrayBuffer) => Promise<any> | undefined;
3340
3493
 
3341
3494
  /**
3342
- * @brief Send SEI message carried by video frames
3343
- * @param streamIndex Stream index. You must use video stream for SEI.
3495
+ * @brief Send supplemental enhancement information (SEI) through video frames.
3496
+ * In the video call scenario, the SEI data will be sent with the video frames. In the voice call scenario, the SDK will generate a 16px × 16px black frame video stream to send the data.
3497
+ * @param streamIndex Specify the type of media stream carrying SEI information. In the voice call scenario, it is recommended to set this value to `STREAM_INDEX_MAIN`.
3344
3498
  * @param message SEI message within 4 KB. Empty message or message exceeding this size will not be sent with respective error prompt.
3345
- * @param repeatCount Number of message sending repetitions. The value range is [0, max{29, %{video frame rate}-1}]. Recommended range: [2,4].
3346
- * Calling this API to add SEI data to consecutive `repeatCount` video frames starting from the current one.
3347
- * @notes + Call this API to add SEI message to the video frame captured by the internal video capture module.
3348
- * + SDK will abandon the SEI message if no video frame in 2s after you call this API.
3349
- * + Users receiving the stream will receive the SEI message via [onSEIMessageReceived](104479#onseimessagereceived) once the SEI message is sent successfully.
3499
+ * @param repeatCount Number of times a message is sent repeatedly. The SEI will be added to a consecutive `repeatCount+1` number of video frames starting from the current frame. The value range is `[0, min{30, %{video frame rate}×2}]`, and the recommended range is `[2,4]`.
3500
+ * @notes + **Compatibility**<br/>
3501
+ * &ensp; - SEI messages only support H.264 encoding, and use on browsers with Chromium 86+.
3502
+ * &ensp; - Android devices do not support sending SEI data in voice call scenarios.
3503
+ * &ensp; - SEI messages cannot be used on iOS devices.
3504
+ * + In voice call scenarios, you still need to publish and subscribe to video streams, instead of audio streams.<br/>
3505
+ * &ensp; - The publisher can enable automatic publishing when entering the room, or call [publishStream](#publishstream) with the media stream type `AUDIO_AND_VIDEO`.
3506
+ * &ensp; - The subsciber can enable automatic subscribing to video streams when entering the room, or call [subscribeStream](#subscribestream) with the media stream type `AUDIO_AND_VIDEO`.
3507
+ * + In voice call scenarios, if no SEI data is sent within 1 minute after calling this interface, the SDK will automatically cancel the publication of the black frame video stream.
3508
+ * + After the message is sent successfully, the remote end will receive [onSEIMessageReceived](104479#onseimessagereceived).
3509
+ * + In voice call scenarios, the sending status of the black frame video stream will be notified to remote users through the [onSEIStreamUpdate](104479#onseistreamupdate) event.
3350
3510
  * @group Message
3351
3511
  * @order 10
3352
3512
  */
@@ -3572,7 +3732,8 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
3572
3732
  * During testing, you can use generate a temporary Token on [Console](https://console.byteplus.com/auth/login), and fill in any value with `roomId`.
3573
3733
  * To officially go live, you need to use the implement token generation at your server. The `roomId` field should be empty. See [Authentication with Token](70121).
3574
3734
  * @param userId User ID.
3575
- * @return
3735
+ * @return + `ALREADY_LOGIN`: The user has already logged in.
3736
+ * + `LOGIN_FAILED`: Login failed. Please check the returned message for the specific reason.
3576
3737
  * @notes + Call [logout](#logout) to log out the IM server.
3577
3738
  * + In the same App ID, the user ID of each user must be unique. The user will be logged out when a user with the same userID joins the room because of the error of `RTM_DUPLICATE_LOGIN`.
3578
3739
  * @group Message
@@ -3613,7 +3774,11 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
3613
3774
  * @brief Send point-to-point (P2P) text message to a user.
3614
3775
  * @param userId ID of the recipient
3615
3776
  * @param message Text message within 64 KB.
3616
- * @return
3777
+ * @return + `USER_MESSAGE_TIMEOUT`: P2P message failed to be sent due to a timeout.
3778
+ * + `USER_MESSAGE_BROKEN`: P2P message failed to be sent due to a the broken channel.
3779
+ * + `USER_MESSAGE_NO_RECEIVER`: No receiver. Please make sure you pass in the right userId.
3780
+ * + `NOT_LOGIN`: The sender has not logged in yet.
3781
+ * + `USER_MESSAGE_UNKNOWN`: Unknown error.
3617
3782
  * @notes + Call [login](#login) before calling this API.
3618
3783
  * + The recipient must be logged into the server and will receive the text message via [onUserMessageReceivedOutsideRoom](104479#onusermessagereceivedoutsideroom) if the message has been sent successfully.
3619
3784
  * @group Message
@@ -3625,7 +3790,11 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
3625
3790
  * @brief Send point-to-point (P2P) binary message to a user.
3626
3791
  * @param userId ID of the recipient
3627
3792
  * @param message Binary message within 64 KB
3628
- * @return
3793
+ * @return + `USER_MESSAGE_TIMEOUT`: P2P message failed to be sent due to a timeout.
3794
+ * + `USER_MESSAGE_BROKEN`: P2P message failed to be sent due to a the broken channel.
3795
+ * + `USER_MESSAGE_NO_RECEIVER`: No receiver. Please make sure you pass in the right userId.
3796
+ * + `NOT_LOGIN`: The sender has not logged in yet.
3797
+ * + `USER_MESSAGE_UNKNOWN`: Unknown error.
3629
3798
  * @notes + Call [login](#login) before calling this API.
3630
3799
  * + The recipient must be logged into the server and will receive the text message via [EngineEventsTypes.onUserBinaryMessageReceivedOutsideRoom](104479#onuserbinarymessagereceivedoutsideroom) if the message has been sent successfully.
3631
3800
  * @group Message
@@ -3650,7 +3819,14 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
3650
3819
  /**
3651
3820
  * @brief Send point-to-point (P2P) text message to the server.
3652
3821
  * @param message Text message within 64 KB.
3653
- * @return
3822
+ * @return + `USER_MESSAGE_TIMEOUT`: P2P message failed to be sent due to a timeout.
3823
+ * + `USER_MESSAGE_BROKEN`: P2P message failed to be sent due to a the broken channel.
3824
+ * + `USER_MESSAGE_NO_RECEIVER`: No receiver. Please make sure you pass in the right userId.
3825
+ * + `USER_MESSAGE_SEND_TO_SERVER_ERROR`: No response from the server.
3826
+ * + `USER_MESSAGE_SERVER_RESPONSE_ERROR`: Failed to send message to the server. Response status code is not 200.
3827
+ * + `NOT_LOGIN`: The sender has not logged in yet.
3828
+ * + `USER_MESSAGE_SERVER_PARAMS_NOTSET`: The server params have not been set yet.
3829
+ * + `USER_MESSAGE_UNKNOWN`: Unknown error.
3654
3830
  * @notes Before sending a message to the server, you must first call [login](#login) to complete the login process.
3655
3831
  * @group Message
3656
3832
  * @order 36
@@ -3660,7 +3836,14 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
3660
3836
  /**
3661
3837
  * @brief Send point-to-point (P2P) binary message to the server.
3662
3838
  * @param message Binary message within 64 KB.
3663
- * @return
3839
+ * @return + `USER_MESSAGE_TIMEOUT`: P2P message failed to be sent due to a timeout.
3840
+ * + `USER_MESSAGE_BROKEN`: P2P message failed to be sent due to a the broken channel.
3841
+ * + `USER_MESSAGE_NO_RECEIVER`: No receiver. Please make sure you pass in the right userId.
3842
+ * + `USER_MESSAGE_SEND_TO_SERVER_ERROR`: No response from the server.
3843
+ * + `USER_MESSAGE_SERVER_RESPONSE_ERROR`: Failed to send message to the server. Response status code is not 200.
3844
+ * + `NOT_LOGIN`: The sender has not logged in yet.
3845
+ * + `USER_MESSAGE_SERVER_PARAMS_NOTSET`: The server params have not been set yet.
3846
+ * + `USER_MESSAGE_UNKNOWN`: Unknown error.
3664
3847
  * @notes Before sending a message to the server, you must first call [login](#login) to complete the login process.
3665
3848
  * @group Message
3666
3849
  * @order 37
@@ -3684,13 +3867,12 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
3684
3867
  stopCloudProxy: () => void;
3685
3868
 
3686
3869
  /**
3687
- * @hidden
3688
3870
  * @brief Starts publishing a public media stream.
3689
3871
  * @param publicStreamId The public stream's ID. The string must conform to the regular expression: `[a-zA-Z0-9_@\-\.]{1,128}`.
3690
3872
  * @param publicStreamParam The public stream's parameters.
3691
3873
  * A public stream can contain several media streams and will appears as the designated layout.
3692
3874
  * If the designated media stream is not published yet, the public stream will automatically update once the media stream is published.
3693
- * @return
3875
+ * @return `REPEAT_PUSH`: Publish a public stream repeatedly.
3694
3876
  * @notes + Users with the same `appID` can call [startPlayPublicStream](#startplaypublicstream) to subscribe to and play the public stream despite whether he/she has join the room.
3695
3877
  * + You cannot update the parameters of the public stream by repeatedly calling this API with the same stream ID by the same user. Call [updatePublicStreamParam](#updatepublicstreamparam) to update the parameters instead.
3696
3878
  * + Users with different `userID` can call this API with the same stream ID to update the parameters.
@@ -3702,20 +3884,18 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
3702
3884
  startPushPublicStream: (publicStreamId: string, publicStreamParam: PublicStreamConfig) => Promise<void>;
3703
3885
 
3704
3886
  /**
3705
- * @hidden
3706
3887
  * @brief Update the properties of the public stream published by the current user.
3707
3888
  * Call [startPushPublicStream](104478#startpushpublicstream) to start publishing a public stream.
3708
3889
  * @param publicStreamId The public stream's ID.
3709
3890
  * The public stream must be published by the current user.
3710
3891
  * @param publicStreamParam The public stream's parameters.
3711
- * @return
3892
+ * @return `REPEAT_PLAY`: Subscribe to a public stream repeatedly.
3712
3893
  * @group Public Stream
3713
3894
  * @order 1
3714
3895
  */
3715
3896
  updatePublicStreamParam: (publicStreamId: string, publicStreamParam: Partial<PublicStreamConfig>) => Promise<void>;
3716
3897
 
3717
3898
  /**
3718
- * @hidden
3719
3899
  * @type api
3720
3900
  * @brief Stops publishing the public stream.
3721
3901
  * Call [startPushPublicStream](104478#startpushpublicstream) to start publishing a public stream.
@@ -3728,7 +3908,6 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
3728
3908
  stopPushPublicStream: (publicStreamId: string) => Promise<void>;
3729
3909
 
3730
3910
  /**
3731
- * @hidden
3732
3911
  * @brief Subscribes to a designated public stream.
3733
3912
  * You can call this API to subscribe to a public stream whether you joined the room or not.
3734
3913
  * @param publicStreamId The public stream's ID.
@@ -3744,7 +3923,6 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
3744
3923
  startPlayPublicStream: (publicStreamId: string) => Promise<void>;
3745
3924
 
3746
3925
  /**
3747
- * @hidden
3748
3926
  * @brief Unsubscribes from a designated public stream.
3749
3927
  * Call [startPlayPublicStream](104478#startplaypublicstream) to subscribe to the public stream.
3750
3928
  * @param publicStreamId The public stream's ID.
@@ -3755,7 +3933,6 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
3755
3933
  stopPlayPublicStream: (publicStreamId: string) => Promise<void>;
3756
3934
 
3757
3935
  /**
3758
- * @hidden
3759
3936
  * @brief Sets the player information and rendering mode for the public stream.
3760
3937
  * @param publicStreamId The public stream's ID.
3761
3938
  * @param videoPlayerOption Player information and rendering mode.
@@ -3771,7 +3948,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
3771
3948
  * The format of the image can be: JPG, PNG, or BMP.
3772
3949
  * 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.
3773
3950
  * @notes + Only available to Chrome browser on Mac
3774
- * + It's recommended to call this API before stopping video capture to avoid blank frame in video recording.
3951
+ * + It is recommended to call this API before stopping video capture to avoid blank frame in video recording.
3775
3952
  * + You cannot see the image during local preview.
3776
3953
  * @group Video Management
3777
3954
  * @order 40
@@ -3788,7 +3965,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
3788
3965
 
3789
3966
  /**
3790
3967
  * @brief Set the fallback option for remote media stream
3791
- * Fallback:to enable media stream fallback or to subscribe to only audio stream under poor network conditions to ensure smooth communication.
3968
+ * Fallback means to enable media stream fallback or to subscribe to only audio stream under poor network conditions to ensure smooth communication.
3792
3969
  * @param option Fallback options for subscribed media stream
3793
3970
  * @return + `true` Success
3794
3971
  * + `false` Failure
@@ -3818,6 +3995,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
3818
3995
  * @param filePath Specify the path of the audio file for the playback test, including *.wav and *.mp3.
3819
3996
  * @param indicationInterval The time interval between each callback in milliseconds. We recommend setting it to 200 ms. The minimal value is 100 ms.
3820
3997
  * @return Resolve when the test ends.
3998
+ * `REPEAT_DEVICE_TEST`: The test has already started.
3821
3999
  * @notes + You can call this API whether the user is in the room.
3822
4000
  * + Call [stopAudioPlaybackDeviceTest](#stopaudioplaybackdevicetest) to stop the playback test before moving on to the other device tests.
3823
4001
  * @group Device Management
@@ -3839,6 +4017,10 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
3839
4017
  * @param indicationInterval The time interval between each callback of [onAudioPlaybackDeviceTestVolume](104479#onaudioplaybackdevicetestvolume) via which you get informed of the playback volume during the test. We recommend setting it to 200 ms. The minimal value is 100 ms.
3840
4018
  * @param onAutoplayFailed Autoplay fails due to the limitation of the browser. We recommend to execute `resume` as soon as the user clicks on the UI element.
3841
4019
  * @return Resolve when the test ends.
4020
+ * The following error codes may be returned.
4021
+ * + `NOT_SUPPORTED`: The browser does not support audio device test or audio capture.
4022
+ * + `REPEAT_DEVICE_TEST`: The test has already started.
4023
+ * + `AUDIO_DEVICE_RECORD_FAILED`: Failed to start the audio device test.
3842
4024
  * @notes + You can call this API whether the user is in a room.
3843
4025
  * + You can call [setCaptureVolume]({{api}}#RTCEngine.setCaptureVolume) to adjust the capture volume during audio route testing. You cannot call [setPlaybackVolume]({{api}}#RTCEngine.setPlaybackVolume) during audio route testing.
3844
4026
  * + The audio capturing will stop and begins to play the recording in 30 seconds after calling this API. Before that, call [stopAudioDeviceRecordAndPlayTest](#stopaudiodevicerecordandplaytest) to stop capturing and start playing the recording.
@@ -3935,6 +4117,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
3935
4117
  * @param streamIndex The specified video stream.
3936
4118
  * @notes + The snapshot is taken with all video effects on, like rotation, and mirroring.
3937
4119
  * + You can take the snapshot either using SDK internal video capture or customized capture.
4120
+ * @return `INVOKED_BEFORE_CAPTURE`: No such stream. Please make sure that the specified stream has been published.
3938
4121
  * @group Video Snapshot
3939
4122
  * @order 0
3940
4123
  */
@@ -3944,6 +4127,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
3944
4127
  * @brief Take a snapshot of the remote video.
3945
4128
  * @param id The index of the user's stream or the index of the public stream.
3946
4129
  * @param streamIndex The specified video stream.
4130
+ * @return `STREAM_NOT_EXIST`: The target stream does not exist. Please enter the correct ID or make sure that the target stream is in the room.
3947
4131
  * @group Video Snapshot
3948
4132
  * @order 1
3949
4133
  */
@@ -3965,7 +4149,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
3965
4149
  * After calling this method, you can choose between the recognition and translation modes based on your needs. In the recognition mode, the speech of the speaker in the room will be recognized and converted into captions. In the translation mode, the transcribed text will be translated.You will receive the [onSubtitleMessageReceived](104479#onsubtitlemessagereceived) callback to informs you of related information about subtitles.
3966
4150
  * After calling this method, you will receive the [onSubtitleStateChanged](104479#onsubtitlestatechanged) to inform you of whether subtitles are on.
3967
4151
  * @param config Subtitle configrations.
3968
- * @return
4152
+ * @return `SUBTITLE_ALREADY_ON`: Subtitle is already turned on.
3969
4153
  * @notes + You must call this method after joining the room.
3970
4154
  * + You can set your source language to Chinese by calling `joinRoom` and importing a json formatted string `"source_language": "zh"` through the parameter of extraInfo, to English by importing `"source_language": "en"` , and to Japanese by importing `"source_language": "ja"`. The language of your browser will be automatically set as the source language if you don't set it. If the language of your browser is not Chinese, English or Japanese, SDK will set Chinese as the source language.
3971
4155
  * @group Live Caption and Translation
@@ -4034,7 +4218,6 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
4034
4218
  setPlaybackVolume: (userId: string, streamIndex: StreamIndex, volume: number) => void;
4035
4219
 
4036
4220
  /**
4037
- * @hidden
4038
4221
  * @brief Adjust audio playback volume of a public stream.
4039
4222
  * @param publicStreamId The Id of a specified public stream.
4040
4223
  * @param volume The percentage of playback volume to the original volume in range of [0, 400]. The default value is 100%.
@@ -4051,6 +4234,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
4051
4234
  * After calling [joinRoom]({{api}}#RTCEngine.joinRoom), you can call this API to publish the media stream to multiple rooms. This feature is suitable for scenarios such as co-host PK and online karaoke.
4052
4235
  * @param forwardStreamInfos Information of the target rooms where the stream will be forwarded.
4053
4236
  * @return Status information for forwarding media stream across rooms.
4237
+ * `UNEXPECTED_INVOKE_FORWARD_STREAM`: Unexpected operation. Triggered if the timing of API calls related to forwarding media streams across rooms is incorrect. Please refer to the documentation of each API to confirm the correct order of API calls.
4054
4238
  * @notes + Once the forwarding begins, other users in the target room will receive [onUserJoined]({{callback}}#EngineEvents.onUserJoined) and [onUserPublishStream]({{callback}}#EngineEvents.onUserPublishStream)/[onUserPublishScreen]({{callback}}#EngineEvents.onUserPublishScreen).
4055
4239
  * + Call [updateForwardStreamToRooms]({{api}}#RTCEngine.updateForwardStreamToRooms) to add or remove the target room(s).
4056
4240
  * + Call [stopForwardStreamToRooms]({{api}}#RTCEngine.stopForwardStreamToRooms) to stop forwarding media stream to all rooms.
@@ -4064,6 +4248,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
4064
4248
  * @brief Update information of the rooms where the stream will be forwarded after calling [startForwardStreamToRooms]({{api}}#RTCEngine.startForwardStreamToRooms).
4065
4249
  * @param forwardStreamInfos Information of the target rooms where the stream will be forwarded.
4066
4250
  * @return Status information for forwarding media stream across rooms.
4251
+ * `UNEXPECTED_INVOKE_FORWARD_STREAM`: Unexpected operation. Triggered if the timing of API calls related to forwarding media streams across rooms is incorrect. Please refer to the documentation of each API to confirm the correct order of API calls.
4067
4252
  * @notes + Users in the added room will receive [onUserJoined]({{callback}}#EngineEvents.onUserJoined) and [onUserPublishStream]({{callback}}#EngineEvents.onUserPublishStream)/[onUserPublishScreen]({{callback}}#EngineEvents.onUserPublishScreen).
4068
4253
  * + Users in the removed room will receive [onUserUnpublishStream]({{callback}}#EngineEvents.onUserUnpublishStream)/[onUserUnpublishScreen]({{callback}}#EngineEvents.onUserUnpublishScreen) and [onUserLeave]({{callback}}#EngineEvents.onUserLeave).
4069
4254
  * @group Audio & Video Transport
@@ -4074,6 +4259,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
4074
4259
  /**
4075
4260
  * @brief Stop forwarding media stream to all rooms.
4076
4261
  * @return Status information for forwarding media stream across rooms.
4262
+ * `UNEXPECTED_INVOKE_FORWARD_STREAM`: Unexpected operation. Triggered if the timing of API calls related to forwarding media streams across rooms is incorrect. Please refer to the documentation of each API to confirm the correct order of API calls.
4077
4263
  * @notes + Users in the former target rooms will receive [onUserUnpublishStream]({{callback}}#EngineEvents.onUserUnpublishStream)/[onUserUnpublishScreen]({{callback}}#EngineEvents.onUserUnpublishScreen) and [onUserLeave]({{callback}}#EngineEvents.onUserLeave).
4078
4264
  * + Call [updateForwardStreamToRooms]({{api}}#RTCEngine.updateForwardStreamToRooms) to stop forwarding media stream to specific rooms.
4079
4265
  * + Call [pauseForwardStreamToAllRooms]({{api}}#RTCEngine.pauseForwardStreamToAllRooms) and [resumeForwardStreamToAllRooms]({{api}}#RTCEngine.resumeForwardStreamToAllRooms) to pause and resume fowarding media stream to all rooms.
@@ -4086,6 +4272,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
4086
4272
  * @brief Pause forwarding media stream to all rooms.
4087
4273
  * After calling this API, call [resumeForwardStreamToAllRooms]({{api}}#RTCEngine.resumeForwardStreamToAllRooms) to resume.
4088
4274
  * @return Status information for forwarding media stream across rooms.
4275
+ * `UNEXPECTED_INVOKE_FORWARD_STREAM`: Unexpected operation. Triggered if the timing of API calls related to forwarding media streams across rooms is incorrect. Please refer to the documentation of each API to confirm the correct order of API calls.
4089
4276
  * @notes Users in the target rooms will receive [onUserUnpublishStream]({{callback}}#EngineEvents.onUserUnpublishStream)/[onUserUnpublishScreen]({{callback}}#EngineEvents.onUserUnpublishScreen) and [onUserLeave]({{callback}}#EngineEvents.onUserLeave).
4090
4277
  * @group Audio & Video Transport
4091
4278
  * @order 43
@@ -4095,11 +4282,32 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
4095
4282
  /**
4096
4283
  * @brief Resume forwarding media stream to all rooms.
4097
4284
  * @return Status information for forwarding media stream across rooms.
4285
+ * `UNEXPECTED_INVOKE_FORWARD_STREAM`: Unexpected operation. Triggered if the timing of API calls related to forwarding media streams across rooms is incorrect. Please refer to the documentation of each API to confirm the correct order of API calls.
4098
4286
  * @notes Users in the target room will receive [onUserJoined]({{callback}}#EngineEvents.onUserJoined) and [onUserPublishStream]({{callback}}#EngineEvents.onUserPublishStream)/[onUserPublishScreen]({{callback}}#EngineEvents.onUserPublishScreen).
4099
4287
  * @group Audio & Video Transport
4100
4288
  * @order 44
4101
4289
  */
4102
4290
  resumeForwardStreamToAllRooms: () => Promise<ForwardStreamStateInfo[]>;
4291
+
4292
+ /**
4293
+ * @hidden
4294
+ */
4295
+ peerConnection: RTCPeerConnection | undefined;
4296
+
4297
+ /**
4298
+ * @hidden
4299
+ */
4300
+ iceState: RTCIceConnectionState | undefined;
4301
+
4302
+ /**
4303
+ * @brief Set the priority of the local audio stream to be published.
4304
+ * @param audio_selection_priority The priority of the local audio stream which defaults to be subscribable only up to the result of the Audio Selection.
4305
+ * @note + You must enable Audio Selection in the RTC console before using this API. You can call this API whether the user has joined a room. Refer to [Audio Selection](https://docs.byteplus.com/byteplus-rtc/docs/113547).<br>
4306
+ * + The setting is independent in each room that the user joins.
4307
+ * @group Room Management
4308
+ * @order 12
4309
+ */
4310
+ setAudioSelectionConfig: (audioSelectionPriority: AudioSelectionPriority) => Promise<void>;
4103
4311
  }
4104
4312
 
4105
4313
  /**
@@ -4133,7 +4341,7 @@ export interface IVERTC {
4133
4341
  * @brief Call this API to destroy the IRTCEngine instance created by [createEngine](104478#createengine).
4134
4342
  * @param engine By calling this API, this `IRTCEngine` instance and resource related will be wiped from memory. And any interaction with the media server will end.
4135
4343
  * @notes + Before calling this API, ensure all business scenarios related to this `IRTCEngine` instance have ended.
4136
- * + Calling this API will block the main thread until it completes the exiting process. Therefore, do not include this API in a callback. Nor wait in a callback for the execution of this API in the main thread, thus causing a deadlock.
4344
+ * + Calling this API will block the main thread until it completes the exiting process. Therefore, do not include this API in a callback. Nor wait in a callback for the execution of this API in the main thread, thus causing a deadlock.
4137
4345
  * @group Engine Management
4138
4346
  * @order 1
4139
4347
  */
@@ -4159,9 +4367,11 @@ export interface IVERTC {
4159
4367
 
4160
4368
  /**
4161
4369
  * @brief Call this API to request for access to video and audio devices.
4162
- * @param options The device type you need
4163
- * @return + `video: boolean` Video devices
4164
- * + `audio:boolean` Audio devices
4370
+ * @param options The device type you need.
4371
+ * @return + `video: boolean` Whether the video device permission is obtained.
4372
+ * + `audio: boolean` Whether the audio device permission is obtained.
4373
+ * + `videoExceptionError?: DOMException` Error message for obtaining video device permission.
4374
+ * + `audioExceptionError?: DOMException` Error message for obtaining audio device permission.
4165
4375
  * @group Device Management
4166
4376
  * @order 5
4167
4377
  */
@@ -4389,7 +4599,7 @@ export interface LiveTranscodeLayoutRegion {
4389
4599
  * @brief The render mode to be set. The default value is 1. See the following options:
4390
4600
  * • 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.
4391
4601
  * • 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.
4392
- * • 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.
4602
+ * • 3: Stretch. The video's aspect ratio is changed as it is automatically stretched to completely fill the bounding box that it is contained in, but the whole image is visible.
4393
4603
  */
4394
4604
  renderMode?: number;
4395
4605
 
@@ -5298,9 +5508,9 @@ export interface ScreenEncoderConfig {
5298
5508
 
5299
5509
  /**
5300
5510
  * @brief The type of content the track contains.
5301
- * `'text'`:The track should be treated as if video details are extra important, and that significant sharp edges and areas of consistent color can occur frequently. For example, presentations or web pages with text content.
5302
- * `'motion'`:The track should be treated as if it contains video where motion is important. For example, webcam video, movies or video games.
5303
- * `'detail'`:The track should be treated as if video details are extra important. For example, presentations or web pages with text content, painting or line art.
5511
+ * `'text'`: The track should be treated as if video details are extra important, and that significant sharp edges and areas of consistent color can occur frequently. For example, presentations or web pages with text content.
5512
+ * `'motion'`: The track should be treated as if it contains video where motion is important. For example, webcam video, movies or video games.
5513
+ * `'detail'`: The track should be treated as if video details are extra important. For example, presentations or web pages with text content, painting or line art.
5304
5514
  * @notes This property is not supported on Firefox. See [contentHint browser compatibility](https://caniuse.com/?search=contentHint).
5305
5515
  */
5306
5516
  contentHint?: "text" | "motion" | "detail";
@@ -5328,7 +5538,7 @@ export interface SetParamInterface {
5328
5538
  SIGNAL_CROP_JOINROOM: boolean;
5329
5539
  VIDEO_STALL_DATA: number;
5330
5540
  AUDIO_STALL_DATA: number;
5331
- FALLBACK_ENCODE_CODEC: string;
5541
+ BLACK_FRAME_LIFETIME: number;
5332
5542
  }
5333
5543
 
5334
5544
  /**
@@ -5407,6 +5617,10 @@ export interface SubtitleEvent {
5407
5617
 
5408
5618
  /**
5409
5619
  * @brief Error codes of the subtitling task.
5620
+ * + `SUBTITLE_ERR_POSTPROCESS`: An internal error occurred in cloud media processing.
5621
+ * + `SUBTITLE_ERR_CONNECTION_ERROR`: Connection to the third-party service failed.
5622
+ * + `SUBTITLE_ERR_PROCESS_ERROR`: Cloud media processing timed out.
5623
+ * + `SUBTITLE_ERR_UNKNOWN`: The client was unable to recognize the error code sent by the cloud media processing.
5410
5624
  */
5411
5625
  errorCode?: ErrorCode;
5412
5626
 
@@ -5566,9 +5780,9 @@ export interface VideoEncoderConfig {
5566
5780
 
5567
5781
  /**
5568
5782
  * @brief The type of content the track contains.
5569
- * `'text'`:The track should be treated as if video details are extra important, and that significant sharp edges and areas of consistent color can occur frequently. For example, presentations or web pages with text content.
5570
- * `'motion'`:The track should be treated as if it contains video where motion is important. For example, webcam video, movies or video games.
5571
- * `'detail'`:The track should be treated as if video details are extra important. For example, presentations or web pages with text content, painting or line art.
5783
+ * `'text'`: The track should be treated as if video details are extra important, and that significant sharp edges and areas of consistent color can occur frequently. For example, presentations or web pages with text content.
5784
+ * `'motion'`: The track should be treated as if it contains video where motion is important. For example, webcam video, movies or video games.
5785
+ * `'detail'`: The track should be treated as if video details are extra important. For example, presentations or web pages with text content, painting or line art.
5572
5786
  * @notes This property is not supported on Firefox. See [contentHint browser compatibility](https://caniuse.com/?search=contentHint).
5573
5787
  */
5574
5788
  contentHint?: "text" | "motion" | "detail";
@@ -5724,6 +5938,27 @@ export interface onSEIMessageReceivedEvent {
5724
5938
  remoteStreamKey: RemoteStreamKey;
5725
5939
  }
5726
5940
 
5941
+ /**
5942
+ * @brief Stream containing SEI information update event.
5943
+ */
5944
+ export interface onSEIStreamUpdateEvent {
5945
+
5946
+ /**
5947
+ * @brief User ID.
5948
+ */
5949
+ userId: string;
5950
+
5951
+ /**
5952
+ * @brief Whether it is a screen-sharing stream.
5953
+ */
5954
+ isScreen: boolean;
5955
+
5956
+ /**
5957
+ * @brief The stream type containing SEI information.
5958
+ */
5959
+ type: SEIStreamEventType;
5960
+ }
5961
+
5727
5962
  /**
5728
5963
  * A User in the room publishes a media stream.
5729
5964
  */