@remotion/renderer 4.0.7 → 4.0.10

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.
@@ -86,8 +86,12 @@ export declare class Page extends EventEmitter {
86
86
  setDefaultTimeout(timeout: number): void;
87
87
  evaluateHandle<HandlerType extends JSHandle = JSHandle>(pageFunction: EvaluateHandleFn, ...args: SerializableOrJSHandle[]): Promise<HandlerType>;
88
88
  url(): string;
89
- goto(url: string, options?: WaitForOptions & {
90
- referer?: string;
89
+ goto({ url, timeout, options, }: {
90
+ url: string;
91
+ timeout: number;
92
+ options?: WaitForOptions & {
93
+ referer?: string;
94
+ };
91
95
  }): Promise<HTTPResponse | null>;
92
96
  bringToFront(): Promise<void>;
93
97
  evaluate<T extends EvaluateFn>(pageFunction: T, ...args: SerializableOrJSHandle[]): Promise<UnwrapPromiseLike<EvaluateFnReturnType<T>>>;
@@ -74,7 +74,7 @@ class Page extends EventEmitter_1.EventEmitter {
74
74
  this.sourcemapContext = null;
75
75
  __classPrivateFieldSet(this, _Page_client, client, "f");
76
76
  __classPrivateFieldSet(this, _Page_target, target, "f");
77
- __classPrivateFieldSet(this, _Page_frameManager, new FrameManager_1.FrameManager(client, this, __classPrivateFieldGet(this, _Page_timeoutSettings, "f")), "f");
77
+ __classPrivateFieldSet(this, _Page_frameManager, new FrameManager_1.FrameManager(client, this), "f");
78
78
  this.screenshotTaskQueue = new TaskQueue_1.TaskQueue();
79
79
  this.browser = browser;
80
80
  this.id = String(Math.random());
@@ -218,8 +218,8 @@ class Page extends EventEmitter_1.EventEmitter {
218
218
  url() {
219
219
  return this.mainFrame().url();
220
220
  }
221
- goto(url, options = {}) {
222
- return __classPrivateFieldGet(this, _Page_frameManager, "f").mainFrame().goto(url, options);
221
+ goto({ url, timeout, options = {}, }) {
222
+ return __classPrivateFieldGet(this, _Page_frameManager, "f").mainFrame().goto(url, timeout, options);
223
223
  }
224
224
  async bringToFront() {
225
225
  await __classPrivateFieldGet(this, _Page_client, "f").send('Page.bringToFront');
@@ -18,11 +18,10 @@ import type { EvaluateFn, EvaluateFnReturnType, EvaluateHandleFn, SerializableOr
18
18
  import type { ExecutionContext } from './ExecutionContext';
19
19
  import type { Frame } from './FrameManager';
20
20
  import type { JSHandle } from './JSHandle';
21
- import type { TimeoutSettings } from './TimeoutSettings';
22
21
  export declare class DOMWorld {
23
22
  #private;
24
23
  get _waitTasks(): Set<WaitTask>;
25
- constructor(frame: Frame, timeoutSettings: TimeoutSettings);
24
+ constructor(frame: Frame);
26
25
  frame(): Frame;
27
26
  _setContext(context: ExecutionContext | null): void;
28
27
  _hasContext(): boolean;
@@ -30,7 +29,12 @@ export declare class DOMWorld {
30
29
  executionContext(): Promise<ExecutionContext>;
31
30
  evaluateHandle<HandlerType extends JSHandle = JSHandle>(pageFunction: EvaluateHandleFn, ...args: SerializableOrJSHandle[]): Promise<HandlerType>;
32
31
  evaluate<T extends EvaluateFn>(pageFunction: T, ...args: SerializableOrJSHandle[]): Promise<UnwrapPromiseLike<EvaluateFnReturnType<T>>>;
33
- waitForFunction(browser: HeadlessBrowser, pageFunction: Function | string, ...args: SerializableOrJSHandle[]): Promise<JSHandle>;
32
+ waitForFunction({ browser, timeout, pageFunction, title, }: {
33
+ browser: HeadlessBrowser;
34
+ timeout: number;
35
+ pageFunction: Function | string;
36
+ title: string;
37
+ }): Promise<JSHandle>;
34
38
  title(): Promise<string>;
35
39
  }
36
40
  interface WaitTaskOptions {
@@ -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_timeoutSettings, _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;
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");
@@ -35,9 +35,8 @@ class DOMWorld {
35
35
  get _waitTasks() {
36
36
  return __classPrivateFieldGet(this, _DOMWorld_waitTasks, "f");
37
37
  }
38
- constructor(frame, timeoutSettings) {
38
+ constructor(frame) {
39
39
  _DOMWorld_frame.set(this, void 0);
40
- _DOMWorld_timeoutSettings.set(this, void 0);
41
40
  _DOMWorld_contextPromise.set(this, null);
42
41
  _DOMWorld_contextResolveCallback.set(this, null);
43
42
  _DOMWorld_detached.set(this, false);
@@ -45,7 +44,6 @@ class DOMWorld {
45
44
  // Keep own reference to client because it might differ from the FrameManager's
46
45
  // client for OOP iframes.
47
46
  __classPrivateFieldSet(this, _DOMWorld_frame, frame, "f");
48
- __classPrivateFieldSet(this, _DOMWorld_timeoutSettings, timeoutSettings, "f");
49
47
  this._setContext(null);
50
48
  }
51
49
  frame() {
@@ -93,18 +91,15 @@ class DOMWorld {
93
91
  const context = await this.executionContext();
94
92
  return context.evaluate(pageFunction, ...args);
95
93
  }
96
- waitForFunction(browser, pageFunction, ...args) {
97
- const timeout = __classPrivateFieldGet(this, _DOMWorld_timeoutSettings, "f").timeout();
98
- const waitTaskOptions = {
94
+ waitForFunction({ browser, timeout, pageFunction, title, }) {
95
+ return new WaitTask({
99
96
  domWorld: this,
100
97
  predicateBody: pageFunction,
101
- title: 'function',
98
+ title,
102
99
  timeout,
103
- args,
100
+ args: [],
104
101
  browser,
105
- };
106
- const waitTask = new WaitTask(waitTaskOptions);
107
- return waitTask.promise;
102
+ }).promise;
108
103
  }
109
104
  title() {
110
105
  return this.evaluate(() => {
@@ -113,7 +108,7 @@ class DOMWorld {
113
108
  }
114
109
  }
115
110
  exports.DOMWorld = DOMWorld;
116
- _DOMWorld_frame = new WeakMap(), _DOMWorld_timeoutSettings = new WeakMap(), _DOMWorld_contextPromise = new WeakMap(), _DOMWorld_contextResolveCallback = new WeakMap(), _DOMWorld_detached = new WeakMap(), _DOMWorld_waitTasks = new WeakMap();
111
+ _DOMWorld_frame = new WeakMap(), _DOMWorld_contextPromise = new WeakMap(), _DOMWorld_contextResolveCallback = new WeakMap(), _DOMWorld_detached = new WeakMap(), _DOMWorld_waitTasks = new WeakMap();
117
112
  const noop = () => undefined;
118
113
  class WaitTask {
119
114
  constructor(options) {
@@ -24,7 +24,6 @@ import type { HTTPResponse } from './HTTPResponse';
24
24
  import type { JSHandle } from './JSHandle';
25
25
  import type { PuppeteerLifeCycleEvent } from './LifecycleWatcher';
26
26
  import { NetworkManager } from './NetworkManager';
27
- import type { TimeoutSettings } from './TimeoutSettings';
28
27
  export declare const FrameManagerEmittedEvents: {
29
28
  FrameNavigated: symbol;
30
29
  FrameDetached: symbol;
@@ -36,13 +35,12 @@ export declare const FrameManagerEmittedEvents: {
36
35
  };
37
36
  export declare class FrameManager extends EventEmitter {
38
37
  #private;
39
- get _timeoutSettings(): TimeoutSettings;
40
38
  get _client(): CDPSession;
41
- constructor(client: CDPSession, page: Page, timeoutSettings: TimeoutSettings);
39
+ constructor(client: CDPSession, page: Page);
42
40
  private setupEventListeners;
43
41
  initialize(client?: CDPSession): Promise<void>;
44
42
  networkManager(): NetworkManager;
45
- navigateFrame(frame: Frame, url: string, options?: {
43
+ navigateFrame(frame: Frame, url: string, timeout: number, options?: {
46
44
  referer?: string;
47
45
  timeout?: number;
48
46
  waitUntil?: PuppeteerLifeCycleEvent;
@@ -68,9 +66,8 @@ export declare class Frame {
68
66
  constructor(frameManager: FrameManager, parentFrame: Frame | null, frameId: string, client: CDPSession);
69
67
  _updateClient(client: CDPSession): void;
70
68
  isOOPFrame(): boolean;
71
- goto(url: string, options?: {
69
+ goto(url: string, timeout: number, options?: {
72
70
  referer?: string;
73
- timeout?: number;
74
71
  waitUntil?: PuppeteerLifeCycleEvent;
75
72
  }): Promise<HTTPResponse | null>;
76
73
  _client(): CDPSession;
@@ -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 _FrameManager_instances, _FrameManager_page, _FrameManager_networkManager, _FrameManager_timeoutSettings, _FrameManager_frames, _FrameManager_contextIdToContext, _FrameManager_isolatedWorlds, _FrameManager_mainFrame, _FrameManager_client, _FrameManager_onAttachedToTarget, _FrameManager_onDetachedFromTarget, _FrameManager_onLifecycleEvent, _FrameManager_onFrameStartedLoading, _FrameManager_onFrameStoppedLoading, _FrameManager_handleFrameTree, _FrameManager_onFrameAttached, _FrameManager_onFrameNavigated, _FrameManager_onFrameNavigatedWithinDocument, _FrameManager_onFrameDetached, _FrameManager_onExecutionContextCreated, _FrameManager_onExecutionContextDestroyed, _FrameManager_onExecutionContextsCleared, _FrameManager_removeFramesRecursively, _Frame_parentFrame, _Frame_url, _Frame_client;
28
+ var _FrameManager_instances, _FrameManager_page, _FrameManager_networkManager, _FrameManager_frames, _FrameManager_contextIdToContext, _FrameManager_isolatedWorlds, _FrameManager_mainFrame, _FrameManager_client, _FrameManager_onAttachedToTarget, _FrameManager_onDetachedFromTarget, _FrameManager_onLifecycleEvent, _FrameManager_onFrameStartedLoading, _FrameManager_onFrameStoppedLoading, _FrameManager_handleFrameTree, _FrameManager_onFrameAttached, _FrameManager_onFrameNavigated, _FrameManager_onFrameNavigatedWithinDocument, _FrameManager_onFrameDetached, _FrameManager_onExecutionContextCreated, _FrameManager_onExecutionContextDestroyed, _FrameManager_onExecutionContextsCleared, _FrameManager_removeFramesRecursively, _Frame_parentFrame, _Frame_url, _Frame_client;
29
29
  Object.defineProperty(exports, "__esModule", { value: true });
30
30
  exports.Frame = exports.FrameManager = exports.FrameManagerEmittedEvents = void 0;
31
31
  const assert_1 = require("./assert");
@@ -48,18 +48,14 @@ exports.FrameManagerEmittedEvents = {
48
48
  ExecutionContextDestroyed: Symbol('FrameManager.ExecutionContextDestroyed'),
49
49
  };
50
50
  class FrameManager extends EventEmitter_1.EventEmitter {
51
- get _timeoutSettings() {
52
- return __classPrivateFieldGet(this, _FrameManager_timeoutSettings, "f");
53
- }
54
51
  get _client() {
55
52
  return __classPrivateFieldGet(this, _FrameManager_client, "f");
56
53
  }
57
- constructor(client, page, timeoutSettings) {
54
+ constructor(client, page) {
58
55
  super();
59
56
  _FrameManager_instances.add(this);
60
57
  _FrameManager_page.set(this, void 0);
61
58
  _FrameManager_networkManager.set(this, void 0);
62
- _FrameManager_timeoutSettings.set(this, void 0);
63
59
  _FrameManager_frames.set(this, new Map());
64
60
  _FrameManager_contextIdToContext.set(this, new Map());
65
61
  _FrameManager_isolatedWorlds.set(this, new Set());
@@ -68,7 +64,6 @@ class FrameManager extends EventEmitter_1.EventEmitter {
68
64
  __classPrivateFieldSet(this, _FrameManager_client, client, "f");
69
65
  __classPrivateFieldSet(this, _FrameManager_page, page, "f");
70
66
  __classPrivateFieldSet(this, _FrameManager_networkManager, new NetworkManager_1.NetworkManager(client, this), "f");
71
- __classPrivateFieldSet(this, _FrameManager_timeoutSettings, timeoutSettings, "f");
72
67
  this.setupEventListeners(__classPrivateFieldGet(this, _FrameManager_client, "f"));
73
68
  }
74
69
  setupEventListeners(session) {
@@ -145,8 +140,8 @@ class FrameManager extends EventEmitter_1.EventEmitter {
145
140
  networkManager() {
146
141
  return __classPrivateFieldGet(this, _FrameManager_networkManager, "f");
147
142
  }
148
- async navigateFrame(frame, url, options = {}) {
149
- const { referer = undefined, waitUntil = 'load', timeout = __classPrivateFieldGet(this, _FrameManager_timeoutSettings, "f").navigationTimeout(), } = options;
143
+ async navigateFrame(frame, url, timeout, options = {}) {
144
+ const { referer = undefined, waitUntil = 'load' } = options;
150
145
  const watcher = new LifecycleWatcher_1.LifecycleWatcher(this, frame, waitUntil, timeout);
151
146
  let error = await Promise.race([
152
147
  navigate(__classPrivateFieldGet(this, _FrameManager_client, "f"), url, referer, frame._id),
@@ -229,7 +224,7 @@ class FrameManager extends EventEmitter_1.EventEmitter {
229
224
  }
230
225
  }
231
226
  exports.FrameManager = FrameManager;
232
- _FrameManager_page = new WeakMap(), _FrameManager_networkManager = new WeakMap(), _FrameManager_timeoutSettings = new WeakMap(), _FrameManager_frames = new WeakMap(), _FrameManager_contextIdToContext = new WeakMap(), _FrameManager_isolatedWorlds = new WeakMap(), _FrameManager_mainFrame = new WeakMap(), _FrameManager_client = new WeakMap(), _FrameManager_instances = new WeakSet(), _FrameManager_onAttachedToTarget = async function _FrameManager_onAttachedToTarget(event) {
227
+ _FrameManager_page = new WeakMap(), _FrameManager_networkManager = new WeakMap(), _FrameManager_frames = new WeakMap(), _FrameManager_contextIdToContext = new WeakMap(), _FrameManager_isolatedWorlds = new WeakMap(), _FrameManager_mainFrame = new WeakMap(), _FrameManager_client = new WeakMap(), _FrameManager_instances = new WeakSet(), _FrameManager_onAttachedToTarget = async function _FrameManager_onAttachedToTarget(event) {
233
228
  if (event.targetInfo.type !== 'iframe') {
234
229
  return;
235
230
  }
@@ -429,14 +424,14 @@ class Frame {
429
424
  }
430
425
  _updateClient(client) {
431
426
  __classPrivateFieldSet(this, _Frame_client, client, "f");
432
- this._mainWorld = new DOMWorld_1.DOMWorld(this, this._frameManager._timeoutSettings);
433
- this._secondaryWorld = new DOMWorld_1.DOMWorld(this, this._frameManager._timeoutSettings);
427
+ this._mainWorld = new DOMWorld_1.DOMWorld(this);
428
+ this._secondaryWorld = new DOMWorld_1.DOMWorld(this);
434
429
  }
435
430
  isOOPFrame() {
436
431
  return __classPrivateFieldGet(this, _Frame_client, "f") !== this._frameManager._client;
437
432
  }
438
- goto(url, options = {}) {
439
- return this._frameManager.navigateFrame(this, url, options);
433
+ goto(url, timeout, options = {}) {
434
+ return this._frameManager.navigateFrame(this, url, timeout, options);
440
435
  }
441
436
  _client() {
442
437
  return __classPrivateFieldGet(this, _Frame_client, "f");
@@ -71,7 +71,7 @@ const callCompositor = (payload) => {
71
71
  reject(err);
72
72
  }
73
73
  catch (err) {
74
- reject(new Error(`Compositor panicked: ${message}`));
74
+ reject(new Error(`Compositor panicked with code ${code}: ${message}`));
75
75
  }
76
76
  }
77
77
  });
@@ -158,7 +158,7 @@ const startCompositor = (type, payload, logLevel, indent) => {
158
158
  else {
159
159
  const errorMessage = Buffer.concat(stderrChunks).toString('utf-8');
160
160
  runningStatus = { type: 'quit-with-error', error: errorMessage };
161
- const error = new Error(`Compositor panicked: ${errorMessage}`);
161
+ const error = new Error(`Compositor panicked with code ${code}: ${errorMessage}`);
162
162
  for (const waiter of waitersToKill) {
163
163
  waiter.reject(error);
164
164
  }
@@ -32,6 +32,9 @@ export type VideoMetadata = {
32
32
  width: number;
33
33
  height: number;
34
34
  durationInSeconds: number;
35
+ codec: 'h264' | 'h265' | 'vp8' | 'vp9' | 'av1' | 'prores' | 'unknown';
36
+ canPlayInVideoTag: boolean;
37
+ supportsSeeking: boolean;
35
38
  };
36
39
  export type CompositorCommand = {
37
40
  Compose: {
@@ -47,7 +47,7 @@ const innerGetCompositions = async ({ envVariables, serializedInputPropsWithCust
47
47
  frame: null,
48
48
  args: [],
49
49
  });
50
- await (0, seek_to_frame_1.waitForReady)(page);
50
+ await (0, seek_to_frame_1.waitForReady)({ page, timeoutInMilliseconds, frame: null });
51
51
  const { value: result } = await (0, puppeteer_evaluate_1.puppeteerEvaluateWithCatch)({
52
52
  pageFunction: () => {
53
53
  return window.getStaticCompositions();
package/dist/index.d.ts CHANGED
@@ -44,7 +44,7 @@ export declare const RenderInternals: {
44
44
  downloadMap: import("./assets/download-map").DownloadMap;
45
45
  remotionRoot: string;
46
46
  concurrency: number;
47
- logLevel: "error" | "verbose" | "info" | "warn";
47
+ logLevel: "verbose" | "info" | "warn" | "error";
48
48
  indent: boolean;
49
49
  }) => Promise<{
50
50
  port: number;
@@ -123,7 +123,7 @@ export declare const RenderInternals: {
123
123
  DEFAULT_CODEC: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif";
124
124
  isAudioCodec: (codec: "h264" | "h265" | "vp8" | "vp9" | "mp3" | "aac" | "wav" | "prores" | "h264-mkv" | "gif" | undefined) => boolean;
125
125
  logLevels: readonly ["verbose", "info", "warn", "error"];
126
- isEqualOrBelowLogLevel: (currentLevel: "error" | "verbose" | "info" | "warn", level: "error" | "verbose" | "info" | "warn") => boolean;
126
+ isEqualOrBelowLogLevel: (currentLevel: "verbose" | "info" | "warn" | "error", level: "verbose" | "info" | "warn" | "error") => boolean;
127
127
  isValidLogLevel: (level: string) => boolean;
128
128
  perf: typeof perf;
129
129
  convertToPositiveFrameIndex: ({ frame, durationInFrames, }: {
@@ -352,30 +352,30 @@ export declare const RenderInternals: {
352
352
  verbose: (message?: any, ...optionalParams: any[]) => void;
353
353
  verboseAdvanced: (options: {
354
354
  indent: boolean;
355
- logLevel: "error" | "verbose" | "info" | "warn";
355
+ logLevel: "verbose" | "info" | "warn" | "error";
356
356
  } & {
357
357
  tag?: string | undefined;
358
358
  }, message?: any, ...optionalParams: any[]) => void;
359
359
  info: (message?: any, ...optionalParams: any[]) => void;
360
360
  infoAdvanced: (options: {
361
361
  indent: boolean;
362
- logLevel: "error" | "verbose" | "info" | "warn";
362
+ logLevel: "verbose" | "info" | "warn" | "error";
363
363
  }, message?: any, ...optionalParams: any[]) => void;
364
364
  warn: (message?: any, ...optionalParams: any[]) => void;
365
365
  warnAdvanced: (options: {
366
366
  indent: boolean;
367
- logLevel: "error" | "verbose" | "info" | "warn";
367
+ logLevel: "verbose" | "info" | "warn" | "error";
368
368
  }, message?: any, ...optionalParams: any[]) => void;
369
369
  error: (message?: any, ...optionalParams: any[]) => void;
370
370
  errorAdvanced: (options: {
371
371
  indent: boolean;
372
- logLevel: "error" | "verbose" | "info" | "warn";
372
+ logLevel: "verbose" | "info" | "warn" | "error";
373
373
  } & {
374
374
  tag?: string | undefined;
375
375
  }, message?: any, ...optionalParams: any[]) => void;
376
376
  };
377
- getLogLevel: () => "error" | "verbose" | "info" | "warn";
378
- setLogLevel: (newLogLevel: "error" | "verbose" | "info" | "warn") => void;
377
+ getLogLevel: () => "verbose" | "info" | "warn" | "error";
378
+ setLogLevel: (newLogLevel: "verbose" | "info" | "warn" | "error") => void;
379
379
  INDENT_TOKEN: string;
380
380
  isColorSupported: () => boolean;
381
381
  HeadlessBrowser: typeof HeadlessBrowser;
@@ -384,7 +384,7 @@ export declare const RenderInternals: {
384
384
  port: number | null;
385
385
  remotionRoot: string;
386
386
  concurrency: number;
387
- logLevel: "error" | "verbose" | "info" | "warn";
387
+ logLevel: "verbose" | "info" | "warn" | "error";
388
388
  indent: boolean;
389
389
  }) => Promise<import("./prepare-server").RemotionServer>;
390
390
  makeOrReuseServer: (server: import("./prepare-server").RemotionServer | undefined, config: {
@@ -392,7 +392,7 @@ export declare const RenderInternals: {
392
392
  port: number | null;
393
393
  remotionRoot: string;
394
394
  concurrency: number;
395
- logLevel: "error" | "verbose" | "info" | "warn";
395
+ logLevel: "verbose" | "info" | "warn" | "error";
396
396
  indent: boolean;
397
397
  }, { onDownload, onError, }: {
398
398
  onError: (err: Error) => void;
@@ -421,7 +421,7 @@ export declare const RenderInternals: {
421
421
  cancelSignal: import("./make-cancel-signal").CancelSignal | null;
422
422
  indent: boolean;
423
423
  server: import("./prepare-server").RemotionServer | undefined;
424
- logLevel: "error" | "verbose" | "info" | "warn";
424
+ logLevel: "verbose" | "info" | "warn" | "error";
425
425
  serveUrl: string;
426
426
  port: number | null;
427
427
  }) => Promise<{
@@ -434,7 +434,7 @@ export declare const RenderInternals: {
434
434
  viewport: import("./browser/PuppeteerViewport").Viewport | null;
435
435
  indent: boolean;
436
436
  browser: import("./browser").Browser;
437
- logLevel: "error" | "verbose" | "info" | "warn";
437
+ logLevel: "verbose" | "info" | "warn" | "error";
438
438
  }) => Promise<HeadlessBrowser>;
439
439
  internalSelectComposition: (options: {
440
440
  serializedInputPropsWithCustomSchema: string;
@@ -447,7 +447,7 @@ export declare const RenderInternals: {
447
447
  port: number | null;
448
448
  indent: boolean;
449
449
  server: import("./prepare-server").RemotionServer | undefined;
450
- logLevel: "error" | "verbose" | "info" | "warn";
450
+ logLevel: "verbose" | "info" | "warn" | "error";
451
451
  serveUrl: string;
452
452
  id: string;
453
453
  }) => Promise<{
@@ -465,7 +465,7 @@ export declare const RenderInternals: {
465
465
  port: number | null;
466
466
  server: import("./prepare-server").RemotionServer | undefined;
467
467
  indent: boolean;
468
- logLevel: "error" | "verbose" | "info" | "warn";
468
+ logLevel: "verbose" | "info" | "warn" | "error";
469
469
  serveUrlOrWebpackUrl: string;
470
470
  }) => Promise<import("remotion").VideoConfig[]>;
471
471
  internalRenderFrames: ({ browserExecutable, cancelSignal, chromiumOptions, composition, concurrency, envVariables, everyNthFrame, frameRange, imageFormat, indent, jpegQuality, muted, onBrowserLog, onDownload, onFrameBuffer, onFrameUpdate, onStart, outputDir, port, puppeteerInstance, scale, server, timeoutInMilliseconds, logLevel, webpackBundleOrServeUrl, serializedInputPropsWithCustomSchema, serializedResolvedPropsWithCustomSchema, }: import("./render-frames").InternalRenderFramesOptions) => Promise<import("./types").RenderFramesOutput>;
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: () => "error" | "verbose" | "info" | "warn";
22
+ export declare const getLogLevel: () => "verbose" | "info" | "warn" | "error";
23
23
  export declare const setLogLevel: (newLogLevel: LogLevel) => void;
24
24
  export {};
@@ -31,7 +31,7 @@ const prespawnFfmpeg = (options) => {
31
31
  }
32
32
  (0, pixel_format_1.validateSelectedPixelFormatAndCodecCombination)(pixelFormat, codec);
33
33
  const ffmpegArgs = [
34
- ['-r', options.fps.toFixed(2)],
34
+ ['-r', options.fps],
35
35
  ...[
36
36
  ['-f', 'image2pipe'],
37
37
  ['-s', `${options.width}x${options.height}`],
@@ -152,7 +152,12 @@ const innerRenderFrames = async ({ onFrameUpdate, outputDir, onStart, serialized
152
152
  });
153
153
  freePage.on('error', errorCallbackOnFrame);
154
154
  const startSeeking = Date.now();
155
- await (0, seek_to_frame_1.seekToFrame)({ frame, page: freePage, composition: compId });
155
+ await (0, seek_to_frame_1.seekToFrame)({
156
+ frame,
157
+ page: freePage,
158
+ composition: compId,
159
+ timeoutInMilliseconds,
160
+ });
156
161
  const timeToSeek = Date.now() - startSeeking;
157
162
  if (timeToSeek > 1000) {
158
163
  logger_1.Log.verbose(`Seeking to frame ${frame} took ${timeToSeek}ms`);
@@ -171,7 +171,12 @@ const innerRenderStill = async ({ composition, imageFormat = image_format_1.DEFA
171
171
  frame: null,
172
172
  page,
173
173
  });
174
- await (0, seek_to_frame_1.seekToFrame)({ frame: stillFrame, page, composition: composition.id });
174
+ await (0, seek_to_frame_1.seekToFrame)({
175
+ frame: stillFrame,
176
+ page,
177
+ composition: composition.id,
178
+ timeoutInMilliseconds,
179
+ });
175
180
  const { buffer } = await (0, take_frame_and_compose_1.takeFrameAndCompose)({
176
181
  frame: stillFrame,
177
182
  freePage: page,
@@ -1,7 +1,12 @@
1
1
  import type { Page } from './browser/BrowserPage';
2
- export declare const waitForReady: (page: Page) => Promise<unknown>;
3
- export declare const seekToFrame: ({ frame, page, composition, }: {
2
+ export declare const waitForReady: ({ page, timeoutInMilliseconds, frame, }: {
3
+ page: Page;
4
+ timeoutInMilliseconds: number;
5
+ frame: number | null;
6
+ }) => Promise<unknown>;
7
+ export declare const seekToFrame: ({ frame, page, composition, timeoutInMilliseconds, }: {
4
8
  frame: number;
5
9
  composition: string;
6
10
  page: Page;
11
+ timeoutInMilliseconds: number;
7
12
  }) => Promise<void>;
@@ -4,52 +4,62 @@ exports.seekToFrame = exports.waitForReady = void 0;
4
4
  const symbolicateable_error_1 = require("./error-handling/symbolicateable-error");
5
5
  const parse_browser_error_stack_1 = require("./parse-browser-error-stack");
6
6
  const puppeteer_evaluate_1 = require("./puppeteer-evaluate");
7
- const waitForReady = (page) => {
8
- return Promise.race([
9
- new Promise((_, reject) => {
10
- page.on("disposed" /* PageEmittedEvents.Disposed */, () => {
11
- reject(new Error('Target closed (page disposed)'));
12
- });
13
- }),
14
- new Promise((_, reject) => {
15
- page.browser.on("closed-silent" /* BrowserEmittedEvents.ClosedSilent */, () => {
16
- reject(new Error('Target closed'));
17
- });
18
- }),
19
- page
20
- .mainFrame()
21
- ._mainWorld.waitForFunction(page.browser, 'window.remotion_renderReady === true')
22
- .catch((err) => {
23
- throw err;
24
- }),
25
- page
26
- .mainFrame()
27
- ._mainWorld.waitForFunction(page.browser, 'window.remotion_cancelledError !== undefined')
28
- .then(() => {
29
- return (0, puppeteer_evaluate_1.puppeteerEvaluateWithCatch)({
30
- pageFunction: () => window.remotion_cancelledError,
31
- args: [],
32
- frame: null,
33
- page,
34
- });
35
- })
36
- .then(({ value: val }) => {
37
- if (typeof val !== 'string') {
38
- throw val;
39
- }
40
- throw new symbolicateable_error_1.SymbolicateableError({
41
- frame: null,
42
- stack: val,
43
- name: 'CancelledError',
44
- message: val.split('\n')[0],
45
- stackFrame: (0, parse_browser_error_stack_1.parseStack)(val.split('\n')),
46
- });
47
- }),
48
- ]);
49
- };
7
+ const waitForReady = ({ page, timeoutInMilliseconds, frame, }) => Promise.race([
8
+ new Promise((_, reject) => {
9
+ page.on("disposed" /* PageEmittedEvents.Disposed */, () => {
10
+ reject(new Error('Target closed (page disposed)'));
11
+ });
12
+ }),
13
+ new Promise((_, reject) => {
14
+ page.browser.on("closed-silent" /* BrowserEmittedEvents.ClosedSilent */, () => {
15
+ reject(new Error('Target closed'));
16
+ });
17
+ }),
18
+ page
19
+ .mainFrame()
20
+ ._mainWorld.waitForFunction({
21
+ browser: page.browser,
22
+ timeout: timeoutInMilliseconds,
23
+ pageFunction: 'window.remotion_renderReady === true',
24
+ title: frame === null
25
+ ? 'the page to render the React component'
26
+ : `the page to render the React component at frame ${frame}`,
27
+ })
28
+ .catch((err) => {
29
+ throw err;
30
+ }),
31
+ page
32
+ .mainFrame()
33
+ ._mainWorld.waitForFunction({
34
+ browser: page.browser,
35
+ timeout: timeoutInMilliseconds,
36
+ pageFunction: 'window.remotion_cancelledError !== undefined',
37
+ title: 'remotion_cancelledError variable to appear on the page',
38
+ })
39
+ .then(() => {
40
+ return (0, puppeteer_evaluate_1.puppeteerEvaluateWithCatch)({
41
+ pageFunction: () => window.remotion_cancelledError,
42
+ args: [],
43
+ frame: null,
44
+ page,
45
+ });
46
+ })
47
+ .then(({ value: val }) => {
48
+ if (typeof val !== 'string') {
49
+ throw val;
50
+ }
51
+ throw new symbolicateable_error_1.SymbolicateableError({
52
+ frame: null,
53
+ stack: val,
54
+ name: 'CancelledError',
55
+ message: val.split('\n')[0],
56
+ stackFrame: (0, parse_browser_error_stack_1.parseStack)(val.split('\n')),
57
+ });
58
+ }),
59
+ ]);
50
60
  exports.waitForReady = waitForReady;
51
- const seekToFrame = async ({ frame, page, composition, }) => {
52
- await (0, exports.waitForReady)(page);
61
+ const seekToFrame = async ({ frame, page, composition, timeoutInMilliseconds, }) => {
62
+ await (0, exports.waitForReady)({ page, timeoutInMilliseconds, frame: null });
53
63
  await (0, puppeteer_evaluate_1.puppeteerEvaluateWithCatch)({
54
64
  pageFunction: (f, c) => {
55
65
  window.remotion_setFrame(f, c);
@@ -58,7 +68,7 @@ const seekToFrame = async ({ frame, page, composition, }) => {
58
68
  frame,
59
69
  page,
60
70
  });
61
- await (0, exports.waitForReady)(page);
71
+ await (0, exports.waitForReady)({ page, timeoutInMilliseconds, frame });
62
72
  await page.evaluateHandle('document.fonts.ready');
63
73
  };
64
74
  exports.seekToFrame = seekToFrame;
@@ -47,7 +47,7 @@ const innerSelectComposition = async ({ page, onBrowserLog, serializedInputProps
47
47
  frame: null,
48
48
  args: [],
49
49
  });
50
- await (0, seek_to_frame_1.waitForReady)(page);
50
+ await (0, seek_to_frame_1.waitForReady)({ page, timeoutInMilliseconds, frame: null });
51
51
  logger_1.Log.verboseAdvanced({
52
52
  indent,
53
53
  tag: 'selectComposition()',
@@ -0,0 +1,6 @@
1
+ import type { SerializedJSONWithCustomFields } from 'remotion';
2
+ export declare const serializeJSONWithDate: ({ data, indent, staticBase, }: {
3
+ data: Record<string, unknown>;
4
+ indent: number | undefined;
5
+ staticBase: string | null;
6
+ }) => SerializedJSONWithCustomFields;
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.serializeJSONWithDate = void 0;
4
+ // Keep in sync with /packages/core/src/input-props-serialization.ts
5
+ const DATE_TOKEN = 'remotion-date:';
6
+ const FILE_TOKEN = 'remotion-file:';
7
+ const serializeJSONWithDate = ({ data, indent, staticBase, }) => {
8
+ let customDateUsed = false;
9
+ let customFileUsed = false;
10
+ let mapUsed = false;
11
+ let setUsed = false;
12
+ const serializedString = JSON.stringify(data, function (key, value) {
13
+ const item = this[key];
14
+ if (item instanceof Date) {
15
+ customDateUsed = true;
16
+ return `${DATE_TOKEN}${item.toISOString()}`;
17
+ }
18
+ if (item instanceof Map) {
19
+ mapUsed = true;
20
+ return value;
21
+ }
22
+ if (item instanceof Set) {
23
+ setUsed = true;
24
+ return value;
25
+ }
26
+ if (typeof item === 'string' &&
27
+ staticBase !== null &&
28
+ item.startsWith(staticBase)) {
29
+ customFileUsed = true;
30
+ return `${FILE_TOKEN}${item.replace(staticBase + '/', '')}`;
31
+ }
32
+ return value;
33
+ }, indent);
34
+ return { serializedString, customDateUsed, customFileUsed, mapUsed, setUsed };
35
+ };
36
+ exports.serializeJSONWithDate = serializeJSONWithDate;
@@ -37,7 +37,7 @@ const innerSetPropsAndEnv = async ({ serializedInputPropsWithCustomSchema, envVa
37
37
  await page.evaluateOnNewDocument((enabled) => {
38
38
  window.remotion_videoEnabled = enabled;
39
39
  }, videoEnabled);
40
- const pageRes = await page.goto(urlToVisit);
40
+ const pageRes = await page.goto({ url: urlToVisit, timeout: actualTimeout });
41
41
  if (pageRes === null) {
42
42
  throw new Error(`Visited "${urlToVisit}" but got no response.`);
43
43
  }
@@ -112,14 +112,25 @@ const innerSetPropsAndEnv = async ({ serializedInputPropsWithCustomSchema, envVa
112
112
  });
113
113
  const requiredVersion = '8';
114
114
  if (siteVersion !== requiredVersion) {
115
- throw new Error(`Incompatible site: When visiting ${urlToVisit}, a bundle was found, but one that is not compatible with this version of Remotion. Found version: ${siteVersion} - Required version: ${requiredVersion}. To resolve this error, please bundle and deploy again.`);
115
+ throw new Error([
116
+ `Incompatible site: When visiting ${urlToVisit}, a bundle was found, but one that is not compatible with this version of Remotion. Found version: ${siteVersion} - Required version: ${requiredVersion}. To resolve this error:`,
117
+ '▸ Use `npx remotion lambda sites create` to redeploy the site with the latest version.',
118
+ ' ℹ Use --site-name with the same name as before to overwrite your site.',
119
+ '▸ Use `deploySite()` if you are using the Node.JS APIs.',
120
+ ].join('\n'));
116
121
  }
117
122
  if (remotionVersion !== version_1.VERSION && process.env.NODE_ENV !== 'test') {
118
123
  if (remotionVersion) {
119
124
  logger_1.Log.warnAdvanced({
120
125
  indent,
121
126
  logLevel,
122
- }, `The site was bundled with version ${remotionVersion} of @remotion/bundler, while @remotion/renderer is on version ${version_1.VERSION}. You may not have the newest bugfixes and features. Re-bundle the site to fix this issue.`);
127
+ }, [
128
+ `The site was bundled with version ${remotionVersion} of @remotion/bundler, while @remotion/renderer is on version ${version_1.VERSION}. You may not have the newest bugfixes and features.`,
129
+ `To resolve this warning:`,
130
+ '▸ Use `npx remotion lambda sites create` to redeploy the site with the latest version.',
131
+ ' ℹ Use --site-name with the same name as before to overwrite your site.',
132
+ '▸ Use `deploySite()` if you are using the Node.JS APIs.',
133
+ ].join('\n'));
123
134
  }
124
135
  else {
125
136
  logger_1.Log.warnAdvanced({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remotion/renderer",
3
- "version": "4.0.7",
3
+ "version": "4.0.10",
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.7"
21
+ "remotion": "4.0.10"
22
22
  },
23
23
  "peerDependencies": {
24
24
  "react": ">=16.8.0",
@@ -42,13 +42,13 @@
42
42
  "zod": "^3.21.4"
43
43
  },
44
44
  "optionalDependencies": {
45
- "@remotion/compositor-darwin-arm64": "4.0.7",
46
- "@remotion/compositor-darwin-x64": "4.0.7",
47
- "@remotion/compositor-linux-arm64-gnu": "4.0.7",
48
- "@remotion/compositor-linux-x64-musl": "4.0.7",
49
- "@remotion/compositor-win32-x64-msvc": "4.0.7",
50
- "@remotion/compositor-linux-x64-gnu": "4.0.7",
51
- "@remotion/compositor-linux-arm64-musl": "4.0.7"
45
+ "@remotion/compositor-darwin-arm64": "4.0.10",
46
+ "@remotion/compositor-linux-arm64-musl": "4.0.10",
47
+ "@remotion/compositor-linux-arm64-gnu": "4.0.10",
48
+ "@remotion/compositor-linux-x64-gnu": "4.0.10",
49
+ "@remotion/compositor-linux-x64-musl": "4.0.10",
50
+ "@remotion/compositor-win32-x64-msvc": "4.0.10",
51
+ "@remotion/compositor-darwin-x64": "4.0.10"
52
52
  },
53
53
  "keywords": [
54
54
  "remotion",