@agora-js/media 4.19.3 → 4.20.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
@@ -265,7 +265,7 @@ declare class AudioElementPlayCenter {
265
265
  * 监听页面事件,自动恢复音频播放
266
266
  */
267
267
  private autoResumeAudioElement;
268
- private autoResumeAfterInterruption;
268
+ autoResumeAfterInterruption: (force?: boolean) => void;
269
269
  private autoResumeAfterInterruptionOnIOS15_16;
270
270
  }
271
271
 
@@ -1354,6 +1354,28 @@ declare function event_beauty_effect_overload(): void;
1354
1354
  */
1355
1355
  declare function event_first_frame_decoded(): void;
1356
1356
 
1357
+ /**
1358
+ * **自从**
1359
+ * <br>&emsp;&emsp;&emsp;*4.20.1*
1360
+ *
1361
+ * 从 H.264 视频流中解析出 SEI 数据时触发,此事件会返回 SEI 数据。
1362
+ *
1363
+ * @param sei Uint8Array 类型的 SEI 数据
1364
+ * @asMemberOf ILocalVideoTrack
1365
+ * @event
1366
+ */
1367
+ /** @en
1368
+ * **Since**
1369
+ * <br>&emsp;&emsp;&emsp;*4.20.1*
1370
+ *
1371
+ * Parsing SEI data from the H.264 video stream triggers this event, which returns the SEI data.
1372
+ *
1373
+ * @param sei SEI data in Uint8Array
1374
+ * @asMemberOf ILocalVideoTrack
1375
+ * @event
1376
+ */
1377
+ declare function event_sei_received(sei: Uint8Array): void;
1378
+
1357
1379
  /**
1358
1380
  * 当 [BufferSourceAudioTrack]{@link IBufferSourceAudioTrack} 的音频数据源处理状态变化时,会触发此事件。
1359
1381
  *
@@ -1533,6 +1555,20 @@ declare function event_video_element_visible_status(data?: CheckVideoVisibleResu
1533
1555
  */
1534
1556
  declare function event_video_element_visible_status_2(data?: CheckVideoVisibleResult): void;
1535
1557
 
1558
+ /**
1559
+ * 视频状态发生变化时触发。
1560
+ *
1561
+ * @event
1562
+ * @asMemberOf IRemoteTrack
1563
+ */
1564
+ /** @en
1565
+ * Occurs when the video state changes.
1566
+ *
1567
+ * @event
1568
+ * @asMemberOf IRemoteTrack
1569
+ */
1570
+ declare function event_video_state_changed(videoState: VideoState): void;
1571
+
1536
1572
  export declare interface ExtendedVideoFrameCallbackMetadata extends VideoFrameCallbackMetadata {
1537
1573
  timestamp: DOMHighResTimeStamp;
1538
1574
  }
@@ -1576,7 +1612,7 @@ export declare function getAudioContext(): AudioContext;
1576
1612
 
1577
1613
  export declare function getAudioEncoderConfiguration(profile: AudioEncoderConfigurationPreset | AudioEncoderConfiguration): AudioEncoderConfiguration;
1578
1614
 
1579
- export declare function getBitrateFromResAndFps(width: number, height: number, fps: number, bitrateAdapterType: "STANDARD_BITRATE" | "COMPATIABLE_BITRATE"): [number, number] | void;
1615
+ export declare function getBitrateConstrainRange(width: number, height: number, frameRate: number, bitrateMin?: number, bitrateMax?: number): DoubleRange;
1580
1616
 
1581
1617
  export declare function getCompatibility(): AgoraRTCCompatibility;
1582
1618
 
