@vkontakte/videoplayer-core 2.0.169-dev.2cfd41de6.0 → 2.0.169-dev.adb464b3a.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 +40 -40
- package/es2015.esm.js +40 -40
- package/esnext.cjs +34 -34
- package/esnext.esm.js +16 -16
- package/evergreen.esm.js +34 -34
- 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/utils/ClientChecker/services/DisplayChecker.d.ts +6 -0
- package/types/utils/ClientChecker/types/displayMode.d.ts +8 -0
- package/types/utils/tuningConfig.d.ts +3 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vkontakte/videoplayer-core",
|
|
3
|
-
"version": "2.0.169-dev.
|
|
3
|
+
"version": "2.0.169-dev.adb464b3a.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.98-dev.
|
|
45
|
+
"@vkontakte/videoplayer-shared": "1.0.98-dev.adb464b3a.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;
|
|
@@ -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
|
}
|
|
@@ -184,6 +184,7 @@ export type ITuningConfig = {
|
|
|
184
184
|
mutexStallExitPolicy: boolean;
|
|
185
185
|
useFetchPriorityHints: boolean;
|
|
186
186
|
useAbortMSEFix: boolean;
|
|
187
|
+
useByteRangeNullFetchRecovery: boolean;
|
|
187
188
|
enableBaseUrlSupport: boolean;
|
|
188
189
|
maxSegmentRetryCount: number;
|
|
189
190
|
sourceOpenTimeout: number;
|
|
@@ -202,7 +203,6 @@ export type ITuningConfig = {
|
|
|
202
203
|
minNativeBufferSize: Milliseconds;
|
|
203
204
|
removeTimeShiftFromSegment: Milliseconds;
|
|
204
205
|
tickMaintainInterval: Milliseconds;
|
|
205
|
-
tickMaintainThrottle: Milliseconds;
|
|
206
206
|
minSafeBufferToPlay: Milliseconds;
|
|
207
207
|
useBufferHoldingOnlyOnStall: boolean;
|
|
208
208
|
useNewAbr: boolean;
|
|
@@ -253,6 +253,8 @@ export type ITuningConfig = {
|
|
|
253
253
|
dashMaxTvVideoQuality: boolean;
|
|
254
254
|
checkRepresentationCanPlayType: Extract<CanPlayTypeResult, "maybe" | "probably"> | false;
|
|
255
255
|
preloadFirstSegment: boolean;
|
|
256
|
+
jumpGapToNearestBuffer: boolean;
|
|
257
|
+
maxQualityForFirstSegmentPreload: ExactVideoQuality;
|
|
256
258
|
downloadTime: {
|
|
257
259
|
minLookaheadSegments: number;
|
|
258
260
|
safetyFactor: number;
|