@remotion/promo-pages 4.0.390 → 4.0.392

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
@@ -755,7 +755,7 @@ var __defProp2, __export2 = (target, all) => {
755
755
  });
756
756
  }, useIsPlayer = () => {
757
757
  return useContext(IsPlayerContext);
758
- }, VERSION = "4.0.390", checkMultipleRemotionVersions = () => {
758
+ }, VERSION = "4.0.392", checkMultipleRemotionVersions = () => {
759
759
  if (typeof globalThis === "undefined") {
760
760
  return;
761
761
  }
@@ -1647,7 +1647,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
1647
1647
  }
1648
1648
  }, error = (options, ...args) => {
1649
1649
  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 = ({
1650
+ }, 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
1651
  scope,
1652
1652
  environment,
1653
1653
  label,
@@ -1657,33 +1657,29 @@ Check that all your Remotion packages are on the same version. If your dependenc
1657
1657
  throw new Error("The label parameter of delayRender() must be a string or undefined, got: " + JSON.stringify(label));
1658
1658
  }
1659
1659
  const handle = Math.random();
1660
- handles.push(handle);
1660
+ scope.remotion_delayRenderHandles.push(handle);
1661
1661
  const called = Error().stack?.replace(/^Error/g, "") ?? "";
1662
1662
  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;
1663
+ const timeoutToUse = (options?.timeoutInMilliseconds ?? scope.remotion_puppeteerTimeout ?? defaultTimeout) - 2000;
1664
+ const retriesLeft = (options?.retries ?? 0) - (scope.remotion_attempt - 1);
1665
+ scope.remotion_delayRenderTimeouts[handle] = {
1666
+ label: label ?? null,
1667
+ startTime: Date.now(),
1668
+ timeout: setTimeout(() => {
1669
+ const message = [
1670
+ `A delayRender()`,
1671
+ label ? `"${label}"` : null,
1672
+ `was called but not cleared after ${timeoutToUse}ms. See https://remotion.dev/docs/timeout for help.`,
1673
+ retriesLeft > 0 ? DELAY_RENDER_RETRIES_LEFT + retriesLeft : null,
1674
+ retriesLeft > 0 ? DELAY_RENDER_RETRY_TOKEN : null,
1675
+ DELAY_RENDER_CALLSTACK_TOKEN,
1676
+ called
1677
+ ].filter(truthy2).join(" ");
1678
+ cancelRenderInternal(scope, Error(message));
1679
+ }, timeoutToUse)
1680
+ };
1686
1681
  }
1682
+ scope.remotion_renderReady = false;
1687
1683
  return handle;
