@remotion/media-parser 4.0.537 → 4.0.539
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/dist/aac-codecprivate.d.ts +2 -2
- package/dist/containers/avc/interpret-sps.js +2 -1
- package/dist/containers/avc/key.d.ts +1 -1
- package/dist/containers/flac/get-block-size.d.ts +1 -1
- package/dist/containers/flac/get-sample-rate.d.ts +1 -1
- package/dist/containers/flac/get-sample-rate.js +2 -1
- package/dist/containers/flac/parse-flac-frame.js +2 -1
- package/dist/containers/iso-base-media/collect-sample-positions-from-trak.d.ts +1 -1
- package/dist/containers/iso-base-media/find-track-to-seek.d.ts +1 -1
- package/dist/containers/iso-base-media/get-video-codec-from-iso-track.d.ts +1 -1
- package/dist/containers/iso-base-media/make-track.js +4 -3
- package/dist/containers/mp3/samples-per-mpeg-file.d.ts +1 -1
- package/dist/containers/riff/convert-queued-sample-to-mediaparser-sample.d.ts +4 -4
- package/dist/containers/riff/convert-queued-sample-to-mediaparser-sample.js +2 -1
- package/dist/containers/riff/has-index.js +2 -1
- package/dist/containers/riff/seeking-hints.js +2 -1
- package/dist/containers/transport-stream/process-audio.js +4 -2
- package/dist/containers/webm/seek/get-seeking-byte.js +4 -3
- package/dist/containers/webm/segments/all-segments.d.ts +563 -563
- package/dist/containers/webm/segments/block-simple-block-flags.d.ts +1 -1
- package/dist/containers/webm/traversal.js +2 -1
- package/dist/controller/emitter.js +5 -5
- package/dist/download-and-parse-media.js +2 -1
- package/dist/emit-available-info.js +31 -30
- package/dist/esm/index.mjs +1 -1
- package/dist/get-duration.d.ts +1 -1
- package/dist/get-duration.js +2 -1
- package/dist/get-fps.js +2 -1
- package/dist/get-number-of-audio-channels.js +2 -1
- package/dist/get-sample-rate.js +2 -1
- package/dist/get-tracks.js +2 -1
- package/dist/get-video-codec.js +2 -1
- package/dist/index.d.ts +454 -1056
- package/dist/log.d.ts +6 -6
- package/dist/metadata/metadata-from-iso.js +2 -1
- package/dist/register-track.d.ts +2 -2
- package/dist/state/iso-base-media/cached-sample-positions.js +2 -1
- package/dist/state/m3u-state.d.ts +2 -2
- package/dist/state/matroska/lazy-cues-fetch.js +4 -3
- package/dist/state/matroska/webm.d.ts +1 -1
- package/dist/state/parser-state.d.ts +37 -43
- package/dist/state/riff/lazy-idx1-fetch.d.ts +2 -2
- package/dist/state/riff/sample-counter.js +2 -1
- package/dist/state/riff.d.ts +2 -2
- package/dist/state/transport-stream/last-emitted-sample.d.ts +1 -1
- package/dist/state/transport-stream/observed-pes-header.d.ts +1 -1
- package/dist/state/transport-stream/transport-stream.d.ts +1 -1
- package/dist/state/video-section.d.ts +4 -10
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +6 -6
|
@@ -5,5 +5,5 @@ type BlockFlags = {
|
|
|
5
5
|
lacing: number;
|
|
6
6
|
keyframe: boolean | null;
|
|
7
7
|
};
|
|
8
|
-
export declare const parseBlockFlags: (iterator: BufferIterator, type: (typeof matroskaElements)[
|
|
8
|
+
export declare const parseBlockFlags: (iterator: BufferIterator, type: (typeof matroskaElements)['Block'] | (typeof matroskaElements)['SimpleBlock']) => BlockFlags;
|
|
9
9
|
export {};
|
|
@@ -172,7 +172,8 @@ const getTracksSegment = (segment) => {
|
|
|
172
172
|
};
|
|
173
173
|
exports.getTracksSegment = getTracksSegment;
|
|
174
174
|
const getTrackWithUid = (segment, trackUid) => {
|
|
175
|
-
var _a
|
|
175
|
+
var _a;
|
|
176
|
+
var _b;
|
|
176
177
|
const tracksSegment = (0, exports.getTracksSegment)(segment);
|
|
177
178
|
if (!tracksSegment) {
|
|
178
179
|
return null;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
3
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
4
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
5
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
6
|
+
};
|
|
2
7
|
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
3
8
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
4
9
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
5
10
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
6
11
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
7
12
|
};
|
|
8
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
9
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
10
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
11
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
12
|
-
};
|
|
13
13
|
var _MediaParserEmitter_markAsReady;
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.MediaParserEmitter = void 0;
|
|
@@ -65,7 +65,8 @@ const downloadAndParseMedia = async (options) => {
|
|
|
65
65
|
controller: (_14 = options.controller) !== null && _14 !== void 0 ? _14 : undefined,
|
|
66
66
|
src: options.src,
|
|
67
67
|
onError: async (err) => {
|
|
68
|
-
var _a
|
|
68
|
+
var _a;
|
|
69
|
+
var _b;
|
|
69
70
|
const action = (_b = (await ((_a = options.onError) === null || _a === void 0 ? void 0 : _a.call(options, err)))) !== null && _b !== void 0 ? _b : { action: 'fail' };
|
|
70
71
|
if (action.action === 'fail') {
|
|
71
72
|
log_1.Log.verbose(logLevel, 'Removing content');
|
|
@@ -17,7 +17,8 @@ const get_video_codec_1 = require("./get-video-codec");
|
|
|
17
17
|
const get_metadata_1 = require("./metadata/get-metadata");
|
|
18
18
|
const work_on_seek_request_1 = require("./work-on-seek-request");
|
|
19
19
|
const emitAvailableInfo = async ({ hasInfo, state, }) => {
|
|
20
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3
|
|
20
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3;
|
|
21
|
+
var _4, _5, _6;
|
|
21
22
|
const keys = Object.keys(hasInfo);
|
|
22
23
|
const { emittedFields, fieldsInReturnValue, returnValue, name, callbackFunctions, } = state;
|
|
23
24
|
for (const key of keys) {
|
|
@@ -48,8 +49,8 @@ const emitAvailableInfo = async ({ hasInfo, state, }) => {
|
|
|
48
49
|
if (key === 'slowDurationInSeconds') {
|
|
49
50
|
if (hasInfo.slowDurationInSeconds &&
|
|
50
51
|
!emittedFields.slowDurationInSeconds) {
|
|
51
|
-
const slowDurationInSeconds = (
|
|
52
|
-
await ((
|
|
52
|
+
const slowDurationInSeconds = (_4 = (0, get_duration_1.getDuration)(state)) !== null && _4 !== void 0 ? _4 : state.samplesObserved.getSlowDurationInSeconds();
|
|
53
|
+
await ((_c = callbackFunctions.onSlowDurationInSeconds) === null || _c === void 0 ? void 0 : _c.call(callbackFunctions, slowDurationInSeconds));
|
|
53
54
|
if (fieldsInReturnValue.slowDurationInSeconds) {
|
|
54
55
|
returnValue.slowDurationInSeconds = slowDurationInSeconds;
|
|
55
56
|
}
|
|
@@ -61,7 +62,7 @@ const emitAvailableInfo = async ({ hasInfo, state, }) => {
|
|
|
61
62
|
if (hasInfo.fps) {
|
|
62
63
|
if (!emittedFields.fps) {
|
|
63
64
|
const fps = (0, get_fps_1.getFps)(state);
|
|
64
|
-
await ((
|
|
65
|
+
await ((_d = callbackFunctions.onFps) === null || _d === void 0 ? void 0 : _d.call(callbackFunctions, fps));
|
|
65
66
|
if (fieldsInReturnValue.fps) {
|
|
66
67
|
returnValue.fps = fps;
|
|
67
68
|
}
|
|
@@ -70,7 +71,7 @@ const emitAvailableInfo = async ({ hasInfo, state, }) => {
|
|
|
70
71
|
if (!emittedFields.slowFps) {
|
|
71
72
|
const fps = (0, get_fps_1.getFps)(state);
|
|
72
73
|
if (fps) {
|
|
73
|
-
await ((
|
|
74
|
+
await ((_e = callbackFunctions.onSlowFps) === null || _e === void 0 ? void 0 : _e.call(callbackFunctions, fps));
|
|
74
75
|
if (fieldsInReturnValue.slowFps) {
|
|
75
76
|
returnValue.slowFps = fps;
|
|
76
77
|
}
|
|
@@ -83,8 +84,8 @@ const emitAvailableInfo = async ({ hasInfo, state, }) => {
|
|
|
83
84
|
// must be handled after fps
|
|
84
85
|
if (key === 'slowFps') {
|
|
85
86
|
if (hasInfo.slowFps && !emittedFields.slowFps) {
|
|
86
|
-
const slowFps = (
|
|
87
|
-
await ((
|
|
87
|
+
const slowFps = (_5 = (0, get_fps_1.getFps)(state)) !== null && _5 !== void 0 ? _5 : state.samplesObserved.getFps();
|
|
88
|
+
await ((_f = callbackFunctions.onSlowFps) === null || _f === void 0 ? void 0 : _f.call(callbackFunctions, slowFps));
|
|
88
89
|
if (fieldsInReturnValue.slowFps) {
|
|
89
90
|
returnValue.slowFps = slowFps;
|
|
90
91
|
}
|
|
@@ -101,7 +102,7 @@ const emitAvailableInfo = async ({ hasInfo, state, }) => {
|
|
|
101
102
|
height: dimensionsQueried.height,
|
|
102
103
|
width: dimensionsQueried.width,
|
|
103
104
|
};
|
|
104
|
-
await ((
|
|
105
|
+
await ((_g = callbackFunctions.onDimensions) === null || _g === void 0 ? void 0 : _g.call(callbackFunctions, dimensions));
|
|
105
106
|
if (fieldsInReturnValue.dimensions) {
|
|
106
107
|
returnValue.dimensions = dimensions;
|
|
107
108
|
}
|
|
@@ -118,7 +119,7 @@ const emitAvailableInfo = async ({ hasInfo, state, }) => {
|
|
|
118
119
|
height: dimensionsQueried.unrotatedHeight,
|
|
119
120
|
width: dimensionsQueried.unrotatedWidth,
|
|
120
121
|
};
|
|
121
|
-
await ((
|
|
122
|
+
await ((_h = callbackFunctions.onUnrotatedDimensions) === null || _h === void 0 ? void 0 : _h.call(callbackFunctions, unrotatedDimensions));
|
|
122
123
|
if (fieldsInReturnValue.unrotatedDimensions) {
|
|
123
124
|
returnValue.unrotatedDimensions = unrotatedDimensions;
|
|
124
125
|
}
|
|
@@ -129,8 +130,8 @@ const emitAvailableInfo = async ({ hasInfo, state, }) => {
|
|
|
129
130
|
if (key === 'rotation') {
|
|
130
131
|
if (hasInfo.rotation && !emittedFields.rotation) {
|
|
131
132
|
const dimensionsQueried = (0, get_dimensions_1.getDimensions)(state);
|
|
132
|
-
const rotation = (
|
|
133
|
-
await ((
|
|
133
|
+
const rotation = (_6 = dimensionsQueried === null || dimensionsQueried === void 0 ? void 0 : dimensionsQueried.rotation) !== null && _6 !== void 0 ? _6 : 0;
|
|
134
|
+
await ((_j = callbackFunctions.onRotation) === null || _j === void 0 ? void 0 : _j.call(callbackFunctions, rotation));
|
|
134
135
|
if (fieldsInReturnValue.rotation) {
|
|
135
136
|
returnValue.rotation = rotation;
|
|
136
137
|
}
|
|
@@ -141,7 +142,7 @@ const emitAvailableInfo = async ({ hasInfo, state, }) => {
|
|
|
141
142
|
if (key === 'videoCodec') {
|
|
142
143
|
if (!emittedFields.videoCodec && hasInfo.videoCodec) {
|
|
143
144
|
const videoCodec = (0, get_video_codec_1.getVideoCodec)(state);
|
|
144
|
-
await ((
|
|
145
|
+
await ((_k = callbackFunctions.onVideoCodec) === null || _k === void 0 ? void 0 : _k.call(callbackFunctions, videoCodec));
|
|
145
146
|
if (fieldsInReturnValue.videoCodec) {
|
|
146
147
|
returnValue.videoCodec = videoCodec;
|
|
147
148
|
}
|
|
@@ -152,7 +153,7 @@ const emitAvailableInfo = async ({ hasInfo, state, }) => {
|
|
|
152
153
|
if (key === 'audioCodec') {
|
|
153
154
|
if (!emittedFields.audioCodec && hasInfo.audioCodec) {
|
|
154
155
|
const audioCodec = (0, get_audio_codec_1.getAudioCodec)(state);
|
|
155
|
-
await ((
|
|
156
|
+
await ((_l = callbackFunctions.onAudioCodec) === null || _l === void 0 ? void 0 : _l.call(callbackFunctions, audioCodec));
|
|
156
157
|
if (fieldsInReturnValue.audioCodec) {
|
|
157
158
|
returnValue.audioCodec = audioCodec;
|
|
158
159
|
}
|
|
@@ -163,7 +164,7 @@ const emitAvailableInfo = async ({ hasInfo, state, }) => {
|
|
|
163
164
|
if (key === 'tracks') {
|
|
164
165
|
if (!emittedFields.tracks && hasInfo.tracks) {
|
|
165
166
|
const tracks = (0, get_tracks_1.getTracks)(state, true);
|
|
166
|
-
await ((
|
|
167
|
+
await ((_m = callbackFunctions.onTracks) === null || _m === void 0 ? void 0 : _m.call(callbackFunctions, tracks));
|
|
167
168
|
if (fieldsInReturnValue.tracks) {
|
|
168
169
|
returnValue.tracks = tracks;
|
|
169
170
|
}
|
|
@@ -184,7 +185,7 @@ const emitAvailableInfo = async ({ hasInfo, state, }) => {
|
|
|
184
185
|
}
|
|
185
186
|
if (key === 'size') {
|
|
186
187
|
if (!emittedFields.size && hasInfo.size) {
|
|
187
|
-
await ((
|
|
188
|
+
await ((_o = callbackFunctions.onSize) === null || _o === void 0 ? void 0 : _o.call(callbackFunctions, state.contentLength));
|
|
188
189
|
if (fieldsInReturnValue.size) {
|
|
189
190
|
returnValue.size = state.contentLength;
|
|
190
191
|
}
|
|
@@ -194,7 +195,7 @@ const emitAvailableInfo = async ({ hasInfo, state, }) => {
|
|
|
194
195
|
}
|
|
195
196
|
if (key === 'mimeType') {
|
|
196
197
|
if (!emittedFields.mimeType && hasInfo.mimeType) {
|
|
197
|
-
await ((
|
|
198
|
+
await ((_p = callbackFunctions.onMimeType) === null || _p === void 0 ? void 0 : _p.call(callbackFunctions, state.mimeType));
|
|
198
199
|
if (fieldsInReturnValue.mimeType) {
|
|
199
200
|
returnValue.mimeType = state.mimeType;
|
|
200
201
|
}
|
|
@@ -204,7 +205,7 @@ const emitAvailableInfo = async ({ hasInfo, state, }) => {
|
|
|
204
205
|
}
|
|
205
206
|
if (key === 'name') {
|
|
206
207
|
if (!emittedFields.name && hasInfo.name) {
|
|
207
|
-
await ((
|
|
208
|
+
await ((_q = callbackFunctions.onName) === null || _q === void 0 ? void 0 : _q.call(callbackFunctions, name));
|
|
208
209
|
if (fieldsInReturnValue.name) {
|
|
209
210
|
returnValue.name = name;
|
|
210
211
|
}
|
|
@@ -215,7 +216,7 @@ const emitAvailableInfo = async ({ hasInfo, state, }) => {
|
|
|
215
216
|
if (key === 'isHdr') {
|
|
216
217
|
if (!returnValue.isHdr && hasInfo.isHdr) {
|
|
217
218
|
const isHdr = (0, get_is_hdr_1.getIsHdr)(state);
|
|
218
|
-
await ((
|
|
219
|
+
await ((_r = callbackFunctions.onIsHdr) === null || _r === void 0 ? void 0 : _r.call(callbackFunctions, isHdr));
|
|
219
220
|
if (fieldsInReturnValue.isHdr) {
|
|
220
221
|
returnValue.isHdr = isHdr;
|
|
221
222
|
}
|
|
@@ -226,7 +227,7 @@ const emitAvailableInfo = async ({ hasInfo, state, }) => {
|
|
|
226
227
|
if (key === 'container') {
|
|
227
228
|
if (!returnValue.container && hasInfo.container) {
|
|
228
229
|
const container = (0, get_container_1.getContainer)(state.structure.getStructure());
|
|
229
|
-
await ((
|
|
230
|
+
await ((_s = callbackFunctions.onContainer) === null || _s === void 0 ? void 0 : _s.call(callbackFunctions, container));
|
|
230
231
|
if (fieldsInReturnValue.container) {
|
|
231
232
|
returnValue.container = container;
|
|
232
233
|
}
|
|
@@ -237,7 +238,7 @@ const emitAvailableInfo = async ({ hasInfo, state, }) => {
|
|
|
237
238
|
if (key === 'metadata') {
|
|
238
239
|
if (!emittedFields.metadata && hasInfo.metadata) {
|
|
239
240
|
const metadata = (0, get_metadata_1.getMetadata)(state);
|
|
240
|
-
await ((
|
|
241
|
+
await ((_t = callbackFunctions.onMetadata) === null || _t === void 0 ? void 0 : _t.call(callbackFunctions, metadata));
|
|
241
242
|
if (fieldsInReturnValue.metadata) {
|
|
242
243
|
returnValue.metadata = metadata;
|
|
243
244
|
}
|
|
@@ -248,7 +249,7 @@ const emitAvailableInfo = async ({ hasInfo, state, }) => {
|
|
|
248
249
|
if (key === 'location') {
|
|
249
250
|
if (!emittedFields.location && hasInfo.location) {
|
|
250
251
|
const location = (0, get_location_1.getLocation)(state);
|
|
251
|
-
await ((
|
|
252
|
+
await ((_u = callbackFunctions.onLocation) === null || _u === void 0 ? void 0 : _u.call(callbackFunctions, location));
|
|
252
253
|
if (fieldsInReturnValue.location) {
|
|
253
254
|
returnValue.location = location;
|
|
254
255
|
}
|
|
@@ -258,7 +259,7 @@ const emitAvailableInfo = async ({ hasInfo, state, }) => {
|
|
|
258
259
|
}
|
|
259
260
|
if (key === 'slowKeyframes') {
|
|
260
261
|
if (!emittedFields.slowKeyframes && hasInfo.slowKeyframes) {
|
|
261
|
-
await ((
|
|
262
|
+
await ((_v = callbackFunctions.onSlowKeyframes) === null || _v === void 0 ? void 0 : _v.call(callbackFunctions, state.keyframes.getKeyframes()));
|
|
262
263
|
if (fieldsInReturnValue.slowKeyframes) {
|
|
263
264
|
returnValue.slowKeyframes = state.keyframes.getKeyframes();
|
|
264
265
|
}
|
|
@@ -268,7 +269,7 @@ const emitAvailableInfo = async ({ hasInfo, state, }) => {
|
|
|
268
269
|
}
|
|
269
270
|
if (key === 'slowNumberOfFrames') {
|
|
270
271
|
if (!emittedFields.slowNumberOfFrames && hasInfo.slowNumberOfFrames) {
|
|
271
|
-
await ((
|
|
272
|
+
await ((_w = callbackFunctions.onSlowNumberOfFrames) === null || _w === void 0 ? void 0 : _w.call(callbackFunctions, state.samplesObserved.getSlowNumberOfFrames()));
|
|
272
273
|
if (fieldsInReturnValue.slowNumberOfFrames) {
|
|
273
274
|
returnValue.slowNumberOfFrames =
|
|
274
275
|
state.samplesObserved.getSlowNumberOfFrames();
|
|
@@ -279,7 +280,7 @@ const emitAvailableInfo = async ({ hasInfo, state, }) => {
|
|
|
279
280
|
}
|
|
280
281
|
if (key === 'slowAudioBitrate') {
|
|
281
282
|
if (!emittedFields.slowAudioBitrate && hasInfo.slowAudioBitrate) {
|
|
282
|
-
await ((
|
|
283
|
+
await ((_x = callbackFunctions.onSlowAudioBitrate) === null || _x === void 0 ? void 0 : _x.call(callbackFunctions, state.samplesObserved.getAudioBitrate()));
|
|
283
284
|
if (fieldsInReturnValue.slowAudioBitrate) {
|
|
284
285
|
returnValue.slowAudioBitrate =
|
|
285
286
|
state.samplesObserved.getAudioBitrate();
|
|
@@ -290,7 +291,7 @@ const emitAvailableInfo = async ({ hasInfo, state, }) => {
|
|
|
290
291
|
}
|
|
291
292
|
if (key === 'slowVideoBitrate') {
|
|
292
293
|
if (!emittedFields.slowVideoBitrate && hasInfo.slowVideoBitrate) {
|
|
293
|
-
await ((
|
|
294
|
+
await ((_y = callbackFunctions.onSlowVideoBitrate) === null || _y === void 0 ? void 0 : _y.call(callbackFunctions, state.samplesObserved.getVideoBitrate()));
|
|
294
295
|
if (fieldsInReturnValue.slowVideoBitrate) {
|
|
295
296
|
returnValue.slowVideoBitrate =
|
|
296
297
|
state.samplesObserved.getVideoBitrate();
|
|
@@ -301,7 +302,7 @@ const emitAvailableInfo = async ({ hasInfo, state, }) => {
|
|
|
301
302
|
}
|
|
302
303
|
if (key === 'keyframes') {
|
|
303
304
|
if (!emittedFields.keyframes && hasInfo.keyframes) {
|
|
304
|
-
await ((
|
|
305
|
+
await ((_z = callbackFunctions.onKeyframes) === null || _z === void 0 ? void 0 : _z.call(callbackFunctions, (0, get_keyframes_1.getKeyframes)(state)));
|
|
305
306
|
if (fieldsInReturnValue.keyframes) {
|
|
306
307
|
returnValue.keyframes = (0, get_keyframes_1.getKeyframes)(state);
|
|
307
308
|
}
|
|
@@ -311,7 +312,7 @@ const emitAvailableInfo = async ({ hasInfo, state, }) => {
|
|
|
311
312
|
}
|
|
312
313
|
if (key === 'images') {
|
|
313
314
|
if (!emittedFields.images && hasInfo.images) {
|
|
314
|
-
await ((
|
|
315
|
+
await ((_0 = callbackFunctions.onImages) === null || _0 === void 0 ? void 0 : _0.call(callbackFunctions, state.images.images));
|
|
315
316
|
if (fieldsInReturnValue.images) {
|
|
316
317
|
returnValue.images = state.images.images;
|
|
317
318
|
}
|
|
@@ -322,7 +323,7 @@ const emitAvailableInfo = async ({ hasInfo, state, }) => {
|
|
|
322
323
|
if (key === 'sampleRate') {
|
|
323
324
|
if (!emittedFields.sampleRate && hasInfo.sampleRate) {
|
|
324
325
|
const sampleRate = (0, get_sample_rate_1.getSampleRate)(state);
|
|
325
|
-
await ((
|
|
326
|
+
await ((_1 = callbackFunctions.onSampleRate) === null || _1 === void 0 ? void 0 : _1.call(callbackFunctions, sampleRate));
|
|
326
327
|
if (fieldsInReturnValue.sampleRate) {
|
|
327
328
|
returnValue.sampleRate = sampleRate;
|
|
328
329
|
}
|
|
@@ -334,7 +335,7 @@ const emitAvailableInfo = async ({ hasInfo, state, }) => {
|
|
|
334
335
|
if (!emittedFields.numberOfAudioChannels &&
|
|
335
336
|
hasInfo.numberOfAudioChannels) {
|
|
336
337
|
const numberOfAudioChannels = (0, get_number_of_audio_channels_1.getNumberOfAudioChannels)(state);
|
|
337
|
-
await ((
|
|
338
|
+
await ((_2 = callbackFunctions.onNumberOfAudioChannels) === null || _2 === void 0 ? void 0 : _2.call(callbackFunctions, numberOfAudioChannels));
|
|
338
339
|
if (fieldsInReturnValue.numberOfAudioChannels) {
|
|
339
340
|
returnValue.numberOfAudioChannels = numberOfAudioChannels;
|
|
340
341
|
}
|
|
@@ -349,7 +350,7 @@ const emitAvailableInfo = async ({ hasInfo, state, }) => {
|
|
|
349
350
|
originalSrc: state.src,
|
|
350
351
|
readerInterface: state.readerInterface,
|
|
351
352
|
});
|
|
352
|
-
await ((
|
|
353
|
+
await ((_3 = callbackFunctions.onM3uStreams) === null || _3 === void 0 ? void 0 : _3.call(callbackFunctions, streams));
|
|
353
354
|
if (fieldsInReturnValue.m3uStreams) {
|
|
354
355
|
returnValue.m3uStreams = streams;
|
|
355
356
|
}
|
package/dist/esm/index.mjs
CHANGED
|
@@ -18208,7 +18208,7 @@ var downloadAndParseMedia = async (options) => {
|
|
|
18208
18208
|
return returnValue;
|
|
18209
18209
|
};
|
|
18210
18210
|
// src/version.ts
|
|
18211
|
-
var VERSION = "4.0.
|
|
18211
|
+
var VERSION = "4.0.539";
|
|
18212
18212
|
|
|
18213
18213
|
// src/index.ts
|
|
18214
18214
|
var MediaParserInternals = {
|
package/dist/get-duration.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type { AnySegment } from './parse-result';
|
|
|
2
2
|
import type { ParserState } from './state/parser-state';
|
|
3
3
|
export declare const isMatroska: (boxes: AnySegment[]) => {
|
|
4
4
|
type: "Segment";
|
|
5
|
-
value: import("
|
|
5
|
+
value: import(".").PossibleEbml[];
|
|
6
6
|
minVintWidth: number | null;
|
|
7
7
|
} | undefined;
|
|
8
8
|
export declare const getDuration: (parserState: ParserState) => number | null;
|
package/dist/get-duration.js
CHANGED
|
@@ -41,7 +41,8 @@ const isMatroska = (boxes) => {
|
|
|
41
41
|
};
|
|
42
42
|
exports.isMatroska = isMatroska;
|
|
43
43
|
const getDurationFromIsoBaseMedia = (parserState) => {
|
|
44
|
-
var _a
|
|
44
|
+
var _a;
|
|
45
|
+
var _b;
|
|
45
46
|
const structure = parserState.structure.getIsoStructure();
|
|
46
47
|
const moovBox = (0, traversal_1.getMoovBoxFromState)({
|
|
47
48
|
structureState: parserState.structure,
|
package/dist/get-fps.js
CHANGED
|
@@ -65,7 +65,8 @@ const getFpsFromMp4TrakBox = (trakBox) => {
|
|
|
65
65
|
};
|
|
66
66
|
exports.getFpsFromMp4TrakBox = getFpsFromMp4TrakBox;
|
|
67
67
|
const getFpsFromIsoMaseMedia = (state) => {
|
|
68
|
-
var _a
|
|
68
|
+
var _a;
|
|
69
|
+
var _b;
|
|
69
70
|
const moovBox = (0, traversal_1.getMoovBoxFromState)({
|
|
70
71
|
structureState: state.structure,
|
|
71
72
|
isoState: state.iso,
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.hasNumberOfAudioChannels = exports.getNumberOfAudioChannels = void 0;
|
|
4
4
|
const getNumberOfAudioChannels = (state) => {
|
|
5
|
-
var _a
|
|
5
|
+
var _a;
|
|
6
|
+
var _b;
|
|
6
7
|
return ((_b = (_a = state.callbacks.tracks.getTracks().find((track) => {
|
|
7
8
|
return track.type === 'audio';
|
|
8
9
|
})) === null || _a === void 0 ? void 0 : _a.numberOfChannels) !== null && _b !== void 0 ? _b : null);
|
package/dist/get-sample-rate.js
CHANGED
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.hasSampleRate = exports.getSampleRate = void 0;
|
|
4
4
|
const getSampleRate = (state) => {
|
|
5
|
-
var _a
|
|
5
|
+
var _a;
|
|
6
|
+
var _b;
|
|
6
7
|
return ((_b = (_a = state.callbacks.tracks.getTracks().find((track) => {
|
|
7
8
|
return track.type === 'audio';
|
|
8
9
|
})) === null || _a === void 0 ? void 0 : _a.sampleRate) !== null && _b !== void 0 ? _b : null);
|
package/dist/get-tracks.js
CHANGED
|
@@ -16,7 +16,8 @@ const getNumberOfTracks = (moovBox) => {
|
|
|
16
16
|
};
|
|
17
17
|
exports.getNumberOfTracks = getNumberOfTracks;
|
|
18
18
|
const isoBaseMediaHasTracks = (state, mayUsePrecomputed) => {
|
|
19
|
-
var _a
|
|
19
|
+
var _a;
|
|
20
|
+
var _b;
|
|
20
21
|
return Boolean((0, traversal_1.getMoovBoxFromState)({
|
|
21
22
|
structureState: state.structure,
|
|
22
23
|
isoState: state.iso,
|
package/dist/get-video-codec.js
CHANGED
|
@@ -6,7 +6,8 @@ const av1_codec_private_1 = require("./containers/webm/av1-codec-private");
|
|
|
6
6
|
const get_sample_aspect_ratio_1 = require("./get-sample-aspect-ratio");
|
|
7
7
|
const get_tracks_1 = require("./get-tracks");
|
|
8
8
|
const getVideoCodec = (state) => {
|
|
9
|
-
var _a
|
|
9
|
+
var _a;
|
|
10
|
+
var _b;
|
|
10
11
|
const track = (0, get_tracks_1.getTracks)(state, true);
|
|
11
12
|
return (_b = (_a = track.find((t) => t.type === 'video')) === null || _a === void 0 ? void 0 : _a.codecEnum) !== null && _b !== void 0 ? _b : null;
|
|
12
13
|
};
|