@vkontakte/videoplayer-core 2.0.170-dev.bce1cd606.0 → 2.0.170
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 +63 -59
- package/es2015.esm.js +61 -57
- package/esnext.cjs +47 -43
- package/esnext.esm.js +50 -46
- package/evergreen.esm.js +50 -46
- package/package.json +2 -2
- package/types/providers/DashProvider/baseDashProvider.d.ts +2 -0
- package/types/providers/DashProviderVirtual/baseDashProvider.d.ts +1 -0
- package/types/providers/DashProviderVirtual/lib/buffer/types.d.ts +0 -1
- package/types/providers/DashProviderVirtual/lib/buffer/virtualBuffer/baseVirtualBufferManager.versionA.d.ts +0 -1
- package/types/providers/DashProviderVirtual/lib/buffer/virtualBuffer/liveVirtualBuffer.d.ts +1 -1
- package/types/providers/DashProviderVirtual/lib/buffer/virtualBuffer/virtualBufferFactory.d.ts +1 -2
- package/types/providers/DashProviderVirtual/lib/fetcher.d.ts +3 -2
- package/types/providers/DashProviderVirtual/lib/player/basePlayer.d.ts +0 -1
- package/types/providers/ProviderContainer/index.d.ts +1 -0
- package/types/providers/utils/Abr/rules/video/failedVideoTrackRule.d.ts +14 -0
- package/types/providers/utils/Abr/types.d.ts +2 -0
- package/types/utils/autoSelectTrack.d.ts +4 -3
- package/types/utils/tuningConfig.d.ts +3 -5
- package/types/providers/DashProviderVirtual/lib/buffer/virtualBuffer/baseVirtualBufferManager.d.ts +0 -110
- package/types/providers/DashProviderVirtual/lib/buffer/virtualBuffer/byteRangeVirtualBufferManager.d.ts +0 -21
- package/types/providers/DashProviderVirtual/lib/buffer/virtualBuffer/templateVirtualBufferManager.d.ts +0 -21
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vkontakte/videoplayer-core",
|
|
3
|
-
"version": "2.0.170
|
|
3
|
+
"version": "2.0.170",
|
|
4
4
|
"author": "vk.ru",
|
|
5
5
|
"description": "Videoplayer core library based on the vk.ru platform",
|
|
6
6
|
"homepage": "https://vk.ru",
|
|
@@ -42,6 +42,6 @@
|
|
|
42
42
|
"**/*.d.ts"
|
|
43
43
|
],
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@vkontakte/videoplayer-shared": "1.0.99
|
|
45
|
+
"@vkontakte/videoplayer-shared": "1.0.99"
|
|
46
46
|
}
|
|
47
47
|
}
|
|
@@ -16,6 +16,7 @@ import { ElementSizeManager } from "../utils/HTMLVideoElement/ElementSizeManager
|
|
|
16
16
|
type IParams = IProviderParams<IDashURLSource> & {
|
|
17
17
|
sourceHls?: IHLSSource;
|
|
18
18
|
forceVideoCodec?: VideoCodec;
|
|
19
|
+
failedVideoTrack?: Nullable<IVideoTrack>;
|
|
19
20
|
isOnDemand?: boolean;
|
|
20
21
|
dashMaxTvVideoQuality?: Nullable<ExactVideoQuality>;
|
|
21
22
|
};
|
|
@@ -33,6 +34,7 @@ export default abstract class BaseDashProvider implements IProvider {
|
|
|
33
34
|
protected stallsManager: StallsManager;
|
|
34
35
|
protected elementSizeManager: ElementSizeManager;
|
|
35
36
|
protected abrManager: AbrManager;
|
|
37
|
+
protected failedVideoTrack: Nullable<IVideoTrack>;
|
|
36
38
|
protected videoTracksMap: Map<IVideoTrack, {
|
|
37
39
|
stream: Stream;
|
|
38
40
|
representation: Representation;
|
|
@@ -16,6 +16,7 @@ import { AbrManager } from "../utils/Abr/abrManager";
|
|
|
16
16
|
type IParams = IProviderParams<IDashURLSource> & {
|
|
17
17
|
sourceHls?: IHLSSource;
|
|
18
18
|
forceVideoCodec?: VideoCodec;
|
|
19
|
+
failedVideoTrack?: Nullable<IVideoTrack>;
|
|
19
20
|
isOnDemand?: boolean;
|
|
20
21
|
dashMaxTvVideoQuality?: Nullable<ExactVideoQuality>;
|
|
21
22
|
};
|
|
@@ -34,7 +34,6 @@ export interface IVirtualBufferManager<T extends Segment = Segment> {
|
|
|
34
34
|
getForwardBufferRepresentations(currentPosition?: Milliseconds): Map<Representation["id"], T[]>;
|
|
35
35
|
getForwardPlaybackBufferDuration(currentPosition?: Milliseconds): Milliseconds;
|
|
36
36
|
getPlaybackBufferState(): IRange<Milliseconds> | null;
|
|
37
|
-
getMutexInfo(): string;
|
|
38
37
|
setTarget(time: Milliseconds): void;
|
|
39
38
|
setPreloadOnly(preloadOnly: boolean): void;
|
|
40
39
|
findSegmentStartTime(position: Milliseconds): Milliseconds | undefined;
|
|
@@ -70,7 +70,6 @@ export declare abstract class BaseVirtualBufferManager<T extends Segment> implem
|
|
|
70
70
|
abort(): Promise<void>;
|
|
71
71
|
findSegmentStartTime(position: Milliseconds): Milliseconds | undefined;
|
|
72
72
|
getRepresentationInitialTime(): Seconds;
|
|
73
|
-
getMutexInfo(): string;
|
|
74
73
|
calculateDurationFromSegments(): Milliseconds;
|
|
75
74
|
getActiveSegmentProgress(): VideoSegmentLoadProgress | undefined;
|
|
76
75
|
getMpdSegmentDuration(): Milliseconds | undefined;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TemplateVirtualBufferManager } from "./templateVirtualBufferManager";
|
|
1
|
+
import { TemplateVirtualBufferManager } from "./templateVirtualBufferManager.versionA";
|
|
2
2
|
import type { Manifest, Representation, StreamKind, TemplateSegment, TemplateSegmentReference } from "../../../../utils/parsers/types";
|
|
3
3
|
import type { NativeBufferManager } from "../nativeBufferManager";
|
|
4
4
|
import type { Dependencies, IBufferPlaybackQueueItem, ISomeDataLoadedCallbackParams } from "../types";
|
package/types/providers/DashProviderVirtual/lib/buffer/virtualBuffer/virtualBufferFactory.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { Representation, StreamKind } from "../../../../utils/parsers/types";
|
|
2
2
|
import type { NativeBufferManager } from "../nativeBufferManager";
|
|
3
3
|
import type { Dependencies, IVirtualBufferManager } from "../types";
|
|
4
|
-
import type { ITuningConfig } from "../../../../../utils/tuningConfig";
|
|
5
4
|
export declare class VirtualBufferFactory {
|
|
6
|
-
static getBufferManager(kind: StreamKind, nativeBufferManager: NativeBufferManager, representations: Representation[], dependencies: Dependencies
|
|
5
|
+
static getBufferManager(kind: StreamKind, nativeBufferManager: NativeBufferManager, representations: Representation[], dependencies: Dependencies): IVirtualBufferManager;
|
|
7
6
|
}
|
|
@@ -3,7 +3,7 @@ import type ThroughputEstimator from "../../../utils/ThroughputEstimator";
|
|
|
3
3
|
import type { Byte, IError, IRange, ISubject, ITracer, IValueSubject, Milliseconds } from "@vkontakte/videoplayer-shared";
|
|
4
4
|
import { abortable } from "@vkontakte/videoplayer-shared";
|
|
5
5
|
import type { ExactVideoQuality } from "@vkontakte/videoplayer-shared";
|
|
6
|
-
import type { CommonInit, GenericContainerParser, Segment, SegmentReference } from "../../utils/parsers/types";
|
|
6
|
+
import type { CommonInit, GenericContainerParser, Segment, SegmentReference, StreamKind } from "../../utils/parsers/types";
|
|
7
7
|
declare global {
|
|
8
8
|
interface Navigator {
|
|
9
9
|
connection: {
|
|
@@ -45,6 +45,7 @@ export interface FetchParams {
|
|
|
45
45
|
isLowLatency?: boolean;
|
|
46
46
|
bufferOptimisation?: boolean;
|
|
47
47
|
urlCacheMechanismEnabled?: boolean;
|
|
48
|
+
kind: StreamKind;
|
|
48
49
|
}
|
|
49
50
|
export type RepresentationFetchResult<T extends Segment> = {
|
|
50
51
|
initMetadata: CommonInit | null;
|
|
@@ -90,7 +91,7 @@ export declare class Fetcher {
|
|
|
90
91
|
private trackRequestStart;
|
|
91
92
|
fetchManifest: ReturnType<typeof abortable<[string], string | null>>;
|
|
92
93
|
fetch: ReturnType<typeof abortable<[string, FetchParams], ArrayBuffer | null>>;
|
|
93
|
-
fetchRepresentation<T extends Segment>(segmentReference: SegmentReference, parser: GenericContainerParser<unknown>, dowbloadAbortSignal: AbortSignal, priority?: Priority, representationHeight?: number): Promise<RepresentationFetchResult<T> | null | undefined>;
|
|
94
|
+
fetchRepresentation<T extends Segment>(segmentReference: SegmentReference, parser: GenericContainerParser<unknown>, dowbloadAbortSignal: AbortSignal, priority?: Priority, representationHeight?: number, kind?: StreamKind): Promise<RepresentationFetchResult<T> | null | undefined>;
|
|
94
95
|
destroy(): void;
|
|
95
96
|
private fetchByteRangeRepresentation;
|
|
96
97
|
private fetchTemplateRepresentation;
|
|
@@ -22,7 +22,6 @@ export declare abstract class BasePlayer {
|
|
|
22
22
|
protected tracer: ITracer;
|
|
23
23
|
protected stallTracer: ITracer | null;
|
|
24
24
|
protected forceVideoCodec?: VideoCodec;
|
|
25
|
-
protected stallTimeInWaitingExitAttemptMade: Milliseconds;
|
|
26
25
|
protected stallStartTime: Milliseconds | null;
|
|
27
26
|
protected lastForceSeekTimestamp: Milliseconds | null;
|
|
28
27
|
protected videoBufferManager: IVirtualBufferManager | null;
|
|
@@ -35,6 +35,7 @@ export default class ProviderContainer implements IProviderContainer {
|
|
|
35
35
|
private tracer;
|
|
36
36
|
private params;
|
|
37
37
|
private currentProviderStarted;
|
|
38
|
+
private currentFailedVideoTrack;
|
|
38
39
|
private volumeMultiplierManager;
|
|
39
40
|
private dashMaxTvVideoQuality;
|
|
40
41
|
private mayday;
|
|
@@ -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 {};
|
|
@@ -15,6 +15,7 @@ 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",
|
|
@@ -58,6 +59,7 @@ export interface IInitAbrManagerContext {
|
|
|
58
59
|
rtt$: IValueSubject<Milliseconds>;
|
|
59
60
|
throughputVariance$?: IValueSubject<number>;
|
|
60
61
|
element: HTMLMediaElement;
|
|
62
|
+
failedVideoTrack: Nullable<IVideoTrack>;
|
|
61
63
|
abrLogger: IComponentLogger;
|
|
62
64
|
panelSize?: IRectangle;
|
|
63
65
|
}
|
|
@@ -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 {};
|
|
@@ -180,11 +180,9 @@ export type ITuningConfig = {
|
|
|
180
180
|
useNewRepresentationSwitch: boolean;
|
|
181
181
|
useDelayedRepresentationSwitch: boolean;
|
|
182
182
|
useSmartRepresentationSwitch: boolean;
|
|
183
|
-
|
|
184
|
-
mutexStallExitPolicy: boolean;
|
|
183
|
+
stallForceSeekOncePerStall: boolean;
|
|
185
184
|
useFetchPriorityHints: boolean;
|
|
186
185
|
useAbortMSEFix: boolean;
|
|
187
|
-
useByteRangeNullFetchRecovery: boolean;
|
|
188
186
|
enableBaseUrlSupport: boolean;
|
|
189
187
|
maxSegmentRetryCount: number;
|
|
190
188
|
sourceOpenTimeout: number;
|
|
@@ -210,7 +208,9 @@ export type ITuningConfig = {
|
|
|
210
208
|
abrVideoRules: VideoRuleName[];
|
|
211
209
|
abrAudioRules: AudioRuleName[];
|
|
212
210
|
useDynamicBirtateRule: boolean;
|
|
211
|
+
useNewFailoverLogic: boolean;
|
|
213
212
|
useFailoverHostsOnAllProviderCrash: boolean;
|
|
213
|
+
videoTrackBanAfterProviderFail: Milliseconds;
|
|
214
214
|
saveData3gQualityLimit: ExactVideoQuality;
|
|
215
215
|
saveData2gQualityLimit: ExactVideoQuality;
|
|
216
216
|
useConnectionDataUpperLimit: boolean;
|
|
@@ -251,7 +251,6 @@ export type ITuningConfig = {
|
|
|
251
251
|
dashMaxTvVideoQuality: boolean;
|
|
252
252
|
checkRepresentationCanPlayType: Extract<CanPlayTypeResult, "maybe" | "probably"> | false;
|
|
253
253
|
preloadFirstSegment: boolean;
|
|
254
|
-
jumpGapToNearestBuffer: boolean;
|
|
255
254
|
maxQualityForFirstSegmentPreload: ExactVideoQuality;
|
|
256
255
|
downloadTime: {
|
|
257
256
|
minLookaheadSegments: number;
|
|
@@ -355,7 +354,6 @@ export type ITuningConfig = {
|
|
|
355
354
|
useNewSwitchTo: boolean;
|
|
356
355
|
alwaysAbortPreviousSwitch: boolean;
|
|
357
356
|
useDashProviderVirtual: boolean;
|
|
358
|
-
useDashProviderVirtualVersionA: boolean;
|
|
359
357
|
useDashProviderVirtualMobile: boolean;
|
|
360
358
|
useNewAutoSelectVideoTrack: boolean;
|
|
361
359
|
useSafariEndlessRequestBugfix: boolean;
|
package/types/providers/DashProviderVirtual/lib/buffer/virtualBuffer/baseVirtualBufferManager.d.ts
DELETED
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
import type { Fetcher, FetchParamsWithUrl, Priority, RepresentationFetchResult } from "../../fetcher";
|
|
2
|
-
import type { CommonInit, ContainerParser, Representation, Segment } from "../../../../utils/parsers/types";
|
|
3
|
-
import { StreamKind } from "../../../../utils/parsers/types";
|
|
4
|
-
import type { ITuningConfig } from "../../../../../utils/tuningConfig";
|
|
5
|
-
import type { Byte, IError, IRange, ISubject, ITracer, IValueSubject, Milliseconds, Seconds } from "@vkontakte/videoplayer-shared";
|
|
6
|
-
import { abortable, Subscription } from "@vkontakte/videoplayer-shared";
|
|
7
|
-
import type { NativeBufferManager } from "../nativeBufferManager";
|
|
8
|
-
import { SwithRepresentationMode, type Dependencies, type IBufferPlaybackQueueItem, type ISomeDataLoadedCallbackParams, type IVirtualBufferManager } from "../types";
|
|
9
|
-
import type { VideoSegmentLoadProgress } from "../../../../utils/Abr/types";
|
|
10
|
-
export declare abstract class BaseVirtualBufferManager<T extends Segment> implements IVirtualBufferManager<T> {
|
|
11
|
-
error$: ISubject<IError>;
|
|
12
|
-
playingRepresentation$: IValueSubject<Representation["id"] | undefined>;
|
|
13
|
-
playingRepresentationInit$: IValueSubject<CommonInit | undefined>;
|
|
14
|
-
currentSegmentLength$: IValueSubject<number>;
|
|
15
|
-
onLastSegment$: IValueSubject<boolean>;
|
|
16
|
-
fullyBuffered$: IValueSubject<boolean>;
|
|
17
|
-
protected readonly kind: StreamKind;
|
|
18
|
-
protected readonly nativeBufferManager: NativeBufferManager;
|
|
19
|
-
protected readonly fetcher: Fetcher;
|
|
20
|
-
protected readonly tracer: ITracer;
|
|
21
|
-
protected readonly tuning: ITuningConfig;
|
|
22
|
-
protected representations: Map<Representation["id"], Representation>;
|
|
23
|
-
protected playingRepresentationId: Representation["id"] | undefined;
|
|
24
|
-
protected downloadingRepresentationId: Representation["id"] | undefined;
|
|
25
|
-
protected switchingRepresentationId: Representation["id"] | null;
|
|
26
|
-
protected initData: Map<Representation["id"], ArrayBuffer>;
|
|
27
|
-
protected initDataPromises: Map<Representation["id"], Promise<RepresentationFetchResult<T> | null | undefined>>;
|
|
28
|
-
protected idleCallbacks: Map<Representation["id"], number>;
|
|
29
|
-
protected parsedInitData: Map<Representation["id"], CommonInit>;
|
|
30
|
-
protected forwardBufferRepresentations: Map<Representation["id"], T[]>;
|
|
31
|
-
protected segments: Map<Representation["id"], T[]>;
|
|
32
|
-
protected containerParser: ContainerParser;
|
|
33
|
-
protected bufferPlaybackQueue: IBufferPlaybackQueueItem<T>[];
|
|
34
|
-
protected downloadingBufferItems: IBufferPlaybackQueueItem<T>[];
|
|
35
|
-
protected preloadOnly: boolean;
|
|
36
|
-
protected forwardBufferTarget: Milliseconds;
|
|
37
|
-
protected failedDownloads: number;
|
|
38
|
-
protected lastDataObtainedTimestampMs: Milliseconds;
|
|
39
|
-
protected loadByteRangeSegmentsTimeoutId: number;
|
|
40
|
-
protected currentVirtualBufferSize: Byte;
|
|
41
|
-
private baseUrls;
|
|
42
|
-
private baseUrlsIndex;
|
|
43
|
-
protected maintainPlaybackBufferMutex: boolean;
|
|
44
|
-
protected maintainNativeBufferMutex: boolean;
|
|
45
|
-
protected bufferClearingMutex: boolean;
|
|
46
|
-
protected abortNativeBufferMutex: boolean;
|
|
47
|
-
protected switchMutex: boolean;
|
|
48
|
-
protected seekMutex: boolean;
|
|
49
|
-
protected destroyAbortController: AbortController;
|
|
50
|
-
protected switchAbortController: AbortController;
|
|
51
|
-
protected downloadAbortController: AbortController;
|
|
52
|
-
protected subscription: Subscription;
|
|
53
|
-
protected readonly getCurrentPosition: () => Milliseconds | undefined;
|
|
54
|
-
protected readonly getCurrentStallDuration: () => Milliseconds | undefined;
|
|
55
|
-
protected constructor(kind: StreamKind, nativeBufferManager: NativeBufferManager, representations: Representation[], { fetcher, tracer, tuning, getCurrentPosition, getCurrentStallDuration, manifest }: Dependencies);
|
|
56
|
-
protected abstract loadItems(itemsToLoad: IBufferPlaybackQueueItem<T>[], representation: Representation, priority?: Priority): Promise<void>;
|
|
57
|
-
protected abstract selectItemsToLoad(): IBufferPlaybackQueueItem<T>[];
|
|
58
|
-
protected abstract prepareFetchParams(items: IBufferPlaybackQueueItem<T>[], representation: Representation): FetchParamsWithUrl;
|
|
59
|
-
protected abstract onSomeDataLoaded(data: ISomeDataLoadedCallbackParams<T>): Promise<void>;
|
|
60
|
-
protected abstract updateRepresentationBaseUrl(representation: Representation, newBaseUrl: string): void;
|
|
61
|
-
startWith: ReturnType<typeof abortable<[Representation["id"]]>>;
|
|
62
|
-
switchTo(newRepresentationId: Representation["id"], mode?: SwithRepresentationMode): Promise<void>;
|
|
63
|
-
protected getSwitchWithAbort(switchToTracer: ITracer): ReturnType<typeof abortable<[Representation["id"], SwithRepresentationMode], void>>;
|
|
64
|
-
prepareSeek(): Promise<void>;
|
|
65
|
-
seek(position: Milliseconds | undefined): Promise<void>;
|
|
66
|
-
maintain(currentPosition?: Milliseconds | undefined): Promise<void>;
|
|
67
|
-
getForwardBufferRepresentations(currentPosition?: Milliseconds | undefined): Map<Representation["id"], T[]>;
|
|
68
|
-
getForwardPlaybackBufferDuration(currentPosition?: Milliseconds | undefined): Milliseconds;
|
|
69
|
-
getPlaybackBufferState(): IRange<Milliseconds> | null;
|
|
70
|
-
abort(): Promise<void>;
|
|
71
|
-
findSegmentStartTime(position: Milliseconds): Milliseconds | undefined;
|
|
72
|
-
getRepresentationInitialTime(): Seconds;
|
|
73
|
-
getMutexInfo(): string;
|
|
74
|
-
calculateDurationFromSegments(): Milliseconds;
|
|
75
|
-
getActiveSegmentProgress(): VideoSegmentLoadProgress | undefined;
|
|
76
|
-
getMpdSegmentDuration(): Milliseconds | undefined;
|
|
77
|
-
get lastDataObtainedTimestamp(): Milliseconds;
|
|
78
|
-
setTarget(time: Milliseconds): void;
|
|
79
|
-
setPreloadOnly(preloadOnly: boolean): void;
|
|
80
|
-
destroy(): void;
|
|
81
|
-
protected verifyBufferPlaybackQueue(position: Milliseconds): Promise<void>;
|
|
82
|
-
protected forceSwitchCondition(oldRepresentation: Representation, newRepresentation: Representation): boolean;
|
|
83
|
-
protected clearBuffer(): Promise<void>;
|
|
84
|
-
protected abortDownload(): void;
|
|
85
|
-
protected abortDownloadingItems(): void;
|
|
86
|
-
protected abortNativeBuffer(): Promise<boolean>;
|
|
87
|
-
protected loadInits(): Promise<void>;
|
|
88
|
-
protected loadInitIfNeeded(representation: Representation, requestedPriority?: Priority, critical?: boolean): Promise<void>;
|
|
89
|
-
protected loadInit(representation: Representation, requestedPriority?: Priority, critical?: boolean): Promise<void>;
|
|
90
|
-
private isMaintainNativeBufferMutexActive;
|
|
91
|
-
protected maintainNativeBuffer(): Promise<void>;
|
|
92
|
-
protected maintainPlaybackBuffer(position: Milliseconds): Promise<void>;
|
|
93
|
-
protected actualizeLastSegmentInfo(currentPosition: Milliseconds): void;
|
|
94
|
-
protected selectDownloadingItems(position: Milliseconds, segments: T[]): IBufferPlaybackQueueItem<T>[];
|
|
95
|
-
protected processCachedItems(): Promise<void>;
|
|
96
|
-
protected withinInterval(currentPosition: Milliseconds | undefined, { from, to }: IRange<Milliseconds>, leftTolerance?: Milliseconds, rightTolerance?: Milliseconds): boolean;
|
|
97
|
-
protected withinAppendInterval(currentPosition: Milliseconds | undefined, { from, to }: IRange<Milliseconds>): boolean;
|
|
98
|
-
protected withinRemoveInterval(currentPosition: Milliseconds | undefined, { to }: IRange<Milliseconds>): boolean;
|
|
99
|
-
protected getExponentialDownloadDelay(): ReturnType<typeof abortable>;
|
|
100
|
-
protected waitExponentialDownloadDelay(): Promise<void>;
|
|
101
|
-
protected appendSegmentFully(nextPlayingItem: IBufferPlaybackQueueItem<T>, signal: AbortSignal): Promise<void>;
|
|
102
|
-
protected appendSegmentPartially(nextPlayingItem: IBufferPlaybackQueueItem<T>, signal: AbortSignal): Promise<void>;
|
|
103
|
-
protected parseFeedableSegmentChunk(chunk: DataView): DataView | null;
|
|
104
|
-
protected onItemFullyDownloaded(downloadedItem: IBufferPlaybackQueueItem<T>): void;
|
|
105
|
-
protected onItemFullyAppended(appendedItem: IBufferPlaybackQueueItem<T>): void;
|
|
106
|
-
protected removeSegment(nextRemoveItem: IBufferPlaybackQueueItem<T>, signal: AbortSignal): Promise<void>;
|
|
107
|
-
protected onDownloadItem(downloadedItem: IBufferPlaybackQueueItem<T>): Promise<void>;
|
|
108
|
-
protected pruneVirtualBuffer(currentPosition: Milliseconds): void;
|
|
109
|
-
protected updateRepresentationsBaseUrlIfNeeded(): void;
|
|
110
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { BaseVirtualBufferManager } from "./baseVirtualBufferManager";
|
|
2
|
-
import type { Dependencies, IBufferPlaybackQueueItem, ISomeDataLoadedCallbackParams, IVirtualBufferManager } from "../types";
|
|
3
|
-
import type { ByteRangeSegment, Representation, StreamKind } from "../../../../utils/parsers/types";
|
|
4
|
-
import type { NativeBufferManager } from "../nativeBufferManager";
|
|
5
|
-
import type { FetchParamsWithUrl, Priority } from "../../fetcher";
|
|
6
|
-
export declare class ByteRangeVirtualBufferManager extends BaseVirtualBufferManager<ByteRangeSegment> implements IVirtualBufferManager<ByteRangeSegment> {
|
|
7
|
-
constructor(kind: StreamKind, nativeBufferManager: NativeBufferManager, representations: Representation[], dependencies: Dependencies);
|
|
8
|
-
protected override loadItems(itemsToLoad: IBufferPlaybackQueueItem<ByteRangeSegment>[], representation: Representation, priority?: Priority): Promise<void>;
|
|
9
|
-
protected override selectItemsToLoad(): IBufferPlaybackQueueItem<ByteRangeSegment>[];
|
|
10
|
-
protected override prepareFetchParams(items: IBufferPlaybackQueueItem<ByteRangeSegment>[], representation: Representation): FetchParamsWithUrl;
|
|
11
|
-
/**
|
|
12
|
-
* Закидываем в буфер сегменты атомарнее чем сегмент целиком. Например, по боксам в мпеге и по блокам в вебме.
|
|
13
|
-
* Таким образом не ждём его полной загрузки и готовы играть его намного быстрее
|
|
14
|
-
* @param dataView – данные, размер буфера – весь запрос
|
|
15
|
-
* @param globalFrom – Отступ dataView от начала файла, совпадает с отсупами сегментов
|
|
16
|
-
* @param loaded – Объём загруженных в dataView данных (всё что больше – пока нули)
|
|
17
|
-
* @private
|
|
18
|
-
*/
|
|
19
|
-
protected override onSomeDataLoaded({ downloadingItems, dataView, representationId, globalFrom, loaded, signal }: ISomeDataLoadedCallbackParams<ByteRangeSegment>): Promise<void>;
|
|
20
|
-
protected override updateRepresentationBaseUrl(representation: Representation, newBaseUrl: string): void;
|
|
21
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { BaseVirtualBufferManager } from "./baseVirtualBufferManager";
|
|
2
|
-
import type { Dependencies, IBufferPlaybackQueueItem, ISomeDataLoadedCallbackParams, IVirtualBufferManager } from "../types";
|
|
3
|
-
import type { TemplateSegment, Representation, StreamKind } from "../../../../utils/parsers/types";
|
|
4
|
-
import type { NativeBufferManager } from "../nativeBufferManager";
|
|
5
|
-
import type { FetchParamsWithUrl, Priority } from "../../fetcher";
|
|
6
|
-
export declare class TemplateVirtualBufferManager extends BaseVirtualBufferManager<TemplateSegment> implements IVirtualBufferManager<TemplateSegment> {
|
|
7
|
-
constructor(kind: StreamKind, nativeBufferManager: NativeBufferManager, representations: Representation[], dependencies: Dependencies);
|
|
8
|
-
protected override loadItems(itemsToLoad: IBufferPlaybackQueueItem<TemplateSegment>[], representation: Representation, priority?: Priority): Promise<void>;
|
|
9
|
-
protected override selectItemsToLoad(): IBufferPlaybackQueueItem<TemplateSegment>[];
|
|
10
|
-
protected override prepareFetchParams(items: IBufferPlaybackQueueItem<TemplateSegment>[], representation: Representation): FetchParamsWithUrl;
|
|
11
|
-
protected getFetchUrl(items: IBufferPlaybackQueueItem<TemplateSegment>[], representation: Representation): URL;
|
|
12
|
-
/**
|
|
13
|
-
* Закидываем в буфер сегменты атомарнее чем сегмент целиком. Например, по боксам в мпеге и по блокам в вебме.
|
|
14
|
-
* Таким образом не ждём его полной загрузки и готовы играть его намного быстрее
|
|
15
|
-
* @param dataView – данные, размер буфера – весь запрос
|
|
16
|
-
* @param loaded – Объём загруженных в dataView данных (всё что больше – пока нули)
|
|
17
|
-
* @private
|
|
18
|
-
*/
|
|
19
|
-
protected override onSomeDataLoaded({ downloadingItems, dataView, representationId, loaded, signal }: ISomeDataLoadedCallbackParams<TemplateSegment>): Promise<void>;
|
|
20
|
-
protected override updateRepresentationBaseUrl(representation: Representation, newBaseUrl: string): void;
|
|
21
|
-
}
|