@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.
Files changed (185) hide show
  1. package/es2015.cjs +83 -136
  2. package/es2015.esm.js +77 -130
  3. package/es2018.cjs +77 -130
  4. package/es2018.esm.js +75 -128
  5. package/es2024.cjs +83 -136
  6. package/es2024.esm.js +81 -134
  7. package/esnext.cjs +83 -136
  8. package/esnext.esm.js +81 -134
  9. package/evergreen.esm.js +82 -135
  10. package/package.json +2 -2
  11. package/types/enums/AndroidPreferredFormat.d.ts +6 -6
  12. package/types/enums/IOSPreferredFormat.d.ts +2 -2
  13. package/types/enums/WebmCodecStrategy.d.ts +5 -5
  14. package/types/index.d.ts +16 -13
  15. package/types/player/Player.d.ts +219 -210
  16. package/types/player/types.d.ts +595 -591
  17. package/types/player/utils/optimisticPosition.d.ts +7 -7
  18. package/types/player/utils/selectContainer.d.ts +1 -1
  19. package/types/providers/ChromecastPresentationApiProvider/ChromecastPresentationApiConnector.d.ts +107 -106
  20. package/types/providers/ChromecastPresentationApiProvider/ChromecastPresentationApiInitializer.d.ts +23 -23
  21. package/types/providers/ChromecastPresentationApiProvider/ChromecastPresentationApiProvider.d.ts +34 -34
  22. package/types/providers/ChromecastPresentationApiProvider/ProgressTicker.d.ts +9 -9
  23. package/types/providers/ChromecastPresentationApiProvider/index.d.ts +3 -3
  24. package/types/providers/ChromecastPresentationApiProvider/types.d.ts +31 -31
  25. package/types/providers/ChromecastPresentationApiProvider/utils.d.ts +1 -1
  26. package/types/providers/ChromecastProvider/ChromecastInitializer/index.d.ts +22 -22
  27. package/types/providers/ChromecastProvider/ChromecastInitializer/types.d.ts +22 -22
  28. package/types/providers/ChromecastProvider/index.d.ts +23 -23
  29. package/types/providers/ChromecastProvider/types.d.ts +7 -7
  30. package/types/providers/ChromecastProvider/utils.d.ts +1 -1
  31. package/types/providers/DashLiveProvider/DashLiveProvider.d.ts +33 -33
  32. package/types/providers/DashLiveProvider/index.d.ts +1 -1
  33. package/types/providers/DashLiveProvider/types.d.ts +17 -17
  34. package/types/providers/DashLiveProvider/utils/FilesFetcher.d.ts +23 -23
  35. package/types/providers/DashLiveProvider/utils/LiveDashPlayer.d.ts +149 -150
  36. package/types/providers/DashLiveProvider/utils/ThroughputEstimator.d.ts +12 -30
  37. package/types/providers/DashLiveProvider/utils/liveDashPlayerUtil.d.ts +19 -22
  38. package/types/providers/DashProvider/baseDashProvider.d.ts +57 -56
  39. package/types/providers/DashProvider/dashCmafLiveProvider.d.ts +6 -6
  40. package/types/providers/DashProvider/dashProvider.d.ts +4 -4
  41. package/types/providers/DashProvider/index.d.ts +2 -2
  42. package/types/providers/DashProvider/lib/ElementSizeManager.d.ts +14 -14
  43. package/types/providers/DashProvider/lib/LiveTextManager.d.ts +21 -21
  44. package/types/providers/DashProvider/lib/buffer.d.ts +123 -122
  45. package/types/providers/DashProvider/lib/fetcher.d.ts +70 -69
  46. package/types/providers/DashProvider/lib/player.d.ts +109 -107
  47. package/types/providers/DashProvider/lib/sourceBufferTaskQueue.d.ts +17 -17
  48. package/types/providers/DashProvider/lib/types.d.ts +20 -20
  49. package/types/providers/DashProvider/lib/utils.d.ts +4 -4
  50. package/types/providers/DashProviderVirtual/baseDashProvider.d.ts +58 -57
  51. package/types/providers/DashProviderVirtual/consts.d.ts +2 -2
  52. package/types/providers/DashProviderVirtual/dashCmafLiveProvider.d.ts +8 -8
  53. package/types/providers/DashProviderVirtual/dashProvider.d.ts +6 -6
  54. package/types/providers/DashProviderVirtual/index.d.ts +2 -2
  55. package/types/providers/DashProviderVirtual/lib/ElementSizeManager.d.ts +15 -14
  56. package/types/providers/DashProviderVirtual/lib/LiveTextManager.d.ts +21 -21
  57. package/types/providers/DashProviderVirtual/lib/buffer/nativeBufferManager.d.ts +17 -17
  58. package/types/providers/DashProviderVirtual/lib/buffer/sourceBufferTaskQueue.d.ts +17 -17
  59. package/types/providers/DashProviderVirtual/lib/buffer/types.d.ts +39 -39
  60. package/types/providers/DashProviderVirtual/lib/buffer/virtualBuffer/baseVirtualBufferManager.d.ts +94 -92
  61. package/types/providers/DashProviderVirtual/lib/buffer/virtualBuffer/byteRangeVirtualBufferManager.d.ts +19 -19
  62. package/types/providers/DashProviderVirtual/lib/buffer/virtualBuffer/liveVirtualBuffer.d.ts +25 -25
  63. package/types/providers/DashProviderVirtual/lib/buffer/virtualBuffer/templateVirtualBufferManager.d.ts +19 -19
  64. package/types/providers/DashProviderVirtual/lib/buffer/virtualBuffer/virtualBufferFactory.d.ts +4 -4
  65. package/types/providers/DashProviderVirtual/lib/fetcher.d.ts +68 -67
  66. package/types/providers/DashProviderVirtual/lib/player/basePlayer.d.ts +103 -100
  67. package/types/providers/DashProviderVirtual/lib/player/livePlayer.d.ts +34 -34
  68. package/types/providers/DashProviderVirtual/lib/player/player.d.ts +9 -9
  69. package/types/providers/DashProviderVirtual/lib/player/types.d.ts +13 -13
  70. package/types/providers/DashProviderVirtual/lib/types.d.ts +20 -20
  71. package/types/providers/DashProviderVirtual/lib/utils.d.ts +4 -4
  72. package/types/providers/HlsLiveProvider/LiveTextManager.d.ts +35 -35
  73. package/types/providers/HlsLiveProvider/index.d.ts +29 -28
  74. package/types/providers/HlsLiveProvider/seekBackTimeExtractor.d.ts +1 -1
  75. package/types/providers/HlsProvider/index.d.ts +19 -19
  76. package/types/providers/HlsProvider/manifestDataExtractor.d.ts +13 -13
  77. package/types/providers/MpegProvider/index.d.ts +17 -17
  78. package/types/providers/ProviderContainer/index.d.ts +47 -45
  79. package/types/providers/ProviderContainer/types.d.ts +16 -16
  80. package/types/providers/ProviderContainer/utils/formatsSupport.d.ts +9 -9
  81. package/types/providers/ProviderContainer/utils/playbackHangup.d.ts +9 -8
  82. package/types/providers/WebRTCLiveProvider/WebRTCLiveClient.d.ts +185 -185
  83. package/types/providers/WebRTCLiveProvider/WebRTCLiveProvider.d.ts +58 -57
  84. package/types/providers/WebRTCLiveProvider/interface/WebRTCLiveClientOptions.d.ts +6 -6
  85. package/types/providers/types.d.ts +103 -102
  86. package/types/providers/utils/HTMLVideoElement/DroppedFramesManager.d.ts +40 -39
  87. package/types/providers/utils/HTMLVideoElement/TextTrackManager.d.ts +28 -28
  88. package/types/providers/utils/HTMLVideoElement/forcePlay.d.ts +5 -5
  89. package/types/providers/utils/HTMLVideoElement/observable.d.ts +25 -25
  90. package/types/providers/utils/HTMLVideoElement/pool.d.ts +5 -4
  91. package/types/providers/utils/LiveOffset/index.d.ts +12 -12
  92. package/types/providers/utils/LiveOffset/types.d.ts +8 -8
  93. package/types/providers/utils/StallsManager.d.ts +49 -49
  94. package/types/providers/utils/debug.d.ts +13 -12
  95. package/types/providers/utils/extractConnectionHeaders.d.ts +3 -3
  96. package/types/providers/utils/generateLiveUrl.d.ts +4 -4
  97. package/types/providers/utils/guessNetworkErrorCause.d.ts +1 -1
  98. package/types/providers/utils/mergeIntervals.d.ts +1 -1
  99. package/types/providers/utils/okQualityStringToVideoQuality.d.ts +1 -1
  100. package/types/providers/utils/parsers/ietf/index.d.ts +8 -8
  101. package/types/providers/utils/parsers/index.d.ts +1 -1
  102. package/types/providers/utils/parsers/mpd.d.ts +1 -1
  103. package/types/providers/utils/parsers/mpeg/BoxModel.d.ts +18 -17
  104. package/types/providers/utils/parsers/mpeg/BoxParser.d.ts +15 -15
  105. package/types/providers/utils/parsers/mpeg/BoxTypeEnum.d.ts +27 -27
  106. package/types/providers/utils/parsers/mpeg/box.d.ts +68 -68
  107. package/types/providers/utils/parsers/mpeg/boxes/avc1.d.ts +5 -5
  108. package/types/providers/utils/parsers/mpeg/boxes/equi.d.ts +18 -18
  109. package/types/providers/utils/parsers/mpeg/boxes/ftyp.d.ts +14 -14
  110. package/types/providers/utils/parsers/mpeg/boxes/index.d.ts +27 -26
  111. package/types/providers/utils/parsers/mpeg/boxes/mdat.d.ts +12 -12
  112. package/types/providers/utils/parsers/mpeg/boxes/mdia.d.ts +5 -5
  113. package/types/providers/utils/parsers/mpeg/boxes/mfhd.d.ts +8 -8
  114. package/types/providers/utils/parsers/mpeg/boxes/minf.d.ts +5 -5
  115. package/types/providers/utils/parsers/mpeg/boxes/moof.d.ts +5 -5
  116. package/types/providers/utils/parsers/mpeg/boxes/moov.d.ts +5 -5
  117. package/types/providers/utils/parsers/mpeg/boxes/mvhd.d.ts +32 -32
  118. package/types/providers/utils/parsers/mpeg/boxes/prhd.d.ts +13 -13
  119. package/types/providers/utils/parsers/mpeg/boxes/proj.d.ts +5 -5
  120. package/types/providers/utils/parsers/mpeg/boxes/sidx.d.ts +43 -43
  121. package/types/providers/utils/parsers/mpeg/boxes/st3d.d.ts +16 -16
  122. package/types/providers/utils/parsers/mpeg/boxes/stbl.d.ts +5 -5
  123. package/types/providers/utils/parsers/mpeg/boxes/stsd.d.ts +8 -8
  124. package/types/providers/utils/parsers/mpeg/boxes/sv3d.d.ts +5 -5
  125. package/types/providers/utils/parsers/mpeg/boxes/tfdt.d.ts +14 -14
  126. package/types/providers/utils/parsers/mpeg/boxes/tfhd.d.ts +19 -19
  127. package/types/providers/utils/parsers/mpeg/boxes/tkhd.d.ts +39 -39
  128. package/types/providers/utils/parsers/mpeg/boxes/traf.d.ts +5 -5
  129. package/types/providers/utils/parsers/mpeg/boxes/trak.d.ts +5 -5
  130. package/types/providers/utils/parsers/mpeg/boxes/trun.d.ts +28 -28
  131. package/types/providers/utils/parsers/mpeg/boxes/unknown.d.ts +4 -5
  132. package/types/providers/utils/parsers/mpeg/boxes/uuid.d.ts +10 -10
  133. package/types/providers/utils/parsers/mpeg/fullBox.d.ts +12 -12
  134. package/types/providers/utils/parsers/mpeg/isobmff.d.ts +7 -7
  135. package/types/providers/utils/parsers/types.d.ts +137 -139
  136. package/types/providers/utils/parsers/webm/ebml.d.ts +62 -62
  137. package/types/providers/utils/parsers/webm/webm.d.ts +1 -1
  138. package/types/providers/utils/restorePlaybackRateInSafari.d.ts +17 -17
  139. package/types/providers/utils/syncDesiredState.d.ts +10 -10
  140. package/types/providers/utils/syncPlaybackState.d.ts +2 -2
  141. package/types/providers/utils/videoStreamRepresentaionsFilter.d.ts +2 -2
  142. package/types/utils/3d/Camera3D.d.ts +11 -11
  143. package/types/utils/3d/CameraRotationManager.d.ts +59 -59
  144. package/types/utils/3d/Scene3D.d.ts +129 -129
  145. package/types/utils/3d/types.d.ts +14 -14
  146. package/types/utils/ClientChecker/ClientChecker.d.ts +19 -19
  147. package/types/utils/ClientChecker/index.d.ts +2 -2
  148. package/types/utils/ClientChecker/services/AudioChecker.d.ts +7 -7
  149. package/types/utils/ClientChecker/services/BrowserChecker.d.ts +36 -36
  150. package/types/utils/ClientChecker/services/DeviceChecker.d.ts +38 -38
  151. package/types/utils/ClientChecker/services/DisplayChecker.d.ts +20 -20
  152. package/types/utils/ClientChecker/services/VideoChecker.d.ts +35 -35
  153. package/types/utils/ClientChecker/types/checker.d.ts +1 -1
  154. package/types/utils/ClientChecker/types/currentClientBrowser.d.ts +10 -10
  155. package/types/utils/ClientChecker/types/currentClientDevice.d.ts +8 -8
  156. package/types/utils/ClientChecker/types/userAgentData.d.ts +21 -21
  157. package/types/utils/StateMachine/StateMachine.d.ts +17 -17
  158. package/types/utils/StateMachine/types.d.ts +56 -56
  159. package/types/utils/StatefulIterator/index.d.ts +13 -13
  160. package/types/utils/ThroughputEstimator.d.ts +22 -22
  161. package/types/utils/VolumeMultiplierManager/VolumeMultiplierManager.d.ts +20 -20
  162. package/types/utils/VolumeMultiplierManager/index.d.ts +1 -1
  163. package/types/utils/autoSelectTrack.d.ts +28 -27
  164. package/types/utils/buffer/createTimeRanges.d.ts +2 -1
  165. package/types/utils/buffer/getBufferedRangeForPosition.d.ts +2 -2
  166. package/types/utils/buffer/getForwardBufferDuration.d.ts +1 -1
  167. package/types/utils/buffer/getTotalBufferDuration.d.ts +1 -1
  168. package/types/utils/buffer/isPositionBuffered.d.ts +1 -1
  169. package/types/utils/buffer/isSourceBufferValid.d.ts +1 -1
  170. package/types/utils/changePlaybackRate.d.ts +1 -1
  171. package/types/utils/decodingInfoLogger.d.ts +1 -1
  172. package/types/utils/mediaSource.d.ts +1 -5
  173. package/types/utils/observeElementVisibility.d.ts +1 -1
  174. package/types/utils/playbackTelemetry.d.ts +4 -4
  175. package/types/utils/playerOptions.d.ts +3 -3
  176. package/types/utils/qualityLimits.d.ts +15 -14
  177. package/types/utils/setStateWithSubscribe.d.ts +6 -3
  178. package/types/utils/smoothedValue/baseSmoothedValue.d.ts +16 -16
  179. package/types/utils/smoothedValue/emaAndMaSmoothedValue.d.ts +5 -5
  180. package/types/utils/smoothedValue/emaTopExtremumValue.d.ts +8 -8
  181. package/types/utils/smoothedValue/smoothedValueFactory.d.ts +4 -4
  182. package/types/utils/smoothedValue/twoEmaSmoothedValue.d.ts +6 -6
  183. package/types/utils/smoothedValue/types.d.ts +16 -16
  184. package/types/utils/tuningConfig.d.ts +304 -287
  185. package/types/utils/videoFormat.d.ts +1 -1
