@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.
package/dist/Homepage.js CHANGED
@@ -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: "",
@@ -7248,7 +7271,7 @@ __export(exports_esm, {
7248
7271
  Lottie: () => Lottie
7249
7272
  });
7250
7273
  import lottie from "lottie-web";
7251
- import { useEffect as useEffect38, useRef as useRef36, useState as useState37 } from "react";
7274
+ import { useEffect as useEffect38, useRef as useRef37, useState as useState37 } from "react";
7252
7275
  import { jsx as jsx59 } from "react/jsx-runtime";
7253
7276
  var getLottieMetadata = (animationData) => {
7254
7277
  const width2 = animationData.w;
@@ -7313,10 +7336,10 @@ var getLottieMetadata = (animationData) => {
7313
7336
  }
7314
7337
  validatePlaybackRate2(playbackRate);
7315
7338
  validateLoop(loop);
7316
- const animationRef = useRef36(null);
7317
- const currentFrameRef = useRef36(null);
7318
- const containerRef = useRef36(null);
7319
- const onAnimationLoadedRef = useRef36(onAnimationLoaded);
7339
+ const animationRef = useRef37(null);
7340
+ const currentFrameRef = useRef37(null);
7341
+ const containerRef = useRef37(null);
7342
+ const onAnimationLoadedRef = useRef37(onAnimationLoaded);
7320
7343
  onAnimationLoadedRef.current = onAnimationLoaded;
7321
7344
  const { delayRender, continueRender } = useDelayRender();
7322
7345
  const [handle] = useState37(() => delayRender("Waiting for Lottie animation to load"));
@@ -12900,7 +12923,7 @@ var extrudeAndTransformElement = (options) => {
12900
12923
  init_esm();
12901
12924
  import { jsx as jsx37, Fragment } from "react/jsx-runtime";
12902
12925
  import { jsx as jsx210, jsxs as jsxs3 } from "react/jsx-runtime";
12903
- import { useEffect as useEffect22, useMemo as useMemo210, useRef as useRef18 } from "react";
12926
+ import { useEffect as useEffect22, useMemo as useMemo210, useRef as useRef19 } from "react";
12904
12927
  import { jsx as jsx38 } from "react/jsx-runtime";
12905
12928
  import { jsx as jsx43, jsxs as jsxs23 } from "react/jsx-runtime";
12906
12929
  import React42 from "react";
@@ -13255,7 +13278,7 @@ var Spinner = ({ size, duration }) => {
13255
13278
  height: size
13256
13279
  };
13257
13280
  }, [size]);
