@remotion/renderer 4.0.59 → 4.0.61
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/dist/browser/Connection.js +13 -0
- package/dist/browser/DOMWorld.d.ts +1 -2
- package/dist/browser/DOMWorld.js +3 -5
- package/dist/browser/JSHandle.js +1 -1
- package/dist/client.d.ts +8 -0
- package/dist/get-port.d.ts +0 -4
- package/dist/get-port.js +1 -10
- package/dist/index.d.ts +2 -1
- package/dist/index.js +3 -3
- package/dist/options/enable-lambda-insights.d.ts +9 -0
- package/dist/options/enable-lambda-insights.js +12 -0
- package/dist/options/index.d.ts +8 -0
- package/dist/options/index.js +2 -0
- package/dist/port-config.d.ts +18 -0
- package/dist/port-config.js +76 -0
- package/dist/seek-to-frame.js +45 -48
- package/dist/serve-static.js +2 -1
- package/package.json +9 -9
- package/dist/is-ipv6-supported.d.ts +0 -1
- package/dist/is-ipv6-supported.js +0 -26
- package/dist/validate-opengl-renderer.d.ts +0 -4
- package/dist/validate-opengl-renderer.js +0 -21
|
@@ -28,6 +28,7 @@ exports.CDPSession = exports.CDPSessionEmittedEvents = exports.Connection = void
|
|
|
28
28
|
* See the License for the specific language governing permissions and
|
|
29
29
|
* limitations under the License.
|
|
30
30
|
*/
|
|
31
|
+
const logger_1 = require("../logger");
|
|
31
32
|
const assert_1 = require("./assert");
|
|
32
33
|
const Errors_1 = require("./Errors");
|
|
33
34
|
const EventEmitter_1 = require("./EventEmitter");
|
|
@@ -62,11 +63,14 @@ class Connection extends EventEmitter_1.EventEmitter {
|
|
|
62
63
|
const params = paramArgs.length ? paramArgs[0] : undefined;
|
|
63
64
|
const id = this._rawSend({ method, params });
|
|
64
65
|
return new Promise((resolve, reject) => {
|
|
66
|
+
var _a;
|
|
65
67
|
__classPrivateFieldGet(this, _Connection_callbacks, "f").set(id, {
|
|
66
68
|
resolve,
|
|
67
69
|
reject,
|
|
68
70
|
method,
|
|
69
71
|
returnSize: true,
|
|
72
|
+
stack: (_a = new Error().stack) !== null && _a !== void 0 ? _a : '',
|
|
73
|
+
fn: method + JSON.stringify(params),
|
|
70
74
|
});
|
|
71
75
|
});
|
|
72
76
|
}
|
|
@@ -192,11 +196,20 @@ class CDPSession extends EventEmitter_1.EventEmitter {
|
|
|
192
196
|
params,
|
|
193
197
|
});
|
|
194
198
|
return new Promise((resolve, reject) => {
|
|
199
|
+
var _a;
|
|
200
|
+
if (__classPrivateFieldGet(this, _CDPSession_callbacks, "f").size > 100) {
|
|
201
|
+
for (const callback of __classPrivateFieldGet(this, _CDPSession_callbacks, "f").values()) {
|
|
202
|
+
logger_1.Log.info(callback.fn);
|
|
203
|
+
}
|
|
204
|
+
throw new Error('Leak detected: Too many callbacks');
|
|
205
|
+
}
|
|
195
206
|
__classPrivateFieldGet(this, _CDPSession_callbacks, "f").set(id, {
|
|
196
207
|
resolve,
|
|
197
208
|
reject,
|
|
198
209
|
method,
|
|
199
210
|
returnSize: true,
|
|
211
|
+
stack: (_a = new Error().stack) !== null && _a !== void 0 ? _a : '',
|
|
212
|
+
fn: method + JSON.stringify(params),
|
|
200
213
|
});
|
|
201
214
|
});
|
|
202
215
|
}
|
package/dist/browser/DOMWorld.js
CHANGED
|
@@ -99,11 +99,6 @@ class DOMWorld {
|
|
|
99
99
|
timeout,
|
|
100
100
|
args: [],
|
|
101
101
|
browser,
|
|
102
|
-
}).promise;
|
|
103
|
-
}
|
|
104
|
-
title() {
|
|
105
|
-
return this.evaluate(() => {
|
|
106
|
-
return document.title;
|
|
107
102
|
});
|
|
108
103
|
}
|
|
109
104
|
}
|
|
@@ -244,6 +239,9 @@ _WaitTask_domWorld = new WeakMap(), _WaitTask_timeout = new WeakMap(), _WaitTask
|
|
|
244
239
|
}
|
|
245
240
|
__classPrivateFieldGet(this, _WaitTask_browser, "f").off("closed" /* BrowserEmittedEvents.Closed */, this.onBrowserClose);
|
|
246
241
|
__classPrivateFieldGet(this, _WaitTask_browser, "f").off("closed-silent" /* BrowserEmittedEvents.ClosedSilent */, this.onBrowserCloseSilent);
|
|
242
|
+
if (__classPrivateFieldGet(this, _WaitTask_domWorld, "f")._waitTasks.size > 100) {
|
|
243
|
+
throw new Error('Leak detected: Too many WaitTasks');
|
|
244
|
+
}
|
|
247
245
|
__classPrivateFieldGet(this, _WaitTask_domWorld, "f")._waitTasks.delete(this);
|
|
248
246
|
};
|
|
249
247
|
function waitForPredicatePageFunction(predicateBody, timeout, ...args) {
|
package/dist/browser/JSHandle.js
CHANGED
|
@@ -77,7 +77,7 @@ class JSHandle {
|
|
|
77
77
|
const type = __classPrivateFieldGet(this, _JSHandle_remoteObject, "f").subtype || __classPrivateFieldGet(this, _JSHandle_remoteObject, "f").type;
|
|
78
78
|
return 'JSHandle@' + type;
|
|
79
79
|
}
|
|
80
|
-
return
|
|
80
|
+
return (0, util_1.valueFromRemoteObject)(__classPrivateFieldGet(this, _JSHandle_remoteObject, "f"));
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
83
|
exports.JSHandle = JSHandle;
|
package/dist/client.d.ts
CHANGED
|
@@ -315,6 +315,14 @@ export declare const BrowserSafeApis: {
|
|
|
315
315
|
ssrName: string;
|
|
316
316
|
description: () => JSX.Element;
|
|
317
317
|
};
|
|
318
|
+
enableLambdaInsights: {
|
|
319
|
+
name: string;
|
|
320
|
+
cliFlag: string;
|
|
321
|
+
description: () => JSX.Element;
|
|
322
|
+
ssrName: string;
|
|
323
|
+
docLink: string;
|
|
324
|
+
type: boolean;
|
|
325
|
+
};
|
|
318
326
|
};
|
|
319
327
|
validColorSpaces: readonly ["default", "bt709"];
|
|
320
328
|
optionsMap: {
|
package/dist/get-port.d.ts
CHANGED
|
@@ -3,10 +3,6 @@ export declare const testPortAvailableOnMultipleHosts: ({ hosts, port, }: {
|
|
|
3
3
|
port: number;
|
|
4
4
|
hosts: string[];
|
|
5
5
|
}) => Promise<PortStatus>;
|
|
6
|
-
export declare const getPortConfig: () => {
|
|
7
|
-
host: string;
|
|
8
|
-
hostsToTry: string[];
|
|
9
|
-
};
|
|
10
6
|
export declare const getDesiredPort: ({ desiredPort, from, hostsToTry, to, }: {
|
|
11
7
|
desiredPort: number | undefined;
|
|
12
8
|
from: number;
|
package/dist/get-port.js
CHANGED
|
@@ -3,9 +3,8 @@ 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.getDesiredPort = exports.
|
|
6
|
+
exports.getDesiredPort = exports.testPortAvailableOnMultipleHosts = void 0;
|
|
7
7
|
const net_1 = __importDefault(require("net"));
|
|
8
|
-
const is_ipv6_supported_1 = require("./is-ipv6-supported");
|
|
9
8
|
const locks_1 = require("./locks");
|
|
10
9
|
const isPortAvailableOnHost = ({ portToTry, host, }) => {
|
|
11
10
|
return new Promise((resolve) => {
|
|
@@ -48,14 +47,6 @@ const getPort = async ({ from, to, hostsToTest, }) => {
|
|
|
48
47
|
throw new Error('No available ports found');
|
|
49
48
|
};
|
|
50
49
|
const portLocks = (0, locks_1.createLock)({ timeout: 10000 });
|
|
51
|
-
const getPortConfig = () => {
|
|
52
|
-
const host = (0, is_ipv6_supported_1.isIpV6Supported)() ? '::' : '0.0.0.0';
|
|
53
|
-
const hostsToTry = (0, is_ipv6_supported_1.isIpV6Supported)()
|
|
54
|
-
? ['::', '::1', '0.0.0.0', '127.0.0.1']
|
|
55
|
-
: ['0.0.0.0', '127.0.0.1'];
|
|
56
|
-
return { host, hostsToTry };
|
|
57
|
-
};
|
|
58
|
-
exports.getPortConfig = getPortConfig;
|
|
59
50
|
const getDesiredPort = async ({ desiredPort, from, hostsToTry, to, }) => {
|
|
60
51
|
await portLocks.waitForAllToBeDone();
|
|
61
52
|
const lockPortSelection = portLocks.lock();
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
/// <reference types="react" />
|
|
3
|
+
/// <reference types="node" />
|
|
3
4
|
import execa from 'execa';
|
|
4
5
|
import { HeadlessBrowser } from './browser/Browser';
|
|
5
6
|
import { SymbolicateableError } from './error-handling/symbolicateable-error';
|
|
@@ -519,7 +520,7 @@ export declare const RenderInternals: {
|
|
|
519
520
|
}>;
|
|
520
521
|
validOpenGlRenderers: readonly ["swangle", "angle", "egl", "swiftshader", "vulkan", "angle-egl"];
|
|
521
522
|
copyImageToClipboard: (src: string, logLevel: "verbose" | "info" | "warn" | "error") => Promise<void>;
|
|
522
|
-
isIpV6Supported: () => boolean;
|
|
523
|
+
isIpV6Supported: (flattened: import("os").NetworkInterfaceInfo[]) => boolean;
|
|
523
524
|
getChromiumGpuInformation: ({ browserExecutable, indent, logLevel, chromiumOptions, }: {
|
|
524
525
|
browserExecutable: import("./browser-executable").BrowserExecutable;
|
|
525
526
|
indent: boolean;
|
package/dist/index.js
CHANGED
|
@@ -60,7 +60,6 @@ const get_local_browser_executable_1 = require("./get-local-browser-executable")
|
|
|
60
60
|
const get_port_1 = require("./get-port");
|
|
61
61
|
const image_format_1 = require("./image-format");
|
|
62
62
|
const is_audio_codec_1 = require("./is-audio-codec");
|
|
63
|
-
const is_ipv6_supported_1 = require("./is-ipv6-supported");
|
|
64
63
|
const is_serve_url_1 = require("./is-serve-url");
|
|
65
64
|
const jpeg_quality_1 = require("./jpeg-quality");
|
|
66
65
|
const log_level_1 = require("./log-level");
|
|
@@ -71,6 +70,7 @@ const gl_1 = require("./options/gl");
|
|
|
71
70
|
const parse_browser_error_stack_1 = require("./parse-browser-error-stack");
|
|
72
71
|
const perf = __importStar(require("./perf"));
|
|
73
72
|
const pixel_format_1 = require("./pixel-format");
|
|
73
|
+
const port_config_1 = require("./port-config");
|
|
74
74
|
const prepare_server_1 = require("./prepare-server");
|
|
75
75
|
const render_frames_1 = require("./render-frames");
|
|
76
76
|
const render_media_1 = require("./render-media");
|
|
@@ -193,9 +193,9 @@ exports.RenderInternals = {
|
|
|
193
193
|
internalRenderMedia: render_media_1.internalRenderMedia,
|
|
194
194
|
validOpenGlRenderers: gl_1.validOpenGlRenderers,
|
|
195
195
|
copyImageToClipboard: copy_to_clipboard_1.copyImageToClipboard,
|
|
196
|
-
isIpV6Supported:
|
|
196
|
+
isIpV6Supported: port_config_1.isIpV6Supported,
|
|
197
197
|
getChromiumGpuInformation: test_gpu_1.getChromiumGpuInformation,
|
|
198
|
-
getPortConfig:
|
|
198
|
+
getPortConfig: port_config_1.getPortConfig,
|
|
199
199
|
};
|
|
200
200
|
// Warn of potential performance issues with Apple Silicon (M1 chip under Rosetta)
|
|
201
201
|
(0, check_apple_silicon_1.checkNodeVersionAndWarnAboutRosetta)();
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.enableLambdaInsights = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
exports.enableLambdaInsights = {
|
|
6
|
+
name: 'Enable Lambda Insights',
|
|
7
|
+
cliFlag: 'enable-lambda-insights',
|
|
8
|
+
description: () => ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["Enable", ' ', (0, jsx_runtime_1.jsx)("a", { href: "https://remotion.dev/docs/lambda/insights", children: "Lambda Insights in AWS CloudWatch" }), ". For this to work, you may have to update your role permission."] })),
|
|
9
|
+
ssrName: 'enableLambdaInsights',
|
|
10
|
+
docLink: 'https://www.remotion.dev/docs/lambda/insights',
|
|
11
|
+
type: false,
|
|
12
|
+
};
|
package/dist/options/index.d.ts
CHANGED
|
@@ -120,4 +120,12 @@ export declare const allOptions: {
|
|
|
120
120
|
ssrName: string;
|
|
121
121
|
description: () => JSX.Element;
|
|
122
122
|
};
|
|
123
|
+
enableLambdaInsights: {
|
|
124
|
+
name: string;
|
|
125
|
+
cliFlag: string;
|
|
126
|
+
description: () => JSX.Element;
|
|
127
|
+
ssrName: string;
|
|
128
|
+
docLink: string;
|
|
129
|
+
type: boolean;
|
|
130
|
+
};
|
|
123
131
|
};
|
package/dist/options/index.js
CHANGED
|
@@ -5,6 +5,7 @@ const audio_bitrate_1 = require("./audio-bitrate");
|
|
|
5
5
|
const color_space_1 = require("./color-space");
|
|
6
6
|
const crf_1 = require("./crf");
|
|
7
7
|
const delete_after_1 = require("./delete-after");
|
|
8
|
+
const enable_lambda_insights_1 = require("./enable-lambda-insights");
|
|
8
9
|
const enable_multiprocess_on_linux_1 = require("./enable-multiprocess-on-linux");
|
|
9
10
|
const enforce_audio_1 = require("./enforce-audio");
|
|
10
11
|
const folder_expiry_1 = require("./folder-expiry");
|
|
@@ -32,4 +33,5 @@ exports.allOptions = {
|
|
|
32
33
|
folderExpiryOption: folder_expiry_1.folderExpiryOption,
|
|
33
34
|
enableMultiprocessOnLinuxOption: enable_multiprocess_on_linux_1.enableMultiprocessOnLinuxOption,
|
|
34
35
|
glOption: gl_1.glOption,
|
|
36
|
+
enableLambdaInsights: enable_lambda_insights_1.enableLambdaInsights,
|
|
35
37
|
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
/// <reference types="node" />
|
|
3
|
+
/// <reference types="node" />
|
|
4
|
+
/// <reference types="node" />
|
|
5
|
+
import type { NetworkInterfaceInfo } from 'os';
|
|
6
|
+
import os from 'os';
|
|
7
|
+
type PortConfig = {
|
|
8
|
+
host: string;
|
|
9
|
+
hostsToTry: string[];
|
|
10
|
+
};
|
|
11
|
+
export declare const getPortConfig: () => PortConfig;
|
|
12
|
+
export declare const getHostToBind: (flattened: os.NetworkInterfaceInfo[]) => "::" | "0.0.0.0";
|
|
13
|
+
export declare const getHostsToTry: (flattened: os.NetworkInterfaceInfo[]) => string[];
|
|
14
|
+
export declare const flattenNetworkInterfaces: (networkInterfaces: NodeJS.Dict<NetworkInterfaceInfo[]>) => NetworkInterfaceInfo[];
|
|
15
|
+
export declare const isIpV6Supported: (flattened: os.NetworkInterfaceInfo[]) => boolean;
|
|
16
|
+
export declare const hasIPv6LoopbackAddress: (flattened: os.NetworkInterfaceInfo[]) => boolean;
|
|
17
|
+
export declare const hasIpv4LoopbackAddress: (flattened: os.NetworkInterfaceInfo[]) => boolean;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.hasIpv4LoopbackAddress = exports.hasIPv6LoopbackAddress = exports.isIpV6Supported = exports.flattenNetworkInterfaces = exports.getHostsToTry = exports.getHostToBind = exports.getPortConfig = void 0;
|
|
7
|
+
const os_1 = __importDefault(require("os"));
|
|
8
|
+
const truthy_1 = require("./truthy");
|
|
9
|
+
let cached = null;
|
|
10
|
+
const getPortConfig = () => {
|
|
11
|
+
if (cached) {
|
|
12
|
+
return cached;
|
|
13
|
+
}
|
|
14
|
+
const networkInterfaces = os_1.default.networkInterfaces();
|
|
15
|
+
const flattened = (0, exports.flattenNetworkInterfaces)(networkInterfaces);
|
|
16
|
+
const host = (0, exports.getHostToBind)(flattened);
|
|
17
|
+
const hostsToTry = (0, exports.getHostsToTry)(flattened);
|
|
18
|
+
const response = { host, hostsToTry };
|
|
19
|
+
cached = response;
|
|
20
|
+
return response;
|
|
21
|
+
};
|
|
22
|
+
exports.getPortConfig = getPortConfig;
|
|
23
|
+
const getHostToBind = (flattened) => {
|
|
24
|
+
return (0, exports.isIpV6Supported)(flattened) ? '::' : '0.0.0.0';
|
|
25
|
+
};
|
|
26
|
+
exports.getHostToBind = getHostToBind;
|
|
27
|
+
const getHostsToTry = (flattened) => {
|
|
28
|
+
return [
|
|
29
|
+
(0, exports.hasIPv6LoopbackAddress)(flattened) ? '::1' : null,
|
|
30
|
+
(0, exports.hasIpv4LoopbackAddress)(flattened) ? '127.0.0.1' : null,
|
|
31
|
+
(0, exports.isIpV6Supported)(flattened) ? '::' : null,
|
|
32
|
+
'0.0.0.0',
|
|
33
|
+
].filter(truthy_1.truthy);
|
|
34
|
+
};
|
|
35
|
+
exports.getHostsToTry = getHostsToTry;
|
|
36
|
+
const flattenNetworkInterfaces = (networkInterfaces) => {
|
|
37
|
+
const result = [];
|
|
38
|
+
for (const iface in networkInterfaces) {
|
|
39
|
+
for (const configuration of networkInterfaces[iface]) {
|
|
40
|
+
result.push(configuration);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
return result;
|
|
44
|
+
};
|
|
45
|
+
exports.flattenNetworkInterfaces = flattenNetworkInterfaces;
|
|
46
|
+
const isIpV6Supported = (flattened) => {
|
|
47
|
+
for (const configuration of flattened) {
|
|
48
|
+
if (configuration.family === 'IPv6' && !configuration.internal) {
|
|
49
|
+
return true;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
return false;
|
|
53
|
+
};
|
|
54
|
+
exports.isIpV6Supported = isIpV6Supported;
|
|
55
|
+
const hasIPv6LoopbackAddress = (flattened) => {
|
|
56
|
+
for (const configuration of flattened) {
|
|
57
|
+
if (configuration.family === 'IPv6' &&
|
|
58
|
+
configuration.internal &&
|
|
59
|
+
configuration.address === '::1') {
|
|
60
|
+
return true;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
return false;
|
|
64
|
+
};
|
|
65
|
+
exports.hasIPv6LoopbackAddress = hasIPv6LoopbackAddress;
|
|
66
|
+
const hasIpv4LoopbackAddress = (flattened) => {
|
|
67
|
+
for (const configuration of flattened) {
|
|
68
|
+
if (configuration.family === 'IPv4' &&
|
|
69
|
+
configuration.internal &&
|
|
70
|
+
configuration.address === '127.0.0.1') {
|
|
71
|
+
return true;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
return false;
|
|
75
|
+
};
|
|
76
|
+
exports.hasIpv4LoopbackAddress = hasIpv4LoopbackAddress;
|
package/dist/seek-to-frame.js
CHANGED
|
@@ -5,21 +5,55 @@ const symbolicateable_error_1 = require("./error-handling/symbolicateable-error"
|
|
|
5
5
|
const logger_1 = require("./logger");
|
|
6
6
|
const parse_browser_error_stack_1 = require("./parse-browser-error-stack");
|
|
7
7
|
const puppeteer_evaluate_1 = require("./puppeteer-evaluate");
|
|
8
|
+
const cancelledToken = 'cancelled';
|
|
9
|
+
const readyToken = 'ready';
|
|
8
10
|
const waitForReady = ({ page, timeoutInMilliseconds, frame, indent, logLevel, }) => {
|
|
11
|
+
const cleanups = [];
|
|
12
|
+
const retrieveErrorAndReject = () => {
|
|
13
|
+
return new Promise((_, reject) => {
|
|
14
|
+
(0, puppeteer_evaluate_1.puppeteerEvaluateWithCatch)({
|
|
15
|
+
pageFunction: () => window.remotion_cancelledError,
|
|
16
|
+
args: [],
|
|
17
|
+
frame: null,
|
|
18
|
+
page,
|
|
19
|
+
}).then(({ value: val }) => {
|
|
20
|
+
if (typeof val !== 'string') {
|
|
21
|
+
reject(val);
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
reject(new symbolicateable_error_1.SymbolicateableError({
|
|
25
|
+
frame: null,
|
|
26
|
+
stack: val,
|
|
27
|
+
name: 'CancelledError',
|
|
28
|
+
message: val.split('\n')[0],
|
|
29
|
+
stackFrame: (0, parse_browser_error_stack_1.parseStack)(val.split('\n')),
|
|
30
|
+
}));
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
};
|
|
9
34
|
const waitForReadyProm = new Promise((resolve, reject) => {
|
|
10
|
-
page
|
|
11
|
-
.mainFrame()
|
|
12
|
-
._mainWorld.waitForFunction({
|
|
35
|
+
const waitTask = page.mainFrame()._mainWorld.waitForFunction({
|
|
13
36
|
browser: page.browser,
|
|
14
37
|
// Increase timeout so the delayRender() timeout fires earlier
|
|
15
38
|
timeout: timeoutInMilliseconds + 3000,
|
|
16
|
-
pageFunction:
|
|
39
|
+
pageFunction: `window.remotion_renderReady === true ? "${readyToken}" : window.remotion_cancelledError !== undefined ? "${cancelledToken}" : false`,
|
|
17
40
|
title: frame === null
|
|
18
41
|
? 'the page to render the React component'
|
|
19
42
|
: `the page to render the React component at frame ${frame}`,
|
|
20
|
-
})
|
|
43
|
+
});
|
|
44
|
+
cleanups.push(() => {
|
|
45
|
+
waitTask.terminate(new Error('cleanup'));
|
|
46
|
+
});
|
|
47
|
+
waitTask.promise
|
|
21
48
|
.then((a) => {
|
|
22
|
-
|
|
49
|
+
const token = a.toString();
|
|
50
|
+
if (token === cancelledToken) {
|
|
51
|
+
return retrieveErrorAndReject();
|
|
52
|
+
}
|
|
53
|
+
if (token === readyToken) {
|
|
54
|
+
return resolve(a);
|
|
55
|
+
}
|
|
56
|
+
reject(new Error('Unexpected token ' + token));
|
|
23
57
|
})
|
|
24
58
|
.catch((err) => {
|
|
25
59
|
if (err.message.includes('timeout') &&
|
|
@@ -54,46 +88,6 @@ const waitForReady = ({ page, timeoutInMilliseconds, frame, indent, logLevel, })
|
|
|
54
88
|
}
|
|
55
89
|
});
|
|
56
90
|
});
|
|
57
|
-
const waitForErrorProm = new Promise((_shouldNeverResolve, reject) => {
|
|
58
|
-
page
|
|
59
|
-
.mainFrame()
|
|
60
|
-
._mainWorld.waitForFunction({
|
|
61
|
-
browser: page.browser,
|
|
62
|
-
timeout: null,
|
|
63
|
-
pageFunction: 'window.remotion_cancelledError !== undefined',
|
|
64
|
-
title: 'remotion_cancelledError variable to appear on the page',
|
|
65
|
-
})
|
|
66
|
-
.then(() => {
|
|
67
|
-
return (0, puppeteer_evaluate_1.puppeteerEvaluateWithCatch)({
|
|
68
|
-
pageFunction: () => window.remotion_cancelledError,
|
|
69
|
-
args: [],
|
|
70
|
-
frame: null,
|
|
71
|
-
page,
|
|
72
|
-
});
|
|
73
|
-
})
|
|
74
|
-
.then(({ value: val }) => {
|
|
75
|
-
if (typeof val !== 'string') {
|
|
76
|
-
reject(val);
|
|
77
|
-
return;
|
|
78
|
-
}
|
|
79
|
-
reject(new symbolicateable_error_1.SymbolicateableError({
|
|
80
|
-
frame: null,
|
|
81
|
-
stack: val,
|
|
82
|
-
name: 'CancelledError',
|
|
83
|
-
message: val.split('\n')[0],
|
|
84
|
-
stackFrame: (0, parse_browser_error_stack_1.parseStack)(val.split('\n')),
|
|
85
|
-
}));
|
|
86
|
-
})
|
|
87
|
-
.catch((err) => {
|
|
88
|
-
if (err.message.includes('timeout') &&
|
|
89
|
-
err.message.includes('exceeded')) {
|
|
90
|
-
// Don't care if a error never appeared
|
|
91
|
-
}
|
|
92
|
-
else {
|
|
93
|
-
reject(err);
|
|
94
|
-
}
|
|
95
|
-
});
|
|
96
|
-
});
|
|
97
91
|
return Promise.race([
|
|
98
92
|
new Promise((_, reject) => {
|
|
99
93
|
page.on("disposed" /* PageEmittedEvents.Disposed */, () => {
|
|
@@ -106,8 +100,11 @@ const waitForReady = ({ page, timeoutInMilliseconds, frame, indent, logLevel, })
|
|
|
106
100
|
});
|
|
107
101
|
}),
|
|
108
102
|
waitForReadyProm,
|
|
109
|
-
|
|
110
|
-
|
|
103
|
+
]).finally(() => {
|
|
104
|
+
cleanups.forEach((cleanup) => {
|
|
105
|
+
cleanup();
|
|
106
|
+
});
|
|
107
|
+
});
|
|
111
108
|
};
|
|
112
109
|
exports.waitForReady = waitForReady;
|
|
113
110
|
const seekToFrame = async ({ frame, page, composition, timeoutInMilliseconds, logLevel, indent, }) => {
|
package/dist/serve-static.js
CHANGED
|
@@ -7,6 +7,7 @@ exports.serveStatic = void 0;
|
|
|
7
7
|
const node_http_1 = __importDefault(require("node:http"));
|
|
8
8
|
const get_port_1 = require("./get-port");
|
|
9
9
|
const offthread_video_server_1 = require("./offthread-video-server");
|
|
10
|
+
const port_config_1 = require("./port-config");
|
|
10
11
|
const serve_handler_1 = require("./serve-handler");
|
|
11
12
|
const serveStatic = async (path, options) => {
|
|
12
13
|
const { listener: offthreadRequest, close: closeCompositor, compositor, } = (0, offthread_video_server_1.startOffthreadVideoServer)({
|
|
@@ -45,7 +46,7 @@ const serveStatic = async (path, options) => {
|
|
|
45
46
|
});
|
|
46
47
|
let selectedPort = null;
|
|
47
48
|
const maxTries = 5;
|
|
48
|
-
const portConfig = (0,
|
|
49
|
+
const portConfig = (0, port_config_1.getPortConfig)();
|
|
49
50
|
for (let i = 0; i < maxTries; i++) {
|
|
50
51
|
try {
|
|
51
52
|
selectedPort = await new Promise((resolve, reject) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remotion/renderer",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.61",
|
|
4
4
|
"description": "Renderer for Remotion",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"extract-zip": "2.0.1",
|
|
19
19
|
"source-map": "^0.8.0-beta.0",
|
|
20
20
|
"ws": "8.7.0",
|
|
21
|
-
"remotion": "4.0.
|
|
21
|
+
"remotion": "4.0.61"
|
|
22
22
|
},
|
|
23
23
|
"peerDependencies": {
|
|
24
24
|
"react": ">=16.8.0",
|
|
@@ -40,13 +40,13 @@
|
|
|
40
40
|
"vitest": "0.31.1"
|
|
41
41
|
},
|
|
42
42
|
"optionalDependencies": {
|
|
43
|
-
"@remotion/compositor-
|
|
44
|
-
"@remotion/compositor-darwin-x64": "4.0.
|
|
45
|
-
"@remotion/compositor-
|
|
46
|
-
"@remotion/compositor-linux-x64-gnu": "4.0.
|
|
47
|
-
"@remotion/compositor-
|
|
48
|
-
"@remotion/compositor-linux-arm64-
|
|
49
|
-
"@remotion/compositor-
|
|
43
|
+
"@remotion/compositor-darwin-arm64": "4.0.61",
|
|
44
|
+
"@remotion/compositor-darwin-x64": "4.0.61",
|
|
45
|
+
"@remotion/compositor-linux-arm64-musl": "4.0.61",
|
|
46
|
+
"@remotion/compositor-linux-x64-gnu": "4.0.61",
|
|
47
|
+
"@remotion/compositor-linux-x64-musl": "4.0.61",
|
|
48
|
+
"@remotion/compositor-linux-arm64-gnu": "4.0.61",
|
|
49
|
+
"@remotion/compositor-win32-x64-msvc": "4.0.61"
|
|
50
50
|
},
|
|
51
51
|
"keywords": [
|
|
52
52
|
"remotion",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const isIpV6Supported: () => boolean;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.isIpV6Supported = void 0;
|
|
7
|
-
const os_1 = __importDefault(require("os"));
|
|
8
|
-
let cache = null;
|
|
9
|
-
const calculate = () => {
|
|
10
|
-
const interfaces = os_1.default.networkInterfaces();
|
|
11
|
-
for (const iface in interfaces) {
|
|
12
|
-
for (const configuration of interfaces[iface]) {
|
|
13
|
-
if (configuration.family === 'IPv6' && !configuration.internal) {
|
|
14
|
-
return true;
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
return false;
|
|
19
|
-
};
|
|
20
|
-
const isIpV6Supported = () => {
|
|
21
|
-
if (cache === null) {
|
|
22
|
-
cache = calculate();
|
|
23
|
-
}
|
|
24
|
-
return cache;
|
|
25
|
-
};
|
|
26
|
-
exports.isIpV6Supported = isIpV6Supported;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export declare const validOpenGlRenderers: readonly ["swangle", "angle", "egl", "swiftshader", "vulkan"];
|
|
2
|
-
export type OpenGlRenderer = (typeof validOpenGlRenderers)[number];
|
|
3
|
-
export declare const DEFAULT_OPENGL_RENDERER: OpenGlRenderer | null;
|
|
4
|
-
export declare const validateOpenGlRenderer: (option: OpenGlRenderer | null) => OpenGlRenderer | null;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.validateOpenGlRenderer = exports.DEFAULT_OPENGL_RENDERER = exports.validOpenGlRenderers = void 0;
|
|
4
|
-
exports.validOpenGlRenderers = [
|
|
5
|
-
'swangle',
|
|
6
|
-
'angle',
|
|
7
|
-
'egl',
|
|
8
|
-
'swiftshader',
|
|
9
|
-
'vulkan',
|
|
10
|
-
];
|
|
11
|
-
exports.DEFAULT_OPENGL_RENDERER = null;
|
|
12
|
-
const validateOpenGlRenderer = (option) => {
|
|
13
|
-
if (option === null) {
|
|
14
|
-
return null;
|
|
15
|
-
}
|
|
16
|
-
if (!exports.validOpenGlRenderers.includes(option)) {
|
|
17
|
-
throw new TypeError(`${option} is not a valid GL backend. Accepted values: ${exports.validOpenGlRenderers.join(', ')}`);
|
|
18
|
-
}
|
|
19
|
-
return option;
|
|
20
|
-
};
|
|
21
|
-
exports.validateOpenGlRenderer = validateOpenGlRenderer;
|