@remotion/promo-pages 4.0.388 → 4.0.391

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.
@@ -96,9 +96,9 @@ import {
96
96
  useImperativeHandle as useImperativeHandle5,
97
97
  useLayoutEffect as useLayoutEffect3,
98
98
  useMemo as useMemo11,
99
+ useRef as useRef5,
99
100
  useState as useState8
100
101
  } from "react";
101
- import { flushSync } from "react-dom";
102
102
  import { jsx as jsx12 } from "react/jsx-runtime";
103
103
  import { forwardRef as forwardRef6, useCallback as useCallback11, useContext as useContext27 } from "react";
104
104
  import React12, { createContext as createContext13, useMemo as useMemo12 } from "react";
@@ -114,22 +114,22 @@ import {
114
114
  useEffect as useEffect12,
115
115
  useImperativeHandle as useImperativeHandle6,
116
116
  useMemo as useMemo21,
117
- useRef as useRef12,
117
+ useRef as useRef13,
118
118
  useState as useState15
119
119
  } from "react";
120
- import { useContext as useContext17, useLayoutEffect as useLayoutEffect5, useRef as useRef7 } from "react";
120
+ import { useContext as useContext17, useLayoutEffect as useLayoutEffect5, useRef as useRef8 } from "react";
121
121
  import React15, {
122
122
  createContext as createContext16,
123
123
  createRef as createRef2,
124
124
  useCallback as useCallback7,
125
125
  useContext as useContext16,
126
126
  useMemo as useMemo15,
127
- useRef as useRef5,
127
+ useRef as useRef6,
128
128
  useState as useState11
129
129
  } from "react";
130
130
  import { useMemo as useMemo14 } from "react";
131
131
  import { jsx as jsx16, jsxs as jsxs2 } from "react/jsx-runtime";
132
- import { useRef as useRef6 } from "react";
132
+ import { useRef as useRef7 } from "react";
133
133
  import { useContext as useContext19, useEffect as useEffect6, useMemo as useMemo16, useState as useState12 } from "react";
134
134
  import { useContext as useContext18 } from "react";
