@remotion/renderer 3.2.21 → 3.2.23-ensure-ffmpeg.123
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 +0 -0
- package/dist/assets/download-file.js +0 -0
- package/dist/assets/download-map.d.ts +0 -0
- 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 +1 -1
- package/dist/assets/get-video-stream-duration.js +5 -4
- package/dist/assets/read-file.d.ts +0 -0
- package/dist/assets/read-file.js +0 -0
- 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 +0 -0
- package/dist/browser/Browser.js +0 -0
- 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 +23 -20
- package/dist/browser/BrowserPage.d.ts +0 -0
- package/dist/browser/BrowserPage.js +0 -0
- package/dist/browser/BrowserRunner.d.ts +1 -4
- package/dist/browser/BrowserRunner.js +28 -71
- package/dist/browser/Connection.d.ts +0 -0
- package/dist/browser/Connection.js +0 -0
- package/dist/browser/ConsoleMessage.d.ts +0 -0
- package/dist/browser/ConsoleMessage.js +0 -0
- package/dist/browser/DOMWorld.d.ts +0 -0
- package/dist/browser/DOMWorld.js +0 -0
- 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 -0
- package/dist/browser/FrameManager.js +0 -0
- 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 -4
- package/dist/browser/LaunchOptions.js +0 -0
- package/dist/browser/Launcher.d.ts +1 -1
- package/dist/browser/Launcher.js +5 -363
- 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 +0 -0
- 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 +1 -4
- 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 +2 -44
- 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 -1
- package/dist/browser/revisions.js +0 -1
- 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 -0
- package/dist/check-apple-silicon.js +55 -0
- 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 +5 -4
- 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 +4 -0
- package/dist/convert-to-positive-frame-index.js +8 -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 +5 -1
- package/dist/crf.js +33 -6
- package/dist/cycle-browser-tabs.d.ts +0 -0
- package/dist/cycle-browser-tabs.js +0 -0
- 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/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 +8 -1
- package/dist/ensure-presentation-timestamp.js +14 -5
- 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 -1
- package/dist/extract-frame-from-video.js +22 -9
- 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 -2
- package/dist/ffmpeg-flags.js +200 -9
- package/dist/ffmpeg-override.d.ts +4 -0
- package/dist/{ffmpeg-args-hook.js → ffmpeg-override.js} +0 -0
- package/dist/find-closest-package-json.d.ts +2 -0
- package/dist/find-closest-package-json.js +31 -0
- 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 +0 -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 +9 -4
- 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-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 +1 -3
- 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 +1 -1
- package/dist/get-video-info.js +5 -4
- 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 +21 -27
- package/dist/index.js +19 -24
- 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 -1
- 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 -11
- 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 +4 -1
- package/dist/prespawn-ffmpeg.js +17 -12
- package/dist/prestitcher-memory-usage.d.ts +0 -0
- package/dist/prestitcher-memory-usage.js +0 -0
- package/dist/prores-profile.d.ts +4 -1
- package/dist/prores-profile.js +6 -6
- 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 +0 -0
- package/dist/quality.d.ts +0 -0
- package/dist/quality.js +0 -0
- package/dist/render-frames.d.ts +1 -1
- package/dist/render-frames.js +48 -10
- package/dist/render-media.d.ts +13 -1
- package/dist/render-media.js +67 -9
- package/dist/render-still.d.ts +1 -1
- package/dist/render-still.js +10 -3
- package/dist/replace-browser.d.ts +6 -0
- package/dist/replace-browser.js +46 -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 +0 -0
- package/dist/screenshot-task.js +0 -0
- package/dist/seek-to-frame.d.ts +0 -0
- package/dist/seek-to-frame.js +0 -0
- 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 +1 -1
- package/dist/stitch-frames-to-video.d.ts +5 -1
- package/dist/stitch-frames-to-video.js +58 -32
- 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/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 +2 -0
- package/dist/{validate-ffmpeg-args-hook.js → validate-ffmpeg-override.js} +6 -3
- 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 +3 -3
- 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 +1 -1
- 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/ffmpeg-args-hook.d.ts +0 -1
- package/dist/make-assets-download-dir.d.ts +0 -1
- package/dist/make-assets-download-dir.js +0 -13
- package/dist/validate-ffmpeg-args-hook.d.ts +0 -2
- 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 });
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
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,4 @@
|
|
|
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 const getVideoStreamDuration: (downloadMap: DownloadMap, src: string, ffprobeExecutable: FfmpegExecutable) => Promise<VideoDurationResult>;
|
|
4
|
+
export declare const getVideoStreamDuration: (downloadMap: DownloadMap, src: string, ffprobeExecutable: FfmpegExecutable, remotionRoot: string) => Promise<VideoDurationResult>;
|
|
@@ -5,6 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.getVideoStreamDuration = 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,7 +39,7 @@ const parseVideoStreamDuration = (stdout) => {
|
|
|
38
39
|
return result;
|
|
39
40
|
};
|
|
40
41
|
exports.parseVideoStreamDuration = parseVideoStreamDuration;
|
|
41
|
-
async function getVideoStreamDurationUnlimited(downloadMap, src, ffprobeExecutable) {
|
|
42
|
+
async function getVideoStreamDurationUnlimited(downloadMap, src, ffprobeExecutable, remotionRoot) {
|
|
42
43
|
if (downloadMap.videoDurationResultCache[src]) {
|
|
43
44
|
return downloadMap.videoDurationResultCache[src];
|
|
44
45
|
}
|
|
@@ -50,10 +51,10 @@ async function getVideoStreamDurationUnlimited(downloadMap, src, ffprobeExecutab
|
|
|
50
51
|
]
|
|
51
52
|
.reduce((acc, val) => acc.concat(val), [])
|
|
52
53
|
.filter(Boolean);
|
|
53
|
-
const task = await (0, execa_1.default)(
|
|
54
|
+
const task = await (0, execa_1.default)(await (0, ffmpeg_flags_1.getExecutableBinary)(ffprobeExecutable, remotionRoot, 'ffprobe'), args);
|
|
54
55
|
return (0, exports.parseVideoStreamDuration)(task.stdout);
|
|
55
56
|
}
|
|
56
|
-
const getVideoStreamDuration = (downloadMap, src, ffprobeExecutable) => {
|
|
57
|
-
return limit(() => getVideoStreamDurationUnlimited(downloadMap, src, ffprobeExecutable));
|
|
57
|
+
const getVideoStreamDuration = (downloadMap, src, ffprobeExecutable, remotionRoot) => {
|
|
58
|
+
return limit(() => getVideoStreamDurationUnlimited(downloadMap, src, ffprobeExecutable, remotionRoot));
|
|
58
59
|
};
|
|
59
60
|
exports.getVideoStreamDuration = getVideoStreamDuration;
|
|
File without changes
|
package/dist/assets/read-file.js
CHANGED
|
File without changes
|
|
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
|
|
File without changes
|
package/dist/browser/Browser.js
CHANGED
|
File without changes
|
|
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,17 +53,17 @@ 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"));
|
|
60
60
|
const https = __importStar(require("https"));
|
|
61
61
|
const os = __importStar(require("os"));
|
|
62
62
|
const path = __importStar(require("path"));
|
|
63
|
-
const
|
|
63
|
+
const util_1 = __importDefault(require("util"));
|
|
64
64
|
const extract_zip_1 = __importDefault(require("extract-zip"));
|
|
65
65
|
const URL = __importStar(require("url"));
|
|
66
|
-
const
|
|
66
|
+
const util_2 = require("util");
|
|
67
67
|
const assert_1 = require("./assert");
|
|
68
68
|
const delete_directory_1 = require("../delete-directory");
|
|
69
69
|
const get_download_destination_1 = require("./get-download-destination");
|
|
@@ -106,7 +106,7 @@ function archiveName(product, platform, revision) {
|
|
|
106
106
|
case 'win64':
|
|
107
107
|
// Windows archive name changed at r591479.
|
|
108
108
|
return parseInt(revision, 10) > 591479
|
|
109
|
-
? '
|
|
109
|
+
? 'Thorium_107.0.5271.0\\BIN'
|
|
110
110
|
: 'chrome-win32';
|
|
111
111
|
default:
|
|
112
112
|
throw new Error('unknown browser');
|
|
@@ -118,8 +118,10 @@ function archiveName(product, platform, revision) {
|
|
|
118
118
|
}
|
|
119
119
|
}
|
|
120
120
|
function _downloadURL(product, platform, host, revision) {
|
|
121
|
-
|
|
122
|
-
|
|
121
|
+
if (platform === 'win64' || platform === 'win32') {
|
|
122
|
+
return 'https://remotionchromium-binaries.s3.eu-central-1.amazonaws.com/thorium-107.zip';
|
|
123
|
+
}
|
|
124
|
+
return util_1.default.format(downloadURLs[product][platform], host, revision, archiveName(product, platform, revision));
|
|
123
125
|
}
|
|
124
126
|
function handleArm64() {
|
|
125
127
|
let exists = fs.existsSync('/usr/bin/chromium-browser');
|
|
@@ -136,10 +138,10 @@ function handleArm64() {
|
|
|
136
138
|
'\n\n sudo apt install chromium-browser\n');
|
|
137
139
|
throw new Error();
|
|
138
140
|
}
|
|
139
|
-
const readdirAsync = (0,
|
|
140
|
-
const mkdirAsync = (0,
|
|
141
|
-
const unlinkAsync = (0,
|
|
142
|
-
const chmodAsync = (0,
|
|
141
|
+
const readdirAsync = (0, util_2.promisify)(fs.readdir.bind(fs));
|
|
142
|
+
const mkdirAsync = (0, util_2.promisify)(fs.mkdir.bind(fs));
|
|
143
|
+
const unlinkAsync = (0, util_2.promisify)(fs.unlink.bind(fs));
|
|
144
|
+
const chmodAsync = (0, util_2.promisify)(fs.chmod.bind(fs));
|
|
143
145
|
function existsAsync(filePath) {
|
|
144
146
|
return new Promise((resolve) => {
|
|
145
147
|
fs.access(filePath, (err) => {
|
|
@@ -325,7 +327,7 @@ class BrowserFetcher {
|
|
|
325
327
|
executablePath = path.join(folderPath, archiveName(__classPrivateFieldGet(this, _BrowserFetcher_product, "f"), __classPrivateFieldGet(this, _BrowserFetcher_platform, "f"), revision), 'chrome');
|
|
326
328
|
}
|
|
327
329
|
else if (__classPrivateFieldGet(this, _BrowserFetcher_platform, "f") === 'win32' || __classPrivateFieldGet(this, _BrowserFetcher_platform, "f") === 'win64') {
|
|
328
|
-
executablePath = path.join(folderPath, archiveName(__classPrivateFieldGet(this, _BrowserFetcher_product, "f"), __classPrivateFieldGet(this, _BrowserFetcher_platform, "f"), revision), '
|
|
330
|
+
executablePath = path.join(folderPath, archiveName(__classPrivateFieldGet(this, _BrowserFetcher_product, "f"), __classPrivateFieldGet(this, _BrowserFetcher_platform, "f"), revision), 'thorium.exe');
|
|
329
331
|
}
|
|
330
332
|
else {
|
|
331
333
|
throw new Error('Unsupported platform: ' + __classPrivateFieldGet(this, _BrowserFetcher_platform, "f"));
|
|
@@ -386,6 +388,13 @@ function _downloadFile(url, destinationPath, progressCallback) {
|
|
|
386
388
|
let downloadedBytes = 0;
|
|
387
389
|
let totalBytes = 0;
|
|
388
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
|
+
}
|
|
389
398
|
const request = httpRequest(url, 'GET', (response) => {
|
|
390
399
|
if (response.statusCode !== 200) {
|
|
391
400
|
const error = new Error(`Download failed: server returned code ${response.statusCode}. URL: ${url}`);
|
|
@@ -395,8 +404,8 @@ function _downloadFile(url, destinationPath, progressCallback) {
|
|
|
395
404
|
return;
|
|
396
405
|
}
|
|
397
406
|
const file = fs.createWriteStream(destinationPath);
|
|
398
|
-
file.on('
|
|
399
|
-
return fulfill();
|
|
407
|
+
file.on('close', () => {
|
|
408
|
+
return fulfill(totalBytes);
|
|
400
409
|
});
|
|
401
410
|
file.on('error', (error) => {
|
|
402
411
|
return reject(error);
|
|
@@ -409,14 +418,8 @@ function _downloadFile(url, destinationPath, progressCallback) {
|
|
|
409
418
|
return reject(error);
|
|
410
419
|
});
|
|
411
420
|
return promise;
|
|
412
|
-
function onData(chunk) {
|
|
413
|
-
downloadedBytes += chunk.length;
|
|
414
|
-
if (Date.now() - lastProgress > 1000) {
|
|
415
|
-
progressCallback(downloadedBytes, totalBytes);
|
|
416
|
-
lastProgress = Date.now();
|
|
417
|
-
}
|
|
418
|
-
}
|
|
419
421
|
}
|
|
422
|
+
exports._downloadFile = _downloadFile;
|
|
420
423
|
function install(archivePath, folderPath) {
|
|
421
424
|
if (archivePath.endsWith('.zip')) {
|
|
422
425
|
return (0, extract_zip_1.default)(archivePath, { dir: folderPath });
|
|
File without changes
|
|
File without changes
|
|
@@ -17,17 +17,14 @@
|
|
|
17
17
|
import * as childProcess from 'child_process';
|
|
18
18
|
import { Connection } from './Connection';
|
|
19
19
|
import type { LaunchOptions } from './LaunchOptions';
|
|
20
|
-
import type { Product } from './Product';
|
|
21
20
|
export declare class BrowserRunner {
|
|
22
21
|
#private;
|
|
23
22
|
proc?: childProcess.ChildProcess;
|
|
24
23
|
connection?: Connection;
|
|
25
|
-
constructor({
|
|
26
|
-
product: Product;
|
|
24
|
+
constructor({ executablePath, processArguments, userDataDir, }: {
|
|
27
25
|
executablePath: string;
|
|
28
26
|
processArguments: string[];
|
|
29
27
|
userDataDir: string;
|
|
30
|
-
isTempUserDataDir?: boolean;
|
|
31
28
|
});
|
|
32
29
|
start(options: LaunchOptions): void;
|
|
33
30
|
close(): Promise<void>;
|
|
@@ -48,45 +48,37 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
48
48
|
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");
|
|
49
49
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
50
50
|
};
|
|
51
|
-
var
|
|
51
|
+
var _BrowserRunner_executablePath, _BrowserRunner_processArguments, _BrowserRunner_userDataDir, _BrowserRunner_closed, _BrowserRunner_listeners, _BrowserRunner_processClosing;
|
|
52
52
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
53
53
|
exports.BrowserRunner = void 0;
|
|
54
54
|
const childProcess = __importStar(require("child_process"));
|
|
55
55
|
const fs = __importStar(require("fs"));
|
|
56
|
-
const path = __importStar(require("path"));
|
|
57
56
|
const readline = __importStar(require("readline"));
|
|
58
|
-
const util_1 = require("util");
|
|
59
57
|
const delete_directory_1 = require("../delete-directory");
|
|
60
58
|
const assert_1 = require("./assert");
|
|
61
59
|
const Connection_1 = require("./Connection");
|
|
62
60
|
const Errors_1 = require("./Errors");
|
|
63
61
|
const NodeWebSocketTransport_1 = require("./NodeWebSocketTransport");
|
|
64
|
-
const
|
|
65
|
-
const renameAsync = (0, util_1.promisify)(fs.rename);
|
|
66
|
-
const unlinkAsync = (0, util_1.promisify)(fs.unlink);
|
|
62
|
+
const util_1 = require("./util");
|
|
67
63
|
const PROCESS_ERROR_EXPLANATION = `Puppeteer was unable to kill the process which ran the browser binary.
|
|
68
64
|
This means that, on future Puppeteer launches, Puppeteer might not be able to launch the browser.
|
|
69
65
|
Please check your open processes and ensure that the browser processes that Puppeteer launched have been killed.
|
|
70
66
|
If you think this is a bug, please report it on the Puppeteer issue tracker.`;
|
|
71
67
|
class BrowserRunner {
|
|
72
|
-
constructor({
|
|
73
|
-
_BrowserRunner_product.set(this, void 0);
|
|
68
|
+
constructor({ executablePath, processArguments, userDataDir, }) {
|
|
74
69
|
_BrowserRunner_executablePath.set(this, void 0);
|
|
75
70
|
_BrowserRunner_processArguments.set(this, void 0);
|
|
76
71
|
_BrowserRunner_userDataDir.set(this, void 0);
|
|
77
|
-
_BrowserRunner_isTempUserDataDir.set(this, void 0);
|
|
78
72
|
_BrowserRunner_closed.set(this, true);
|
|
79
73
|
_BrowserRunner_listeners.set(this, []);
|
|
80
74
|
_BrowserRunner_processClosing.set(this, void 0);
|
|
81
|
-
__classPrivateFieldSet(this, _BrowserRunner_product, product, "f");
|
|
82
75
|
__classPrivateFieldSet(this, _BrowserRunner_executablePath, executablePath, "f");
|
|
83
76
|
__classPrivateFieldSet(this, _BrowserRunner_processArguments, processArguments, "f");
|
|
84
77
|
__classPrivateFieldSet(this, _BrowserRunner_userDataDir, userDataDir, "f");
|
|
85
|
-
__classPrivateFieldSet(this, _BrowserRunner_isTempUserDataDir, isTempUserDataDir, "f");
|
|
86
78
|
}
|
|
87
79
|
start(options) {
|
|
88
80
|
var _a, _b;
|
|
89
|
-
const {
|
|
81
|
+
const { dumpio, env, pipe } = options;
|
|
90
82
|
let stdio;
|
|
91
83
|
if (pipe) {
|
|
92
84
|
if (dumpio) {
|
|
@@ -121,66 +113,33 @@ class BrowserRunner {
|
|
|
121
113
|
this.proc.once('exit', async () => {
|
|
122
114
|
__classPrivateFieldSet(this, _BrowserRunner_closed, true, "f");
|
|
123
115
|
// Cleanup as processes exit.
|
|
124
|
-
|
|
125
|
-
|
|
116
|
+
try {
|
|
117
|
+
if (fs.existsSync(__classPrivateFieldGet(this, _BrowserRunner_userDataDir, "f"))) {
|
|
126
118
|
await (0, delete_directory_1.deleteDirectory)(__classPrivateFieldGet(this, _BrowserRunner_userDataDir, "f"));
|
|
127
|
-
fulfill();
|
|
128
|
-
}
|
|
129
|
-
catch (error) {
|
|
130
|
-
reject(error);
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
else {
|
|
134
|
-
if (__classPrivateFieldGet(this, _BrowserRunner_product, "f") === 'firefox') {
|
|
135
|
-
try {
|
|
136
|
-
// When an existing user profile has been used remove the user
|
|
137
|
-
// preferences file and restore possibly backuped preferences.
|
|
138
|
-
await unlinkAsync(path.join(__classPrivateFieldGet(this, _BrowserRunner_userDataDir, "f"), 'user.js'));
|
|
139
|
-
const prefsBackupPath = path.join(__classPrivateFieldGet(this, _BrowserRunner_userDataDir, "f"), 'prefs.js.puppeteer');
|
|
140
|
-
if (fs.existsSync(prefsBackupPath)) {
|
|
141
|
-
const prefsPath = path.join(__classPrivateFieldGet(this, _BrowserRunner_userDataDir, "f"), 'prefs.js');
|
|
142
|
-
await unlinkAsync(prefsPath);
|
|
143
|
-
await renameAsync(prefsBackupPath, prefsPath);
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
catch (error) {
|
|
147
|
-
reject(error);
|
|
148
|
-
}
|
|
149
119
|
}
|
|
150
120
|
fulfill();
|
|
151
121
|
}
|
|
122
|
+
catch (error) {
|
|
123
|
+
reject(error);
|
|
124
|
+
}
|
|
152
125
|
});
|
|
153
126
|
}), "f");
|
|
154
|
-
__classPrivateFieldSet(this, _BrowserRunner_listeners, [(0,
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
if (handleSIGTERM) {
|
|
162
|
-
__classPrivateFieldGet(this, _BrowserRunner_listeners, "f").push((0, util_2.addEventListener)(process, 'SIGTERM', this.close.bind(this)));
|
|
163
|
-
}
|
|
164
|
-
if (handleSIGHUP) {
|
|
165
|
-
__classPrivateFieldGet(this, _BrowserRunner_listeners, "f").push((0, util_2.addEventListener)(process, 'SIGHUP', this.close.bind(this)));
|
|
166
|
-
}
|
|
127
|
+
__classPrivateFieldSet(this, _BrowserRunner_listeners, [(0, util_1.addEventListener)(process, 'exit', this.kill.bind(this))], "f");
|
|
128
|
+
__classPrivateFieldGet(this, _BrowserRunner_listeners, "f").push((0, util_1.addEventListener)(process, 'SIGINT', () => {
|
|
129
|
+
this.kill();
|
|
130
|
+
process.exit(130);
|
|
131
|
+
}));
|
|
132
|
+
__classPrivateFieldGet(this, _BrowserRunner_listeners, "f").push((0, util_1.addEventListener)(process, 'SIGTERM', this.close.bind(this)));
|
|
133
|
+
__classPrivateFieldGet(this, _BrowserRunner_listeners, "f").push((0, util_1.addEventListener)(process, 'SIGHUP', this.close.bind(this)));
|
|
167
134
|
}
|
|
168
135
|
close() {
|
|
169
136
|
if (__classPrivateFieldGet(this, _BrowserRunner_closed, "f")) {
|
|
170
137
|
return Promise.resolve();
|
|
171
138
|
}
|
|
172
|
-
|
|
173
|
-
this.kill();
|
|
174
|
-
}
|
|
175
|
-
else if (this.connection) {
|
|
176
|
-
// Attempt to close the browser gracefully
|
|
177
|
-
this.connection.send('Browser.close').catch(() => {
|
|
178
|
-
this.kill();
|
|
179
|
-
});
|
|
180
|
-
}
|
|
139
|
+
this.kill();
|
|
181
140
|
// Cleanup this listener last, as that makes sure the full callback runs. If we
|
|
182
141
|
// perform this earlier, then the previous function calls would not happen.
|
|
183
|
-
(0,
|
|
142
|
+
(0, util_1.removeEventListeners)(__classPrivateFieldGet(this, _BrowserRunner_listeners, "f"));
|
|
184
143
|
return __classPrivateFieldGet(this, _BrowserRunner_processClosing, "f");
|
|
185
144
|
}
|
|
186
145
|
kill() {
|
|
@@ -217,19 +176,17 @@ class BrowserRunner {
|
|
|
217
176
|
}
|
|
218
177
|
}
|
|
219
178
|
catch (error) {
|
|
220
|
-
throw new Error(`${PROCESS_ERROR_EXPLANATION}\nError cause: ${(0,
|
|
179
|
+
throw new Error(`${PROCESS_ERROR_EXPLANATION}\nError cause: ${(0, util_1.isErrorLike)(error) ? error.stack : error}`);
|
|
221
180
|
}
|
|
222
181
|
}
|
|
223
182
|
// Attempt to remove temporary profile directory to avoid littering.
|
|
224
183
|
try {
|
|
225
|
-
|
|
226
|
-
fs.rmSync(__classPrivateFieldGet(this, _BrowserRunner_userDataDir, "f"), { recursive: true, force: true });
|
|
227
|
-
}
|
|
184
|
+
fs.rmSync(__classPrivateFieldGet(this, _BrowserRunner_userDataDir, "f"), { recursive: true, force: true });
|
|
228
185
|
}
|
|
229
186
|
catch (error) { }
|
|
230
187
|
// Cleanup this listener last, as that makes sure the full callback runs. If we
|
|
231
188
|
// perform this earlier, then the previous function calls would not happen.
|
|
232
|
-
(0,
|
|
189
|
+
(0, util_1.removeEventListeners)(__classPrivateFieldGet(this, _BrowserRunner_listeners, "f"));
|
|
233
190
|
}
|
|
234
191
|
async setupConnection(options) {
|
|
235
192
|
(0, assert_1.assert)(this.proc, 'BrowserRunner not started.');
|
|
@@ -241,21 +198,21 @@ class BrowserRunner {
|
|
|
241
198
|
}
|
|
242
199
|
}
|
|
243
200
|
exports.BrowserRunner = BrowserRunner;
|
|
244
|
-
|
|
201
|
+
_BrowserRunner_executablePath = new WeakMap(), _BrowserRunner_processArguments = new WeakMap(), _BrowserRunner_userDataDir = new WeakMap(), _BrowserRunner_closed = new WeakMap(), _BrowserRunner_listeners = new WeakMap(), _BrowserRunner_processClosing = new WeakMap();
|
|
245
202
|
function waitForWSEndpoint(browserProcess, timeout, preferredRevision) {
|
|
246
203
|
(0, assert_1.assert)(browserProcess.stderr, '`browserProcess` does not have stderr.');
|
|
247
204
|
const rl = readline.createInterface(browserProcess.stderr);
|
|
248
205
|
let stderr = '';
|
|
249
206
|
return new Promise((resolve, reject) => {
|
|
250
207
|
const listeners = [
|
|
251
|
-
(0,
|
|
252
|
-
(0,
|
|
208
|
+
(0, util_1.addEventListener)(rl, 'line', onLine),
|
|
209
|
+
(0, util_1.addEventListener)(rl, 'close', () => {
|
|
253
210
|
return onClose();
|
|
254
211
|
}),
|
|
255
|
-
(0,
|
|
212
|
+
(0, util_1.addEventListener)(browserProcess, 'exit', () => {
|
|
256
213
|
return onClose();
|
|
257
214
|
}),
|
|
258
|
-
(0,
|
|
215
|
+
(0, util_1.addEventListener)(browserProcess, 'error', (error) => {
|
|
259
216
|
return onClose(error);
|
|
260
217
|
}),
|
|
261
218
|
];
|
|
@@ -289,7 +246,7 @@ function waitForWSEndpoint(browserProcess, timeout, preferredRevision) {
|
|
|
289
246
|
if (timeoutId) {
|
|
290
247
|
clearTimeout(timeoutId);
|
|
291
248
|
}
|
|
292
|
-
(0,
|
|
249
|
+
(0, util_1.removeEventListeners)(listeners);
|
|
293
250
|
}
|
|
294
251
|
});
|
|
295
252
|
}
|
|
@@ -298,7 +255,7 @@ function pidExists(pid) {
|
|
|
298
255
|
return process.kill(pid, 0);
|
|
299
256
|
}
|
|
300
257
|
catch (error) {
|
|
301
|
-
if ((0,
|
|
258
|
+
if ((0, util_1.isErrnoException)(error)) {
|
|
302
259
|
if (error.code && error.code === 'ESRCH') {
|
|
303
260
|
return false;
|
|
304
261
|
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/dist/browser/DOMWorld.js
CHANGED
|
File without changes
|
package/dist/browser/Errors.d.ts
CHANGED
|
File without changes
|
package/dist/browser/Errors.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|