@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,21 +1,21 @@
|
|
|
1
|
-
import { BaseVirtualBufferManager } from
|
|
2
|
-
import { Dependencies, IBufferPlaybackQueueItem, ISomeDataLoadedCallbackParams, IVirtualBufferManager } from
|
|
3
|
-
import { TemplateSegment, Representation, StreamKind } from
|
|
4
|
-
import { NativeBufferManager } from
|
|
5
|
-
import { FetchParamsWithUrl, Priority } from
|
|
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
6
|
export declare class TemplateVirtualBufferManager extends BaseVirtualBufferManager<TemplateSegment> implements IVirtualBufferManager {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
7
|
+
constructor(kind: StreamKind, nativeBufferManager: NativeBufferManager, representations: Representation[], dependencies: Dependencies);
|
|
8
|
+
protected loadItems(itemsToLoad: IBufferPlaybackQueueItem<TemplateSegment>[], representation: Representation, priority?: Priority): Promise<void>;
|
|
9
|
+
protected selectItemsToLoad(): IBufferPlaybackQueueItem<TemplateSegment>[];
|
|
10
|
+
protected 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 onSomeDataLoaded({ downloadingItems, dataView, representationId, loaded, signal }: ISomeDataLoadedCallbackParams<TemplateSegment>): Promise<void>;
|
|
20
|
+
protected updateRepresentationBaseUrl(representation: Representation, newBaseUrl: string): void;
|
|
21
21
|
}
|
package/types/providers/DashProviderVirtual/lib/buffer/virtualBuffer/virtualBufferFactory.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Representation, StreamKind } from
|
|
2
|
-
import { NativeBufferManager } from
|
|
3
|
-
import { Dependencies, IVirtualBufferManager } from
|
|
1
|
+
import type { Representation, StreamKind } from "../../../../utils/parsers/types";
|
|
2
|
+
import type { NativeBufferManager } from "../nativeBufferManager";
|
|
3
|
+
import type { Dependencies, IVirtualBufferManager } from "../types";
|
|
4
4
|
export declare class VirtualBufferFactory {
|
|
5
|
-
|
|
5
|
+
static getBufferManager(kind: StreamKind, nativeBufferManager: NativeBufferManager, representations: Representation[], dependencies: Dependencies): IVirtualBufferManager;
|
|
6
6
|
}
|
|
@@ -1,81 +1,82 @@
|
|
|
1
|
-
import { HttpConnectionType, HttpConnectionMetrics, HttpDownloadMetrics } from
|
|
2
|
-
import type ThroughputEstimator from
|
|
3
|
-
import { Byte, IError, IRange, ISubject, ITracer, IValueSubject, Milliseconds } from
|
|
4
|
-
import {
|
|
1
|
+
import type { HttpConnectionType, HttpConnectionMetrics, HttpDownloadMetrics } from "../../../player/types";
|
|
2
|
+
import type ThroughputEstimator from "../../../utils/ThroughputEstimator";
|
|
3
|
+
import type { Byte, IError, IRange, ISubject, ITracer, IValueSubject, Milliseconds } 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
|
-
|
|
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;
|
|
39
40
|
}
|
|
40
41
|
export type RepresentationFetchResult<T extends Segment> = {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
initMetadata: CommonInit | null;
|
|
43
|
+
initDataView: DataView;
|
|
44
|
+
segments: T[];
|
|
44
45
|
};
|
|
45
46
|
export declare class Fetcher {
|
|
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
|
-
|
|
47
|
+
private throughputEstimator;
|
|
48
|
+
private requestQuic;
|
|
49
|
+
private tracer;
|
|
50
|
+
manifestRequested: ISubject<void>;
|
|
51
|
+
manifestReceived: ISubject<void>;
|
|
52
|
+
firstBytesRequested: ISubject<void>;
|
|
53
|
+
firstBytesReceived: ISubject<void>;
|
|
54
|
+
lastConnectionType$: IValueSubject<HttpConnectionType | undefined>;
|
|
55
|
+
lastConnectionReused$: IValueSubject<boolean | undefined>;
|
|
56
|
+
lastRequestFirstBytes$: IValueSubject<Milliseconds | undefined>;
|
|
57
|
+
lastConnectionMetrics$: IValueSubject<HttpConnectionMetrics | undefined>;
|
|
58
|
+
lastDownloadMetrics$: IValueSubject<HttpDownloadMetrics | undefined>;
|
|
59
|
+
recoverableError$: ISubject<IError>;
|
|
60
|
+
error$: ISubject<IError>;
|
|
61
|
+
private abortAllController;
|
|
62
|
+
private subscription;
|
|
63
|
+
private compatibilityMode;
|
|
64
|
+
private useEnableSubtitlesParam;
|
|
65
|
+
private performanceObserver;
|
|
66
|
+
private pendingConnectionMetrics;
|
|
67
|
+
constructor({ throughputEstimator, requestQuic, tracer, compatibilityMode, useEnableSubtitlesParam }: IParams);
|
|
68
|
+
private onHeadersReceived;
|
|
69
|
+
private setupPerformanceObserver;
|
|
70
|
+
private processResourceTiming;
|
|
71
|
+
private estimateNetworkType;
|
|
72
|
+
private extractConnectionMetrics;
|
|
73
|
+
private findMatchingRequest;
|
|
74
|
+
private trackRequestStart;
|
|
75
|
+
fetchManifest: ReturnType<typeof abortable<[string], string | null>>;
|
|
76
|
+
fetch: ReturnType<typeof abortable<[string, FetchParams], ArrayBuffer | null>>;
|
|
77
|
+
fetchRepresentation<T extends Segment>(segmentReference: SegmentReference, parser: GenericContainerParser<unknown>, priority?: Priority): Promise<RepresentationFetchResult<T> | null | undefined>;
|
|
78
|
+
destroy(): void;
|
|
79
|
+
private fetchByteRangeRepresentation;
|
|
80
|
+
private fetchTemplateRepresentation;
|
|
81
|
+
private doFetch;
|
|
81
82
|
}
|
|
@@ -1,102 +1,105 @@
|
|
|
1
|
-
import { IHLSSource, HttpConnectionType, HttpConnectionMetrics, HttpDownloadMetrics, VideoCodec } from
|
|
2
|
-
import { LiveStreamStatus } from
|
|
3
|
-
import { CommonInit, Manifest, Representation,
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
1
|
+
import type { IHLSSource, HttpConnectionType, HttpConnectionMetrics, HttpDownloadMetrics, VideoCodec } from "../../../../player/types";
|
|
2
|
+
import type { 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, IRange, ISubject, ISubscription, ITracer, IValueSubject, Milliseconds, Nullable, Seconds } from "@vkontakte/videoplayer-shared";
|
|
9
|
+
import { abortable, Subject, Subscription, SubscriptionRemovable } from "@vkontakte/videoplayer-shared";
|
|
10
|
+
import { Fetcher } from "../fetcher";
|
|
11
|
+
import type { Dependencies, IVirtualBufferManager } from "../buffer/types";
|
|
12
|
+
import type { Params } from "./types";
|
|
13
|
+
import { State } from "./types";
|
|
14
|
+
import { NativeBufferManager } from "../buffer/nativeBufferManager";
|
|
12
15
|
export declare abstract class BasePlayer {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
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
|
-
|
|
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
|
-
|
|
16
|
+
protected element: HTMLVideoElement | null;
|
|
17
|
+
protected manifestUrlString: string;
|
|
18
|
+
protected source: MediaSource | null;
|
|
19
|
+
protected manifest: Manifest | null;
|
|
20
|
+
protected tuning: ITuningConfig;
|
|
21
|
+
protected tracer: ITracer;
|
|
22
|
+
protected forceVideoCodec?: VideoCodec;
|
|
23
|
+
protected videoBufferManager: IVirtualBufferManager | null;
|
|
24
|
+
protected audioBufferManager: IVirtualBufferManager | null;
|
|
25
|
+
protected bufferManagers: IVirtualBufferManager[];
|
|
26
|
+
protected videoNativeBufferManager: NativeBufferManager | null;
|
|
27
|
+
protected audioNativeBufferManager: NativeBufferManager | null;
|
|
28
|
+
protected nativeBufferManagers: NativeBufferManager[];
|
|
29
|
+
protected throughputEstimator: ThroughputEstimator;
|
|
30
|
+
protected subscription: Subscription;
|
|
31
|
+
protected subscriptionRemovable: SubscriptionRemovable;
|
|
32
|
+
protected representationSubscription: Subscription;
|
|
33
|
+
protected fetcher: Fetcher;
|
|
34
|
+
protected forceEnded$: ISubject<void>;
|
|
35
|
+
protected stallWatchdogSubscription: ISubscription | undefined;
|
|
36
|
+
protected destroyController: AbortController;
|
|
37
|
+
state$: StateMachine<State>;
|
|
38
|
+
currentVideoRepresentation$: IValueSubject<Representation["id"] | undefined>;
|
|
39
|
+
currentVideoRepresentationInit$: IValueSubject<CommonInit | undefined>;
|
|
40
|
+
currentAudioRepresentation$: IValueSubject<Representation["id"] | undefined>;
|
|
41
|
+
currentVideoSegmentLength$: IValueSubject<number>;
|
|
42
|
+
currentAudioSegmentLength$: IValueSubject<number>;
|
|
43
|
+
error$: ISubject<IError>;
|
|
44
|
+
manifestRequested: ISubject<void>;
|
|
45
|
+
manifestReceived: ISubject<void>;
|
|
46
|
+
firstBytesRequested: ISubject<void>;
|
|
47
|
+
firstBytesReceived: ISubject<void>;
|
|
48
|
+
lastConnectionType$: IValueSubject<HttpConnectionType | undefined>;
|
|
49
|
+
lastConnectionReused$: IValueSubject<boolean | undefined>;
|
|
50
|
+
lastRequestFirstBytes$: IValueSubject<Milliseconds | undefined>;
|
|
51
|
+
lastConnectionMetrics$: IValueSubject<HttpConnectionMetrics | undefined>;
|
|
52
|
+
lastDownloadMetrics$: IValueSubject<HttpDownloadMetrics | undefined>;
|
|
53
|
+
currentLiveTextRepresentation$: IValueSubject<TextRepresentation | null>;
|
|
54
|
+
private timeoutSourceOpenId;
|
|
55
|
+
isLive$: IValueSubject<boolean>;
|
|
56
|
+
isActiveLive$: IValueSubject<boolean>;
|
|
57
|
+
isLowLatency$: IValueSubject<boolean>;
|
|
58
|
+
liveDuration$: IValueSubject<Milliseconds>;
|
|
59
|
+
liveSeekableDuration$: IValueSubject<Milliseconds>;
|
|
60
|
+
liveAvailabilityStartTime$: IValueSubject<Milliseconds>;
|
|
61
|
+
liveStreamStatus$: IValueSubject<LiveStreamStatus | undefined>;
|
|
62
|
+
currentBuffer$: IValueSubject<IRange<Seconds>>;
|
|
63
|
+
bufferLength$: IValueSubject<Milliseconds>;
|
|
64
|
+
nativeBufferLength$: IValueSubject<Milliseconds>;
|
|
65
|
+
liveLatency$: IValueSubject<Milliseconds | undefined>;
|
|
66
|
+
liveLoadBufferLength$: IValueSubject<Milliseconds>;
|
|
67
|
+
livePositionFromPlayer$: IValueSubject<number>;
|
|
68
|
+
currentStallDuration$: IValueSubject<Milliseconds>;
|
|
69
|
+
videoLastDataObtainedTimestamp$: IValueSubject<Milliseconds>;
|
|
70
|
+
fetcherRecoverableError$: Subject<IError>;
|
|
71
|
+
fetcherError$: Subject<IError>;
|
|
72
|
+
protected constructor(params: Params);
|
|
73
|
+
protected abstract prepareManifestUrlString(manifestBaseUrlString: string, offset: number): string;
|
|
74
|
+
protected abstract setSourceDuration(): void;
|
|
75
|
+
protected abstract restoreAfterDeepStall(stallTraceAttributes: Record<string, number>): Promise<void>;
|
|
76
|
+
initRepresentations: ReturnType<typeof abortable<[Representation["id"], Representation["id"] | undefined, IHLSSource | undefined]>>;
|
|
77
|
+
initManifest(element: HTMLVideoElement, manifestBaseUrlString: string, offset: number): Promise<void>;
|
|
78
|
+
initBuffer(): void;
|
|
79
|
+
switchRepresentation(kind: StreamKind, id: Representation["id"], isAuto?: boolean): Promise<void>;
|
|
80
|
+
seek(requestedPosition: Milliseconds, forcePrecise?: boolean): Promise<void>;
|
|
81
|
+
warmUpMediaSourceIfNeeded(position?: Milliseconds | undefined): void;
|
|
82
|
+
calculateDurationFromSegments(representationId: Representation["id"]): Milliseconds;
|
|
83
|
+
get isStreamEnded(): boolean;
|
|
84
|
+
getStreams(): Manifest["streams"] | undefined;
|
|
85
|
+
getCodecs(): Manifest["codecs"] | undefined;
|
|
86
|
+
setBufferTarget(time: Milliseconds): void;
|
|
87
|
+
setPreloadOnly(preloadOnly: boolean): void;
|
|
88
|
+
stop(): void;
|
|
89
|
+
destroy(): void;
|
|
90
|
+
protected get isStreamNotOpen(): boolean;
|
|
91
|
+
protected reinitDecoderIfNeeded(force?: boolean): Promise<void>;
|
|
92
|
+
protected stallWatchdogIntervalCallback(): Promise<void>;
|
|
93
|
+
protected isStallExceeded(timeInWaiting: Milliseconds): boolean;
|
|
94
|
+
protected updateManifest(): Promise<Manifest | null>;
|
|
95
|
+
protected fetchManifest: ReturnType<typeof abortable<[], Nullable<string>>>;
|
|
96
|
+
protected parseManifest(manifestString: string): Nullable<Manifest>;
|
|
97
|
+
protected getResultManifest(manifest: Manifest): Manifest;
|
|
98
|
+
protected stopStallWatchdogSubscription(): void;
|
|
99
|
+
protected createBuffers(dependencies: Dependencies, initialVideo: Representation["id"], initialAudio?: Representation["id"], sourceHls?: IHLSSource): void;
|
|
100
|
+
protected waitStreamToOpen(): Promise<void>;
|
|
101
|
+
protected initRepresentationSubscriptions(): void;
|
|
102
|
+
protected initBufferLengthSubscription(): void;
|
|
103
|
+
protected initTracerSubscription(): void;
|
|
104
|
+
protected tick(): Promise<void>;
|
|
102
105
|
}
|
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
import { BasePlayer } from
|
|
2
|
-
import { ISmoothedValue } from
|
|
3
|
-
import { ISubscription, Milliseconds } from
|
|
4
|
-
import { Params } from
|
|
5
|
-
import { Manifest, Representation } from
|
|
6
|
-
import { LiveVirtualBuffer } from
|
|
7
|
-
import { IHLSSource } from
|
|
8
|
-
import { LiveTextManager } from
|
|
9
|
-
import { Dependencies } from
|
|
1
|
+
import { BasePlayer } from "./basePlayer";
|
|
2
|
+
import type { ISmoothedValue } from "../../../../utils/smoothedValue/types";
|
|
3
|
+
import type { ISubscription, Milliseconds } from "@vkontakte/videoplayer-shared";
|
|
4
|
+
import type { Params } from "./types";
|
|
5
|
+
import type { Manifest, Representation } from "../../../utils/parsers/types";
|
|
6
|
+
import type { LiveVirtualBuffer } from "../buffer/virtualBuffer/liveVirtualBuffer";
|
|
7
|
+
import type { IHLSSource } from "../../../../player/types";
|
|
8
|
+
import { LiveTextManager } from "../LiveTextManager";
|
|
9
|
+
import type { Dependencies } from "../buffer/types";
|
|
10
10
|
export declare class LivePlayer extends BasePlayer {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
11
|
+
protected liveTextManager: LiveTextManager | null;
|
|
12
|
+
protected liveStreamEndTimestamp: Milliseconds;
|
|
13
|
+
protected liveBuffer: ISmoothedValue;
|
|
14
|
+
protected livePauseWatchdogSubscription: ISubscription | undefined;
|
|
15
|
+
protected liveWasInterrupted: boolean;
|
|
16
|
+
constructor(params: Params);
|
|
17
|
+
seek(nextOffset: Milliseconds): Promise<void>;
|
|
18
|
+
initBuffer(): void;
|
|
19
|
+
protected forcePositionToRepresentationInitialTime(): Promise<void>;
|
|
20
|
+
protected tick(): Promise<void>;
|
|
21
|
+
protected setSourceDuration(): void;
|
|
22
|
+
protected isStallExceeded(timeInWaiting: Milliseconds): boolean;
|
|
23
|
+
protected restoreAfterDeepStall(stallTraceAttributes: Record<string, number>): Promise<void>;
|
|
24
|
+
protected updateManifest(): Promise<Manifest | null>;
|
|
25
|
+
protected prepareManifestUrlString(manifestBaseUrlString: string, offset: number): string;
|
|
26
|
+
protected updateManifestUrlWithTimeOffset(nextOffset: Milliseconds): void;
|
|
27
|
+
protected createBuffers(dependencies: Dependencies, initialVideo: Representation["id"], initialAudio?: Representation["id"], sourceHls?: IHLSSource): void;
|
|
28
|
+
protected initRepresentationSubscriptions(): void;
|
|
29
|
+
protected initStreamDurationOnPauseSubscription(): void;
|
|
30
|
+
protected initLiveDurationSubscriptions(videoBufferManager: LiveVirtualBuffer): void;
|
|
31
|
+
protected initLiveChangePlaybackRateSubscriptions(): void;
|
|
32
|
+
protected initLiveBufferInfoSubscriptions(videoBufferManager: LiveVirtualBuffer, bufferManagers: LiveVirtualBuffer[]): void;
|
|
33
|
+
protected initLiveMaintainSubscription(bufferManagers: LiveVirtualBuffer[]): void;
|
|
34
|
+
protected isManualDecreasePlaybackInLive(): boolean;
|
|
35
|
+
protected normalizeLiveOffset(nextOffset: Milliseconds): Milliseconds;
|
|
36
36
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { BasePlayer } from
|
|
2
|
-
import { Params } from
|
|
1
|
+
import { BasePlayer } from "./basePlayer";
|
|
2
|
+
import type { Params } from "./types";
|
|
3
3
|
export declare class Player extends BasePlayer {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
4
|
+
constructor(params: Params);
|
|
5
|
+
protected prepareManifestUrlString(manifestBaseUrlString: string, _offset: number): string;
|
|
6
|
+
protected initRepresentationSubscriptions(): void;
|
|
7
|
+
protected setSourceDuration(): void;
|
|
8
|
+
protected restoreAfterDeepStall(stallTraceAttributes: Record<string, number>): Promise<void>;
|
|
9
|
+
protected initDisableStallWatchdogSubscription(): void;
|
|
10
|
+
protected initEndOfVideoSubscription(): void;
|
|
11
11
|
}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import type ThroughputEstimator from
|
|
2
|
-
import { ITuningConfig } from
|
|
3
|
-
import { VideoCodec } from
|
|
4
|
-
import { ITracer } from
|
|
1
|
+
import type ThroughputEstimator from "../../../../utils/ThroughputEstimator";
|
|
2
|
+
import type { ITuningConfig } from "../../../../utils/tuningConfig";
|
|
3
|
+
import type { VideoCodec } from "../../../../player/types";
|
|
4
|
+
import type { ITracer } from "@vkontakte/videoplayer-shared";
|
|
5
5
|
export declare enum State {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
NONE = "none",
|
|
7
|
+
MANIFEST_READY = "manifest_ready",
|
|
8
|
+
REPRESENTATIOS_READY = "representations_ready",
|
|
9
|
+
RUNNING = "running"
|
|
10
10
|
}
|
|
11
11
|
export interface Params {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
throughputEstimator: ThroughputEstimator;
|
|
13
|
+
tuning: ITuningConfig;
|
|
14
|
+
compatibilityMode?: boolean;
|
|
15
|
+
forceVideoCodec?: VideoCodec;
|
|
16
|
+
tracer: ITracer;
|
|
17
17
|
}
|
|
@@ -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 }: 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;
|