@vindral/web-sdk 2.2.6 → 2.2.8
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/index.d.ts +30 -8
- package/package.json +1 -1
- package/web-sdk.esm.js +1 -1
- package/web-sdk.umd.js +1 -1
package/index.d.ts
CHANGED
|
@@ -19,6 +19,9 @@ interface CodedAudioSample extends BaseCodedSample {
|
|
|
19
19
|
interface CodedVideoSample extends BaseCodedSample {
|
|
20
20
|
type: "video";
|
|
21
21
|
codec: VideoCodec;
|
|
22
|
+
width: number;
|
|
23
|
+
height: number;
|
|
24
|
+
buffer?: ArrayBuffer;
|
|
22
25
|
}
|
|
23
26
|
declare type CodedSample = CodedAudioSample | CodedVideoSample;
|
|
24
27
|
declare type AudioCodec = "aac" | "opus" | "mp3";
|
|
@@ -49,6 +52,7 @@ interface DecodedVideoSample {
|
|
|
49
52
|
Uint8Array,
|
|
50
53
|
Uint8Array
|
|
51
54
|
];
|
|
55
|
+
buffer: ArrayBuffer;
|
|
52
56
|
statistics?: DecodedSampleStatistics;
|
|
53
57
|
}
|
|
54
58
|
interface DecodedAudioSample {
|
|
@@ -338,7 +342,7 @@ declare class AdaptivityModule {
|
|
|
338
342
|
unload: () => void;
|
|
339
343
|
suspend: () => void;
|
|
340
344
|
unsuspend: () => void;
|
|
341
|
-
reset: () => void;
|
|
345
|
+
reset: (extraGraceTimeMs?: number) => void;
|
|
342
346
|
getStatistics: () => AdaptivityStatistics;
|
|
343
347
|
isQoSOk: (renditionLevel: RenditionLevel) => boolean;
|
|
344
348
|
private onBufferState;
|
|
@@ -706,6 +710,18 @@ declare class ConstraintCapModule {
|
|
|
706
710
|
private enterPictureInPicture;
|
|
707
711
|
private exitPictureInPicture;
|
|
708
712
|
}
|
|
713
|
+
declare class ArrayBufferPool {
|
|
714
|
+
private maxSize;
|
|
715
|
+
private size;
|
|
716
|
+
private buffers;
|
|
717
|
+
private _borrowedBuffers;
|
|
718
|
+
constructor(maxSize: number);
|
|
719
|
+
get bufferSize(): number;
|
|
720
|
+
get poolSize(): number;
|
|
721
|
+
get borrowedBuffers(): number;
|
|
722
|
+
get: (size: number) => ArrayBuffer;
|
|
723
|
+
reclaim: (buffer: ArrayBuffer) => void;
|
|
724
|
+
}
|
|
709
725
|
declare type DecoderParamType<Type extends "audio" | "video"> = Type extends "video" ? CodedVideoSample : CodedAudioSample;
|
|
710
726
|
declare type DecoderReturnType<Type extends "audio" | "video"> = Type extends "video" ? DecodedVideoSample : DecodedAudioSample;
|
|
711
727
|
interface DecoderContext<Type extends "audio" | "video"> {
|
|
@@ -756,7 +772,7 @@ declare class DecoderModule {
|
|
|
756
772
|
unload: () => void;
|
|
757
773
|
suspend: () => void;
|
|
758
774
|
unsuspend: () => void;
|
|
759
|
-
static create: (emitter: Emitter<DecoderModuleListeners, DecoderModuleEvents>, logger: Logger, tracks: Track[], clockSource: ClockSource) => Promise<DecoderModule>;
|
|
775
|
+
static create: (emitter: Emitter<DecoderModuleListeners, DecoderModuleEvents>, logger: Logger, tracks: Track[], clockSource: ClockSource, pool: ArrayBufferPool) => Promise<DecoderModule>;
|
|
760
776
|
getBuffer: (type: Type) => TimeRange[] | undefined;
|
|
761
777
|
videoDecodeRate: () => number;
|
|
762
778
|
getStatistics: () => DecoderStatistics;
|
|
@@ -896,8 +912,13 @@ declare class LoggerModule {
|
|
|
896
912
|
unload: () => void;
|
|
897
913
|
private onLog;
|
|
898
914
|
}
|
|
915
|
+
interface RecoveredContext {
|
|
916
|
+
error: Error;
|
|
917
|
+
count: number;
|
|
918
|
+
}
|
|
899
919
|
interface MseModuleEvents {
|
|
900
920
|
["error"]: Readonly<VindralError>;
|
|
921
|
+
["recovered from media error"]: Readonly<RecoveredContext>;
|
|
901
922
|
}
|
|
902
923
|
interface MseModuleListeners {
|
|
903
924
|
["init segment"]: Readonly<InitSegment>;
|
|
@@ -919,6 +940,7 @@ declare class MseModule {
|
|
|
919
940
|
private trackContexts;
|
|
920
941
|
private autoRecoverFromMediaErrors;
|
|
921
942
|
private quotaErrorCount;
|
|
943
|
+
private recoveredFromErrorCount;
|
|
922
944
|
constructor(logger: Logger, emitter: Emitter<MseModuleListeners, MseModuleEvents>, mediaElement: HTMLMediaElement, tracks: Track[]);
|
|
923
945
|
static create: (logger: Logger, emitter: Emitter<MseModuleListeners, MseModuleEvents>, mediaElement: HTMLMediaElement, tracks: Track[]) => Promise<MseModule>;
|
|
924
946
|
load: () => void;
|
|
@@ -1016,10 +1038,6 @@ declare class QualityOfServiceModule {
|
|
|
1016
1038
|
private setActive;
|
|
1017
1039
|
private unsetActive;
|
|
1018
1040
|
}
|
|
1019
|
-
interface Size {
|
|
1020
|
-
width: number;
|
|
1021
|
-
height: number;
|
|
1022
|
-
}
|
|
1023
1041
|
interface SubscriptionModuleListeners {
|
|
1024
1042
|
["subscription changed"]: Readonly<SubscriptionChange>;
|
|
1025
1043
|
}
|
|
@@ -1201,6 +1219,7 @@ export declare type Statistics = ModuleStatistics & UserAgentInformation & {
|
|
|
1201
1219
|
timeToFirstFrame?: number;
|
|
1202
1220
|
};
|
|
1203
1221
|
export declare class Vindral extends Emitter<PublicVindralEvents> {
|
|
1222
|
+
private static MAX_POOL_SIZE;
|
|
1204
1223
|
private static INITIAL_MAX_BIT_RATE;
|
|
1205
1224
|
private static PING_TIMEOUT;
|
|
1206
1225
|
readonly pictureInPicture: {
|
|
@@ -1227,7 +1246,9 @@ export declare class Vindral extends Emitter<PublicVindralEvents> {
|
|
|
1227
1246
|
private wakeLock;
|
|
1228
1247
|
private cachedEdges;
|
|
1229
1248
|
private shiftedEdges;
|
|
1249
|
+
private pool;
|
|
1230
1250
|
private durationSessions;
|
|
1251
|
+
private sizes;
|
|
1231
1252
|
constructor(options: Options);
|
|
1232
1253
|
attach: (container: HTMLElement) => void;
|
|
1233
1254
|
set volume(volume: number);
|
|
@@ -1399,6 +1420,7 @@ interface VideoPlayerStatistics {
|
|
|
1399
1420
|
}
|
|
1400
1421
|
declare class VideoPlayerModule {
|
|
1401
1422
|
private readonly oldTimestampLimit;
|
|
1423
|
+
private pool;
|
|
1402
1424
|
private logger;
|
|
1403
1425
|
private emitter;
|
|
1404
1426
|
private videoRenderer;
|
|
@@ -1408,14 +1430,14 @@ declare class VideoPlayerModule {
|
|
|
1408
1430
|
private animationFrameRequest?;
|
|
1409
1431
|
private renderedFrameCount;
|
|
1410
1432
|
private rendererDroppedFrameCount;
|
|
1411
|
-
constructor(emitter: Emitter<VideoPlayerModuleListeners, unknown>, logger: Logger, clockSource: ClockSource);
|
|
1433
|
+
constructor(emitter: Emitter<VideoPlayerModuleListeners, unknown>, logger: Logger, clockSource: ClockSource, pool: ArrayBufferPool);
|
|
1412
1434
|
load: () => void;
|
|
1413
1435
|
unload: () => Promise<void>;
|
|
1414
1436
|
suspend: () => void;
|
|
1415
1437
|
unsuspend: () => void;
|
|
1416
1438
|
element: () => HTMLCanvasElement;
|
|
1417
1439
|
getStatistics: () => VideoPlayerStatistics;
|
|
1418
|
-
static create: (emitter: Emitter<VideoPlayerModuleListeners, unknown>, logger: Logger, clockSource: ClockSource) => VideoPlayerModule;
|
|
1440
|
+
static create: (emitter: Emitter<VideoPlayerModuleListeners, unknown>, logger: Logger, clockSource: ClockSource, pool: ArrayBufferPool) => VideoPlayerModule;
|
|
1419
1441
|
private onDecodedFrame;
|
|
1420
1442
|
private render;
|
|
1421
1443
|
private renderSample;
|
package/package.json
CHANGED