@agora-js/media 4.22.2 → 4.23.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/media.d.ts CHANGED
@@ -363,6 +363,10 @@ export declare interface AudioEncoderConfiguration {
363
363
  */
364
364
  export declare type AudioEncoderConfigurationPreset = keyof typeof AUDIO_ENCODER_CONFIG_SETTINGS;
365
365
 
366
+ export declare interface AudioMetadata {
367
+ value: Uint8Array;
368
+ }
369
+
366
370
  export declare interface AudioPlaybackOptions {
367
371
  /**
368
372
  * 控制人声是否要被播放,默认为 `true`
@@ -776,7 +780,7 @@ export declare class CameraVideoTrack extends LocalVideoTrack implements ICamera
776
780
  _enabled: boolean;
777
781
  _deviceName: string;
778
782
  get __className__(): string;
779
- constructor(track: MediaStreamTrack, config: CameraVideoTrackInitConfig, constraints: MediaTrackConstraints, scalabilityConfig?: SVCConfiguration, optimizationMode?: OptimizationMode | "balanced", trackId?: string);
783
+ constructor(track: MediaStreamTrack, config: CameraVideoTrackInitConfig, constraints: MediaTrackConstraints, scalabilityConfig?: SVCConfiguration, optimizationMode?: OptimizationMode, trackId?: string);
780
784
  setDevice(deviceId: string | RequiredOnlyOneOf<{
781
785
  facingMode: VideoFacingModeEnum;
782
786
  deviceId: string;
@@ -883,6 +887,9 @@ export declare interface CameraVideoTrackInitConfig {
883
887
  * - `"motion"`: Since v4.21.0, the browser prioritizes video smoothness.
884
888
  * - In poor network conditions, the browser reduces the sending bitrate to minimize video freezes.
885
889
  * - In most cases, the browser does not reduce the frame rate, but may reduce the sending resolution.
890
+ * - `"balanced"`: The default optimization mode.
891
+ * - For screen sharing video streams, the SDK default optimization strategy is quality-first.
892
+ * - For other video streams, the SDK default optimization strategy is balanced between quality and smoothness. Under poor network conditions, both the frame rate and resolution will be adjusted.
886
893
  */
887
894
  optimizationMode?: OptimizationMode;
888
895
  /**
@@ -1172,7 +1179,7 @@ export declare interface CustomVideoTrackInitConfig {
1172
1179
  * - In poor network conditions, the SDK reduces the sending bitrate to minimize video freezes.
1173
1180
  * - In most cases, the SDK does not reduce the frame rate, but may reduce the sending resolution.
1174
1181
  */
1175
- optimizationMode?: "motion" | "detail";
1182
+ optimizationMode?: OptimizationMode;
1176
1183
  /**
1177
1184
  * @ignore
1178
1185
  * @自从
@@ -1677,7 +1684,7 @@ declare class FakeTrackSource extends EventEmitter {
1677
1684
  createMediaStreamSourceNode(): undefined;
1678
1685
  }
1679
1686
 
1680
- export declare const frameData2CryptoBuffer: (imageData: ImageTypedData, appid: string, channelName: string) => Promise<Uint8Array>;
1687
+ export declare const frameData2CryptoBuffer: (imageData: ImageTypedData, appid: string, channelName: string) => Promise<Uint8Array<ArrayBufferLike>>;
1681
1688
 
1682
1689
  export declare function getAudioContext(): AudioContext;
1683
1690
 
@@ -2638,7 +2645,7 @@ export declare interface ILocalVideoTrack extends ILocalTrack {
2638
2645
  * - In poor network conditions, the browser reduces the sending bitrate to minimize video freezes.
2639
2646
  * - In most cases, the browser does not reduce the frame rate, but may reduce the sending resolution.
2640
2647
  */
2641
- setOptimizationMode(mode: "balanced" | "motion" | "detail"): Promise<void>;
2648
+ setOptimizationMode(mode: OptimizationMode): Promise<void>;
2642
2649
  /**
2643
2650
  * * @自从
2644
2651
  * <br>&emsp;&emsp;&emsp;*4.8.0*
@@ -2876,11 +2883,21 @@ export declare interface IMicrophoneAudioTrack extends ILocalAudioTrack {
2876
2883
  setEnabled(enabled: boolean): Promise<void>;
2877
2884
  }
2878
2885
 
2879
- export declare function interceptLocalAudioFrame(sender: RTCRtpSender): Promise<void>;
2886
+ declare interface InterceptAudioFrameOptions {
2887
+ enableTopn?: boolean;
2888
+ enableMetadata?: boolean;
2889
+ onMetadata?: (metadata: Uint8Array) => void;
2890
+ }
2891
+
2892
+ declare interface InterceptAudioFrameOptions_2 {
2893
+ metadata?: () => Uint8Array | undefined;
2894
+ }
2895
+
2896
+ export declare function interceptLocalAudioFrame(sender: RTCRtpSender, options?: InterceptAudioFrameOptions_2): Promise<void>;
2880
2897
 
2881
2898
  export declare function interceptLocalVideoFrame(sender: RTCRtpSender, localVideoTrack: LocalVideoTrack): Promise<void>;
2882
2899
 
2883
- export declare function interceptRemoteAudioFrame(receiver: RTCRtpReceiver): Promise<void>;
2900
+ export declare function interceptRemoteAudioFrame(receiver: RTCRtpReceiver, options?: InterceptAudioFrameOptions): Promise<void>;
2884
2901
 
2885
2902
  export declare function interceptRemoteVideoFrame(receiver: RTCRtpReceiver, options?: InterceptVideoFrameOptions): Promise<void>;
2886
2903
 
@@ -3459,6 +3476,7 @@ export declare class LocalAudioTrack extends LocalTrack implements ILocalAudioTr
3459
3476
  readonly trackMediaType: "audio" | "video";
3460
3477
  _encoderConfig?: AudioEncoderConfiguration;
3461
3478
  _trackSource: AudioTrackSource | FakeTrackSource;
3479
+ metadata: AudioMetadata[];
3462
3480
  /**
3463
3481
  * @description This method is used to init WebAudio, if you're sure you don't want to use WebAudio, call _trackSource
3464
3482
  */
@@ -3655,7 +3673,7 @@ export declare class LocalVideoTrack extends LocalTrack implements ILocalVideoTr
3655
3673
  private _clearPreviousVideoVisibleStatus;
3656
3674
  _encoderConfig?: Partial<VideoEncoderConfiguration>;
3657
3675
  _scalabilityMode?: SVCConfiguration;
3658
- _optimizationMode?: OptimizationMode | "balanced";
3676
+ _optimizationMode?: OptimizationMode;
3659
3677
  private _videoHeight?;
3660
3678
  private _videoWidth?;
3661
3679
  get videoHeight(): number | undefined;
@@ -3672,7 +3690,7 @@ export declare class LocalVideoTrack extends LocalTrack implements ILocalVideoTr
3672
3690
  protected get processorContext(): VideoProcessorContext;
3673
3691
  protected set processorContext(ctx: VideoProcessorContext);
3674
3692
  get __className__(): string;
3675
- constructor(track: MediaStreamTrack, encoderConfig?: Partial<VideoEncoderConfiguration>, scalabilityConfig?: SVCConfiguration, optimizationMode?: OptimizationMode | "balanced", trackId?: string, hints?: TrackHint[]);
3693
+ constructor(track: MediaStreamTrack, encoderConfig?: Partial<VideoEncoderConfiguration>, scalabilityConfig?: SVCConfiguration, optimizationMode?: OptimizationMode, trackId?: string, hints?: TrackHint[]);
3676
3694
  play(element: HTMLElement | HTMLVideoElement | string, config?: VideoPlayerConfig): void;
3677
3695
  stop(): void;
3678
3696
  setEnabled(enabled: boolean, skipChangeState?: boolean): Promise<void>;
@@ -3686,7 +3704,7 @@ export declare class LocalVideoTrack extends LocalTrack implements ILocalVideoTr
3686
3704
  max_bitrate: number;
3687
3705
  min_bitrate: number;
3688
3706
  }): Promise<void>;
