remotion 4.0.375 → 4.0.377

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.
@@ -13,7 +13,7 @@ const Artifact = ({ filename, content, downloadBehavior }) => {
13
13
  const [id] = (0, react_1.useState)(() => {
14
14
  return String(Math.random());
15
15
  });
16
- (0, react_1.useEffect)(() => {
16
+ (0, react_1.useLayoutEffect)(() => {
17
17
  if (!env.isRendering) {
18
18
  return;
19
19
  }
@@ -43,7 +43,7 @@ type MandatoryDimensions<Schema extends AnyZodObject, Props extends Record<strin
43
43
  calculateMetadata?: CalculateMetadataFunction<InferProps<Schema, Props>>;
44
44
  };
45
45
  type StillCalculateMetadataOrExplicit<Schema extends AnyZodObject, Props extends Record<string, unknown>> = OptionalDimensions<Schema, Props> | MandatoryDimensions<Schema, Props>;
46
- type CompositionCalculateMetadataOrExplicit<Schema extends AnyZodObject, Props extends Record<string, unknown>> = (OptionalDimensions<Schema, Props> & {
46
+ export type CompositionCalculateMetadataOrExplicit<Schema extends AnyZodObject, Props extends Record<string, unknown>> = (OptionalDimensions<Schema, Props> & {
47
47
  fps?: number;
48
48
  durationInFrames?: number;
49
49
  }) | (MandatoryDimensions<Schema, Props> & {
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import type { LogLevel } from './log.js';
3
- export declare const RemotionRoot: React.FC<{
3
+ export declare const RemotionRootContexts: React.FC<{
4
4
  readonly children: React.ReactNode;
5
5
  readonly numberOfAudioTags: number;
6
6
  readonly logLevel: LogLevel;
@@ -1,10 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.RemotionRoot = void 0;
3
+ exports.RemotionRootContexts = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_1 = require("react");
6
6
  const EditorProps_js_1 = require("./EditorProps.js");
7
- const RenderAssetManager_js_1 = require("./RenderAssetManager.js");
8
7
  const SequenceManager_js_1 = require("./SequenceManager.js");
9
8
  const TimelineContext_js_1 = require("./TimelineContext.js");
10
9
  const shared_audio_tags_js_1 = require("./audio/shared-audio-tags.js");
@@ -14,7 +13,7 @@ const nonce_js_1 = require("./nonce.js");
14
13
  const prefetch_state_js_1 = require("./prefetch-state.js");
15
14
  const use_media_enabled_js_1 = require("./use-media-enabled.js");
16
15
  const duration_state_js_1 = require("./video/duration-state.js");
17
- const RemotionRoot = ({ children, numberOfAudioTags, logLevel, audioLatencyHint, videoEnabled, audioEnabled, frameState, }) => {
16
+ const RemotionRootContexts = ({ children, numberOfAudioTags, logLevel, audioLatencyHint, videoEnabled, audioEnabled, frameState, }) => {
18
17
  const [fastRefreshes, setFastRefreshes] = (0, react_1.useState)(0);
19
18
  const [manualRefreshes, setManualRefreshes] = (0, react_1.useState)(0);
20
19
  const nonceContext = (0, react_1.useMemo)(() => {
@@ -46,6 +45,6 @@ const RemotionRoot = ({ children, numberOfAudioTags, logLevel, audioLatencyHint,
46
45
  const logging = (0, react_1.useMemo)(() => {
47
46
  return { logLevel, mountTime: Date.now() };
48
47
  }, [logLevel]);
49
- return ((0, jsx_runtime_1.jsx)(log_level_context_js_1.LogLevelContext.Provider, { value: logging, children: (0, jsx_runtime_1.jsx)(nonce_js_1.NonceContext.Provider, { value: nonceContext, children: (0, jsx_runtime_1.jsx)(nonce_js_1.SetNonceContext.Provider, { value: setNonceContext, children: (0, jsx_runtime_1.jsx)(TimelineContext_js_1.TimelineContextProvider, { frameState: frameState, children: (0, jsx_runtime_1.jsx)(use_media_enabled_js_1.MediaEnabledProvider, { videoEnabled: videoEnabled, audioEnabled: audioEnabled, children: (0, jsx_runtime_1.jsx)(EditorProps_js_1.EditorPropsProvider, { children: (0, jsx_runtime_1.jsx)(prefetch_state_js_1.PrefetchProvider, { children: (0, jsx_runtime_1.jsx)(SequenceManager_js_1.SequenceManagerProvider, { children: (0, jsx_runtime_1.jsx)(RenderAssetManager_js_1.RenderAssetManagerProvider, { children: (0, jsx_runtime_1.jsx)(shared_audio_tags_js_1.SharedAudioContextProvider, { numberOfAudioTags: numberOfAudioTags, audioLatencyHint: audioLatencyHint, children: (0, jsx_runtime_1.jsx)(duration_state_js_1.DurationsContextProvider, { children: (0, jsx_runtime_1.jsx)(buffering_js_1.BufferingProvider, { children: children }) }) }) }) }) }) }) }) }) }) }) }));
48
+ return ((0, jsx_runtime_1.jsx)(log_level_context_js_1.LogLevelContext.Provider, { value: logging, children: (0, jsx_runtime_1.jsx)(nonce_js_1.NonceContext.Provider, { value: nonceContext, children: (0, jsx_runtime_1.jsx)(nonce_js_1.SetNonceContext.Provider, { value: setNonceContext, children: (0, jsx_runtime_1.jsx)(TimelineContext_js_1.TimelineContextProvider, { frameState: frameState, children: (0, jsx_runtime_1.jsx)(use_media_enabled_js_1.MediaEnabledProvider, { videoEnabled: videoEnabled, audioEnabled: audioEnabled, children: (0, jsx_runtime_1.jsx)(EditorProps_js_1.EditorPropsProvider, { children: (0, jsx_runtime_1.jsx)(prefetch_state_js_1.PrefetchProvider, { children: (0, jsx_runtime_1.jsx)(SequenceManager_js_1.SequenceManagerProvider, { children: (0, jsx_runtime_1.jsx)(shared_audio_tags_js_1.SharedAudioContextProvider, { numberOfAudioTags: numberOfAudioTags, audioLatencyHint: audioLatencyHint, children: (0, jsx_runtime_1.jsx)(duration_state_js_1.DurationsContextProvider, { children: (0, jsx_runtime_1.jsx)(buffering_js_1.BufferingProvider, { children: children }) }) }) }) }) }) }) }) }) }) }));
50
49
  };
51
- exports.RemotionRoot = RemotionRoot;
50
+ exports.RemotionRootContexts = RemotionRootContexts;
@@ -5,6 +5,10 @@ export type RenderAssetManagerContext = {
5
5
  renderAssets: TRenderAsset[];
6
6
  };
7
7
  export declare const RenderAssetManager: import("react").Context<RenderAssetManagerContext>;
8
+ export type CollectAssetsRef = {
9
+ collectAssets: () => TRenderAsset[];
10
+ };
8
11
  export declare const RenderAssetManagerProvider: React.FC<{
9
12
  children: React.ReactNode;
13
+ collectAssets: null | React.RefObject<CollectAssetsRef | null>;
10
14
  }>;
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.RenderAssetManagerProvider = exports.RenderAssetManager = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_1 = require("react");
6
+ const react_dom_1 = require("react-dom");
6
7
  const validate_artifact_js_1 = require("./validation/validate-artifact.js");
7
8
  exports.RenderAssetManager = (0, react_1.createContext)({
8
9
  // Must be undefined, otherwise error in Player
@@ -10,7 +11,7 @@ exports.RenderAssetManager = (0, react_1.createContext)({
10
11
  unregisterRenderAsset: () => undefined,
11
12
  renderAssets: [],
12
13
  });
13
- const RenderAssetManagerProvider = ({ children }) => {
14
+ const RenderAssetManagerProvider = ({ children, collectAssets }) => {
14
15
  const [renderAssets, setRenderAssets] = (0, react_1.useState)([]);
15
16
  const registerRenderAsset = (0, react_1.useCallback)((renderAsset) => {
16
17
  (0, validate_artifact_js_1.validateRenderAsset)(renderAsset);
@@ -18,6 +19,19 @@ const RenderAssetManagerProvider = ({ children }) => {
18
19
  return [...assets, renderAsset];
19
20
  });
20
21
  }, []);
22
+ if (collectAssets) {
23
+ // eslint-disable-next-line react-hooks/rules-of-hooks
24
+ (0, react_1.useImperativeHandle)(collectAssets, () => {
25
+ return {
26
+ collectAssets: () => {
27
+ (0, react_dom_1.flushSync)(() => {
28
+ setRenderAssets([]); // clear assets at next render
29
+ });
30
+ return renderAssets;
31
+ },
32
+ };
33
+ }, [renderAssets]);
34
+ }
21
35
  const unregisterRenderAsset = (0, react_1.useCallback)((id) => {
22
36
  setRenderAssets((assts) => {
23
37
  return assts.filter((a) => a.id !== id);
@@ -64,7 +64,7 @@ const ResolveCompositionConfigInStudio = ({ children }) => {
64
64
  const result = (0, resolve_video_config_js_1.resolveVideoConfigOrCatch)({
65
65
  compositionId,
66
66
  calculateMetadata,
67
- originalProps: combinedProps,
67
+ inputProps: combinedProps,
68
68
  signal,
69
69
  defaultProps,
70
70
  compositionDurationInFrames,
@@ -92,6 +92,7 @@ export { Artifact } from './Artifact.js';
92
92
  export { Audio, Html5Audio, RemotionAudioProps } from './audio/index.js';
93
93
  export type { LoopVolumeCurveBehavior } from './audio/use-audio-frame.js';
94
94
  export { cancelRender } from './cancel-render.js';
95
+ export type { Codec } from './codec.js';
95
96
  export { CalculateMetadataFunction, Composition, CompositionProps, CompProps, StillProps, } from './Composition.js';
96
97
  export type { CanvasContent } from './CompositionManagerContext.js';
97
98
  export { getInputProps } from './config/input-props.js';
@@ -12,6 +12,7 @@ import type { MediaVolumeContextValue, SetMediaVolumeContextValue } from './volu
12
12
  import type { WatchRemotionStaticFilesPayload } from './watch-static-file.js';
13
13
  import { useRemotionContexts } from './wrap-remotion-context.js';
14
14
  export declare const Internals: {
15
+ readonly MaxMediaCacheSizeContext: import("react").Context<number | null>;
15
16
  readonly useUnsafeVideoConfig: () => import("./video-config.js").VideoConfig | null;
16
17
  readonly useFrameForVolumeProp: (behavior: import("./audio/use-audio-frame.js").LoopVolumeCurveBehavior) => number;
17
18
  readonly useTimelinePosition: () => number;
@@ -71,7 +72,7 @@ export declare const Internals: {
71
72
  readonly CompositionSetters: import("react").Context<import("./CompositionManagerContext.js").CompositionManagerSetters>;
72
73
  readonly SequenceManager: import("react").Context<import("./SequenceManager.js").SequenceManagerContext>;
73
74
  readonly SequenceVisibilityToggleContext: import("react").Context<import("./SequenceManager.js").SequenceVisibilityToggleState>;
74
- readonly RemotionRoot: import("react").FC<{
75
+ readonly RemotionRootContexts: import("react").FC<{
75
76
  readonly children: React.ReactNode;
76
77
  readonly numberOfAudioTags: number;
77
78
  readonly logLevel: import("./log.js").LogLevel;
@@ -188,7 +189,7 @@ export declare const Internals: {
188
189
  readonly usePreload: (src: string) => string;
189
190
  readonly NonceContext: import("react").Context<import("./nonce.js").TNonceContext>;
190
191
  readonly SetNonceContext: import("react").Context<import("./nonce.js").TSetNonceContext>;
191
- readonly resolveVideoConfig: ({ calculateMetadata, signal, defaultProps, originalProps, compositionId, compositionDurationInFrames, compositionFps, compositionHeight, compositionWidth, }: {
192
+ readonly resolveVideoConfig: ({ calculateMetadata, signal, defaultProps, inputProps: originalProps, compositionId, compositionDurationInFrames, compositionFps, compositionHeight, compositionWidth, }: {
192
193
  compositionId: string;
193
194
  compositionWidth: number | null;
194
195
  compositionHeight: number | null;
@@ -197,7 +198,7 @@ export declare const Internals: {
197
198
  calculateMetadata: import("./Composition.js").CalculateMetadataFunction<import("./props-if-has-props.js").InferProps<import("zod").AnyZodObject, Record<string, unknown>>> | null;
198
199
  signal: AbortSignal;
199
200
  defaultProps: Record<string, unknown>;
200
- originalProps: Record<string, unknown>;
201
+ inputProps: Record<string, unknown>;
201
202
  }) => import("./video-config.js").VideoConfig | Promise<import("./video-config.js").VideoConfig>;
202
203
  readonly useResolvedVideoConfig: (preferredCompositionId: string | null) => ({
203
204
  type: "loading";
@@ -379,5 +380,9 @@ export declare const Internals: {
379
380
  readonly TimelinePosition: typeof TimelinePosition;
380
381
  readonly DelayRenderContextType: import("react").Context<import("./delay-render.js").DelayRenderScope | null>;
381
382
  readonly TimelineContext: import("react").Context<TimelineContextValue>;
383
+ readonly RenderAssetManagerProvider: import("react").FC<{
384
+ children: React.ReactNode;
385
+ collectAssets: null | React.RefObject<import("./RenderAssetManager.js").CollectAssetsRef | null>;
386
+ }>;
382
387
  };
383
388
  export type { CompositionManagerContext, CompProps, LoggingContextValue, MediaVolumeContextValue, RemotionEnvironment, SerializedJSONWithCustomFields, SetMediaVolumeContextValue, SetTimelineContextValue, TCompMetadata, TComposition, TimelineContextValue, TRenderAsset, TSequence, WatchRemotionStaticFilesPayload, };
@@ -55,6 +55,7 @@ const input_props_override_js_1 = require("./input-props-override.js");
55
55
  const is_player_js_1 = require("./is-player.js");
56
56
  const log_level_context_js_1 = require("./log-level-context.js");
57
57
  const log_js_1 = require("./log.js");
58
+ const max_video_cache_size_js_1 = require("./max-video-cache-size.js");
58
59
  const nonce_js_1 = require("./nonce.js");
59
60
  const playback_logging_js_1 = require("./playback-logging.js");
60
61
  const portal_node_js_1 = require("./portal-node.js");
@@ -98,6 +99,7 @@ const compositionSelectorRef = (0, react_1.createRef)();
98
99
  // Mark them as Internals so use don't assume this is public
99
100
  // API and are less likely to use it
100
101
  exports.Internals = {
102
+ MaxMediaCacheSizeContext: max_video_cache_size_js_1.MaxMediaCacheSizeContext,
101
103
  useUnsafeVideoConfig: use_unsafe_video_config_js_1.useUnsafeVideoConfig,
102
104
  useFrameForVolumeProp: use_audio_frame_js_1.useFrameForVolumeProp,
103
105
  useTimelinePosition: TimelinePosition.useTimelinePosition,
@@ -112,7 +114,7 @@ exports.Internals = {
112
114
  CompositionSetters: CompositionManagerContext_js_1.CompositionSetters,
113
115
  SequenceManager: SequenceManager_js_1.SequenceManager,
114
116
  SequenceVisibilityToggleContext: SequenceManager_js_1.SequenceVisibilityToggleContext,
115
- RemotionRoot: RemotionRoot_js_1.RemotionRoot,
117
+ RemotionRootContexts: RemotionRoot_js_1.RemotionRootContexts,
116
118
  CompositionManagerProvider: CompositionManagerProvider_js_1.CompositionManagerProvider,
117
119
  useVideo: use_video_js_1.useVideo,
118
120
  getRoot: register_root_js_1.getRoot,
@@ -191,4 +193,5 @@ exports.Internals = {
191
193
  TimelinePosition,
192
194
  DelayRenderContextType: use_delay_render_js_1.DelayRenderContextType,
193
195
  TimelineContext: TimelineContext_js_1.TimelineContext,
196
+ RenderAssetManagerProvider: RenderAssetManager_js_1.RenderAssetManagerProvider,
194
197
  };
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const MaxMediaCacheSizeContext: React.Context<number | null>;
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.MaxMediaCacheSizeContext = void 0;
7
+ const react_1 = __importDefault(require("react"));
8
+ exports.MaxMediaCacheSizeContext = react_1.default.createContext(null);
@@ -11,9 +11,9 @@ type ResolveVideoConfigParams = {
11
11
  calculateMetadata: CalculateMetadataFunction<InferProps<AnyZodObject, Record<string, unknown>>> | null;
12
12
  signal: AbortSignal;
13
13
  defaultProps: Record<string, unknown>;
14
- originalProps: Record<string, unknown>;
14
+ inputProps: Record<string, unknown>;
15
15
  };
16
- export declare const resolveVideoConfig: ({ calculateMetadata, signal, defaultProps, originalProps, compositionId, compositionDurationInFrames, compositionFps, compositionHeight, compositionWidth, }: ResolveVideoConfigParams) => VideoConfig | Promise<VideoConfig>;
16
+ export declare const resolveVideoConfig: ({ calculateMetadata, signal, defaultProps, inputProps: originalProps, compositionId, compositionDurationInFrames, compositionFps, compositionHeight, compositionWidth, }: ResolveVideoConfigParams) => VideoConfig | Promise<VideoConfig>;
17
17
  export declare const resolveVideoConfigOrCatch: (params: ResolveVideoConfigParams) => {
18
18
  type: "success";
19
19
  result: VideoConfig | Promise<VideoConfig>;
@@ -40,7 +40,7 @@ const validateCalculated = ({ calculated, compositionId, compositionFps, composi
40
40
  defaultProResProfile,
41
41
  };
42
42
  };
43
- const resolveVideoConfig = ({ calculateMetadata, signal, defaultProps, originalProps, compositionId, compositionDurationInFrames, compositionFps, compositionHeight, compositionWidth, }) => {
43
+ const resolveVideoConfig = ({ calculateMetadata, signal, defaultProps, inputProps: originalProps, compositionId, compositionDurationInFrames, compositionFps, compositionHeight, compositionWidth, }) => {
44
44
  var _a, _b, _c, _d, _e, _f;
45
45
  const calculatedProm = calculateMetadata
46
46
  ? calculateMetadata({
@@ -1,7 +1,8 @@
1
+ import type { cancelRender as cancelRenderOriginal } from './cancel-render.js';
1
2
  import type { DelayRenderOptions, DelayRenderScope } from './delay-render.js';
2
3
  type DelayRenderFn = (label?: string, options?: DelayRenderOptions) => number;
3
4
  type ContinueRenderFn = (handle: number) => void;
4
- type CancelRenderFn = (err: unknown) => never;
5
+ type CancelRenderFn = typeof cancelRenderOriginal;
5
6
  export declare const DelayRenderContextType: import("react").Context<DelayRenderScope | null>;
6
7
  export declare const useDelayRender: () => {
7
8
  delayRender: DelayRenderFn;
@@ -3,4 +3,4 @@
3
3
  * @see [Documentation](https://remotion.dev/docs/version)
4
4
  * @returns {string} The current version of the remotion package
5
5
  */
6
- export declare const VERSION = "4.0.375";
6
+ export declare const VERSION = "4.0.377";
@@ -7,4 +7,4 @@ exports.VERSION = void 0;
7
7
  * @see [Documentation](https://remotion.dev/docs/version)
8
8
  * @returns {string} The current version of the remotion package
9
9
  */
10
- exports.VERSION = '4.0.375';
10
+ exports.VERSION = '4.0.377';
@@ -110,7 +110,7 @@ function truthy(value) {
110
110
  }
111
111
 
112
112
  // src/version.ts
113
- var VERSION = "4.0.375";
113
+ var VERSION = "4.0.377";
114
114
 
115
115
  // src/multiple-versions-warning.ts
116
116
  var checkMultipleRemotionVersions = () => {
@@ -751,7 +751,7 @@ var resolveVideoConfig = ({
751
751
  calculateMetadata,
752
752
  signal,
753
753
  defaultProps,
754
- originalProps,
754
+ inputProps: originalProps,
755
755
  compositionId,
756
756
  compositionDurationInFrames,
757
757
  compositionFps,
@@ -897,7 +897,7 @@ var ResolveCompositionConfigInStudio = ({ children }) => {
897
897
  const result = resolveVideoConfigOrCatch({
898
898
  compositionId,
899
899
  calculateMetadata,
900
- originalProps: combinedProps,
900
+ inputProps: combinedProps,
901
901
  signal,
902
902
  defaultProps,
903
903
  compositionDurationInFrames,
@@ -2352,16 +2352,18 @@ var AnimatedImage = forwardRef3(({
2352
2352
  });
2353
2353
  });
2354
2354
  // src/Artifact.tsx
2355
- import { useContext as useContext14, useEffect as useEffect5, useState as useState9 } from "react";
2355
+ import { useContext as useContext14, useLayoutEffect as useLayoutEffect4, useState as useState9 } from "react";
2356
2356
 
2357
2357
  // src/RenderAssetManager.tsx
2358
2358
  import {
2359
2359
  createContext as createContext12,
2360
2360
  useCallback as useCallback6,
2361
+ useImperativeHandle as useImperativeHandle5,
2361
2362
  useLayoutEffect as useLayoutEffect3,
2362
2363
  useMemo as useMemo11,
2363
2364
  useState as useState8
2364
2365
  } from "react";
2366
+ import { flushSync } from "react-dom";
2365
2367
 
2366
2368
  // src/validation/validate-artifact.ts
2367
2369
  var validateArtifactFilename = (filename) => {
@@ -2405,7 +2407,7 @@ var RenderAssetManager = createContext12({
2405
2407
  },
2406
2408
  renderAssets: []
2407
2409
  });
2408
- var RenderAssetManagerProvider = ({ children }) => {
2410
+ var RenderAssetManagerProvider = ({ children, collectAssets }) => {
2409
2411
  const [renderAssets, setRenderAssets] = useState8([]);
2410
2412
  const registerRenderAsset = useCallback6((renderAsset) => {
2411
2413
  validateRenderAsset(renderAsset);
@@ -2413,6 +2415,18 @@ var RenderAssetManagerProvider = ({ children }) => {
2413
2415
  return [...assets, renderAsset];
2414
2416
  });
2415
2417
  }, []);
2418
+ if (collectAssets) {
2419
+ useImperativeHandle5(collectAssets, () => {
2420
+ return {
2421
+ collectAssets: () => {
2422
+ flushSync(() => {
2423
+ setRenderAssets([]);
2424
+ });
2425
+ return renderAssets;
2426
+ }
2427
+ };
2428
+ }, [renderAssets]);
2429
+ }
2416
2430
  const unregisterRenderAsset = useCallback6((id) => {
2417
2431
  setRenderAssets((assts) => {
2418
2432
  return assts.filter((a) => a.id !== id);
@@ -2448,7 +2462,7 @@ var Artifact = ({ filename, content, downloadBehavior }) => {
2448
2462
  const [id] = useState9(() => {
2449
2463
  return String(Math.random());
2450
2464
  });
2451
- useEffect5(() => {
2465
+ useLayoutEffect4(() => {
2452
2466
  if (!env.isRendering) {
2453
2467
  return;
2454
2468
  }
@@ -2603,7 +2617,7 @@ var playbackLogging = ({
2603
2617
  };
2604
2618
 
2605
2619
  // src/prefetch-state.tsx
2606
- import { createContext as createContext14, useEffect as useEffect6, useState as useState10 } from "react";
2620
+ import { createContext as createContext14, useEffect as useEffect5, useState as useState10 } from "react";
2607
2621
  import { jsx as jsx14 } from "react/jsx-runtime";
2608
2622
  var PreloadContext = createContext14({});
2609
2623
  var preloads = {};
@@ -2614,7 +2628,7 @@ var setPreloads = (updater) => {
2614
2628
  };
2615
2629
  var PrefetchProvider = ({ children }) => {
2616
2630
  const [_preloads, _setPreloads] = useState10(() => preloads);
2617
- useEffect6(() => {
2631
+ useEffect5(() => {
2618
2632
  const updaterFunction = () => {
2619
2633
  _setPreloads(preloads);
2620
2634
  };
@@ -2960,8 +2974,8 @@ var DurationsContextProvider = ({ children }) => {
2960
2974
  import {
2961
2975
  forwardRef as forwardRef4,
2962
2976
  useContext as useContext25,
2963
- useEffect as useEffect14,
2964
- useImperativeHandle as useImperativeHandle5,
2977
+ useEffect as useEffect13,
2978
+ useImperativeHandle as useImperativeHandle6,
2965
2979
  useMemo as useMemo21,
2966
2980
  useRef as useRef12,
2967
2981
  useState as useState15
@@ -2982,7 +2996,7 @@ var getCrossOriginValue = ({
2982
2996
  };
2983
2997
 
2984
2998
  // src/use-amplification.ts
2985
- import { useContext as useContext17, useLayoutEffect as useLayoutEffect4, useRef as useRef7 } from "react";
2999
+ import { useContext as useContext17, useLayoutEffect as useLayoutEffect5, useRef as useRef7 } from "react";
2986
3000
 
2987
3001
  // src/audio/shared-audio-tags.tsx
2988
3002
  import React15, {
@@ -2990,7 +3004,7 @@ import React15, {
2990
3004
  createRef as createRef2,
2991
3005
  useCallback as useCallback7,
2992
3006
  useContext as useContext16,
2993
- useEffect as useEffect7,
3007
+ useEffect as useEffect6,
2994
3008
  useMemo as useMemo15,
2995
3009
  useRef as useRef5,
2996
3010
  useState as useState11
@@ -3285,7 +3299,7 @@ var SharedAudioContextProvider = ({ children, numberOfAudioTags, audioLatencyHin
3285
3299
  audios.current = [];
3286
3300
  rerenderAudios();
3287
3301
  }, [numberOfAudioTags, rerenderAudios]);
3288
- useEffect7(() => {
3302
+ useEffect6(() => {
3289
3303
  return () => {
3290
3304
  resetAudio();
3291
3305
  };
@@ -3490,7 +3504,7 @@ var useVolume = ({
3490
3504
  }
3491
3505
  const { audioContext } = sharedAudioContext;
3492
3506
  if (typeof window !== "undefined") {
3493
- useLayoutEffect4(() => {
3507
+ useLayoutEffect5(() => {
3494
3508
  if (!audioContext) {
3495
3509
  return;
3496
3510
  }
@@ -3540,7 +3554,7 @@ var useVolume = ({
3540
3554
  };
3541
3555
 
3542
3556
  // src/use-media-in-timeline.ts
3543
- import { useContext as useContext19, useEffect as useEffect8, useMemo as useMemo16, useState as useState12 } from "react";
3557
+ import { useContext as useContext19, useEffect as useEffect7, useMemo as useMemo16, useState as useState12 } from "react";
3544
3558
 
3545
3559
  // src/audio/use-audio-frame.ts
3546
3560
  import { useContext as useContext18 } from "react";
@@ -3638,7 +3652,7 @@ var useBasicMediaInTimeline = ({
3638
3652
  });
3639
3653
  }).join(",");
3640
3654
  }, [duration, startsAt, volume, mediaVolume]);
3641
- useEffect8(() => {
3655
+ useEffect7(() => {
3642
3656
  if (typeof volume === "number" && volume !== initialVolume) {
3643
3657
  warnOnce2(`Remotion: The ${mediaType} with src ${src} has changed it's volume. Prefer the callback syntax for setting volume to get better timeline display: https://www.remotion.dev/docs/audio/volume`);
3644
3658
  }
@@ -3692,7 +3706,7 @@ var useMediaInTimeline = ({
3692
3706
  trimBefore: undefined,
3693
3707
  playbackRate
3694
3708
  });
3695
- useEffect8(() => {
3709
+ useEffect7(() => {
3696
3710
  if (!src) {
3697
3711
  throw new Error("No src passed");
3698
3712
  }
@@ -3753,8 +3767,8 @@ var useMediaInTimeline = ({
3753
3767
  import {
3754
3768
  useCallback as useCallback10,
3755
3769
  useContext as useContext22,
3756
- useEffect as useEffect12,
3757
- useLayoutEffect as useLayoutEffect6,
3770
+ useEffect as useEffect11,
3771
+ useLayoutEffect as useLayoutEffect7,
3758
3772
  useRef as useRef11
3759
3773
  } from "react";
3760
3774
 
@@ -3768,8 +3782,8 @@ import { useContext as useContext21, useMemo as useMemo18 } from "react";
3768
3782
  import React16, {
3769
3783
  useCallback as useCallback8,
3770
3784
  useContext as useContext20,
3771
- useEffect as useEffect9,
3772
- useLayoutEffect as useLayoutEffect5,
3785
+ useEffect as useEffect8,
3786
+ useLayoutEffect as useLayoutEffect6,
3773
3787
  useMemo as useMemo17,
3774
3788
  useRef as useRef8,
3775
3789
  useState as useState13
@@ -3810,7 +3824,7 @@ var useBufferManager = (logLevel, mountTime) => {
3810
3824
  }
3811
3825
  };
3812
3826
  }, []);
3813
- useEffect9(() => {
3827
+ useEffect8(() => {
3814
3828
  if (blocks.length > 0) {
3815
3829
  onBufferingCallbacks.forEach((c) => c());
3816
3830
  playbackLogging({
@@ -3822,7 +3836,7 @@ var useBufferManager = (logLevel, mountTime) => {
3822
3836
  }
3823
3837
  }, [blocks]);
3824
3838
  if (typeof window !== "undefined") {
3825
- useLayoutEffect5(() => {
3839
+ useLayoutEffect6(() => {
3826
3840
  if (blocks.length === 0) {
3827
3841
  onResumeCallbacks.forEach((c) => c());
3828
3842
  playbackLogging({
@@ -3849,7 +3863,7 @@ var BufferingProvider = ({ children }) => {
3849
3863
  };
3850
3864
  var useIsPlayerBuffering = (bufferManager) => {
3851
3865
  const [isBuffering, setIsBuffering] = useState13(bufferManager.buffering.current);
3852
- useEffect9(() => {
3866
+ useEffect8(() => {
3853
3867
  const onBuffer = () => {
3854
3868
  setIsBuffering(true);
3855
3869
  };
@@ -4018,7 +4032,7 @@ var seek = ({
4018
4032
  };
4019
4033
 
4020
4034
  // src/use-media-buffering.ts
4021
- import { useEffect as useEffect10, useState as useState14 } from "react";
4035
+ import { useEffect as useEffect9, useState as useState14 } from "react";
4022
4036
  var useMediaBuffering = ({
4023
4037
  element,
4024
4038
  shouldBuffer,
@@ -4030,7 +4044,7 @@ var useMediaBuffering = ({
4030
4044
  }) => {
4031
4045
  const buffer = useBufferState();
4032
4046
  const [isBuffering, setIsBuffering] = useState14(false);
4033
- useEffect10(() => {
4047
+ useEffect9(() => {
4034
4048
  let cleanupFns = [];
4035
4049
  const { current } = element;
4036
4050
  if (!current) {
@@ -4158,7 +4172,7 @@ var useMediaBuffering = ({
4158
4172
  };
4159
4173
 
4160
4174
  // src/use-request-video-callback-time.ts
4161
- import { useEffect as useEffect11, useRef as useRef10 } from "react";
4175
+ import { useEffect as useEffect10, useRef as useRef10 } from "react";
4162
4176
  var useRequestVideoCallbackTime = ({
4163
4177
  mediaRef,
4164
4178
  mediaType,
@@ -4166,7 +4180,7 @@ var useRequestVideoCallbackTime = ({
4166
4180
  onVariableFpsVideoDetected
4167
4181
  }) => {
4168
4182
  const currentTime = useRef10(null);
4169
- useEffect11(() => {
4183
+ useEffect10(() => {
4170
4184
  const { current } = mediaRef;
4171
4185
  if (current) {
4172
4186
  currentTime.current = {
@@ -4460,7 +4474,7 @@ var useMediaPlayback = ({
4460
4474
  return acceptableTimeshift ?? defaultAcceptableTimeshift;
4461
4475
  })();
4462
4476
  const isPlayerBuffering = useIsPlayerBuffering(buffering);
4463
- useEffect12(() => {
4477
+ useEffect11(() => {
4464
4478
  if (mediaRef.current?.paused) {
4465
4479
  return;
4466
4480
  }
@@ -4499,13 +4513,13 @@ var useMediaPlayback = ({
4499
4513
  isPostmounting
4500
4514
  ]);
4501
4515
  const env = useRemotionEnvironment();
4502
- useLayoutEffect6(() => {
4516
+ useLayoutEffect7(() => {
4503
4517
  const playbackRateToSet = Math.max(0, playbackRate);
4504
4518
  if (mediaRef.current && mediaRef.current.playbackRate !== playbackRateToSet) {
4505
4519
  mediaRef.current.playbackRate = playbackRateToSet;
4506
4520
  }
4507
4521
  }, [mediaRef, playbackRate]);
4508
- useEffect12(() => {
4522
+ useEffect11(() => {
4509
4523
  const tagName = mediaType === "audio" ? "<Html5Audio>" : "<Html5Video>";
4510
4524
  if (!mediaRef.current) {
4511
4525
  throw new Error(`No ${mediaType} ref found`);
@@ -4624,7 +4638,7 @@ var useMediaPlayback = ({
4624
4638
  };
4625
4639
 
4626
4640
  // src/use-media-tag.ts
4627
- import { useContext as useContext23, useEffect as useEffect13 } from "react";
4641
+ import { useContext as useContext23, useEffect as useEffect12 } from "react";
4628
4642
  var useMediaTag = ({
4629
4643
  mediaRef,
4630
4644
  id,
@@ -4637,7 +4651,7 @@ var useMediaTag = ({
4637
4651
  const logLevel = useLogLevel();
4638
4652
  const mountTime = useMountTime();
4639
4653
  const env = useRemotionEnvironment();
4640
- useEffect13(() => {
4654
+ useEffect12(() => {
4641
4655
  const tag = {
4642
4656
  id,
4643
4657
  play: (reason) => {
@@ -4849,12 +4863,12 @@ var AudioForDevelopmentForwardRefFunction = (props, ref) => {
4849
4863
  volume: userPreferredVolume,
4850
4864
  shouldUseWebAudioApi: useWebAudioApi ?? false
4851
4865
  });
4852
- useImperativeHandle5(ref, () => {
4866
+ useImperativeHandle6(ref, () => {
4853
4867
  return audioRef.current;
4854
4868
  }, [audioRef]);
4855
4869
  const currentOnDurationCallback = useRef12(onDuration);
4856
4870
  currentOnDurationCallback.current = onDuration;
4857
- useEffect14(() => {
4871
+ useEffect13(() => {
4858
4872
  const { current } = audioRef;
4859
4873
  if (!current) {
4860
4874
  return;
@@ -4887,9 +4901,9 @@ var AudioForPreview = forwardRef4(AudioForDevelopmentForwardRefFunction);
4887
4901
  import {
4888
4902
  forwardRef as forwardRef5,
4889
4903
  useContext as useContext26,
4890
- useEffect as useEffect15,
4891
- useImperativeHandle as useImperativeHandle6,
4892
- useLayoutEffect as useLayoutEffect7,
4904
+ useEffect as useEffect14,
4905
+ useImperativeHandle as useImperativeHandle7,
4906
+ useLayoutEffect as useLayoutEffect8,
4893
4907
  useMemo as useMemo22,
4894
4908
  useRef as useRef13
4895
4909
  } from "react";
@@ -4932,10 +4946,10 @@ var AudioForRenderingRefForwardingFunction = (props, ref) => {
4932
4946
  mediaVolume: 1
4933
4947
  });
4934
4948
  warnAboutTooHighVolume(volume);
4935
- useImperativeHandle6(ref, () => {
4949
+ useImperativeHandle7(ref, () => {
4936
4950
  return audioRef.current;
4937
4951
  }, []);
4938
- useEffect15(() => {
4952
+ useEffect14(() => {
4939
4953
  if (!props.src) {
4940
4954
  throw new Error("No src passed");
4941
4955
  }
@@ -4979,7 +4993,7 @@ var AudioForRenderingRefForwardingFunction = (props, ref) => {
4979
4993
  ]);
4980
4994
  const { src } = props;
4981
4995
  const needsToRenderAudioTag = ref || _remotionInternalNeedsDurationCalculation;
4982
- useLayoutEffect7(() => {
4996
+ useLayoutEffect8(() => {
4983
4997
  if (window.process?.env?.NODE_ENV === "test") {
4984
4998
  return;
4985
4999
  }
@@ -5142,11 +5156,11 @@ var Html5Audio = forwardRef6(AudioRefForwardingFunction);
5142
5156
  addSequenceStackTraces(Html5Audio);
5143
5157
  var Audio = Html5Audio;
5144
5158
  // src/Composition.tsx
5145
- import { Suspense, useContext as useContext29, useEffect as useEffect17 } from "react";
5159
+ import { Suspense, useContext as useContext29, useEffect as useEffect16 } from "react";
5146
5160
  import { createPortal } from "react-dom";
5147
5161
 
5148
5162
  // src/Folder.tsx
5149
- import { createContext as createContext18, useContext as useContext28, useEffect as useEffect16, useMemo as useMemo23 } from "react";
5163
+ import { createContext as createContext18, useContext as useContext28, useEffect as useEffect15, useMemo as useMemo23 } from "react";
5150
5164
 
5151
5165
  // src/validation/validate-folder-name.ts
5152
5166
  var getRegex = () => /^([a-zA-Z0-9-\u4E00-\u9FFF])+$/g;
@@ -5182,7 +5196,7 @@ var Folder = ({ name, children }) => {
5182
5196
  parentName
5183
5197
  };
5184
5198
  }, [name, parentName]);
5185
- useEffect16(() => {
5199
+ useEffect15(() => {
5186
5200
  registerFolder(name, parentName);
5187
5201
  return () => {
5188
5202
  unregisterFolder(name, parentName);
@@ -5337,7 +5351,7 @@ var validateDefaultAndInputProps = (defaultProps, name, compositionId) => {
5337
5351
  import { jsx as jsx23 } from "react/jsx-runtime";
5338
5352
  var Fallback = () => {
5339
5353
  const { continueRender: continueRender2, delayRender: delayRender2 } = useDelayRender();
5340
- useEffect17(() => {
5354
+ useEffect16(() => {
5341
5355
  const fallback = delayRender2("Waiting for Root component to unsuspend");
5342
5356
  return () => continueRender2(fallback);
5343
5357
  }, [continueRender2, delayRender2]);
@@ -5375,7 +5389,7 @@ var InnerComposition = ({
5375
5389
  throw new Error("<Composition> mounted inside another composition. See https://remotion.dev/docs/wrong-composition-mount for help.");
5376
5390
  }
5377
5391
  const { folderName, parentName } = useContext29(FolderContext);
5378
- useEffect17(() => {
5392
+ useEffect16(() => {
5379
5393
  if (!id) {
5380
5394
  throw new Error("No id for composition passed.");
5381
5395
  }
@@ -5414,7 +5428,7 @@ var InnerComposition = ({
5414
5428
  registerComposition,
5415
5429
  unregisterComposition
5416
5430
  ]);
5417
- useEffect17(() => {
5431
+ useEffect16(() => {
5418
5432
  window.dispatchEvent(new CustomEvent(PROPS_UPDATED_EXTERNALLY, {
5419
5433
  detail: {
5420
5434
  resetUnsaved: id
@@ -5715,8 +5729,8 @@ import {
5715
5729
  forwardRef as forwardRef8,
5716
5730
  useCallback as useCallback13,
5717
5731
  useContext as useContext30,
5718
- useImperativeHandle as useImperativeHandle7,
5719
- useLayoutEffect as useLayoutEffect8,
5732
+ useImperativeHandle as useImperativeHandle8,
5733
+ useLayoutEffect as useLayoutEffect9,
5720
5734
  useRef as useRef14
5721
5735
  } from "react";
5722
5736
  import { jsx as jsx25 } from "react/jsx-runtime";
@@ -5745,7 +5759,7 @@ var ImgRefForwarding = ({
5745
5759
  if (!_propsValid) {
5746
5760
  throw new Error("typecheck error");
5747
5761
  }
5748
- useImperativeHandle7(ref, () => {
5762
+ useImperativeHandle8(ref, () => {
5749
5763
  return imageRef.current;
5750
5764
  }, []);
5751
5765
  const actualSrc = usePreload(src);
@@ -5787,7 +5801,7 @@ var ImgRefForwarding = ({
5787
5801
  if (typeof window !== "undefined") {
5788
5802
  const isPremounting = Boolean(sequenceContext?.premounting);
5789
5803
  const isPostmounting = Boolean(sequenceContext?.postmounting);
5790
- useLayoutEffect8(() => {
5804
+ useLayoutEffect9(() => {
5791
5805
  if (window.process?.env?.NODE_ENV === "test") {
5792
5806
  if (imageRef.current) {
5793
5807
  imageRef.current.src = actualSrc;
@@ -5876,7 +5890,7 @@ var compositionsRef = React25.createRef();
5876
5890
  // src/CompositionManagerProvider.tsx
5877
5891
  import {
5878
5892
  useCallback as useCallback14,
5879
- useImperativeHandle as useImperativeHandle8,
5893
+ useImperativeHandle as useImperativeHandle9,
5880
5894
  useMemo as useMemo25,
5881
5895
  useRef as useRef15,
5882
5896
  useState as useState17
@@ -5930,7 +5944,7 @@ var CompositionManagerProvider = ({
5930
5944
  return prevFolders.filter((p) => !(p.name === name && p.parent === parent));
5931
5945
  });
5932
5946
  }, []);
5933
- useImperativeHandle8(compositionsRef, () => {
5947
+ useImperativeHandle9(compositionsRef, () => {
5934
5948
  return {
5935
5949
  getCompositions: () => currentcompositionsRef.current
5936
5950
  };
@@ -6041,6 +6055,10 @@ var getPreviewDomElement = () => {
6041
6055
  return document.getElementById(REMOTION_STUDIO_CONTAINER_ELEMENT);
6042
6056
  };
6043
6057
 
6058
+ // src/max-video-cache-size.ts
6059
+ import React26 from "react";
6060
+ var MaxMediaCacheSizeContext = React26.createContext(null);
6061
+
6044
6062
  // src/register-root.ts
6045
6063
  var Root = null;
6046
6064
  var listeners = [];
@@ -6073,7 +6091,7 @@ var waitForRoot = (fn) => {
6073
6091
  };
6074
6092
 
6075
6093
  // src/RemotionRoot.tsx
6076
- import { useEffect as useEffect18, useMemo as useMemo27, useState as useState18 } from "react";
6094
+ import { useEffect as useEffect17, useMemo as useMemo27, useState as useState18 } from "react";
6077
6095
 
6078
6096
  // src/use-media-enabled.tsx
6079
6097
  import { createContext as createContext19, useContext as useContext31, useMemo as useMemo26 } from "react";
@@ -6113,7 +6131,7 @@ var MediaEnabledProvider = ({
6113
6131
 
6114
6132
  // src/RemotionRoot.tsx
6115
6133
  import { jsx as jsx28 } from "react/jsx-runtime";
6116
- var RemotionRoot = ({
6134
+ var RemotionRootContexts = ({
6117
6135
  children,
6118
6136
  numberOfAudioTags,
6119
6137
  logLevel,
@@ -6139,7 +6157,7 @@ var RemotionRoot = ({
6139
6157
  }
6140
6158
  };
6141
6159
  }, []);
6142
- useEffect18(() => {
6160
+ useEffect17(() => {
6143
6161
  if (typeof __webpack_module__ !== "undefined") {
6144
6162
  if (__webpack_module__.hot) {
6145
6163
  __webpack_module__.hot.addStatusHandler((status) => {
@@ -6167,14 +6185,12 @@ var RemotionRoot = ({
6167
6185
  children: /* @__PURE__ */ jsx28(EditorPropsProvider, {
6168
6186
  children: /* @__PURE__ */ jsx28(PrefetchProvider, {
6169
6187
  children: /* @__PURE__ */ jsx28(SequenceManagerProvider, {
6170
- children: /* @__PURE__ */ jsx28(RenderAssetManagerProvider, {
6171
- children: /* @__PURE__ */ jsx28(SharedAudioContextProvider, {
6172
- numberOfAudioTags,
6173
- audioLatencyHint,
6174
- children: /* @__PURE__ */ jsx28(DurationsContextProvider, {
6175
- children: /* @__PURE__ */ jsx28(BufferingProvider, {
6176
- children
6177
- })
6188
+ children: /* @__PURE__ */ jsx28(SharedAudioContextProvider, {
6189
+ numberOfAudioTags,
6190
+ audioLatencyHint,
6191
+ children: /* @__PURE__ */ jsx28(DurationsContextProvider, {
6192
+ children: /* @__PURE__ */ jsx28(BufferingProvider, {
6193
+ children
6178
6194
  })
6179
6195
  })
6180
6196
  })
@@ -6216,8 +6232,8 @@ var setupEnvVariables = () => {
6216
6232
  };
6217
6233
 
6218
6234
  // src/use-current-scale.ts
6219
- import React27, { createContext as createContext20 } from "react";
6220
- var CurrentScaleContext = React27.createContext(null);
6235
+ import React28, { createContext as createContext20 } from "react";
6236
+ var CurrentScaleContext = React28.createContext(null);
6221
6237
  var PreviewSizeContext = createContext20({
6222
6238
  setSize: () => {
6223
6239
  return;
@@ -6242,8 +6258,8 @@ var calculateScale = ({
6242
6258
  return Number(previewSize);
6243
6259
  };
6244
6260
  var useCurrentScale = (options) => {
6245
- const hasContext = React27.useContext(CurrentScaleContext);
6246
- const zoomContext = React27.useContext(PreviewSizeContext);
6261
+ const hasContext = React28.useContext(CurrentScaleContext);
6262
+ const zoomContext = React28.useContext(PreviewSizeContext);
6247
6263
  const config = useUnsafeVideoConfig();
6248
6264
  const env = useRemotionEnvironment();
6249
6265
  if (hasContext === null || config === null || zoomContext === null) {
@@ -6279,8 +6295,8 @@ import { useCallback as useCallback16 } from "react";
6279
6295
  import {
6280
6296
  useCallback as useCallback15,
6281
6297
  useContext as useContext32,
6282
- useEffect as useEffect19,
6283
- useLayoutEffect as useLayoutEffect9,
6298
+ useEffect as useEffect18,
6299
+ useLayoutEffect as useLayoutEffect10,
6284
6300
  useMemo as useMemo28,
6285
6301
  useState as useState19
6286
6302
  } from "react";
@@ -6341,7 +6357,7 @@ var OffthreadVideoForRendering = ({
6341
6357
  mediaVolume: 1
6342
6358
  });
6343
6359
  warnAboutTooHighVolume(volume);
6344
- useEffect19(() => {
6360
+ useEffect18(() => {
6345
6361
  if (!src) {
6346
6362
  throw new Error("No src passed");
6347
6363
  }
@@ -6398,7 +6414,7 @@ var OffthreadVideoForRendering = ({
6398
6414
  }, [toneMapped, currentTime, src, transparent]);
6399
6415
  const [imageSrc, setImageSrc] = useState19(null);
6400
6416
  const { delayRender: delayRender2, continueRender: continueRender2 } = useDelayRender();
6401
- useLayoutEffect9(() => {
6417
+ useLayoutEffect10(() => {
6402
6418
  if (!window.remotion_videoEnabled) {
6403
6419
  return;
6404
6420
  }
@@ -6503,20 +6519,20 @@ var OffthreadVideoForRendering = ({
6503
6519
  import {
6504
6520
  forwardRef as forwardRef9,
6505
6521
  useContext as useContext33,
6506
- useEffect as useEffect21,
6507
- useImperativeHandle as useImperativeHandle9,
6522
+ useEffect as useEffect20,
6523
+ useImperativeHandle as useImperativeHandle10,
6508
6524
  useMemo as useMemo29,
6509
6525
  useRef as useRef16,
6510
6526
  useState as useState20
6511
6527
  } from "react";
6512
6528
 
6513
6529
  // src/video/emit-video-frame.ts
6514
- import { useEffect as useEffect20 } from "react";
6530
+ import { useEffect as useEffect19 } from "react";
6515
6531
  var useEmitVideoFrame = ({
6516
6532
  ref,
6517
6533
  onVideoFrame
6518
6534
  }) => {
6519
- useEffect20(() => {
6535
+ useEffect19(() => {
6520
6536
  const { current } = ref;
6521
6537
  if (!current) {
6522
6538
  return;
@@ -6657,7 +6673,7 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
6657
6673
  duration,
6658
6674
  fps
6659
6675
  });
6660
- useImperativeHandle9(ref, () => {
6676
+ useImperativeHandle10(ref, () => {
6661
6677
  return videoRef.current;
6662
6678
  }, []);
6663
6679
  useState20(() => playbackLogging({
@@ -6666,7 +6682,7 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
6666
6682
  tag: "video",
6667
6683
  mountTime
6668
6684
  }));
6669
- useEffect21(() => {
6685
+ useEffect20(() => {
6670
6686
  const { current } = videoRef;
6671
6687
  if (!current) {
6672
6688
  return;
@@ -6697,7 +6713,7 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
6697
6713
  const currentOnDurationCallback = useRef16(onDuration);
6698
6714
  currentOnDurationCallback.current = onDuration;
6699
6715
  useEmitVideoFrame({ ref: videoRef, onVideoFrame });
6700
- useEffect21(() => {
6716
+ useEffect20(() => {
6701
6717
  const { current } = videoRef;
6702
6718
  if (!current) {
6703
6719
  return;
@@ -6714,7 +6730,7 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
6714
6730
  current.removeEventListener("loadedmetadata", onLoadedMetadata);
6715
6731
  };
6716
6732
  }, [src]);
6717
- useEffect21(() => {
6733
+ useEffect20(() => {
6718
6734
  const { current } = videoRef;
6719
6735
  if (!current) {
6720
6736
  return;
@@ -6943,21 +6959,21 @@ var watchStaticFile = (fileName, callback) => {
6943
6959
  };
6944
6960
 
6945
6961
  // src/wrap-remotion-context.tsx
6946
- import React31, { useMemo as useMemo30 } from "react";
6962
+ import React32, { useMemo as useMemo30 } from "react";
6947
6963
  import { jsx as jsx32 } from "react/jsx-runtime";
6948
6964
  function useRemotionContexts() {
6949
- const compositionManagerCtx = React31.useContext(CompositionManager);
6950
- const timelineContext = React31.useContext(TimelineContext);
6951
- const setTimelineContext = React31.useContext(SetTimelineContext);
6952
- const sequenceContext = React31.useContext(SequenceContext);
6953
- const nonceContext = React31.useContext(NonceContext);
6954
- const canUseRemotionHooksContext = React31.useContext(CanUseRemotionHooks);
6955
- const preloadContext = React31.useContext(PreloadContext);
6956
- const resolveCompositionContext = React31.useContext(ResolveCompositionContext);
6957
- const renderAssetManagerContext = React31.useContext(RenderAssetManager);
6958
- const sequenceManagerContext = React31.useContext(SequenceManager);
6959
- const bufferManagerContext = React31.useContext(BufferingContextReact);
6960
- const logLevelContext = React31.useContext(LogLevelContext);
6965
+ const compositionManagerCtx = React32.useContext(CompositionManager);
6966
+ const timelineContext = React32.useContext(TimelineContext);
6967
+ const setTimelineContext = React32.useContext(SetTimelineContext);
6968
+ const sequenceContext = React32.useContext(SequenceContext);
6969
+ const nonceContext = React32.useContext(NonceContext);
6970
+ const canUseRemotionHooksContext = React32.useContext(CanUseRemotionHooks);
6971
+ const preloadContext = React32.useContext(PreloadContext);
6972
+ const resolveCompositionContext = React32.useContext(ResolveCompositionContext);
6973
+ const renderAssetManagerContext = React32.useContext(RenderAssetManager);
6974
+ const sequenceManagerContext = React32.useContext(SequenceManager);
6975
+ const bufferManagerContext = React32.useContext(BufferingContextReact);
6976
+ const logLevelContext = React32.useContext(LogLevelContext);
6961
6977
  return useMemo30(() => ({
6962
6978
  compositionManagerCtx,
6963
6979
  timelineContext,
@@ -7030,6 +7046,7 @@ var RemotionContextProvider = (props2) => {
7030
7046
  // src/internals.ts
7031
7047
  var compositionSelectorRef = createRef3();
7032
7048
  var Internals = {
7049
+ MaxMediaCacheSizeContext,
7033
7050
  useUnsafeVideoConfig,
7034
7051
  useFrameForVolumeProp,
7035
7052
  useTimelinePosition,
@@ -7044,7 +7061,7 @@ var Internals = {
7044
7061
  CompositionSetters,
7045
7062
  SequenceManager,
7046
7063
  SequenceVisibilityToggleContext,
7047
- RemotionRoot,
7064
+ RemotionRootContexts,
7048
7065
  CompositionManagerProvider,
7049
7066
  useVideo,
7050
7067
  getRoot,
@@ -7122,7 +7139,8 @@ var Internals = {
7122
7139
  useIsPlayerBuffering,
7123
7140
  TimelinePosition: exports_timeline_position_state,
7124
7141
  DelayRenderContextType,
7125
- TimelineContext
7142
+ TimelineContext,
7143
+ RenderAssetManagerProvider
7126
7144
  };
7127
7145
  // src/interpolate-colors.ts
7128
7146
  var NUMBER = "[-+]?\\d*\\.?\\d+";
@@ -7491,11 +7509,11 @@ var validateFrame = ({
7491
7509
  import { Children, forwardRef as forwardRef10, useMemo as useMemo31 } from "react";
7492
7510
 
7493
7511
  // src/series/flatten-children.tsx
7494
- import React32 from "react";
7512
+ import React33 from "react";
7495
7513
  var flattenChildren = (children) => {
7496
- const childrenArray = React32.Children.toArray(children);
7514
+ const childrenArray = React33.Children.toArray(children);
7497
7515
  return childrenArray.reduce((flatChildren, child) => {
7498
- if (child.type === React32.Fragment) {
7516
+ if (child.type === React33.Fragment) {
7499
7517
  return flatChildren.concat(flattenChildren(child.props.children));
7500
7518
  }
7501
7519
  flatChildren.push(child);
@@ -7504,7 +7522,7 @@ var flattenChildren = (children) => {
7504
7522
  };
7505
7523
 
7506
7524
  // src/series/is-inside-series.tsx
7507
- import React33, { createContext as createContext21 } from "react";
7525
+ import React34, { createContext as createContext21 } from "react";
7508
7526
  import { jsx as jsx33 } from "react/jsx-runtime";
7509
7527
  var IsInsideSeriesContext = createContext21(false);
7510
7528
  var IsInsideSeriesContainer = ({ children }) => {
@@ -7520,7 +7538,7 @@ var IsNotInsideSeriesProvider = ({ children }) => {
7520
7538
  });
7521
7539
  };
7522
7540
  var useRequireToBeInsideSeries = () => {
7523
- const isInsideSeries = React33.useContext(IsInsideSeriesContext);
7541
+ const isInsideSeries = React34.useContext(IsInsideSeriesContext);
7524
7542
  if (!isInsideSeries) {
7525
7543
  throw new Error("This component must be inside a <Series /> component.");
7526
7544
  }
@@ -7935,14 +7953,14 @@ var staticFile = (path) => {
7935
7953
  return preparsed;
7936
7954
  };
7937
7955
  // src/Still.tsx
7938
- import React35 from "react";
7956
+ import React36 from "react";
7939
7957
  var Still = (props2) => {
7940
7958
  const newProps = {
7941
7959
  ...props2,
7942
7960
  durationInFrames: 1,
7943
7961
  fps: 1
7944
7962
  };
7945
- return React35.createElement(Composition, newProps);
7963
+ return React36.createElement(Composition, newProps);
7946
7964
  };
7947
7965
  // src/video/Video.tsx
7948
7966
  import { forwardRef as forwardRef12, useCallback as useCallback17, useContext as useContext35 } from "react";
@@ -7951,9 +7969,9 @@ import { forwardRef as forwardRef12, useCallback as useCallback17, useContext as
7951
7969
  import {
7952
7970
  forwardRef as forwardRef11,
7953
7971
  useContext as useContext34,
7954
- useEffect as useEffect22,
7955
- useImperativeHandle as useImperativeHandle10,
7956
- useLayoutEffect as useLayoutEffect10,
7972
+ useEffect as useEffect21,
7973
+ useImperativeHandle as useImperativeHandle11,
7974
+ useLayoutEffect as useLayoutEffect11,
7957
7975
  useMemo as useMemo32,
7958
7976
  useRef as useRef17
7959
7977
  } from "react";
@@ -8126,7 +8144,7 @@ var VideoForRenderingForwardFunction = ({
8126
8144
  mediaVolume: 1
8127
8145
  });
8128
8146
  warnAboutTooHighVolume(volume);
8129
- useEffect22(() => {
8147
+ useEffect21(() => {
8130
8148
  if (!props2.src) {
8131
8149
  throw new Error("No src passed");
8132
8150
  }
@@ -8166,10 +8184,10 @@ var VideoForRenderingForwardFunction = ({
8166
8184
  sequenceContext?.relativeFrom,
8167
8185
  audioStreamIndex
8168
8186
  ]);
8169
- useImperativeHandle10(ref, () => {
8187
+ useImperativeHandle11(ref, () => {
8170
8188
  return videoRef.current;
8171
8189
  }, []);
8172
- useEffect22(() => {
8190
+ useEffect21(() => {
8173
8191
  if (!window.remotion_videoEnabled) {
8174
8192
  return;
8175
8193
  }
@@ -8253,7 +8271,7 @@ var VideoForRenderingForwardFunction = ({
8253
8271
  ]);
8254
8272
  const { src } = props2;
8255
8273
  if (environment.isRendering) {
8256
- useLayoutEffect10(() => {
8274
+ useLayoutEffect11(() => {
8257
8275
  if (window.process?.env?.NODE_ENV === "test") {
8258
8276
  return;
8259
8277
  }
@@ -1,5 +1,5 @@
1
1
  // src/version.ts
2
- var VERSION = "4.0.375";
2
+ var VERSION = "4.0.377";
3
3
  export {
4
4
  VERSION
5
5
  };
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "url": "https://github.com/remotion-dev/remotion/tree/main/packages/core"
4
4
  },
5
5
  "name": "remotion",
6
- "version": "4.0.375",
6
+ "version": "4.0.377",
7
7
  "description": "Make videos programmatically",
8
8
  "main": "dist/cjs/index.js",
9
9
  "types": "dist/cjs/index.d.ts",
@@ -34,7 +34,7 @@
34
34
  "react-dom": "19.0.0",
35
35
  "webpack": "5.96.1",
36
36
  "zod": "3.22.3",
37
- "@remotion/eslint-config-internal": "4.0.375",
37
+ "@remotion/eslint-config-internal": "4.0.377",
38
38
  "eslint": "9.19.0"
39
39
  },
40
40
  "keywords": [