@agora-js/media 4.20.0 → 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.
- package/AgoraRTC_N-media.esm.mjs +2 -2
- package/AgoraRTC_N-media.js +3 -2
- package/media.d.ts +224 -29
- package/package.json +3 -3
- package/rtc-sdk-media_en.d.ts +161 -26
package/rtc-sdk-media_en.d.ts
CHANGED
|
@@ -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?:
|
|
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?:
|
|
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>   *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
|
|
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}.
|
|
@@ -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/
|
|
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
|
/**
|
|
@@ -1469,7 +1502,7 @@ export declare interface ILocalVideoTrack extends ILocalTrack {
|
|
|
1469
1502
|
*/
|
|
1470
1503
|
on(event: "transceiver-updated", listener: typeof event_transceiver_updated): void;
|
|
1471
1504
|
/**
|
|
1472
|
-
* Plays a
|
|
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}.
|
|
@@ -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}.
|
|
@@ -1836,6 +1894,12 @@ export declare interface IRemoteVideoTrack extends IRemoteTrack {
|
|
|
1836
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
|
*
|
|
@@ -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
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
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?:
|
|
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?:
|
|
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:
|
|
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;
|
|
@@ -2334,7 +2409,8 @@ export declare class MicrophoneAudioTrack extends LocalAudioTrack implements IMi
|
|
|
2334
2409
|
close(): void;
|
|
2335
2410
|
protected onTrackEnded(): void;
|
|
2336
2411
|
renewMediaStreamTrack(newConstraints?: MediaTrackConstraints): Promise<void>;
|
|
2337
|
-
|
|
2412
|
+
protected bindProcessorContextEvents(processorContext: AudioProcessorContext): void;
|
|
2413
|
+
protected unbindProcessorContextEvents(processorContext: AudioProcessorContext): void;
|
|
2338
2414
|
}
|
|
2339
2415
|
|
|
2340
2416
|
/**
|
|
@@ -2399,6 +2475,8 @@ export declare class MixingAudioTrack extends LocalAudioTrack {
|
|
|
2399
2475
|
_updateRtpTransceiver(transceiver: RTCRtpTransceiver): void;
|
|
2400
2476
|
}
|
|
2401
2477
|
|
|
2478
|
+
export declare type OptimizationMode = "motion" | "detail";
|
|
2479
|
+
|
|
2402
2480
|
export declare interface PlayerConfig extends VideoPlayerConfig {
|
|
2403
2481
|
trackId: string;
|
|
2404
2482
|
element: HTMLElement;
|
|
@@ -2423,6 +2501,13 @@ export declare interface ProcessorUsageStats {
|
|
|
2423
2501
|
totalTs: number;
|
|
2424
2502
|
}
|
|
2425
2503
|
|
|
2504
|
+
declare enum QualityLimitationReason {
|
|
2505
|
+
BANDWIDTH = "bandwidth",
|
|
2506
|
+
CPU = "cpu",
|
|
2507
|
+
NONE = "none",
|
|
2508
|
+
OTHER = "other"
|
|
2509
|
+
}
|
|
2510
|
+
|
|
2426
2511
|
export declare class RemoteAudioTrack extends RemoteTrack implements IRemoteAudioTrack {
|
|
2427
2512
|
readonly trackMediaType: "audio" | "video";
|
|
2428
2513
|
_source: AudioTrackSource | FakeTrackSource;
|
|
@@ -2593,7 +2678,8 @@ export declare abstract class RemoteTrack extends Track implements IRemoteTrack
|
|
|
2593
2678
|
|
|
2594
2679
|
export declare enum RemoteTrackEvents {
|
|
2595
2680
|
FIRST_FRAME_DECODED = "first-frame-decoded",
|
|
2596
|
-
VIDEO_ELEMENT_VISIBLE_STATUS = "video-element-visible-status"
|
|
2681
|
+
VIDEO_ELEMENT_VISIBLE_STATUS = "video-element-visible-status",
|
|
2682
|
+
VIDEO_STATE_CHANGED = "video-state-changed"
|
|
2597
2683
|
}
|
|
2598
2684
|
|
|
2599
2685
|
export declare class RemoteVideoTrack extends RemoteTrack implements IRemoteVideoTrack {
|
|
@@ -2621,6 +2707,7 @@ export declare class RemoteVideoTrack extends RemoteTrack implements IRemoteVide
|
|
|
2621
2707
|
private bindProcessorDestinationEvents;
|
|
2622
2708
|
private unbindProcessorDestinationEvents;
|
|
2623
2709
|
_destroy(): void;
|
|
2710
|
+
_onSei(sei: Uint8Array): void;
|
|
2624
2711
|
}
|
|
2625
2712
|
|
|
2626
2713
|
/**
|
|
@@ -2888,6 +2975,12 @@ export declare interface ScreenVideoTrackInitConfig {
|
|
|
2888
2975
|
systemAudio?: "include" | "exclude";
|
|
2889
2976
|
}
|
|
2890
2977
|
|
|
2978
|
+
export declare type SenderConfig = {
|
|
2979
|
+
bitrateMax: number;
|
|
2980
|
+
bitrateMin: number;
|
|
2981
|
+
scaleResolutionDownBy: number;
|
|
2982
|
+
};
|
|
2983
|
+
|
|
2891
2984
|
export declare function silenceScriptProcessHandler(e: AudioProcessingEvent): AudioBuffer;
|
|
2892
2985
|
|
|
2893
2986
|
export declare interface StatsRegistry {
|
|
@@ -2983,7 +3076,9 @@ export declare abstract class Track extends EventEmitter implements ITrack {
|
|
|
2983
3076
|
_hints: TrackHint[];
|
|
2984
3077
|
_isClosed: boolean;
|
|
2985
3078
|
_originMediaStreamTrack: MediaStreamTrack;
|
|
2986
|
-
|
|
3079
|
+
mediaStreamTrack: MediaStreamTrack;
|
|
3080
|
+
set _mediaStreamTrack(track: MediaStreamTrack);
|
|
3081
|
+
get _mediaStreamTrack(): MediaStreamTrack;
|
|
2987
3082
|
_external: ExternalMethods;
|
|
2988
3083
|
constructor(track: MediaStreamTrack, trackId?: string);
|
|
2989
3084
|
toString(): string;
|
|
@@ -2998,7 +3093,10 @@ export declare abstract class Track extends EventEmitter implements ITrack {
|
|
|
2998
3093
|
}
|
|
2999
3094
|
|
|
3000
3095
|
export declare enum TrackEvents {
|
|
3001
|
-
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"
|
|
3002
3100
|
}
|
|
3003
3101
|
|
|
3004
3102
|
export declare enum TrackHint {
|
|
@@ -3010,6 +3108,7 @@ export declare enum TrackHint {
|
|
|
3010
3108
|
export declare enum TrackInternalEvent {
|
|
3011
3109
|
NEED_RENEGOTIATE = "@need_renegotiate",
|
|
3012
3110
|
NEED_REPLACE_TRACK = "@need_replace_track",
|
|
3111
|
+
NEED_REPLACE_MIXING_TRACK = "@need_replace_mixing_track",
|
|
3013
3112
|
NEED_CLOSE = "@need_close",
|
|
3014
3113
|
NEED_ENABLE_TRACK = "@need_enable_track",
|
|
3015
3114
|
NEED_DISABLE_TRACK = "@need_disable_track",
|
|
@@ -3020,6 +3119,7 @@ export declare enum TrackInternalEvent {
|
|
|
3020
3119
|
GET_LOW_VIDEO_TRACK = "@get_low_video_track",
|
|
3021
3120
|
NEED_RESET_REMOTE_SDP = "@need_reset_remote_sdp",
|
|
3022
3121
|
NEED_UPDATE_VIDEO_ENCODER = "@need_update_video_encoder",
|
|
3122
|
+
NEED_UPDATE_VIDEO_SEND_PARAMETERS = "@need_update_video_send_parameters",
|
|
3023
3123
|
NEED_MUTE_TRACK = "@need_mute_track",
|
|
3024
3124
|
NEED_UNMUTE_TRACK = "@need_unmute_track"
|
|
3025
3125
|
}
|
|
@@ -3141,6 +3241,7 @@ declare class VideoPlayer {
|
|
|
3141
3241
|
trackId: string;
|
|
3142
3242
|
config: PlayerConfig;
|
|
3143
3243
|
onFirstVideoFrameDecoded?: () => void;
|
|
3244
|
+
onVideoStateChanged?: (state: VideoState) => void;
|
|
3144
3245
|
freezeTimeCounterList: number[];
|
|
3145
3246
|
renderFreezeAccTime: number;
|
|
3146
3247
|
isKeepLastFrame: boolean;
|
|
@@ -3154,7 +3255,11 @@ declare class VideoPlayer {
|
|
|
3154
3255
|
protected cacheVideoElement?: HTMLVideoElement;
|
|
3155
3256
|
get videoElementStatus(): MediaElementStatus;
|
|
3156
3257
|
set videoElementStatus(status: MediaElementStatus);
|
|
3258
|
+
get videoState(): VideoState;
|
|
3259
|
+
set videoState(state: VideoState);
|
|
3260
|
+
private _videoState;
|
|
3157
3261
|
private videoElementCheckInterval?;
|
|
3262
|
+
private videoElementFreezeTimeout?;
|
|
3158
3263
|
private _videoElementStatus;
|
|
3159
3264
|
private isGettingVideoDimensions;
|
|
3160
3265
|
constructor(config: PlayerConfig);
|
|
@@ -3245,6 +3350,36 @@ export declare class VideoProcessorDestination extends EventEmitter implements I
|
|
|
3245
3350
|
reset(): void;
|
|
3246
3351
|
}
|
|
3247
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
|
+
|
|
3248
3383
|
declare class VisibilityWatcher extends EventEmitter {
|
|
3249
3384
|
private _lastHiddenTime;
|
|
3250
3385
|
private _lastVisibleTime;
|