@remotion/media-parser 4.0.277 → 4.0.279
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.js +13 -6
- package/dist/add-avc-profile-to-track.js +9 -5
- package/dist/check-if-done.d.ts +2 -0
- package/dist/check-if-done.js +34 -0
- package/dist/combine-uint8-arrays.js +5 -1
- package/dist/containers/aac/parse-aac.js +27 -18
- package/dist/containers/aac/types.js +2 -1
- package/dist/containers/avc/codec-string.js +5 -1
- package/dist/containers/avc/color.js +9 -3
- package/dist/containers/avc/create-sps-pps-data.js +9 -5
- package/dist/containers/avc/interpret-sps.js +13 -7
- package/dist/containers/avc/key.js +5 -1
- package/dist/containers/avc/parse-avc.js +7 -3
- package/dist/containers/avc/sps-and-pps.js +5 -1
- package/dist/containers/flac/get-block-size.d.ts +1 -1
- package/dist/containers/flac/get-block-size.js +5 -1
- package/dist/containers/flac/get-channel-count.d.ts +2 -2
- package/dist/containers/flac/get-channel-count.js +5 -1
- package/dist/containers/flac/get-duration-from-flac.js +5 -1
- package/dist/containers/flac/get-metadata-from-flac.js +5 -1
- package/dist/containers/flac/get-sample-rate.d.ts +1 -1
- package/dist/containers/flac/get-sample-rate.js +5 -1
- package/dist/containers/flac/parse-flac-frame.d.ts +1 -1
- package/dist/containers/flac/parse-flac-frame.js +33 -23
- package/dist/containers/flac/parse-flac.d.ts +1 -1
- package/dist/containers/flac/parse-flac.js +19 -15
- package/dist/containers/flac/parse-header.d.ts +1 -1
- package/dist/containers/flac/parse-header.js +5 -1
- package/dist/containers/flac/parse-metadata.d.ts +1 -1
- package/dist/containers/flac/parse-metadata.js +5 -1
- package/dist/containers/flac/parse-streaminfo.d.ts +1 -1
- package/dist/containers/flac/parse-streaminfo.js +7 -3
- package/dist/containers/flac/parse-unknown-block.d.ts +1 -1
- package/dist/containers/flac/parse-unknown-block.js +5 -1
- package/dist/containers/flac/types.js +2 -1
- package/dist/containers/iso-base-media/base-media-box.js +2 -1
- package/dist/containers/iso-base-media/base-type.js +2 -1
- package/dist/containers/iso-base-media/esds/decoder-specific-config.d.ts +1 -1
- package/dist/containers/iso-base-media/esds/decoder-specific-config.js +5 -1
- package/dist/containers/iso-base-media/esds/esds-descriptors.d.ts +1 -1
- package/dist/containers/iso-base-media/esds/esds-descriptors.js +10 -5
- package/dist/containers/iso-base-media/esds/esds.d.ts +1 -1
- package/dist/containers/iso-base-media/esds/esds.js +7 -3
- package/dist/containers/iso-base-media/ftyp.d.ts +1 -1
- package/dist/containers/iso-base-media/ftyp.js +5 -1
- package/dist/containers/iso-base-media/get-actual-number-of-channels.js +8 -4
- package/dist/containers/iso-base-media/get-children.js +7 -3
- package/dist/containers/iso-base-media/get-keyframes.js +11 -7
- package/dist/containers/iso-base-media/get-moov-atom.js +26 -16
- package/dist/containers/iso-base-media/get-sample-positions-from-track.js +24 -20
- package/dist/containers/iso-base-media/get-seeking-from-mp4.d.ts +5 -0
- package/dist/containers/iso-base-media/get-seeking-from-mp4.js +56 -0
- package/dist/containers/iso-base-media/get-video-codec-from-iso-track.js +7 -3
- package/dist/containers/iso-base-media/make-track.js +34 -30
- package/dist/containers/iso-base-media/mdat/mdat.js +47 -34
- package/dist/containers/iso-base-media/mdhd.d.ts +1 -1
- package/dist/containers/iso-base-media/mdhd.js +5 -1
- package/dist/containers/iso-base-media/meta/hdlr.d.ts +1 -1
- package/dist/containers/iso-base-media/meta/hdlr.js +5 -1
- package/dist/containers/iso-base-media/meta/ilst.d.ts +1 -1
- package/dist/containers/iso-base-media/meta/ilst.js +5 -1
- package/dist/containers/iso-base-media/moov/moov.js +7 -3
- package/dist/containers/iso-base-media/mvhd.d.ts +1 -1
- package/dist/containers/iso-base-media/mvhd.js +11 -7
- package/dist/containers/iso-base-media/parse-boxes.js +9 -5
- package/dist/containers/iso-base-media/parse-icc-profile.js +8 -4
- package/dist/containers/iso-base-media/process-box.js +67 -63
- package/dist/containers/iso-base-media/stsd/av1c.d.ts +1 -1
- package/dist/containers/iso-base-media/stsd/av1c.js +5 -1
- package/dist/containers/iso-base-media/stsd/avcc.d.ts +1 -1
- package/dist/containers/iso-base-media/stsd/avcc.js +5 -1
- package/dist/containers/iso-base-media/stsd/colr.d.ts +1 -1
- package/dist/containers/iso-base-media/stsd/colr.js +7 -3
- package/dist/containers/iso-base-media/stsd/ctts.d.ts +1 -1
- package/dist/containers/iso-base-media/stsd/ctts.js +5 -1
- package/dist/containers/iso-base-media/stsd/hvcc.d.ts +1 -1
- package/dist/containers/iso-base-media/stsd/hvcc.js +7 -3
- package/dist/containers/iso-base-media/stsd/keys.d.ts +1 -1
- package/dist/containers/iso-base-media/stsd/keys.js +5 -1
- package/dist/containers/iso-base-media/stsd/mebx.js +7 -3
- package/dist/containers/iso-base-media/stsd/pasp.d.ts +1 -1
- package/dist/containers/iso-base-media/stsd/pasp.js +5 -1
- package/dist/containers/iso-base-media/stsd/samples.js +13 -8
- package/dist/containers/iso-base-media/stsd/stco.d.ts +1 -1
- package/dist/containers/iso-base-media/stsd/stco.js +5 -1
- package/dist/containers/iso-base-media/stsd/stsc.d.ts +1 -1
- package/dist/containers/iso-base-media/stsd/stsc.js +5 -1
- package/dist/containers/iso-base-media/stsd/stsd.js +7 -3
- package/dist/containers/iso-base-media/stsd/stss.d.ts +1 -1
- package/dist/containers/iso-base-media/stsd/stss.js +5 -1
- package/dist/containers/iso-base-media/stsd/stsz.d.ts +1 -1
- package/dist/containers/iso-base-media/stsd/stsz.js +5 -1
- package/dist/containers/iso-base-media/stsd/stts.d.ts +1 -1
- package/dist/containers/iso-base-media/stsd/stts.js +5 -1
- package/dist/containers/iso-base-media/tfdt.d.ts +1 -1
- package/dist/containers/iso-base-media/tfdt.js +5 -1
- package/dist/containers/iso-base-media/tfhd.d.ts +1 -1
- package/dist/containers/iso-base-media/tfhd.js +5 -1
- package/dist/containers/iso-base-media/tkhd.d.ts +1 -1
- package/dist/containers/iso-base-media/tkhd.js +8 -4
- package/dist/containers/iso-base-media/to-date.js +5 -1
- package/dist/containers/iso-base-media/trak/trak.js +7 -3
- package/dist/containers/iso-base-media/traversal.js +57 -33
- package/dist/containers/iso-base-media/trun.d.ts +1 -1
- package/dist/containers/iso-base-media/trun.js +5 -1
- package/dist/containers/iso-base-media/void-box.js +2 -1
- package/dist/containers/m3u/after-manifest-fetch.js +15 -11
- package/dist/containers/m3u/fetch-m3u8-stream.js +7 -3
- package/dist/containers/m3u/get-chunks.js +5 -1
- package/dist/containers/m3u/get-duration-from-m3u.js +8 -4
- package/dist/containers/m3u/get-playlist.js +12 -6
- package/dist/containers/m3u/get-streams.js +9 -3
- package/dist/containers/m3u/iterate-over-segment-files.js +15 -11
- package/dist/containers/m3u/parse-directive.js +10 -6
- package/dist/containers/m3u/parse-m3u-manifest.d.ts +1 -1
- package/dist/containers/m3u/parse-m3u-manifest.js +7 -3
- package/dist/containers/m3u/parse-m3u-media-directive.js +10 -5
- package/dist/containers/m3u/parse-m3u.js +11 -7
- package/dist/containers/m3u/parse-m3u8-text.js +7 -3
- package/dist/containers/m3u/parse-stream-inf.js +7 -2
- package/dist/containers/m3u/run-over-m3u.js +13 -9
- package/dist/containers/m3u/sample-sorter.js +8 -4
- package/dist/containers/m3u/select-stream.js +11 -4
- package/dist/containers/m3u/types.js +2 -1
- package/dist/containers/mp3/get-duration.js +9 -5
- package/dist/containers/mp3/get-frame-length.js +7 -2
- package/dist/containers/mp3/get-metadata-from-mp3.js +5 -1
- package/dist/containers/mp3/id3-v1.d.ts +1 -1
- package/dist/containers/mp3/id3-v1.js +5 -1
- package/dist/containers/mp3/id3.js +5 -1
- package/dist/containers/mp3/parse-mp3.js +11 -7
- package/dist/containers/mp3/parse-mpeg-header.js +28 -19
- package/dist/containers/mp3/samples-per-mpeg-file.js +5 -1
- package/dist/containers/riff/expect-riff-box.js +15 -11
- package/dist/containers/riff/get-duration.js +12 -7
- package/dist/containers/riff/get-tracks-from-avi.js +28 -20
- package/dist/containers/riff/is-movi.d.ts +1 -1
- package/dist/containers/riff/is-movi.js +5 -1
- package/dist/containers/riff/parse-avih.d.ts +1 -1
- package/dist/containers/riff/parse-avih.js +5 -1
- package/dist/containers/riff/parse-isft.d.ts +1 -1
- package/dist/containers/riff/parse-isft.js +5 -1
- package/dist/containers/riff/parse-list-box.js +7 -3
- package/dist/containers/riff/parse-movi.js +45 -31
- package/dist/containers/riff/parse-riff-body.js +13 -9
- package/dist/containers/riff/parse-riff-box.js +13 -9
- package/dist/containers/riff/parse-riff-header.js +5 -1
- package/dist/containers/riff/parse-riff.js +9 -5
- package/dist/containers/riff/parse-strf.d.ts +1 -1
- package/dist/containers/riff/parse-strf.js +5 -1
- package/dist/containers/riff/parse-strh.d.ts +1 -1
- package/dist/containers/riff/parse-strh.js +7 -3
- package/dist/containers/riff/parse-video-section.js +11 -7
- package/dist/containers/riff/riff-box.js +2 -1
- package/dist/containers/riff/timescale.js +4 -1
- package/dist/containers/riff/traversal.js +15 -7
- package/dist/containers/transport-stream/adts-header.js +10 -6
- package/dist/containers/transport-stream/boxes.js +2 -1
- package/dist/containers/transport-stream/discard-rest-of-packet.d.ts +1 -1
- package/dist/containers/transport-stream/discard-rest-of-packet.js +7 -2
- package/dist/containers/transport-stream/find-separator.js +4 -1
- package/dist/containers/transport-stream/get-tracks.js +16 -10
- package/dist/containers/transport-stream/handle-aac-packet.js +21 -12
- package/dist/containers/transport-stream/handle-avc-packet.js +31 -22
- package/dist/containers/transport-stream/next-pes-header-store.js +5 -1
- package/dist/containers/transport-stream/parse-packet.js +17 -13
- package/dist/containers/transport-stream/parse-pat.d.ts +1 -1
- package/dist/containers/transport-stream/parse-pat.js +10 -5
- package/dist/containers/transport-stream/parse-pes.d.ts +1 -1
- package/dist/containers/transport-stream/parse-pes.js +5 -1
- package/dist/containers/transport-stream/parse-pmt.d.ts +1 -1
- package/dist/containers/transport-stream/parse-pmt.js +7 -3
- package/dist/containers/transport-stream/parse-stream-packet.js +17 -13
- package/dist/containers/transport-stream/parse-transport-stream.js +9 -5
- package/dist/containers/transport-stream/process-stream-buffers.js +17 -12
- package/dist/containers/transport-stream/traversal.js +10 -4
- package/dist/containers/wav/get-duration-from-wav.js +8 -3
- package/dist/containers/wav/get-metadata-from-wav.js +5 -1
- package/dist/containers/wav/parse-data.js +9 -5
- package/dist/containers/wav/parse-fmt.js +7 -3
- package/dist/containers/wav/parse-header.js +5 -1
- package/dist/containers/wav/parse-id3.js +5 -1
- package/dist/containers/wav/parse-list.js +5 -1
- package/dist/containers/wav/parse-video-section.js +21 -12
- package/dist/containers/wav/parse-wav.js +19 -15
- package/dist/containers/wav/types.js +2 -1
- package/dist/containers/webm/allowed-partial-segments.js +4 -1
- package/dist/containers/webm/av1-codec-private.js +7 -3
- package/dist/containers/webm/color.js +10 -6
- package/dist/containers/webm/description.js +10 -6
- package/dist/containers/webm/get-ready-tracks.js +18 -13
- package/dist/containers/webm/get-sample-from-block.js +16 -12
- package/dist/containers/webm/make-track.js +48 -43
- package/dist/containers/webm/parse-ebml.js +35 -17
- package/dist/containers/webm/parse-webm-header.js +7 -3
- package/dist/containers/webm/segments/all-segments.js +173 -168
- package/dist/containers/webm/segments/block-simple-block-flags.d.ts +1 -1
- package/dist/containers/webm/segments/block-simple-block-flags.js +8 -4
- package/dist/containers/webm/segments/track-entry.js +5 -1
- package/dist/containers/webm/segments.js +13 -9
- package/dist/containers/webm/traversal.js +67 -37
- package/dist/convert-audio-or-video-sample.js +5 -1
- package/dist/download-and-parse-media.js +14 -10
- package/dist/emit-all-info.d.ts +3 -0
- package/dist/emit-all-info.js +30 -0
- package/dist/emit-audio-sample.d.ts +12 -0
- package/dist/emit-audio-sample.js +14 -0
- package/dist/emit-available-info.d.ts +2 -7
- package/dist/emit-available-info.js +70 -63
- package/dist/emitter.js +5 -1
- package/dist/errors.js +15 -6
- package/dist/esm/index.mjs +1921 -1618
- package/dist/esm/worker-server-entry.mjs +840 -537
- package/dist/esm/worker-web-entry.mjs +840 -537
- package/dist/esm/worker.mjs +4 -5
- package/dist/fetch.js +17 -1
- package/dist/fields.d.ts +61 -0
- package/dist/fields.js +2 -0
- package/dist/file-types/bmp.js +7 -3
- package/dist/file-types/detect-file-type.js +38 -24
- package/dist/file-types/index.js +26 -22
- package/dist/file-types/jpeg.js +9 -4
- package/dist/file-types/pdf.js +7 -3
- package/dist/file-types/png.js +9 -4
- package/dist/file-types/webp.js +7 -3
- package/dist/forward-controller.js +5 -1
- package/dist/get-audio-codec.js +38 -25
- package/dist/get-container.js +10 -5
- package/dist/get-dimensions.js +13 -8
- package/dist/get-duration.js +34 -27
- package/dist/get-fields-from-callbacks.d.ts +2 -1
- package/dist/get-fields-from-callbacks.js +5 -1
- package/dist/get-fps.js +34 -24
- package/dist/get-is-hdr.js +10 -5
- package/dist/get-keyframes.js +11 -6
- package/dist/get-location.js +9 -4
- package/dist/get-number-of-audio-channels.js +7 -2
- package/dist/get-sample-aspect-ratio.js +30 -17
- package/dist/get-sample-positions-from-lpcm.js +9 -5
- package/dist/get-sample-positions.js +5 -1
- package/dist/get-sample-rate.js +7 -2
- package/dist/get-seeking-info.d.ts +4 -0
- package/dist/get-seeking-info.js +22 -0
- package/dist/get-tracks.js +40 -29
- package/dist/get-video-codec.js +34 -26
- package/dist/has-all-info.d.ts +3 -5
- package/dist/has-all-info.js +39 -35
- package/dist/index.d.ts +53 -14
- package/dist/index.js +47 -32
- package/dist/init-video.d.ts +1 -4
- package/dist/init-video.js +29 -24
- package/dist/internal-parse-media.js +40 -199
- package/dist/is-audio-structure.js +5 -1
- package/dist/{buffer-iterator.d.ts → iterator/buffer-iterator.d.ts} +12 -15
- package/dist/{buffer-iterator.js → iterator/buffer-iterator.js} +16 -119
- package/dist/iterator/buffer-manager.d.ts +18 -0
- package/dist/iterator/buffer-manager.js +87 -0
- package/dist/iterator/offset-counter.d.ts +10 -0
- package/dist/iterator/offset-counter.js +31 -0
- package/dist/log.js +12 -8
- package/dist/make-hvc1-codec-strings.d.ts +1 -1
- package/dist/make-hvc1-codec-strings.js +5 -1
- package/dist/make-progress-object.d.ts +6 -0
- package/dist/make-progress-object.js +13 -0
- package/dist/media-parser-controller.d.ts +3 -0
- package/dist/media-parser-controller.js +15 -7
- package/dist/metadata/get-metadata.js +22 -17
- package/dist/metadata/metadata-from-iso.js +17 -12
- package/dist/metadata/metadata-from-matroska.js +7 -3
- package/dist/metadata/metadata-from-riff.js +7 -3
- package/dist/node-writer.js +17 -1
- package/dist/node.js +17 -1
- package/dist/options.d.ts +1 -61
- package/dist/options.js +2 -1
- package/dist/parse-loop.d.ts +8 -0
- package/dist/parse-loop.js +93 -0
- package/dist/parse-media-on-worker-entry.d.ts +2 -1
- package/dist/parse-media-on-worker-entry.js +7 -3
- package/dist/parse-media.js +12 -8
- package/dist/parse-result.js +2 -1
- package/dist/pause-signal.js +5 -1
- package/dist/perform-seek.d.ts +2 -7
- package/dist/perform-seek.js +29 -26
- package/dist/print-timings.d.ts +2 -0
- package/dist/print-timings.js +12 -0
- package/dist/readers/fetch/get-body-and-reader.js +5 -1
- package/dist/readers/fetch/resolve-url.js +5 -1
- package/dist/readers/from-fetch.js +21 -14
- package/dist/readers/from-node.js +23 -17
- package/dist/readers/from-web-file.js +13 -7
- package/dist/readers/reader.js +2 -1
- package/dist/readers/universal.js +16 -13
- package/dist/readers/web.js +12 -9
- package/dist/register-track.js +18 -9
- package/dist/remotion-license-acknowledge.js +8 -4
- package/dist/run-parse-iteration.d.ts +1 -4
- package/dist/run-parse-iteration.js +25 -24
- package/dist/samples-from-moof.js +10 -6
- package/dist/seek-backwards.d.ts +2 -0
- package/dist/seek-backwards.js +26 -0
- package/dist/seek-forwards.d.ts +2 -0
- package/dist/seek-forwards.js +28 -0
- package/dist/seek-signal.d.ts +22 -0
- package/dist/seek-signal.js +26 -0
- package/dist/seeking-info.d.ts +8 -0
- package/dist/seeking-info.js +2 -0
- package/dist/skip.js +5 -1
- package/dist/state/aac-state.js +5 -1
- package/dist/state/can-skip-tracks.d.ts +2 -2
- package/dist/state/can-skip-tracks.js +12 -4
- package/dist/state/emitted-fields.d.ts +1 -1
- package/dist/state/emitted-fields.js +5 -1
- package/dist/state/flac-state.js +5 -1
- package/dist/state/has-tracks-section.d.ts +2 -1
- package/dist/state/has-tracks-section.js +7 -3
- package/dist/state/images.js +5 -1
- package/dist/state/iso-base-media/cached-sample-positions.js +13 -8
- package/dist/state/iso-base-media/iso-state.js +9 -5
- package/dist/state/iso-base-media/moov-box.js +5 -1
- package/dist/state/keyframes.js +5 -1
- package/dist/state/m3u-state.js +9 -5
- package/dist/state/may-skip-video-data.js +7 -3
- package/dist/state/mp3.js +5 -1
- package/dist/state/need-samples-for-fields.d.ts +1 -1
- package/dist/state/need-samples-for-fields.js +5 -1
- package/dist/state/parser-state.d.ts +38 -8
- package/dist/state/parser-state.js +59 -35
- package/dist/state/riff.js +5 -1
- package/dist/state/sample-callbacks.d.ts +8 -3
- package/dist/state/sample-callbacks.js +27 -10
- package/dist/state/slow-duration-fps.js +5 -1
- package/dist/state/structure.js +5 -1
- package/dist/state/timings.d.ts +8 -0
- package/dist/state/timings.js +13 -0
- package/dist/state/transport-stream.js +7 -3
- package/dist/state/video-section.d.ts +1 -1
- package/dist/state/video-section.js +5 -1
- package/dist/state/webm.d.ts +1 -1
- package/dist/state/webm.js +9 -5
- package/dist/throttled-progress.d.ts +2 -3
- package/dist/throttled-progress.js +5 -1
- package/dist/truthy.js +4 -1
- package/dist/universal.js +5 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +4 -1
- package/dist/web.js +5 -1
- package/dist/webcodec-sample-types.js +2 -1
- package/dist/work-on-seek-request.d.ts +2 -0
- package/dist/work-on-seek-request.js +43 -0
- package/dist/worker/forward-controller.js +7 -3
- package/dist/worker/serialize-error.js +19 -14
- package/dist/worker/worker-types.d.ts +2 -1
- package/dist/worker/worker-types.js +2 -1
- package/dist/worker-server-entry.js +5 -3
- package/dist/worker-server.js +16 -12
- package/dist/worker-web-entry.js +5 -3
- package/dist/worker.d.ts +3 -2
- package/dist/worker.js +11 -2
- package/dist/writers/node.js +23 -16
- package/dist/writers/writer.js +2 -1
- package/package.json +10 -10
- package/dist/parse-media-on-server-worker.d.ts +0 -2
- package/dist/parse-media-on-server-worker.js +0 -4
- package/dist/parse-media-on-web-worker.d.ts +0 -2
- package/dist/parse-media-on-web-worker.js +0 -4
|
@@ -1,25 +1,30 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.emitAvailableInfo = void 0;
|
|
4
|
+
const get_streams_1 = require("./containers/m3u/get-streams");
|
|
5
|
+
const get_audio_codec_1 = require("./get-audio-codec");
|
|
6
|
+
const get_container_1 = require("./get-container");
|
|
7
|
+
const get_dimensions_1 = require("./get-dimensions");
|
|
8
|
+
const get_duration_1 = require("./get-duration");
|
|
9
|
+
const get_fps_1 = require("./get-fps");
|
|
10
|
+
const get_is_hdr_1 = require("./get-is-hdr");
|
|
11
|
+
const get_keyframes_1 = require("./get-keyframes");
|
|
12
|
+
const get_location_1 = require("./get-location");
|
|
13
|
+
const get_number_of_audio_channels_1 = require("./get-number-of-audio-channels");
|
|
14
|
+
const get_sample_rate_1 = require("./get-sample-rate");
|
|
15
|
+
const get_tracks_1 = require("./get-tracks");
|
|
16
|
+
const get_video_codec_1 = require("./get-video-codec");
|
|
17
|
+
const get_metadata_1 = require("./metadata/get-metadata");
|
|
18
|
+
const work_on_seek_request_1 = require("./work-on-seek-request");
|
|
19
|
+
const emitAvailableInfo = async ({ hasInfo, state, }) => {
|
|
16
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, _4, _5;
|
|
17
21
|
const keys = Object.keys(hasInfo);
|
|
18
|
-
const { emittedFields } = state;
|
|
22
|
+
const { emittedFields, fieldsInReturnValue, returnValue, name, callbackFunctions, } = state;
|
|
19
23
|
for (const key of keys) {
|
|
24
|
+
await (0, work_on_seek_request_1.workOnSeekRequest)(state);
|
|
20
25
|
if (key === 'structure') {
|
|
21
26
|
if (hasInfo.structure && !emittedFields.structure) {
|
|
22
|
-
await ((_a =
|
|
27
|
+
await ((_a = callbackFunctions.onStructure) === null || _a === void 0 ? void 0 : _a.call(callbackFunctions, state.getStructure()));
|
|
23
28
|
if (fieldsInReturnValue.structure) {
|
|
24
29
|
returnValue.structure = state.getStructure();
|
|
25
30
|
}
|
|
@@ -30,8 +35,8 @@ export const emitAvailableInfo = async ({ hasInfo, callbacks, state, returnValue
|
|
|
30
35
|
if (key === 'durationInSeconds') {
|
|
31
36
|
if (hasInfo.durationInSeconds) {
|
|
32
37
|
if (!emittedFields.durationInSeconds) {
|
|
33
|
-
const durationInSeconds = getDuration(state);
|
|
34
|
-
await ((_b =
|
|
38
|
+
const durationInSeconds = (0, get_duration_1.getDuration)(state);
|
|
39
|
+
await ((_b = callbackFunctions.onDurationInSeconds) === null || _b === void 0 ? void 0 : _b.call(callbackFunctions, durationInSeconds));
|
|
35
40
|
if (fieldsInReturnValue.durationInSeconds) {
|
|
36
41
|
returnValue.durationInSeconds = durationInSeconds;
|
|
37
42
|
}
|
|
@@ -43,8 +48,8 @@ export const emitAvailableInfo = async ({ hasInfo, callbacks, state, returnValue
|
|
|
43
48
|
if (key === 'slowDurationInSeconds') {
|
|
44
49
|
if (hasInfo.slowDurationInSeconds &&
|
|
45
50
|
!emittedFields.slowDurationInSeconds) {
|
|
46
|
-
const slowDurationInSeconds = (_c = getDuration(state)) !== null && _c !== void 0 ? _c : state.slowDurationAndFps.getSlowDurationInSeconds();
|
|
47
|
-
await ((_d =
|
|
51
|
+
const slowDurationInSeconds = (_c = (0, get_duration_1.getDuration)(state)) !== null && _c !== void 0 ? _c : state.slowDurationAndFps.getSlowDurationInSeconds();
|
|
52
|
+
await ((_d = callbackFunctions.onSlowDurationInSeconds) === null || _d === void 0 ? void 0 : _d.call(callbackFunctions, slowDurationInSeconds));
|
|
48
53
|
if (fieldsInReturnValue.slowDurationInSeconds) {
|
|
49
54
|
returnValue.slowDurationInSeconds = slowDurationInSeconds;
|
|
50
55
|
}
|
|
@@ -55,17 +60,17 @@ export const emitAvailableInfo = async ({ hasInfo, callbacks, state, returnValue
|
|
|
55
60
|
if (key === 'fps') {
|
|
56
61
|
if (hasInfo.fps) {
|
|
57
62
|
if (!emittedFields.fps) {
|
|
58
|
-
const fps = getFps(state);
|
|
59
|
-
await ((_e =
|
|
63
|
+
const fps = (0, get_fps_1.getFps)(state);
|
|
64
|
+
await ((_e = callbackFunctions.onFps) === null || _e === void 0 ? void 0 : _e.call(callbackFunctions, fps));
|
|
60
65
|
if (fieldsInReturnValue.fps) {
|
|
61
66
|
returnValue.fps = fps;
|
|
62
67
|
}
|
|
63
68
|
emittedFields.fps = true;
|
|
64
69
|
}
|
|
65
70
|
if (!emittedFields.slowFps) {
|
|
66
|
-
const fps = getFps(state);
|
|
71
|
+
const fps = (0, get_fps_1.getFps)(state);
|
|
67
72
|
if (fps) {
|
|
68
|
-
await ((_f =
|
|
73
|
+
await ((_f = callbackFunctions.onSlowFps) === null || _f === void 0 ? void 0 : _f.call(callbackFunctions, fps));
|
|
69
74
|
if (fieldsInReturnValue.slowFps) {
|
|
70
75
|
returnValue.slowFps = fps;
|
|
71
76
|
}
|
|
@@ -79,7 +84,7 @@ export const emitAvailableInfo = async ({ hasInfo, callbacks, state, returnValue
|
|
|
79
84
|
if (key === 'slowFps') {
|
|
80
85
|
if (hasInfo.slowFps && !emittedFields.slowFps) {
|
|
81
86
|
const slowFps = state.slowDurationAndFps.getFps();
|
|
82
|
-
await ((_g =
|
|
87
|
+
await ((_g = callbackFunctions.onSlowFps) === null || _g === void 0 ? void 0 : _g.call(callbackFunctions, slowFps));
|
|
83
88
|
if (fieldsInReturnValue.slowFps) {
|
|
84
89
|
returnValue.slowFps = slowFps;
|
|
85
90
|
}
|
|
@@ -89,14 +94,14 @@ export const emitAvailableInfo = async ({ hasInfo, callbacks, state, returnValue
|
|
|
89
94
|
}
|
|
90
95
|
if (key === 'dimensions') {
|
|
91
96
|
if (hasInfo.dimensions && !emittedFields.dimensions) {
|
|
92
|
-
const dimensionsQueried = getDimensions(state);
|
|
97
|
+
const dimensionsQueried = (0, get_dimensions_1.getDimensions)(state);
|
|
93
98
|
const dimensions = dimensionsQueried === null
|
|
94
99
|
? null
|
|
95
100
|
: {
|
|
96
101
|
height: dimensionsQueried.height,
|
|
97
102
|
width: dimensionsQueried.width,
|
|
98
103
|
};
|
|
99
|
-
await ((_h =
|
|
104
|
+
await ((_h = callbackFunctions.onDimensions) === null || _h === void 0 ? void 0 : _h.call(callbackFunctions, dimensions));
|
|
100
105
|
if (fieldsInReturnValue.dimensions) {
|
|
101
106
|
returnValue.dimensions = dimensions;
|
|
102
107
|
}
|
|
@@ -106,14 +111,14 @@ export const emitAvailableInfo = async ({ hasInfo, callbacks, state, returnValue
|
|
|
106
111
|
}
|
|
107
112
|
if (key === 'unrotatedDimensions') {
|
|
108
113
|
if (hasInfo.unrotatedDimensions && !emittedFields.unrotatedDimensions) {
|
|
109
|
-
const dimensionsQueried = getDimensions(state);
|
|
114
|
+
const dimensionsQueried = (0, get_dimensions_1.getDimensions)(state);
|
|
110
115
|
const unrotatedDimensions = dimensionsQueried === null
|
|
111
116
|
? null
|
|
112
117
|
: {
|
|
113
118
|
height: dimensionsQueried.unrotatedHeight,
|
|
114
119
|
width: dimensionsQueried.unrotatedWidth,
|
|
115
120
|
};
|
|
116
|
-
await ((_j =
|
|
121
|
+
await ((_j = callbackFunctions.onUnrotatedDimensions) === null || _j === void 0 ? void 0 : _j.call(callbackFunctions, unrotatedDimensions));
|
|
117
122
|
if (fieldsInReturnValue.unrotatedDimensions) {
|
|
118
123
|
returnValue.unrotatedDimensions = unrotatedDimensions;
|
|
119
124
|
}
|
|
@@ -123,9 +128,9 @@ export const emitAvailableInfo = async ({ hasInfo, callbacks, state, returnValue
|
|
|
123
128
|
}
|
|
124
129
|
if (key === 'rotation') {
|
|
125
130
|
if (hasInfo.rotation && !emittedFields.rotation) {
|
|
126
|
-
const dimensionsQueried = getDimensions(state);
|
|
131
|
+
const dimensionsQueried = (0, get_dimensions_1.getDimensions)(state);
|
|
127
132
|
const rotation = (_k = dimensionsQueried === null || dimensionsQueried === void 0 ? void 0 : dimensionsQueried.rotation) !== null && _k !== void 0 ? _k : 0;
|
|
128
|
-
await ((_l =
|
|
133
|
+
await ((_l = callbackFunctions.onRotation) === null || _l === void 0 ? void 0 : _l.call(callbackFunctions, rotation));
|
|
129
134
|
if (fieldsInReturnValue.rotation) {
|
|
130
135
|
returnValue.rotation = rotation;
|
|
131
136
|
}
|
|
@@ -135,8 +140,8 @@ export const emitAvailableInfo = async ({ hasInfo, callbacks, state, returnValue
|
|
|
135
140
|
}
|
|
136
141
|
if (key === 'videoCodec') {
|
|
137
142
|
if (!emittedFields.videoCodec && hasInfo.videoCodec) {
|
|
138
|
-
const videoCodec = getVideoCodec(state);
|
|
139
|
-
await ((_m =
|
|
143
|
+
const videoCodec = (0, get_video_codec_1.getVideoCodec)(state);
|
|
144
|
+
await ((_m = callbackFunctions.onVideoCodec) === null || _m === void 0 ? void 0 : _m.call(callbackFunctions, videoCodec));
|
|
140
145
|
if (fieldsInReturnValue.videoCodec) {
|
|
141
146
|
returnValue.videoCodec = videoCodec;
|
|
142
147
|
}
|
|
@@ -146,8 +151,8 @@ export const emitAvailableInfo = async ({ hasInfo, callbacks, state, returnValue
|
|
|
146
151
|
}
|
|
147
152
|
if (key === 'audioCodec') {
|
|
148
153
|
if (!emittedFields.audioCodec && hasInfo.audioCodec) {
|
|
149
|
-
const audioCodec = getAudioCodec(state);
|
|
150
|
-
await ((_o =
|
|
154
|
+
const audioCodec = (0, get_audio_codec_1.getAudioCodec)(state);
|
|
155
|
+
await ((_o = callbackFunctions.onAudioCodec) === null || _o === void 0 ? void 0 : _o.call(callbackFunctions, audioCodec));
|
|
151
156
|
if (fieldsInReturnValue.audioCodec) {
|
|
152
157
|
returnValue.audioCodec = audioCodec;
|
|
153
158
|
}
|
|
@@ -157,8 +162,8 @@ export const emitAvailableInfo = async ({ hasInfo, callbacks, state, returnValue
|
|
|
157
162
|
}
|
|
158
163
|
if (key === 'tracks') {
|
|
159
164
|
if (!emittedFields.tracks && hasInfo.tracks) {
|
|
160
|
-
const { videoTracks, audioTracks } = getTracks(state);
|
|
161
|
-
await ((_p =
|
|
165
|
+
const { videoTracks, audioTracks } = (0, get_tracks_1.getTracks)(state);
|
|
166
|
+
await ((_p = callbackFunctions.onTracks) === null || _p === void 0 ? void 0 : _p.call(callbackFunctions, { videoTracks, audioTracks }));
|
|
162
167
|
if (fieldsInReturnValue.tracks) {
|
|
163
168
|
returnValue.tracks = { videoTracks, audioTracks };
|
|
164
169
|
}
|
|
@@ -179,7 +184,7 @@ export const emitAvailableInfo = async ({ hasInfo, callbacks, state, returnValue
|
|
|
179
184
|
}
|
|
180
185
|
if (key === 'size') {
|
|
181
186
|
if (!emittedFields.size && hasInfo.size) {
|
|
182
|
-
await ((_q =
|
|
187
|
+
await ((_q = callbackFunctions.onSize) === null || _q === void 0 ? void 0 : _q.call(callbackFunctions, state.contentLength));
|
|
183
188
|
if (fieldsInReturnValue.size) {
|
|
184
189
|
returnValue.size = state.contentLength;
|
|
185
190
|
}
|
|
@@ -189,9 +194,9 @@ export const emitAvailableInfo = async ({ hasInfo, callbacks, state, returnValue
|
|
|
189
194
|
}
|
|
190
195
|
if (key === 'mimeType') {
|
|
191
196
|
if (!emittedFields.mimeType && hasInfo.mimeType) {
|
|
192
|
-
await ((_r =
|
|
197
|
+
await ((_r = callbackFunctions.onMimeType) === null || _r === void 0 ? void 0 : _r.call(callbackFunctions, state.mimeType));
|
|
193
198
|
if (fieldsInReturnValue.mimeType) {
|
|
194
|
-
returnValue.mimeType = mimeType;
|
|
199
|
+
returnValue.mimeType = state.mimeType;
|
|
195
200
|
}
|
|
196
201
|
emittedFields.mimeType = true;
|
|
197
202
|
}
|
|
@@ -199,7 +204,7 @@ export const emitAvailableInfo = async ({ hasInfo, callbacks, state, returnValue
|
|
|
199
204
|
}
|
|
200
205
|
if (key === 'name') {
|
|
201
206
|
if (!emittedFields.name && hasInfo.name) {
|
|
202
|
-
await ((_s =
|
|
207
|
+
await ((_s = callbackFunctions.onName) === null || _s === void 0 ? void 0 : _s.call(callbackFunctions, name));
|
|
203
208
|
if (fieldsInReturnValue.name) {
|
|
204
209
|
returnValue.name = name;
|
|
205
210
|
}
|
|
@@ -209,8 +214,8 @@ export const emitAvailableInfo = async ({ hasInfo, callbacks, state, returnValue
|
|
|
209
214
|
}
|
|
210
215
|
if (key === 'isHdr') {
|
|
211
216
|
if (!returnValue.isHdr && hasInfo.isHdr) {
|
|
212
|
-
const isHdr = getIsHdr(state);
|
|
213
|
-
await ((_t =
|
|
217
|
+
const isHdr = (0, get_is_hdr_1.getIsHdr)(state);
|
|
218
|
+
await ((_t = callbackFunctions.onIsHdr) === null || _t === void 0 ? void 0 : _t.call(callbackFunctions, isHdr));
|
|
214
219
|
if (fieldsInReturnValue.isHdr) {
|
|
215
220
|
returnValue.isHdr = isHdr;
|
|
216
221
|
}
|
|
@@ -220,8 +225,8 @@ export const emitAvailableInfo = async ({ hasInfo, callbacks, state, returnValue
|
|
|
220
225
|
}
|
|
221
226
|
if (key === 'container') {
|
|
222
227
|
if (!returnValue.container && hasInfo.container) {
|
|
223
|
-
const container = getContainer(state.getStructure());
|
|
224
|
-
await ((_u =
|
|
228
|
+
const container = (0, get_container_1.getContainer)(state.getStructure());
|
|
229
|
+
await ((_u = callbackFunctions.onContainer) === null || _u === void 0 ? void 0 : _u.call(callbackFunctions, container));
|
|
225
230
|
if (fieldsInReturnValue.container) {
|
|
226
231
|
returnValue.container = container;
|
|
227
232
|
}
|
|
@@ -231,8 +236,8 @@ export const emitAvailableInfo = async ({ hasInfo, callbacks, state, returnValue
|
|
|
231
236
|
}
|
|
232
237
|
if (key === 'metadata') {
|
|
233
238
|
if (!emittedFields.metadata && hasInfo.metadata) {
|
|
234
|
-
const metadata = getMetadata(state);
|
|
235
|
-
await ((_v =
|
|
239
|
+
const metadata = (0, get_metadata_1.getMetadata)(state);
|
|
240
|
+
await ((_v = callbackFunctions.onMetadata) === null || _v === void 0 ? void 0 : _v.call(callbackFunctions, metadata));
|
|
236
241
|
if (fieldsInReturnValue.metadata) {
|
|
237
242
|
returnValue.metadata = metadata;
|
|
238
243
|
}
|
|
@@ -242,8 +247,8 @@ export const emitAvailableInfo = async ({ hasInfo, callbacks, state, returnValue
|
|
|
242
247
|
}
|
|
243
248
|
if (key === 'location') {
|
|
244
249
|
if (!emittedFields.location && hasInfo.location) {
|
|
245
|
-
const location = getLocation(state);
|
|
246
|
-
await ((_w =
|
|
250
|
+
const location = (0, get_location_1.getLocation)(state);
|
|
251
|
+
await ((_w = callbackFunctions.onLocation) === null || _w === void 0 ? void 0 : _w.call(callbackFunctions, location));
|
|
247
252
|
if (fieldsInReturnValue.location) {
|
|
248
253
|
returnValue.location = location;
|
|
249
254
|
}
|
|
@@ -253,7 +258,7 @@ export const emitAvailableInfo = async ({ hasInfo, callbacks, state, returnValue
|
|
|
253
258
|
}
|
|
254
259
|
if (key === 'slowKeyframes') {
|
|
255
260
|
if (!emittedFields.slowKeyframes && hasInfo.slowKeyframes) {
|
|
256
|
-
await ((_x =
|
|
261
|
+
await ((_x = callbackFunctions.onSlowKeyframes) === null || _x === void 0 ? void 0 : _x.call(callbackFunctions, state.keyframes.getKeyframes()));
|
|
257
262
|
if (fieldsInReturnValue.slowKeyframes) {
|
|
258
263
|
returnValue.slowKeyframes = state.keyframes.getKeyframes();
|
|
259
264
|
}
|
|
@@ -263,7 +268,7 @@ export const emitAvailableInfo = async ({ hasInfo, callbacks, state, returnValue
|
|
|
263
268
|
}
|
|
264
269
|
if (key === 'slowNumberOfFrames') {
|
|
265
270
|
if (!emittedFields.slowNumberOfFrames && hasInfo.slowNumberOfFrames) {
|
|
266
|
-
await ((_y =
|
|
271
|
+
await ((_y = callbackFunctions.onSlowNumberOfFrames) === null || _y === void 0 ? void 0 : _y.call(callbackFunctions, state.slowDurationAndFps.getSlowNumberOfFrames()));
|
|
267
272
|
if (fieldsInReturnValue.slowNumberOfFrames) {
|
|
268
273
|
returnValue.slowNumberOfFrames =
|
|
269
274
|
state.slowDurationAndFps.getSlowNumberOfFrames();
|
|
@@ -274,7 +279,7 @@ export const emitAvailableInfo = async ({ hasInfo, callbacks, state, returnValue
|
|
|
274
279
|
}
|
|
275
280
|
if (key === 'slowAudioBitrate') {
|
|
276
281
|
if (!emittedFields.slowAudioBitrate && hasInfo.slowAudioBitrate) {
|
|
277
|
-
await ((_z =
|
|
282
|
+
await ((_z = callbackFunctions.onSlowAudioBitrate) === null || _z === void 0 ? void 0 : _z.call(callbackFunctions, state.slowDurationAndFps.getAudioBitrate()));
|
|
278
283
|
if (fieldsInReturnValue.slowAudioBitrate) {
|
|
279
284
|
returnValue.slowAudioBitrate =
|
|
280
285
|
state.slowDurationAndFps.getAudioBitrate();
|
|
@@ -285,7 +290,7 @@ export const emitAvailableInfo = async ({ hasInfo, callbacks, state, returnValue
|
|
|
285
290
|
}
|
|
286
291
|
if (key === 'slowVideoBitrate') {
|
|
287
292
|
if (!emittedFields.slowVideoBitrate && hasInfo.slowVideoBitrate) {
|
|
288
|
-
await ((_0 =
|
|
293
|
+
await ((_0 = callbackFunctions.onSlowVideoBitrate) === null || _0 === void 0 ? void 0 : _0.call(callbackFunctions, state.slowDurationAndFps.getVideoBitrate()));
|
|
289
294
|
if (fieldsInReturnValue.slowVideoBitrate) {
|
|
290
295
|
returnValue.slowVideoBitrate =
|
|
291
296
|
state.slowDurationAndFps.getVideoBitrate();
|
|
@@ -296,9 +301,9 @@ export const emitAvailableInfo = async ({ hasInfo, callbacks, state, returnValue
|
|
|
296
301
|
}
|
|
297
302
|
if (key === 'keyframes') {
|
|
298
303
|
if (!emittedFields.keyframes && hasInfo.keyframes) {
|
|
299
|
-
await ((_1 =
|
|
304
|
+
await ((_1 = callbackFunctions.onKeyframes) === null || _1 === void 0 ? void 0 : _1.call(callbackFunctions, (0, get_keyframes_1.getKeyframes)(state)));
|
|
300
305
|
if (fieldsInReturnValue.keyframes) {
|
|
301
|
-
returnValue.keyframes = getKeyframes(state);
|
|
306
|
+
returnValue.keyframes = (0, get_keyframes_1.getKeyframes)(state);
|
|
302
307
|
}
|
|
303
308
|
emittedFields.keyframes = true;
|
|
304
309
|
}
|
|
@@ -306,7 +311,7 @@ export const emitAvailableInfo = async ({ hasInfo, callbacks, state, returnValue
|
|
|
306
311
|
}
|
|
307
312
|
if (key === 'images') {
|
|
308
313
|
if (!emittedFields.images && hasInfo.images) {
|
|
309
|
-
await ((_2 =
|
|
314
|
+
await ((_2 = callbackFunctions.onImages) === null || _2 === void 0 ? void 0 : _2.call(callbackFunctions, state.images.images));
|
|
310
315
|
if (fieldsInReturnValue.images) {
|
|
311
316
|
returnValue.images = state.images.images;
|
|
312
317
|
}
|
|
@@ -316,8 +321,8 @@ export const emitAvailableInfo = async ({ hasInfo, callbacks, state, returnValue
|
|
|
316
321
|
}
|
|
317
322
|
if (key === 'sampleRate') {
|
|
318
323
|
if (!emittedFields.sampleRate && hasInfo.sampleRate) {
|
|
319
|
-
const sampleRate = getSampleRate(state);
|
|
320
|
-
await ((_3 =
|
|
324
|
+
const sampleRate = (0, get_sample_rate_1.getSampleRate)(state);
|
|
325
|
+
await ((_3 = callbackFunctions.onSampleRate) === null || _3 === void 0 ? void 0 : _3.call(callbackFunctions, sampleRate));
|
|
321
326
|
if (fieldsInReturnValue.sampleRate) {
|
|
322
327
|
returnValue.sampleRate = sampleRate;
|
|
323
328
|
}
|
|
@@ -328,8 +333,8 @@ export const emitAvailableInfo = async ({ hasInfo, callbacks, state, returnValue
|
|
|
328
333
|
if (key === 'numberOfAudioChannels') {
|
|
329
334
|
if (!emittedFields.numberOfAudioChannels &&
|
|
330
335
|
hasInfo.numberOfAudioChannels) {
|
|
331
|
-
const numberOfAudioChannels = getNumberOfAudioChannels(state);
|
|
332
|
-
await ((_4 =
|
|
336
|
+
const numberOfAudioChannels = (0, get_number_of_audio_channels_1.getNumberOfAudioChannels)(state);
|
|
337
|
+
await ((_4 = callbackFunctions.onNumberOfAudioChannels) === null || _4 === void 0 ? void 0 : _4.call(callbackFunctions, numberOfAudioChannels));
|
|
333
338
|
if (fieldsInReturnValue.numberOfAudioChannels) {
|
|
334
339
|
returnValue.numberOfAudioChannels = numberOfAudioChannels;
|
|
335
340
|
}
|
|
@@ -339,12 +344,12 @@ export const emitAvailableInfo = async ({ hasInfo, callbacks, state, returnValue
|
|
|
339
344
|
}
|
|
340
345
|
if (key === 'm3uStreams') {
|
|
341
346
|
if (!emittedFields.m3uStreams && hasInfo.m3uStreams) {
|
|
342
|
-
const streams = getM3uStreams({
|
|
347
|
+
const streams = (0, get_streams_1.getM3uStreams)({
|
|
343
348
|
structure: state.getStructureOrNull(),
|
|
344
349
|
originalSrc: state.src,
|
|
345
350
|
readerInterface: state.readerInterface,
|
|
346
351
|
});
|
|
347
|
-
await ((_5 =
|
|
352
|
+
await ((_5 = callbackFunctions.onM3uStreams) === null || _5 === void 0 ? void 0 : _5.call(callbackFunctions, streams));
|
|
348
353
|
if (fieldsInReturnValue.m3uStreams) {
|
|
349
354
|
returnValue.m3uStreams = streams;
|
|
350
355
|
}
|
|
@@ -354,4 +359,6 @@ export const emitAvailableInfo = async ({ hasInfo, callbacks, state, returnValue
|
|
|
354
359
|
}
|
|
355
360
|
throw new Error(`Unhandled key: ${key}`);
|
|
356
361
|
}
|
|
362
|
+
await (0, work_on_seek_request_1.workOnSeekRequest)(state);
|
|
357
363
|
};
|
|
364
|
+
exports.emitAvailableInfo = emitAvailableInfo;
|
package/dist/emitter.js
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MediaParserEmitter = void 0;
|
|
4
|
+
class MediaParserEmitter {
|
|
2
5
|
constructor() {
|
|
3
6
|
this.listeners = {
|
|
4
7
|
pause: [],
|
|
@@ -27,3 +30,4 @@ export class MediaParserEmitter {
|
|
|
27
30
|
});
|
|
28
31
|
}
|
|
29
32
|
}
|
|
33
|
+
exports.MediaParserEmitter = MediaParserEmitter;
|
package/dist/errors.js
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.hasBeenAborted = exports.MediaParserAbortError = exports.IsAnUnsupportedFileTypeError = exports.IsAPdfError = exports.IsAnImageError = exports.IsAGifError = void 0;
|
|
4
|
+
class IsAGifError extends Error {
|
|
2
5
|
constructor({ message, mimeType, sizeInBytes, fileName, }) {
|
|
3
6
|
super(message);
|
|
4
7
|
this.name = 'IsAGifError';
|
|
@@ -11,7 +14,8 @@ export class IsAGifError extends Error {
|
|
|
11
14
|
}
|
|
12
15
|
}
|
|
13
16
|
}
|
|
14
|
-
|
|
17
|
+
exports.IsAGifError = IsAGifError;
|
|
18
|
+
class IsAnImageError extends Error {
|
|
15
19
|
constructor({ dimensions, imageType, message, mimeType, sizeInBytes, fileName, }) {
|
|
16
20
|
super(message);
|
|
17
21
|
this.name = 'IsAnImageError';
|
|
@@ -25,7 +29,8 @@ export class IsAnImageError extends Error {
|
|
|
25
29
|
}
|
|
26
30
|
}
|
|
27
31
|
}
|
|
28
|
-
|
|
32
|
+
exports.IsAnImageError = IsAnImageError;
|
|
33
|
+
class IsAPdfError extends Error {
|
|
29
34
|
constructor({ message, mimeType, sizeInBytes, fileName, }) {
|
|
30
35
|
super(message);
|
|
31
36
|
this.name = 'IsAPdfError';
|
|
@@ -37,7 +42,8 @@ export class IsAPdfError extends Error {
|
|
|
37
42
|
}
|
|
38
43
|
}
|
|
39
44
|
}
|
|
40
|
-
|
|
45
|
+
exports.IsAPdfError = IsAPdfError;
|
|
46
|
+
class IsAnUnsupportedFileTypeError extends Error {
|
|
41
47
|
constructor({ message, mimeType, sizeInBytes, fileName, }) {
|
|
42
48
|
super(message);
|
|
43
49
|
this.name = 'IsAnUnsupportedFileTypeError';
|
|
@@ -49,15 +55,18 @@ export class IsAnUnsupportedFileTypeError extends Error {
|
|
|
49
55
|
}
|
|
50
56
|
}
|
|
51
57
|
}
|
|
52
|
-
|
|
58
|
+
exports.IsAnUnsupportedFileTypeError = IsAnUnsupportedFileTypeError;
|
|
59
|
+
class MediaParserAbortError extends Error {
|
|
53
60
|
constructor(message) {
|
|
54
61
|
super(message);
|
|
55
62
|
this.name = 'MediaParserAbortError';
|
|
56
63
|
this.cause = undefined;
|
|
57
64
|
}
|
|
58
65
|
}
|
|
59
|
-
|
|
66
|
+
exports.MediaParserAbortError = MediaParserAbortError;
|
|
67
|
+
const hasBeenAborted = (error) => {
|
|
60
68
|
return (error instanceof MediaParserAbortError ||
|
|
61
69
|
// On worker it is not the same instance, but same name
|
|
62
70
|
error.name === 'MediaParserAbortError');
|
|
63
71
|
};
|
|
72
|
+
exports.hasBeenAborted = hasBeenAborted;
|