135
135
  import {
@@ -137,9 +137,9 @@ import {
137
137
  useContext as useContext22,
138
138
  useEffect as useEffect10,
139
139
  useLayoutEffect as useLayoutEffect7,
140
- useRef as useRef11
140
+ useRef as useRef12
141
141
  } from "react";
142
- import { useCallback as useCallback9, useMemo as useMemo19, useRef as useRef9 } from "react";
142
+ import { useCallback as useCallback9, useMemo as useMemo19, useRef as useRef10 } from "react";
143
143
  import { useContext as useContext21, useMemo as useMemo18 } from "react";
144
144
  import React16, {
145
145
  useCallback as useCallback8,
@@ -147,13 +147,13 @@ import React16, {
147
147
  useEffect as useEffect7,
148
148
  useLayoutEffect as useLayoutEffect6,
149
149
  useMemo as useMemo17,
150
- useRef as useRef8,
150
+ useRef as useRef9,
151
151
  useState as useState13
152
152
  } from "react";
153
153
  import { jsx as jsx17 } from "react/jsx-runtime";
154
154
  import React17 from "react";
155
155
  import { useEffect as useEffect8, useState as useState14 } from "react";
156
- import { useEffect as useEffect9, useRef as useRef10 } from "react";
156
+ import { useEffect as useEffect9, useRef as useRef11 } from "react";
157
157
  import { useContext as useContext23, useEffect as useEffect11 } from "react";
158
158
  import { createContext as createContext17, useContext as useContext24, useMemo as useMemo20 } from "react";
159
159
  import { jsx as jsx18 } from "react/jsx-runtime";
@@ -164,7 +164,7 @@ import {
164
164
  useImperativeHandle as useImperativeHandle7,
165
165
  useLayoutEffect as useLayoutEffect8,
166
166
  useMemo as useMemo222,
167
- useRef as useRef13
167
+ useRef as useRef14
168
168
  } from "react";
169
169
  import { jsx as jsx19 } from "react/jsx-runtime";
170
170
  import { jsx as jsx20 } from "react/jsx-runtime";
@@ -183,7 +183,7 @@ import {
183
183
  useContext as useContext30,
184
184
  useImperativeHandle as useImperativeHandle8,
185
185
  useLayoutEffect as useLayoutEffect9,
186
- useRef as useRef14
186
+ useRef as useRef15
187
187
  } from "react";
188
188
  import { jsx as jsx25 } from "react/jsx-runtime";
189
189
  import { createRef as createRef3 } from "react";
@@ -192,7 +192,7 @@ import {
192
192
  useCallback as useCallback14,
193
193
  useImperativeHandle as useImperativeHandle9,
194
194
  useMemo as useMemo25,
195
- useRef as useRef15,
195
+ useRef as useRef16,
196
196
  useState as useState17
197
197
  } from "react";
198
198
  import { jsx as jsx26 } from "react/jsx-runtime";
@@ -218,7 +218,7 @@ import {
218
218
  useEffect as useEffect19,
219
219
  useImperativeHandle as useImperativeHandle10,
220
220
  useMemo as useMemo29,
221
- useRef as useRef16,
221
+ useRef as useRef17,
222
222
  useState as useState20
223
223
  } from "react";
224
224
  import { useEffect as useEffect18 } from "react";
@@ -240,7 +240,7 @@ import {
240
240
  useImperativeHandle as useImperativeHandle11,
241
241
  useLayoutEffect as useLayoutEffect11,
242
242
  useMemo as useMemo32,
243
- useRef as useRef17
243
+ useRef as useRef18
244
244
  } from "react";
245
245
  import { jsx as jsx35 } from "react/jsx-runtime";
246
246
  import { jsx as jsx36 } from "react/jsx-runtime";
@@ -755,7 +755,7 @@ var __defProp2, __export2 = (target, all) => {
755
755
  });
756
756
  }, useIsPlayer = () => {
757
757
  return useContext(IsPlayerContext);
758
- }, VERSION = "4.0.388", checkMultipleRemotionVersions = () => {
758
+ }, VERSION = "4.0.391", checkMultipleRemotionVersions = () => {
759
759
  if (typeof globalThis === "undefined") {
760
760
  return;
761
761
  }
@@ -1582,6 +1582,9 @@ Check that all your Remotion packages are on the same version. If your dependenc
1582
1582
  }
1583
1583
  const unclamped = state.frame[videoConfig.id] ?? (env.isPlayer ? 0 : getFrameForComposition(videoConfig.id));
1584
1584
  return Math.min(videoConfig.durationInFrames - 1, unclamped);
1585
+ }, useTimelineFrameRef = () => {
1586
+ const { frameRef } = useContext6(TimelineContext);
1587
+ return frameRef;
1585
1588
  }, useTimelineSetFrame = () => {
1586
1589
  const { setFrame } = useContext6(SetTimelineContext);
1587
1590
  return setFrame;
@@ -1647,7 +1650,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
1647
1650
  }
