@vkontakte/videoplayer-core 2.0.171-dev.a5a2d3fc3.0 → 2.0.171-dev.cb6e2e206.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 +160 -48
- package/es2015.esm.js +162 -50
- package/esnext.cjs +158 -46
- package/esnext.esm.js +158 -46
- package/evergreen.esm.js +158 -46
- package/package.json +2 -2
- package/types/player/Player.d.ts +0 -1
- package/types/player/types.d.ts +4 -16
- package/types/providers/DashLiveProvider/utils/LiveDashPlayer.d.ts +9 -3
- package/types/providers/DashProvider/baseDashProvider.d.ts +4 -1
- package/types/providers/DashProvider/lib/buffer.d.ts +0 -4
- package/types/providers/DashProvider/lib/fetcher.d.ts +4 -6
- package/types/providers/DashProvider/lib/player.d.ts +0 -1
- package/types/providers/DashProvider/lib/sourceBufferTaskQueue.d.ts +2 -1
- package/types/providers/DashProvider/lib/urlsCache.d.ts +23 -0
- package/types/providers/DashProviderVirtual/baseDashProvider.d.ts +3 -1
- package/types/providers/DashProviderVirtual/lib/buffer/nativeBufferManager.d.ts +1 -1
- package/types/providers/DashProviderVirtual/lib/buffer/sourceBufferTaskQueue.d.ts +2 -1
- package/types/providers/DashProviderVirtual/lib/buffer/types.d.ts +0 -2
- package/types/providers/DashProviderVirtual/lib/buffer/virtualBuffer/baseVirtualBufferManager.versionA.d.ts +1 -5
- package/types/providers/DashProviderVirtual/lib/buffer/virtualBuffer/byteRangeVirtualBufferManager.versionA.d.ts +0 -1
- package/types/providers/DashProviderVirtual/lib/fetcher.d.ts +4 -6
- package/types/providers/DashProviderVirtual/lib/player/basePlayer.d.ts +1 -5
- package/types/providers/DashProviderVirtual/lib/urlsCache.d.ts +22 -0
- package/types/providers/ProviderContainer/Mayday/heuristics/HangupHeuristic.d.ts +23 -0
- package/types/providers/ProviderContainer/Mayday/index.d.ts +1 -2
- package/types/providers/ProviderContainer/Mayday/types.d.ts +1 -2
- package/types/providers/ProviderContainer/index.d.ts +1 -3
- package/types/providers/ProviderContainer/utils/formatsSupport.d.ts +1 -0
- package/types/providers/ProviderContainer/utils/playbackHangup.d.ts +2 -6
- package/types/providers/types.d.ts +2 -4
- package/types/providers/utils/Abr/abrController.d.ts +1 -4
- package/types/providers/utils/Abr/abrManager.d.ts +0 -1
- package/types/providers/utils/Abr/controllers/stallsController.d.ts +1 -8
- 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/downloadTimeRule.d.ts +15 -0
- package/types/providers/utils/Abr/rules/video/failedVideoTrackRule.d.ts +14 -0
- 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 +2 -6
- 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 +8 -6
- package/types/providers/utils/Abr/utils.d.ts +3 -1
- package/types/providers/utils/HTMLVideoElement/destroy.d.ts +1 -1
- package/types/providers/utils/HTMLVideoElement/observable.d.ts +1 -1
- package/types/providers/utils/HTMLVideoElement/pool.d.ts +3 -2
- package/types/utils/autoSelectTrack.d.ts +4 -3
- package/types/utils/buffer/dynamicBufferTarget.d.ts +10 -0
- package/types/utils/tuningConfig.d.ts +42 -28
- package/types/providers/ProviderContainer/Mayday/GraceTimeout.d.ts +0 -17
- package/types/providers/ProviderContainer/Mayday/heuristics/SegmentAppendHeuristic.d.ts +0 -10
- package/types/providers/ProviderContainer/Mayday/heuristics/StartupHangupHeuristic.d.ts +0 -46
- package/types/providers/ProviderContainer/Mayday/heuristics/TvFetcherErrorHeuristic.d.ts +0 -10
- package/types/providers/utils/segmentCache/IndexedDbSegmentCacheStorage.d.ts +0 -52
- package/types/providers/utils/segmentCache/SegmentCache.d.ts +0 -40
- package/types/providers/utils/segmentCache/constants.d.ts +0 -20
- package/types/providers/utils/segmentCache/index.d.ts +0 -8
- package/types/providers/utils/segmentCache/segmentCacheDb.d.ts +0 -25
- package/types/providers/utils/segmentCache/segmentCacheUtils.d.ts +0 -25
- package/types/providers/utils/segmentCache/types.d.ts +0 -74
- package/types/utils/buffer/isBrokenSegmentAppend.d.ts +0 -3
- package/types/utils/buffer/timeRangesToIntervals.d.ts +0 -3
- package/types/utils/timers.d.ts +0 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IAbrRule, IAbrRuleResolution, IAudioAbrContext
|
|
1
|
+
import type { IAbrRule, IAbrRuleResolution, IAudioAbrContext } from "../../types";
|
|
2
2
|
import type { IAudioTrack, IVideoTrack } from "../../../../../player/types";
|
|
3
3
|
import { LimitAboveRule } from "../limitAboveRule";
|
|
4
4
|
import type { Kbps, Nullable } from "@vkontakte/videoplayer-shared";
|
|
@@ -8,6 +8,6 @@ type AudioThroughputLogsArgs = [forwardBufferHealth: Nullable<number>, playbackR
|
|
|
8
8
|
export declare class AudioThroughputRule extends LimitAboveRule<IAudioTrack, IAudioAbrContext, AudioThroughputLogsArgs> implements IAbrRule<IAudioTrack, IAudioAbrContext> {
|
|
9
9
|
constructor(phaseConfig: RulePhaseConfig);
|
|
10
10
|
execute(context: IAudioAbrContext): IAbrRuleResolution<IAudioTrack>;
|
|
11
|
-
protected
|
|
11
|
+
protected createLogMessage(selectedTrack: IVideoTrack, forwardBufferHealth: number | undefined, playbackRate: number, reserve: Kbps, playbackRateFactor: number, bitrateFactor: number, estimatedThroughput: Kbps, tuning: ITuningConfig): string;
|
|
12
12
|
}
|
|
13
13
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IAbrRule, IAbrRuleResolution, IAudioAbrContext
|
|
1
|
+
import type { IAbrRule, IAbrRuleResolution, IAudioAbrContext } from "../../types";
|
|
2
2
|
import type { IAudioTrack, IVideoTrack } from "../../../../../player/types";
|
|
3
3
|
import { LimitBelowRule } from "../limitBelowRule";
|
|
4
4
|
import type { ITuningConfig } from "../../../../../utils/tuningConfig";
|
|
@@ -8,6 +8,6 @@ type MinAudioForVideoLogsArgs = [lastVideoTrackSelected: Nullable<IVideoTrack>,
|
|
|
8
8
|
export declare class MinAudioForVideoRule extends LimitBelowRule<IAudioTrack, IAudioAbrContext, MinAudioForVideoLogsArgs> implements IAbrRule<IAudioTrack, IAudioAbrContext> {
|
|
9
9
|
constructor(phaseConfig: RulePhaseConfig);
|
|
10
10
|
execute(context: IAudioAbrContext): IAbrRuleResolution<IAudioTrack>;
|
|
11
|
-
protected
|
|
11
|
+
protected createLogMessage(selectedTrack: IVideoTrack, lastVideoTrackSelected: Nullable<IVideoTrack>, tuning: ITuningConfig): string;
|
|
12
12
|
}
|
|
13
13
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IAbrRule, IAbrRuleResolution, IBaseAbrControllerContext, IRuleInitContext, RuleConfidence,
|
|
1
|
+
import type { IAbrRule, IAbrRuleResolution, IBaseAbrControllerContext, IRuleInitContext, RuleConfidence, RuleType } from "../types";
|
|
2
2
|
import type { IBaseTrack } from "../../../../player/types";
|
|
3
3
|
import { Subscription } from "@vkontakte/videoplayer-shared";
|
|
4
4
|
import type { AbrPhase } from "../controllers/abrPhaseController";
|
|
@@ -19,5 +19,5 @@ export declare abstract class BaseRule<
|
|
|
19
19
|
destroy(): void;
|
|
20
20
|
abstract execute(context: C): IAbrRuleResolution<T>;
|
|
21
21
|
protected createResolution(context: C, selectedTrack: T, ...params: LogsArgs): IAbrRuleResolution<T>;
|
|
22
|
-
protected abstract
|
|
22
|
+
protected abstract createLogMessage(selectedTrack: T, ...params: LogsArgs): string;
|
|
23
23
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IAbrRule, IAbrRuleResolution, IVideoAbrContext
|
|
1
|
+
import type { IAbrRule, IAbrRuleResolution, IVideoAbrContext } from "../../types";
|
|
2
2
|
import type { IVideoTrack } from "../../../../../player/types";
|
|
3
3
|
import type { Milliseconds } from "@vkontakte/videoplayer-shared";
|
|
4
4
|
import { LimitAboveRule } from "../limitAboveRule";
|
|
@@ -7,6 +7,6 @@ type LogsArgs = [elapsedMs: Milliseconds, loadedFraction: number, estimatedRemai
|
|
|
7
7
|
export declare class AbandonRequestRule extends LimitAboveRule<IVideoTrack, IVideoAbrContext, LogsArgs> implements IAbrRule<IVideoTrack, IVideoAbrContext> {
|
|
8
8
|
constructor(phaseConfig: RulePhaseConfig);
|
|
9
9
|
execute(context: IVideoAbrContext): IAbrRuleResolution<IVideoTrack>;
|
|
10
|
-
protected
|
|
10
|
+
protected createLogMessage(selectedTrack: IVideoTrack, elapsedMs: Milliseconds, loadedFraction: number, estimatedRemainingMs: Milliseconds, bufferLimitMs: Milliseconds, triggered: boolean): string;
|
|
11
11
|
}
|
|
12
12
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IAbrRule, IAbrRuleResolution, IRuleInitContext, IVideoAbrContext
|
|
1
|
+
import type { IAbrRule, IAbrRuleResolution, IRuleInitContext, IVideoAbrContext } from "../../types";
|
|
2
2
|
import type { IVideoTrack } from "../../../../../player/types";
|
|
3
3
|
import type { Kbps, Seconds } from "@vkontakte/videoplayer-shared";
|
|
4
4
|
import { LimitAboveRule } from "../limitAboveRule";
|
|
@@ -26,6 +26,6 @@ export declare class BolaRule extends LimitAboveRule<IVideoTrack, IVideoAbrConte
|
|
|
26
26
|
private resolveSegmentDurationS;
|
|
27
27
|
private applyBolaOSafeguard;
|
|
28
28
|
private resetPlaceholder;
|
|
29
|
-
protected
|
|
29
|
+
protected createLogMessage(selectedTrack: IVideoTrack, bufferLevelS: Seconds, placeholderBufferS: Seconds, segmentDurationS: Seconds, Vp: number, gp: number, validBitrates: Kbps[], selectedIndex: number, phase: AbrPhase | undefined): string;
|
|
30
30
|
}
|
|
31
31
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IAbrRule, IAbrRuleResolution, IVideoAbrContext
|
|
1
|
+
import type { IAbrRule, IAbrRuleResolution, IVideoAbrContext } from "../../types";
|
|
2
2
|
import type { IVideoTrack } from "../../../../../player/types";
|
|
3
3
|
import type { Nullable } from "@vkontakte/videoplayer-shared";
|
|
4
4
|
import { LimitAboveRule } from "../limitAboveRule";
|
|
@@ -12,6 +12,6 @@ type BufferRuleLogsArgs = [currentVideoTrack: Nullable<IVideoTrack>, lastVideoTr
|
|
|
12
12
|
export declare class BufferRule extends LimitAboveRule<IVideoTrack, IVideoAbrContext, BufferRuleLogsArgs> implements IAbrRule<IVideoTrack, IVideoAbrContext> {
|
|
13
13
|
constructor(phaseConfig: RulePhaseConfig);
|
|
14
14
|
execute(context: IVideoAbrContext): IAbrRuleResolution<IVideoTrack>;
|
|
15
|
-
protected
|
|
15
|
+
protected createLogMessage(selectedTrack: IVideoTrack, currentVideoTrack: Nullable<IVideoTrack>, lastVideoTrackSelected: Nullable<IVideoTrack>, forwardBufferHealth: Nullable<number>, abrTuning: ITuningConfig["autoTrackSelection"]): string;
|
|
16
16
|
}
|
|
17
17
|
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
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 {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { IAbrRule, IAbrRuleResolution, IRuleInitContext, IVideoAbrContext } from "../../types";
|
|
2
|
+
import type { IVideoTrack } from "../../../../../player/types";
|
|
3
|
+
import type { Nullable } from "@vkontakte/videoplayer-shared";
|
|
4
|
+
import { LimitAboveRule } from "../limitAboveRule";
|
|
5
|
+
import type { RulePhaseConfig } from "../../controllers/abrPhaseController";
|
|
6
|
+
type FailedVideoTracLogsArgs = [banTrack: Nullable<IVideoTrack>];
|
|
7
|
+
export declare class FailedVideoTrackRule extends LimitAboveRule<IVideoTrack, IVideoAbrContext, FailedVideoTracLogsArgs> implements IAbrRule<IVideoTrack, IVideoAbrContext> {
|
|
8
|
+
protected banTrack: Nullable<IVideoTrack>;
|
|
9
|
+
constructor(phaseConfig: RulePhaseConfig);
|
|
10
|
+
init(initContext: IRuleInitContext): void;
|
|
11
|
+
execute(context: IVideoAbrContext): IAbrRuleResolution<IVideoTrack>;
|
|
12
|
+
protected createLogMessage(selectedTrack: IVideoTrack, banTrack: Nullable<IVideoTrack>): string;
|
|
13
|
+
}
|
|
14
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IAbrRule, IAbrRuleResolution, IVideoAbrContext
|
|
1
|
+
import type { IAbrRule, IAbrRuleResolution, IVideoAbrContext } from "../../types";
|
|
2
2
|
import type { IVideoTrack } from "../../../../../player/types";
|
|
3
3
|
import type { IRectangle, Nullable } from "@vkontakte/videoplayer-shared";
|
|
4
4
|
import { LimitAboveRule } from "../limitAboveRule";
|
|
@@ -9,7 +9,7 @@ type FitsContainerLogsArgs = [containerSizeLimit: Nullable<IContainerSizeLimit>,
|
|
|
9
9
|
export declare class FitsContainerRule extends LimitAboveRule<IVideoTrack, IVideoAbrContext, FitsContainerLogsArgs> implements IAbrRule<IVideoTrack, IVideoAbrContext> {
|
|
10
10
|
constructor(phaseConfig: RulePhaseConfig);
|
|
11
11
|
execute(context: IVideoAbrContext): IAbrRuleResolution<IVideoTrack>;
|
|
12
|
-
protected
|
|
12
|
+
protected createLogMessage(selectedTrack: IVideoTrack, containerSizeLimit: Nullable<IContainerSizeLimit>, containerSizeFactor: number, abrTuning: ITuningConfig["autoTrackSelection"]): string;
|
|
13
13
|
private getContainerSizeLimit;
|
|
14
14
|
}
|
|
15
15
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IAbrRule, IAbrRuleResolution, IRuleInitContext, IVideoAbrContext
|
|
1
|
+
import type { IAbrRule, IAbrRuleResolution, IRuleInitContext, IVideoAbrContext } from "../../types";
|
|
2
2
|
import type { IVideoTrack } from "../../../../../player/types";
|
|
3
3
|
import type { Milliseconds } from "@vkontakte/videoplayer-shared";
|
|
4
4
|
import { LimitAboveRule } from "../limitAboveRule";
|
|
@@ -10,6 +10,6 @@ export declare class InsufficientBufferRule extends LimitAboveRule<IVideoTrack,
|
|
|
10
10
|
override init(initContext: IRuleInitContext): void;
|
|
11
11
|
execute(context: IVideoAbrContext): IAbrRuleResolution<IVideoTrack>;
|
|
12
12
|
private selectThroughputAwareFallback;
|
|
13
|
-
protected
|
|
13
|
+
protected createLogMessage(selectedTrack: IVideoTrack, forwardBufferDuration: Milliseconds | undefined, thresholdMs: Milliseconds, triggered: boolean, suppressedByGrace: boolean): string;
|
|
14
14
|
}
|
|
15
15
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IAbrRule, IAbrRuleResolution, IVideoAbrContext
|
|
1
|
+
import type { IAbrRule, IAbrRuleResolution, IVideoAbrContext } from "../../types";
|
|
2
2
|
import type { IVideoTrack } from "../../../../../player/types";
|
|
3
3
|
import type { Nullable, QualityLimits } from "@vkontakte/videoplayer-shared";
|
|
4
4
|
import { type ExactVideoQuality } from "@vkontakte/videoplayer-shared";
|
|
@@ -8,6 +8,6 @@ type LowerLimitLogsArgs = [limitsAreInvalid: boolean, lowestAvailableQuality: Nu
|
|
|
8
8
|
export declare class LowerLimitRule extends LimitBelowRule<IVideoTrack, IVideoAbrContext, LowerLimitLogsArgs> implements IAbrRule<IVideoTrack, IVideoAbrContext> {
|
|
9
9
|
constructor(phaseConfig: RulePhaseConfig);
|
|
10
10
|
execute(context: IVideoAbrContext): IAbrRuleResolution<IVideoTrack>;
|
|
11
|
-
protected
|
|
11
|
+
protected createLogMessage(selectedTrack: IVideoTrack, limitsAreInvalid: boolean, lowestAvailableQuality: Nullable<ExactVideoQuality>, highestAvailableQuality: Nullable<ExactVideoQuality>, limits: QualityLimits): string;
|
|
12
12
|
}
|
|
13
13
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IAbrRule, IAbrRuleResolution, IVideoAbrContext
|
|
1
|
+
import type { IAbrRule, IAbrRuleResolution, IVideoAbrContext } from "../../types";
|
|
2
2
|
import type { IVideoTrack } from "../../../../../player/types";
|
|
3
3
|
import type { Kbps, Nullable } from "@vkontakte/videoplayer-shared";
|
|
4
4
|
import { LimitAboveRule } from "../limitAboveRule";
|
|
@@ -11,13 +11,9 @@ export declare class StallsRule extends LimitAboveRule<IVideoTrack, IVideoAbrCon
|
|
|
11
11
|
private lastStallDurationRestriction;
|
|
12
12
|
private maxQualityLimitOnStall;
|
|
13
13
|
private predictedThroughputWithoutData;
|
|
14
|
-
private restrictionTracer;
|
|
15
|
-
private restrictionStartedAt;
|
|
16
14
|
constructor(phaseConfig: RulePhaseConfig);
|
|
17
15
|
execute(context: IVideoAbrContext): IAbrRuleResolution<IVideoTrack>;
|
|
18
|
-
protected
|
|
19
|
-
private traceRestrictionSet;
|
|
20
|
-
private traceRestrictionReset;
|
|
16
|
+
protected createLogMessage(selectedTrack: IVideoTrack, forwardBufferHealth: Nullable<number>, playbackRate: number, reserve: Kbps, playbackRateFactor: number, bitrateFactor: number, tuning: ITuningConfig): string;
|
|
21
17
|
private updateStallQualityLimits;
|
|
22
18
|
}
|
|
23
19
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IAbrRule, IAbrRuleResolution, IVideoAbrContext
|
|
1
|
+
import type { IAbrRule, IAbrRuleResolution, IVideoAbrContext } from "../../types";
|
|
2
2
|
import type { IVideoTrack } from "../../../../../player/types";
|
|
3
3
|
import type { Kbps, Nullable } from "@vkontakte/videoplayer-shared";
|
|
4
4
|
import { LimitAboveRule } from "../limitAboveRule";
|
|
@@ -8,6 +8,6 @@ type ThroughputLogsArgs = [forwardBufferHealth: Nullable<number>, playbackRate:
|
|
|
8
8
|
export declare class ThroughputRule extends LimitAboveRule<IVideoTrack, IVideoAbrContext, ThroughputLogsArgs> implements IAbrRule<IVideoTrack, IVideoAbrContext> {
|
|
9
9
|
constructor(phaseConfig: RulePhaseConfig);
|
|
10
10
|
execute(context: IVideoAbrContext): IAbrRuleResolution<IVideoTrack>;
|
|
11
|
-
protected
|
|
11
|
+
protected createLogMessage(selectedTrack: IVideoTrack, forwardBufferHealth: Nullable<number>, playbackRate: number, reserve: Kbps, playbackRateFactor: number, bitrateFactor: number, estimatedThroughput: Kbps, phase: AbrPhase | undefined, tuning: ITuningConfig): string;
|
|
12
12
|
}
|
|
13
13
|
export {};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { IAbrRule, IAbrRuleResolution, IVideoAbrContext
|
|
1
|
+
import type { IAbrRule, IAbrRuleResolution, IVideoAbrContext } from "../../types";
|
|
2
2
|
import type { IVideoTrack } from "../../../../../player/types";
|
|
3
3
|
import { LimitAboveRule } from "../limitAboveRule";
|
|
4
4
|
import type { RulePhaseConfig } from "../../controllers/abrPhaseController";
|
|
5
5
|
export declare class TvDisabledVideoTrackRule extends LimitAboveRule<IVideoTrack, IVideoAbrContext> implements IAbrRule<IVideoTrack, IVideoAbrContext> {
|
|
6
6
|
constructor(phaseConfig: RulePhaseConfig);
|
|
7
7
|
execute(context: IVideoAbrContext): IAbrRuleResolution<IVideoTrack>;
|
|
8
|
-
protected
|
|
8
|
+
protected createLogMessage(selectedTrack: IVideoTrack): string;
|
|
9
9
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IAbrRule, IAbrRuleResolution, IVideoAbrContext
|
|
1
|
+
import type { IAbrRule, IAbrRuleResolution, IVideoAbrContext } from "../../types";
|
|
2
2
|
import type { IVideoTrack } from "../../../../../player/types";
|
|
3
3
|
import type { Nullable, QualityLimits, VideoQuality } from "@vkontakte/videoplayer-shared";
|
|
4
4
|
import { type ExactVideoQuality } from "@vkontakte/videoplayer-shared";
|
|
@@ -63,7 +63,7 @@ type UpperLimitsLogsArgs = [limitsAreInvalid: boolean, lowestAvailableQuality: N
|
|
|
63
63
|
export declare class UpperLimitsRule extends LimitAboveRule<IVideoTrack, IVideoAbrContext, UpperLimitsLogsArgs> implements IAbrRule<IVideoTrack, IVideoAbrContext> {
|
|
64
64
|
constructor(phaseConfig: RulePhaseConfig);
|
|
65
65
|
execute(context: IVideoAbrContext): IAbrRuleResolution<IVideoTrack>;
|
|
66
|
-
protected
|
|
66
|
+
protected createLogMessage(selectedTrack: IVideoTrack, limitsAreInvalid: boolean, lowestAvailableQuality: Nullable<ExactVideoQuality>, highestAvailableQuality: Nullable<ExactVideoQuality>, visible: boolean, limits: QualityLimits, backgroundVideoQualityLimit: VideoQuality, effectiveType: string | undefined, connectionDataQualityLimit: ExactVideoQuality | undefined): string;
|
|
67
67
|
private getConnection;
|
|
68
68
|
private resolveConnectionDataQualityLimit;
|
|
69
69
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { IAudioTrack, IBaseTrack, IVideoTrack } from "../../../player/types";
|
|
2
|
-
import type { Byte, IComponentLogger, IObservable, IRectangle,
|
|
2
|
+
import type { Byte, IComponentLogger, IObservable, IRectangle, IValueSubject, Kbps, Milliseconds, Nullable, QualityLimits } from "@vkontakte/videoplayer-shared";
|
|
3
3
|
import type { ITuningConfig } from "../../../utils/tuningConfig";
|
|
4
4
|
import type { Representation, Segment } from "../parsers/types";
|
|
5
5
|
import type { ElementSizeManager } from "../HTMLVideoElement/ElementSizeManager";
|
|
@@ -15,13 +15,15 @@ export declare enum VideoRuleName {
|
|
|
15
15
|
Buffer = "buffer_rule",
|
|
16
16
|
Bola = "bola_rule",
|
|
17
17
|
FitsContainer = "fits_container_rule",
|
|
18
|
+
FailedVideoTrack = "failed_video_track_rule",
|
|
18
19
|
TvDisabledVideoTrack = "tv_disabled_video_track_rule",
|
|
19
20
|
Stalls = "stalls_rule",
|
|
20
21
|
LowerLimit = "lower_limit_rule",
|
|
21
22
|
UpperLimit = "upper_limit_rule",
|
|
22
23
|
Throughput = "throughput_rule",
|
|
23
24
|
AbandonRequest = "abandon_request_rule",
|
|
24
|
-
InsufficientBuffer = "insufficient_buffer_rule"
|
|
25
|
+
InsufficientBuffer = "insufficient_buffer_rule",
|
|
26
|
+
DownloadTime = "download_time_rule"
|
|
25
27
|
}
|
|
26
28
|
export declare enum AudioRuleName {
|
|
27
29
|
MinAudioForVideo = "min_audio_for_video_rule",
|
|
@@ -39,6 +41,7 @@ export interface IUpdatableAbrManagerContext {
|
|
|
39
41
|
desiredVideoTrack: Nullable<IVideoTrack>;
|
|
40
42
|
limits: QualityLimits;
|
|
41
43
|
forwardBufferHealth?: number;
|
|
44
|
+
forwardBufferTarget: Milliseconds;
|
|
42
45
|
forwardVideoBufferRepresentations: Nullable<Map<Representation["id"], Segment[]>>;
|
|
43
46
|
forwardAudioBufferRepresentations: Nullable<Map<Representation["id"], Segment[]>>;
|
|
44
47
|
forwardBufferDuration?: Milliseconds;
|
|
@@ -56,8 +59,8 @@ export interface IInitAbrManagerContext {
|
|
|
56
59
|
rtt$: IValueSubject<Milliseconds>;
|
|
57
60
|
throughputVariance$?: IValueSubject<number>;
|
|
58
61
|
element: HTMLMediaElement;
|
|
62
|
+
failedVideoTrack: Nullable<IVideoTrack>;
|
|
59
63
|
abrLogger: IComponentLogger;
|
|
60
|
-
tracer: ITracer;
|
|
61
64
|
panelSize?: IRectangle;
|
|
62
65
|
}
|
|
63
66
|
export interface IVideoElementAbrManagerContext {
|
|
@@ -74,13 +77,12 @@ export interface IAudioTracksContext {
|
|
|
74
77
|
audioTracksDesc: IAudioTrack[];
|
|
75
78
|
}
|
|
76
79
|
export type IAbrManagerContext = Omit<IUpdatableAbrManagerContext, "videoTracks" | "audioTracks"> & IVideoElementAbrManagerContext & IInitAbrManagerContext & IVideoTracksContext & IAudioTracksContext;
|
|
77
|
-
export type RuleLogData = Record<string, string | number | boolean | undefined>;
|
|
78
80
|
export interface IAbrRuleResolution<T extends IBaseTrack> {
|
|
79
81
|
track: T;
|
|
80
82
|
confidence: number;
|
|
81
83
|
type: RuleType;
|
|
82
84
|
name: string;
|
|
83
|
-
|
|
85
|
+
logMessage: string;
|
|
84
86
|
}
|
|
85
87
|
export interface IRuleInitContext extends IInitAbrManagerContext {}
|
|
86
88
|
export interface IAbrRule<
|
|
@@ -103,7 +105,6 @@ export interface IBaseAbrControllerContext extends IVideoTracksContext {
|
|
|
103
105
|
lastVideoTrackSelected: Nullable<IVideoTrack>;
|
|
104
106
|
tuning: ITuningConfig;
|
|
105
107
|
abrLogger: IComponentLogger;
|
|
106
|
-
tracer: ITracer;
|
|
107
108
|
estimatedThroughput: Kbps;
|
|
108
109
|
reserve: Kbps;
|
|
109
110
|
forwardBufferHealth: Nullable<number>;
|
|
@@ -121,6 +122,7 @@ export interface IVideoAbrContext extends IBaseAbrControllerContext {
|
|
|
121
122
|
container: Nullable<IRectangle>;
|
|
122
123
|
panelSize: Nullable<IRectangle>;
|
|
123
124
|
forwardBufferRepresentations: Nullable<Map<Representation["id"], Segment[]>>;
|
|
125
|
+
forwardBufferTarget: Milliseconds;
|
|
124
126
|
limits: QualityLimits;
|
|
125
127
|
visible: boolean;
|
|
126
128
|
severeStallOccurred: boolean;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import type { Milliseconds, Nullable } from "@vkontakte/videoplayer-shared";
|
|
1
|
+
import type { Kbps, 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;
|
|
3
5
|
export declare const bufferToPlaybackMs: (contentMs: Milliseconds | undefined, playbackRate: number) => Milliseconds;
|
|
4
6
|
export declare enum CompareTrack {
|
|
5
7
|
Descending = -1,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const destroy: (video: HTMLMediaElement) => void;
|
|
1
|
+
export declare const destroy: (video: HTMLMediaElement, clearVideoElementInnerHTML: boolean) => void;
|
|
@@ -17,7 +17,7 @@ export interface IObservableVideo {
|
|
|
17
17
|
loadedMetadata$: IObservable<undefined>;
|
|
18
18
|
loadedData$: IObservable<undefined>;
|
|
19
19
|
isBuffering$: IObservable<boolean>;
|
|
20
|
-
|
|
20
|
+
currentBuffer$: IObservable<IRange<Seconds>>;
|
|
21
21
|
totalBufferDuration$: IObservable<Milliseconds>;
|
|
22
22
|
bufferRangeCount$: IObservable<number>;
|
|
23
23
|
volumeState$: IObservable<IVolumeState>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { ITuningConfig } from "../../../utils/tuningConfig";
|
|
2
|
-
type
|
|
3
|
-
|
|
2
|
+
export type AllocateConstraints = Pick<ITuningConfig, "audioVideoSyncRate" | "disableYandexPiP" | "clearVideoElementInnerHTML" | "reuseOwnVideoElement">;
|
|
3
|
+
type DisposeConstraints = Pick<ITuningConfig, "keepVideoElement" | "clearVideoElementInnerHTML" | "reuseOwnVideoElement">;
|
|
4
|
+
export declare const allocate: (container: HTMLElement, { audioVideoSyncRate, disableYandexPiP, clearVideoElementInnerHTML, reuseOwnVideoElement }: ITuningConfig) => HTMLVideoElement;
|
|
4
5
|
export declare const initializeAudio: (element: HTMLAudioElement) => HTMLAudioElement;
|
|
5
6
|
export declare const dispose: (element: HTMLMediaElement, constraints: DisposeConstraints) => void;
|
|
6
7
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ITuningConfig } from "./tuningConfig";
|
|
2
|
-
import type { Kbps, Milliseconds, IRectangle, QualityLimits, IComponentLogger } from "@vkontakte/videoplayer-shared";
|
|
2
|
+
import type { Kbps, Milliseconds, IRectangle, QualityLimits, IComponentLogger, Nullable } from "@vkontakte/videoplayer-shared";
|
|
3
3
|
import { type ExactVideoQuality } from "@vkontakte/videoplayer-shared";
|
|
4
4
|
import type { IAudioTrack, IBaseTrack, IVideoTrack } from "../player/types";
|
|
5
5
|
interface IConstraints<T extends IBaseTrack> {
|
|
@@ -11,6 +11,7 @@ interface IConstraints<T extends IBaseTrack> {
|
|
|
11
11
|
playbackRate?: number;
|
|
12
12
|
forwardBufferHealth?: number;
|
|
13
13
|
current?: T;
|
|
14
|
+
failedVideoTrack?: Nullable<T>;
|
|
14
15
|
visible?: boolean;
|
|
15
16
|
history?: TrackHistory<T>;
|
|
16
17
|
droppedVideoMaxQualityLimit?: ExactVideoQuality;
|
|
@@ -29,8 +30,8 @@ export declare class TrackHistory<T extends IBaseTrack> {
|
|
|
29
30
|
export declare const defaultEmptyArrayErrorMessage = "Assertion \"ABR Tracks is empty array\" failed";
|
|
30
31
|
export declare const getMinPossibleAudioForVideoOld: (videoTrack: IVideoTrack, videoTracks: IVideoTrack[], audioTracks: IAudioTrack[], minVideoAudioRatio: number) => IAudioTrack | undefined;
|
|
31
32
|
export declare const getMinPossibleAudioForVideoNew: (videoTrack: IVideoTrack, videoTracks: IVideoTrack[], audioTracks: IAudioTrack[], minVideoAudioRatio: number) => IAudioTrack | undefined;
|
|
32
|
-
export declare const autoSelectVideoTrackNew: (videoTracks: IVideoTrack[], { container, estimatedThroughput, tuning, limits, reserve, forwardBufferHealth, playbackRate, current, history, visible, droppedVideoMaxQualityLimit, stallsVideoMaxQualityLimit, stallsPredictedThroughput, abrLogger, panelSize }: IConstraints<IVideoTrack>) => IVideoTrack;
|
|
33
|
-
export declare const autoSelectVideoTrackOld: (videoTracks: IVideoTrack[], { container, estimatedThroughput, tuning, limits, reserve, forwardBufferHealth, playbackRate, current, history, visible, droppedVideoMaxQualityLimit, stallsVideoMaxQualityLimit, stallsPredictedThroughput, abrLogger, panelSize }: IConstraints<IVideoTrack>) => IVideoTrack;
|
|
33
|
+
export declare const autoSelectVideoTrackNew: (videoTracks: IVideoTrack[], { container, estimatedThroughput, tuning, limits, reserve, forwardBufferHealth, playbackRate, current, failedVideoTrack, history, visible, droppedVideoMaxQualityLimit, stallsVideoMaxQualityLimit, stallsPredictedThroughput, abrLogger, panelSize }: IConstraints<IVideoTrack>) => IVideoTrack;
|
|
34
|
+
export declare const autoSelectVideoTrackOld: (videoTracks: IVideoTrack[], { container, estimatedThroughput, tuning, limits, reserve, forwardBufferHealth, playbackRate, current, failedVideoTrack, history, visible, droppedVideoMaxQualityLimit, stallsVideoMaxQualityLimit, stallsPredictedThroughput, abrLogger, panelSize }: IConstraints<IVideoTrack>) => IVideoTrack;
|
|
34
35
|
export declare const autoSelectAudioTrackForVideoOld: (selectedVideoTrack: IVideoTrack, videoTracks: IVideoTrack[], audioTracks: IAudioTrack[], { estimatedThroughput, tuning, playbackRate, forwardBufferHealth, history, abrLogger, stallsPredictedThroughput }: IConstraints<IAudioTrack>) => IAudioTrack | undefined;
|
|
35
36
|
export declare const autoSelectAudioTrackForVideoNew: (selectedVideoTrack: IVideoTrack, videoTracks: IVideoTrack[], audioTracks: IAudioTrack[], { estimatedThroughput, tuning, playbackRate, forwardBufferHealth, history, abrLogger, stallsPredictedThroughput }: IConstraints<IAudioTrack>) => IAudioTrack | undefined;
|
|
36
37
|
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
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 {};
|
|
@@ -2,10 +2,9 @@ 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
|
|
5
|
+
import type { Byte, Kbps, Milliseconds, RecursivePartial, Seconds } 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
|
-
import type { SegmentCacheConfig } from "../providers/utils/segmentCache/types";
|
|
9
8
|
export type ITuningConfig = {
|
|
10
9
|
/** @deprecated */
|
|
11
10
|
configName?: string[];
|
|
@@ -14,23 +13,24 @@ export type ITuningConfig = {
|
|
|
14
13
|
playingUnstableThresholdMs: Milliseconds;
|
|
15
14
|
/** Список имён включённых эвристик. Пустой массив = все эвристики выключены */
|
|
16
15
|
heuristics: string[];
|
|
17
|
-
/** Множитель уменьшения grace-таймаута при каждом поступлении данных в StartupHangupHeuristic */
|
|
18
|
-
hangupGraceDecayFactor: number;
|
|
19
|
-
/** Минимальный grace-таймаут (мс). При достижении — следующий decay возвращает 0 (немедленный expire) */
|
|
20
|
-
hangupGraceMinTimeoutMs: Milliseconds;
|
|
21
|
-
/**
|
|
22
|
-
* Если true — audible (не muted) хэнгап в hidden-вкладке откладывается до возврата на visible (reinit),
|
|
23
|
-
* desired state при этом не меняется.
|
|
24
|
-
* Если false — audible хэнгап в hidden-вкладке мониторится: данные перезапускают decay-таймер,
|
|
25
|
-
* при ≥3 поступлениях данных без завершения перехода — эскалация в switch_codec/switch_provider.
|
|
26
|
-
*/
|
|
27
|
-
deferAudibleHangupOnHiddenTab: boolean;
|
|
28
16
|
};
|
|
29
17
|
/**
|
|
18
|
+
* Если true, внутренний video элемент не будет уничтожаться при реините провайдера
|
|
19
|
+
* и при создании нового экземляра Player.
|
|
20
|
+
* Будет веcти себя аналогично элементу переданному снаружи
|
|
21
|
+
* Для кейса прямого использовани ядра
|
|
22
|
+
*/
|
|
23
|
+
keepVideoElement: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Временный флаг для тестирования очистки video элемента
|
|
26
|
+
* Если true, при очистке будет вызван innerHTML = '' для очистки дочерних элементов трэков
|
|
27
|
+
* В противном случае они размножаются
|
|
28
|
+
*/
|
|
29
|
+
clearVideoElementInnerHTML: boolean;
|
|
30
|
+
/**
|
|
30
31
|
* Включает очистку состояния плеера при вызове метода stop()
|
|
31
32
|
*/
|
|
32
33
|
allowPlayerReuse: boolean;
|
|
33
|
-
useWorkerTimers: TimerModule[];
|
|
34
34
|
throughputEstimator: {
|
|
35
35
|
type: "TwoEma" | "EmaAndMa";
|
|
36
36
|
emaAlphaSlow: number;
|
|
@@ -119,7 +119,6 @@ export type ITuningConfig = {
|
|
|
119
119
|
activeVideoAreaThreshold: number;
|
|
120
120
|
trafficSavingLimit: ExactVideoQuality;
|
|
121
121
|
highQualityLimit: ExactVideoQuality;
|
|
122
|
-
lowQualityTelemetryLimit: ExactVideoQuality;
|
|
123
122
|
};
|
|
124
123
|
stallsManager: {
|
|
125
124
|
enabled: boolean;
|
|
@@ -160,6 +159,7 @@ export type ITuningConfig = {
|
|
|
160
159
|
forwardBufferTargetManual: Milliseconds;
|
|
161
160
|
forwardBufferTargetPreload: Milliseconds;
|
|
162
161
|
audioBufferAheadOfVideoMs: Milliseconds;
|
|
162
|
+
useDynamicBufferTarget: boolean;
|
|
163
163
|
seekBiasInTheEnd: Milliseconds;
|
|
164
164
|
maxSegmentDurationLeftToSelectNextSegment: Milliseconds;
|
|
165
165
|
minSafeBufferThreshold: number;
|
|
@@ -181,15 +181,15 @@ export type ITuningConfig = {
|
|
|
181
181
|
useDelayedRepresentationSwitch: boolean;
|
|
182
182
|
useSmartRepresentationSwitch: boolean;
|
|
183
183
|
stallForceSeekOncePerStall: boolean;
|
|
184
|
-
brokenSegmentAppendDetection: boolean;
|
|
185
|
-
brokenSegmentAppendTolerance: Milliseconds;
|
|
186
184
|
useFetchPriorityHints: boolean;
|
|
185
|
+
useAbortMSEFix: boolean;
|
|
187
186
|
enableBaseUrlSupport: boolean;
|
|
188
187
|
maxSegmentRetryCount: number;
|
|
189
188
|
sourceOpenTimeout: number;
|
|
190
189
|
vktvAbrThrottle: number;
|
|
191
190
|
timeupdateEventTickThrottle: number;
|
|
192
191
|
fetcherBufferOptimisation: boolean;
|
|
192
|
+
codecsPrioritizeEnabled: boolean;
|
|
193
193
|
usePersistentGaps: boolean;
|
|
194
194
|
abrThrottle: number;
|
|
195
195
|
useVideoElementWaitingCurrentTimeReassign: boolean;
|
|
@@ -208,7 +208,9 @@ export type ITuningConfig = {
|
|
|
208
208
|
abrVideoRules: VideoRuleName[];
|
|
209
209
|
abrAudioRules: AudioRuleName[];
|
|
210
210
|
useDynamicBirtateRule: boolean;
|
|
211
|
+
useNewFailoverLogic: boolean;
|
|
211
212
|
useFailoverHostsOnAllProviderCrash: boolean;
|
|
213
|
+
videoTrackBanAfterProviderFail: Milliseconds;
|
|
212
214
|
saveData3gQualityLimit: ExactVideoQuality;
|
|
213
215
|
saveData2gQualityLimit: ExactVideoQuality;
|
|
214
216
|
useConnectionDataUpperLimit: boolean;
|
|
@@ -236,14 +238,26 @@ export type ITuningConfig = {
|
|
|
236
238
|
budgetFactor: number;
|
|
237
239
|
fallbackSegmentDurationMs: Milliseconds;
|
|
238
240
|
};
|
|
241
|
+
dynamicBufferTarget: {
|
|
242
|
+
maxMs: Milliseconds;
|
|
243
|
+
optimisticHeadroomLow: number;
|
|
244
|
+
optimisticHeadroomHigh: number;
|
|
245
|
+
weakThroughputLowKbps: Kbps;
|
|
246
|
+
weakThroughputHighKbps: Kbps;
|
|
247
|
+
maxFactor: number;
|
|
248
|
+
};
|
|
239
249
|
videoStreamRepresentaionsFilter: [VideoQuality, number, VideoCodecName][];
|
|
240
250
|
filterOnDemandQualityList: boolean;
|
|
241
251
|
dashMaxTvVideoQuality: boolean;
|
|
242
252
|
checkRepresentationCanPlayType: Extract<CanPlayTypeResult, "maybe" | "probably"> | false;
|
|
243
253
|
preloadFirstSegment: boolean;
|
|
244
254
|
maxQualityForFirstSegmentPreload: ExactVideoQuality;
|
|
245
|
-
|
|
246
|
-
|
|
255
|
+
downloadTime: {
|
|
256
|
+
minLookaheadSegments: number;
|
|
257
|
+
safetyFactor: number;
|
|
258
|
+
bootstrapBufferMs: Milliseconds;
|
|
259
|
+
demandTolerance: number;
|
|
260
|
+
};
|
|
247
261
|
};
|
|
248
262
|
dashCmafLive: {
|
|
249
263
|
externalStopControl: boolean;
|
|
@@ -417,6 +431,15 @@ export type ITuningConfig = {
|
|
|
417
431
|
*/
|
|
418
432
|
handleExtendedNetworkErrorsSet?: boolean;
|
|
419
433
|
/**
|
|
434
|
+
* Кэшируем ответы от сервера руками, так как из за динамичесокй природы некоторых параметров в урле
|
|
435
|
+
* браузер это не может сделать.
|
|
436
|
+
*/
|
|
437
|
+
useUrlCacheMechanism?: boolean;
|
|
438
|
+
/**
|
|
439
|
+
* Очищаем кэш урлов при падение провайдера.
|
|
440
|
+
*/
|
|
441
|
+
dropUrlCacheWhenProviderCrashed?: boolean;
|
|
442
|
+
/**
|
|
420
443
|
* При смене/реините провайдера игнорируем результат того, смогло видео заиграть или нет.
|
|
421
444
|
*/
|
|
422
445
|
ignoreForcePlayResultWhenProviderChanged?: boolean;
|
|
@@ -431,15 +454,6 @@ export type ITuningConfig = {
|
|
|
431
454
|
useDurationFromSegments: boolean;
|
|
432
455
|
/** включен режим проигрывания только аудио (без видео) */
|
|
433
456
|
audioOnly: boolean;
|
|
434
|
-
/**
|
|
435
|
-
* Переводить провайдер в READY по loadedmetadata вместо canplay.
|
|
436
|
-
* canplay означает, что видео уже может играться, что избыточно для READY —
|
|
437
|
-
* достаточно получить манифест (loadedmetadata).
|
|
438
|
-
* Применяется только когда желаемое состояние — READY (preload): при автоплее
|
|
439
|
-
* провайдер по-прежнему ждёт canplay, чтобы play() не вызывался до появления данных.
|
|
440
|
-
*/
|
|
441
|
-
readyOnLoadedMetadata: boolean;
|
|
442
|
-
segmentCache: SegmentCacheConfig;
|
|
443
457
|
};
|
|
444
458
|
export type IOptionalTuningConfig = RecursivePartial<ITuningConfig>;
|
|
445
459
|
export declare const fillDefault: (partial: IOptionalTuningConfig) => ITuningConfig;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { Milliseconds } from "@vkontakte/videoplayer-shared";
|
|
2
|
-
/**
|
|
3
|
-
* Декрементный grace-таймаут: каждый вызов `decay()` уменьшает оставшееся время.
|
|
4
|
-
*
|
|
5
|
-
* После создания `current` возвращает начальное значение.
|
|
6
|
-
* Каждый вызов `decay()` умножает `remaining` на `decayFactor`, но не меньше `minTimeout`.
|
|
7
|
-
* Когда `remaining` достигает `minTimeout` — следующий `decay()` возвращает 0 (expire).
|
|
8
|
-
*/
|
|
9
|
-
export declare class GraceTimeout {
|
|
10
|
-
private remaining;
|
|
11
|
-
private readonly decayFactor;
|
|
12
|
-
private readonly minTimeout;
|
|
13
|
-
constructor(initialTimeout: Milliseconds, decayFactor: number, minTimeout: Milliseconds);
|
|
14
|
-
get current(): Milliseconds;
|
|
15
|
-
decay(): Milliseconds;
|
|
16
|
-
reset(initialTimeout: Milliseconds): void;
|
|
17
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { IError } from "@vkontakte/videoplayer-shared";
|
|
2
|
-
import type { IHeuristicDeps } from "../types";
|
|
3
|
-
import type { ISyncHeuristic, HeuristicResult } from "./IHeuristic";
|
|
4
|
-
export declare class SegmentAppendHeuristic implements ISyncHeuristic {
|
|
5
|
-
private deps;
|
|
6
|
-
static readonly heuristicName = "SegmentAppendHeuristic";
|
|
7
|
-
readonly type = "sync";
|
|
8
|
-
constructor(deps: IHeuristicDeps);
|
|
9
|
-
analyze(error: IError): HeuristicResult;
|
|
10
|
-
}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { Subject } from "@vkontakte/videoplayer-shared";
|
|
2
|
-
import type { IError } from "@vkontakte/videoplayer-shared";
|
|
3
|
-
import type { IHeuristicDeps, IMaydayEvent } from "../types";
|
|
4
|
-
import type { IAsyncHeuristic, HeuristicResult } from "./IHeuristic";
|
|
5
|
-
/**
|
|
6
|
-
* Эвристика зависания перехода stopped-*.
|
|
7
|
-
*
|
|
8
|
-
* В зависимости от видимости вкладки и наличия звука выбирает стратегию
|
|
9
|
-
* и эмитит одну из рекомендаций:
|
|
10
|
-
*
|
|
11
|
-
* Visible-вкладка: grace-таймаут с уменьшением таймаута на поступление данных.
|
|
12
|
-
* — данные поступают → таймер продлевается.
|
|
13
|
-
* — grace истёк без прогресса → emit switch_codec (или switch_provider).
|
|
14
|
-
*
|
|
15
|
-
* Hidden-вкладка (audible): та же grace-модель с таймаутом (таймеры в воркере не тротлятся).
|
|
16
|
-
* — данные поступают → таймер продлевается.
|
|
17
|
-
* — grace истёк без прогресса → emit switch_codec.
|
|
18
|
-
*
|
|
19
|
-
* Hidden-вкладка (muted/deferred): молча ждём возврата на visible, desired state не трогаем.
|
|
20
|
-
* — вкладка стала visible → emit reinit (полный реинит сам восстановит воспроизведение).
|
|
21
|
-
* — переход всё-таки завершился в фоне (видео заиграло) → отмена, reinit не нужен.
|
|
22
|
-
*/
|
|
23
|
-
export declare class StartupHangupHeuristic implements IAsyncHeuristic {
|
|
24
|
-
private deps;
|
|
25
|
-
static readonly heuristicName = "StartupHangupHeuristic";
|
|
26
|
-
readonly type = "async";
|
|
27
|
-
readonly recommendation$: Subject<IMaydayEvent>;
|
|
28
|
-
private timerId;
|
|
29
|
-
private subscription;
|
|
30
|
-
private error;
|
|
31
|
-
private grace;
|
|
32
|
-
private hangupStartedAt;
|
|
33
|
-
private dataArrivals;
|
|
34
|
-
private hiddenWaitActive;
|
|
35
|
-
constructor(deps: IHeuristicDeps);
|
|
36
|
-
analyze(error: IError): HeuristicResult;
|
|
37
|
-
private startMonitoring;
|
|
38
|
-
private waitForVisible;
|
|
39
|
-
private restartTimer;
|
|
40
|
-
private recommendSwitch;
|
|
41
|
-
private isTabHidden;
|
|
42
|
-
private logOutcome;
|
|
43
|
-
private cancel;
|
|
44
|
-
reset(): void;
|
|
45
|
-
destroy(): void;
|
|
46
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { IError } from "@vkontakte/videoplayer-shared";
|
|
2
|
-
import type { IHeuristicDeps } from "../types";
|
|
3
|
-
import type { ISyncHeuristic, HeuristicResult } from "./IHeuristic";
|
|
4
|
-
export declare class TvFetcherErrorHeuristic implements ISyncHeuristic {
|
|
5
|
-
private _deps;
|
|
6
|
-
static readonly heuristicName = "TvFetcherErrorHeuristic";
|
|
7
|
-
readonly type = "sync";
|
|
8
|
-
constructor(_deps: IHeuristicDeps);
|
|
9
|
-
analyze(error: IError): HeuristicResult;
|
|
10
|
-
}
|