@byteplus/rtc 4.44.5 → 4.45.0-blw.12

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
@@ -377,7 +377,8 @@ declare enum ErrorCode {
377
377
  * @brief Reconnection with the server fails and SDK will no longer automatically retry.
378
378
  * Please leave room first and join room again, or contact technical support.
379
379
  */
380
- RECONNECT_FAILED = "RECONNECT_FAILED"
380
+ RECONNECT_FAILED = "RECONNECT_FAILED",
381
+ PUBLIC_STREAM_DECODE_FAILED = "PUBLIC_STREAM_DECODE_FAILED"
381
382
  }
382
383
  declare enum AudioMixingError {
383
384
 
@@ -661,7 +662,7 @@ export interface MixOption {
661
662
  playCount: number;
662
663
 
663
664
  /**
664
- * @brief For mixing playback types. Refer to [AudioMixingType](#audiomixingtype).
665
+ * @brief For mixing playback types.
665
666
  */
666
667
  type?: AudioMixingType;
667
668
  }
@@ -976,7 +977,7 @@ export interface onMediaDeviceStateChangeEvent {
976
977
  export interface onSEIMessageEvent {
977
978
 
978
979
  /**
979
- * @brief Including userId of the user who sent the message, roomId of the current room, and the media stream carrying this SEI message. Refer to [RemoteStreamKey](#remotestreamkey) for more information.
980
+ * @brief Including userId of the user who sent the message, roomId of the current room, and the media stream carrying this SEI message.
980
981
  */
981
982
  remoteStreamKey: RemoteStreamKey;
982
983
 
@@ -1353,7 +1354,7 @@ export interface RemoteStreamStats {
1353
1354
  /**
1354
1355
  * @brief userId of the user who is joining the room
1355
1356
  */
1356
- userId?: string;
1357
+ userId: string;
1357
1358
 
1358
1359
  /**
1359
1360
  * @brief State of the remote audio stream
@@ -1558,7 +1559,9 @@ declare enum EngineEventsTypes {
1558
1559
  onPublicStreamSEIMessageReceived = "onPublicStreamSEIMessageReceived",
1559
1560
  onNetworkQuality = "onNetworkQuality",
1560
1561
  onSimulcastSubscribeFallback = "onSimulcastSubscribeFallback",
1561
- onRemoteVideoSizeChanged = "onRemoteVideoSizeChanged"
1562
+ onRemoteVideoSizeChanged = "onRemoteVideoSizeChanged",
1563
+ onLocalVideoSizeChanged = "onLocalVideoSizeChanged",
1564
+ onLocalCameraStalled = "onLocalCameraStalled"
1562
1565
  }
1563
1566
 
1564
1567
  /**
@@ -1567,12 +1570,12 @@ declare enum EngineEventsTypes {
1567
1570
  export interface StreamMixingEvent {
1568
1571
 
1569
1572
  /**
1570
- * @brief The types. See [StreamMixingEventType](104481#streammixingeventtype).
1573
+ * @brief The types.
1571
1574
  */
1572
1575
  event: StreamMixingEventType;
1573
1576
 
1574
1577
  /**
1575
- * @brief The error codes. See [StreamMixingEventErrorCode](104480#streammixingeventerrorcode).
1578
+ * @brief The error codes.
1576
1579
  */
1577
1580
  error: StreamMixingEventErrorCode;
1578
1581
 
@@ -1588,7 +1591,7 @@ export interface StreamMixingEvent {
1588
1591
  export interface UserConnectionEvent {
1589
1592
 
1590
1593
  /**
1591
- * @brief User information, refer to [UserInfo](#userinfo) for more details.
1594
+ * @brief User information.
1592
1595
  */
1593
1596
  userInfo: UserInfo;
1594
1597
  }
@@ -1599,7 +1602,7 @@ export interface UserConnectionEvent {
1599
1602
  export interface UserDisconnectionEvent {
1600
1603
 
1601
1604
  /**
1602
- * @brief User information, refer to [UserInfo](#userinfo) for more details.
1605
+ * @brief User information.
1603
1606
  */
1604
1607
  userInfo: UserInfo;
1605
1608
 
@@ -1655,6 +1658,10 @@ export interface PlayerEvent {
1655
1658
  * @brief userId of the user who is joining the room
1656
1659
  */
1657
1660
  userId: string;
1661
+
1662
+ /**
1663
+ * @brief The public stream's ID.
1664
+ */
1658
1665
  publicStreamId?: string;
1659
1666
 
1660
1667
  /**
@@ -1771,6 +1778,38 @@ export interface StreamKey {
1771
1778
  */
1772
1779
  streamIndex: StreamIndex;
1773
1780
  }
1781
+ /**
1782
+ * {zh}
1783
+ * @brief 自动播放失败事件
1784
+ */
1785
+ /**
1786
+ *
1787
+ * @brief Event of Auto-play failure
1788
+ */
1789
+ export interface AutoPlayFailedEvent {
1790
+ /**
1791
+ * {zh}
1792
+ * @brief 自动播放失败的流所属的用户 ID。不带此参数时表示本地流播放失败。
1793
+ */
1794
+ /**
1795
+ *
1796
+ * @brief ID of the user whose stream failed to playback automatically. Without this parameter, the notification is about the local stream.
1797
+ */
1798
+ userId: string;
1799
+ /**
1800
+ * {zh}
1801
+ * @brief 自动播放失败的媒体类型
1802
+ * 例如,当同一用户的视频流和音频流自动播放都失败时,将触发两次 `onAutoPlayFailed` 回调,分别包含 `audio` 和 `video` 参数。
1803
+ */
1804
+ /**
1805
+ *
1806
+ * @brief Type of the media which is failed to play automatically
1807
+ * 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.
1808
+ */
1809
+ kind: "audio" | "video";
1810
+ streamIndex: StreamIndex;
1811
+ mediaType: MediaType.AUDIO | MediaType.VIDEO;
1812
+ }
1774
1813
  declare enum StreamMixingEventErrorCode {
1775
1814
 
1776
1815
  /**
@@ -1954,7 +1993,7 @@ export interface IEngineEvents {
1954
1993
  * @param event
1955
1994
  * @region Video Management Event
1956
1995
  */
1957
- [EngineEventsTypes.onAutoplayFailed]: (event: PlayerEvent) => void;
1996
+ [EngineEventsTypes.onAutoplayFailed]: (event: AutoPlayFailedEvent) => void;
1958
1997
 
1959
1998
  /**
1960
1999
  * @brief Event of media track ending
@@ -2187,7 +2226,7 @@ export interface IEngineEvents {
2187
2226
  * @param event Event related to the player
2188
2227
  * @region Room Management Event
2189
2228
  */
2190
- [EngineEventsTypes.onAutoplayFailed]: (event: PlayerEvent) => void;
2229
+ [EngineEventsTypes.onAutoplayFailed]: (event: AutoPlayFailedEvent) => void;
2191
2230
 
2192
2231
  /**
2193
2232
  * @hidden
@@ -2208,7 +2247,8 @@ export interface IEngineEvents {
2208
2247
  /**
2209
2248
  * @brief The reason why the current user has been removed from the room.
2210
2249
  */
2211
- errorCode: ErrorCode.DUPLICATE_LOGIN | ErrorCode.RTM_DUPLICATE_LOGIN | ErrorCode.RTM_TOKEN_ERROR | ErrorCode.EXPIRED_TOKEN | ErrorCode.RECONNECT_FAILED;
2250
+ errorCode: ErrorCode.DUPLICATE_LOGIN | ErrorCode.RTM_DUPLICATE_LOGIN | ErrorCode.RTM_TOKEN_ERROR | ErrorCode.EXPIRED_TOKEN | ErrorCode.RECONNECT_FAILED | ErrorCode.PUBLIC_STREAM_DECODE_FAILED;
2251
+ publicStreamId?: string;
2212
2252
  }) => void;
2213
2253
 
2214
2254
  /**
@@ -2291,19 +2331,11 @@ export interface IEngineEvents {
2291
2331
  [EngineEventsTypes.onAudioPlaybackDeviceTestVolume]: (volume: number) => void;
2292
2332
 
2293
2333
  /**
2294
- * @brief The callback reports the network quality of the local user every 2s after the user enters the room.
2295
- */
2296
- [EngineEventsTypes.onNetworkQuality]: (
2297
-
2298
- /**
2299
- * @brief Upstream network quality
2334
+ * @brief The callback reports the upstream and downstream network quality of the local user every 2s after the user enters the room.
2335
+ * @param uplinkNetworkQuality Upstream network quality.
2336
+ * @param downlinkNetworkQuality Downstream network quality.
2300
2337
  */
2301
- uplinkNetworkQuality: NetworkQuality,
2302
-
2303
- /**
2304
- * @brief Downstream network quality
2305
- */
2306
- downlinkNetworkQuality: NetworkQuality) => void;
2338
+ [EngineEventsTypes.onNetworkQuality]: (uplinkNetworkQuality: NetworkQuality, downlinkNetworkQuality: NetworkQuality) => void;
2307
2339
 
2308
2340
  /**
2309
2341
  * @brief Receives this callback when fallback happens or the stream recovers from fallback.
@@ -2343,6 +2375,34 @@ export interface IEngineEvents {
2343
2375
  * @region Push to CDN
2344
2376
  */
2345
2377
  [EngineEventsTypes.onStreamMixingEvent]: (event: StreamMixingEvent) => void;
2378
+
2379
+ /**
2380
+ * @brief The callback of the actual video capturing configuration.
2381
+ */
2382
+ [EngineEventsTypes.onLocalVideoSizeChanged]: (e: {
2383
+
2384
+ /**
2385
+ * @brief The attributes of the screen-sharing stream.
2386
+ */
2387
+ streamIndex: StreamIndex;
2388
+
2389
+ /**
2390
+ * @brief The actual capturing configuration.
2391
+ */
2392
+ info: {
2393
+
2394
+ /**
2395
+ * @brief The width of the shared video (px).
2396
+ */
2397
+ width: number;
2398
+
2399
+ /**
2400
+ * @brief The height of the shared video (px).
2401
+ */
2402
+ height: number;
2403
+ };
2404
+ }) => void;
2405
+ [EngineEventsTypes.onLocalCameraStalled]: () => void;
2346
2406
  }
2347
2407
 
2348
2408
  /**
@@ -2384,6 +2444,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2384
2444
  leaveRoom(waitAck?: boolean): Promise<void>;
2385
2445
 
2386
2446
  /**
2447
+ * @hidden
2387
2448
  * @brief Destroy engine
2388
2449
  * Destroy the engine instances created by calling [createEngine](#createengine) and release all related resources.
2389
2450
  * @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 +2457,10 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2396
2457
  /**
2397
2458
  * @brief Publishes media streams captured by camera/microphone in the current room.
2398
2459
  * @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. <br>
2400
- * + An invisible user cannot publish media streams. Call [setUserVisibility](#setuservisibility) to change your visibility in the room. <br>
2401
- * + Call [publishScreen](#publishscreen) to start screen sharing. <br>
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. <br>
2460
+ * @notes + Streams are not published automatically in multi-room mode by default, you need to call this API to publish streams manually.
2461
+ * + An invisible user cannot publish media streams. Call [setUserVisibility](#setuservisibility) to change your visibility in the room.
2462
+ * + Call [publishScreen](#publishscreen) to start screen sharing.
2463
+ * + 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
2464
  * + Call [unpublishStream](#unpublishstream) to stop publishing streams.
2404
2465
  * @region Room Management
2405
2466
  */
@@ -2408,7 +2469,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2408
2469
  /**
2409
2470
  * @brief Stops publishing media streams captured by camera/microphone in the current room.
2410
2471
  * @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. <br>
2472
+ * @notes + After calling [publishStream](#publishstream), call this API to stop publishing streams.
2412
2473
  * + After calling this API, the other users in the room will receive [onUserUnpublishStream](104479#onuserunpublishstream).
2413
2474
  * @region Room Management
2414
2475
  */
@@ -2417,8 +2478,8 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2417
2478
  /**
2418
2479
  * @brief Publishes local screen sharing streams in the current room.
2419
2480
  * @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. <br>
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. <br>
2481
+ * @notes + An invisible user cannot publish media streams. Call [setUserVisibility](#setuservisibility) to change your visibility in the room.
2482
+ * + 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
2483
  * + Call [unpublishScreen](#unpublishscreen) to stop publishing screen sharing streams.
2423
2484
  * @region Screen Sharing
2424
2485
  */
@@ -2427,25 +2488,24 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2427
2488
  /**
2428
2489
  * @brief Stops publishing local screen sharing streams in the current room.
2429
2490
  * @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. <br>
2491
+ * @notes + After calling [publishScreen](#publishscreen), call this API to stop publishing streams.
2431
2492
  * + After calling this API, the other users in the room will receive [onUserUnpublishScreen](104479#onuserunpublishscreen).
2432
2493
  * @region Screen Sharing
2433
2494
  */
2434
2495
  unpublishScreen(mediaType: MediaType): Promise<void>;
2435
2496
 
2436
2497
  /**
2437
- * @brief Subscribes to specific remote media streams captured by camera/microphone. <br>
2498
+ * @brief Subscribes to specific remote media streams captured by camera/microphone.
2438
2499
  * You can call this API in both automatic subscription mode and manual subscription mode.
2439
2500
  * @param userId The ID of the remote user who published the target audio/video stream.
2440
2501
  * @param mediaType Media stream type, used for specifying whether to subscribe to the audio stream or the video stream.
2441
- * @notes + You must first get the remote stream information through onUserPublishStream{@link #IRTCRoomEventHandler#onUserPublishStream} before calling this API to subscribe to streams accordingly. <br>
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>
2502
+ * @notes You must first get the remote stream information through onUserPublishStream{@link #IRTCRoomEventHandler#onUserPublishStream} before calling this API to subscribe to streams accordingly.
2443
2503
  * @region Room Management
2444
2504
  */
2445
2505
  subscribeStream(userId: string, mediaType: MediaType): Promise<void>;
2446
2506
 
2447
2507
  /**
2448
- * @brief Unsubscribes from specific remote media streams captured by camera/microphone. <br>
2508
+ * @brief Unsubscribes from specific remote media streams captured by camera/microphone.
2449
2509
  * You can call this API in both automatic subscription mode and manual subscription mode.
2450
2510
  * @param userId The ID of the remote user who published the target audio/video stream.
2451
2511
  * @param mediaType Media stream type, used for specifying whether to unsubscribe from the audio stream or the video stream.
@@ -2454,18 +2514,18 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2454
2514
  unsubscribeStream(userId: string, mediaType: MediaType): Promise<void>;
2455
2515
 
2456
2516
  /**
2457
- * @brief Subscribes to specific screen sharing media stream. <br>
2517
+ * @brief Subscribes to specific screen sharing media stream.
2458
2518
  * You can call this API in both automatic subscription mode and manual subscription mode.
2459
2519
  * @param userId The ID of the remote user who published the target screen audio/video stream.
2460
2520
  * @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. <br>
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. <br>
2521
+ * @notes + You must first get the remote stream information through [onUserPublishScreen](104479#onuserpublishscreen) before calling this API to subscribe to streams accordingly.
2522
+ * + 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
2523
  * @region Room Management
2464
2524
  */
2465
2525
  subscribeScreen(userId: string, mediaType: MediaType): Promise<void>;
2466
2526
 
2467
2527
  /**
2468
- * @brief Unsubscribes from specific screen sharing media stream. <br>
2528
+ * @brief Unsubscribes from specific screen sharing media stream.
2469
2529
  * You can call this API in both automatic subscription mode and manual subscription mode.
2470
2530
  * @param uid The ID of the remote user who published the target screen audio/video stream.
2471
2531
  * @param type Media stream type, used for specifying whether to unsubscribe from the audio stream or the video stream.
@@ -2514,6 +2574,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2514
2574
  * @region Video Management
2515
2575
  */
2516
2576
  startVideoCapture(deviceId?: string): Promise<MediaTrackSettings>;
2577
+ startVideoAndAudioCapture(videoDeviceId: string | undefined, audioDeviceId: string | undefined): Promise<void>;
2517
2578
 
2518
2579
  /**
2519
2580
  * @brief Enable internal video capture immediately. The default setting is off.
@@ -2544,7 +2605,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2544
2605
  * 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
2606
  * @return
2546
2607
  * @notes + Call [startAudioCapture](#startaudiocapture) to enable the internal audio capture.
2547
- * + Without calling this API the internal audio capture will sustain until you destroy the engine instance.
2608
+ * + Without calling this API the internal audio capture will sustain until you destroy the engine instance.
2548
2609
  * @region Audio Management
2549
2610
  */
2550
2611
  stopAudioCapture(): Promise<void>;
@@ -2568,6 +2629,8 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2568
2629
  */
2569
2630
  stopScreenCapture(): Promise<void>;
2570
2631
 
2632
+ setRemoteScreenVideoStreamIndex(streamIndex: StreamIndex): boolean;
2633
+
2571
2634
  /**
2572
2635
  * @brief Bind a view to the local media stream and set the rendering mode for the rendering of the local stream
2573
2636
  * Listen to `onPlayerEvent` for the state after binding a view to the local video stream.
@@ -2577,7 +2640,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2577
2640
  * @notes You should bind the view after the user joins a room. This setting will sustain when the user leaves the room.
2578
2641
  * @region Video Management
2579
2642
  */
2580
- setLocalVideoPlayer(streamIndex: StreamIndex, videoPlayerOption?: VideoPlayerOption): HTMLVideoElement | undefined;
2643
+ setLocalVideoPlayer(streamIndex: StreamIndex, videoPlayerOption?: Partial<VideoPlayerOption>): HTMLVideoElement | undefined;
2581
2644
 
2582
2645
  /**
2583
2646
  * @brief Bind a view to the remote media stream and set the rendering mode for the rendering of the remote stream
@@ -2605,15 +2668,19 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2605
2668
  * @region Audio Management
2606
2669
  */
2607
2670
  setAudioPlaybackDevice(deviceId: string): Promise<void>;
2671
+ resetRemoteAudioPlayer(userId: string): void;
2608
2672
 
2609
2673
  /**
2610
2674
  * @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 [joinRoom](#joinroom) and set to autoPlay to False.
2612
- * @param userId
2613
- * @return
2675
+ * 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.
2676
+ * @param userId ID of the user whose stream is intended to play
2677
+ * Call this API without a parameter to start playing the local medias.
2678
+ * @return Calling this API when the audio and video are playing will also return a Promise.
2614
2679
  * @region Room Management
2680
+ * @note + Call this API to start playback if the audio and/or video is not playing.
2681
+ * + Call this API once to start both audio and video playbacks when they do not start.
2615
2682
  */
2616
- play(userId: string): Promise<void>;
2683
+ play: (userId?: string, mediaType?: MediaType, streamIndex?: StreamIndex) => Promise<void>;
2617
2684
 
2618
2685
  /**
2619
2686
  * @brief Pause receiving remote media streams.
@@ -2695,19 +2762,21 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2695
2762
  * 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
2763
  * The code rate of the parameters must be in descending order.
2697
2764
  * 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 <br>
2699
- * + 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.
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>
2765
+ * @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.
2766
+ * + 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
2767
  * + This API is applicable to the video stream captured by the camera, see [setScreenEncoderConfig](#setscreenencoderconfig) for setting parameters for screen sharing video stream.
2702
2768
  * @region Video Management
2703
2769
  */
2704
2770
  setVideoEncoderConfig(descriptions: VideoEncoderConfig | VideoEncoderConfig[]): Promise<void>;
2705
2771
 
2706
2772
  /**
2707
- * @brief Video publisher call this API to set the expected configurations for the screen sharing video stream, including resolution, frame rate, bitrate, scale mode, and fallback strategy in poor network conditions.
2708
- * @param description You expected configurations for screen sharing video stream.
2709
- * @notes Before calling this API, a screen video stream with a default resolution of 1920px × 1080px and a frame rate of 15fps will be published.
2710
- * @region Screen Shareing Management
2773
+ * @type api
2774
+ * @author changzhenan
2775
+ * @region Video Management
2776
+ * @brief Set the encoding configuration of the screen-sharing stream,which is also applied in video capture.
2777
+ * 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).
2778
+ * @param VideoEncoderConfig The encoding configuration of the screen-sharing stream.
2779
+ * @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
2780
  */
2712
2781
  setScreenEncoderConfig(description: VideoEncoderConfig): Promise<void>;
2713
2782
 
@@ -2715,10 +2784,9 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2715
2784
  * @brief Sets your expected configuration of the remote video stream that you want to subscribe to or have subscribed to.
2716
2785
  * @param userId The ID of the target stream publisher
2717
2786
  * @param remoteVideoConfig Your expected configuration, see RemoteVideoConfig{@link #RemoteVideoConfig}.
2718
- * @notes <br>
2719
- * + 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. <br>
2720
- * + 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. <br>
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>
2787
+ * @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.
2788
+ * + 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.
2789
+ * + 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
2790
  * @region Video Management
2723
2791
  */
2724
2792
  setRemoteVideoConfig(userId: string, remoteVideoConfig: RemoteVideoConfig): Promise<void>;
@@ -2807,18 +2875,20 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
2807
2875
  setUserVisibility(enable: boolean): Promise<void>;
2808
2876
 
2809
2877
  /**
2810
- * @brief Bind a custom videoTrack object.
2811
- * @param index specify a stream index
2812
- * @param track specify a video track. Refer to [MediaStreamTrack](https://developer.mozilla.org/zh-CN/docs/Web/API/MediaStreamTrack) for more details.
2878
+ * @brief Set a custom videoTrack as the video source.
2879
+ * Before calling this API, you must call [setVideoSourceType](#setvideosourcetype) to enable custom video capture.
2880
+ * @param index specify a stream index.
2881
+ * @param track specify a video track. See [MediaStreamTrack](https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamTrack).
2813
2882
  * @return
2814
2883
  * @region Video Management
2815
2884
  */
2816
2885
  setExternalVideoTrack(index: StreamIndex, track: MediaStreamTrack): Promise<void>;
2817
2886
 
2818
2887
  /**
2819
- * @brief Bind a custom audioTrack object.
2820
- * @param index specify a stream index
2821
- * @param track specify a audio track
2888
+ * @brief Set a custom audioTrack as the audio source.
2889
+ * Before calling this API, you must call [setAudioSourceType](#setaudiosourcetype) to enable custom video capture.
2890
+ * @param index specify a stream index.
2891
+ * @param track specify an audio track. See [MediaStreamTrack](https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamTrack).
2822
2892
  * @return
2823
2893
  * @region Audio Management
2824
2894
  */
@@ -3118,6 +3188,8 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
3118
3188
  * @notes We recommend to call this API before the audio capture starts.
3119
3189
  */
3120
3190
  setAudioProfile(profile: AudioProfileType): void;
3191
+ getLocalStreamTrack(streamIndex: StreamIndex, type: "video" | "audio"): MediaStreamTrack | undefined;
3192
+ getRemoteStreamTrack(userId: string, streamIndex: StreamIndex, type: "video" | "audio"): MediaStreamTrack | undefined;
3121
3193
  }
3122
3194
 
3123
3195
  /**
@@ -3214,18 +3286,21 @@ export interface RoomConfig {
3214
3286
 
3215
3287
  /**
3216
3288
  * @brief Enable/disable auto-subscribe audio. Enable by default.
3289
+ * This does not include the screen stream.
3217
3290
  * Call publish[104481#publish] to publish media streams if you disable `isAutoPublish`.
3218
3291
  */
3219
3292
  isAutoPublish?: boolean;
3220
3293
 
3221
3294
  /**
3222
3295
  * @brief Enable/disable auto-subscribe audio. Enable by default.
3296
+ * This does not include the screen stream.
3223
3297
  * Call subscribeUserStream, unsubscribe to revise the subscription.
3224
3298
  */
3225
3299
  isAutoSubscribeAudio?: boolean;
3226
3300
 
3227
3301
  /**
3228
3302
  * @brief Enable/disable auto-subscribe video. Enable by default.
3303
+ * This does not include the screen stream.
3229
3304
  * Call subscribeUserStream, unsubscribe to revise the subscription.
3230
3305
  */
3231
3306
  isAutoSubscribeVideo?: boolean;
@@ -3530,7 +3605,12 @@ export declare enum ConnectionState {
3530
3605
  /**
3531
3606
  * @brief Completion of the reconnecting
3532
3607
  */
3533
- CONNECTION_STATE_RECONNECTED = 5
3608
+ CONNECTION_STATE_RECONNECTED = 5,
3609
+
3610
+ /**
3611
+ * @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.
3612
+ */
3613
+ CONNECTION_STATE_LOST = 6
3534
3614
  }
3535
3615
 
3536
3616
  /**
@@ -3589,29 +3669,38 @@ export interface ScreenConfig {
3589
3669
  }
3590
3670
 
3591
3671
  /**
3592
- * @brief Video encoding configuration
3672
+ * @brief The video encoding configuration.
3593
3673
  */
3594
3674
  export interface VideoEncoderConfig {
3595
3675
 
3596
3676
  /**
3597
- * @brief width in px
3677
+ * @brief The width of the shared video (px).
3598
3678
  */
3599
3679
  width: number;
3600
3680
 
3601
3681
  /**
3602
- * @brief height in px
3682
+ * @brief The height of the shared video (px).
3603
3683
  */
3604
3684
  height: number;
3605
3685
 
3606
3686
  /**
3607
- * @brief frame rate
3687
+ * @brief The framerate of the shared video (fps).
3608
3688
  */
3609
3689
  frameRate: number;
3610
3690
 
3611
3691
  /**
3612
- * @brief The max bitrate, unit: kbps
3692
+ * @brief The maximum bitrate(>0/kbps). The default value is 3000kbps.
3613
3693
  */
3614
3694
  maxKbps: number;
3695
+ /**
3696
+ * - 'motion':表现为流畅度优先,用于视频内容为摄像头采集、电影、视频、游戏的情况。
3697
+ * - 'detail':表现为清晰度优先,用于视频内容包含图片、文本混排的情况。在进行屏幕分享时,建议使用这个提示。【默认值】
3698
+ * - 'text':表现为清晰度优先,用于视频内容只包含大量文本的情况
3699
+ * 只有Chrome生效
3700
+ */
3701
+ contentHint?: "text" | "motion" | "detail";
3702
+ }
3703
+ export interface ScreenEncoderConfig extends VideoEncoderConfig {
3615
3704
  }
3616
3705
 
3617
3706
  /**
@@ -3677,7 +3766,7 @@ export interface LiveTranscodeConfig {
3677
3766
  video?: Partial<LiveTranscodeVideoConfig>;
3678
3767
 
3679
3768
  /**
3680
- * @brief User layout information. Refer to [LiveTranscodeLayoutConfig](#LiveTranscodeLayoutConfig) for more details.
3769
+ * @brief User layout information.
3681
3770
  */
3682
3771
  layout?: Partial<LiveTranscodeLayoutConfig>;
3683
3772
  }
@@ -4284,6 +4373,38 @@ export declare enum AudioProfileType {
4284
4373
  hdMono = 5
4285
4374
  }
4286
4375
 
4376
+ /**
4377
+ * @brief Auto-play policy
4378
+ */
4379
+ export declare enum RTCAutoPlayPolicy {
4380
+
4381
+ /**
4382
+ * @brief By default, play audios and videos automatically.
4383
+ */
4384
+ AUTO_PLAY = 0,
4385
+
4386
+ /**
4387
+ * @brief Play videos only automatically.
4388
+ */
4389
+ VIDEO_ONLY = 1,
4390
+
4391
+ /**
4392
+ * @brief Disable Auto-play. Guide user to act with the App to play the media streams.
4393
+ */
4394
+ PLAY_MANUALLY = 2
4395
+ }
4396
+
4397
+ /**
4398
+ * @brief Configuration for the engine instance to be created
4399
+ */
4400
+ export interface EngineConfig {
4401
+
4402
+ /**
4403
+ * @brief Auto-play policy
4404
+ */
4405
+ autoPlayPolicy: RTCAutoPlayPolicy;
4406
+ }
4407
+
4287
4408
  /**
4288
4409
  * @brief Point-to-point text message
4289
4410
  */
@@ -4297,7 +4418,7 @@ export interface UserMessageEvent {
4297
4418
  /**
4298
4419
  * @brief Point-to-point text message
4299
4420
  */
4300
- message: Object | string;
4421
+ message: string;
4301
4422
  }
4302
4423
 
4303
4424
  /**
@@ -4359,9 +4480,10 @@ declare const Config: {
4359
4480
  LOG_SERVER_URL: string;
4360
4481
  CONFIG_REQUEST_DOMAINS: string[];
4361
4482
  DEVICE_ID: string;
4483
+ OVERSEA: boolean;
4362
4484
  };
4363
4485
  declare function setParameter(key: keyof typeof Config, value: any): void;
4364
- declare function getParameter(key: keyof typeof Config): string | string[];
4486
+ declare function getParameter(key: keyof typeof Config): string | boolean | string[];
4365
4487
  /**
4366
4488
  * @list 104477
4367
4489
  * @detail 104478
@@ -4378,12 +4500,13 @@ export interface IVERTC {
4378
4500
  * Calling this API repeatedly will create multiple IRTCEngine instances.
4379
4501
  * @param appId A unique identifier for each application. You can apply appIDs on the RTC console.
4380
4502
  * Instances generated by different AppIDs are independent in RTC service. Users served by one AppID cannot communicate with users served by another AppID.
4503
+ * @param config Configuration of the engine instance, such as Auto-play policy
4381
4504
  * @return Return an `IRTCEngine` instance if you call this API successfully.
4382
4505
  * @notes + Call [destroyEngine](#destroyengine) respectively to destroy each IRTCEngine instance.
4383
4506
  * + As each IRTCEngine instance is resource consuming, we recommend creating no more than 2 engine instances on each device at the same time.
4384
4507
  * @region Engine Management
4385
4508
  */
4386
- createEngine(appId: string): IRTCEngine;
4509
+ createEngine(appId: string, config?: EngineConfig): IRTCEngine;
4387
4510
 
4388
4511
  /**
4389
4512
  * @brief Call this API to destroy the IRTCEngine instance created by [createEngine](#createengine).
@@ -4474,7 +4597,7 @@ export interface IVERTC {
4474
4597
  }
4475
4598
  declare class VERTC implements IVERTC {
4476
4599
  getSdkVersion: () => string;
4477
- createEngine: (appId: string) => IRTCEngine;
4600
+ createEngine: (appId: string, config?: EngineConfig | undefined) => IRTCEngine;
4478
4601
  destroyEngine: (engine: IRTCEngine) => void;
4479
4602
  enumerateDevices: () => Promise<MediaDeviceInfo[]>;
4480
4603
  enableDevices: (options?: {