@agora-js/media 4.24.0 → 4.24.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
@@ -60,6 +60,10 @@ export declare interface AgoraRTCCompatibility {
60
60
  supportRequestVideoFrameCallback: boolean;
61
61
  /** 是否支持WebCrypto */
62
62
  supportWebCrypto: boolean;
63
+ /** 是否支持限制本地音频播放 */
64
+ supportSuppressLocalAudioPlayback: boolean;
65
+ /** 是否支持限制本地页面声音采集 */
66
+ supportRestrictOwnAudio: boolean;
63
67
  }
64
68
 
65
69
  /**
@@ -262,6 +266,7 @@ declare class AudioElementPlayCenter {
262
266
  updateTrack(trackId: string, track: MediaStreamTrack): void;
263
267
  isPlaying(trackId: string): boolean;
264
268
  setVolume(trackId: string, volume: number): void;
269
+ getVolume(trackId: string): number;
265
270
  stop(trackId: string): void;
266
271
  private bindAudioElementEvents;
267
272
  getPlayerState(trackId: string): string;
@@ -269,7 +274,7 @@ declare class AudioElementPlayCenter {
269
274
  * 监听页面事件,自动恢复音频播放
270
275
  */
271
276
  private autoResumeAudioElement;
272
- autoResumeAfterInterruption: (force?: boolean) => void;
277
+ autoResumeAfterInterruption: (force?: boolean) => Promise<void[]>;
273
278
  private autoResumeAfterInterruptionOnIOS15_16;
274
279
  }
275
280
 
@@ -1287,6 +1292,10 @@ export declare function detectSupportPrePc(store?: SDKStore): boolean;
1287
1292
  */
1288
1293
  export declare function detectSupportPreSub(store?: SDKStore): boolean;
1289
1294
 