@@ -2034,7 +2070,6 @@ export declare interface ILocalAudioTrack extends ILocalTrack {
2034
2070
  *
2035
2071
  * > 注意事项:
2036
2072
  * > - 自 v4.7.0 起,该方法不再生效。请改用 [IRemoteAudioTrack.setPlaybackDevice]{@link IRemoteAudioTrack.setPlaybackDevice}。
2037
- * > - 该方法只支持桌面端的 Chrome 浏览器,其他浏览器调用将会抛出 `NOT_SUPPORTED` 错误。
2038
2073
  *
2039
2074
  * 设置本地播放远端音频流的设备(扬声器)。
2040
2075
  *
@@ -2046,7 +2081,6 @@ export declare interface ILocalAudioTrack extends ILocalTrack {
2046
2081
  *
2047
2082
  * > Note:
2048
2083
  * > - As of v4.7.0, this method no longer takes effect. Use [IRemoteAudioTrack.setPlaybackDevice]{@link IRemoteAudioTrack.setPlaybackDevice} instead.
2049
- * > - This method supports Chrome on desktop devices only. Other browsers throw a '`NOT_SUPPORTED` error when calling this method.
2050
2084
  *
2051
2085
  * Sets the playback device (speaker) for the remote audio stream.
2052
2086
  *
@@ -2144,12 +2178,12 @@ export declare interface ILocalTrack extends ITrack {
2144
2178
  /**
2145
2179
  * 添加事件监听器。
2146
2180
  * @param event 事件名称。
2147
- * @param listener 详见 [transceiver-updated]{@link event_transceiver_updated}。
2181
+ * @param listener 详见 [ILocalTrack.transceiver-updated]{@link event_transceiver_updated}。
2148
2182
  */
2149
2183
  /** @en
2150
2184
  * Adds an event listener.
2151
2185
  * @param event The event name.
2152
- * @param listener See [transceiver-updated]{@link event_transceiver_updated}.
2186
+ * @param listener See [ILocalTrack.transceiver-updated]{@link event_transceiver_updated}.
2153
2187
  */
2154
2188
  on(event: "transceiver-updated", listener: typeof event_transceiver_updated): void;
2155
2189
  /**
@@ -2241,7 +2275,7 @@ export declare interface ILocalTrack extends ITrack {
2241
2275
  *
2242
2276
  * 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.
2243
2277
  *
2244
- * > - 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%20Broadcast/faq/differences_between_setenabled_and_setmuted).
2278
+ * > - 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).
2245
2279
  * > - Do not call `setEnabled` and `setMuted` together.
2246
2280
  *
2247
2281
  * @param muted Whether to stop sending the media data of the track:
@@ -2308,16 +2342,16 @@ export declare interface ILocalVideoTrack extends ILocalTrack {
2308
2342
  /**
2309
2343
  * 添加事件监听器。
2310
2344
  * @param event 事件名称。
2311
- * @param listener 详见 [transceiver-updated]{@link event_transceiver_updated}。
2345
+ * @param listener 详见 [ILocalTrack.transceiver-updated]{@link event_transceiver_updated}。
2312
2346
  */
2313
2347
  /** @en
2314
2348
  * Adds an event listener.
2315
2349
  * @param event The event name.
2316
- * @param listener See [transceiver-updated]{@link event_transceiver_updated}.
2350
+ * @param listener See [ILocalTrack.transceiver-updated]{@link event_transceiver_updated}.
2317
2351
  */
2318
2352
  on(event: "transceiver-updated", listener: typeof event_transceiver_updated): void;
2319
2353
  /**
2320
- * 在页面上播放本地视频轨道。
2354
+ * 在页面上播放远端视频轨道。
2321
2355
  *
2322
2356
  * @param element 指定一个 DOM 元素,SDK 将在这个元素下创建 `<video>` 元素播放视频轨道,支持 2 种类型:
2323
2357
  * - `string`: 指定该 DOM 元素的 ID 值。
@@ -2325,7 +2359,7 @@ export declare interface ILocalVideoTrack extends ILocalTrack {
2325
2359
  * @param config 设置播放参数(镜像/显示模式)。详见 [[VideoPlayerConfig]]。对于本地视频轨道,镜像模式默认开启。
2326
2360
  */
2327
2361
  /** @en
2328
- * Plays a local video track on the web page.
2362
+ * Plays a remote video track on the web page.
2329
2363
  *
2330
2364
  * @param element Specifies a DOM element. The SDK will create a `<video>` element under the specified DOM element to play the video track. You can specify a DOM element in either of the following ways:
2331
2365
  * - `string`: Specify the ID of the DOM element.
@@ -2641,6 +2675,17 @@ export declare interface ILocalVideoTrack extends ILocalTrack {
2641
2675
  * @param config The video encoder configurations. You can pass either [[VideoEncoderConfigurationPreset]] or a customized [[VideoEncoderConfiguration]] object.
2642
2676
  */
2643
2677
  setEncoderConfiguration(config: VideoEncoderConfiguration | VideoEncoderConfigurationPreset): Promise<void>;
2678
+ /**
2679
+ * 在 H.264 视频流中添加 SEI 数据。
2680
+ *
2681
+ * @param sei SEI 数据。
2682
+ */
2683
+ /** @en
2684
+ * Add the SEI data to the H.264 video stream.
2685
+ *
2686
+ * @param config SEI data.
2687
+ */
2688
+ sendSeiData(sei: Uint8Array): void;
2644
2689
  }
2645
2690
 
2646
2691
  export declare interface ImageTypedData {
@@ -2710,6 +2755,18 @@ export declare interface IMicrophoneAudioTrack extends ILocalAudioTrack {
2710
2755
  setEnabled(enabled: boolean): Promise<void>;
2711
2756
  }
2712
2757
 
2758
+ export declare function interceptLocalAudioFrame(sender: RTCRtpSender): Promise<void>;
2759
+
2760
+ export declare function interceptLocalVideoFrame(sender: RTCRtpSender, localVideoTrack: LocalVideoTrack): Promise<void>;
2761
+
2762
+ export declare function interceptRemoteAudioFrame(receiver: RTCRtpReceiver): Promise<void>;
2763
+
2764
+ export declare function interceptRemoteVideoFrame(receiver: RTCRtpReceiver, options?: InterceptVideoFrameOptions): Promise<void>;
2765
+
2766
+ declare interface InterceptVideoFrameOptions {
2767
+ onSei?: (sei: Uint8Array) => void;
2768
+ }
2769
+
2713
2770
  /**
2714
2771
  * 远端音频轨道,调用 [subscribe]{@link IAgoraRTCClient.subscribe} 后通过 [AgoraRTCRemoteUser.audioTrack]{@link IAgoraRTCRemoteUser.audioTrack} 对象获取
2715
2772
  */
@@ -2749,7 +2806,7 @@ export declare interface IRemoteAudioTrack extends IRemoteTrack {
2749
2806
  *
2750
2807
  * 设置音频播放设备,比如扬声器。
2751
2808
  *
2752
- * > 该方法只支持桌面端的 Chrome 浏览器,其他浏览器调用将会抛出 `NOT_SUPPORTED` 错误。
2809
+ * > 该方法只支持桌面端的 Chrome 和 Edge 浏览器,其他浏览器调用将会抛出 `NOT_SUPPORTED` 错误。
2753
2810
  * @param deviceId 设备 ID,可以通过 [[getPlaybackDevices]] 方法获取。
2754
2811
  */
2755
2812
  /** @en
@@ -2758,7 +2815,7 @@ export declare interface IRemoteAudioTrack extends IRemoteTrack {
2758
2815
  *
2759
2816
  * Sets the audio playback device, for example, the speaker.
2760
2817
  *
2761
- * > This method supports Chrome on desktop devices only. Other browsers throw a `NOT_SUPPORTED` error when calling this method.
2818
+ * > This method supports Chrome and Edge on desktop devices only. Other browsers throw a `NOT_SUPPORTED` error when calling this method.
2762
2819
  * @param deviceId Device ID, which can be retrieved by calling [[getPlaybackDevices]].
2763
2820
  */
2764
2821
  setPlaybackDevice(deviceId: string): Promise<void>;
@@ -2916,12 +2973,12 @@ export declare interface IRemoteTrack extends ITrack {
2916
2973
  /**
2917
2974
  * 添加事件监听器。
2918
2975
  * @param event 事件名称。
2919
- * @param listener 详见 [transceiver-updated-2]{@link event_transceiver_updated_2}。
2976
+ * @param listener 详见 [IRemoteTrack.transceiver-updated]{@link event_transceiver_updated_2}。
2920
2977
  */
2921
2978
  /** @en
2922
2979
  * Adds an event listener.
2923
2980
  * @param event The event name.
2924
- * @param listener See [transceiver-updated-2]{@link event_transceiver_updated_2}.
2981
+ * @param listener See [IRemoteTrack.transceiver-updated]{@link event_transceiver_updated_2}.
2925
2982
  */
2926
2983
  on(event: "transceiver-updated", listener: typeof event_transceiver_updated_2): void;
2927
2984
  /**
@@ -2963,6 +3020,15 @@ export declare interface IRemoteTrack extends ITrack {
2963
3020
  * You can get create a remote video track by the [AgoraRTCRemoteUser.videoTrack]{@link IAgoraRTCRemoteUser.videoTrack} object after calling [subscribe]{@link IAgoraRTCClient.subscribe}.
2964
3021
  */
2965
3022
  export declare interface IRemoteVideoTrack extends IRemoteTrack {
3023
+ /**
3024
+ * @param event 事件名称。
3025
+ * @param listener 详见 [video-state-changed]{@link event_video_state_changed}。
3026
+ */
3027
+ /** @en
3028
+ * @param event The event name.
3029
+ * @param listener See [video-state-changed]{@link event_video_state_changed}.
3030
+ */
3031
+ on(event: "video-state-changed", listener: typeof event_video_state_changed): void;
2966
3032
  /**
2967
3033
  * @param event 事件名称。
2968
3034
  * @param listener 详见 [first-frame-decoded]{@link event_first_frame_decoded}。
@@ -2984,14 +3050,25 @@ export declare interface IRemoteVideoTrack extends IRemoteTrack {
2984
3050
  /**
2985
3051
  * 添加事件监听器。
2986
3052
  * @param event 事件名称。
2987
- * @param listener 详见 [transceiver-updated-2]{@link event_transceiver_updated_2}。
3053
+ * @param listener 详见 [IRemoteTrack.transceiver-updated]{@link event_transceiver_updated_2}。
2988
3054
  */
2989
3055
  /** @en
2990
3056
  * Adds an event listener.
2991
3057
  * @param event The event name.
2992
- * @param listener See [transceiver-updated-2]{@link event_transceiver_updated_2}.
3058
+ * @param listener See [IRemoteTrack.transceiver-updated]{@link event_transceiver_updated_2}.
2993
3059
  */
2994
3060
  on(event: "transceiver-updated", listener: typeof event_transceiver_updated_2): void;
3061
+ /**
3062
+ * 添加事件监听器。
3063
+ * @param event 事件名称。
3064
+ * @param listener 详见 [ILocalTrack.sei-received]{@link event_sei_received}。
3065
+ */
3066
+ /** @en
3067
+ * Adds an event listener.
3068
+ * @param event The event name.
3069
+ * @param listener See [ILocalTrack.sei-received]{@link event_sei_received}.
3070
+ */
3071
+ on(event: "sei-received", listener: typeof event_sei_received): void;
2995
3072
  /**
2996
3073
  * 获取远端视频轨道相关信息。
2997
3074
  *
@@ -3194,8 +3271,8 @@ export declare interface ITrack extends EventEmitter {
3194
3271
  * 该方法目前主要用于视频流的[端到端加密(Beta)](https://doc.shengwang.cn/doc/rtc/javascript/advanced-features/e2e-encryption)。
3195
3272
  *
3196
3273
  * > 如果 SDK 发生断线重连,当前轨道对应的 `RTCRtpTransceiver` 实例可能会发生变化。你可以通过以下回调来获取新的 `RTCRtpTransceiver` 实例:
3197
- * > - 本地轨道:["transceiver-updated"]{@link ILocalTrack.event_transceiver_updated}
3198
- * > - 远端轨道:["transceiver-updated-2"]{@link IRemoteTrack.event_transceiver_updated_2}
3274
+ * > - 本地轨道:[ILocalTrack.transceiver-updated]{@link event_transceiver_updated}
3275
+ * > - 远端轨道:[IRemoteTrack.transceiver-updated]{@link event_transceiver_updated_2}
3199
3276
  *
3200
3277
  * @param type 视频流的类型。详见 {@link StreamType}。
3201
3278
  * @returns 当前轨道的 `RTCRtpTransceiver` 实例。
@@ -3206,8 +3283,8 @@ export declare interface ITrack extends EventEmitter {
3206
3283
  * This method is currently mainly used for end-to-end encryption of video streams (Beta).
3207
3284
  *
3208
3285
  * > If the SDK experiences a reconnection, the `RTCRtpTransceiver` instance corresponding to the current track might change. You can obtain the new `RTCRtpTransceiver` instance through the following callbacks:
3209
- * > - For a local track: ["transceiver-updated"]{@link ILocalTrack.event_transceiver_updated}
3210
- * > - For a remote track: ["transceiver-updated-2"]{@link IRemoteTrack.event_transceiver_updated_2}
3286
+ * > - For a local track: [ILocalTrack.transceiver-updated]{@link event_transceiver_updated}
3287
+ * > - For a remote track: [IRemoteTrack.transceiver-updated]{@link event_transceiver_updated_2}
3211
3288
  *
3212
3289
  * @param type The type of the video stream. See {@link StreamType}.
3213
3290
  * @returns The [RTCRtpTransceiver](https://developer.mozilla.org/en-US/docs/Web/API/RTCRtpTransceiver) instance of the current track.
@@ -3241,23 +3318,24 @@ export declare class LocalAudioTrack extends LocalTrack implements ILocalAudioTr
3241
3318
  readonly trackMediaType: "audio" | "video";
3242
3319
  _encoderConfig?: AudioEncoderConfiguration;
3243
3320
  _trackSource: AudioTrackSource | FakeTrackSource;
3244
- get _source(): AudioTrackSource | FakeTrackSource;
3321
+ /**
3322
+ * @description This method is used to init WebAudio, if you're sure you don't want to use WebAudio, call _trackSource
3323
+ */
3324
+ get _source(): AudioTrackSource;
3245
3325
  set _source(source: AudioTrackSource | FakeTrackSource);
3246
3326
  _enabled: boolean;
3247
3327
  private _volume;
3248
3328
  _useAudioElement: boolean;
3249
3329
  _bypassWebAudio: boolean;
3250
3330
  protected processor?: IAudioProcessor;
3251
- protected _processorContext: AudioProcessorContext;
3331
+ protected _processorContext: AudioProcessorContext | undefined;
3252
3332
  protected get processorContext(): AudioProcessorContext;
3253
- protected set processorContext(ctx: AudioProcessorContext);
3254
- _processorDestination: AudioProcessorDestination;
3333
+ _processorDestination: AudioProcessorDestination | undefined;
3255
3334
  get processorDestination(): AudioProcessorDestination;
3256
- set processorDestination(des: AudioProcessorDestination);
3257
3335
  protected _getOriginVolumeLevel: boolean;
3258
3336
  get isPlaying(): boolean;
3259
3337
  get __className__(): string;
3260
- constructor(track: MediaStreamTrack, encoderConfig?: AudioEncoderConfiguration, trackId?: string, getOriginVolumeLevel?: boolean, deferWebAudio?: boolean);
3338
+ constructor(track: MediaStreamTrack, encoderConfig?: AudioEncoderConfiguration, trackId?: string, getOriginVolumeLevel?: boolean);
3261
3339
  setVolume(volume: number): void;
3262
3340
  getVolumeLevel(): number;
3263
3341
  setPlaybackDevice(deviceId: string): Promise<void>;
@@ -3276,7 +3354,10 @@ export declare class LocalAudioTrack extends LocalTrack implements ILocalAudioTr
3276
3354
  unpipe(): void;
3277
3355
  private bindProcessorDestinationEvents;
3278
3356
  private unbindProcessorDestinationEvents;
3279
- private unbindProcessorContextEvents;
3357
+ protected bindProcessorContextEvents(processorContext: AudioProcessorContext): void;
3358
+ protected unbindProcessorContextEvents(processorContext: AudioProcessorContext): void;
3359
+ private initWebAudio;
3360
+ private initProcessor;
3280
3361
  }
3281
3362
 
3282
3363
  /**
@@ -3395,9 +3476,9 @@ export declare abstract class LocalTrack extends Track implements ILocalTrack {
3395
3476
  _isClosed: boolean;
3396
3477
  protected _enabledMutex: PromiseMutex;
3397
3478
  protected processor?: IBaseProcessor;
3398
- protected abstract _processorContext: IProcessorContext;
3399
- protected get processorContext(): IProcessorContext;
3400
- protected set processorContext(ctx: IProcessorContext);
3479
+ protected abstract _processorContext: IProcessorContext | undefined;
3480
+ protected get processorContext(): IProcessorContext | undefined;
3481
+ abstract processorDestination: IBaseProcessor;
3401
3482
  constructor(track: MediaStreamTrack, trackId?: string);
3402
3483
  abstract getStats(): LocalVideoTrackStats | LocalAudioTrackStats;
3403
3484
  abstract setMuted(enabled: boolean): Promise<void>;
@@ -3480,6 +3561,7 @@ export declare class LocalVideoTrack extends LocalTrack implements ILocalVideoTr
3480
3561
  clone(config?: VideoEncoderConfiguration | VideoEncoderConfigurationPreset, cloneTrack?: boolean): LocalVideoTrack;
3481
3562
  replaceTrack(track: MediaStreamTrack, stopOldTrack: boolean): Promise<void>;
3482
3563
  startMonitorStats(): void;
3564
+ sendSeiData(sei: Uint8Array): never;
3483
3565
  private bindProcessorDestinationEvents;
3484
3566
  private unbindProcessorDestinationEvents;
3485
3567
  private unbindProcessorContextEvents;
@@ -3497,7 +3579,6 @@ export declare interface LocalVideoTrackStats {
3497
3579
  * 视频编码格式。
3498
3580
  *
3499
3581
  * - `"H264"`: 视频编码格式为 H.264。
3500
- * - `"H265"`: 视频编码格式为 H.265。
3501
3582
  * - `"VP8"`: 视频编码格式为 VP8。
3502
3583
  * - `"VP9"`: 视频编码格式为 VP9。
3503
3584
  * - `"AV1X"`: 预留参数,暂不支持。
@@ -3509,7 +3590,6 @@ export declare interface LocalVideoTrackStats {
3509
3590
  * The video codec.
3510
3591
  *
3511
3592
  * - `"H264"`: The video codec is H.264.
3512
- * - `"H265"`: The video codec is H.265.
3513
3593
  * - `"VP8"`: The video codec is VP8.
3514
3594
  * - `"VP9"`: The video codec is VP9.
3515
3595
  * - `"AV1X"`: Reserved for future use.
@@ -3753,7 +3833,8 @@ export declare class MicrophoneAudioTrack extends LocalAudioTrack implements IMi
3753
3833
  close(): void;
3754
3834
  protected onTrackEnded(): void;
3755
3835
  renewMediaStreamTrack(newConstraints?: MediaTrackConstraints): Promise<void>;
3756
- private bindProcessorContextEvents;
3836
+ protected bindProcessorContextEvents(processorContext: AudioProcessorContext): void;
3837
+ protected unbindProcessorContextEvents(processorContext: AudioProcessorContext): void;
3757
3838
  }
3758
3839
 
3759
3840
  /**
@@ -3887,111 +3968,6 @@ export declare interface ProcessorUsageStats {
3887
3968
  totalTs: number;
3888
3969
  }
3889
3970
 
3890
- export declare interface PublishAudioUploadStats {
3891
- id: string;
3892
- timestamp: string;
3893
- mediaType: "audio";
3894
- type: "ssrc";
3895
- ssrc: string;
3896
- /** audioInputLevel */
3897
- A_ail?: string;
3898
- /** audioPCMInputLevel */
3899
- A_apil?: string;
3900
- /** Audio Send Track is Disabled */
3901
- A_astd?: string;
3902
- /** googEchoCancellationReturnLoss */
3903
- A_ecrl?: string;
3904
- /** googEchoCancellationReturnLossEnhancement */
3905
- A_ecrle?: string;
3906
- /** 发流字节数目,目前仅在p2p下上报 */
3907
- bytesSent?: string;
3908
- /** 发流丢包数目,目前仅在p2p下上报 */
3909
- packetsLost?: string;
3910
- /** 发包数目,目前仅在p2p下上报 */
3911
- packetsSent?: string;
3912
- }
3913
-
3914
- export declare interface PublishBandwidthUploadStats {
3915
- id: "bweforvideo";
3916
- type: "VideoBwe";
3917
- timestamp: string;
3918
- /** ActualEncBitrate */
3919
- A_aeb?: string;
3920
- /** AvailableSendBandwidth */
3921
- A_asb?: string;
3922
- /** RetransmitBitrate */
3923
- A_rb?: string;
3924
- /** AvailableReceiveBandwidth */
3925
- A_arb?: string;
3926
- /** TargetEncBitrate */
3927
- A_teb?: string;
3928
- /** BucketDelay */
3929
- A_bd?: string;
3930
- /** TransmitBitrate */
3931
- A_tb?: string;
3932
- }
3933
-
3934
- export declare interface PublishVideoInputStats {
3935
- id: string;
3936
- timestamp: string;
3937
- mediaType: "video";
3938
- type: "ssrc";
3939
- ssrc: string;
3940
- /** FrameHeightInput */
3941
- A_fhi?: string;
3942
- /** FrameRateInput */
3943
- A_fri?: string;
3944
- /** FrameWidthInput */
3945
- A_fwi?: string;
3946
- }
3947
-
3948
- export declare interface PublishVideoRelatedStats {
3949
- mediaType: "video";
3950
- isVideoMute: boolean;
3951
- frameRateInput?: string;
3952
- frameRateSent?: string;
3953
- googRtt: string;
3954
- qpSumPerFrame?: string;
3955
- }
3956
-
3957
- export declare interface PublishVideoUploadStats {
3958
- id: string;
3959
- timestamp: string;
3960
- mediaType: "video";
3961
- type: "ssrc";
3962
- ssrc: string;
3963
- /** FrameHeightSent */
3964
- A_fhs?: string;
3965
- /** FrameRateSent */
3966
- A_frs?: string;
3967
- /** FrameWidthSent */
3968
- A_fws?: string;
3969
- /** NacksReceived */
3970
- A_nr?: string;
3971
- /** Video Send Track is Disabled */
3972
- A_vstd?: string;
3973
- /** googAvgEncodeMs */
3974
- A_aem?: string;
3975
- /** Local Video Player Status */
3976
- A_lvps?: string;
3977
- /**
3978
- * googAdaptationChanges
3979
- *
3980
- * 这里实际是记录发生自动回退的次数,但是目前 spec stats 还没有这个值,只能拿到回退的原因。所以修改一下上报格式:
3981
- * - “0” 没有发生回退
3982
- * - “1” 因为 cpu 发生回退
3983
- * - “2” 因为 bandwidth 发生回退
3984
- * - “3” 因为其他原因发生回退
3985
- */
3986
- A_ac?: string;
3987
- /** 发流字节数目,目前仅在p2p下上报 */
3988
- bytesSent?: string;
3989
- /** 发流丢包数目,目前仅在p2p下上报 */
3990
- packetsLost?: string;
3991
- /** 发包数目,目前仅在p2p下上报 */
3992
- packetsSent?: string;
3993
- }
3994
-
3995
3971
  export declare class RemoteAudioTrack extends RemoteTrack implements IRemoteAudioTrack {
3996
3972
  readonly trackMediaType: "audio" | "video";
3997
3973
  _source: AudioTrackSource | FakeTrackSource;
@@ -4179,7 +4155,7 @@ export declare class RemoteDataChannel extends DataChannel implements IRemoteDat
4179
4155
  }
4180
4156
 
4181
4157
  /**
4182
- * 远端视频流的回退类型,用于 [setStreamFallbackOption]{@link IAgoraRTCClient.setStreamFallbackOption}。
4158
+ * 媒体流的回退策略选项,用于 [setStreamFallbackOption]{@link IAgoraRTCClient.setStreamFallbackOption}。
4183
4159
  * @public
4184
4160
  */
4185
4161
  /** @en
@@ -4192,9 +4168,9 @@ export declare enum RemoteStreamFallbackType {
4192
4168
  * 0: Disable the fallback.
4193
4169
  */
4194
4170
  DISABLE = 0,
4195
- /** 1:(默认)网络条件较差的情况下,SDK 将自动订阅视频小流。 */
4171
+ /** 1: 在网络条件较差的情况下,自动订阅视频小流。 */
4196
4172
  /** @en
4197
- * 1: (Default) Automatically subscribe to the low-video stream under poor network conditions. */
4173
+ * 1: Automatically subscribe to the low-video stream under poor network conditions. */
4198
4174
  LOW_STREAM = 1,
4199
4175
  /** 2: 网络较弱时,先尝试订阅视频小流。如果网络环境无法显示视频,则再回退到订阅纯音频流。 */
4200
4176
  /** @en
@@ -4243,7 +4219,8 @@ export declare abstract class RemoteTrack extends Track implements IRemoteTrack
4243
4219
 
4244
4220
  export declare enum RemoteTrackEvents {
4245
4221
  FIRST_FRAME_DECODED = "first-frame-decoded",
4246
- VIDEO_ELEMENT_VISIBLE_STATUS = "video-element-visible-status"
4222
+ VIDEO_ELEMENT_VISIBLE_STATUS = "video-element-visible-status",
4223
+ VIDEO_STATE_CHANGED = "video-state-changed"
4247
4224
  }
4248
4225
 
4249
4226
  export declare class RemoteVideoTrack extends RemoteTrack implements IRemoteVideoTrack {
@@ -4271,6 +4248,7 @@ export declare class RemoteVideoTrack extends RemoteTrack implements IRemoteVide
4271
4248
  private bindProcessorDestinationEvents;
4272
4249
  private unbindProcessorDestinationEvents;
4273
4250
  _destroy(): void;
4251
+ _onSei(sei: Uint8Array): void;
4274
4252
  }
4275
4253
 
4276
4254
  /**
@@ -4296,7 +4274,6 @@ export declare interface RemoteVideoTrackStats {
4296
4274
  * 视频编码格式。
4297
4275
  *
4298
4276
  * - `"H264"`: 视频编码格式为 H.264。
4299
- * - `"H265"`: 视频编码格式为 H.265。
4300
4277
  * - `"VP8"`: 视频编码格式为 VP8。
4301
4278
  * - `"VP9"`: 视频编码格式为 VP9。
4302
4279
  * - `"AV1X"`: 视频编码格式为 AV1,在 Chrome M96 版本之前。
@@ -4308,7 +4285,6 @@ export declare interface RemoteVideoTrackStats {
4308
4285
  * The video codec.
4309
4286
  *
4310
4287
  * - `"H264"`: The video codec is H.264.
4311
- * - `"H265"`: The video codec is H.265.
4312
4288
  * - `"VP8"`: The video codec is VP8.
4313
4289
  * - `"VP9"`: The video codec is VP9.
4314
4290
  * - `"AV1X"`: Reserved for future use.
@@ -4800,100 +4776,6 @@ export declare enum StreamType {
4800
4776
  LOW_STREAM = 1
4801
4777
  }
4802
4778
 
4803
- export declare interface SubscribeAudioRelatedStats {
4804
- mediaType: "audio";
4805
- peerId: UID;
4806
- isAudioMute: boolean;
4807
- frameDropped?: string;
4808
- frameReceived?: string;
4809
- googJitterReceived: string;
4810
- bytesReceived: string;
4811
- packetsReceived: string;
4812
- isFreeze: boolean;
4813
- packetsLost: string;
4814
- }
4815
-
4816
- export declare interface SubscribeAudioUploadStats {
4817
- id: string;
4818
- timestamp: string;
4819
- mediaType: "audio";
4820
- type: "ssrc";
4821
- ssrc: string;
4822
- bytesReceived?: string;
4823
- packetsLost?: string;
4824
- packetsReceived?: string;
4825
- /** audioOutputLevel */
4826
- A_aol?: string;
4827
- /** audioPCMOutputLevel */
4828
- A_apol?: string;
4829
- /** JitterReceived */
4830
- A_jr?: string;
4831
- /** JitterBufferMs */
4832
- A_jbm?: string;
4833
- /** CurrentDelayMs(JitterBufferMs) */
4834
- A_cdm?: string;
4835
- /** Audio Recv Track is Disabled */
4836
- A_artd?: string;
4837
- /** Remote Audio Player Status */
4838
- A_raps?: string;
4839
- /**Audio concealed samples*/
4840
- A_cs?: string;
4841
- }
4842
-
4843
- export declare interface SubscribeVideoRelatedStats {
4844
- mediaType: "video";
4845
- peerId: UID;
4846
- isVideoMute: boolean;
4847
- frameRateReceived?: string;
4848
- frameRateDecoded?: string;
4849
- bytesReceived: string;
4850
- packetsReceived: string;
4851
- isFreeze: boolean;
4852
- packetsLost: string;
4853
- qpSumPerFrame?: string;
4854
- }
4855
-
4856
- export declare interface SubscribeVideoUploadStats {
4857
- id: string;
4858
- timestamp: string;
4859
- mediaType: "video";
4860
- type: "ssrc";
4861
- ssrc: string;
4862
- bytesReceived?: string;
4863
- packetsLost?: string;
4864
- packetsReceived?: string;
4865
- /** FrameRateReceived */
4866
- A_frr?: string;
4867
- /** FrameRateDecoded */
4868
- A_frd?: string;
4869
- /** FrameRateOutput */
4870
- A_fro?: string;
4871
- /** JitterBufferMs */
4872
- A_jbm?: string;
4873
- /** CurrentDelayMs(JitterBufferMs) */
4874
- A_cdm?: string;
4875
- /** NacksSent */
4876
- A_ns?: string;
4877
- /** PlisSent */
4878
- A_ps?: string;
4879
- /** FirsSent */
4880
- A_fs?: string;
4881
- /** Video Recv Track is Disabled */
4882
- A_vrtd?: string;
4883
- /** Video Recv Freeze Time */
4884
- A_vrft?: string;
4885
- /** Remote Video Player Status */
4886
- A_rvps?: string;
4887
- /** Frame height received */
4888
- A_fhr?: string;
4889
- /** Frame width received */
4890
- A_fwr?: string;
4891
- /** Video Recv Render Freeze Time */
4892
- A_vrrft?: string;
4893
- /** Video Recv Inter Frame Delay in ms standard deviation */
4894
- A_ifdsd?: string;
4895
- }
4896
-
4897
4779
  export declare const SUPPORT_720P_AUTO_CONFIG_LIST: Required<{
4898
4780
  scaleResolutionDownBy: number;
4899
4781
  width: number;
@@ -5023,7 +4905,9 @@ export declare abstract class Track extends EventEmitter implements ITrack {
5023
4905
  }
5024
4906
 
5025
4907
  export declare enum TrackEvents {
5026
- TRANSCEIVER_UPDATED = "transceiver-updated"
4908
+ TRANSCEIVER_UPDATED = "transceiver-updated",
4909
+ SEI_TO_SEND = "sei-to-send",
4910
+ SEI_RECEIVED = "sei-received"
5027
4911
  }
5028
4912
 
5029
4913
  /**
@@ -5041,6 +4925,7 @@ export declare enum TrackHint {
5041
4925
  export declare enum TrackInternalEvent {
5042
4926
  NEED_RENEGOTIATE = "@need_renegotiate",
5043
4927
  NEED_REPLACE_TRACK = "@need_replace_track",
4928
+ NEED_REPLACE_MIXING_TRACK = "@need_replace_mixing_track",
5044
4929
  NEED_CLOSE = "@need_close",
5045
4930
  NEED_ENABLE_TRACK = "@need_enable_track",
5046
4931
  NEED_DISABLE_TRACK = "@need_disable_track",
@@ -5055,11 +4940,6 @@ export declare enum TrackInternalEvent {
5055
4940
  NEED_UNMUTE_TRACK = "@need_unmute_track"
5056
4941
  }
5057
4942
 
5058
- export declare interface TransportUploadStats {
5059
- connectionType: number;
5060
- googRtt?: number;
5061
- }
5062
-
5063
4943
  export declare function updateAgoraRTCCompatibility(): void;
5064
4944
 
5065
4945
  export declare interface UsageRegistry {
@@ -5277,6 +5157,7 @@ declare class VideoPlayer {
5277
5157
  trackId: string;
5278
5158
  config: PlayerConfig;
5279
5159
  onFirstVideoFrameDecoded?: () => void;
5160
+ onVideoStateChanged?: (state: VideoState) => void;
5280
5161
  freezeTimeCounterList: number[];
5281
5162
  renderFreezeAccTime: number;
5282
5163
  isKeepLastFrame: boolean;
@@ -5292,7 +5173,11 @@ declare class VideoPlayer {
5292
5173
  protected cacheVideoElement?: HTMLVideoElement;
5293
5174
  get videoElementStatus(): MediaElementStatus;
5294
5175
  set videoElementStatus(status: MediaElementStatus);
5176
+ get videoState(): VideoState;
5177
+ set videoState(state: VideoState);
5178
+ private _videoState;
5295
5179
  private videoElementCheckInterval?;
5180
+ private videoElementFreezeTimeout?;
5296
5181
  private _videoElementStatus;
5297
5182
  private isGettingVideoDimensions;
5298
5183
  constructor(config: PlayerConfig);
@@ -5405,6 +5290,36 @@ export declare class VideoProcessorDestination extends EventEmitter implements I
5405
5290
  reset(): void;
5406
5291
  }
5407
5292
 
5293
+ /**
5294
+ * 视频流状态。
5295
+ * @public
5296
+ */
5297
+ /** @en
5298
+ * The state of the video stream.
5299
+ */
5300
+ export declare enum VideoState {
5301
+ /** 0: 视频默认初始状态。 */
5302
+ /** @en
5303
+ * 0: The initial state of the video.
5304
+ */
5305
+ VideoStateStopped = 0,
5306
+ /** 1: 本地用户已接收视频首包。 */
5307
+ /** @en
5308
+ * 1: The local user has received the first video packet.
5309
+ */
5310
+ VideoStateStarting = 1,
5311
+ /** 2: 视频流正在解码,正常播放。 */
5312
+ /** @en
5313
+ * 2: The video stream is being decoded and played normally.
5314
+ */
5315
+ VideoStateDecoding = 2,
5316
+ /** 3: 视频流卡顿。 */
5317
+ /** @en
5318
+ * 3: The video stream is frozen.
5319
+ */
5320
+ VideoStateFrozen = 3
5321
+ }
5322
+
5408
5323
  declare class VisibilityWatcher extends EventEmitter {
5409
5324
  private _lastHiddenTime;
5410
5325
  private _lastVisibleTime;