@byteplus/rtc 4.62.0 → 4.63.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
@@ -28,6 +28,7 @@ declare class VERTC implements IVERTC {
28
28
  setParameter: typeof setParameter;
29
29
  isSupported: () => Promise<boolean>;
30
30
  getSupportedCodecs: () => Promise<string[]>;
31
+ getElectronScreenSources: typeof getElectronScreenSources;
31
32
  events: typeof EngineEventsTypes;
32
33
  ErrorCode: typeof ErrorCode;
33
34
  platform: string;
@@ -68,6 +69,8 @@ declare const Config: {
68
69
  PRE_ICE: boolean;
69
70
  STATS_LOOP_INTERVAL: number;
70
71
  HIDDEN_STATS: boolean;
72
+ UPLOAD_REMOTE_STATS: ExtendMediaType;
73
+ SDK_CODEC_NEGOTIATION: boolean;
71
74
  };
72
75
  declare const _default: VERTC;
73
76
  declare enum AudioMixingError {
@@ -826,7 +829,33 @@ declare enum ErrorCode {
826
829
  /**
827
830
  * @brief The user is banned. Triggered when you call `joinRoom` after the local user is banned.
828
831
  */
829
- USER_FORBIDDEN = "USER_FORBIDDEN"
832
+ USER_FORBIDDEN = "USER_FORBIDDEN",
833
+
834
+ /**
835
+ * @brief Failed to get the Electron instance. Ensure the environment meets the requirements for Electron development. Refer to [PC Screen Sharing by Web SDK in Electron](https://docs.byteplus.com/en/docs/byteplus-rtc/docs-1340581) for more.
836
+ */
837
+ ERR_ELECTRON_IS_NULL = "ERR_ELECTRON_IS_NULL",
838
+
839
+ /**
840
+ * @brief Failed to get the screen sharing source in Electron environment.
841
+ */
842
+ ELECTRON_DESKTOP_CAPTURER_GET_SOURCES_ERROR = "ELECTRON_DESKTOP_CAPTURER_GET_SOURCES_ERROR",
843
+
844
+ /**
845
+ * @brief Failed to change the simulcast settings. Ensure that the timing of calling [`setLocalSimulcastMode`](104478#rtcengine-setlocalsimulcastmode) is correct.
846
+ * You can change the resolution after publishing, but not the number of streams.
847
+ */
848
+ SET_SIMULCAST_FAILED = "SET_SIMULCAST_FAILED",
849
+
850
+ /**
851
+ * @brief Mixed the deprecated methods of Simulcast feature with the current methods is forbidden. The deprecated methods will no longer be maintained in future versions and are expected to be removed after several updates. It is advised to switch to the current methods as soon as possible.
852
+ * + `setRemoteVideoConfig` is deprecated. Please use [`setRemoteSimulcastStreamType`](104478#rtcengine-setremotesimulcaststreamtype) instead.
853
+ * + `enableSimulcastMode` is deprecated. Please use [`setLocalSimulcastMode`](104478#rtcengine-setlocalsimulcastmode) instead.
854
+ */
855
+ MIXING_OLD_AND_NEW_APIS = "MIXING_OLD_AND_NEW_APIS"
856
+ }
857
+ declare enum ExtendMediaType {
858
+ NONE = 0
830
859
  }
831
860
  declare enum SEIStreamEventType {
832
861
 
@@ -921,6 +950,7 @@ declare enum StreamMixingEventType {
921
950
  */
922
951
  STOP_FAILED = 9
923
952
  }
953
+ declare function getElectronScreenSources(type?: ScreenSourceType): Promise<ElectronDesktopCapturerSource[]>;
924
954
  declare function getParameter(key: keyof typeof Config): string | number | boolean | string[] | IJoinRoomConfig;
925
955
  declare function setParameter<T extends SetParamKey>(key: T, value: (SetParamInterface & CoreSetParamterInterface)[T]): IJoinRoomConfig | undefined;
926
956
 
@@ -1143,6 +1173,27 @@ export declare enum ConnectionState {
1143
1173
  CONNECTION_STATE_LOST = 6
1144
1174
  }
1145
1175
 
1176
+ /**
1177
+ * @brief The preference for the quality of the subscribed stream.
1178
+ */
1179
+ export declare enum EarMonitorPosition {
1180
+
1181
+ /**
1182
+ * @brief Disables the ear monitor.
1183
+ */
1184
+ NONE = 0,
1185
+
1186
+ /**
1187
+ * @brief Plays the local audio without any processing and audio mixing.
1188
+ */
1189
+ AFTER_CAPTURE = 1,
1190
+
1191
+ /**
1192
+ * @brief Plays the local audio after processing, without audio mixing.
1193
+ */
1194
+ AFTER_PROCESS = 2
1195
+ }
1196
+
1146
1197
  /**
1147
1198
  * @brief The reason for media stream fallback or recovery
1148
1199
  */
@@ -1500,6 +1551,27 @@ export declare enum SUBTITLE_MODE {
1500
1551
  ASR_AND_TRANSLATION = 1
1501
1552
  }
1502
1553
 
1554
+ /**
1555
+ * @brief The preference for the quality of the subscribed stream.
1556
+ */
1557
+ export declare enum SimulcastStreamType {
1558
+
1559
+ /**
1560
+ * @brief The stream with the best quality.
1561
+ */
1562
+ VIDEO_STREAM_HIGH = "high",
1563
+
1564
+ /**
1565
+ * @brief The stream with a medium quality.
1566
+ */
1567
+ VIDEO_STREAM_MID = "mid",
1568
+
1569
+ /**
1570
+ * @brief The stream with a low quality.
1571
+ */
1572
+ VIDEO_STREAM_LOW = "low"
1573
+ }
1574
+
1503
1575
  /**
1504
1576
  * @brief Stream specification
1505
1577
  */
@@ -1703,6 +1775,27 @@ export declare enum UserOfflineReason {
1703
1775
  KICKED_BY_ADMIN = 3
1704
1776
  }
1705
1777
 
1778
+ /**
1779
+ * @brief The preferred codec for the video stream.
1780
+ */
1781
+ export declare enum VideoCodecType {
1782
+
1783
+ /**
1784
+ * @brief Not specified. The SDK will automatically match the best codec based on the current video resolution and device performance.
1785
+ */
1786
+ AUTO = "auto",
1787
+
1788
+ /**
1789
+ * @brief H.264
1790
+ */
1791
+ H264 = "h264",
1792
+
1793
+ /**
1794
+ * @brief VP8
1795
+ */
1796
+ VP8 = "vp8"
1797
+ }
1798
+
1706
1799
  /**
1707
1800
  * @brief Rendering modes
1708
1801
  */
@@ -1727,6 +1820,27 @@ export declare enum VideoRenderMode {
1727
1820
  RENDER_MODE_FILL = 2
1728
1821
  }
1729
1822
 
1823
+ /**
1824
+ * @brief Multiple quality streams
1825
+ */
1826
+ export declare enum VideoSimulcastMode {
1827
+
1828
+ /**
1829
+ * @brief Single. The video stream is sent in only set of specification.
1830
+ */
1831
+ VIDEO_ONLY_ONE = 0,
1832
+
1833
+ /**
1834
+ * @brief On-demand. The publisher will publish streams according to the subscriber's demands. When no subscription preference is taking effect, 2 streams will be published.
1835
+ */
1836
+ VIDEO_ON_DEMAND = 1,
1837
+
1838
+ /**
1839
+ * @brief Manual. The publisher will publish streams in the qualities of the settings. The default is to publish 2 streams.
1840
+ */
1841
+ VIDEO_ALWAYS_SIMULCAST = 2
1842
+ }
1843
+
1730
1844
  /**
1731
1845
  * @brief Video source type
1732
1846
  */
@@ -1742,6 +1856,27 @@ export declare enum VideoSourceType {
1742
1856
  */
1743
1857
  VIDEO_SOURCE_TYPE_INTERNAL = 1
1744
1858
  }
1859
+
1860
+ /**
1861
+ * @brief The object to be shared during screen-sharing in Electron.
1862
+ */
1863
+ export declare interface ElectronDesktopCapturerSource {
1864
+
1865
+ /**
1866
+ * @brief Identifier.
1867
+ */
1868
+ id: string;
1869
+
1870
+ /**
1871
+ * @brief Name.
1872
+ */
1873
+ name: string;
1874
+
1875
+ /**
1876
+ * @brief Thumbnail.
1877
+ */
1878
+ thumbnail: IElectronNativeImage;
1879
+ }
1745
1880
  export declare type RTCExtension = any;
1746
1881
 
1747
1882
  /**
@@ -1921,6 +2056,11 @@ export interface AutoPlayFailedEvent {
1921
2056
  * @brief Player ID. An empty value indicates the default player.
1922
2057
  */
1923
2058
  playerId?: string;
2059
+
2060
+ /**
2061
+ * @brief Whether the ear monitor is enabled. And whether the in-ear monitoring audio is processed.
2062
+ */
2063
+ position?: EarMonitorPosition;
1924
2064
  }
1925
2065
 
1926
2066
  /**
@@ -2242,6 +2382,17 @@ export interface IBLWRTCEngine extends IRTCEngine {
2242
2382
  setRemoteScreenVideoStreamIndex: (streamIndex: StreamIndex) => boolean;
2243
2383
  }
2244
2384
 
2385
+ /**
2386
+ * @brief The thumbnail of the screen-sharing source in Electron.
2387
+ */
2388
+ export interface IElectronNativeImage {
2389
+
2390
+ /**
2391
+ * @brief A base 64 encoded Data URL string. Refer to [nativeImage](http://electron.atom.io/docs/api/native-image) for more details.
2392
+ */
2393
+ toDataURL: () => string;
2394
+ }
2395
+
2245
2396
  /**
2246
2397
  * @id EngineEvents
2247
2398
  * @list overview
@@ -2417,15 +2568,15 @@ export interface IEngineEvents {
2417
2568
  /**
2418
2569
  * @brief Event of video device state changing.
2419
2570
  * @param event Information and state of a media device.
2420
- * @group Video Management
2421
- * @order 50
2571
+ * @group Device Management
2572
+ * @order 60
2422
2573
  */
2423
2574
  [EngineEventsTypes.onVideoDeviceStateChanged]: (event: DeviceInfo) => void;
2424
2575
 
2425
2576
  /**
2426
2577
  * @brief Event of audio device state changing.
2427
2578
  * @param event Information and state of a media device.
2428
- * @group Audio Management
2579
+ * @group Device Management
2429
2580
  * @order 50
2430
2581
  */
2431
2582
  [EngineEventsTypes.onAudioDeviceStateChanged]: (event: DeviceInfo) => void;
@@ -2575,7 +2726,7 @@ export interface IEngineEvents {
2575
2726
  }) => void;
2576
2727
 
2577
2728
  /**
2578
- * @brief After calling [enableAudioPropertiesReport](docs-104478#enableaudiopropertiesreport), you will periodically receive this callback for the information about local audio.
2729
+ * @brief After calling [enableAudioPropertiesReport](docs-104478#enableaudiopropertiesreport), you will periodically receive this callback for the instant information about local audio.
2579
2730
  * Local audio includes the microphone audio and the screen audio captured using RTC SDK internal mechanisms.
2580
2731
  * @param event Information about local audio.
2581
2732
  * @group Audio Management
@@ -3283,8 +3434,8 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
3283
3434
  * @param deviceId Device ID. Call [enumerateDevices](#enumeratedevices) to get the device list.
3284
3435
  * @return
3285
3436
  * @notes If the internal audio capturing is on, the switch is effective once you call this API. If the internal audio capturing is off, the setting will be effective when capture starts.
3286
- * @group Audio Management
3287
- * @order 0
3437
+ * @group Device Management
3438
+ * @order 45
3288
3439
  */
3289
3440
  setAudioCaptureDevice: (deviceId: string) => Promise<void>;
3290
3441
 
@@ -3295,8 +3446,8 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
3295
3446
  * @notes + If the internal video capturing is on, the switch is effective once you call this API. If the internal video capturing is off, the setting will be effective when capture starts.
3296
3447
  * + For mobile devices, set deviceId as `"user"` to use the front camera. Set deviceId as `"environment"` to use the rear camera.
3297
3448
  * + The default camera is set by the browser.
3298
- * @group Video Management
3299
- * @order 0
3449
+ * @group Device Management
3450
+ * @order 55
3300
3451
  */
3301
3452
  setVideoCaptureDevice: (deviceId: string) => Promise<void>;
3302
3453
 
@@ -3508,7 +3659,8 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
3508
3659
  * @param mediaType For audio or video. It defaults to `AUDIO_AND_VIDEO`. The local audio is not included. While the Audio selection is enabled, it can only be set to `VIDEO`.
3509
3660
  * @param streamIndex Main stream or screen-sharing stream. By default, the action will apply to both the main stream and the screen-sharing stream.
3510
3661
  * @param playerId Player ID. An empty value indicates the default player.
3511
- * @notes After using this method to pause the media stream,
3662
+ * @notes When the audio selection is enabled, this method will not take effect.
3663
+ * After using this method to pause the media stream,
3512
3664
  * + The billing duration will not stop counting since the subscription doesn't cancel.
3513
3665
  * + The stream will not remove from the player. You can call [play](#play) to resume the stream.
3514
3666
  * + The volume of the stream will not be `0`, which you can obtain via [getAudioLevel](getAudioLevel) or the callback of [onLocalAudioPropertiesReport](docs-104479#onlocalaudiopropertiesreport) or [onRemoteAudioPropertiesReport](docs-104479#onremoteaudiopropertiesreport).
@@ -3547,7 +3699,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
3547
3699
  * @brief Toggle the callbacks carrying the audio frames.
3548
3700
  * @param streamIndex Audio from microphone or device audio.
3549
3701
  * @param userId ID of the remote user who published the audio. An empty value indicates the local audio.
3550
- * When the Audio seclection enabled, only the local audio frames are available.
3702
+ * When the Audio selection enabled, only the local audio frames are available.
3551
3703
  * You will get the callback carrying the audio data as soon as the user starts publish audio.
3552
3704
  * @param callback The callback function to receive the audio frames. An empty value indicates disabling the callback.
3553
3705
  * When the user disconnects, the audio data is zero amplitude.
@@ -3639,7 +3791,9 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
3639
3791
  * @brief Send supplemental enhancement information (SEI) through video frames.
3640
3792
  * 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.
3641
3793
  * @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`.
3642
- * @param message SEI message within 4 KB. Empty message or message exceeding this size will not be sent with respective error prompt.
3794
+ * @param message SEI message within 4 KB.
3795
+ * Empty message or message exceeding this size will not be sent with respective error prompt.
3796
+ * The SEI PayLoadType must be `5` or `100`.
3643
3797
  * @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]`.
3644
3798
  * @notes + **Compatibility**<br/>
3645
3799
  * &ensp; - SEI messages only support H.264 encoding, and use on browsers with Chromium 86+.
@@ -3655,18 +3809,14 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
3655
3809
  sendSEIMessage: (streamIndex: StreamIndex, message: Uint8Array | string, repeatCount: number) => void;
3656
3810
 
3657
3811
  /**
3658
- * @brief Set the video stream configurations from the video publishing end.
3659
- * @param descriptions The configurations of multiple video streams to be published. The resolution set is the maximum resolution for each stream.
3660
- * Up to 3 sets of configurations can be set. When there are more than 3 sets, the values of the first 3 sets will be used.
3661
- * When multiple configurations are set, the resolution and frame rate must be arranged in descending order. For better compatibility, it is recommended that the ratio between the maximum level resolution and other level resolutions be an integer multiple.
3662
- * When the resolution of the first stream is greater than or equal to 540P, it supports publishing 3 streams; when it is between 270P (inclusive) and 450P (inclusive), it supports publishing 2 streams; when it is 180P or below, you cannot enable simulcasting.
3663
- * @notes + Before calling this method, the SDK defaults to publishing a stream with a resolution of 640 × 480 pixels, a frame rate of 15 FPS, and a maximum encoding bitrate of 600 Kbps.
3664
- * + When publishing a single stream, you can call this method before or after publishing the video stream. After the video stream is published, dynamic switching between single stream and multiple streams is not supported, and modifying the parameters of the published multiple streams is not supported.
3665
- * + When using a mobile device to publish a video stream in portrait mode, the set resolution width and height are reversed in the actual streaming parameters. For example, when setting the sending resolution to 640 × 480 pixels, the actual streaming parameters are 480 × 640 pixels.
3666
- * + If the set parameters are not supported by the browser, the RTC SDK will capture and encode based on the parameter range supported by the browser, and notify the actual parameters through the [onLocalVideoSizeChanged](docs-104479#onlocalvideosizechanged) callback.
3667
- * + If you want to simulcast, you need to disable automatic publishing, call this method and [enableSimulcastMode](#enablesimulcastmode) to enable multiple stream mode, and then call [publishStream](#publishstream) to manually publish the audio and video streams.
3668
- * + If this method is called to set multiple resolutions but multiple stream mode is not enabled, the SDK will default to publishing the stream with the highest resolution. If multiple stream publishing is enabled but only one set of stream parameters is set, the SDK will automatically fill in 1-2 sets of small stream parameters.
3669
- * + This method is applicable to video streams captured by the camera. For setting the screen sharing stream parameters, refer to [setScreenEncoderConfig](#setscreenencoderconfig).
3812
+ * @brief Configure the encdoing settings for the camera videos on the publisher side.
3813
+ * @param descriptions The configurations of the video streams to be published.
3814
+ * @notes + If you want to publish multiple streams with different resolutions, you need to enable and specify the configurations of the lower-quality streams through [setLocalSimulcastMode](#rtcengine-setlocalsimulcastmode). When publishing multiple streams with different resolutions, the parameters set through this method are the highest resolution among the video streams.
3815
+ * + Before calling this method, the SDK defaults to publishing a stream with a resolution of 640 × 480 pixels, a frame rate of 15 FPS, and a maximum encoding bitrate of 600 Kbps.
3816
+ * + You can call this method before or after publishing the video stream.
3817
+ * + When using a mobile device to publish a video stream in portrait mode, the set resolution width and height are reversed in the actual streaming parameters. For example, when setting the sending resolution to 640 × 480 pixels, the actual streaming parameters are 480 × 640 pixels.
3818
+ * + If the set parameters are not supported by the browser, the RTC SDK will capture and encode based on the parameter range supported by the browser, and notify the actual parameters through the [onLocalVideoSizeChanged](docs-104479#onlocalvideosizechanged) callback.
3819
+ * + This method is applicable to video streams captured by the camera. For setting the screen sharing stream parameters, refer to [setScreenEncoderConfig](#setscreenencoderconfig).
3670
3820
  * @group Video Management
3671
3821
  * @order 35
3672
3822
  */
@@ -3684,6 +3834,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
3684
3834
  setScreenEncoderConfig: (description: ScreenEncoderConfig) => Promise<void>;
3685
3835
 
3686
3836
  /**
3837
+ * @hidden Deprecated since V4.63, use setRemoteSimulcastStreamType instead.
3687
3838
  * @brief Sets your expected configuration of the remote video stream that you want to subscribe to or have subscribed to.
3688
3839
  * @param userId ID of the remote video stream publisher you expect to configure subscription parameters for.
3689
3840
  * @param remoteVideoConfig The parameters you expect to configure for the remote video stream.
@@ -3696,6 +3847,22 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
3696
3847
  setRemoteVideoConfig: (userId: string, remoteVideoConfig: RemoteVideoConfig) => Promise<void>;
3697
3848
 
3698
3849
  /**
3850
+ * @brief Sets your expected quality level of the remote video stream that you want to subscribe to or have subscribed to.
3851
+ * @param userId ID of the remote video stream publisher you expect to configure subscription parameters for.
3852
+ * If the low-quality stream to be subscribed to is not published, the standard stream would be subscribed to. If the mid-quality stream to be subscribed to is not published, the low-quality stream would be subscribed to.
3853
+ * @param streamType The preference for the quality of the subscribed stream.
3854
+ * @return Refer to [MIXING_OLD_AND_NEW_APIS](docs-104480#errorcode) for the details of the error code.
3855
+ * @notes + This API only works after the publisher calls [setLocalSimulcastMode](#setLocalSimulcastMode) to enable publishing multiple video streams, in which case the subscriber will receive a stream that is closest to the set configuration.
3856
+ * + If you don't call this API after the publisher enables the function of publishing multiple streams, you will receive the highest-quality video stream by default.
3857
+ * + You can call this method before or after joining a room.
3858
+ * - Refer to [Simulcasting](https://docs.byteplus.com/en/docs/byteplus-rtc/docs-70139) for more information.
3859
+ * @group Audio & Video Transport
3860
+ * @order 25
3861
+ */
3862
+ setRemoteSimulcastStreamType: (userId: string, streamType: SimulcastStreamType) => Promise<void>;
3863
+
3864
+ /**
3865
+ * @hidden Deprecated since V4.63, use setLocalSimulcastMode instead.
3699
3866
  * @brief Enables the simulcast mode of the video stream captured by the camera at the publishing end.imulcasting, including resolution, frame rate, bitrate, scale mode, fallback strategy under poor network conditions.
3700
3867
  * @param enabled Whether to enable simulcast.
3701
3868
  * @return + `true`: Success.
@@ -3708,6 +3875,27 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
3708
3875
  */
3709
3876
  enableSimulcastMode: (enabled: boolean) => boolean;
3710
3877
 
3878
+ /**
3879
+ * @valid since V4.63
3880
+ * @brief Enable the Simulcast feature and configure the lower-quality camera videos for the stream publisher.
3881
+ * @param mode Whether to publish lower-quality streams and how many of them to be published. By default, it is set to Single, where the publisher sends the video in a single profile.
3882
+ * This parameter must be set before joining a room.
3883
+ * @param streamConfig The specification of the lower quality stream(s).
3884
+ * The resolution of the lower quality stream must be smaller than the standard stream set via [setVideoEncoderConfig](#rtcengine-setvideoencoderconfig). The specifications in the array must be arranged in ascending order based on resolution.
3885
+ * You can configure the lower quality stream(s) before or after joining a room. However, after publishing the streams, you can no longer change the number of lower quality streams.
3886
+ * When the Simulcast feature is enabled, the low-quality stream is set to a default resolution of 120px × 90px @10fps with a bitrate of 100Kbps.
3887
+ * - For the stream exceeding 540P in resolution, the browser supports up to three distinct video stream resolutions.
3888
+ * - For the stream below 180P in resolution, publishing is limited to a single stream only.
3889
+ * - For the stream falls between 180P and 540P in resolution, you can publish an additional lower-quality stream.
3890
+ * @return Refer to [SET_SIMULCAST_FAILED](docs-104480#errorcode) and [MIXING_OLD_AND_NEW_APIS](docs-104480#errorcode) for the details of the error code.
3891
+ * @note - The default setting is to publish a single stream.
3892
+ * - The method applies to the camera video only.
3893
+ * - Refer to [Simulcasting](https://docs.byteplus.com/en/docs/byteplus-rtc/docs-70139) for more information.
3894
+ * @group Audio & Video Transport
3895
+ * @order 20
3896
+ */
3897
+ setLocalSimulcastMode: (mode: VideoSimulcastMode, streamConfig?: VideoEncoderConfig[]) => Promise<void>;
3898
+
3711
3899
  /**
3712
3900
  * @hidden
3713
3901
  * @deprecated since 4.42, use enableAudioPropertiesReport instead
@@ -4257,8 +4445,9 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
4257
4445
  * @brief Take a snapshot of the local video.
4258
4446
  * @param streamIndex The specified video stream.
4259
4447
  * @param playerId Player ID. An empty value indicates the default player. If the default player does not exist by then, the call will not take effect.
4260
- * @notes + The snapshot is taken with all video effects on, including the beauty effect, virtual background and mirroring.
4261
- * + You can take the snapshot either using SDK internal video capture or customized capture.
4448
+ * @notes + Before using this method to capture a snapshot, make sure the local camera is actively streaming. You can check this via [getLocalStreamTrack](docs-104478#rtcengine-getlocalstreamtrack). A non-empty return value indicates that the local video stream is active and ready for snapshot capture.
4449
+ * + The snapshot is taken with the beauty effect and virtual background.
4450
+ * + You can take the snapshot either using SDK internal video capture or customized capture.
4262
4451
  * @return `INVOKED_BEFORE_CAPTURE`: No such stream. Please make sure that the specified stream has been published.
4263
4452
  * @group Video Snapshot
4264
4453
  * @order 0
@@ -4271,6 +4460,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
4271
4460
  * @param streamIndex The specified video stream.
4272
4461
  * @param playerId Player ID. An empty value indicates the default player. If the default player does not exist by then, the call will not take effect.
4273
4462
  * @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.
4463
+ * @notes Before using this method to capture a snapshot, make sure you have successfully received the remote stream on the local client. You can check this via [getRemoteStreamTrack](docs-104478#rtcengine-getremotestreamtrack). A non-empty return value indicates that the remote stream has been successfully subscribed to.
4274
4464
  * @group Video Snapshot
4275
4465
  * @order 1
4276
4466
  */
@@ -4509,6 +4699,31 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
4509
4699
  * @hidden for internal use
4510
4700
  */
4511
4701
  getPublicAudioStats: () => Record<string, RemoteAudioStats>;
4702
+
4703
+ /**
4704
+ * @valid since V4.63
4705
+ * @brief Enable/Disable in-ear monitoring.
4706
+ * @param streamIndex Mainstream or screen-sharing stream.
4707
+ * @param position Whether to enable in-ear monitoring. Specify whether the in-ear monitoring audio is processed.
4708
+ * @return If the in-ear monitoring audio fails to play automatically, we recommend calling this method again after receiving [onAutoplayFailed](docs-104479#engineevents-onautoplayfailed) to recover.
4709
+ * @note - You can set the ear monitor volume anytime after creating the engine.
4710
+ * - You can adjust the ear monitor volume using [setEarMonitorVolume](docs-104478#rtcengine-setearmonitorvolume).
4711
+ * - We recommend that you use wired earbuds/headphones for a high-quality hearing experience.
4712
+ * @group Audio Management
4713
+ * @order 75
4714
+ */
4715
+ setEarMonitorMode: (streamIndex: StreamIndex, position: EarMonitorPosition) => Promise<void>;
4716
+
4717
+ /**
4718
+ * @valid since V4.63
4719
+ * @brief Set the monitoring volume.
4720
+ * @param streamIndex Mainstream or screen-sharing stream.
4721
+ * @param volume The monitoring volume with the adjustment range between 0 and 400. The initial value is `100`.
4722
+ * @note We recommend that you set the ear monitor volume after starting to capture audio and enabling the ear monitor.
4723
+ * @group Audio Management
4724
+ * @order 80
4725
+ */
4726
+ setEarMonitorVolume: (streamIndex: StreamIndex, volume: number) => void;
4512
4727
  }
4513
4728
 
4514
4729
  /**
@@ -4673,6 +4888,18 @@ export interface IVERTC {
4673
4888
  * @order 26
4674
4889
  */
4675
4890
  downloadLog: (key?: string) => void;
4891
+
4892
+ /**
4893
+ * @valid since V4.63
4894
+ * @brief Get the list of screen-sharing objects.
4895
+ * @param type The type of screen-sharing object, screen or application. If empty, get all the available screen-sharing objects.
4896
+ * @notes For more details, see [Implement screen sharing with Web SDK in Electron](https://docs.byteplus.com/byteplus-rtc/docs/1340581).
4897
+ * @return The list of screen-sharing objects.
4898
+ * Refer to [ERR_ELECTRON_IS_NULL](docs-104480#errorcode) and [ELECTRON_DESKTOP_CAPTURER_GET_SOURCES_ERROR](docs-104480#errorcode) for the details of the error code.
4899
+ * @group Screen Sharing
4900
+ * @order 3
4901
+ */
4902
+ getElectronScreenSources: (type?: ScreenSourceType) => Promise<ElectronDesktopCapturerSource[]>;
4676
4903
  }
4677
4904
 
4678
4905
  /**
@@ -5119,7 +5346,7 @@ export interface LocalVideoStats {
5119
5346
  * "H264": H.264 video codec.
5120
5347
  * "VP8": VP8 video codec.
5121
5348
  */
5122
- codecType: string;
5349
+ codecType: "H264" | "VP8";
5123
5350
 
5124
5351
  /**
5125
5352
  * @brief Whether it is a screen-sharing stream
@@ -5718,6 +5945,13 @@ export interface RemoteVideoStats {
5718
5945
  * @brief Video index
5719
5946
  */
5720
5947
  videoIndex?: number;
5948
+
5949
+ /**
5950
+ * @brief Video codec.
5951
+ * "H264": H.264 video codec.
5952
+ * "VP8": VP8 video codec.
5953
+ */
5954
+ codecType: "H264" | "VP8";
5721
5955
  }