1295
+ export declare function detectSupportRestrictOwnAudio(): boolean;
1296
+
1297
+ export declare function detectSupportSuppressLocalAudioPlayback(): boolean;
1298
+
1290
1299
  /**
1291
1300
  * 音视频采集设备的信息。
1292
1301
  *
@@ -1450,7 +1459,7 @@ declare function event_first_frame_decoded(): void;
1450
1459
  * @自从
1451
1460
  * <br>&emsp;&emsp;&emsp;*4.20.1*
1452
1461
  *
1453
- * 从 H.264 视频流中解析出 SEI 数据时触发,此事件会返回 SEI 数据。
1462
+ * 从 H.264 或 H.265 视频流中解析出 SEI 数据时触发,此事件会返回 SEI 数据。
1454
1463
  *
1455
1464
  * @param sei Uint8Array 类型的 SEI 数据
1456
1465
  * @asMemberOf ILocalVideoTrack
@@ -1460,7 +1469,7 @@ declare function event_first_frame_decoded(): void;
1460
1469
  * @since
1461
1470
  * <br>&emsp;&emsp;&emsp;*4.20.1*
1462
1471
  *
1463
- * Parsing SEI data from the H.264 video stream triggers this event, which returns the SEI data.
1472
+ * Parsing SEI data from the H.264 or H.265 video stream triggers this event, which returns the SEI data.
1464
1473
  *
1465
1474
  * @param sei SEI data in Uint8Array
1466
1475
  * @asMemberOf ILocalVideoTrack
@@ -1710,7 +1719,7 @@ declare class FakeTrackSource extends EventEmitter {
1710
1719
  createMediaStreamSourceNode(): undefined;
1711
1720
  }
1712
1721
 
1713
- export declare const frameData2CryptoBuffer: (imageData: ImageTypedData, appid: string, channelName: string) => Promise<Uint8Array<ArrayBufferLike>>;
1722
+ export declare const frameData2CryptoBuffer: (imageData: ImageTypedData, appid: string, channelName: string) => Promise<Uint8Array>;
1714
1723
 
1715
1724
  export declare function getAudioContext(): AudioContext;
1716
1725
 
@@ -1734,7 +1743,10 @@ export declare function getConstraintsFromCameraConfig(config: CameraVideoTrackI
1734
1743
 
1735
1744
  export declare function getConstraintsFromMicrophoneConfig(config: MicrophoneAudioTrackInitConfig): MediaTrackConstraints;
1736
1745
 
1737
- export declare function getConstraintsFromScreenAudioConfig(config: ScreenAudioTrackInitConfig): MediaTrackConstraints;
1746
+ export declare function getConstraintsFromScreenAudioConfig(config: ScreenAudioTrackInitConfig): MediaTrackConstraints & {
1747
+ suppressLocalAudioPlayback?: boolean;
1748
+ restrictOwnAudio?: boolean;
1749
+ };
1738
1750
 
1739
1751
  export declare function getConstraintsFromScreenConfig(config: ScreenVideoTrackInitConfig): ScreenConstraintsWithElectron;
1740
1752
 
@@ -1820,6 +1832,8 @@ export declare let HAS_GUM_VIDEO: boolean;
1820
1832
 
1821
1833
  export declare function hasAudioContext(): boolean;
1822
1834
 
1835
+ export declare function hasMicrophoneTrack(): boolean;
1836
+
1823
1837
  /**
1824
1838
  * 直接通过音频数据源创建的音频轨道,继承于 [LocalAudioTrack]{@link ILocalAudioTrack}, 在此之上提供了控制音频数据处理流程的功能(开始/暂停/跳转等等)。
1825
1839
  *
@@ -2116,6 +2130,15 @@ declare interface IDataStream {
2116
2130
  deserialize: (packet: ArrayBuffer) => ArrayBuffer;
2117
2131
  }
2118
2132
 
2133
+ export declare interface IFrameInfo {
2134
+ type: string;
2135
+ rtpTimestamp: number;
2136
+ payloadType: number;
2137
+ ssrc: number;
2138
+ length: number;
2139
+ mimeType?: string;
2140
+ }
2141
+
2119
2142
  /**
2120
2143
  * 基础本地音频轨道,提供了本地音频轨道的主要功能。
2121
2144
  *
@@ -2418,7 +2441,7 @@ export declare interface ILocalTrack extends ITrack {
2418
2441
  * 发送或暂停发送该轨道的媒体数据。
2419
2442
  *
2420
2443
  * @自从
2421
- * <br>&emsp;&emsp;&emsp;*4.6.0*
2444
+ * <br>&emsp;&emsp;&emsp;*4.0.0*
2422
2445
  *
2423
2446
  * 如果该轨道已发布,调用 `setMuted(true)` 后,远端会触发 [user-unpublished]{@link IAgoraRTCClient.event_user_unpublished} 事件。再调用 `setMuted(false)` 后,远端会触发 [user-published]{@link IAgoraRTCClient.event_user_published} 事件。
2424
2447
  *
@@ -2433,11 +2456,11 @@ export declare interface ILocalTrack extends ITrack {
2433
2456
  * Sends or stops sending the media data of the track.
2434
2457
  *
2435
2458
  * @since
2436
- * <br>&emsp;&emsp;&emsp;*4.6.0*
2459
+ * <br>&emsp;&emsp;&emsp;*4.0.0*
2437
2460
  *
2438
2461
  * If the track is published, a successful call of `setMuted(true)` triggers the [user-unpublished]{@link IAgoraRTCClient.event_user_unpublished} event on the remote client, and a successful call of `setMuted(false)` triggers the [user-published]{@link IAgoraRTCClient.event_user_published} event.
2439
2462
  *
2440
- * > - Calling `setMuted(true)` does not stop capturing audio or video and takes shorter time to take effect than [[setEnabled]]. For details, see [What are the differences between setEnabled and setMuted?](https://docs.agora.io/en/interactive-live-streaming/develop/product-workflow?platform=web#setenabled-and-setmuted).
2463
+ * > - Calling `setMuted(true)` does not stop capturing audio or video and takes shorter time to take effect than [[setEnabled]]. For details, see [What are the differences between setEnabled and setMuted?](https://docs.agora.io/en/help/integration-issues/set_enabled_set_muted).
2441
2464
  * > - Do not call `setEnabled` and `setMuted` together.
2442
2465
  *
2443
2466
  * @param muted Whether to stop sending the media data of the track:
@@ -2948,6 +2971,7 @@ export declare function interceptRemoteVideoFrame(receiver: RTCRtpReceiver, opti
2948
2971
 
2949
2972
  export declare interface InterceptVideoFrameOptions {
2950
2973
  onSei?: (sei: Uint8Array) => void;
2974
+ onFirstFrame?: (frameInfo: IFrameInfo) => void;
2951
2975
  }
2952
2976
 
2953
2977
  /**
@@ -3061,6 +3085,7 @@ export declare interface IRemoteAudioTrack extends IRemoteTrack {
3061
3085
  * @param volume The volume. The value ranges from 0 (mute) to 100 (maximum). A value of 100 is the current volume.
3062
3086
  */
