@remotion/renderer 4.0.222 → 4.0.223

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.
Files changed (2) hide show
  1. package/ensure-browser.mjs +20 -8
  2. package/package.json +10 -10
@@ -2887,6 +2887,7 @@ var downloadFileWithoutRetries = ({ onProgress, url, to: toFn }) => {
2887
2887
  }, 20000);
2888
2888
  };
2889
2889
  refreshTimeout();
2890
+ let finishEventSent = false;
2890
2891
  readFile(url).then((res) => {
2891
2892
  const contentDisposition = res.headers["content-disposition"] ?? null;
2892
2893
  const contentType = res.headers["content-type"] ?? null;
@@ -2900,11 +2901,13 @@ var downloadFileWithoutRetries = ({ onProgress, url, to: toFn }) => {
2900
2901
  if (rejected) {
2901
2902
  return;
2902
2903
  }
2903
- onProgress?.({
2904
- downloaded,
2905
- percent: 1,
2906
- totalSize: downloaded
2907
- });
2904
+ if (!finishEventSent) {
2905
+ onProgress?.({
2906
+ downloaded,
2907
+ percent: 1,
2908
+ totalSize: downloaded
2909
+ });
2910
+ }
2908
2911
  refreshTimeout();
2909
2912
  return resolveAndFlag({ sizeInBytes: downloaded, to });
2910
2913
  });
@@ -2915,11 +2918,15 @@ var downloadFileWithoutRetries = ({ onProgress, url, to: toFn }) => {
2915
2918
  refreshTimeout();
2916
2919
  downloaded += d.length;
2917
2920
  refreshTimeout();
2921
+ const percent = totalSize === null ? null : downloaded / totalSize;
2918
2922
  onProgress?.({
2919
2923
  downloaded,
2920
- percent: totalSize === null ? null : downloaded / totalSize,
2924
+ percent,
2921
2925
  totalSize
2922
2926
  });
2927
+ if (percent === 1) {
2928
+ finishEventSent = true;
2929
+ }
2923
2930
  });
2924
2931
  res.on("close", () => {
2925
2932
  if (totalSize !== null && downloaded !== totalSize) {
@@ -3164,7 +3171,7 @@ var defaultBrowserDownloadProgress = ({
3164
3171
  let lastProgress = 0;
3165
3172
  return {
3166
3173
  onProgress: (progress) => {
3167
- if (progress.downloadedBytes > lastProgress + 1e7) {
3174
+ if (progress.downloadedBytes > lastProgress + 1e7 || progress.percent === 1) {
3168
3175
  lastProgress = progress.downloadedBytes;
3169
3176
  Log.info({ indent, logLevel }, `Downloading Chrome Headless Shell - ${toMegabytes(progress.downloadedBytes)}/${toMegabytes(progress.totalSizeInBytes)}`);
3170
3177
  }
@@ -3188,7 +3195,8 @@ var getLocalBrowser = () => {
3188
3195
  };
3189
3196
 
3190
3197
  // src/ensure-browser.ts
3191
- var internalEnsureBrowser = async ({
3198
+ var currentEnsureBrowserOperation = Promise.resolve();
3199
+ var internalEnsureBrowserUncapped = async ({
3192
3200
  indent,
3193
3201
  logLevel,
3194
3202
  browserExecutable,
@@ -3202,6 +3210,10 @@ var internalEnsureBrowser = async ({
3202
3210
  const newStatus = getBrowserStatus(browserExecutable);
3203
3211
  return newStatus;
3204
3212
  };
3213
+ var internalEnsureBrowser = (options) => {
3214
+ currentEnsureBrowserOperation = currentEnsureBrowserOperation.then(() => internalEnsureBrowserUncapped(options));
3215
+ return currentEnsureBrowserOperation;
3216
+ };
3205
3217
  var getBrowserStatus = (browserExecutable) => {
3206
3218
  if (browserExecutable) {
3207
3219
  if (!fs5.existsSync(browserExecutable)) {
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "url": "https://github.com/remotion-dev/remotion/tree/main/packages/renderer"
4
4
  },
5
5
  "name": "@remotion/renderer",
6
- "version": "4.0.222",
6
+ "version": "4.0.223",
7
7
  "description": "Render Remotion videos using Node.js or Bun",
8
8
  "main": "dist/index.js",
9
9
  "types": "dist/index.d.ts",
@@ -18,8 +18,8 @@
18
18
  "extract-zip": "2.0.1",
19
19
  "source-map": "^0.8.0-beta.0",
20
20
  "ws": "8.17.1",
21
- "remotion": "4.0.222",
22
- "@remotion/streaming": "4.0.222"
21
+ "remotion": "4.0.223",
22
+ "@remotion/streaming": "4.0.223"
23
23
  },
24
24
  "peerDependencies": {
25
25
  "react": ">=16.8.0",
@@ -34,13 +34,13 @@
34
34
  "@types/ws": "8.5.10"
35
35
  },
36
36
  "optionalDependencies": {
37
- "@remotion/compositor-darwin-x64": "4.0.222",
38
- "@remotion/compositor-linux-arm64-gnu": "4.0.222",
39
- "@remotion/compositor-linux-arm64-musl": "4.0.222",
40
- "@remotion/compositor-linux-x64-gnu": "4.0.222",
41
- "@remotion/compositor-linux-x64-musl": "4.0.222",
42
- "@remotion/compositor-darwin-arm64": "4.0.222",
43
- "@remotion/compositor-win32-x64-msvc": "4.0.222"
37
+ "@remotion/compositor-darwin-x64": "4.0.223",
38
+ "@remotion/compositor-linux-arm64-musl": "4.0.223",
39
+ "@remotion/compositor-linux-x64-gnu": "4.0.223",
40
+ "@remotion/compositor-darwin-arm64": "4.0.223",
41
+ "@remotion/compositor-linux-x64-musl": "4.0.223",
42
+ "@remotion/compositor-win32-x64-msvc": "4.0.223",
43
+ "@remotion/compositor-linux-arm64-gnu": "4.0.223"
44
44
  },
45
45
  "keywords": [
46
46
  "remotion",