@byteplus/rtc 4.44.6 → 4.45.0-blw.13

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