3063
3087
  setVolume(volume: number): void;
3088
+ setAmplifiedVolume(volume: number): void;
3064
3089
  /**
3065
3090
  * 获取远端音频轨道的音量等级。
3066
3091
  *
@@ -3073,6 +3098,7 @@ export declare interface IRemoteAudioTrack extends IRemoteTrack {
3073
3098
  * Usually a user with audio level above 0.6 is a speaking user.
3074
3099
  */
3075
3100
  getVolumeLevel(): number;
3101
+ getVolume(): number;
3076
3102
  /**
3077
3103
  * @自从
3078
3104
  * <br>&emsp;&emsp;&emsp;*4.13.0*
@@ -3394,6 +3420,17 @@ export declare interface IRemoteVideoTrack extends IRemoteTrack {
3394
3420
  * The destination of the current processing pipeline on the remote video track.
3395
3421
  */
3396
3422
  processorDestination: IBaseProcessor;
3423
+ /**
3424
+ * 停止播放。
3425
+ * @param isKeepLastFrame 是否保留最后一帧。
3426
+ * @internal
3427
+ */
3428
+ /** @en
3429
+ * Stops playing the media track.
3430
+ * @param isKeepLastFrame Whether to keep the last frame.
3431
+ * @internal
3432
+ */
3433
+ stop(isKeepLastFrame?: boolean): void;
3397
3434
  }
3398
3435
 
3399
3436
  export declare function isAudioEncoderConfiguration(config: AudioEncoderConfiguration): config is AudioEncoderConfiguration;
@@ -4182,8 +4219,10 @@ export declare class RemoteAudioTrack extends RemoteTrack implements IRemoteAudi
4182
4219
  constructor(track: MediaStreamTrack, userId: UID, uintId: number, store: SDKStore);
4183
4220
  setAudioFrameCallback(callback: null | ((buffer: AudioBuffer) => void), frameSize?: number): void;
4184
4221
  setVolume(volume: number): void;
4222
+ setAmplifiedVolume(volume: number): void;
4185
4223
  setPlaybackDevice(deviceId: string): Promise<void>;
4186
4224
  getVolumeLevel(): number;
4225
+ getVolume(): number;
4187
4226
  getStats(): RemoteAudioTrackStats;
4188
4227
  play(): void;
4189
4228
  stop(): void;
@@ -4471,7 +4510,7 @@ export declare class RemoteVideoTrack extends RemoteTrack implements IRemoteVide
4471
4510
  constructor(track: MediaStreamTrack, userId: UID, uintId: number, store: SDKStore, player?: AgoraRTCPlayer);
4472
4511
  getStats(): RemoteVideoTrackStats;
4473
4512
  play(element: string | HTMLElement | HTMLVideoElement, config?: VideoPlayerConfig): void;
4474
- stop(): void;
4513
+ stop(isKeepLastFrame?: boolean): void;
4475
4514
  getCurrentFrameData(): ImageData;
4476
4515
  updateMediaStreamTrackResolution(): void;
4477
4516
  protected _updatePlayerSource(): void;
@@ -4665,6 +4704,8 @@ export declare interface Resolution {
4665
4704
  height: number;
4666
4705
  }
4667
4706
 
