@remotion/renderer 4.0.440 → 4.0.442

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.
@@ -15638,33 +15638,29 @@ var isPortAvailableOnHost = ({
15638
15638
  host
15639
15639
  }) => {
15640
15640
  return new Promise((resolve2) => {
15641
- let status = "unavailable";
15642
- const socket = new net.Socket;
15643
- socket.on("connect", () => {
15644
- status = "unavailable";
15645
- socket.destroy();
15641
+ const server = net.createServer();
15642
+ server.unref();
15643
+ server.on("error", () => {
15644
+ resolve2("unavailable");
15646
15645
  });
15647
- socket.setTimeout(3000);
15648
- socket.on("timeout", () => {
15649
- status = "unavailable";
15650
- socket.destroy();
15651
- resolve2(status);
15652
- });
15653
- socket.on("error", () => {
15654
- status = "available";
15646
+ server.listen({ port: portToTry, host }, () => {
15647
+ server.close(() => {
15648
+ resolve2("available");
15649
+ });
15655
15650
  });
15656
- socket.on("close", () => resolve2(status));
15657
- socket.connect(portToTry, host);
15658
15651
  });
15659
15652
  };
15660
15653
  var testPortAvailableOnMultipleHosts = async ({
15661
15654
  hosts,
15662
15655
  port
15663
15656
  }) => {
15664
- const results = await Promise.all(hosts.map((host) => {
15665
- return isPortAvailableOnHost({ portToTry: port, host });
15666
- }));
15667
- return results.every((r) => r === "available") ? "available" : "unavailable";
15657
+ for (const host of hosts) {
15658
+ const result = await isPortAvailableOnHost({ portToTry: port, host });
15659
+ if (result === "unavailable") {
15660
+ return "unavailable";
15661
+ }
15662
+ }
15663
+ return "available";
15668
15664
  };
15669
15665
  var getPort = async ({
15670
15666
  from,
@@ -18593,7 +18589,7 @@ var takeFrame = async ({
18593
18589
  }
18594
18590
  const buf = await screenshot({
18595
18591
  page: freePage,
18596
- omitBackground: imageFormat === "png",
18592
+ omitBackground: imageFormat === "png" || imageFormat === "webp",
18597
18593
  path: (wantsBuffer ? undefined : output) ?? undefined,
18598
18594
  type: imageFormat,
18599
18595
  jpegQuality,
package/dist/get-port.js CHANGED
@@ -8,30 +8,26 @@ const net_1 = __importDefault(require("net"));
8
8
  const locks_1 = require("./locks");
9
9
  const isPortAvailableOnHost = ({ portToTry, host, }) => {
10
10
  return new Promise((resolve) => {
11
- let status = 'unavailable';
12
- const socket = new net_1.default.Socket();
13
- socket.on('connect', () => {
14
- status = 'unavailable';
15
- socket.destroy();
11
+ const server = net_1.default.createServer();
12
+ server.unref();
13
+ server.on('error', () => {
14
+ resolve('unavailable');
16
15
  });
17
- socket.setTimeout(3000);
18
- socket.on('timeout', () => {
19
- status = 'unavailable';
20
- socket.destroy();
21
- resolve(status);
16
+ server.listen({ port: portToTry, host }, () => {
17
+ server.close(() => {
18
+ resolve('available');
19
+ });
22
20
  });
23
- socket.on('error', () => {
24
- status = 'available';
25
- });
26
- socket.on('close', () => resolve(status));
27
- socket.connect(portToTry, host);
28
21
  });
29
22
  };
30
23
  const testPortAvailableOnMultipleHosts = async ({ hosts, port, }) => {
31
- const results = await Promise.all(hosts.map((host) => {
32
- return isPortAvailableOnHost({ portToTry: port, host });
33
- }));
34
- return results.every((r) => r === 'available') ? 'available' : 'unavailable';
24
+ for (const host of hosts) {
25
+ const result = await isPortAvailableOnHost({ portToTry: port, host });
26
+ if (result === 'unavailable') {
27
+ return 'unavailable';
28
+ }
29
+ }
30
+ return 'available';
35
31
  };
36
32
  exports.testPortAvailableOnMultipleHosts = testPortAvailableOnMultipleHosts;
37
33
  const getPort = async ({ from, to, hostsToTest, onPortUnavailable, }) => {
@@ -34,7 +34,7 @@ const takeFrame = async ({ freePage, imageFormat, jpegQuality, width, height, ou
34
34
  }
35
35
  const buf = await (0, puppeteer_screenshot_1.screenshot)({
36
36
  page: freePage,
37
- omitBackground: imageFormat === 'png',
37
+ omitBackground: imageFormat === 'png' || imageFormat === 'webp',
38
38
  path: (_a = (wantsBuffer ? undefined : output)) !== null && _a !== void 0 ? _a : undefined,
39
39
  type: imageFormat,
40
40
  jpegQuality,
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.440",
6
+ "version": "4.0.442",
7
7
  "description": "Render Remotion videos using Node.js or Bun",
8
8
  "main": "dist/index.js",
9
9
  "types": "dist/index.d.ts",
@@ -24,11 +24,11 @@
24
24
  "dependencies": {
25
25
  "execa": "5.1.1",
26
26
  "extract-zip": "2.0.1",
27
- "remotion": "4.0.440",
28
- "@remotion/streaming": "4.0.440",
27
+ "remotion": "4.0.442",
28
+ "@remotion/streaming": "4.0.442",
29
29
  "source-map": "^0.8.0-beta.0",
30
30
  "ws": "8.17.1",
31
- "@remotion/licensing": "4.0.440"
31
+ "@remotion/licensing": "4.0.442"
32
32
  },
33
33
  "peerDependencies": {
34
34
  "react": ">=16.8.0",
@@ -42,19 +42,19 @@
42
42
  "react-dom": "19.2.3",
43
43
  "@typescript/native-preview": "7.0.0-dev.20260217.1",
44
44
  "@types/ws": "8.5.10",
45
- "@remotion/example-videos": "4.0.440",
46
- "@remotion/eslint-config-internal": "4.0.440",
45
+ "@remotion/example-videos": "4.0.442",
46
+ "@remotion/eslint-config-internal": "4.0.442",
47
47
  "eslint": "9.19.0",
48
48
  "@types/node": "20.12.14"
49
49
  },
50
50
  "optionalDependencies": {
51
- "@remotion/compositor-darwin-arm64": "4.0.440",
52
- "@remotion/compositor-darwin-x64": "4.0.440",
53
- "@remotion/compositor-linux-arm64-gnu": "4.0.440",
54
- "@remotion/compositor-linux-arm64-musl": "4.0.440",
55
- "@remotion/compositor-linux-x64-gnu": "4.0.440",
56
- "@remotion/compositor-linux-x64-musl": "4.0.440",
57
- "@remotion/compositor-win32-x64-msvc": "4.0.440"
51
+ "@remotion/compositor-darwin-arm64": "4.0.442",
52
+ "@remotion/compositor-darwin-x64": "4.0.442",
53
+ "@remotion/compositor-linux-arm64-gnu": "4.0.442",
54
+ "@remotion/compositor-linux-arm64-musl": "4.0.442",
55
+ "@remotion/compositor-linux-x64-gnu": "4.0.442",
56
+ "@remotion/compositor-linux-x64-musl": "4.0.442",
57
+ "@remotion/compositor-win32-x64-msvc": "4.0.442"
58
58
  },
59
59
  "keywords": [
60
60
  "remotion",
@@ -1,16 +0,0 @@
1
- export declare const browserDownloadDirOption: {
2
- name: string;
3
- cliFlag: "browser-download-dir";
4
- description: () => import("react/jsx-runtime").JSX.Element;
5
- ssrName: "browserDownloadDir";
6
- docLink: string;
7
- type: string | null;
8
- getValue: ({ commandLine }: {
9
- commandLine: Record<string, unknown>;
10
- }) => {
11
- source: string;
12
- value: string | null;
13
- };
14
- setConfig: (value: string | null) => void;
15
- id: "browser-download-dir";
16
- };
@@ -1,42 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.browserDownloadDirOption = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const cliFlag = 'browser-download-dir';
6
- let currentDirectory = null;
7
- exports.browserDownloadDirOption = {
8
- name: 'Browser Download Directory',
9
- cliFlag,
10
- description: () => (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: ["Specify the directory where the browser should be downloaded to when calling ",
11
- jsx_runtime_1.jsx("code", { children: "npx remotion browser ensure" }),
12
- ". By default, Remotion downloads the browser into ",
13
- jsx_runtime_1.jsx("code", { children: "node_modules/.remotion" }),
14
- " inside the nearest project root. Use this option to override the default download location. Pass ",
15
- jsx_runtime_1.jsx("code", { children: "null" }),
16
- " to use the default location."] })),
17
- ssrName: 'browserDownloadDir',
18
- docLink: 'https://www.remotion.dev/docs/config#setbrowserdownloaddir',
19
- type: '',
20
- getValue: ({ commandLine }) => {
21
- if (commandLine[cliFlag] !== undefined) {
22
- return {
23
- source: 'cli',
24
- value: commandLine[cliFlag],
25
- };
26
- }
27
- if (currentDirectory !== null) {
28
- return {
29
- source: 'config',
30
- value: currentDirectory,
31
- };
32
- }
33
- return {
34
- source: 'default',
35
- value: null,
36
- };
37
- },
38
- setConfig: (value) => {
39
- currentDirectory = value;
40
- },
41
- id: cliFlag,
42
- };