@agora-js/media 4.19.3 → 4.20.1-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.
@@ -174,7 +174,7 @@ declare class AudioElementPlayCenter {
174
174
  private bindAudioElementEvents;
175
175
  getPlayerState(trackId: string): string;
176
176
  private autoResumeAudioElement;
177
- private autoResumeAfterInterruption;
177
+ autoResumeAfterInterruption: (force?: boolean) => void;
178
178
  private autoResumeAfterInterruptionOnIOS15_16;
179
179
  }
180
180
 
@@ -487,7 +487,7 @@ export declare class CameraVideoTrack extends LocalVideoTrack implements ICamera
487
487
  _enabled: boolean;
488
488
  _deviceName: string;
489
489
  get __className__(): string;
490
- constructor(track: MediaStreamTrack, config: CameraVideoTrackInitConfig, constraints: MediaTrackConstraints, scalabilityConfig?: SVCConfiguration, optimizationMode?: "motion" | "detail" | "balanced", trackId?: string);
490
+ constructor(track: MediaStreamTrack, config: CameraVideoTrackInitConfig, constraints: MediaTrackConstraints, scalabilityConfig?: SVCConfiguration, optimizationMode?: OptimizationMode | "balanced", trackId?: string);
491
491
  setDevice(deviceId: string | RequiredOnlyOneOf<{
492
492
  facingMode: VideoFacingModeEnum;
493
493
  deviceId: string;
@@ -547,7 +547,7 @@ export declare interface CameraVideoTrackInitConfig {
547
547
  *
548
548
  * > Note: This method is only supported on Chrome.
549
549
  */
550
- optimizationMode?: "motion" | "detail";
550
+ optimizationMode?: OptimizationMode;
551
551
  /**
552
552
  * @ignore
553
553
  *
@@ -896,6 +896,18 @@ declare function event_beauty_effect_overload(): void;
896
896
  */
897
897
  declare function event_first_frame_decoded(): void;
898
898
 
899
+ /**
900
+ * **Since**
901
+ * <br>&emsp;&emsp;&emsp;*4.20.1*
902
+ *
903
+ * Parsing SEI data from the H.264 video stream triggers this event, which returns the SEI data.
904
+ *
905
+ * @param sei SEI data in Uint8Array
906
+ * @asMemberOf ILocalVideoTrack
907
+ * @event
908
+ */
909
+ declare function event_sei_received(sei: Uint8Array): void;
910
+
899
911
  /**
900
912
  * Occurs when the state of processing the audio buffer in [BufferSourceAudioTrack]{@link IBufferSourceAudioTrack} changes.
901
913
  *
@@ -927,6 +939,8 @@ declare function event_source_state_change(currentState: AudioSourceState): void
927
939
  */
928
940
  declare function event_track_ended(): void;
929
941
 
942
+ export declare function event_track_updated(track: MediaStreamTrack): void;
943
+
930
944
  /**
931
945
  * Occurs when the `RTCRtpTransceiver` instance of the current track is updated.
932
946
  *
@@ -999,6 +1013,14 @@ declare function event_video_element_visible_status(data?: CheckVideoVisibleResu
999
1013
  */
1000
1014
  declare function event_video_element_visible_status_2(data?: CheckVideoVisibleResult): void;
1001
1015
 
1016
+ /**
1017
+ * Occurs when the video state changes.
1018
+ *
1019
+ * @event
1020
+ * @asMemberOf IRemoteTrack
1021
+ */
1022
+ declare function event_video_state_changed(videoState: VideoState): void;
1023
+
1002
1024
  export declare interface ExtendedVideoFrameCallbackMetadata extends VideoFrameCallbackMetadata {
1003
1025
  timestamp: DOMHighResTimeStamp;
1004
1026
  }
@@ -1042,7 +1064,9 @@ export declare function getAudioContext(): AudioContext;
1042
1064
 
1043
1065
  export declare function getAudioEncoderConfiguration(profile: AudioEncoderConfigurationPreset | AudioEncoderConfiguration): AudioEncoderConfiguration;
1044
1066
 
1045
- export declare function getBitrateFromResAndFps(width: number, height: number, fps: number, bitrateAdapterType: "STANDARD_BITRATE" | "COMPATIABLE_BITRATE"): [number, number] | void;
1067
+ export declare function getBitrateConstrainRange(width: number, height: number, frameRate: number, bitrateMin?: number, bitrateMax?: number): DoubleRange;
1068
+
1069
+ export declare function getBitrateFromResAndFps(width: number, height: number, fps: number): Required<DoubleRange>;
1046
1070
 
1047
1071
  export declare function getCompatibility(): AgoraRTCCompatibility;
1048
1072
 
@@ -1060,6 +1084,14 @@ export declare function getElectronScreenStreamByUserSelect(config: ScreenConstr
1060
1084
 
1061
1085
  export declare function getLocalStream(config: GetUserMediaConfig, id: string): Promise<MediaStream>;
1062
1086
 
1087
+ export declare const getOriginSenderConfig: (track: LocalVideoTrack) => {
1088
+ frameRate: number;
1089
+ bitrateMax: number;
1090
+ bitrateMin: number;
1091
+ scaleResolutionDownBy: number;
1092
+ scale: number;
1093
+ };
1094
+
1063
1095
  export declare function getScalabilityConfiguration(profile: SVCConfiguration | SVCConfigurationPreset): SVCConfiguration;
1064
1096
 
1065
1097
  export declare function getScreenEncoderConfiguration(profile: VideoEncoderConfiguration | ScreenEncoderConfigurationPreset | string): VideoEncoderConfiguration;
@@ -1317,7 +1349,6 @@ export declare interface ILocalAudioTrack extends ILocalTrack {
1317
1349
  *
1318
1350
  * > Note:
1319
1351
  * > - As of v4.7.0, this method no longer takes effect. Use [IRemoteAudioTrack.setPlaybackDevice]{@link IRemoteAudioTrack.setPlaybackDevice} instead.
1320
- * > - This method supports Chrome on desktop devices only. Other browsers throw a '`NOT_SUPPORTED` error when calling this method.
1321
1352
  *
1322
1353
  * Sets the playback device (speaker) for the remote audio stream.
1323
1354
  *
@@ -1371,6 +1402,7 @@ export declare interface ILocalDataChannel extends IDataChannel {
1371
1402
  * `LocalTrack` is the basic interface for local tracks, providing public methods for [LocalAudioTrack]{@link ILocalAudioTrack} and [LocalVideoTrack]{@link ILocalVideoTrack}.
1372
1403
  */
1373
1404
  export declare interface ILocalTrack extends ITrack {
1405
+ on(event: "track-updated", listener: typeof event_track_updated): void;
1374
1406
  /**
1375
1407
  * @param event The event name.
1376
1408
  * @param listener See [track-ended]{@link event_track_ended}.
@@ -1379,7 +1411,7 @@ export declare interface ILocalTrack extends ITrack {
1379
1411
  /**
1380
1412
  * Adds an event listener.
1381
1413
  * @param event The event name.
1382
- * @param listener See [transceiver-updated]{@link event_transceiver_updated}.
1414
+ * @param listener See [ILocalTrack.transceiver-updated]{@link event_transceiver_updated}.
1383
1415
  */
1384
1416
  on(event: "transceiver-updated", listener: typeof event_transceiver_updated): void;
1385
1417
  /**
@@ -1424,7 +1456,7 @@ export declare interface ILocalTrack extends ITrack {
1424
1456
  *
1425
1457
  * 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.
1426
1458
  *
1427
- * > - 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).
1459
+ * > - 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).
1428
1460
  * > - Do not call `setEnabled` and `setMuted` together.
1429
1461
  *
1430
1462
  * @param muted Whether to stop sending the media data of the track:
@@ -1450,6 +1482,7 @@ export declare interface ILocalTrack extends ITrack {
1450
1482
  * Inherited from `LocalVideoTrack`, [CameraVideoTrack]{@link ICameraVideoTrack} is an interface for the video captured by a local camera and adds several camera-related functions.
1451
1483
  */
1452
1484
  export declare interface ILocalVideoTrack extends ILocalTrack {
1485
+ on(event: "track-updated", listener: typeof event_track_updated): void;
1453
1486
  /** @internal */
1454
1487
  on(event: "beauty-effect-overload", listener: typeof event_beauty_effect_overload): void;
1455
1488
  /**
@@ -1465,11 +1498,11 @@ export declare interface ILocalVideoTrack extends ILocalTrack {
1465
1498
  /**
1466
1499
  * Adds an event listener.
1467
1500
  * @param event The event name.
1468
- * @param listener See [transceiver-updated]{@link event_transceiver_updated}.
1501
+ * @param listener See [ILocalTrack.transceiver-updated]{@link event_transceiver_updated}.
1469
1502
  */
1470
1503
  on(event: "transceiver-updated", listener: typeof event_transceiver_updated): void;
1471
1504
  /**
1472
- * Plays a local video track on the web page.
1505
+ * Plays a remote video track on the web page.
1473
1506
  *
1474
1507
  * @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:
1475
1508
  * - `string`: Specify the ID of the DOM element.
@@ -1636,6 +1669,12 @@ export declare interface ILocalVideoTrack extends ILocalTrack {
1636
1669
  * @param config The video encoder configurations. You can pass either [[VideoEncoderConfigurationPreset]] or a customized [[VideoEncoderConfiguration]] object.
1637
1670
  */
1638
1671
  setEncoderConfiguration(config: VideoEncoderConfiguration | VideoEncoderConfigurationPreset): Promise<void>;
1672
+ /**
1673
+ * Add the SEI data to the H.264 video stream.
1674
+ *
1675
+ * @param config SEI data.
1676
+ */
1677
+ sendSeiData(sei: Uint8Array): void;
1639
1678
  }
1640
1679
 
1641
1680
  export declare interface ImageTypedData {
@@ -1677,6 +1716,18 @@ export declare interface IMicrophoneAudioTrack extends ILocalAudioTrack {
1677
1716
  setEnabled(enabled: boolean): Promise<void>;
1678
1717
  }
1679
1718
 
1719
+ export declare function interceptLocalAudioFrame(sender: RTCRtpSender): Promise<void>;
1720
+
1721
+ export declare function interceptLocalVideoFrame(sender: RTCRtpSender, localVideoTrack: LocalVideoTrack): Promise<void>;
1722
+
1723
+ export declare function interceptRemoteAudioFrame(receiver: RTCRtpReceiver): Promise<void>;
1724
+
1725
+ export declare function interceptRemoteVideoFrame(receiver: RTCRtpReceiver, options?: InterceptVideoFrameOptions): Promise<void>;
1726
+
1727
+ declare interface InterceptVideoFrameOptions {
1728
+ onSei?: (sei: Uint8Array) => void;
1729
+ }
1730
+
1680
1731
  /**
1681
1732
  * `RemoteAudioTrack` is the basic interface for the remote audio track.
1682
1733
  *
@@ -1701,7 +1752,7 @@ export declare interface IRemoteAudioTrack extends IRemoteTrack {
1701
1752
  *
1702
1753
  * Sets the audio playback device, for example, the speaker.
1703
1754
  *
1704
- * > This method supports Chrome on desktop devices only. Other browsers throw a `NOT_SUPPORTED` error when calling this method.
1755
+ * > This method supports Chrome and Edge on desktop devices only. Other browsers throw a `NOT_SUPPORTED` error when calling this method.
1705
1756
  * @param deviceId Device ID, which can be retrieved by calling [[getPlaybackDevices]].
1706
1757
  */
1707
1758
  setPlaybackDevice(deviceId: string): Promise<void>;
@@ -1788,6 +1839,7 @@ export declare interface IRemoteDataChannel extends IDataChannel {
1788
1839
  * `RemoteTrack` is the basic interface for remote tracks, providing public methods for [RemoteAudioTrack]{@link IRemoteAudioTrack} and [RemoteVideoTrack]{@link IRemoteVideoTrack}.
1789
1840
  */
1790
1841
  export declare interface IRemoteTrack extends ITrack {
1842
+ on(event: "track-updated", listener: typeof event_track_updated): void;
1791
1843
  /**
1792
1844
  * @param event The event name.
1793
1845
  * @param listener See [first-frame-decoded]{@link event_first_frame_decoded}.
@@ -1796,7 +1848,7 @@ export declare interface IRemoteTrack extends ITrack {
1796
1848
  /**
1797
1849
  * Adds an event listener.
1798
1850
  * @param event The event name.
1799
- * @param listener See [transceiver-updated-2]{@link event_transceiver_updated_2}.
1851
+ * @param listener See [IRemoteTrack.transceiver-updated]{@link event_transceiver_updated_2}.
1800
1852
  */
1801
1853
  on(event: "transceiver-updated", listener: typeof event_transceiver_updated_2): void;
1802
1854
  /**
@@ -1820,6 +1872,12 @@ export declare interface IRemoteTrack extends ITrack {
1820
1872
  * You can get create a remote video track by the [AgoraRTCRemoteUser.videoTrack]{@link IAgoraRTCRemoteUser.videoTrack} object after calling [subscribe]{@link IAgoraRTCClient.subscribe}.
1821
1873
  */
1822
1874
  export declare interface IRemoteVideoTrack extends IRemoteTrack {
1875
+ /**
1876
+ * @param event The event name.
1877
+ * @param listener See [video-state-changed]{@link event_video_state_changed}.
1878
+ */
1879
+ on(event: "track-updated", listener: typeof event_track_updated): void;
1880
+ on(event: "video-state-changed", listener: typeof event_video_state_changed): void;
1823
1881
  /**
1824
1882
  * @param event The event name.
1825
1883
  * @param listener See [first-frame-decoded]{@link event_first_frame_decoded}.
@@ -1833,9 +1891,15 @@ export declare interface IRemoteVideoTrack extends IRemoteTrack {
1833
1891
  /**
1834
1892
  * Adds an event listener.
1835
1893
  * @param event The event name.
1836
- * @param listener See [transceiver-updated-2]{@link event_transceiver_updated_2}.
1894
+ * @param listener See [IRemoteTrack.transceiver-updated]{@link event_transceiver_updated_2}.
1837
1895
  */
1838
1896
  on(event: "transceiver-updated", listener: typeof event_transceiver_updated_2): void;
1897
+ /**
1898
+ * Adds an event listener.
1899
+ * @param event The event name.
1900
+ * @param listener See [ILocalTrack.sei-received]{@link event_sei_received}.
1901
+ */
1902
+ on(event: "sei-received", listener: typeof event_sei_received): void;
1839
1903
  /**
1840
1904
  * Gets the statistics of a remote video track.
1841
1905
  *
@@ -1950,8 +2014,8 @@ export declare interface ITrack extends EventEmitter {
1950
2014
  * This method is currently mainly used for end-to-end encryption of video streams (Beta).
1951
2015
  *
1952
2016
  * > 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:
1953
- * > - For a local track: ["transceiver-updated"]{@link ILocalTrack.event_transceiver_updated}
1954
- * > - For a remote track: ["transceiver-updated-2"]{@link IRemoteTrack.event_transceiver_updated_2}
2017
+ * > - For a local track: [ILocalTrack.transceiver-updated]{@link event_transceiver_updated}
2018
+ * > - For a remote track: [IRemoteTrack.transceiver-updated]{@link event_transceiver_updated_2}
1955
2019
  *
1956
2020
  * @param type The type of the video stream. See {@link StreamType}.
1957
2021
  * @returns The [RTCRtpTransceiver](https://developer.mozilla.org/en-US/docs/Web/API/RTCRtpTransceiver) instance of the current track.
@@ -1975,23 +2039,21 @@ export declare class LocalAudioTrack extends LocalTrack implements ILocalAudioTr
1975
2039
  readonly trackMediaType: "audio" | "video";
1976
2040
  _encoderConfig?: AudioEncoderConfiguration;
1977
2041
  _trackSource: AudioTrackSource | FakeTrackSource;
1978
- get _source(): AudioTrackSource | FakeTrackSource;
2042
+ get _source(): AudioTrackSource;
1979
2043
  set _source(source: AudioTrackSource | FakeTrackSource);
1980
2044
  _enabled: boolean;
1981
2045
  private _volume;
1982
2046
  _useAudioElement: boolean;
1983
2047
  _bypassWebAudio: boolean;
1984
2048
  protected processor?: IAudioProcessor;
1985
- protected _processorContext: AudioProcessorContext;
2049
+ protected _processorContext: AudioProcessorContext | undefined;
1986
2050
  protected get processorContext(): AudioProcessorContext;
1987
- protected set processorContext(ctx: AudioProcessorContext);
1988
- _processorDestination: AudioProcessorDestination;
2051
+ _processorDestination: AudioProcessorDestination | undefined;
1989
2052
  get processorDestination(): AudioProcessorDestination;
1990
- set processorDestination(des: AudioProcessorDestination);
1991
2053
  protected _getOriginVolumeLevel: boolean;
1992
2054
  get isPlaying(): boolean;
1993
2055
  get __className__(): string;
1994
- constructor(track: MediaStreamTrack, encoderConfig?: AudioEncoderConfiguration, trackId?: string, getOriginVolumeLevel?: boolean, deferWebAudio?: boolean);
2056
+ constructor(track: MediaStreamTrack, encoderConfig?: AudioEncoderConfiguration, trackId?: string, getOriginVolumeLevel?: boolean);
1995
2057
  setVolume(volume: number): void;
1996
2058
  getVolumeLevel(): number;
1997
2059
  setPlaybackDevice(deviceId: string): Promise<void>;
@@ -2010,7 +2072,10 @@ export declare class LocalAudioTrack extends LocalTrack implements ILocalAudioTr
2010
2072
  unpipe(): void;
2011
2073
  private bindProcessorDestinationEvents;
2012
2074
  private unbindProcessorDestinationEvents;
2013
- private unbindProcessorContextEvents;
2075
+ protected bindProcessorContextEvents(processorContext: AudioProcessorContext): void;
2076
+ protected unbindProcessorContextEvents(processorContext: AudioProcessorContext): void;
2077
+ private initWebAudio;
2078
+ private initProcessor;
2014
2079
  }
2015
2080
 
2016
2081
  /**
@@ -2083,9 +2148,9 @@ export declare abstract class LocalTrack extends Track implements ILocalTrack {
2083
2148
  _isClosed: boolean;
2084
2149
  protected _enabledMutex: PromiseMutex;
2085
2150
  protected processor?: IBaseProcessor;
2086
- protected abstract _processorContext: IProcessorContext;
2087
- protected get processorContext(): IProcessorContext;
2088
- protected set processorContext(ctx: IProcessorContext);
2151
+ protected abstract _processorContext: IProcessorContext | undefined;
2152
+ protected get processorContext(): IProcessorContext | undefined;
2153
+ abstract processorDestination: IBaseProcessor;
2089
2154
  constructor(track: MediaStreamTrack, trackId?: string);
2090
2155
  abstract getStats(): LocalVideoTrackStats | LocalAudioTrackStats;
2091
2156
  abstract setMuted(enabled: boolean): Promise<void>;
@@ -2119,9 +2184,15 @@ export declare class LocalVideoTrack extends LocalTrack implements ILocalVideoTr
2119
2184
  protected _statsTimer: number | null;
2120
2185
  private _previousVideoVisibleStatus;
2121
2186
  private _clearPreviousVideoVisibleStatus;
2122
- _encoderConfig?: Partial<VideoEncoderConfiguration>;
2187
+ _encoderConfig?: Partial<VideoEncoderConfiguration & {
2188
+ scale: number;
2189
+ }>;
2123
2190
  _scalabilityMode?: SVCConfiguration;
2124
- _optimizationMode?: "motion" | "detail" | "balanced";
2191
+ _optimizationMode?: OptimizationMode | "balanced";
2192
+ _qualityLimitationReason?: QualityLimitationReason;
2193
+ private _originalSenderConfig?;
2194
+ _adaptationConfig?: VideoSenderConfig;
2195
+ private _adaptationTimer;
2125
2196
  _videoHeight?: number;
2126
2197
  _videoWidth?: number;
2127
2198
  _forceBitrateLimit?: {
@@ -2135,13 +2206,13 @@ export declare class LocalVideoTrack extends LocalTrack implements ILocalVideoTr
2135
2206
  protected get processorContext(): VideoProcessorContext;
2136
2207
  protected set processorContext(ctx: VideoProcessorContext);
2137
2208
  get __className__(): string;
2138
- constructor(track: MediaStreamTrack, encoderConfig?: Partial<VideoEncoderConfiguration>, scalabilityConfig?: SVCConfiguration, optimizationMode?: "motion" | "detail" | "balanced", trackId?: string, hints?: TrackHint[]);
2209
+ constructor(track: MediaStreamTrack, encoderConfig?: Partial<VideoEncoderConfiguration>, scalabilityConfig?: SVCConfiguration, optimizationMode?: OptimizationMode | "balanced", trackId?: string, hints?: TrackHint[]);
2139
2210
  play(element: HTMLElement | HTMLVideoElement | string, config?: VideoPlayerConfig): void;
2140
2211
  stop(): void;
2141
2212
  setEnabled(enabled: boolean, skipChangeState?: boolean): Promise<void>;
2142
2213
  setMuted(muted: boolean): Promise<void>;
2143
2214
  setEncoderConfiguration(config: VideoEncoderConfiguration | VideoEncoderConfigurationPreset, doNotRenegoation?: boolean): Promise<void>;
2144
- getStats(): LocalVideoTrackStats;
2215
+ getStats(isExternal?: boolean): LocalVideoTrackStats;
2145
2216
  setBeautyEffect(enabled: boolean, options?: BeautyEffectOptions): Promise<void>;
2146
2217
  getCurrentFrameData(): ImageData;
2147
2218
  getCurrentFrameImage(imageType: string, quality?: number): Promise<ImageTypedData>;
@@ -2149,7 +2220,10 @@ export declare class LocalVideoTrack extends LocalTrack implements ILocalVideoTr
2149
2220
  max_bitrate: number;
2150
2221
  min_bitrate: number;
2151
2222
  }): Promise<void>;
2152
- setOptimizationMode(mode: "motion" | "detail" | "balanced"): Promise<void>;
2223
+ setOptimizationMode(mode: OptimizationMode | "balanced"): Promise<void>;
2224
+ protected applyAdaptation(config: VideoSenderConfig): Promise<void>;
2225
+ startVideoStreamAdapter(): void;
2226
+ protected updateAdapterConfig(): void;
2153
2227
  setScalabiltyMode(mode: SVCConfiguration): void;
2154
2228
  updateMediaStreamTrackResolution(): void;
2155
2229
  protected _updatePlayerSource(): void;
@@ -2164,6 +2238,7 @@ export declare class LocalVideoTrack extends LocalTrack implements ILocalVideoTr
2164
2238
  clone(config?: VideoEncoderConfiguration | VideoEncoderConfigurationPreset, cloneTrack?: boolean): LocalVideoTrack;
2165
2239
  replaceTrack(track: MediaStreamTrack, stopOldTrack: boolean): Promise<void>;
2166
2240
  startMonitorStats(): void;
2241
+ sendSeiData(sei: Uint8Array): never;
2167
2242
  private bindProcessorDestinationEvents;
2168
2243
  private unbindProcessorDestinationEvents;
2169
2244
  private unbindProcessorContextEvents;
@@ -2177,7 +2252,6 @@ export declare interface LocalVideoTrackStats {
2177
2252
  * The video codec.
2178
2253
  *
2179
2254
  * - `"H264"`: The video codec is H.264.
2180
- * - `"H265"`: The video codec is H.265.
2181
2255
  * - `"VP8"`: The video codec is VP8.
2182
2256
  * - `"VP9"`: The video codec is VP9.
2183
2257
  * - `"AV1X"`: Reserved for future use.
@@ -2335,7 +2409,8 @@ export declare class MicrophoneAudioTrack extends LocalAudioTrack implements IMi
2335
2409
  close(): void;
2336
2410
  protected onTrackEnded(): void;
2337
2411
  renewMediaStreamTrack(newConstraints?: MediaTrackConstraints): Promise<void>;
2338
- private bindProcessorContextEvents;
2412
+ protected bindProcessorContextEvents(processorContext: AudioProcessorContext): void;
2413
+ protected unbindProcessorContextEvents(processorContext: AudioProcessorContext): void;
2339
2414
  }
2340
2415
 
2341
2416
  /**
@@ -2400,6 +2475,8 @@ export declare class MixingAudioTrack extends LocalAudioTrack {
2400
2475
  _updateRtpTransceiver(transceiver: RTCRtpTransceiver): void;
2401
2476
  }
2402
2477
 
2478
+ export declare type OptimizationMode = "motion" | "detail";
2479
+
2403
2480
  export declare interface PlayerConfig extends VideoPlayerConfig {
2404
2481
  trackId: string;
2405
2482
  element: HTMLElement;
@@ -2424,72 +2501,11 @@ export declare interface ProcessorUsageStats {
2424
2501
  totalTs: number;
2425
2502
  }
2426
2503
 
2427
- export declare interface PublishAudioUploadStats {
2428
- id: string;
2429
- timestamp: string;
2430
- mediaType: "audio";
2431
- type: "ssrc";
2432
- ssrc: string;
2433
- A_ail?: string;
2434
- A_apil?: string;
2435
- A_astd?: string;
2436
- A_ecrl?: string;
2437
- A_ecrle?: string;
2438
- bytesSent?: string;
2439
- packetsLost?: string;
2440
- packetsSent?: string;
2441
- }
2442
-
2443
- export declare interface PublishBandwidthUploadStats {
2444
- id: "bweforvideo";
2445
- type: "VideoBwe";
2446
- timestamp: string;
2447
- A_aeb?: string;
2448
- A_asb?: string;
2449
- A_rb?: string;
2450
- A_arb?: string;
2451
- A_teb?: string;
2452
- A_bd?: string;
2453
- A_tb?: string;
2454
- }
2455
-
2456
- export declare interface PublishVideoInputStats {
2457
- id: string;
2458
- timestamp: string;
2459
- mediaType: "video";
2460
- type: "ssrc";
2461
- ssrc: string;
2462
- A_fhi?: string;
2463
- A_fri?: string;
2464
- A_fwi?: string;
2465
- }
2466
-
2467
- export declare interface PublishVideoRelatedStats {
2468
- mediaType: "video";
2469
- isVideoMute: boolean;
2470
- frameRateInput?: string;
2471
- frameRateSent?: string;
2472
- googRtt: string;
2473
- qpSumPerFrame?: string;
2474
- }
2475
-
2476
- export declare interface PublishVideoUploadStats {
2477
- id: string;
2478
- timestamp: string;
2479
- mediaType: "video";
2480
- type: "ssrc";
2481
- ssrc: string;
2482
- A_fhs?: string;
2483
- A_frs?: string;
2484
- A_fws?: string;
2485
- A_nr?: string;
2486
- A_vstd?: string;
2487
- A_aem?: string;
2488
- A_lvps?: string;
2489
- A_ac?: string;
2490
- bytesSent?: string;
2491
- packetsLost?: string;
2492
- packetsSent?: string;
2504
+ declare enum QualityLimitationReason {
2505
+ BANDWIDTH = "bandwidth",
2506
+ CPU = "cpu",
2507
+ NONE = "none",
2508
+ OTHER = "other"
2493
2509
  }
2494
2510
 
2495
2511
  export declare class RemoteAudioTrack extends RemoteTrack implements IRemoteAudioTrack {
@@ -2620,7 +2636,7 @@ export declare enum RemoteStreamFallbackType {
2620
2636
  */
2621
2637
  DISABLE = 0,
2622
2638
  /**
2623
- * 1: (Default) Automatically subscribe to the low-video stream under poor network conditions. */
2639
+ * 1: Automatically subscribe to the low-video stream under poor network conditions. */
2624
2640
  LOW_STREAM = 1,
2625
2641
  /**
2626
2642
  * 2: Subscribe to the low-quality video stream when the network conditions worsen, and subscribe to audio only when the conditions become too poor to support video transmission.
@@ -2662,7 +2678,8 @@ export declare abstract class RemoteTrack extends Track implements IRemoteTrack
2662
2678
 
2663
2679
  export declare enum RemoteTrackEvents {
2664
2680
  FIRST_FRAME_DECODED = "first-frame-decoded",
2665
- VIDEO_ELEMENT_VISIBLE_STATUS = "video-element-visible-status"
2681
+ VIDEO_ELEMENT_VISIBLE_STATUS = "video-element-visible-status",
2682
+ VIDEO_STATE_CHANGED = "video-state-changed"
2666
2683
  }
2667
2684
 
2668
2685
  export declare class RemoteVideoTrack extends RemoteTrack implements IRemoteVideoTrack {
@@ -2690,6 +2707,7 @@ export declare class RemoteVideoTrack extends RemoteTrack implements IRemoteVide
2690
2707
  private bindProcessorDestinationEvents;
2691
2708
  private unbindProcessorDestinationEvents;
2692
2709
  _destroy(): void;
2710
+ _onSei(sei: Uint8Array): void;
2693
2711
  }
2694
2712
 
2695
2713
  /**
@@ -2706,7 +2724,6 @@ export declare interface RemoteVideoTrackStats {
2706
2724
  * The video codec.
2707
2725
  *
2708
2726
  * - `"H264"`: The video codec is H.264.
2709
- * - `"H265"`: The video codec is H.265.
2710
2727
  * - `"VP8"`: The video codec is VP8.
2711
2728
  * - `"VP9"`: The video codec is VP9.
2712
2729
  * - `"AV1X"`: Reserved for future use.
@@ -2958,6 +2975,12 @@ export declare interface ScreenVideoTrackInitConfig {
2958
2975
  systemAudio?: "include" | "exclude";
2959
2976
  }
2960
2977
 
2978
+ export declare type SenderConfig = {
2979
+ bitrateMax: number;
2980
+ bitrateMin: number;
2981
+ scaleResolutionDownBy: number;
2982
+ };
2983
+
2961
2984
  export declare function silenceScriptProcessHandler(e: AudioProcessingEvent): AudioBuffer;
2962
2985
 
2963
2986
  export declare interface StatsRegistry {
@@ -2978,77 +3001,6 @@ export declare enum StreamType {
2978
3001
  LOW_STREAM = 1
2979
3002
  }
2980
3003
 
2981
- export declare interface SubscribeAudioRelatedStats {
2982
- mediaType: "audio";
2983
- peerId: UID;
2984
- isAudioMute: boolean;
2985
- frameDropped?: string;
2986
- frameReceived?: string;
2987
- googJitterReceived: string;
2988
- bytesReceived: string;
2989
- packetsReceived: string;
2990
- isFreeze: boolean;
2991
- packetsLost: string;
2992
- }
2993
-
2994
- export declare interface SubscribeAudioUploadStats {
2995
- id: string;
2996
- timestamp: string;
2997
- mediaType: "audio";
2998
- type: "ssrc";
2999
- ssrc: string;
3000
- bytesReceived?: string;
3001
- packetsLost?: string;
3002
- packetsReceived?: string;
3003
- A_aol?: string;
3004
- A_apol?: string;
3005
- A_jr?: string;
3006
- A_jbm?: string;
3007
- A_cdm?: string;
3008
- A_artd?: string;
3009
- A_raps?: string;
3010
- A_cs?: string;
3011
- }
3012
-
3013
- export declare interface SubscribeVideoRelatedStats {
3014
- mediaType: "video";
3015
- peerId: UID;
3016
- isVideoMute: boolean;
3017
- frameRateReceived?: string;
3018
- frameRateDecoded?: string;
3019
- bytesReceived: string;
3020
- packetsReceived: string;
3021
- isFreeze: boolean;
3022
- packetsLost: string;
3023
- qpSumPerFrame?: string;
3024
- }
3025
-
3026
- export declare interface SubscribeVideoUploadStats {
3027
- id: string;
3028
- timestamp: string;
3029
- mediaType: "video";
3030
- type: "ssrc";
3031
- ssrc: string;
3032
- bytesReceived?: string;
3033
- packetsLost?: string;
3034
- packetsReceived?: string;
3035
- A_frr?: string;
3036
- A_frd?: string;
3037
- A_fro?: string;
3038
- A_jbm?: string;
3039
- A_cdm?: string;
3040
- A_ns?: string;
3041
- A_ps?: string;
3042
- A_fs?: string;
3043
- A_vrtd?: string;
3044
- A_vrft?: string;
3045
- A_rvps?: string;
3046
- A_fhr?: string;
3047
- A_fwr?: string;
3048
- A_vrrft?: string;
3049
- A_ifdsd?: string;
3050
- }
3051
-
3052
3004
  export declare const SUPPORT_720P_AUTO_CONFIG_LIST: Required<{
3053
3005
  scaleResolutionDownBy: number;
3054
3006
  width: number;
@@ -3124,7 +3076,9 @@ export declare abstract class Track extends EventEmitter implements ITrack {
3124
3076
  _hints: TrackHint[];
3125
3077
  _isClosed: boolean;
3126
3078
  _originMediaStreamTrack: MediaStreamTrack;
3127
- _mediaStreamTrack: MediaStreamTrack;
3079
+ mediaStreamTrack: MediaStreamTrack;
3080
+ set _mediaStreamTrack(track: MediaStreamTrack);
3081
+ get _mediaStreamTrack(): MediaStreamTrack;
3128
3082
  _external: ExternalMethods;
3129
3083
  constructor(track: MediaStreamTrack, trackId?: string);
3130
3084
  toString(): string;
@@ -3139,7 +3093,10 @@ export declare abstract class Track extends EventEmitter implements ITrack {
3139
3093
  }
3140
3094
 
3141
3095
  export declare enum TrackEvents {
3142
- TRANSCEIVER_UPDATED = "transceiver-updated"
3096
+ TRANSCEIVER_UPDATED = "transceiver-updated",
3097
+ SEI_TO_SEND = "sei-to-send",
3098
+ SEI_RECEIVED = "sei-received",
3099
+ TRACK_UPDATED = "track-updated"
3143
3100
  }
3144
3101
 
3145
3102
  export declare enum TrackHint {
@@ -3151,6 +3108,7 @@ export declare enum TrackHint {
3151
3108
  export declare enum TrackInternalEvent {
3152
3109
  NEED_RENEGOTIATE = "@need_renegotiate",
3153
3110
  NEED_REPLACE_TRACK = "@need_replace_track",
3111
+ NEED_REPLACE_MIXING_TRACK = "@need_replace_mixing_track",
3154
3112
  NEED_CLOSE = "@need_close",
3155
3113
  NEED_ENABLE_TRACK = "@need_enable_track",
3156
3114
  NEED_DISABLE_TRACK = "@need_disable_track",
@@ -3161,15 +3119,11 @@ export declare enum TrackInternalEvent {
3161
3119
  GET_LOW_VIDEO_TRACK = "@get_low_video_track",
3162
3120
  NEED_RESET_REMOTE_SDP = "@need_reset_remote_sdp",
3163
3121
  NEED_UPDATE_VIDEO_ENCODER = "@need_update_video_encoder",
3122
+ NEED_UPDATE_VIDEO_SEND_PARAMETERS = "@need_update_video_send_parameters",
3164
3123
  NEED_MUTE_TRACK = "@need_mute_track",
3165
3124
  NEED_UNMUTE_TRACK = "@need_unmute_track"
3166
3125
  }
3167
3126
 
3168
- export declare interface TransportUploadStats {
3169
- connectionType: number;
3170
- googRtt?: number;
3171
- }
3172
-
3173
3127
  export declare function updateAgoraRTCCompatibility(): void;
3174
3128
 
3175
3129
  export declare interface UsageRegistry {
@@ -3287,6 +3241,7 @@ declare class VideoPlayer {
3287
3241
  trackId: string;
3288
3242
  config: PlayerConfig;
3289
3243
  onFirstVideoFrameDecoded?: () => void;
3244
+ onVideoStateChanged?: (state: VideoState) => void;
3290
3245
  freezeTimeCounterList: number[];
3291
3246
  renderFreezeAccTime: number;
3292
3247
  isKeepLastFrame: boolean;
@@ -3300,7 +3255,11 @@ declare class VideoPlayer {
3300
3255
  protected cacheVideoElement?: HTMLVideoElement;
3301
3256
  get videoElementStatus(): MediaElementStatus;
3302
3257
  set videoElementStatus(status: MediaElementStatus);
3258
+ get videoState(): VideoState;
3259
+ set videoState(state: VideoState);
3260
+ private _videoState;
3303
3261
  private videoElementCheckInterval?;
3262
+ private videoElementFreezeTimeout?;
3304
3263
  private _videoElementStatus;
3305
3264
  private isGettingVideoDimensions;
3306
3265
  constructor(config: PlayerConfig);
@@ -3391,6 +3350,36 @@ export declare class VideoProcessorDestination extends EventEmitter implements I
3391
3350
  reset(): void;
3392
3351
  }
3393
3352
 
3353
+ declare interface VideoSenderConfig {
3354
+ frameRate: number;
3355
+ bitrateMax: number;
3356
+ bitrateMin: number;
3357
+ scaleResolutionDownBy: number;
3358
+ scale: number;
3359
+ }
3360
+
3361
+ /**
3362
+ * The state of the video stream.
3363
+ */
3364
+ export declare enum VideoState {
3365
+ /**
3366
+ * 0: The initial state of the video.
3367
+ */
3368
+ VideoStateStopped = 0,
3369
+ /**
3370
+ * 1: The local user has received the first video packet.
3371
+ */
3372
+ VideoStateStarting = 1,
3373
+ /**
3374
+ * 2: The video stream is being decoded and played normally.
3375
+ */
3376
+ VideoStateDecoding = 2,
3377
+ /**
3378
+ * 3: The video stream is frozen.
3379
+ */
3380
+ VideoStateFrozen = 3
3381
+ }
3382
+
3394
3383
  declare class VisibilityWatcher extends EventEmitter {
3395
3384
  private _lastHiddenTime;
3396
3385
  private _lastVisibleTime;