4707
+ export declare function restartBackgroundTag(): void;
4708
+
4668
4709
  /**
4669
4710
  * 全局 getUserMedia 锁,确保每次 GUM 时上一个 GUM 已经完成
4670
4711
  *
@@ -4680,7 +4721,90 @@ export declare const SAFARI_GLOBAL_GUM_LOCK: PromiseMutex;
4680
4721
  /** @en
4681
4722
  * Configurations for the audio track of screen sharing. Set these configurations when calling [AgoraRTC.createScreenVideoTrack]{@link IAgoraRTC.createScreenVideoTrack} to enable audio during screen sharing.
4682
4723
  */
4683
- export declare type ScreenAudioTrackInitConfig = AudioTrackInitConfig;
4724
+ export declare type ScreenAudioTrackInitConfig = {
4725
+ /**
4726
+ * 是否开启回声消除:
4727
+ * - `true`: 开启回声消除。
4728
+ * - `false`: 不开启回声消除。
4729
+ */
4730
+ /** @en
4731
+ * Whether to enable acoustic echo cancellation:
4732
+ * - `true`: Enable acoustic echo cancellation.
4733
+ * - `false`: Do not enable acoustic echo cancellation.
4734
+ */
4735
+ AEC?: boolean;
4736
+ /**
4737
+ * 是否开启自动增益:
4738
+ * - `true`: 开启自动增益。
4739
+ * - `false`: 不开启自动增益。
4740
+ */
4741
+ /** @en
4742
+ * Whether to enable audio gain control:
4743
+ * - `true`: Enable audio gain control.
4744
+ * - `false`: Do not enable audio gain control.
4745
+ */
4746
+ AGC?: boolean;
4747
+ /**
4748
+ * 是否开启噪声抑制:
4749
+ * - `true`: 开启噪声抑制。
4750
+ * - `false`: 不开启噪声抑制。
4751
+ */
4752
+ /** @en
4753
+ * Whether to enable automatic noise suppression:
4754
+ * - `true`: Enable automatic noise suppression.
4755
+ * - `false`: Do not enable automatic noise suppression.
4756
+ */
4757
+ ANS?: boolean;
4758
+ /**
4759
+ * @自从
4760
+ * <br>&emsp;&emsp;&emsp;*4.24.1*</br>
4761
+ *
4762
+ * 是否禁止本地播放音频。
4763
+ * - `true`:禁止本地播放音频。
4764
+ * - `false`:(默认) 允许本地播放音频。
4765
+ *
4766
+ * 详见 [suppressLocalAudioPlayback](https://developer.mozilla.org/en-US/docs/Web/API/MediaTrackSupportedConstraints/suppressLocalAudioPlayback)。
4767
+ *
4768
+ * > 该参数仅支持 Chrome 109 及以上、Edge 109 及以上和 Opera 95 及以上。
4769
+ */
4770
+ /** @en
4771
+ * @since
4772
+ * <br>&emsp;&emsp;&emsp;*4.24.1*</br>
4773
+ *
4774
+ * Whether to suppress local audio playback.
4775
+ * - `true`: Suppress local audio playback.
4776
+ * - `false`: (Default) Do not suppress local audio playback.
4777
+ *
4778
+ * See [suppressLocalAudioPlayback](https://developer.mozilla.org/en-US/docs/Web/API/MediaTrackSupportedConstraints/suppressLocalAudioPlayback) for details.
4779
+ *
4780
+ * > This parameter is supported on Chrome 109 and later, Edge 109 and later, and Opera 95 and later.
4781
+ */
4782
+ suppressLocalAudioPlayback?: boolean;
4783
+ /**
4784
+ * @自从
4785
+ * <br>&emsp;&emsp;&emsp;*4.24.1*</br>
4786
+ *
4787
+ * 是否禁止本地页面声音采集。
4788
+ * - `true`:禁止本地页面声音采集。
4789
+ * - `false`:(默认) 允许本地页面声音采集。
4790
+ * 详见 [restrictOwnAudio](https://developer.mozilla.org/en-US/docs/Web/API/MediaTrackSupportedConstraints/restrictOwnAudio)。
4791
+ *
4792
+ * > 该参数仅支持 Chrome 141 及以上、Edge 141 及以上和 Opera 125 及以上。
4793
+ */
4794
+ /** @en
4795
+ * @since
4796
+ * <br>&emsp;&emsp;&emsp;*4.24.1*</br>
4797
+ *
4798
+ * Whether to restrict local audio capture.
4799
+ * - `true`: Restrict local audio capture.
4800
+ * - `false`: (Default) Do not restrict local audio capture.
4801
+ *
4802
+ * See [restrictOwnAudio](https://developer.mozilla.org/en-US/docs/Web/API/MediaTrackSupportedConstraints/restrictOwnAudio) for details.
4803
+ *
4804
+ * > This parameter is supported on Chrome 141 and later, Edge 141 and later, and Opera 125 and later.
4805
+ */
4806
+ restrictOwnAudio?: boolean;
4807
+ };
4684
4808
 
