remotion 4.0.512 → 4.0.514

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.
@@ -34,6 +34,7 @@ type EnhancedTSequenceData = {
34
34
  src: string;
35
35
  volume: string | number;
36
36
  doesVolumeChange: boolean;
37
+ muted: boolean;
37
38
  startMediaFrom: number;
38
39
  mediaFrameAtSequenceZero: number | null;
39
40
  playbackRate: number;
@@ -43,6 +44,7 @@ type EnhancedTSequenceData = {
43
44
  src: string;
44
45
  volume: string | number;
45
46
  doesVolumeChange: boolean;
47
+ muted: boolean;
46
48
  startMediaFrom: number;
47
49
  mediaFrameAtSequenceZero: number | null;
48
50
  playbackRate: number;
@@ -85,6 +87,7 @@ export type TSequence = {
85
87
  controls: SequenceRegistrationControls | null;
86
88
  refForOutline: React.RefObject<Element | null> | null;
87
89
  effects: readonly EffectDefinition<unknown>[];
90
+ effectRuntimeValues: readonly RuntimeValueStore[] | null;
88
91
  isInsideSeries: boolean;
89
92
  frozenFrame: number | null;
90
93
  singleChildComponent?: unknown;
@@ -13,6 +13,23 @@ const use_crop_style_js_1 = require("./use-crop-style.js");
13
13
  const use_delay_render_js_1 = require("./use-delay-render.js");
14
14
  const use_remotion_environment_js_1 = require("./use-remotion-environment.js");
15
15
  const with_interactivity_schema_js_1 = require("./with-interactivity-schema.js");
16
+ // `transferControlToOffscreen()` may only be called once per canvas — a second
17
+ // call throws an `InvalidStateError`. The layout effect that needs the
18
+ // `OffscreenCanvas` can run more than once for the same canvas element: its
19
+ // dependencies (e.g. the paint callback) can change identity without the
20
+ // canvas remounting, and React StrictMode intentionally double-invokes
21
+ // effects. Cache the transferred `OffscreenCanvas` per canvas element so
22
+ // re-runs reuse it instead of throwing.
23
+ const transferredOffscreenCanvases = new WeakMap();
24
+ const getTransferredOffscreenCanvas = (canvas) => {
25
+ const existing = transferredOffscreenCanvases.get(canvas);
26
+ if (existing) {
27
+ return existing;
28
+ }
29
+ const offscreen = canvas.transferControlToOffscreen();
30
+ transferredOffscreenCanvases.set(canvas, offscreen);
31
+ return offscreen;
32
+ };
16
33
  // Memoize the support check across the session — neither the platform
17
34
  // capability nor the chrome://flags toggle can change between calls.
18
35
  // SSR results are not cached so the check runs again once `document` exists.
@@ -36,17 +53,6 @@ const isHtmlInCanvasSupported = () => {
36
53
  exports.isHtmlInCanvasSupported = isHtmlInCanvasSupported;
37
54
  /** Shown when {@link isHtmlInCanvasSupported} is false: APIs are absent (old Chrome and/or flag off). */
38
55
  exports.HTML_IN_CANVAS_UNSUPPORTED_MESSAGE = 'HTML in Canvas is not supported. Two common causes: Chrome is older than version 148 (update Chrome), or the HTML-in-Canvas flag is disabled at chrome://flags/#canvas-draw-element (enable it and restart Chrome).';
39
- const MINIMUM_CHROME_VERSION_FOR_NESTED_HTML_IN_CANVAS = 152;
40
- const getChromeMajorVersion = () => {
41
- if (typeof navigator === 'undefined') {
42
- return null;
43
- }
44
- const match = navigator.userAgent.match(/\b(?:HeadlessChrome|Chrome)\/(\d+)/);
45
- if (!match) {
46
- return null;
47
- }
48
- return Number(match[1]);
49
- };
50
56
  function assertHtmlInCanvasDimensions(width, height) {
51
57
  if (typeof width !== 'number' || typeof height !== 'number') {
52
58
  throw new Error(`HtmlInCanvas: \`width\` and \`height\` must be numbers. Received width=${String(width)}, height=${String(height)}.`);
@@ -90,16 +96,14 @@ const defaultOnPaint = ({ canvas, element, elementImage, }) => {
90
96
  const transform = ctx.drawElementImage(elementImage, 0, 0);
91
97
  element.style.transform = transform.toString();
92
98
  };
93
- const HtmlInCanvasAncestorContext = (0, react_1.createContext)(null);
99
+ /* eslint-enable react/require-default-props */
100
+ const HtmlInCanvasAncestorContext = (0, react_1.createContext)(false);
94
101
  const HtmlInCanvasContent = (0, react_1.forwardRef)(({ width, height, effects, children, onPaint, onInit, pixelDensity, controls, style, }, ref) => {
95
102
  var _a;
96
- const ancestor = (0, react_1.useContext)(HtmlInCanvasAncestorContext);
103
+ const isInsideAncestorHtmlInCanvas = (0, react_1.useContext)(HtmlInCanvasAncestorContext);
97
104
  assertHtmlInCanvasDimensions(width, height);
98
- const chromeMajorVersion = getChromeMajorVersion();
99
- if (ancestor &&
100
- chromeMajorVersion !== null &&
101
- chromeMajorVersion < MINIMUM_CHROME_VERSION_FOR_NESTED_HTML_IN_CANVAS) {
102
- throw new Error(`Nested <HtmlInCanvas> components require Chrome ${MINIMUM_CHROME_VERSION_FOR_NESTED_HTML_IN_CANVAS} or newer, but the current browser is Chrome ${chromeMajorVersion}. Upgrade Chrome or avoid nesting components that use <HtmlInCanvas>, such as shapes with effects.`);
105
+ if (isInsideAncestorHtmlInCanvas) {
106
+ throw new Error('<HtmlInCanvas> components cannot be nested. Chrome does not reliably render nested HTML-in-canvas subtrees. Consider merging the effects into one <HtmlInCanvas> if you can.');
103
107
  }
104
108
  const resolvedPixelDensity = resolveHtmlInCanvasPixelDensity(pixelDensity);
105
109
  const canvasWidth = Math.ceil(width * resolvedPixelDensity);
@@ -139,10 +143,7 @@ const HtmlInCanvasContent = (0, react_1.forwardRef)(({ width, height, effects, c
139
143
  const initializedRef = (0, react_1.useRef)(false);
140
144
  const onInitCleanupRef = (0, react_1.useRef)(null);
141
145
  const unmountedRef = (0, react_1.useRef)(false);
142
- const ancestorRef = (0, react_1.useRef)(ancestor);
143
- ancestorRef.current = ancestor;
144
146
  const onPaintCb = (0, react_1.useCallback)(async () => {
145
- var _a;
146
147
  const element = divRef.current;
147
148
  if (!element) {
148
149
  throw new Error('Canvas or scene element not found');
@@ -267,10 +268,6 @@ const HtmlInCanvasContent = (0, react_1.forwardRef)(({ width, height, effects, c
267
268
  finally {
268
269
  elImage.close();
269
270
  }
270
- // Effects may complete after Chromium has dispatched the parent's
271
- // paint event. Repaint the direct parent so deeply nested canvases
272
- // propagate their final pixels through every ancestor.
273
- (_a = ancestorRef.current) === null || _a === void 0 ? void 0 : _a.requestParentPaint();
274
271
  continueRender(handle);
275
272
  }
276
273
  catch (error) {
@@ -286,9 +283,8 @@ const HtmlInCanvasContent = (0, react_1.forwardRef)(({ width, height, effects, c
286
283
  resolvedPixelDensity,
287
284
  canRetryMissingPaintRecord,
288
285
  ]);
289
- // Default paint handlers draw synchronously on the layout canvas itself so
290
- // Chromium can include their final pixels during its deepest-first nested
291
- // paint traversal. Custom handlers retain the transferred OffscreenCanvas API.
286
+ // Default paint handlers draw synchronously on the layout canvas itself.
287
+ // Custom handlers retain the transferred OffscreenCanvas API.
292
288
  (0, react_1.useLayoutEffect)(() => {
293
289
  const placeholder = canvas2dRef.current;
294
290
  if (!placeholder) {
@@ -297,7 +293,7 @@ const HtmlInCanvasContent = (0, react_1.forwardRef)(({ width, height, effects, c
297
293
  placeholder.layoutSubtree = true;
298
294
  const paintTarget = usesDirectLayoutCanvas
299
295
  ? placeholder
300
- : placeholder.transferControlToOffscreen();
296
+ : getTransferredOffscreenCanvas(placeholder);
301
297
  paintTargetRef.current = paintTarget;
302
298
  resizePaintTarget({
303
299
  target: paintTarget,
@@ -362,15 +358,7 @@ const HtmlInCanvasContent = (0, react_1.forwardRef)(({ width, height, effects, c
362
358
  ...(style !== null && style !== void 0 ? style : {}),
363
359
  };
364
360
  }, [height, style, width]);
365
- const ancestorValue = (0, react_1.useMemo)(() => {
366
- return {
367
- requestParentPaint: () => {
368
- var _a, _b;
369
- (_b = (_a = canvas2dRef.current) === null || _a === void 0 ? void 0 : _a.requestPaint) === null || _b === void 0 ? void 0 : _b.call(_a);
370
- },
371
- };
372
- }, []);
373
- return (jsx_runtime_1.jsx(HtmlInCanvasAncestorContext.Provider, { value: ancestorValue, children: jsx_runtime_1.jsx("canvas", { ref: setLayoutCanvasRef, width: canvasWidth, height: canvasHeight, style: canvasStyle, children: jsx_runtime_1.jsx("div", { ref: divRef, style: innerStyle, children: children }) }, canvasSizeKey) }));
361
+ return (jsx_runtime_1.jsx(HtmlInCanvasAncestorContext.Provider, { value: true, children: jsx_runtime_1.jsx("canvas", { ref: setLayoutCanvasRef, width: canvasWidth, height: canvasHeight, style: canvasStyle, children: jsx_runtime_1.jsx("div", { ref: divRef, style: innerStyle, children: children }) }, canvasSizeKey) }));
374
362
  });
375
363
  HtmlInCanvasContent.displayName = 'HtmlInCanvasContent';
376
364
  const HtmlInCanvasInner = (0, react_1.forwardRef)(({ width, height, effects = [], children, onPaint, onInit, pixelDensity, controls, style, cropLeft, cropRight, cropTop, cropBottom, durationInFrames, name, ...sequenceProps }, ref) => {
@@ -195,6 +195,10 @@ const RegularSequenceRefForwardingFunction = ({ from = 0, trimBefore = 0, freeze
195
195
  const controlsSupportsEffects = controls === null || controls === void 0 ? void 0 : controls.supportsEffects;
196
196
  const controlsComponentIdentity = controls === null || controls === void 0 ? void 0 : controls.componentIdentity;
197
197
  const controlsComponentName = controls === null || controls === void 0 ? void 0 : controls.componentName;
198
+ const effectRuntimeValues = (0, react_1.useMemo)(() => {
199
+ var _a;
200
+ return (_a = _remotionInternalEffects === null || _remotionInternalEffects === void 0 ? void 0 : _remotionInternalEffects.runtimeValues) !== null && _a !== void 0 ? _a : null;
201
+ }, [_remotionInternalEffects]);
198
202
  const registrationControls = (0, react_1.useMemo)(() => {
199
203
  if (controlsSchema === undefined ||
200
204
  controlsRuntimeValues === undefined ||
@@ -231,6 +235,7 @@ const RegularSequenceRefForwardingFunction = ({ from = 0, trimBefore = 0, freeze
231
235
  type: 'image',
232
236
  controls: registrationControls,
233
237
  effects: _remotionInternalEffects !== null && _remotionInternalEffects !== void 0 ? _remotionInternalEffects : EMPTY_EFFECTS,
238
+ effectRuntimeValues,
234
239
  displayName: timelineClipName,
235
240
  documentationLink: resolvedDocumentationLink,
236
241
  duration: actualDurationInFrames,
@@ -256,6 +261,7 @@ const RegularSequenceRefForwardingFunction = ({ from = 0, trimBefore = 0, freeze
256
261
  type: isMedia.type,
257
262
  controls: registrationControls,
258
263
  effects: _remotionInternalEffects !== null && _remotionInternalEffects !== void 0 ? _remotionInternalEffects : EMPTY_EFFECTS,
264
+ effectRuntimeValues,
259
265
  displayName: timelineClipName,
260
266
  documentationLink: resolvedDocumentationLink,
261
267
  doesVolumeChange: isMedia.data.doesVolumeChange,
@@ -275,6 +281,7 @@ const RegularSequenceRefForwardingFunction = ({ from = 0, trimBefore = 0, freeze
275
281
  startMediaFrom: startMediaFrom !== null && startMediaFrom !== void 0 ? startMediaFrom : isMedia.data.startMediaFrom,
276
282
  mediaFrameAtSequenceZero,
277
283
  volume: isMedia.data.volumes,
284
+ muted: isMedia.data.muted,
278
285
  refForOutline: refForOutline !== null && refForOutline !== void 0 ? refForOutline : null,
279
286
  isInsideSeries,
280
287
  frozenFrame: registeredFrozenFrame,
@@ -303,6 +310,7 @@ const RegularSequenceRefForwardingFunction = ({ from = 0, trimBefore = 0, freeze
303
310
  postmountDisplay: postmountDisplay !== null && postmountDisplay !== void 0 ? postmountDisplay : null,
304
311
  controls: registrationControls,
305
312
  effects: _remotionInternalEffects !== null && _remotionInternalEffects !== void 0 ? _remotionInternalEffects : EMPTY_EFFECTS,
313
+ effectRuntimeValues,
306
314
  refForOutline: refForOutline !== null && refForOutline !== void 0 ? refForOutline : null,
307
315
  isInsideSeries,
308
316
  frozenFrame: registeredFrozenFrame,
@@ -331,6 +339,7 @@ const RegularSequenceRefForwardingFunction = ({ from = 0, trimBefore = 0, freeze
331
339
  env.isStudio,
332
340
  registrationControls,
333
341
  _remotionInternalEffects,
342
+ effectRuntimeValues,
334
343
  isMedia,
335
344
  resolvedDocumentationLink,
336
345
  refForOutline,
@@ -136,6 +136,7 @@ const AudioForDevelopmentForwardRefFunction = (props, ref) => {
136
136
  loopDisplay: undefined,
137
137
  documentationLink: 'https://www.remotion.dev/docs/html5-audio',
138
138
  refForOutline: null,
139
+ muted: muted !== null && muted !== void 0 ? muted : false,
139
140
  });
140
141
  // putting playback before useVolume
141
142
  // because volume looks at playbackrate
@@ -0,0 +1,4 @@
1
+ export declare const DELAY_RENDER_CALLSTACK_TOKEN = "The delayRender was called:";
2
+ export declare const DELAY_RENDER_RETRIES_LEFT = "Retries left: ";
3
+ export declare const DELAY_RENDER_RETRY_TOKEN = "- Rendering the frame will be retried.";
4
+ export declare const DELAY_RENDER_CLEAR_TOKEN = "handle was cleared after";
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DELAY_RENDER_CLEAR_TOKEN = exports.DELAY_RENDER_RETRY_TOKEN = exports.DELAY_RENDER_RETRIES_LEFT = exports.DELAY_RENDER_CALLSTACK_TOKEN = void 0;
4
+ exports.DELAY_RENDER_CALLSTACK_TOKEN = 'The delayRender was called:';
5
+ exports.DELAY_RENDER_RETRIES_LEFT = 'Retries left: ';
6
+ exports.DELAY_RENDER_RETRY_TOKEN = '- Rendering the frame will be retried.';
7
+ exports.DELAY_RENDER_CLEAR_TOKEN = 'handle was cleared after';
@@ -1,5 +1,6 @@
1
1
  import type { LogLevel } from './log.js';
2
2
  import type { RemotionEnvironment } from './remotion-environment-context.js';
3
+ export { DELAY_RENDER_CALLSTACK_TOKEN, DELAY_RENDER_CLEAR_TOKEN, DELAY_RENDER_RETRIES_LEFT, DELAY_RENDER_RETRY_TOKEN, } from './delay-render-constants.js';
3
4
  export type DelayRenderScope = {
4
5
  remotion_renderReady: boolean;
5
6
  remotion_delayRenderTimeouts: {
@@ -14,10 +15,6 @@ export type DelayRenderScope = {
14
15
  remotion_delayRenderHandles: number[];
15
16
  remotion_cancelledError?: string;
16
17
  };
17
- export declare const DELAY_RENDER_CALLSTACK_TOKEN = "The delayRender was called:";
18
- export declare const DELAY_RENDER_RETRIES_LEFT = "Retries left: ";
19
- export declare const DELAY_RENDER_RETRY_TOKEN = "- Rendering the frame will be retried.";
20
- export declare const DELAY_RENDER_CLEAR_TOKEN = "handle was cleared after";
21
18
  export type DelayRenderOptions = {
22
19
  timeoutInMilliseconds?: number;
23
20
  retries?: number;
@@ -47,4 +44,3 @@ type ContinueRenderInternalOptions = {
47
44
  };
48
45
  export declare const continueRenderInternal: ({ scope, handle, environment, logLevel, }: ContinueRenderInternalOptions) => void;
49
46
  export declare const continueRender: (handle: number) => void;
50
- export {};
@@ -1,10 +1,16 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.continueRender = exports.continueRenderInternal = exports.delayRender = exports.delayRenderInternal = exports.DELAY_RENDER_CLEAR_TOKEN = exports.DELAY_RENDER_RETRY_TOKEN = exports.DELAY_RENDER_RETRIES_LEFT = exports.DELAY_RENDER_CALLSTACK_TOKEN = void 0;
3
+ exports.continueRender = exports.continueRenderInternal = exports.delayRender = exports.delayRenderInternal = exports.DELAY_RENDER_RETRY_TOKEN = exports.DELAY_RENDER_RETRIES_LEFT = exports.DELAY_RENDER_CLEAR_TOKEN = exports.DELAY_RENDER_CALLSTACK_TOKEN = void 0;
4
4
  const cancel_render_js_1 = require("./cancel-render.js");
5
+ const delay_render_constants_js_1 = require("./delay-render-constants.js");
5
6
  const get_remotion_environment_js_1 = require("./get-remotion-environment.js");
6
7
  const log_js_1 = require("./log.js");
7
8
  const truthy_js_1 = require("./truthy.js");
9
+ const delay_render_constants_js_2 = require("./delay-render-constants.js");
10
+ Object.defineProperty(exports, "DELAY_RENDER_CALLSTACK_TOKEN", { enumerable: true, get: function () { return delay_render_constants_js_2.DELAY_RENDER_CALLSTACK_TOKEN; } });
11
+ Object.defineProperty(exports, "DELAY_RENDER_CLEAR_TOKEN", { enumerable: true, get: function () { return delay_render_constants_js_2.DELAY_RENDER_CLEAR_TOKEN; } });
12
+ Object.defineProperty(exports, "DELAY_RENDER_RETRIES_LEFT", { enumerable: true, get: function () { return delay_render_constants_js_2.DELAY_RENDER_RETRIES_LEFT; } });
13
+ Object.defineProperty(exports, "DELAY_RENDER_RETRY_TOKEN", { enumerable: true, get: function () { return delay_render_constants_js_2.DELAY_RENDER_RETRY_TOKEN; } });
8
14
  if (typeof window !== 'undefined') {
9
15
  window.remotion_renderReady = false;
10
16
  if (!window.remotion_delayRenderTimeouts) {
@@ -12,10 +18,6 @@ if (typeof window !== 'undefined') {
12
18
  }
13
19
  window.remotion_delayRenderHandles = [];
14
20
  }
15
- exports.DELAY_RENDER_CALLSTACK_TOKEN = 'The delayRender was called:';
16
- exports.DELAY_RENDER_RETRIES_LEFT = 'Retries left: ';
17
- exports.DELAY_RENDER_RETRY_TOKEN = '- Rendering the frame will be retried.';
18
- exports.DELAY_RENDER_CLEAR_TOKEN = 'handle was cleared after';
19
21
  const defaultTimeout = 30000;
20
22
  const delayRenderInternal = ({ scope, environment, label, options, }) => {
21
23
  var _a;
@@ -38,9 +40,9 @@ const delayRenderInternal = ({ scope, environment, label, options, }) => {
38
40
  `A delayRender()`,
39
41
  label ? `"${label}"` : null,
40
42
  `was called but not cleared after ${timeoutToUse}ms. See https://remotion.dev/docs/timeout for help.`,
41
- retriesLeft > 0 ? exports.DELAY_RENDER_RETRIES_LEFT + retriesLeft : null,
42
- retriesLeft > 0 ? exports.DELAY_RENDER_RETRY_TOKEN : null,
43
- exports.DELAY_RENDER_CALLSTACK_TOKEN,
43
+ retriesLeft > 0 ? delay_render_constants_js_1.DELAY_RENDER_RETRIES_LEFT + retriesLeft : null,
44
+ retriesLeft > 0 ? delay_render_constants_js_1.DELAY_RENDER_RETRY_TOKEN : null,
45
+ delay_render_constants_js_1.DELAY_RENDER_CALLSTACK_TOKEN,
44
46
  called,
45
47
  ]
46
48
  .filter(truthy_js_1.truthy)
@@ -90,7 +92,7 @@ const continueRenderInternal = ({ scope, handle, environment, logLevel, }) => {
90
92
  clearTimeout(timeout);
91
93
  const message = [
92
94
  label ? `"${label}"` : 'A handle',
93
- exports.DELAY_RENDER_CLEAR_TOKEN,
95
+ delay_render_constants_js_1.DELAY_RENDER_CLEAR_TOKEN,
94
96
  `${Date.now() - startTime}ms`,
95
97
  ]
96
98
  .filter(truthy_js_1.truthy)
@@ -1,8 +1,11 @@
1
+ import type { RuntimeValueStore } from '../runtime-value-store.js';
1
2
  import type { CannotUpdateEffectReason, CannotUpdateSequenceReason } from '../SequenceManager.js';
2
3
  import { type SequencePropsSubscriptionKey } from '../SequenceManager.js';
3
4
  import { type CanUpdateSequencePropStatus, type PropStatuses } from '../use-schema.js';
4
- import type { EffectDefinition, EffectDefinitionAndStack, EffectDescriptor } from './effect-types.js';
5
- export declare const useMemoizedEffectDefinitions: (effects: readonly EffectDescriptor<unknown>[]) => readonly EffectDefinition<unknown>[];
5
+ import type { EffectDefinitionAndStack, EffectDescriptor, EffectDefinition } from './effect-types.js';
6
+ export declare const useMemoizedEffectDefinitions: (effects: readonly EffectDescriptor<unknown>[]) => readonly EffectDefinition<unknown>[] & {
7
+ readonly runtimeValues: readonly RuntimeValueStore[];
8
+ };
6
9
  type EffectStatus = {
7
10
  type: 'cannot-update-sequence';
8
11
  reason: CannotUpdateSequenceReason;
@@ -4,6 +4,7 @@ exports.useMemoizedEffects = exports.getPropStatusesCtx = exports.getEffectPropS
4
4
  const react_1 = require("react");
5
5
  const get_effective_visual_mode_value_js_1 = require("../get-effective-visual-mode-value.js");
6
6
  const interpolate_keyframed_status_js_1 = require("../interpolate-keyframed-status.js");
7
+ const runtime_value_store_js_1 = require("../runtime-value-store.js");
7
8
  const sequence_node_path_js_1 = require("../sequence-node-path.js");
8
9
  const SequenceManager_js_1 = require("../SequenceManager.js");
9
10
  const use_current_frame_js_1 = require("../use-current-frame.js");
@@ -68,13 +69,25 @@ const useMemoizedEffectDefinitions = (effects) => {
68
69
  const definitions = effects.map((descriptor) => descriptor.definition);
69
70
  const previous = previousRef.current;
70
71
  const isSame = previous !== null &&
71
- previous.length === definitions.length &&
72
- previous.every((def, i) => def === definitions[i]);
73
- if (isSame) {
74
- return previous;
75
- }
76
- previousRef.current = definitions;
77
- return definitions;
72
+ previous.definitions.length === definitions.length &&
73
+ previous.definitions.every((definition, i) => definition === definitions[i]);
74
+ const controllers = isSame
75
+ ? previous.controllers
76
+ : effects.map((effect) => (0, runtime_value_store_js_1.createRuntimeValueStore)(effect.params));
77
+ const stableDefinitions = isSame ? previous.definitions : definitions;
78
+ (0, react_1.useLayoutEffect)(() => {
79
+ // Stores are intentionally updated without changing the registered effect
80
+ // array, so frame-dependent parameters don't re-register the Sequence.
81
+ stableDefinitions.forEach((_definition, index) => {
82
+ var _a;
83
+ const snapshot = (_a = effects[index]) === null || _a === void 0 ? void 0 : _a.params;
84
+ controllers[index].setSnapshot(snapshot);
85
+ });
86
+ }, [controllers, effects, stableDefinitions]);
87
+ previousRef.current = { definitions: stableDefinitions, controllers };
88
+ return Object.assign(stableDefinitions, {
89
+ runtimeValues: controllers.map((controller) => controller.store),
90
+ });
78
91
  };
79
92
  exports.useMemoizedEffectDefinitions = useMemoizedEffectDefinitions;
80
93
  const getEffectPropStatusesCtx = ({ propStatuses, nodePath, effectIndex, }) => {
@@ -5,6 +5,10 @@ export type ResolvedDragOverrideValue = {
5
5
  readonly type: 'resolved';
6
6
  readonly value: unknown;
7
7
  };
8
+ export declare const getFrameInKeyframedStatusClock: ({ frame, status, }: {
9
+ readonly frame: number;
10
+ readonly status: CanUpdateSequencePropStatusKeyframed;
11
+ }) => number;
8
12
  export declare const resolveDragOverrideValue: ({ dragOverrideValue, frame, }: {
9
13
  dragOverrideValue: DragOverrideValue | undefined;
10
14
  frame: number | null;
@@ -1,7 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getEffectiveVisualModeValue = exports.resolveDragOverrideValue = void 0;
3
+ exports.getEffectiveVisualModeValue = exports.resolveDragOverrideValue = exports.getFrameInKeyframedStatusClock = void 0;
4
4
  const interpolate_keyframed_status_1 = require("./interpolate-keyframed-status");
5
+ const getFrameInKeyframedStatusClock = ({ frame, status, }) => {
6
+ var _a;
7
+ return frame - ((_a = status.keyframeDisplayOffsetAdjustment) !== null && _a !== void 0 ? _a : 0);
8
+ };
9
+ exports.getFrameInKeyframedStatusClock = getFrameInKeyframedStatusClock;
5
10
  const resolveDragOverrideValue = ({ dragOverrideValue, frame, }) => {
6
11
  if (dragOverrideValue === undefined) {
7
12
  return { type: 'none' };
@@ -14,7 +19,10 @@ const resolveDragOverrideValue = ({ dragOverrideValue, frame, }) => {
14
19
  }
15
20
  const interpolated = (0, interpolate_keyframed_status_1.interpolateKeyframedStatus)({
16
21
  forceSpringAllowTail: null,
17
- frame,
22
+ frame: (0, exports.getFrameInKeyframedStatusClock)({
23
+ frame,
24
+ status: dragOverrideValue.status,
25
+ }),
18
26
  status: dragOverrideValue.status,
19
27
  });
20
28
  if (interpolated === null) {
@@ -35,7 +43,7 @@ const getEffectiveVisualModeValue = ({ propStatus, dragOverrideValue, defaultVal
35
43
  if (frame !== null) {
36
44
  return (0, interpolate_keyframed_status_1.interpolateKeyframedStatus)({
37
45
  forceSpringAllowTail: null,
38
- frame,
46
+ frame: (0, exports.getFrameInKeyframedStatusClock)({ frame, status: propStatus }),
39
47
  status: propStatus,
40
48
  });
41
49
  }
@@ -25,6 +25,7 @@ import type { WatchRemotionStaticFilesPayload } from './watch-static-file.js';
25
25
  import { useRemotionContexts } from './wrap-remotion-context.js';
26
26
  export type { EffectChainState } from './effects/run-effect-chain.js';
27
27
  export declare const Internals: {
28
+ readonly AbsoluteFillElement: import("react").ForwardRefExoticComponent<Omit<import("./AbsoluteFillElement.js").AbsoluteFillElementProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
28
29
  readonly MaxMediaCacheSizeContext: import("react").Context<number | null>;
29
30
  readonly makeRenderResourceManager: () => import("./render-resource-manager.js").RenderResourceManager;
30
31
  readonly RenderResourceManagerContext: import("react").Context<import("./render-resource-manager.js").RenderResourceManager | null>;
@@ -753,7 +754,7 @@ export declare const Internals: {
753
754
  readonly getRoot: () => import("react").FC<{}> | null;
754
755
  readonly useMediaVolumeState: () => readonly [number, (u: number) => void];
755
756
  readonly usePlayerMutedState: () => readonly [boolean, (u: import("react").SetStateAction<boolean>) => void];
756
- readonly useMediaInTimeline: ({ volume, mediaVolume, src, mediaType, playbackRate, displayName, id, getStack, showInTimeline, premountDisplay, postmountDisplay, loopDisplay, documentationLink, refForOutline, }: {
757
+ readonly useMediaInTimeline: ({ volume, mediaVolume, src, mediaType, playbackRate, displayName, id, getStack, showInTimeline, premountDisplay, postmountDisplay, loopDisplay, documentationLink, refForOutline, muted, }: {
757
758
  volume: import("./volume-prop.js").VolumeProp | undefined;
758
759
  mediaVolume: number;
759
760
  src: string | undefined;
@@ -768,6 +769,7 @@ export declare const Internals: {
768
769
  loopDisplay: import("./CompositionManager.js").LoopDisplay | undefined;
769
770
  documentationLink: string | null;
770
771
  refForOutline: import("react").RefObject<Element | null> | null;
772
+ muted: boolean;
771
773
  }) => void;
772
774
  readonly useLazyComponent: <Props>({ compProps, componentName, noSuspense, }: {
773
775
  compProps: CompProps<Props>;
@@ -1129,7 +1131,7 @@ export declare const Internals: {
1129
1131
  }, "ref"> & import("react").RefAttributes<HTMLAudioElement>>;
1130
1132
  readonly OBJECTFIT_CONTAIN_CLASS_NAME: "__remotion_objectfitcontain";
1131
1133
  readonly InnerOffthreadVideo: import("react").FC<import("./video/props.js").AllOffthreadVideoProps>;
1132
- readonly useBasicMediaInTimeline: ({ volume, mediaVolume, mediaType, src, displayName, trimBefore, trimAfter, playbackRate, sequenceDurationInFrames, mediaStartsAt, loop, }: {
1134
+ readonly useBasicMediaInTimeline: ({ volume, mediaVolume, mediaType, src, displayName, trimBefore, trimAfter, playbackRate, sequenceDurationInFrames, mediaStartsAt, loop, muted, }: {
1133
1135
  volume: import("./volume-prop.js").VolumeProp | undefined;
1134
1136
  mediaVolume: number;
1135
1137
  mediaType: "audio" | "image" | "video";
@@ -1141,6 +1143,7 @@ export declare const Internals: {
1141
1143
  sequenceDurationInFrames: number;
1142
1144
  mediaStartsAt: number;
1143
1145
  loop: boolean;
1146
+ muted: boolean;
1144
1147
  }) => {
1145
1148
  volumes: string | number;
1146
1149
  duration: number;
@@ -1150,6 +1153,7 @@ export declare const Internals: {
1150
1153
  startMediaFrom: number;
1151
1154
  src: string;
1152
1155
  playbackRate: number;
1156
+ muted: boolean;
1153
1157
  };
1154
1158
  readonly getInputPropsOverride: () => Record<string, unknown> | null;
1155
1159
  readonly setInputPropsOverride: (override: Record<string, unknown> | null) => void;
@@ -1197,7 +1201,9 @@ export declare const Internals: {
1197
1201
  effects: readonly import("./index.js").EffectDescriptor<unknown>[];
1198
1202
  readonly overrideId: string | null;
1199
1203
  }) => import("./index.js").EffectDefinitionAndStack<unknown>[];
1200
- readonly useMemoizedEffectDefinitions: (effects: readonly import("./index.js").EffectDescriptor<unknown>[]) => readonly import("./index.js").EffectDefinition<unknown>[];
1204
+ readonly useMemoizedEffectDefinitions: (effects: readonly import("./index.js").EffectDescriptor<unknown>[]) => readonly import("./index.js").EffectDefinition<unknown>[] & {
1205
+ readonly runtimeValues: readonly import("./runtime-value-store.js").RuntimeValueStore[];
1206
+ };
1201
1207
  readonly createEffect: <P, S>(definition: import("./index.js").EffectDefinition<P, S>) => import("./index.js").EffectFactory<P>;
1202
1208
  readonly createWebGLContextError: (effectName: string) => Error;
1203
1209
  readonly createWebGL2ContextError: (effectName: string) => Error;
@@ -36,6 +36,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
36
36
  exports.Internals = void 0;
37
37
  const react_1 = require("react");
38
38
  const absolute_src_js_1 = require("./absolute-src.js");
39
+ const AbsoluteFillElement_js_1 = require("./AbsoluteFillElement.js");
39
40
  const get_duration_in_seconds_js_1 = require("./animated-image/get-duration-in-seconds.js");
40
41
  const AudioForPreview_js_1 = require("./audio/AudioForPreview.js");
41
42
  const shared_audio_tags_js_1 = require("./audio/shared-audio-tags.js");
@@ -123,6 +124,7 @@ const compositionSelectorRef = (0, react_1.createRef)();
123
124
  // Mark them as Internals so use don't assume this is public
124
125
  // API and are less likely to use it
125
126
  exports.Internals = {
127
+ AbsoluteFillElement: AbsoluteFillElement_js_1.AbsoluteFillElement,
126
128
  MaxMediaCacheSizeContext: max_video_cache_size_js_1.MaxMediaCacheSizeContext,
127
129
  makeRenderResourceManager: render_resource_manager_js_1.makeRenderResourceManager,
128
130
  RenderResourceManagerContext: render_resource_manager_js_1.RenderResourceManagerContext,
@@ -490,8 +490,12 @@ const interpolateString = ({ input, inputRange, outputRange, options, }) => {
490
490
  var _a;
491
491
  const initiallyParsedOutputRange = outputRange.map(parseStringInterpolationValue);
492
492
  const hasAxisRotation = initiallyParsedOutputRange.some((parsed) => parsed.axisRotation);
493
+ const posterizedInput = (options === null || options === void 0 ? void 0 : options.posterize) === undefined
494
+ ? input
495
+ : Math.floor(input / options.posterize) * options.posterize;
496
+ const segmentIndex = inputRange.length === 1 ? 0 : findRange(posterizedInput, inputRange);
493
497
  const parsedOutputRange = hasAxisRotation
494
- ? initiallyParsedOutputRange.map((parsed) => {
498
+ ? initiallyParsedOutputRange.map((parsed, index) => {
495
499
  if (parsed.kind !== 'rotate') {
496
500
  return parsed;
497
501
  }
@@ -501,9 +505,22 @@ const interpolateString = ({ input, inputRange, outputRange, options, }) => {
501
505
  if (parsed.dimensions !== 1) {
502
506
  throw new TypeError('Cannot interpolate a multi-angle rotate value with an axis rotation');
503
507
  }
508
+ // A zero-degree rotation is the identity regardless of its axis. Reusing
509
+ // the active neighbor's axis prevents the axis from drifting while the
510
+ // angle interpolates away from zero.
511
+ const adjacentAxisRotation = parsed.values[0] === 0
512
+ ? index === segmentIndex
513
+ ? initiallyParsedOutputRange[index + 1]
514
+ : index === segmentIndex + 1
515
+ ? initiallyParsedOutputRange[index - 1]
516
+ : undefined
517
+ : undefined;
518
+ const axis = (adjacentAxisRotation === null || adjacentAxisRotation === void 0 ? void 0 : adjacentAxisRotation.axisRotation)
519
+ ? adjacentAxisRotation.values
520
+ : [0, 0, 1];
504
521
  return {
505
522
  kind: 'rotate',
506
- values: [0, 0, 1, parsed.values[0]],
523
+ values: [axis[0], axis[1], axis[2], parsed.values[0]],
507
524
  units: [null, null, null, parsed.units[0]],
508
525
  dimensions: 4,
509
526
  axisRotation: true,
@@ -15,6 +15,14 @@ const label = {
15
15
  const container = {
16
16
  justifyContent: 'center',
17
17
  alignItems: 'center',
18
+ backgroundColor: '#1f2428',
19
+ };
20
+ const content = {
21
+ display: 'flex',
22
+ flexDirection: 'column',
23
+ alignItems: 'center',
24
+ animation: 'anim 2s',
25
+ animationFillMode: 'forwards',
18
26
  };
19
27
  const Loading = () => {
20
28
  return (jsx_runtime_1.jsxs(AbsoluteFillElement_js_1.AbsoluteFillElement, { style: container, id: "remotion-comp-loading", children: [
@@ -27,11 +35,9 @@ const Loading = () => {
27
35
  opacity: 1
28
36
  }
29
37
  }
30
- #remotion-comp-loading {
31
- animation: anim 2s;
32
- animation-fill-mode: forwards;
33
- }
34
- ` }), jsx_runtime_1.jsx("svg", { width: ICON_SIZE, height: ICON_SIZE, viewBox: "-100 -100 400 400", style: rotate, children: jsx_runtime_1.jsx("path", { fill: "#555", stroke: "#555", strokeWidth: "100", strokeLinejoin: "round", d: "M 2 172 a 196 100 0 0 0 195 5 A 196 240 0 0 0 100 2.259 A 196 240 0 0 0 2 172 z" }) }), jsx_runtime_1.jsxs("p", { style: label, children: ["Resolving ", '<Suspense>', "..."] })
38
+ ` }), jsx_runtime_1.jsxs("div", { id: "remotion-comp-loading-content", style: content, children: [
39
+ jsx_runtime_1.jsx("svg", { width: ICON_SIZE, height: ICON_SIZE, viewBox: "-100 -100 400 400", style: rotate, children: jsx_runtime_1.jsx("path", { fill: "#555", stroke: "#555", strokeWidth: "100", strokeLinejoin: "round", d: "M 2 172 a 196 100 0 0 0 195 5 A 196 240 0 0 0 100 2.259 A 196 240 0 0 0 2 172 z" }) }), jsx_runtime_1.jsxs("p", { style: label, children: ["Resolving ", '<Suspense>', "..."] })
40
+ ] })
35
41
  ] }));
36
42
  };
37
43
  exports.Loading = Loading;
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "assertValidInterpolatePosterizeOption", { enumer
7
7
  Object.defineProperty(exports, "interpolate", { enumerable: true, get: function () { return interpolate_1.interpolate; } });
8
8
  const random_js_1 = require("./random.js");
9
9
  Object.defineProperty(exports, "random", { enumerable: true, get: function () { return random_js_1.random; } });
10
- const delay_render_1 = require("./delay-render");
10
+ const delay_render_constants_1 = require("./delay-render-constants");
11
11
  const find_props_to_delete_1 = require("./find-props-to-delete");
12
12
  const input_props_serialization_1 = require("./input-props-serialization");
13
13
  const input_props_serialization_js_1 = require("./input-props-serialization.js");
@@ -37,10 +37,10 @@ exports.NoReactInternals = {
37
37
  bundleName: 'bundle.js',
38
38
  bundleMapName: 'bundle.js.map',
39
39
  deserializeJSONWithSpecialTypes: input_props_serialization_1.deserializeJSONWithSpecialTypes,
40
- DELAY_RENDER_CALLSTACK_TOKEN: delay_render_1.DELAY_RENDER_CALLSTACK_TOKEN,
41
- DELAY_RENDER_RETRY_TOKEN: delay_render_1.DELAY_RENDER_RETRY_TOKEN,
42
- DELAY_RENDER_CLEAR_TOKEN: delay_render_1.DELAY_RENDER_CLEAR_TOKEN,
43
- DELAY_RENDER_ATTEMPT_TOKEN: delay_render_1.DELAY_RENDER_RETRIES_LEFT,
40
+ DELAY_RENDER_CALLSTACK_TOKEN: delay_render_constants_1.DELAY_RENDER_CALLSTACK_TOKEN,
41
+ DELAY_RENDER_RETRY_TOKEN: delay_render_constants_1.DELAY_RENDER_RETRY_TOKEN,
42
+ DELAY_RENDER_CLEAR_TOKEN: delay_render_constants_1.DELAY_RENDER_CLEAR_TOKEN,
43
+ DELAY_RENDER_ATTEMPT_TOKEN: delay_render_constants_1.DELAY_RENDER_RETRIES_LEFT,
44
44
  getOffthreadVideoSource: offthread_video_source_1.getOffthreadVideoSource,
45
45
  getExpectedMediaFrameUncorrected: get_current_time_1.getExpectedMediaFrameUncorrected,
46
46
  ENABLE_V5_BREAKING_CHANGES: v5_flag_1.ENABLE_V5_BREAKING_CHANGES,
@@ -127,7 +127,7 @@ const SeriesInner = (props) => {
127
127
  const currentStartFrame = startFrame + offset;
128
128
  const nextStartFrame = startFrame + durationInFramesProp + offset;
129
129
  return (jsx_runtime_1.jsxs(jsx_runtime_1.Fragment, { children: [
130
- jsx_runtime_1.jsx(SequenceWithoutSchemaWithRef, { ref: ref, name: name || '<Series.Sequence>', _remotionInternalDocumentationLink: name ? undefined : 'https://www.remotion.dev/docs/series', controls: controls !== null && controls !== void 0 ? controls : undefined, from: currentStartFrame, durationInFrames: durationInFramesProp, ...passedProps, children: jsx_runtime_1.jsx(is_inside_series_js_1.IsNotInsideSeriesProvider, { children: sequenceChildren }) }), renderChildren(i + 1, nextStartFrame)] }));
130
+ jsx_runtime_1.jsx(SequenceWithoutSchemaWithRef, { ref: ref, name: name || '<Series.Sequence>', _remotionInternalDocumentationLink: name ? undefined : 'https://www.remotion.dev/docs/series', controls: controls !== null && controls !== void 0 ? controls : undefined, from: currentStartFrame, durationInFrames: durationInFramesProp, ...passedProps, _remotionInternalSingleChildComponent: (0, enable_sequence_stack_traces_js_1.getSingleChildComponent)(sequenceChildren), children: jsx_runtime_1.jsx(is_inside_series_js_1.IsNotInsideSeriesProvider, { children: sequenceChildren }) }), renderChildren(i + 1, nextStartFrame)] }));
131
131
  },
132
132
  });
133
133
  };
@@ -1,6 +1,6 @@
1
1
  import type { LoopDisplay } from './CompositionManager.js';
2
2
  import type { VolumeProp } from './volume-prop.js';
3
- export declare const useBasicMediaInTimeline: ({ volume, mediaVolume, mediaType, src, displayName, trimBefore, trimAfter, playbackRate, sequenceDurationInFrames, mediaStartsAt, loop, }: {
3
+ export declare const useBasicMediaInTimeline: ({ volume, mediaVolume, mediaType, src, displayName, trimBefore, trimAfter, playbackRate, sequenceDurationInFrames, mediaStartsAt, loop, muted, }: {
4
4
  volume: VolumeProp | undefined;
5
5
  mediaVolume: number;
6
6
  mediaType: "audio" | "image" | "video";
@@ -12,6 +12,7 @@ export declare const useBasicMediaInTimeline: ({ volume, mediaVolume, mediaType,
12
12
  sequenceDurationInFrames: number;
13
13
  mediaStartsAt: number;
14
14
  loop: boolean;
15
+ muted: boolean;
15
16
  }) => {
16
17
  volumes: string | number;
17
18
  duration: number;
@@ -21,9 +22,10 @@ export declare const useBasicMediaInTimeline: ({ volume, mediaVolume, mediaType,
21
22
  startMediaFrom: number;
22
23
  src: string;
23
24
  playbackRate: number;
25
+ muted: boolean;
24
26
  };
25
27
  export type BasicMediaInTimelineReturnType = ReturnType<typeof useBasicMediaInTimeline>;
26
- export declare const useMediaInTimeline: ({ volume, mediaVolume, src, mediaType, playbackRate, displayName, id, getStack, showInTimeline, premountDisplay, postmountDisplay, loopDisplay, documentationLink, refForOutline, }: {
28
+ export declare const useMediaInTimeline: ({ volume, mediaVolume, src, mediaType, playbackRate, displayName, id, getStack, showInTimeline, premountDisplay, postmountDisplay, loopDisplay, documentationLink, refForOutline, muted, }: {
27
29
  volume: VolumeProp | undefined;
28
30
  mediaVolume: number;
29
31
  src: string | undefined;
@@ -38,4 +40,5 @@ export declare const useMediaInTimeline: ({ volume, mediaVolume, src, mediaType,
38
40
  loopDisplay: LoopDisplay | undefined;
39
41
  documentationLink: string | null;
40
42
  refForOutline: import("react").RefObject<Element | null> | null;
43
+ muted: boolean;
41
44
  }) => void;