@remotion/renderer 4.0.223 → 4.0.225

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.
@@ -1,13 +1,18 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
6
  exports.openBrowser = exports.internalOpenBrowser = void 0;
7
+ const node_fs_1 = __importDefault(require("node:fs"));
8
+ const node_os_1 = __importDefault(require("node:os"));
9
+ const node_path_1 = __importDefault(require("node:path"));
4
10
  const browser_instances_1 = require("./browser-instances");
5
11
  const browser_download_progress_bar_1 = require("./browser/browser-download-progress-bar");
6
- const node_1 = require("./browser/node");
12
+ const Launcher_1 = require("./browser/Launcher");
7
13
  const ensure_browser_1 = require("./ensure-browser");
8
14
  const get_local_browser_executable_1 = require("./get-local-browser-executable");
9
15
  const get_video_threads_flag_1 = require("./get-video-threads-flag");
10
- const log_level_1 = require("./log-level");
11
16
  const logger_1 = require("./logger");
12
17
  const gl_1 = require("./options/gl");
13
18
  const featuresToEnable = (option) => {
@@ -62,11 +67,12 @@ const internalOpenBrowser = async ({ browser, browserExecutable, chromiumOptions
62
67
  if (chromiumOptions.userAgent) {
63
68
  logger_1.Log.verbose({ indent, logLevel: 'verbose', tag: 'openBrowser()' }, `Using custom user agent: ${chromiumOptions.userAgent}`);
64
69
  }
65
- const browserInstance = await node_1.puppeteer.launch({
70
+ const userDataDir = await node_fs_1.default.promises.mkdtemp(node_path_1.default.join(node_os_1.default.tmpdir(), 'puppeteer_dev_chrome_profile-'));
71
+ const browserInstance = await (0, Launcher_1.launchChrome)({
66
72
  executablePath,
67
- dumpio: (0, log_level_1.isEqualOrBelowLogLevel)(logLevel, 'verbose'),
68
73
  logLevel,
69
74
  indent,
75
+ userDataDir,
70
76
  args: [
71
77
  'about:blank',
72
78
  '--allow-pre-commit-input',
@@ -136,6 +142,8 @@ const internalOpenBrowser = async ({ browser, browserExecutable, chromiumOptions
136
142
  (chromiumOptions === null || chromiumOptions === void 0 ? void 0 : chromiumOptions.userAgent)
137
143
  ? `--user-agent="${chromiumOptions.userAgent}"`
138
144
  : null,
145
+ '--remote-debugging-port=0',
146
+ `--user-data-dir=${userDataDir}`,
139
147
  ].filter(Boolean),
140
148
  defaultViewport: viewport !== null && viewport !== void 0 ? viewport : {
141
149
  height: 720,
@@ -17,7 +17,7 @@ export declare const colorSpaceOption: {
17
17
  source: string;
18
18
  value: ColorSpace;
19
19
  };
20
- setConfig: (value: "bt709" | "bt2020-ncl" | "default" | null) => void;
20
+ setConfig: (value: "default" | "bt709" | "bt2020-ncl" | null) => void;
21
21
  };
22
22
  export declare const validateColorSpace: (option: unknown) => void;
23
23
  export {};
@@ -191,7 +191,7 @@ export declare const allOptions: {
191
191
  source: string;
192
192
  value: import("./color-space").ColorSpace;
193
193
  };
194
- setConfig: (value: "bt709" | "bt2020-ncl" | "default" | null) => void;
194
+ setConfig: (value: "default" | "bt709" | "bt2020-ncl" | null) => void;
195
195
  };
196
196
  deleteAfterOption: {
197
197
  name: string;
@@ -115,7 +115,7 @@ export declare const optionsMap: {
115
115
  source: string;
116
116
  value: import("./color-space").ColorSpace;
117
117
  };
118
- setConfig: (value: "bt709" | "bt2020-ncl" | "default" | null) => void;
118
+ setConfig: (value: "default" | "bt709" | "bt2020-ncl" | null) => void;
119
119
  };
120
120
  readonly codec: {
121
121
  name: string;
@@ -855,7 +855,7 @@ export declare const optionsMap: {
855
855
  source: string;
856
856
  value: import("./color-space").ColorSpace;
857
857
  };
858
- setConfig: (value: "bt709" | "bt2020-ncl" | "default" | null) => void;
858
+ setConfig: (value: "default" | "bt709" | "bt2020-ncl" | null) => void;
859
859
  };
860
860
  readonly muted: {
861
861
  name: string;
@@ -1119,7 +1119,7 @@ export declare const optionsMap: {
1119
1119
  source: string;
1120
1120
  value: import("./color-space").ColorSpace;
1121
1121
  };
1122
- setConfig: (value: "bt709" | "bt2020-ncl" | "default" | null) => void;
1122
+ setConfig: (value: "default" | "bt709" | "bt2020-ncl" | null) => void;
1123
1123
  };
1124
1124
  readonly audioBitrate: {
1125
1125
  name: string;
@@ -87,6 +87,10 @@ const serveStatic = async (path, options) => {
87
87
  // this is okay as we are in cleanup phase
88
88
  closeCompositor()
89
89
  .catch((err) => {
90
+ if (err.message.includes('Compositor quit')) {
91
+ resolve();
92
+ return;
93
+ }
90
94
  reject(err);
91
95
  })
92
96
  .finally(() => {
@@ -2887,7 +2887,6 @@ var downloadFileWithoutRetries = ({ onProgress, url, to: toFn }) => {
2887
2887
  }, 20000);
2888
2888
  };
2889
2889
  refreshTimeout();
2890
- let finishEventSent = false;
2891
2890
  readFile(url).then((res) => {
2892
2891
  const contentDisposition = res.headers["content-disposition"] ?? null;
2893
2892
  const contentType = res.headers["content-type"] ?? null;
@@ -2901,13 +2900,11 @@ var downloadFileWithoutRetries = ({ onProgress, url, to: toFn }) => {
2901
2900
  if (rejected) {
2902
2901
  return;
2903
2902
  }
2904
- if (!finishEventSent) {
2905
- onProgress?.({
2906
- downloaded,
2907
- percent: 1,
2908
- totalSize: downloaded
2909
- });
2910
- }
2903
+ onProgress?.({
2904
+ downloaded,
2905
+ percent: 1,
2906
+ totalSize: downloaded
2907
+ });
2911
2908
  refreshTimeout();
2912
2909
  return resolveAndFlag({ sizeInBytes: downloaded, to });
2913
2910
  });
@@ -2918,15 +2915,11 @@ var downloadFileWithoutRetries = ({ onProgress, url, to: toFn }) => {
2918
2915
  refreshTimeout();
2919
2916
  downloaded += d.length;
2920
2917
  refreshTimeout();
2921
- const percent = totalSize === null ? null : downloaded / totalSize;
2922
2918
  onProgress?.({
2923
2919
  downloaded,
2924
- percent,
2920
+ percent: totalSize === null ? null : downloaded / totalSize,
2925
2921
  totalSize
2926
2922
  });
2927
- if (percent === 1) {
2928
- finishEventSent = true;
2929
- }
2930
2923
  });
2931
2924
  res.on("close", () => {
2932
2925
  if (totalSize !== null && downloaded !== totalSize) {
@@ -3171,7 +3164,7 @@ var defaultBrowserDownloadProgress = ({
3171
3164
  let lastProgress = 0;
3172
3165
  return {
3173
3166
  onProgress: (progress) => {
3174
- if (progress.downloadedBytes > lastProgress + 1e7 || progress.percent === 1) {
3167
+ if (progress.downloadedBytes > lastProgress + 1e7) {
3175
3168
  lastProgress = progress.downloadedBytes;
3176
3169
  Log.info({ indent, logLevel }, `Downloading Chrome Headless Shell - ${toMegabytes(progress.downloadedBytes)}/${toMegabytes(progress.totalSizeInBytes)}`);
3177
3170
  }
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.223",
6
+ "version": "4.0.225",
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.223",
22
- "@remotion/streaming": "4.0.223"
21
+ "remotion": "4.0.225",
22
+ "@remotion/streaming": "4.0.225"
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.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"
37
+ "@remotion/compositor-darwin-arm64": "4.0.225",
38
+ "@remotion/compositor-darwin-x64": "4.0.225",
39
+ "@remotion/compositor-linux-arm64-gnu": "4.0.225",
40
+ "@remotion/compositor-linux-x64-musl": "4.0.225",
41
+ "@remotion/compositor-win32-x64-msvc": "4.0.225",
42
+ "@remotion/compositor-linux-x64-gnu": "4.0.225",
43
+ "@remotion/compositor-linux-arm64-musl": "4.0.225"
44
44
  },
45
45
  "keywords": [
46
46
  "remotion",