@@ -1,16 +1,17 @@
1
- import { DevNullEntry } from '@vkontakte/videoplayer-shared';
1
+ import type { DevNullEntry } from "@vkontakte/videoplayer-shared";
2
2
  declare class Entry {
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;
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
- export declare const dashLiveDebug: {
12
- (data: Record<string, unknown>, addTrace?: boolean): void;
13
- reset(): void;
14
- drain(): Entry[];
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 '../../player/types';
1
+ import { HttpConnectionType } from "../../player/types";
2
2
  declare const _default: (headers: Headers) => {
3
- type: HttpConnectionType | undefined;
4
- reused: boolean | undefined;
3
+ type: HttpConnectionType | undefined;
4
+ reused: boolean | undefined;
5
5
  };
6
6
  export default _default;
@@ -1,8 +1,8 @@
1
- import { Milliseconds } from '@vkontakte/videoplayer-shared';
1
+ import type { Milliseconds } from "@vkontakte/videoplayer-shared";
2
2
  export declare enum OffsetParameterType {
3
- OFFSET_P = 0,
4
- PLAYBACK_SHIFT = 1,
5
- DASH_CMAF_OFFSET_P = 2
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 '@vkontakte/videoplayer-shared';
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 '@vkontakte/videoplayer-shared';
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,3 +1,3 @@
1
- import { type ExactVideoQuality } from '@vkontakte/videoplayer-shared';
1
+ import { type ExactVideoQuality } from "@vkontakte/videoplayer-shared";
2
2
  declare const _default: (string: string) => ExactVideoQuality | undefined;
3
3
  export default _default;
@@ -1,13 +1,13 @@
1
1
  /** @fork https://github.com/sozialhelden/ietf-language-tags */
2
2
  export interface ILanguageSubtag {
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;
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 './types';
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 './types';
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 { type Box, ValidBox } from './box';
1
+ import type { ValidBox } from "./box";
2
+ import { type Box } from "./box";
2
3
  /**
3
- * Queryable object to get needed boxes from structure
4
- */
4
+ * Queryable object to get needed boxes from structure
5
+ */
5
6
  export declare class BoxModel {
6
- private readonly index;
7
- constructor(initialSet: Box[]);
8
- /**
9
- * Processes index creation
10
- */
11
- private indexBoxLevel;
12
- /**
13
- * Returns first box of given type
14
- */
15
- find<T extends Box>(type: string): ValidBox<T> | null;
16
- /**
17
- * Returns all boxes of given type
18
- */
19
- findAll<T extends Box>(type: string): ValidBox<T>[];
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 './box';
2
- import { BoxTypeEnum } from './BoxTypeEnum';
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
- offset: number;
5
+ offset: number;
6
6
  }
7
7
  /**
8
- * Box parsing object
9
- */
8
+ * Box parsing object
9
+ */
10
10
  export declare class BoxParser {
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;
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
- * 'Known' box types
3
- */
2
+ * 'Known' box types
3
+ */
4
4
  export declare enum BoxTypeEnum {
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"
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 './BoxParser';
1
+ import { type BoxParser } from "./BoxParser";
2
2
  export type ValidBox<T extends Box> = T & {
3
- valid: true;
4
- size: number;
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
- * 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
- */
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
- 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;
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 '../box';
2
- import { BoxParser } from '../BoxParser';
1
+ import { Box } from "../box";
2
+ import type { BoxParser } from "../BoxParser";
3
3
  /**
4
- * Advance Video Coding Box
5
- */
4
+ * Advance Video Coding Box
5
+ */
6
6
  export declare class Avc1Box extends Box {
7
- constructor(source: DataView, boxParser: BoxParser);
7
+ constructor(source: DataView, boxParser: BoxParser);
8
8
  }
@@ -1,21 +1,21 @@
1
- import { FullBox } from '../fullBox';
2
- import { type BoxParser } from '../BoxParser';
1
+ import { FullBox } from "../fullBox";
2
+ import { type BoxParser } from "../BoxParser";
3
3
  /**
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
- */
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
- projectionBoundsTop: number;
17
- projectionBoundsBottom: number;
18
- projectionBoundsLeft: number;
19
- projectionBoundsRight: number;
20
- constructor(source: DataView, boxParser: BoxParser);
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 '../box';
2
- import { type BoxParser } from '../BoxParser';
1
+ import { Box } from "../box";
2
+ import { type BoxParser } from "../BoxParser";
3
3
  /**
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
- */
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
- majorBrand: string;
14
- minorVersion: number;
15
- compatibleBrands: string[];
16
- constructor(source: DataView, boxParser: BoxParser);
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 '../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, SidxBoxSegment } from './sidx';
10
- export { TrakBox } from './trak';
11
- export { Sv3dBox } from './sv3d';
12
- export { St3dBox } from './st3d';
13
- export { PrhdBox } from './prhd';
14
- export { EquiBox } from './equi';
15
- export { MdiaBox } from './mdia';
16
- export { TkhdBox } from './tkhd';
17
- export { MinfBox } from './minf';
18
- export { ProjBox } from './proj';
19
- export { MfhdBox } from './mfhd';
20
- export { TrafBox } from './traf';
21
- export { TfhdBox } from './tfhd';
22
- export { TfdtBox } from './tfdt';
23
- export { TrunBox } from './trun';
24
- export { StblBox } from './stbl';
25
- export { StsdBox } from './stsd';
26
- export { Avc1Box } from './avc1';
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 '../box';
2
- import { type BoxParser } from '../BoxParser';
1
+ import { Box } from "../box";
2
+ import { type BoxParser } from "../BoxParser";
3
3
  /**
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
- */
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
- data: DataView;
14
- constructor(source: DataView, boxParser: BoxParser);
13
+ data: DataView;
14
+ constructor(source: DataView, boxParser: BoxParser);
15
15
  }
@@ -1,8 +1,8 @@
1
- import { Box } from '../box';
2
- import { BoxParser } from '../BoxParser';
1
+ import { Box } from "../box";
2
+ import type { BoxParser } from "../BoxParser";
3
3
  /**
4
- * aligned(8) class MediaBox extends Box(‘mdia’) {}
5
- */
4
+ * aligned(8) class MediaBox extends Box(‘mdia’) {}
5
+ */
6
6
  export declare class MdiaBox extends Box {
7
- constructor(source: DataView, boxParser: BoxParser);
7
+ constructor(source: DataView, boxParser: BoxParser);
8
8
  }
@@ -1,11 +1,11 @@
1
- import { FullBox } from '../fullBox';
2
- import { type BoxParser } from '../BoxParser';
1
+ import { FullBox } from "../fullBox";
2
+ import { type BoxParser } from "../BoxParser";
3
3
  /**
4
- * aligned(8) class MovieFragmentHeaderBox extends FullBox(‘mfhd’, 0, 0) {
5
- * unsigned int(32) sequence_number;
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
- sequenceNumber: number;
10
- constructor(source: DataView, boxParser: BoxParser);
9
+ sequenceNumber: number;
10
+ constructor(source: DataView, boxParser: BoxParser);
11
11
  }
@@ -1,8 +1,8 @@
1
- import { Box } from '../box';
2
- import { BoxParser } from '../BoxParser';
1
+ import { Box } from "../box";
2
+ import type { BoxParser } from "../BoxParser";
3
3
  /**
4
- * aligned(8) class MediaInformationBox extends Box(‘minf’) {}
5
- */
4
+ * aligned(8) class MediaInformationBox extends Box(‘minf’) {}
5
+ */
6
6
  export declare class MinfBox extends Box {
7
- constructor(source: DataView, boxParser: BoxParser);
7
+ constructor(source: DataView, boxParser: BoxParser);
8
8
  }
@@ -1,8 +1,8 @@
1
- import { Box } from '../box';
2
- import { BoxParser } from '../BoxParser';
1
+ import { Box } from "../box";
2
+ import type { BoxParser } from "../BoxParser";
3
3
  /**
4
- * aligned(8) class MovieFragmentBox extends Box(‘moof’) {}
5
- */
4
+ * aligned(8) class MovieFragmentBox extends Box(‘moof’) {}
5
+ */
6
6
  export declare class MoofBox extends Box {
7
- constructor(source: DataView, boxParser: BoxParser);
7
+ constructor(source: DataView, boxParser: BoxParser);
8
8
  }
@@ -1,8 +1,8 @@
1
- import { Box } from '../box';
2
- import { BoxParser } from '../BoxParser';
1
+ import { Box } from "../box";
2
+ import type { BoxParser } from "../BoxParser";
3
3
  /**
4
- * aligned(8) class MovieBox extends Box(‘moov’) {}
5
- */
4
+ * aligned(8) class MovieBox extends Box(‘moov’) {}
5
+ */
6
6
  export declare class MoovBox extends Box {
7
- constructor(source: DataView, boxParser: BoxParser);
7
+ constructor(source: DataView, boxParser: BoxParser);
8
8
  }