1648
1651
  }, error = (options, ...args) => {
1649
1652
  return console.error(...transformArgs({ args, logLevel: "error", tag: options.tag }));
1650
- }, Log, handles, DELAY_RENDER_CALLSTACK_TOKEN = "The delayRender was called:", DELAY_RENDER_RETRIES_LEFT = "Retries left: ", DELAY_RENDER_RETRY_TOKEN = "- Rendering the frame will be retried.", DELAY_RENDER_CLEAR_TOKEN = "handle was cleared after", defaultTimeout = 30000, delayRenderInternal = ({
1653
+ }, Log, DELAY_RENDER_CALLSTACK_TOKEN = "The delayRender was called:", DELAY_RENDER_RETRIES_LEFT = "Retries left: ", DELAY_RENDER_RETRY_TOKEN = "- Rendering the frame will be retried.", DELAY_RENDER_CLEAR_TOKEN = "handle was cleared after", defaultTimeout = 30000, delayRenderInternal = ({
1651
1654
  scope,
1652
1655
  environment,
1653
1656
  label,
@@ -1657,33 +1660,29 @@ Check that all your Remotion packages are on the same version. If your dependenc
1657
1660
  throw new Error("The label parameter of delayRender() must be a string or undefined, got: " + JSON.stringify(label));
1658
1661
  }
1659
1662
  const handle = Math.random();
1660
- handles.push(handle);
1663
+ scope.remotion_delayRenderHandles.push(handle);
1661
1664
  const called = Error().stack?.replace(/^Error/g, "") ?? "";
1662
1665
  if (environment.isRendering) {
1663
- const timeoutToUse = (options?.timeoutInMilliseconds ?? (typeof scope === "undefined" ? defaultTimeout : scope.remotion_puppeteerTimeout ?? defaultTimeout)) - 2000;
1664
- if (typeof scope !== "undefined") {
1665
- const retriesLeft = (options?.retries ?? 0) - (scope.remotion_attempt - 1);
1666
- scope.remotion_delayRenderTimeouts[handle] = {
1667
- label: label ?? null,
1668
- startTime: Date.now(),
1669
- timeout: setTimeout(() => {
1670
- const message = [
1671
- `A delayRender()`,
1672
- label ? `"${label}"` : null,
1673
- `was called but not cleared after ${timeoutToUse}ms. See https://remotion.dev/docs/timeout for help.`,
1674
- retriesLeft > 0 ? DELAY_RENDER_RETRIES_LEFT + retriesLeft : null,
1675
- retriesLeft > 0 ? DELAY_RENDER_RETRY_TOKEN : null,
1676
- DELAY_RENDER_CALLSTACK_TOKEN,
1677
- called
1678
- ].filter(truthy2).join(" ");
1679
- cancelRenderInternal(scope, Error(message));
1680
- }, timeoutToUse)
1681
- };
1682
- }
1683
- }
1684
- if (typeof scope !== "undefined") {
1685
- scope.remotion_renderReady = false;
1666
+ const timeoutToUse = (options?.timeoutInMilliseconds ?? scope.remotion_puppeteerTimeout ?? defaultTimeout) - 2000;
1667
+ const retriesLeft = (options?.retries ?? 0) - (scope.remotion_attempt - 1);
1668
+ scope.remotion_delayRenderTimeouts[handle] = {
1669
+ label: label ?? null,
1670
+ startTime: Date.now(),
1671
+ timeout: setTimeout(() => {
1672
+ const message = [
1673
+ `A delayRender()`,
1674
+ label ? `"${label}"` : null,
1675
+ `was called but not cleared after ${timeoutToUse}ms. See https://remotion.dev/docs/timeout for help.`,
1676
+ retriesLeft > 0 ? DELAY_RENDER_RETRIES_LEFT + retriesLeft : null,
1677
+ retriesLeft > 0 ? DELAY_RENDER_RETRY_TOKEN : null,
1678
+ DELAY_RENDER_CALLSTACK_TOKEN,
1679
+ called
1680
+ ].filter(truthy2).join(" ");
1681
+ cancelRenderInternal(scope, Error(message));
1682
+ }, timeoutToUse)
1683
+ };
1686
1684
  }
1685
+ scope.remotion_renderReady = false;
1687
1686
  return handle;
1688
1687
  }, continueRenderInternal = ({
1689
1688
  scope,
@@ -1697,7 +1696,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
1697
1696
  if (typeof handle !== "number") {
1698
1697
  throw new TypeError("The parameter passed into continueRender() must be the return value of delayRender() which is a number. Got: " + JSON.stringify(handle));
1699
1698
  }
1700
- handles = handles.filter((h) => {
1699
+ scope.remotion_delayRenderHandles = scope.remotion_delayRenderHandles.filter((h) => {
1701
1700
  if (h === handle) {
1702
1701
  if (environment.isRendering && scope !== undefined) {
1703
1702
  if (!scope.remotion_delayRenderTimeouts[handle]) {
@@ -1717,7 +1716,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
1717
1716
  }
1718
1717
  return true;
1719
1718
  });
1720
- if (handles.length === 0 && typeof scope !== "undefined") {
1719
+ if (scope.remotion_delayRenderHandles.length === 0) {
1721
1720
  scope.remotion_renderReady = true;
1722
1721
  }
1723
1722
  }, LogLevelContext, useLogLevel = () => {
@@ -1734,19 +1733,25 @@ Check that all your Remotion packages are on the same version. If your dependenc
1734
1733
  return mountTime;
1735
1734
  }, DelayRenderContextType, useDelayRender = () => {
1736
1735
  const environment = useRemotionEnvironment();
1737
- const scope = useContext8(DelayRenderContextType);
1736
+ const scope = useContext8(DelayRenderContextType) ?? (typeof window !== "undefined" ? window : undefined);
1738
1737
  const logLevel = useLogLevel();
1739
1738
  const delayRender2 = useCallback4((label, options) => {
1739
+ if (!scope) {
1740
+ return Math.random();
1741
+ }
1740
1742
  return delayRenderInternal({
1741
- scope: scope ?? (typeof window !== "undefined" ? window : undefined),
1743
+ scope,
1742
1744
  environment,
1743
1745
  label: label ?? null,
1744
1746
  options: options ?? {}
1745
1747
  });
1746
1748
  }, [environment, scope]);
1747
1749
  const continueRender2 = useCallback4((handle) => {
1750
+ if (!scope) {
1751
+ return;
1752
+ }
1748
1753
  continueRenderInternal({
1749
- scope: scope ?? (typeof window !== "undefined" ? window : undefined),
1754
+ scope,
1750
1755
  handle,
1751
1756
  environment,
1752
1757
  logLevel
@@ -1764,6 +1769,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
1764
1769
  const [remotionRootId] = useState5(() => String(random(null)));
1765
1770
  const [_frame, setFrame] = useState5(() => getInitialFrameState());
1766
1771
  const frame = frameState ?? _frame;
1772
+ const frameRef = useRef2(0);
1767
1773
  const { delayRender: delayRender2, continueRender: continueRender2 } = useDelayRender();
1768
1774
  if (typeof window !== "undefined") {
1769
1775
  useLayoutEffect(() => {
@@ -1799,7 +1805,8 @@ Check that all your Remotion packages are on the same version. If your dependenc
1799
1805
  rootId: remotionRootId,
1800
1806
  playbackRate,
1801
1807
  setPlaybackRate,
1802
- audioAndVideoTags
1808
+ audioAndVideoTags,
1809
+ frameRef
1803
1810
  };
1804
1811
  }, [frame, playbackRate, playing, remotionRootId]);
1805
1812
  const setTimelineContextValue = useMemo7(() => {
@@ -2430,37 +2437,38 @@ Check that all your Remotion packages are on the same version. If your dependenc
2430
2437
  validateContent(artifact.content);
2431
2438
  }, RenderAssetManager, RenderAssetManagerProvider = ({ children, collectAssets }) => {
2432
2439
  const [renderAssets, setRenderAssets] = useState8([]);
2440
+ const renderAssetsRef = useRef5([]);
2433
2441
  const registerRenderAsset = useCallback6((renderAsset) => {
2434
2442
  validateRenderAsset(renderAsset);
2435
- setRenderAssets((assets) => {
2436
- return [...assets, renderAsset];
2437
- });
2443
+ renderAssetsRef.current = [...renderAssetsRef.current, renderAsset];
2444
+ setRenderAssets(renderAssetsRef.current);
2438
2445
  }, []);
2439
2446
  if (collectAssets) {
2440
2447
  useImperativeHandle5(collectAssets, () => {
2441
2448
  return {
2442
2449
  collectAssets: () => {
2443
- flushSync(() => {
2444
- setRenderAssets([]);
2445
- });
2446
- return renderAssets;
2450
+ const assets = renderAssetsRef.current;
2451
+ renderAssetsRef.current = [];
2452
+ setRenderAssets([]);
2453
+ return assets;
2447
2454
  }
2448
2455
  };
2449
- }, [renderAssets]);
2456
+ }, []);
2450
2457
  }
2451
2458
  const unregisterRenderAsset = useCallback6((id) => {
2452
- setRenderAssets((assts) => {
2453
- return assts.filter((a) => a.id !== id);
2454
- });
2459
+ renderAssetsRef.current = renderAssetsRef.current.filter((a) => a.id !== id);
2460
+ setRenderAssets(renderAssetsRef.current);
2455
2461
  }, []);
2456
2462
  useLayoutEffect3(() => {
2457
2463
  if (typeof window !== "undefined") {
2458
2464
  window.remotion_collectAssets = () => {
2465
+ const assets = renderAssetsRef.current;
2466
+ renderAssetsRef.current = [];
2459
2467
  setRenderAssets([]);
2460
- return renderAssets;
2468
+ return assets;
2461
2469
  };
2462
2470
  }
2463
- }, [renderAssets]);
2471
+ }, []);
2464
2472
  const contextValue = useMemo11(() => {
2465
2473
  return {
2466
2474
  registerRenderAsset,
@@ -3061,7 +3069,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
3061
3069
  }
3062
3070
  return true;
3063
3071
  }, SharedAudioContext, SharedAudioContextProvider = ({ children, numberOfAudioTags, audioLatencyHint }) => {
3064
- const audios = useRef5([]);
3072
+ const audios = useRef6([]);
3065
3073
  const [initialNumberOfAudioTags] = useState11(numberOfAudioTags);
3066
3074
  if (numberOfAudioTags !== initialNumberOfAudioTags) {
3067
3075
  throw new Error("The number of shared audio tags has changed dynamically. Once you have set this property, you cannot change it afterwards.");
@@ -3081,7 +3089,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
3081
3089
  };
3082
3090
  });
3083
3091
  }, [audioContext, numberOfAudioTags]);
3084
- const takenAudios = useRef5(new Array(numberOfAudioTags).fill(false));
3092
+ const takenAudios = useRef6(new Array(numberOfAudioTags).fill(false));
3085
3093
  const rerenderAudios = useCallback7(() => {
3086
3094
  refs.forEach(({ ref, id }) => {
3087
3095
  const data = audios.current?.find((a) => a.id === id);
@@ -3104,7 +3112,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
3104
3112
  });
3105
3113
  }, [refs]);
3106
3114
  const registerAudio = useCallback7((options) => {
3107
- const { aud, audioId, premounting } = options;
3115
+ const { aud, audioId, premounting, postmounting } = options;
3108
3116
  const found = audios.current?.find((a) => a.audioId === audioId);
3109
3117
  if (found) {
3110
3118
  return found;
@@ -3123,7 +3131,9 @@ Check that all your Remotion packages are on the same version. If your dependenc
3123
3131
  el: ref,
3124
3132
  audioId,
3125
3133
  mediaElementSourceNode,
3126
- premounting
3134
+ premounting,
3135
+ audioMounted: Boolean(ref.current),
3136
+ postmounting
3127
3137
  };
3128
3138
  audios.current?.push(newElem);
3129
3139
  rerenderAudios();
@@ -3144,12 +3154,17 @@ Check that all your Remotion packages are on the same version. If your dependenc
3144
3154
  aud,
3145
3155
  audioId,
3146
3156
  id,
3147
- premounting
3157
+ premounting,
3158
+ postmounting
3148
3159
  }) => {
3149
3160
  let changed = false;
3150
3161
  audios.current = audios.current?.map((prevA) => {
3162
+ const audioMounted = Boolean(prevA.el.current);
3163
+ if (prevA.audioMounted !== audioMounted) {
3164
+ changed = true;
3165
+ }
3151
3166
  if (prevA.id === id) {
3152
- const isTheSame = compareProps(aud, prevA.props) && prevA.premounting === premounting;
3167
+ const isTheSame = compareProps(aud, prevA.props) && prevA.premounting === premounting && prevA.postmounting === postmounting;
3153
3168
  if (isTheSame) {
3154
3169
  return prevA;
3155
3170
  }
@@ -3158,7 +3173,9 @@ Check that all your Remotion packages are on the same version. If your dependenc
3158
3173
  ...prevA,
3159
3174
  props: aud,
3160
3175
  premounting,
3161
- audioId
3176
+ postmounting,
3177
+ audioId,
3178
+ audioMounted
3162
3179
  };
3163
3180
  }
3164
3181
  return prevA;
@@ -3220,12 +3237,13 @@ Check that all your Remotion packages are on the same version. If your dependenc
3220
3237
  }, useSharedAudio = ({
3221
3238
  aud,
3222
3239
  audioId,
3223
- premounting
3240
+ premounting,
3241
+ postmounting
3224
3242
  }) => {
3225
3243
  const ctx = useContext16(SharedAudioContext);
3226
3244
  const [elem] = useState11(() => {
3227
3245
  if (ctx && ctx.numberOfAudioTags > 0) {
3228
- return ctx.registerAudio({ aud, audioId, premounting });
3246
+ return ctx.registerAudio({ aud, audioId, premounting, postmounting });
3229
3247
  }
3230
3248
  const el = React15.createRef();
3231
3249
  const mediaElementSourceNode = ctx?.audioContext ? makeSharedElementSourceNode({
@@ -3238,16 +3256,18 @@ Check that all your Remotion packages are on the same version. If your dependenc
3238
3256
  props: aud,
3239
3257
  audioId,
3240
3258
  mediaElementSourceNode,
3241
- premounting
3259
+ premounting,
3260
+ audioMounted: Boolean(el.current),
3261
+ postmounting
3242
3262
  };
3243
3263
  });
3244
3264
  const effectToUse = React15.useInsertionEffect ?? React15.useLayoutEffect;
3245
3265
  if (typeof document !== "undefined") {
3246
3266
  effectToUse(() => {
3247
3267
  if (ctx && ctx.numberOfAudioTags > 0) {
3248
- ctx.updateAudio({ id: elem.id, aud, audioId, premounting });
3268
+ ctx.updateAudio({ id: elem.id, aud, audioId, premounting, postmounting });
3249
3269
  }
3250
- }, [aud, ctx, elem.id, audioId, premounting]);
3270
+ }, [aud, ctx, elem.id, audioId, premounting, postmounting]);
3251
3271
  effectToUse(() => {
3252
3272
  return () => {
3253
3273
  if (ctx && ctx.numberOfAudioTags > 0) {
@@ -3337,9 +3357,9 @@ Check that all your Remotion packages are on the same version. If your dependenc
3337
3357
  duration: initialDuration,
3338
3358
  fps
3339
3359
  }) => {
3340
- const actualFromRef = useRef6(initialActualFrom);
3341
- const actualDuration = useRef6(initialDuration);
3342
- const actualSrc = useRef6(initialActualSrc);
3360
+ const actualFromRef = useRef7(initialActualFrom);
3361
+ const actualDuration = useRef7(initialDuration);
3362
+ const actualSrc = useRef7(initialActualSrc);
3343
3363
  if (!isSubsetOfDuration({
3344
3364
  prevStartFrom: actualFromRef.current,
3345
3365
  newStartFrom: initialActualFrom,
@@ -3373,8 +3393,8 @@ Check that all your Remotion packages are on the same version. If your dependenc
3373
3393
  source,
3374
3394
  shouldUseWebAudioApi
3375
3395
  }) => {
3376
- const audioStuffRef = useRef7(null);
3377
- const currentVolumeRef = useRef7(volume);
3396
+ const audioStuffRef = useRef8(null);
3397
+ const currentVolumeRef = useRef8(volume);
3378
3398
  currentVolumeRef.current = volume;
3379
3399
  const sharedAudioContext = useContext17(SharedAudioContext);
3380
3400
  if (!sharedAudioContext) {
@@ -3623,7 +3643,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
3623
3643
  const [blocks, setBlocks] = useState13([]);
3624
3644
  const [onBufferingCallbacks, setOnBufferingCallbacks] = useState13([]);
3625
3645
  const [onResumeCallbacks, setOnResumeCallbacks] = useState13([]);
3626
- const buffering = useRef8(false);
3646
+ const buffering = useRef9(false);
3627
3647
  const addBlock = useCallback8((block) => {
3628
3648
  setBlocks((b) => [...b, block]);
3629
3649
  return {
@@ -3734,7 +3754,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
3734
3754
  logLevel,
3735
3755
  mountTime
3736
3756
  }) => {
3737
- const bufferingRef = useRef9(false);
3757
+ const bufferingRef = useRef10(false);
3738
3758
  const { delayPlayback } = useBufferState();
3739
3759
  const bufferUntilFirstFrame = useCallback9((requestedTime) => {
3740
3760
  if (mediaType !== "video") {
@@ -3984,7 +4004,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
3984
4004
  lastSeek,
3985
4005
  onVariableFpsVideoDetected
3986
4006
  }) => {
3987
- const currentTime = useRef10(null);
4007
+ const currentTime = useRef11(null);
3988
4008
  useEffect9(() => {
3989
4009
  const { current } = mediaRef;
3990
4010
  if (current) {
@@ -4108,14 +4128,14 @@ Check that all your Remotion packages are on the same version. If your dependenc
4108
4128
  const buffering = useContext22(BufferingContextReact);
4109
4129
  const { fps } = useVideoConfig();
4110
4130
  const mediaStartsAt = useMediaStartsAt();
4111
- const lastSeekDueToShift = useRef11(null);
4112
- const lastSeek = useRef11(null);
4131
+ const lastSeekDueToShift = useRef12(null);
4132
+ const lastSeek = useRef12(null);
4113
4133
  const logLevel = useLogLevel();
4114
4134
  const mountTime = useMountTime();
4115
4135
  if (!buffering) {
4116
4136
  throw new Error("useMediaPlayback must be used inside a <BufferingContext>");
4117
4137
  }
4118
- const isVariableFpsVideoMap = useRef11({});
4138
+ const isVariableFpsVideoMap = useRef12({});
4119
4139
  const onVariableFpsVideoDetected = useCallback10(() => {
4120
4140
  if (!src) {
4121
4141
  return;
@@ -4485,7 +4505,8 @@ Check that all your Remotion packages are on the same version. If your dependenc
4485
4505
  const { el: audioRef, mediaElementSourceNode } = useSharedAudio({
4486
4506
  aud: propsToPass,
4487
4507
  audioId: id,
4488
- premounting: Boolean(sequenceContext?.premounting)
4508
+ premounting: Boolean(sequenceContext?.premounting),
4509
+ postmounting: Boolean(sequenceContext?.postmounting)
4489
4510
  });
4490
4511
  useMediaInTimeline({
4491
4512
  volume,
@@ -4531,7 +4552,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
4531
4552
  useImperativeHandle6(ref, () => {
4532
4553
  return audioRef.current;
4533
4554
  }, [audioRef]);
4534
- const currentOnDurationCallback = useRef12(onDuration);
4555
+ const currentOnDurationCallback = useRef13(onDuration);
4535
4556
  currentOnDurationCallback.current = onDuration;
4536
4557
  useEffect12(() => {
4537
4558
  const { current } = audioRef;
@@ -4560,7 +4581,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
4560
4581
  ...propsToPass
4561
4582
  });
4562
4583
  }, AudioForPreview, AudioForRenderingRefForwardingFunction = (props, ref) => {
4563
- const audioRef = useRef13(null);
4584
+ const audioRef = useRef14(null);
4564
4585
  const {
4565
4586
  volume: volumeProp,
4566
4587
  playbackRate,
@@ -5067,8 +5088,8 @@ Check that all your Remotion packages are on the same version. If your dependenc
5067
5088
  crossOrigin,
5068
5089
  ...props2
5069
5090
  }, ref) => {
5070
- const imageRef = useRef14(null);
5071
- const errors = useRef14({});
5091
+ const imageRef = useRef15(null);
5092
+ const errors = useRef15({});
5072
5093
  const { delayPlayback } = useBufferState();
5073
5094
  const sequenceContext = useContext30(SequenceContext);
5074
5095
  if (!src) {
@@ -5207,7 +5228,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
5207
5228
  const [folders, setFolders] = useState17([]);
5208
5229
  const [canvasContent, setCanvasContent] = useState17(initialCanvasContent);
5209
5230
  const [compositions, setCompositions] = useState17(initialCompositions);
5210
- const currentcompositionsRef = useRef15(compositions);
5231
+ const currentcompositionsRef = useRef16(compositions);
5211
5232
  const updateCompositions = useCallback14((updateComps) => {
5212
5233
  setCompositions((comps) => {
5213
5234
  const updated = updateComps(comps);
@@ -5726,7 +5747,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
5726
5747
  if (!context) {
5727
5748
  throw new Error("SharedAudioContext not found");
5728
5749
  }
5729
- const videoRef = useRef16(null);
5750
+ const videoRef = useRef17(null);
5730
5751
  const sharedSource = useMemo29(() => {
5731
5752
  if (!context.audioContext) {
5732
5753
  return null;
@@ -5874,7 +5895,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
5874
5895
  current.removeEventListener("error", errorHandler);
5875
5896
  };
5876
5897
  }, [onError, src]);
5877
- const currentOnDurationCallback = useRef16(onDuration);
5898
+ const currentOnDurationCallback = useRef17(onDuration);
5878
5899
  currentOnDurationCallback.current = onDuration;
5879
5900
  useEmitVideoFrame({ ref: videoRef, onVideoFrame });
5880
5901
  useEffect19(() => {
@@ -6450,7 +6471,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
6450
6471
  const frame = useCurrentFrame();
6451
6472
  const volumePropsFrame = useFrameForVolumeProp(loopVolumeCurveBehavior ?? "repeat");
6452
6473
  const videoConfig = useUnsafeVideoConfig();
6453
- const videoRef = useRef17(null);
6474
+ const videoRef = useRef18(null);
6454
6475
  const sequenceContext = useContext34(SequenceContext);
6455
6476
  const mediaStartsAt = useMediaStartsAt();
6456
6477
  const environment = useRemotionEnvironment();
@@ -6779,6 +6800,7 @@ var init_esm = __esm(() => {
6779
6800
  __export2(exports_timeline_position_state, {
6780
6801
  useTimelineSetFrame: () => useTimelineSetFrame,
6781
6802
  useTimelinePosition: () => useTimelinePosition,
6803
+ useTimelineFrameRef: () => useTimelineFrameRef,
6782
6804
  usePlayingState: () => usePlayingState,
6783
6805
  persistCurrentFrame: () => persistCurrentFrame,
6784
6806
  getInitialFrameState: () => getInitialFrameState,
@@ -6854,12 +6876,12 @@ var init_esm = __esm(() => {
6854
6876
  warn,
6855
6877
  error
6856
6878
  };
6857
- handles = [];
6858
6879
  if (typeof window !== "undefined") {
6859
6880
  window.remotion_renderReady = false;
6860
6881
  if (!window.remotion_delayRenderTimeouts) {
6861
6882
  window.remotion_delayRenderTimeouts = {};
6862
6883
  }
6884
+ window.remotion_delayRenderHandles = [];
6863
6885
  }
6864
6886
  LogLevelContext = createContext8({
6865
6887
  logLevel: "info",
@@ -6876,6 +6898,7 @@ var init_esm = __esm(() => {
6876
6898
  });
6877
6899
  TimelineContext = createContext10({
6878
6900
  frame: {},
6901
+ frameRef: { current: 0 },
6879
6902
  playing: false,
6880
6903
  playbackRate: 1,
6881
6904
  rootId: "",
@@ -12724,7 +12747,7 @@ var extrudeAndTransformElement = (options) => {
12724
12747
  init_esm();
12725
12748
  import { jsx as jsx37, Fragment } from "react/jsx-runtime";
12726
12749
  import { jsx as jsx210, jsxs as jsxs3 } from "react/jsx-runtime";
12727
- import { useEffect as useEffect22, useMemo as useMemo210, useRef as useRef18 } from "react";
12750
+ import { useEffect as useEffect22, useMemo as useMemo210, useRef as useRef19 } from "react";
12728
12751
  import { jsx as jsx38 } from "react/jsx-runtime";
12729
12752
  import { jsx as jsx43, jsxs as jsxs23 } from "react/jsx-runtime";
12730
12753
  import React42 from "react";
@@ -13079,7 +13102,7 @@ var Spinner = ({ size, duration }) => {
13079
13102
  height: size
13080
13103
  };
13081
13104
  }, [size]);
13082
- const pathsRef = useRef18([]);
13105
+ const pathsRef = useRef19([]);
13083
13106
  useEffect22(() => {
13084
13107
  const animate = () => {
13085
13108
  const now = performance.now();