@agora-js/media 4.20.2 → 4.22.0

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
@@ -56,6 +56,10 @@ export declare interface AgoraRTCCompatibility {
56
56
  supportWebRTCEncodedTransform: boolean;
57
57
  /** 是否支持WebRTC Insertable Stream */
58
58
  supportWebRTCInsertableStream: boolean;
59
+ /** 是否支持requestVideoFrameCallback, 用于计算卡顿率 */
60
+ supportRequestVideoFrameCallback: boolean;
61
+ /** 是否支持WebCrypto */
62
+ supportWebCrypto: boolean;
59
63
  }
60
64
 
61
65
  /**
@@ -331,7 +335,7 @@ export declare interface AudioEncoderConfiguration {
331
335
  * | -------- | --------------- |
332
336
  * |`"speech_low_quality"`|16 kHz 采样率,单声道,编码码率约 24 Kbps|
333
337
  * |`"speech_standard"`|32 kHz 采样率,单声道,编码码率约 24 Kbps|
334
- * |`"music_standard"`|48 kHz 采样率,单声道,编码码率约 40 Kbps|
338
+ * |`"music_standard"`|48 kHz 采样率,单声道,编码码率约 32 Kbps|
335
339
  * |`"standard_stereo"`|48 kHz 采样率,双声道,编码码率约 64 Kbps|
336
340
  * |`"high_quality"`|48 kHz 采样率,单声道, 编码码率约 128 Kbps|
337
341
  * |`"high_quality_stereo"`|48 kHz 采样率,双声道,编码码率约 192 Kbps|
@@ -349,12 +353,12 @@ export declare interface AudioEncoderConfiguration {
349
353
  *
350
354
  * | Audio Profile | Configurations |
351
355
  * | -------- | --------------- |
352
- * |`"speech_low_quality"`|Sample rate 16 kHz, mono, encoding rate 24 Kbps|
353
- * |`"speech_standard"`|Sample rate 32 kHz, mono, encoding rate 24 Kbps|
354
- * |`"music_standard"`|Sample rate 48 kHz, mono, encoding rate 40 Kbps|
355
- * |`"standard_stereo"`|Sample rate 48 kHz, stereo, encoding rate 64 Kbps|
356
- * |`"high_quality"`|Sample rate 48 kHz, mono, encoding rate 128 Kbps|
357
- * |`"high_quality_stereo"`|Sample rate 48 kHz, stereo, encoding rate 192 Kbps| Kbps.
356
+ * |`"speech_low_quality"`|Sample rate 16 kHz, mono, encoding bitrate 24 Kbps|
357
+ * |`"speech_standard"`|Sample rate 32 kHz, mono, encoding bitrate 24 Kbps|
358
+ * |`"music_standard"`|Sample rate 48 kHz, mono, encoding bitrate 32 Kbps|
359
+ * |`"standard_stereo"`|Sample rate 48 kHz, stereo, encoding bitrate 64 Kbps|
360
+ * |`"high_quality"`|Sample rate 48 kHz, mono, encoding bitrate 128 Kbps|
361
+ * |`"high_quality_stereo"`|Sample rate 48 kHz, stereo, encoding bitrate 192 Kbps| Kbps.
358
362
  * @public
359
363
  */
360
364
  export declare type AudioEncoderConfigurationPreset = keyof typeof AUDIO_ENCODER_CONFIG_SETTINGS;
@@ -730,7 +734,7 @@ export declare class CameraVideoTrack extends LocalVideoTrack implements ICamera
730
734
  _enabled: boolean;
731
735
  _deviceName: string;
732
736
  get __className__(): string;