3689
- setOptimizationMode(mode: OptimizationMode | "balanced"): Promise<void>;
3707
+ setOptimizationMode(mode: OptimizationMode): Promise<void>;
3690
3708
  setScalabiltyMode(mode: SVCConfiguration): void;
3691
3709
  updateMediaStreamTrackResolution(): void;
3692
3710
  protected _updatePlayerSource(): void;
@@ -4050,6 +4068,9 @@ export declare class MixingAudioTrack extends LocalAudioTrack {
4050
4068
  * - `"motion"`: 自 4.21.0 开始,浏览器默认开启流畅优先模式。
4051
4069
  * - 浏览器不会启用最小码率策略。遭遇网络波动时,发送端会降低码率来确保接收端的视频画面不会出现中断和卡顿。
4052
4070
  * - 大部分情况下,浏览器不会降低帧率,但是可能会降低发送分辨率。
4071
+ * - `"balanced"`: 默认的传输优化模式。
4072
+ * - 对于屏幕共享视频流,SDK 默认的优化策略为清晰优先。
4073
+ * - 对于其他视频流,SDK 默认的优化策略为坚固清晰合流畅,弱网条件下,帧率和分辨率都会被调整。
4053
4074
  * @public
4054
4075
  */
4055
4076
  /** @en
@@ -4060,8 +4081,11 @@ export declare class MixingAudioTrack extends LocalAudioTrack {
4060
4081
  * - `"motion"`: Since v4.21.0, the browser prioritizes video smoothness.
4061
4082
  * - In poor network conditions, the browser reduces the sending bitrate to minimize video freezes.
4062
4083
  * - In most cases, the browser does not reduce the frame rate, but may reduce the sending resolution.
4084
+ * - `"balanced"`: The default optimization mode.
4085
+ * - For screen sharing video streams, the SDK default optimization strategy is quality-first.
4086
+ * - For other video streams, the SDK default optimization strategy is balanced between quality and smoothness. Under poor network conditions, both the frame rate and resolution will be adjusted.
4063
4087
  */
4064
- export declare type OptimizationMode = "motion" | "detail";
4088
+ export declare type OptimizationMode = "motion" | "detail" | "balanced";
4065
4089
 
4066
4090
  /**
4067
4091
  * @internal
@@ -4242,14 +4266,14 @@ export declare interface RemoteAudioTrackStats {
4242
4266
  * 接收的音频总丢包率。
4243
4267
  */
4244
4268
  /** @en
4245
- * The packet loss rate of the received audio.
4269
+ * The total packet loss rate of the received audio.
4246
4270
  */
4247
4271
  packetLossRate: number;
4248
4272
  /**
4249
- * 接收的音频400ms内的丢包率。
4273
+ * 接收的音频在 400ms 内的丢包率。
4250
4274
  */
4251
4275
  /** @en
4252
- * The packet loss rate of the received audio.
4276
+ * The packet loss rate of the received audio in 400ms.
4253
4277
  */
4254
4278
  currentPacketLossRate: number;
4255
4279
  /**
@@ -4521,17 +4545,17 @@ export declare interface RemoteVideoTrackStats {
4521
4545
  */
4522
4546
  receivePacketsLost: number;
4523
4547
  /**
4524
- * 接收的视频丢包率。
4548
+ * 接收的视频总丢包率。
4525
4549
  */
4526
4550
  /** @en
4527
- * The packet loss rate of the received video.
4551
+ * The total packet loss rate of the received video.
4528
4552
  */
4529
4553
  packetLossRate: number;
4530
4554
  /**
4531
- * 接收的视频在400ms内的丢包率。
4555
+ * 接收的视频在 400ms 内的丢包率。
4532
4556
  */
4533
4557
  /** @en
4534
- * The packet loss rate of the received video.
4558
+ * The packet loss rate of the received video in 400ms.
4535
4559
  */
4536
4560
  currentPacketLossRate: number;
4537
4561
  /**
@@ -4563,10 +4587,10 @@ export declare interface RemoteVideoTrackStats {
4563
4587
  */
4564
4588
  totalFreezeTime: number;
4565
4589
  /**
4566
- * 接收的视频卡顿率。
4590
+ * 最近一秒接收视频的卡顿率。取值范围为 [0.0,1.0],代表最近一秒内视频卡顿百分比。
4567
4591
  */
4568
4592
  /** @en
4569
- * The freeze rate of the received video.
4593
+ * The freeze rate of the remote video in the last second. The value range is [0.0,1.0], representing the percentage of video freezes in the last second.
4570
4594
  */
4571
4595
  freezeRate: number;
4572
4596
  /**
@@ -4633,6 +4657,8 @@ export declare interface ScreenConstraintsWithElectron extends MediaTrackConstra
4633
4657
  surfaceSwitching?: "include" | "exclude";
4634
4658
  /** 是否开启系统音频,默认开启include, Chrome 105以上, Opera 91以上 */
4635
4659
  systemAudio?: "include" | "exclude";
4660
+ /** 是否默认分享当前页面,默认为false, Chrome 94以上, Opera 80以上 */
4661
+ preferCurrentTab?: boolean;
4636
4662
  }