4685
4809
  export declare interface ScreenConstraintsWithElectron extends MediaTrackConstraints {
4686
4810
  /**
@@ -4711,10 +4835,23 @@ export declare interface ScreenConstraintsWithElectron extends MediaTrackConstra
4711
4835
  selfBrowserSurface?: "include" | "exclude";
4712
4836
  /** 是否允许tag切换分享, 默认允许include, Chrome 107以上 Opera 93以上*/
4713
4837
  surfaceSwitching?: "include" | "exclude";
4714
- /** 是否开启系统音频,默认开启include, Chrome 105以上, Opera 91以上 */
4838
+ /** 是否开启系统音频,默认开启include, Chrome 105以上, Opera 91以上
4839
+ */
4715
4840
  systemAudio?: "include" | "exclude";
4716
4841
  /** 是否默认分享当前页面,默认为false, Chrome 94以上, Opera 80以上 */
4717
4842
  preferCurrentTab?: boolean;
4843
+ /**
4844
+ * link https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getDisplayMedia#monitortypesurfaces
4845
+ * 决定 是否 允许分享整个屏幕。默认include, 允许分享整个屏幕, Chrome 119 以上支持
4846
+ */
4847
+ monitorTypeSurfaces?: "exclude" | "include";
4848
+ /**
4849
+ * 决定 是否 允许分享窗口音频, window 表示分享窗口音频,system 表示分享系统音频,
4850
+ * 注意:
4851
+ * 1. window 这个选项暂时不支持,所以 对外,只支持 exclude / system
4852
+ * 2. Chrome 141 以上支持此字段,但表现不一,Chrome 141 设置 window,实际展示 systemAudio, 142+ 设置 window,实际展示 exclude
4853
+ */
4854
+ windowAudio?: "exclude" | "system";
4718
4855
  }
4719
4856
 
4720
4857
  /**
@@ -5025,6 +5162,55 @@ export declare interface ScreenVideoTrackInitConfig {
5025
5162
  * > Note: This property is only supported in Chrome 94 and above, and Opera 80 and above..
5026
5163
  */
5027
5164
  preferCurrentTab?: boolean;