733
- constructor(track: MediaStreamTrack, config: CameraVideoTrackInitConfig, constraints: MediaTrackConstraints, scalabilityConfig?: SVCConfiguration, optimizationMode?: "motion" | "detail" | "balanced", trackId?: string);
737
+ constructor(track: MediaStreamTrack, config: CameraVideoTrackInitConfig, constraints: MediaTrackConstraints, scalabilityConfig?: SVCConfiguration, optimizationMode?: OptimizationMode | "balanced", trackId?: string);
734
738
  setDevice(deviceId: string | RequiredOnlyOneOf<{
735
739
  facingMode: VideoFacingModeEnum;
736
740
  deviceId: string;
@@ -804,35 +808,41 @@ export declare interface CameraVideoTrackInitConfig {
804
808
  cameraId?: string;
805
809
  /**
806
810
  * @自从
807
- * <br>&emsp;&emsp;&emsp;*4.0.0*
811
+ * <br>&emsp;&emsp;&emsp;*4.2.0*
812
+ *
813
+ * 设置视频传输优化模式。
814
+ *
815
+ * 你可以在视频通话、视频直播或屏幕共享过程中调用此方法动态调整视频的传输优化模式。例如你想要把屏幕共享内容从演示文稿切换为视频时,你可以将传输优化模式从 `"detail"` 切换为 `"motion"`,确保视频画面在网络波动时不会出现卡顿。
816
+ *
817
+ * > 注意事项:该方法只支持 Chrome 浏览器。
808
818
  *
809
- * 传输优化模式。设置该值后,SDK 会自动调整码率配置以及使用不同的回退策略。
819
+ * @param mode 视频传输优化模式:
810
820
  * - `"detail"`: 清晰优先。
811
821
  * - SDK 会自动根据你的采集分辨率和帧率设定一个最小码率。即使遭遇网络波动,发送码率也不会低于这个值,从而确保清晰的视频画面。
812
822
  * - 大部分情况下,SDK 不会降低发送分辨率,但是可能会降低帧率。
813
- * - `"motion"`: 流畅优先。
823
+ * - `"motion"`: 自 4.21.0 开始,SDK 默认开启流畅优先模式。
814
824
  * - SDK 不会启用最小码率策略。遭遇网络波动时,发送端会降低码率来确保接收端的视频画面不会出现中断和卡顿。
815
825
  * - 大部分情况下,SDK 不会降低帧率,但是可能会降低发送分辨率。
816
- * - 留空: 默认优化策略,兼顾清晰和流畅,也就是说弱网条件下,帧率和分辨率都会被调整。
817
- *
818
- * > 注意事项:该方法只支持 Chrome 浏览器。
819
826
  */
820
827
  /** @en
821
828
  * @since
822
- * <br>&emsp;&emsp;&emsp;*4.0.0*
829
+ * <br>&emsp;&emsp;&emsp;*4.2.0*
830
+ *
831
+ * Sets the video transmission optimization mode.
832
+ *
833
+ * You can call this method during a video call, a live streaming or screen sharing to dynamically change the optimization mode. For example, during the screen sharing, before you change the shared content from text to video, you can change the optimization mode from `"detail"` to `"motion"` to ensure smoothness in poor network conditions.
834
+ *
835
+ * > Note: This method supports Chrome only.
823
836
  *
824
- * Transmission optimization mode. Whether to prioritize video quality or smoothness:
837
+ * @param mode The video transmission optimization mode:
825
838
  * - `"detail"`: Prioritizes video quality.
826
839
  * - The SDK ensures high-quality images by automatically calculating a minimum bitrate based on the capturing resolution and frame rate. No matter how poor the network condition is, the sending bitrate will never be lower than the minimum value.
827
840
  * - In most cases, the SDK does not reduce the sending resolution, but may reduce the frame rate.
828
- * - `"motion"`: Prioritizes video smoothness.
841
+ * - `"motion"`: Since 4.21.0, the SDK prioritizes video smoothness.
829
842
  * - In poor network conditions, the SDK reduces the sending bitrate to minimize video freezes.
830
843
  * - In most cases, the SDK does not reduce the frame rate, but may reduce the sending resolution.
831
- * - Empty: Uses the default transmission optimization mode. The SDK may reduce the frame rate or the sending resolution in poor network conditions.
832
- *
833
- * > Note: This method is only supported on Chrome.
834
844
  */
835
- optimizationMode?: "motion" | "detail";
845
+ optimizationMode?: OptimizationMode;
836
846
  /**
837
847
  * @ignore
838
848
  * @自从
@@ -867,7 +877,7 @@ export declare function checkTrackState(): (target: any, propertyKey: any, descr
867
877
  * 可通过以下方法或事件获取:
868
878
  * - [localVideoTrack.on("video-element-visible-status")]{@link ILocalVideoTrack.event_video_element_visible_status}
869
879
  * - [localVideoTrack.getVideoElementVisibleStatus]{@link ILocalVideoTrack.getVideoElementVisibleStatus}
870
- * - [remoteVideoTrack.on("video-element-visible-status")]{@link IRemoteVideoTrack.event_video_element_visible_status}
880
+ * - [remoteVideoTrack.on("video-element-visible-status")]{@link IRemoteVideoTrack.event_video_element_visible_status_2}
871
881
  * - [remoteVideoTrack.getVideoElementVisibleStatus]{@link IRemoteVideoTrack.getVideoElementVisibleStatus}
872
882
  *
873
883
  * 包含以下字段:
@@ -884,7 +894,7 @@ export declare function checkTrackState(): (target: any, propertyKey: any, descr
884
894
  * Get the visibility of the `<video>` tag through the following methods and events:
885
895
  * - [localVideoTrack.on("video-element-visible-status")]{@link ILocalVideoTrack.event_video_element_visible_status}
886
896
  * - [localVideoTrack.getVideoElementVisibleStatus]{@link ILocalVideoTrack.getVideoElementVisibleStatus}
887
- * - [remoteVideoTrack.on("video-element-visible-status")]{@link IRemoteVideoTrack.event_video_element_visible_status}
897
+ * - [remoteVideoTrack.on("video-element-visible-status")]{@link IRemoteVideoTrack.event_video_element_visible_status_2}
888
898
  * - [remoteVideoTrack.getVideoElementVisibleStatus]{@link IRemoteVideoTrack.getVideoElementVisibleStatus}
889
899
  *
890
900
  * This object contains the following parameters:
@@ -1080,33 +1090,45 @@ export declare interface CustomVideoTrackInitConfig {
1080
1090
  bitrateMax?: number;
1081
1091
  /**
1082
1092
  * @自从
1083
- * <br>&emsp;&emsp;&emsp;*4.0.0*
1093
+ * <br>&emsp;&emsp;&emsp;*4.2.0*
1094
+ *
1095
+ * 设置视频传输优化模式。
1096
+ *
1097
+ * 你可以在视频通话、视频直播或屏幕共享过程中调用此方法动态调整视频的传输优化模式。例如你想要把屏幕共享内容从演示文稿切换为视频时,你可以将传输优化模式从 `"detail"` 切换为 `"motion"`,确保视频画面在网络波动时不会出现卡顿。
1084
1098
  *
1085
- * 传输优化模式。设置该值后,SDK 会自动调整码率配置以及使用不同的回退策略。
1099
+ * > 注意事项:该方法只支持 Chrome 浏览器。
1100
+ *
1101
+ * @param mode 视频传输优化模式:
1102
+ * - `"balanced"`: 使用默认的传输优化模式:
1103
+ * - 对于屏幕共享视频流,SDK 默认的优化策略为清晰优先。
1104
+ * - 对于其他视频流,SDK 默认的优化策略为兼顾清晰和流畅,弱网条件下,帧率和分辨率都会被调整。
1086
1105
  * - `"detail"`: 清晰优先。
1087
1106
  * - SDK 会自动根据你的采集分辨率和帧率设定一个最小码率。即使遭遇网络波动,发送码率也不会低于这个值,从而确保清晰的视频画面。
1088
1107
  * - 大部分情况下,SDK 不会降低发送分辨率,但是可能会降低帧率。
1089
- * - `"motion"`: 流畅优先。
1108
+ * - `"motion"`: 自 4.21.0开始,SDK 默认开启流畅优先模式
1090
1109
  * - SDK 不会启用最小码率策略。遭遇网络波动时,发送端会降低码率来确保接收端的视频画面不会出现中断和卡顿。
1091
1110
  * - 大部分情况下,SDK 不会降低帧率,但是可能会降低发送分辨率。
1092
- * - 留空: 默认优化策略,兼顾清晰和流畅,也就是说弱网条件下,帧率和分辨率都会被调整。
1093
- *
1094
- * > 注意事项:该方法只支持 Chrome 浏览器。
1095
1111
  */
1096
1112
  /** @en
1097
1113
  * @since
1098
- * <br>&emsp;&emsp;&emsp;*4.0.0*
1114
+ * <br>&emsp;&emsp;&emsp;*4.2.0*
1115
+ *
1116
+ * Sets the video transmission optimization mode.
1117
+ *
1118
+ * You can call this method during a video call, a live streaming or screen sharing to dynamically change the optimization mode. For example, during the screen sharing, before you change the shared content from text to video, you can change the optimization mode from `"detail"` to `"motion"` to ensure smoothness in poor network conditions.
1099
1119
  *
1100
- * Transmission optimization mode. Whether to prioritize video quality or smoothness:
1120
+ * > Note: This method supports Chrome only.
1121
+ *
1122
+ * @param mode The video transmission optimization mode:
1123
+ * - `"balanced"`: Uses the default optimization mode.
1124
+ * - For a screen-sharing video track, the default transmission optimization strategy is to prioritizes clarity.
1125
+ * - For the other types of video tracks, the SDK may reduce the frame rate or the sending resolution in poor network conditions.
1101
1126
  * - `"detail"`: Prioritizes video quality.
1102
1127
  * - The SDK ensures high-quality images by automatically calculating a minimum bitrate based on the capturing resolution and frame rate. No matter how poor the network condition is, the sending bitrate will never be lower than the minimum value.
1103
1128
  * - In most cases, the SDK does not reduce the sending resolution, but may reduce the frame rate.
1104
- * - `"motion"`: Prioritizes video smoothness.
1129
+ * - `"motion"`: Since 4.21.0, the SDK prioritizes video smoothness.
1105
1130
  * - In poor network conditions, the SDK reduces the sending bitrate to minimize video freezes.
1106
1131
  * - In most cases, the SDK does not reduce the frame rate, but may reduce the sending resolution.
1107
- * - Empty: Uses the default transmission optimization mode. The SDK may reduce the frame rate or the sending resolution in poor network conditions.
1108
- *
1109
- * > Note: This method is only supported on Chrome.
1110
1132
  */
1111
1133
  optimizationMode?: "motion" | "detail";
1112
1134
  /**
@@ -1134,15 +1156,17 @@ export declare interface CustomVideoTrackInitConfig {
1134
1156
  }
1135
1157
 
1136
1158
  export declare abstract class DataChannel extends EventEmitter implements IDataChannel {
1159
+ readonly trackMediaType: TrackMediaType.DATA;
1137
1160
  private _version;
1138
1161
  private _type;
1139
1162
  _config: IDataChannelConfig;
1140
1163
  /** 原始的 DataChannel 对象 */
1141
1164
  _originDataChannel?: RTCDataChannel;
1142
1165
  protected _dataStreamPacketHeader: ArrayBuffer;
1143
- protected _dataStreamPacketHandler: DataStream;
1166
+ protected _dataStreamPacketHandler: IDataStream;
1144
1167
  private _datachannelEventMap;
1145
1168
  constructor(config: IDataChannelConfig, datachannel?: RTCDataChannel);
1169
+ useDataStream(dataStream: IDataStream): void;
1146
1170
  get id(): number;
1147
1171
  get ordered(): boolean;
1148
1172
  get maxRetransmits(): number;
@@ -1167,20 +1191,6 @@ export declare enum DataChannelEvents {
1167
1191
  ERROR = "error"
1168
1192
  }
1169
1193
 
1170
- declare class DataStream {
1171
- private _sequence;
1172
- private _startTime;
1173
- private isUseOneByte;
1174
- private get startTime();
1175
- private get sequence();
1176
- serialize(payload: ArrayBuffer): ArrayBuffer;
1177
- deserialize(packet: ArrayBuffer): ArrayBuffer;
1178
- private serializeExtension;
1179
- private deserializeExtension;
1180
- private decompress;
1181
- private compress;
1182
- }
1183
-
1184
1194
  export declare function decodeAudioData(buffer: ArrayBuffer): Promise<AudioBuffer>;
1185
1195
 
1186
1196
  export declare const DEFAULT_LOCAL_AUDIO_TRACK_STATS: LocalAudioTrackStats;
@@ -1200,6 +1210,13 @@ export declare interface DenoiserStats {
1200
1210
  vl: number;
1201
1211
  }
1202
1212
 
1213
+ /**
1214
+ * 是否支持Audio标签 setSinkId
1215
+ * Firefox 116 以上也支持此接口,但是会出现回声问题
1216
+ * 仅支持PC 端 Chrome / Edge,且不支持移动端
1217
+ */
1218
+ export declare function detectSupportAudioElementSetSinkId(): boolean;
1219
+
1203
1220
  /**
1204
1221
  * 音视频采集设备的信息。
1205
1222
  *
@@ -1430,6 +1447,18 @@ declare function event_source_state_change(currentState: AudioSourceState): void
1430
1447
  */
1431
1448
  declare function event_track_ended(): void;
1432
1449
 
1450
+ /**
1451
+ * 媒体轨道有更新时触发。
1452
+ * @param track 媒体轨道。详见 [MediaStreamTrack](https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamTrack)。
1453
+ * @event
1454
+ */
1455
+ /** @en
1456
+ * Triggers when a media track is updated.
1457
+ * @param track The media stream track. See [MediaStreamTrack](https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamTrack).
1458
+ * @event
1459
+ */
1460
+ export declare function event_track_updated(track: MediaStreamTrack): void;
1461
+
1433
1462
  /**
1434
1463
  * 当前轨道的 `RTCRtpTransceiver` 实例更新回调。
1435
1464
  *
@@ -1614,6 +1643,14 @@ export declare function getAudioEncoderConfiguration(profile: AudioEncoderConfig
1614
1643
 
1615
1644
  export declare function getBitrateConstrainRange(width: number, height: number, frameRate: number, bitrateMin?: number, bitrateMax?: number): DoubleRange;
1616
1645
 
1646
+ /**
1647
+ * get bitrate, use STANDARD_BITRATE to make sure the response
1648
+ * @param width
1649
+ * @param height
1650
+ * @param fps
1651
+ */
1652
+ export declare function getBitrateFromResAndFps(width: number, height: number, fps: number): Required<DoubleRange>;
1653
+
1617
1654
  export declare function getCompatibility(): AgoraRTCCompatibility;
1618
1655
 
1619
1656
  export declare function getConstraintsFromCameraConfig(config: CameraVideoTrackInitConfig): MediaTrackConstraints;
@@ -1630,6 +1667,22 @@ export declare function getElectronScreenStreamByUserSelect(config: ScreenConstr
1630
1667
 
1631
1668
  export declare function getLocalStream(config: GetUserMediaConfig, id: string): Promise<MediaStream>;
1632
1669
 
1670
+ /**
1671
+ * 获取初始配置
1672
+ * 分辨率:track.getMediaStreamTrackSettings > 客户设置
1673
+ * 帧率: track.getMediaStreamTrackSettings > 客户设置
1674
+ * 码率: 客户设置 > 根据分辨率计算
1675
+ *
1676
+ * ⚠️:理论上不存在没有分辨率的情况,如果出现不足任何处理
1677
+ */
1678
+ export declare const getOriginSenderConfig: (track: LocalVideoTrack) => {
1679
+ frameRate: number;
1680
+ bitrateMax: number;
1681
+ bitrateMin: number;
1682
+ scaleResolutionDownBy: number;
1683
+ scale: number;
1684
+ };
1685
+
1633
1686
  export declare function getScalabilityConfiguration(profile: SVCConfiguration | SVCConfigurationPreset): SVCConfiguration;
1634
1687
 
1635
1688
  export declare function getScreenEncoderConfiguration(profile: VideoEncoderConfiguration | ScreenEncoderConfigurationPreset | string): VideoEncoderConfiguration;
@@ -1963,6 +2016,11 @@ export declare interface IDataChannelConfig {
1963
2016
  metadata: string;
1964
2017
  }
1965
2018
 
2019
+ declare interface IDataStream {
2020
+ serialize: (payload: ArrayBuffer) => ArrayBuffer;
2021
+ deserialize: (packet: ArrayBuffer) => ArrayBuffer;
2022
+ }
2023
+
1966
2024
  /**
1967
2025
  * 基础本地音频轨道,提供了本地音频轨道的主要功能。
1968
2026
  *
@@ -2166,6 +2224,15 @@ export declare interface ILocalDataChannel extends IDataChannel {
2166
2224
  * `LocalTrack` is the basic interface for local tracks, providing public methods for [LocalAudioTrack]{@link ILocalAudioTrack} and [LocalVideoTrack]{@link ILocalVideoTrack}.
2167
2225
  */
2168
2226
  export declare interface ILocalTrack extends ITrack {
2227
+ /**
2228
+ * @param event 事件名称。
2229
+ * @param listener 详见 [track-updated]{@link event_track_updated}。
2230
+ */
2231
+ /** @en
2232
+ * @param event The event name.
2233
+ * @param listener See [track-updated]{@link event_track_updated}.
2234
+ */
2235
+ on(event: "track-updated", listener: typeof event_track_updated): void;
2169
2236
  /**
2170
2237
  * @param event 事件名称。
2171
2238
  * @param listener 详见 [track-ended]{@link event_track_ended}。
@@ -2319,6 +2386,15 @@ export declare interface ILocalTrack extends ITrack {
2319
2386
  * Inherited from `LocalVideoTrack`, [CameraVideoTrack]{@link ICameraVideoTrack} is an interface for the video captured by a local camera and adds several camera-related functions.
2320
2387
  */
2321
2388
  export declare interface ILocalVideoTrack extends ILocalTrack {
2389
+ /**
2390
+ * @param event 事件名称。
2391
+ * @param listener 详见 [track-updated]{@link event_track_updated}。
2392
+ */
2393
+ /** @en
2394
+ * @param event The event name.
2395
+ * @param listener See [track-updated]{@link event_track_updated}.
2396
+ */
2397
+ on(event: "track-updated", listener: typeof event_track_updated): void;
2322
2398
  /** @internal */
2323
2399
  on(event: "beauty-effect-overload", listener: typeof event_beauty_effect_overload): void;
2324
2400
  /**
@@ -2492,7 +2568,7 @@ export declare interface ILocalVideoTrack extends ILocalTrack {
2492
2568
  * - `"detail"`: 清晰优先。
2493
2569
  * - SDK 会自动根据你的采集分辨率和帧率设定一个最小码率。即使遭遇网络波动,发送码率也不会低于这个值,从而确保清晰的视频画面。
2494
2570
  * - 大部分情况下,SDK 不会降低发送分辨率,但是可能会降低帧率。
2495
- * - `"motion"`: 流畅优先。
2571
+ * - `"motion"`: 自 4.21.0 开始,SDK 默认开启流畅优先模式。
2496
2572
  * - SDK 不会启用最小码率策略。遭遇网络波动时,发送端会降低码率来确保接收端的视频画面不会出现中断和卡顿。
2497
2573
  * - 大部分情况下,SDK 不会降低帧率,但是可能会降低发送分辨率。
2498
2574
  */
@@ -2513,7 +2589,7 @@ export declare interface ILocalVideoTrack extends ILocalTrack {
2513
2589
  * - `"detail"`: Prioritizes video quality.
2514
2590
  * - The SDK ensures high-quality images by automatically calculating a minimum bitrate based on the capturing resolution and frame rate. No matter how poor the network condition is, the sending bitrate will never be lower than the minimum value.
2515
2591
  * - In most cases, the SDK does not reduce the sending resolution, but may reduce the frame rate.
2516
- * - `"motion"`: Prioritizes video smoothness.
2592
+ * - `"motion"`: Since 4.21.0, the SDK prioritizes video smoothness.
2517
2593
  * - In poor network conditions, the SDK reduces the sending bitrate to minimize video freezes.
2518
2594
  * - In most cases, the SDK does not reduce the frame rate, but may reduce the sending resolution.
2519
2595
  */
@@ -2961,6 +3037,15 @@ export declare interface IRemoteDataChannel extends IDataChannel {
2961
3037
  * `RemoteTrack` is the basic interface for remote tracks, providing public methods for [RemoteAudioTrack]{@link IRemoteAudioTrack} and [RemoteVideoTrack]{@link IRemoteVideoTrack}.
2962
3038
  */
2963
3039
  export declare interface IRemoteTrack extends ITrack {
3040
+ /**
3041
+ * @param event 事件名称。
3042
+ * @param listener 详见 [track-updated]{@link event_track_updated}。
3043
+ */
3044
+ /** @en
3045
+ * @param event The event name.
3046
+ * @param listener See [track-updated]{@link event_track_updated}.
3047
+ */
3048
+ on(event: "track-updated", listener: typeof event_track_updated): void;
2964
3049
  /**
2965
3050
  * @param event 事件名称。
2966
3051
  * @param listener 详见 [first-frame-decoded]{@link event_first_frame_decoded}。
@@ -3020,6 +3105,15 @@ export declare interface IRemoteTrack extends ITrack {
3020
3105
  * You can get create a remote video track by the [AgoraRTCRemoteUser.videoTrack]{@link IAgoraRTCRemoteUser.videoTrack} object after calling [subscribe]{@link IAgoraRTCClient.subscribe}.
3021
3106
  */
3022
3107
  export declare interface IRemoteVideoTrack extends IRemoteTrack {
3108
+ /**
3109
+ * @param event 事件名称。
3110
+ * @param listener 详见 [track-updated]{@link event_track_updated}。
3111
+ */
3112
+ /** @en
3113
+ * @param event The event name.
3114
+ * @param listener See [track-updated]{@link event_track_updated}.
3115
+ */
3116
+ on(event: "track-updated", listener: typeof event_track_updated): void;
3023
3117
  /**
3024
3118
  * @param event 事件名称。
3025
3119
  * @param listener 详见 [video-state-changed]{@link event_video_state_changed}。
@@ -3128,7 +3222,7 @@ export declare interface IRemoteVideoTrack extends IRemoteTrack {
3128
3222
  * 调用 `remoteVideoTrack.play` 后 SDK 会创建 [HTML `<video>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/video) 标签用于播放视频轨道。当 `remoteVideoTrack.isPlaying` 为 `true` 却看不到图像时,你可调用该方法进行问题排查。
3129
3223
  *
3130
3224
  * @return [[CheckVideoVisibleResult]] 对象。如果该方法返回 `undefined`,可能为以下原因:
3131
- * - `localRemoteTrack.isPlaying` 为 `false`。
3225
+ * - `remoteVideoTrack.isPlaying` 为 `false`。
3132
3226
  * - `<video>` 标签不存在。
3133
3227
  * - `<video>` 标签不是通过 `play` 方法调用产生的。
3134
3228
  */
@@ -3141,7 +3235,7 @@ export declare interface IRemoteVideoTrack extends IRemoteTrack {
3141
3235
  * After you call `remoteVideoTrack.play`, the SDK creates an [`<video>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/video) tag for playing video tracks. When `remoteVideoTrack.isPlaying` is `true` but you cannot see any video, call this method to check whether the `<video>` tag is visible or not and learn the reason when the `<video>` tag is invisible.
3142
3236
  *
3143
3237
  * @returns The [[CheckVideoVisibleResult]] object. If this method returns `undefined`, it may be due to the following reasons:
3144
- * - `localRemoteTrack.isPlaying` is `false`.
3238
+ * - `remoteVideoTrack.isPlaying` is `false`.
3145
3239
  * - The `<video>` tag does not exist.
3146
3240
  * - The `<video>` tag is not created by calling the `play` method.
3147
3241
  */
@@ -3208,6 +3302,8 @@ export { isElectron }
3208
3302
 
3209
3303
  export declare function isLowStreamParameter(streamParameter: any): streamParameter is LowStreamParameter;
3210
3304
 
3305
+ export declare function isPlanB(): boolean;
3306
+
3211
3307
  export declare function isScreenSourceType(mediaSource: any): mediaSource is ScreenSourceType;
3212
3308
 
3213
3309
  export declare function isVideoEncoderConfiguration(config: VideoEncoderConfiguration): config is VideoEncoderConfiguration;
@@ -3478,7 +3574,7 @@ export declare abstract class LocalTrack extends Track implements ILocalTrack {
3478
3574
  protected processor?: IBaseProcessor;
3479
3575
  protected abstract _processorContext: IProcessorContext | undefined;
3480
3576
  protected get processorContext(): IProcessorContext | undefined;
3481
- abstract processorDestination: IBaseProcessor;
3577
+ abstract get processorDestination(): IBaseProcessor;
3482
3578
  constructor(track: MediaStreamTrack, trackId?: string);
3483
3579
  abstract getStats(): LocalVideoTrackStats | LocalAudioTrackStats;
3484
3580
  abstract setMuted(enabled: boolean): Promise<void>;
@@ -3510,29 +3606,28 @@ export declare class LocalVideoTrack extends LocalTrack implements ILocalVideoTr
3510
3606
  _player?: AgoraRTCPlayer | VideoPlayer;
3511
3607
  isUseScaleResolutionDownBy: boolean;
3512
3608
  private _videoVisibleTimer;
3513
- /**
3514
- * 轮询监听stats
3515
- */
3516
- protected _statsTimer: number | null;
3517
3609
  private _previousVideoVisibleStatus;
3518
3610
  private _clearPreviousVideoVisibleStatus;
3519
3611
  _encoderConfig?: Partial<VideoEncoderConfiguration>;
3520
3612
  _scalabilityMode?: SVCConfiguration;
3521
- _optimizationMode?: "motion" | "detail" | "balanced";
3522
- _videoHeight?: number;
3523
- _videoWidth?: number;
3613
+ _optimizationMode?: OptimizationMode | "balanced";
3614
+ private _videoHeight?;
3615
+ private _videoWidth?;
3616
+ get videoHeight(): number | undefined;
3617
+ get videoWidth(): number | undefined;
3524
3618
  _forceBitrateLimit?: {
3525
3619
  max_bitrate: number;
3526
3620
  min_bitrate: number;
3527
3621
  };
3528
3622
  _enabled: boolean;
3529
3623
  get isPlaying(): boolean;
3530
- processorDestination: VideoProcessorDestination;
3624
+ protected _processorDestination: VideoProcessorDestination;
3625
+ get processorDestination(): VideoProcessorDestination;
3531
3626
  protected _processorContext: VideoProcessorContext;
3532
3627
  protected get processorContext(): VideoProcessorContext;
3533
3628
  protected set processorContext(ctx: VideoProcessorContext);
3534
3629
  get __className__(): string;
3535
- constructor(track: MediaStreamTrack, encoderConfig?: Partial<VideoEncoderConfiguration>, scalabilityConfig?: SVCConfiguration, optimizationMode?: "motion" | "detail" | "balanced", trackId?: string, hints?: TrackHint[]);
3630
+ constructor(track: MediaStreamTrack, encoderConfig?: Partial<VideoEncoderConfiguration>, scalabilityConfig?: SVCConfiguration, optimizationMode?: OptimizationMode | "balanced", trackId?: string, hints?: TrackHint[]);
3536
3631
  play(element: HTMLElement | HTMLVideoElement | string, config?: VideoPlayerConfig): void;
3537
3632
  stop(): void;
3538
3633
  setEnabled(enabled: boolean, skipChangeState?: boolean): Promise<void>;
@@ -3546,7 +3641,7 @@ export declare class LocalVideoTrack extends LocalTrack implements ILocalVideoTr
3546
3641
  max_bitrate: number;
3547
3642
  min_bitrate: number;
3548
3643
  }): Promise<void>;
3549
- setOptimizationMode(mode: "motion" | "detail" | "balanced"): Promise<void>;
3644
+ setOptimizationMode(mode: OptimizationMode | "balanced"): Promise<void>;
3550
3645
  setScalabiltyMode(mode: SVCConfiguration): void;
3551
3646
  updateMediaStreamTrackResolution(): void;
3552
3647
  protected _updatePlayerSource(): void;
@@ -3560,7 +3655,6 @@ export declare class LocalVideoTrack extends LocalTrack implements ILocalVideoTr
3560
3655
  close(): void;
3561
3656
  clone(config?: VideoEncoderConfiguration | VideoEncoderConfigurationPreset, cloneTrack?: boolean): LocalVideoTrack;
3562
3657
  replaceTrack(track: MediaStreamTrack, stopOldTrack: boolean): Promise<void>;
3563
- startMonitorStats(): void;
3564
3658
  sendSeiData(sei: Uint8Array): never;
3565
3659
  private bindProcessorDestinationEvents;
3566
3660
  private unbindProcessorDestinationEvents;
@@ -3582,7 +3676,7 @@ export declare interface LocalVideoTrackStats {
3582
3676
  * - `"VP8"`: 视频编码格式为 VP8。
3583
3677
  * - `"VP9"`: 视频编码格式为 VP9。
3584
3678
  * - `"AV1X"`: 预留参数,暂不支持。
3585
- * - `"AV1"`: 预留参数,暂不支持。
3679
+ * - `"AV1"`: 视频编码格式为 AV1。
3586
3680
  *
3587
3681
  * > Firefox 上无法获取该值。
3588
3682
  */
@@ -3593,7 +3687,7 @@ export declare interface LocalVideoTrackStats {
3593
3687
  * - `"VP8"`: The video codec is VP8.
3594
3688
  * - `"VP9"`: The video codec is VP9.
3595
3689
  * - `"AV1X"`: Reserved for future use.
3596
- * - `"AV1"`: Reserved for future use.
3690
+ * - `"AV1"`: The video codec is AV1.
3597
3691
  *
3598
3692
  * > You can not get this property on Firefox.
3599
3693
  */
@@ -3936,6 +4030,8 @@ export declare class MixingAudioTrack extends LocalAudioTrack {
3936
4030
  _updateRtpTransceiver(transceiver: RTCRtpTransceiver): void;
3937
4031
  }
3938
4032
 
4033
+ export declare type OptimizationMode = "motion" | "detail";
4034
+
3939
4035
  /**
3940
4036
  * @internal
3941
4037
  */
@@ -3969,7 +4065,7 @@ export declare interface ProcessorUsageStats {
3969
4065
  }
3970
4066
 
3971
4067
  export declare class RemoteAudioTrack extends RemoteTrack implements IRemoteAudioTrack {
3972
- readonly trackMediaType: "audio" | "video";
4068
+ readonly trackMediaType: TrackMediaType.AUDIO;
3973
4069
  _source: AudioTrackSource | FakeTrackSource;
3974
4070
  _useAudioElement: boolean;
3975
4071
  private _volume;
@@ -4104,6 +4200,13 @@ export declare interface RemoteAudioTrackStats {
4104
4200
  * The total number of lost audio packets that should be received.
4105
4201
  */
4106
4202
  receivePacketsLost: number;
4203
+ /**
4204
+ * 因过早或过晚到达抖动缓冲器而被丢弃的数据包数量。
4205
+ */
4206
+ /** @en
4207
+ * The number of packets discarded by the jitter buffer due to early or late arrival.
4208
+ */
4209
+ receivePacketsDiscarded: number;
4107
4210
  /**
4108
4211
  * 接收的音频总丢包率。
4109
4212
  */
@@ -4227,7 +4330,7 @@ export declare class RemoteVideoTrack extends RemoteTrack implements IRemoteVide
4227
4330
  private _videoVisibleTimer;
4228
4331
  private _previousVideoVisibleStatus;
4229
4332
  private _clearPreviousVideoVisibleStatus;
4230
- readonly trackMediaType: "audio" | "video";
4333
+ readonly trackMediaType: TrackMediaType.VIDEO;
4231
4334
  _videoWidth?: number;
4232
4335
  _videoHeight?: number;
4233
4336
  _player?: AgoraRTCPlayer | VideoPlayer;
@@ -4288,7 +4391,7 @@ export declare interface RemoteVideoTrackStats {
4288
4391
  * - `"VP8"`: The video codec is VP8.
4289
4392
  * - `"VP9"`: The video codec is VP9.
4290
4393
  * - `"AV1X"`: Reserved for future use.
4291
- * - `"AV1"`: Reserved for future use.
4394
+ * - `"AV1"`: The video codec is AV1.
4292
4395
  *
4293
4396
  * > You can not get this property on Firefox.
4294
4397
  */
@@ -4596,31 +4699,39 @@ export declare interface ScreenVideoTrackInitConfig {
4596
4699
  screenSourceType?: ScreenSourceType;
4597
4700
  /**
4598
4701
  * @自从
4599
- * <br>&emsp;&emsp;&emsp;*4.0.0*
4702
+ * <br>&emsp;&emsp;&emsp;*4.2.0*
4600
4703
  *
4601
- * 传输优化模式。设置该值后,SDK 会自动调整码率配置以及使用不同的回退策略。
4602
- * - `"motion"`: 流畅优先。
4603
- * - SDK 不会启用最小码率策略。遭遇网络波动时,发送端会降低码率来确保接收端的视频画面不会出现中断和卡顿。
4604
- * - 大部分情况下,SDK 不会降低帧率,但是可能会降低发送分辨率。
4605
- * - `"detail"`: (默认)清晰优先。
4606
- * - SDK 会自动根据你的采集分辨率和帧率设定一个最小码率。即使遭遇网络波动,发送码率也不会低于这个值,从而确保清晰的视频画面。
4607
- * - 大部分情况下,SDK 不会降低发送分辨率,但是可能会降低帧率。
4704
+ * 设置视频传输优化模式。
4705
+ *
4706
+ * 你可以在视频通话、视频直播或屏幕共享过程中调用此方法动态调整视频的传输优化模式。例如你想要把屏幕共享内容从演示文稿切换为视频时,你可以将传输优化模式从 `"detail"` 切换为 `"motion"`,确保视频画面在网络波动时不会出现卡顿。
4608
4707
  *
4609
4708
  * > 注意事项:该方法只支持 Chrome 浏览器。
4709
+ *
4710
+ * @param mode 视频传输优化模式:
4711
+ * - `"detail"`: 清晰优先。
4712
+ * - SDK 会自动根据你的采集分辨率和帧率设定一个最小码率。即使遭遇网络波动,发送码率也不会低于这个值,从而确保清晰的视频画面。
4713
+ * - 大部分情况下,SDK 不会降低发送分辨率,但是可能会降低帧率。
4714
+ * - `"motion"`: 自 4.21.0 开始,SDK 默认开启流畅优先模式。
4715
+ * - SDK 不会启用最小码率策略。遭遇网络波动时,发送端会降低码率来确保接收端的视频画面不会出现中断和卡顿。
4716
+ * - 大部分情况下,SDK 不会降低帧率,但是可能会降低发送分辨率。
4610
4717
  */
4611
4718
  /** @en
4612
4719
  * @since
4613
- * <br>&emsp;&emsp;&emsp;*4.0.0*
4720
+ * <br>&emsp;&emsp;&emsp;*4.2.0*
4721
+ *
4722
+ * Sets the video transmission optimization mode.
4723
+ *
4724
+ * You can call this method during a video call, a live streaming or screen sharing to dynamically change the optimization mode. For example, during the screen sharing, before you change the shared content from text to video, you can change the optimization mode from `"detail"` to `"motion"` to ensure smoothness in poor network conditions.
4614
4725
  *
4615
- * Transmission optimization mode. Whether to prioritize video quality or smoothness:
4616
- * - `"detail"`: (Default) Prioritizes video quality.
4726
+ * > Note: This method supports Chrome only.
4727
+ *
4728
+ * @param mode The video transmission optimization mode:
4729
+ * - `"detail"`: Prioritizes video quality.
4617
4730
  * - The SDK ensures high-quality images by automatically calculating a minimum bitrate based on the capturing resolution and frame rate. No matter how poor the network condition is, the sending bitrate will never be lower than the minimum value.
4618
4731
  * - In most cases, the SDK does not reduce the sending resolution, but may reduce the frame rate.
4619
- * - `"motion"`: Prioritizes video smoothness.
4732
+ * - `"motion"`: Since 4.21.0, the SDK prioritizes video smoothness.
4620
4733
  * - In poor network conditions, the SDK reduces the sending bitrate to minimize video freezes.
4621
4734
  * - In most cases, the SDK does not reduce the frame rate, but may reduce the sending resolution.
4622
- *
4623
- * > Note: This method is only supported on Chrome.
4624
4735
  */
4625
4736
  optimizationMode?: "motion" | "detail";
4626
4737
  /**
@@ -4751,6 +4862,12 @@ export declare interface ScreenVideoTrackInitConfig {
4751
4862
  systemAudio?: "include" | "exclude";
4752
4863
  }
4753
4864
 
4865
+ export declare type SenderConfig = {
4866
+ bitrateMax: number;
4867
+ bitrateMin: number;
4868
+ scaleResolutionDownBy: number;
4869
+ };
4870
+
4754
4871
  /**
4755
4872
  * 将节点输入的 AudioBuffer 返回,将节点输出的 AudioBuffer 设置成 silence
4756
4873
  */
@@ -4889,7 +5006,9 @@ export declare abstract class Track extends EventEmitter implements ITrack {
4889
5006
  /** 原始的 Track 对象,来自于采集/用户传入/订阅返回 */
4890
5007
  _originMediaStreamTrack: MediaStreamTrack;
4891
5008
  /** 用于播放和发布的 Track 对象,可能被各种模块修改,一般来说等于 `_originMediaStreamTrack` */
4892
- _mediaStreamTrack: MediaStreamTrack;
5009
+ mediaStreamTrack: MediaStreamTrack;
5010
+ set _mediaStreamTrack(track: MediaStreamTrack);
5011
+ get _mediaStreamTrack(): MediaStreamTrack;
4893
5012
  /** 提供给外部插件以同步数据 */
4894
5013
  _external: ExternalMethods;
4895
5014
  constructor(track: MediaStreamTrack, trackId?: string);
@@ -4907,7 +5026,8 @@ export declare abstract class Track extends EventEmitter implements ITrack {
4907
5026
  export declare enum TrackEvents {
4908
5027
  TRANSCEIVER_UPDATED = "transceiver-updated",
4909
5028
  SEI_TO_SEND = "sei-to-send",
4910
- SEI_RECEIVED = "sei-received"
5029
+ SEI_RECEIVED = "sei-received",
5030
+ TRACK_UPDATED = "track-updated"
4911
5031
  }
4912
5032
 
4913
5033
  /**
@@ -4923,7 +5043,7 @@ export declare enum TrackHint {
4923
5043
  }
4924
5044
 
4925
5045
  export declare enum TrackInternalEvent {
4926
- NEED_RENEGOTIATE = "@need_renegotiate",
5046
+ NEED_RENEGOTIATE = "@need_renegotiate",//deprecated
4927
5047
  NEED_REPLACE_TRACK = "@need_replace_track",
4928
5048
  NEED_REPLACE_MIXING_TRACK = "@need_replace_mixing_track",
4929
5049
  NEED_CLOSE = "@need_close",
@@ -4934,12 +5054,19 @@ export declare enum TrackInternalEvent {
4934
5054
  GET_STATS = "@get_stats",
4935
5055
  GET_RTC_STATS = "@get_rtc_stats",
4936
5056
  GET_LOW_VIDEO_TRACK = "@get_low_video_track",
4937
- NEED_RESET_REMOTE_SDP = "@need_reset_remote_sdp",
5057
+ NEED_RESET_REMOTE_SDP = "@need_reset_remote_sdp",//deprecated
4938
5058
  NEED_UPDATE_VIDEO_ENCODER = "@need_update_video_encoder",
5059
+ NEED_UPDATE_VIDEO_SEND_PARAMETERS = "@need_update_video_send_parameters",
4939
5060
  NEED_MUTE_TRACK = "@need_mute_track",
4940
5061
  NEED_UNMUTE_TRACK = "@need_unmute_track"
4941
5062
  }
4942
5063
 
5064
+ export declare enum TrackMediaType {
5065
+ AUDIO = "audio",
5066
+ VIDEO = "video",
5067
+ DATA = "data"
5068
+ }
5069
+
4943
5070
  export declare function updateAgoraRTCCompatibility(): void;
4944
5071
 
4945
5072
  export declare interface UsageRegistry {
@@ -5044,50 +5171,50 @@ export declare interface VideoEncoderConfiguration {
5044
5171
  *
5045
5172
  * 下表列出了 SDK 所有内置的视频属性配置,SDK 默认使用 `"480p_1"`。
5046
5173
  *
5047
- * | 视频属性 | 分辨率(宽×高) | 帧率(fps) | 码率(Kbps) | Chrome | Firefox | Safari |
5048
- * | -------- | --------------- | ----------- | ------------ | ------ | ------- | ------ |
5049
- * | 120p | 160 × 120 | 15 | 65 | ✓ | | |
5050
- * | 120p_1 | 160 × 120 | 15 | 65 | ✓ | | |
5051
- * | 120p_3 | 120 × 120 | 15 | 50 | ✓ | | |
5052
- * | 180p | 320 × 180 | 15 | 140 | ✓ | | |
5053
- * | 180p_1 | 320 × 180 | 15 | 140 | ✓ | | |
5054
- * | 180p_3 | 180 × 180 | 15 | 100 | ✓ | | |
5055
- * | 180p_4 | 240 × 180 | 15 | 120 | ✓ | | |
5056
- * | 240p | 320 × 240 | 15 | 200 | ✓ | | |
5057
- * | 240p_1 | 320 × 240 | 15 | 200 | ✓ | | |
5058
- * | 240p_3 | 240 × 240 | 15 | 140 | ✓ | | |
5059
- * | 240p_4 | 424 × 240 | 15 | 220 | ✓ | | |
5060
- * | 360p | 640 × 360 | 15 | 400 | ✓ | | |
5061
- * | 360p_1 | 640 × 360 | 15 | 400 | ✓ | | |
5062
- * | 360p_3 | 360 × 360 | 15 | 260 | ✓ | | |
5063
- * | 360p_4 | 640 × 360 | 30 | 600 | ✓ | | |
5064
- * | 360p_6 | 360 × 360 | 30 | 400 | ✓ | | |
5065
- * | 360p_7 | 480 × 360 | 15 | 320 | ✓ | | |
5066
- * | 360p_8 | 480 × 360 | 30 | 490 | ✓ | | |
5067
- * | 360p_9 | 640 × 360 | 15 | 800 | ✓ | | |
5068
- * | 360p_10 | 640 × 360 | 24 | 800 | ✓ | | |
5069
- * | 360p_11 | 640 × 360 | 24 | 1000 | ✓ | | |
5070
- * | 480p | 640 × 480 | 15 | 500 | ✓ | ✓ | ✓ |
5071
- * | 480p_1 | 640 × 480 | 15 | 500 | ✓ | ✓ | ✓ |
5072
- * | 480p_2 | 640 × 480 | 30 | 1000 | ✓ | ✓ | ✓ |
5073
- * | 480p_3 | 480 × 480 | 15 | 400 | ✓ | ✓ | ✓ |
5074
- * | 480p_4 | 640 × 480 | 30 | 750 | ✓ | ✓ | ✓ |
5075
- * | 480p_6 | 480 × 480 | 30 | 600 | ✓ | ✓ | ✓ |
5076
- * | 480p_8 | 848 × 480 | 15 | 610 | ✓ | ✓ | ✓ |
5077
- * | 480p_9 | 848 × 480 | 30 | 930 | ✓ | ✓ | ✓ |
5078
- * | 480p_10 | 640 × 480 | 10 | 400 | ✓ | ✓ | ✓ |
5079
- * | 720p | 1280 × 720 | 15 | 1130 | ✓ | ✓ | ✓ |
5080
- * | 720p_1 | 1280 × 720 | 15 | 1130 | ✓ | ✓ | ✓ |
5081
- * | 720p_2 | 1280 × 720 | 30 | 2000 | ✓ | ✓ | ✓ |
5082
- * | 720p_3 | 1280 × 720 | 30 | 1710 | ✓ | ✓ | ✓ |
5083
- * | 720p_auto <sup>①</sup> | 1280 × 720 | 30 | 3000 | ✓ | ✓ | ✓ |
5084
- * | 720p_5 | 960 × 720 | 15 | 910 | ✓ | ✓ | ✓ |
5085
- * | 720p_6 | 960 × 720 | 30 | 1380 | ✓ | ✓ | ✓ |
5086
- * | 1080p | 1920 × 1080 | 15 | 2080 | ✓ | | ✓ |
5087
- * | 1080p_1 | 1920 × 1080 | 15 | 2080 | ✓ | | ✓ |
5088
- * | 1080p_2 | 1920 × 1080 | 30 | 3000 | ✓ | | ✓ |
5089
- * | 1080p_3 | 1920 × 1080 | 30 | 3150 | ✓ | | ✓ |
5090
- * | 1080p_5 | 1920 × 1080 | 60 | 4780 | ✓ | | ✓ |
5174
+ * | 视频属性 | 分辨率(宽×高) | 帧率(fps) | Chrome | Firefox | Safari |
5175
+ * | -------- | --------------- | ----------- | ------ | ------- | ------ |
5176
+ * | 120p | 160 × 120 | 15 | ✓ | | |
5177
+ * | 120p_1 | 160 × 120 | 15 | ✓ | | |
5178
+ * | 120p_3 | 120 × 120 | 15 | ✓ | | |
5179
+ * | 180p | 320 × 180 | 15 | ✓ | | |
5180
+ * | 180p_1 | 320 × 180 | 15 | ✓ | | |
5181
+ * | 180p_3 | 180 × 180 | 15 | ✓ | | |
5182
+ * | 180p_4 | 240 × 180 | 15 | ✓ | | |
5183
+ * | 240p | 320 × 240 | 15 | ✓ | | |
5184
+ * | 240p_1 | 320 × 240 | 15 | ✓ | | |
5185
+ * | 240p_3 | 240 × 240 | 15 | ✓ | | |
5186
+ * | 240p_4 | 424 × 240 | 15 | ✓ | | |
5187
+ * | 360p | 640 × 360 | 15 | ✓ | | |
5188
+ * | 360p_1 | 640 × 360 | 15 | ✓ | | |
5189
+ * | 360p_3 | 360 × 360 | 15 | ✓ | | |
5190
+ * | 360p_4 | 640 × 360 | 30 | ✓ | | |
5191
+ * | 360p_6 | 360 × 360 | 30 | ✓ | | |
5192
+ * | 360p_7 | 480 × 360 | 15 | ✓ | | |
5193
+ * | 360p_8 | 480 × 360 | 30 | ✓ | | |
5194
+ * | 360p_9 | 640 × 360 | 15 | ✓ | | |
5195
+ * | 360p_10 | 640 × 360 | 24 | ✓ | | |
5196
+ * | 360p_11 | 640 × 360 | 24 | ✓ | | |
5197
+ * | 480p | 640 × 480 | 15 | ✓ | ✓ | ✓ |
5198
+ * | 480p_1 | 640 × 480 | 15 | ✓ | ✓ | ✓ |
5199
+ * | 480p_2 | 640 × 480 | 30 | ✓ | ✓ | ✓ |
5200
+ * | 480p_3 | 480 × 480 | 15 | ✓ | ✓ | ✓ |
5201
+ * | 480p_4 | 640 × 480 | 30 | ✓ | ✓ | ✓ |
5202
+ * | 480p_6 | 480 × 480 | 30 | ✓ | ✓ | ✓ |
5203
+ * | 480p_8 | 848 × 480 | 15 | ✓ | ✓ | ✓ |
5204
+ * | 480p_9 | 848 × 480 | 30 | ✓ | ✓ | ✓ |
5205
+ * | 480p_10 | 640 × 480 | 10 | ✓ | ✓ | ✓ |
5206
+ * | 720p | 1280 × 720 | 15 | ✓ | ✓ | ✓ |
5207
+ * | 720p_1 | 1280 × 720 | 15 | ✓ | ✓ | ✓ |
5208
+ * | 720p_2 | 1280 × 720 | 30 | ✓ | ✓ | ✓ |
5209
+ * | 720p_3 | 1280 × 720 | 30 | ✓ | ✓ | ✓ |
5210
+ * | 720p_auto <sup>①</sup> | 1280 × 720 | 30 |✓ | ✓ | ✓ |
5211
+ * | 720p_5 | 960 × 720 | 15 | ✓ | ✓ | ✓ |
5212
+ * | 720p_6 | 960 × 720 | 30 | ✓ | ✓ | ✓ |
5213
+ * | 1080p | 1920 × 1080 | 15 | ✓ | | ✓ |
5214
+ * | 1080p_1 | 1920 × 1080 | 15 | ✓ | | ✓ |
5215
+ * | 1080p_2 | 1920 × 1080 | 30 | ✓ | | ✓ |
5216
+ * | 1080p_3 | 1920 × 1080 | 30 | ✓ | | ✓ |
5217
+ * | 1080p_5 | 1920 × 1080 | 60 | ✓ | | ✓ |
5091
5218
  *
5092
5219
  * > <sup>①</sup> `"720p_auto"` 仅推荐在 Safari 上设置,用于确保能够动态调整编码分辨率,详见[发版说明](https://doc.shengwang.cn/doc/rtc/javascript/overview/release-notes)。
5093
5220
  *
@@ -5101,50 +5228,50 @@ export declare interface VideoEncoderConfiguration {
5101
5228
  *
5102
5229
  * The following table lists all the preset video profiles. The SDK uses `"480p_1"` by default.
5103
5230
  *
5104
- * | Video Profile | Resolution (Width×Height) | Frame Rate (fps) | Bitrate (Kbps) | Chrome | Firefox | Safari |
5105
- * | -------- | --------------- | ----------- | ------------ | ------ | ------- | ------ |
5106
- * | 120p | 160 × 120 | 15 | 65 | ✓ | | |
5107
- * | 120p_1 | 160 × 120 | 15 | 65 | ✓ | | |
5108
- * | 120p_3 | 120 × 120 | 15 | 50 | ✓ | | |
5109
- * | 180p | 320 × 180 | 15 | 140 | ✓ | | |
5110
- * | 180p_1 | 320 × 180 | 15 | 140 | ✓ | | |
5111
- * | 180p_3 | 180 × 180 | 15 | 100 | ✓ | | |
5112
- * | 180p_4 | 240 × 180 | 15 | 120 | ✓ | | |
5113
- * | 240p | 320 × 240 | 15 | 200 | ✓ | | |
5114
- * | 240p_1 | 320 × 240 | 15 | 200 | ✓ | | |
5115
- * | 240p_3 | 240 × 240 | 15 | 140 | ✓ | | |
5116
- * | 240p_4 | 424 × 240 | 15 | 220 | ✓ | | |
5117
- * | 360p | 640 × 360 | 15 | 400 | ✓ | | |
5118
- * | 360p_1 | 640 × 360 | 15 | 400 | ✓ | | |
5119
- * | 360p_3 | 360 × 360 | 15 | 260 | ✓ | | |
5120
- * | 360p_4 | 640 × 360 | 30 | 600 | ✓ | | |
5121
- * | 360p_6 | 360 × 360 | 30 | 400 | ✓ | | |
5122
- * | 360p_7 | 480 × 360 | 15 | 320 | ✓ | | |
5123
- * | 360p_8 | 480 × 360 | 30 | 490 | ✓ | | |
5124
- * | 360p_9 | 640 × 360 | 15 | 800 | ✓ | | |
5125
- * | 360p_10 | 640 × 360 | 24 | 800 | ✓ | | |
5126
- * | 360p_11 | 640 × 360 | 24 | 1000 | ✓ | | |
5127
- * | 480p | 640 × 480 | 15 | 500 | ✓ | ✓ | ✓ |
5128
- * | 480p_1 | 640 × 480 | 15 | 500 | ✓ | ✓ | ✓ |
5129
- * | 480p_2 | 640 × 480 | 30 | 1000 | ✓ | ✓ | ✓ |
5130
- * | 480p_3 | 480 × 480 | 15 | 400 | ✓ | ✓ | ✓ |
5131
- * | 480p_4 | 640 × 480 | 30 | 750 | ✓ | ✓ | ✓ |
5132
- * | 480p_6 | 480 × 480 | 30 | 600 | ✓ | ✓ | ✓ |
5133
- * | 480p_8 | 848 × 480 | 15 | 610 | ✓ | ✓ | ✓ |
5134
- * | 480p_9 | 848 × 480 | 30 | 930 | ✓ | ✓ | ✓ |
5135
- * | 480p_10 | 640 × 480 | 10 | 400 | ✓ | ✓ | ✓ |
5136
- * | 720p | 1280 × 720 | 15 | 1130 | ✓ | ✓ | ✓ |
5137
- * | 720p_1 | 1280 × 720 | 15 | 1130 | ✓ | ✓ | ✓ |
5138
- * | 720p_2 | 1280 × 720 | 30 | 2000 | ✓ | ✓ | ✓ |
5139
- * | 720p_3 | 1280 × 720 | 30 | 1710 | ✓ | ✓ | ✓ |
5140
- * | 720p_auto <sup>①</sup> | 1280 × 720 | 30 | 3000 | ✓ | ✓ | ✓ |
5141
- * | 720p_5 | 960 × 720 | 15 | 910 | ✓ | ✓ | ✓ |
5142
- * | 720p_6 | 960 × 720 | 30 | 1380 | ✓ | ✓ | ✓ |
5143
- * | 1080p | 1920 × 1080 | 15 | 2080 | ✓ | | ✓ |
5144
- * | 1080p_1 | 1920 × 1080 | 15 | 2080 | ✓ | | ✓ |
5145
- * | 1080p_2 | 1920 × 1080 | 30 | 3000 | ✓ | | ✓ |
5146
- * | 1080p_3 | 1920 × 1080 | 30 | 3150 | ✓ | | ✓ |
5147
- * | 1080p_5 | 1920 × 1080 | 60 | 4780 | ✓ | | ✓ |
5231
+ * | Video Profile | Resolution (Width×Height) | Frame Rate (fps) | Chrome | Firefox | Safari |
5232
+ * | -------- | --------------- | ----------- | ------ | ------- | ------ |
5233
+ * | 120p | 160 × 120 | 15 | ✓ | | |
5234
+ * | 120p_1 | 160 × 120 | 15 | ✓ | | |
5235
+ * | 120p_3 | 120 × 120 | 15 | ✓ | | |
5236
+ * | 180p | 320 × 180 | 15 | ✓ | | |
5237
+ * | 180p_1 | 320 × 180 | 15 | ✓ | | |
5238
+ * | 180p_3 | 180 × 180 | 15 | ✓ | | |
5239
+ * | 180p_4 | 240 × 180 | 15 | ✓ | | |
5240
+ * | 240p | 320 × 240 | 15 | ✓ | | |
5241
+ * | 240p_1 | 320 × 240 | 15 | ✓ | | |
5242
+ * | 240p_3 | 240 × 240 | 15 | ✓ | | |
5243
+ * | 240p_4 | 424 × 240 | 15 | ✓ | | |
5244
+ * | 360p | 640 × 360 | 15 | ✓ | | |
5245
+ * | 360p_1 | 640 × 360 | 15 | ✓ | | |
5246
+ * | 360p_3 | 360 × 360 | 15 | ✓ | | |
5247
+ * | 360p_4 | 640 × 360 | 30 | ✓ | | |
5248
+ * | 360p_6 | 360 × 360 | 30 | ✓ | | |
5249
+ * | 360p_7 | 480 × 360 | 15 | ✓ | | |
5250
+ * | 360p_8 | 480 × 360 | 30 | ✓ | | |
5251
+ * | 360p_9 | 640 × 360 | 15 | ✓ | | |
5252
+ * | 360p_10 | 640 × 360 | 24 | ✓ | | |
5253
+ * | 360p_11 | 640 × 360 | 24 | ✓ | | |
5254
+ * | 480p | 640 × 480 | 15 | ✓ | ✓ | ✓ |
5255
+ * | 480p_1 | 640 × 480 | 15 | ✓ | ✓ | ✓ |
5256
+ * | 480p_2 | 640 × 480 | 30 | ✓ | ✓ | ✓ |
5257
+ * | 480p_3 | 480 × 480 | 15 | ✓ | ✓ | ✓ |
5258
+ * | 480p_4 | 640 × 480 | 30 | ✓ | ✓ | ✓ |
5259
+ * | 480p_6 | 480 × 480 | 30 | ✓ | ✓ | ✓ |
5260
+ * | 480p_8 | 848 × 480 | 15 | ✓ | ✓ | ✓ |
5261
+ * | 480p_9 | 848 × 480 | 30 | ✓ | ✓ | ✓ |
5262
+ * | 480p_10 | 640 × 480 | 10 | ✓ | ✓ | ✓ |
5263
+ * | 720p | 1280 × 720 | 15 | ✓ | ✓ | ✓ |
5264
+ * | 720p_1 | 1280 × 720 | 15 | ✓ | ✓ | ✓ |
5265
+ * | 720p_2 | 1280 × 720 | 30 | ✓ | ✓ | ✓ |
5266
+ * | 720p_3 | 1280 × 720 | 30 | ✓ | ✓ | ✓ |
5267
+ * | 720p_auto <sup>①</sup> | 1280 × 720 | 30 | ✓ | ✓ | ✓ |
5268
+ * | 720p_5 | 960 × 720 | 15 | ✓ | ✓ | ✓ |
5269
+ * | 720p_6 | 960 × 720 | 30 | ✓ | ✓ | ✓ |
5270
+ * | 1080p | 1920 × 1080 | 15 | ✓ | | ✓ |
5271
+ * | 1080p_1 | 1920 × 1080 | 15 | ✓ | | ✓ |
5272
+ * | 1080p_2 | 1920 × 1080 | 30 | ✓ | | ✓ |
5273
+ * | 1080p_3 | 1920 × 1080 | 30 | ✓ | | ✓ |
5274
+ * | 1080p_5 | 1920 × 1080 | 60 | ✓ | | ✓ |
5148
5275
  *
5149
5276
  * > <sup>①</sup> `"720p_auto"` is only recommended to be set on Safari to ensure dynamic adjustment of the encoding resolution. For details, see the release notes.
5150
5277
  */
@@ -5171,6 +5298,8 @@ declare class VideoPlayer {
5171
5298
  protected videoTrack?: MediaStreamTrack;
5172
5299
  protected videoElement: HTMLVideoElement;
5173
5300
  protected cacheVideoElement?: HTMLVideoElement;
5301
+ private renderStats?;
5302
+ get rendFrameRate(): number;
5174
5303
  get videoElementStatus(): MediaElementStatus;
5175
5304
  set videoElementStatus(status: MediaElementStatus);
5176
5305
  get videoState(): VideoState;