@vkontakte/videoplayer-core 2.0.131-dev.c93c80a1.0 → 2.0.131-dev.d8e93fa7.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/es2015.cjs.js +38 -38
- package/es2015.esm.js +37 -37
- package/es2018.cjs.js +43 -43
- package/es2018.esm.js +44 -44
- package/es2024.cjs.js +41 -41
- package/es2024.esm.js +32 -32
- package/esnext.cjs.js +41 -41
- package/esnext.esm.js +32 -32
- package/evergreen.esm.js +41 -41
- package/package.json +2 -2
- package/types/providers/DashProvider/baseDashProvider.d.ts +0 -1
- package/types/providers/DashProvider/lib/buffer.d.ts +0 -3
- package/types/providers/DashProvider/lib/fetcher.d.ts +1 -2
- package/types/providers/DashProvider/lib/player.d.ts +0 -1
- package/types/providers/DashProvider/lib/utils.d.ts +0 -11
- package/types/providers/utils/StallsManager.d.ts +18 -4
- package/types/utils/tuningConfig.d.ts +25 -8
- package/types/providers/DashProvider/lib/sourceBufferBufferedDiff.d.ts +0 -19
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vkontakte/videoplayer-core",
|
|
3
|
-
"version": "2.0.131-dev.
|
|
3
|
+
"version": "2.0.131-dev.d8e93fa7.0",
|
|
4
4
|
"author": "vk.com",
|
|
5
5
|
"description": "Videoplayer core library based on the vk.com platform",
|
|
6
6
|
"homepage": "https://vk.com",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"**/*.d.ts"
|
|
55
55
|
],
|
|
56
56
|
"dependencies": {
|
|
57
|
-
"@vkontakte/videoplayer-shared": "1.0.59-dev.
|
|
57
|
+
"@vkontakte/videoplayer-shared": "1.0.59-dev.da7451fa.0",
|
|
58
58
|
"hls.js": "~1.4.7"
|
|
59
59
|
}
|
|
60
60
|
}
|
|
@@ -41,7 +41,6 @@ export default abstract class BaseDashProvider implements IProvider {
|
|
|
41
41
|
protected audioStreamsMap: Map<Stream, IAudioTrack[]>;
|
|
42
42
|
protected videoTrackSwitchHistory: TrackHistory<IVideoTrack>;
|
|
43
43
|
protected audioTrackSwitchHistory: TrackHistory<import("../../player/types").IBaseTrack>;
|
|
44
|
-
private readonly selectedRepresentations;
|
|
45
44
|
constructor(params: IParams);
|
|
46
45
|
protected abstract seek(position: Milliseconds, forcePrecise: boolean): void;
|
|
47
46
|
protected getProviderSubscriptionInfo(): IProviderSubscriptionInfo;
|
|
@@ -12,7 +12,6 @@ export interface Dependencies {
|
|
|
12
12
|
}
|
|
13
13
|
export interface Gap extends IRange<Milliseconds> {
|
|
14
14
|
representation: Representation['id'];
|
|
15
|
-
persistent: boolean;
|
|
16
15
|
}
|
|
17
16
|
export declare class BufferManager {
|
|
18
17
|
currentLiveSegmentServerLatency$: IValueSubject<number>;
|
|
@@ -61,7 +60,6 @@ export declare class BufferManager {
|
|
|
61
60
|
private index;
|
|
62
61
|
private lastDataObtainedTimestampMs;
|
|
63
62
|
private loadByteRangeSegmentsTimeoutId;
|
|
64
|
-
private sourceBufferBufferedDiff;
|
|
65
63
|
constructor(kind: StreamKind, mediaSource: MediaSource, representations: Representation[], { fetcher, tuning, getCurrentPosition, isActiveLowLatency, compatibilityMode, manifest }: Dependencies);
|
|
66
64
|
startWith: (param_0: string) => Promise<void | undefined>;
|
|
67
65
|
switchToWithPreviousAbort(newRepresentationId: Representation['id'], dropBuffer?: boolean): void;
|
|
@@ -110,7 +108,6 @@ export declare class BufferManager {
|
|
|
110
108
|
private pruneBuffer;
|
|
111
109
|
private abortBuffer;
|
|
112
110
|
getDebugBufferState(): IRange<Milliseconds> | undefined;
|
|
113
|
-
getBufferedTo(): number | null;
|
|
114
111
|
getForwardBufferDuration(currentPosition?: Milliseconds | undefined): Milliseconds;
|
|
115
112
|
private detectGaps;
|
|
116
113
|
private detectGapsWhenIdle;
|
|
@@ -42,9 +42,9 @@ export declare class Fetcher {
|
|
|
42
42
|
recoverableError$: Subject<IError>;
|
|
43
43
|
error$: Subject<IError>;
|
|
44
44
|
private abortAllController;
|
|
45
|
+
private subscription;
|
|
45
46
|
private compatibilityMode;
|
|
46
47
|
private useEnableSubtitlesParam;
|
|
47
|
-
private readonly subscription;
|
|
48
48
|
constructor({ throughputEstimator, requestQuic, tracer, compatibilityMode, useEnableSubtitlesParam }: IParams);
|
|
49
49
|
private onHeadersReceived;
|
|
50
50
|
fetchManifest: (param_0: string) => Promise<string | null | undefined>;
|
|
@@ -54,6 +54,5 @@ export declare class Fetcher {
|
|
|
54
54
|
private fetchByteRangeRepresentation;
|
|
55
55
|
private fetchTemplateRepresentation;
|
|
56
56
|
private doFetch;
|
|
57
|
-
private unsubscribeAbortSubscription;
|
|
58
57
|
}
|
|
59
58
|
export declare const suppressAbort: (e: Error | unknown) => void | never;
|
|
@@ -68,7 +68,6 @@ export declare class Player {
|
|
|
68
68
|
private stallWatchdogSubscription;
|
|
69
69
|
private livePauseWatchdogSubscription;
|
|
70
70
|
private destroyController;
|
|
71
|
-
private initedPruneBufferCallback;
|
|
72
71
|
constructor(params: Params);
|
|
73
72
|
initManifest: (param_0: HTMLVideoElement, param_1: string, param_2: number) => Promise<void | undefined>;
|
|
74
73
|
updateManifest: () => Promise<Manifest | null | undefined>;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Representation, Segment, SegmentReference, Stream, TemplateSegment, TemplateSegmentReference, TextRepresentation } from '../../../providers/DashProvider/lib/types';
|
|
2
2
|
import { IAudioStream, IAudioTrack, IInternalTextTrack, IVideoStream, IVideoTrack } from '../../../player/types';
|
|
3
|
-
import { IRange, Milliseconds } from '@vkontakte/videoplayer-shared';
|
|
4
3
|
export declare const representationToVideoTrack: ({ id, width, height, bitrate, fps, quality: qualityString, streamId }: Representation) => IVideoTrack | undefined;
|
|
5
4
|
export declare const representationToAudioTrack: ({ id, bitrate }: Representation) => IAudioTrack;
|
|
6
5
|
export declare const representationToTextTrack: ({ language, label }: Stream, { id, url, isAuto }: Representation & {
|
|
@@ -14,13 +13,3 @@ export declare const isTemplateSegment: (segment: Segment) => segment is Templat
|
|
|
14
13
|
export declare const isTemplateSegmentReference: (segmentReference: SegmentReference) => segmentReference is TemplateSegmentReference;
|
|
15
14
|
export declare const isAbortError: (e: Error | unknown) => boolean;
|
|
16
15
|
export declare const isTextRepresentation: (representation: Representation | TextRepresentation) => representation is TextRepresentation;
|
|
17
|
-
/**
|
|
18
|
-
* @mutates intervals
|
|
19
|
-
*/
|
|
20
|
-
export declare const mergeIntervals: (intervals: IRange<Milliseconds>[]) => IRange<Milliseconds>[];
|
|
21
|
-
export declare const findInIterator: <T>(iterable: MapIterator<T> | SetIterator<T>, matchFn: (arg: T) => boolean) => T | null;
|
|
22
|
-
/**
|
|
23
|
-
* даёт `true` каждые `ms` миллисекунд
|
|
24
|
-
*/
|
|
25
|
-
export declare const semaphor: (ms: number) => () => boolean;
|
|
26
|
-
export declare const createTimeRanges: (buffered: TimeRanges) => number[];
|
|
@@ -8,20 +8,26 @@ interface IConnectData {
|
|
|
8
8
|
isBuffering$: IObservable<boolean>;
|
|
9
9
|
isSeeked$: IObservable<boolean>;
|
|
10
10
|
looped$: IObservable<Seconds>;
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
playing$: IObservable<undefined>;
|
|
12
|
+
currentStallDuration$: IValueSubject<Milliseconds>;
|
|
13
|
+
tuning: ITuningConfig['stallsManager'];
|
|
14
|
+
abrParams: ITuningConfig['autoTrackSelection'];
|
|
13
15
|
}
|
|
14
16
|
declare class StallsManager {
|
|
15
17
|
private currentStallDuration$;
|
|
16
18
|
private videoLastDataObtainedTimestamp$;
|
|
17
19
|
private throughput$;
|
|
18
20
|
private rtt$;
|
|
19
|
-
private
|
|
21
|
+
private tuning;
|
|
22
|
+
private abrParams;
|
|
20
23
|
private isSeeked$;
|
|
21
24
|
private isBuffering$;
|
|
22
|
-
private currentStallsCount;
|
|
23
25
|
private maxQualityLimit;
|
|
24
26
|
private lastUniqueVideoTrackSelected;
|
|
27
|
+
private currentStallsCount;
|
|
28
|
+
private sumStallsDuration;
|
|
29
|
+
private lastStallDuration;
|
|
30
|
+
private providerStartWatchingTimestamp;
|
|
25
31
|
private lastUniqueVideoTrackSelectedTimestamp;
|
|
26
32
|
private predictedThroughputWithoutData;
|
|
27
33
|
private qualityRestrictionTimer;
|
|
@@ -30,7 +36,15 @@ declare class StallsManager {
|
|
|
30
36
|
connect(data: IConnectData): void;
|
|
31
37
|
get videoMaxQualityLimit(): ExactVideoQuality | undefined;
|
|
32
38
|
get predictedThroughput(): Kbps;
|
|
39
|
+
get abrTuningParams(): ITuningConfig['autoTrackSelection'];
|
|
33
40
|
set lastVideoTrackSelected(lastUniqueVideoTrackSelected: IVideoTrack);
|
|
34
41
|
destroy(): void;
|
|
42
|
+
private updateStoredAbrParams;
|
|
43
|
+
private calculateOptimalAbrParams;
|
|
44
|
+
private getStoredData;
|
|
45
|
+
private setStoredData;
|
|
46
|
+
private addStallInfoToHistory;
|
|
47
|
+
private updateStallData;
|
|
48
|
+
private subscribe;
|
|
35
49
|
}
|
|
36
50
|
export default StallsManager;
|
|
@@ -24,8 +24,12 @@ export type ITuningConfig = {
|
|
|
24
24
|
};
|
|
25
25
|
autoTrackSelection: {
|
|
26
26
|
bitrateFactorAtEmptyBuffer: number;
|
|
27
|
+
minBitrateFactorAtEmptyBuffer: number;
|
|
28
|
+
maxBitrateFactorAtEmptyBuffer: number;
|
|
27
29
|
bitrateAudioFactorAtEmptyBuffer: number;
|
|
28
30
|
bitrateFactorAtFullBuffer: number;
|
|
31
|
+
minBitrateFactorAtFullBuffer: number;
|
|
32
|
+
maxBitrateFactorAtFullBuffer: number;
|
|
29
33
|
bitrateAudioFactorAtFullBuffer: number;
|
|
30
34
|
minVideoAudioRatio: number;
|
|
31
35
|
minAvailableThroughputAudioRatio: number;
|
|
@@ -36,6 +40,8 @@ export type ITuningConfig = {
|
|
|
36
40
|
pixelRatioLogBase: number;
|
|
37
41
|
pixelRatioLogCoefficients: number[];
|
|
38
42
|
containerSizeFactor: number;
|
|
43
|
+
minContainerSizeFactor: number;
|
|
44
|
+
maxContainerSizeFactor: number;
|
|
39
45
|
lazyQualitySwitch: boolean;
|
|
40
46
|
minBufferToSwitchUp: number;
|
|
41
47
|
considerPlaybackRate: boolean;
|
|
@@ -46,6 +52,25 @@ export type ITuningConfig = {
|
|
|
46
52
|
trafficSavingLimit: ExactVideoQuality;
|
|
47
53
|
highQualityLimit: ExactVideoQuality;
|
|
48
54
|
};
|
|
55
|
+
stallsManager: {
|
|
56
|
+
stallDurationNoDataBeforeQualityDecrease: Milliseconds;
|
|
57
|
+
stallDurationToBeCount: Milliseconds;
|
|
58
|
+
stallCountBeforeQualityDecrease: Milliseconds;
|
|
59
|
+
resetQualityRestrictionTimeout: Milliseconds;
|
|
60
|
+
ignoreStallsOnSeek: boolean;
|
|
61
|
+
stallsMetricsHistoryLength: number;
|
|
62
|
+
maxPossibleStallDuration: Milliseconds;
|
|
63
|
+
minTvtToBeCounted: Seconds;
|
|
64
|
+
maxTvtToBeCounted: Seconds;
|
|
65
|
+
targetStallsDurationPerTvt: number;
|
|
66
|
+
deviationStallsDurationPerTvt: number;
|
|
67
|
+
criticalStallsDurationPerTvt: number;
|
|
68
|
+
abrAdjustingSpeed: number;
|
|
69
|
+
emaAlpha: number;
|
|
70
|
+
useTotalStallsDurationPerTvt: boolean;
|
|
71
|
+
useAverageStallsDurationPerTvt: boolean;
|
|
72
|
+
useEmaStallsDurationPerTvt: boolean;
|
|
73
|
+
};
|
|
49
74
|
droppedFramesChecker: {
|
|
50
75
|
enabled: boolean;
|
|
51
76
|
percentLimit: number;
|
|
@@ -72,18 +97,10 @@ export type ITuningConfig = {
|
|
|
72
97
|
enableSubSegmentBufferFeeding: boolean;
|
|
73
98
|
bufferEmptinessTolerance: Milliseconds;
|
|
74
99
|
useFetchPriorityHints: boolean;
|
|
75
|
-
qualityLimitsOnStall: {
|
|
76
|
-
stallDurationNoDataBeforeQualityDecrease: Milliseconds;
|
|
77
|
-
stallDurationToBeCount: Milliseconds;
|
|
78
|
-
stallCountBeforeQualityDecrease: Milliseconds;
|
|
79
|
-
resetQualityRestrictionTimeout: Milliseconds;
|
|
80
|
-
ignoreStallsOnSeek: boolean;
|
|
81
|
-
};
|
|
82
100
|
enableBaseUrlSupport: boolean;
|
|
83
101
|
maxSegmentRetryCount: number;
|
|
84
102
|
sourceOpenTimeout: number;
|
|
85
103
|
rejectOnSourceOpenTimeout: boolean;
|
|
86
|
-
vktvAbrThrottle: number | null;
|
|
87
104
|
};
|
|
88
105
|
dashCmafLive: {
|
|
89
106
|
maxActiveLiveOffset: Milliseconds;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
export declare class SourceBufferBufferedDiff {
|
|
2
|
-
private lastUpdateTs;
|
|
3
|
-
private lastCallTs;
|
|
4
|
-
private prevRanges;
|
|
5
|
-
private readonly sourceBuffer;
|
|
6
|
-
private readonly mediaSource;
|
|
7
|
-
private readonly subscription;
|
|
8
|
-
constructor(mediaSource: MediaSource, sourceBuffer: SourceBuffer);
|
|
9
|
-
private updateend;
|
|
10
|
-
/**
|
|
11
|
-
* если длина массивов разная - считаем, что какие то сегменты удалили
|
|
12
|
-
*
|
|
13
|
-
* если длина одинаковая - считаем, что сегменты удалили в том случае,
|
|
14
|
-
* если в новом массиве хотя бы 1 сегмент стал меньше
|
|
15
|
-
*/
|
|
16
|
-
private isRangesRemoved;
|
|
17
|
-
wasUpdated(): boolean;
|
|
18
|
-
destroy(): void;
|
|
19
|
-
}
|