@vindral/web-sdk 2.0.15 → 2.0.19
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 +63 -23
- package/package.json +1 -1
- package/web-sdk.esm.js +1 -1
- package/web-sdk.umd.js +1 -1
package/index.d.ts
CHANGED
|
@@ -27,6 +27,7 @@ interface DecodedSampleStatistics {
|
|
|
27
27
|
decodeTime: number;
|
|
28
28
|
transportTimeFromWorker: number;
|
|
29
29
|
transportTimeToWorker: number;
|
|
30
|
+
samplesInBatch: number;
|
|
30
31
|
}
|
|
31
32
|
interface DecodedVideoSample {
|
|
32
33
|
type: "video";
|
|
@@ -182,6 +183,7 @@ export interface PlaybackSource {
|
|
|
182
183
|
playbackRate?: number;
|
|
183
184
|
isActivated: boolean;
|
|
184
185
|
readonly seekTime: number;
|
|
186
|
+
readonly paused: boolean;
|
|
185
187
|
readonly isSeeking: boolean;
|
|
186
188
|
play(initiator: PlayInitiator): Promise<void>;
|
|
187
189
|
}
|
|
@@ -190,6 +192,7 @@ interface MediaElementOptions {
|
|
|
190
192
|
muted: boolean;
|
|
191
193
|
type: "audio" | "video";
|
|
192
194
|
logger: Logger;
|
|
195
|
+
poster?: string;
|
|
193
196
|
}
|
|
194
197
|
interface NeedsUserInputContext {
|
|
195
198
|
forAudio: boolean;
|
|
@@ -207,7 +210,7 @@ declare class MediaElement extends Emitter<MediaElementEvents> {
|
|
|
207
210
|
private _userProvidedMuted;
|
|
208
211
|
private _userHasProvidedInput;
|
|
209
212
|
isActivated: boolean;
|
|
210
|
-
constructor({ type, autoplay, muted, logger }: MediaElementOptions);
|
|
213
|
+
constructor({ type, autoplay, muted, logger, poster }: MediaElementOptions);
|
|
211
214
|
attach: (container: HTMLElement) => void;
|
|
212
215
|
get seekTime(): number;
|
|
213
216
|
get isSeeking(): boolean;
|
|
@@ -282,6 +285,7 @@ declare class PlaybackModule {
|
|
|
282
285
|
}
|
|
283
286
|
declare type Direction = "upgrade" | "downgrade" | "double downgrade" | "reconnect";
|
|
284
287
|
interface QualityOfServiceConfig {
|
|
288
|
+
cooldownTime: number;
|
|
285
289
|
maxBufferingEvents: {
|
|
286
290
|
last10Seconds: number;
|
|
287
291
|
last30Seconds: number;
|
|
@@ -301,6 +305,9 @@ interface QualityOfServiceConfig {
|
|
|
301
305
|
interface AdaptivityEvents {
|
|
302
306
|
["adapt level"]: Readonly<Direction>;
|
|
303
307
|
}
|
|
308
|
+
interface AdaptivityStatistics {
|
|
309
|
+
isAbrEnabled: boolean;
|
|
310
|
+
}
|
|
304
311
|
interface QualityOfServiceSource {
|
|
305
312
|
getMetrics(): Metrics;
|
|
306
313
|
getLevelStats(level: RenditionLevel): PerLevelStats | undefined;
|
|
@@ -318,7 +325,6 @@ declare class AdaptivityModule {
|
|
|
318
325
|
private logger;
|
|
319
326
|
private isSuspended;
|
|
320
327
|
private lastAdaptTime;
|
|
321
|
-
private cooldownTime;
|
|
322
328
|
isEnabled: boolean;
|
|
323
329
|
constructor(emitter: Emitter<AdaptivityEvents>, logger: Logger, qualityOfServiceSource: QualityOfServiceSource, config: Partial<QualityOfServiceConfig>);
|
|
324
330
|
static create: (emitter: Emitter<AdaptivityEvents>, logger: Logger, qualityOfServiceSource: QualityOfServiceSource, config?: Partial<QualityOfServiceConfig>) => AdaptivityModule;
|
|
@@ -327,6 +333,7 @@ declare class AdaptivityModule {
|
|
|
327
333
|
suspend: () => void;
|
|
328
334
|
unsuspend: () => void;
|
|
329
335
|
reset: () => void;
|
|
336
|
+
getStatistics: () => AdaptivityStatistics;
|
|
330
337
|
isQoSOk: (renditionLevel: RenditionLevel) => boolean;
|
|
331
338
|
private onBufferState;
|
|
332
339
|
private onAdaptedLevel;
|
|
@@ -369,6 +376,7 @@ declare class AudioPlayerModule {
|
|
|
369
376
|
get isSeeking(): boolean;
|
|
370
377
|
get muted(): boolean;
|
|
371
378
|
set muted(muted: boolean);
|
|
379
|
+
get paused(): boolean;
|
|
372
380
|
get currentTime(): number;
|
|
373
381
|
set currentTime(currentTime: number);
|
|
374
382
|
constructor(emitter: Emitter<AudioPlayerModuleListeners, AudioPlayerModuleEvents>, logger: Logger, clockSource: ClockSource, muted: boolean);
|
|
@@ -442,6 +450,7 @@ interface ConnectionStatistics {
|
|
|
442
450
|
estimatedBandwidth: number;
|
|
443
451
|
edgeUrl?: string;
|
|
444
452
|
connectCount: number;
|
|
453
|
+
connectionAttemptCount: number;
|
|
445
454
|
}
|
|
446
455
|
declare class ConnectionModule {
|
|
447
456
|
private static PING_INTERVAL;
|
|
@@ -452,9 +461,9 @@ declare class ConnectionModule {
|
|
|
452
461
|
private transport?;
|
|
453
462
|
private logger;
|
|
454
463
|
private options;
|
|
455
|
-
private pingInterval?;
|
|
456
464
|
private rtts;
|
|
457
|
-
private lastPingSentTime
|
|
465
|
+
private lastPingSentTime;
|
|
466
|
+
private isPingInFlight;
|
|
458
467
|
private connectCount;
|
|
459
468
|
private _firstConnectionTime?;
|
|
460
469
|
private _lastConnectionTime?;
|
|
@@ -481,7 +490,8 @@ declare class ConnectionModule {
|
|
|
481
490
|
private onTransportChange;
|
|
482
491
|
disconnect: (reason?: string) => void;
|
|
483
492
|
reconnect: (reason: string) => void;
|
|
484
|
-
private
|
|
493
|
+
private resetPingState;
|
|
494
|
+
private pingCooldownExpired;
|
|
485
495
|
private sendPing;
|
|
486
496
|
}
|
|
487
497
|
interface Size {
|
|
@@ -804,6 +814,9 @@ interface MseModuleListeners {
|
|
|
804
814
|
["init segment"]: Readonly<InitSegment>;
|
|
805
815
|
["coded sample"]: Readonly<CodedSample>;
|
|
806
816
|
}
|
|
817
|
+
interface MseModuleStatistics {
|
|
818
|
+
quotaErrorCount: number;
|
|
819
|
+
}
|
|
807
820
|
declare class MseModule {
|
|
808
821
|
private logger;
|
|
809
822
|
private timers;
|
|
@@ -815,9 +828,11 @@ declare class MseModule {
|
|
|
815
828
|
private autoRecoverFromMediaErrors;
|
|
816
829
|
private pendingSamples;
|
|
817
830
|
private isWorkingOnPendingSamples;
|
|
831
|
+
private quotaErrorCount;
|
|
818
832
|
constructor(logger: Logger, emitter: Emitter<MseModuleListeners, MseModuleEvents>, mediaElement: HTMLMediaElement, tracks: Track[]);
|
|
819
833
|
static create: (logger: Logger, emitter: Emitter<MseModuleListeners, MseModuleEvents>, mediaElement: HTMLMediaElement, tracks: Track[]) => Promise<MseModule>;
|
|
820
834
|
unload: () => void;
|
|
835
|
+
getStatistics: () => MseModuleStatistics;
|
|
821
836
|
private open;
|
|
822
837
|
getBuffer: (type: Type) => TimeRange[];
|
|
823
838
|
init: (initSegment: Readonly<InitSegment>) => void;
|
|
@@ -869,6 +884,7 @@ interface QualityOfServiceModuleStatistics {
|
|
|
869
884
|
};
|
|
870
885
|
}
|
|
871
886
|
declare class QualityOfServiceModule {
|
|
887
|
+
private readonly minBufferFullnessLengthForRegression;
|
|
872
888
|
private logger;
|
|
873
889
|
private emitter;
|
|
874
890
|
private timers;
|
|
@@ -924,12 +940,14 @@ declare class SubscriptionModule {
|
|
|
924
940
|
private currentSubscription;
|
|
925
941
|
private _isSwitchingSubscription;
|
|
926
942
|
private pendingSubscriptionTimeoutId?;
|
|
943
|
+
private burstMs;
|
|
927
944
|
private constructor();
|
|
928
945
|
unload: () => void;
|
|
929
946
|
static create: (logger: Logger, emitter: Emitter<SubscriptionModuleListeners>, subscription: Subscription) => SubscriptionModule;
|
|
930
947
|
isSwitchingSubscription: () => boolean;
|
|
931
948
|
getTargetSubscription: () => Subscription;
|
|
932
949
|
getCurrentSubscription: () => Subscription;
|
|
950
|
+
enableBurst: (bufferTimeMs: number) => void;
|
|
933
951
|
setSize: (size: Readonly<Size>) => void;
|
|
934
952
|
setVideoConstraint: (constraint: VideoConstraint) => void;
|
|
935
953
|
setAudioConstraint: (constraint: AudioConstraint) => void;
|
|
@@ -939,6 +957,8 @@ declare class SubscriptionModule {
|
|
|
939
957
|
setLanguage: (language: string | undefined) => void;
|
|
940
958
|
setVideoCodec: (videoCodec: VideoCodec | undefined) => void;
|
|
941
959
|
setAudioCodec: (audioCodec: AudioCodec | undefined) => void;
|
|
960
|
+
private setBurst;
|
|
961
|
+
private isNewSubscription;
|
|
942
962
|
private onSubscriptionChanged;
|
|
943
963
|
private scheduleSubscriptionChange;
|
|
944
964
|
}
|
|
@@ -965,8 +985,9 @@ interface BufferSource {
|
|
|
965
985
|
interface SyncModuleStatistics {
|
|
966
986
|
drift: number | undefined;
|
|
967
987
|
driftAdjustmentCount: number;
|
|
968
|
-
|
|
988
|
+
timeshiftDriftAdjustmentCount: number;
|
|
969
989
|
discardedTimeInfoCount: number;
|
|
990
|
+
seekTime: number;
|
|
970
991
|
}
|
|
971
992
|
declare class SyncModule {
|
|
972
993
|
private emitter;
|
|
@@ -974,25 +995,29 @@ declare class SyncModule {
|
|
|
974
995
|
private playbackSource;
|
|
975
996
|
private bufferSource;
|
|
976
997
|
private lastSeekTime;
|
|
977
|
-
readonly seekCooldownTime =
|
|
998
|
+
readonly seekCooldownTime = 1000;
|
|
999
|
+
readonly seekTimeoutTime = 5000;
|
|
978
1000
|
readonly syncMaxBehind: number;
|
|
979
1001
|
readonly syncMaxBehindMultiplierStep = 1;
|
|
980
|
-
readonly syncMaxBehindIncreaseEvery =
|
|
981
|
-
readonly syncMaxBehindMaximumAllowed =
|
|
1002
|
+
readonly syncMaxBehindIncreaseEvery = 3;
|
|
1003
|
+
readonly syncMaxBehindMaximumAllowed = 2000;
|
|
982
1004
|
syncMaxBehindMultiplier: number;
|
|
983
1005
|
readonly syncMaxAhead = 150;
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
1006
|
+
timeshiftSync: {
|
|
1007
|
+
enabled: boolean;
|
|
1008
|
+
maxBehind: number;
|
|
1009
|
+
multiplier: number;
|
|
1010
|
+
maxBehindAllowed: number;
|
|
1011
|
+
overshoot: number;
|
|
1012
|
+
minOvershootAllowed: number;
|
|
1013
|
+
maxOvershootAllowed: number;
|
|
989
1014
|
};
|
|
990
|
-
readonly maxTimeSyncDifferenceTolerance =
|
|
1015
|
+
readonly maxTimeSyncDifferenceTolerance = 150;
|
|
991
1016
|
private timers;
|
|
992
1017
|
private rtt;
|
|
993
1018
|
private channelSyncInfo;
|
|
994
1019
|
private driftAdjustmentsCount;
|
|
995
|
-
private
|
|
1020
|
+
private timeshiftDriftAdjustmentCount;
|
|
996
1021
|
private timestampOffset?;
|
|
997
1022
|
private currentChannelId?;
|
|
998
1023
|
private highestSeenTimestamps;
|
|
@@ -1005,34 +1030,38 @@ declare class SyncModule {
|
|
|
1005
1030
|
suspend: () => void;
|
|
1006
1031
|
unsuspend: () => void;
|
|
1007
1032
|
activateSyncAdjustments: () => void;
|
|
1008
|
-
static create: (emitter: Emitter<SyncModuleListeners, SyncModuleEvents>, logger: Logger, playbackSource: PlaybackSource, bufferSource: BufferSource,
|
|
1033
|
+
static create: (emitter: Emitter<SyncModuleListeners, SyncModuleEvents>, logger: Logger, playbackSource: PlaybackSource, bufferSource: BufferSource, isTimeshiftSyncEnabled: boolean) => SyncModule;
|
|
1009
1034
|
reset: () => void;
|
|
1010
1035
|
getTimeshiftOffset: () => number;
|
|
1011
1036
|
getCurrentChannelId: () => string | undefined;
|
|
1012
1037
|
updateChannelSyncInfo(channelId: string, syncInfo: SyncInfo): void;
|
|
1038
|
+
private tryApplySyncInfo;
|
|
1013
1039
|
getLiveEdgeTime: (channelId: string) => number | undefined;
|
|
1014
1040
|
getLiveEdgeTimeLatencyAdjusted: (channelId: string) => number | undefined;
|
|
1015
1041
|
getWallclockTime: (channelId: string) => number | undefined;
|
|
1016
1042
|
getWallclockTimeLatencyAdjusted: (channelId: string) => number | undefined;
|
|
1017
1043
|
get serverCurrentTime(): number;
|
|
1044
|
+
get channelCurrentTime(): number;
|
|
1018
1045
|
processSample: <T extends SyncSample>(sample: T) => T;
|
|
1019
1046
|
getStatistics: () => SyncModuleStatistics;
|
|
1020
1047
|
get drift(): number | undefined;
|
|
1021
1048
|
private updateRtt;
|
|
1022
1049
|
isPlaybackSourceReadyToSeek: () => boolean;
|
|
1050
|
+
private isSeeking;
|
|
1023
1051
|
private isAllowedToSync;
|
|
1024
1052
|
private isSeekCooldownExpired;
|
|
1053
|
+
private isSeekTimeoutExpired;
|
|
1054
|
+
private currentTimeshiftMaxBehind;
|
|
1025
1055
|
private currentSyncMaxBehind;
|
|
1056
|
+
private currentSyncMaxAhead;
|
|
1057
|
+
private tryTimeshiftSync;
|
|
1026
1058
|
private onSync;
|
|
1027
|
-
playbackRateSync: (drift: number, playbackRate: number) => [
|
|
1028
|
-
boolean,
|
|
1029
|
-
number
|
|
1030
|
-
];
|
|
1031
1059
|
}
|
|
1032
1060
|
declare const defaultOptions: {
|
|
1033
1061
|
sizeBasedResolutionCapEnabled: boolean;
|
|
1034
1062
|
pictureInPictureEnabled: boolean;
|
|
1035
1063
|
abrEnabled: boolean;
|
|
1064
|
+
burstEnabled: boolean;
|
|
1036
1065
|
mseEnabled: boolean;
|
|
1037
1066
|
mseOpusEnabled: boolean;
|
|
1038
1067
|
muted: boolean;
|
|
@@ -1044,6 +1073,7 @@ declare const defaultOptions: {
|
|
|
1044
1073
|
maxAudioBitRate: number;
|
|
1045
1074
|
tags: string[];
|
|
1046
1075
|
media: Media;
|
|
1076
|
+
posterEnabled: boolean;
|
|
1047
1077
|
reconnectHandler: (state: ReconnectState) => Promise<boolean> | boolean;
|
|
1048
1078
|
advanced: {
|
|
1049
1079
|
wasmDecodingConstraint: Partial<VideoConstraint>;
|
|
@@ -1118,6 +1148,7 @@ export declare class Vindral extends Emitter<PublicVindralEvents> {
|
|
|
1118
1148
|
get serverEdgeTime(): number | undefined;
|
|
1119
1149
|
get serverWallclockTime(): number | undefined;
|
|
1120
1150
|
get currentTime(): number;
|
|
1151
|
+
get channelCurrentTime(): number;
|
|
1121
1152
|
get targetBufferTime(): number;
|
|
1122
1153
|
set targetBufferTime(bufferTimeMs: number);
|
|
1123
1154
|
get playbackLatency(): number | undefined;
|
|
@@ -1146,6 +1177,7 @@ export declare class Vindral extends Emitter<PublicVindralEvents> {
|
|
|
1146
1177
|
get timeSpentBuffering(): number;
|
|
1147
1178
|
get timeActive(): number;
|
|
1148
1179
|
getOptions: () => Options & typeof defaultOptions;
|
|
1180
|
+
getThumbnailUrl: () => string;
|
|
1149
1181
|
updateAuthenticationToken: (token: string) => void;
|
|
1150
1182
|
connect: () => void;
|
|
1151
1183
|
getCastOptions: () => Options;
|
|
@@ -1204,6 +1236,7 @@ declare class TelemetryModule {
|
|
|
1204
1236
|
private unsentLines;
|
|
1205
1237
|
private retries;
|
|
1206
1238
|
private errorCount;
|
|
1239
|
+
private statsCount;
|
|
1207
1240
|
private constructor();
|
|
1208
1241
|
unload: () => void;
|
|
1209
1242
|
static create: (logger: Logger, emitter: Emitter<TelemetryModuleListeners, unknown>, options: TelemetryModuleOptions, statisticsSource: TelemetryStatisticsSource) => TelemetryModule;
|
|
@@ -1307,12 +1340,14 @@ export interface Options {
|
|
|
1307
1340
|
maxBufferTime?: number;
|
|
1308
1341
|
sizeBasedResolutionCapEnabled?: boolean;
|
|
1309
1342
|
pictureInPictureEnabled?: boolean;
|
|
1343
|
+
burstEnabled?: boolean;
|
|
1310
1344
|
mseEnabled?: boolean;
|
|
1311
1345
|
mseOpusEnabled?: boolean;
|
|
1312
1346
|
abrEnabled?: boolean;
|
|
1313
1347
|
maxSize?: Size;
|
|
1314
1348
|
maxAudioBitRate?: number;
|
|
1315
1349
|
maxVideoBitRate?: number;
|
|
1350
|
+
posterEnabled?: boolean;
|
|
1316
1351
|
muted?: boolean;
|
|
1317
1352
|
reconnectHandler?: (state: ReconnectState) => Promise<boolean> | boolean;
|
|
1318
1353
|
tags?: string[];
|
|
@@ -1373,12 +1408,16 @@ interface AudioRenditionProps {
|
|
|
1373
1408
|
channels: number;
|
|
1374
1409
|
sampleRate: number;
|
|
1375
1410
|
}
|
|
1411
|
+
interface CodecProps {
|
|
1412
|
+
codec: Codec;
|
|
1413
|
+
codecString?: string;
|
|
1414
|
+
}
|
|
1376
1415
|
export declare type VideoRendition = VideoRenditionProps & RenditionProps;
|
|
1377
1416
|
export declare type AudioRendition = AudioRenditionProps & RenditionProps;
|
|
1378
1417
|
export declare type Rendition = VideoRendition | AudioRendition;
|
|
1379
1418
|
export declare const isVideoRendition: (rendition: Readonly<Rendition>) => rendition is VideoRendition;
|
|
1380
1419
|
export declare const isAudioRendition: (rendition: Readonly<Rendition>) => rendition is AudioRendition;
|
|
1381
|
-
export declare const getMimeType: (rendition: Readonly<
|
|
1420
|
+
export declare const getMimeType: (rendition: Readonly<CodecProps>) => string;
|
|
1382
1421
|
interface AudioConstraint {
|
|
1383
1422
|
bitRate: number;
|
|
1384
1423
|
codec?: AudioCodec;
|
|
@@ -1397,6 +1436,7 @@ interface Subscription {
|
|
|
1397
1436
|
channelId: string;
|
|
1398
1437
|
video: VideoConstraint;
|
|
1399
1438
|
audio: AudioConstraint;
|
|
1439
|
+
burstMs?: number;
|
|
1400
1440
|
meta?: Record<string, string>;
|
|
1401
1441
|
initiator?: SubscriptionInitiator;
|
|
1402
1442
|
}
|
|
@@ -1532,6 +1572,7 @@ export declare class CastSender extends Emitter<CastSenderEvents> {
|
|
|
1532
1572
|
init: () => Promise<void>;
|
|
1533
1573
|
start: () => Promise<void>;
|
|
1534
1574
|
stop: () => void;
|
|
1575
|
+
getReceiverName: () => string | undefined;
|
|
1535
1576
|
private onGCastApiAvailable;
|
|
1536
1577
|
private send;
|
|
1537
1578
|
private onMessage;
|
|
@@ -1539,7 +1580,6 @@ export declare class CastSender extends Emitter<CastSenderEvents> {
|
|
|
1539
1580
|
private onSessionStateChanged;
|
|
1540
1581
|
private getInstance;
|
|
1541
1582
|
private getSession;
|
|
1542
|
-
private getReceiverName;
|
|
1543
1583
|
private castLibrariesAdded;
|
|
1544
1584
|
private verifyCastLibraries;
|
|
1545
1585
|
}
|
package/package.json
CHANGED