@vkontakte/videoplayer-core 2.0.171-dev.065b3da4a.0 → 2.0.171-dev.3748d91d5.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 +38 -146
- package/es2015.esm.js +32 -140
- package/esnext.cjs +23 -131
- package/esnext.esm.js +24 -132
- package/evergreen.esm.js +26 -134
- package/package.json +2 -2
- package/types/player/Player.d.ts +1 -0
- package/types/player/types.d.ts +16 -4
- package/types/providers/DashProvider/baseDashProvider.d.ts +1 -2
- package/types/providers/DashProvider/lib/buffer.d.ts +2 -0
- package/types/providers/DashProviderVirtual/baseDashProvider.d.ts +1 -2
- package/types/providers/DashProviderVirtual/lib/buffer/virtualBuffer/baseVirtualBufferManager.versionA.d.ts +2 -0
- package/types/providers/DashProviderVirtual/lib/player/basePlayer.d.ts +3 -1
- package/types/providers/ProviderContainer/Mayday/GraceTimeout.d.ts +17 -0
- package/types/providers/ProviderContainer/Mayday/heuristics/SegmentAppendHeuristic.d.ts +10 -0
- package/types/providers/ProviderContainer/Mayday/heuristics/StartupHangupHeuristic.d.ts +46 -0
- package/types/providers/ProviderContainer/Mayday/heuristics/TvFetcherErrorHeuristic.d.ts +10 -0
- package/types/providers/ProviderContainer/Mayday/index.d.ts +2 -1
- package/types/providers/ProviderContainer/Mayday/types.d.ts +2 -1
- package/types/providers/ProviderContainer/utils/formatsSupport.d.ts +0 -1
- package/types/providers/ProviderContainer/utils/playbackHangup.d.ts +6 -2
- package/types/providers/types.d.ts +4 -2
- package/types/providers/utils/Abr/abrController.d.ts +4 -1
- package/types/providers/utils/Abr/abrManager.d.ts +1 -0
- package/types/providers/utils/Abr/controllers/stallsController.d.ts +8 -1
- package/types/providers/utils/Abr/rules/audio/audioThroughputRule.d.ts +2 -2
- package/types/providers/utils/Abr/rules/audio/minAudioForVideoRule.d.ts +2 -2
- package/types/providers/utils/Abr/rules/baseRule.d.ts +2 -2
- package/types/providers/utils/Abr/rules/video/abandonRequestRule.d.ts +2 -2
- package/types/providers/utils/Abr/rules/video/bolaRule.d.ts +2 -2
- package/types/providers/utils/Abr/rules/video/bufferRule.d.ts +2 -2
- package/types/providers/utils/Abr/rules/video/fitsContainerRule.d.ts +2 -2
- package/types/providers/utils/Abr/rules/video/insufficientBufferRule.d.ts +2 -2
- package/types/providers/utils/Abr/rules/video/lowerLimitRule.d.ts +2 -2
- package/types/providers/utils/Abr/rules/video/stallsRule.d.ts +6 -2
- package/types/providers/utils/Abr/rules/video/throughputRule.d.ts +2 -2
- package/types/providers/utils/Abr/rules/video/tvDisabledVideoTrackRule.d.ts +2 -2
- package/types/providers/utils/Abr/rules/video/upperLimitRule.d.ts +2 -2
- package/types/providers/utils/Abr/types.d.ts +6 -6
- package/types/providers/utils/Abr/utils.d.ts +1 -3
- package/types/providers/utils/HTMLVideoElement/observable.d.ts +1 -1
- package/types/utils/buffer/isBrokenSegmentAppend.d.ts +3 -0
- package/types/utils/buffer/timeRangesToIntervals.d.ts +3 -0
- package/types/utils/timers.d.ts +2 -0
- package/types/utils/tuningConfig.d.ts +18 -17
- package/types/providers/ProviderContainer/Mayday/heuristics/HangupHeuristic.d.ts +0 -22
- package/types/providers/utils/Abr/rules/video/downloadTimeRule.d.ts +0 -15
- package/types/utils/buffer/dynamicBufferTarget.d.ts +0 -10
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Milliseconds, Nullable } from "@vkontakte/videoplayer-shared";
|
|
2
2
|
import type { IAudioTrack, IBaseTrack, IVideoTrack } from "../../../player/types";
|
|
3
|
-
import type { Segment } from "../parsers/types";
|
|
4
|
-
export declare const computeForwardBitrate: (segments: Nullable<Segment[]>) => Kbps;
|
|
5
3
|
export declare const bufferToPlaybackMs: (contentMs: Milliseconds | undefined, playbackRate: number) => Milliseconds;
|
|
6
4
|
export declare enum CompareTrack {
|
|
7
5
|
Descending = -1,
|
|
@@ -17,7 +17,7 @@ export interface IObservableVideo {
|
|
|
17
17
|
loadedMetadata$: IObservable<undefined>;
|
|
18
18
|
loadedData$: IObservable<undefined>;
|
|
19
19
|
isBuffering$: IObservable<boolean>;
|
|
20
|
-
|
|
20
|
+
currentVideoBuffer$: IObservable<IRange<Seconds>>;
|
|
21
21
|
totalBufferDuration$: IObservable<Milliseconds>;
|
|
22
22
|
bufferRangeCount$: IObservable<number>;
|
|
23
23
|
volumeState$: IObservable<IVolumeState>;
|
|
@@ -2,7 +2,7 @@ import type { VideoCodecName, VideoFormat } from "../player/types";
|
|
|
2
2
|
import { WebmCodecStrategy } from "../enums/WebmCodecStrategy";
|
|
3
3
|
import { AndroidPreferredFormat } from "../enums/AndroidPreferredFormat";
|
|
4
4
|
import { IOSPreferredFormat } from "../enums/IOSPreferredFormat";
|
|
5
|
-
import type { Byte, Kbps, Milliseconds, RecursivePartial, Seconds } from "@vkontakte/videoplayer-shared";
|
|
5
|
+
import type { Byte, Kbps, Milliseconds, RecursivePartial, Seconds, TimerModule } from "@vkontakte/videoplayer-shared";
|
|
6
6
|
import { type ExactVideoQuality, VideoQuality } from "@vkontakte/videoplayer-shared";
|
|
7
7
|
import { AudioRuleName, VideoRuleName } from "../providers/utils/Abr/types";
|
|
8
8
|
export type ITuningConfig = {
|
|
@@ -13,11 +13,23 @@ export type ITuningConfig = {
|
|
|
13
13
|
playingUnstableThresholdMs: Milliseconds;
|
|
14
14
|
/** Список имён включённых эвристик. Пустой массив = все эвристики выключены */
|
|
15
15
|
heuristics: string[];
|
|
16
|
+
/** Множитель уменьшения grace-таймаута при каждом поступлении данных в StartupHangupHeuristic */
|
|
17
|
+
hangupGraceDecayFactor: number;
|
|
18
|
+
/** Минимальный grace-таймаут (мс). При достижении — следующий decay возвращает 0 (немедленный expire) */
|
|
19
|
+
hangupGraceMinTimeoutMs: Milliseconds;
|
|
20
|
+
/**
|
|
21
|
+
* Если true — audible (не muted) хэнгап в hidden-вкладке откладывается до возврата на visible (reinit),
|
|
22
|
+
* desired state при этом не меняется.
|
|
23
|
+
* Если false — audible хэнгап в hidden-вкладке мониторится: данные перезапускают decay-таймер,
|
|
24
|
+
* при ≥3 поступлениях данных без завершения перехода — эскалация в switch_codec/switch_provider.
|
|
25
|
+
*/
|
|
26
|
+
deferAudibleHangupOnHiddenTab: boolean;
|
|
16
27
|
};
|
|
17
28
|
/**
|
|
18
29
|
* Включает очистку состояния плеера при вызове метода stop()
|
|
19
30
|
*/
|
|
20
31
|
allowPlayerReuse: boolean;
|
|
32
|
+
useWorkerTimers: TimerModule[];
|
|
21
33
|
throughputEstimator: {
|
|
22
34
|
type: "TwoEma" | "EmaAndMa";
|
|
23
35
|
emaAlphaSlow: number;
|
|
@@ -106,6 +118,7 @@ export type ITuningConfig = {
|
|
|
106
118
|
activeVideoAreaThreshold: number;
|
|
107
119
|
trafficSavingLimit: ExactVideoQuality;
|
|
108
120
|
highQualityLimit: ExactVideoQuality;
|
|
121
|
+
lowQualityTelemetryLimit: ExactVideoQuality;
|
|
109
122
|
};
|
|
110
123
|
stallsManager: {
|
|
111
124
|
enabled: boolean;
|
|
@@ -146,7 +159,6 @@ export type ITuningConfig = {
|
|
|
146
159
|
forwardBufferTargetManual: Milliseconds;
|
|
147
160
|
forwardBufferTargetPreload: Milliseconds;
|
|
148
161
|
audioBufferAheadOfVideoMs: Milliseconds;
|
|
149
|
-
useDynamicBufferTarget: boolean;
|
|
150
162
|
seekBiasInTheEnd: Milliseconds;
|
|
151
163
|
maxSegmentDurationLeftToSelectNextSegment: Milliseconds;
|
|
152
164
|
minSafeBufferThreshold: number;
|
|
@@ -168,6 +180,8 @@ export type ITuningConfig = {
|
|
|
168
180
|
useDelayedRepresentationSwitch: boolean;
|
|
169
181
|
useSmartRepresentationSwitch: boolean;
|
|
170
182
|
stallForceSeekOncePerStall: boolean;
|
|
183
|
+
brokenSegmentAppendDetection: boolean;
|
|
184
|
+
brokenSegmentAppendTolerance: Milliseconds;
|
|
171
185
|
useFetchPriorityHints: boolean;
|
|
172
186
|
enableBaseUrlSupport: boolean;
|
|
173
187
|
maxSegmentRetryCount: number;
|
|
@@ -175,7 +189,6 @@ export type ITuningConfig = {
|
|
|
175
189
|
vktvAbrThrottle: number;
|
|
176
190
|
timeupdateEventTickThrottle: number;
|
|
177
191
|
fetcherBufferOptimisation: boolean;
|
|
178
|
-
codecsPrioritizeEnabled: boolean;
|
|
179
192
|
usePersistentGaps: boolean;
|
|
180
193
|
abrThrottle: number;
|
|
181
194
|
useVideoElementWaitingCurrentTimeReassign: boolean;
|
|
@@ -222,26 +235,14 @@ export type ITuningConfig = {
|
|
|
222
235
|
budgetFactor: number;
|
|
223
236
|
fallbackSegmentDurationMs: Milliseconds;
|
|
224
237
|
};
|
|
225
|
-
dynamicBufferTarget: {
|
|
226
|
-
maxMs: Milliseconds;
|
|
227
|
-
optimisticHeadroomLow: number;
|
|
228
|
-
optimisticHeadroomHigh: number;
|
|
229
|
-
weakThroughputLowKbps: Kbps;
|
|
230
|
-
weakThroughputHighKbps: Kbps;
|
|
231
|
-
maxFactor: number;
|
|
232
|
-
};
|
|
233
238
|
videoStreamRepresentaionsFilter: [VideoQuality, number, VideoCodecName][];
|
|
234
239
|
filterOnDemandQualityList: boolean;
|
|
235
240
|
dashMaxTvVideoQuality: boolean;
|
|
236
241
|
checkRepresentationCanPlayType: Extract<CanPlayTypeResult, "maybe" | "probably"> | false;
|
|
237
242
|
preloadFirstSegment: boolean;
|
|
238
243
|
maxQualityForFirstSegmentPreload: ExactVideoQuality;
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
safetyFactor: number;
|
|
242
|
-
bootstrapBufferMs: Milliseconds;
|
|
243
|
-
demandTolerance: number;
|
|
244
|
-
};
|
|
244
|
+
/** Включает отправку телеметрии трейсера (resume) при превышении stall watchdog */
|
|
245
|
+
tracerResumeOnUnexpectedStall: boolean;
|
|
245
246
|
};
|
|
246
247
|
dashCmafLive: {
|
|
247
248
|
externalStopControl: boolean;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import type { IError } from "@vkontakte/videoplayer-shared";
|
|
2
|
-
import type { IHeuristicDeps } from "../types";
|
|
3
|
-
import type { IAsyncHeuristic, HeuristicResult } from "./IHeuristic";
|
|
4
|
-
export declare class HangupHeuristic implements IAsyncHeuristic {
|
|
5
|
-
private deps;
|
|
6
|
-
static readonly heuristicName = "HangupHeuristic";
|
|
7
|
-
readonly type = "async";
|
|
8
|
-
readonly recommendation$;
|
|
9
|
-
private timerId;
|
|
10
|
-
private sub;
|
|
11
|
-
private error;
|
|
12
|
-
private manifestRequested;
|
|
13
|
-
private manifestRequestedAt;
|
|
14
|
-
private manifestReceivedMs;
|
|
15
|
-
constructor(deps: IHeuristicDeps);
|
|
16
|
-
analyze(error: IError): HeuristicResult;
|
|
17
|
-
private restartTimer;
|
|
18
|
-
private expire;
|
|
19
|
-
private cancel;
|
|
20
|
-
reset(): void;
|
|
21
|
-
destroy(): void;
|
|
22
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { IAbrRule, IAbrRuleResolution, IVideoAbrContext } from "../../types";
|
|
2
|
-
import type { IVideoTrack } from "../../../../../player/types";
|
|
3
|
-
import type { Kbps, Milliseconds } from "@vkontakte/videoplayer-shared";
|
|
4
|
-
import { LimitAboveRule } from "../limitAboveRule";
|
|
5
|
-
import type { RulePhaseConfig } from "../../controllers/abrPhaseController";
|
|
6
|
-
type DownloadTimeLogsArgs = [estimatedThroughput: Kbps, forwardBufferDuration: Milliseconds, simulatedFinalBufferMs: Milliseconds | null];
|
|
7
|
-
export declare class DownloadTimeRule extends LimitAboveRule<IVideoTrack, IVideoAbrContext, DownloadTimeLogsArgs> implements IAbrRule<IVideoTrack, IVideoAbrContext> {
|
|
8
|
-
constructor(phaseConfig: RulePhaseConfig);
|
|
9
|
-
execute(context: IVideoAbrContext): IAbrRuleResolution<IVideoTrack>;
|
|
10
|
-
private buildReferenceTimeline;
|
|
11
|
-
private resolveLookaheadCount;
|
|
12
|
-
private simulate;
|
|
13
|
-
protected createLogMessage(selectedTrack: IVideoTrack, estimatedThroughput: Kbps, forwardBufferDuration: Milliseconds, simulatedFinalBufferMs: Milliseconds | null): string;
|
|
14
|
-
}
|
|
15
|
-
export {};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { Kbps, Milliseconds, Nullable } from "@vkontakte/videoplayer-shared";
|
|
2
|
-
import type { ITuningConfig } from "../tuningConfig";
|
|
3
|
-
type DynamicBufferTargetConfig = ITuningConfig["dash"]["dynamicBufferTarget"];
|
|
4
|
-
export interface IDynamicBufferTargetState {
|
|
5
|
-
throughputKbps: Kbps;
|
|
6
|
-
currentBitrateKbps: Nullable<Kbps>;
|
|
7
|
-
baseTargetMs: Milliseconds;
|
|
8
|
-
}
|
|
9
|
-
export declare const computeDynamicBufferTarget: (state: IDynamicBufferTargetState, config: DynamicBufferTargetConfig) => Milliseconds;
|
|
10
|
-
export {};
|