5165
+ /**
5166
+ * @自从
5167
+ * <br>&emsp;&emsp;&emsp;*4.24.1*</br>
5168
+ *
5169
+ * 共享窗口时是否允许分享窗口音频。
5170
+ * - `"exclude"`:不分享任何音频。
5171
+ * - `"system"`:(默认)分享所有系统音频。
5172
+ *
5173
+ * 详见 [withAudio](https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getDisplayMedia#windowAudio)。
5174
+ */
5175
+ /** @en
5176
+ * @since
5177
+ * <br>&emsp;&emsp;&emsp;*4.24.1*</br>
5178
+ *
5179
+ * Whether to allow sharing window audio.
5180
+ * - `"exclude"`: Do not share any audio.
5181
+ * - `"system"`: (Default) Share system audio.
5182
+ *
5183
+ * See [withAudio](https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getDisplayMedia#windowAudio) for details.
5184
+ */
5185
+ windowAudio?: "exclude" | "system";
5186
+ /**
5187
+ * @自从
5188
+ * <br>&emsp;&emsp;&emsp;*4.24.1*</br>
5189
+ *
5190
+ * 是否允许分享整个屏幕,包括浏览器页签和窗口选项。
5191
+ * - `"exclude"`: 不分享整个屏幕。
5192
+ * - `"include"`: (默认)分享整个屏幕。
5193
+ *
5194
+ * 详见 [monitorTypeSurfaces](https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getDisplayMedia#monitortypesurfaces)。
5195
+ *
5196
+ * > - 该参数仅支持 Chrome 119 及以上。
5197
+ * > - 如果将 `monitorTypeSurface` 设为 `exclude`,则无法将 `displaySurface` 设为 `monitor`,否则会报错。
5198
+ *
5199
+ */
5200
+ /** @en
5201
+ * @since
5202
+ * <br>&emsp;&emsp;&emsp;*4.24.1*</br>
5203
+ *
5204
+ * Whether to allow sharing the entire screen, including the browser tab and window options.
5205
+ * - `"exclude"`: Do not share the entire screen.
5206
+ * - `"include"`: Share the entire screen.
5207
+ *
5208
+ * See [monitorTypeSurfaces](https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getDisplayMedia#monitortypesurfaces) for details.
5209
+ *
5210
+ * > - This parameter is supported on Chrome 119 and later.
5211
+ * > - If you set `monitorTypeSurface` to `exclude`, you cannot set `displaySurface` to `monitor`; otherwise, an error will occur.
5212
+ */
5213
+ monitorTypeSurfaces?: "exclude" | "include";
5028
5214
  }
5029
5215
 