13258
- const pathsRef = useRef18([]);
13281
+ const pathsRef = useRef19([]);
13259
13282
  useEffect22(() => {
13260
13283
  const animate = () => {
13261
13284
  const now = performance.now();
@@ -20515,23 +20538,23 @@ init_esm();
20515
20538
  import { jsx as jsx50, jsxs as jsxs14 } from "react/jsx-runtime";
20516
20539
  import { jsx as jsx213, jsxs as jsxs24, Fragment as Fragment6 } from "react/jsx-runtime";
20517
20540
  import React41 from "react";
20518
- import { useContext as useContext210, useEffect as useEffect210, useState as useState35 } from "react";
20519
- import { useContext as useContext40, useEffect as useEffect36 } from "react";
20541
+ import { useContext as useContext210, useEffect as useEffect36, useState as useState35 } from "react";
20542
+ import { useContext as useContext40, useLayoutEffect as useLayoutEffect15 } from "react";
20520
20543
  import { jsx as jsx310 } from "react/jsx-runtime";
20521
- import { useCallback as useCallback27, useRef as useRef32 } from "react";
20522
- import { useEffect as useEffect37, useState as useState210 } from "react";
20523
- import { useContext as useContext42, useEffect as useEffect62, useRef as useRef42 } from "react";
20524
- import { useEffect as useEffect42 } from "react";
20525
- import { useCallback as useCallback28, useContext as useContext37, useMemo as useMemo42, useRef as useRef24, useState as useState36 } from "react";
20526
- import { useEffect as useEffect52, useRef as useRef33 } from "react";
20527
- import { useCallback as useCallback32, useEffect as useEffect72, useMemo as useMemo212, useState as useState42 } from "react";
20544
+ import { useCallback as useCallback27 } from "react";
20545
+ import { useEffect as useEffect210, useState as useState210 } from "react";
20546
+ import { useContext as useContext42, useEffect as useEffect52, useRef as useRef33 } from "react";
20547
+ import { useEffect as useEffect37 } from "react";
20548
+ import { useCallback as useCallback28, useContext as useContext37, useMemo as useMemo42, useRef as useRef34, useState as useState36 } from "react";
20549
+ import { useEffect as useEffect42, useRef as useRef24 } from "react";
20550
+ import { useCallback as useCallback32, useEffect as useEffect62, useMemo as useMemo212, useState as useState42 } from "react";
20528
20551
  import {
20529
20552
  forwardRef as forwardRef26,
20530
- useEffect as useEffect142,
20553
+ useEffect as useEffect132,
20531
20554
  useImperativeHandle as useImperativeHandle22,
20532
- useLayoutEffect as useLayoutEffect15,
20555
+ useLayoutEffect as useLayoutEffect23,
20533
20556
  useMemo as useMemo142,
20534
- useRef as useRef112,
20557
+ useRef as useRef102,
20535
20558
  useState as useState132
20536
20559
  } from "react";
20537
20560
  import React102, {
@@ -20539,28 +20562,28 @@ import React102, {
20539
20562
  forwardRef as forwardRef27,
20540
20563
  useCallback as useCallback112,
20541
20564
  useContext as useContext62,
20542
- useEffect as useEffect132,
20565
+ useEffect as useEffect122,
20543
20566
  useImperativeHandle as useImperativeHandle12,
20544
20567
  useMemo as useMemo122,
20545
- useRef as useRef102,
20568
+ useRef as useRef92,
20546
20569
  useState as useState113
20547
20570
  } from "react";
20548
- import { useCallback as useCallback82, useEffect as useEffect112, useMemo as useMemo92, useRef as useRef82, useState as useState102 } from "react";
20571
+ import { useCallback as useCallback82, useEffect as useEffect102, useMemo as useMemo92, useRef as useRef72, useState as useState102 } from "react";
20549
20572
  import { jsx as jsx45 } from "react/jsx-runtime";
20550
- import { useCallback as useCallback52, useMemo as useMemo43, useRef as useRef52, useState as useState62 } from "react";
20573
+ import { useCallback as useCallback52, useMemo as useMemo43, useRef as useRef42, useState as useState62 } from "react";
20551
20574
  import React38, { useCallback as useCallback42, useMemo as useMemo34, useState as useState52 } from "react";
20552
20575
  import { jsx as jsx54, jsxs as jsxs33 } from "react/jsx-runtime";
20553
20576
  import { jsx as jsx64, jsxs as jsxs42 } from "react/jsx-runtime";
20554
20577
  import {
20555
20578
  useCallback as useCallback62,
20556
20579
  useContext as useContext52,
20557
- useEffect as useEffect92,
20580
+ useEffect as useEffect83,
20558
20581
  useMemo as useMemo52,
20559
20582
  useState as useState82
20560
20583
  } from "react";
20561
- import { useEffect as useEffect83, useRef as useRef62, useState as useState72 } from "react";
20584
+ import { useEffect as useEffect72, useRef as useRef52, useState as useState72 } from "react";
20562
20585
  import { jsx as jsx74, jsxs as jsxs52 } from "react/jsx-runtime";
20563
- import { useCallback as useCallback72, useEffect as useEffect102, useMemo as useMemo62, useRef as useRef72, useState as useState92 } from "react";
20586
+ import { useCallback as useCallback72, useEffect as useEffect92, useMemo as useMemo62, useRef as useRef62, useState as useState92 } from "react";
20564
20587
  import { jsx as jsx84, jsxs as jsxs62 } from "react/jsx-runtime";
20565
20588
  import { useMemo as useMemo72 } from "react";
20566
20589
  import { jsxs as jsxs7 } from "react/jsx-runtime";
@@ -20568,10 +20591,10 @@ import { useMemo as useMemo82 } from "react";
20568
20591
  import { jsx as jsx94, jsxs as jsxs82, Fragment as Fragment22 } from "react/jsx-runtime";
20569
20592
  import React82 from "react";
20570
20593
  import { jsx as jsx104 } from "react/jsx-runtime";
20571
- import React92, { useEffect as useEffect122 } from "react";
20594
+ import React92, { useEffect as useEffect112 } from "react";
20572
20595
  import { jsx as jsx113 } from "react/jsx-runtime";
20573
20596
  import { useCallback as useCallback102, useMemo as useMemo112 } from "react";
20574
- import { useCallback as useCallback92, useMemo as useMemo102, useRef as useRef92 } from "react";
20597
+ import { useCallback as useCallback92, useMemo as useMemo102, useRef as useRef82 } from "react";
20575
20598
  import { jsx as jsx123, jsxs as jsxs92, Fragment as Fragment32 } from "react/jsx-runtime";
20576
20599
  import { useCallback as useCallback122, useMemo as useMemo132, useState as useState122 } from "react";
20577
20600
  import { jsx as jsx133 } from "react/jsx-runtime";
@@ -20684,6 +20707,7 @@ if (typeof window !== "undefined") {
20684
20707
  if (!window.remotion_delayRenderTimeouts) {
20685
20708
  window.remotion_delayRenderTimeouts = {};
20686
20709
  }
20710
+ window.remotion_delayRenderHandles = [];
20687
20711
  }
20688
20712
  var DELAY_RENDER_CALLSTACK_TOKEN2 = "The delayRender was called:";
20689
20713
  var DELAY_RENDER_RETRIES_LEFT2 = "Retries left: ";
@@ -21209,9 +21233,9 @@ import { jsx as jsx143 } from "react/jsx-runtime";
21209
21233
  import {
21210
21234
  forwardRef as forwardRef42,
21211
21235
  useImperativeHandle as useImperativeHandle42,
21212
- useLayoutEffect as useLayoutEffect23,
21236
+ useLayoutEffect as useLayoutEffect33,
21213
21237
  useMemo as useMemo172,
21214
- useRef as useRef132,
21238
+ useRef as useRef122,
21215
21239
  useState as useState142
21216
21240
  } from "react";
21217
21241
  import React132, {
@@ -21220,7 +21244,7 @@ import React132, {
21220
21244
  useCallback as useCallback132,
21221
21245
  useImperativeHandle as useImperativeHandle32,
21222
21246
  useMemo as useMemo162,
21223
- useRef as useRef122
21247
+ useRef as useRef112
21224
21248
  } from "react";
21225
21249
  import { useContext as useContext72, useMemo as useMemo152 } from "react";
21226
21250
  import { jsx as jsx153 } from "react/jsx-runtime";
@@ -21662,7 +21686,7 @@ var useBufferStateEmitter = (emitter) => {
21662
21686
  if (!bufferManager) {
21663
21687
  throw new Error("BufferingContextReact not found");
21664
21688
  }
21665
- useEffect36(() => {
21689
+ useLayoutEffect15(() => {
21666
21690
  const clear1 = bufferManager.listenForBuffering(() => {
21667
21691
  bufferManager.buffering.current = true;
21668
21692
  emitter.dispatchWaiting({});
@@ -21683,7 +21707,7 @@ var PlayerEmitterProvider = ({ children, currentPlaybackRate }) => {
21683
21707
  if (!bufferManager) {
21684
21708
  throw new Error("BufferingContextReact not found");
21685
21709
  }
21686
- useEffect210(() => {
21710
+ useEffect36(() => {
21687
21711
  if (currentPlaybackRate) {
21688
21712
  emitter.dispatchRateChange(currentPlaybackRate);
21689
21713
  }
@@ -21696,7 +21720,7 @@ var PlayerEmitterProvider = ({ children, currentPlaybackRate }) => {
21696
21720
  };
21697
21721
  var useHoverState = (ref, hideControlsWhenPointerDoesntMove) => {
21698
21722
  const [hovered, setHovered] = useState210(false);
21699
- useEffect37(() => {
21723
+ useEffect210(() => {
21700
21724
  const { current } = ref;
21701
21725
  if (!current) {
21702
21726
  return;
@@ -21738,12 +21762,12 @@ var usePlayer = () => {
21738
21762
  const [playing, setPlaying, imperativePlaying] = Internals.Timeline.usePlayingState();
21739
21763
  const [hasPlayed, setHasPlayed] = useState36(false);
21740
21764
  const frame = Internals.Timeline.useTimelinePosition();
21741
- const playStart = useRef24(frame);
21765
+ const playStart = useRef34(frame);
21742
21766
  const setFrame = Internals.Timeline.useTimelineSetFrame();
21743
21767
  const setTimelinePosition = Internals.Timeline.useTimelineSetFrame();
21744
21768
  const audioContext = useContext37(Internals.SharedAudioContext);
21745
21769
  const { audioAndVideoTags } = useContext37(Internals.TimelineContext);
21746
- const frameRef = useRef24(frame);
21770
+ const frameRef = Internals.Timeline.useTimelineFrameRef();
21747
21771
  frameRef.current = frame;
21748
21772
  const video = Internals.useVideo();
21749
21773
  const config = Internals.useUnsafeVideoConfig();
@@ -21759,13 +21783,16 @@ var usePlayer = () => {
21759
21783
  throw new Error("Missing the buffering context. Most likely you have a Remotion version mismatch.");
21760
21784
  }
21761
21785
  const { buffering } = bufferingContext;
21786
+ const setFrameAndImperative = useCallback28((newFrame, videoIdToSet) => {
21787
+ setTimelinePosition((c) => ({ ...c, [videoIdToSet]: newFrame }));
21788
+ frameRef.current = newFrame;
21789
+ }, [frameRef, setTimelinePosition]);
21762
21790
  const seek2 = useCallback28((newFrame) => {
21763
21791
  if (video?.id) {
21764
- setTimelinePosition((c) => ({ ...c, [video.id]: newFrame }));
21792
+ setFrameAndImperative(newFrame, video.id);
21765
21793
  }
21766
- frameRef.current = newFrame;
21767
21794
  emitter.dispatchSeek(newFrame);
21768
- }, [emitter, setTimelinePosition, video?.id]);
21795
+ }, [emitter, setFrameAndImperative, video?.id]);
21769
21796
  const play = useCallback28((e) => {
21770
21797
  if (imperativePlaying.current) {
21771
21798
  return;
@@ -21790,7 +21817,8 @@ var usePlayer = () => {
21790
21817
  setPlaying,
21791
21818
  emitter,
21792
21819
  seek2,
21793
- audioAndVideoTags
21820
+ audioAndVideoTags,
21821
+ frameRef
21794
21822
  ]);
21795
21823
  const pause = useCallback28(() => {
21796
21824
  if (imperativePlaying.current) {
@@ -21813,7 +21841,14 @@ var usePlayer = () => {
21813
21841
  emitter.dispatchPause();
21814
21842
  }
21815
21843
  }
21816
- }, [config, emitter, imperativePlaying, setPlaying, setTimelinePosition]);
21844
+ }, [
21845
+ config,
21846
+ emitter,
21847
+ imperativePlaying,
21848
+ setPlaying,
21849
+ setTimelinePosition,
21850
+ frameRef
21851
+ ]);
21817
21852
  const videoId = video?.id;
21818
21853
  const frameBack = useCallback28((frames) => {
21819
21854
  if (!videoId) {
@@ -21871,12 +21906,15 @@ var usePlayer = () => {
21871
21906
  pause,
21872
21907
  seek: seek2,
21873
21908
  isFirstFrame,
21874
- getCurrentFrame: () => frameRef.current,
21909
+ getCurrentFrame: () => {
21910
+ return frameRef.current;
21911
+ },
21875
21912
  isPlaying: () => imperativePlaying.current,
21876
21913
  isBuffering: () => buffering.current,
21877
21914
  pauseAndReturnToPlayStart,
21878
21915
  hasPlayed,
21879
- toggle
21916
+ toggle,
21917
+ setFrameAndImperative
21880
21918
  };
21881
21919
  }, [
21882
21920
  buffering,
@@ -21892,7 +21930,9 @@ var usePlayer = () => {
21892
21930
  play,
21893
21931
  playing,
21894
21932
  seek2,
21895
- toggle
21933
+ toggle,
21934
+ setFrameAndImperative,
21935
+ frameRef
21896
21936
  ]);
21897
21937
  return returnValue;
21898
21938
  };
@@ -21902,7 +21942,7 @@ var useBrowserMediaSession = ({
21902
21942
  playbackRate
21903
21943
  }) => {
21904
21944
  const { playing, pause, play, emitter, getCurrentFrame, seek: seek2 } = usePlayer();
21905
- useEffect42(() => {
21945
+ useEffect37(() => {
21906
21946
  if (!navigator.mediaSession) {
21907
21947
  return;
21908
21948
  }
@@ -21915,7 +21955,7 @@ var useBrowserMediaSession = ({
21915
21955
  navigator.mediaSession.playbackState = "paused";
21916
21956
  }
21917
21957
  }, [browserMediaControlsBehavior.mode, playing]);
21918
- useEffect42(() => {
21958
+ useEffect37(() => {
21919
21959
  if (!navigator.mediaSession) {
21920
21960
  return;
21921
21961
  }
@@ -21945,7 +21985,7 @@ var useBrowserMediaSession = ({
21945
21985
  playbackRate,
21946
21986
  videoConfig
21947
21987
  ]);
21948
- useEffect42(() => {
21988
+ useEffect37(() => {
21949
21989
  if (!navigator.mediaSession) {
21950
21990
  return;
21951
21991
  }
@@ -22038,8 +22078,8 @@ var getIsBackgrounded = () => {
22038
22078
  return document.visibilityState === "hidden";
22039
22079
  };
22040
22080
  var useIsBackgrounded = () => {
22041
- const isBackgrounded = useRef33(getIsBackgrounded());
22042
- useEffect52(() => {
22081
+ const isBackgrounded = useRef24(getIsBackgrounded());
22082
+ useEffect42(() => {
22043
22083
  const onVisibilityChange = () => {
22044
22084
  isBackgrounded.current = getIsBackgrounded();
22045
22085
  };
@@ -22061,10 +22101,9 @@ var usePlayback = ({
22061
22101
  }) => {
22062
22102
  const config = Internals.useUnsafeVideoConfig();
22063
22103
  const frame = Internals.Timeline.useTimelinePosition();
22064
- const { playing, pause, emitter } = usePlayer();
22065
- const setFrame = Internals.Timeline.useTimelineSetFrame();
22104
+ const { playing, pause, emitter, setFrameAndImperative } = usePlayer();
22066
22105
  const isBackgroundedRef = useIsBackgrounded();
22067
- const lastTimeUpdateEvent = useRef42(null);
22106
+ const lastTimeUpdateEvent = useRef33(null);
22068
22107
  const context = useContext42(Internals.BufferingContextReact);
22069
22108
  if (!context) {
22070
22109
  throw new Error("Missing the buffering context. Most likely you have a Remotion version mismatch.");
@@ -22074,7 +22113,7 @@ var usePlayback = ({
22074
22113
  playbackRate,
22075
22114
  videoConfig: config
22076
22115
  });
22077
- useEffect62(() => {
22116
+ useEffect52(() => {
22078
22117
  if (!config) {
22079
22118
  return;
22080
22119
  }
@@ -22118,7 +22157,7 @@ var usePlayback = ({
22118
22157
  });
22119
22158
  framesAdvanced += framesToAdvance;
22120
22159
  if (nextFrame !== getCurrentFrame() && (!hasEnded || moveToBeginningWhenEnded)) {
22121
- setFrame((c) => ({ ...c, [config.id]: nextFrame }));
22160
+ setFrameAndImperative(nextFrame, config.id);
22122
22161
  }
22123
22162
  if (hasEnded) {
22124
22163
  stop();
@@ -22165,7 +22204,7 @@ var usePlayback = ({
22165
22204
  loop,
22166
22205
  pause,
22167
22206
  playing,
22168
- setFrame,
22207
+ setFrameAndImperative,
22169
22208
  emitter,
22170
22209
  playbackRate,
22171
22210
  inFrame,
@@ -22175,7 +22214,7 @@ var usePlayback = ({
22175
22214
  getCurrentFrame,
22176
22215
  context
22177
22216
  ]);
22178
- useEffect62(() => {
22217
+ useEffect52(() => {
22179
22218
  const interval = setInterval(() => {
22180
22219
  if (lastTimeUpdateEvent.current === getCurrentFrame()) {
22181
22220
  return;
@@ -22185,7 +22224,7 @@ var usePlayback = ({
22185
22224
  }, 250);
22186
22225
  return () => clearInterval(interval);
22187
22226
  }, [emitter, getCurrentFrame]);
22188
- useEffect62(() => {
22227
+ useEffect52(() => {
22189
22228
  emitter.dispatchFrameUpdate({ frame });
22190
22229
  }, [emitter, frame]);
22191
22230
  };
@@ -22268,7 +22307,7 @@ var useElementSize = (ref, options2) => {
22268
22307
  };
22269
22308
  });
22270
22309
  }, [ref]);
22271
- useEffect72(() => {
22310
+ useEffect62(() => {
22272
22311
  if (!observer) {
22273
22312
  return;
22274
22313
  }
@@ -22282,7 +22321,7 @@ var useElementSize = (ref, options2) => {
22282
22321
  }
22283
22322
  };
22284
22323
  }, [observer, ref, updateSize]);
22285
- useEffect72(() => {
22324
+ useEffect62(() => {
22286
22325
  if (!options2.triggerOnWindowResize) {
22287
22326
  return;
22288
22327
  }
@@ -22291,7 +22330,7 @@ var useElementSize = (ref, options2) => {
22291
22330
  window.removeEventListener("resize", updateSize);
22292
22331
  };
22293
22332
  }, [options2.triggerOnWindowResize, updateSize]);
22294
- useEffect72(() => {
22333
+ useEffect62(() => {
22295
22334
  elementSizeHooks.push(updateSize);
22296
22335
  return () => {
22297
22336
  elementSizeHooks = elementSizeHooks.filter((e) => e !== updateSize);
@@ -22423,8 +22462,8 @@ var MediaVolumeSlider = ({ displayVerticalVolumeSlider, renderMuteButton, render
22423
22462
  const [mediaMuted, setMediaMuted] = Internals.useMediaMutedState();
22424
22463
  const [mediaVolume, setMediaVolume] = Internals.useMediaVolumeState();
22425
22464
  const [focused, setFocused] = useState62(false);
22426
- const parentDivRef = useRef52(null);
22427
- const inputRef = useRef52(null);
22465
+ const parentDivRef = useRef42(null);
22466
+ const inputRef = useRef42(null);
22428
22467
  const hover = useHoverState(parentDivRef, false);
22429
22468
  const onBlur = useCallback52(() => {
22430
22469
  setTimeout(() => {
@@ -22509,8 +22548,8 @@ var MediaVolumeSlider = ({ displayVerticalVolumeSlider, renderMuteButton, render
22509
22548
  };
22510
22549
  function useComponentVisible(initialIsVisible) {
22511
22550
  const [isComponentVisible, setIsComponentVisible] = useState72(initialIsVisible);
22512
- const ref = useRef62(null);
22513
- useEffect83(() => {
22551
+ const ref = useRef52(null);
22552
+ useEffect72(() => {
22514
22553
  const handleClickOutside = (event) => {
22515
22554
  if (ref.current && !ref.current.contains(event.target)) {
22516
22555
  setIsComponentVisible(false);
@@ -22594,7 +22633,7 @@ var PlaybackrateOption = ({ rate, onSelect, selectedRate, keyboardSelectedRate }
22594
22633
  var PlaybackPopup = ({ setIsComponentVisible, playbackRates, canvasSize }) => {
22595
22634
  const { setPlaybackRate, playbackRate } = useContext52(Internals.TimelineContext);
22596
22635
  const [keyboardSelectedRate, setKeyboardSelectedRate] = useState82(playbackRate);
22597
- useEffect92(() => {
22636
+ useEffect83(() => {
22598
22637
  const listener = (e) => {
22599
22638
  e.preventDefault();
22600
22639
  if (e.key === "ArrowUp") {
@@ -22759,7 +22798,7 @@ var findBodyInWhichDivIsLocated = (div) => {
22759
22798
  return current;
22760
22799
  };
22761
22800
  var PlayerSeekBar = ({ durationInFrames, onSeekEnd, onSeekStart, inFrame, outFrame }) => {
22762
- const containerRef = useRef72(null);
22801
+ const containerRef = useRef62(null);
22763
22802
  const barHovered = useHoverState(containerRef, false);
22764
22803
  const size4 = useElementSize(containerRef, {
22765
22804
  triggerOnWindowResize: true,
@@ -22810,7 +22849,7 @@ var PlayerSeekBar = ({ durationInFrames, onSeekEnd, onSeekStart, inFrame, outFra
22810
22849
  }
22811
22850
  onSeekEnd();
22812
22851
  }, [dragging, onSeekEnd, pause, play]);
22813
- useEffect102(() => {
22852
+ useEffect92(() => {
22814
22853
  if (!dragging.dragging) {
22815
22854
  return;
22816
22855
  }
@@ -23035,7 +23074,7 @@ var Controls = ({
23035
23074
  playing,
23036
23075
  toggle
23037
23076
  }) => {
23038
- const playButtonRef = useRef82(null);
23077
+ const playButtonRef = useRef72(null);
23039
23078
  const [supportsFullscreen, setSupportsFullscreen] = useState102(false);
23040
23079
  const hovered = useHoverState(containerRef, hideControlsWhenPointerDoesntMove);
23041
23080
  const { maxTimeLabelWidth, displayVerticalVolumeSlider } = useVideoControlsResize({
@@ -23070,17 +23109,17 @@ var Controls = ({
23070
23109
  opacity: Number(shouldShow)
23071
23110
  };
23072
23111
  }, [hovered, shouldShowInitially, playing, alwaysShowControls]);
23073
- useEffect112(() => {
23112
+ useEffect102(() => {
23074
23113
  if (playButtonRef.current && spaceKeyToPlayOrPause) {
23075
23114
  playButtonRef.current.focus({
23076
23115
  preventScroll: true
23077
23116
  });
23078
23117
  }
23079
23118
  }, [playing, spaceKeyToPlayOrPause]);
23080
- useEffect112(() => {
23119
+ useEffect102(() => {
23081
23120
  setSupportsFullscreen((typeof document !== "undefined" && (document.fullscreenEnabled || document.webkitFullscreenEnabled)) ?? false);
23082
23121
  }, []);
23083
- useEffect112(() => {
23122
+ useEffect102(() => {
23084
23123
  if (shouldShowInitially === false) {
23085
23124
  return;
23086
23125
  }
@@ -23109,8 +23148,8 @@ var Controls = ({
23109
23148
  }
23110
23149
  return null;
23111
23150
  }, [showPlaybackRateControl]);
23112
- const ref = useRef82(null);
23113
- const flexRef = useRef82(null);
23151
+ const ref = useRef72(null);
23152
+ const flexRef = useRef72(null);
23114
23153
  const onPointerDownIfContainer = useCallback82((e) => {
23115
23154
  if (e.target === ref.current || e.target === flexRef.current) {
23116
23155
  onPointerDown?.(e);
@@ -23278,7 +23317,7 @@ var DOMAIN_BLACKLIST = [
23278
23317
  var ran = false;
23279
23318
  var RenderWarningIfBlacklist = () => {
23280
23319
  const [unlicensed, setUnlicensed] = React92.useState(false);
23281
- useEffect122(() => {
23320
+ useEffect112(() => {
23282
23321
  if (ran) {
23283
23322
  return;
23284
23323
  }
@@ -23289,7 +23328,7 @@ var RenderWarningIfBlacklist = () => {
23289
23328
  }
23290
23329
  }).catch(() => {});
23291
23330
  }, []);
23292
- useEffect122(() => {
23331
+ useEffect112(() => {
23293
23332
  if (!unlicensed) {
23294
23333
  return;
23295
23334
  }
@@ -23355,7 +23394,7 @@ var cancellablePromise = (promise) => {
23355
23394
  };
23356
23395
  var delay = (n) => new Promise((resolve) => setTimeout(resolve, n));
23357
23396
  var useCancellablePromises = () => {
23358
- const pendingPromises = useRef92([]);
23397
+ const pendingPromises = useRef82([]);
23359
23398
  const appendPendingPromise = useCallback92((promise) => {
23360
23399
  pendingPromises.current = [...pendingPromises.current, promise];
23361
23400
  }, []);
@@ -23459,7 +23498,7 @@ var PlayerUI = ({
23459
23498
  }, ref) => {
23460
23499
  const config = Internals.useUnsafeVideoConfig();
23461
23500
  const video = Internals.useVideo();
23462
- const container4 = useRef102(null);
23501
+ const container4 = useRef92(null);
23463
23502
  const canvasSize = useElementSize(container4, {
23464
23503
  triggerOnWindowResize: false,
23465
23504
  shouldApplyCssTransforms: false
@@ -23485,13 +23524,13 @@ var PlayerUI = ({
23485
23524
  getCurrentFrame: player.getCurrentFrame,
23486
23525
  browserMediaControlsBehavior
23487
23526
  });
23488
- useEffect132(() => {
23527
+ useEffect122(() => {
23489
23528
  if (hasPausedToResume && !player.playing) {
23490
23529
  setHasPausedToResume(false);
23491
23530
  player.play();
23492
23531
  }
23493
23532
  }, [hasPausedToResume, player]);
23494
- useEffect132(() => {
23533
+ useEffect122(() => {
23495
23534
  const { current } = container4;
23496
23535
  if (!current) {
23497
23536
  return;
@@ -23533,7 +23572,7 @@ var PlayerUI = ({
23533
23572
  document.exitFullscreen();
23534
23573
  }
23535
23574
  }, []);
23536
- useEffect132(() => {
23575
+ useEffect122(() => {
23537
23576
  const { current } = container4;
23538
23577
  if (!current) {
23539
23578
  return;
@@ -23570,8 +23609,8 @@ var PlayerUI = ({
23570
23609
  });
23571
23610
  }, [canvasSize, config]);
23572
23611
  const scale = layout?.scale ?? 1;
23573
- const initialScaleIgnored = useRef102(false);
23574
- useEffect132(() => {
23612
+ const initialScaleIgnored = useRef92(false);
23613
+ useEffect122(() => {
23575
23614
  if (!initialScaleIgnored.current) {
23576
23615
  initialScaleIgnored.current = true;
23577
23616
  return;
@@ -23580,17 +23619,17 @@ var PlayerUI = ({
23580
23619
  }, [player.emitter, scale]);
23581
23620
  const { setMediaVolume, setMediaMuted } = useContext62(Internals.SetMediaVolumeContext);
23582
23621
  const { mediaMuted, mediaVolume } = useContext62(Internals.MediaVolumeContext);
23583
- useEffect132(() => {
23622
+ useEffect122(() => {
23584
23623
  player.emitter.dispatchVolumeChange(mediaVolume);
23585
23624
  }, [player.emitter, mediaVolume]);
23586
23625
  const isMuted = mediaMuted || mediaVolume === 0;
23587
- useEffect132(() => {
23626
+ useEffect122(() => {
23588
23627
  player.emitter.dispatchMuteChange({
23589
23628
  isMuted
23590
23629
  });
23591
23630
  }, [player.emitter, isMuted]);
23592
23631
  const [showBufferIndicator, setShowBufferState] = useState113(false);
23593
- useEffect132(() => {
23632
+ useEffect122(() => {
23594
23633
  let timeout = null;
23595
23634
  let stopped = false;
23596
23635
  const onBuffer = () => {
@@ -23762,7 +23801,7 @@ var PlayerUI = ({
23762
23801
  }
23763
23802
  }, [exitFullscreen, isFullscreen, requestFullscreen]);
23764
23803
  const { handlePointerDown, handleDoubleClick } = useClickPreventionOnDoubleClick(onSingleClick, onDoubleClick, doubleClickToFullscreen && allowFullscreen && supportsFullScreen);
23765
- useEffect132(() => {
23804
+ useEffect122(() => {
23766
23805
  if (shouldAutoplay) {
23767
23806
  player.play();
23768
23807
  setShouldAutoPlay(false);
@@ -24218,9 +24257,9 @@ var PlayerFn = ({
24218
24257
  }));
24219
24258
  const [playing, setPlaying] = useState132(false);
24220
24259
  const [rootId] = useState132("player-comp");
24221
- const rootRef = useRef112(null);
24222
- const audioAndVideoTags = useRef112([]);
24223
- const imperativePlaying = useRef112(false);
24260
+ const rootRef = useRef102(null);
24261
+ const audioAndVideoTags = useRef102([]);
24262
+ const imperativePlaying = useRef102(false);
24224
24263
  const [currentPlaybackRate, setCurrentPlaybackRate] = useState132(playbackRate);
24225
24264
  if (typeof compositionHeight !== "number") {
24226
24265
  throw new TypeError(`'compositionHeight' must be a number but got '${typeof compositionHeight}' instead`);
@@ -24269,7 +24308,7 @@ var PlayerFn = ({
24269
24308
  throw new TypeError(`'numberOfSharedAudioTags' must be an integer but got '${numberOfSharedAudioTags}' instead`);
24270
24309
  }
24271
24310
  validatePlaybackRate(currentPlaybackRate);
24272
- useEffect142(() => {
24311
+ useEffect132(() => {
24273
24312
  setCurrentPlaybackRate(playbackRate);
24274
24313
  }, [playbackRate]);
24275
24314
  useImperativeHandle22(ref, () => rootRef.current, []);
@@ -24284,6 +24323,7 @@ var PlayerFn = ({
24284
24323
  const timelineContextValue = useMemo142(() => {
24285
24324
  return {
24286
24325
  frame,
24326
+ frameRef: { current: frame[PLAYER_COMP_ID] },
24287
24327
  playing,
24288
24328
  rootId,
24289
24329
  playbackRate: currentPlaybackRate,
@@ -24301,7 +24341,7 @@ var PlayerFn = ({
24301
24341
  };
24302
24342
  }, [setFrame]);
24303
24343
  if (typeof window !== "undefined") {
24304
- useLayoutEffect15(() => {
24344
+ useLayoutEffect23(() => {
24305
24345
  Internals.CSSUtils.injectCSS(Internals.CSSUtils.makeDefaultPreviewCSS(`.${playerCssClassname(overrideInternalClassName)}`, "#fff"));
24306
24346
  }, [overrideInternalClassName]);
24307
24347
  }
@@ -24405,7 +24445,7 @@ var ThumbnailUI = ({
24405
24445
  }, ref) => {
24406
24446
  const config = Internals.useUnsafeVideoConfig();
24407
24447
  const video = Internals.useVideo();
24408
- const container4 = useRef122(null);
24448
+ const container4 = useRef112(null);
24409
24449
  const canvasSize = useElementSize(container4, {
24410
24450
  triggerOnWindowResize: false,
24411
24451
  shouldApplyCssTransforms: false
@@ -24526,14 +24566,15 @@ var ThumbnailFn = ({
24526
24566
  ...componentProps
24527
24567
  }, ref) => {
24528
24568
  if (typeof window !== "undefined") {
24529
- useLayoutEffect23(() => {
24569
+ useLayoutEffect33(() => {
24530
24570
  window.remotion_isPlayer = true;
24531
24571
  }, []);
24532
24572
  }
24533
24573
  const [thumbnailId] = useState142(() => String(random(null)));
24534
- const rootRef = useRef132(null);
24574
+ const rootRef = useRef122(null);
24535
24575
  const timelineState = useMemo172(() => {
24536
24576
  const value = {
24577
+ frameRef: { current: frameToDisplay },
24537
24578
  playing: false,
24538
24579
  frame: {
24539
24580
  [PLAYER_COMP_ID]: frameToDisplay
@@ -24598,7 +24639,7 @@ import {
24598
24639
  useCallback as useCallback43,
24599
24640
  useEffect as useEffect51,
24600
24641
  useMemo as useMemo53,
24601
- useRef as useRef41,
24642
+ useRef as useRef43,
24602
24643
  useState as useState47
24603
24644
  } from "react";
24604
24645
 
@@ -25382,13 +25423,13 @@ import {
25382
25423
  createRef as createRef4,
25383
25424
  useCallback as useCallback35,
25384
25425
  useEffect as useEffect43,
25385
- useRef as useRef38,
25426
+ useRef as useRef39,
25386
25427
  useState as useState40
25387
25428
  } from "react";
25388
25429
 
25389
25430
  // src/components/homepage/Demo/Card.tsx
25390
25431
  init_esm();
25391
- import { useCallback as useCallback31, useRef as useRef34 } from "react";
25432
+ import { useCallback as useCallback31, useRef as useRef36 } from "react";
25392
25433
 
25393
25434
  // src/components/homepage/Demo/math.ts
25394
25435
  var paddingAndMargin = 20;
@@ -25486,7 +25527,7 @@ var Card2 = ({
25486
25527
  onClickRight
25487
25528
  }) => {
25488
25529
  const refToUse = refsToUse[index2];
25489
- const stopPrevious = useRef34([]);
25530
+ const stopPrevious = useRef36([]);
25490
25531
  let newIndices = [...indices];
25491
25532
  const applyPositions = useCallback31((except) => {
25492
25533
  let stopped = false;
@@ -25754,7 +25795,7 @@ import {
25754
25795
  useCallback as useCallback33,
25755
25796
  useEffect as useEffect41,
25756
25797
  useImperativeHandle as useImperativeHandle14,
25757
- useRef as useRef37
25798
+ useRef as useRef38
25758
25799
  } from "react";
25759
25800
 
25760
25801
  // src/components/homepage/Demo/DisplayedEmoji.tsx
@@ -25867,10 +25908,10 @@ var emojiStyle = {
25867
25908
  top: "calc(50% - 50px)"
25868
25909
  };
25869
25910
  var EmojiCardRefFn = ({ emojiIndex }, ref) => {
25870
- const ref1 = useRef37(null);
25871
- const ref2 = useRef37(null);
25872
- const ref3 = useRef37(null);
25873
- const transforms = useRef37([-100, 0, 100]);
25911
+ const ref1 = useRef38(null);
25912
+ const ref2 = useRef38(null);
25913
+ const ref3 = useRef38(null);
25914
+ const transforms = useRef38([-100, 0, 100]);
25874
25915
  const onLeft = useCallback33(() => {
25875
25916
  if (!ref1.current || !ref2.current || !ref3.current) {
25876
25917
  return;
@@ -26323,14 +26364,14 @@ var Cards = ({
26323
26364
  location,
26324
26365
  trending
26325
26366
  }) => {
26326
- const container4 = useRef38(null);
26367
+ const container4 = useRef39(null);
26327
26368
  const [refs] = useState40(() => {
26328
26369
  return new Array(4).fill(true).map(() => {
26329
26370
  return createRef4();
26330
26371
  });
26331
26372
  });
26332
- const positions = useRef38(getInitialPositions());
26333
- const shouldBePositions = useRef38(getInitialPositions());
26373
+ const positions = useRef39(getInitialPositions());
26374
+ const shouldBePositions = useRef39(getInitialPositions());
26334
26375
  const { isRendering } = useRemotionEnvironment();
26335
26376
  useEffect43(() => {
26336
26377
  const { current } = container4;
@@ -26348,7 +26389,7 @@ var Cards = ({
26348
26389
  current.removeEventListener("click", onClick);
26349
26390
  };
26350
26391
  }, [onToggle]);
26351
- const ref = useRef38(null);
26392
+ const ref = useRef39(null);
26352
26393
  const onLeft = useCallback35(() => {
26353
26394
  ref.current?.onRight();
26354
26395
  onRightPress();
@@ -26871,7 +26912,7 @@ var DragAndDropNudge = () => {
26871
26912
 
26872
26913
  // src/components/homepage/Demo/PlayerSeekBar.tsx
26873
26914
  init_esm();
26874
- import { useCallback as useCallback39, useEffect as useEffect47, useMemo as useMemo51, useRef as useRef39, useState as useState45 } from "react";
26915
+ import { useCallback as useCallback39, useEffect as useEffect47, useMemo as useMemo51, useRef as useRef40, useState as useState45 } from "react";
26875
26916
 
26876
26917
  // src/components/homepage/layout/use-el-size.ts
26877
26918
  import { useCallback as useCallback38, useEffect as useEffect46, useMemo as useMemo50, useState as useState43 } from "react";
@@ -27000,7 +27041,7 @@ var PlayerSeekBar2 = ({
27000
27041
  outFrame,
27001
27042
  playerRef
27002
27043
  }) => {
27003
- const containerRef = useRef39(null);
27044
+ const containerRef = useRef40(null);
27004
27045
  const barHovered = useHoverState2(containerRef, false);
27005
27046
  const size4 = useElementSize2(containerRef.current);
27006
27047
  const [playing, setPlaying] = useState45(false);
@@ -27149,7 +27190,7 @@ var PlayerSeekBar2 = ({
27149
27190
  };
27150
27191
 
27151
27192
  // src/components/homepage/Demo/PlayerVolume.tsx
27152
- import { useCallback as useCallback40, useEffect as useEffect48, useRef as useRef40, useState as useState46 } from "react";
27193
+ import { useCallback as useCallback40, useEffect as useEffect48, useRef as useRef41, useState as useState46 } from "react";
27153
27194
 
27154
27195
  // src/components/homepage/Demo/icons.tsx
27155
27196
  import { jsx as jsx90 } from "react/jsx-runtime";
@@ -27209,7 +27250,7 @@ import { jsx as jsx91 } from "react/jsx-runtime";
27209
27250
  var PlayerVolume = ({ playerRef }) => {
27210
27251
  const [muted, setIsMuted] = useState46(() => playerRef.current?.isMuted() ?? true);
27211
27252
  const [isHovered, setIsHovered] = useState46(false);
27212
- const timerRef = useRef40(null);
27253
+ const timerRef = useRef41(null);
27213
27254
  useEffect48(() => {
27214
27255
  const { current } = playerRef;
27215
27256
  if (!current) {
@@ -27498,7 +27539,7 @@ var playerWrapper = {
27498
27539
  var Demo = () => {
27499
27540
  const { colorMode } = useColorMode();
27500
27541
  const [data2, setData] = useState47(null);
27501
- const ref = useRef41(null);
27542
+ const ref = useRef43(null);
27502
27543
  const [isFullscreen, setIsFullscreen] = useState47(false);
27503
27544
  const [cardOrder, setCardOrder] = useState47([0, 1, 2, 3]);
27504
27545
  const [emojiIndex, setEmojiIndex] = useState47(0);
@@ -27645,15 +27686,15 @@ var ClearButton = (props) => {
27645
27686
 
27646
27687
  // src/components/homepage/MuxVideo.tsx
27647
27688
  import Hls2 from "hls.js";
27648
- import { forwardRef as forwardRef31, useEffect as useEffect55, useImperativeHandle as useImperativeHandle15, useRef as useRef45 } from "react";
27689
+ import { forwardRef as forwardRef31, useEffect as useEffect55, useImperativeHandle as useImperativeHandle15, useRef as useRef46 } from "react";
27649
27690
 
27650
27691
  // src/components/homepage/VideoPlayerWithControls.tsx
27651
27692
  import Hls from "hls.js";
27652
27693
  import"plyr/dist/plyr.css";
27653
- import { forwardRef as forwardRef30, useCallback as useCallback45, useEffect as useEffect53, useRef as useRef43, useState as useState48 } from "react";
27694
+ import { forwardRef as forwardRef30, useCallback as useCallback45, useEffect as useEffect53, useRef as useRef45, useState as useState48 } from "react";
27654
27695
  import { jsx as jsx105 } from "react/jsx-runtime";
27655
27696
  var useCombinedRefs = function(...refs) {
27656
- const targetRef = useRef43(null);
27697
+ const targetRef = useRef45(null);
27657
27698
  useEffect53(() => {
27658
27699
  refs.forEach((ref) => {
27659
27700
  if (!ref)
@@ -27668,9 +27709,9 @@ var useCombinedRefs = function(...refs) {
27668
27709
  return targetRef;
27669
27710
  };
27670
27711
  var VideoPlayerWithControls = forwardRef30(({ playbackId, poster, currentTime, onLoaded, onError, onSize, autoPlay }, ref) => {
27671
- const videoRef = useRef43(null);
27712
+ const videoRef = useRef45(null);
27672
27713
  const metaRef = useCombinedRefs(ref, videoRef);
27673
- const playerRef = useRef43(null);
27714
+ const playerRef = useRef45(null);
27674
27715
  const [playerInitTime] = useState48(Date.now());
27675
27716
  const videoError = useCallback45((event) => onError(event), [onError]);
27676
27717
  const onImageLoad = useCallback45((event) => {
@@ -27755,7 +27796,7 @@ var getVideoToPlayUrl = (muxId) => {
27755
27796
  return `https://stream.mux.com/${muxId}.m3u8`;
27756
27797
  };
27757
27798
  var MuxVideoForward = ({ muxId, ...props }, ref) => {
27758
- const videoRef = useRef45(null);
27799
+ const videoRef = useRef46(null);
27759
27800
  const vidUrl = getVideoToPlayUrl(muxId);
27760
27801
  useImperativeHandle15(ref, () => videoRef.current, []);
27761
27802
  useEffect55(() => {
@@ -28137,14 +28178,14 @@ var NewsletterButton = () => {
28137
28178
  };
28138
28179
 
28139
28180
  // src/components/homepage/ParameterizeAndEdit.tsx
28140
- import { useEffect as useEffect58, useRef as useRef46, useState as useState53 } from "react";
28181
+ import { useEffect as useEffect58, useRef as useRef47, useState as useState53 } from "react";
28141
28182
  import { jsx as jsx114, jsxs as jsxs46 } from "react/jsx-runtime";
28142
28183
  var icon3 = {
28143
28184
  height: 16,
28144
28185
  marginLeft: 10
28145
28186
  };
28146
28187
  var ParameterizeAndEdit = () => {
28147
- const ref = useRef46(null);
28188
+ const ref = useRef47(null);
28148
28189
  const [vid, setVid] = useState53("/img/editing-vp9-chrome.webm");
28149
28190
  useEffect58(() => {
28150
28191
  if (isWebkit()) {
@@ -28260,15 +28301,15 @@ var ParameterizeAndEdit = () => {
28260
28301
  };
28261
28302
 
28262
28303
  // src/components/homepage/RealMp4Videos.tsx
28263
- import { useEffect as useEffect59, useRef as useRef47, useState as useState55 } from "react";
28304
+ import { useEffect as useEffect59, useRef as useRef48, useState as useState55 } from "react";
28264
28305
  import { jsx as jsx116, jsxs as jsxs47 } from "react/jsx-runtime";
28265
28306
  var icon4 = {
28266
28307
  height: 16,
28267
28308
  marginLeft: 10
28268
28309
  };
28269
28310
  var RealMP4Videos = () => {
28270
- const ref = useRef47(null);
28271
- const videoRef = useRef47(null);
28311
+ const ref = useRef48(null);
28312
+ const videoRef = useRef48(null);
28272
28313
  const [vid, setVid] = useState55("/img/render-progress.webm");
28273
28314
  useEffect59(() => {
28274
28315
  if (isWebkit()) {
@@ -28521,7 +28562,7 @@ var TrustedByBanner = () => {
28521
28562
  var TrustedByBanner_default = TrustedByBanner;
28522
28563
 
28523
28564
  // src/components/homepage/VideoAppsShowcase.tsx
28524
- import { useEffect as useEffect60, useRef as useRef48, useState as useState56 } from "react";
28565
+ import { useEffect as useEffect60, useRef as useRef49, useState as useState56 } from "react";
28525
28566
  import { jsx as jsx118, jsxs as jsxs49 } from "react/jsx-runtime";
28526
28567
  var tabs = [
28527
28568
  "Music visualization",
@@ -28577,8 +28618,8 @@ var VideoAppsShowcase = () => {
28577
28618
  const [activeTab, setActiveTab] = useState56(0);
28578
28619
  const [isMuted, setIsMuted] = useState56(true);
28579
28620
  const [isPlaying, setIsPlaying] = useState56(false);
28580
- const videoRef = useRef48(null);
28581
- const containerRef = useRef48(null);
28621
+ const videoRef = useRef49(null);
28622
+ const containerRef = useRef49(null);
28582
28623
  useEffect60(() => {
28583
28624
  const video = videoRef.current;
28584
28625
  if (video) {