4637
4663
 
4638
4664
  /**
@@ -4772,6 +4798,9 @@ export declare interface ScreenVideoTrackInitConfig {
4772
4798
  * - `"motion"`: 自 4.21.0 开始,浏览器默认开启流畅优先模式。
4773
4799
  * - 浏览器不会启用最小码率策略。遭遇网络波动时,发送端会降低码率来确保接收端的视频画面不会出现中断和卡顿。
4774
4800
  * - 大部分情况下,浏览器不会降低帧率,但是可能会降低发送分辨率。
4801
+ * - `"balanced"`: 默认的传输优化模式。
4802
+ * - 对于屏幕共享视频流,SDK 默认的优化策略为清晰优先。
4803
+ * - 对于其他视频流,SDK 默认的优化策略为坚固清晰合流畅,弱网条件下,帧率和分辨率都会被调整。
4775
4804
  */
4776
4805
  /** @en
4777
4806
  * @since
@@ -4791,7 +4820,7 @@ export declare interface ScreenVideoTrackInitConfig {
4791
4820
  * - In poor network conditions, the browser reduces the sending bitrate to minimize video freezes.
4792
4821
  * - In most cases, the browser does not reduce the frame rate, but may reduce the sending resolution.
4793
4822
  */
4794
- optimizationMode?: "motion" | "detail";
4823
+ optimizationMode?: OptimizationMode;
4795
4824
  /**
4796
4825
  * @ignore
4797
4826
  *
@@ -4918,6 +4947,28 @@ export declare interface ScreenVideoTrackInitConfig {
4918
4947
  * > Note: This property is supported on Chrome 105 and later (Windows only), as well as Edge 105 and later (Windows only).
4919
4948
  */