5722
5956
 
5723
5957
  /**
@@ -5784,7 +6018,8 @@ export interface ScreenConfig {
5784
6018
  * @brief Whether to include the system audio
5785
6019
  * `include`:(Default) Include.
5786
6020
  * `exclude`:Exclude.
5787
- * For Chrome 107, Edge 107, and later versions on Windows
6021
+ * For Chrome 107, Edge 107, and later versions on Windows.
6022
+ * For Electron app, only support sharing the system audio on Windows.
5788
6023
  * See [systemAudio](https://developer.chrome.com/docs/web-platform/screen-sharing-controls/#systemAudio).
5789
6024
  */
5790
6025
  systemAudio?: "include" | "exclude";
@@ -5806,6 +6041,12 @@ export interface ScreenConfig {
5806
6041
  * See [selfBrowserSurface](https://developer.chrome.com/docs/web-platform/screen-sharing-controls/#selfBrowserSurface).
5807
6042
  */
5808
6043
  selfBrowserSurface?: "include" | "exclude";
6044
+
6045
+ /**
6046
+ * @brief The ID of the object to be shared during screen-sharing in Electron.
6047
+ * You can get the ID from [getElectronScreenSources](docs-104478#vertc-getelectronscreensources).
6048
+ */
6049
+ sourceId?: string;
5809
6050
  }
5810
6051
 
5811
6052
  /**
@@ -5875,6 +6116,8 @@ export interface SetParamInterface {
5875
6116
  /** 是否开启提前建连 */
5876
6117
  PRE_ICE: boolean;
5877
6118
  STATS_LOOP_INTERVAL: number;
6119
+ UPLOAD_REMOTE_STATS: string;
6120
+ SDK_CODEC_NEGOTIATION: boolean;
5878
6121
  }
5879
6122
 
5880
6123
  /**
@@ -6440,6 +6683,7 @@ export type CoreSetParamterInterface = {
6440
6683
 
6441
6684
  /**
6442
6685
  * @brief Layout configuration of a media stream
6686
+ * This struct contains all parameters in [LiveTranscodeLayoutRegion](#livetranscodelayoutregion) except for `isLocalUser` and `contentControl`, as well as the following parameters.
6443
6687
  */
6444
6688
  export type PublicStreamLayoutRegion = Omit<LiveTranscodeLayoutRegion, "isLocalUser" | "contentControl"> & {
6445
6689
 
@@ -6511,6 +6755,13 @@ onVideoFirstFrameDecodedEvent, "userId"> & {
6511
6755
  */
6512
6756
  publicStreamId: string;
6513
6757
  };
6758
+
6759
+ /**
6760
+ * @brief The type of screen-sharing object in Electron.
6761
+ * • `screen`: Screens.
6762
+ * • `window`: Windows and applications.
6763
+ */
6764
+ export type ScreenSourceType = "screen" | "window";
6514
6765
  export type SetParamKey = keyof (SetParamInterface & CoreSetParamterInterface);
6515
6766
 
6516
6767
  /**