@byteplus/rtc 4.62.1 → 4.63.1
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/extension-beauty/index.js +1 -1
- package/extension-beauty/index.umd.js +1 -1
- package/index.d.ts +274 -29
- package/index.esm.min.js +3 -3
- package/index.min.js +2 -2
- package/package.json +1 -1
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;
|
|
@@ -69,7 +70,7 @@ declare const Config: {
|
|
|
69
70
|
STATS_LOOP_INTERVAL: number;
|
|
70
71
|
HIDDEN_STATS: boolean;
|
|
71
72
|
UPLOAD_REMOTE_STATS: ExtendMediaType;
|
|
72
|
-
|
|
73
|
+
SDK_CODEC_NEGOTIATION: boolean;
|
|
73
74
|
};
|
|
74
75
|
declare const _default: VERTC;
|
|
75
76
|
declare enum AudioMixingError {
|
|
@@ -828,7 +829,30 @@ declare enum ErrorCode {
|
|
|
828
829
|
/**
|
|
829
830
|
* @brief The user is banned. Triggered when you call `joinRoom` after the local user is banned.
|
|
830
831
|
*/
|
|
831
|
-
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"
|
|
832
856
|
}
|
|
833
857
|
declare enum ExtendMediaType {
|
|
834
858
|
NONE = 0
|
|
@@ -926,6 +950,7 @@ declare enum StreamMixingEventType {
|
|
|
926
950
|
*/
|
|
927
951
|
STOP_FAILED = 9
|
|
928
952
|
}
|
|
953
|
+
declare function getElectronScreenSources(type?: ScreenSourceType): Promise<ElectronDesktopCapturerSource[]>;
|
|
929
954
|
declare function getParameter(key: keyof typeof Config): string | number | boolean | string[] | IJoinRoomConfig;
|
|
930
955
|
declare function setParameter<T extends SetParamKey>(key: T, value: (SetParamInterface & CoreSetParamterInterface)[T]): IJoinRoomConfig | undefined;
|
|
931
956
|
|
|
@@ -1148,6 +1173,27 @@ export declare enum ConnectionState {
|
|
|
1148
1173
|
CONNECTION_STATE_LOST = 6
|
|
1149
1174
|
}
|
|
1150
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
|
+
|
|
1151
1197
|
/**
|
|
1152
1198
|
* @brief The reason for media stream fallback or recovery
|
|
1153
1199
|
*/
|
|
@@ -1505,6 +1551,27 @@ export declare enum SUBTITLE_MODE {
|
|
|
1505
1551
|
ASR_AND_TRANSLATION = 1
|
|
1506
1552
|
}
|
|
1507
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
|
+
|
|
1508
1575
|
/**
|
|
1509
1576
|
* @brief Stream specification
|
|
1510
1577
|
*/
|
|
@@ -1708,6 +1775,27 @@ export declare enum UserOfflineReason {
|
|
|
1708
1775
|
KICKED_BY_ADMIN = 3
|
|
1709
1776
|
}
|
|
1710
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
|
+
|
|
1711
1799
|
/**
|
|
1712
1800
|
* @brief Rendering modes
|
|
1713
1801
|
*/
|
|
@@ -1732,6 +1820,27 @@ export declare enum VideoRenderMode {
|
|
|
1732
1820
|
RENDER_MODE_FILL = 2
|
|
1733
1821
|
}
|
|
1734
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
|
+
|
|
1735
1844
|
/**
|
|
1736
1845
|
* @brief Video source type
|
|
1737
1846
|
*/
|
|
@@ -1747,6 +1856,27 @@ export declare enum VideoSourceType {
|
|
|
1747
1856
|
*/
|
|
1748
1857
|
VIDEO_SOURCE_TYPE_INTERNAL = 1
|
|
1749
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
|
+
}
|
|
1750
1880
|
export declare type RTCExtension = any;
|
|
1751
1881
|
|
|
1752
1882
|
/**
|
|
@@ -1926,6 +2056,11 @@ export interface AutoPlayFailedEvent {
|
|
|
1926
2056
|
* @brief Player ID. An empty value indicates the default player.
|
|
1927
2057
|
*/
|
|
1928
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;
|
|
1929
2064
|
}
|
|
1930
2065
|
|
|
1931
2066
|
/**
|
|
@@ -2247,6 +2382,17 @@ export interface IBLWRTCEngine extends IRTCEngine {
|
|
|
2247
2382
|
setRemoteScreenVideoStreamIndex: (streamIndex: StreamIndex) => boolean;
|
|
2248
2383
|
}
|
|
2249
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
|
+
|
|
2250
2396
|
/**
|
|
2251
2397
|
* @id EngineEvents
|
|
2252
2398
|
* @list overview
|
|
@@ -2422,15 +2568,15 @@ export interface IEngineEvents {
|
|
|
2422
2568
|
/**
|
|
2423
2569
|
* @brief Event of video device state changing.
|
|
2424
2570
|
* @param event Information and state of a media device.
|
|
2425
|
-
* @group
|
|
2426
|
-
* @order
|
|
2571
|
+
* @group Device Management
|
|
2572
|
+
* @order 60
|
|
2427
2573
|
*/
|
|
2428
2574
|
[EngineEventsTypes.onVideoDeviceStateChanged]: (event: DeviceInfo) => void;
|
|
2429
2575
|
|
|
2430
2576
|
/**
|
|
2431
2577
|
* @brief Event of audio device state changing.
|
|
2432
2578
|
* @param event Information and state of a media device.
|
|
2433
|
-
* @group
|
|
2579
|
+
* @group Device Management
|
|
2434
2580
|
* @order 50
|
|
2435
2581
|
*/
|
|
2436
2582
|
[EngineEventsTypes.onAudioDeviceStateChanged]: (event: DeviceInfo) => void;
|
|
@@ -2580,7 +2726,7 @@ export interface IEngineEvents {
|
|
|
2580
2726
|
}) => void;
|
|
2581
2727
|
|
|
2582
2728
|
/**
|
|
2583
|
-
* @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.
|
|
2584
2730
|
* Local audio includes the microphone audio and the screen audio captured using RTC SDK internal mechanisms.
|
|
2585
2731
|
* @param event Information about local audio.
|
|
2586
2732
|
* @group Audio Management
|
|
@@ -3288,8 +3434,8 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
3288
3434
|
* @param deviceId Device ID. Call [enumerateDevices](#enumeratedevices) to get the device list.
|
|
3289
3435
|
* @return
|
|
3290
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.
|
|
3291
|
-
* @group
|
|
3292
|
-
* @order
|
|
3437
|
+
* @group Device Management
|
|
3438
|
+
* @order 45
|
|
3293
3439
|
*/
|
|
3294
3440
|
setAudioCaptureDevice: (deviceId: string) => Promise<void>;
|
|
3295
3441
|
|
|
@@ -3300,8 +3446,8 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
3300
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.
|
|
3301
3447
|
* + For mobile devices, set deviceId as `"user"` to use the front camera. Set deviceId as `"environment"` to use the rear camera.
|
|
3302
3448
|
* + The default camera is set by the browser.
|
|
3303
|
-
* @group
|
|
3304
|
-
* @order
|
|
3449
|
+
* @group Device Management
|
|
3450
|
+
* @order 55
|
|
3305
3451
|
*/
|
|
3306
3452
|
setVideoCaptureDevice: (deviceId: string) => Promise<void>;
|
|
3307
3453
|
|
|
@@ -3513,7 +3659,8 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
3513
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`.
|
|
3514
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.
|
|
3515
3661
|
* @param playerId Player ID. An empty value indicates the default player.
|
|
3516
|
-
* @notes
|
|
3662
|
+
* @notes When the audio selection is enabled, this method will not take effect.
|
|
3663
|
+
* After using this method to pause the media stream,
|
|
3517
3664
|
* + The billing duration will not stop counting since the subscription doesn't cancel.
|
|
3518
3665
|
* + The stream will not remove from the player. You can call [play](#play) to resume the stream.
|
|
3519
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).
|
|
@@ -3552,7 +3699,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
3552
3699
|
* @brief Toggle the callbacks carrying the audio frames.
|
|
3553
3700
|
* @param streamIndex Audio from microphone or device audio.
|
|
3554
3701
|
* @param userId ID of the remote user who published the audio. An empty value indicates the local audio.
|
|
3555
|
-
* When the Audio
|
|
3702
|
+
* When the Audio selection enabled, only the local audio frames are available.
|
|
3556
3703
|
* You will get the callback carrying the audio data as soon as the user starts publish audio.
|
|
3557
3704
|
* @param callback The callback function to receive the audio frames. An empty value indicates disabling the callback.
|
|
3558
3705
|
* When the user disconnects, the audio data is zero amplitude.
|
|
@@ -3644,7 +3791,9 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
3644
3791
|
* @brief Send supplemental enhancement information (SEI) through video frames.
|
|
3645
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.
|
|
3646
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`.
|
|
3647
|
-
* @param message SEI message within 4 KB.
|
|
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`.
|
|
3648
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]`.
|
|
3649
3798
|
* @notes + **Compatibility**<br/>
|
|
3650
3799
|
*   - SEI messages only support H.264 encoding, and use on browsers with Chromium 86+.
|
|
@@ -3660,18 +3809,14 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
3660
3809
|
sendSEIMessage: (streamIndex: StreamIndex, message: Uint8Array | string, repeatCount: number) => void;
|
|
3661
3810
|
|
|
3662
3811
|
/**
|
|
3663
|
-
* @brief
|
|
3664
|
-
* @param descriptions The configurations of
|
|
3665
|
-
*
|
|
3666
|
-
*
|
|
3667
|
-
*
|
|
3668
|
-
*
|
|
3669
|
-
*
|
|
3670
|
-
*
|
|
3671
|
-
* + 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.
|
|
3672
|
-
* + 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.
|
|
3673
|
-
* + 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.
|
|
3674
|
-
* + 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).
|
|
3675
3820
|
* @group Video Management
|
|
3676
3821
|
* @order 35
|
|
3677
3822
|
*/
|
|
@@ -3689,6 +3834,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
3689
3834
|
setScreenEncoderConfig: (description: ScreenEncoderConfig) => Promise<void>;
|
|
3690
3835
|
|
|
3691
3836
|
/**
|
|
3837
|
+
* @hidden Deprecated since V4.63, use setRemoteSimulcastStreamType instead.
|
|
3692
3838
|
* @brief Sets your expected configuration of the remote video stream that you want to subscribe to or have subscribed to.
|
|
3693
3839
|
* @param userId ID of the remote video stream publisher you expect to configure subscription parameters for.
|
|
3694
3840
|
* @param remoteVideoConfig The parameters you expect to configure for the remote video stream.
|
|
@@ -3701,6 +3847,22 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
3701
3847
|
setRemoteVideoConfig: (userId: string, remoteVideoConfig: RemoteVideoConfig) => Promise<void>;
|
|
3702
3848
|
|
|
3703
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.
|
|
3704
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.
|
|
3705
3867
|
* @param enabled Whether to enable simulcast.
|
|
3706
3868
|
* @return + `true`: Success.
|
|
@@ -3713,6 +3875,27 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
3713
3875
|
*/
|
|
3714
3876
|
enableSimulcastMode: (enabled: boolean) => boolean;
|
|
3715
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
|
+
|
|
3716
3899
|
/**
|
|
3717
3900
|
* @hidden
|
|
3718
3901
|
* @deprecated since 4.42, use enableAudioPropertiesReport instead
|
|
@@ -4262,8 +4445,9 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
4262
4445
|
* @brief Take a snapshot of the local video.
|
|
4263
4446
|
* @param streamIndex The specified video stream.
|
|
4264
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.
|
|
4265
|
-
* @notes +
|
|
4266
|
-
*
|
|
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.
|
|
4267
4451
|
* @return `INVOKED_BEFORE_CAPTURE`: No such stream. Please make sure that the specified stream has been published.
|
|
4268
4452
|
* @group Video Snapshot
|
|
4269
4453
|
* @order 0
|
|
@@ -4276,6 +4460,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
4276
4460
|
* @param streamIndex The specified video stream.
|
|
4277
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.
|
|
4278
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.
|
|
4279
4464
|
* @group Video Snapshot
|
|
4280
4465
|
* @order 1
|
|
4281
4466
|
*/
|
|
@@ -4514,6 +4699,31 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
4514
4699
|
* @hidden for internal use
|
|
4515
4700
|
*/
|
|
4516
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;
|
|
4517
4727
|
}
|
|
4518
4728
|
|
|
4519
4729
|
/**
|
|
@@ -4678,6 +4888,18 @@ export interface IVERTC {
|
|
|
4678
4888
|
* @order 26
|
|
4679
4889
|
*/
|
|
4680
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[]>;
|
|
4681
4903
|
}
|
|
4682
4904
|
|
|
4683
4905
|
/**
|
|
@@ -5124,7 +5346,7 @@ export interface LocalVideoStats {
|
|
|
5124
5346
|
* "H264": H.264 video codec.
|
|
5125
5347
|
* "VP8": VP8 video codec.
|
|
5126
5348
|
*/
|
|
5127
|
-
codecType:
|
|
5349
|
+
codecType: "H264" | "VP8";
|
|
5128
5350
|
|
|
5129
5351
|
/**
|
|
5130
5352
|
* @brief Whether it is a screen-sharing stream
|
|
@@ -5723,6 +5945,13 @@ export interface RemoteVideoStats {
|
|
|
5723
5945
|
* @brief Video index
|
|
5724
5946
|
*/
|
|
5725
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";
|
|
5726
5955
|
}
|
|
5727
5956
|
|
|
5728
5957
|
/**
|
|
@@ -5789,7 +6018,8 @@ export interface ScreenConfig {
|
|
|
5789
6018
|
* @brief Whether to include the system audio
|
|
5790
6019
|
* `include`:(Default) Include.
|
|
5791
6020
|
* `exclude`:Exclude.
|
|
5792
|
-
* 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.
|
|
5793
6023
|
* See [systemAudio](https://developer.chrome.com/docs/web-platform/screen-sharing-controls/#systemAudio).
|
|
5794
6024
|
*/
|
|
5795
6025
|
systemAudio?: "include" | "exclude";
|
|
@@ -5811,6 +6041,12 @@ export interface ScreenConfig {
|
|
|
5811
6041
|
* See [selfBrowserSurface](https://developer.chrome.com/docs/web-platform/screen-sharing-controls/#selfBrowserSurface).
|
|
5812
6042
|
*/
|
|
5813
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;
|
|
5814
6050
|
}
|
|
5815
6051
|
|
|
5816
6052
|
/**
|
|
@@ -5881,6 +6117,7 @@ export interface SetParamInterface {
|
|
|
5881
6117
|
PRE_ICE: boolean;
|
|
5882
6118
|
STATS_LOOP_INTERVAL: number;
|
|
5883
6119
|
UPLOAD_REMOTE_STATS: string;
|
|
6120
|
+
SDK_CODEC_NEGOTIATION: boolean;
|
|
5884
6121
|
}
|
|
5885
6122
|
|
|
5886
6123
|
/**
|
|
@@ -6446,6 +6683,7 @@ export type CoreSetParamterInterface = {
|
|
|
6446
6683
|
|
|
6447
6684
|
/**
|
|
6448
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.
|
|
6449
6687
|
*/
|
|
6450
6688
|
export type PublicStreamLayoutRegion = Omit<LiveTranscodeLayoutRegion, "isLocalUser" | "contentControl"> & {
|
|
6451
6689
|
|
|
@@ -6517,6 +6755,13 @@ onVideoFirstFrameDecodedEvent, "userId"> & {
|
|
|
6517
6755
|
*/
|
|
6518
6756
|
publicStreamId: string;
|
|
6519
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";
|
|
6520
6765
|
export type SetParamKey = keyof (SetParamInterface & CoreSetParamterInterface);
|
|
6521
6766
|
|
|
6522
6767
|
/**
|