@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,16 +1,17 @@
|
|
|
1
|
-
import { DevNullEntry } from
|
|
1
|
+
import type { DevNullEntry } from "@vkontakte/videoplayer-shared";
|
|
2
2
|
declare class Entry {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
3
|
+
readonly tag: string;
|
|
4
|
+
readonly time: number;
|
|
5
|
+
readonly data: Record<string, unknown>;
|
|
6
|
+
readonly stack?: string | undefined;
|
|
7
|
+
constructor(tag: string, time: number, data: Record<string, unknown>, stack?: string | undefined);
|
|
8
|
+
toString(): string;
|
|
9
|
+
toDevNullEntry(): DevNullEntry;
|
|
10
10
|
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
type DebugFn = {
|
|
12
|
+
(data: Record<string, unknown>, addTrace?: boolean): void;
|
|
13
|
+
reset: () => void;
|
|
14
|
+
drain: () => Entry[];
|
|
15
15
|
};
|
|
16
|
+
export declare const dashLiveDebug: DebugFn;
|
|
16
17
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { HttpConnectionType } from
|
|
1
|
+
import { HttpConnectionType } from "../../player/types";
|
|
2
2
|
declare const _default: (headers: Headers) => {
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
type: HttpConnectionType | undefined;
|
|
4
|
+
reused: boolean | undefined;
|
|
5
5
|
};
|
|
6
6
|
export default _default;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Milliseconds } from
|
|
1
|
+
import type { Milliseconds } from "@vkontakte/videoplayer-shared";
|
|
2
2
|
export declare enum OffsetParameterType {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
OFFSET_P = 0,
|
|
4
|
+
PLAYBACK_SHIFT = 1,
|
|
5
|
+
DASH_CMAF_OFFSET_P = 2
|
|
6
6
|
}
|
|
7
7
|
declare const _default: (url: string, offset?: Milliseconds, type?: OffsetParameterType) => string;
|
|
8
8
|
export default _default;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { type IError } from
|
|
1
|
+
import { type IError } from "@vkontakte/videoplayer-shared";
|
|
2
2
|
export declare const guessNetworkError: (responseText: string) => IError | undefined;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { IRange, Milliseconds } from
|
|
1
|
+
import type { IRange, Milliseconds } from "@vkontakte/videoplayer-shared";
|
|
2
2
|
declare const mergeIntervals: (intervals: IRange<Milliseconds>[]) => IRange<Milliseconds>[];
|
|
3
3
|
export default mergeIntervals;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/** @fork https://github.com/sozialhelden/ietf-language-tags */
|
|
2
2
|
export interface ILanguageSubtag {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
3
|
+
langtag?: string;
|
|
4
|
+
language?: string;
|
|
5
|
+
extlang?: string;
|
|
6
|
+
script?: string;
|
|
7
|
+
region?: string;
|
|
8
|
+
variants?: string[];
|
|
9
|
+
extensions?: Record<string, string>;
|
|
10
|
+
privateuse?: string;
|
|
11
11
|
}
|
|
12
12
|
/** @fork https://github.com/sozialhelden/ietf-language-tags */
|
|
13
13
|
export declare const parseLangAttribute: (attr: string) => ILanguageSubtag | null;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { ContainerParser, MpegParser } from
|
|
1
|
+
import type { ContainerParser, MpegParser } from "./types";
|
|
2
2
|
export declare const getContainerParser: (mime: string) => ContainerParser;
|
|
3
3
|
export declare const isMp4Parser: (parser: ContainerParser) => parser is MpegParser;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { Manifest } from
|
|
1
|
+
import type { Manifest } from "./types";
|
|
2
2
|
export declare const replaceSegmentTemplate: (template: string, data: Partial<Record<"representationId" | "segmentNumber" | "bandwidth" | "segmentTime", string>>) => string;
|
|
3
3
|
export declare const parse: (text: string, manifestUrl: string) => Manifest;
|
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type { ValidBox } from "./box";
|
|
2
|
+
import { type Box } from "./box";
|
|
2
3
|
/**
|
|
3
|
-
|
|
4
|
-
|
|
4
|
+
* Queryable object to get needed boxes from structure
|
|
5
|
+
*/
|
|
5
6
|
export declare class BoxModel {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
7
|
+
private readonly index;
|
|
8
|
+
constructor(initialSet: Box[]);
|
|
9
|
+
/**
|
|
10
|
+
* Processes index creation
|
|
11
|
+
*/
|
|
12
|
+
private indexBoxLevel;
|
|
13
|
+
/**
|
|
14
|
+
* Returns first box of given type
|
|
15
|
+
*/
|
|
16
|
+
find<T extends Box>(type: string): ValidBox<T> | null;
|
|
17
|
+
/**
|
|
18
|
+
* Returns all boxes of given type
|
|
19
|
+
*/
|
|
20
|
+
findAll<T extends Box>(type: string): ValidBox<T>[];
|
|
20
21
|
}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { type Box } from
|
|
2
|
-
import { BoxTypeEnum } from
|
|
1
|
+
import { type Box } from "./box";
|
|
2
|
+
import { BoxTypeEnum } from "./BoxTypeEnum";
|
|
3
3
|
export declare const BOX_TYPE_MAP: Record<BoxTypeEnum, typeof Box>;
|
|
4
4
|
export interface BoxParserOptions {
|
|
5
|
-
|
|
5
|
+
offset: number;
|
|
6
6
|
}
|
|
7
7
|
/**
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
* Box parsing object
|
|
9
|
+
*/
|
|
10
10
|
export declare class BoxParser {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
11
|
+
private options;
|
|
12
|
+
constructor(opts?: Partial<BoxParserOptions>);
|
|
13
|
+
/**
|
|
14
|
+
* Parses DataView into the set of boxes
|
|
15
|
+
*/
|
|
16
|
+
parse(view: DataView): Box[];
|
|
17
|
+
/**
|
|
18
|
+
* Creates boxes from source DataView with exact type
|
|
19
|
+
*/
|
|
20
|
+
private createBox;
|
|
21
21
|
}
|
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
* 'Known' box types
|
|
3
|
+
*/
|
|
4
4
|
export declare enum BoxTypeEnum {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
5
|
+
FtypBox = "ftyp",
|
|
6
|
+
MoovBox = "moov",
|
|
7
|
+
MvhdBox = "mvhd",
|
|
8
|
+
MoofBox = "moof",
|
|
9
|
+
MdatBox = "mdat",
|
|
10
|
+
SidxBox = "sidx",
|
|
11
|
+
TrakBox = "trak",
|
|
12
|
+
MdiaBox = "mdia",
|
|
13
|
+
MfhdBox = "mfhd",
|
|
14
|
+
TkhdBox = "tkhd",
|
|
15
|
+
TrafBox = "traf",
|
|
16
|
+
TfhdBox = "tfhd",
|
|
17
|
+
TfdtBox = "tfdt",
|
|
18
|
+
TrunBox = "trun",
|
|
19
|
+
MinfBox = "minf",
|
|
20
|
+
Sv3dBox = "sv3d",
|
|
21
|
+
St3dBox = "st3d",
|
|
22
|
+
PrhdBox = "prhd",
|
|
23
|
+
ProjBox = "proj",
|
|
24
|
+
EquiBox = "equi",
|
|
25
|
+
UuidBox = "uuid",
|
|
26
|
+
StblBox = "stbl",
|
|
27
|
+
StsdBox = "stsd",
|
|
28
|
+
Avc1Box = "avc1",
|
|
29
|
+
UnknownBox = "unknown"
|
|
30
30
|
}
|
|
@@ -1,74 +1,74 @@
|
|
|
1
|
-
import { type BoxParser } from
|
|
1
|
+
import { type BoxParser } from "./BoxParser";
|
|
2
2
|
export type ValidBox<T extends Box> = T & {
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
valid: true;
|
|
4
|
+
size: number;
|
|
5
5
|
};
|
|
6
6
|
export declare const isValid: <T extends Box>(box: T) => box is ValidBox<T>;
|
|
7
7
|
/**
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
8
|
+
* Generic boxes description
|
|
9
|
+
*
|
|
10
|
+
* aligned(8) class Box (unsigned int(32) boxtype, optional unsigned int(8)[16] extended_type) {
|
|
11
|
+
* unsigned int(32) size;
|
|
12
|
+
* unsigned int(32) type = boxtype;
|
|
13
|
+
* if (size==1) {
|
|
14
|
+
* unsigned int(64) largesize;
|
|
15
|
+
* } else if (size==0) {
|
|
16
|
+
* // boxes extends to end of file
|
|
17
|
+
* }
|
|
18
|
+
* if (boxtype==‘uuid’) {
|
|
19
|
+
* unsigned int(8)[16] usertype = extended_type;
|
|
20
|
+
* }
|
|
21
|
+
* }
|
|
22
|
+
*/
|
|
23
23
|
export declare class Box {
|
|
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
|
-
|
|
24
|
+
source: DataView;
|
|
25
|
+
boxParser: BoxParser;
|
|
26
|
+
type: string;
|
|
27
|
+
size: number | undefined;
|
|
28
|
+
content: DataView;
|
|
29
|
+
valid: boolean;
|
|
30
|
+
children: Box[];
|
|
31
|
+
/**
|
|
32
|
+
* Next byte in source buffer to be read
|
|
33
|
+
*/
|
|
34
|
+
protected cursor: number;
|
|
35
|
+
/**
|
|
36
|
+
* for compatibility with old Box type
|
|
37
|
+
*/
|
|
38
|
+
get id(): string;
|
|
39
|
+
constructor(source: DataView, boxParser: BoxParser);
|
|
40
|
+
/**
|
|
41
|
+
* Internal method to scan for children
|
|
42
|
+
*/
|
|
43
|
+
protected scanForBoxes(view: DataView): Box[];
|
|
44
|
+
/**
|
|
45
|
+
* Reads given number of bytes from source buffer as a string
|
|
46
|
+
* starting from current cursor position and using provided encoding
|
|
47
|
+
* Moves cursor forward
|
|
48
|
+
*/
|
|
49
|
+
protected readString(byteLength: number, encoding?: string): string;
|
|
50
|
+
/**
|
|
51
|
+
* Reads 1 byte from source buffer as an unsigned integer
|
|
52
|
+
* starting from current cursor position
|
|
53
|
+
* Moves cursor forward
|
|
54
|
+
*/
|
|
55
|
+
protected readUint8(): number;
|
|
56
|
+
/**
|
|
57
|
+
* Reads 2 bytes from source buffer as an unsigned integer
|
|
58
|
+
* starting from current cursor position
|
|
59
|
+
* Moves cursor forward
|
|
60
|
+
*/
|
|
61
|
+
protected readUint16(): number;
|
|
62
|
+
/**
|
|
63
|
+
* Reads 4 bytes from source buffer as an unsigned integer
|
|
64
|
+
* starting from current cursor position
|
|
65
|
+
* Moves cursor forward
|
|
66
|
+
*/
|
|
67
|
+
protected readUint32(): number;
|
|
68
|
+
/**
|
|
69
|
+
* Reads 8 bytes from source buffer as an unsigned BigInt
|
|
70
|
+
* starting from current cursor position
|
|
71
|
+
* Moves cursor forward
|
|
72
|
+
*/
|
|
73
|
+
protected readUint64(): bigint;
|
|
74
74
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Box } from
|
|
2
|
-
import { BoxParser } from
|
|
1
|
+
import { Box } from "../box";
|
|
2
|
+
import type { BoxParser } from "../BoxParser";
|
|
3
3
|
/**
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
* Advance Video Coding Box
|
|
5
|
+
*/
|
|
6
6
|
export declare class Avc1Box extends Box {
|
|
7
|
-
|
|
7
|
+
constructor(source: DataView, boxParser: BoxParser);
|
|
8
8
|
}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { FullBox } from
|
|
2
|
-
import { type BoxParser } from
|
|
1
|
+
import { FullBox } from "../fullBox";
|
|
2
|
+
import { type BoxParser } from "../BoxParser";
|
|
3
3
|
/**
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
4
|
+
* aligned(8) class ProjectionDataBox(unsigned int(32) proj_type, unsigned int(8)version, unsigned int(24) flags)
|
|
5
|
+
* extends FullBox(proj_type, version, flags) {
|
|
6
|
+
* }
|
|
7
|
+
*
|
|
8
|
+
* aligned(8) class EquirectangularProjection ProjectionDataBox(‘equi’, 0, 0) {
|
|
9
|
+
* unsigned int(32) projection_bounds_top;
|
|
10
|
+
* unsigned int(32) projection_bounds_bottom;
|
|
11
|
+
* unsigned int(32) projection_bounds_left;
|
|
12
|
+
* unsigned int(32) projection_bounds_right;
|
|
13
|
+
* }
|
|
14
|
+
*/
|
|
15
15
|
export declare class EquiBox extends FullBox {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
16
|
+
projectionBoundsTop: number;
|
|
17
|
+
projectionBoundsBottom: number;
|
|
18
|
+
projectionBoundsLeft: number;
|
|
19
|
+
projectionBoundsRight: number;
|
|
20
|
+
constructor(source: DataView, boxParser: BoxParser);
|
|
21
21
|
}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { Box } from
|
|
2
|
-
import { type BoxParser } from
|
|
1
|
+
import { Box } from "../box";
|
|
2
|
+
import { type BoxParser } from "../BoxParser";
|
|
3
3
|
/**
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
4
|
+
* File Type Box description
|
|
5
|
+
*
|
|
6
|
+
* aligned(8) class FileTypeBox extends Box(‘ftyp’) {
|
|
7
|
+
* unsigned int(32) major_brand;
|
|
8
|
+
* unsigned int(32) minor_version;
|
|
9
|
+
* unsigned int(32) compatible_brands[]; // to end of the boxes
|
|
10
|
+
* }
|
|
11
|
+
*/
|
|
12
12
|
export declare class FtypBox extends Box {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
majorBrand: string;
|
|
14
|
+
minorVersion: number;
|
|
15
|
+
compatibleBrands: string[];
|
|
16
|
+
constructor(source: DataView, boxParser: BoxParser);
|
|
17
17
|
}
|
|
@@ -1,26 +1,27 @@
|
|
|
1
|
-
export { Box } from
|
|
2
|
-
export { UnknownBox } from
|
|
3
|
-
export { UuidBox } from
|
|
4
|
-
export { FtypBox } from
|
|
5
|
-
export { MoovBox } from
|
|
6
|
-
export { MvhdBox } from
|
|
7
|
-
export { MoofBox } from
|
|
8
|
-
export { MdatBox } from
|
|
9
|
-
export { SidxBox
|
|
10
|
-
export {
|
|
11
|
-
export {
|
|
12
|
-
export {
|
|
13
|
-
export {
|
|
14
|
-
export {
|
|
15
|
-
export {
|
|
16
|
-
export {
|
|
17
|
-
export {
|
|
18
|
-
export {
|
|
19
|
-
export {
|
|
20
|
-
export {
|
|
21
|
-
export {
|
|
22
|
-
export {
|
|
23
|
-
export {
|
|
24
|
-
export {
|
|
25
|
-
export {
|
|
26
|
-
export {
|
|
1
|
+
export { Box } from "../box";
|
|
2
|
+
export { UnknownBox } from "./unknown";
|
|
3
|
+
export { UuidBox } from "./uuid";
|
|
4
|
+
export { FtypBox } from "./ftyp";
|
|
5
|
+
export { MoovBox } from "./moov";
|
|
6
|
+
export { MvhdBox } from "./mvhd";
|
|
7
|
+
export { MoofBox } from "./moof";
|
|
8
|
+
export { MdatBox } from "./mdat";
|
|
9
|
+
export { SidxBox } from "./sidx";
|
|
10
|
+
export type { SidxBoxSegment } from "./sidx";
|
|
11
|
+
export { TrakBox } from "./trak";
|
|
12
|
+
export { Sv3dBox } from "./sv3d";
|
|
13
|
+
export { St3dBox } from "./st3d";
|
|
14
|
+
export { PrhdBox } from "./prhd";
|
|
15
|
+
export { EquiBox } from "./equi";
|
|
16
|
+
export { MdiaBox } from "./mdia";
|
|
17
|
+
export { TkhdBox } from "./tkhd";
|
|
18
|
+
export { MinfBox } from "./minf";
|
|
19
|
+
export { ProjBox } from "./proj";
|
|
20
|
+
export { MfhdBox } from "./mfhd";
|
|
21
|
+
export { TrafBox } from "./traf";
|
|
22
|
+
export { TfhdBox } from "./tfhd";
|
|
23
|
+
export { TfdtBox } from "./tfdt";
|
|
24
|
+
export { TrunBox } from "./trun";
|
|
25
|
+
export { StblBox } from "./stbl";
|
|
26
|
+
export { StsdBox } from "./stsd";
|
|
27
|
+
export { Avc1Box } from "./avc1";
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { Box } from
|
|
2
|
-
import { type BoxParser } from
|
|
1
|
+
import { Box } from "../box";
|
|
2
|
+
import { type BoxParser } from "../BoxParser";
|
|
3
3
|
/**
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
4
|
+
* Media Data Box
|
|
5
|
+
*
|
|
6
|
+
* All its content is binary media data
|
|
7
|
+
*
|
|
8
|
+
* aligned(8) class MediaDataBox extends Box(‘mdat’) {
|
|
9
|
+
* bit(8) data[];
|
|
10
|
+
* }
|
|
11
|
+
*/
|
|
12
12
|
export declare class MdatBox extends Box {
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
data: DataView;
|
|
14
|
+
constructor(source: DataView, boxParser: BoxParser);
|
|
15
15
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Box } from
|
|
2
|
-
import { BoxParser } from
|
|
1
|
+
import { Box } from "../box";
|
|
2
|
+
import type { BoxParser } from "../BoxParser";
|
|
3
3
|
/**
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
* aligned(8) class MediaBox extends Box(‘mdia’) {}
|
|
5
|
+
*/
|
|
6
6
|
export declare class MdiaBox extends Box {
|
|
7
|
-
|
|
7
|
+
constructor(source: DataView, boxParser: BoxParser);
|
|
8
8
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { FullBox } from
|
|
2
|
-
import { type BoxParser } from
|
|
1
|
+
import { FullBox } from "../fullBox";
|
|
2
|
+
import { type BoxParser } from "../BoxParser";
|
|
3
3
|
/**
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
* aligned(8) class MovieFragmentHeaderBox extends FullBox(‘mfhd’, 0, 0) {
|
|
5
|
+
* unsigned int(32) sequence_number;
|
|
6
|
+
* }
|
|
7
|
+
*/
|
|
8
8
|
export declare class MfhdBox extends FullBox {
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
sequenceNumber: number;
|
|
10
|
+
constructor(source: DataView, boxParser: BoxParser);
|
|
11
11
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Box } from
|
|
2
|
-
import { BoxParser } from
|
|
1
|
+
import { Box } from "../box";
|
|
2
|
+
import type { BoxParser } from "../BoxParser";
|
|
3
3
|
/**
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
* aligned(8) class MediaInformationBox extends Box(‘minf’) {}
|
|
5
|
+
*/
|
|
6
6
|
export declare class MinfBox extends Box {
|
|
7
|
-
|
|
7
|
+
constructor(source: DataView, boxParser: BoxParser);
|
|
8
8
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Box } from
|
|
2
|
-
import { BoxParser } from
|
|
1
|
+
import { Box } from "../box";
|
|
2
|
+
import type { BoxParser } from "../BoxParser";
|
|
3
3
|
/**
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
* aligned(8) class MovieFragmentBox extends Box(‘moof’) {}
|
|
5
|
+
*/
|
|
6
6
|
export declare class MoofBox extends Box {
|
|
7
|
-
|
|
7
|
+
constructor(source: DataView, boxParser: BoxParser);
|
|
8
8
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Box } from
|
|
2
|
-
import { BoxParser } from
|
|
1
|
+
import { Box } from "../box";
|
|
2
|
+
import type { BoxParser } from "../BoxParser";
|
|
3
3
|
/**
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
* aligned(8) class MovieBox extends Box(‘moov’) {}
|
|
5
|
+
*/
|
|
6
6
|
export declare class MoovBox extends Box {
|
|
7
|
-
|
|
7
|
+
constructor(source: DataView, boxParser: BoxParser);
|
|
8
8
|
}
|