@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,10 +1,10 @@
|
|
|
1
|
-
import { Milliseconds } from
|
|
2
|
-
import { IParams } from
|
|
3
|
-
import BaseDashProvider from
|
|
4
|
-
import { LivePlayer } from
|
|
1
|
+
import type { Milliseconds } from "@vkontakte/videoplayer-shared";
|
|
2
|
+
import type { IParams } from "./lib/types";
|
|
3
|
+
import BaseDashProvider from "./baseDashProvider";
|
|
4
|
+
import { LivePlayer } from "./lib/player/livePlayer";
|
|
5
5
|
export default class DashCmafLiveProvider extends BaseDashProvider {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
constructor(params: IParams);
|
|
7
|
+
protected getPlayer(): LivePlayer;
|
|
8
|
+
protected subscribe(): void;
|
|
9
|
+
protected seek(position: Milliseconds): void;
|
|
10
10
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Milliseconds } from
|
|
2
|
-
import BaseDashProvider from
|
|
3
|
-
import { Player } from
|
|
1
|
+
import type { Milliseconds } from "@vkontakte/videoplayer-shared";
|
|
2
|
+
import BaseDashProvider from "./baseDashProvider";
|
|
3
|
+
import { Player } from "./lib/player/player";
|
|
4
4
|
export default class DashProvider extends BaseDashProvider {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
protected subscribe(): void;
|
|
6
|
+
protected getPlayer(): Player;
|
|
7
|
+
protected seek(position: Milliseconds, forcePrecise: boolean): void;
|
|
8
8
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { default as DashProvider } from
|
|
2
|
-
export { default as DashCmafLiveProvider } from
|
|
1
|
+
export { default as DashProvider } from "./dashProvider";
|
|
2
|
+
export { default as DashCmafLiveProvider } from "./dashCmafLiveProvider";
|
|
@@ -1,19 +1,20 @@
|
|
|
1
|
-
import { IObservableVideo } from
|
|
2
|
-
import { IListener, IRectangle, ISubscription
|
|
1
|
+
import type { IObservableVideo } from "../../utils/HTMLVideoElement/observable";
|
|
2
|
+
import type { IListener, IRectangle, ISubscription } from "@vkontakte/videoplayer-shared";
|
|
3
|
+
import { ValueSubject } from "@vkontakte/videoplayer-shared";
|
|
3
4
|
interface ConnectParams {
|
|
4
|
-
|
|
5
|
-
|
|
5
|
+
video: HTMLVideoElement;
|
|
6
|
+
observableVideo: IObservableVideo;
|
|
6
7
|
}
|
|
7
8
|
export declare class ElementSizeManager {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
9
|
+
private readonly subscription;
|
|
10
|
+
private readonly pipSize$;
|
|
11
|
+
private readonly videoSize$;
|
|
12
|
+
private readonly elementSize$;
|
|
13
|
+
private pictureInPictureWindowRemoveEventListener;
|
|
14
|
+
connect({ observableVideo, video }: ConnectParams): void;
|
|
15
|
+
getValue(): IRectangle<number> | undefined;
|
|
16
|
+
subscribe(listener: IListener<IRectangle<number> | undefined>, error?: IListener<Error | unknown>): ISubscription;
|
|
17
|
+
getObservable(): ValueSubject<IRectangle<number> | undefined>;
|
|
18
|
+
destroy(): void;
|
|
18
19
|
}
|
|
19
20
|
export {};
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { IValueSubject, Milliseconds } from
|
|
2
|
-
import { Manifest, Stream, TextRepresentation } from
|
|
3
|
-
import { Dependencies } from
|
|
1
|
+
import type { IValueSubject, Milliseconds } from "@vkontakte/videoplayer-shared";
|
|
2
|
+
import type { Manifest, Stream, TextRepresentation } from "../../utils/parsers/types";
|
|
3
|
+
import type { Dependencies } from "./buffer/types";
|
|
4
4
|
export declare class LiveTextManager {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
5
|
+
currentRepresentation$: IValueSubject<TextRepresentation | null>;
|
|
6
|
+
private readonly maxRepresentations;
|
|
7
|
+
private representationsCursor;
|
|
8
|
+
private representations;
|
|
9
|
+
private readonly getCurrentPosition;
|
|
10
|
+
private currentSegment;
|
|
11
|
+
constructor(streams: Stream[], deps: Pick<Dependencies, "getCurrentPosition">);
|
|
12
|
+
updateLive(manifest: Manifest | null): void;
|
|
13
|
+
seekLive(streams?: Stream[]): void;
|
|
14
|
+
maintain(currentPosition?: Milliseconds | undefined): void;
|
|
15
|
+
destroy(): void;
|
|
16
|
+
/**
|
|
17
|
+
* @todo support multi-streams
|
|
18
|
+
* @see https://jira.mvk.com/browse/VP-2420
|
|
19
|
+
*/
|
|
20
|
+
private processStreams;
|
|
21
|
+
static isSupported(streams?: Stream[]): boolean;
|
|
22
|
+
private static filterRepresentations;
|
|
23
23
|
}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { IError, IRange, ISubject, Milliseconds } from
|
|
1
|
+
import type { IError, IRange, ISubject, Milliseconds } from "@vkontakte/videoplayer-shared";
|
|
2
2
|
export declare class NativeBufferManager {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
3
|
+
error$: ISubject<IError>;
|
|
4
|
+
private mediaSource;
|
|
5
|
+
private sourceBuffer;
|
|
6
|
+
private sourceBufferTaskQueue;
|
|
7
|
+
private subscription;
|
|
8
|
+
constructor(mediaSource: MediaSource);
|
|
9
|
+
init(mime: string, codecs: string, useAbortMSEFix?: boolean): void;
|
|
10
|
+
addInitSegment(initView: BufferSource, signal?: AbortSignal): Promise<boolean>;
|
|
11
|
+
append(segmentView: BufferSource, signal?: AbortSignal): Promise<boolean>;
|
|
12
|
+
remove(from: Milliseconds, to: Milliseconds, signal?: AbortSignal): Promise<boolean>;
|
|
13
|
+
clear(signal?: AbortSignal): Promise<boolean>;
|
|
14
|
+
warmUpMediaSource(): void;
|
|
15
|
+
getBufferState(): IRange<Milliseconds>[] | null;
|
|
16
|
+
getForwardBufferDuration(currentPosition: Milliseconds | undefined): Milliseconds;
|
|
17
|
+
abortBuffer(init: ArrayBuffer | undefined): Promise<boolean>;
|
|
18
|
+
destroy(): void;
|
|
19
19
|
}
|
|
@@ -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,47 +1,47 @@
|
|
|
1
|
-
import { Byte, IError, IRange, ISubject, IValueSubject, Milliseconds } from
|
|
2
|
-
import { CommonInit, Manifest, Representation, Segment } from
|
|
3
|
-
import type { Fetcher } from
|
|
4
|
-
import { ITuningConfig } from
|
|
5
|
-
export type TRepresentationSwitchMode =
|
|
1
|
+
import type { Byte, IError, IRange, ISubject, IValueSubject, Milliseconds } from "@vkontakte/videoplayer-shared";
|
|
2
|
+
import type { CommonInit, Manifest, Representation, Segment } from "../../../utils/parsers/types";
|
|
3
|
+
import type { Fetcher } from "../fetcher";
|
|
4
|
+
import type { ITuningConfig } from "../../../../utils/tuningConfig";
|
|
5
|
+
export type TRepresentationSwitchMode = "lazy" | "force";
|
|
6
6
|
export interface Dependencies {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
7
|
+
fetcher: Fetcher;
|
|
8
|
+
tuning: ITuningConfig;
|
|
9
|
+
compatibilityMode?: boolean;
|
|
10
|
+
manifest: Manifest | null;
|
|
11
|
+
getCurrentPosition(): Milliseconds | undefined;
|
|
12
|
+
getCurrentStallDuration(): Milliseconds;
|
|
13
|
+
isActiveLowLatency(): boolean;
|
|
14
14
|
}
|
|
15
15
|
export interface IVirtualBufferManager {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
16
|
+
error$: ISubject<IError>;
|
|
17
|
+
playingRepresentation$: IValueSubject<Representation["id"] | undefined>;
|
|
18
|
+
playingRepresentationInit$: IValueSubject<CommonInit | undefined>;
|
|
19
|
+
currentSegmentLength$: IValueSubject<number>;
|
|
20
|
+
onLastSegment$: IValueSubject<boolean>;
|
|
21
|
+
fullyBuffered$: IValueSubject<boolean>;
|
|
22
|
+
startWith(representationId: Representation["id"]): Promise<void | undefined>;
|
|
23
|
+
seek(currentPosition: Milliseconds | undefined): Promise<void>;
|
|
24
|
+
maintain(currentPosition: Milliseconds | undefined): Promise<void>;
|
|
25
|
+
switchTo(newRepresentationId: Representation["id"], isAuto: boolean | undefined): Promise<void | undefined>;
|
|
26
|
+
getForwardPlaybackBufferDuration(currentPosition?: Milliseconds): Milliseconds;
|
|
27
|
+
getPlaybackBufferState(): IRange<Milliseconds> | null;
|
|
28
|
+
setTarget(time: Milliseconds): void;
|
|
29
|
+
setPreloadOnly(preloadOnly: boolean): void;
|
|
30
|
+
findSegmentStartTime(position: Milliseconds): Milliseconds | undefined;
|
|
31
|
+
calculateDurationFromSegments(representationId: Representation["id"]): Milliseconds;
|
|
32
|
+
destroy(): void;
|
|
33
|
+
get lastDataObtainedTimestamp(): Milliseconds;
|
|
34
34
|
}
|
|
35
35
|
export interface IBufferPlaybackQueueItem<T extends Segment> {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
36
|
+
representationId: Representation["id"];
|
|
37
|
+
segmentIndex: number;
|
|
38
|
+
segment: T;
|
|
39
39
|
}
|
|
40
40
|
export interface ISomeDataLoadedCallbackParams<T extends Segment> {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
41
|
+
downloadingItems: IBufferPlaybackQueueItem<T>[];
|
|
42
|
+
dataView: DataView;
|
|
43
|
+
representationId: Representation["id"];
|
|
44
|
+
globalFrom?: Byte;
|
|
45
|
+
loaded: Byte;
|
|
46
|
+
signal: AbortSignal;
|
|
47
47
|
}
|
package/types/providers/DashProviderVirtual/lib/buffer/virtualBuffer/baseVirtualBufferManager.d.ts
CHANGED
|
@@ -1,94 +1,96 @@
|
|
|
1
|
-
import { Fetcher, FetchParamsWithUrl, Priority, RepresentationFetchResult } from
|
|
2
|
-
import { CommonInit, ContainerParser, Representation, Segment
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
1
|
+
import type { Fetcher, FetchParamsWithUrl, Priority, RepresentationFetchResult } from "../../fetcher";
|
|
2
|
+
import type { CommonInit, ContainerParser, Representation, Segment } from "../../../../utils/parsers/types";
|
|
3
|
+
import { StreamKind } from "../../../../utils/parsers/types";
|
|
4
|
+
import type { ITuningConfig } from "../../../../../utils/tuningConfig";
|
|
5
|
+
import type { Byte, IError, IRange, ISubject, IValueSubject, Milliseconds, Seconds } from "@vkontakte/videoplayer-shared";
|
|
6
|
+
import { abortable, Subscription } from "@vkontakte/videoplayer-shared";
|
|
7
|
+
import type { NativeBufferManager } from "../nativeBufferManager";
|
|
8
|
+
import type { Dependencies, IBufferPlaybackQueueItem, ISomeDataLoadedCallbackParams, IVirtualBufferManager } from "../types";
|
|
7
9
|
export declare abstract class BaseVirtualBufferManager<T extends Segment> implements IVirtualBufferManager {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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
|
-
|
|
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
|
-
|
|
10
|
+
error$: ISubject<IError>;
|
|
11
|
+
playingRepresentation$: IValueSubject<Representation["id"] | undefined>;
|
|
12
|
+
playingRepresentationInit$: IValueSubject<CommonInit | undefined>;
|
|
13
|
+
currentSegmentLength$: IValueSubject<number>;
|
|
14
|
+
onLastSegment$: IValueSubject<boolean>;
|
|
15
|
+
fullyBuffered$: IValueSubject<boolean>;
|
|
16
|
+
protected readonly kind: StreamKind;
|
|
17
|
+
protected readonly nativeBufferManager: NativeBufferManager;
|
|
18
|
+
protected readonly fetcher: Fetcher;
|
|
19
|
+
protected readonly tuning: ITuningConfig;
|
|
20
|
+
protected representations: Map<Representation["id"], Representation>;
|
|
21
|
+
protected playingRepresentationId: Representation["id"] | undefined;
|
|
22
|
+
protected downloadingRepresentationId: Representation["id"] | undefined;
|
|
23
|
+
protected switchingRepresentationId: Representation["id"] | null;
|
|
24
|
+
protected initData: Map<Representation["id"], ArrayBuffer>;
|
|
25
|
+
protected initDataPromises: Map<Representation["id"], Promise<RepresentationFetchResult<T> | null | undefined>>;
|
|
26
|
+
protected idleCallbacks: Map<Representation["id"], number>;
|
|
27
|
+
protected parsedInitData: Map<Representation["id"], CommonInit>;
|
|
28
|
+
protected segments: Map<Representation["id"], T[]>;
|
|
29
|
+
protected containerParser: ContainerParser;
|
|
30
|
+
protected bufferPlaybackQueue: IBufferPlaybackQueueItem<T>[];
|
|
31
|
+
protected downloadingBufferItems: IBufferPlaybackQueueItem<T>[];
|
|
32
|
+
protected preloadOnly: boolean;
|
|
33
|
+
protected forwardBufferTarget: Milliseconds;
|
|
34
|
+
protected failedDownloads: number;
|
|
35
|
+
protected lastDataObtainedTimestampMs: Milliseconds;
|
|
36
|
+
protected loadByteRangeSegmentsTimeoutId: number;
|
|
37
|
+
protected currentVirtualBufferSize: Byte;
|
|
38
|
+
private baseUrls;
|
|
39
|
+
private baseUrlsIndex;
|
|
40
|
+
protected maintainPlaybackBufferMutex: boolean;
|
|
41
|
+
protected maintainNativeBufferMutex: boolean;
|
|
42
|
+
protected bufferClearingMutex: boolean;
|
|
43
|
+
protected abortNativeBufferMutex: boolean;
|
|
44
|
+
protected switchMutex: boolean;
|
|
45
|
+
protected destroyAbortController: AbortController;
|
|
46
|
+
protected downloadAbortController: AbortController;
|
|
47
|
+
protected subscription: Subscription;
|
|
48
|
+
protected readonly getCurrentPosition: () => Milliseconds | undefined;
|
|
49
|
+
protected readonly getCurrentStallDuration: () => Milliseconds | undefined;
|
|
50
|
+
protected constructor(kind: StreamKind, nativeBufferManager: NativeBufferManager, representations: Representation[], { fetcher, tuning, getCurrentPosition, getCurrentStallDuration, manifest }: Dependencies);
|
|
51
|
+
protected abstract loadItems(itemsToLoad: IBufferPlaybackQueueItem<T>[], representation: Representation, priority?: Priority): Promise<void>;
|
|
52
|
+
protected abstract selectItemsToLoad(): IBufferPlaybackQueueItem<T>[];
|
|
53
|
+
protected abstract prepareFetchParams(items: IBufferPlaybackQueueItem<T>[], representation: Representation): FetchParamsWithUrl;
|
|
54
|
+
protected abstract onSomeDataLoaded(data: ISomeDataLoadedCallbackParams<T>): Promise<void>;
|
|
55
|
+
protected abstract updateRepresentationBaseUrl(representation: Representation, newBaseUrl: string): void;
|
|
56
|
+
startWith: ReturnType<typeof abortable<[Representation["id"]]>>;
|
|
57
|
+
switchTo: ReturnType<typeof abortable<[Representation["id"], boolean | undefined], void>>;
|
|
58
|
+
seek(position: Milliseconds): Promise<void>;
|
|
59
|
+
maintain(currentPosition?: Milliseconds | undefined): Promise<void>;
|
|
60
|
+
getForwardPlaybackBufferDuration(currentPosition?: Milliseconds | undefined): Milliseconds;
|
|
61
|
+
getPlaybackBufferState(): IRange<Milliseconds> | null;
|
|
62
|
+
abort(): Promise<void>;
|
|
63
|
+
findSegmentStartTime(position: Milliseconds): Milliseconds | undefined;
|
|
64
|
+
getRepresentationInitialTime(): Seconds;
|
|
65
|
+
calculateDurationFromSegments(representationId: Representation["id"]): Milliseconds;
|
|
66
|
+
get lastDataObtainedTimestamp(): Milliseconds;
|
|
67
|
+
setTarget(time: Milliseconds): void;
|
|
68
|
+
setPreloadOnly(preloadOnly: boolean): void;
|
|
69
|
+
destroy(): void;
|
|
70
|
+
protected forceSwitchCondition(oldRepresentation: Representation, newRepresentation: Representation): boolean;
|
|
71
|
+
protected clearBuffer(): Promise<void>;
|
|
72
|
+
protected abortDownload(): void;
|
|
73
|
+
protected abortDownloadingItems(): void;
|
|
74
|
+
protected abortNativeBuffer(): Promise<boolean>;
|
|
75
|
+
protected loadInits(startingRepresentation: Representation): Promise<void>;
|
|
76
|
+
protected loadInitIfNeeded(representation: Representation, requestedPriority?: Priority, critical?: boolean): Promise<void>;
|
|
77
|
+
protected loadInit(representation: Representation, requestedPriority?: Priority, critical?: boolean): Promise<void>;
|
|
78
|
+
protected maintainNativeBuffer(): Promise<void>;
|
|
79
|
+
protected maintainPlaybackBuffer(position: Milliseconds): Promise<void>;
|
|
80
|
+
protected actualizeLastSegmentInfo(currentPosition: Milliseconds): void;
|
|
81
|
+
protected selectDownloadingItems(position: Milliseconds, segments: T[]): IBufferPlaybackQueueItem<T>[];
|
|
82
|
+
protected processCachedItems(): Promise<void>;
|
|
83
|
+
protected withinInterval(currentPosition: Milliseconds | undefined, { from, to }: IRange<Milliseconds>, tolerance?: Milliseconds): boolean;
|
|
84
|
+
protected withinAppendInterval(currentPosition: Milliseconds | undefined, { from, to }: IRange<Milliseconds>): boolean;
|
|
85
|
+
protected withinRemoveInterval(currentPosition: Milliseconds | undefined, { to }: IRange<Milliseconds>): boolean;
|
|
86
|
+
protected waitExponentialDownloadDelay: ReturnType<typeof abortable>;
|
|
87
|
+
protected appendSegmentFully(nextPlayingItem: IBufferPlaybackQueueItem<T>, signal: AbortSignal): Promise<void>;
|
|
88
|
+
protected appendSegmentPartially(nextPlayingItem: IBufferPlaybackQueueItem<T>, signal: AbortSignal): Promise<void>;
|
|
89
|
+
protected parseFeedableSegmentChunk(chunk: DataView): DataView | null;
|
|
90
|
+
protected onItemFullyDownloaded(downloadedItem: IBufferPlaybackQueueItem<T>): void;
|
|
91
|
+
protected onItemFullyAppended(appendedItem: IBufferPlaybackQueueItem<T>): void;
|
|
92
|
+
protected removeSegment(nextRemoveItem: IBufferPlaybackQueueItem<T>, signal: AbortSignal): Promise<void>;
|
|
93
|
+
protected onDownloadItem(downloadedItem: IBufferPlaybackQueueItem<T>): Promise<void>;
|
|
94
|
+
protected pruneVirtualBuffer(currentPosition: Milliseconds): void;
|
|
95
|
+
protected updateRepresentationsBaseUrlIfNeeded(): void;
|
|
94
96
|
}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { BaseVirtualBufferManager } from
|
|
2
|
-
import { Dependencies, IBufferPlaybackQueueItem, ISomeDataLoadedCallbackParams, IVirtualBufferManager } from
|
|
3
|
-
import { ByteRangeSegment, 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 { ByteRangeSegment, Representation, StreamKind } from "../../../../utils/parsers/types";
|
|
4
|
+
import type { NativeBufferManager } from "../nativeBufferManager";
|
|
5
|
+
import type { FetchParamsWithUrl, Priority } from "../../fetcher";
|
|
6
6
|
export declare class ByteRangeVirtualBufferManager extends BaseVirtualBufferManager<ByteRangeSegment> 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<ByteRangeSegment>[], representation: Representation, priority?: Priority): Promise<void>;
|
|
9
|
+
protected selectItemsToLoad(): IBufferPlaybackQueueItem<ByteRangeSegment>[];
|
|
10
|
+
protected prepareFetchParams(items: IBufferPlaybackQueueItem<ByteRangeSegment>[], representation: Representation): FetchParamsWithUrl;
|
|
11
|
+
/**
|
|
12
|
+
* Закидываем в буфер сегменты атомарнее чем сегмент целиком. Например, по боксам в мпеге и по блокам в вебме.
|
|
13
|
+
* Таким образом не ждём его полной загрузки и готовы играть его намного быстрее
|
|
14
|
+
* @param dataView – данные, размер буфера – весь запрос
|
|
15
|
+
* @param globalFrom – Отступ dataView от начала файла, совпадает с отсупами сегментов
|
|
16
|
+
* @param loaded – Объём загруженных в dataView данных (всё что больше – пока нули)
|
|
17
|
+
* @private
|
|
18
|
+
*/
|
|
19
|
+
protected onSomeDataLoaded({ downloadingItems, dataView, representationId, globalFrom, loaded, signal }: ISomeDataLoadedCallbackParams<ByteRangeSegment>): Promise<void>;
|
|
20
|
+
protected updateRepresentationBaseUrl(representation: Representation, newBaseUrl: string): void;
|
|
21
21
|
}
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { TemplateVirtualBufferManager } from
|
|
2
|
-
import { Manifest, Representation, StreamKind, TemplateSegment, TemplateSegmentReference } from
|
|
3
|
-
import { NativeBufferManager } from
|
|
4
|
-
import { Dependencies, IBufferPlaybackQueueItem, ISomeDataLoadedCallbackParams } from
|
|
5
|
-
import { FetchParamsWithUrl, Priority } from
|
|
6
|
-
import { IRange, IValueSubject, Milliseconds } from
|
|
1
|
+
import { TemplateVirtualBufferManager } from "./templateVirtualBufferManager";
|
|
2
|
+
import type { Manifest, Representation, StreamKind, TemplateSegment, TemplateSegmentReference } from "../../../../utils/parsers/types";
|
|
3
|
+
import type { NativeBufferManager } from "../nativeBufferManager";
|
|
4
|
+
import type { Dependencies, IBufferPlaybackQueueItem, ISomeDataLoadedCallbackParams } from "../types";
|
|
5
|
+
import type { FetchParamsWithUrl, Priority } from "../../fetcher";
|
|
6
|
+
import type { IRange, IValueSubject, Milliseconds } from "@vkontakte/videoplayer-shared";
|
|
7
7
|
export declare class LiveVirtualBuffer extends TemplateVirtualBufferManager {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
8
|
+
currentLiveSegmentServerLatency$: IValueSubject<number>;
|
|
9
|
+
currentLowLatencySegmentLength$: IValueSubject<number>;
|
|
10
|
+
protected liveInitialAdditionalOffset: number;
|
|
11
|
+
protected isSeekingLive: boolean;
|
|
12
|
+
protected readonly isActiveLowLatency: () => boolean;
|
|
13
|
+
constructor(kind: StreamKind, nativeBufferManager: NativeBufferManager, representations: Representation[], dependencies: Dependencies);
|
|
14
|
+
updateManifest(manifest: Manifest | null): void;
|
|
15
|
+
proceedLowLatencyLive(): void;
|
|
16
|
+
getLiveSegmentsToLoadState(manifest: Manifest | null): IRange<Milliseconds> | undefined;
|
|
17
|
+
getRepresentationInitialTime(): Milliseconds;
|
|
18
|
+
protected prepareFetchParams(items: IBufferPlaybackQueueItem<TemplateSegment>[], representation: Representation): FetchParamsWithUrl;
|
|
19
|
+
protected onSomeDataLoaded({ downloadingItems, ...params }: ISomeDataLoadedCallbackParams<TemplateSegment>): Promise<void>;
|
|
20
|
+
protected onItemFullyDownloaded(downloadedItem: IBufferPlaybackQueueItem<TemplateSegment>): void;
|
|
21
|
+
protected updateLowLatencyItemTime(item: IBufferPlaybackQueueItem<TemplateSegment>): void;
|
|
22
|
+
protected updateLowLatencyLive(latestItem: IBufferPlaybackQueueItem<TemplateSegment>): void;
|
|
23
|
+
protected parseFeedableSegmentChunk(chunk: DataView): DataView | null;
|
|
24
|
+
protected getFetchUrl(items: IBufferPlaybackQueueItem<TemplateSegment>[], representation: Representation): URL;
|
|
25
|
+
protected loadInit(representation: Representation, requestedPriority?: Priority, critical?: boolean): Promise<void>;
|
|
26
|
+
protected getActualLiveStartingSegments(templateSegmentReference: TemplateSegmentReference): TemplateSegment[];
|
|
27
27
|
}
|