@vkontakte/videoplayer-core 2.0.154-dev.48c0527e.0 → 2.0.154-dev.6d21d9b3.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 +184 -0
- package/es2015.esm.js +184 -0
- package/es2018.cjs +131 -77
- package/es2018.esm.js +129 -75
- package/es2024.cjs +135 -81
- package/es2024.esm.js +133 -79
- package/esnext.cjs +135 -81
- package/esnext.esm.js +133 -79
- package/evergreen.esm.js +134 -80
- 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 +13 -16
- package/types/player/Player.d.ts +210 -217
- package/types/player/types.d.ts +589 -589
- 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 +106 -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 -32
- 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 +150 -149
- package/types/providers/DashLiveProvider/utils/ThroughputEstimator.d.ts +30 -12
- package/types/providers/DashLiveProvider/utils/liveDashPlayerUtil.d.ts +22 -19
- package/types/providers/DashProvider/baseDashProvider.d.ts +56 -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 +122 -123
- package/types/providers/DashProvider/lib/fetcher.d.ts +69 -70
- package/types/providers/DashProvider/lib/player.d.ts +107 -109
- 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 +57 -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 +14 -15
- 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 +92 -94
- 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 +67 -68
- package/types/providers/DashProviderVirtual/lib/player/basePlayer.d.ts +100 -103
- 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 +28 -28
- package/types/providers/HlsLiveProvider/seekBackTimeExtractor.d.ts +1 -1
- package/types/providers/HlsProvider/index.d.ts +19 -18
- package/types/providers/HlsProvider/manifestDataExtractor.d.ts +13 -13
- package/types/providers/MpegProvider/index.d.ts +17 -16
- package/types/providers/ProviderContainer/index.d.ts +46 -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 +8 -9
- package/types/providers/WebRTCLiveProvider/WebRTCLiveClient.d.ts +185 -185
- package/types/providers/WebRTCLiveProvider/WebRTCLiveProvider.d.ts +57 -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 +39 -40
- 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 +2 -2
- 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 +12 -13
- 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 +17 -18
- 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 +26 -27
- 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 +5 -4
- 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 +133 -131
- 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 +12 -8
- 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 +27 -28
- package/types/utils/buffer/createTimeRanges.d.ts +1 -2
- 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 +5 -1
- 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 +14 -15
- package/types/utils/setStateWithSubscribe.d.ts +3 -6
- 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 +275 -276
- package/types/utils/videoFormat.d.ts +1 -1
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { BaseVirtualBufferManager } from
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
1
|
+
import { BaseVirtualBufferManager } from '../../../../../providers/DashProviderVirtual/lib/buffer/virtualBuffer/baseVirtualBufferManager';
|
|
2
|
+
import { Dependencies, IBufferPlaybackQueueItem, ISomeDataLoadedCallbackParams, IVirtualBufferManager } from '../../../../../providers/DashProviderVirtual/lib/buffer/types';
|
|
3
|
+
import { TemplateSegment, Representation, StreamKind } from '../../../../../providers/utils/parsers/types';
|
|
4
|
+
import { NativeBufferManager } from '../../../../../providers/DashProviderVirtual/lib/buffer/nativeBufferManager';
|
|
5
|
+
import { FetchParamsWithUrl, Priority } from '../../../../../providers/DashProviderVirtual/lib/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
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import { Representation, StreamKind } from '../../../../../providers/utils/parsers/types';
|
|
2
|
+
import { NativeBufferManager } from '../../../../../providers/DashProviderVirtual/lib/buffer/nativeBufferManager';
|
|
3
|
+
import { Dependencies, IVirtualBufferManager } from '../../../../../providers/DashProviderVirtual/lib/buffer/types';
|
|
4
4
|
export declare class VirtualBufferFactory {
|
|
5
|
-
|
|
5
|
+
static getBufferManager(kind: StreamKind, nativeBufferManager: NativeBufferManager, representations: Representation[], dependencies: Dependencies): IVirtualBufferManager;
|
|
6
6
|
}
|
|
@@ -1,82 +1,81 @@
|
|
|
1
|
-
import
|
|
2
|
-
import type ThroughputEstimator from
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import type { CommonInit, GenericContainerParser, Segment, SegmentReference } from "../../utils/parsers/types";
|
|
1
|
+
import { HttpConnectionType, HttpConnectionMetrics, HttpDownloadMetrics } from '../../../player/types';
|
|
2
|
+
import type ThroughputEstimator from '../../../utils/ThroughputEstimator';
|
|
3
|
+
import { Byte, IError, IRange, ISubject, ITracer, IValueSubject, Milliseconds } from '@vkontakte/videoplayer-shared';
|
|
4
|
+
import { CommonInit, GenericContainerParser, Segment, SegmentReference } from '../../../providers/utils/parsers/types';
|
|
6
5
|
declare global {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
6
|
+
interface Navigator {
|
|
7
|
+
connection: {
|
|
8
|
+
effectiveType: string;
|
|
9
|
+
downlink: number;
|
|
10
|
+
rtt: number;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
14
13
|
}
|
|
15
14
|
export declare enum RangeMethod {
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
HEADER = 0,
|
|
16
|
+
PARAM = 1
|
|
18
17
|
}
|
|
19
18
|
export interface IParams {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
19
|
+
throughputEstimator?: ThroughputEstimator;
|
|
20
|
+
requestQuic: boolean;
|
|
21
|
+
compatibilityMode?: boolean;
|
|
22
|
+
tracer: ITracer;
|
|
23
|
+
useEnableSubtitlesParam?: boolean;
|
|
25
24
|
}
|
|
26
|
-
export type Priority =
|
|
25
|
+
export type Priority = 'high' | 'low' | 'auto';
|
|
27
26
|
export interface FetchParamsWithUrl extends FetchParams {
|
|
28
|
-
|
|
27
|
+
url: string;
|
|
29
28
|
}
|
|
30
29
|
export interface FetchParams {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
30
|
+
range?: IRange<Byte>;
|
|
31
|
+
rangeMethod?: RangeMethod;
|
|
32
|
+
onProgress?: (dataView: DataView, loaded: number) => void;
|
|
33
|
+
onProgressTasks?: Promise<void>[];
|
|
34
|
+
signal?: AbortSignal;
|
|
35
|
+
priority?: Priority;
|
|
36
|
+
measureThroughput?: boolean;
|
|
37
|
+
isLowLatency?: boolean;
|
|
38
|
+
bufferOptimisation?: boolean;
|
|
40
39
|
}
|
|
41
40
|
export type RepresentationFetchResult<T extends Segment> = {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
41
|
+
initMetadata: CommonInit | null;
|
|
42
|
+
initDataView: DataView;
|
|
43
|
+
segments: T[];
|
|
45
44
|
};
|
|
46
45
|
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
|
-
|
|
46
|
+
private throughputEstimator;
|
|
47
|
+
private requestQuic;
|
|
48
|
+
private tracer;
|
|
49
|
+
manifestRequested: ISubject<void>;
|
|
50
|
+
manifestReceived: ISubject<void>;
|
|
51
|
+
firstBytesRequested: ISubject<void>;
|
|
52
|
+
firstBytesReceived: ISubject<void>;
|
|
53
|
+
lastConnectionType$: IValueSubject<HttpConnectionType | undefined>;
|
|
54
|
+
lastConnectionReused$: IValueSubject<boolean | undefined>;
|
|
55
|
+
lastRequestFirstBytes$: IValueSubject<Milliseconds | undefined>;
|
|
56
|
+
lastConnectionMetrics$: IValueSubject<HttpConnectionMetrics | undefined>;
|
|
57
|
+
lastDownloadMetrics$: IValueSubject<HttpDownloadMetrics | undefined>;
|
|
58
|
+
recoverableError$: ISubject<IError>;
|
|
59
|
+
error$: ISubject<IError>;
|
|
60
|
+
private abortAllController;
|
|
61
|
+
private subscription;
|
|
62
|
+
private compatibilityMode;
|
|
63
|
+
private useEnableSubtitlesParam;
|
|
64
|
+
private performanceObserver;
|
|
65
|
+
private pendingConnectionMetrics;
|
|
66
|
+
constructor({ throughputEstimator, requestQuic, tracer, compatibilityMode, useEnableSubtitlesParam }: IParams);
|
|
67
|
+
private onHeadersReceived;
|
|
68
|
+
private setupPerformanceObserver;
|
|
69
|
+
private processResourceTiming;
|
|
70
|
+
private estimateNetworkType;
|
|
71
|
+
private extractConnectionMetrics;
|
|
72
|
+
private findMatchingRequest;
|
|
73
|
+
private trackRequestStart;
|
|
74
|
+
fetchManifest: (param_0: string) => Promise<string | null | undefined>;
|
|
75
|
+
fetch: (param_0: string, param_1: FetchParams) => Promise<ArrayBuffer | null | undefined>;
|
|
76
|
+
fetchRepresentation<T extends Segment>(segmentReference: SegmentReference, parser: GenericContainerParser<unknown>, priority?: Priority): Promise<RepresentationFetchResult<T> | null | undefined>;
|
|
77
|
+
destroy(): void;
|
|
78
|
+
private fetchByteRangeRepresentation;
|
|
79
|
+
private fetchTemplateRepresentation;
|
|
80
|
+
private doFetch;
|
|
82
81
|
}
|
|
@@ -1,105 +1,102 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import
|
|
12
|
-
import type { Params } from "./types";
|
|
13
|
-
import { State } from "./types";
|
|
14
|
-
import { NativeBufferManager } from "../buffer/nativeBufferManager";
|
|
1
|
+
import { IHLSSource, HttpConnectionType, HttpConnectionMetrics, HttpDownloadMetrics, VideoCodec } from '../../../../player/types';
|
|
2
|
+
import { LiveStreamStatus } from '../types';
|
|
3
|
+
import { CommonInit, Manifest, Representation, StreamKind, TextRepresentation } from '../../../../providers/utils/parsers/types';
|
|
4
|
+
import StateMachine from '../../../../utils/StateMachine/StateMachine';
|
|
5
|
+
import type ThroughputEstimator from '../../../../utils/ThroughputEstimator';
|
|
6
|
+
import { ITuningConfig } from '../../../../utils/tuningConfig';
|
|
7
|
+
import { IError, IRange, ISubject, ISubscription, ITracer, IValueSubject, Milliseconds, Nullable, Seconds, Subject, Subscription, SubscriptionRemovable } from '@vkontakte/videoplayer-shared';
|
|
8
|
+
import { Fetcher } from '../fetcher';
|
|
9
|
+
import { Dependencies, IVirtualBufferManager } from '../../../../providers/DashProviderVirtual/lib/buffer/types';
|
|
10
|
+
import { Params, State } from '../../../../providers/DashProviderVirtual/lib/player/types';
|
|
11
|
+
import { NativeBufferManager } from '../../../../providers/DashProviderVirtual/lib/buffer/nativeBufferManager';
|
|
15
12
|
export declare abstract class BasePlayer {
|
|
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
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
13
|
+
protected element: HTMLVideoElement | null;
|
|
14
|
+
protected manifestUrlString: string;
|
|
15
|
+
protected source: MediaSource | null;
|
|
16
|
+
protected manifest: Manifest | null;
|
|
17
|
+
protected tuning: ITuningConfig;
|
|
18
|
+
protected tracer: ITracer;
|
|
19
|
+
protected forceVideoCodec?: VideoCodec;
|
|
20
|
+
protected videoBufferManager: IVirtualBufferManager | null;
|
|
21
|
+
protected audioBufferManager: IVirtualBufferManager | null;
|
|
22
|
+
protected bufferManagers: IVirtualBufferManager[];
|
|
23
|
+
protected videoNativeBufferManager: NativeBufferManager | null;
|
|
24
|
+
protected audioNativeBufferManager: NativeBufferManager | null;
|
|
25
|
+
protected nativeBufferManagers: NativeBufferManager[];
|
|
26
|
+
protected throughputEstimator: ThroughputEstimator;
|
|
27
|
+
protected subscription: Subscription;
|
|
28
|
+
protected subscriptionRemovable: SubscriptionRemovable;
|
|
29
|
+
protected representationSubscription: Subscription;
|
|
30
|
+
protected fetcher: Fetcher;
|
|
31
|
+
protected forceEnded$: ISubject<void>;
|
|
32
|
+
protected stallWatchdogSubscription: ISubscription | undefined;
|
|
33
|
+
protected destroyController: AbortController;
|
|
34
|
+
state$: StateMachine<State>;
|
|
35
|
+
currentVideoRepresentation$: IValueSubject<Representation['id'] | undefined>;
|
|
36
|
+
currentVideoRepresentationInit$: IValueSubject<CommonInit | undefined>;
|
|
37
|
+
currentAudioRepresentation$: IValueSubject<Representation['id'] | undefined>;
|
|
38
|
+
currentVideoSegmentLength$: IValueSubject<number>;
|
|
39
|
+
currentAudioSegmentLength$: IValueSubject<number>;
|
|
40
|
+
error$: ISubject<IError>;
|
|
41
|
+
manifestRequested: ISubject<void>;
|
|
42
|
+
manifestReceived: ISubject<void>;
|
|
43
|
+
firstBytesRequested: ISubject<void>;
|
|
44
|
+
firstBytesReceived: ISubject<void>;
|
|
45
|
+
lastConnectionType$: IValueSubject<HttpConnectionType | undefined>;
|
|
46
|
+
lastConnectionReused$: IValueSubject<boolean | undefined>;
|
|
47
|
+
lastRequestFirstBytes$: IValueSubject<Milliseconds | undefined>;
|
|
48
|
+
lastConnectionMetrics$: IValueSubject<HttpConnectionMetrics | undefined>;
|
|
49
|
+
lastDownloadMetrics$: IValueSubject<HttpDownloadMetrics | undefined>;
|
|
50
|
+
currentLiveTextRepresentation$: IValueSubject<TextRepresentation | null>;
|
|
51
|
+
private timeoutSourceOpenId;
|
|
52
|
+
isLive$: IValueSubject<boolean>;
|
|
53
|
+
isActiveLive$: IValueSubject<boolean>;
|
|
54
|
+
isLowLatency$: IValueSubject<boolean>;
|
|
55
|
+
liveDuration$: IValueSubject<Milliseconds>;
|
|
56
|
+
liveSeekableDuration$: IValueSubject<Milliseconds>;
|
|
57
|
+
liveAvailabilityStartTime$: IValueSubject<Milliseconds>;
|
|
58
|
+
liveStreamStatus$: IValueSubject<LiveStreamStatus | undefined>;
|
|
59
|
+
currentBuffer$: IValueSubject<IRange<Seconds>>;
|
|
60
|
+
bufferLength$: IValueSubject<Milliseconds>;
|
|
61
|
+
nativeBufferLength$: IValueSubject<Milliseconds>;
|
|
62
|
+
liveLatency$: IValueSubject<Milliseconds | undefined>;
|
|
63
|
+
liveLoadBufferLength$: IValueSubject<Milliseconds>;
|
|
64
|
+
livePositionFromPlayer$: IValueSubject<number>;
|
|
65
|
+
currentStallDuration$: IValueSubject<Milliseconds>;
|
|
66
|
+
videoLastDataObtainedTimestamp$: IValueSubject<Milliseconds>;
|
|
67
|
+
fetcherRecoverableError$: Subject<IError>;
|
|
68
|
+
fetcherError$: Subject<IError>;
|
|
69
|
+
protected constructor(params: Params);
|
|
70
|
+
protected abstract prepareManifestUrlString(manifestBaseUrlString: string, offset: number): string;
|
|
71
|
+
protected abstract setSourceDuration(): void;
|
|
72
|
+
protected abstract restoreAfterDeepStall(stallTraceAttributes: Record<string, number>): Promise<void>;
|
|
73
|
+
initRepresentations: (param_0: string, param_1: string | undefined, param_2: import("../../../../player/types").URLSource | undefined) => Promise<void | undefined>;
|
|
74
|
+
initManifest(element: HTMLVideoElement, manifestBaseUrlString: string, offset: number): Promise<void>;
|
|
75
|
+
initBuffer(): void;
|
|
76
|
+
switchRepresentation(kind: StreamKind, id: Representation['id'], isAuto?: boolean): Promise<void>;
|
|
77
|
+
seek(requestedPosition: Milliseconds, forcePrecise?: boolean): Promise<void>;
|
|
78
|
+
warmUpMediaSourceIfNeeded(position?: Milliseconds | undefined): void;
|
|
79
|
+
calculateDurationFromSegments(representationId: Representation['id']): Milliseconds;
|
|
80
|
+
get isStreamEnded(): boolean;
|
|
81
|
+
getStreams(): Manifest['streams'] | undefined;
|
|
82
|
+
getCodecs(): Manifest['codecs'] | undefined;
|
|
83
|
+
setBufferTarget(time: Milliseconds): void;
|
|
84
|
+
setPreloadOnly(preloadOnly: boolean): void;
|
|
85
|
+
stop(): void;
|
|
86
|
+
destroy(): void;
|
|
87
|
+
protected get isStreamNotOpen(): boolean;
|
|
88
|
+
protected reinitDecoderIfNeeded(force?: boolean): Promise<void>;
|
|
89
|
+
protected stallWatchdogIntervalCallback(): Promise<void>;
|
|
90
|
+
protected isStallExceeded(timeInWaiting: Milliseconds): boolean;
|
|
91
|
+
protected updateManifest(): Promise<Manifest | null>;
|
|
92
|
+
protected fetchManifest: () => Promise<Nullable<string>>;
|
|
93
|
+
protected parseManifest(manifestString: string): Nullable<Manifest>;
|
|
94
|
+
protected getResultManifest(manifest: Manifest): Manifest;
|
|
95
|
+
protected stopStallWatchdogSubscription(): void;
|
|
96
|
+
protected createBuffers(dependencies: Dependencies, initialVideo: Representation['id'], initialAudio?: Representation['id'], sourceHls?: IHLSSource): void;
|
|
97
|
+
protected waitStreamToOpen(): Promise<void>;
|
|
98
|
+
protected initRepresentationSubscriptions(): void;
|
|
99
|
+
protected initBufferLengthSubscription(): void;
|
|
100
|
+
protected initTracerSubscription(): void;
|
|
101
|
+
protected tick(): Promise<void>;
|
|
105
102
|
}
|
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
import { BasePlayer } from
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import { LiveTextManager } from
|
|
9
|
-
import
|
|
1
|
+
import { BasePlayer } from '../../../../providers/DashProviderVirtual/lib/player/basePlayer';
|
|
2
|
+
import { ISmoothedValue } from '../../../../utils/smoothedValue/types';
|
|
3
|
+
import { ISubscription, Milliseconds } from '@vkontakte/videoplayer-shared';
|
|
4
|
+
import { Params } from '../../../../providers/DashProviderVirtual/lib/player/types';
|
|
5
|
+
import { Manifest, Representation } from '../../../../providers/utils/parsers/types';
|
|
6
|
+
import { LiveVirtualBuffer } from '../../../../providers/DashProviderVirtual/lib/buffer/virtualBuffer/liveVirtualBuffer';
|
|
7
|
+
import { IHLSSource } from '../../../../player/types';
|
|
8
|
+
import { LiveTextManager } from '../../../../providers/DashProviderVirtual/lib/LiveTextManager';
|
|
9
|
+
import { Dependencies } from '../../../../providers/DashProviderVirtual/lib/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
|
|
1
|
+
import { BasePlayer } from '../../../../providers/DashProviderVirtual/lib/player/basePlayer';
|
|
2
|
+
import { Params } from '../../../../providers/DashProviderVirtual/lib/player/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
|
|
3
|
-
import
|
|
4
|
-
import
|
|
1
|
+
import type ThroughputEstimator from '../../../../utils/ThroughputEstimator';
|
|
2
|
+
import { ITuningConfig } from '../../../../utils/tuningConfig';
|
|
3
|
+
import { VideoCodec } from '../../../../player/types';
|
|
4
|
+
import { 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
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
1
|
+
import { IObservable, ISubject, IValueSubject } from '@vkontakte/videoplayer-shared';
|
|
2
|
+
import { IDesiredState, IProviderOutput, IProviderParams } from '../../../providers/types';
|
|
3
|
+
import { IObservableVideo } from '../../../providers/utils/HTMLVideoElement/observable';
|
|
4
|
+
import { 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
|
|
2
|
-
import
|
|
1
|
+
import { Representation, Segment, SegmentReference, Stream, TemplateSegment, TemplateSegmentReference, TextRepresentation } from '../../../providers/utils/parsers/types';
|
|
2
|
+
import { 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;
|