@vkontakte/videoplayer-core 2.0.168 → 2.0.169-beta.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 +41 -41
- package/es2015.esm.js +41 -41
- package/esnext.cjs +35 -35
- package/esnext.esm.js +17 -17
- package/evergreen.esm.js +35 -35
- package/package.json +2 -2
- package/types/providers/DashProvider/lib/fetcher.d.ts +5 -1
- package/types/providers/DashProviderVirtual/lib/fetcher.d.ts +5 -2
- package/types/providers/utils/StallsManager.d.ts +2 -0
- package/types/utils/ClientChecker/services/DisplayChecker.d.ts +6 -0
- package/types/utils/ClientChecker/types/displayMode.d.ts +8 -0
- package/types/utils/tuningConfig.d.ts +4 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vkontakte/videoplayer-core",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.169-beta.0",
|
|
4
4
|
"author": "vk.ru",
|
|
5
5
|
"description": "Videoplayer core library based on the vk.ru platform",
|
|
6
6
|
"homepage": "https://vk.ru",
|
|
@@ -42,6 +42,6 @@
|
|
|
42
42
|
"**/*.d.ts"
|
|
43
43
|
],
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@vkontakte/videoplayer-shared": "1.0.
|
|
45
|
+
"@vkontakte/videoplayer-shared": "1.0.98-beta.0"
|
|
46
46
|
}
|
|
47
47
|
}
|
|
@@ -2,6 +2,7 @@ import type { HttpConnectionType, HttpConnectionMetrics, HttpDownloadMetrics } f
|
|
|
2
2
|
import type ThroughputEstimator from "../../../utils/ThroughputEstimator";
|
|
3
3
|
import type { Byte, IValueSubject, ISubject, Milliseconds, IRange, ITracer, IError } from "@vkontakte/videoplayer-shared";
|
|
4
4
|
import { abortable } from "@vkontakte/videoplayer-shared";
|
|
5
|
+
import type { ExactVideoQuality } from "@vkontakte/videoplayer-shared";
|
|
5
6
|
import type { CommonInit, GenericContainerParser, Segment, SegmentReference } from "../../utils/parsers/types";
|
|
6
7
|
declare global {
|
|
7
8
|
interface Navigator {
|
|
@@ -27,6 +28,7 @@ export interface IParams {
|
|
|
27
28
|
measureNonSegmentRequests?: boolean;
|
|
28
29
|
measureFastSamples?: boolean;
|
|
29
30
|
preloadFirstSegment?: boolean;
|
|
31
|
+
maxQualityForFirstSegmentPreload?: ExactVideoQuality;
|
|
30
32
|
}
|
|
31
33
|
export type Priority = "high" | "low" | "auto";
|
|
32
34
|
export interface FetchParamsWithUrl extends FetchParams {
|
|
@@ -44,6 +46,7 @@ export interface FetchParams {
|
|
|
44
46
|
bufferOptimisation?: boolean;
|
|
45
47
|
ignoreNetworkErrors?: boolean;
|
|
46
48
|
urlCacheMechanismEnabled?: boolean;
|
|
49
|
+
representationHeight?: number;
|
|
47
50
|
}
|
|
48
51
|
export type RepresentationFetchResult = {
|
|
49
52
|
init: CommonInit | null;
|
|
@@ -74,11 +77,12 @@ export declare class Fetcher {
|
|
|
74
77
|
private measureNonSegmentRequests;
|
|
75
78
|
private measureFastSamples;
|
|
76
79
|
private preloadFirstSegment;
|
|
80
|
+
private maxQualityForFirstSegmentPreload;
|
|
77
81
|
private startupPhase;
|
|
78
82
|
private performanceObserver;
|
|
79
83
|
private pendingConnectionMetrics;
|
|
80
84
|
private handleExtendedNetworkErrorsSet;
|
|
81
|
-
constructor({ throughputEstimator, requestQuic, tracer, compatibilityMode, useEnableSubtitlesParam, handleExtendedNetworkErrorsSet, useUrlCacheMechanism, measureNonSegmentRequests, measureFastSamples, preloadFirstSegment }: IParams);
|
|
85
|
+
constructor({ throughputEstimator, requestQuic, tracer, compatibilityMode, useEnableSubtitlesParam, handleExtendedNetworkErrorsSet, useUrlCacheMechanism, measureNonSegmentRequests, measureFastSamples, preloadFirstSegment, maxQualityForFirstSegmentPreload }: IParams);
|
|
82
86
|
private onHeadersReceived;
|
|
83
87
|
private setupPerformanceObserver;
|
|
84
88
|
private processPerformanceResourceTiming;
|
|
@@ -2,6 +2,7 @@ import type { HttpConnectionType, HttpConnectionMetrics, HttpDownloadMetrics } f
|
|
|
2
2
|
import type ThroughputEstimator from "../../../utils/ThroughputEstimator";
|
|
3
3
|
import type { Byte, IError, IRange, ISubject, ITracer, IValueSubject, Milliseconds } from "@vkontakte/videoplayer-shared";
|
|
4
4
|
import { abortable } from "@vkontakte/videoplayer-shared";
|
|
5
|
+
import type { ExactVideoQuality } from "@vkontakte/videoplayer-shared";
|
|
5
6
|
import type { CommonInit, GenericContainerParser, Segment, SegmentReference } from "../../utils/parsers/types";
|
|
6
7
|
declare global {
|
|
7
8
|
interface Navigator {
|
|
@@ -27,6 +28,7 @@ export interface IParams {
|
|
|
27
28
|
measureNonSegmentRequests?: boolean;
|
|
28
29
|
measureFastSamples?: boolean;
|
|
29
30
|
preloadFirstSegment?: boolean;
|
|
31
|
+
maxQualityForFirstSegmentPreload?: ExactVideoQuality;
|
|
30
32
|
}
|
|
31
33
|
export type Priority = "high" | "low" | "auto";
|
|
32
34
|
export interface FetchParamsWithUrl extends FetchParams {
|
|
@@ -73,11 +75,12 @@ export declare class Fetcher {
|
|
|
73
75
|
private measureNonSegmentRequests;
|
|
74
76
|
private measureFastSamples;
|
|
75
77
|
private preloadFirstSegment;
|
|
78
|
+
private maxQualityForFirstSegmentPreload;
|
|
76
79
|
private startupPhase;
|
|
77
80
|
private performanceObserver;
|
|
78
81
|
private pendingConnectionMetrics;
|
|
79
82
|
private handleExtendedNetworkErrorsSet;
|
|
80
|
-
constructor({ throughputEstimator, requestQuic, tracer, compatibilityMode, useEnableSubtitlesParam, handleExtendedNetworkErrorsSet, useUrlCacheMechanism, measureNonSegmentRequests, measureFastSamples, preloadFirstSegment }: IParams);
|
|
83
|
+
constructor({ throughputEstimator, requestQuic, tracer, compatibilityMode, useEnableSubtitlesParam, handleExtendedNetworkErrorsSet, useUrlCacheMechanism, measureNonSegmentRequests, measureFastSamples, preloadFirstSegment, maxQualityForFirstSegmentPreload }: IParams);
|
|
81
84
|
private onHeadersReceived;
|
|
82
85
|
private setupPerformanceObserver;
|
|
83
86
|
private processResourceTiming;
|
|
@@ -87,7 +90,7 @@ export declare class Fetcher {
|
|
|
87
90
|
private trackRequestStart;
|
|
88
91
|
fetchManifest: ReturnType<typeof abortable<[string], string | null>>;
|
|
89
92
|
fetch: ReturnType<typeof abortable<[string, FetchParams], ArrayBuffer | null>>;
|
|
90
|
-
fetchRepresentation<T extends Segment>(segmentReference: SegmentReference, parser: GenericContainerParser<unknown>, dowbloadAbortSignal: AbortSignal, priority?: Priority): Promise<RepresentationFetchResult<T> | null | undefined>;
|
|
93
|
+
fetchRepresentation<T extends Segment>(segmentReference: SegmentReference, parser: GenericContainerParser<unknown>, dowbloadAbortSignal: AbortSignal, priority?: Priority, representationHeight?: number): Promise<RepresentationFetchResult<T> | null | undefined>;
|
|
91
94
|
destroy(): void;
|
|
92
95
|
private fetchByteRangeRepresentation;
|
|
93
96
|
private fetchTemplateRepresentation;
|
|
@@ -9,6 +9,7 @@ interface IConnectData {
|
|
|
9
9
|
isSeeked$: IObservable<boolean>;
|
|
10
10
|
looped$: IObservable<Seconds>;
|
|
11
11
|
playing$: IObservable<undefined>;
|
|
12
|
+
pause$: IObservable<undefined>;
|
|
12
13
|
currentStallDuration$: IValueSubject<Milliseconds>;
|
|
13
14
|
tuning: ITuningConfig["stallsManager"];
|
|
14
15
|
abrParams: ITuningConfig["autoTrackSelection"];
|
|
@@ -24,6 +25,7 @@ declare class StallsManager {
|
|
|
24
25
|
private duration;
|
|
25
26
|
private isSeeked$;
|
|
26
27
|
private isBuffering$;
|
|
28
|
+
private isPaused;
|
|
27
29
|
private maxQualityLimit;
|
|
28
30
|
private lastUniqueVideoTrackSelected;
|
|
29
31
|
private currentStallsCount;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Checker } from "../types/checker";
|
|
2
|
+
import { DisplayMode } from "../types/displayMode";
|
|
2
3
|
export { isMobile } from "../utils/isMobile";
|
|
3
4
|
export declare class DisplayChecker implements Checker {
|
|
4
5
|
private _maxTouchPoints;
|
|
@@ -9,6 +10,8 @@ export declare class DisplayChecker implements Checker {
|
|
|
9
10
|
private _screenHeight;
|
|
10
11
|
private _screenWidth;
|
|
11
12
|
private _colorDepth;
|
|
13
|
+
private _displayMode;
|
|
14
|
+
private _isStandalone;
|
|
12
15
|
get isTouch(): boolean;
|
|
13
16
|
get maxTouchPoints(): number;
|
|
14
17
|
get height(): number;
|
|
@@ -18,5 +21,8 @@ export declare class DisplayChecker implements Checker {
|
|
|
18
21
|
get pixelRatio(): number;
|
|
19
22
|
get isHDR(): boolean;
|
|
20
23
|
get colorDepth(): number;
|
|
24
|
+
get displayMode(): DisplayMode;
|
|
25
|
+
get isStandalone(): boolean;
|
|
21
26
|
detect(): void;
|
|
27
|
+
private detectDisplayMode;
|
|
22
28
|
}
|
|
@@ -141,6 +141,7 @@ export type ITuningConfig = {
|
|
|
141
141
|
useTotalStallsDurationPerTvt: boolean;
|
|
142
142
|
useAverageStallsDurationPerTvt: boolean;
|
|
143
143
|
useEmaStallsDurationPerTvt: boolean;
|
|
144
|
+
ignoreStallsOnPause: boolean;
|
|
144
145
|
};
|
|
145
146
|
droppedFramesChecker: {
|
|
146
147
|
enabled: boolean;
|
|
@@ -183,6 +184,7 @@ export type ITuningConfig = {
|
|
|
183
184
|
mutexStallExitPolicy: boolean;
|
|
184
185
|
useFetchPriorityHints: boolean;
|
|
185
186
|
useAbortMSEFix: boolean;
|
|
187
|
+
useByteRangeNullFetchRecovery: boolean;
|
|
186
188
|
enableBaseUrlSupport: boolean;
|
|
187
189
|
maxSegmentRetryCount: number;
|
|
188
190
|
sourceOpenTimeout: number;
|
|
@@ -201,7 +203,6 @@ export type ITuningConfig = {
|
|
|
201
203
|
minNativeBufferSize: Milliseconds;
|
|
202
204
|
removeTimeShiftFromSegment: Milliseconds;
|
|
203
205
|
tickMaintainInterval: Milliseconds;
|
|
204
|
-
tickMaintainThrottle: Milliseconds;
|
|
205
206
|
minSafeBufferToPlay: Milliseconds;
|
|
206
207
|
useBufferHoldingOnlyOnStall: boolean;
|
|
207
208
|
useNewAbr: boolean;
|
|
@@ -252,6 +253,8 @@ export type ITuningConfig = {
|
|
|
252
253
|
dashMaxTvVideoQuality: boolean;
|
|
253
254
|
checkRepresentationCanPlayType: Extract<CanPlayTypeResult, "maybe" | "probably"> | false;
|
|
254
255
|
preloadFirstSegment: boolean;
|
|
256
|
+
jumpGapToNearestBuffer: boolean;
|
|
257
|
+
maxQualityForFirstSegmentPreload: ExactVideoQuality;
|
|
255
258
|
downloadTime: {
|
|
256
259
|
minLookaheadSegments: number;
|
|
257
260
|
safetyFactor: number;
|