4920
4949
  systemAudio?: "include" | "exclude";
4950
+ /**
4951
+ * @自从
4952
+ * <br>&emsp;&emsp;&emsp;*4.23.0*
4953
+ *
4954
+ * 是否默认共享当前页面。
4955
+ * - `true`: 是。
4956
+ * - `false`: (默认)否。
4957
+ *
4958
+ * > 注意事项: 该属性仅支持 Chrome 94 及以上版本、Opera 80 及以上版本。
4959
+ */
4960
+ /** @en
4961
+ *
4962
+ * @since
4963
+ * <br>&emsp;&emsp;&emsp;*4.23.0*
4964
+ *
4965
+ * Whether to share the current tab by default.
4966
+ * - `true`: Yes.
4967
+ * - `false`: (Default) No.
4968
+ *
4969
+ * > Note: This property is only supported in Chrome 94 and above, and Opera 80 and above..
4970
+ */
4971
+ preferCurrentTab?: boolean;
4921
4972
  }
4922
4973
 
4923
4974
  export declare type SenderConfig = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agora-js/media",
3
- "version": "4.22.2",
3
+ "version": "4.23.1",
4
4
  "description": "media module across @agora-js packages",
5
5
  "main": "AgoraRTC_N-media.js",
6
6
  "module": "AgoraRTC_N-media.esm.mjs",
@@ -23,8 +23,8 @@
23
23
  "homepage": "https://api-ref.agora.io/en/voice-sdk/web/4.x/index.html",
24
24
  "peerDependencies": {},
