@byteplus/rtc 4.58.3 → 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,6 +60,7 @@ declare const Config: {
60
60
  VIDEO_STALL_DATA: number;
61
61
  AUDIO_STALL_DATA: number;
62
62
  IOS_SAFARI_ORIENTATION: boolean;
63
+ BLACK_FRAME_LIFETIME: number;
63
64
  };
64
65
  declare const _default: VERTC;
65
66
  declare enum AudioMixingError {
@@ -329,6 +330,10 @@ declare enum EngineEventsTypes {
329
330
  onUserMessageReceivedOutsideRoom = "onUserMessageReceivedOutsideRoom",
330
331
  onUserBinaryMessageReceivedOutsideRoom = "onUserBinaryMessageReceivedOutsideRoom",
331
332
  onTokenWillExpire = "onTokenWillExpire",
333
+ onTokenPublishPrivilegeWillExpire = "onTokenPublishPrivilegeWillExpire",
334
+ onTokenPublishPrivilegeDidExpired = "onTokenPublishPrivilegeDidExpired",
335
+ onTokenSubscribePrivilegeWillExpire = "onTokenSubscribePrivilegeWillExpire",
336
+ onTokenSubscribePrivilegeDidExpired = "onTokenSubscribePrivilegeDidExpired",
332
337
  onCloudProxyConnected = "onCloudProxyConnected",
333
338
  onPushPublicStreamResult = "onPushPublicStreamResult",
334
339
  onPublicStreamSEIMessageReceived = "onPublicStreamSEIMessageReceived",
@@ -349,7 +354,8 @@ declare enum EngineEventsTypes {
349
354
  onPublishRetry = "onPublishRetry",
350
355
  onSubscribeRetry = "onSubscribeRetry",
351
356
  onPublishResult = "onPublishResult",
352
- onSubscribeResult = "onSubscribeResult"
357
+ onSubscribeResult = "onSubscribeResult",
358
+ onSEIStreamUpdate = "onSEIStreamUpdate"
353
359
  }
354
360
  declare enum ErrorCode {
355
361
 
@@ -359,7 +365,7 @@ declare enum ErrorCode {
359
365
  INVALID_ENGINE = "INVALID_ENGINE",
360
366
 
361
367
  /**
362
- * @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.
363
369
  */
364
370
  INVALID_PARAMS = "INVALID_PARAMS",
365
371
 
@@ -488,6 +494,16 @@ declare enum ErrorCode {
488
494
  */
489
495
  TOKEN_EXPIRED = "TOKEN_EXPIRED",
490
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
+
491
507
  /**
492
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.
493
509
  */
@@ -543,7 +559,8 @@ declare enum ErrorCode {
543
559
  * @brief Operation not supported. Triggered when you call `startAudioDeviceRecordTest` or `setAudioPlaybackDevice` if the browser does not support audio device test or audio capture.
544
560
  */
545
561
  NOT_SUPPORTED = "NOT_SUPPORTED",
546
- /**
562
+
563
+ /**
547
564
  * @hidden no use
548
565
  */
549
566
  INTERRUPT = "INTERRUPT",
@@ -804,6 +821,20 @@ declare enum ErrorCode {
804
821
  */
805
822
  USER_FORBIDDEN = "USER_FORBIDDEN"
806
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
+ }
807
838
  declare enum StreamMixingEventErrorCode {
808
839
 
809
840
  /**
@@ -1024,6 +1055,22 @@ export declare enum AudioReportMode {
1024
1055
  AUDIOMIXING = 1
1025
1056
  }
1026
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
+
1027
1074
  /**
1028
1075
  * @brief Audio source type
1029
1076
  */
@@ -1111,7 +1158,8 @@ export declare enum FallbackOrRecoverReason {
1111
1158
  }
1112
1159
 
1113
1160
  /**
1114
- * @brief Forward stream error code.
1161
+ * @detail errorcode
1162
+ * @brief Forward stream error code. Returned through the [onForwardStreamError]({{callback}}#onForwardStreamError) callback.
1115
1163
  */
1116
1164
  export declare enum ForwardStreamError {
1117
1165
 
@@ -1452,7 +1500,6 @@ export declare enum StreamIndex {
1452
1500
 
1453
1501
  /**
1454
1502
  * @brief The reason for the removal of the remote stream in the room.
1455
- *
1456
1503
  */
1457
1504
  export declare enum StreamRemoveReason {
1458
1505
 
@@ -1484,7 +1531,12 @@ export declare enum StreamRemoveReason {
1484
1531
  /**
1485
1532
  * @brief Other reasons.
1486
1533
  */
1487
- 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
1488
1540
  }
1489
1541
 
1490
1542
  /**
@@ -1965,7 +2017,7 @@ export interface IAudioMixingManager {
1965
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.
1966
2018
  * @param config Mix Sound configuration.
1967
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.
1968
- * @return
2020
+ * @return `LOAD_RESOURCES_FAILED`: Loading resource failed. Please pass in the correct resource path.
1969
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).
1970
2022
  * + After you start playing the audio file and mixing, you can call the [stopAudioMixing](#stopaudiomixing) method to stop playing the audio file.
1971
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.
@@ -2010,7 +2062,7 @@ export interface IAudioMixingManager {
2010
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.
2011
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.
2012
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.
2013
- * @return
2065
+ * @return `LOAD_RESOURCES_FAILED`: Loading resource failed. Please pass in the correct resource path.
2014
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.
2015
2067
  * + This method pre-loads the specified audio file, and only calling [startAudioMixing](#startaudiomixing) API can you start playing the specified audio file.
2016
2068
  * + The specified audio file preloaded by calling this method can be unloaded through [unloadAudioMixing](#unloadaudiomixing).
@@ -2429,7 +2481,6 @@ export interface IEngineEvents {
2429
2481
  [EngineEventsTypes.onLocalStreamStats]: (stats: LocalStreamStats) => void;
2430
2482
 
2431
2483
  /**
2432
- * @hidden
2433
2484
  * @brief This 2 s periodical callback notifies information of the public stream after calling [startPlayPublicStream](104478#startplaypublicstream).
2434
2485
  * @param stats
2435
2486
  * @group Public Stream
@@ -2550,6 +2601,16 @@ export interface IEngineEvents {
2550
2601
  */
2551
2602
  [EngineEventsTypes.onSEIMessageReceived]: (event: onSEIMessageEvent) => void;
2552
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
+
2553
2614
  /**
2554
2615
  * @brief Result of the Auto-Subscription
2555
2616
  * @param event
@@ -2655,13 +2716,68 @@ export interface IEngineEvents {
2655
2716
  [EngineEventsTypes.onUserBinaryMessageReceivedOutsideRoom]: (event: UserBinaryMessageEvent) => void;
2656
2717
 
2657
2718
  /**
2658
- * @brief You will receive this callback 30 s before the Token expires.
2659
- * 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.
2660
2721
  * @group Room Management
2661
2722
  * @order 45
2662
2723
  */
2663
2724
  [EngineEventsTypes.onTokenWillExpire]: () => void;
2664
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
+
2665
2781
  /**
2666
2782
  * @brief Receives the callback when you call [startCloudProxy](104478#startcloudproxy) to start cloud proxy, and the SDK connects the proxy server successfully.
2667
2783
  * @param event
@@ -2669,7 +2785,6 @@ export interface IEngineEvents {
2669
2785
  [EngineEventsTypes.onCloudProxyConnected]: (event: CloudProxyConnectedEvent) => void;
2670
2786
 
2671
2787
  /**
2672
- * @hidden
2673
2788
  * @brief Callback of the result of publishing the public stream.
2674
2789
  * After calling [startPushPublicStream](104478#startpushpublicstream), you will be informed of the result through this callback.
2675
2790
  * @param event
@@ -2679,7 +2794,6 @@ export interface IEngineEvents {
2679
2794
  [EngineEventsTypes.onPushPublicStreamResult]: (event: PublicStreamResultEvent) => void;
2680
2795
 
2681
2796
  /**
2682
- * @hidden
2683
2797
  * @brief Callback of the SEI carried by the public video stream.
2684
2798
  * You will receive SEI by this callback if the public stream you subscribed to by calling [startPlayPublicStream](104478#startplaypublicstream) is carrying SEI.
2685
2799
  * @param event
@@ -2692,7 +2806,6 @@ export interface IEngineEvents {
2692
2806
  [EngineEventsTypes.onPublicStreamSEIMessageReceived]: (event: PublicStreamSEIMessageEvent) => void;
2693
2807
 
2694
2808
  /**
2695
- * @hidden
2696
2809
  * @brief Callback of the successful decoding of the first video frame of the public stream.
2697
2810
  * Refer to [startPlayPublicStream](104478#startplaypublicstream) for details about subscribing to a public stream.
2698
2811
  * @param event
@@ -2702,7 +2815,6 @@ export interface IEngineEvents {
2702
2815
  [EngineEventsTypes.onFirstPublicStreamVideoFrameDecoded]: (event: PublicStreamVideoFirstFrameDecodedEvent) => void;
2703
2816
 
2704
2817
  /**
2705
- * @hidden
2706
2818
  * @brief Callback of the successful decoding of the first audio frame of the public stream.
2707
2819
  * Refer to [startPlayPublicStream](104478#startplaypublicstream) for details about subscribing to a public stream.
2708
2820
  * @param event
@@ -2712,7 +2824,6 @@ export interface IEngineEvents {
2712
2824
  [EngineEventsTypes.onFirstPublicStreamAudioFrameDecoded]: (event: PublicStreamAudioFirstFrameDecodedEvent) => void;
2713
2825
 
2714
2826
  /**
2715
- * @hidden
2716
2827
  * @brief Callback of the successful rendering of the first video frame of the public stream.
2717
2828
  * Refer to [startPlayPublicStream](104478#startplaypublicstream) for details about subscribing to a public stream.
2718
2829
  * @param event
@@ -2909,12 +3020,18 @@ export interface IEngineEvents {
2909
3020
  screen: boolean;
2910
3021
  }) => void;
2911
3022
 
3023
+ /**
3024
+ * @hidden
3025
+ */
2912
3026
  [EngineEventsTypes.onPublishResult]: (e: {
2913
3027
  isScreen: boolean;
2914
3028
  isAutoPublish: boolean;
2915
3029
  errorCode?: ErrorCode;
2916
3030
  }) => void;
2917
3031
 
3032
+ /**
3033
+ * @hidden
3034
+ */
2918
3035
  [EngineEventsTypes.onSubscribeResult]: (e: {
2919
3036
  userId: string;
2920
3037
  isScreen: boolean;
@@ -2945,8 +3062,11 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2945
3062
  * @param roomId The Room ID. The string must conform to the regular expression: `[a-zA-Z0-9_@\-\.]{1,128}`.
2946
3063
  * @param userInfo User information.
2947
3064
  * @param roomConfig Room parameter configuration, set the room mode and whether to automatically publish or subscribe to the flow.
2948
- * @return The error code `ErrorCode.ROOM_FORBIDDEN` indicates that the user failed to enter the room because the room has been banned.
2949
- * 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.
2950
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`.
2951
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.
2952
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).
@@ -2983,6 +3103,9 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2983
3103
  * + Call [publishScreen](#publishscreen) to start screen sharing.
2984
3104
  * + After you call this API, the other users in the room will receive [onUserPublishStream](104479#onuserpublishstream).
2985
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.
2986
3109
  * @group Audio & Video Transport
2987
3110
  * @order 0
2988
3111
  */
@@ -3004,6 +3127,9 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
3004
3127
  * @notes + An invisible user cannot publish media streams. Call [setUserVisibility](#setuservisibility) to change your visibility in the room.
3005
3128
  * + After you called this API, the other users in the room will receive [onUserPublishScreen](104479#onuserpublishscreen).
3006
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.
3007
3133
  * @group Screen Sharing
3008
3134
  * @order 10
3009
3135
  */
@@ -3024,8 +3150,9 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
3024
3150
  * You can call this API in both automatic subscription mode and manual subscription mode.
3025
3151
  * @param userId The ID of the remote user who published the target audio/video stream.
3026
3152
  * @param mediaType Media stream type, used for specifying whether to subscribe to the audio stream or the video stream.
3027
- * @notes You must first get the remote stream
3028
- * 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.
3029
3156
  * @group Audio & Video Transport
3030
3157
  * @order 5
3031
3158
  */
@@ -3036,6 +3163,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
3036
3163
  * You can call this API in both automatic subscription mode and manual subscription mode.
3037
3164
  * @param userId The ID of the remote user who published the target audio/video stream.
3038
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.
3039
3167
  * @group Audio & Video Transport
3040
3168
  * @order 6
3041
3169
  */
@@ -3047,6 +3175,8 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
3047
3175
  * @param userId The ID of the remote user who published the target screen audio/video stream.
3048
3176
  * @param mediaType Media stream type, used for specifying whether to subscribe to the audio stream or the video stream.
3049
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.
3050
3180
  * @group Screen Sharing
3051
3181
  * @order 15
3052
3182
  */
@@ -3064,15 +3194,17 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
3064
3194
 
3065
3195
  /**
3066
3196
  * @brief Update Token.
3067
- * 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.
3068
3198
  * @param token A valid token.
3069
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.
3070
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.
3071
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.
3072
3204
  * @group Room Management
3073
3205
  * @order 5
3074
3206
  */
3075
- updateToken: (token: string) => void;
3207
+ updateToken: (token: string) => Promise<void>;
3076
3208
 
3077
3209
  /**
3078
3210
  * @brief Switch the microphone used for internal audio capturing.
@@ -3102,6 +3234,10 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
3102
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.
3103
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.
3104
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.
3105
3241
  * @notes + Call [stopVideoCapture](#stopvideocapture) to stop the internal video capture. Otherwise, the internal video capture will sustain until you destroy the engine instance.
3106
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.
3107
3243
  * + Call [setVideoCaptureDevice](#setvideocapturedevice) to switch the camera used by the internal video capture module.
@@ -3114,7 +3250,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
3114
3250
  * @brief Enable internal video capture immediately. The default setting is off.
3115
3251
  * Internal video capture refers to: capturing video using the built-in module.
3116
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.
3117
- * @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.
3118
3254
  * @notes + Call [startVideoCapture](#startvideocapture) to enable the internal video capture.
3119
3255
  * + Without calling this API the internal video capture will sustain until you destroy the engine instance.
3120
3256
  * @group Video Management
@@ -3128,6 +3264,10 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
3128
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.
3129
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.
3130
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.
3131
3271
  * @notes + Call [stopAudioCapture](#stopaudiocapture) to stop the internal audio capture. Otherwise, the internal audio capture will sustain until you destroy the engine instance.
3132
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.
3133
3273
  * @group Audio Management
@@ -3139,7 +3279,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
3139
3279
  * @brief Stop internal audio capture. The default is off.
3140
3280
  * Internal audio capture refers to: capturing audio using the built-in module.
3141
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.
3142
- * @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.
3143
3283
  * @notes + Call [startAudioCapture](#startaudiocapture) to enable the internal audio capture.
3144
3284
  * + Without calling this API the internal audio capture will sustain until you destroy the engine instance.
3145
3285
  * @group Audio Management
@@ -3153,6 +3293,11 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
3153
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.
3154
3294
  * @param videoDeviceId Video device's ID.
3155
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.
3156
3301
  * @notes + The audio and video capture can be published using [publishStream](#publishstream) and unpublished using [unPublishStream](#unpublishstream).
3157
3302
  * + The method cannot be called simultaneously with [startVideoCapture](#startvideocapture) / [startAudioCapture](#startaudiocapture).
3158
3303
  * + If either the camera or the microphone fails to complete the capture when calling this method, the audio and video capture will fail.
@@ -3196,10 +3341,10 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
3196
3341
  /**
3197
3342
  * @brief Use the capture module provided by the RTC SDK to capture the current screen stream for sharing.
3198
3343
  * @param screenConfig Specify properties for the sharing screen.
3199
- * @return
3344
+ * @return `GET_SCREEN_TRACK_FAILED`: Capture failed.
3200
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).
3201
- * + To turn off screen video source capture, call [stopScreenCapture](#stopscreencapture).
3202
- * + 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.
3203
3348
  * @group Screen Sharing
3204
3349
  * @order 0
3205
3350
  */
@@ -3227,8 +3372,8 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
3227
3372
 
3228
3373
  /**
3229
3374
  * @brief Bind a view to the remote media stream and set the rendering mode for the rendering of the remote stream
3230
- * It's recommended to call this API and bind a view once the event of [onUserPublishStream](104479#onuserpublishstream)/[onUserPublishScreen](104479#onuserpublishscreen) is triggered.
3231
- * 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.
3232
3377
  * @param streamIndex Video stream properties
3233
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`.
3234
3379
  * @notes You should bind the view after the user joins a room. This setting will sustain when the user leaves the room.
@@ -3248,7 +3393,8 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
3248
3393
  /**
3249
3394
  * @brief Sets the speaker or the earpiece as the audio playback device. The audio playback device defaults to the speaker.
3250
3395
  * @param deviceId ID of the audio playback device. Call [enumerateDevices](#enumeratedevices) to get device ID.
3251
- * @return
3396
+ * @return + `INVALID_DEVICE_ID`: Invalid device ID.
3397
+ * + `NOT_SUPPORTED`: The browser does not support audio device test or audio capture.
3252
3398
  * @notes You can call this API before or after the user joins a room.
3253
3399
  * @group Audio Management
3254
3400
  * @order 1
@@ -3298,7 +3444,11 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
3298
3444
  * The recipient receives the message via [onUserMessageReceived](104479#onusermessagereceived) once the message is sent successfully.
3299
3445
  * @param userId User ID of the recipient
3300
3446
  * @param message Text to be sent within 64 KB
3301
- * @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.
3302
3452
  * @notes Call [joinRoom](#joinroom) to join the room before calling this API.
3303
3453
  * @group Message
3304
3454
  * @order 0
@@ -3310,7 +3460,11 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
3310
3460
  * The recipient receives the message via [onUserBinaryMessageReceived](104479#onuserbinarymessagereceived) once the message is sent successfully.
3311
3461
  * @param userId User ID of the recipient
3312
3462
  * @param message Binary to be sent within 64 KB
3313
- * @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.
3314
3468
  * @notes Call [joinRoom](#joinroom) to join the room before calling this API.
3315
3469
  * @group Message
3316
3470
  * @order 1
@@ -3338,14 +3492,21 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
3338
3492
  sendRoomBinaryMessage: (message: ArrayBuffer) => Promise<any> | undefined;
3339
3493
 
3340
3494
  /**
3341
- * @brief Send SEI message carried by video frames
3342
- * @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`.
3343
3498
  * @param message SEI message within 4 KB. Empty message or message exceeding this size will not be sent with respective error prompt.
3344
- * @param repeatCount Number of message sending repetitions. The value range is [0, max{29, %{video frame rate}-1}]. Recommended range: [2,4].
3345
- * Calling this API to add SEI data to consecutive `repeatCount` video frames starting from the current one.
3346
- * @notes + Call this API to add SEI message to the video frame captured by the internal video capture module.
3347
- * + SDK will abandon the SEI message if no video frame in 2s after you call this API.
3348
- * + 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.
3349
3510
  * @group Message
3350
3511
  * @order 10
3351
3512
  */
@@ -3571,7 +3732,8 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
3571
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`.
3572
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).
3573
3734
  * @param userId User ID.
3574
- * @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.
3575
3737
  * @notes + Call [logout](#logout) to log out the IM server.
3576
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`.
3577
3739
  * @group Message
@@ -3612,7 +3774,11 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
3612
3774
  * @brief Send point-to-point (P2P) text message to a user.
3613
3775
  * @param userId ID of the recipient
3614
3776
  * @param message Text message within 64 KB.
3615
- * @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.
3616
3782
  * @notes + Call [login](#login) before calling this API.
3617
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.
3618
3784
  * @group Message
@@ -3624,7 +3790,11 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
3624
3790
  * @brief Send point-to-point (P2P) binary message to a user.
3625
3791
  * @param userId ID of the recipient
3626
3792
  * @param message Binary message within 64 KB
3627
- * @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.
3628
3798
  * @notes + Call [login](#login) before calling this API.
3629
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.
3630
3800
  * @group Message
@@ -3649,7 +3819,14 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
3649
3819
  /**
3650
3820
  * @brief Send point-to-point (P2P) text message to the server.
3651
3821
  * @param message Text message within 64 KB.
3652
- * @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.
3653
3830
  * @notes Before sending a message to the server, you must first call [login](#login) to complete the login process.
3654
3831
  * @group Message
3655
3832
  * @order 36
@@ -3659,7 +3836,14 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
3659
3836
  /**
3660
3837
  * @brief Send point-to-point (P2P) binary message to the server.
3661
3838
  * @param message Binary message within 64 KB.
3662
- * @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.
3663
3847
  * @notes Before sending a message to the server, you must first call [login](#login) to complete the login process.
3664
3848
  * @group Message
3665
3849
  * @order 37
@@ -3683,13 +3867,12 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
3683
3867
  stopCloudProxy: () => void;
3684
3868
 
3685
3869
  /**
3686
- * @hidden
3687
3870
  * @brief Starts publishing a public media stream.
3688
3871
  * @param publicStreamId The public stream's ID. The string must conform to the regular expression: `[a-zA-Z0-9_@\-\.]{1,128}`.
3689
3872
  * @param publicStreamParam The public stream's parameters.
3690
3873
  * A public stream can contain several media streams and will appears as the designated layout.
3691
3874
  * If the designated media stream is not published yet, the public stream will automatically update once the media stream is published.
3692
- * @return
3875
+ * @return `REPEAT_PUSH`: Publish a public stream repeatedly.
3693
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.
3694
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.
3695
3878
  * + Users with different `userID` can call this API with the same stream ID to update the parameters.
@@ -3701,20 +3884,18 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
3701
3884
  startPushPublicStream: (publicStreamId: string, publicStreamParam: PublicStreamConfig) => Promise<void>;
3702
3885
 
3703
3886
  /**
3704
- * @hidden
3705
3887
  * @brief Update the properties of the public stream published by the current user.
3706
3888
  * Call [startPushPublicStream](104478#startpushpublicstream) to start publishing a public stream.
3707
3889
  * @param publicStreamId The public stream's ID.
3708
3890
  * The public stream must be published by the current user.
3709
3891
  * @param publicStreamParam The public stream's parameters.
3710
- * @return
3892
+ * @return `REPEAT_PLAY`: Subscribe to a public stream repeatedly.
3711
3893
  * @group Public Stream
3712
3894
  * @order 1
3713
3895
  */
3714
3896
  updatePublicStreamParam: (publicStreamId: string, publicStreamParam: Partial<PublicStreamConfig>) => Promise<void>;
3715
3897
 
3716
3898
  /**
3717
- * @hidden
3718
3899
  * @type api
3719
3900
  * @brief Stops publishing the public stream.
3720
3901
  * Call [startPushPublicStream](104478#startpushpublicstream) to start publishing a public stream.
@@ -3727,7 +3908,6 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
3727
3908
  stopPushPublicStream: (publicStreamId: string) => Promise<void>;
3728
3909
 
3729
3910
  /**
3730
- * @hidden
3731
3911
  * @brief Subscribes to a designated public stream.
3732
3912
  * You can call this API to subscribe to a public stream whether you joined the room or not.
3733
3913
  * @param publicStreamId The public stream's ID.
@@ -3743,7 +3923,6 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
3743
3923
  startPlayPublicStream: (publicStreamId: string) => Promise<void>;
3744
3924
 
3745
3925
  /**
3746
- * @hidden
3747
3926
  * @brief Unsubscribes from a designated public stream.
3748
3927
  * Call [startPlayPublicStream](104478#startplaypublicstream) to subscribe to the public stream.
3749
3928
  * @param publicStreamId The public stream's ID.
@@ -3754,7 +3933,6 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
3754
3933
  stopPlayPublicStream: (publicStreamId: string) => Promise<void>;
3755
3934
 
3756
3935
  /**
3757
- * @hidden
3758
3936
  * @brief Sets the player information and rendering mode for the public stream.
3759
3937
  * @param publicStreamId The public stream's ID.
3760
3938
  * @param videoPlayerOption Player information and rendering mode.
@@ -3770,7 +3948,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
3770
3948
  * The format of the image can be: JPG, PNG, or BMP.
3771
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.
3772
3950
  * @notes + Only available to Chrome browser on Mac
3773
- * + 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.
3774
3952
  * + You cannot see the image during local preview.
3775
3953
  * @group Video Management
3776
3954
  * @order 40
@@ -3787,7 +3965,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
3787
3965
 
3788
3966
  /**
3789
3967
  * @brief Set the fallback option for remote media stream
3790
- * 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.
3791
3969
  * @param option Fallback options for subscribed media stream
3792
3970
  * @return + `true` Success
3793
3971
  * + `false` Failure
@@ -3817,6 +3995,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
3817
3995
  * @param filePath Specify the path of the audio file for the playback test, including *.wav and *.mp3.
3818
3996
  * @param indicationInterval The time interval between each callback in milliseconds. We recommend setting it to 200 ms. The minimal value is 100 ms.
3819
3997
  * @return Resolve when the test ends.
3998
+ * `REPEAT_DEVICE_TEST`: The test has already started.
3820
3999
  * @notes + You can call this API whether the user is in the room.
3821
4000
  * + Call [stopAudioPlaybackDeviceTest](#stopaudioplaybackdevicetest) to stop the playback test before moving on to the other device tests.
3822
4001
  * @group Device Management
@@ -3838,6 +4017,10 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
3838
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.
3839
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.
3840
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.
3841
4024
  * @notes + You can call this API whether the user is in a room.
3842
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.
3843
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.
@@ -3934,6 +4117,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
3934
4117
  * @param streamIndex The specified video stream.
3935
4118
  * @notes + The snapshot is taken with all video effects on, like rotation, and mirroring.
3936
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.
3937
4121
  * @group Video Snapshot
3938
4122
  * @order 0
3939
4123
  */
@@ -3943,6 +4127,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
3943
4127
  * @brief Take a snapshot of the remote video.
3944
4128
  * @param id The index of the user's stream or the index of the public stream.
3945
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.
3946
4131
  * @group Video Snapshot
3947
4132
  * @order 1
3948
4133
  */
@@ -3964,7 +4149,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
3964
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.
3965
4150
  * After calling this method, you will receive the [onSubtitleStateChanged](104479#onsubtitlestatechanged) to inform you of whether subtitles are on.
3966
4151
  * @param config Subtitle configrations.
3967
- * @return
4152
+ * @return `SUBTITLE_ALREADY_ON`: Subtitle is already turned on.
3968
4153
  * @notes + You must call this method after joining the room.
3969
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.
3970
4155
  * @group Live Caption and Translation
@@ -4033,7 +4218,6 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
4033
4218
  setPlaybackVolume: (userId: string, streamIndex: StreamIndex, volume: number) => void;
4034
4219
 
4035
4220
  /**
4036
- * @hidden
4037
4221
  * @brief Adjust audio playback volume of a public stream.
4038
4222
  * @param publicStreamId The Id of a specified public stream.
4039
4223
  * @param volume The percentage of playback volume to the original volume in range of [0, 400]. The default value is 100%.
@@ -4050,6 +4234,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
4050
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.
4051
4235
  * @param forwardStreamInfos Information of the target rooms where the stream will be forwarded.
4052
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.
4053
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).
4054
4239
  * + Call [updateForwardStreamToRooms]({{api}}#RTCEngine.updateForwardStreamToRooms) to add or remove the target room(s).
4055
4240
  * + Call [stopForwardStreamToRooms]({{api}}#RTCEngine.stopForwardStreamToRooms) to stop forwarding media stream to all rooms.
@@ -4063,6 +4248,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
4063
4248
  * @brief Update information of the rooms where the stream will be forwarded after calling [startForwardStreamToRooms]({{api}}#RTCEngine.startForwardStreamToRooms).
4064
4249
  * @param forwardStreamInfos Information of the target rooms where the stream will be forwarded.
4065
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.
4066
4252
  * @notes + Users in the added room will receive [onUserJoined]({{callback}}#EngineEvents.onUserJoined) and [onUserPublishStream]({{callback}}#EngineEvents.onUserPublishStream)/[onUserPublishScreen]({{callback}}#EngineEvents.onUserPublishScreen).
4067
4253
  * + Users in the removed room will receive [onUserUnpublishStream]({{callback}}#EngineEvents.onUserUnpublishStream)/[onUserUnpublishScreen]({{callback}}#EngineEvents.onUserUnpublishScreen) and [onUserLeave]({{callback}}#EngineEvents.onUserLeave).
4068
4254
  * @group Audio & Video Transport
@@ -4073,6 +4259,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
4073
4259
  /**
4074
4260
  * @brief Stop forwarding media stream to all rooms.
4075
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.
4076
4263
  * @notes + Users in the former target rooms will receive [onUserUnpublishStream]({{callback}}#EngineEvents.onUserUnpublishStream)/[onUserUnpublishScreen]({{callback}}#EngineEvents.onUserUnpublishScreen) and [onUserLeave]({{callback}}#EngineEvents.onUserLeave).
4077
4264
  * + Call [updateForwardStreamToRooms]({{api}}#RTCEngine.updateForwardStreamToRooms) to stop forwarding media stream to specific rooms.
4078
4265
  * + Call [pauseForwardStreamToAllRooms]({{api}}#RTCEngine.pauseForwardStreamToAllRooms) and [resumeForwardStreamToAllRooms]({{api}}#RTCEngine.resumeForwardStreamToAllRooms) to pause and resume fowarding media stream to all rooms.
@@ -4085,6 +4272,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
4085
4272
  * @brief Pause forwarding media stream to all rooms.
4086
4273
  * After calling this API, call [resumeForwardStreamToAllRooms]({{api}}#RTCEngine.resumeForwardStreamToAllRooms) to resume.
4087
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.
4088
4276
  * @notes Users in the target rooms will receive [onUserUnpublishStream]({{callback}}#EngineEvents.onUserUnpublishStream)/[onUserUnpublishScreen]({{callback}}#EngineEvents.onUserUnpublishScreen) and [onUserLeave]({{callback}}#EngineEvents.onUserLeave).
4089
4277
  * @group Audio & Video Transport
4090
4278
  * @order 43
@@ -4094,11 +4282,32 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
4094
4282
  /**
4095
4283
  * @brief Resume forwarding media stream to all rooms.
4096
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.
4097
4286
  * @notes Users in the target room will receive [onUserJoined]({{callback}}#EngineEvents.onUserJoined) and [onUserPublishStream]({{callback}}#EngineEvents.onUserPublishStream)/[onUserPublishScreen]({{callback}}#EngineEvents.onUserPublishScreen).
4098
4287
  * @group Audio & Video Transport
4099
4288
  * @order 44
4100
4289
  */
4101
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>;
4102
4311
  }
4103
4312
 
4104
4313
  /**
@@ -4132,7 +4341,7 @@ export interface IVERTC {
4132
4341
  * @brief Call this API to destroy the IRTCEngine instance created by [createEngine](104478#createengine).
4133
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.
4134
4343
  * @notes + Before calling this API, ensure all business scenarios related to this `IRTCEngine` instance have ended.
4135
- * + 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.
4136
4345
  * @group Engine Management
4137
4346
  * @order 1
4138
4347
  */
@@ -4158,9 +4367,11 @@ export interface IVERTC {
4158
4367
 
4159
4368
  /**
4160
4369
  * @brief Call this API to request for access to video and audio devices.
4161
- * @param options The device type you need
4162
- * @return + `video: boolean` Video devices
4163
- * + `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.
4164
4375
  * @group Device Management
4165
4376
  * @order 5
4166
4377
  */
@@ -4388,7 +4599,7 @@ export interface LiveTranscodeLayoutRegion {
4388
4599
  * @brief The render mode to be set. The default value is 1. See the following options:
4389
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.
4390
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.
4391
- * • 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.
4392
4603
  */
4393
4604
  renderMode?: number;
4394
4605
 
@@ -5297,9 +5508,9 @@ export interface ScreenEncoderConfig {
5297
5508
 
5298
5509
  /**
5299
5510
  * @brief The type of content the track contains.
5300
- * `'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.
5301
- * `'motion'`:The track should be treated as if it contains video where motion is important. For example, webcam video, movies or video games.
5302
- * `'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.
5303
5514
  * @notes This property is not supported on Firefox. See [contentHint browser compatibility](https://caniuse.com/?search=contentHint).
5304
5515
  */
5305
5516
  contentHint?: "text" | "motion" | "detail";
@@ -5327,6 +5538,7 @@ export interface SetParamInterface {
5327
5538
  SIGNAL_CROP_JOINROOM: boolean;
5328
5539
  VIDEO_STALL_DATA: number;
5329
5540
  AUDIO_STALL_DATA: number;
5541
+ BLACK_FRAME_LIFETIME: number;
5330
5542
  }
5331
5543
 
5332
5544
  /**
@@ -5405,6 +5617,10 @@ export interface SubtitleEvent {
5405
5617
 
5406
5618
  /**
5407
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.
5408
5624
  */
5409
5625
  errorCode?: ErrorCode;
5410
5626
 
@@ -5564,9 +5780,9 @@ export interface VideoEncoderConfig {
5564
5780
 
5565
5781
  /**
5566
5782
  * @brief The type of content the track contains.
5567
- * `'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.
5568
- * `'motion'`:The track should be treated as if it contains video where motion is important. For example, webcam video, movies or video games.
5569
- * `'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.
5570
5786
  * @notes This property is not supported on Firefox. See [contentHint browser compatibility](https://caniuse.com/?search=contentHint).
5571
5787
  */
5572
5788
  contentHint?: "text" | "motion" | "detail";
@@ -5722,6 +5938,27 @@ export interface onSEIMessageReceivedEvent {
5722
5938
  remoteStreamKey: RemoteStreamKey;
5723
5939
  }
5724
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
+
5725
5962
  /**
5726
5963
  * A User in the room publishes a media stream.
5727
5964
  */