@vindral/web-sdk 2.0.13 → 2.0.17
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 +61 -28
- package/package.json +1 -1
- package/web-sdk.esm.js +1 -1
- package/web-sdk.umd.js +1 -1
package/index.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ interface BaseCodedSample {
|
|
|
7
7
|
timescale: number;
|
|
8
8
|
duration: number;
|
|
9
9
|
data: ArrayBuffer;
|
|
10
|
+
compositionTimeOffset?: number;
|
|
10
11
|
}
|
|
11
12
|
interface CodedAudioSample extends BaseCodedSample {
|
|
12
13
|
type: "audio";
|
|
@@ -181,6 +182,7 @@ export interface PlaybackSource {
|
|
|
181
182
|
playbackRate?: number;
|
|
182
183
|
isActivated: boolean;
|
|
183
184
|
readonly seekTime: number;
|
|
185
|
+
readonly paused: boolean;
|
|
184
186
|
readonly isSeeking: boolean;
|
|
185
187
|
play(initiator: PlayInitiator): Promise<void>;
|
|
186
188
|
}
|
|
@@ -281,6 +283,7 @@ declare class PlaybackModule {
|
|
|
281
283
|
}
|
|
282
284
|
declare type Direction = "upgrade" | "downgrade" | "double downgrade" | "reconnect";
|
|
283
285
|
interface QualityOfServiceConfig {
|
|
286
|
+
cooldownTime: number;
|
|
284
287
|
maxBufferingEvents: {
|
|
285
288
|
last10Seconds: number;
|
|
286
289
|
last30Seconds: number;
|
|
@@ -300,6 +303,9 @@ interface QualityOfServiceConfig {
|
|
|
300
303
|
interface AdaptivityEvents {
|
|
301
304
|
["adapt level"]: Readonly<Direction>;
|
|
302
305
|
}
|
|
306
|
+
interface AdaptivityStatistics {
|
|
307
|
+
isAbrEnabled: boolean;
|
|
308
|
+
}
|
|
303
309
|
interface QualityOfServiceSource {
|
|
304
310
|
getMetrics(): Metrics;
|
|
305
311
|
getLevelStats(level: RenditionLevel): PerLevelStats | undefined;
|
|
@@ -317,7 +323,6 @@ declare class AdaptivityModule {
|
|
|
317
323
|
private logger;
|
|
318
324
|
private isSuspended;
|
|
319
325
|
private lastAdaptTime;
|
|
320
|
-
private cooldownTime;
|
|
321
326
|
isEnabled: boolean;
|
|
322
327
|
constructor(emitter: Emitter<AdaptivityEvents>, logger: Logger, qualityOfServiceSource: QualityOfServiceSource, config: Partial<QualityOfServiceConfig>);
|
|
323
328
|
static create: (emitter: Emitter<AdaptivityEvents>, logger: Logger, qualityOfServiceSource: QualityOfServiceSource, config?: Partial<QualityOfServiceConfig>) => AdaptivityModule;
|
|
@@ -326,6 +331,7 @@ declare class AdaptivityModule {
|
|
|
326
331
|
suspend: () => void;
|
|
327
332
|
unsuspend: () => void;
|
|
328
333
|
reset: () => void;
|
|
334
|
+
getStatistics: () => AdaptivityStatistics;
|
|
329
335
|
isQoSOk: (renditionLevel: RenditionLevel) => boolean;
|
|
330
336
|
private onBufferState;
|
|
331
337
|
private onAdaptedLevel;
|
|
@@ -368,6 +374,7 @@ declare class AudioPlayerModule {
|
|
|
368
374
|
get isSeeking(): boolean;
|
|
369
375
|
get muted(): boolean;
|
|
370
376
|
set muted(muted: boolean);
|
|
377
|
+
get paused(): boolean;
|
|
371
378
|
get currentTime(): number;
|
|
372
379
|
set currentTime(currentTime: number);
|
|
373
380
|
constructor(emitter: Emitter<AudioPlayerModuleListeners, AudioPlayerModuleEvents>, logger: Logger, clockSource: ClockSource, muted: boolean);
|
|
@@ -441,6 +448,7 @@ interface ConnectionStatistics {
|
|
|
441
448
|
estimatedBandwidth: number;
|
|
442
449
|
edgeUrl?: string;
|
|
443
450
|
connectCount: number;
|
|
451
|
+
connectionAttemptCount: number;
|
|
444
452
|
}
|
|
445
453
|
declare class ConnectionModule {
|
|
446
454
|
private static PING_INTERVAL;
|
|
@@ -480,7 +488,7 @@ declare class ConnectionModule {
|
|
|
480
488
|
private onTransportChange;
|
|
481
489
|
disconnect: (reason?: string) => void;
|
|
482
490
|
reconnect: (reason: string) => void;
|
|
483
|
-
private
|
|
491
|
+
private cleanupPingIntervals;
|
|
484
492
|
private sendPing;
|
|
485
493
|
}
|
|
486
494
|
interface Size {
|
|
@@ -728,7 +736,6 @@ declare class DocumentStateModule implements DocumentState {
|
|
|
728
736
|
private onOffline;
|
|
729
737
|
private onPageHide;
|
|
730
738
|
private onVisibilityChanged;
|
|
731
|
-
private onFocusChange;
|
|
732
739
|
private setIsActive;
|
|
733
740
|
}
|
|
734
741
|
interface IncomingDataModuleListeners {
|
|
@@ -777,23 +784,23 @@ declare class LoggerModule {
|
|
|
777
784
|
interface MetadataModuleEvents {
|
|
778
785
|
["metadata"]: Readonly<Metadata>;
|
|
779
786
|
}
|
|
780
|
-
interface
|
|
781
|
-
["buffer state"]: Readonly<BufferState>;
|
|
782
|
-
}
|
|
783
|
-
interface DriftSource {
|
|
787
|
+
interface TimeSource {
|
|
784
788
|
readonly drift: number | undefined;
|
|
789
|
+
readonly serverCurrentTime: number;
|
|
785
790
|
}
|
|
786
791
|
declare class MetadataModule {
|
|
787
792
|
private static METADATA_TIMEOUT;
|
|
793
|
+
private static METADATA_CHECK_INTERVAL;
|
|
788
794
|
private logger;
|
|
789
795
|
private emitter;
|
|
790
796
|
private waitingMetadata;
|
|
791
797
|
private isTriggered;
|
|
792
|
-
private
|
|
793
|
-
|
|
798
|
+
private timeSource;
|
|
799
|
+
private timers;
|
|
800
|
+
constructor(emitter: Emitter<unknown, MetadataModuleEvents>, logger: Logger, timeSource: TimeSource);
|
|
794
801
|
load: () => void;
|
|
795
802
|
unload: () => void;
|
|
796
|
-
static create: (emitter: Emitter<
|
|
803
|
+
static create: (emitter: Emitter<unknown, MetadataModuleEvents>, logger: Logger, timeSource: TimeSource) => MetadataModule;
|
|
797
804
|
addMetadata: (metadata: Metadata) => void;
|
|
798
805
|
private onBufferedStateChanged;
|
|
799
806
|
}
|
|
@@ -804,6 +811,9 @@ interface MseModuleListeners {
|
|
|
804
811
|
["init segment"]: Readonly<InitSegment>;
|
|
805
812
|
["coded sample"]: Readonly<CodedSample>;
|
|
806
813
|
}
|
|
814
|
+
interface MseModuleStatistics {
|
|
815
|
+
quotaErrorCount: number;
|
|
816
|
+
}
|
|
807
817
|
declare class MseModule {
|
|
808
818
|
private logger;
|
|
809
819
|
private timers;
|
|
@@ -815,9 +825,11 @@ declare class MseModule {
|
|
|
815
825
|
private autoRecoverFromMediaErrors;
|
|
816
826
|
private pendingSamples;
|
|
817
827
|
private isWorkingOnPendingSamples;
|
|
828
|
+
private quotaErrorCount;
|
|
818
829
|
constructor(logger: Logger, emitter: Emitter<MseModuleListeners, MseModuleEvents>, mediaElement: HTMLMediaElement, tracks: Track[]);
|
|
819
830
|
static create: (logger: Logger, emitter: Emitter<MseModuleListeners, MseModuleEvents>, mediaElement: HTMLMediaElement, tracks: Track[]) => Promise<MseModule>;
|
|
820
831
|
unload: () => void;
|
|
832
|
+
getStatistics: () => MseModuleStatistics;
|
|
821
833
|
private open;
|
|
822
834
|
getBuffer: (type: Type) => TimeRange[];
|
|
823
835
|
init: (initSegment: Readonly<InitSegment>) => void;
|
|
@@ -869,6 +881,7 @@ interface QualityOfServiceModuleStatistics {
|
|
|
869
881
|
};
|
|
870
882
|
}
|
|
871
883
|
declare class QualityOfServiceModule {
|
|
884
|
+
private readonly minBufferFullnessLengthForRegression;
|
|
872
885
|
private logger;
|
|
873
886
|
private emitter;
|
|
874
887
|
private timers;
|
|
@@ -924,12 +937,14 @@ declare class SubscriptionModule {
|
|
|
924
937
|
private currentSubscription;
|
|
925
938
|
private _isSwitchingSubscription;
|
|
926
939
|
private pendingSubscriptionTimeoutId?;
|
|
940
|
+
private burstMs;
|
|
927
941
|
private constructor();
|
|
928
942
|
unload: () => void;
|
|
929
943
|
static create: (logger: Logger, emitter: Emitter<SubscriptionModuleListeners>, subscription: Subscription) => SubscriptionModule;
|
|
930
944
|
isSwitchingSubscription: () => boolean;
|
|
931
945
|
getTargetSubscription: () => Subscription;
|
|
932
946
|
getCurrentSubscription: () => Subscription;
|
|
947
|
+
enableBurst: (bufferTimeMs: number) => void;
|
|
933
948
|
setSize: (size: Readonly<Size>) => void;
|
|
934
949
|
setVideoConstraint: (constraint: VideoConstraint) => void;
|
|
935
950
|
setAudioConstraint: (constraint: AudioConstraint) => void;
|
|
@@ -939,6 +954,7 @@ declare class SubscriptionModule {
|
|
|
939
954
|
setLanguage: (language: string | undefined) => void;
|
|
940
955
|
setVideoCodec: (videoCodec: VideoCodec | undefined) => void;
|
|
941
956
|
setAudioCodec: (audioCodec: AudioCodec | undefined) => void;
|
|
957
|
+
private setBurst;
|
|
942
958
|
private onSubscriptionChanged;
|
|
943
959
|
private scheduleSubscriptionChange;
|
|
944
960
|
}
|
|
@@ -965,8 +981,9 @@ interface BufferSource {
|
|
|
965
981
|
interface SyncModuleStatistics {
|
|
966
982
|
drift: number | undefined;
|
|
967
983
|
driftAdjustmentCount: number;
|
|
968
|
-
|
|
984
|
+
timeshiftDriftAdjustmentCount: number;
|
|
969
985
|
discardedTimeInfoCount: number;
|
|
986
|
+
seekTime: number;
|
|
970
987
|
}
|
|
971
988
|
declare class SyncModule {
|
|
972
989
|
private emitter;
|
|
@@ -974,25 +991,29 @@ declare class SyncModule {
|
|
|
974
991
|
private playbackSource;
|
|
975
992
|
private bufferSource;
|
|
976
993
|
private lastSeekTime;
|
|
977
|
-
readonly seekCooldownTime =
|
|
994
|
+
readonly seekCooldownTime = 1000;
|
|
995
|
+
readonly seekTimeoutTime = 5000;
|
|
978
996
|
readonly syncMaxBehind: number;
|
|
979
997
|
readonly syncMaxBehindMultiplierStep = 1;
|
|
980
|
-
readonly syncMaxBehindIncreaseEvery =
|
|
981
|
-
readonly syncMaxBehindMaximumAllowed =
|
|
998
|
+
readonly syncMaxBehindIncreaseEvery = 3;
|
|
999
|
+
readonly syncMaxBehindMaximumAllowed = 2000;
|
|
982
1000
|
syncMaxBehindMultiplier: number;
|
|
983
1001
|
readonly syncMaxAhead = 150;
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
1002
|
+
timeshiftSync: {
|
|
1003
|
+
enabled: boolean;
|
|
1004
|
+
maxBehind: number;
|
|
1005
|
+
multiplier: number;
|
|
1006
|
+
maxBehindAllowed: number;
|
|
1007
|
+
overshoot: number;
|
|
1008
|
+
minOvershootAllowed: number;
|
|
1009
|
+
maxOvershootAllowed: number;
|
|
989
1010
|
};
|
|
990
|
-
readonly maxTimeSyncDifferenceTolerance =
|
|
1011
|
+
readonly maxTimeSyncDifferenceTolerance = 150;
|
|
991
1012
|
private timers;
|
|
992
1013
|
private rtt;
|
|
993
1014
|
private channelSyncInfo;
|
|
994
1015
|
private driftAdjustmentsCount;
|
|
995
|
-
private
|
|
1016
|
+
private timeshiftDriftAdjustmentCount;
|
|
996
1017
|
private timestampOffset?;
|
|
997
1018
|
private currentChannelId?;
|
|
998
1019
|
private highestSeenTimestamps;
|
|
@@ -1005,34 +1026,38 @@ declare class SyncModule {
|
|
|
1005
1026
|
suspend: () => void;
|
|
1006
1027
|
unsuspend: () => void;
|
|
1007
1028
|
activateSyncAdjustments: () => void;
|
|
1008
|
-
static create: (emitter: Emitter<SyncModuleListeners, SyncModuleEvents>, logger: Logger, playbackSource: PlaybackSource, bufferSource: BufferSource,
|
|
1029
|
+
static create: (emitter: Emitter<SyncModuleListeners, SyncModuleEvents>, logger: Logger, playbackSource: PlaybackSource, bufferSource: BufferSource, isTimeshiftSyncEnabled: boolean) => SyncModule;
|
|
1009
1030
|
reset: () => void;
|
|
1010
1031
|
getTimeshiftOffset: () => number;
|
|
1011
1032
|
getCurrentChannelId: () => string | undefined;
|
|
1012
1033
|
updateChannelSyncInfo(channelId: string, syncInfo: SyncInfo): void;
|
|
1034
|
+
private tryApplySyncInfo;
|
|
1013
1035
|
getLiveEdgeTime: (channelId: string) => number | undefined;
|
|
1014
1036
|
getLiveEdgeTimeLatencyAdjusted: (channelId: string) => number | undefined;
|
|
1015
1037
|
getWallclockTime: (channelId: string) => number | undefined;
|
|
1016
1038
|
getWallclockTimeLatencyAdjusted: (channelId: string) => number | undefined;
|
|
1017
1039
|
get serverCurrentTime(): number;
|
|
1040
|
+
get channelCurrentTime(): number;
|
|
1018
1041
|
processSample: <T extends SyncSample>(sample: T) => T;
|
|
1019
1042
|
getStatistics: () => SyncModuleStatistics;
|
|
1020
1043
|
get drift(): number | undefined;
|
|
1021
1044
|
private updateRtt;
|
|
1022
1045
|
isPlaybackSourceReadyToSeek: () => boolean;
|
|
1046
|
+
private isSeeking;
|
|
1023
1047
|
private isAllowedToSync;
|
|
1024
1048
|
private isSeekCooldownExpired;
|
|
1049
|
+
private isSeekTimeoutExpired;
|
|
1050
|
+
private currentTimeshiftMaxBehind;
|
|
1025
1051
|
private currentSyncMaxBehind;
|
|
1052
|
+
private currentSyncMaxAhead;
|
|
1053
|
+
private tryTimeshiftSync;
|
|
1026
1054
|
private onSync;
|
|
1027
|
-
playbackRateSync: (drift: number, playbackRate: number) => [
|
|
1028
|
-
boolean,
|
|
1029
|
-
number
|
|
1030
|
-
];
|
|
1031
1055
|
}
|
|
1032
1056
|
declare const defaultOptions: {
|
|
1033
1057
|
sizeBasedResolutionCapEnabled: boolean;
|
|
1034
1058
|
pictureInPictureEnabled: boolean;
|
|
1035
1059
|
abrEnabled: boolean;
|
|
1060
|
+
burstEnabled: boolean;
|
|
1036
1061
|
mseEnabled: boolean;
|
|
1037
1062
|
mseOpusEnabled: boolean;
|
|
1038
1063
|
muted: boolean;
|
|
@@ -1118,6 +1143,7 @@ export declare class Vindral extends Emitter<PublicVindralEvents> {
|
|
|
1118
1143
|
get serverEdgeTime(): number | undefined;
|
|
1119
1144
|
get serverWallclockTime(): number | undefined;
|
|
1120
1145
|
get currentTime(): number;
|
|
1146
|
+
get channelCurrentTime(): number;
|
|
1121
1147
|
get targetBufferTime(): number;
|
|
1122
1148
|
set targetBufferTime(bufferTimeMs: number);
|
|
1123
1149
|
get playbackLatency(): number | undefined;
|
|
@@ -1204,6 +1230,7 @@ declare class TelemetryModule {
|
|
|
1204
1230
|
private unsentLines;
|
|
1205
1231
|
private retries;
|
|
1206
1232
|
private errorCount;
|
|
1233
|
+
private statsCount;
|
|
1207
1234
|
private constructor();
|
|
1208
1235
|
unload: () => void;
|
|
1209
1236
|
static create: (logger: Logger, emitter: Emitter<TelemetryModuleListeners, unknown>, options: TelemetryModuleOptions, statisticsSource: TelemetryStatisticsSource) => TelemetryModule;
|
|
@@ -1307,6 +1334,7 @@ export interface Options {
|
|
|
1307
1334
|
maxBufferTime?: number;
|
|
1308
1335
|
sizeBasedResolutionCapEnabled?: boolean;
|
|
1309
1336
|
pictureInPictureEnabled?: boolean;
|
|
1337
|
+
burstEnabled?: boolean;
|
|
1310
1338
|
mseEnabled?: boolean;
|
|
1311
1339
|
mseOpusEnabled?: boolean;
|
|
1312
1340
|
abrEnabled?: boolean;
|
|
@@ -1373,12 +1401,16 @@ interface AudioRenditionProps {
|
|
|
1373
1401
|
channels: number;
|
|
1374
1402
|
sampleRate: number;
|
|
1375
1403
|
}
|
|
1404
|
+
interface CodecProps {
|
|
1405
|
+
codec: Codec;
|
|
1406
|
+
codecString?: string;
|
|
1407
|
+
}
|
|
1376
1408
|
export declare type VideoRendition = VideoRenditionProps & RenditionProps;
|
|
1377
1409
|
export declare type AudioRendition = AudioRenditionProps & RenditionProps;
|
|
1378
1410
|
export declare type Rendition = VideoRendition | AudioRendition;
|
|
1379
1411
|
export declare const isVideoRendition: (rendition: Readonly<Rendition>) => rendition is VideoRendition;
|
|
1380
1412
|
export declare const isAudioRendition: (rendition: Readonly<Rendition>) => rendition is AudioRendition;
|
|
1381
|
-
export declare const getMimeType: (rendition: Readonly<
|
|
1413
|
+
export declare const getMimeType: (rendition: Readonly<CodecProps>) => string;
|
|
1382
1414
|
interface AudioConstraint {
|
|
1383
1415
|
bitRate: number;
|
|
1384
1416
|
codec?: AudioCodec;
|
|
@@ -1397,6 +1429,7 @@ interface Subscription {
|
|
|
1397
1429
|
channelId: string;
|
|
1398
1430
|
video: VideoConstraint;
|
|
1399
1431
|
audio: AudioConstraint;
|
|
1432
|
+
burstMs?: number;
|
|
1400
1433
|
meta?: Record<string, string>;
|
|
1401
1434
|
initiator?: SubscriptionInitiator;
|
|
1402
1435
|
}
|
|
@@ -1532,6 +1565,7 @@ export declare class CastSender extends Emitter<CastSenderEvents> {
|
|
|
1532
1565
|
init: () => Promise<void>;
|
|
1533
1566
|
start: () => Promise<void>;
|
|
1534
1567
|
stop: () => void;
|
|
1568
|
+
getReceiverName: () => string | undefined;
|
|
1535
1569
|
private onGCastApiAvailable;
|
|
1536
1570
|
private send;
|
|
1537
1571
|
private onMessage;
|
|
@@ -1539,7 +1573,6 @@ export declare class CastSender extends Emitter<CastSenderEvents> {
|
|
|
1539
1573
|
private onSessionStateChanged;
|
|
1540
1574
|
private getInstance;
|
|
1541
1575
|
private getSession;
|
|
1542
|
-
private getReceiverName;
|
|
1543
1576
|
private castLibrariesAdded;
|
|
1544
1577
|
private verifyCastLibraries;
|
|
1545
1578
|
}
|
package/package.json
CHANGED