@remotion/media-parser 4.0.241 → 4.0.243
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/add-avc-profile-to-track.js +2 -2
- package/dist/boxes/avc/codec-private.js +2 -2
- package/dist/boxes/avc/create-sps-pps-data.d.ts +2 -0
- package/dist/boxes/avc/create-sps-pps-data.js +28 -0
- package/dist/boxes/iso-base-media/get-keyframes.d.ts +3 -0
- package/dist/boxes/iso-base-media/get-keyframes.js +30 -0
- package/dist/boxes/iso-base-media/mdat/mdat.d.ts +3 -3
- package/dist/boxes/iso-base-media/mdat/mdat.js +9 -5
- package/dist/boxes/iso-base-media/moov/moov.d.ts +3 -3
- package/dist/boxes/iso-base-media/moov/moov.js +5 -4
- package/dist/boxes/iso-base-media/process-box.d.ts +9 -9
- package/dist/boxes/iso-base-media/process-box.js +48 -56
- package/dist/boxes/iso-base-media/stsd/mebx.d.ts +3 -3
- package/dist/boxes/iso-base-media/stsd/mebx.js +5 -4
- package/dist/boxes/iso-base-media/stsd/samples.d.ts +5 -5
- package/dist/boxes/iso-base-media/stsd/samples.js +19 -16
- package/dist/boxes/iso-base-media/stsd/stsd.d.ts +3 -3
- package/dist/boxes/iso-base-media/stsd/stsd.js +2 -2
- package/dist/boxes/iso-base-media/trak/trak.d.ts +3 -3
- package/dist/boxes/iso-base-media/trak/trak.js +7 -6
- package/dist/boxes/riff/expect-riff-box.d.ts +3 -3
- package/dist/boxes/riff/expect-riff-box.js +5 -5
- package/dist/boxes/riff/get-tracks-from-avi.js +1 -1
- package/dist/boxes/riff/parse-box.d.ts +7 -7
- package/dist/boxes/riff/parse-box.js +29 -24
- package/dist/boxes/riff/parse-list-box.d.ts +3 -3
- package/dist/boxes/riff/parse-list-box.js +2 -2
- package/dist/boxes/riff/parse-movi.d.ts +5 -5
- package/dist/boxes/riff/parse-movi.js +35 -20
- package/dist/boxes/riff/parse-riff-box.d.ts +3 -3
- package/dist/boxes/riff/parse-riff-box.js +2 -2
- package/dist/boxes/transport-stream/get-tracks.js +1 -1
- package/dist/boxes/transport-stream/handle-aac-packet.d.ts +4 -3
- package/dist/boxes/transport-stream/handle-aac-packet.js +6 -4
- package/dist/boxes/transport-stream/handle-avc-packet.d.ts +4 -3
- package/dist/boxes/transport-stream/handle-avc-packet.js +8 -6
- package/dist/boxes/transport-stream/parse-packet.d.ts +3 -3
- package/dist/boxes/transport-stream/parse-packet.js +2 -2
- package/dist/boxes/transport-stream/parse-stream-packet.d.ts +3 -3
- package/dist/boxes/transport-stream/parse-stream-packet.js +14 -7
- package/dist/boxes/transport-stream/parse-transport-stream.d.ts +5 -6
- package/dist/boxes/transport-stream/parse-transport-stream.js +10 -9
- package/dist/boxes/transport-stream/process-stream-buffers.d.ts +6 -5
- package/dist/boxes/transport-stream/process-stream-buffers.js +18 -8
- package/dist/boxes/webm/ebml.d.ts +1 -1
- package/dist/boxes/webm/get-sample-from-block.d.ts +2 -2
- package/dist/boxes/webm/get-sample-from-block.js +8 -4
- package/dist/boxes/webm/parse-ebml.d.ts +4 -4
- package/dist/boxes/webm/parse-ebml.js +18 -18
- package/dist/boxes/webm/parse-webm-header.d.ts +5 -5
- package/dist/boxes/webm/parse-webm-header.js +6 -5
- package/dist/boxes/webm/segments/parse-children.d.ts +5 -5
- package/dist/boxes/webm/segments/parse-children.js +12 -13
- package/dist/boxes/webm/segments.d.ts +3 -3
- package/dist/boxes/webm/segments.js +13 -13
- package/dist/convert-audio-or-video-sample.js +5 -2
- package/dist/create/matroska/create-matroska-media.js +2 -0
- package/dist/create/progress-tracker.js +2 -2
- package/dist/emit-available-info.d.ts +4 -5
- package/dist/emit-available-info.js +171 -57
- package/dist/esm/index.mjs +899 -501
- package/dist/file-types/detect-file-type.js +4 -2
- package/dist/get-duration.d.ts +1 -0
- package/dist/get-duration.js +14 -1
- package/dist/get-fields-from-callbacks.js +5 -0
- package/dist/get-fps.d.ts +1 -0
- package/dist/get-fps.js +17 -12
- package/dist/get-keyframes.d.ts +5 -0
- package/dist/get-keyframes.js +20 -0
- package/dist/get-tracks.d.ts +7 -1
- package/dist/get-tracks.js +15 -10
- package/dist/has-all-info.d.ts +2 -5
- package/dist/has-all-info.js +23 -4
- package/dist/index.d.ts +2 -1
- package/dist/may-skip-video-data/may-skip-video-data.d.ts +4 -0
- package/dist/may-skip-video-data/may-skip-video-data.js +14 -0
- package/dist/may-skip-video-data/need-samples-for-fields.d.ts +5 -0
- package/dist/may-skip-video-data/need-samples-for-fields.js +33 -0
- package/dist/options.d.ts +32 -0
- package/dist/parse-media.js +12 -40
- package/dist/parse-result.d.ts +2 -4
- package/dist/parse-video.d.ts +5 -5
- package/dist/parse-video.js +24 -10
- package/dist/register-track.d.ts +5 -5
- package/dist/register-track.js +12 -12
- package/dist/state/can-skip-tracks.js +5 -0
- package/dist/state/emitted-fields.d.ts +2 -0
- package/dist/state/emitted-fields.js +31 -0
- package/dist/state/has-tracks-section.d.ts +1 -0
- package/dist/state/keyframes.d.ts +6 -0
- package/dist/state/keyframes.js +15 -0
- package/dist/state/parser-state.d.ts +60 -29
- package/dist/state/parser-state.js +32 -150
- package/dist/state/riff.d.ts +10 -0
- package/dist/state/riff.js +32 -0
- package/dist/state/sample-callbacks.d.ts +31 -0
- package/dist/state/sample-callbacks.js +101 -0
- package/dist/state/slow-duration-fps.d.ts +8 -0
- package/dist/state/slow-duration-fps.js +36 -0
- package/dist/state/structure.d.ts +7 -0
- package/dist/state/structure.js +21 -0
- package/dist/state/tracks-and-samples.d.ts +0 -0
- package/dist/state/tracks-and-samples.js +1 -0
- package/dist/state/webm.d.ts +11 -0
- package/dist/state/webm.js +67 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/webcodec-sample-types.d.ts +2 -0
- package/package.json +3 -3
|
@@ -7,45 +7,116 @@ const get_dimensions_1 = require("./get-dimensions");
|
|
|
7
7
|
const get_duration_1 = require("./get-duration");
|
|
8
8
|
const get_fps_1 = require("./get-fps");
|
|
9
9
|
const get_is_hdr_1 = require("./get-is-hdr");
|
|
10
|
+
const get_keyframes_1 = require("./get-keyframes");
|
|
10
11
|
const get_location_1 = require("./get-location");
|
|
11
12
|
const get_tracks_1 = require("./get-tracks");
|
|
12
13
|
const get_video_codec_1 = require("./get-video-codec");
|
|
13
14
|
const get_metadata_1 = require("./metadata/get-metadata");
|
|
14
|
-
const emitAvailableInfo = ({ hasInfo, parseResult, callbacks, state, returnValue, contentLength, name, mimeType, fieldsInReturnValue,
|
|
15
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
15
|
+
const emitAvailableInfo = ({ hasInfo, parseResult, callbacks, state, returnValue, contentLength, name, mimeType, fieldsInReturnValue, }) => {
|
|
16
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y;
|
|
16
17
|
const keys = Object.keys(hasInfo);
|
|
18
|
+
const segments = state.structure.getStructureOrNull();
|
|
19
|
+
const { emittedFields } = state;
|
|
17
20
|
for (const key of keys) {
|
|
18
21
|
if (key === 'structure') {
|
|
19
|
-
if (parseResult &&
|
|
20
|
-
|
|
22
|
+
if (parseResult &&
|
|
23
|
+
hasInfo.structure &&
|
|
24
|
+
!emittedFields.structure &&
|
|
25
|
+
segments) {
|
|
26
|
+
(_a = callbacks.onStructure) === null || _a === void 0 ? void 0 : _a.call(callbacks, segments);
|
|
21
27
|
if (fieldsInReturnValue.structure) {
|
|
22
|
-
returnValue.structure =
|
|
28
|
+
returnValue.structure = segments;
|
|
23
29
|
}
|
|
24
30
|
emittedFields.structure = true;
|
|
25
31
|
}
|
|
26
32
|
continue;
|
|
27
33
|
}
|
|
28
34
|
if (key === 'durationInSeconds') {
|
|
29
|
-
if (hasInfo.durationInSeconds &&
|
|
30
|
-
!emittedFields.durationInSeconds
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
35
|
+
if (hasInfo.durationInSeconds && parseResult && segments) {
|
|
36
|
+
if (!emittedFields.durationInSeconds) {
|
|
37
|
+
const durationInSeconds = (0, get_duration_1.getDuration)(segments, state);
|
|
38
|
+
(_b = callbacks.onDurationInSeconds) === null || _b === void 0 ? void 0 : _b.call(callbacks, durationInSeconds);
|
|
39
|
+
if (fieldsInReturnValue.durationInSeconds) {
|
|
40
|
+
returnValue.durationInSeconds = durationInSeconds;
|
|
41
|
+
}
|
|
42
|
+
emittedFields.durationInSeconds = true;
|
|
43
|
+
}
|
|
44
|
+
if (!emittedFields.slowDurationInSeconds) {
|
|
45
|
+
const durationInSeconds = (0, get_duration_1.getDuration)(segments, state);
|
|
46
|
+
if (durationInSeconds !== null) {
|
|
47
|
+
(_c = callbacks.onSlowDurationInSeconds) === null || _c === void 0 ? void 0 : _c.call(callbacks, durationInSeconds);
|
|
48
|
+
if (fieldsInReturnValue.slowDurationInSeconds) {
|
|
49
|
+
returnValue.slowDurationInSeconds = durationInSeconds;
|
|
50
|
+
}
|
|
51
|
+
emittedFields.slowDurationInSeconds = true;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
continue;
|
|
56
|
+
}
|
|
57
|
+
if (key === 'slowDurationInSeconds') {
|
|
58
|
+
if (hasInfo.slowDurationInSeconds &&
|
|
59
|
+
!emittedFields.slowDurationInSeconds &&
|
|
60
|
+
parseResult &&
|
|
61
|
+
segments) {
|
|
62
|
+
const slowDurationInSeconds = state.slowDurationAndFps.getSlowDurationInSeconds();
|
|
63
|
+
(_d = callbacks.onSlowDurationInSeconds) === null || _d === void 0 ? void 0 : _d.call(callbacks, slowDurationInSeconds);
|
|
64
|
+
if (fieldsInReturnValue.slowDurationInSeconds) {
|
|
65
|
+
returnValue.slowDurationInSeconds = slowDurationInSeconds;
|
|
66
|
+
}
|
|
67
|
+
emittedFields.slowDurationInSeconds = true;
|
|
68
|
+
}
|
|
69
|
+
continue;
|
|
70
|
+
}
|
|
71
|
+
if (key === 'fps') {
|
|
72
|
+
if (hasInfo.fps && parseResult && segments) {
|
|
73
|
+
if (!emittedFields.fps) {
|
|
74
|
+
const fps = (0, get_fps_1.getFps)(segments);
|
|
75
|
+
(_e = callbacks.onFps) === null || _e === void 0 ? void 0 : _e.call(callbacks, fps);
|
|
76
|
+
if (fieldsInReturnValue.fps) {
|
|
77
|
+
returnValue.fps = fps;
|
|
78
|
+
}
|
|
79
|
+
emittedFields.fps = true;
|
|
80
|
+
}
|
|
81
|
+
if (!emittedFields.slowFps) {
|
|
82
|
+
const fps = (0, get_fps_1.getFps)(segments);
|
|
83
|
+
if (fps) {
|
|
84
|
+
(_f = callbacks.onSlowFps) === null || _f === void 0 ? void 0 : _f.call(callbacks, fps);
|
|
85
|
+
if (fieldsInReturnValue.slowFps) {
|
|
86
|
+
returnValue.slowFps = fps;
|
|
87
|
+
}
|
|
88
|
+
emittedFields.slowFps = true;
|
|
89
|
+
}
|
|
36
90
|
}
|
|
37
|
-
|
|
91
|
+
}
|
|
92
|
+
continue;
|
|
93
|
+
}
|
|
94
|
+
// must be handled after fps
|
|
95
|
+
if (key === 'slowFps') {
|
|
96
|
+
if (hasInfo.slowFps &&
|
|
97
|
+
!emittedFields.slowFps &&
|
|
98
|
+
parseResult &&
|
|
99
|
+
segments) {
|
|
100
|
+
const slowFps = state.slowDurationAndFps.getFps();
|
|
101
|
+
(_g = callbacks.onSlowFps) === null || _g === void 0 ? void 0 : _g.call(callbacks, slowFps);
|
|
102
|
+
if (fieldsInReturnValue.slowFps) {
|
|
103
|
+
returnValue.slowFps = slowFps;
|
|
104
|
+
}
|
|
105
|
+
emittedFields.slowFps = true;
|
|
38
106
|
}
|
|
39
107
|
continue;
|
|
40
108
|
}
|
|
41
109
|
if (key === 'dimensions') {
|
|
42
|
-
if (hasInfo.dimensions &&
|
|
43
|
-
|
|
110
|
+
if (hasInfo.dimensions &&
|
|
111
|
+
!emittedFields.dimensions &&
|
|
112
|
+
parseResult &&
|
|
113
|
+
segments) {
|
|
114
|
+
const dimensionsQueried = (0, get_dimensions_1.getDimensions)(segments, state);
|
|
44
115
|
const dimensions = {
|
|
45
116
|
height: dimensionsQueried.height,
|
|
46
117
|
width: dimensionsQueried.width,
|
|
47
118
|
};
|
|
48
|
-
(
|
|
119
|
+
(_h = callbacks.onDimensions) === null || _h === void 0 ? void 0 : _h.call(callbacks, dimensions);
|
|
49
120
|
if (fieldsInReturnValue.dimensions) {
|
|
50
121
|
returnValue.dimensions = dimensions;
|
|
51
122
|
}
|
|
@@ -56,13 +127,14 @@ const emitAvailableInfo = ({ hasInfo, parseResult, callbacks, state, returnValue
|
|
|
56
127
|
if (key === 'unrotatedDimensions') {
|
|
57
128
|
if (hasInfo.unrotatedDimensions &&
|
|
58
129
|
!emittedFields.unrotatedDimensions &&
|
|
59
|
-
parseResult
|
|
60
|
-
|
|
130
|
+
parseResult &&
|
|
131
|
+
segments) {
|
|
132
|
+
const dimensionsQueried = (0, get_dimensions_1.getDimensions)(segments, state);
|
|
61
133
|
const unrotatedDimensions = {
|
|
62
134
|
height: dimensionsQueried.unrotatedHeight,
|
|
63
135
|
width: dimensionsQueried.unrotatedWidth,
|
|
64
136
|
};
|
|
65
|
-
(
|
|
137
|
+
(_j = callbacks.onUnrotatedDimensions) === null || _j === void 0 ? void 0 : _j.call(callbacks, unrotatedDimensions);
|
|
66
138
|
if (fieldsInReturnValue.unrotatedDimensions) {
|
|
67
139
|
returnValue.unrotatedDimensions = unrotatedDimensions;
|
|
68
140
|
}
|
|
@@ -71,10 +143,13 @@ const emitAvailableInfo = ({ hasInfo, parseResult, callbacks, state, returnValue
|
|
|
71
143
|
continue;
|
|
72
144
|
}
|
|
73
145
|
if (key === 'rotation') {
|
|
74
|
-
if (hasInfo.rotation &&
|
|
75
|
-
|
|
146
|
+
if (hasInfo.rotation &&
|
|
147
|
+
!emittedFields.rotation &&
|
|
148
|
+
parseResult &&
|
|
149
|
+
segments) {
|
|
150
|
+
const dimensionsQueried = (0, get_dimensions_1.getDimensions)(segments, state);
|
|
76
151
|
const { rotation } = dimensionsQueried;
|
|
77
|
-
(
|
|
152
|
+
(_k = callbacks.onRotation) === null || _k === void 0 ? void 0 : _k.call(callbacks, rotation);
|
|
78
153
|
if (fieldsInReturnValue.rotation) {
|
|
79
154
|
returnValue.rotation = rotation;
|
|
80
155
|
}
|
|
@@ -82,21 +157,13 @@ const emitAvailableInfo = ({ hasInfo, parseResult, callbacks, state, returnValue
|
|
|
82
157
|
}
|
|
83
158
|
continue;
|
|
84
159
|
}
|
|
85
|
-
if (key === 'fps') {
|
|
86
|
-
if (!emittedFields.fps && hasInfo.fps && parseResult) {
|
|
87
|
-
const fps = (0, get_fps_1.getFps)(parseResult.segments);
|
|
88
|
-
(_f = callbacks.onFps) === null || _f === void 0 ? void 0 : _f.call(callbacks, fps);
|
|
89
|
-
if (fieldsInReturnValue.fps) {
|
|
90
|
-
returnValue.fps = fps;
|
|
91
|
-
}
|
|
92
|
-
emittedFields.fps = true;
|
|
93
|
-
}
|
|
94
|
-
continue;
|
|
95
|
-
}
|
|
96
160
|
if (key === 'videoCodec') {
|
|
97
|
-
if (!emittedFields.videoCodec &&
|
|
98
|
-
|
|
99
|
-
|
|
161
|
+
if (!emittedFields.videoCodec &&
|
|
162
|
+
hasInfo.videoCodec &&
|
|
163
|
+
parseResult &&
|
|
164
|
+
segments) {
|
|
165
|
+
const videoCodec = (0, get_video_codec_1.getVideoCodec)(segments, state);
|
|
166
|
+
(_l = callbacks.onVideoCodec) === null || _l === void 0 ? void 0 : _l.call(callbacks, videoCodec);
|
|
100
167
|
if (fieldsInReturnValue.videoCodec) {
|
|
101
168
|
returnValue.videoCodec = videoCodec;
|
|
102
169
|
}
|
|
@@ -105,9 +172,12 @@ const emitAvailableInfo = ({ hasInfo, parseResult, callbacks, state, returnValue
|
|
|
105
172
|
continue;
|
|
106
173
|
}
|
|
107
174
|
if (key === 'audioCodec') {
|
|
108
|
-
if (!emittedFields.audioCodec &&
|
|
109
|
-
|
|
110
|
-
|
|
175
|
+
if (!emittedFields.audioCodec &&
|
|
176
|
+
hasInfo.audioCodec &&
|
|
177
|
+
parseResult &&
|
|
178
|
+
segments) {
|
|
179
|
+
const audioCodec = (0, get_audio_codec_1.getAudioCodec)(segments, state);
|
|
180
|
+
(_m = callbacks.onAudioCodec) === null || _m === void 0 ? void 0 : _m.call(callbacks, audioCodec);
|
|
111
181
|
if (fieldsInReturnValue.audioCodec) {
|
|
112
182
|
returnValue.audioCodec = audioCodec;
|
|
113
183
|
}
|
|
@@ -116,9 +186,9 @@ const emitAvailableInfo = ({ hasInfo, parseResult, callbacks, state, returnValue
|
|
|
116
186
|
continue;
|
|
117
187
|
}
|
|
118
188
|
if (key === 'tracks') {
|
|
119
|
-
if (!emittedFields.tracks && hasInfo.tracks && parseResult) {
|
|
120
|
-
const { videoTracks, audioTracks } = (0, get_tracks_1.getTracks)(
|
|
121
|
-
(
|
|
189
|
+
if (!emittedFields.tracks && hasInfo.tracks && parseResult && segments) {
|
|
190
|
+
const { videoTracks, audioTracks } = (0, get_tracks_1.getTracks)(segments, state);
|
|
191
|
+
(_o = callbacks.onTracks) === null || _o === void 0 ? void 0 : _o.call(callbacks, { videoTracks, audioTracks });
|
|
122
192
|
if (fieldsInReturnValue.tracks) {
|
|
123
193
|
returnValue.tracks = { videoTracks, audioTracks };
|
|
124
194
|
}
|
|
@@ -139,7 +209,7 @@ const emitAvailableInfo = ({ hasInfo, parseResult, callbacks, state, returnValue
|
|
|
139
209
|
}
|
|
140
210
|
if (key === 'size') {
|
|
141
211
|
if (!emittedFields.size && hasInfo.size) {
|
|
142
|
-
(
|
|
212
|
+
(_p = callbacks.onSize) === null || _p === void 0 ? void 0 : _p.call(callbacks, contentLength);
|
|
143
213
|
if (fieldsInReturnValue.size) {
|
|
144
214
|
returnValue.size = contentLength;
|
|
145
215
|
}
|
|
@@ -149,7 +219,7 @@ const emitAvailableInfo = ({ hasInfo, parseResult, callbacks, state, returnValue
|
|
|
149
219
|
}
|
|
150
220
|
if (key === 'mimeType') {
|
|
151
221
|
if (!emittedFields.mimeType && hasInfo.mimeType) {
|
|
152
|
-
(
|
|
222
|
+
(_q = callbacks.onMimeType) === null || _q === void 0 ? void 0 : _q.call(callbacks, mimeType);
|
|
153
223
|
if (fieldsInReturnValue.mimeType) {
|
|
154
224
|
returnValue.mimeType = mimeType;
|
|
155
225
|
}
|
|
@@ -159,7 +229,7 @@ const emitAvailableInfo = ({ hasInfo, parseResult, callbacks, state, returnValue
|
|
|
159
229
|
}
|
|
160
230
|
if (key === 'name') {
|
|
161
231
|
if (!emittedFields.name && hasInfo.name) {
|
|
162
|
-
(
|
|
232
|
+
(_r = callbacks.onName) === null || _r === void 0 ? void 0 : _r.call(callbacks, name);
|
|
163
233
|
if (fieldsInReturnValue.name) {
|
|
164
234
|
returnValue.name = name;
|
|
165
235
|
}
|
|
@@ -168,9 +238,9 @@ const emitAvailableInfo = ({ hasInfo, parseResult, callbacks, state, returnValue
|
|
|
168
238
|
continue;
|
|
169
239
|
}
|
|
170
240
|
if (key === 'isHdr') {
|
|
171
|
-
if (!returnValue.isHdr && hasInfo.isHdr && parseResult) {
|
|
172
|
-
const isHdr = (0, get_is_hdr_1.getIsHdr)(
|
|
173
|
-
(
|
|
241
|
+
if (!returnValue.isHdr && hasInfo.isHdr && parseResult && segments) {
|
|
242
|
+
const isHdr = (0, get_is_hdr_1.getIsHdr)(segments, state);
|
|
243
|
+
(_s = callbacks.onIsHdr) === null || _s === void 0 ? void 0 : _s.call(callbacks, isHdr);
|
|
174
244
|
if (fieldsInReturnValue.isHdr) {
|
|
175
245
|
returnValue.isHdr = isHdr;
|
|
176
246
|
}
|
|
@@ -179,9 +249,12 @@ const emitAvailableInfo = ({ hasInfo, parseResult, callbacks, state, returnValue
|
|
|
179
249
|
continue;
|
|
180
250
|
}
|
|
181
251
|
if (key === 'container') {
|
|
182
|
-
if (!returnValue.container &&
|
|
183
|
-
|
|
184
|
-
|
|
252
|
+
if (!returnValue.container &&
|
|
253
|
+
hasInfo.container &&
|
|
254
|
+
parseResult &&
|
|
255
|
+
segments) {
|
|
256
|
+
const container = (0, get_container_1.getContainer)(segments);
|
|
257
|
+
(_t = callbacks.onContainer) === null || _t === void 0 ? void 0 : _t.call(callbacks, container);
|
|
185
258
|
if (fieldsInReturnValue.container) {
|
|
186
259
|
returnValue.container = container;
|
|
187
260
|
}
|
|
@@ -190,9 +263,12 @@ const emitAvailableInfo = ({ hasInfo, parseResult, callbacks, state, returnValue
|
|
|
190
263
|
continue;
|
|
191
264
|
}
|
|
192
265
|
if (key === 'metadata') {
|
|
193
|
-
if (!emittedFields.metadata &&
|
|
194
|
-
|
|
195
|
-
|
|
266
|
+
if (!emittedFields.metadata &&
|
|
267
|
+
hasInfo.metadata &&
|
|
268
|
+
parseResult &&
|
|
269
|
+
segments) {
|
|
270
|
+
const metadata = (0, get_metadata_1.getMetadata)(segments);
|
|
271
|
+
(_u = callbacks.onMetadata) === null || _u === void 0 ? void 0 : _u.call(callbacks, metadata);
|
|
196
272
|
if (fieldsInReturnValue.metadata) {
|
|
197
273
|
returnValue.metadata = metadata;
|
|
198
274
|
}
|
|
@@ -201,9 +277,12 @@ const emitAvailableInfo = ({ hasInfo, parseResult, callbacks, state, returnValue
|
|
|
201
277
|
continue;
|
|
202
278
|
}
|
|
203
279
|
if (key === 'location') {
|
|
204
|
-
if (!emittedFields.location &&
|
|
205
|
-
|
|
206
|
-
|
|
280
|
+
if (!emittedFields.location &&
|
|
281
|
+
hasInfo.location &&
|
|
282
|
+
parseResult &&
|
|
283
|
+
segments) {
|
|
284
|
+
const location = (0, get_location_1.getLocation)(segments);
|
|
285
|
+
(_v = callbacks.onLocation) === null || _v === void 0 ? void 0 : _v.call(callbacks, location);
|
|
207
286
|
if (fieldsInReturnValue.location) {
|
|
208
287
|
returnValue.location = location;
|
|
209
288
|
}
|
|
@@ -211,6 +290,41 @@ const emitAvailableInfo = ({ hasInfo, parseResult, callbacks, state, returnValue
|
|
|
211
290
|
}
|
|
212
291
|
continue;
|
|
213
292
|
}
|
|
293
|
+
if (key === 'slowKeyframes') {
|
|
294
|
+
if (!emittedFields.slowKeyframes &&
|
|
295
|
+
hasInfo.slowKeyframes &&
|
|
296
|
+
parseResult) {
|
|
297
|
+
(_w = callbacks.onSlowKeyframes) === null || _w === void 0 ? void 0 : _w.call(callbacks, state.keyframes.getKeyframes());
|
|
298
|
+
if (fieldsInReturnValue.slowKeyframes) {
|
|
299
|
+
returnValue.slowKeyframes = state.keyframes.getKeyframes();
|
|
300
|
+
}
|
|
301
|
+
emittedFields.slowKeyframes = true;
|
|
302
|
+
}
|
|
303
|
+
continue;
|
|
304
|
+
}
|
|
305
|
+
if (key === 'slowNumberOfFrames') {
|
|
306
|
+
if (!emittedFields.slowNumberOfFrames &&
|
|
307
|
+
hasInfo.slowNumberOfFrames &&
|
|
308
|
+
parseResult) {
|
|
309
|
+
(_x = callbacks.onSlowNumberOfFrames) === null || _x === void 0 ? void 0 : _x.call(callbacks, state.slowDurationAndFps.getSlowNumberOfFrames());
|
|
310
|
+
if (fieldsInReturnValue.slowNumberOfFrames) {
|
|
311
|
+
returnValue.slowNumberOfFrames =
|
|
312
|
+
state.slowDurationAndFps.getSlowNumberOfFrames();
|
|
313
|
+
}
|
|
314
|
+
emittedFields.slowNumberOfFrames = true;
|
|
315
|
+
}
|
|
316
|
+
continue;
|
|
317
|
+
}
|
|
318
|
+
if (key === 'keyframes') {
|
|
319
|
+
if (!emittedFields.keyframes && hasInfo.keyframes && parseResult) {
|
|
320
|
+
(_y = callbacks.onKeyframes) === null || _y === void 0 ? void 0 : _y.call(callbacks, (0, get_keyframes_1.getKeyframes)(state.structure.getStructure()));
|
|
321
|
+
if (fieldsInReturnValue.keyframes) {
|
|
322
|
+
returnValue.keyframes = (0, get_keyframes_1.getKeyframes)(state.structure.getStructure());
|
|
323
|
+
}
|
|
324
|
+
emittedFields.keyframes = true;
|
|
325
|
+
}
|
|
326
|
+
continue;
|
|
327
|
+
}
|
|
214
328
|
throw new Error(`Unhandled key: ${key}`);
|
|
215
329
|
}
|
|
216
330
|
};
|