1688
1684
  }, continueRenderInternal = ({
1689
1685
  scope,
@@ -1697,7 +1693,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
1697
1693
  if (typeof handle !== "number") {
1698
1694
  throw new TypeError("The parameter passed into continueRender() must be the return value of delayRender() which is a number. Got: " + JSON.stringify(handle));
1699
1695
  }
1700
- handles = handles.filter((h) => {
1696
+ scope.remotion_delayRenderHandles = scope.remotion_delayRenderHandles.filter((h) => {
1701
1697
  if (h === handle) {
1702
1698
  if (environment.isRendering && scope !== undefined) {
1703
1699
  if (!scope.remotion_delayRenderTimeouts[handle]) {
@@ -1717,7 +1713,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
1717
1713
  }
1718
1714
  return true;
1719
1715
  });
1720
- if (handles.length === 0 && typeof scope !== "undefined") {
1716
+ if (scope.remotion_delayRenderHandles.length === 0) {
1721
1717
  scope.remotion_renderReady = true;
1722
1718
  }
1723
1719
  }, LogLevelContext, useLogLevel = () => {
@@ -1734,19 +1730,25 @@ Check that all your Remotion packages are on the same version. If your dependenc
1734
1730
  return mountTime;
1735
1731
  }, DelayRenderContextType, useDelayRender = () => {
1736
1732
  const environment = useRemotionEnvironment();
1737
- const scope = useContext8(DelayRenderContextType);
1733
+ const scope = useContext8(DelayRenderContextType) ?? (typeof window !== "undefined" ? window : undefined);
1738
1734
  const logLevel = useLogLevel();
1739
1735
  const delayRender2 = useCallback4((label, options) => {
1736
+ if (!scope) {
1737
+ return Math.random();
1738
+ }
1740
1739
  return delayRenderInternal({
1741
- scope: scope ?? (typeof window !== "undefined" ? window : undefined),
1740
+ scope,
1742
1741
  environment,
1743
1742
  label: label ?? null,
1744
1743
  options: options ?? {}
1745
1744
  });
1746
1745
  }, [environment, scope]);
1747
1746
  const continueRender2 = useCallback4((handle) => {
1747
+ if (!scope) {
1748
+ return;
1749
+ }
1748
1750
  continueRenderInternal({
1749
- scope: scope ?? (typeof window !== "undefined" ? window : undefined),
1751
+ scope,
1750
1752
  handle,
1751
1753
  environment,
1752
1754
  logLevel
@@ -3105,7 +3107,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
3105
3107
  });
3106
3108
  }, [refs]);
3107
3109
  const registerAudio = useCallback7((options) => {
3108
- const { aud, audioId, premounting } = options;
3110
+ const { aud, audioId, premounting, postmounting } = options;
3109
3111
  const found = audios.current?.find((a) => a.audioId === audioId);
3110
3112
  if (found) {
3111
3113
  return found;
@@ -3124,7 +3126,9 @@ Check that all your Remotion packages are on the same version. If your dependenc
3124
3126
  el: ref,
3125
3127
  audioId,
3126
3128
  mediaElementSourceNode,
3127
- premounting
3129
+ premounting,
3130
+ audioMounted: Boolean(ref.current),
3131
+ postmounting
3128
3132
  };
3129
3133
  audios.current?.push(newElem);
3130
3134
  rerenderAudios();
@@ -3145,12 +3149,17 @@ Check that all your Remotion packages are on the same version. If your dependenc
3145
3149
  aud,
3146
3150
  audioId,
3147
3151
  id,
3148
- premounting
3152
+ premounting,
3153
+ postmounting
3149
3154
  }) => {
3150
3155
  let changed = false;
3151
3156
  audios.current = audios.current?.map((prevA) => {
3157
+ const audioMounted = Boolean(prevA.el.current);
3158
+ if (prevA.audioMounted !== audioMounted) {
3159
+ changed = true;
3160
+ }
3152
3161
  if (prevA.id === id) {
3153
- const isTheSame = compareProps(aud, prevA.props) && prevA.premounting === premounting;
3162
+ const isTheSame = compareProps(aud, prevA.props) && prevA.premounting === premounting && prevA.postmounting === postmounting;
3154
3163
  if (isTheSame) {
3155
3164
  return prevA;
3156
3165
  }
@@ -3159,7 +3168,9 @@ Check that all your Remotion packages are on the same version. If your dependenc
3159
3168
  ...prevA,
3160
3169
  props: aud,
3161
3170
  premounting,
3162
- audioId
3171
+ postmounting,
3172
+ audioId,
3173
+ audioMounted
3163
3174
  };
3164
3175
  }
3165
3176
  return prevA;
@@ -3221,12 +3232,13 @@ Check that all your Remotion packages are on the same version. If your dependenc
3221
3232
  }, useSharedAudio = ({
3222
3233
  aud,
3223
3234
  audioId,
3224
- premounting
3235
+ premounting,
3236
+ postmounting
3225
3237
  }) => {
3226
3238
  const ctx = useContext16(SharedAudioContext);
3227
3239
  const [elem] = useState11(() => {
3228
3240
  if (ctx && ctx.numberOfAudioTags > 0) {
3229
- return ctx.registerAudio({ aud, audioId, premounting });
3241
+ return ctx.registerAudio({ aud, audioId, premounting, postmounting });
3230
3242
  }
3231
3243
  const el = React15.createRef();
3232
3244
  const mediaElementSourceNode = ctx?.audioContext ? makeSharedElementSourceNode({
@@ -3239,16 +3251,18 @@ Check that all your Remotion packages are on the same version. If your dependenc
3239
3251
  props: aud,
3240
3252
  audioId,
3241
3253
  mediaElementSourceNode,
3242
- premounting
3254
+ premounting,
3255
+ audioMounted: Boolean(el.current),
3256
+ postmounting
3243
3257
  };
3244
3258
  });
3245
3259
  const effectToUse = React15.useInsertionEffect ?? React15.useLayoutEffect;
3246
3260
  if (typeof document !== "undefined") {
3247
3261
  effectToUse(() => {
3248
3262
  if (ctx && ctx.numberOfAudioTags > 0) {
3249
- ctx.updateAudio({ id: elem.id, aud, audioId, premounting });
3263
+ ctx.updateAudio({ id: elem.id, aud, audioId, premounting, postmounting });
3250
3264
  }
3251
- }, [aud, ctx, elem.id, audioId, premounting]);
3265
+ }, [aud, ctx, elem.id, audioId, premounting, postmounting]);
3252
3266
  effectToUse(() => {
3253
3267
  return () => {
3254
3268
  if (ctx && ctx.numberOfAudioTags > 0) {
@@ -4486,7 +4500,8 @@ Check that all your Remotion packages are on the same version. If your dependenc
4486
4500
  const { el: audioRef, mediaElementSourceNode } = useSharedAudio({
4487
4501
  aud: propsToPass,
4488
4502
  audioId: id,
4489
- premounting: Boolean(sequenceContext?.premounting)
4503
+ premounting: Boolean(sequenceContext?.premounting),
4504
+ postmounting: Boolean(sequenceContext?.postmounting)
4490
4505
  });
4491
4506
  useMediaInTimeline({
4492
4507
  volume,
@@ -6855,12 +6870,12 @@ var init_esm = __esm(() => {
6855
6870
  warn,
6856
6871
  error
6857
6872
  };
6858
- handles = [];
6859
6873
  if (typeof window !== "undefined") {
6860
6874
  window.remotion_renderReady = false;
6861
6875
  if (!window.remotion_delayRenderTimeouts) {
6862
6876
  window.remotion_delayRenderTimeouts = {};
6863
6877
  }
6878
+ window.remotion_delayRenderHandles = [];
6864
6879
  }
6865
6880
  LogLevelContext = createContext8({
6866
6881
  logLevel: "info",
@@ -20516,21 +20531,21 @@ init_esm();
20516
20531
  import { jsx as jsx50, jsxs as jsxs14 } from "react/jsx-runtime";
20517
20532
  import { jsx as jsx213, jsxs as jsxs24, Fragment as Fragment6 } from "react/jsx-runtime";
20518
20533
  import React41 from "react";
20519
- import { useContext as useContext210, useEffect as useEffect210, useState as useState35 } from "react";
20520
- import { useContext as useContext40, useEffect as useEffect36 } from "react";
20534
+ import { useContext as useContext210, useEffect as useEffect36, useState as useState35 } from "react";
20535
+ import { useContext as useContext40, useLayoutEffect as useLayoutEffect15 } from "react";
20521
20536
  import { jsx as jsx310 } from "react/jsx-runtime";
20522
20537
  import { useCallback as useCallback27, useRef as useRef33 } from "react";
20523
- import { useEffect as useEffect37, useState as useState210 } from "react";
20524
- import { useContext as useContext42, useEffect as useEffect62, useRef as useRef42 } from "react";
20525
- import { useEffect as useEffect42 } from "react";
20538
+ import { useEffect as useEffect210, useState as useState210 } from "react";
20539
+ import { useContext as useContext42, useEffect as useEffect52, useRef as useRef42 } from "react";
20540
+ import { useEffect as useEffect37 } from "react";
20526
20541
  import { useCallback as useCallback28, useContext as useContext37, useMemo as useMemo42, useRef as useRef24, useState as useState36 } from "react";
20527
- import { useEffect as useEffect52, useRef as useRef34 } from "react";
20528
- import { useCallback as useCallback32, useEffect as useEffect72, useMemo as useMemo212, useState as useState42 } from "react";
20542
+ import { useEffect as useEffect42, useRef as useRef34 } from "react";
20543
+ import { useCallback as useCallback32, useEffect as useEffect62, useMemo as useMemo212, useState as useState42 } from "react";
20529
20544
  import {
20530
20545
  forwardRef as forwardRef26,
20531
- useEffect as useEffect142,
20546
+ useEffect as useEffect132,
20532
20547
  useImperativeHandle as useImperativeHandle22,
20533
- useLayoutEffect as useLayoutEffect15,
20548
+ useLayoutEffect as useLayoutEffect23,
20534
20549
  useMemo as useMemo142,
20535
20550
  useRef as useRef112,
20536
20551
  useState as useState132
@@ -20540,13 +20555,13 @@ import React102, {
20540
20555
  forwardRef as forwardRef27,
20541
20556
  useCallback as useCallback112,
20542
20557
  useContext as useContext62,
20543
- useEffect as useEffect132,
20558
+ useEffect as useEffect122,
20544
20559
  useImperativeHandle as useImperativeHandle12,
20545
20560
  useMemo as useMemo122,
20546
20561
  useRef as useRef102,
20547
20562
  useState as useState113
20548
20563
  } from "react";
20549
- import { useCallback as useCallback82, useEffect as useEffect112, useMemo as useMemo92, useRef as useRef82, useState as useState102 } from "react";
20564
+ import { useCallback as useCallback82, useEffect as useEffect102, useMemo as useMemo92, useRef as useRef82, useState as useState102 } from "react";
20550
20565
  import { jsx as jsx45 } from "react/jsx-runtime";
20551
20566
  import { useCallback as useCallback52, useMemo as useMemo43, useRef as useRef52, useState as useState62 } from "react";
20552
20567
  import React38, { useCallback as useCallback42, useMemo as useMemo34, useState as useState52 } from "react";
@@ -20555,13 +20570,13 @@ import { jsx as jsx64, jsxs as jsxs42 } from "react/jsx-runtime";
20555
20570
  import {
20556
20571
  useCallback as useCallback62,
20557
20572
  useContext as useContext52,
20558
- useEffect as useEffect92,
20573
+ useEffect as useEffect83,
20559
20574
  useMemo as useMemo52,
20560
20575
  useState as useState82
20561
20576
  } from "react";
20562
- import { useEffect as useEffect83, useRef as useRef62, useState as useState72 } from "react";
20577
+ import { useEffect as useEffect72, useRef as useRef62, useState as useState72 } from "react";
20563
20578
  import { jsx as jsx74, jsxs as jsxs52 } from "react/jsx-runtime";
20564
- import { useCallback as useCallback72, useEffect as useEffect102, useMemo as useMemo62, useRef as useRef72, useState as useState92 } from "react";
20579
+ import { useCallback as useCallback72, useEffect as useEffect92, useMemo as useMemo62, useRef as useRef72, useState as useState92 } from "react";
20565
20580
  import { jsx as jsx84, jsxs as jsxs62 } from "react/jsx-runtime";
20566
20581
  import { useMemo as useMemo72 } from "react";
20567
20582
  import { jsxs as jsxs7 } from "react/jsx-runtime";
@@ -20569,7 +20584,7 @@ import { useMemo as useMemo82 } from "react";
20569
20584
  import { jsx as jsx94, jsxs as jsxs82, Fragment as Fragment22 } from "react/jsx-runtime";
20570
20585
  import React82 from "react";
20571
20586
  import { jsx as jsx104 } from "react/jsx-runtime";
20572
- import React92, { useEffect as useEffect122 } from "react";
20587
+ import React92, { useEffect as useEffect112 } from "react";
20573
20588
  import { jsx as jsx113 } from "react/jsx-runtime";
20574
20589
  import { useCallback as useCallback102, useMemo as useMemo112 } from "react";
20575
20590
  import { useCallback as useCallback92, useMemo as useMemo102, useRef as useRef92 } from "react";
@@ -20685,6 +20700,7 @@ if (typeof window !== "undefined") {
20685
20700
  if (!window.remotion_delayRenderTimeouts) {
20686
20701
  window.remotion_delayRenderTimeouts = {};
20687
20702
  }
20703
+ window.remotion_delayRenderHandles = [];
20688
20704
  }
20689
20705
  var DELAY_RENDER_CALLSTACK_TOKEN2 = "The delayRender was called:";
20690
20706
  var DELAY_RENDER_RETRIES_LEFT2 = "Retries left: ";
@@ -21210,7 +21226,7 @@ import { jsx as jsx143 } from "react/jsx-runtime";
21210
21226
  import {
21211
21227
  forwardRef as forwardRef42,
21212
21228
  useImperativeHandle as useImperativeHandle42,
21213
- useLayoutEffect as useLayoutEffect23,
21229
+ useLayoutEffect as useLayoutEffect33,
21214
21230
  useMemo as useMemo172,
21215
21231
  useRef as useRef132,
21216
21232
  useState as useState142
@@ -21663,7 +21679,7 @@ var useBufferStateEmitter = (emitter) => {
21663
21679
  if (!bufferManager) {
21664
21680
  throw new Error("BufferingContextReact not found");
21665
21681
  }
21666
- useEffect36(() => {
21682
+ useLayoutEffect15(() => {
21667
21683
  const clear1 = bufferManager.listenForBuffering(() => {
21668
21684
  bufferManager.buffering.current = true;
21669
21685
  emitter.dispatchWaiting({});
@@ -21684,7 +21700,7 @@ var PlayerEmitterProvider = ({ children, currentPlaybackRate }) => {
21684
21700
  if (!bufferManager) {
21685
21701
  throw new Error("BufferingContextReact not found");
21686
21702
  }
21687
- useEffect210(() => {
21703
+ useEffect36(() => {
21688
21704
  if (currentPlaybackRate) {
21689
21705
  emitter.dispatchRateChange(currentPlaybackRate);
21690
21706
  }
@@ -21697,7 +21713,7 @@ var PlayerEmitterProvider = ({ children, currentPlaybackRate }) => {
21697
21713
  };
21698
21714
  var useHoverState = (ref, hideControlsWhenPointerDoesntMove) => {
21699
21715
  const [hovered, setHovered] = useState210(false);
21700
- useEffect37(() => {
21716
+ useEffect210(() => {
21701
21717
  const { current } = ref;
21702
21718
  if (!current) {
21703
21719
  return;
@@ -21903,7 +21919,7 @@ var useBrowserMediaSession = ({
21903
21919
  playbackRate
21904
21920
  }) => {
21905
21921
  const { playing, pause, play, emitter, getCurrentFrame, seek: seek2 } = usePlayer();
21906
- useEffect42(() => {
21922
+ useEffect37(() => {
21907
21923
  if (!navigator.mediaSession) {
21908
21924
  return;
21909
21925
  }
@@ -21916,7 +21932,7 @@ var useBrowserMediaSession = ({
21916
21932
  navigator.mediaSession.playbackState = "paused";
21917
21933
  }
21918
21934
  }, [browserMediaControlsBehavior.mode, playing]);
21919
- useEffect42(() => {
21935
+ useEffect37(() => {
21920
21936
  if (!navigator.mediaSession) {
21921
21937
  return;
21922
21938
  }
@@ -21946,7 +21962,7 @@ var useBrowserMediaSession = ({
21946
21962
  playbackRate,
21947
21963
  videoConfig
21948
21964
  ]);
21949
- useEffect42(() => {
21965
+ useEffect37(() => {
21950
21966
  if (!navigator.mediaSession) {
21951
21967
  return;
21952
21968
  }
@@ -22040,7 +22056,7 @@ var getIsBackgrounded = () => {
22040
22056
  };
22041
22057
  var useIsBackgrounded = () => {
22042
22058
  const isBackgrounded = useRef34(getIsBackgrounded());
22043
- useEffect52(() => {
22059
+ useEffect42(() => {
22044
22060
  const onVisibilityChange = () => {
22045
22061
  isBackgrounded.current = getIsBackgrounded();
22046
22062
  };
@@ -22075,7 +22091,7 @@ var usePlayback = ({
22075
22091
  playbackRate,
22076
22092
  videoConfig: config
22077
22093
  });
22078
- useEffect62(() => {
22094
+ useEffect52(() => {
22079
22095
  if (!config) {
22080
22096
  return;
22081
22097
  }
@@ -22176,7 +22192,7 @@ var usePlayback = ({
22176
22192
  getCurrentFrame,
22177
22193
  context
22178
22194
  ]);
22179
- useEffect62(() => {
22195
+ useEffect52(() => {
22180
22196
  const interval = setInterval(() => {
22181
22197
  if (lastTimeUpdateEvent.current === getCurrentFrame()) {
22182
22198
  return;
@@ -22186,7 +22202,7 @@ var usePlayback = ({
22186
22202
  }, 250);
22187
22203
  return () => clearInterval(interval);
22188
22204
  }, [emitter, getCurrentFrame]);
22189
- useEffect62(() => {
22205
+ useEffect52(() => {
22190
22206
  emitter.dispatchFrameUpdate({ frame });
22191
22207
  }, [emitter, frame]);
22192
22208
  };
@@ -22269,7 +22285,7 @@ var useElementSize = (ref, options2) => {
22269
22285
  };
22270
22286
  });
22271
22287
  }, [ref]);
22272
- useEffect72(() => {
22288
+ useEffect62(() => {
22273
22289
  if (!observer) {
22274
22290
  return;
22275
22291
  }
@@ -22283,7 +22299,7 @@ var useElementSize = (ref, options2) => {
22283
22299
  }
22284
22300
  };
22285
22301
  }, [observer, ref, updateSize]);
22286
- useEffect72(() => {
22302
+ useEffect62(() => {
22287
22303
  if (!options2.triggerOnWindowResize) {
22288
22304
  return;
22289
22305
  }
@@ -22292,7 +22308,7 @@ var useElementSize = (ref, options2) => {
22292
22308
  window.removeEventListener("resize", updateSize);
22293
22309
  };
22294
22310
  }, [options2.triggerOnWindowResize, updateSize]);
22295
- useEffect72(() => {
22311
+ useEffect62(() => {
22296
22312
  elementSizeHooks.push(updateSize);
22297
22313
  return () => {
22298
22314
  elementSizeHooks = elementSizeHooks.filter((e) => e !== updateSize);
@@ -22511,7 +22527,7 @@ var MediaVolumeSlider = ({ displayVerticalVolumeSlider, renderMuteButton, render
22511
22527
  function useComponentVisible(initialIsVisible) {
22512
22528
  const [isComponentVisible, setIsComponentVisible] = useState72(initialIsVisible);
22513
22529
  const ref = useRef62(null);
22514
- useEffect83(() => {
22530
+ useEffect72(() => {
22515
22531
  const handleClickOutside = (event) => {
22516
22532
  if (ref.current && !ref.current.contains(event.target)) {
22517
22533
  setIsComponentVisible(false);
@@ -22595,7 +22611,7 @@ var PlaybackrateOption = ({ rate, onSelect, selectedRate, keyboardSelectedRate }
22595
22611
  var PlaybackPopup = ({ setIsComponentVisible, playbackRates, canvasSize }) => {
22596
22612
  const { setPlaybackRate, playbackRate } = useContext52(Internals.TimelineContext);
22597
22613
  const [keyboardSelectedRate, setKeyboardSelectedRate] = useState82(playbackRate);
22598
- useEffect92(() => {
22614
+ useEffect83(() => {
22599
22615
  const listener = (e) => {
22600
22616
  e.preventDefault();
22601
22617
  if (e.key === "ArrowUp") {
@@ -22811,7 +22827,7 @@ var PlayerSeekBar = ({ durationInFrames, onSeekEnd, onSeekStart, inFrame, outFra
22811
22827
  }
22812
22828
  onSeekEnd();
22813
22829
  }, [dragging, onSeekEnd, pause, play]);
22814
- useEffect102(() => {
22830
+ useEffect92(() => {
22815
22831
  if (!dragging.dragging) {
22816
22832
  return;
22817
22833
  }
@@ -23071,17 +23087,17 @@ var Controls = ({
23071
23087
  opacity: Number(shouldShow)
23072
23088
  };
23073
23089
  }, [hovered, shouldShowInitially, playing, alwaysShowControls]);
23074
- useEffect112(() => {
23090
+ useEffect102(() => {
23075
23091
  if (playButtonRef.current && spaceKeyToPlayOrPause) {
23076
23092
  playButtonRef.current.focus({
23077
23093
  preventScroll: true
23078
23094
  });
23079
23095
  }
23080
23096
  }, [playing, spaceKeyToPlayOrPause]);
23081
- useEffect112(() => {
23097
+ useEffect102(() => {
23082
23098
  setSupportsFullscreen((typeof document !== "undefined" && (document.fullscreenEnabled || document.webkitFullscreenEnabled)) ?? false);
23083
23099
  }, []);
23084
- useEffect112(() => {
23100
+ useEffect102(() => {
23085
23101
  if (shouldShowInitially === false) {
23086
23102
  return;
23087
23103
  }
@@ -23279,7 +23295,7 @@ var DOMAIN_BLACKLIST = [
23279
23295
  var ran = false;
23280
23296
  var RenderWarningIfBlacklist = () => {
23281
23297
  const [unlicensed, setUnlicensed] = React92.useState(false);
23282
- useEffect122(() => {
23298
+ useEffect112(() => {
23283
23299
  if (ran) {
23284
23300
  return;
23285
23301
  }
@@ -23290,7 +23306,7 @@ var RenderWarningIfBlacklist = () => {
23290
23306
  }
23291
23307
  }).catch(() => {});
23292
23308
  }, []);
23293
- useEffect122(() => {
23309
+ useEffect112(() => {
23294
23310
  if (!unlicensed) {
23295
23311
  return;
23296
23312
  }
@@ -23486,13 +23502,13 @@ var PlayerUI = ({
23486
23502
  getCurrentFrame: player.getCurrentFrame,
23487
23503
  browserMediaControlsBehavior
23488
23504
  });
23489
- useEffect132(() => {
23505
+ useEffect122(() => {
23490
23506
  if (hasPausedToResume && !player.playing) {
23491
23507
  setHasPausedToResume(false);
23492
23508
  player.play();
23493
23509
  }
23494
23510
  }, [hasPausedToResume, player]);
23495
- useEffect132(() => {
23511
+ useEffect122(() => {
23496
23512
  const { current } = container4;
23497
23513
  if (!current) {
23498
23514
  return;
@@ -23534,7 +23550,7 @@ var PlayerUI = ({
23534
23550
  document.exitFullscreen();
23535
23551
  }
23536
23552
  }, []);
23537
- useEffect132(() => {
23553
+ useEffect122(() => {
23538
23554
  const { current } = container4;
23539
23555
  if (!current) {
23540
23556
  return;
@@ -23572,7 +23588,7 @@ var PlayerUI = ({
23572
23588
  }, [canvasSize, config]);
23573
23589
  const scale = layout?.scale ?? 1;
23574
23590
  const initialScaleIgnored = useRef102(false);
23575
- useEffect132(() => {
23591
+ useEffect122(() => {
23576
23592
  if (!initialScaleIgnored.current) {
23577
23593
  initialScaleIgnored.current = true;
23578
23594
  return;
@@ -23581,17 +23597,17 @@ var PlayerUI = ({
23581
23597
  }, [player.emitter, scale]);
23582
23598
  const { setMediaVolume, setMediaMuted } = useContext62(Internals.SetMediaVolumeContext);
23583
23599
  const { mediaMuted, mediaVolume } = useContext62(Internals.MediaVolumeContext);
23584
- useEffect132(() => {
23600
+ useEffect122(() => {
23585
23601
  player.emitter.dispatchVolumeChange(mediaVolume);
23586
23602
  }, [player.emitter, mediaVolume]);
23587
23603
  const isMuted = mediaMuted || mediaVolume === 0;
23588
- useEffect132(() => {
23604
+ useEffect122(() => {
23589
23605
  player.emitter.dispatchMuteChange({
23590
23606
  isMuted
23591
23607
  });
23592
23608
  }, [player.emitter, isMuted]);
23593
23609
  const [showBufferIndicator, setShowBufferState] = useState113(false);
23594
- useEffect132(() => {
23610
+ useEffect122(() => {
23595
23611
  let timeout = null;
23596
23612
  let stopped = false;
23597
23613
  const onBuffer = () => {
@@ -23763,7 +23779,7 @@ var PlayerUI = ({
23763
23779
  }
23764
23780
  }, [exitFullscreen, isFullscreen, requestFullscreen]);
23765
23781
  const { handlePointerDown, handleDoubleClick } = useClickPreventionOnDoubleClick(onSingleClick, onDoubleClick, doubleClickToFullscreen && allowFullscreen && supportsFullScreen);
23766
- useEffect132(() => {
23782
+ useEffect122(() => {
23767
23783
  if (shouldAutoplay) {
23768
23784
  player.play();
23769
23785
  setShouldAutoPlay(false);
@@ -24270,7 +24286,7 @@ var PlayerFn = ({
24270
24286
  throw new TypeError(`'numberOfSharedAudioTags' must be an integer but got '${numberOfSharedAudioTags}' instead`);
24271
24287
  }
24272
24288
  validatePlaybackRate(currentPlaybackRate);
24273
- useEffect142(() => {
24289
+ useEffect132(() => {
24274
24290
  setCurrentPlaybackRate(playbackRate);
24275
24291
  }, [playbackRate]);
24276
24292
  useImperativeHandle22(ref, () => rootRef.current, []);
@@ -24302,7 +24318,7 @@ var PlayerFn = ({
24302
24318
  };
24303
24319
  }, [setFrame]);
24304
24320
  if (typeof window !== "undefined") {
24305
- useLayoutEffect15(() => {
24321
+ useLayoutEffect23(() => {
24306
24322
  Internals.CSSUtils.injectCSS(Internals.CSSUtils.makeDefaultPreviewCSS(`.${playerCssClassname(overrideInternalClassName)}`, "#fff"));
24307
24323
  }, [overrideInternalClassName]);
24308
24324
  }
@@ -24527,7 +24543,7 @@ var ThumbnailFn = ({
24527
24543
  ...componentProps
24528
24544
  }, ref) => {
24529
24545
  if (typeof window !== "undefined") {
24530
- useLayoutEffect23(() => {
24546
+ useLayoutEffect33(() => {
24531
24547
  window.remotion_isPlayer = true;
24532
24548
  }, []);
24533
24549
  }