@remotion/renderer 4.0.0-bitrate.18 → 4.0.0-copy.4
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/LICENSE.md +8 -8
- package/dist/assets/calculate-asset-positions.d.ts +0 -0
- package/dist/assets/calculate-asset-positions.js +0 -0
- package/dist/assets/calculate-atempo.d.ts +0 -0
- package/dist/assets/calculate-atempo.js +0 -0
- package/dist/assets/convert-assets-to-file-urls.d.ts +0 -0
- package/dist/assets/convert-assets-to-file-urls.js +0 -0
- package/dist/assets/download-and-map-assets-to-file.d.ts +0 -0
- package/dist/assets/download-and-map-assets-to-file.js +7 -7
- package/dist/assets/download-file.d.ts +6 -4
- package/dist/assets/download-file.js +44 -5
- package/dist/assets/download-map.d.ts +3 -2
- package/dist/assets/download-map.js +0 -0
- package/dist/assets/ffmpeg-volume-expression.d.ts +0 -0
- package/dist/assets/ffmpeg-volume-expression.js +0 -0
- package/dist/assets/flatten-volume-array.d.ts +0 -0
- package/dist/assets/flatten-volume-array.js +0 -0
- package/dist/assets/get-audio-channels.d.ts +1 -1
- package/dist/assets/get-audio-channels.js +5 -4
- package/dist/assets/get-video-stream-duration.d.ts +6 -1
- package/dist/assets/get-video-stream-duration.js +21 -9
- package/dist/assets/read-file.d.ts +0 -0
- package/dist/assets/read-file.js +2 -4
- package/dist/assets/round-volume-to-avoid-stack-overflow.d.ts +0 -0
- package/dist/assets/round-volume-to-avoid-stack-overflow.js +0 -0
- package/dist/assets/sanitize-filename.d.ts +0 -0
- package/dist/assets/sanitize-filename.js +0 -0
- package/dist/assets/sanitize-filepath.d.ts +0 -0
- package/dist/assets/sanitize-filepath.js +0 -0
- package/dist/assets/truncate-utf8-bytes.d.ts +0 -0
- package/dist/assets/truncate-utf8-bytes.js +0 -0
- package/dist/assets/types.d.ts +0 -0
- package/dist/assets/types.js +0 -0
- package/dist/browser/Browser.d.ts +4 -2
- package/dist/browser/Browser.js +15 -12
- package/dist/browser/BrowserConnector.d.ts +0 -0
- package/dist/browser/BrowserConnector.js +0 -0
- package/dist/browser/BrowserFetcher.d.ts +1 -0
- package/dist/browser/BrowserFetcher.js +11 -10
- package/dist/browser/BrowserPage.d.ts +8 -2
- package/dist/browser/BrowserPage.js +7 -10
- package/dist/browser/BrowserRunner.d.ts +0 -0
- package/dist/browser/BrowserRunner.js +0 -0
- package/dist/browser/Connection.d.ts +0 -0
- package/dist/browser/Connection.js +1 -1
- package/dist/browser/ConsoleMessage.d.ts +0 -0
- package/dist/browser/ConsoleMessage.js +0 -0
- package/dist/browser/DOMWorld.d.ts +2 -1
- package/dist/browser/DOMWorld.js +8 -1
- package/dist/browser/Errors.d.ts +0 -0
- package/dist/browser/Errors.js +0 -0
- package/dist/browser/EvalTypes.d.ts +0 -0
- package/dist/browser/EvalTypes.js +0 -0
- package/dist/browser/EventEmitter.d.ts +0 -0
- package/dist/browser/EventEmitter.js +0 -0
- package/dist/browser/ExecutionContext.d.ts +0 -0
- package/dist/browser/ExecutionContext.js +0 -0
- package/dist/browser/FrameManager.d.ts +0 -2
- package/dist/browser/FrameManager.js +0 -3
- package/dist/browser/HTTPRequest.d.ts +0 -0
- package/dist/browser/HTTPRequest.js +0 -0
- package/dist/browser/HTTPResponse.d.ts +0 -0
- package/dist/browser/HTTPResponse.js +0 -0
- package/dist/browser/JSHandle.d.ts +0 -0
- package/dist/browser/JSHandle.js +0 -0
- package/dist/browser/LaunchOptions.d.ts +0 -0
- package/dist/browser/LaunchOptions.js +0 -0
- package/dist/browser/Launcher.d.ts +7 -1
- package/dist/browser/Launcher.js +3 -5
- package/dist/browser/LifecycleWatcher.d.ts +0 -0
- package/dist/browser/LifecycleWatcher.js +0 -0
- package/dist/browser/NetworkEventManager.d.ts +0 -0
- package/dist/browser/NetworkEventManager.js +0 -0
- package/dist/browser/NetworkManager.d.ts +0 -0
- package/dist/browser/NetworkManager.js +0 -0
- package/dist/browser/NodeWebSocketTransport.d.ts +0 -0
- package/dist/browser/NodeWebSocketTransport.js +1 -1
- package/dist/browser/Product.d.ts +0 -0
- package/dist/browser/Product.js +0 -0
- package/dist/browser/PuppeteerNode.d.ts +0 -0
- package/dist/browser/PuppeteerNode.js +2 -6
- package/dist/browser/PuppeteerViewport.d.ts +0 -0
- package/dist/browser/PuppeteerViewport.js +0 -0
- package/dist/browser/ScreenshotOptions.d.ts +0 -0
- package/dist/browser/ScreenshotOptions.js +0 -0
- package/dist/browser/Target.d.ts +0 -0
- package/dist/browser/Target.js +0 -0
- package/dist/browser/TaskQueue.d.ts +0 -0
- package/dist/browser/TaskQueue.js +0 -0
- package/dist/browser/TimeoutSettings.d.ts +0 -0
- package/dist/browser/TimeoutSettings.js +0 -0
- package/dist/browser/assert.d.ts +0 -0
- package/dist/browser/assert.js +0 -0
- package/dist/browser/create-browser-fetcher.d.ts +0 -0
- package/dist/browser/create-browser-fetcher.js +0 -0
- package/dist/browser/devtools-commands.d.ts +0 -0
- package/dist/browser/devtools-commands.js +0 -0
- package/dist/browser/devtools-types.d.ts +0 -0
- package/dist/browser/devtools-types.js +0 -0
- package/dist/browser/get-download-destination.d.ts +0 -0
- package/dist/browser/get-download-destination.js +0 -0
- package/dist/browser/mitt/index.d.ts +0 -0
- package/dist/browser/mitt/index.js +0 -0
- package/dist/browser/node.d.ts +0 -0
- package/dist/browser/node.js +0 -0
- package/dist/browser/revisions.d.ts +0 -0
- package/dist/browser/revisions.js +0 -0
- package/dist/browser/util.d.ts +0 -0
- package/dist/browser/util.js +0 -0
- package/dist/browser-executable.d.ts +0 -0
- package/dist/browser-executable.js +0 -0
- package/dist/browser-log.d.ts +0 -0
- package/dist/browser-log.js +0 -0
- package/dist/browser.d.ts +0 -0
- package/dist/browser.js +0 -0
- package/dist/calculate-ffmpeg-filters.d.ts +0 -0
- package/dist/calculate-ffmpeg-filters.js +0 -0
- package/dist/calculate-sar-dar-pixels.d.ts +0 -0
- package/dist/calculate-sar-dar-pixels.js +0 -0
- package/dist/can-use-parallel-encoding.d.ts +0 -0
- package/dist/can-use-parallel-encoding.js +0 -0
- package/dist/check-apple-silicon.d.ts +1 -1
- package/dist/check-apple-silicon.js +9 -5
- package/dist/chunk.d.ts +0 -0
- package/dist/chunk.js +0 -0
- package/dist/codec-supports-media.d.ts +0 -0
- package/dist/codec-supports-media.js +0 -0
- package/dist/codec.d.ts +0 -0
- package/dist/codec.js +0 -0
- package/dist/combine-videos.d.ts +7 -2
- package/dist/combine-videos.js +4 -3
- package/dist/compress-assets.d.ts +0 -0
- package/dist/compress-assets.js +0 -0
- package/dist/convert-number-of-gif-loops-to-ffmpeg.d.ts +0 -0
- package/dist/convert-number-of-gif-loops-to-ffmpeg.js +0 -0
- package/dist/convert-to-pcm.d.ts +2 -1
- package/dist/convert-to-pcm.js +3 -2
- package/dist/convert-to-positive-frame-index.d.ts +0 -0
- package/dist/convert-to-positive-frame-index.js +0 -0
- package/dist/create-ffmpeg-complex-filter.d.ts +0 -0
- package/dist/create-ffmpeg-complex-filter.js +0 -0
- package/dist/create-ffmpeg-merge-filter.d.ts +0 -0
- package/dist/create-ffmpeg-merge-filter.js +0 -0
- package/dist/create-silent-audio.d.ts +2 -1
- package/dist/create-silent-audio.js +3 -2
- package/dist/crf.d.ts +0 -0
- package/dist/crf.js +16 -0
- package/dist/cycle-browser-tabs.d.ts +2 -5
- package/dist/cycle-browser-tabs.js +5 -5
- package/dist/delay-render-embedded-stack.d.ts +0 -0
- package/dist/delay-render-embedded-stack.js +0 -0
- package/dist/delete-directory.d.ts +0 -0
- package/dist/delete-directory.js +0 -0
- package/dist/determine-resize-params.d.ts +1 -0
- package/dist/determine-resize-params.js +10 -0
- package/dist/determine-vcodec-ffmepg-flags.d.ts +2 -0
- package/dist/determine-vcodec-ffmepg-flags.js +13 -0
- package/dist/ensure-ffmpeg.d.ts +10 -0
- package/dist/ensure-ffmpeg.js +50 -0
- package/dist/ensure-frames-in-order.d.ts +0 -0
- package/dist/ensure-frames-in-order.js +0 -0
- package/dist/ensure-output-directory.d.ts +0 -0
- package/dist/ensure-output-directory.js +0 -0
- package/dist/ensure-presentation-timestamp.d.ts +14 -1
- package/dist/ensure-presentation-timestamp.js +36 -17
- package/dist/error-handling/handle-javascript-exception.d.ts +0 -0
- package/dist/error-handling/handle-javascript-exception.js +0 -0
- package/dist/error-handling/symbolicate-error.d.ts +0 -0
- package/dist/error-handling/symbolicate-error.js +0 -0
- package/dist/error-handling/symbolicateable-error.d.ts +0 -0
- package/dist/error-handling/symbolicateable-error.js +0 -0
- package/dist/extract-frame-from-video.d.ts +1 -0
- package/dist/extract-frame-from-video.js +35 -121
- package/dist/ffmpeg-executable.d.ts +0 -0
- package/dist/ffmpeg-executable.js +0 -0
- package/dist/ffmpeg-filter-file.d.ts +0 -0
- package/dist/ffmpeg-filter-file.js +0 -0
- package/dist/ffmpeg-flags.d.ts +20 -1
- package/dist/ffmpeg-flags.js +201 -6
- package/dist/ffmpeg-override.d.ts +0 -0
- package/dist/ffmpeg-override.js +0 -0
- package/dist/find-closest-package-json.js +1 -4
- package/dist/frame-range.d.ts +0 -0
- package/dist/frame-range.js +0 -0
- package/dist/frame-to-ffmpeg-timestamp.d.ts +0 -0
- package/dist/frame-to-ffmpeg-timestamp.js +0 -0
- package/dist/get-audio-codec-name.d.ts +0 -0
- package/dist/get-audio-codec-name.js +0 -0
- package/dist/get-browser-instance.d.ts +0 -0
- package/dist/get-browser-instance.js +1 -1
- package/dist/get-can-extract-frames-fast.d.ts +10 -0
- package/dist/get-can-extract-frames-fast.js +67 -0
- package/dist/get-codec-name.d.ts +0 -0
- package/dist/get-codec-name.js +0 -0
- package/dist/get-compositions.d.ts +0 -0
- package/dist/get-compositions.js +11 -5
- package/dist/get-concurrency.d.ts +0 -0
- package/dist/get-concurrency.js +0 -0
- package/dist/get-duration-from-frame-range.d.ts +0 -0
- package/dist/get-duration-from-frame-range.js +0 -0
- package/dist/get-extension-from-codec.d.ts +0 -0
- package/dist/get-extension-from-codec.js +4 -0
- package/dist/get-extension-of-filename.d.ts +0 -0
- package/dist/get-extension-of-filename.js +0 -0
- package/dist/get-frame-of-video-slow.d.ts +15 -0
- package/dist/get-frame-of-video-slow.js +72 -0
- package/dist/get-frame-padded-index.d.ts +0 -0
- package/dist/get-frame-padded-index.js +0 -0
- package/dist/get-frame-to-render.d.ts +0 -0
- package/dist/get-frame-to-render.js +0 -0
- package/dist/get-local-browser-executable.d.ts +0 -0
- package/dist/get-local-browser-executable.js +0 -0
- package/dist/get-port.d.ts +0 -0
- package/dist/get-port.js +0 -0
- package/dist/get-prores-profile-name.d.ts +0 -0
- package/dist/get-prores-profile-name.js +0 -0
- package/dist/get-video-info.d.ts +6 -1
- package/dist/get-video-info.js +19 -9
- package/dist/get-video-threads-flag.d.ts +0 -0
- package/dist/get-video-threads-flag.js +0 -0
- package/dist/guess-extension-for-media.d.ts +5 -1
- package/dist/guess-extension-for-media.js +3 -2
- package/dist/image-format.d.ts +1 -1
- package/dist/image-format.js +3 -0
- package/dist/index.d.ts +18 -32
- package/dist/index.js +15 -22
- package/dist/is-audio-codec.d.ts +0 -0
- package/dist/is-audio-codec.js +0 -0
- package/dist/is-beyond-last-frame.d.ts +0 -0
- package/dist/is-beyond-last-frame.js +0 -0
- package/dist/is-serve-url.d.ts +0 -0
- package/dist/is-serve-url.js +0 -0
- package/dist/last-frame-from-video-cache.d.ts +1 -0
- package/dist/last-frame-from-video-cache.js +0 -0
- package/dist/legacy-webpack-config.d.ts +0 -0
- package/dist/legacy-webpack-config.js +0 -0
- package/dist/log-level.d.ts +0 -0
- package/dist/log-level.js +0 -0
- package/dist/make-cancel-signal.d.ts +0 -0
- package/dist/make-cancel-signal.js +0 -0
- package/dist/merge-audio-track.d.ts +1 -0
- package/dist/merge-audio-track.js +7 -2
- package/dist/mime-db.d.ts +0 -0
- package/dist/mime-db.js +0 -0
- package/dist/mime-types.d.ts +0 -0
- package/dist/mime-types.js +0 -0
- package/dist/normalize-serve-url.d.ts +0 -0
- package/dist/normalize-serve-url.js +0 -0
- package/dist/offthread-video-server.d.ts +2 -1
- package/dist/offthread-video-server.js +2 -1
- package/dist/open-browser.d.ts +0 -0
- package/dist/open-browser.js +1 -1
- package/dist/overwrite.d.ts +0 -0
- package/dist/overwrite.js +0 -0
- package/dist/p-limit.d.ts +0 -0
- package/dist/p-limit.js +0 -0
- package/dist/parse-browser-error-stack.d.ts +0 -0
- package/dist/parse-browser-error-stack.js +0 -0
- package/dist/parse-ffmpeg-progress.d.ts +0 -0
- package/dist/parse-ffmpeg-progress.js +0 -0
- package/dist/perf.d.ts +0 -0
- package/dist/perf.js +0 -0
- package/dist/pixel-format.d.ts +1 -1
- package/dist/pixel-format.js +3 -0
- package/dist/pool.d.ts +0 -0
- package/dist/pool.js +0 -0
- package/dist/prepare-server.d.ts +2 -1
- package/dist/prepare-server.js +3 -1
- package/dist/preprocess-audio-track.d.ts +1 -0
- package/dist/preprocess-audio-track.js +4 -3
- package/dist/prespawn-ffmpeg.d.ts +1 -1
- package/dist/prespawn-ffmpeg.js +4 -3
- package/dist/prestitcher-memory-usage.d.ts +0 -0
- package/dist/prestitcher-memory-usage.js +0 -0
- package/dist/prores-profile.d.ts +0 -0
- package/dist/prores-profile.js +0 -0
- package/dist/provide-screenshot.d.ts +0 -0
- package/dist/provide-screenshot.js +0 -0
- package/dist/puppeteer-evaluate.d.ts +0 -0
- package/dist/puppeteer-evaluate.js +0 -0
- package/dist/puppeteer-screenshot.d.ts +0 -0
- package/dist/puppeteer-screenshot.js +1 -1
- package/dist/quality.d.ts +0 -0
- package/dist/quality.js +0 -0
- package/dist/redirect-status-codes.d.ts +1 -0
- package/dist/redirect-status-codes.js +4 -0
- package/dist/render-frames.d.ts +0 -0
- package/dist/render-frames.js +80 -31
- package/dist/render-media.d.ts +0 -0
- package/dist/render-media.js +14 -1
- package/dist/render-still.d.ts +0 -0
- package/dist/render-still.js +3 -1
- package/dist/replace-browser.d.ts +6 -0
- package/dist/replace-browser.js +47 -0
- package/dist/resolve-asset-src.d.ts +0 -0
- package/dist/resolve-asset-src.js +0 -0
- package/dist/sample-rate.d.ts +0 -0
- package/dist/sample-rate.js +0 -0
- package/dist/screenshot-dom-element.d.ts +0 -0
- package/dist/screenshot-dom-element.js +0 -0
- package/dist/screenshot-task.d.ts +1 -1
- package/dist/screenshot-task.js +3 -3
- package/dist/seek-to-frame.d.ts +1 -0
- package/dist/seek-to-frame.js +24 -3
- package/dist/serve-handler/index.d.ts +0 -0
- package/dist/serve-handler/index.js +0 -0
- package/dist/serve-handler/is-path-inside.d.ts +0 -0
- package/dist/serve-handler/is-path-inside.js +0 -0
- package/dist/serve-handler/range-parser.d.ts +0 -0
- package/dist/serve-handler/range-parser.js +0 -0
- package/dist/serve-static.d.ts +1 -0
- package/dist/serve-static.js +1 -0
- package/dist/set-props-and-env.d.ts +0 -0
- package/dist/set-props-and-env.js +2 -7
- package/dist/stitch-frames-to-video.d.ts +1 -1
- package/dist/stitch-frames-to-video.js +56 -23
- package/dist/stringify-ffmpeg-filter.d.ts +0 -0
- package/dist/stringify-ffmpeg-filter.js +0 -0
- package/dist/symbolicate-stacktrace.d.ts +0 -0
- package/dist/symbolicate-stacktrace.js +0 -0
- package/dist/tmp-dir.d.ts +0 -0
- package/dist/tmp-dir.js +0 -0
- package/dist/truthy.d.ts +0 -0
- package/dist/truthy.js +0 -0
- package/dist/try-to-extract-frame-of-video-fast.d.ts +13 -0
- package/dist/try-to-extract-frame-of-video-fast.js +55 -0
- package/dist/types.d.ts +0 -0
- package/dist/types.js +0 -0
- package/dist/validate-concurrency.d.ts +0 -0
- package/dist/validate-concurrency.js +0 -0
- package/dist/validate-even-dimensions-with-codec.d.ts +0 -0
- package/dist/validate-even-dimensions-with-codec.js +0 -0
- package/dist/validate-every-nth-frame.d.ts +2 -1
- package/dist/validate-every-nth-frame.js +8 -1
- package/dist/validate-ffmpeg-override.d.ts +0 -0
- package/dist/validate-ffmpeg-override.js +0 -0
- package/dist/validate-ffmpeg.d.ts +7 -2
- package/dist/validate-ffmpeg.js +48 -43
- package/dist/validate-frame.d.ts +0 -0
- package/dist/validate-frame.js +0 -0
- package/dist/validate-number-of-gif-loops.d.ts +2 -0
- package/dist/validate-number-of-gif-loops.js +24 -0
- package/dist/validate-opengl-renderer.d.ts +0 -0
- package/dist/validate-opengl-renderer.js +0 -0
- package/dist/validate-output-filename.d.ts +0 -0
- package/dist/validate-output-filename.js +0 -0
- package/dist/validate-puppeteer-timeout.d.ts +0 -0
- package/dist/validate-puppeteer-timeout.js +0 -0
- package/dist/validate-scale.d.ts +0 -0
- package/dist/validate-scale.js +0 -0
- package/dist/validate-videobitrate.d.ts +1 -0
- package/dist/validate-videobitrate.js +20 -0
- package/dist/wait-for-symbolication-error-to-be-done.d.ts +0 -0
- package/dist/wait-for-symbolication-error-to-be-done.js +0 -0
- package/dist/warn-about-ffmpeg-version.d.ts +5 -0
- package/dist/warn-about-ffmpeg-version.js +37 -0
- package/dist/ws/ws-types.d.ts +0 -0
- package/dist/ws/ws-types.js +0 -0
- package/package.json +7 -7
- package/dist/assets/dl-browser.d.ts +0 -1
- package/dist/assets/dl-browser.js +0 -38
- package/dist/get-codec-and-bitrate.d.ts +0 -2
- package/dist/get-codec-and-bitrate.js +0 -23
- package/vitest.config.ts +0 -8
package/LICENSE.md
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
1
|
# Remotion License
|
|
2
2
|
|
|
3
|
-
Depending on the type of your legal entity, you are granted permission to use Remotion for your project. Individuals and small companies are allowed to use Remotion create videos for free (even commercial), while a company license is required for for-profit
|
|
3
|
+
Depending on the type of your legal entity, you are granted permission to use Remotion for your project. Individuals and small companies are allowed to use Remotion to create videos for free (even commercial), while a company license is required for for-profit organizations of a certain size. This two-tier system was designed to ensure funding for this project while still allowing the source code to be available and the program to be free for most. Read below for the exact terms of use.
|
|
4
4
|
|
|
5
5
|
- [Free license](#free-license)
|
|
6
6
|
- [Company license](#company-license)
|
|
7
7
|
|
|
8
8
|
## Free license
|
|
9
9
|
|
|
10
|
-
Copyright © 2022 [
|
|
10
|
+
Copyright © 2022 [Remotion](https://www.remotion.dev/)
|
|
11
11
|
|
|
12
12
|
### Eligibility
|
|
13
13
|
|
|
14
14
|
You are eligible to use Remotion for free if you are:
|
|
15
15
|
|
|
16
16
|
- an individual
|
|
17
|
-
- a for-profit
|
|
18
|
-
- a non-profit or not-for-profit
|
|
17
|
+
- a for-profit organization with up to 3 employees
|
|
18
|
+
- a non-profit or not-for-profit organization
|
|
19
19
|
- evaluating whether Remotion is a good fit, and are not yet using it in a commercial way
|
|
20
20
|
|
|
21
21
|
### Allowed use cases
|
|
22
22
|
|
|
23
|
-
Permission is hereby granted, free of charge, to any person eligible for the "Free license", to use the software non-commercially or commercially for the purpose of creating videos and images and to modify
|
|
23
|
+
Permission is hereby granted, free of charge, to any person eligible for the "Free license", to use the software non-commercially or commercially for the purpose of creating videos and images and to modify the software to their own liking, for the purpose of fulfilling their custom use case or to contribute bug fixes or improvements back to Remotion.
|
|
24
24
|
|
|
25
25
|
### Disallowed use cases
|
|
26
26
|
|
|
27
|
-
It is not allowed to copy or modify Remotion code for the purpose of selling, renting, licensing, relicensing, sublicensing your own derivate of Remotion.
|
|
27
|
+
It is not allowed to copy or modify Remotion code for the purpose of selling, renting, licensing, relicensing, or sublicensing your own derivate of Remotion.
|
|
28
28
|
|
|
29
29
|
### Warranty notice
|
|
30
30
|
|
|
31
|
-
The software is provided "as is", without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and
|
|
31
|
+
The software is provided "as is", without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose, and non-infringement. In no event shall the author or copyright holders be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the software or the use or other dealings in the software.
|
|
32
32
|
|
|
33
33
|
### Support
|
|
34
34
|
|
|
@@ -36,6 +36,6 @@ Support is provided on a best-we-can-do basis via GitHub Issues and Discord.
|
|
|
36
36
|
|
|
37
37
|
## Company license
|
|
38
38
|
|
|
39
|
-
You are required to obtain a company license to use Remotion if you are not within the group of entities eligible for a free license. This license will enable you to use Remotion for the allowed use cases specified in the free license, and give you access to prioritized support.
|
|
39
|
+
You are required to obtain a company license to use Remotion if you are not within the group of entities eligible for a free license. This license will enable you to use Remotion for the allowed use cases specified in the free license, and give you access to prioritized support (read the [Support Policy](/docs/support)).
|
|
40
40
|
|
|
41
41
|
Visit [companies.remotion.dev](https://companies.remotion.dev) for pricing and to buy a license.
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -141,13 +141,6 @@ const downloadAsset = async ({ src, onDownload, downloadMap, }) => {
|
|
|
141
141
|
downloadMap.isDownloadingMap[src][downloadDir] = true;
|
|
142
142
|
const onProgress = onDownload(src);
|
|
143
143
|
if (src.startsWith('data:')) {
|
|
144
|
-
const output = (0, exports.getSanitizedFilenameForAssetUrl)({
|
|
145
|
-
contentDisposition: null,
|
|
146
|
-
downloadDir,
|
|
147
|
-
src,
|
|
148
|
-
contentType: null,
|
|
149
|
-
});
|
|
150
|
-
(0, ensure_output_directory_1.ensureOutputDirectory)(output);
|
|
151
144
|
const [assetDetails, assetData] = src.substring('data:'.length).split(',');
|
|
152
145
|
if (!assetDetails.includes(';')) {
|
|
153
146
|
const errMessage = [
|
|
@@ -161,6 +154,13 @@ const downloadAsset = async ({ src, onDownload, downloadMap, }) => {
|
|
|
161
154
|
const [mimeType, encoding] = assetDetails.split(';');
|
|
162
155
|
validateMimeType(mimeType, src);
|
|
163
156
|
validateBufferEncoding(encoding, src);
|
|
157
|
+
const output = (0, exports.getSanitizedFilenameForAssetUrl)({
|
|
158
|
+
contentDisposition: null,
|
|
159
|
+
downloadDir,
|
|
160
|
+
src,
|
|
161
|
+
contentType: mimeType,
|
|
162
|
+
});
|
|
163
|
+
(0, ensure_output_directory_1.ensureOutputDirectory)(output);
|
|
164
164
|
const buff = Buffer.from(assetData, encoding);
|
|
165
165
|
await fs_1.default.promises.writeFile(output, buff);
|
|
166
166
|
notifyAssetIsDownloaded({ src, downloadMap, downloadDir, to: output });
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
declare type Response = {
|
|
2
|
+
sizeInBytes: number;
|
|
3
|
+
to: string;
|
|
4
|
+
};
|
|
1
5
|
export declare const downloadFile: ({ onProgress, url, to: toFn, }: {
|
|
2
6
|
url: string;
|
|
3
7
|
to: (contentDisposition: string | null, contentType: string | null) => string;
|
|
@@ -6,7 +10,5 @@ export declare const downloadFile: ({ onProgress, url, to: toFn, }: {
|
|
|
6
10
|
downloaded: number;
|
|
7
11
|
totalSize: number | null;
|
|
8
12
|
}) => void) | undefined;
|
|
9
|
-
}) => Promise<
|
|
10
|
-
|
|
11
|
-
to: string;
|
|
12
|
-
}>;
|
|
13
|
+
}) => Promise<Response>;
|
|
14
|
+
export {};
|
|
@@ -6,6 +6,35 @@ const ensure_output_directory_1 = require("../ensure-output-directory");
|
|
|
6
6
|
const read_file_1 = require("./read-file");
|
|
7
7
|
const downloadFile = ({ onProgress, url, to: toFn, }) => {
|
|
8
8
|
return new Promise((resolve, reject) => {
|
|
9
|
+
let rejected = false;
|
|
10
|
+
let resolved = false;
|
|
11
|
+
let timeout;
|
|
12
|
+
const resolveAndFlag = (val) => {
|
|
13
|
+
resolved = true;
|
|
14
|
+
resolve(val);
|
|
15
|
+
if (timeout) {
|
|
16
|
+
clearTimeout(timeout);
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
const rejectAndFlag = (err) => {
|
|
20
|
+
if (timeout) {
|
|
21
|
+
clearTimeout(timeout);
|
|
22
|
+
}
|
|
23
|
+
reject(err);
|
|
24
|
+
rejected = true;
|
|
25
|
+
};
|
|
26
|
+
const refreshTimeout = () => {
|
|
27
|
+
if (timeout) {
|
|
28
|
+
clearTimeout(timeout);
|
|
29
|
+
}
|
|
30
|
+
timeout = setTimeout(() => {
|
|
31
|
+
if (resolved) {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
rejectAndFlag(new Error(`Tried to download file ${url}, but the server sent no data for 20 seconds`));
|
|
35
|
+
}, 20000);
|
|
36
|
+
};
|
|
37
|
+
refreshTimeout();
|
|
9
38
|
(0, read_file_1.readFile)(url)
|
|
10
39
|
.then((res) => {
|
|
11
40
|
var _a, _b;
|
|
@@ -21,16 +50,20 @@ const downloadFile = ({ onProgress, url, to: toFn, }) => {
|
|
|
21
50
|
// concise method to avoid this problem
|
|
22
51
|
// https://github.com/remotion-dev/remotion/issues/384#issuecomment-844398183
|
|
23
52
|
writeStream.on('close', () => {
|
|
53
|
+
if (rejected) {
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
24
56
|
onProgress === null || onProgress === void 0 ? void 0 : onProgress({
|
|
25
57
|
downloaded,
|
|
26
58
|
percent: 1,
|
|
27
59
|
totalSize: downloaded,
|
|
28
60
|
});
|
|
29
|
-
|
|
61
|
+
refreshTimeout();
|
|
62
|
+
return resolveAndFlag({ sizeInBytes: downloaded, to });
|
|
30
63
|
});
|
|
31
|
-
writeStream.on('error', (err) =>
|
|
32
|
-
res.on('error', (err) =>
|
|
33
|
-
res.pipe(writeStream).on('error', (err) =>
|
|
64
|
+
writeStream.on('error', (err) => rejectAndFlag(err));
|
|
65
|
+
res.on('error', (err) => rejectAndFlag(err));
|
|
66
|
+
res.pipe(writeStream).on('error', (err) => rejectAndFlag(err));
|
|
34
67
|
res.on('data', (d) => {
|
|
35
68
|
downloaded += d.length;
|
|
36
69
|
onProgress === null || onProgress === void 0 ? void 0 : onProgress({
|
|
@@ -39,9 +72,15 @@ const downloadFile = ({ onProgress, url, to: toFn, }) => {
|
|
|
39
72
|
totalSize,
|
|
40
73
|
});
|
|
41
74
|
});
|
|
75
|
+
res.on('close', () => {
|
|
76
|
+
if (totalSize !== null && downloaded !== totalSize) {
|
|
77
|
+
rejectAndFlag(new Error(`Download finished with ${downloaded} bytes, but expected ${totalSize} bytes from 'Content-Length'.`));
|
|
78
|
+
}
|
|
79
|
+
writeStream.close();
|
|
80
|
+
});
|
|
42
81
|
})
|
|
43
82
|
.catch((err) => {
|
|
44
|
-
|
|
83
|
+
rejectAndFlag(err);
|
|
45
84
|
});
|
|
46
85
|
});
|
|
47
86
|
};
|
|
@@ -7,9 +7,10 @@ declare type EncodingStatus = {
|
|
|
7
7
|
src: string;
|
|
8
8
|
} | undefined;
|
|
9
9
|
export declare type SpecialVCodecForTransparency = 'vp9' | 'vp8' | 'none';
|
|
10
|
+
export declare type NeedsResize = [number, number] | null;
|
|
10
11
|
export declare type Vp9Result = {
|
|
11
|
-
|
|
12
|
-
needsResize:
|
|
12
|
+
specialVcodecForTransparency: SpecialVCodecForTransparency;
|
|
13
|
+
needsResize: NeedsResize;
|
|
13
14
|
};
|
|
14
15
|
export declare type VideoDurationResult = {
|
|
15
16
|
duration: number | null;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { FfmpegExecutable } from '../ffmpeg-executable';
|
|
2
2
|
import type { AudioChannelsAndDurationResultCache, DownloadMap } from './download-map';
|
|
3
|
-
export declare const getAudioChannelsAndDuration: (downloadMap: DownloadMap, src: string, ffprobeExecutable: FfmpegExecutable) => Promise<AudioChannelsAndDurationResultCache>;
|
|
3
|
+
export declare const getAudioChannelsAndDuration: (downloadMap: DownloadMap, src: string, ffprobeExecutable: FfmpegExecutable, remotionRoot: string) => Promise<AudioChannelsAndDurationResultCache>;
|
|
@@ -5,9 +5,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.getAudioChannelsAndDuration = void 0;
|
|
7
7
|
const execa_1 = __importDefault(require("execa"));
|
|
8
|
+
const ffmpeg_flags_1 = require("../ffmpeg-flags");
|
|
8
9
|
const p_limit_1 = require("../p-limit");
|
|
9
10
|
const limit = (0, p_limit_1.pLimit)(1);
|
|
10
|
-
async function getAudioChannelsAndDurationUnlimited(downloadMap, src, ffprobeExecutable) {
|
|
11
|
+
async function getAudioChannelsAndDurationUnlimited(downloadMap, src, ffprobeExecutable, remotionRoot) {
|
|
11
12
|
if (downloadMap.durationOfAssetCache[src]) {
|
|
12
13
|
return downloadMap.durationOfAssetCache[src];
|
|
13
14
|
}
|
|
@@ -19,7 +20,7 @@ async function getAudioChannelsAndDurationUnlimited(downloadMap, src, ffprobeExe
|
|
|
19
20
|
]
|
|
20
21
|
.reduce((acc, val) => acc.concat(val), [])
|
|
21
22
|
.filter(Boolean);
|
|
22
|
-
const task = await (0, execa_1.default)(
|
|
23
|
+
const task = await (0, execa_1.default)(await (0, ffmpeg_flags_1.getExecutableBinary)(ffprobeExecutable, remotionRoot, 'ffprobe'), args);
|
|
23
24
|
const channels = task.stdout.match(/channels=([0-9]+)/);
|
|
24
25
|
const duration = task.stdout.match(/duration=([0-9.]+)/);
|
|
25
26
|
const result = {
|
|
@@ -29,7 +30,7 @@ async function getAudioChannelsAndDurationUnlimited(downloadMap, src, ffprobeExe
|
|
|
29
30
|
downloadMap.durationOfAssetCache[src] = result;
|
|
30
31
|
return result;
|
|
31
32
|
}
|
|
32
|
-
const getAudioChannelsAndDuration = (downloadMap, src, ffprobeExecutable) => {
|
|
33
|
-
return limit(() => getAudioChannelsAndDurationUnlimited(downloadMap, src, ffprobeExecutable));
|
|
33
|
+
const getAudioChannelsAndDuration = (downloadMap, src, ffprobeExecutable, remotionRoot) => {
|
|
34
|
+
return limit(() => getAudioChannelsAndDurationUnlimited(downloadMap, src, ffprobeExecutable, remotionRoot));
|
|
34
35
|
};
|
|
35
36
|
exports.getAudioChannelsAndDuration = getAudioChannelsAndDuration;
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import type { FfmpegExecutable } from '../ffmpeg-executable';
|
|
2
2
|
import type { DownloadMap, VideoDurationResult } from './download-map';
|
|
3
3
|
export declare const parseVideoStreamDuration: (stdout: string) => VideoDurationResult;
|
|
4
|
-
export declare
|
|
4
|
+
export declare function getVideoStreamDurationwithoutCache({ src, ffprobeExecutable, remotionRoot, }: {
|
|
5
|
+
src: string;
|
|
6
|
+
ffprobeExecutable: FfmpegExecutable;
|
|
7
|
+
remotionRoot: string;
|
|
8
|
+
}): Promise<VideoDurationResult>;
|
|
9
|
+
export declare const getVideoStreamDuration: (downloadMap: DownloadMap, src: string, ffprobeExecutable: FfmpegExecutable, remotionRoot: string) => Promise<VideoDurationResult>;
|
|
@@ -3,8 +3,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.getVideoStreamDuration = exports.parseVideoStreamDuration = void 0;
|
|
6
|
+
exports.getVideoStreamDuration = exports.getVideoStreamDurationwithoutCache = exports.parseVideoStreamDuration = void 0;
|
|
7
7
|
const execa_1 = __importDefault(require("execa"));
|
|
8
|
+
const ffmpeg_flags_1 = require("../ffmpeg-flags");
|
|
8
9
|
const p_limit_1 = require("../p-limit");
|
|
9
10
|
const limit = (0, p_limit_1.pLimit)(1);
|
|
10
11
|
const parseAlternativeDuration = (stdout) => {
|
|
@@ -38,10 +39,7 @@ const parseVideoStreamDuration = (stdout) => {
|
|
|
38
39
|
return result;
|
|
39
40
|
};
|
|
40
41
|
exports.parseVideoStreamDuration = parseVideoStreamDuration;
|
|
41
|
-
async function
|
|
42
|
-
if (downloadMap.videoDurationResultCache[src]) {
|
|
43
|
-
return downloadMap.videoDurationResultCache[src];
|
|
44
|
-
}
|
|
42
|
+
async function getVideoStreamDurationwithoutCache({ src, ffprobeExecutable, remotionRoot, }) {
|
|
45
43
|
const args = [
|
|
46
44
|
['-v', 'error'],
|
|
47
45
|
['-select_streams', 'v:0'],
|
|
@@ -50,10 +48,24 @@ async function getVideoStreamDurationUnlimited(downloadMap, src, ffprobeExecutab
|
|
|
50
48
|
]
|
|
51
49
|
.reduce((acc, val) => acc.concat(val), [])
|
|
52
50
|
.filter(Boolean);
|
|
53
|
-
const task = await (0, execa_1.default)(
|
|
54
|
-
|
|
51
|
+
const task = await (0, execa_1.default)(await (0, ffmpeg_flags_1.getExecutableBinary)(ffprobeExecutable, remotionRoot, 'ffprobe'), args);
|
|
52
|
+
const result = (0, exports.parseVideoStreamDuration)(task.stdout);
|
|
53
|
+
return result;
|
|
54
|
+
}
|
|
55
|
+
exports.getVideoStreamDurationwithoutCache = getVideoStreamDurationwithoutCache;
|
|
56
|
+
async function getVideoStreamDurationUnlimited(downloadMap, src, ffprobeExecutable, remotionRoot) {
|
|
57
|
+
if (downloadMap.videoDurationResultCache[src]) {
|
|
58
|
+
return downloadMap.videoDurationResultCache[src];
|
|
59
|
+
}
|
|
60
|
+
const result = await getVideoStreamDurationwithoutCache({
|
|
61
|
+
src,
|
|
62
|
+
ffprobeExecutable,
|
|
63
|
+
remotionRoot,
|
|
64
|
+
});
|
|
65
|
+
downloadMap.videoDurationResultCache[src] = result;
|
|
66
|
+
return result;
|
|
55
67
|
}
|
|
56
|
-
const getVideoStreamDuration = (downloadMap, src, ffprobeExecutable) => {
|
|
57
|
-
return limit(() => getVideoStreamDurationUnlimited(downloadMap, src, ffprobeExecutable));
|
|
68
|
+
const getVideoStreamDuration = (downloadMap, src, ffprobeExecutable, remotionRoot) => {
|
|
69
|
+
return limit(() => getVideoStreamDurationUnlimited(downloadMap, src, ffprobeExecutable, remotionRoot));
|
|
58
70
|
};
|
|
59
71
|
exports.getVideoStreamDuration = getVideoStreamDuration;
|
|
File without changes
|
package/dist/assets/read-file.js
CHANGED
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.readFile = void 0;
|
|
7
7
|
const http_1 = __importDefault(require("http"));
|
|
8
8
|
const https_1 = __importDefault(require("https"));
|
|
9
|
+
const redirect_status_codes_1 = require("../redirect-status-codes");
|
|
9
10
|
const getClient = (url) => {
|
|
10
11
|
if (url.startsWith('https://')) {
|
|
11
12
|
return https_1.default.get;
|
|
@@ -29,10 +30,7 @@ const readFile = async (url, redirectsSoFar = 0) => {
|
|
|
29
30
|
throw new Error(`Too many redirects while downloading ${url}`);
|
|
30
31
|
}
|
|
31
32
|
const file = await readFileWithoutRedirect(url);
|
|
32
|
-
if (file.statusCode
|
|
33
|
-
file.statusCode === 301 ||
|
|
34
|
-
file.statusCode === 307 ||
|
|
35
|
-
file.statusCode === 308) {
|
|
33
|
+
if (redirect_status_codes_1.redirectStatusCodes.includes(file.statusCode)) {
|
|
36
34
|
if (!file.headers.location) {
|
|
37
35
|
throw new Error(`Received a status code ${file.statusCode} but no "Location" header while calling ${file.headers.location}`);
|
|
38
36
|
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/dist/assets/types.d.ts
CHANGED
|
File without changes
|
package/dist/assets/types.js
CHANGED
|
File without changes
|
|
@@ -25,7 +25,8 @@ interface WaitForTargetOptions {
|
|
|
25
25
|
export declare const enum BrowserEmittedEvents {
|
|
26
26
|
TargetChanged = "targetchanged",
|
|
27
27
|
TargetCreated = "targetcreated",
|
|
28
|
-
Closed = "closed"
|
|
28
|
+
Closed = "closed",
|
|
29
|
+
ClosedSilent = "closed-silent"
|
|
29
30
|
}
|
|
30
31
|
export declare class Browser extends EventEmitter {
|
|
31
32
|
#private;
|
|
@@ -35,6 +36,7 @@ export declare class Browser extends EventEmitter {
|
|
|
35
36
|
defaultViewport: Viewport;
|
|
36
37
|
closeCallback?: BrowserCloseCallback;
|
|
37
38
|
}): Promise<Browser>;
|
|
39
|
+
connection: Connection;
|
|
38
40
|
get _targets(): Map<string, Target>;
|
|
39
41
|
constructor(connection: Connection, contextIds: string[], defaultViewport: Viewport, closeCallback?: BrowserCloseCallback);
|
|
40
42
|
browserContexts(): BrowserContext[];
|
|
@@ -43,7 +45,7 @@ export declare class Browser extends EventEmitter {
|
|
|
43
45
|
targets(): Target[];
|
|
44
46
|
waitForTarget(predicate: (x: Target) => boolean | Promise<boolean>, options?: WaitForTargetOptions): Promise<Target>;
|
|
45
47
|
pages(): Promise<Page[]>;
|
|
46
|
-
close(): Promise<void>;
|
|
48
|
+
close(silent: boolean): Promise<void>;
|
|
47
49
|
disconnect(): void;
|
|
48
50
|
}
|
|
49
51
|
export declare class BrowserContext extends EventEmitter {
|
package/dist/browser/Browser.js
CHANGED
|
@@ -25,7 +25,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
25
25
|
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");
|
|
26
26
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
27
27
|
};
|
|
28
|
-
var _Browser_instances, _Browser_defaultViewport,
|
|
28
|
+
var _Browser_instances, _Browser_defaultViewport, _Browser_closeCallback, _Browser_defaultContext, _Browser_contexts, _Browser_targets, _Browser_targetCreated, _Browser_targetDestroyed, _Browser_targetInfoChanged, _BrowserContext_browser, _BrowserContext_id;
|
|
29
29
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
30
|
exports.BrowserContext = exports.Browser = void 0;
|
|
31
31
|
const assert_1 = require("./assert");
|
|
@@ -38,13 +38,12 @@ class Browser extends EventEmitter_1.EventEmitter {
|
|
|
38
38
|
super();
|
|
39
39
|
_Browser_instances.add(this);
|
|
40
40
|
_Browser_defaultViewport.set(this, void 0);
|
|
41
|
-
_Browser_connection.set(this, void 0);
|
|
42
41
|
_Browser_closeCallback.set(this, void 0);
|
|
43
42
|
_Browser_defaultContext.set(this, void 0);
|
|
44
43
|
_Browser_contexts.set(this, void 0);
|
|
45
44
|
_Browser_targets.set(this, void 0);
|
|
46
45
|
__classPrivateFieldSet(this, _Browser_defaultViewport, defaultViewport, "f");
|
|
47
|
-
|
|
46
|
+
this.connection = connection;
|
|
48
47
|
__classPrivateFieldSet(this, _Browser_closeCallback, closeCallback ||
|
|
49
48
|
function () {
|
|
50
49
|
return undefined;
|
|
@@ -55,9 +54,9 @@ class Browser extends EventEmitter_1.EventEmitter {
|
|
|
55
54
|
__classPrivateFieldGet(this, _Browser_contexts, "f").set(contextId, new BrowserContext(this, contextId));
|
|
56
55
|
}
|
|
57
56
|
__classPrivateFieldSet(this, _Browser_targets, new Map(), "f");
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
57
|
+
this.connection.on('Target.targetCreated', __classPrivateFieldGet(this, _Browser_instances, "m", _Browser_targetCreated).bind(this));
|
|
58
|
+
this.connection.on('Target.targetDestroyed', __classPrivateFieldGet(this, _Browser_instances, "m", _Browser_targetDestroyed).bind(this));
|
|
59
|
+
this.connection.on('Target.targetInfoChanged', __classPrivateFieldGet(this, _Browser_instances, "m", _Browser_targetInfoChanged).bind(this));
|
|
61
60
|
}
|
|
62
61
|
static async _create({ connection, contextIds, defaultViewport, closeCallback, }) {
|
|
63
62
|
const browser = new Browser(connection, contextIds, defaultViewport, closeCallback);
|
|
@@ -74,7 +73,7 @@ class Browser extends EventEmitter_1.EventEmitter {
|
|
|
74
73
|
return __classPrivateFieldGet(this, _Browser_defaultContext, "f").newPage();
|
|
75
74
|
}
|
|
76
75
|
async _createPageInContext(contextId) {
|
|
77
|
-
const { targetId } = await
|
|
76
|
+
const { targetId } = await this.connection.send('Target.createTarget', {
|
|
78
77
|
url: 'about:blank',
|
|
79
78
|
browserContextId: contextId || undefined,
|
|
80
79
|
});
|
|
@@ -133,17 +132,21 @@ class Browser extends EventEmitter_1.EventEmitter {
|
|
|
133
132
|
return acc.concat(x);
|
|
134
133
|
}, []);
|
|
135
134
|
}
|
|
136
|
-
async close() {
|
|
135
|
+
async close(silent) {
|
|
137
136
|
await __classPrivateFieldGet(this, _Browser_closeCallback, "f").call(null);
|
|
137
|
+
(await this.pages()).forEach((page) => {
|
|
138
|
+
page.emit("disposed" /* PageEmittedEvents.Disposed */);
|
|
139
|
+
page.closed = true;
|
|
140
|
+
});
|
|
138
141
|
this.disconnect();
|
|
139
|
-
this.emit("closed" /* BrowserEmittedEvents.Closed */);
|
|
142
|
+
this.emit(silent ? "closed-silent" /* BrowserEmittedEvents.ClosedSilent */ : "closed" /* BrowserEmittedEvents.Closed */);
|
|
140
143
|
}
|
|
141
144
|
disconnect() {
|
|
142
|
-
|
|
145
|
+
this.connection.dispose();
|
|
143
146
|
}
|
|
144
147
|
}
|
|
145
148
|
exports.Browser = Browser;
|
|
146
|
-
_Browser_defaultViewport = new WeakMap(),
|
|
149
|
+
_Browser_defaultViewport = new WeakMap(), _Browser_closeCallback = new WeakMap(), _Browser_defaultContext = new WeakMap(), _Browser_contexts = new WeakMap(), _Browser_targets = new WeakMap(), _Browser_instances = new WeakSet(), _Browser_targetCreated = async function _Browser_targetCreated(event) {
|
|
147
150
|
var _a;
|
|
148
151
|
const { targetInfo } = event;
|
|
149
152
|
const { browserContextId } = targetInfo;
|
|
@@ -154,7 +157,7 @@ _Browser_defaultViewport = new WeakMap(), _Browser_connection = new WeakMap(), _
|
|
|
154
157
|
throw new Error('Missing browser context');
|
|
155
158
|
}
|
|
156
159
|
const target = new Target_1.Target(targetInfo, context, () => {
|
|
157
|
-
return
|
|
160
|
+
return this.connection.createSession(targetInfo);
|
|
158
161
|
}, (_a = __classPrivateFieldGet(this, _Browser_defaultViewport, "f")) !== null && _a !== void 0 ? _a : null);
|
|
159
162
|
(0, assert_1.assert)(!__classPrivateFieldGet(this, _Browser_targets, "f").has(event.targetInfo.targetId), 'Target should not exist before targetCreated');
|
|
160
163
|
__classPrivateFieldGet(this, _Browser_targets, "f").set(event.targetInfo.targetId, target);
|
|
File without changes
|
|
File without changes
|
|
@@ -86,4 +86,5 @@ export declare class BrowserFetcher {
|
|
|
86
86
|
*/
|
|
87
87
|
revisionInfo(revision: string): BrowserFetcherRevisionInfo;
|
|
88
88
|
}
|
|
89
|
+
export declare function _downloadFile(url: string, destinationPath: string, progressCallback: (x: number, y: number) => void): Promise<number>;
|
|
89
90
|
export {};
|
|
@@ -53,7 +53,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
53
53
|
};
|
|
54
54
|
var _BrowserFetcher_instances, _BrowserFetcher_product, _BrowserFetcher_downloadsFolder, _BrowserFetcher_downloadHost, _BrowserFetcher_platform, _BrowserFetcher_getFolderPath;
|
|
55
55
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
56
|
-
exports.BrowserFetcher = void 0;
|
|
56
|
+
exports._downloadFile = exports.BrowserFetcher = void 0;
|
|
57
57
|
const childProcess = __importStar(require("child_process"));
|
|
58
58
|
const fs = __importStar(require("fs"));
|
|
59
59
|
const http = __importStar(require("http"));
|
|
@@ -388,6 +388,13 @@ function _downloadFile(url, destinationPath, progressCallback) {
|
|
|
388
388
|
let downloadedBytes = 0;
|
|
389
389
|
let totalBytes = 0;
|
|
390
390
|
let lastProgress = Date.now();
|
|
391
|
+
function onData(chunk) {
|
|
392
|
+
downloadedBytes += chunk.length;
|
|
393
|
+
if (Date.now() - lastProgress > 1000) {
|
|
394
|
+
progressCallback(downloadedBytes, totalBytes);
|
|
395
|
+
lastProgress = Date.now();
|
|
396
|
+
}
|
|
397
|
+
}
|
|
391
398
|
const request = httpRequest(url, 'GET', (response) => {
|
|
392
399
|
if (response.statusCode !== 200) {
|
|
393
400
|
const error = new Error(`Download failed: server returned code ${response.statusCode}. URL: ${url}`);
|
|
@@ -397,8 +404,8 @@ function _downloadFile(url, destinationPath, progressCallback) {
|
|
|
397
404
|
return;
|
|
398
405
|
}
|
|
399
406
|
const file = fs.createWriteStream(destinationPath);
|
|
400
|
-
file.on('
|
|
401
|
-
return fulfill();
|
|
407
|
+
file.on('close', () => {
|
|
408
|
+
return fulfill(totalBytes);
|
|
402
409
|
});
|
|
403
410
|
file.on('error', (error) => {
|
|
404
411
|
return reject(error);
|
|
@@ -411,14 +418,8 @@ function _downloadFile(url, destinationPath, progressCallback) {
|
|
|
411
418
|
return reject(error);
|
|
412
419
|
});
|
|
413
420
|
return promise;
|
|
414
|
-
function onData(chunk) {
|
|
415
|
-
downloadedBytes += chunk.length;
|
|
416
|
-
if (Date.now() - lastProgress > 1000) {
|
|
417
|
-
progressCallback(downloadedBytes, totalBytes);
|
|
418
|
-
lastProgress = Date.now();
|
|
419
|
-
}
|
|
420
|
-
}
|
|
421
421
|
}
|
|
422
|
+
exports._downloadFile = _downloadFile;
|
|
422
423
|
function install(archivePath, folderPath) {
|
|
423
424
|
if (archivePath.endsWith('.zip')) {
|
|
424
425
|
return (0, extract_zip_1.default)(archivePath, { dir: folderPath });
|
|
@@ -27,13 +27,21 @@ import { TaskQueue } from './TaskQueue';
|
|
|
27
27
|
interface WaitForOptions {
|
|
28
28
|
timeout?: number;
|
|
29
29
|
}
|
|
30
|
+
export declare const enum PageEmittedEvents {
|
|
31
|
+
Console = "console",
|
|
32
|
+
Error = "error",
|
|
33
|
+
Disposed = "disposed"
|
|
34
|
+
}
|
|
30
35
|
interface PageEventObject {
|
|
31
36
|
console: ConsoleMessage;
|
|
32
37
|
error: Error;
|
|
38
|
+
disposed: undefined;
|
|
33
39
|
}
|
|
34
40
|
export declare class Page extends EventEmitter {
|
|
35
41
|
#private;
|
|
42
|
+
id: string;
|
|
36
43
|
static _create(client: CDPSession, target: Target, defaultViewport: Viewport, browser: Browser): Promise<Page>;
|
|
44
|
+
closed: boolean;
|
|
37
45
|
browser: Browser;
|
|
38
46
|
screenshotTaskQueue: TaskQueue;
|
|
39
47
|
constructor(client: CDPSession, target: Target, browser: Browser);
|
|
@@ -68,7 +76,5 @@ export declare class Page extends EventEmitter {
|
|
|
68
76
|
close(options?: {
|
|
69
77
|
runBeforeUnload?: boolean;
|
|
70
78
|
}): Promise<void>;
|
|
71
|
-
isClosed(): boolean;
|
|
72
|
-
waitForFunction(browser: Browser, pageFunction: Function | string, ...args: SerializableOrJSHandle[]): Promise<JSHandle>;
|
|
73
79
|
}
|
|
74
80
|
export {};
|
|
@@ -25,7 +25,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
25
25
|
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");
|
|
26
26
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
27
27
|
};
|
|
28
|
-
var _Page_instances,
|
|
28
|
+
var _Page_instances, _Page_client, _Page_target, _Page_timeoutSettings, _Page_frameManager, _Page_pageBindings, _Page_initialize, _Page_onTargetCrashed, _Page_onLogEntryAdded, _Page_onConsoleAPI, _Page_onBindingCalled, _Page_addConsoleMessage;
|
|
29
29
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
30
|
exports.Page = void 0;
|
|
31
31
|
const assert_1 = require("./assert");
|
|
@@ -40,7 +40,7 @@ class Page extends EventEmitter_1.EventEmitter {
|
|
|
40
40
|
constructor(client, target, browser) {
|
|
41
41
|
super();
|
|
42
42
|
_Page_instances.add(this);
|
|
43
|
-
|
|
43
|
+
this.closed = false;
|
|
44
44
|
_Page_client.set(this, void 0);
|
|
45
45
|
_Page_target.set(this, void 0);
|
|
46
46
|
_Page_timeoutSettings.set(this, new TimeoutSettings_1.TimeoutSettings());
|
|
@@ -51,6 +51,7 @@ class Page extends EventEmitter_1.EventEmitter {
|
|
|
51
51
|
__classPrivateFieldSet(this, _Page_frameManager, new FrameManager_1.FrameManager(client, this, __classPrivateFieldGet(this, _Page_timeoutSettings, "f")), "f");
|
|
52
52
|
this.screenshotTaskQueue = new TaskQueue_1.TaskQueue();
|
|
53
53
|
this.browser = browser;
|
|
54
|
+
this.id = String(Math.random());
|
|
54
55
|
client.on('Target.attachedToTarget', (event) => {
|
|
55
56
|
switch (event.targetInfo.type) {
|
|
56
57
|
case 'iframe':
|
|
@@ -166,7 +167,9 @@ class Page extends EventEmitter_1.EventEmitter {
|
|
|
166
167
|
}
|
|
167
168
|
async close(options = { runBeforeUnload: undefined }) {
|
|
168
169
|
const connection = __classPrivateFieldGet(this, _Page_client, "f").connection();
|
|
169
|
-
|
|
170
|
+
if (!connection) {
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
170
173
|
const runBeforeUnload = Boolean(options.runBeforeUnload);
|
|
171
174
|
if (runBeforeUnload) {
|
|
172
175
|
await __classPrivateFieldGet(this, _Page_client, "f").send('Page.close');
|
|
@@ -178,15 +181,9 @@ class Page extends EventEmitter_1.EventEmitter {
|
|
|
178
181
|
await __classPrivateFieldGet(this, _Page_target, "f")._isClosedPromise;
|
|
179
182
|
}
|
|
180
183
|
}
|
|
181
|
-
isClosed() {
|
|
182
|
-
return __classPrivateFieldGet(this, _Page_closed, "f");
|
|
183
|
-
}
|
|
184
|
-
waitForFunction(browser, pageFunction, ...args) {
|
|
185
|
-
return this.mainFrame().waitForFunction(browser, pageFunction, ...args);
|
|
186
|
-
}
|
|
187
184
|
}
|
|
188
185
|
exports.Page = Page;
|
|
189
|
-
|
|
186
|
+
_Page_client = new WeakMap(), _Page_target = new WeakMap(), _Page_timeoutSettings = new WeakMap(), _Page_frameManager = new WeakMap(), _Page_pageBindings = new WeakMap(), _Page_instances = new WeakSet(), _Page_initialize = async function _Page_initialize() {
|
|
190
187
|
await Promise.all([
|
|
191
188
|
__classPrivateFieldGet(this, _Page_frameManager, "f").initialize(),
|
|
192
189
|
__classPrivateFieldGet(this, _Page_client, "f").send('Target.setAutoAttach', {
|
|
File without changes
|
|
File without changes
|
|
File without changes
|