@vkontakte/videoplayer-core 2.0.161-dev.eddfe39b7.0 → 2.0.162-dev.cd80d9e13.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 +62 -34
- package/es2015.esm.js +65 -37
- package/esnext.cjs +62 -34
- package/esnext.esm.js +62 -34
- package/evergreen.esm.js +67 -39
- package/package.json +2 -2
- package/types/player/types.d.ts +1 -0
- package/types/providers/DashProvider/baseDashProvider.d.ts +3 -2
- package/types/providers/DashProvider/lib/buffer.d.ts +5 -1
- package/types/providers/DashProvider/lib/player.d.ts +9 -1
- package/types/providers/DashProvider/lib/utils.d.ts +1 -1
- package/types/providers/DashProviderVirtual/baseDashProvider.d.ts +3 -2
- package/types/providers/DashProviderVirtual/lib/buffer/nativeBufferManager.d.ts +2 -1
- package/types/providers/DashProviderVirtual/lib/buffer/types.d.ts +6 -1
- package/types/providers/DashProviderVirtual/lib/buffer/virtualBuffer/baseVirtualBufferManager.d.ts +5 -2
- package/types/providers/DashProviderVirtual/lib/player/basePlayer.d.ts +9 -2
- package/types/providers/DashProviderVirtual/lib/player/livePlayer.d.ts +1 -1
- package/types/providers/DashProviderVirtual/lib/player/player.d.ts +1 -1
- package/types/providers/DashProviderVirtual/lib/player/types.d.ts +2 -1
- package/types/providers/DashProviderVirtual/lib/utils.d.ts +2 -2
- package/types/providers/HlsProvider/index.d.ts +1 -1
- package/types/providers/MpegProvider/index.d.ts +1 -1
- package/types/providers/ProviderContainer/index.d.ts +1 -0
- package/types/providers/types.d.ts +1 -0
- package/types/providers/utils/Abr/abrController.d.ts +7 -4
- package/types/providers/utils/Abr/abrManager.d.ts +2 -0
- package/types/providers/utils/Abr/controllers/abrPhaseController.d.ts +17 -0
- package/types/providers/utils/Abr/rules/audio/audioThroughputRule.d.ts +3 -2
- package/types/providers/utils/Abr/rules/audio/minAudioForVideoRule.d.ts +3 -2
- package/types/providers/utils/Abr/rules/audioRuleFactory.d.ts +2 -2
- package/types/providers/utils/Abr/rules/baseRule.d.ts +9 -5
- package/types/providers/utils/Abr/rules/limitAboveRule.d.ts +3 -2
- package/types/providers/utils/Abr/rules/limitBelowRule.d.ts +3 -2
- package/types/providers/utils/Abr/rules/video/abandonRequestRule.d.ts +12 -0
- package/types/providers/utils/Abr/rules/video/bolaRule.d.ts +31 -0
- package/types/providers/utils/Abr/rules/video/bufferRule.d.ts +7 -2
- package/types/providers/utils/Abr/rules/video/failedVideoTrackRule.d.ts +4 -3
- package/types/providers/utils/Abr/rules/video/fitsContainerRule.d.ts +3 -2
- package/types/providers/utils/Abr/rules/video/insufficientBufferRule.d.ts +15 -0
- package/types/providers/utils/Abr/rules/video/lowerLimitRule.d.ts +3 -2
- package/types/providers/utils/Abr/rules/video/stallsRule.d.ts +3 -2
- package/types/providers/utils/Abr/rules/video/throughputRule.d.ts +5 -4
- package/types/providers/utils/Abr/rules/video/upperLimitRule.d.ts +62 -4
- package/types/providers/utils/Abr/rules/videoRuleFactory.d.ts +3 -2
- package/types/providers/utils/Abr/types.d.ts +31 -5
- package/types/providers/utils/Abr/utils.d.ts +2 -1
- package/types/providers/utils/parsers/types.d.ts +1 -0
- package/types/utils/ThroughputEstimator.d.ts +4 -1
- package/types/utils/dashMaxTvVideoQuality.d.ts +7 -0
- package/types/utils/smoothedValue/baseSmoothedValue.d.ts +1 -0
- package/types/utils/smoothedValue/types.d.ts +1 -0
- package/types/utils/tuningConfig.d.ts +59 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vkontakte/videoplayer-core",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.162-dev.cd80d9e13.0",
|
|
4
4
|
"author": "vk.com",
|
|
5
5
|
"description": "Videoplayer core library based on the vk.com platform",
|
|
6
6
|
"homepage": "https://vk.com",
|
|
@@ -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.91-dev.cd80d9e13.0"
|
|
46
46
|
}
|
|
47
47
|
}
|
package/types/player/types.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ import type { IProvider, IProviderParams } from "../types";
|
|
|
6
6
|
import type { IObservableVideo } from "../utils/HTMLVideoElement/observable";
|
|
7
7
|
import { TrackHistory } from "../../utils/autoSelectTrack";
|
|
8
8
|
import type { IStateMachine } from "../../utils/StateMachine/types";
|
|
9
|
-
import type { ISubscription, ITracer, Milliseconds, Nullable } from "@vkontakte/videoplayer-shared";
|
|
9
|
+
import type { ExactVideoQuality, ISubscription, ITracer, Milliseconds, Nullable } from "@vkontakte/videoplayer-shared";
|
|
10
10
|
import { Player } from "./lib/player";
|
|
11
11
|
import { Scene3D } from "../../utils/3d/Scene3D";
|
|
12
12
|
import DroppedFramesManager from "../utils/HTMLVideoElement/DroppedFramesManager";
|
|
@@ -19,6 +19,7 @@ type IParams = IProviderParams<IDashURLSource> & {
|
|
|
19
19
|
forceVideoCodec?: VideoCodec;
|
|
20
20
|
failedVideoTrack?: Nullable<IVideoTrack>;
|
|
21
21
|
isOnDemand?: boolean;
|
|
22
|
+
dashMaxTvVideoQuality?: Nullable<ExactVideoQuality>;
|
|
22
23
|
};
|
|
23
24
|
export default abstract class BaseDashProvider implements IProvider {
|
|
24
25
|
scene3D: Scene3D | undefined;
|
|
@@ -30,7 +31,7 @@ export default abstract class BaseDashProvider implements IProvider {
|
|
|
30
31
|
protected player: Player;
|
|
31
32
|
protected params: IParams;
|
|
32
33
|
protected tracer: ITracer;
|
|
33
|
-
protected textTracksManager: TextTrackManager;
|
|
34
|
+
protected textTracksManager: TextTrackManager | null;
|
|
34
35
|
protected droppedFramesManager: DroppedFramesManager;
|
|
35
36
|
protected stallsManager: StallsManager;
|
|
36
37
|
protected elementSizeManager: ElementSizeManager;
|
|
@@ -3,6 +3,7 @@ import type { IError, IRange, ISubject, IValueSubject, Milliseconds } from "@vko
|
|
|
3
3
|
import { abortable } from "@vkontakte/videoplayer-shared";
|
|
4
4
|
import type { Fetcher } from "./fetcher";
|
|
5
5
|
import type { CommonInit, Manifest, Representation, Segment, Stream, StreamKind } from "../../utils/parsers/types";
|
|
6
|
+
import type { VideoSegmentLoadProgress } from "../../utils/Abr/types";
|
|
6
7
|
export interface Dependencies {
|
|
7
8
|
fetcher: Fetcher;
|
|
8
9
|
tuning: ITuningConfig;
|
|
@@ -33,6 +34,7 @@ export declare class BufferManager {
|
|
|
33
34
|
playingRepresentationInit$: IValueSubject<CommonInit | undefined>;
|
|
34
35
|
error$: ISubject<IError>;
|
|
35
36
|
gaps: Gap[];
|
|
37
|
+
updateEnd$: IValueSubject<void>;
|
|
36
38
|
private subscription;
|
|
37
39
|
private kind;
|
|
38
40
|
private initData;
|
|
@@ -74,7 +76,7 @@ export declare class BufferManager {
|
|
|
74
76
|
private loadByteRangeSegmentsTimeoutId;
|
|
75
77
|
constructor(kind: StreamKind, mediaSource: MediaSource, representations: Representation[], { fetcher, tuning, getCurrentPosition, isActiveLowLatency, compatibilityMode, manifest }: Dependencies);
|
|
76
78
|
startWith: ReturnType<typeof abortable<[Representation["id"]]>>;
|
|
77
|
-
switchToWithPreviousAbort(newRepresentationId: Representation["id"], dropBuffer?: boolean): void
|
|
79
|
+
switchToWithPreviousAbort(newRepresentationId: Representation["id"], dropBuffer?: boolean): Promise<void | undefined>;
|
|
78
80
|
switchTo: ReturnType<typeof abortable<[Representation["id"], boolean | undefined], void>>;
|
|
79
81
|
switchToOld: ReturnType<typeof abortable<[Representation["id"], boolean | undefined], void>>;
|
|
80
82
|
warmUpMediaSource(): void;
|
|
@@ -124,6 +126,8 @@ export declare class BufferManager {
|
|
|
124
126
|
getDebugBufferState(): IRange<Milliseconds> | undefined;
|
|
125
127
|
getForwardBufferDuration(currentPosition?: Milliseconds | undefined): Milliseconds;
|
|
126
128
|
getForwardBufferRepresentations(currentPosition?: Milliseconds | undefined): Map<Representation["id"], Segment[]>;
|
|
129
|
+
getMpdSegmentDuration(): Milliseconds | undefined;
|
|
130
|
+
getActiveSegmentProgress(): VideoSegmentLoadProgress | undefined;
|
|
127
131
|
private detectGaps;
|
|
128
132
|
private detectGapsWhenIdle;
|
|
129
133
|
private checkEjectedSegments;
|
|
@@ -5,8 +5,9 @@ import { StreamKind } from "../../utils/parsers/types";
|
|
|
5
5
|
import StateMachine from "../../../utils/StateMachine/StateMachine";
|
|
6
6
|
import type ThroughputEstimator from "../../../utils/ThroughputEstimator";
|
|
7
7
|
import type { ITuningConfig } from "../../../utils/tuningConfig";
|
|
8
|
-
import type { IError, ISubject, ITracer, IValueSubject, Milliseconds } from "@vkontakte/videoplayer-shared";
|
|
8
|
+
import type { ExactVideoQuality, IError, ISubject, ITracer, IValueSubject, Milliseconds, Nullable } from "@vkontakte/videoplayer-shared";
|
|
9
9
|
import { abortable, Subject } from "@vkontakte/videoplayer-shared";
|
|
10
|
+
import type { VideoSegmentLoadProgress } from "../../utils/Abr/types";
|
|
10
11
|
export declare enum State {
|
|
11
12
|
NONE = "none",
|
|
12
13
|
MANIFEST_READY = "manifest_ready",
|
|
@@ -20,6 +21,7 @@ export interface Params {
|
|
|
20
21
|
forceVideoCodec?: VideoCodec;
|
|
21
22
|
tracer: ITracer;
|
|
22
23
|
isOnDemand: boolean;
|
|
24
|
+
dashMaxTvVideoQuality: Nullable<ExactVideoQuality>;
|
|
23
25
|
}
|
|
24
26
|
export declare class Player {
|
|
25
27
|
private element;
|
|
@@ -72,6 +74,7 @@ export declare class Player {
|
|
|
72
74
|
videoLastDataObtainedTimestamp$: IValueSubject<Milliseconds>;
|
|
73
75
|
fetcherRecoverableError$: Subject<IError>;
|
|
74
76
|
fetcherError$: Subject<IError>;
|
|
77
|
+
updateDurationError$: Subject<IError>;
|
|
75
78
|
private liveStreamEndTimestamp;
|
|
76
79
|
private liveBuffer;
|
|
77
80
|
private isUpdatingLive;
|
|
@@ -83,6 +86,7 @@ export declare class Player {
|
|
|
83
86
|
private livePauseWatchdogSubscription;
|
|
84
87
|
private liveWasInterrupted;
|
|
85
88
|
private isOnDemand;
|
|
89
|
+
private dashMaxTvVideoQuality;
|
|
86
90
|
private destroyController;
|
|
87
91
|
constructor(params: Params);
|
|
88
92
|
initManifest: ReturnType<typeof abortable<[HTMLVideoElement, string, number]>>;
|
|
@@ -100,6 +104,8 @@ export declare class Player {
|
|
|
100
104
|
get isStreamEnded(): boolean;
|
|
101
105
|
stop(): void;
|
|
102
106
|
getForwardBufferRepresentations(kind: Exclude<StreamKind, StreamKind.TEXT>): Map<Representation["id"], Segment[]> | undefined;
|
|
107
|
+
getActiveVideoSegmentProgress(): VideoSegmentLoadProgress | undefined;
|
|
108
|
+
getMpdVideoSegmentDuration(): Milliseconds | undefined;
|
|
103
109
|
setBufferTarget(time: Milliseconds): void;
|
|
104
110
|
getStreams(): Manifest["streams"] | undefined;
|
|
105
111
|
getCodecs(): Manifest["codecs"] | undefined;
|
|
@@ -115,4 +121,6 @@ export declare class Player {
|
|
|
115
121
|
* Возвращает duration в милисекундах.
|
|
116
122
|
*/
|
|
117
123
|
calculateDurationFromSegments(): number;
|
|
124
|
+
private isAnyBufferUpdating;
|
|
125
|
+
updateSourceDurationFromSegments(): void;
|
|
118
126
|
}
|
|
@@ -7,7 +7,7 @@ export declare const representationToTextTrack: ({ language, label }: Stream, {
|
|
|
7
7
|
isAuto: boolean;
|
|
8
8
|
}) => IInternalTextTrack;
|
|
9
9
|
export declare const textRepresentationToTextTrack: ({ language, label, id, url, isAuto }: TextRepresentation) => IInternalTextTrack;
|
|
10
|
-
export declare const streamToIAudioStream: ({ id, language, label, codecs, isDefault }: Stream) => IAudioStream;
|
|
10
|
+
export declare const streamToIAudioStream: ({ id, language, label, codecs, isDefault, channels }: Stream) => IAudioStream;
|
|
11
11
|
export declare const streamToIVideoStream: ({ id, language, label, hdr, codecs }: Stream) => IVideoStream;
|
|
12
12
|
export declare const isTemplateSegment: (segment: Segment) => segment is TemplateSegment;
|
|
13
13
|
export declare const isTemplateSegmentReference: (segmentReference: SegmentReference) => segmentReference is TemplateSegmentReference;
|
|
@@ -6,7 +6,7 @@ import type { IProvider, IProviderParams } from "../types";
|
|
|
6
6
|
import type { IObservableVideo } from "../utils/HTMLVideoElement/observable";
|
|
7
7
|
import { TrackHistory } from "../../utils/autoSelectTrack";
|
|
8
8
|
import type { IStateMachine } from "../../utils/StateMachine/types";
|
|
9
|
-
import type { ISubscription, ITracer, Milliseconds, Nullable } from "@vkontakte/videoplayer-shared";
|
|
9
|
+
import type { ExactVideoQuality, ISubscription, ITracer, Milliseconds, Nullable } from "@vkontakte/videoplayer-shared";
|
|
10
10
|
import { Scene3D } from "../../utils/3d/Scene3D";
|
|
11
11
|
import DroppedFramesManager from "../utils/HTMLVideoElement/DroppedFramesManager";
|
|
12
12
|
import TextTrackManager from "../utils/HTMLVideoElement/TextTrackManager";
|
|
@@ -19,6 +19,7 @@ type IParams = IProviderParams<IDashURLSource> & {
|
|
|
19
19
|
forceVideoCodec?: VideoCodec;
|
|
20
20
|
failedVideoTrack?: Nullable<IVideoTrack>;
|
|
21
21
|
isOnDemand?: boolean;
|
|
22
|
+
dashMaxTvVideoQuality?: Nullable<ExactVideoQuality>;
|
|
22
23
|
};
|
|
23
24
|
export default abstract class BaseDashProvider implements IProvider {
|
|
24
25
|
scene3D: Scene3D | undefined;
|
|
@@ -30,7 +31,7 @@ export default abstract class BaseDashProvider implements IProvider {
|
|
|
30
31
|
protected player: BasePlayer;
|
|
31
32
|
protected params: IParams;
|
|
32
33
|
protected tracer: ITracer;
|
|
33
|
-
protected textTracksManager: TextTrackManager;
|
|
34
|
+
protected textTracksManager: TextTrackManager | null;
|
|
34
35
|
protected droppedFramesManager: DroppedFramesManager;
|
|
35
36
|
protected stallsManager: StallsManager;
|
|
36
37
|
protected elementSizeManager: ElementSizeManager;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import type { IError, IRange, ISubject, Milliseconds } from "@vkontakte/videoplayer-shared";
|
|
1
|
+
import type { IError, IRange, ISubject, IValueSubject, Milliseconds } from "@vkontakte/videoplayer-shared";
|
|
2
2
|
export declare class NativeBufferManager {
|
|
3
3
|
error$: ISubject<IError>;
|
|
4
|
+
updateEnd$: IValueSubject<void>;
|
|
4
5
|
private mediaSource;
|
|
5
6
|
private sourceBuffer;
|
|
6
7
|
private sourceBufferTaskQueue;
|
|
@@ -2,6 +2,7 @@ import type { Byte, IError, IRange, ISubject, IValueSubject, Milliseconds } from
|
|
|
2
2
|
import type { CommonInit, Manifest, Representation, Segment } from "../../../utils/parsers/types";
|
|
3
3
|
import type { Fetcher } from "../fetcher";
|
|
4
4
|
import type { ITuningConfig } from "../../../../utils/tuningConfig";
|
|
5
|
+
import type { VideoSegmentLoadProgress } from "../../../utils/Abr/types";
|
|
5
6
|
export type TRepresentationSwitchMode = "lazy" | "force";
|
|
6
7
|
export declare enum SwithRepresentationMode {
|
|
7
8
|
Lazy = "lazy",
|
|
@@ -32,10 +33,13 @@ export interface IVirtualBufferManager<T extends Segment = Segment> {
|
|
|
32
33
|
getForwardBufferRepresentations(currentPosition?: Milliseconds): Map<Representation["id"], T[]>;
|
|
33
34
|
getForwardPlaybackBufferDuration(currentPosition?: Milliseconds): Milliseconds;
|
|
34
35
|
getPlaybackBufferState(): IRange<Milliseconds> | null;
|
|
36
|
+
getMutexInfo(): string;
|
|
35
37
|
setTarget(time: Milliseconds): void;
|
|
36
38
|
setPreloadOnly(preloadOnly: boolean): void;
|
|
37
39
|
findSegmentStartTime(position: Milliseconds): Milliseconds | undefined;
|
|
38
|
-
calculateDurationFromSegments(
|
|
40
|
+
calculateDurationFromSegments(): Milliseconds;
|
|
41
|
+
getActiveSegmentProgress(): VideoSegmentLoadProgress | undefined;
|
|
42
|
+
getMpdSegmentDuration(): Milliseconds | undefined;
|
|
39
43
|
destroy(): void;
|
|
40
44
|
get lastDataObtainedTimestamp(): Milliseconds;
|
|
41
45
|
}
|
|
@@ -43,6 +47,7 @@ export interface IBufferPlaybackQueueItem<T extends Segment> {
|
|
|
43
47
|
representationId: Representation["id"];
|
|
44
48
|
segmentIndex: number;
|
|
45
49
|
segment: T;
|
|
50
|
+
startedAtMs?: Milliseconds;
|
|
46
51
|
}
|
|
47
52
|
export interface ISomeDataLoadedCallbackParams<T extends Segment> {
|
|
48
53
|
downloadingItems: IBufferPlaybackQueueItem<T>[];
|
package/types/providers/DashProviderVirtual/lib/buffer/virtualBuffer/baseVirtualBufferManager.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ import type { Byte, IError, IRange, ISubject, IValueSubject, Milliseconds, Secon
|
|
|
6
6
|
import { abortable, Subscription } from "@vkontakte/videoplayer-shared";
|
|
7
7
|
import type { NativeBufferManager } from "../nativeBufferManager";
|
|
8
8
|
import { SwithRepresentationMode, type Dependencies, type IBufferPlaybackQueueItem, type ISomeDataLoadedCallbackParams, type IVirtualBufferManager } from "../types";
|
|
9
|
+
import type { VideoSegmentLoadProgress } from "../../../../utils/Abr/types";
|
|
9
10
|
export declare abstract class BaseVirtualBufferManager<T extends Segment> implements IVirtualBufferManager<T> {
|
|
10
11
|
error$: ISubject<IError>;
|
|
11
12
|
playingRepresentation$: IValueSubject<Representation["id"] | undefined>;
|
|
@@ -59,7 +60,6 @@ export declare abstract class BaseVirtualBufferManager<T extends Segment> implem
|
|
|
59
60
|
startWith: ReturnType<typeof abortable<[Representation["id"]]>>;
|
|
60
61
|
switchTo(newRepresentationId: Representation["id"], mode?: SwithRepresentationMode): Promise<void>;
|
|
61
62
|
protected getSwitchWithAbort(): ReturnType<typeof abortable<[Representation["id"], SwithRepresentationMode], void>>;
|
|
62
|
-
switchToOld: ReturnType<typeof abortable<[Representation["id"], boolean | undefined], void>>;
|
|
63
63
|
prepareSeek(): Promise<void>;
|
|
64
64
|
seek(position: Milliseconds | undefined): Promise<void>;
|
|
65
65
|
maintain(currentPosition?: Milliseconds | undefined): Promise<void>;
|
|
@@ -69,7 +69,10 @@ export declare abstract class BaseVirtualBufferManager<T extends Segment> implem
|
|
|
69
69
|
abort(): Promise<void>;
|
|
70
70
|
findSegmentStartTime(position: Milliseconds): Milliseconds | undefined;
|
|
71
71
|
getRepresentationInitialTime(): Seconds;
|
|
72
|
-
|
|
72
|
+
getMutexInfo(): string;
|
|
73
|
+
calculateDurationFromSegments(): Milliseconds;
|
|
74
|
+
getActiveSegmentProgress(): VideoSegmentLoadProgress | undefined;
|
|
75
|
+
getMpdSegmentDuration(): Milliseconds | undefined;
|
|
73
76
|
get lastDataObtainedTimestamp(): Milliseconds;
|
|
74
77
|
setTarget(time: Milliseconds): void;
|
|
75
78
|
setPreloadOnly(preloadOnly: boolean): void;
|
|
@@ -7,6 +7,7 @@ import type ThroughputEstimator from "../../../../utils/ThroughputEstimator";
|
|
|
7
7
|
import type { ITuningConfig } from "../../../../utils/tuningConfig";
|
|
8
8
|
import type { IError, IRange, ISubject, ISubscription, ITracer, IValueSubject, Milliseconds, Nullable, Seconds } from "@vkontakte/videoplayer-shared";
|
|
9
9
|
import { abortable, Subject, Subscription, SubscriptionRemovable } from "@vkontakte/videoplayer-shared";
|
|
10
|
+
import type { VideoSegmentLoadProgress } from "../../../utils/Abr/types";
|
|
10
11
|
import { Fetcher } from "../fetcher";
|
|
11
12
|
import type { Dependencies, IVirtualBufferManager, SwithRepresentationMode } from "../buffer/types";
|
|
12
13
|
import type { Params } from "./types";
|
|
@@ -70,10 +71,12 @@ export declare abstract class BasePlayer {
|
|
|
70
71
|
videoLastDataObtainedTimestamp$: IValueSubject<Milliseconds>;
|
|
71
72
|
fetcherRecoverableError$: Subject<IError>;
|
|
72
73
|
fetcherError$: Subject<IError>;
|
|
74
|
+
updateDurationError$: Subject<IError>;
|
|
73
75
|
private isOnDemand;
|
|
76
|
+
private dashMaxTvVideoQuality;
|
|
74
77
|
protected constructor(params: Params);
|
|
75
78
|
protected abstract prepareManifestUrlString(manifestBaseUrlString: string, offset: number): string;
|
|
76
|
-
protected abstract
|
|
79
|
+
protected abstract setSourceInitDuration(): void;
|
|
77
80
|
protected abstract restoreAfterDeepStall(stallTraceAttributes: Record<string, number>): Promise<void>;
|
|
78
81
|
initRepresentations: ReturnType<typeof abortable<[Representation["id"], Representation["id"] | undefined, IHLSSource | undefined]>>;
|
|
79
82
|
initManifest(element: HTMLVideoElement, manifestBaseUrlString: string, offset: number): Promise<void>;
|
|
@@ -82,7 +85,8 @@ export declare abstract class BasePlayer {
|
|
|
82
85
|
seek(requestedPosition: Milliseconds, forcePrecise?: boolean): Promise<void>;
|
|
83
86
|
warmUpMediaSourceIfNeeded(position?: Milliseconds | undefined): void;
|
|
84
87
|
getForwardBufferRepresentations(kind: Exclude<StreamKind, StreamKind.TEXT>): Map<Representation["id"], Segment[]> | undefined;
|
|
85
|
-
|
|
88
|
+
getActiveVideoSegmentProgress(): VideoSegmentLoadProgress | undefined;
|
|
89
|
+
getMpdVideoSegmentDuration(): Milliseconds | undefined;
|
|
86
90
|
get isStreamEnded(): boolean;
|
|
87
91
|
getStreams(): Manifest["streams"] | undefined;
|
|
88
92
|
getCodecs(): Manifest["codecs"] | undefined;
|
|
@@ -90,6 +94,9 @@ export declare abstract class BasePlayer {
|
|
|
90
94
|
setPreloadOnly(preloadOnly: boolean): void;
|
|
91
95
|
stop(): void;
|
|
92
96
|
destroy(): void;
|
|
97
|
+
updateSourceDurationFromSegments(): void;
|
|
98
|
+
calculateDurationFromBuffersSegments(): Milliseconds;
|
|
99
|
+
private isAnyBufferUpdating;
|
|
93
100
|
protected get isStreamNotOpen(): boolean;
|
|
94
101
|
protected reinitDecoderIfNeeded(force?: boolean): Promise<void>;
|
|
95
102
|
protected stallWatchdogIntervalCallback(): Promise<void>;
|
|
@@ -18,7 +18,7 @@ export declare class LivePlayer extends BasePlayer {
|
|
|
18
18
|
initBuffer(): void;
|
|
19
19
|
protected forcePositionToRepresentationInitialTime(): Promise<void>;
|
|
20
20
|
protected tick(): Promise<void>;
|
|
21
|
-
protected
|
|
21
|
+
protected setSourceInitDuration(): void;
|
|
22
22
|
protected isStallExceeded(timeInWaiting: Milliseconds): boolean;
|
|
23
23
|
protected restoreAfterDeepStall(stallTraceAttributes: Record<string, number>): Promise<void>;
|
|
24
24
|
protected updateManifest(): Promise<Manifest | null>;
|
|
@@ -4,7 +4,7 @@ export declare class Player extends BasePlayer {
|
|
|
4
4
|
constructor(params: Params);
|
|
5
5
|
protected prepareManifestUrlString(manifestBaseUrlString: string, _offset: number): string;
|
|
6
6
|
protected initRepresentationSubscriptions(): void;
|
|
7
|
-
protected
|
|
7
|
+
protected setSourceInitDuration(): void;
|
|
8
8
|
protected restoreAfterDeepStall(stallTraceAttributes: Record<string, number>): Promise<void>;
|
|
9
9
|
protected initDisableStallWatchdogSubscription(): void;
|
|
10
10
|
protected initEndOfVideoSubscription(): void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type ThroughputEstimator from "../../../../utils/ThroughputEstimator";
|
|
2
2
|
import type { ITuningConfig } from "../../../../utils/tuningConfig";
|
|
3
3
|
import type { VideoCodec } from "../../../../player/types";
|
|
4
|
-
import type { ITracer } from "@vkontakte/videoplayer-shared";
|
|
4
|
+
import type { ExactVideoQuality, ITracer, Nullable } from "@vkontakte/videoplayer-shared";
|
|
5
5
|
export declare enum State {
|
|
6
6
|
NONE = "none",
|
|
7
7
|
MANIFEST_READY = "manifest_ready",
|
|
@@ -15,4 +15,5 @@ export interface Params {
|
|
|
15
15
|
forceVideoCodec?: VideoCodec;
|
|
16
16
|
tracer: ITracer;
|
|
17
17
|
isOnDemand?: boolean;
|
|
18
|
+
dashMaxTvVideoQuality?: Nullable<ExactVideoQuality>;
|
|
18
19
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import type { Representation, Segment, SegmentReference, Stream, TemplateSegment, TemplateSegmentReference, TextRepresentation } from "../../utils/parsers/types";
|
|
2
2
|
import type { IAudioStream, IAudioTrack, IInternalTextTrack, IVideoStream, IVideoTrack } from "../../../player/types";
|
|
3
|
-
export declare const representationToVideoTrack: ({ id, width, height, bitrate, fps, quality: qualityString, streamId }: Representation) => IVideoTrack | undefined;
|
|
3
|
+
export declare const representationToVideoTrack: ({ id, width, height, bitrate, fps, quality: qualityString, streamId, tvDisabled }: Representation) => IVideoTrack | undefined;
|
|
4
4
|
export declare const representationToAudioTrack: ({ id, bitrate }: Representation) => IAudioTrack;
|
|
5
5
|
export declare const representationToTextTrack: ({ language, label }: Stream, { id, url, isAuto }: Representation & {
|
|
6
6
|
url: string;
|
|
7
7
|
isAuto: boolean;
|
|
8
8
|
}) => IInternalTextTrack;
|
|
9
9
|
export declare const textRepresentationToTextTrack: ({ language, label, id, url, isAuto }: TextRepresentation) => IInternalTextTrack;
|
|
10
|
-
export declare const streamToIAudioStream: ({ id, language, label, codecs, isDefault }: Stream) => IAudioStream;
|
|
10
|
+
export declare const streamToIAudioStream: ({ id, language, label, codecs, isDefault, channels }: Stream) => IAudioStream;
|
|
11
11
|
export declare const streamToIVideoStream: ({ id, language, label, hdr, codecs }: Stream) => IVideoStream;
|
|
12
12
|
export declare const isTemplateSegment: (segment: Segment) => segment is TemplateSegment;
|
|
13
13
|
export declare const isTemplateSegmentReference: (segmentReference: SegmentReference) => segmentReference is TemplateSegmentReference;
|
|
@@ -13,7 +13,7 @@ export default class MpegProvider implements IProvider {
|
|
|
13
13
|
private subscribe;
|
|
14
14
|
destroy(): void;
|
|
15
15
|
private prepare;
|
|
16
|
-
|
|
16
|
+
protected playIfAllowed(): void;
|
|
17
17
|
private seek;
|
|
18
18
|
private syncPlayback;
|
|
19
19
|
private handleQualityLimitTransition;
|
|
@@ -36,6 +36,7 @@ export default class ProviderContainer implements IProviderContainer {
|
|
|
36
36
|
private failoverIndex;
|
|
37
37
|
private currentFailedVideoTrack;
|
|
38
38
|
private volumeMultiplierManager;
|
|
39
|
+
private dashMaxTvVideoQuality;
|
|
39
40
|
constructor(params: IParams);
|
|
40
41
|
init(): void;
|
|
41
42
|
destroy(): void;
|
|
@@ -108,6 +108,7 @@ export interface IProviderOutput {
|
|
|
108
108
|
error$: ISubject<IError>;
|
|
109
109
|
fetcherRecoverableError$: ISubject<IError>;
|
|
110
110
|
fetcherError$: ISubject<IError>;
|
|
111
|
+
updateDurationError$: ISubject<IError>;
|
|
111
112
|
warning$: ISubject<IWarning>;
|
|
112
113
|
endedEvent$: ISubject<void>;
|
|
113
114
|
loopedEvent$: ISubject<Seconds>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IAbrController, IAbrRule, IBaseAbrControllerContext,
|
|
1
|
+
import type { IAbrController, IAbrRule, IBaseAbrControllerContext, IRuleInitContext } from "./types";
|
|
2
2
|
import type { IBaseTrack } from "../../../player/types";
|
|
3
3
|
export default class AbrController<
|
|
4
4
|
T extends IBaseTrack,
|
|
@@ -6,10 +6,13 @@ export default class AbrController<
|
|
|
6
6
|
> implements IAbrController<T> {
|
|
7
7
|
private history;
|
|
8
8
|
private rules;
|
|
9
|
-
private
|
|
10
|
-
|
|
9
|
+
private _context;
|
|
10
|
+
get context(): C;
|
|
11
|
+
init(rules: IAbrRule<T, C>[], initContext: IRuleInitContext): void;
|
|
11
12
|
destroy(): void;
|
|
12
13
|
updateContext(context: C): void;
|
|
13
|
-
autoSelectTrack(): T;
|
|
14
|
+
autoSelectTrack(rules?: IAbrRule<T, C>[]): T;
|
|
14
15
|
private selectTrackBasedOnHistory;
|
|
16
|
+
/** при переключении аудио стрима очищаем историю для предотвращения залипания в `onCooldown` */
|
|
17
|
+
historyReset(): void;
|
|
15
18
|
}
|
|
@@ -8,6 +8,8 @@ export declare class AbrManager {
|
|
|
8
8
|
private subscription;
|
|
9
9
|
private lastVideoTrackSelected$;
|
|
10
10
|
private context;
|
|
11
|
+
private phaseController;
|
|
12
|
+
private allVideoRules;
|
|
11
13
|
init(context: IInitAbrManagerContext): void;
|
|
12
14
|
updateContext(updateContext: IUpdatableAbrManagerContext): void;
|
|
13
15
|
autoSelectTrack<T extends IVideoTrack | IAudioTrack>(kind: Exclude<StreamKind, StreamKind.TEXT>): T;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { IObservable } from "@vkontakte/videoplayer-shared";
|
|
2
|
+
import type { IVideoAbrContext, RuleConfidence } from "../types";
|
|
3
|
+
export declare enum AbrPhase {
|
|
4
|
+
Startup = "startup",
|
|
5
|
+
Steady = "steady"
|
|
6
|
+
}
|
|
7
|
+
export type RulePhaseConfig = Readonly<Partial<Record<AbrPhase, RuleConfidence>>>;
|
|
8
|
+
export declare const uniformPhaseConfig: (confidence: RuleConfidence) => RulePhaseConfig;
|
|
9
|
+
export declare class AbrPhaseController {
|
|
10
|
+
private _phase;
|
|
11
|
+
private readonly subscription;
|
|
12
|
+
constructor(isSeeked$?: IObservable<boolean>);
|
|
13
|
+
get phase(): AbrPhase;
|
|
14
|
+
updatePhase(context: IVideoAbrContext): void;
|
|
15
|
+
reset(): void;
|
|
16
|
+
destroy(): void;
|
|
17
|
+
}
|
|
@@ -1,11 +1,12 @@
|
|
|
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";
|
|
5
5
|
import type { ITuningConfig } from "../../../../../utils/tuningConfig";
|
|
6
|
+
import type { RulePhaseConfig } from "../../controllers/abrPhaseController";
|
|
6
7
|
type AudioThroughputLogsArgs = [forwardBufferHealth: Nullable<number>, playbackRate: number, reserve: Kbps, playbackRateFactor: number, bitrateFactor: number, estimatedThroughput: Kbps, tuning: ITuningConfig];
|
|
7
8
|
export declare class AudioThroughputRule extends LimitAboveRule<IAudioTrack, IAudioAbrContext, AudioThroughputLogsArgs> implements IAbrRule<IAudioTrack, IAudioAbrContext> {
|
|
8
|
-
constructor(
|
|
9
|
+
constructor(phaseConfig: RulePhaseConfig);
|
|
9
10
|
execute(context: IAudioAbrContext): IAbrRuleResolution<IAudioTrack>;
|
|
10
11
|
protected createLogMessage(selectedTrack: IVideoTrack, forwardBufferHealth: number | undefined, playbackRate: number, reserve: Kbps, playbackRateFactor: number, bitrateFactor: number, estimatedThroughput: Kbps, tuning: ITuningConfig): string;
|
|
11
12
|
}
|
|
@@ -1,11 +1,12 @@
|
|
|
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";
|
|
5
5
|
import type { Nullable } from "@vkontakte/videoplayer-shared";
|
|
6
|
+
import type { RulePhaseConfig } from "../../controllers/abrPhaseController";
|
|
6
7
|
type MinAudioForVideoLogsArgs = [lastVideoTrackSelected: Nullable<IVideoTrack>, tuning: ITuningConfig];
|
|
7
8
|
export declare class MinAudioForVideoRule extends LimitBelowRule<IAudioTrack, IAudioAbrContext, MinAudioForVideoLogsArgs> implements IAbrRule<IAudioTrack, IAudioAbrContext> {
|
|
8
|
-
constructor(
|
|
9
|
+
constructor(phaseConfig: RulePhaseConfig);
|
|
9
10
|
execute(context: IAudioAbrContext): IAbrRuleResolution<IAudioTrack>;
|
|
10
11
|
protected createLogMessage(selectedTrack: IVideoTrack, lastVideoTrackSelected: Nullable<IVideoTrack>, tuning: ITuningConfig): string;
|
|
11
12
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AudioRuleName } from "../types";
|
|
2
2
|
import type { IAbrRule, IAudioAbrContext } from "../types";
|
|
3
|
-
import { RuleConfidence } from "../types";
|
|
4
3
|
import type { IAudioTrack } from "../../../../player/types";
|
|
4
|
+
import { type RulePhaseConfig } from "../controllers/abrPhaseController";
|
|
5
5
|
export declare class AudioRuleFactory {
|
|
6
|
-
static createRule(ruleName: AudioRuleName,
|
|
6
|
+
static createRule(ruleName: AudioRuleName, phaseConfig?: RulePhaseConfig): IAbrRule<IAudioTrack, IAudioAbrContext>;
|
|
7
7
|
}
|
|
@@ -1,19 +1,23 @@
|
|
|
1
|
-
import type { IAbrRule, IAbrRuleResolution, IBaseAbrControllerContext,
|
|
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
|
+
import type { AbrPhase } from "../controllers/abrPhaseController";
|
|
5
|
+
import { type RulePhaseConfig } from "../controllers/abrPhaseController";
|
|
4
6
|
export declare abstract class BaseRule<
|
|
5
7
|
T extends IBaseTrack,
|
|
6
8
|
C extends IBaseAbrControllerContext,
|
|
7
9
|
LogsArgs extends unknown[]
|
|
8
10
|
> implements IAbrRule<T, C> {
|
|
11
|
+
readonly phaseConfig: RulePhaseConfig;
|
|
12
|
+
readonly activePhases: ReadonlySet<AbrPhase>;
|
|
9
13
|
protected subscription: Subscription;
|
|
10
|
-
protected confidence: RuleConfidence;
|
|
11
14
|
protected type: RuleType;
|
|
12
15
|
protected name: string;
|
|
13
|
-
|
|
14
|
-
|
|
16
|
+
protected confidence: RuleConfidence;
|
|
17
|
+
constructor(phaseConfig: RulePhaseConfig);
|
|
18
|
+
init(_initContext: IRuleInitContext): void;
|
|
15
19
|
destroy(): void;
|
|
16
20
|
abstract execute(context: C): IAbrRuleResolution<T>;
|
|
17
|
-
protected createResolution(selectedTrack: T, ...params: LogsArgs): IAbrRuleResolution<T>;
|
|
21
|
+
protected createResolution(context: C, selectedTrack: T, ...params: LogsArgs): IAbrRuleResolution<T>;
|
|
18
22
|
protected abstract createLogMessage(selectedTrack: T, ...params: LogsArgs): string;
|
|
19
23
|
}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import type { IAbrRule, IAbrRuleResolution, IBaseAbrControllerContext
|
|
1
|
+
import type { IAbrRule, IAbrRuleResolution, IBaseAbrControllerContext } from "../types";
|
|
2
2
|
import type { IBaseTrack } from "../../../../player/types";
|
|
3
3
|
import { BaseRule } from "./baseRule";
|
|
4
|
+
import type { RulePhaseConfig } from "../controllers/abrPhaseController";
|
|
4
5
|
export declare abstract class LimitAboveRule<
|
|
5
6
|
T extends IBaseTrack,
|
|
6
7
|
C extends IBaseAbrControllerContext,
|
|
7
8
|
LogsArgs extends unknown[] = unknown[]
|
|
8
9
|
> extends BaseRule<T, C, LogsArgs> implements IAbrRule<T, C> {
|
|
9
|
-
constructor(
|
|
10
|
+
constructor(phaseConfig: RulePhaseConfig);
|
|
10
11
|
abstract execute(context: C): IAbrRuleResolution<T>;
|
|
11
12
|
}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import type { IAbrRule, IAbrRuleResolution, IBaseAbrControllerContext
|
|
1
|
+
import type { IAbrRule, IAbrRuleResolution, IBaseAbrControllerContext } from "../types";
|
|
2
2
|
import type { IBaseTrack } from "../../../../player/types";
|
|
3
3
|
import { BaseRule } from "./baseRule";
|
|
4
|
+
import type { RulePhaseConfig } from "../controllers/abrPhaseController";
|
|
4
5
|
export declare abstract class LimitBelowRule<
|
|
5
6
|
T extends IBaseTrack,
|
|
6
7
|
C extends IBaseAbrControllerContext,
|
|
7
8
|
LogsArgs extends unknown[] = unknown[]
|
|
8
9
|
> extends BaseRule<T, C, LogsArgs> implements IAbrRule<T, C> {
|
|
9
|
-
constructor(
|
|
10
|
+
constructor(phaseConfig: RulePhaseConfig);
|
|
10
11
|
abstract execute(context: C): IAbrRuleResolution<T>;
|
|
11
12
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { IAbrRule, IAbrRuleResolution, IVideoAbrContext } from "../../types";
|
|
2
|
+
import type { IVideoTrack } from "../../../../../player/types";
|
|
3
|
+
import type { Milliseconds } from "@vkontakte/videoplayer-shared";
|
|
4
|
+
import { LimitAboveRule } from "../limitAboveRule";
|
|
5
|
+
import type { RulePhaseConfig } from "../../controllers/abrPhaseController";
|
|
6
|
+
type LogsArgs = [elapsedMs: Milliseconds, loadedFraction: number, estimatedRemainingMs: Milliseconds, bufferLimitMs: Milliseconds, triggered: boolean];
|
|
7
|
+
export declare class AbandonRequestRule extends LimitAboveRule<IVideoTrack, IVideoAbrContext, LogsArgs> implements IAbrRule<IVideoTrack, IVideoAbrContext> {
|
|
8
|
+
constructor(phaseConfig: RulePhaseConfig);
|
|
9
|
+
execute(context: IVideoAbrContext): IAbrRuleResolution<IVideoTrack>;
|
|
10
|
+
protected createLogMessage(selectedTrack: IVideoTrack, elapsedMs: Milliseconds, loadedFraction: number, estimatedRemainingMs: Milliseconds, bufferLimitMs: Milliseconds, triggered: boolean): string;
|
|
11
|
+
}
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { IAbrRule, IAbrRuleResolution, IRuleInitContext, IVideoAbrContext } from "../../types";
|
|
2
|
+
import type { IVideoTrack } from "../../../../../player/types";
|
|
3
|
+
import type { Kbps, Seconds } from "@vkontakte/videoplayer-shared";
|
|
4
|
+
import { LimitAboveRule } from "../limitAboveRule";
|
|
5
|
+
import { AbrPhase, type RulePhaseConfig } from "../../controllers/abrPhaseController";
|
|
6
|
+
export declare const calculateUtilities: (bitratesAsc: Kbps[]) => number[];
|
|
7
|
+
export declare const calculateVpAndGp: (utilityHigh: number, bufferTargetS: Seconds, minBufferS: Seconds) => {
|
|
8
|
+
Vp: number;
|
|
9
|
+
gp: number;
|
|
10
|
+
};
|
|
11
|
+
export declare const calculateScores: (bitratesAsc: Kbps[], utilities: number[], Vp: number, gp: number, effectiveBufferS: Seconds) => number[];
|
|
12
|
+
export declare const argmax: (values: number[]) => number;
|
|
13
|
+
export declare const adjustBufferForFinite: (effectiveBufferS: Seconds, remainingDurationS: Seconds, finiteThresholdS: Seconds, _bufferTargetS: Seconds) => Seconds;
|
|
14
|
+
export declare const calculateMinBufferLevelForRep: (qIndex: number, bitratesAsc: Kbps[], utilities: number[], Vp: number, gp: number) => Seconds;
|
|
15
|
+
export declare const calculateMaxBufferLevelForRep: (qIndex: number, utilities: number[], Vp: number, gp: number) => Seconds;
|
|
16
|
+
export declare const pickIndexByThroughput: (bitratesAsc: Kbps[], throughputKbps: Kbps) => number;
|
|
17
|
+
type BolaLogsArgs = [bufferLevelS: Seconds, placeholderBufferS: Seconds, segmentDurationS: Seconds, Vp: number, gp: number, validBitrates: Kbps[], selectedIndex: number, phase: AbrPhase | undefined];
|
|
18
|
+
export declare class BolaRule extends LimitAboveRule<IVideoTrack, IVideoAbrContext, BolaLogsArgs> implements IAbrRule<IVideoTrack, IVideoAbrContext> {
|
|
19
|
+
private placeholderBufferS;
|
|
20
|
+
private lastCallTimeMs;
|
|
21
|
+
private lastBufferLevelS;
|
|
22
|
+
constructor(phaseConfig: RulePhaseConfig);
|
|
23
|
+
init(initContext?: IRuleInitContext): void;
|
|
24
|
+
destroy(): void;
|
|
25
|
+
execute(context: IVideoAbrContext): IAbrRuleResolution<IVideoTrack>;
|
|
26
|
+
private resolveSegmentDurationS;
|
|
27
|
+
private applyBolaOSafeguard;
|
|
28
|
+
private resetPlaceholder;
|
|
29
|
+
protected createLogMessage(selectedTrack: IVideoTrack, bufferLevelS: Seconds, placeholderBufferS: Seconds, segmentDurationS: Seconds, Vp: number, gp: number, validBitrates: Kbps[], selectedIndex: number, phase: AbrPhase | undefined): string;
|
|
30
|
+
}
|
|
31
|
+
export {};
|
|
@@ -1,11 +1,16 @@
|
|
|
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";
|
|
5
5
|
import type { ITuningConfig } from "../../../../../utils/tuningConfig";
|
|
6
|
+
import type { RulePhaseConfig } from "../../controllers/abrPhaseController";
|
|
6
7
|
type BufferRuleLogsArgs = [currentVideoTrack: Nullable<IVideoTrack>, lastVideoTrackSelected: Nullable<IVideoTrack>, forwardBufferHealth: Nullable<number>, abrTuning: ITuningConfig["autoTrackSelection"]];
|
|
8
|
+
/**
|
|
9
|
+
* @deprecated Заменено на связку `BolaRule` + `InsufficientBufferRule` в фазовой архитектуре ABR.
|
|
10
|
+
* Не использовать в новых наборах правил.
|
|
11
|
+
*/
|
|
7
12
|
export declare class BufferRule extends LimitAboveRule<IVideoTrack, IVideoAbrContext, BufferRuleLogsArgs> implements IAbrRule<IVideoTrack, IVideoAbrContext> {
|
|
8
|
-
constructor(
|
|
13
|
+
constructor(phaseConfig: RulePhaseConfig);
|
|
9
14
|
execute(context: IVideoAbrContext): IAbrRuleResolution<IVideoTrack>;
|
|
10
15
|
protected createLogMessage(selectedTrack: IVideoTrack, currentVideoTrack: Nullable<IVideoTrack>, lastVideoTrackSelected: Nullable<IVideoTrack>, forwardBufferHealth: Nullable<number>, abrTuning: ITuningConfig["autoTrackSelection"]): string;
|
|
11
16
|
}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import type { IAbrRule, IAbrRuleResolution,
|
|
1
|
+
import type { IAbrRule, IAbrRuleResolution, IRuleInitContext, 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";
|
|
5
|
+
import type { RulePhaseConfig } from "../../controllers/abrPhaseController";
|
|
5
6
|
type FailedVideoTracLogsArgs = [banTrack: Nullable<IVideoTrack>];
|
|
6
7
|
export declare class FailedVideoTrackRule extends LimitAboveRule<IVideoTrack, IVideoAbrContext, FailedVideoTracLogsArgs> implements IAbrRule<IVideoTrack, IVideoAbrContext> {
|
|
7
8
|
protected banTrack: Nullable<IVideoTrack>;
|
|
8
|
-
constructor(
|
|
9
|
-
init(initContext:
|
|
9
|
+
constructor(phaseConfig: RulePhaseConfig);
|
|
10
|
+
init(initContext: IRuleInitContext): void;
|
|
10
11
|
execute(context: IVideoAbrContext): IAbrRuleResolution<IVideoTrack>;
|
|
11
12
|
protected createLogMessage(selectedTrack: IVideoTrack, banTrack: Nullable<IVideoTrack>): string;
|
|
12
13
|
}
|