@agora-js/media 4.23.4-3 → 4.24.0-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 +2 -2
- package/media.d.ts +42 -6
- package/package.json +3 -3
- package/rtc-sdk-media_en.d.ts +32 -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
|
*
|
|
@@ -2918,7 +2939,9 @@ export declare function interceptRemoteAudioFrame(receiver: RTCRtpReceiver, opti
|
|
|
2918
2939
|
export declare interface InterceptRemoteAudioFrameOptions {
|
|
2919
2940
|
enableTopn?: boolean;
|
|
2920
2941
|
enableMetadata?: boolean;
|
|
2942
|
+
enablePts?: boolean;
|
|
2921
2943
|
onMetadata?: (metadata: Uint8Array) => void;
|
|
2944
|
+
onPts?: (pts: bigint) => void;
|
|
2922
2945
|
}
|
|
2923
2946
|
|
|
2924
2947
|
export declare function interceptRemoteVideoFrame(receiver: RTCRtpReceiver, options?: InterceptVideoFrameOptions): Promise<void>;
|
|
@@ -4117,7 +4140,8 @@ export declare type OptimizationMode = "motion" | "detail" | "balanced";
|
|
|
4117
4140
|
*/
|
|
4118
4141
|
export declare interface PlayerConfig extends VideoPlayerConfig {
|
|
4119
4142
|
trackId: string;
|
|
4120
|
-
element
|
|
4143
|
+
element?: HTMLElement;
|
|
4144
|
+
preEl?: HTMLVideoElement;
|
|
4121
4145
|
}
|
|
4122
4146
|
|
|
4123
4147
|
/**
|
|
@@ -4422,7 +4446,13 @@ export declare abstract class RemoteTrack extends Track implements IRemoteTrack
|
|
|
4422
4446
|
export declare enum RemoteTrackEvents {
|
|
4423
4447
|
FIRST_FRAME_DECODED = "first-frame-decoded",
|
|
4424
4448
|
VIDEO_ELEMENT_VISIBLE_STATUS = "video-element-visible-status",
|
|
4425
|
-
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"
|
|
4426
4456
|
}
|
|
4427
4457
|
|
|
4428
4458
|
export declare class RemoteVideoTrack extends RemoteTrack implements IRemoteVideoTrack {
|
|
@@ -4433,11 +4463,12 @@ export declare class RemoteVideoTrack extends RemoteTrack implements IRemoteVide
|
|
|
4433
4463
|
_videoWidth?: number;
|
|
4434
4464
|
_videoHeight?: number;
|
|
4435
4465
|
_player?: AgoraRTCPlayer | VideoPlayer;
|
|
4466
|
+
private _prePlayer?;
|
|
4436
4467
|
processorDestination: VideoProcessorDestination;
|
|
4437
4468
|
protected processorContext: VideoProcessorContext;
|
|
4438
4469
|
get isPlaying(): boolean;
|
|
4439
4470
|
get __className__(): string;
|
|
4440
|
-
constructor(track: MediaStreamTrack, userId: UID, uintId: number, store: SDKStore);
|
|
4471
|
+
constructor(track: MediaStreamTrack, userId: UID, uintId: number, store: SDKStore, player?: AgoraRTCPlayer);
|
|
4441
4472
|
getStats(): RemoteVideoTrackStats;
|
|
4442
4473
|
play(element: string | HTMLElement | HTMLVideoElement, config?: VideoPlayerConfig): void;
|
|
4443
4474
|
stop(): void;
|
|
@@ -5411,11 +5442,13 @@ declare class VideoPlayer {
|
|
|
5411
5442
|
trackId: string;
|
|
5412
5443
|
config: PlayerConfig;
|
|
5413
5444
|
onFirstVideoFrameDecoded?: () => void;
|
|
5445
|
+
onFirstVideoFrameRender?: () => void;
|
|
5414
5446
|
onVideoStateChanged?: (state: VideoState) => void;
|
|
5415
5447
|
freezeTimeCounterList: number[];
|
|
5416
5448
|
renderFreezeAccTime: number;
|
|
5417
5449
|
renderFreezeAccTime2: number;
|
|
5418
5450
|
isKeepLastFrame: boolean;
|
|
5451
|
+
isDestroyed: boolean;
|
|
5419
5452
|
/** 计算 500ms 卡顿时间用 */
|
|
5420
5453
|
private timeUpdatedCount;
|
|
5421
5454
|
private freezeTime;
|
|
@@ -5426,6 +5459,7 @@ declare class VideoPlayer {
|
|
|
5426
5459
|
protected videoTrack?: MediaStreamTrack;
|
|
5427
5460
|
protected videoElement: HTMLVideoElement;
|
|
5428
5461
|
protected cacheVideoElement?: HTMLVideoElement;
|
|
5462
|
+
protected internal: boolean;
|
|
5429
5463
|
get rendFrameRate(): number;
|
|
5430
5464
|
get videoElementStatus(): MediaElementStatus;
|
|
5431
5465
|
set videoElementStatus(status: MediaElementStatus);
|
|
@@ -5437,6 +5471,7 @@ declare class VideoPlayer {
|
|
|
5437
5471
|
private videoElementCheckInterval?;
|
|
5438
5472
|
private videoElementFreezeTimeout?;
|
|
5439
5473
|
private _videoElementStatus;
|
|
5474
|
+
private _isInPage;
|
|
5440
5475
|
private isGettingVideoDimensions;
|
|
5441
5476
|
constructor(config: PlayerConfig);
|
|
5442
5477
|
getVideoElement(): HTMLVideoElement | undefined;
|
|
@@ -5450,6 +5485,7 @@ declare class VideoPlayer {
|
|
|
5450
5485
|
protected initVideoElement(): void;
|
|
5451
5486
|
protected resetVideoElement(): void;
|
|
5452
5487
|
private startGetVideoDimensions;
|
|
5488
|
+
private isSkipCalcRenderFreezeTime;
|
|
5453
5489
|
private handleAutoPlayFailed;
|
|
5454
5490
|
private autoResumeAfterInterruption;
|
|
5455
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-1",
|
|
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-1",
|
|
27
|
+
"@agora-js/report": "4.24.0-1",
|
|
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
|
*
|
|
@@ -1790,7 +1804,9 @@ export declare function interceptRemoteAudioFrame(receiver: RTCRtpReceiver, opti
|
|
|
1790
1804
|
export declare interface InterceptRemoteAudioFrameOptions {
|
|
1791
1805
|
enableTopn?: boolean;
|
|
1792
1806
|
enableMetadata?: boolean;
|
|
1807
|
+
enablePts?: boolean;
|
|
1793
1808
|
onMetadata?: (metadata: Uint8Array) => void;
|
|
1809
|
+
onPts?: (pts: bigint) => void;
|
|
1794
1810
|
}
|
|
1795
1811
|
|
|
1796
1812
|
export declare function interceptRemoteVideoFrame(receiver: RTCRtpReceiver, options?: InterceptVideoFrameOptions): Promise<void>;
|
|
@@ -2550,7 +2566,8 @@ export declare type OptimizationMode = "motion" | "detail" | "balanced";
|
|
|
2550
2566
|
|
|
2551
2567
|
export declare interface PlayerConfig extends VideoPlayerConfig {
|
|
2552
2568
|
trackId: string;
|
|
2553
|
-
element
|
|
2569
|
+
element?: HTMLElement;
|
|
2570
|
+
preEl?: HTMLVideoElement;
|
|
2554
2571
|
}
|
|
2555
2572
|
|
|
2556
2573
|
export declare function polyfillAudioNode(node: AudioNode): void;
|
|
@@ -2759,7 +2776,10 @@ export declare abstract class RemoteTrack extends Track implements IRemoteTrack
|
|
|
2759
2776
|
export declare enum RemoteTrackEvents {
|
|
2760
2777
|
FIRST_FRAME_DECODED = "first-frame-decoded",
|
|
2761
2778
|
VIDEO_ELEMENT_VISIBLE_STATUS = "video-element-visible-status",
|
|
2762
|
-
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"
|
|
2763
2783
|
}
|
|
2764
2784
|
|
|
2765
2785
|
export declare class RemoteVideoTrack extends RemoteTrack implements IRemoteVideoTrack {
|
|
@@ -2770,11 +2790,12 @@ export declare class RemoteVideoTrack extends RemoteTrack implements IRemoteVide
|
|
|
2770
2790
|
_videoWidth?: number;
|
|
2771
2791
|
_videoHeight?: number;
|
|
2772
2792
|
_player?: AgoraRTCPlayer | VideoPlayer;
|
|
2793
|
+
private _prePlayer?;
|
|
2773
2794
|
processorDestination: VideoProcessorDestination;
|
|
2774
2795
|
protected processorContext: VideoProcessorContext;
|
|
2775
2796
|
get isPlaying(): boolean;
|
|
2776
2797
|
get __className__(): string;
|
|
2777
|
-
constructor(track: MediaStreamTrack, userId: UID, uintId: number, store: SDKStore);
|
|
2798
|
+
constructor(track: MediaStreamTrack, userId: UID, uintId: number, store: SDKStore, player?: AgoraRTCPlayer);
|
|
2778
2799
|
getStats(): RemoteVideoTrackStats;
|
|
2779
2800
|
play(element: string | HTMLElement | HTMLVideoElement, config?: VideoPlayerConfig): void;
|
|
2780
2801
|
stop(): void;
|
|
@@ -3341,11 +3362,13 @@ declare class VideoPlayer {
|
|
|
3341
3362
|
trackId: string;
|
|
3342
3363
|
config: PlayerConfig;
|
|
3343
3364
|
onFirstVideoFrameDecoded?: () => void;
|
|
3365
|
+
onFirstVideoFrameRender?: () => void;
|
|
3344
3366
|
onVideoStateChanged?: (state: VideoState) => void;
|
|
3345
3367
|
freezeTimeCounterList: number[];
|
|
3346
3368
|
renderFreezeAccTime: number;
|
|
3347
3369
|
renderFreezeAccTime2: number;
|
|
3348
3370
|
isKeepLastFrame: boolean;
|
|
3371
|
+
isDestroyed: boolean;
|
|
3349
3372
|
private timeUpdatedCount;
|
|
3350
3373
|
private freezeTime;
|
|
3351
3374
|
private playbackTime;
|
|
@@ -3354,6 +3377,7 @@ declare class VideoPlayer {
|
|
|
3354
3377
|
protected videoTrack?: MediaStreamTrack;
|
|
3355
3378
|
protected videoElement: HTMLVideoElement;
|
|
3356
3379
|
protected cacheVideoElement?: HTMLVideoElement;
|
|
3380
|
+
protected internal: boolean;
|
|
3357
3381
|
get rendFrameRate(): number;
|
|
3358
3382
|
get videoElementStatus(): MediaElementStatus;
|
|
3359
3383
|
set videoElementStatus(status: MediaElementStatus);
|
|
@@ -3365,6 +3389,7 @@ declare class VideoPlayer {
|
|
|
3365
3389
|
private videoElementCheckInterval?;
|
|
3366
3390
|
private videoElementFreezeTimeout?;
|
|
3367
3391
|
private _videoElementStatus;
|
|
3392
|
+
private _isInPage;
|
|
3368
3393
|
private isGettingVideoDimensions;
|
|
3369
3394
|
constructor(config: PlayerConfig);
|
|
3370
3395
|
getVideoElement(): HTMLVideoElement | undefined;
|
|
@@ -3378,6 +3403,7 @@ declare class VideoPlayer {
|
|
|
3378
3403
|
protected initVideoElement(): void;
|
|
3379
3404
|
protected resetVideoElement(): void;
|
|
3380
3405
|
private startGetVideoDimensions;
|
|
3406
|
+
private isSkipCalcRenderFreezeTime;
|
|
3381
3407
|
private handleAutoPlayFailed;
|
|
3382
3408
|
private autoResumeAfterInterruption;
|
|
3383
3409
|
private handleVideoEvents;
|