@agora-js/media 4.20.2 → 4.21.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;
@@ -832,7 +836,7 @@ export declare interface CameraVideoTrackInitConfig {
832
836
  *
833
837
  * > Note: This method is only supported on Chrome.
834
838
  */
835
- optimizationMode?: "motion" | "detail";
839
+ optimizationMode?: OptimizationMode;
836
840
  /**
837
841
  * @ignore
838
842
  * @自从
@@ -1200,6 +1204,13 @@ export declare interface DenoiserStats {
1200
1204
  vl: number;
1201
1205
  }
1202
1206
 
1207
+ /**
1208
+ * 是否支持Audio标签 setSinkId
1209
+ * Firefox 116 以上也支持此接口,但是会出现回声问题
1210
+ * 仅支持PC 端 Chrome / Edge,且不支持移动端
1211
+ */
1212
+ export declare function detectSupportAudioElementSetSinkId(): boolean;
1213
+
1203
1214
  /**
1204
1215
  * 音视频采集设备的信息。
1205
1216
  *
@@ -1430,6 +1441,18 @@ declare function event_source_state_change(currentState: AudioSourceState): void
1430
1441
  */
1431
1442
  declare function event_track_ended(): void;
1432
1443
 
1444
+ /**
1445
+ * 媒体轨道有更新时触发。
1446
+ * @param track 媒体轨道。详见 [MediaStreamTrack](https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamTrack)。
1447
+ * @event
1448
+ */
1449
+ /** @en
1450
+ * Triggers when a media track is updated.
1451
+ * @param track The media stream track. See [MediaStreamTrack](https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamTrack).
1452
+ * @event
1453
+ */
1454
+ export declare function event_track_updated(track: MediaStreamTrack): void;
1455
+
1433
1456
  /**
1434
1457
  * 当前轨道的 `RTCRtpTransceiver` 实例更新回调。
1435
1458
  *
@@ -1614,6 +1637,14 @@ export declare function getAudioEncoderConfiguration(profile: AudioEncoderConfig
1614
1637
 
1615
1638
  export declare function getBitrateConstrainRange(width: number, height: number, frameRate: number, bitrateMin?: number, bitrateMax?: number): DoubleRange;
1616
1639
 
1640
+ /**
1641
+ * get bitrate, use STANDARD_BITRATE to make sure the response
1642
+ * @param width
1643
+ * @param height
1644
+ * @param fps
1645
+ */
1646
+ export declare function getBitrateFromResAndFps(width: number, height: number, fps: number): Required<DoubleRange>;
1647
+
1617
1648
  export declare function getCompatibility(): AgoraRTCCompatibility;
1618
1649
 
1619
1650
  export declare function getConstraintsFromCameraConfig(config: CameraVideoTrackInitConfig): MediaTrackConstraints;
@@ -1630,6 +1661,22 @@ export declare function getElectronScreenStreamByUserSelect(config: ScreenConstr
1630
1661
 
1631
1662
  export declare function getLocalStream(config: GetUserMediaConfig, id: string): Promise<MediaStream>;
1632
1663
 
1664
+ /**
1665
+ * 获取初始配置
1666
+ * 分辨率:track.getMediaStreamTrackSettings > 客户设置
1667
+ * 帧率: track.getMediaStreamTrackSettings > 客户设置
1668
+ * 码率: 客户设置 > 根据分辨率计算
1669
+ *
1670
+ * ⚠️:理论上不存在没有分辨率的情况,如果出现不足任何处理
1671
+ */
1672
+ export declare const getOriginSenderConfig: (track: LocalVideoTrack) => {
1673
+ frameRate: number;
1674
+ bitrateMax: number;
1675
+ bitrateMin: number;
1676
+ scaleResolutionDownBy: number;
1677
+ scale: number;
1678
+ };
1679
+
1633
1680
  export declare function getScalabilityConfiguration(profile: SVCConfiguration | SVCConfigurationPreset): SVCConfiguration;
1634
1681
 
1635
1682
  export declare function getScreenEncoderConfiguration(profile: VideoEncoderConfiguration | ScreenEncoderConfigurationPreset | string): VideoEncoderConfiguration;
@@ -2166,6 +2213,15 @@ export declare interface ILocalDataChannel extends IDataChannel {
2166
2213
  * `LocalTrack` is the basic interface for local tracks, providing public methods for [LocalAudioTrack]{@link ILocalAudioTrack} and [LocalVideoTrack]{@link ILocalVideoTrack}.
2167
2214
  */
2168
2215
  export declare interface ILocalTrack extends ITrack {
2216
+ /**
2217
+ * @param event 事件名称。
2218
+ * @param listener 详见 [track-updated]{@link event_track_updated}。
2219
+ */
2220
+ /** @en
2221
+ * @param event The event name.
2222
+ * @param listener See [track-updated]{@link event_track_updated}.
2223
+ */
2224
+ on(event: "track-updated", listener: typeof event_track_updated): void;
2169
2225
  /**
2170
2226
  * @param event 事件名称。
2171
2227
  * @param listener 详见 [track-ended]{@link event_track_ended}。
@@ -2319,6 +2375,15 @@ export declare interface ILocalTrack extends ITrack {
2319
2375
  * Inherited from `LocalVideoTrack`, [CameraVideoTrack]{@link ICameraVideoTrack} is an interface for the video captured by a local camera and adds several camera-related functions.
2320
2376
  */
2321
2377
  export declare interface ILocalVideoTrack extends ILocalTrack {
2378
+ /**
2379
+ * @param event 事件名称。
2380
+ * @param listener 详见 [track-updated]{@link event_track_updated}。
2381
+ */
2382
+ /** @en
2383
+ * @param event The event name.
2384
+ * @param listener See [track-updated]{@link event_track_updated}.
2385
+ */
2386
+ on(event: "track-updated", listener: typeof event_track_updated): void;
2322
2387
  /** @internal */
2323
2388
  on(event: "beauty-effect-overload", listener: typeof event_beauty_effect_overload): void;
2324
2389
  /**
@@ -2806,7 +2871,7 @@ export declare interface IRemoteAudioTrack extends IRemoteTrack {
2806
2871
  *
2807
2872
  * 设置音频播放设备,比如扬声器。
2808
2873
  *
2809
- * > 该方法只支持桌面端的 Chrome 和 Edge 浏览器,其他浏览器调用将会抛出 `NOT_SUPPORTED` 错误。
2874
+ * > 该方法只支持桌面端的 Chrome 和 Edge 浏览器。如果在其他浏览器上需要先设置`RESTRICTION_SET_PLAYBACK_DEVICE`为`false`,直接调用将会抛出 `NOT_SUPPORTED` 错误。
2810
2875
  * @param deviceId 设备 ID,可以通过 [[getPlaybackDevices]] 方法获取。
2811
2876
  */
2812
2877
  /** @en
@@ -2815,7 +2880,7 @@ export declare interface IRemoteAudioTrack extends IRemoteTrack {
2815
2880
  *
2816
2881
  * Sets the audio playback device, for example, the speaker.
2817
2882
  *
2818
- * > This method supports Chrome and Edge on desktop devices only. Other browsers throw a `NOT_SUPPORTED` error when calling this method.
2883
+ * > > This method is only supported on desktop Chrome and Edge browsers. If you call it on other browsers, you need to set `RESTRICTION_SET_PLAYBACK_DEVICE` to `false` first, and calling it directly will throw a `NOT_SUPPORTED` error.
2819
2884
  * @param deviceId Device ID, which can be retrieved by calling [[getPlaybackDevices]].
2820
2885
  */
2821
2886
  setPlaybackDevice(deviceId: string): Promise<void>;
@@ -2961,6 +3026,15 @@ export declare interface IRemoteDataChannel extends IDataChannel {
2961
3026
  * `RemoteTrack` is the basic interface for remote tracks, providing public methods for [RemoteAudioTrack]{@link IRemoteAudioTrack} and [RemoteVideoTrack]{@link IRemoteVideoTrack}.
2962
3027
  */
2963
3028
  export declare interface IRemoteTrack extends ITrack {
3029
+ /**
3030
+ * @param event 事件名称。
3031
+ * @param listener 详见 [track-updated]{@link event_track_updated}。
3032
+ */
3033
+ /** @en
3034
+ * @param event The event name.
3035
+ * @param listener See [track-updated]{@link event_track_updated}.
3036
+ */
3037
+ on(event: "track-updated", listener: typeof event_track_updated): void;
2964
3038
  /**
2965
3039
  * @param event 事件名称。
2966
3040
  * @param listener 详见 [first-frame-decoded]{@link event_first_frame_decoded}。
@@ -3020,6 +3094,15 @@ export declare interface IRemoteTrack extends ITrack {
3020
3094
  * You can get create a remote video track by the [AgoraRTCRemoteUser.videoTrack]{@link IAgoraRTCRemoteUser.videoTrack} object after calling [subscribe]{@link IAgoraRTCClient.subscribe}.
3021
3095
  */
3022
3096
  export declare interface IRemoteVideoTrack extends IRemoteTrack {
3097
+ /**
3098
+ * @param event 事件名称。
3099
+ * @param listener 详见 [track-updated]{@link event_track_updated}。
3100
+ */
3101
+ /** @en
3102
+ * @param event The event name.
3103
+ * @param listener See [track-updated]{@link event_track_updated}.
3104
+ */
3105
+ on(event: "track-updated", listener: typeof event_track_updated): void;
3023
3106
  /**
3024
3107
  * @param event 事件名称。
3025
3108
  * @param listener 详见 [video-state-changed]{@link event_video_state_changed}。
@@ -3128,7 +3211,7 @@ export declare interface IRemoteVideoTrack extends IRemoteTrack {
3128
3211
  * 调用 `remoteVideoTrack.play` 后 SDK 会创建 [HTML `<video>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/video) 标签用于播放视频轨道。当 `remoteVideoTrack.isPlaying` 为 `true` 却看不到图像时,你可调用该方法进行问题排查。
3129
3212
  *
3130
3213
  * @return [[CheckVideoVisibleResult]] 对象。如果该方法返回 `undefined`,可能为以下原因:
3131
- * - `localRemoteTrack.isPlaying` 为 `false`。
3214
+ * - `remoteVideoTrack.isPlaying` 为 `false`。
3132
3215
  * - `<video>` 标签不存在。
3133
3216
  * - `<video>` 标签不是通过 `play` 方法调用产生的。
3134
3217
  */
@@ -3141,7 +3224,7 @@ export declare interface IRemoteVideoTrack extends IRemoteTrack {
3141
3224
  * 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
3225
  *
3143
3226
  * @returns The [[CheckVideoVisibleResult]] object. If this method returns `undefined`, it may be due to the following reasons:
3144
- * - `localRemoteTrack.isPlaying` is `false`.
3227
+ * - `remoteVideoTrack.isPlaying` is `false`.
3145
3228
  * - The `<video>` tag does not exist.
3146
3229
  * - The `<video>` tag is not created by calling the `play` method.
3147
3230
  */
@@ -3478,7 +3561,7 @@ export declare abstract class LocalTrack extends Track implements ILocalTrack {
3478
3561
  protected processor?: IBaseProcessor;
3479
3562
  protected abstract _processorContext: IProcessorContext | undefined;
3480
3563
  protected get processorContext(): IProcessorContext | undefined;
3481
- abstract processorDestination: IBaseProcessor;
3564
+ abstract get processorDestination(): IBaseProcessor;
3482
3565
  constructor(track: MediaStreamTrack, trackId?: string);
3483
3566
  abstract getStats(): LocalVideoTrackStats | LocalAudioTrackStats;
3484
3567
  abstract setMuted(enabled: boolean): Promise<void>;
@@ -3518,21 +3601,24 @@ export declare class LocalVideoTrack extends LocalTrack implements ILocalVideoTr
3518
3601
  private _clearPreviousVideoVisibleStatus;
3519
3602
  _encoderConfig?: Partial<VideoEncoderConfiguration>;
3520
3603
  _scalabilityMode?: SVCConfiguration;
3521
- _optimizationMode?: "motion" | "detail" | "balanced";
3522
- _videoHeight?: number;
3523
- _videoWidth?: number;
3604
+ _optimizationMode?: OptimizationMode | "balanced";
3605
+ private _videoHeight?;
3606
+ private _videoWidth?;
3607
+ get videoHeight(): number | undefined;
3608
+ get videoWidth(): number | undefined;
3524
3609
  _forceBitrateLimit?: {
3525
3610
  max_bitrate: number;
3526
3611
  min_bitrate: number;
3527
3612
  };
3528
3613
  _enabled: boolean;
3529
3614
  get isPlaying(): boolean;
3530
- processorDestination: VideoProcessorDestination;
3615
+ protected _processorDestination: VideoProcessorDestination;
3616
+ get processorDestination(): VideoProcessorDestination;
3531
3617
  protected _processorContext: VideoProcessorContext;
3532
3618
  protected get processorContext(): VideoProcessorContext;
3533
3619
  protected set processorContext(ctx: VideoProcessorContext);
3534
3620
  get __className__(): string;
3535
- constructor(track: MediaStreamTrack, encoderConfig?: Partial<VideoEncoderConfiguration>, scalabilityConfig?: SVCConfiguration, optimizationMode?: "motion" | "detail" | "balanced", trackId?: string, hints?: TrackHint[]);
3621
+ constructor(track: MediaStreamTrack, encoderConfig?: Partial<VideoEncoderConfiguration>, scalabilityConfig?: SVCConfiguration, optimizationMode?: OptimizationMode | "balanced", trackId?: string, hints?: TrackHint[]);
3536
3622
  play(element: HTMLElement | HTMLVideoElement | string, config?: VideoPlayerConfig): void;
3537
3623
  stop(): void;
3538
3624
  setEnabled(enabled: boolean, skipChangeState?: boolean): Promise<void>;
@@ -3546,7 +3632,7 @@ export declare class LocalVideoTrack extends LocalTrack implements ILocalVideoTr
3546
3632
  max_bitrate: number;
3547
3633
  min_bitrate: number;
3548
3634
  }): Promise<void>;
3549
- setOptimizationMode(mode: "motion" | "detail" | "balanced"): Promise<void>;
3635
+ setOptimizationMode(mode: OptimizationMode | "balanced"): Promise<void>;
3550
3636
  setScalabiltyMode(mode: SVCConfiguration): void;
3551
3637
  updateMediaStreamTrackResolution(): void;
3552
3638
  protected _updatePlayerSource(): void;
@@ -3936,6 +4022,8 @@ export declare class MixingAudioTrack extends LocalAudioTrack {
3936
4022
  _updateRtpTransceiver(transceiver: RTCRtpTransceiver): void;
3937
4023
  }
3938
4024
 
4025
+ export declare type OptimizationMode = "motion" | "detail";
4026
+
3939
4027
  /**
3940
4028
  * @internal
3941
4029
  */
@@ -4751,6 +4839,12 @@ export declare interface ScreenVideoTrackInitConfig {
4751
4839
  systemAudio?: "include" | "exclude";
4752
4840
  }
4753
4841
 
4842
+ export declare type SenderConfig = {
4843
+ bitrateMax: number;
4844
+ bitrateMin: number;
4845
+ scaleResolutionDownBy: number;
4846
+ };
4847
+
4754
4848
  /**
4755
4849
  * 将节点输入的 AudioBuffer 返回,将节点输出的 AudioBuffer 设置成 silence
4756
4850
  */
@@ -4889,7 +4983,9 @@ export declare abstract class Track extends EventEmitter implements ITrack {
4889
4983
  /** 原始的 Track 对象,来自于采集/用户传入/订阅返回 */
4890
4984
  _originMediaStreamTrack: MediaStreamTrack;
4891
4985
  /** 用于播放和发布的 Track 对象,可能被各种模块修改,一般来说等于 `_originMediaStreamTrack` */
4892
- _mediaStreamTrack: MediaStreamTrack;
4986
+ mediaStreamTrack: MediaStreamTrack;
4987
+ set _mediaStreamTrack(track: MediaStreamTrack);
4988
+ get _mediaStreamTrack(): MediaStreamTrack;
4893
4989
  /** 提供给外部插件以同步数据 */
4894
4990
  _external: ExternalMethods;
4895
4991
  constructor(track: MediaStreamTrack, trackId?: string);
@@ -4907,7 +5003,8 @@ export declare abstract class Track extends EventEmitter implements ITrack {
4907
5003
  export declare enum TrackEvents {
4908
5004
  TRANSCEIVER_UPDATED = "transceiver-updated",
4909
5005
  SEI_TO_SEND = "sei-to-send",
4910
- SEI_RECEIVED = "sei-received"
5006
+ SEI_RECEIVED = "sei-received",
5007
+ TRACK_UPDATED = "track-updated"
4911
5008
  }
4912
5009
 
4913
5010
  /**
@@ -4923,7 +5020,7 @@ export declare enum TrackHint {
4923
5020
  }
4924
5021
 
4925
5022
  export declare enum TrackInternalEvent {
4926
- NEED_RENEGOTIATE = "@need_renegotiate",
5023
+ NEED_RENEGOTIATE = "@need_renegotiate",//deprecated
4927
5024
  NEED_REPLACE_TRACK = "@need_replace_track",
4928
5025
  NEED_REPLACE_MIXING_TRACK = "@need_replace_mixing_track",
4929
5026
  NEED_CLOSE = "@need_close",
@@ -4934,8 +5031,9 @@ export declare enum TrackInternalEvent {
4934
5031
  GET_STATS = "@get_stats",
4935
5032
  GET_RTC_STATS = "@get_rtc_stats",
4936
5033
  GET_LOW_VIDEO_TRACK = "@get_low_video_track",
4937
- NEED_RESET_REMOTE_SDP = "@need_reset_remote_sdp",
5034
+ NEED_RESET_REMOTE_SDP = "@need_reset_remote_sdp",//deprecated
4938
5035
  NEED_UPDATE_VIDEO_ENCODER = "@need_update_video_encoder",
5036
+ NEED_UPDATE_VIDEO_SEND_PARAMETERS = "@need_update_video_send_parameters",
4939
5037
  NEED_MUTE_TRACK = "@need_mute_track",
4940
5038
  NEED_UNMUTE_TRACK = "@need_unmute_track"
4941
5039
  }
@@ -5044,50 +5142,50 @@ export declare interface VideoEncoderConfiguration {
5044
5142
  *
5045
5143
  * 下表列出了 SDK 所有内置的视频属性配置,SDK 默认使用 `"480p_1"`。
5046
5144
  *
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 | ✓ | | ✓ |
5145
+ * | 视频属性 | 分辨率(宽×高) | 帧率(fps) | Chrome | Firefox | Safari |
5146
+ * | -------- | --------------- | ----------- | ------ | ------- | ------ |
5147
+ * | 120p | 160 × 120 | 15 | ✓ | | |
5148
+ * | 120p_1 | 160 × 120 | 15 | ✓ | | |
5149
+ * | 120p_3 | 120 × 120 | 15 | ✓ | | |
5150
+ * | 180p | 320 × 180 | 15 | ✓ | | |
5151
+ * | 180p_1 | 320 × 180 | 15 | ✓ | | |
5152
+ * | 180p_3 | 180 × 180 | 15 | ✓ | | |
5153
+ * | 180p_4 | 240 × 180 | 15 | ✓ | | |
5154
+ * | 240p | 320 × 240 | 15 | ✓ | | |
5155
+ * | 240p_1 | 320 × 240 | 15 | ✓ | | |
5156
+ * | 240p_3 | 240 × 240 | 15 | ✓ | | |
5157
+ * | 240p_4 | 424 × 240 | 15 | ✓ | | |
5158
+ * | 360p | 640 × 360 | 15 | ✓ | | |
5159
+ * | 360p_1 | 640 × 360 | 15 | ✓ | | |
5160
+ * | 360p_3 | 360 × 360 | 15 | ✓ | | |
5161
+ * | 360p_4 | 640 × 360 | 30 | ✓ | | |
5162
+ * | 360p_6 | 360 × 360 | 30 | ✓ | | |
5163
+ * | 360p_7 | 480 × 360 | 15 | ✓ | | |
5164
+ * | 360p_8 | 480 × 360 | 30 | ✓ | | |
5165
+ * | 360p_9 | 640 × 360 | 15 | ✓ | | |
5166
+ * | 360p_10 | 640 × 360 | 24 | ✓ | | |
5167
+ * | 360p_11 | 640 × 360 | 24 | ✓ | | |
5168
+ * | 480p | 640 × 480 | 15 | ✓ | ✓ | ✓ |
5169
+ * | 480p_1 | 640 × 480 | 15 | ✓ | ✓ | ✓ |
5170
+ * | 480p_2 | 640 × 480 | 30 | ✓ | ✓ | ✓ |
5171
+ * | 480p_3 | 480 × 480 | 15 | ✓ | ✓ | ✓ |
5172
+ * | 480p_4 | 640 × 480 | 30 | ✓ | ✓ | ✓ |
5173
+ * | 480p_6 | 480 × 480 | 30 | ✓ | ✓ | ✓ |
5174
+ * | 480p_8 | 848 × 480 | 15 | ✓ | ✓ | ✓ |
5175
+ * | 480p_9 | 848 × 480 | 30 | ✓ | ✓ | ✓ |
5176
+ * | 480p_10 | 640 × 480 | 10 | ✓ | ✓ | ✓ |
5177
+ * | 720p | 1280 × 720 | 15 | ✓ | ✓ | ✓ |
5178
+ * | 720p_1 | 1280 × 720 | 15 | ✓ | ✓ | ✓ |
5179
+ * | 720p_2 | 1280 × 720 | 30 | ✓ | ✓ | ✓ |
5180
+ * | 720p_3 | 1280 × 720 | 30 | ✓ | ✓ | ✓ |
5181
+ * | 720p_auto <sup>①</sup> | 1280 × 720 | 30 |✓ | ✓ | ✓ |
5182
+ * | 720p_5 | 960 × 720 | 15 | ✓ | ✓ | ✓ |
5183
+ * | 720p_6 | 960 × 720 | 30 | ✓ | ✓ | ✓ |
5184
+ * | 1080p | 1920 × 1080 | 15 | ✓ | | ✓ |
5185
+ * | 1080p_1 | 1920 × 1080 | 15 | ✓ | | ✓ |
5186
+ * | 1080p_2 | 1920 × 1080 | 30 | ✓ | | ✓ |
5187
+ * | 1080p_3 | 1920 × 1080 | 30 | ✓ | | ✓ |
5188
+ * | 1080p_5 | 1920 × 1080 | 60 | ✓ | | ✓ |
5091
5189
  *
5092
5190
  * > <sup>①</sup> `"720p_auto"` 仅推荐在 Safari 上设置,用于确保能够动态调整编码分辨率,详见[发版说明](https://doc.shengwang.cn/doc/rtc/javascript/overview/release-notes)。
5093
5191
  *
@@ -5101,50 +5199,50 @@ export declare interface VideoEncoderConfiguration {
5101
5199
  *
5102
5200
  * The following table lists all the preset video profiles. The SDK uses `"480p_1"` by default.
5103
5201
  *
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 | ✓ | | ✓ |
5202
+ * | Video Profile | Resolution (Width×Height) | Frame Rate (fps) | Chrome | Firefox | Safari |
5203
+ * | -------- | --------------- | ----------- | ------ | ------- | ------ |
5204
+ * | 120p | 160 × 120 | 15 | ✓ | | |
5205
+ * | 120p_1 | 160 × 120 | 15 | ✓ | | |
5206
+ * | 120p_3 | 120 × 120 | 15 | ✓ | | |
5207
+ * | 180p | 320 × 180 | 15 | ✓ | | |
5208
+ * | 180p_1 | 320 × 180 | 15 | ✓ | | |
5209
+ * | 180p_3 | 180 × 180 | 15 | ✓ | | |
5210
+ * | 180p_4 | 240 × 180 | 15 | ✓ | | |
5211
+ * | 240p | 320 × 240 | 15 | ✓ | | |
5212
+ * | 240p_1 | 320 × 240 | 15 | ✓ | | |
5213
+ * | 240p_3 | 240 × 240 | 15 | ✓ | | |
5214
+ * | 240p_4 | 424 × 240 | 15 | ✓ | | |
5215
+ * | 360p | 640 × 360 | 15 | ✓ | | |
5216
+ * | 360p_1 | 640 × 360 | 15 | ✓ | | |
5217
+ * | 360p_3 | 360 × 360 | 15 | ✓ | | |
5218
+ * | 360p_4 | 640 × 360 | 30 | ✓ | | |
5219
+ * | 360p_6 | 360 × 360 | 30 | ✓ | | |
5220
+ * | 360p_7 | 480 × 360 | 15 | ✓ | | |
5221
+ * | 360p_8 | 480 × 360 | 30 | ✓ | | |
5222
+ * | 360p_9 | 640 × 360 | 15 | ✓ | | |
5223
+ * | 360p_10 | 640 × 360 | 24 | ✓ | | |
5224
+ * | 360p_11 | 640 × 360 | 24 | ✓ | | |
5225
+ * | 480p | 640 × 480 | 15 | ✓ | ✓ | ✓ |
5226
+ * | 480p_1 | 640 × 480 | 15 | ✓ | ✓ | ✓ |
5227
+ * | 480p_2 | 640 × 480 | 30 | ✓ | ✓ | ✓ |
5228
+ * | 480p_3 | 480 × 480 | 15 | ✓ | ✓ | ✓ |
5229
+ * | 480p_4 | 640 × 480 | 30 | ✓ | ✓ | ✓ |
5230
+ * | 480p_6 | 480 × 480 | 30 | ✓ | ✓ | ✓ |
5231
+ * | 480p_8 | 848 × 480 | 15 | ✓ | ✓ | ✓ |
5232
+ * | 480p_9 | 848 × 480 | 30 | ✓ | ✓ | ✓ |
5233
+ * | 480p_10 | 640 × 480 | 10 | ✓ | ✓ | ✓ |
5234
+ * | 720p | 1280 × 720 | 15 | ✓ | ✓ | ✓ |
5235
+ * | 720p_1 | 1280 × 720 | 15 | ✓ | ✓ | ✓ |
5236
+ * | 720p_2 | 1280 × 720 | 30 | ✓ | ✓ | ✓ |
5237
+ * | 720p_3 | 1280 × 720 | 30 | ✓ | ✓ | ✓ |
5238
+ * | 720p_auto <sup>①</sup> | 1280 × 720 | 30 | ✓ | ✓ | ✓ |
5239
+ * | 720p_5 | 960 × 720 | 15 | ✓ | ✓ | ✓ |
5240
+ * | 720p_6 | 960 × 720 | 30 | ✓ | ✓ | ✓ |
5241
+ * | 1080p | 1920 × 1080 | 15 | ✓ | | ✓ |
5242
+ * | 1080p_1 | 1920 × 1080 | 15 | ✓ | | ✓ |
5243
+ * | 1080p_2 | 1920 × 1080 | 30 | ✓ | | ✓ |
5244
+ * | 1080p_3 | 1920 × 1080 | 30 | ✓ | | ✓ |
5245
+ * | 1080p_5 | 1920 × 1080 | 60 | ✓ | | ✓ |
5148
5246
  *
5149
5247
  * > <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
5248
  */
@@ -5171,6 +5269,8 @@ declare class VideoPlayer {
5171
5269
  protected videoTrack?: MediaStreamTrack;
5172
5270
  protected videoElement: HTMLVideoElement;
5173
5271
  protected cacheVideoElement?: HTMLVideoElement;
5272
+ private renderStats?;
5273
+ get rendFrameRate(): number;
5174
5274
  get videoElementStatus(): MediaElementStatus;
5175
5275
  set videoElementStatus(status: MediaElementStatus);
5176
5276
  get videoState(): VideoState;
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@agora-js/media",
3
- "version": "4.20.2",
3
+ "version": "4.21.0",
4
4
  "description": "media module across @agora-js packages",
5
5
  "main": "AgoraRTC_N-media.js",
6
6
  "module": "AgoraRTC_N-media.esm.mjs",
7
- "types": "media.d.ts",
7
+ "types": "rtc-sdk-media_en.d.ts",
8
8
  "declaration": true,
9
9
  "author": "Agora WebRTC Team",
10
10
  "keywords": [
@@ -23,9 +23,9 @@
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.20.2",
27
- "@agora-js/report": "4.20.2",
28
- "axios": "^1.6.7",
26
+ "@agora-js/shared": "4.21.0",
27
+ "@agora-js/report": "4.21.0",
28
+ "axios": "^1.6.8",
29
29
  "agora-rte-extension": "^1.2.4",
30
30
  "webrtc-adapter": "8.2.0",
31
31
  "pako": "^2.1.0"