@byteplus/rtc 4.44.3 → 4.45.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/index.d.ts +175 -73
- package/index.esm.min.js +2 -2
- package/index.min.js +2 -2
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -661,7 +661,7 @@ export interface MixOption {
|
|
|
661
661
|
playCount: number;
|
|
662
662
|
|
|
663
663
|
/**
|
|
664
|
-
* @brief For mixing playback types.
|
|
664
|
+
* @brief For mixing playback types.
|
|
665
665
|
*/
|
|
666
666
|
type?: AudioMixingType;
|
|
667
667
|
}
|
|
@@ -976,7 +976,7 @@ export interface onMediaDeviceStateChangeEvent {
|
|
|
976
976
|
export interface onSEIMessageEvent {
|
|
977
977
|
|
|
978
978
|
/**
|
|
979
|
-
* @brief Including userId of the user who sent the message, roomId of the current room, and the media stream carrying this SEI message.
|
|
979
|
+
* @brief Including userId of the user who sent the message, roomId of the current room, and the media stream carrying this SEI message.
|
|
980
980
|
*/
|
|
981
981
|
remoteStreamKey: RemoteStreamKey;
|
|
982
982
|
|
|
@@ -1353,7 +1353,7 @@ export interface RemoteStreamStats {
|
|
|
1353
1353
|
/**
|
|
1354
1354
|
* @brief userId of the user who is joining the room
|
|
1355
1355
|
*/
|
|
1356
|
-
userId
|
|
1356
|
+
userId: string;
|
|
1357
1357
|
|
|
1358
1358
|
/**
|
|
1359
1359
|
* @brief State of the remote audio stream
|
|
@@ -1558,7 +1558,8 @@ declare enum EngineEventsTypes {
|
|
|
1558
1558
|
onPublicStreamSEIMessageReceived = "onPublicStreamSEIMessageReceived",
|
|
1559
1559
|
onNetworkQuality = "onNetworkQuality",
|
|
1560
1560
|
onSimulcastSubscribeFallback = "onSimulcastSubscribeFallback",
|
|
1561
|
-
onRemoteVideoSizeChanged = "onRemoteVideoSizeChanged"
|
|
1561
|
+
onRemoteVideoSizeChanged = "onRemoteVideoSizeChanged",
|
|
1562
|
+
onLocalVideoSizeChanged = "onLocalVideoSizeChanged"
|
|
1562
1563
|
}
|
|
1563
1564
|
|
|
1564
1565
|
/**
|
|
@@ -1567,12 +1568,12 @@ declare enum EngineEventsTypes {
|
|
|
1567
1568
|
export interface StreamMixingEvent {
|
|
1568
1569
|
|
|
1569
1570
|
/**
|
|
1570
|
-
* @brief The types.
|
|
1571
|
+
* @brief The types.
|
|
1571
1572
|
*/
|
|
1572
1573
|
event: StreamMixingEventType;
|
|
1573
1574
|
|
|
1574
1575
|
/**
|
|
1575
|
-
* @brief The error codes.
|
|
1576
|
+
* @brief The error codes.
|
|
1576
1577
|
*/
|
|
1577
1578
|
error: StreamMixingEventErrorCode;
|
|
1578
1579
|
|
|
@@ -1588,7 +1589,7 @@ export interface StreamMixingEvent {
|
|
|
1588
1589
|
export interface UserConnectionEvent {
|
|
1589
1590
|
|
|
1590
1591
|
/**
|
|
1591
|
-
* @brief User information
|
|
1592
|
+
* @brief User information.
|
|
1592
1593
|
*/
|
|
1593
1594
|
userInfo: UserInfo;
|
|
1594
1595
|
}
|
|
@@ -1599,7 +1600,7 @@ export interface UserConnectionEvent {
|
|
|
1599
1600
|
export interface UserDisconnectionEvent {
|
|
1600
1601
|
|
|
1601
1602
|
/**
|
|
1602
|
-
* @brief User information
|
|
1603
|
+
* @brief User information.
|
|
1603
1604
|
*/
|
|
1604
1605
|
userInfo: UserInfo;
|
|
1605
1606
|
|
|
@@ -1654,7 +1655,11 @@ export interface PlayerEvent {
|
|
|
1654
1655
|
/**
|
|
1655
1656
|
* @brief userId of the user who is joining the room
|
|
1656
1657
|
*/
|
|
1657
|
-
userId
|
|
1658
|
+
userId?: string;
|
|
1659
|
+
|
|
1660
|
+
/**
|
|
1661
|
+
* @brief The public stream's ID.
|
|
1662
|
+
*/
|
|
1658
1663
|
publicStreamId?: string;
|
|
1659
1664
|
|
|
1660
1665
|
/**
|
|
@@ -1771,6 +1776,36 @@ export interface StreamKey {
|
|
|
1771
1776
|
*/
|
|
1772
1777
|
streamIndex: StreamIndex;
|
|
1773
1778
|
}
|
|
1779
|
+
/**
|
|
1780
|
+
* {zh}
|
|
1781
|
+
* @brief 自动播放失败事件
|
|
1782
|
+
*/
|
|
1783
|
+
/**
|
|
1784
|
+
*
|
|
1785
|
+
* @brief Event of Auto-play failure
|
|
1786
|
+
*/
|
|
1787
|
+
export interface AutoPlayFailedEvent {
|
|
1788
|
+
/**
|
|
1789
|
+
* {zh}
|
|
1790
|
+
* @brief 自动播放失败的流所属的用户 ID。不带此参数时表示本地流播放失败。
|
|
1791
|
+
*/
|
|
1792
|
+
/**
|
|
1793
|
+
*
|
|
1794
|
+
* @brief ID of the user whose stream failed to playback automatically. Without this parameter, the notification is about the local stream.
|
|
1795
|
+
*/
|
|
1796
|
+
userId?: string;
|
|
1797
|
+
/**
|
|
1798
|
+
* {zh}
|
|
1799
|
+
* @brief 自动播放失败的媒体类型
|
|
1800
|
+
* 例如,当同一用户的视频流和音频流自动播放都失败时,将触发两次 `onAutoPlayFailed` 回调,分别包含 `audio` 和 `video` 参数。
|
|
1801
|
+
*/
|
|
1802
|
+
/**
|
|
1803
|
+
*
|
|
1804
|
+
* @brief Type of the media which is failed to play automatically
|
|
1805
|
+
* For example, when both audio and video streams from the same user failed to playback automatically, you would get notified by `onAutoPlayFailed` twice with the argument of `audio` and `video` respectively.
|
|
1806
|
+
*/
|
|
1807
|
+
kind?: "audio" | "video";
|
|
1808
|
+
}
|
|
1774
1809
|
declare enum StreamMixingEventErrorCode {
|
|
1775
1810
|
|
|
1776
1811
|
/**
|
|
@@ -1954,7 +1989,7 @@ export interface IEngineEvents {
|
|
|
1954
1989
|
* @param event
|
|
1955
1990
|
* @region Video Management Event
|
|
1956
1991
|
*/
|
|
1957
|
-
[EngineEventsTypes.onAutoplayFailed]: (event:
|
|
1992
|
+
[EngineEventsTypes.onAutoplayFailed]: (event: AutoPlayFailedEvent) => void;
|
|
1958
1993
|
|
|
1959
1994
|
/**
|
|
1960
1995
|
* @brief Event of media track ending
|
|
@@ -2187,7 +2222,7 @@ export interface IEngineEvents {
|
|
|
2187
2222
|
* @param event Event related to the player
|
|
2188
2223
|
* @region Room Management Event
|
|
2189
2224
|
*/
|
|
2190
|
-
[EngineEventsTypes.onAutoplayFailed]: (event:
|
|
2225
|
+
[EngineEventsTypes.onAutoplayFailed]: (event: AutoPlayFailedEvent) => void;
|
|
2191
2226
|
|
|
2192
2227
|
/**
|
|
2193
2228
|
* @hidden
|
|
@@ -2291,19 +2326,11 @@ export interface IEngineEvents {
|
|
|
2291
2326
|
[EngineEventsTypes.onAudioPlaybackDeviceTestVolume]: (volume: number) => void;
|
|
2292
2327
|
|
|
2293
2328
|
/**
|
|
2294
|
-
* @brief The callback reports the network quality of the local user every 2s after the user enters the room.
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
/**
|
|
2299
|
-
* @brief Upstream network quality
|
|
2300
|
-
*/
|
|
2301
|
-
uplinkNetworkQuality: NetworkQuality,
|
|
2302
|
-
|
|
2303
|
-
/**
|
|
2304
|
-
* @brief Downstream network quality
|
|
2329
|
+
* @brief The callback reports the upstream and downstream network quality of the local user every 2s after the user enters the room.
|
|
2330
|
+
* @param uplinkNetworkQuality Upstream network quality.
|
|
2331
|
+
* @param downlinkNetworkQuality Downstream network quality.
|
|
2305
2332
|
*/
|
|
2306
|
-
downlinkNetworkQuality: NetworkQuality) => void;
|
|
2333
|
+
[EngineEventsTypes.onNetworkQuality]: (uplinkNetworkQuality: NetworkQuality, downlinkNetworkQuality: NetworkQuality) => void;
|
|
2307
2334
|
|
|
2308
2335
|
/**
|
|
2309
2336
|
* @brief Receives this callback when fallback happens or the stream recovers from fallback.
|
|
@@ -2343,6 +2370,33 @@ export interface IEngineEvents {
|
|
|
2343
2370
|
* @region Push to CDN
|
|
2344
2371
|
*/
|
|
2345
2372
|
[EngineEventsTypes.onStreamMixingEvent]: (event: StreamMixingEvent) => void;
|
|
2373
|
+
|
|
2374
|
+
/**
|
|
2375
|
+
* @brief The callback of the actual video capturing configuration.
|
|
2376
|
+
*/
|
|
2377
|
+
[EngineEventsTypes.onLocalVideoSizeChanged]: (e: {
|
|
2378
|
+
|
|
2379
|
+
/**
|
|
2380
|
+
* @brief The attributes of the screen-sharing stream.
|
|
2381
|
+
*/
|
|
2382
|
+
streamIndex: StreamIndex;
|
|
2383
|
+
|
|
2384
|
+
/**
|
|
2385
|
+
* @brief The actual capturing configuration.
|
|
2386
|
+
*/
|
|
2387
|
+
info: {
|
|
2388
|
+
|
|
2389
|
+
/**
|
|
2390
|
+
* @brief The width of the shared video (px).
|
|
2391
|
+
*/
|
|
2392
|
+
width: number;
|
|
2393
|
+
|
|
2394
|
+
/**
|
|
2395
|
+
* @brief The height of the shared video (px).
|
|
2396
|
+
*/
|
|
2397
|
+
height: number;
|
|
2398
|
+
};
|
|
2399
|
+
}) => void;
|
|
2346
2400
|
}
|
|
2347
2401
|
|
|
2348
2402
|
/**
|
|
@@ -2384,6 +2438,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
2384
2438
|
leaveRoom(waitAck?: boolean): Promise<void>;
|
|
2385
2439
|
|
|
2386
2440
|
/**
|
|
2441
|
+
* @hidden
|
|
2387
2442
|
* @brief Destroy engine
|
|
2388
2443
|
* Destroy the engine instances created by calling [createEngine](#createengine) and release all related resources.
|
|
2389
2444
|
* @notes + Make sure that the business scenarios related to the `RTCEngine` instances that need to be destroyed are all finished before calling this API.
|
|
@@ -2396,10 +2451,10 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
2396
2451
|
/**
|
|
2397
2452
|
* @brief Publishes media streams captured by camera/microphone in the current room.
|
|
2398
2453
|
* @param mediaType Media stream type, used for specifying whether to publish audio stream or video stream.
|
|
2399
|
-
* @notes + Streams are not published automatically in multi-room mode by default, you need to call this API to publish streams manually.
|
|
2400
|
-
* + An invisible user cannot publish media streams. Call [setUserVisibility](#setuservisibility) to change your visibility in the room.
|
|
2401
|
-
* + Call [publishScreen](#publishscreen) to start screen sharing.
|
|
2402
|
-
* + After you call this API, the other users in the room will receive [onUserPublishStream](104479#onuserpublishstream). Those who successfully received your streams will receive [onAudioFirstFrameDecoded](104479#onaudiofirstframedecoded)/[onVideoFirstFrameDecoded](104479#onvideofirstframedecoded) at the same time.
|
|
2454
|
+
* @notes + Streams are not published automatically in multi-room mode by default, you need to call this API to publish streams manually.
|
|
2455
|
+
* + An invisible user cannot publish media streams. Call [setUserVisibility](#setuservisibility) to change your visibility in the room.
|
|
2456
|
+
* + Call [publishScreen](#publishscreen) to start screen sharing.
|
|
2457
|
+
* + After you call this API, the other users in the room will receive [onUserPublishStream](104479#onuserpublishstream). Those who successfully received your streams will receive [onAudioFirstFrameDecoded](104479#onaudiofirstframedecoded)/[onVideoFirstFrameDecoded](104479#onvideofirstframedecoded) at the same time.
|
|
2403
2458
|
* + Call [unpublishStream](#unpublishstream) to stop publishing streams.
|
|
2404
2459
|
* @region Room Management
|
|
2405
2460
|
*/
|
|
@@ -2408,7 +2463,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
2408
2463
|
/**
|
|
2409
2464
|
* @brief Stops publishing media streams captured by camera/microphone in the current room.
|
|
2410
2465
|
* @param mediaType Media stream type, used for specifying whether to stop publishing audio stream or video stream.
|
|
2411
|
-
* @notes + After calling [publishStream](#publishstream), call this API to stop publishing streams.
|
|
2466
|
+
* @notes + After calling [publishStream](#publishstream), call this API to stop publishing streams.
|
|
2412
2467
|
* + After calling this API, the other users in the room will receive [onUserUnpublishStream](104479#onuserunpublishstream).
|
|
2413
2468
|
* @region Room Management
|
|
2414
2469
|
*/
|
|
@@ -2417,8 +2472,8 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
2417
2472
|
/**
|
|
2418
2473
|
* @brief Publishes local screen sharing streams in the current room.
|
|
2419
2474
|
* @param mediaType Media stream type, used for specifying whether to publish audio stream or video stream.
|
|
2420
|
-
* @notes + An invisible user cannot publish media streams. Call [setUserVisibility](#setuservisibility) to change your visibility in the room.
|
|
2421
|
-
* + After you called this API, the other users in the room will receive [onUserPublishScreen](104479#onuserpublishscreen). Those who successfully received your streams will receive [onAudioFirstFrameDecoded](104479#onaudiofirstframedecoded)/[onVideoFirstFrameDecoded](104479#onvideofirstframedecoded) at the same time.
|
|
2475
|
+
* @notes + An invisible user cannot publish media streams. Call [setUserVisibility](#setuservisibility) to change your visibility in the room.
|
|
2476
|
+
* + After you called this API, the other users in the room will receive [onUserPublishScreen](104479#onuserpublishscreen). Those who successfully received your streams will receive [onAudioFirstFrameDecoded](104479#onaudiofirstframedecoded)/[onVideoFirstFrameDecoded](104479#onvideofirstframedecoded) at the same time.
|
|
2422
2477
|
* + Call [unpublishScreen](#unpublishscreen) to stop publishing screen sharing streams.
|
|
2423
2478
|
* @region Screen Sharing
|
|
2424
2479
|
*/
|
|
@@ -2427,25 +2482,24 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
2427
2482
|
/**
|
|
2428
2483
|
* @brief Stops publishing local screen sharing streams in the current room.
|
|
2429
2484
|
* @param mediaType Media stream type, used for specifying whether to stop publishing audio stream or video stream.
|
|
2430
|
-
* @notes + After calling [publishScreen](#publishscreen), call this API to stop publishing streams.
|
|
2485
|
+
* @notes + After calling [publishScreen](#publishscreen), call this API to stop publishing streams.
|
|
2431
2486
|
* + After calling this API, the other users in the room will receive [onUserUnpublishScreen](104479#onuserunpublishscreen).
|
|
2432
2487
|
* @region Screen Sharing
|
|
2433
2488
|
*/
|
|
2434
2489
|
unpublishScreen(mediaType: MediaType): Promise<void>;
|
|
2435
2490
|
|
|
2436
2491
|
/**
|
|
2437
|
-
* @brief Subscribes to specific remote media streams captured by camera/microphone.
|
|
2492
|
+
* @brief Subscribes to specific remote media streams captured by camera/microphone.
|
|
2438
2493
|
* You can call this API in both automatic subscription mode and manual subscription mode.
|
|
2439
2494
|
* @param userId The ID of the remote user who published the target audio/video stream.
|
|
2440
2495
|
* @param mediaType Media stream type, used for specifying whether to subscribe to the audio stream or the video stream.
|
|
2441
|
-
* @notes
|
|
2442
|
-
* + The [onAudioFirstFrameDecoded](104479#onaudiofirstframedecoded)/[onVideoFirstFrameDecoded](104479#onvideofirstframedecoded) callback will be triggered after calling this API to indicate that the audio/video stream was successfully received. <br>
|
|
2496
|
+
* @notes You must first get the remote stream information through onUserPublishStream{@link #IRTCRoomEventHandler#onUserPublishStream} before calling this API to subscribe to streams accordingly.
|
|
2443
2497
|
* @region Room Management
|
|
2444
2498
|
*/
|
|
2445
2499
|
subscribeStream(userId: string, mediaType: MediaType): Promise<void>;
|
|
2446
2500
|
|
|
2447
2501
|
/**
|
|
2448
|
-
* @brief Unsubscribes from specific remote media streams captured by camera/microphone.
|
|
2502
|
+
* @brief Unsubscribes from specific remote media streams captured by camera/microphone.
|
|
2449
2503
|
* You can call this API in both automatic subscription mode and manual subscription mode.
|
|
2450
2504
|
* @param userId The ID of the remote user who published the target audio/video stream.
|
|
2451
2505
|
* @param mediaType Media stream type, used for specifying whether to unsubscribe from the audio stream or the video stream.
|
|
@@ -2454,18 +2508,18 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
2454
2508
|
unsubscribeStream(userId: string, mediaType: MediaType): Promise<void>;
|
|
2455
2509
|
|
|
2456
2510
|
/**
|
|
2457
|
-
* @brief Subscribes to specific screen sharing media stream.
|
|
2511
|
+
* @brief Subscribes to specific screen sharing media stream.
|
|
2458
2512
|
* You can call this API in both automatic subscription mode and manual subscription mode.
|
|
2459
2513
|
* @param userId The ID of the remote user who published the target screen audio/video stream.
|
|
2460
2514
|
* @param mediaType Media stream type, used for specifying whether to subscribe to the audio stream or the video stream.
|
|
2461
|
-
* @notes + You must first get the remote stream information through [onUserPublishScreen](104479#onuserpublishscreen) before calling this API to subscribe to streams accordingly.
|
|
2462
|
-
* + The [onAudioFirstFrameDecoded](104479#onaudiofirstframedecoded)/[onVideoFirstFrameDecoded](104479#onvideofirstframedecoded) callback will be triggered after calling this API to indicate that the audio/video stream was successfully received.
|
|
2515
|
+
* @notes + You must first get the remote stream information through [onUserPublishScreen](104479#onuserpublishscreen) before calling this API to subscribe to streams accordingly.
|
|
2516
|
+
* + The [onAudioFirstFrameDecoded](104479#onaudiofirstframedecoded)/[onVideoFirstFrameDecoded](104479#onvideofirstframedecoded) callback will be triggered after calling this API to indicate that the audio/video stream was successfully received.
|
|
2463
2517
|
* @region Room Management
|
|
2464
2518
|
*/
|
|
2465
2519
|
subscribeScreen(userId: string, mediaType: MediaType): Promise<void>;
|
|
2466
2520
|
|
|
2467
2521
|
/**
|
|
2468
|
-
* @brief Unsubscribes from specific screen sharing media stream.
|
|
2522
|
+
* @brief Unsubscribes from specific screen sharing media stream.
|
|
2469
2523
|
* You can call this API in both automatic subscription mode and manual subscription mode.
|
|
2470
2524
|
* @param uid The ID of the remote user who published the target screen audio/video stream.
|
|
2471
2525
|
* @param type Media stream type, used for specifying whether to unsubscribe from the audio stream or the video stream.
|
|
@@ -2544,7 +2598,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
2544
2598
|
* 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.
|
|
2545
2599
|
* @return
|
|
2546
2600
|
* @notes + Call [startAudioCapture](#startaudiocapture) to enable the internal audio capture.
|
|
2547
|
-
*
|
|
2601
|
+
* + Without calling this API the internal audio capture will sustain until you destroy the engine instance.
|
|
2548
2602
|
* @region Audio Management
|
|
2549
2603
|
*/
|
|
2550
2604
|
stopAudioCapture(): Promise<void>;
|
|
@@ -2577,7 +2631,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
2577
2631
|
* @notes You should bind the view after the user joins a room. This setting will sustain when the user leaves the room.
|
|
2578
2632
|
* @region Video Management
|
|
2579
2633
|
*/
|
|
2580
|
-
setLocalVideoPlayer(streamIndex: StreamIndex, videoPlayerOption?: VideoPlayerOption): HTMLVideoElement | undefined;
|
|
2634
|
+
setLocalVideoPlayer(streamIndex: StreamIndex, videoPlayerOption?: Partial<VideoPlayerOption>): HTMLVideoElement | undefined;
|
|
2581
2635
|
|
|
2582
2636
|
/**
|
|
2583
2637
|
* @brief Bind a view to the remote media stream and set the rendering mode for the rendering of the remote stream
|
|
@@ -2608,12 +2662,15 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
2608
2662
|
|
|
2609
2663
|
/**
|
|
2610
2664
|
* @brief Play audio and video stream manually.
|
|
2611
|
-
* Call this API when user need to take part in the audio and video reaction after calling [
|
|
2612
|
-
* @param userId
|
|
2613
|
-
*
|
|
2665
|
+
* Call this API when user need to take part in the audio and video reaction after calling [createEngine](#createengine) and set to autoPlay to False.
|
|
2666
|
+
* @param userId ID of the user whose stream is intended to play
|
|
2667
|
+
* Call this API without a parameter to start playing the local medias.
|
|
2668
|
+
* @return Calling this API when the audio and video are playing will also return a Promise.
|
|
2614
2669
|
* @region Room Management
|
|
2670
|
+
* @note + Call this API to start playback if the audio and/or video is not playing.
|
|
2671
|
+
* + Call this API once to start both audio and video playbacks when they do not start.
|
|
2615
2672
|
*/
|
|
2616
|
-
play(userId
|
|
2673
|
+
play(userId?: string): Promise<void>;
|
|
2617
2674
|
|
|
2618
2675
|
/**
|
|
2619
2676
|
* @brief Pause receiving remote media streams.
|
|
@@ -2695,19 +2752,21 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
2695
2752
|
* You can set parameters for up to 3 streams, SDK will always take the value of the first 3 streams when parameters for more streams are set.
|
|
2696
2753
|
* The code rate of the parameters must be in descending order.
|
|
2697
2754
|
* When the resolution of the max stream is in [540P, 1080P], you can simulcast 3 streams; when in [270P, 450P], you can simulcast 2 streams; when in [0, 180P], you can not enable simulcast.
|
|
2698
|
-
* @notes
|
|
2699
|
-
* +
|
|
2700
|
-
* + Before calling this API to set parameters for multiple video streams, the largest resolution of published streams is 640px × 360px with a frame rate of 15fps by default. <br>
|
|
2755
|
+
* @notes + For the video stream captured by the camera, the default value is 360P, 15FPS; for the screen-sharing stream, the default value is 1080P, 15FPS.
|
|
2756
|
+
* + Before calling this API to set parameters for multiple video streams, the largest resolution of published streams is 640px × 360px with a frame rate of 15fps by default.
|
|
2701
2757
|
* + This API is applicable to the video stream captured by the camera, see [setScreenEncoderConfig](#setscreenencoderconfig) for setting parameters for screen sharing video stream.
|
|
2702
2758
|
* @region Video Management
|
|
2703
2759
|
*/
|
|
2704
2760
|
setVideoEncoderConfig(descriptions: VideoEncoderConfig | VideoEncoderConfig[]): Promise<void>;
|
|
2705
2761
|
|
|
2706
2762
|
/**
|
|
2707
|
-
* @
|
|
2708
|
-
* @
|
|
2709
|
-
* @
|
|
2710
|
-
* @
|
|
2763
|
+
* @type api
|
|
2764
|
+
* @author changzhenan
|
|
2765
|
+
* @region Video Management
|
|
2766
|
+
* @brief Set the encoding configuration of the screen-sharing stream,which is also applied in video capture.
|
|
2767
|
+
* If the configuration is not supported by your browser, the video will be captured based on the supported configuration. You will also receive the callback [onLocalVideoSizeChanged](104479#onlocalvideosizechanged).
|
|
2768
|
+
* @param VideoEncoderConfig The encoding configuration of the screen-sharing stream.
|
|
2769
|
+
* @notes + We recommend that you set the encoding configuration before video capture. Otherwise, the video will be captured based on the default configuration(1080p@15fps).
|
|
2711
2770
|
*/
|
|
2712
2771
|
setScreenEncoderConfig(description: VideoEncoderConfig): Promise<void>;
|
|
2713
2772
|
|
|
@@ -2715,10 +2774,9 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
2715
2774
|
* @brief Sets your expected configuration of the remote video stream that you want to subscribe to or have subscribed to.
|
|
2716
2775
|
* @param userId The ID of the target stream publisher
|
|
2717
2776
|
* @param remoteVideoConfig Your expected configuration, see RemoteVideoConfig{@link #RemoteVideoConfig}.
|
|
2718
|
-
* @notes
|
|
2719
|
-
* +
|
|
2720
|
-
* +
|
|
2721
|
-
* + You should call this API in the room. If you want to call it before entering the room, you should set the `remoteVideoConfig` in the roomConfig` when calling [joinRoom](#joinroom). <br>
|
|
2777
|
+
* @notes + This API only works after the publisher calls [enableSimulcastMode](#enablesimulcastmode) to enable publishing multiple video streams, in which case the subscriber will receive a stream that is closest to the set configuration.
|
|
2778
|
+
* + If you don't call this API after the publisher enables the function of publishing multiple streams, you will receive by default the video stream with the largest resolution set by the publisher.
|
|
2779
|
+
* + You should call this API in the room. If you want to call it before entering the room, you should set the `remoteVideoConfig` in the roomConfig` when calling [joinRoom](#joinroom).
|
|
2722
2780
|
* @region Video Management
|
|
2723
2781
|
*/
|
|
2724
2782
|
setRemoteVideoConfig(userId: string, remoteVideoConfig: RemoteVideoConfig): Promise<void>;
|
|
@@ -2807,18 +2865,20 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
2807
2865
|
setUserVisibility(enable: boolean): Promise<void>;
|
|
2808
2866
|
|
|
2809
2867
|
/**
|
|
2810
|
-
* @brief
|
|
2811
|
-
*
|
|
2812
|
-
* @param
|
|
2868
|
+
* @brief Set a custom videoTrack as the video source.
|
|
2869
|
+
* Before calling this API, you must call [setVideoSourceType](#setvideosourcetype) to enable custom video capture.
|
|
2870
|
+
* @param index specify a stream index.
|
|
2871
|
+
* @param track specify a video track. See [MediaStreamTrack](https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamTrack).
|
|
2813
2872
|
* @return
|
|
2814
2873
|
* @region Video Management
|
|
2815
2874
|
*/
|
|
2816
2875
|
setExternalVideoTrack(index: StreamIndex, track: MediaStreamTrack): Promise<void>;
|
|
2817
2876
|
|
|
2818
2877
|
/**
|
|
2819
|
-
* @brief
|
|
2820
|
-
*
|
|
2821
|
-
* @param
|
|
2878
|
+
* @brief Set a custom audioTrack as the audio source.
|
|
2879
|
+
* Before calling this API, you must call [setAudioSourceType](#setaudiosourcetype) to enable custom video capture.
|
|
2880
|
+
* @param index specify a stream index.
|
|
2881
|
+
* @param track specify an audio track. See [MediaStreamTrack](https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamTrack).
|
|
2822
2882
|
* @return
|
|
2823
2883
|
* @region Audio Management
|
|
2824
2884
|
*/
|
|
@@ -3214,18 +3274,21 @@ export interface RoomConfig {
|
|
|
3214
3274
|
|
|
3215
3275
|
/**
|
|
3216
3276
|
* @brief Enable/disable auto-subscribe audio. Enable by default.
|
|
3277
|
+
* This does not include the screen stream.
|
|
3217
3278
|
* Call publish[104481#publish] to publish media streams if you disable `isAutoPublish`.
|
|
3218
3279
|
*/
|
|
3219
3280
|
isAutoPublish?: boolean;
|
|
3220
3281
|
|
|
3221
3282
|
/**
|
|
3222
3283
|
* @brief Enable/disable auto-subscribe audio. Enable by default.
|
|
3284
|
+
* This does not include the screen stream.
|
|
3223
3285
|
* Call subscribeUserStream, unsubscribe to revise the subscription.
|
|
3224
3286
|
*/
|
|
3225
3287
|
isAutoSubscribeAudio?: boolean;
|
|
3226
3288
|
|
|
3227
3289
|
/**
|
|
3228
3290
|
* @brief Enable/disable auto-subscribe video. Enable by default.
|
|
3291
|
+
* This does not include the screen stream.
|
|
3229
3292
|
* Call subscribeUserStream, unsubscribe to revise the subscription.
|
|
3230
3293
|
*/
|
|
3231
3294
|
isAutoSubscribeVideo?: boolean;
|
|
@@ -3530,7 +3593,12 @@ export declare enum ConnectionState {
|
|
|
3530
3593
|
/**
|
|
3531
3594
|
* @brief Completion of the reconnecting
|
|
3532
3595
|
*/
|
|
3533
|
-
CONNECTION_STATE_RECONNECTED = 5
|
|
3596
|
+
CONNECTION_STATE_RECONNECTED = 5,
|
|
3597
|
+
|
|
3598
|
+
/**
|
|
3599
|
+
* @brief The `CONNECTION_STATE_DISCONNECTED` status lasted for more than 10 seconds, during which SDK failed to reconnect. SDK will continue to try to reconnect.
|
|
3600
|
+
*/
|
|
3601
|
+
CONNECTION_STATE_LOST = 6
|
|
3534
3602
|
}
|
|
3535
3603
|
|
|
3536
3604
|
/**
|
|
@@ -3589,27 +3657,27 @@ export interface ScreenConfig {
|
|
|
3589
3657
|
}
|
|
3590
3658
|
|
|
3591
3659
|
/**
|
|
3592
|
-
* @brief
|
|
3660
|
+
* @brief The video encoding configuration.
|
|
3593
3661
|
*/
|
|
3594
3662
|
export interface VideoEncoderConfig {
|
|
3595
3663
|
|
|
3596
3664
|
/**
|
|
3597
|
-
* @brief width
|
|
3665
|
+
* @brief The width of the shared video (px).
|
|
3598
3666
|
*/
|
|
3599
3667
|
width: number;
|
|
3600
3668
|
|
|
3601
3669
|
/**
|
|
3602
|
-
* @brief height
|
|
3670
|
+
* @brief The height of the shared video (px).
|
|
3603
3671
|
*/
|
|
3604
3672
|
height: number;
|
|
3605
3673
|
|
|
3606
3674
|
/**
|
|
3607
|
-
* @brief
|
|
3675
|
+
* @brief The framerate of the shared video (fps).
|
|
3608
3676
|
*/
|
|
3609
3677
|
frameRate: number;
|
|
3610
3678
|
|
|
3611
3679
|
/**
|
|
3612
|
-
* @brief The
|
|
3680
|
+
* @brief The maximum bitrate(>0/kbps). The default value is 3000kbps.
|
|
3613
3681
|
*/
|
|
3614
3682
|
maxKbps: number;
|
|
3615
3683
|
}
|
|
@@ -3677,7 +3745,7 @@ export interface LiveTranscodeConfig {
|
|
|
3677
3745
|
video?: Partial<LiveTranscodeVideoConfig>;
|
|
3678
3746
|
|
|
3679
3747
|
/**
|
|
3680
|
-
* @brief User layout information.
|
|
3748
|
+
* @brief User layout information.
|
|
3681
3749
|
*/
|
|
3682
3750
|
layout?: Partial<LiveTranscodeLayoutConfig>;
|
|
3683
3751
|
}
|
|
@@ -4284,6 +4352,38 @@ export declare enum AudioProfileType {
|
|
|
4284
4352
|
hdMono = 5
|
|
4285
4353
|
}
|
|
4286
4354
|
|
|
4355
|
+
/**
|
|
4356
|
+
* @brief Auto-play policy
|
|
4357
|
+
*/
|
|
4358
|
+
export declare enum RTCAutoPlayPolicy {
|
|
4359
|
+
|
|
4360
|
+
/**
|
|
4361
|
+
* @brief By default, play audios and videos automatically.
|
|
4362
|
+
*/
|
|
4363
|
+
AUTO_PLAY = 0,
|
|
4364
|
+
|
|
4365
|
+
/**
|
|
4366
|
+
* @brief Play videos only automatically.
|
|
4367
|
+
*/
|
|
4368
|
+
VIDEO_ONLY = 1,
|
|
4369
|
+
|
|
4370
|
+
/**
|
|
4371
|
+
* @brief Disable Auto-play. Guide user to act with the App to play the media streams.
|
|
4372
|
+
*/
|
|
4373
|
+
PLAY_MANUALLY = 2
|
|
4374
|
+
}
|
|
4375
|
+
|
|
4376
|
+
/**
|
|
4377
|
+
* @brief Configuration for the engine instance to be created
|
|
4378
|
+
*/
|
|
4379
|
+
export interface EngineConfig {
|
|
4380
|
+
|
|
4381
|
+
/**
|
|
4382
|
+
* @brief Auto-play policy
|
|
4383
|
+
*/
|
|
4384
|
+
autoPlayPolicy: RTCAutoPlayPolicy;
|
|
4385
|
+
}
|
|
4386
|
+
|
|
4287
4387
|
/**
|
|
4288
4388
|
* @brief Point-to-point text message
|
|
4289
4389
|
*/
|
|
@@ -4297,7 +4397,7 @@ export interface UserMessageEvent {
|
|
|
4297
4397
|
/**
|
|
4298
4398
|
* @brief Point-to-point text message
|
|
4299
4399
|
*/
|
|
4300
|
-
message:
|
|
4400
|
+
message: string;
|
|
4301
4401
|
}
|
|
4302
4402
|
|
|
4303
4403
|
/**
|
|
@@ -4359,9 +4459,10 @@ declare const Config: {
|
|
|
4359
4459
|
LOG_SERVER_URL: string;
|
|
4360
4460
|
CONFIG_REQUEST_DOMAINS: string[];
|
|
4361
4461
|
DEVICE_ID: string;
|
|
4462
|
+
OVERSEA: boolean;
|
|
4362
4463
|
};
|
|
4363
4464
|
declare function setParameter(key: keyof typeof Config, value: any): void;
|
|
4364
|
-
declare function getParameter(key: keyof typeof Config): string | string[];
|
|
4465
|
+
declare function getParameter(key: keyof typeof Config): string | boolean | string[];
|
|
4365
4466
|
/**
|
|
4366
4467
|
* @list 104477
|
|
4367
4468
|
* @detail 104478
|
|
@@ -4378,12 +4479,13 @@ export interface IVERTC {
|
|
|
4378
4479
|
* Calling this API repeatedly will create multiple IRTCEngine instances.
|
|
4379
4480
|
* @param appId A unique identifier for each application. You can apply appIDs on the RTC console.
|
|
4380
4481
|
* Instances generated by different AppIDs are independent in RTC service. Users served by one AppID cannot communicate with users served by another AppID.
|
|
4482
|
+
* @param config Configuration of the engine instance, such as Auto-play policy
|
|
4381
4483
|
* @return Return an `IRTCEngine` instance if you call this API successfully.
|
|
4382
4484
|
* @notes + Call [destroyEngine](#destroyengine) respectively to destroy each IRTCEngine instance.
|
|
4383
4485
|
* + As each IRTCEngine instance is resource consuming, we recommend creating no more than 2 engine instances on each device at the same time.
|
|
4384
4486
|
* @region Engine Management
|
|
4385
4487
|
*/
|
|
4386
|
-
createEngine(appId: string): IRTCEngine;
|
|
4488
|
+
createEngine(appId: string, config?: EngineConfig): IRTCEngine;
|
|
4387
4489
|
|
|
4388
4490
|
/**
|
|
4389
4491
|
* @brief Call this API to destroy the IRTCEngine instance created by [createEngine](#createengine).
|
|
@@ -4474,7 +4576,7 @@ export interface IVERTC {
|
|
|
4474
4576
|
}
|
|
4475
4577
|
declare class VERTC implements IVERTC {
|
|
4476
4578
|
getSdkVersion: () => string;
|
|
4477
|
-
createEngine: (appId: string) => IRTCEngine;
|
|
4579
|
+
createEngine: (appId: string, config?: EngineConfig | undefined) => IRTCEngine;
|
|
4478
4580
|
destroyEngine: (engine: IRTCEngine) => void;
|
|
4479
4581
|
enumerateDevices: () => Promise<MediaDeviceInfo[]>;
|
|
4480
4582
|
enableDevices: (options?: {
|