@vkontakte/videoplayer-core 2.0.155 → 2.0.156-dev.04ce2cd1.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 +83 -136
- package/es2015.esm.js +77 -130
- package/es2018.cjs +77 -130
- package/es2018.esm.js +75 -128
- package/es2024.cjs +83 -136
- package/es2024.esm.js +81 -134
- package/esnext.cjs +83 -136
- package/esnext.esm.js +81 -134
- package/evergreen.esm.js +82 -135
- package/package.json +2 -2
- package/types/enums/AndroidPreferredFormat.d.ts +6 -6
- package/types/enums/IOSPreferredFormat.d.ts +2 -2
- package/types/enums/WebmCodecStrategy.d.ts +5 -5
- package/types/index.d.ts +16 -13
- package/types/player/Player.d.ts +219 -210
- package/types/player/types.d.ts +595 -591
- package/types/player/utils/optimisticPosition.d.ts +7 -7
- package/types/player/utils/selectContainer.d.ts +1 -1
- package/types/providers/ChromecastPresentationApiProvider/ChromecastPresentationApiConnector.d.ts +107 -106
- package/types/providers/ChromecastPresentationApiProvider/ChromecastPresentationApiInitializer.d.ts +23 -23
- package/types/providers/ChromecastPresentationApiProvider/ChromecastPresentationApiProvider.d.ts +34 -34
- package/types/providers/ChromecastPresentationApiProvider/ProgressTicker.d.ts +9 -9
- package/types/providers/ChromecastPresentationApiProvider/index.d.ts +3 -3
- package/types/providers/ChromecastPresentationApiProvider/types.d.ts +31 -31
- package/types/providers/ChromecastPresentationApiProvider/utils.d.ts +1 -1
- package/types/providers/ChromecastProvider/ChromecastInitializer/index.d.ts +22 -22
- package/types/providers/ChromecastProvider/ChromecastInitializer/types.d.ts +22 -22
- package/types/providers/ChromecastProvider/index.d.ts +23 -23
- package/types/providers/ChromecastProvider/types.d.ts +7 -7
- package/types/providers/ChromecastProvider/utils.d.ts +1 -1
- package/types/providers/DashLiveProvider/DashLiveProvider.d.ts +33 -33
- package/types/providers/DashLiveProvider/index.d.ts +1 -1
- package/types/providers/DashLiveProvider/types.d.ts +17 -17
- package/types/providers/DashLiveProvider/utils/FilesFetcher.d.ts +23 -23
- package/types/providers/DashLiveProvider/utils/LiveDashPlayer.d.ts +149 -150
- package/types/providers/DashLiveProvider/utils/ThroughputEstimator.d.ts +12 -30
- package/types/providers/DashLiveProvider/utils/liveDashPlayerUtil.d.ts +19 -22
- package/types/providers/DashProvider/baseDashProvider.d.ts +57 -56
- package/types/providers/DashProvider/dashCmafLiveProvider.d.ts +6 -6
- package/types/providers/DashProvider/dashProvider.d.ts +4 -4
- package/types/providers/DashProvider/index.d.ts +2 -2
- package/types/providers/DashProvider/lib/ElementSizeManager.d.ts +14 -14
- package/types/providers/DashProvider/lib/LiveTextManager.d.ts +21 -21
- package/types/providers/DashProvider/lib/buffer.d.ts +123 -122
- package/types/providers/DashProvider/lib/fetcher.d.ts +70 -69
- package/types/providers/DashProvider/lib/player.d.ts +109 -107
- package/types/providers/DashProvider/lib/sourceBufferTaskQueue.d.ts +17 -17
- package/types/providers/DashProvider/lib/types.d.ts +20 -20
- package/types/providers/DashProvider/lib/utils.d.ts +4 -4
- package/types/providers/DashProviderVirtual/baseDashProvider.d.ts +58 -57
- package/types/providers/DashProviderVirtual/consts.d.ts +2 -2
- package/types/providers/DashProviderVirtual/dashCmafLiveProvider.d.ts +8 -8
- package/types/providers/DashProviderVirtual/dashProvider.d.ts +6 -6
- package/types/providers/DashProviderVirtual/index.d.ts +2 -2
- package/types/providers/DashProviderVirtual/lib/ElementSizeManager.d.ts +15 -14
- package/types/providers/DashProviderVirtual/lib/LiveTextManager.d.ts +21 -21
- package/types/providers/DashProviderVirtual/lib/buffer/nativeBufferManager.d.ts +17 -17
- package/types/providers/DashProviderVirtual/lib/buffer/sourceBufferTaskQueue.d.ts +17 -17
- package/types/providers/DashProviderVirtual/lib/buffer/types.d.ts +39 -39
- package/types/providers/DashProviderVirtual/lib/buffer/virtualBuffer/baseVirtualBufferManager.d.ts +94 -92
- package/types/providers/DashProviderVirtual/lib/buffer/virtualBuffer/byteRangeVirtualBufferManager.d.ts +19 -19
- package/types/providers/DashProviderVirtual/lib/buffer/virtualBuffer/liveVirtualBuffer.d.ts +25 -25
- package/types/providers/DashProviderVirtual/lib/buffer/virtualBuffer/templateVirtualBufferManager.d.ts +19 -19
- package/types/providers/DashProviderVirtual/lib/buffer/virtualBuffer/virtualBufferFactory.d.ts +4 -4
- package/types/providers/DashProviderVirtual/lib/fetcher.d.ts +68 -67
- package/types/providers/DashProviderVirtual/lib/player/basePlayer.d.ts +103 -100
- package/types/providers/DashProviderVirtual/lib/player/livePlayer.d.ts +34 -34
- package/types/providers/DashProviderVirtual/lib/player/player.d.ts +9 -9
- package/types/providers/DashProviderVirtual/lib/player/types.d.ts +13 -13
- package/types/providers/DashProviderVirtual/lib/types.d.ts +20 -20
- package/types/providers/DashProviderVirtual/lib/utils.d.ts +4 -4
- package/types/providers/HlsLiveProvider/LiveTextManager.d.ts +35 -35
- package/types/providers/HlsLiveProvider/index.d.ts +29 -28
- package/types/providers/HlsLiveProvider/seekBackTimeExtractor.d.ts +1 -1
- package/types/providers/HlsProvider/index.d.ts +19 -19
- package/types/providers/HlsProvider/manifestDataExtractor.d.ts +13 -13
- package/types/providers/MpegProvider/index.d.ts +17 -17
- package/types/providers/ProviderContainer/index.d.ts +47 -45
- package/types/providers/ProviderContainer/types.d.ts +16 -16
- package/types/providers/ProviderContainer/utils/formatsSupport.d.ts +9 -9
- package/types/providers/ProviderContainer/utils/playbackHangup.d.ts +9 -8
- package/types/providers/WebRTCLiveProvider/WebRTCLiveClient.d.ts +185 -185
- package/types/providers/WebRTCLiveProvider/WebRTCLiveProvider.d.ts +58 -57
- package/types/providers/WebRTCLiveProvider/interface/WebRTCLiveClientOptions.d.ts +6 -6
- package/types/providers/types.d.ts +103 -102
- package/types/providers/utils/HTMLVideoElement/DroppedFramesManager.d.ts +40 -39
- package/types/providers/utils/HTMLVideoElement/TextTrackManager.d.ts +28 -28
- package/types/providers/utils/HTMLVideoElement/forcePlay.d.ts +5 -5
- package/types/providers/utils/HTMLVideoElement/observable.d.ts +25 -25
- package/types/providers/utils/HTMLVideoElement/pool.d.ts +5 -4
- package/types/providers/utils/LiveOffset/index.d.ts +12 -12
- package/types/providers/utils/LiveOffset/types.d.ts +8 -8
- package/types/providers/utils/StallsManager.d.ts +49 -49
- package/types/providers/utils/debug.d.ts +13 -12
- package/types/providers/utils/extractConnectionHeaders.d.ts +3 -3
- package/types/providers/utils/generateLiveUrl.d.ts +4 -4
- package/types/providers/utils/guessNetworkErrorCause.d.ts +1 -1
- package/types/providers/utils/mergeIntervals.d.ts +1 -1
- package/types/providers/utils/okQualityStringToVideoQuality.d.ts +1 -1
- package/types/providers/utils/parsers/ietf/index.d.ts +8 -8
- package/types/providers/utils/parsers/index.d.ts +1 -1
- package/types/providers/utils/parsers/mpd.d.ts +1 -1
- package/types/providers/utils/parsers/mpeg/BoxModel.d.ts +18 -17
- package/types/providers/utils/parsers/mpeg/BoxParser.d.ts +15 -15
- package/types/providers/utils/parsers/mpeg/BoxTypeEnum.d.ts +27 -27
- package/types/providers/utils/parsers/mpeg/box.d.ts +68 -68
- package/types/providers/utils/parsers/mpeg/boxes/avc1.d.ts +5 -5
- package/types/providers/utils/parsers/mpeg/boxes/equi.d.ts +18 -18
- package/types/providers/utils/parsers/mpeg/boxes/ftyp.d.ts +14 -14
- package/types/providers/utils/parsers/mpeg/boxes/index.d.ts +27 -26
- package/types/providers/utils/parsers/mpeg/boxes/mdat.d.ts +12 -12
- package/types/providers/utils/parsers/mpeg/boxes/mdia.d.ts +5 -5
- package/types/providers/utils/parsers/mpeg/boxes/mfhd.d.ts +8 -8
- package/types/providers/utils/parsers/mpeg/boxes/minf.d.ts +5 -5
- package/types/providers/utils/parsers/mpeg/boxes/moof.d.ts +5 -5
- package/types/providers/utils/parsers/mpeg/boxes/moov.d.ts +5 -5
- package/types/providers/utils/parsers/mpeg/boxes/mvhd.d.ts +32 -32
- package/types/providers/utils/parsers/mpeg/boxes/prhd.d.ts +13 -13
- package/types/providers/utils/parsers/mpeg/boxes/proj.d.ts +5 -5
- package/types/providers/utils/parsers/mpeg/boxes/sidx.d.ts +43 -43
- package/types/providers/utils/parsers/mpeg/boxes/st3d.d.ts +16 -16
- package/types/providers/utils/parsers/mpeg/boxes/stbl.d.ts +5 -5
- package/types/providers/utils/parsers/mpeg/boxes/stsd.d.ts +8 -8
- package/types/providers/utils/parsers/mpeg/boxes/sv3d.d.ts +5 -5
- package/types/providers/utils/parsers/mpeg/boxes/tfdt.d.ts +14 -14
- package/types/providers/utils/parsers/mpeg/boxes/tfhd.d.ts +19 -19
- package/types/providers/utils/parsers/mpeg/boxes/tkhd.d.ts +39 -39
- package/types/providers/utils/parsers/mpeg/boxes/traf.d.ts +5 -5
- package/types/providers/utils/parsers/mpeg/boxes/trak.d.ts +5 -5
- package/types/providers/utils/parsers/mpeg/boxes/trun.d.ts +28 -28
- package/types/providers/utils/parsers/mpeg/boxes/unknown.d.ts +4 -5
- package/types/providers/utils/parsers/mpeg/boxes/uuid.d.ts +10 -10
- package/types/providers/utils/parsers/mpeg/fullBox.d.ts +12 -12
- package/types/providers/utils/parsers/mpeg/isobmff.d.ts +7 -7
- package/types/providers/utils/parsers/types.d.ts +137 -139
- package/types/providers/utils/parsers/webm/ebml.d.ts +62 -62
- package/types/providers/utils/parsers/webm/webm.d.ts +1 -1
- package/types/providers/utils/restorePlaybackRateInSafari.d.ts +17 -17
- package/types/providers/utils/syncDesiredState.d.ts +10 -10
- package/types/providers/utils/syncPlaybackState.d.ts +2 -2
- package/types/providers/utils/videoStreamRepresentaionsFilter.d.ts +2 -2
- package/types/utils/3d/Camera3D.d.ts +11 -11
- package/types/utils/3d/CameraRotationManager.d.ts +59 -59
- package/types/utils/3d/Scene3D.d.ts +129 -129
- package/types/utils/3d/types.d.ts +14 -14
- package/types/utils/ClientChecker/ClientChecker.d.ts +19 -19
- package/types/utils/ClientChecker/index.d.ts +2 -2
- package/types/utils/ClientChecker/services/AudioChecker.d.ts +7 -7
- package/types/utils/ClientChecker/services/BrowserChecker.d.ts +36 -36
- package/types/utils/ClientChecker/services/DeviceChecker.d.ts +38 -38
- package/types/utils/ClientChecker/services/DisplayChecker.d.ts +20 -20
- package/types/utils/ClientChecker/services/VideoChecker.d.ts +35 -35
- package/types/utils/ClientChecker/types/checker.d.ts +1 -1
- package/types/utils/ClientChecker/types/currentClientBrowser.d.ts +10 -10
- package/types/utils/ClientChecker/types/currentClientDevice.d.ts +8 -8
- package/types/utils/ClientChecker/types/userAgentData.d.ts +21 -21
- package/types/utils/StateMachine/StateMachine.d.ts +17 -17
- package/types/utils/StateMachine/types.d.ts +56 -56
- package/types/utils/StatefulIterator/index.d.ts +13 -13
- package/types/utils/ThroughputEstimator.d.ts +22 -22
- package/types/utils/VolumeMultiplierManager/VolumeMultiplierManager.d.ts +20 -20
- package/types/utils/VolumeMultiplierManager/index.d.ts +1 -1
- package/types/utils/autoSelectTrack.d.ts +28 -27
- package/types/utils/buffer/createTimeRanges.d.ts +2 -1
- package/types/utils/buffer/getBufferedRangeForPosition.d.ts +2 -2
- package/types/utils/buffer/getForwardBufferDuration.d.ts +1 -1
- package/types/utils/buffer/getTotalBufferDuration.d.ts +1 -1
- package/types/utils/buffer/isPositionBuffered.d.ts +1 -1
- package/types/utils/buffer/isSourceBufferValid.d.ts +1 -1
- package/types/utils/changePlaybackRate.d.ts +1 -1
- package/types/utils/decodingInfoLogger.d.ts +1 -1
- package/types/utils/mediaSource.d.ts +1 -5
- package/types/utils/observeElementVisibility.d.ts +1 -1
- package/types/utils/playbackTelemetry.d.ts +4 -4
- package/types/utils/playerOptions.d.ts +3 -3
- package/types/utils/qualityLimits.d.ts +15 -14
- package/types/utils/setStateWithSubscribe.d.ts +6 -3
- package/types/utils/smoothedValue/baseSmoothedValue.d.ts +16 -16
- package/types/utils/smoothedValue/emaAndMaSmoothedValue.d.ts +5 -5
- package/types/utils/smoothedValue/emaTopExtremumValue.d.ts +8 -8
- package/types/utils/smoothedValue/smoothedValueFactory.d.ts +4 -4
- package/types/utils/smoothedValue/twoEmaSmoothedValue.d.ts +6 -6
- package/types/utils/smoothedValue/types.d.ts +16 -16
- package/types/utils/tuningConfig.d.ts +304 -287
- package/types/utils/videoFormat.d.ts +1 -1
|
@@ -1,83 +1,84 @@
|
|
|
1
|
-
import { HttpConnectionType, HttpConnectionMetrics, HttpDownloadMetrics } from
|
|
2
|
-
import type ThroughputEstimator from
|
|
3
|
-
import { Byte, IValueSubject, ISubject, Milliseconds, IRange, ITracer, IError } from
|
|
4
|
-
import {
|
|
1
|
+
import type { HttpConnectionType, HttpConnectionMetrics, HttpDownloadMetrics } from "../../../player/types";
|
|
2
|
+
import type ThroughputEstimator from "../../../utils/ThroughputEstimator";
|
|
3
|
+
import type { Byte, IValueSubject, ISubject, Milliseconds, IRange, ITracer, IError } from "@vkontakte/videoplayer-shared";
|
|
4
|
+
import { abortable } from "@vkontakte/videoplayer-shared";
|
|
5
|
+
import type { CommonInit, GenericContainerParser, Segment, SegmentReference } from "../../utils/parsers/types";
|
|
5
6
|
declare global {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
interface Navigator {
|
|
8
|
+
connection: {
|
|
9
|
+
effectiveType: string;
|
|
10
|
+
downlink: number;
|
|
11
|
+
rtt: number;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
13
14
|
}
|
|
14
15
|
export declare enum RangeMethod {
|
|
15
|
-
|
|
16
|
-
|
|
16
|
+
HEADER = 0,
|
|
17
|
+
PARAM = 1
|
|
17
18
|
}
|
|
18
19
|
export interface IParams {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
throughputEstimator?: ThroughputEstimator;
|
|
21
|
+
requestQuic: boolean;
|
|
22
|
+
compatibilityMode?: boolean;
|
|
23
|
+
tracer: ITracer;
|
|
24
|
+
useEnableSubtitlesParam?: boolean;
|
|
24
25
|
}
|
|
25
|
-
export type Priority =
|
|
26
|
+
export type Priority = "high" | "low" | "auto";
|
|
26
27
|
export interface FetchParamsWithUrl extends FetchParams {
|
|
27
|
-
|
|
28
|
+
url: string;
|
|
28
29
|
}
|
|
29
30
|
export interface FetchParams {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
31
|
+
range?: IRange<Byte>;
|
|
32
|
+
rangeMethod?: RangeMethod;
|
|
33
|
+
onProgress?: (dataView: DataView, loaded: number) => void;
|
|
34
|
+
onProgressTasks?: Promise<void>[];
|
|
35
|
+
signal?: AbortSignal;
|
|
36
|
+
priority?: Priority;
|
|
37
|
+
measureThroughput?: boolean;
|
|
38
|
+
isLowLatency?: boolean;
|
|
39
|
+
bufferOptimisation?: boolean;
|
|
40
|
+
ignoreNetworkErrors?: boolean;
|
|
40
41
|
}
|
|
41
42
|
export type RepresentationFetchResult = {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
43
|
+
init: CommonInit | null;
|
|
44
|
+
segments: Segment[];
|
|
45
|
+
dataView: DataView;
|
|
45
46
|
};
|
|
46
47
|
export declare class Fetcher {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
48
|
+
private throughputEstimator;
|
|
49
|
+
private requestQuic;
|
|
50
|
+
private tracer;
|
|
51
|
+
manifestRequested$: ISubject<void>;
|
|
52
|
+
firstBytesManifest$: ISubject<void>;
|
|
53
|
+
firstBytesRequested$: ISubject<void>;
|
|
54
|
+
firstBytesReceived$: ISubject<void>;
|
|
55
|
+
lastConnectionType$: IValueSubject<HttpConnectionType | undefined>;
|
|
56
|
+
lastConnectionReused$: IValueSubject<boolean | undefined>;
|
|
57
|
+
lastRequestFirstBytes$: IValueSubject<Milliseconds | undefined>;
|
|
58
|
+
lastConnectionMetrics$: IValueSubject<HttpConnectionMetrics | undefined>;
|
|
59
|
+
lastDownloadMetrics$: IValueSubject<HttpDownloadMetrics | undefined>;
|
|
60
|
+
recoverableError$: ISubject<IError>;
|
|
61
|
+
error$: ISubject<IError>;
|
|
62
|
+
private abortAllController;
|
|
63
|
+
private readonly subscription;
|
|
64
|
+
private compatibilityMode;
|
|
65
|
+
private useEnableSubtitlesParam;
|
|
66
|
+
private performanceObserver;
|
|
67
|
+
private pendingConnectionMetrics;
|
|
68
|
+
constructor({ throughputEstimator, requestQuic, tracer, compatibilityMode, useEnableSubtitlesParam }: IParams);
|
|
69
|
+
private onHeadersReceived;
|
|
70
|
+
private setupPerformanceObserver;
|
|
71
|
+
private processPerformanceResourceTiming;
|
|
72
|
+
private estimateNetworkType;
|
|
73
|
+
private extractConnectionMetrics;
|
|
74
|
+
private findMatchingRequest;
|
|
75
|
+
private trackRequestStart;
|
|
76
|
+
fetchManifest: ReturnType<typeof abortable<[string], string | null>>;
|
|
77
|
+
fetch: ReturnType<typeof abortable<[string, FetchParams], ArrayBuffer | null>>;
|
|
78
|
+
fetchRepresentation(segmentReference: SegmentReference, parser: GenericContainerParser<unknown>, fetchParams: FetchParams): Promise<RepresentationFetchResult | null>;
|
|
79
|
+
destroy(): void;
|
|
80
|
+
private fetchByteRangeRepresentation;
|
|
81
|
+
private fetchTemplateRepresentation;
|
|
82
|
+
private doFetch;
|
|
83
|
+
private unsubscribeAbortSubscription;
|
|
83
84
|
}
|
|
@@ -1,113 +1,115 @@
|
|
|
1
|
-
import { HttpConnectionType, HttpConnectionMetrics, HttpDownloadMetrics, VideoCodec } from
|
|
2
|
-
import { LiveStreamStatus } from
|
|
3
|
-
import { CommonInit, Manifest, Representation,
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
1
|
+
import type { IHLSSource, HttpConnectionType, HttpConnectionMetrics, HttpDownloadMetrics, VideoCodec } from "../../../player/types";
|
|
2
|
+
import { LiveStreamStatus } from "./types";
|
|
3
|
+
import type { CommonInit, Manifest, Representation, TextRepresentation } from "../../utils/parsers/types";
|
|
4
|
+
import { StreamKind } from "../../utils/parsers/types";
|
|
5
|
+
import StateMachine from "../../../utils/StateMachine/StateMachine";
|
|
6
|
+
import type ThroughputEstimator from "../../../utils/ThroughputEstimator";
|
|
7
|
+
import type { ITuningConfig } from "../../../utils/tuningConfig";
|
|
8
|
+
import type { IError, ISubject, ITracer, IValueSubject, Milliseconds } from "@vkontakte/videoplayer-shared";
|
|
9
|
+
import { abortable, Subject } from "@vkontakte/videoplayer-shared";
|
|
8
10
|
export declare enum State {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
NONE = "none",
|
|
12
|
+
MANIFEST_READY = "manifest_ready",
|
|
13
|
+
REPRESENTATIOS_READY = "representations_ready",
|
|
14
|
+
RUNNING = "running"
|
|
13
15
|
}
|
|
14
16
|
export interface Params {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
throughputEstimator: ThroughputEstimator;
|
|
18
|
+
tuning: ITuningConfig;
|
|
19
|
+
compatibilityMode?: boolean;
|
|
20
|
+
forceVideoCodec?: VideoCodec;
|
|
21
|
+
tracer: ITracer;
|
|
20
22
|
}
|
|
21
23
|
export declare class Player {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
24
|
+
private element;
|
|
25
|
+
private manifestUrlString;
|
|
26
|
+
private source;
|
|
27
|
+
private manifest;
|
|
28
|
+
private tuning;
|
|
29
|
+
private tracer;
|
|
30
|
+
private forceVideoCodec?;
|
|
31
|
+
private videoBufferManager;
|
|
32
|
+
private audioBufferManager;
|
|
33
|
+
private bufferManagers;
|
|
34
|
+
private liveTextManager;
|
|
35
|
+
private throughputEstimator;
|
|
36
|
+
private subscription;
|
|
37
|
+
private subscriptionRemovable;
|
|
38
|
+
private representationSubscription;
|
|
39
|
+
private fetcher;
|
|
40
|
+
state$: StateMachine<State>;
|
|
41
|
+
currentVideoRepresentation$: IValueSubject<Representation["id"] | undefined>;
|
|
42
|
+
currentVideoRepresentationInit$: IValueSubject<CommonInit | undefined>;
|
|
43
|
+
currentAudioRepresentation$: IValueSubject<Representation["id"] | undefined>;
|
|
44
|
+
currentVideoSegmentLength$: IValueSubject<number>;
|
|
45
|
+
currentAudioSegmentLength$: IValueSubject<number>;
|
|
46
|
+
error$: ISubject<IError>;
|
|
47
|
+
manifestRequested$: ISubject<void>;
|
|
48
|
+
firstBytesManifest$: ISubject<void>;
|
|
49
|
+
manifestReceived$: ISubject<void>;
|
|
50
|
+
firstBytesRequested$: ISubject<void>;
|
|
51
|
+
firstBytesReceived$: ISubject<void>;
|
|
52
|
+
lastConnectionType$: IValueSubject<HttpConnectionType | undefined>;
|
|
53
|
+
lastConnectionReused$: IValueSubject<boolean | undefined>;
|
|
54
|
+
lastRequestFirstBytes$: IValueSubject<Milliseconds | undefined>;
|
|
55
|
+
lastConnectionMetrics$: IValueSubject<HttpConnectionMetrics | undefined>;
|
|
56
|
+
lastDownloadMetrics$: IValueSubject<HttpDownloadMetrics | undefined>;
|
|
57
|
+
currentLiveTextRepresentation$: IValueSubject<TextRepresentation | null>;
|
|
58
|
+
private timeoutSourceOpenId;
|
|
59
|
+
isLive$: IValueSubject<boolean>;
|
|
60
|
+
isActiveLive$: IValueSubject<boolean>;
|
|
61
|
+
isLowLatency$: IValueSubject<boolean>;
|
|
62
|
+
liveDuration$: IValueSubject<Milliseconds>;
|
|
63
|
+
liveSeekableDuration$: IValueSubject<Milliseconds>;
|
|
64
|
+
liveAvailabilityStartTime$: IValueSubject<Milliseconds>;
|
|
65
|
+
liveStreamStatus$: IValueSubject<LiveStreamStatus | undefined>;
|
|
66
|
+
bufferLength$: IValueSubject<Milliseconds>;
|
|
67
|
+
liveLatency$: IValueSubject<Milliseconds | undefined>;
|
|
68
|
+
liveLoadBufferLength$: IValueSubject<Milliseconds>;
|
|
69
|
+
livePositionFromPlayer$: IValueSubject<number>;
|
|
70
|
+
currentStallDuration$: IValueSubject<Milliseconds>;
|
|
71
|
+
videoLastDataObtainedTimestamp$: IValueSubject<Milliseconds>;
|
|
72
|
+
fetcherRecoverableError$: Subject<IError>;
|
|
73
|
+
fetcherError$: Subject<IError>;
|
|
74
|
+
private liveStreamEndTimestamp;
|
|
75
|
+
private liveBuffer;
|
|
76
|
+
private isUpdatingLive;
|
|
77
|
+
private isJumpGapAfterSeekLive;
|
|
78
|
+
private forceEnded$;
|
|
79
|
+
private gapWatchdogActive;
|
|
80
|
+
private gapWatchdogSubscription;
|
|
81
|
+
private stallWatchdogSubscription;
|
|
82
|
+
private livePauseWatchdogSubscription;
|
|
83
|
+
private liveWasInterrupted;
|
|
84
|
+
private destroyController;
|
|
85
|
+
constructor(params: Params);
|
|
86
|
+
initManifest: ReturnType<typeof abortable<[HTMLVideoElement, string, number]>>;
|
|
87
|
+
updateManifest: ReturnType<typeof abortable<[], Manifest | null>>;
|
|
88
|
+
setSmartRepresentationSwitch(state: boolean): void;
|
|
89
|
+
seekLive(nextOffset: Milliseconds): Promise<void>;
|
|
90
|
+
private updateManifestUrlWithTimeOffset;
|
|
91
|
+
private updateLiveBuffersFromManifest;
|
|
92
|
+
private stopStallWatchdogSubscription;
|
|
93
|
+
initRepresentations: ReturnType<typeof abortable<[Representation["id"], Representation["id"] | undefined, IHLSSource | undefined]>>;
|
|
94
|
+
initBuffer(): void;
|
|
95
|
+
switchRepresentation(kind: StreamKind, id: Representation["id"], dropBuffer?: boolean): Promise<void>;
|
|
96
|
+
seek(requestedPosition: Milliseconds, forcePrecise: boolean): Promise<void>;
|
|
97
|
+
warmUpMediaSourceIfNeeded(position?: Milliseconds | undefined): void;
|
|
98
|
+
get isStreamEnded(): boolean;
|
|
99
|
+
stop(): void;
|
|
100
|
+
setBufferTarget(time: Milliseconds): void;
|
|
101
|
+
getStreams(): Manifest["streams"] | undefined;
|
|
102
|
+
getCodecs(): Manifest["codecs"] | undefined;
|
|
103
|
+
setPreloadOnly(preloadOnly: boolean): void;
|
|
104
|
+
destroy(): void;
|
|
105
|
+
private initTracerSubscription;
|
|
106
|
+
private isManualDecreasePlaybackInLive;
|
|
107
|
+
private normalizeLiveOffset;
|
|
108
|
+
private tick;
|
|
109
|
+
private updateLive;
|
|
110
|
+
private jumpGap;
|
|
111
|
+
/**
|
|
112
|
+
* Возвращает duration в милисекундах.
|
|
113
|
+
*/
|
|
114
|
+
calculateDurationFromSegments(): number;
|
|
113
115
|
}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { Byte, IError, ISubject, Milliseconds } from
|
|
1
|
+
import type { Byte, IError, ISubject, Milliseconds } from "@vkontakte/videoplayer-shared";
|
|
2
2
|
declare class SourceBufferTaskQueue {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
3
|
+
bufferFull$: ISubject<Byte>;
|
|
4
|
+
error$: ISubject<IError>;
|
|
5
|
+
private buffer;
|
|
6
|
+
private queue;
|
|
7
|
+
private currentTask;
|
|
8
|
+
private destroyed;
|
|
9
|
+
private abortRequested;
|
|
10
|
+
private isAbortFixEnabled;
|
|
11
|
+
constructor(buffer: SourceBuffer, isAbortFixEnabled?: boolean);
|
|
12
|
+
append(data: BufferSource, signal?: AbortSignal): Promise<boolean>;
|
|
13
|
+
remove(from: Milliseconds, to: Milliseconds, signal?: AbortSignal): Promise<boolean>;
|
|
14
|
+
abort(init?: BufferSource): Promise<boolean>;
|
|
15
|
+
destroy(): void;
|
|
16
|
+
private completeTask;
|
|
17
|
+
private pull;
|
|
18
|
+
private execute;
|
|
19
19
|
}
|
|
20
20
|
export default SourceBufferTaskQueue;
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import { IObservable, ISubject, IValueSubject } from
|
|
2
|
-
import { IDesiredState, IProviderOutput, IProviderParams } from
|
|
3
|
-
import { IObservableVideo } from
|
|
4
|
-
import { IDashURLSource } from
|
|
1
|
+
import type { IObservable, ISubject, IValueSubject } from "@vkontakte/videoplayer-shared";
|
|
2
|
+
import type { IDesiredState, IProviderOutput, IProviderParams } from "../../types";
|
|
3
|
+
import type { IObservableVideo } from "../../utils/HTMLVideoElement/observable";
|
|
4
|
+
import type { IDashURLSource } from "../../../player/types";
|
|
5
5
|
export declare enum LiveStatus {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
ActiveLowLatency = "active_low_latency",
|
|
7
|
+
LiveWithTargetOffset = "live_with_target_offset",
|
|
8
|
+
LiveForwardBuffering = "live_forward_buffering",
|
|
9
|
+
None = "none"
|
|
10
10
|
}
|
|
11
11
|
export declare enum LiveStreamStatus {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
Active = "active",
|
|
13
|
+
UnexpectedlyDown = "unexpectedly_down",
|
|
14
|
+
Unpublished = "unpublished"
|
|
15
15
|
}
|
|
16
16
|
export interface IProviderSubscriptionInfo {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
output: IProviderOutput;
|
|
18
|
+
desiredState: IDesiredState;
|
|
19
|
+
observableVideo: IObservableVideo;
|
|
20
|
+
genericErrorListener: (error: Error | unknown) => void;
|
|
21
|
+
connect: <Value>(from: IObservable<Value>, to: ISubject<Value> | IValueSubject<Value> | ((v: Value) => void)) => void;
|
|
22
22
|
}
|
|
23
23
|
export declare enum ProviderState {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
STOPPED = "stopped",
|
|
25
|
+
READY = "ready",
|
|
26
|
+
PLAYING = "playing",
|
|
27
|
+
PAUSED = "paused"
|
|
28
28
|
}
|
|
29
29
|
export type IParams = IProviderParams<IDashURLSource>;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { Representation, Segment, SegmentReference, Stream, TemplateSegment, TemplateSegmentReference, TextRepresentation } from
|
|
2
|
-
import { IAudioStream, IAudioTrack, IInternalTextTrack, IVideoStream, IVideoTrack } from
|
|
1
|
+
import type { Representation, Segment, SegmentReference, Stream, TemplateSegment, TemplateSegmentReference, TextRepresentation } from "../../utils/parsers/types";
|
|
2
|
+
import type { IAudioStream, IAudioTrack, IInternalTextTrack, IVideoStream, IVideoTrack } from "../../../player/types";
|
|
3
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
|
-
|
|
7
|
-
|
|
6
|
+
url: string;
|
|
7
|
+
isAuto: boolean;
|
|
8
8
|
}) => IInternalTextTrack;
|
|
9
9
|
export declare const textRepresentationToTextTrack: ({ language, label, id, url, isAuto }: TextRepresentation) => IInternalTextTrack;
|
|
10
10
|
export declare const streamToIAudioStream: ({ id, language, label, codecs, isDefault }: Stream) => IAudioStream;
|
|
@@ -1,61 +1,62 @@
|
|
|
1
|
-
import { IAudioTrack, IDashURLSource, IHLSSource, IInternalTextTrack, IVideoTrack, VideoCodec } from
|
|
2
|
-
import { IProviderSubscriptionInfo
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import {
|
|
1
|
+
import type { IAudioTrack, IDashURLSource, IHLSSource, IInternalTextTrack, IVideoTrack, VideoCodec } from "../../player/types";
|
|
2
|
+
import type { IProviderSubscriptionInfo } from "./lib/types";
|
|
3
|
+
import { ProviderState } from "./lib/types";
|
|
4
|
+
import type { CommonInit, Representation, Stream } from "../utils/parsers/types";
|
|
5
|
+
import type { IProvider, IProviderParams } from "../types";
|
|
6
|
+
import type { IObservableVideo } from "../utils/HTMLVideoElement/observable";
|
|
7
|
+
import { TrackHistory } from "../../utils/autoSelectTrack";
|
|
8
|
+
import type { IStateMachine } from "../../utils/StateMachine/types";
|
|
9
|
+
import type { ISubscription, ITracer, Milliseconds } from "@vkontakte/videoplayer-shared";
|
|
10
|
+
import { Scene3D } from "../../utils/3d/Scene3D";
|
|
11
|
+
import DroppedFramesManager from "../utils/HTMLVideoElement/DroppedFramesManager";
|
|
12
|
+
import TextTrackManager from "../utils/HTMLVideoElement/TextTrackManager";
|
|
13
|
+
import StallsManager from "../utils/StallsManager";
|
|
14
|
+
import { ElementSizeManager } from "./lib/ElementSizeManager";
|
|
15
|
+
import type { BasePlayer } from "./lib/player/basePlayer";
|
|
15
16
|
type IParams = IProviderParams<IDashURLSource> & {
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
sourceHls?: IHLSSource;
|
|
18
|
+
forceVideoCodec?: VideoCodec;
|
|
18
19
|
};
|
|
19
20
|
export default abstract class BaseDashProvider implements IProvider {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
21
|
+
scene3D: Scene3D | undefined;
|
|
22
|
+
protected subscription: ISubscription;
|
|
23
|
+
protected volumeSubscription: ISubscription;
|
|
24
|
+
protected videoState: IStateMachine<ProviderState>;
|
|
25
|
+
protected video: HTMLVideoElement;
|
|
26
|
+
protected observableVideo: IObservableVideo | null;
|
|
27
|
+
protected player: BasePlayer;
|
|
28
|
+
protected params: IParams;
|
|
29
|
+
protected tracer: ITracer;
|
|
30
|
+
protected textTracksManager: TextTrackManager;
|
|
31
|
+
protected droppedFramesManager: DroppedFramesManager;
|
|
32
|
+
protected stallsManager: StallsManager;
|
|
33
|
+
protected elementSizeManager: ElementSizeManager;
|
|
34
|
+
protected videoTracksMap: Map<IVideoTrack, {
|
|
35
|
+
stream: Stream;
|
|
36
|
+
representation: Representation;
|
|
37
|
+
}>;
|
|
38
|
+
protected audioTracksMap: Map<IAudioTrack, {
|
|
39
|
+
stream: Stream;
|
|
40
|
+
representation: Representation;
|
|
41
|
+
}>;
|
|
42
|
+
protected textTracksMap: Map<IInternalTextTrack, {
|
|
43
|
+
stream: Stream;
|
|
44
|
+
representation: Representation;
|
|
45
|
+
}>;
|
|
46
|
+
protected videoStreamsMap: Map<Stream, IVideoTrack[]>;
|
|
47
|
+
protected audioStreamsMap: Map<Stream, IAudioTrack[]>;
|
|
48
|
+
protected videoTrackSwitchHistory: TrackHistory<IVideoTrack>;
|
|
49
|
+
protected audioTrackSwitchHistory: TrackHistory<IAudioTrack>;
|
|
50
|
+
constructor(params: IParams);
|
|
51
|
+
protected abstract seek(position: Milliseconds, forcePrecise: boolean): void;
|
|
52
|
+
protected abstract getPlayer(): BasePlayer;
|
|
53
|
+
protected getProviderSubscriptionInfo(): IProviderSubscriptionInfo;
|
|
54
|
+
protected subscribe(): void;
|
|
55
|
+
protected selectVideoAudioRepresentations(): [Representation, Representation | undefined] | undefined;
|
|
56
|
+
protected prepare(manifestOffset?: number): void;
|
|
57
|
+
protected syncPlayback: () => void;
|
|
58
|
+
protected init3DScene: (init: CommonInit) => void;
|
|
59
|
+
protected destroy3DScene: () => void;
|
|
60
|
+
protected playIfAllowed(): void;
|
|
61
|
+
destroy(): void;
|
|
60
62
|
}
|
|
61
|
-
export {};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare const DASH_LIVE_UPDATE_INTERVAL_MS =
|
|
1
|
+
export declare const DASH_LIVE_UPDATE_INTERVAL_MS = 1e3;
|
|
2
2
|
export declare const DASH_STALL_UPDATE_INTERVAL_MS = 50;
|
|
3
|
-
export declare const DASH_LIVE_STALL_REINIT_INTERVAL_MS =
|
|
3
|
+
export declare const DASH_LIVE_STALL_REINIT_INTERVAL_MS = 2e3;
|