@remotion/renderer 4.0.38 → 4.0.40
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/DOMWorld.d.ts +1 -3
- package/dist/browser/DOMWorld.js +3 -9
- package/dist/browser/NetworkManager.js +3 -1
- package/dist/get-silent-parts.d.ts +1 -1
- package/dist/index.d.ts +15 -15
- package/dist/logger.d.ts +1 -1
- package/dist/options/render-expiry-days.d.ts +8 -0
- package/dist/options/render-expiry-days.js +14 -0
- package/dist/presets-profile.d.ts +7 -0
- package/dist/presets-profile.js +27 -0
- package/dist/puppeteer-evaluate.d.ts +1 -1
- package/dist/puppeteer-evaluate.js +10 -35
- package/dist/seek-to-frame.js +1 -3
- package/package.json +9 -9
|
@@ -29,12 +29,11 @@ export declare class DOMWorld {
|
|
|
29
29
|
executionContext(): Promise<ExecutionContext>;
|
|
30
30
|
evaluateHandle<HandlerType extends JSHandle = JSHandle>(pageFunction: EvaluateHandleFn, ...args: SerializableOrJSHandle[]): Promise<HandlerType>;
|
|
31
31
|
evaluate<T extends EvaluateFn>(pageFunction: T, ...args: SerializableOrJSHandle[]): Promise<UnwrapPromiseLike<EvaluateFnReturnType<T>>>;
|
|
32
|
-
waitForFunction({ browser, timeout, pageFunction, title,
|
|
32
|
+
waitForFunction({ browser, timeout, pageFunction, title, }: {
|
|
33
33
|
browser: HeadlessBrowser;
|
|
34
34
|
timeout: number | null;
|
|
35
35
|
pageFunction: Function | string;
|
|
36
36
|
title: string;
|
|
37
|
-
shouldClosePage: boolean;
|
|
38
37
|
}): Promise<JSHandle>;
|
|
39
38
|
title(): Promise<string>;
|
|
40
39
|
}
|
|
@@ -45,7 +44,6 @@ interface WaitTaskOptions {
|
|
|
45
44
|
timeout: number | null;
|
|
46
45
|
browser: HeadlessBrowser;
|
|
47
46
|
args: SerializableOrJSHandle[];
|
|
48
|
-
shouldClosePage: boolean;
|
|
49
47
|
}
|
|
50
48
|
declare class WaitTask {
|
|
51
49
|
#private;
|
package/dist/browser/DOMWorld.js
CHANGED
|
@@ -25,7 +25,7 @@ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (
|
|
|
25
25
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
26
26
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
27
27
|
};
|
|
28
|
-
var _DOMWorld_frame, _DOMWorld_contextPromise, _DOMWorld_contextResolveCallback, _DOMWorld_detached, _DOMWorld_waitTasks, _WaitTask_instances, _WaitTask_domWorld, _WaitTask_timeout, _WaitTask_predicateBody, _WaitTask_args, _WaitTask_runCount, _WaitTask_resolve, _WaitTask_reject, _WaitTask_timeoutTimer, _WaitTask_terminated, _WaitTask_browser,
|
|
28
|
+
var _DOMWorld_frame, _DOMWorld_contextPromise, _DOMWorld_contextResolveCallback, _DOMWorld_detached, _DOMWorld_waitTasks, _WaitTask_instances, _WaitTask_domWorld, _WaitTask_timeout, _WaitTask_predicateBody, _WaitTask_args, _WaitTask_runCount, _WaitTask_resolve, _WaitTask_reject, _WaitTask_timeoutTimer, _WaitTask_terminated, _WaitTask_browser, _WaitTask_cleanup;
|
|
29
29
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
30
|
exports.DOMWorld = void 0;
|
|
31
31
|
const assert_1 = require("./assert");
|
|
@@ -91,7 +91,7 @@ class DOMWorld {
|
|
|
91
91
|
const context = await this.executionContext();
|
|
92
92
|
return context.evaluate(pageFunction, ...args);
|
|
93
93
|
}
|
|
94
|
-
waitForFunction({ browser, timeout, pageFunction, title,
|
|
94
|
+
waitForFunction({ browser, timeout, pageFunction, title, }) {
|
|
95
95
|
return new WaitTask({
|
|
96
96
|
domWorld: this,
|
|
97
97
|
predicateBody: pageFunction,
|
|
@@ -99,7 +99,6 @@ class DOMWorld {
|
|
|
99
99
|
timeout,
|
|
100
100
|
args: [],
|
|
101
101
|
browser,
|
|
102
|
-
shouldClosePage,
|
|
103
102
|
}).promise;
|
|
104
103
|
}
|
|
105
104
|
title() {
|
|
@@ -124,7 +123,6 @@ class WaitTask {
|
|
|
124
123
|
_WaitTask_timeoutTimer.set(this, void 0);
|
|
125
124
|
_WaitTask_terminated.set(this, false);
|
|
126
125
|
_WaitTask_browser.set(this, void 0);
|
|
127
|
-
_WaitTask_shouldClosePage.set(this, void 0);
|
|
128
126
|
this.onBrowserClose = () => {
|
|
129
127
|
return this.terminate(new Error('Browser was closed'));
|
|
130
128
|
};
|
|
@@ -142,7 +140,6 @@ class WaitTask {
|
|
|
142
140
|
__classPrivateFieldSet(this, _WaitTask_predicateBody, getPredicateBody(options.predicateBody), "f");
|
|
143
141
|
__classPrivateFieldSet(this, _WaitTask_args, options.args, "f");
|
|
144
142
|
__classPrivateFieldSet(this, _WaitTask_runCount, 0, "f");
|
|
145
|
-
__classPrivateFieldSet(this, _WaitTask_shouldClosePage, options.shouldClosePage, "f");
|
|
146
143
|
__classPrivateFieldGet(this, _WaitTask_domWorld, "f")._waitTasks.add(this);
|
|
147
144
|
this.promise = new Promise((resolve, reject) => {
|
|
148
145
|
__classPrivateFieldSet(this, _WaitTask_resolve, resolve, "f");
|
|
@@ -153,9 +150,6 @@ class WaitTask {
|
|
|
153
150
|
if (options.timeout) {
|
|
154
151
|
const timeoutError = new Errors_1.TimeoutError(`waiting for ${options.title} failed: timeout ${options.timeout}ms exceeded`);
|
|
155
152
|
__classPrivateFieldSet(this, _WaitTask_timeoutTimer, setTimeout(() => {
|
|
156
|
-
if (__classPrivateFieldGet(this, _WaitTask_shouldClosePage, "f")) {
|
|
157
|
-
return this.terminate(timeoutError);
|
|
158
|
-
}
|
|
159
153
|
return __classPrivateFieldGet(this, _WaitTask_reject, "f").call(this, timeoutError);
|
|
160
154
|
}, options.timeout), "f");
|
|
161
155
|
}
|
|
@@ -244,7 +238,7 @@ class WaitTask {
|
|
|
244
238
|
__classPrivateFieldGet(this, _WaitTask_instances, "m", _WaitTask_cleanup).call(this);
|
|
245
239
|
}
|
|
246
240
|
}
|
|
247
|
-
_WaitTask_domWorld = new WeakMap(), _WaitTask_timeout = new WeakMap(), _WaitTask_predicateBody = new WeakMap(), _WaitTask_args = new WeakMap(), _WaitTask_runCount = new WeakMap(), _WaitTask_resolve = new WeakMap(), _WaitTask_reject = new WeakMap(), _WaitTask_timeoutTimer = new WeakMap(), _WaitTask_terminated = new WeakMap(), _WaitTask_browser = new WeakMap(),
|
|
241
|
+
_WaitTask_domWorld = new WeakMap(), _WaitTask_timeout = new WeakMap(), _WaitTask_predicateBody = new WeakMap(), _WaitTask_args = new WeakMap(), _WaitTask_runCount = new WeakMap(), _WaitTask_resolve = new WeakMap(), _WaitTask_reject = new WeakMap(), _WaitTask_timeoutTimer = new WeakMap(), _WaitTask_terminated = new WeakMap(), _WaitTask_browser = new WeakMap(), _WaitTask_instances = new WeakSet(), _WaitTask_cleanup = function _WaitTask_cleanup() {
|
|
248
242
|
if (__classPrivateFieldGet(this, _WaitTask_timeoutTimer, "f") !== undefined) {
|
|
249
243
|
clearTimeout(__classPrivateFieldGet(this, _WaitTask_timeoutTimer, "f"));
|
|
250
244
|
}
|
|
@@ -228,6 +228,8 @@ _NetworkManager_client = new WeakMap(), _NetworkManager_frameManager = new WeakM
|
|
|
228
228
|
if (!request) {
|
|
229
229
|
return;
|
|
230
230
|
}
|
|
231
|
-
|
|
231
|
+
if (!event.canceled) {
|
|
232
|
+
logger_1.Log.warn(`Browser failed to load ${request._url}: ${event.errorText}`);
|
|
233
|
+
}
|
|
232
234
|
__classPrivateFieldGet(this, _NetworkManager_instances, "m", _NetworkManager_forgetRequest).call(this, request, true);
|
|
233
235
|
};
|
|
@@ -3,6 +3,6 @@ import type { LogLevel } from './log-level';
|
|
|
3
3
|
export declare const getSilentParts: ({ src, noiseThresholdInDecibels: passedNoiseThresholdInDecibels, minDurationInSeconds: passedMinDuration, logLevel, }: {
|
|
4
4
|
src: string;
|
|
5
5
|
minDurationInSeconds?: number | undefined;
|
|
6
|
-
logLevel?: "
|
|
6
|
+
logLevel?: "error" | "verbose" | "info" | "warn" | undefined;
|
|
7
7
|
noiseThresholdInDecibels?: number | undefined;
|
|
8
8
|
}) => Promise<GetSilentPartsResponse>;
|
package/dist/index.d.ts
CHANGED
|
@@ -48,7 +48,7 @@ export declare const RenderInternals: {
|
|
|
48
48
|
downloadMap: import("./assets/download-map").DownloadMap;
|
|
49
49
|
remotionRoot: string;
|
|
50
50
|
concurrency: number;
|
|
51
|
-
logLevel: "
|
|
51
|
+
logLevel: "error" | "verbose" | "info" | "warn";
|
|
52
52
|
indent: boolean;
|
|
53
53
|
offthreadVideoCacheSizeInBytes: number | null;
|
|
54
54
|
}) => Promise<{
|
|
@@ -132,7 +132,7 @@ export declare const RenderInternals: {
|
|
|
132
132
|
DEFAULT_CODEC: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif";
|
|
133
133
|
isAudioCodec: (codec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif" | undefined) => boolean;
|
|
134
134
|
logLevels: readonly ["verbose", "info", "warn", "error"];
|
|
135
|
-
isEqualOrBelowLogLevel: (currentLevel: "
|
|
135
|
+
isEqualOrBelowLogLevel: (currentLevel: "error" | "verbose" | "info" | "warn", level: "error" | "verbose" | "info" | "warn") => boolean;
|
|
136
136
|
isValidLogLevel: (level: string) => boolean;
|
|
137
137
|
perf: typeof perf;
|
|
138
138
|
convertToPositiveFrameIndex: ({ frame, durationInFrames, }: {
|
|
@@ -369,30 +369,30 @@ export declare const RenderInternals: {
|
|
|
369
369
|
verbose: (message?: any, ...optionalParams: any[]) => void;
|
|
370
370
|
verboseAdvanced: (options: {
|
|
371
371
|
indent: boolean;
|
|
372
|
-
logLevel: "
|
|
372
|
+
logLevel: "error" | "verbose" | "info" | "warn";
|
|
373
373
|
} & {
|
|
374
374
|
tag?: string | undefined;
|
|
375
375
|
}, message?: any, ...optionalParams: any[]) => void;
|
|
376
376
|
info: (message?: any, ...optionalParams: any[]) => void;
|
|
377
377
|
infoAdvanced: (options: {
|
|
378
378
|
indent: boolean;
|
|
379
|
-
logLevel: "
|
|
379
|
+
logLevel: "error" | "verbose" | "info" | "warn";
|
|
380
380
|
}, message?: any, ...optionalParams: any[]) => void;
|
|
381
381
|
warn: (message?: any, ...optionalParams: any[]) => void;
|
|
382
382
|
warnAdvanced: (options: {
|
|
383
383
|
indent: boolean;
|
|
384
|
-
logLevel: "
|
|
384
|
+
logLevel: "error" | "verbose" | "info" | "warn";
|
|
385
385
|
}, message?: any, ...optionalParams: any[]) => void;
|
|
386
386
|
error: (message?: any, ...optionalParams: any[]) => void;
|
|
387
387
|
errorAdvanced: (options: {
|
|
388
388
|
indent: boolean;
|
|
389
|
-
logLevel: "
|
|
389
|
+
logLevel: "error" | "verbose" | "info" | "warn";
|
|
390
390
|
} & {
|
|
391
391
|
tag?: string | undefined;
|
|
392
392
|
}, message?: any, ...optionalParams: any[]) => void;
|
|
393
393
|
};
|
|
394
|
-
getLogLevel: () => "
|
|
395
|
-
setLogLevel: (newLogLevel: "
|
|
394
|
+
getLogLevel: () => "error" | "verbose" | "info" | "warn";
|
|
395
|
+
setLogLevel: (newLogLevel: "error" | "verbose" | "info" | "warn") => void;
|
|
396
396
|
INDENT_TOKEN: string;
|
|
397
397
|
isColorSupported: () => boolean;
|
|
398
398
|
HeadlessBrowser: typeof HeadlessBrowser;
|
|
@@ -401,7 +401,7 @@ export declare const RenderInternals: {
|
|
|
401
401
|
port: number | null;
|
|
402
402
|
remotionRoot: string;
|
|
403
403
|
concurrency: number;
|
|
404
|
-
logLevel: "
|
|
404
|
+
logLevel: "error" | "verbose" | "info" | "warn";
|
|
405
405
|
indent: boolean;
|
|
406
406
|
offthreadVideoCacheSizeInBytes: number | null;
|
|
407
407
|
}) => Promise<import("./prepare-server").RemotionServer>;
|
|
@@ -410,7 +410,7 @@ export declare const RenderInternals: {
|
|
|
410
410
|
port: number | null;
|
|
411
411
|
remotionRoot: string;
|
|
412
412
|
concurrency: number;
|
|
413
|
-
logLevel: "
|
|
413
|
+
logLevel: "error" | "verbose" | "info" | "warn";
|
|
414
414
|
indent: boolean;
|
|
415
415
|
offthreadVideoCacheSizeInBytes: number | null;
|
|
416
416
|
}, { onDownload, onError, }: {
|
|
@@ -440,7 +440,7 @@ export declare const RenderInternals: {
|
|
|
440
440
|
cancelSignal: import("./make-cancel-signal").CancelSignal | null;
|
|
441
441
|
indent: boolean;
|
|
442
442
|
server: import("./prepare-server").RemotionServer | undefined;
|
|
443
|
-
logLevel: "
|
|
443
|
+
logLevel: "error" | "verbose" | "info" | "warn";
|
|
444
444
|
serveUrl: string;
|
|
445
445
|
port: number | null;
|
|
446
446
|
offthreadVideoCacheSizeInBytes: number | null;
|
|
@@ -461,7 +461,7 @@ export declare const RenderInternals: {
|
|
|
461
461
|
viewport: import("./browser/PuppeteerViewport").Viewport | null;
|
|
462
462
|
indent: boolean;
|
|
463
463
|
browser: "chrome";
|
|
464
|
-
logLevel: "
|
|
464
|
+
logLevel: "error" | "verbose" | "info" | "warn";
|
|
465
465
|
}) => Promise<HeadlessBrowser>;
|
|
466
466
|
internalSelectComposition: (options: {
|
|
467
467
|
serializedInputPropsWithCustomSchema: string;
|
|
@@ -474,7 +474,7 @@ export declare const RenderInternals: {
|
|
|
474
474
|
port: number | null;
|
|
475
475
|
indent: boolean;
|
|
476
476
|
server: import("./prepare-server").RemotionServer | undefined;
|
|
477
|
-
logLevel: "
|
|
477
|
+
logLevel: "error" | "verbose" | "info" | "warn";
|
|
478
478
|
serveUrl: string;
|
|
479
479
|
id: string;
|
|
480
480
|
} & import("./options/option").ToOptions<readonly [{
|
|
@@ -499,7 +499,7 @@ export declare const RenderInternals: {
|
|
|
499
499
|
port: number | null;
|
|
500
500
|
server: import("./prepare-server").RemotionServer | undefined;
|
|
501
501
|
indent: boolean;
|
|
502
|
-
logLevel: "
|
|
502
|
+
logLevel: "error" | "verbose" | "info" | "warn";
|
|
503
503
|
serveUrlOrWebpackUrl: string;
|
|
504
504
|
} & import("./options/option").ToOptions<readonly [{
|
|
505
505
|
name: string;
|
|
@@ -515,5 +515,5 @@ export declare const RenderInternals: {
|
|
|
515
515
|
slowestFrames: import("./render-media").SlowFrame[];
|
|
516
516
|
}>;
|
|
517
517
|
validOpenGlRenderers: readonly ["swangle", "angle", "egl", "swiftshader"];
|
|
518
|
-
copyImageToClipboard: (src: string, logLevel: "
|
|
518
|
+
copyImageToClipboard: (src: string, logLevel: "error" | "verbose" | "info" | "warn") => Promise<void>;
|
|
519
519
|
};
|
package/dist/logger.d.ts
CHANGED
|
@@ -19,6 +19,6 @@ export declare const Log: {
|
|
|
19
19
|
error: (message?: any, ...optionalParams: any[]) => void;
|
|
20
20
|
errorAdvanced: (options: VerboseLogOptions, message?: any, ...optionalParams: any[]) => void;
|
|
21
21
|
};
|
|
22
|
-
export declare const getLogLevel: () => "
|
|
22
|
+
export declare const getLogLevel: () => "error" | "verbose" | "info" | "warn";
|
|
23
23
|
export declare const setLogLevel: (newLogLevel: LogLevel) => void;
|
|
24
24
|
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.deleteAfterOption = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
exports.deleteAfterOption = {
|
|
6
|
+
name: 'Render expiry days',
|
|
7
|
+
cliFlag: 'delete-after',
|
|
8
|
+
description: () => {
|
|
9
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["Automatically delete the render after a certain period. Accepted values are ", (0, jsx_runtime_1.jsx)("code", { children: "1-day" }), ", ", (0, jsx_runtime_1.jsx)("code", { children: "3-days" }), ", ", (0, jsx_runtime_1.jsx)("code", { children: "7-days" }), " and", ' ', (0, jsx_runtime_1.jsx)("code", { children: "30-days" }), ".", (0, jsx_runtime_1.jsx)("br", {}), " For this to work, your bucket needs to have", ' ', (0, jsx_runtime_1.jsx)("a", { href: "/docs/lambda/autodelete", children: "lifecycles enabled" }), "."] }));
|
|
10
|
+
},
|
|
11
|
+
ssrName: 'deleteAfter',
|
|
12
|
+
docLink: 'https://www.remotion.dev/docs/autodelete',
|
|
13
|
+
type: 0,
|
|
14
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Codec } from './codec';
|
|
2
|
+
export declare const x264PresetOptions: readonly ["ultrafast", "superfast", "veryfast", "faster", "fast", "medium", "slow", "slower", "veryslow", "placebo"];
|
|
3
|
+
export type x264Preset = typeof x264PresetOptions[number];
|
|
4
|
+
export declare const validateSelectedCodecAndPresetCombination: ({ codec, x264Preset, }: {
|
|
5
|
+
codec: Codec;
|
|
6
|
+
x264Preset: "ultrafast" | "superfast" | "veryfast" | "faster" | "fast" | "medium" | "slow" | "slower" | "veryslow" | "placebo" | undefined;
|
|
7
|
+
}) => void;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.validateSelectedCodecAndPresetCombination = exports.x264PresetOptions = void 0;
|
|
4
|
+
exports.x264PresetOptions = [
|
|
5
|
+
'ultrafast',
|
|
6
|
+
'superfast',
|
|
7
|
+
'veryfast',
|
|
8
|
+
'faster',
|
|
9
|
+
'fast',
|
|
10
|
+
'medium',
|
|
11
|
+
'slow',
|
|
12
|
+
'slower',
|
|
13
|
+
'veryslow',
|
|
14
|
+
'placebo',
|
|
15
|
+
];
|
|
16
|
+
const validateSelectedCodecAndPresetCombination = ({ codec, x264Preset, }) => {
|
|
17
|
+
if (typeof x264Preset !== 'undefined' && codec !== 'h264') {
|
|
18
|
+
throw new TypeError(`You have set a Preset profile but the codec is "${codec}". Set the codec to "h264" or remove the Preset profile.`);
|
|
19
|
+
}
|
|
20
|
+
if (x264Preset !== undefined &&
|
|
21
|
+
!exports.x264PresetOptions.includes(x264Preset)) {
|
|
22
|
+
throw new TypeError(`The Preset profile "${x264Preset}" is not valid. Valid options are ${exports.x264PresetOptions
|
|
23
|
+
.map((p) => `"${p}"`)
|
|
24
|
+
.join(', ')}`);
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
exports.validateSelectedCodecAndPresetCombination = validateSelectedCodecAndPresetCombination;
|
|
@@ -5,7 +5,6 @@ const JSHandle_1 = require("./browser/JSHandle");
|
|
|
5
5
|
const symbolicateable_error_1 = require("./error-handling/symbolicateable-error");
|
|
6
6
|
const parse_browser_error_stack_1 = require("./parse-browser-error-stack");
|
|
7
7
|
const EVALUATION_SCRIPT_URL = '__puppeteer_evaluation_script__';
|
|
8
|
-
const SOURCE_URL_REGEX = /^[\040\t]*\/\/[@#] sourceURL=\s*(\S*?)\s*$/m;
|
|
9
8
|
function valueFromRemoteObject(remoteObject) {
|
|
10
9
|
if (remoteObject.unserializableValue) {
|
|
11
10
|
if (remoteObject.type === 'bigint' && typeof BigInt !== 'undefined')
|
|
@@ -26,14 +25,14 @@ function valueFromRemoteObject(remoteObject) {
|
|
|
26
25
|
}
|
|
27
26
|
return remoteObject.value;
|
|
28
27
|
}
|
|
29
|
-
function isString(obj) {
|
|
30
|
-
return typeof obj === 'string' || obj instanceof String;
|
|
31
|
-
}
|
|
32
28
|
function puppeteerEvaluateWithCatchAndTimeout({ args, frame, page, pageFunction, }) {
|
|
33
29
|
return Promise.race([
|
|
34
30
|
new Promise((_, reject) => {
|
|
35
31
|
setTimeout(() => {
|
|
36
|
-
reject(new Error(
|
|
32
|
+
reject(new Error(
|
|
33
|
+
// This means the page is not responding anymore
|
|
34
|
+
// This error message is retryable - sync it with packages/lambda/src/shared/is-flaky-error.ts
|
|
35
|
+
`Timed out evaluating page function "${pageFunction.toString()}"`));
|
|
37
36
|
}, 5000);
|
|
38
37
|
}),
|
|
39
38
|
puppeteerEvaluateWithCatch({
|
|
@@ -46,34 +45,10 @@ function puppeteerEvaluateWithCatchAndTimeout({ args, frame, page, pageFunction,
|
|
|
46
45
|
}
|
|
47
46
|
exports.puppeteerEvaluateWithCatchAndTimeout = puppeteerEvaluateWithCatchAndTimeout;
|
|
48
47
|
async function puppeteerEvaluateWithCatch({ page, pageFunction, frame, args, }) {
|
|
49
|
-
var _a, _b, _c, _d, _e, _f
|
|
48
|
+
var _a, _b, _c, _d, _e, _f;
|
|
50
49
|
const contextId = (await page.mainFrame().executionContext())._contextId;
|
|
51
50
|
const client = page._client();
|
|
52
51
|
const suffix = `//# sourceURL=${EVALUATION_SCRIPT_URL}`;
|
|
53
|
-
if (isString(pageFunction)) {
|
|
54
|
-
const expression = pageFunction;
|
|
55
|
-
const expressionWithSourceUrl = SOURCE_URL_REGEX.test(expression)
|
|
56
|
-
? expression
|
|
57
|
-
: expression + '\n' + suffix;
|
|
58
|
-
const { value: { exceptionDetails: exceptDetails, result: remotObject }, size, } = await client.send('Runtime.evaluate', {
|
|
59
|
-
expression: expressionWithSourceUrl,
|
|
60
|
-
contextId,
|
|
61
|
-
returnByValue: true,
|
|
62
|
-
awaitPromise: true,
|
|
63
|
-
userGesture: true,
|
|
64
|
-
});
|
|
65
|
-
if (exceptDetails === null || exceptDetails === void 0 ? void 0 : exceptDetails.exception) {
|
|
66
|
-
const err = new symbolicateable_error_1.SymbolicateableError({
|
|
67
|
-
stack: exceptDetails.exception.description,
|
|
68
|
-
name: exceptDetails.exception.className,
|
|
69
|
-
message: (_b = (_a = exceptDetails.exception.description) === null || _a === void 0 ? void 0 : _a.split('\n')) === null || _b === void 0 ? void 0 : _b[0],
|
|
70
|
-
frame,
|
|
71
|
-
stackFrame: (0, parse_browser_error_stack_1.parseStack)(exceptDetails.exception.description.split('\n')),
|
|
72
|
-
});
|
|
73
|
-
throw err;
|
|
74
|
-
}
|
|
75
|
-
return { value: valueFromRemoteObject(remotObject), size };
|
|
76
|
-
}
|
|
77
52
|
if (typeof pageFunction !== 'function')
|
|
78
53
|
throw new Error(`Expected to get |string| or |function| as the first argument, but got "${pageFunction}" instead.`);
|
|
79
54
|
let functionText = pageFunction.toString();
|
|
@@ -120,18 +95,18 @@ async function puppeteerEvaluateWithCatch({ page, pageFunction, frame, args, })
|
|
|
120
95
|
const { value: { exceptionDetails, result: remoteObject }, size, } = await callFunctionOnPromise;
|
|
121
96
|
if (exceptionDetails) {
|
|
122
97
|
const err = new symbolicateable_error_1.SymbolicateableError({
|
|
123
|
-
stack: (
|
|
124
|
-
name: (
|
|
125
|
-
message: (
|
|
98
|
+
stack: (_a = exceptionDetails.exception) === null || _a === void 0 ? void 0 : _a.description,
|
|
99
|
+
name: (_b = exceptionDetails.exception) === null || _b === void 0 ? void 0 : _b.className,
|
|
100
|
+
message: (_d = (_c = exceptionDetails.exception) === null || _c === void 0 ? void 0 : _c.description) === null || _d === void 0 ? void 0 : _d.split('\n')[0],
|
|
126
101
|
frame,
|
|
127
|
-
stackFrame: (0, parse_browser_error_stack_1.parseStack)(((
|
|
102
|
+
stackFrame: (0, parse_browser_error_stack_1.parseStack)(((_e = exceptionDetails.exception) === null || _e === void 0 ? void 0 : _e.description).split('\n')),
|
|
128
103
|
});
|
|
129
104
|
throw err;
|
|
130
105
|
}
|
|
131
106
|
return { size, value: valueFromRemoteObject(remoteObject) };
|
|
132
107
|
}
|
|
133
108
|
catch (error) {
|
|
134
|
-
if ((
|
|
109
|
+
if ((_f = error === null || error === void 0 ? void 0 : error.originalMessage) === null || _f === void 0 ? void 0 : _f.startsWith("Object couldn't be returned by value")) {
|
|
135
110
|
throw new Error('Could not serialize the return value of the function. Did you pass non-serializable values to defaultProps?');
|
|
136
111
|
}
|
|
137
112
|
throw error;
|
package/dist/seek-to-frame.js
CHANGED
|
@@ -17,7 +17,6 @@ const waitForReady = ({ page, timeoutInMilliseconds, frame, }) => {
|
|
|
17
17
|
title: frame === null
|
|
18
18
|
? 'the page to render the React component'
|
|
19
19
|
: `the page to render the React component at frame ${frame}`,
|
|
20
|
-
shouldClosePage: false,
|
|
21
20
|
})
|
|
22
21
|
.then((a) => {
|
|
23
22
|
return resolve(a);
|
|
@@ -63,7 +62,6 @@ const waitForReady = ({ page, timeoutInMilliseconds, frame, }) => {
|
|
|
63
62
|
timeout: null,
|
|
64
63
|
pageFunction: 'window.remotion_cancelledError !== undefined',
|
|
65
64
|
title: 'remotion_cancelledError variable to appear on the page',
|
|
66
|
-
shouldClosePage: false,
|
|
67
65
|
})
|
|
68
66
|
.then(() => {
|
|
69
67
|
return (0, puppeteer_evaluate_1.puppeteerEvaluateWithCatch)({
|
|
@@ -114,7 +112,7 @@ const waitForReady = ({ page, timeoutInMilliseconds, frame, }) => {
|
|
|
114
112
|
exports.waitForReady = waitForReady;
|
|
115
113
|
const seekToFrame = async ({ frame, page, composition, timeoutInMilliseconds, }) => {
|
|
116
114
|
await (0, exports.waitForReady)({ page, timeoutInMilliseconds, frame: null });
|
|
117
|
-
await (0, puppeteer_evaluate_1.
|
|
115
|
+
await (0, puppeteer_evaluate_1.puppeteerEvaluateWithCatchAndTimeout)({
|
|
118
116
|
pageFunction: (f, c) => {
|
|
119
117
|
window.remotion_setFrame(f, c);
|
|
120
118
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remotion/renderer",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.40",
|
|
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.40"
|
|
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-darwin-arm64": "4.0.
|
|
44
|
-
"@remotion/compositor-
|
|
45
|
-
"@remotion/compositor-
|
|
46
|
-
"@remotion/compositor-linux-arm64-musl": "4.0.
|
|
47
|
-
"@remotion/compositor-linux-
|
|
48
|
-
"@remotion/compositor-
|
|
49
|
-
"@remotion/compositor-
|
|
43
|
+
"@remotion/compositor-darwin-arm64": "4.0.40",
|
|
44
|
+
"@remotion/compositor-darwin-x64": "4.0.40",
|
|
45
|
+
"@remotion/compositor-linux-x64-gnu": "4.0.40",
|
|
46
|
+
"@remotion/compositor-linux-arm64-musl": "4.0.40",
|
|
47
|
+
"@remotion/compositor-linux-arm64-gnu": "4.0.40",
|
|
48
|
+
"@remotion/compositor-win32-x64-msvc": "4.0.40",
|
|
49
|
+
"@remotion/compositor-linux-x64-musl": "4.0.40"
|
|
50
50
|
},
|
|
51
51
|
"keywords": [
|
|
52
52
|
"remotion",
|