25
25
  "dependencies": {
26
- "@agora-js/shared": "4.22.2",
27
- "@agora-js/report": "4.22.2",
26
+ "@agora-js/shared": "4.23.1",
27
+ "@agora-js/report": "4.23.1",
28
28
  "axios": "^1.7.7",
29
29
  "agora-rte-extension": "^1.2.4",
30
30
  "webrtc-adapter": "8.2.0"
@@ -229,6 +229,10 @@ export declare interface AudioEncoderConfiguration {
229
229
  */
230
230
  export declare type AudioEncoderConfigurationPreset = keyof typeof AUDIO_ENCODER_CONFIG_SETTINGS;
231
231
 
232
+ export declare interface AudioMetadata {
233
+ value: Uint8Array;
234
+ }
235
+
232
236
  export declare interface AudioPlaybackOptions {
233
237
  origin?: boolean;
234
238
  mixing?: boolean;
@@ -513,7 +517,7 @@ export declare class CameraVideoTrack extends LocalVideoTrack implements ICamera
513
517
  _enabled: boolean;
514
518
  _deviceName: string;
515
519
  get __className__(): string;
516
- constructor(track: MediaStreamTrack, config: CameraVideoTrackInitConfig, constraints: MediaTrackConstraints, scalabilityConfig?: SVCConfiguration, optimizationMode?: OptimizationMode | "balanced", trackId?: string);
520
+ constructor(track: MediaStreamTrack, config: CameraVideoTrackInitConfig, constraints: MediaTrackConstraints, scalabilityConfig?: SVCConfiguration, optimizationMode?: OptimizationMode, trackId?: string);
517
521
  setDevice(deviceId: string | RequiredOnlyOneOf<{
518
522
  facingMode: VideoFacingModeEnum;
519
523
  deviceId: string;
@@ -575,6 +579,9 @@ export declare interface CameraVideoTrackInitConfig {
575
579
  * - `"motion"`: Since v4.21.0, the browser prioritizes video smoothness.
576
580
  * - In poor network conditions, the browser reduces the sending bitrate to minimize video freezes.
577
581
  * - In most cases, the browser does not reduce the frame rate, but may reduce the sending resolution.
582
+ * - `"balanced"`: The default optimization mode.
583
+ * - For screen sharing video streams, the SDK default optimization strategy is quality-first.
584
+ * - For other video streams, the SDK default optimization strategy is balanced between quality and smoothness. Under poor network conditions, both the frame rate and resolution will be adjusted.
578
585
  */
579
586
  optimizationMode?: OptimizationMode;
580
587
  /**
@@ -747,7 +754,7 @@ export declare interface CustomVideoTrackInitConfig {
747
754
  * - In poor network conditions, the SDK reduces the sending bitrate to minimize video freezes.
748
755
  * - In most cases, the SDK does not reduce the frame rate, but may reduce the sending resolution.
749
756
  */
750
- optimizationMode?: "motion" | "detail";
757
+ optimizationMode?: OptimizationMode;
751
758
  /**
752
759
  * @ignore
753
760
  *
@@ -1088,7 +1095,7 @@ declare class FakeTrackSource extends EventEmitter {
1088
1095
  createMediaStreamSourceNode(): undefined;
1089
1096
  }
1090
1097
 
1091
- export declare const frameData2CryptoBuffer: (imageData: ImageTypedData, appid: string, channelName: string) => Promise<Uint8Array>;
1098
+ export declare const frameData2CryptoBuffer: (imageData: ImageTypedData, appid: string, channelName: string) => Promise<Uint8Array<ArrayBufferLike>>;
1092
1099
 
1093
1100
  export declare function getAudioContext(): AudioContext;
1094
1101
 
@@ -1635,7 +1642,7 @@ export declare interface ILocalVideoTrack extends ILocalTrack {
1635
1642
  * - In poor network conditions, the browser reduces the sending bitrate to minimize video freezes.
1636
1643
  * - In most cases, the browser does not reduce the frame rate, but may reduce the sending resolution.
1637
1644
  */
1638
- setOptimizationMode(mode: "balanced" | "motion" | "detail"): Promise<void>;
1645
+ setOptimizationMode(mode: OptimizationMode): Promise<void>;
1639
1646
  /**
1640
1647
  * @since
1641
1648
  * <br>&emsp;&emsp;&emsp;*4.8.0*
@@ -1763,11 +1770,21 @@ export declare interface IMicrophoneAudioTrack extends ILocalAudioTrack {
1763
1770
  setEnabled(enabled: boolean): Promise<void>;
1764
1771
  }
1765
1772
 
1766
- export declare function interceptLocalAudioFrame(sender: RTCRtpSender): Promise<void>;
1773
+ declare interface InterceptAudioFrameOptions {
1774
+ enableTopn?: boolean;
1775
+ enableMetadata?: boolean;
1776
+ onMetadata?: (metadata: Uint8Array) => void;
1777
+ }
1778
+
1779
+ declare interface InterceptAudioFrameOptions_2 {
1780
+ metadata?: () => Uint8Array | undefined;
1781
+ }
1782
+
1783
+ export declare function interceptLocalAudioFrame(sender: RTCRtpSender, options?: InterceptAudioFrameOptions_2): Promise<void>;
1767
1784
 
1768
1785
  export declare function interceptLocalVideoFrame(sender: RTCRtpSender, localVideoTrack: LocalVideoTrack): Promise<void>;
1769
1786
 
1770
- export declare function interceptRemoteAudioFrame(receiver: RTCRtpReceiver): Promise<void>;
1787
+ export declare function interceptRemoteAudioFrame(receiver: RTCRtpReceiver, options?: InterceptAudioFrameOptions): Promise<void>;
1771
1788
 
1772
1789
  export declare function interceptRemoteVideoFrame(receiver: RTCRtpReceiver, options?: InterceptVideoFrameOptions): Promise<void>;
1773
1790
 
@@ -2096,6 +2113,7 @@ export declare class LocalAudioTrack extends LocalTrack implements ILocalAudioTr
2096
2113
  readonly trackMediaType: "audio" | "video";
2097
2114
  _encoderConfig?: AudioEncoderConfiguration;
2098
2115
  _trackSource: AudioTrackSource | FakeTrackSource;
2116
+ metadata: AudioMetadata[];
2099
2117
  get _source(): AudioTrackSource;
2100
2118
  set _source(source: AudioTrackSource | FakeTrackSource);
2101
2119
  _enabled: boolean;
@@ -2242,7 +2260,7 @@ export declare class LocalVideoTrack extends LocalTrack implements ILocalVideoTr
2242
2260
  private _clearPreviousVideoVisibleStatus;
2243
2261
  _encoderConfig?: Partial<VideoEncoderConfiguration>;
2244
2262
  _scalabilityMode?: SVCConfiguration;
2245
- _optimizationMode?: OptimizationMode | "balanced";
2263
+ _optimizationMode?: OptimizationMode;
2246
2264
  private _videoHeight?;
2247
2265
  private _videoWidth?;
2248
2266
  get videoHeight(): number | undefined;
@@ -2259,7 +2277,7 @@ export declare class LocalVideoTrack extends LocalTrack implements ILocalVideoTr
2259
2277
  protected get processorContext(): VideoProcessorContext;
2260
2278
  protected set processorContext(ctx: VideoProcessorContext);
2261
2279
  get __className__(): string;
2262
- constructor(track: MediaStreamTrack, encoderConfig?: Partial<VideoEncoderConfiguration>, scalabilityConfig?: SVCConfiguration, optimizationMode?: OptimizationMode | "balanced", trackId?: string, hints?: TrackHint[]);
2280
+ constructor(track: MediaStreamTrack, encoderConfig?: Partial<VideoEncoderConfiguration>, scalabilityConfig?: SVCConfiguration, optimizationMode?: OptimizationMode, trackId?: string, hints?: TrackHint[]);
2263
2281
  play(element: HTMLElement | HTMLVideoElement | string, config?: VideoPlayerConfig): void;
2264
2282
  stop(): void;
2265
2283
  setEnabled(enabled: boolean, skipChangeState?: boolean): Promise<void>;
@@ -2273,7 +2291,7 @@ export declare class LocalVideoTrack extends LocalTrack implements ILocalVideoTr
2273
2291
  max_bitrate: number;
2274
2292
  min_bitrate: number;
2275
2293
  }): Promise<void>;
2276
- setOptimizationMode(mode: OptimizationMode | "balanced"): Promise<void>;
2294
+ setOptimizationMode(mode: OptimizationMode): Promise<void>;
2277
2295
  setScalabiltyMode(mode: SVCConfiguration): void;
2278
2296
  updateMediaStreamTrackResolution(): void;
2279
2297
  protected _updatePlayerSource(): void;
@@ -2514,8 +2532,11 @@ export declare class MixingAudioTrack extends LocalAudioTrack {
2514
2532
  * - `"motion"`: Since v4.21.0, the browser prioritizes video smoothness.
2515
2533
  * - In poor network conditions, the browser reduces the sending bitrate to minimize video freezes.
2516
2534
  * - In most cases, the browser does not reduce the frame rate, but may reduce the sending resolution.
2535
+ * - `"balanced"`: The default optimization mode.
2536
+ * - For screen sharing video streams, the SDK default optimization strategy is quality-first.
2537
+ * - For other video streams, the SDK default optimization strategy is balanced between quality and smoothness. Under poor network conditions, both the frame rate and resolution will be adjusted.
2517
2538
  */
2518
- export declare type OptimizationMode = "motion" | "detail";
2539
+ export declare type OptimizationMode = "motion" | "detail" | "balanced";
2519
2540
 
2520
2541
  export declare interface PlayerConfig extends VideoPlayerConfig {
2521
2542
  trackId: string;
@@ -2633,11 +2654,11 @@ export declare interface RemoteAudioTrackStats {
2633
2654
  */
2634
2655
  receivePacketsDiscarded: number;
2635
2656
  /**
2636
- * The packet loss rate of the received audio.
2657
+ * The total packet loss rate of the received audio.
2637
2658
  */
2638
2659
  packetLossRate: number;
2639
2660
  /**
2640
- * The packet loss rate of the received audio.
2661
+ * The packet loss rate of the received audio in 400ms.
2641
2662
  */
2642
2663
  currentPacketLossRate: number;
2643
2664
  /**
@@ -2823,11 +2844,11 @@ export declare interface RemoteVideoTrackStats {
2823
2844
  */
2824
2845
  receivePacketsLost: number;
2825
2846
  /**
2826
- * The packet loss rate of the received video.
2847
+ * The total packet loss rate of the received video.
2827
2848
  */
2828
2849
  packetLossRate: number;
2829
2850
  /**
2830
- * The packet loss rate of the received video.
2851
+ * The packet loss rate of the received video in 400ms.
2831
2852
  */
2832
2853
  currentPacketLossRate: number;
2833
2854
  /**
@@ -2847,7 +2868,7 @@ export declare interface RemoteVideoTrackStats {
2847
2868
  */
2848
2869
  totalFreezeTime: number;
2849
2870
  /**
2850
- * The freeze rate of the received video.
2871
+ * The freeze rate of the remote video in the last second. The value range is [0.0,1.0], representing the percentage of video freezes in the last second.
2851
2872
  */
2852
2873
  freezeRate: number;
2853
2874
  publishDuration: number;
@@ -2880,6 +2901,7 @@ export declare interface ScreenConstraintsWithElectron extends MediaTrackConstra
2880
2901
  selfBrowserSurface?: "include" | "exclude";
2881
2902
  surfaceSwitching?: "include" | "exclude";
2882
2903
  systemAudio?: "include" | "exclude";
2904
+ preferCurrentTab?: boolean;
2883
2905
  }
2884
2906
 
2885
2907
  /**
@@ -2963,7 +2985,7 @@ export declare interface ScreenVideoTrackInitConfig {
2963
2985
  * - In poor network conditions, the browser reduces the sending bitrate to minimize video freezes.
2964
2986
  * - In most cases, the browser does not reduce the frame rate, but may reduce the sending resolution.
2965
2987
  */
2966
- optimizationMode?: "motion" | "detail";
2988
+ optimizationMode?: OptimizationMode;
2967
2989
  /**
2968
2990
  * @ignore
2969
2991
  *
@@ -3031,6 +3053,18 @@ export declare interface ScreenVideoTrackInitConfig {
3031
3053
  * > Note: This property is supported on Chrome 105 and later (Windows only), as well as Edge 105 and later (Windows only).
3032
3054
  */
3033
3055
  systemAudio?: "include" | "exclude";
3056
+ /**
3057
+ *
3058
+ * @since
3059
+ * <br>&emsp;&emsp;&emsp;*4.23.0*
3060
+ *
3061
+ * Whether to share the current tab by default.
3062
+ * - `true`: Yes.
3063
+ * - `false`: (Default) No.
3064
+ *
3065
+ * > Note: This property is only supported in Chrome 94 and above, and Opera 80 and above..
3066
+ */
3067
+ preferCurrentTab?: boolean;
3034
3068
  }
3035
3069
 
3036
3070
  export declare type SenderConfig = {