5030
5216
  export declare type SenderConfig = {
@@ -5327,54 +5513,7 @@ export declare interface VideoEncoderConfiguration {
5327
5513
  *
5328
5514
  * 你可以在 [AgoraRTC.createCameraVideoTrack]{@link IAgoraRTC.createCameraVideoTrack} 方法中传入预设的视频编码配置。
5329
5515
  *
5330
- * 下表列出了 SDK 所有内置的视频属性配置,SDK 默认使用 `"480p_1"`。
5331
- *
5332
- * | 视频属性 | 分辨率(宽×高) | 帧率(fps) | Chrome | Firefox | Safari |
5333
- * | -------- | --------------- | ----------- | ------ | ------- | ------ |
5334
- * | 120p | 160 × 120 | 15 | ✓ | | |
5335
- * | 120p_1 | 160 × 120 | 15 | ✓ | | |
5336
- * | 120p_3 | 120 × 120 | 15 | ✓ | | |
5337
- * | 180p | 320 × 180 | 15 | ✓ | | |
5338
- * | 180p_1 | 320 × 180 | 15 | ✓ | | |
5339
- * | 180p_3 | 180 × 180 | 15 | ✓ | | |
5340
- * | 180p_4 | 240 × 180 | 15 | ✓ | | |
5341
- * | 240p | 320 × 240 | 15 | ✓ | | |
5342
- * | 240p_1 | 320 × 240 | 15 | ✓ | | |
5343
- * | 240p_3 | 240 × 240 | 15 | ✓ | | |
5344
- * | 240p_4 | 424 × 240 | 15 | ✓ | | |
5345
- * | 360p | 640 × 360 | 15 | ✓ | | |
5346
- * | 360p_1 | 640 × 360 | 15 | ✓ | | |
5347
- * | 360p_3 | 360 × 360 | 15 | ✓ | | |
5348
- * | 360p_4 | 640 × 360 | 30 | ✓ | | |
5349
- * | 360p_6 | 360 × 360 | 30 | ✓ | | |
5350
- * | 360p_7 | 480 × 360 | 15 | ✓ | | |
5351
- * | 360p_8 | 480 × 360 | 30 | ✓ | | |
5352
- * | 360p_9 | 640 × 360 | 15 | ✓ | | |
5353
- * | 360p_10 | 640 × 360 | 24 | ✓ | | |
5354
- * | 360p_11 | 640 × 360 | 24 | ✓ | | |
5355
- * | 480p | 640 × 480 | 15 | ✓ | ✓ | ✓ |
5356
- * | 480p_1 | 640 × 480 | 15 | ✓ | ✓ | ✓ |
5357
- * | 480p_2 | 640 × 480 | 30 | ✓ | ✓ | ✓ |
5358
- * | 480p_3 | 480 × 480 | 15 | ✓ | ✓ | ✓ |
5359
- * | 480p_4 | 640 × 480 | 30 | ✓ | ✓ | ✓ |
5360
- * | 480p_6 | 480 × 480 | 30 | ✓ | ✓ | ✓ |
5361
- * | 480p_8 | 848 × 480 | 15 | ✓ | ✓ | ✓ |
5362
- * | 480p_9 | 848 × 480 | 30 | ✓ | ✓ | ✓ |
5363
- * | 480p_10 | 640 × 480 | 10 | ✓ | ✓ | ✓ |
5364
- * | 720p | 1280 × 720 | 15 | ✓ | ✓ | ✓ |
5365
- * | 720p_1 | 1280 × 720 | 15 | ✓ | ✓ | ✓ |
5366
- * | 720p_2 | 1280 × 720 | 30 | ✓ | ✓ | ✓ |
5367
- * | 720p_3 | 1280 × 720 | 30 | ✓ | ✓ | ✓ |
5368
- * | 720p_auto <sup>①</sup> | 1280 × 720 | 30 |✓ | ✓ | ✓ |
5369
- * | 720p_5 | 960 × 720 | 15 | ✓ | ✓ | ✓ |
5370
- * | 720p_6 | 960 × 720 | 30 | ✓ | ✓ | ✓ |
5371
- * | 1080p | 1920 × 1080 | 15 | ✓ | | ✓ |
5372
- * | 1080p_1 | 1920 × 1080 | 15 | ✓ | | ✓ |
5373
- * | 1080p_2 | 1920 × 1080 | 30 | ✓ | | ✓ |
5374
- * | 1080p_3 | 1920 × 1080 | 30 | ✓ | | ✓ |
5375
- * | 1080p_5 | 1920 × 1080 | 60 | ✓ | | ✓ |
5376
- *
5377
- * > <sup>①</sup> `"720p_auto"` 仅推荐在 Safari 上设置,用于确保能够动态调整编码分辨率,详见[发版说明](https://doc.shengwang.cn/doc/rtc/javascript/overview/release-notes)。
5516
+ * SDK 支持预设的视频属性,以及在各浏览器上的支持情况,请参考[设置视频编码属性](https://doc.shengwang.cn/doc/rtc/javascript/basic-features/video-profile#preset-video-profiles)。
5378
5517
  *
5379
5518
  * @public
5380
5519
  */
@@ -5389,14 +5528,14 @@ export declare interface VideoEncoderConfiguration {
5389
5528
  * | Video Profile | Resolution (Width×Height) | Frame Rate (fps) | Chrome | Firefox | Safari |
5390
5529
  * | -------- | --------------- | ----------- | ------ | ------- | ------ |
5391
5530
  * | 120p | 160 × 120 | 15 | ✓ | | |
5392
- * | 120p_1 | 160 × 120 | 15 | ✓ | | |
5531
+ * | 120p_1 | 160 × 120 | 15 | ✓ | ||
5393
5532
  * | 120p_3 | 120 × 120 | 15 | ✓ | | |
5394
5533
  * | 180p | 320 × 180 | 15 | ✓ | | |
5395
5534
  * | 180p_1 | 320 × 180 | 15 | ✓ | | |
5396
5535
  * | 180p_3 | 180 × 180 | 15 | ✓ | | |
5397
- * | 180p_4 | 240 × 180 | 15 | ✓ | | |
5536
+ * | 180p_4 | 240 × 180 | 15 | ✓ | ||
5398
5537
  * | 240p | 320 × 240 | 15 | ✓ | | |
5399
- * | 240p_1 | 320 × 240 | 15 | ✓ | | |
5538
+ * | 240p_1 | 320 × 240 | 15 | ✓ | ||
5400
5539
  * | 240p_3 | 240 × 240 | 15 | ✓ | | |
5401
5540
  * | 240p_4 | 424 × 240 | 15 | ✓ | | |
5402
5541
  * | 360p | 640 × 360 | 15 | ✓ | | |
@@ -5404,7 +5543,7 @@ export declare interface VideoEncoderConfiguration {
5404
5543
  * | 360p_3 | 360 × 360 | 15 | ✓ | | |
5405
5544
  * | 360p_4 | 640 × 360 | 30 | ✓ | | |
5406
5545
  * | 360p_6 | 360 × 360 | 30 | ✓ | | |
5407
- * | 360p_7 | 480 × 360 | 15 | ✓ | | |
5546
+ * | 360p_7 | 480 × 360 | 15 | ✓ | ||
5408
5547
  * | 360p_8 | 480 × 360 | 30 | ✓ | | |
5409
5548
  * | 360p_9 | 640 × 360 | 15 | ✓ | | |
5410
5549
  * | 360p_10 | 640 × 360 | 24 | ✓ | | |
@@ -5443,6 +5582,7 @@ declare class VideoPlayer {
5443
5582
  config: PlayerConfig;
5444
5583
  onFirstVideoFrameDecoded?: () => void;
5445
5584
  onFirstVideoFrameRender?: () => void;
5585
+ onVideoBufferReady?: () => void;
5446
5586
  onVideoStateChanged?: (state: VideoState) => void;
5447
5587
  freezeTimeCounterList: number[];
5448
5588
  renderFreezeAccTime: number;
@@ -5459,6 +5599,7 @@ declare class VideoPlayer {
5459
5599
  protected videoTrack?: MediaStreamTrack;
5460
5600
  protected videoElement: HTMLVideoElement;
5461
5601
  protected cacheVideoElement?: HTMLVideoElement;
5602
+ protected cancelRVFId?: number;
5462
5603
  protected internal: boolean;
5463
5604
  get rendFrameRate(): number;
5464
5605
  get videoElementStatus(): MediaElementStatus;
@@ -5481,7 +5622,7 @@ declare class VideoPlayer {
5481
5622
  play(sessionId?: string): void;
5482
5623
  getCurrentFrame(): ImageData;
5483
5624
  getCurrentFrameToUint8Array(type: string, quality?: number): Promise<ImageTypedData>;
5484
- destroy(): void;
5625
+ destroy(isKeepLastFrame?: boolean): void;
5485
5626
  protected initVideoElement(): void;
5486
5627
  protected resetVideoElement(): void;
5487
5628
  private startGetVideoDimensions;
@@ -5539,6 +5680,15 @@ export declare interface VideoPlayerConfig {
5539
5680
  * > - When playing the remote video track, the SDK uses cover mode by default.
5540
5681
  */
5541
5682
  fit?: "cover" | "contain" | "fill";
5683
+ /**
5684
+ * 是否不使用样式
5685
+ * @ignore
5686
+ */
5687
+ /** @en
5688
+ * Whether to use the style
5689
+ * @ignore
5690
+ */
5691
+ noStyle?: boolean;
5542
5692
  }
5543
5693
 
5544
5694
  export declare class VideoProcessorContext extends EventEmitter implements IProcessorContext {
@@ -5617,10 +5767,14 @@ export declare enum VideoState {
5617
5767
  declare class VisibilityWatcher extends EventEmitter {
5618
5768
  private _lastHiddenTime;
5619
5769
  private _lastVisibleTime;
5770
+ needUploadStats: number[];
5771
+ isCollectingStats: boolean;
5620
5772
  get visibility(): DocumentVisibilityState;
5621
5773
  get lastHiddenTime(): DOMHighResTimeStamp;
5622
5774
  get lastVisibleTime(): DOMHighResTimeStamp;
5623
5775
  constructor();
5776
+ startCollectStats(): void;
5777
+ stopCollectStats(): void;
5624
5778
  }
5625
5779
 
5626
5780
  export declare const visibilityWatcher: VisibilityWatcher;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agora-js/media",
3
- "version": "4.24.0",
3
+ "version": "4.24.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,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.24.0",
27
- "@agora-js/report": "4.24.0",
28
- "axios": "^1.8.3",
26
+ "@agora-js/shared": "4.24.1",
27
+ "@agora-js/report": "4.24.1",
28
+ "axios": "^1.13.2",
29
29
  "agora-rte-extension": "^1.2.4",
30
30
  "webrtc-adapter": "8.2.0"
31
31
  }