@agora-js/media 4.23.4 → 4.24.0
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 +2 -2
- package/media.d.ts +51 -6
- package/package.json +3 -3
- package/rtc-sdk-media_en.d.ts +35 -6
package/media.d.ts
CHANGED
|
@@ -65,10 +65,10 @@ export declare interface AgoraRTCCompatibility {
|
|
|
65
65
|
/**
|
|
66
66
|
* @internal
|
|
67
67
|
*/
|
|
68
|
-
declare class AgoraRTCPlayer extends VideoPlayer {
|
|
68
|
+
export declare class AgoraRTCPlayer extends VideoPlayer {
|
|
69
69
|
private container?;
|
|
70
|
-
private slot
|
|
71
|
-
constructor(config: PlayerConfig);
|
|
70
|
+
private slot?;
|
|
71
|
+
constructor(config: PlayerConfig, internal?: boolean);
|
|
72
72
|
updateConfig(config: PlayerConfig): void;
|
|
73
73
|
updateVideoTrack(track?: MediaStreamTrack): void;
|
|
74
74
|
play(sessionId?: string): void;
|
|
@@ -428,6 +428,10 @@ export declare class AudioProcessorDestination extends EventEmitter implements I
|
|
|
428
428
|
}): void;
|
|
429
429
|
}
|
|
430
430
|
|
|
431
|
+
export declare interface AudioPts {
|
|
432
|
+
value: BigInt;
|
|
433
|
+
}
|
|
434
|
+
|
|
431
435
|
declare abstract class AudioSource extends EventEmitter {
|
|
432
436
|
outputNode: GainNode;
|
|
433
437
|
outputTrack?: MediaStreamTrack;
|
|
@@ -1266,6 +1270,23 @@ export declare interface DenoiserStats {
|
|
|
1266
1270
|
*/
|
|
1267
1271
|
export declare function detectSupportAudioElementSetSinkId(): boolean;
|
|
1268
1272
|
|
|
1273
|
+
export declare function detectSupportAutCC(): boolean | undefined;
|
|
1274
|
+
|
|
1275
|
+
export declare function detectSupportAutCCFeedback(): boolean | undefined;
|
|
1276
|
+
|
|
1277
|
+
export declare function detectSupportInstantVideo(store?: SDKStore): boolean;
|
|
1278
|
+
|
|
1279
|
+
export declare function detectSupportPrePc(store?: SDKStore): boolean;
|
|
1280
|
+
|
|
1281
|
+
/**
|
|
1282
|
+
* Firefox / 低版本的chrome(chrome 87 以下) / planB 暂时不支持 pre_sub
|
|
1283
|
+
* commit:https://webrtc.googlesource.com/src.git/+/c03a187391be0e802b27dbb51b25e69a796b84d4
|
|
1284
|
+
* 当前 pre_sub 模式,ssrc 还没设置好,就可能已经下发流了,在firefox上,会出现m-line串流问题,所以暂时不支持
|
|
1285
|
+
* 后续 pre_sub 模式,在下发流之前,设置ssrc ,这样就不会出现m-line串流问题,后续依情况解除限制
|
|
1286
|
+
*
|
|
1287
|
+
*/
|
|
1288
|
+
export declare function detectSupportPreSub(store?: SDKStore): boolean;
|
|
1289
|
+
|
|
1269
1290
|
/**
|
|
1270
1291
|
* 音视频采集设备的信息。
|
|
1271
1292
|
*
|
|
@@ -1725,6 +1746,14 @@ export declare function getElectronScreenStreamByUserSelect(config: ScreenConstr
|
|
|
1725
1746
|
|
|
1726
1747
|
export declare function getLocalStream(config: GetUserMediaConfig, id: string): Promise<MediaStream>;
|
|
1727
1748
|
|
|
1749
|
+
/**
|
|
1750
|
+
* 获取新的视频码率
|
|
1751
|
+
* @param width
|
|
1752
|
+
* @param height
|
|
1753
|
+
* @param fps
|
|
1754
|
+
*/
|
|
1755
|
+
export declare function getNewNearestVideoProfile(width: number, height: number, frameRate: number): any;
|
|
1756
|
+
|
|
1728
1757
|
/**
|
|
1729
1758
|
* 获取新的视频码率
|
|
1730
1759
|
* @param width
|
|
@@ -2910,7 +2939,9 @@ export declare function interceptRemoteAudioFrame(receiver: RTCRtpReceiver, opti
|
|
|
2910
2939
|
export declare interface InterceptRemoteAudioFrameOptions {
|
|
2911
2940
|
enableTopn?: boolean;
|
|
2912
2941
|
enableMetadata?: boolean;
|
|
2942
|
+
enablePts?: boolean;
|
|
2913
2943
|
onMetadata?: (metadata: Uint8Array) => void;
|
|
2944
|
+
onPts?: (pts: bigint) => void;
|
|
2914
2945
|
}
|
|
2915
2946
|
|
|
2916
2947
|
export declare function interceptRemoteVideoFrame(receiver: RTCRtpReceiver, options?: InterceptVideoFrameOptions): Promise<void>;
|
|
@@ -3716,6 +3747,7 @@ export declare class LocalVideoTrack extends LocalTrack implements ILocalVideoTr
|
|
|
3716
3747
|
setBeautyEffect(enabled: boolean, options?: BeautyEffectOptions): Promise<void>;
|
|
3717
3748
|
getCurrentFrameData(): ImageData;
|
|
3718
3749
|
getCurrentFrameImage(imageType: string, quality?: number): Promise<ImageTypedData>;
|
|
3750
|
+
findClosestProfile(): Promise<void>;
|
|
3719
3751
|
setBitrateLimit(bitrateLimit: {
|
|
3720
3752
|
max_bitrate: number;
|
|
3721
3753
|
min_bitrate: number;
|
|
@@ -4108,7 +4140,8 @@ export declare type OptimizationMode = "motion" | "detail" | "balanced";
|
|
|
4108
4140
|
*/
|
|
4109
4141
|
export declare interface PlayerConfig extends VideoPlayerConfig {
|
|
4110
4142
|
trackId: string;
|
|
4111
|
-
element
|
|
4143
|
+
element?: HTMLElement;
|
|
4144
|
+
preEl?: HTMLVideoElement;
|
|
4112
4145
|
}
|
|
4113
4146
|
|
|
4114
4147
|
/**
|
|
@@ -4413,7 +4446,13 @@ export declare abstract class RemoteTrack extends Track implements IRemoteTrack
|
|
|
4413
4446
|
export declare enum RemoteTrackEvents {
|
|
4414
4447
|
FIRST_FRAME_DECODED = "first-frame-decoded",
|
|
4415
4448
|
VIDEO_ELEMENT_VISIBLE_STATUS = "video-element-visible-status",
|
|
4416
|
-
VIDEO_STATE_CHANGED = "video-state-changed"
|
|
4449
|
+
VIDEO_STATE_CHANGED = "video-state-changed",
|
|
4450
|
+
/** @ignore */
|
|
4451
|
+
PLAY_START = "play-start",
|
|
4452
|
+
/** @ignore */
|
|
4453
|
+
PLAY_END = "play-end",
|
|
4454
|
+
/** @ignore */
|
|
4455
|
+
FIRST_FRAME_RENDER = "first-frame-render"
|
|
4417
4456
|
}
|
|
4418
4457
|
|
|
4419
4458
|
export declare class RemoteVideoTrack extends RemoteTrack implements IRemoteVideoTrack {
|
|
@@ -4424,11 +4463,12 @@ export declare class RemoteVideoTrack extends RemoteTrack implements IRemoteVide
|
|
|
4424
4463
|
_videoWidth?: number;
|
|
4425
4464
|
_videoHeight?: number;
|
|
4426
4465
|
_player?: AgoraRTCPlayer | VideoPlayer;
|
|
4466
|
+
private _prePlayer?;
|
|
4427
4467
|
processorDestination: VideoProcessorDestination;
|
|
4428
4468
|
protected processorContext: VideoProcessorContext;
|
|
4429
4469
|
get isPlaying(): boolean;
|
|
4430
4470
|
get __className__(): string;
|
|
4431
|
-
constructor(track: MediaStreamTrack, userId: UID, uintId: number, store: SDKStore);
|
|
4471
|
+
constructor(track: MediaStreamTrack, userId: UID, uintId: number, store: SDKStore, player?: AgoraRTCPlayer);
|
|
4432
4472
|
getStats(): RemoteVideoTrackStats;
|
|
4433
4473
|
play(element: string | HTMLElement | HTMLVideoElement, config?: VideoPlayerConfig): void;
|
|
4434
4474
|
stop(): void;
|
|
@@ -5402,11 +5442,13 @@ declare class VideoPlayer {
|
|
|
5402
5442
|
trackId: string;
|
|
5403
5443
|
config: PlayerConfig;
|
|
5404
5444
|
onFirstVideoFrameDecoded?: () => void;
|
|
5445
|
+
onFirstVideoFrameRender?: () => void;
|
|
5405
5446
|
onVideoStateChanged?: (state: VideoState) => void;
|
|
5406
5447
|
freezeTimeCounterList: number[];
|
|
5407
5448
|
renderFreezeAccTime: number;
|
|
5408
5449
|
renderFreezeAccTime2: number;
|
|
5409
5450
|
isKeepLastFrame: boolean;
|
|
5451
|
+
isDestroyed: boolean;
|
|
5410
5452
|
/** 计算 500ms 卡顿时间用 */
|
|
5411
5453
|
private timeUpdatedCount;
|
|
5412
5454
|
private freezeTime;
|
|
@@ -5417,6 +5459,7 @@ declare class VideoPlayer {
|
|
|
5417
5459
|
protected videoTrack?: MediaStreamTrack;
|
|
5418
5460
|
protected videoElement: HTMLVideoElement;
|
|
5419
5461
|
protected cacheVideoElement?: HTMLVideoElement;
|
|
5462
|
+
protected internal: boolean;
|
|
5420
5463
|
get rendFrameRate(): number;
|
|
5421
5464
|
get videoElementStatus(): MediaElementStatus;
|
|
5422
5465
|
set videoElementStatus(status: MediaElementStatus);
|
|
@@ -5428,6 +5471,7 @@ declare class VideoPlayer {
|
|
|
5428
5471
|
private videoElementCheckInterval?;
|
|
5429
5472
|
private videoElementFreezeTimeout?;
|
|
5430
5473
|
private _videoElementStatus;
|
|
5474
|
+
private _isInPage;
|
|
5431
5475
|
private isGettingVideoDimensions;
|
|
5432
5476
|
constructor(config: PlayerConfig);
|
|
5433
5477
|
getVideoElement(): HTMLVideoElement | undefined;
|
|
@@ -5441,6 +5485,7 @@ declare class VideoPlayer {
|
|
|
5441
5485
|
protected initVideoElement(): void;
|
|
5442
5486
|
protected resetVideoElement(): void;
|
|
5443
5487
|
private startGetVideoDimensions;
|
|
5488
|
+
private isSkipCalcRenderFreezeTime;
|
|
5444
5489
|
private handleAutoPlayFailed;
|
|
5445
5490
|
private autoResumeAfterInterruption;
|
|
5446
5491
|
private handleVideoEvents;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agora-js/media",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.24.0",
|
|
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": "4.
|
|
27
|
-
"@agora-js/report": "4.
|
|
26
|
+
"@agora-js/shared": "4.24.0",
|
|
27
|
+
"@agora-js/report": "4.24.0",
|
|
28
28
|
"axios": "^1.8.3",
|
|
29
29
|
"agora-rte-extension": "^1.2.4",
|
|
30
30
|
"webrtc-adapter": "8.2.0"
|
package/rtc-sdk-media_en.d.ts
CHANGED
|
@@ -43,10 +43,10 @@ export declare interface AgoraRTCCompatibility {
|
|
|
43
43
|
supportWebCrypto: boolean;
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
declare class AgoraRTCPlayer extends VideoPlayer {
|
|
46
|
+
export declare class AgoraRTCPlayer extends VideoPlayer {
|
|
47
47
|
private container?;
|
|
48
|
-
private slot
|
|
49
|
-
constructor(config: PlayerConfig);
|
|
48
|
+
private slot?;
|
|
49
|
+
constructor(config: PlayerConfig, internal?: boolean);
|
|
50
50
|
updateConfig(config: PlayerConfig): void;
|
|
51
51
|
updateVideoTrack(track?: MediaStreamTrack): void;
|
|
52
52
|
play(sessionId?: string): void;
|
|
@@ -285,6 +285,10 @@ export declare class AudioProcessorDestination extends EventEmitter implements I
|
|
|
285
285
|
}): void;
|
|
286
286
|
}
|
|
287
287
|
|
|
288
|
+
export declare interface AudioPts {
|
|
289
|
+
value: BigInt;
|
|
290
|
+
}
|
|
291
|
+
|
|
288
292
|
declare abstract class AudioSource extends EventEmitter {
|
|
289
293
|
outputNode: GainNode;
|
|
290
294
|
outputTrack?: MediaStreamTrack;
|
|
@@ -826,6 +830,16 @@ export declare interface DenoiserStats {
|
|
|
826
830
|
|
|
827
831
|
export declare function detectSupportAudioElementSetSinkId(): boolean;
|
|
828
832
|
|
|
833
|
+
export declare function detectSupportAutCC(): boolean | undefined;
|
|
834
|
+
|
|
835
|
+
export declare function detectSupportAutCCFeedback(): boolean | undefined;
|
|
836
|
+
|
|
837
|
+
export declare function detectSupportInstantVideo(store?: SDKStore): boolean;
|
|
838
|
+
|
|
839
|
+
export declare function detectSupportPrePc(store?: SDKStore): boolean;
|
|
840
|
+
|
|
841
|
+
export declare function detectSupportPreSub(store?: SDKStore): boolean;
|
|
842
|
+
|
|
829
843
|
/**
|
|
830
844
|
* Information of the media input device.
|
|
831
845
|
*
|
|
@@ -1128,6 +1142,8 @@ export declare function getElectronScreenStreamByUserSelect(config: ScreenConstr
|
|
|
1128
1142
|
|
|
1129
1143
|
export declare function getLocalStream(config: GetUserMediaConfig, id: string): Promise<MediaStream>;
|
|
1130
1144
|
|
|
1145
|
+
export declare function getNewNearestVideoProfile(width: number, height: number, frameRate: number): any;
|
|
1146
|
+
|
|
1131
1147
|
export declare function getNewVideoBitrate(width: number, height: number, fps: number): [number, number];
|
|
1132
1148
|
|
|
1133
1149
|
export declare const getOriginSenderConfig: (track: LocalVideoTrack) => {
|
|
@@ -1788,7 +1804,9 @@ export declare function interceptRemoteAudioFrame(receiver: RTCRtpReceiver, opti
|
|
|
1788
1804
|
export declare interface InterceptRemoteAudioFrameOptions {
|
|
1789
1805
|
enableTopn?: boolean;
|
|
1790
1806
|
enableMetadata?: boolean;
|
|
1807
|
+
enablePts?: boolean;
|
|
1791
1808
|
onMetadata?: (metadata: Uint8Array) => void;
|
|
1809
|
+
onPts?: (pts: bigint) => void;
|
|
1792
1810
|
}
|
|
1793
1811
|
|
|
1794
1812
|
export declare function interceptRemoteVideoFrame(receiver: RTCRtpReceiver, options?: InterceptVideoFrameOptions): Promise<void>;
|
|
@@ -2294,6 +2312,7 @@ export declare class LocalVideoTrack extends LocalTrack implements ILocalVideoTr
|
|
|
2294
2312
|
setBeautyEffect(enabled: boolean, options?: BeautyEffectOptions): Promise<void>;
|
|
2295
2313
|
getCurrentFrameData(): ImageData;
|
|
2296
2314
|
getCurrentFrameImage(imageType: string, quality?: number): Promise<ImageTypedData>;
|
|
2315
|
+
findClosestProfile(): Promise<void>;
|
|
2297
2316
|
setBitrateLimit(bitrateLimit: {
|
|
2298
2317
|
max_bitrate: number;
|
|
2299
2318
|
min_bitrate: number;
|
|
@@ -2547,7 +2566,8 @@ export declare type OptimizationMode = "motion" | "detail" | "balanced";
|
|
|
2547
2566
|
|
|
2548
2567
|
export declare interface PlayerConfig extends VideoPlayerConfig {
|
|
2549
2568
|
trackId: string;
|
|
2550
|
-
element
|
|
2569
|
+
element?: HTMLElement;
|
|
2570
|
+
preEl?: HTMLVideoElement;
|
|
2551
2571
|
}
|
|
2552
2572
|
|
|
2553
2573
|
export declare function polyfillAudioNode(node: AudioNode): void;
|
|
@@ -2756,7 +2776,10 @@ export declare abstract class RemoteTrack extends Track implements IRemoteTrack
|
|
|
2756
2776
|
export declare enum RemoteTrackEvents {
|
|
2757
2777
|
FIRST_FRAME_DECODED = "first-frame-decoded",
|
|
2758
2778
|
VIDEO_ELEMENT_VISIBLE_STATUS = "video-element-visible-status",
|
|
2759
|
-
VIDEO_STATE_CHANGED = "video-state-changed"
|
|
2779
|
+
VIDEO_STATE_CHANGED = "video-state-changed",
|
|
2780
|
+
PLAY_START = "play-start",
|
|
2781
|
+
PLAY_END = "play-end",
|
|
2782
|
+
FIRST_FRAME_RENDER = "first-frame-render"
|
|
2760
2783
|
}
|
|
2761
2784
|
|
|
2762
2785
|
export declare class RemoteVideoTrack extends RemoteTrack implements IRemoteVideoTrack {
|
|
@@ -2767,11 +2790,12 @@ export declare class RemoteVideoTrack extends RemoteTrack implements IRemoteVide
|
|
|
2767
2790
|
_videoWidth?: number;
|
|
2768
2791
|
_videoHeight?: number;
|
|
2769
2792
|
_player?: AgoraRTCPlayer | VideoPlayer;
|
|
2793
|
+
private _prePlayer?;
|
|
2770
2794
|
processorDestination: VideoProcessorDestination;
|
|
2771
2795
|
protected processorContext: VideoProcessorContext;
|
|
2772
2796
|
get isPlaying(): boolean;
|
|
2773
2797
|
get __className__(): string;
|
|
2774
|
-
constructor(track: MediaStreamTrack, userId: UID, uintId: number, store: SDKStore);
|
|
2798
|
+
constructor(track: MediaStreamTrack, userId: UID, uintId: number, store: SDKStore, player?: AgoraRTCPlayer);
|
|
2775
2799
|
getStats(): RemoteVideoTrackStats;
|
|
2776
2800
|
play(element: string | HTMLElement | HTMLVideoElement, config?: VideoPlayerConfig): void;
|
|
2777
2801
|
stop(): void;
|
|
@@ -3338,11 +3362,13 @@ declare class VideoPlayer {
|
|
|
3338
3362
|
trackId: string;
|
|
3339
3363
|
config: PlayerConfig;
|
|
3340
3364
|
onFirstVideoFrameDecoded?: () => void;
|
|
3365
|
+
onFirstVideoFrameRender?: () => void;
|
|
3341
3366
|
onVideoStateChanged?: (state: VideoState) => void;
|
|
3342
3367
|
freezeTimeCounterList: number[];
|
|
3343
3368
|
renderFreezeAccTime: number;
|
|
3344
3369
|
renderFreezeAccTime2: number;
|
|
3345
3370
|
isKeepLastFrame: boolean;
|
|
3371
|
+
isDestroyed: boolean;
|
|
3346
3372
|
private timeUpdatedCount;
|
|
3347
3373
|
private freezeTime;
|
|
3348
3374
|
private playbackTime;
|
|
@@ -3351,6 +3377,7 @@ declare class VideoPlayer {
|
|
|
3351
3377
|
protected videoTrack?: MediaStreamTrack;
|
|
3352
3378
|
protected videoElement: HTMLVideoElement;
|
|
3353
3379
|
protected cacheVideoElement?: HTMLVideoElement;
|
|
3380
|
+
protected internal: boolean;
|
|
3354
3381
|
get rendFrameRate(): number;
|
|
3355
3382
|
get videoElementStatus(): MediaElementStatus;
|
|
3356
3383
|
set videoElementStatus(status: MediaElementStatus);
|
|
@@ -3362,6 +3389,7 @@ declare class VideoPlayer {
|
|
|
3362
3389
|
private videoElementCheckInterval?;
|
|
3363
3390
|
private videoElementFreezeTimeout?;
|
|
3364
3391
|
private _videoElementStatus;
|
|
3392
|
+
private _isInPage;
|
|
3365
3393
|
private isGettingVideoDimensions;
|
|
3366
3394
|
constructor(config: PlayerConfig);
|
|
3367
3395
|
getVideoElement(): HTMLVideoElement | undefined;
|
|
@@ -3375,6 +3403,7 @@ declare class VideoPlayer {
|
|
|
3375
3403
|
protected initVideoElement(): void;
|
|
3376
3404
|
protected resetVideoElement(): void;
|
|
3377
3405
|
private startGetVideoDimensions;
|
|
3406
|
+
private isSkipCalcRenderFreezeTime;
|
|
3378
3407
|
private handleAutoPlayFailed;
|
|
3379
3408
|
private autoResumeAfterInterruption;
|
|
3380
3409
|
private handleVideoEvents;
|