@agora-js/media 4.20.0 → 4.20.1-100
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 +160 -22
- package/package.json +3 -3
- package/rtc-sdk-media_en.d.ts +117 -19
package/media.d.ts
CHANGED
|
@@ -420,6 +420,8 @@ export declare class AudioProcessorDestination extends EventEmitter implements I
|
|
|
420
420
|
}): void;
|
|
421
421
|
}
|
|
422
422
|
|
|
423
|
+
declare type AudioRenderMode = "stereo" | "mono" | "surround";
|
|
424
|
+
|
|
423
425
|
declare abstract class AudioSource extends EventEmitter {
|
|
424
426
|
outputNode: GainNode;
|
|
425
427
|
outputTrack?: MediaStreamTrack;
|
|
@@ -985,6 +987,7 @@ export declare interface CustomAudioTrackInitConfig {
|
|
|
985
987
|
* > Firefox does not support setting the audio encoding rate.
|
|
986
988
|
*/
|
|
987
989
|
encoderConfig?: AudioEncoderConfiguration | AudioEncoderConfigurationPreset;
|
|
990
|
+
channelCount?: number;
|
|
988
991
|
}
|
|
989
992
|
|
|
990
993
|
/**
|
|
@@ -1354,6 +1357,28 @@ declare function event_beauty_effect_overload(): void;
|
|
|
1354
1357
|
*/
|
|
1355
1358
|
declare function event_first_frame_decoded(): void;
|
|
1356
1359
|
|
|
1360
|
+
/**
|
|
1361
|
+
* **自从**
|
|
1362
|
+
* <br>   *4.20.1*
|
|
1363
|
+
*
|
|
1364
|
+
* 从 H.264 视频流中解析出 SEI 数据时触发,此事件会返回 SEI 数据。
|
|
1365
|
+
*
|
|
1366
|
+
* @param sei Uint8Array 类型的 SEI 数据
|
|
1367
|
+
* @asMemberOf ILocalVideoTrack
|
|
1368
|
+
* @event
|
|
1369
|
+
*/
|
|
1370
|
+
/** @en
|
|
1371
|
+
* **Since**
|
|
1372
|
+
* <br>   *4.20.1*
|
|
1373
|
+
*
|
|
1374
|
+
* Parsing SEI data from the H.264 video stream triggers this event, which returns the SEI data.
|
|
1375
|
+
*
|
|
1376
|
+
* @param sei SEI data in Uint8Array
|
|
1377
|
+
* @asMemberOf ILocalVideoTrack
|
|
1378
|
+
* @event
|
|
1379
|
+
*/
|
|
1380
|
+
declare function event_sei_received(sei: Uint8Array): void;
|
|
1381
|
+
|
|
1357
1382
|
/**
|
|
1358
1383
|
* 当 [BufferSourceAudioTrack]{@link IBufferSourceAudioTrack} 的音频数据源处理状态变化时,会触发此事件。
|
|
1359
1384
|
*
|
|
@@ -1533,6 +1558,20 @@ declare function event_video_element_visible_status(data?: CheckVideoVisibleResu
|
|
|
1533
1558
|
*/
|
|
1534
1559
|
declare function event_video_element_visible_status_2(data?: CheckVideoVisibleResult): void;
|
|
1535
1560
|
|
|
1561
|
+
/**
|
|
1562
|
+
* 视频状态发生变化时触发。
|
|
1563
|
+
*
|
|
1564
|
+
* @event
|
|
1565
|
+
* @asMemberOf IRemoteTrack
|
|
1566
|
+
*/
|
|
1567
|
+
/** @en
|
|
1568
|
+
* Occurs when the video state changes.
|
|
1569
|
+
*
|
|
1570
|
+
* @event
|
|
1571
|
+
* @asMemberOf IRemoteTrack
|
|
1572
|
+
*/
|
|
1573
|
+
declare function event_video_state_changed(videoState: VideoState): void;
|
|
1574
|
+
|
|
1536
1575
|
export declare interface ExtendedVideoFrameCallbackMetadata extends VideoFrameCallbackMetadata {
|
|
1537
1576
|
timestamp: DOMHighResTimeStamp;
|
|
1538
1577
|
}
|
|
@@ -1576,7 +1615,7 @@ export declare function getAudioContext(): AudioContext;
|
|
|
1576
1615
|
|
|
1577
1616
|
export declare function getAudioEncoderConfiguration(profile: AudioEncoderConfigurationPreset | AudioEncoderConfiguration): AudioEncoderConfiguration;
|
|
1578
1617
|
|
|
1579
|
-
export declare function
|
|
1618
|
+
export declare function getBitrateConstrainRange(width: number, height: number, frameRate: number, bitrateMin?: number, bitrateMax?: number): DoubleRange;
|
|
1580
1619
|
|
|
1581
1620
|
export declare function getCompatibility(): AgoraRTCCompatibility;
|
|
1582
1621
|
|
|
@@ -2034,7 +2073,6 @@ export declare interface ILocalAudioTrack extends ILocalTrack {
|
|
|
2034
2073
|
*
|
|
2035
2074
|
* > 注意事项:
|
|
2036
2075
|
* > - 自 v4.7.0 起,该方法不再生效。请改用 [IRemoteAudioTrack.setPlaybackDevice]{@link IRemoteAudioTrack.setPlaybackDevice}。
|
|
2037
|
-
* > - 该方法只支持桌面端的 Chrome 浏览器,其他浏览器调用将会抛出 `NOT_SUPPORTED` 错误。
|
|
2038
2076
|
*
|
|
2039
2077
|
* 设置本地播放远端音频流的设备(扬声器)。
|
|
2040
2078
|
*
|
|
@@ -2046,7 +2084,6 @@ export declare interface ILocalAudioTrack extends ILocalTrack {
|
|
|
2046
2084
|
*
|
|
2047
2085
|
* > Note:
|
|
2048
2086
|
* > - 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
2087
|
*
|
|
2051
2088
|
* Sets the playback device (speaker) for the remote audio stream.
|
|
2052
2089
|
*
|
|
@@ -2065,6 +2102,8 @@ export declare interface ILocalAudioTrack extends ILocalTrack {
|
|
|
2065
2102
|
* **DEPRECATED** from v4.1.0. Use [AgoraRTCClient.getLocalVideoStats]{@link IAgoraRTCClient.getLocalVideoStats} and [AgoraRTCClient.getLocalAudioStats]{@link IAgoraRTCClient.getLocalAudioStats} instead.
|
|
2066
2103
|
*/
|
|
2067
2104
|
getStats(): LocalAudioTrackStats;
|
|
2105
|
+
selectChannels(channels: number[], mode: AudioRenderMode): void;
|
|
2106
|
+
getVolumeLevels(channels?: number[]): number[];
|
|
2068
2107
|
/**
|
|
2069
2108
|
* **自从**
|
|
2070
2109
|
* <br>   *4.10.0*
|
|
@@ -2241,7 +2280,7 @@ export declare interface ILocalTrack extends ITrack {
|
|
|
2241
2280
|
*
|
|
2242
2281
|
* 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
2282
|
*
|
|
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/
|
|
2283
|
+
* > - 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
2284
|
* > - Do not call `setEnabled` and `setMuted` together.
|
|
2246
2285
|
*
|
|
2247
2286
|
* @param muted Whether to stop sending the media data of the track:
|
|
@@ -2317,7 +2356,7 @@ export declare interface ILocalVideoTrack extends ILocalTrack {
|
|
|
2317
2356
|
*/
|
|
2318
2357
|
on(event: "transceiver-updated", listener: typeof event_transceiver_updated): void;
|
|
2319
2358
|
/**
|
|
2320
|
-
*
|
|
2359
|
+
* 在页面上播放远端视频轨道。
|
|
2321
2360
|
*
|
|
2322
2361
|
* @param element 指定一个 DOM 元素,SDK 将在这个元素下创建 `<video>` 元素播放视频轨道,支持 2 种类型:
|
|
2323
2362
|
* - `string`: 指定该 DOM 元素的 ID 值。
|
|
@@ -2325,7 +2364,7 @@ export declare interface ILocalVideoTrack extends ILocalTrack {
|
|
|
2325
2364
|
* @param config 设置播放参数(镜像/显示模式)。详见 [[VideoPlayerConfig]]。对于本地视频轨道,镜像模式默认开启。
|
|
2326
2365
|
*/
|
|
2327
2366
|
/** @en
|
|
2328
|
-
* Plays a
|
|
2367
|
+
* Plays a remote video track on the web page.
|
|
2329
2368
|
*
|
|
2330
2369
|
* @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
2370
|
* - `string`: Specify the ID of the DOM element.
|
|
@@ -2641,6 +2680,17 @@ export declare interface ILocalVideoTrack extends ILocalTrack {
|
|
|
2641
2680
|
* @param config The video encoder configurations. You can pass either [[VideoEncoderConfigurationPreset]] or a customized [[VideoEncoderConfiguration]] object.
|
|
2642
2681
|
*/
|
|
2643
2682
|
setEncoderConfiguration(config: VideoEncoderConfiguration | VideoEncoderConfigurationPreset): Promise<void>;
|
|
2683
|
+
/**
|
|
2684
|
+
* 在 H.264 视频流中添加 SEI 数据。
|
|
2685
|
+
*
|
|
2686
|
+
* @param sei SEI 数据。
|
|
2687
|
+
*/
|
|
2688
|
+
/** @en
|
|
2689
|
+
* Add the SEI data to the H.264 video stream.
|
|
2690
|
+
*
|
|
2691
|
+
* @param config SEI data.
|
|
2692
|
+
*/
|
|
2693
|
+
sendSeiData(sei: Uint8Array): void;
|
|
2644
2694
|
}
|
|
2645
2695
|
|
|
2646
2696
|
export declare interface ImageTypedData {
|
|
@@ -2710,6 +2760,18 @@ export declare interface IMicrophoneAudioTrack extends ILocalAudioTrack {
|
|
|
2710
2760
|
setEnabled(enabled: boolean): Promise<void>;
|
|
2711
2761
|
}
|
|
2712
2762
|
|
|
2763
|
+
export declare function interceptLocalAudioFrame(sender: RTCRtpSender): Promise<void>;
|
|
2764
|
+
|
|
2765
|
+
export declare function interceptLocalVideoFrame(sender: RTCRtpSender, localVideoTrack: LocalVideoTrack): Promise<void>;
|
|
2766
|
+
|
|
2767
|
+
export declare function interceptRemoteAudioFrame(receiver: RTCRtpReceiver): Promise<void>;
|
|
2768
|
+
|
|
2769
|
+
export declare function interceptRemoteVideoFrame(receiver: RTCRtpReceiver, options?: InterceptVideoFrameOptions): Promise<void>;
|
|
2770
|
+
|
|
2771
|
+
declare interface InterceptVideoFrameOptions {
|
|
2772
|
+
onSei?: (sei: Uint8Array) => void;
|
|
2773
|
+
}
|
|
2774
|
+
|
|
2713
2775
|
/**
|
|
2714
2776
|
* 远端音频轨道,调用 [subscribe]{@link IAgoraRTCClient.subscribe} 后通过 [AgoraRTCRemoteUser.audioTrack]{@link IAgoraRTCRemoteUser.audioTrack} 对象获取
|
|
2715
2777
|
*/
|
|
@@ -2749,7 +2811,7 @@ export declare interface IRemoteAudioTrack extends IRemoteTrack {
|
|
|
2749
2811
|
*
|
|
2750
2812
|
* 设置音频播放设备,比如扬声器。
|
|
2751
2813
|
*
|
|
2752
|
-
* > 该方法只支持桌面端的 Chrome 浏览器,其他浏览器调用将会抛出 `NOT_SUPPORTED` 错误。
|
|
2814
|
+
* > 该方法只支持桌面端的 Chrome 和 Edge 浏览器,其他浏览器调用将会抛出 `NOT_SUPPORTED` 错误。
|
|
2753
2815
|
* @param deviceId 设备 ID,可以通过 [[getPlaybackDevices]] 方法获取。
|
|
2754
2816
|
*/
|
|
2755
2817
|
/** @en
|
|
@@ -2758,7 +2820,7 @@ export declare interface IRemoteAudioTrack extends IRemoteTrack {
|
|
|
2758
2820
|
*
|
|
2759
2821
|
* Sets the audio playback device, for example, the speaker.
|
|
2760
2822
|
*
|
|
2761
|
-
* > This method supports Chrome on desktop devices only. Other browsers throw a `NOT_SUPPORTED` error when calling this method.
|
|
2823
|
+
* > This method supports Chrome and Edge on desktop devices only. Other browsers throw a `NOT_SUPPORTED` error when calling this method.
|
|
2762
2824
|
* @param deviceId Device ID, which can be retrieved by calling [[getPlaybackDevices]].
|
|
2763
2825
|
*/
|
|
2764
2826
|
setPlaybackDevice(deviceId: string): Promise<void>;
|
|
@@ -2833,6 +2895,8 @@ export declare interface IRemoteAudioTrack extends IRemoteTrack {
|
|
|
2833
2895
|
* Usually a user with audio level above 0.6 is a speaking user.
|
|
2834
2896
|
*/
|
|
2835
2897
|
getVolumeLevel(): number;
|
|
2898
|
+
selectChannels(channels: number[], mode: AudioRenderMode): void;
|
|
2899
|
+
getVolumeLevels(channels?: number[]): number[];
|
|
2836
2900
|
/**
|
|
2837
2901
|
* **自从**
|
|
2838
2902
|
* <br>   *4.13.0*
|
|
@@ -2963,6 +3027,15 @@ export declare interface IRemoteTrack extends ITrack {
|
|
|
2963
3027
|
* You can get create a remote video track by the [AgoraRTCRemoteUser.videoTrack]{@link IAgoraRTCRemoteUser.videoTrack} object after calling [subscribe]{@link IAgoraRTCClient.subscribe}.
|
|
2964
3028
|
*/
|
|
2965
3029
|
export declare interface IRemoteVideoTrack extends IRemoteTrack {
|
|
3030
|
+
/**
|
|
3031
|
+
* @param event 事件名称。
|
|
3032
|
+
* @param listener 详见 [video-state-changed]{@link event_video_state_changed}。
|
|
3033
|
+
*/
|
|
3034
|
+
/** @en
|
|
3035
|
+
* @param event The event name.
|
|
3036
|
+
* @param listener See [video-state-changed]{@link event_video_state_changed}.
|
|
3037
|
+
*/
|
|
3038
|
+
on(event: "video-state-changed", listener: typeof event_video_state_changed): void;
|
|
2966
3039
|
/**
|
|
2967
3040
|
* @param event 事件名称。
|
|
2968
3041
|
* @param listener 详见 [first-frame-decoded]{@link event_first_frame_decoded}。
|
|
@@ -2992,6 +3065,17 @@ export declare interface IRemoteVideoTrack extends IRemoteTrack {
|
|
|
2992
3065
|
* @param listener See [IRemoteTrack.transceiver-updated]{@link event_transceiver_updated_2}.
|
|
2993
3066
|
*/
|
|
2994
3067
|
on(event: "transceiver-updated", listener: typeof event_transceiver_updated_2): void;
|
|
3068
|
+
/**
|
|
3069
|
+
* 添加事件监听器。
|
|
3070
|
+
* @param event 事件名称。
|
|
3071
|
+
* @param listener 详见 [ILocalTrack.sei-received]{@link event_sei_received}。
|
|
3072
|
+
*/
|
|
3073
|
+
/** @en
|
|
3074
|
+
* Adds an event listener.
|
|
3075
|
+
* @param event The event name.
|
|
3076
|
+
* @param listener See [ILocalTrack.sei-received]{@link event_sei_received}.
|
|
3077
|
+
*/
|
|
3078
|
+
on(event: "sei-received", listener: typeof event_sei_received): void;
|
|
2995
3079
|
/**
|
|
2996
3080
|
* 获取远端视频轨道相关信息。
|
|
2997
3081
|
*
|
|
@@ -3241,23 +3325,28 @@ export declare class LocalAudioTrack extends LocalTrack implements ILocalAudioTr
|
|
|
3241
3325
|
readonly trackMediaType: "audio" | "video";
|
|
3242
3326
|
_encoderConfig?: AudioEncoderConfiguration;
|
|
3243
3327
|
_trackSource: AudioTrackSource | FakeTrackSource;
|
|
3244
|
-
|
|
3328
|
+
channelCount?: number;
|
|
3329
|
+
private transformer?;
|
|
3330
|
+
/**
|
|
3331
|
+
* @description This method is used to init WebAudio, if you're sure you don't want to use WebAudio, call _trackSource
|
|
3332
|
+
*/
|
|
3333
|
+
get _source(): AudioTrackSource;
|
|
3245
3334
|
set _source(source: AudioTrackSource | FakeTrackSource);
|
|
3246
3335
|
_enabled: boolean;
|
|
3247
3336
|
private _volume;
|
|
3248
3337
|
_useAudioElement: boolean;
|
|
3249
3338
|
_bypassWebAudio: boolean;
|
|
3250
3339
|
protected processor?: IAudioProcessor;
|
|
3251
|
-
protected _processorContext: AudioProcessorContext;
|
|
3340
|
+
protected _processorContext: AudioProcessorContext | undefined;
|
|
3252
3341
|
protected get processorContext(): AudioProcessorContext;
|
|
3253
|
-
|
|
3254
|
-
_processorDestination: AudioProcessorDestination;
|
|
3342
|
+
_processorDestination: AudioProcessorDestination | undefined;
|
|
3255
3343
|
get processorDestination(): AudioProcessorDestination;
|
|
3256
|
-
set processorDestination(des: AudioProcessorDestination);
|
|
3257
3344
|
protected _getOriginVolumeLevel: boolean;
|
|
3258
3345
|
get isPlaying(): boolean;
|
|
3259
3346
|
get __className__(): string;
|
|
3260
|
-
constructor(track: MediaStreamTrack, encoderConfig?: AudioEncoderConfiguration, trackId?: string, getOriginVolumeLevel?: boolean,
|
|
3347
|
+
constructor(track: MediaStreamTrack, encoderConfig?: AudioEncoderConfiguration, trackId?: string, getOriginVolumeLevel?: boolean, channelCount?: number);
|
|
3348
|
+
selectChannels(channels: number[], mode?: AudioRenderMode): void;
|
|
3349
|
+
getVolumeLevels(channels?: number[]): number[];
|
|
3261
3350
|
setVolume(volume: number): void;
|
|
3262
3351
|
getVolumeLevel(): number;
|
|
3263
3352
|
setPlaybackDevice(deviceId: string): Promise<void>;
|
|
@@ -3276,7 +3365,10 @@ export declare class LocalAudioTrack extends LocalTrack implements ILocalAudioTr
|
|
|
3276
3365
|
unpipe(): void;
|
|
3277
3366
|
private bindProcessorDestinationEvents;
|
|
3278
3367
|
private unbindProcessorDestinationEvents;
|
|
3279
|
-
|
|
3368
|
+
protected bindProcessorContextEvents(processorContext: AudioProcessorContext): void;
|
|
3369
|
+
protected unbindProcessorContextEvents(processorContext: AudioProcessorContext): void;
|
|
3370
|
+
private initWebAudio;
|
|
3371
|
+
private initProcessor;
|
|
3280
3372
|
}
|
|
3281
3373
|
|
|
3282
3374
|
/**
|
|
@@ -3395,9 +3487,9 @@ export declare abstract class LocalTrack extends Track implements ILocalTrack {
|
|
|
3395
3487
|
_isClosed: boolean;
|
|
3396
3488
|
protected _enabledMutex: PromiseMutex;
|
|
3397
3489
|
protected processor?: IBaseProcessor;
|
|
3398
|
-
protected abstract _processorContext: IProcessorContext;
|
|
3399
|
-
protected get processorContext(): IProcessorContext;
|
|
3400
|
-
|
|
3490
|
+
protected abstract _processorContext: IProcessorContext | undefined;
|
|
3491
|
+
protected get processorContext(): IProcessorContext | undefined;
|
|
3492
|
+
abstract processorDestination: IBaseProcessor;
|
|
3401
3493
|
constructor(track: MediaStreamTrack, trackId?: string);
|
|
3402
3494
|
abstract getStats(): LocalVideoTrackStats | LocalAudioTrackStats;
|
|
3403
3495
|
abstract setMuted(enabled: boolean): Promise<void>;
|
|
@@ -3480,6 +3572,7 @@ export declare class LocalVideoTrack extends LocalTrack implements ILocalVideoTr
|
|
|
3480
3572
|
clone(config?: VideoEncoderConfiguration | VideoEncoderConfigurationPreset, cloneTrack?: boolean): LocalVideoTrack;
|
|
3481
3573
|
replaceTrack(track: MediaStreamTrack, stopOldTrack: boolean): Promise<void>;
|
|
3482
3574
|
startMonitorStats(): void;
|
|
3575
|
+
sendSeiData(sei: Uint8Array): never;
|
|
3483
3576
|
private bindProcessorDestinationEvents;
|
|
3484
3577
|
private unbindProcessorDestinationEvents;
|
|
3485
3578
|
private unbindProcessorContextEvents;
|
|
@@ -3751,7 +3844,8 @@ export declare class MicrophoneAudioTrack extends LocalAudioTrack implements IMi
|
|
|
3751
3844
|
close(): void;
|
|
3752
3845
|
protected onTrackEnded(): void;
|
|
3753
3846
|
renewMediaStreamTrack(newConstraints?: MediaTrackConstraints): Promise<void>;
|
|
3754
|
-
|
|
3847
|
+
protected bindProcessorContextEvents(processorContext: AudioProcessorContext): void;
|
|
3848
|
+
protected unbindProcessorContextEvents(processorContext: AudioProcessorContext): void;
|
|
3755
3849
|
}
|
|
3756
3850
|
|
|
3757
3851
|
/**
|
|
@@ -3889,15 +3983,19 @@ export declare class RemoteAudioTrack extends RemoteTrack implements IRemoteAudi
|
|
|
3889
3983
|
readonly trackMediaType: "audio" | "video";
|
|
3890
3984
|
_source: AudioTrackSource | FakeTrackSource;
|
|
3891
3985
|
_useAudioElement: boolean;
|
|
3986
|
+
channelCount?: number;
|
|
3892
3987
|
private _volume;
|
|
3893
3988
|
protected processorContext: AudioProcessorContext;
|
|
3894
3989
|
processorDestination: AudioProcessorDestination;
|
|
3895
3990
|
private _played;
|
|
3896
3991
|
private _bypassWebAudio;
|
|
3992
|
+
private transformer?;
|
|
3897
3993
|
get isPlaying(): boolean;
|
|
3898
3994
|
get __className__(): string;
|
|
3899
|
-
constructor(track: MediaStreamTrack, userId: UID, uintId: number, store: SDKStore);
|
|
3995
|
+
constructor(track: MediaStreamTrack, userId: UID, uintId: number, store: SDKStore, channelCount?: number);
|
|
3900
3996
|
setAudioFrameCallback(callback: null | ((buffer: AudioBuffer) => void), frameSize?: number): void;
|
|
3997
|
+
selectChannels(channels: number[], mode?: AudioRenderMode): void;
|
|
3998
|
+
getVolumeLevels(channels?: number[]): number[];
|
|
3901
3999
|
setVolume(volume: number): void;
|
|
3902
4000
|
setPlaybackDevice(deviceId: string): Promise<void>;
|
|
3903
4001
|
getVolumeLevel(): number;
|
|
@@ -4136,7 +4234,8 @@ export declare abstract class RemoteTrack extends Track implements IRemoteTrack
|
|
|
4136
4234
|
|
|
4137
4235
|
export declare enum RemoteTrackEvents {
|
|
4138
4236
|
FIRST_FRAME_DECODED = "first-frame-decoded",
|
|
4139
|
-
VIDEO_ELEMENT_VISIBLE_STATUS = "video-element-visible-status"
|
|
4237
|
+
VIDEO_ELEMENT_VISIBLE_STATUS = "video-element-visible-status",
|
|
4238
|
+
VIDEO_STATE_CHANGED = "video-state-changed"
|
|
4140
4239
|
}
|
|
4141
4240
|
|
|
4142
4241
|
export declare class RemoteVideoTrack extends RemoteTrack implements IRemoteVideoTrack {
|
|
@@ -4164,6 +4263,7 @@ export declare class RemoteVideoTrack extends RemoteTrack implements IRemoteVide
|
|
|
4164
4263
|
private bindProcessorDestinationEvents;
|
|
4165
4264
|
private unbindProcessorDestinationEvents;
|
|
4166
4265
|
_destroy(): void;
|
|
4266
|
+
_onSei(sei: Uint8Array): void;
|
|
4167
4267
|
}
|
|
4168
4268
|
|
|
4169
4269
|
/**
|
|
@@ -4820,7 +4920,9 @@ export declare abstract class Track extends EventEmitter implements ITrack {
|
|
|
4820
4920
|
}
|
|
4821
4921
|
|
|
4822
4922
|
export declare enum TrackEvents {
|
|
4823
|
-
TRANSCEIVER_UPDATED = "transceiver-updated"
|
|
4923
|
+
TRANSCEIVER_UPDATED = "transceiver-updated",
|
|
4924
|
+
SEI_TO_SEND = "sei-to-send",
|
|
4925
|
+
SEI_RECEIVED = "sei-received"
|
|
4824
4926
|
}
|
|
4825
4927
|
|
|
4826
4928
|
/**
|
|
@@ -4838,6 +4940,7 @@ export declare enum TrackHint {
|
|
|
4838
4940
|
export declare enum TrackInternalEvent {
|
|
4839
4941
|
NEED_RENEGOTIATE = "@need_renegotiate",
|
|
4840
4942
|
NEED_REPLACE_TRACK = "@need_replace_track",
|
|
4943
|
+
NEED_REPLACE_MIXING_TRACK = "@need_replace_mixing_track",
|
|
4841
4944
|
NEED_CLOSE = "@need_close",
|
|
4842
4945
|
NEED_ENABLE_TRACK = "@need_enable_track",
|
|
4843
4946
|
NEED_DISABLE_TRACK = "@need_disable_track",
|
|
@@ -5069,6 +5172,7 @@ declare class VideoPlayer {
|
|
|
5069
5172
|
trackId: string;
|
|
5070
5173
|
config: PlayerConfig;
|
|
5071
5174
|
onFirstVideoFrameDecoded?: () => void;
|
|
5175
|
+
onVideoStateChanged?: (state: VideoState) => void;
|
|
5072
5176
|
freezeTimeCounterList: number[];
|
|
5073
5177
|
renderFreezeAccTime: number;
|
|
5074
5178
|
isKeepLastFrame: boolean;
|
|
@@ -5084,7 +5188,11 @@ declare class VideoPlayer {
|
|
|
5084
5188
|
protected cacheVideoElement?: HTMLVideoElement;
|
|
5085
5189
|
get videoElementStatus(): MediaElementStatus;
|
|
5086
5190
|
set videoElementStatus(status: MediaElementStatus);
|
|
5191
|
+
get videoState(): VideoState;
|
|
5192
|
+
set videoState(state: VideoState);
|
|
5193
|
+
private _videoState;
|
|
5087
5194
|
private videoElementCheckInterval?;
|
|
5195
|
+
private videoElementFreezeTimeout?;
|
|
5088
5196
|
private _videoElementStatus;
|
|
5089
5197
|
private isGettingVideoDimensions;
|
|
5090
5198
|
constructor(config: PlayerConfig);
|
|
@@ -5197,6 +5305,36 @@ export declare class VideoProcessorDestination extends EventEmitter implements I
|
|
|
5197
5305
|
reset(): void;
|
|
5198
5306
|
}
|
|
5199
5307
|
|
|
5308
|
+
/**
|
|
5309
|
+
* 视频流状态。
|
|
5310
|
+
* @public
|
|
5311
|
+
*/
|
|
5312
|
+
/** @en
|
|
5313
|
+
* The state of the video stream.
|
|
5314
|
+
*/
|
|
5315
|
+
export declare enum VideoState {
|
|
5316
|
+
/** 0: 视频默认初始状态。 */
|
|
5317
|
+
/** @en
|
|
5318
|
+
* 0: The initial state of the video.
|
|
5319
|
+
*/
|
|
5320
|
+
VideoStateStopped = 0,
|
|
5321
|
+
/** 1: 本地用户已接收视频首包。 */
|
|
5322
|
+
/** @en
|
|
5323
|
+
* 1: The local user has received the first video packet.
|
|
5324
|
+
*/
|
|
5325
|
+
VideoStateStarting = 1,
|
|
5326
|
+
/** 2: 视频流正在解码,正常播放。 */
|
|
5327
|
+
/** @en
|
|
5328
|
+
* 2: The video stream is being decoded and played normally.
|
|
5329
|
+
*/
|
|
5330
|
+
VideoStateDecoding = 2,
|
|
5331
|
+
/** 3: 视频流卡顿。 */
|
|
5332
|
+
/** @en
|
|
5333
|
+
* 3: The video stream is frozen.
|
|
5334
|
+
*/
|
|
5335
|
+
VideoStateFrozen = 3
|
|
5336
|
+
}
|
|
5337
|
+
|
|
5200
5338
|
declare class VisibilityWatcher extends EventEmitter {
|
|
5201
5339
|
private _lastHiddenTime;
|
|
5202
5340
|
private _lastVisibleTime;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agora-js/media",
|
|
3
|
-
"version": "4.20.
|
|
3
|
+
"version": "4.20.1-100",
|
|
4
4
|
"description": "media module across @agora-js packages",
|
|
5
5
|
"main": "AgoraRTC_N-media.js",
|
|
6
6
|
"module": "AgoraRTC_N-media.esm.mjs",
|
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
"homepage": "https://api-ref.agora.io/en/voice-sdk/web/4.x/index.html",
|
|
24
24
|
"peerDependencies": {},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@agora-js/shared": "
|
|
27
|
-
"@agora-js/report": "
|
|
26
|
+
"@agora-js/shared": "4.20.1-100",
|
|
27
|
+
"@agora-js/report": "4.20.1-100",
|
|
28
28
|
"axios": "^0.27.2",
|
|
29
29
|
"agora-rte-extension": "^1.2.4",
|
|
30
30
|
"webrtc-adapter": "8.2.0",
|