remotion 4.0.362 → 4.0.364

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/cjs/Img.js CHANGED
@@ -117,25 +117,20 @@ const ImgRefForwarding = ({ onError, maxRetries = 2, src, pauseWhenLoading, dela
117
117
  return;
118
118
  }
119
119
  current.src = actualSrc;
120
- if (current.complete) {
121
- onComplete();
122
- }
123
- else {
124
- current
125
- .decode()
126
- .then(onComplete)
127
- .catch((err) => {
128
- // fall back to onload event if decode() fails
129
- // eslint-disable-next-line no-console
130
- console.warn(err);
131
- if (current.complete) {
132
- onComplete();
133
- }
134
- else {
135
- current.addEventListener('load', onComplete);
136
- }
137
- });
138
- }
120
+ current
121
+ .decode()
122
+ .then(onComplete)
123
+ .catch((err) => {
124
+ // fall back to onload event if decode() fails
125
+ // eslint-disable-next-line no-console
126
+ console.warn(err);
127
+ if (current.complete) {
128
+ onComplete();
129
+ }
130
+ else {
131
+ current.addEventListener('load', onComplete);
132
+ }
133
+ });
139
134
  // If tag gets unmounted, clear pending handles because image is not going to load
140
135
  return () => {
141
136
  unmounted = true;
@@ -161,7 +156,7 @@ const ImgRefForwarding = ({ onError, maxRetries = 2, src, pauseWhenLoading, dela
161
156
  requestsVideoFrame: false,
162
157
  });
163
158
  // src gets set once we've loaded and decoded the image.
164
- return ((0, jsx_runtime_1.jsx)("img", { ...props, ref: imageRef, crossOrigin: crossOriginValue, onError: didGetError }));
159
+ return ((0, jsx_runtime_1.jsx)("img", { ...props, ref: imageRef, crossOrigin: crossOriginValue, onError: didGetError, decoding: "sync" }));
165
160
  };
166
161
  /*
167
162
  * @description Works just like a regular HTML img tag. When you use the <Img> tag, Remotion will ensure that the image is loaded before rendering the frame.
@@ -8,4 +8,6 @@ export declare const RemotionRoot: React.FC<{
8
8
  readonly onlyRenderComposition: string | null;
9
9
  readonly currentCompositionMetadata: BaseMetadata | null;
10
10
  readonly audioLatencyHint: AudioContextLatencyCategory;
11
+ readonly videoEnabled: boolean | null;
12
+ readonly audioEnabled: boolean | null;
11
13
  }>;
@@ -12,8 +12,9 @@ const prefetch_state_js_1 = require("./prefetch-state.js");
12
12
  const random_js_1 = require("./random.js");
13
13
  const timeline_position_state_js_1 = require("./timeline-position-state.js");
14
14
  const use_delay_render_js_1 = require("./use-delay-render.js");
15
+ const use_media_enabled_js_1 = require("./use-media-enabled.js");
15
16
  const duration_state_js_1 = require("./video/duration-state.js");
16
- const RemotionRoot = ({ children, numberOfAudioTags, logLevel, onlyRenderComposition, currentCompositionMetadata, audioLatencyHint, }) => {
17
+ const RemotionRoot = ({ children, numberOfAudioTags, logLevel, onlyRenderComposition, currentCompositionMetadata, audioLatencyHint, videoEnabled, audioEnabled, }) => {
17
18
  const [remotionRootId] = (0, react_1.useState)(() => String((0, random_js_1.random)(null)));
18
19
  const [frame, setFrame] = (0, react_1.useState)(() => (0, timeline_position_state_js_1.getInitialFrameState)());
19
20
  const [playing, setPlaying] = (0, react_1.useState)(false);
@@ -100,6 +101,6 @@ const RemotionRoot = ({ children, numberOfAudioTags, logLevel, onlyRenderComposi
100
101
  const logging = (0, react_1.useMemo)(() => {
101
102
  return { logLevel, mountTime: Date.now() };
102
103
  }, [logLevel]);
103
- 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)(timeline_position_state_js_1.TimelineContext.Provider, { value: timelineContextValue, children: (0, jsx_runtime_1.jsx)(timeline_position_state_js_1.SetTimelineContext.Provider, { value: setTimelineContextValue, 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)(CompositionManager_js_1.CompositionManagerProvider, { numberOfAudioTags: numberOfAudioTags, onlyRenderComposition: onlyRenderComposition, currentCompositionMetadata: currentCompositionMetadata, 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 }) }) }) }) }) }) }) }) }) }));
104
+ 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)(timeline_position_state_js_1.TimelineContext.Provider, { value: timelineContextValue, children: (0, jsx_runtime_1.jsx)(timeline_position_state_js_1.SetTimelineContext.Provider, { value: setTimelineContextValue, 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)(CompositionManager_js_1.CompositionManagerProvider, { numberOfAudioTags: numberOfAudioTags, onlyRenderComposition: onlyRenderComposition, currentCompositionMetadata: currentCompositionMetadata, 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 }) }) }) }) }) }) }) }) }) }) }));
104
105
  };
105
106
  exports.RemotionRoot = RemotionRoot;
@@ -5,12 +5,12 @@ const cancel_render_js_1 = require("./cancel-render.js");
5
5
  const get_remotion_environment_js_1 = require("./get-remotion-environment.js");
6
6
  const log_js_1 = require("./log.js");
7
7
  const truthy_js_1 = require("./truthy.js");
8
- if (typeof window !== 'undefined') {
9
- window.remotion_renderReady = false;
10
- }
11
8
  let handles = [];
12
9
  if (typeof window !== 'undefined') {
13
- window.remotion_delayRenderTimeouts = {};
10
+ window.remotion_renderReady = false;
11
+ if (!window.remotion_delayRenderTimeouts) {
12
+ window.remotion_delayRenderTimeouts = {};
13
+ }
14
14
  }
15
15
  exports.DELAY_RENDER_CALLSTACK_TOKEN = 'The delayRender was called:';
16
16
  exports.DELAY_RENDER_RETRIES_LEFT = 'Retries left: ';
@@ -78,6 +78,8 @@ export declare const Internals: {
78
78
  readonly onlyRenderComposition: string | null;
79
79
  readonly currentCompositionMetadata: import("./CompositionManagerContext.js").BaseMetadata | null;
80
80
  readonly audioLatencyHint: AudioContextLatencyCategory;
81
+ readonly videoEnabled: boolean | null;
82
+ readonly audioEnabled: boolean | null;
81
83
  }>;
82
84
  readonly useVideo: () => (import("./video-config.js").VideoConfig & {
83
85
  component: import("react").LazyExoticComponent<import("react").ComponentType<Record<string, unknown>>>;
@@ -352,5 +354,7 @@ export declare const Internals: {
352
354
  };
353
355
  readonly getInputPropsOverride: () => Record<string, unknown> | null;
354
356
  readonly setInputPropsOverride: (override: Record<string, unknown> | null) => void;
357
+ readonly useVideoEnabled: () => boolean;
358
+ readonly useAudioEnabled: () => boolean;
355
359
  };
356
360
  export type { CompositionManagerContext, CompProps, LoggingContextValue, MediaVolumeContextValue, RemotionEnvironment, SerializedJSONWithCustomFields, SetMediaVolumeContextValue, SetTimelineContextValue, TCompMetadata, TComposition, TimelineContextValue, TRenderAsset, TSequence, WatchRemotionStaticFilesPayload, };
@@ -73,6 +73,7 @@ const timeline_position_state_js_1 = require("./timeline-position-state.js");
73
73
  const truthy_js_1 = require("./truthy.js");
74
74
  const use_current_scale_js_1 = require("./use-current-scale.js");
75
75
  const use_lazy_component_js_1 = require("./use-lazy-component.js");
76
+ const use_media_enabled_js_1 = require("./use-media-enabled.js");
76
77
  const use_media_in_timeline_js_1 = require("./use-media-in-timeline.js");
77
78
  const use_unsafe_video_config_js_1 = require("./use-unsafe-video-config.js");
78
79
  const use_video_js_1 = require("./use-video.js");
@@ -179,4 +180,6 @@ exports.Internals = {
179
180
  useBasicMediaInTimeline: use_media_in_timeline_js_1.useBasicMediaInTimeline,
180
181
  getInputPropsOverride: input_props_override_js_1.getInputPropsOverride,
181
182
  setInputPropsOverride: input_props_override_js_1.setInputPropsOverride,
183
+ useVideoEnabled: use_media_enabled_js_1.useVideoEnabled,
184
+ useAudioEnabled: use_media_enabled_js_1.useAudioEnabled,
182
185
  };
package/dist/cjs/log.js CHANGED
@@ -17,7 +17,9 @@ const transformArgs = ({ args, logLevel, tag, }) => {
17
17
  !(0, get_remotion_environment_1.getRemotionEnvironment)().isClientSideRendering) {
18
18
  arr.unshift(Symbol.for(`__remotion_level_${logLevel}`));
19
19
  }
20
- if (tag) {
20
+ if (tag &&
21
+ (0, get_remotion_environment_1.getRemotionEnvironment)().isRendering &&
22
+ !(0, get_remotion_environment_1.getRemotionEnvironment)().isClientSideRendering) {
21
23
  arr.unshift(Symbol.for(`__remotion_tag_${tag}`));
22
24
  }
23
25
  return arr;
@@ -0,0 +1,2 @@
1
+ export declare const useVideoEnabled: () => boolean;
2
+ export declare const useAudioEnabled: () => boolean;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useAudioEnabled = exports.useVideoEnabled = void 0;
4
+ const useVideoEnabled = () => {
5
+ return window.remotion_videoEnabled;
6
+ };
7
+ exports.useVideoEnabled = useVideoEnabled;
8
+ const useAudioEnabled = () => {
9
+ return window.remotion_audioEnabled;
10
+ };
11
+ exports.useAudioEnabled = useAudioEnabled;
@@ -0,0 +1,7 @@
1
+ export declare const useVideoEnabled: () => boolean;
2
+ export declare const useAudioEnabled: () => boolean;
3
+ export declare const MediaEnabledProvider: ({ children, videoEnabled, audioEnabled, }: {
4
+ readonly children: React.ReactNode;
5
+ readonly videoEnabled: boolean | null;
6
+ readonly audioEnabled: boolean | null;
7
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MediaEnabledProvider = exports.useAudioEnabled = exports.useVideoEnabled = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_1 = require("react");
6
+ const MediaEnabledContext = (0, react_1.createContext)(null);
7
+ const useVideoEnabled = () => {
8
+ const context = (0, react_1.useContext)(MediaEnabledContext);
9
+ if (!context) {
10
+ return window.remotion_videoEnabled;
11
+ }
12
+ if (context.videoEnabled === null) {
13
+ return window.remotion_videoEnabled;
14
+ }
15
+ return context.videoEnabled;
16
+ };
17
+ exports.useVideoEnabled = useVideoEnabled;
18
+ const useAudioEnabled = () => {
19
+ const context = (0, react_1.useContext)(MediaEnabledContext);
20
+ if (!context) {
21
+ return window.remotion_audioEnabled;
22
+ }
23
+ if (context.audioEnabled === null) {
24
+ return window.remotion_audioEnabled;
25
+ }
26
+ return context.audioEnabled;
27
+ };
28
+ exports.useAudioEnabled = useAudioEnabled;
29
+ const MediaEnabledProvider = ({ children, videoEnabled, audioEnabled, }) => {
30
+ const value = (0, react_1.useMemo)(() => ({ videoEnabled, audioEnabled }), [videoEnabled, audioEnabled]);
31
+ return ((0, jsx_runtime_1.jsx)(MediaEnabledContext.Provider, { value: value, children: children }));
32
+ };
33
+ exports.MediaEnabledProvider = MediaEnabledProvider;
@@ -52,7 +52,7 @@ const validateTrimProps = (trimBefore, trimAfter) => {
52
52
  throw new TypeError(`trimAfter must be a positive number, instead got ${trimAfter}.`);
53
53
  }
54
54
  }
55
- if (trimAfter < trimBefore) {
55
+ if (trimAfter <= trimBefore) {
56
56
  throw new TypeError('trimAfter prop must be greater than trimBefore prop.');
57
57
  }
58
58
  };
@@ -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.362";
6
+ export declare const VERSION = "4.0.364";
@@ -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.362';
10
+ exports.VERSION = '4.0.364';
@@ -110,7 +110,7 @@ function truthy(value) {
110
110
  }
111
111
 
112
112
  // src/version.ts
113
- var VERSION = "4.0.362";
113
+ var VERSION = "4.0.364";
114
114
 
115
115
  // src/multiple-versions-warning.ts
116
116
  var checkMultipleRemotionVersions = () => {
@@ -1674,7 +1674,7 @@ var transformArgs = ({
1674
1674
  if (getRemotionEnvironment().isRendering && !getRemotionEnvironment().isClientSideRendering) {
1675
1675
  arr.unshift(Symbol.for(`__remotion_level_${logLevel}`));
1676
1676
  }
1677
- if (tag) {
1677
+ if (tag && getRemotionEnvironment().isRendering && !getRemotionEnvironment().isClientSideRendering) {
1678
1678
  arr.unshift(Symbol.for(`__remotion_tag_${tag}`));
1679
1679
  }
1680
1680
  return arr;
@@ -1711,12 +1711,12 @@ var Log = {
1711
1711
  };
1712
1712
 
1713
1713
  // src/delay-render.ts
1714
- if (typeof window !== "undefined") {
1715
- window.remotion_renderReady = false;
1716
- }
1717
1714
  var handles = [];
1718
1715
  if (typeof window !== "undefined") {
1719
- window.remotion_delayRenderTimeouts = {};
1716
+ window.remotion_renderReady = false;
1717
+ if (!window.remotion_delayRenderTimeouts) {
1718
+ window.remotion_delayRenderTimeouts = {};
1719
+ }
1720
1720
  }
1721
1721
  var DELAY_RENDER_CALLSTACK_TOKEN = "The delayRender was called:";
1722
1722
  var DELAY_RENDER_RETRIES_LEFT = "Retries left: ";
@@ -2697,7 +2697,7 @@ var validateTrimProps = (trimBefore, trimAfter) => {
2697
2697
  throw new TypeError(`trimAfter must be a positive number, instead got ${trimAfter}.`);
2698
2698
  }
2699
2699
  }
2700
- if (trimAfter < trimBefore) {
2700
+ if (trimAfter <= trimBefore) {
2701
2701
  throw new TypeError("trimAfter prop must be greater than trimBefore prop.");
2702
2702
  }
2703
2703
  };
@@ -5694,18 +5694,14 @@ var ImgRefForwarding = ({
5694
5694
  return;
5695
5695
  }
5696
5696
  current.src = actualSrc;
5697
- if (current.complete) {
5698
- onComplete();
5699
- } else {
5700
- current.decode().then(onComplete).catch((err) => {
5701
- console.warn(err);
5702
- if (current.complete) {
5703
- onComplete();
5704
- } else {
5705
- current.addEventListener("load", onComplete);
5706
- }
5707
- });
5708
- }
5697
+ current.decode().then(onComplete).catch((err) => {
5698
+ console.warn(err);
5699
+ if (current.complete) {
5700
+ onComplete();
5701
+ } else {
5702
+ current.addEventListener("load", onComplete);
5703
+ }
5704
+ });
5709
5705
  return () => {
5710
5706
  unmounted = true;
5711
5707
  current.removeEventListener("load", onComplete);
@@ -5733,7 +5729,8 @@ var ImgRefForwarding = ({
5733
5729
  ...props2,
5734
5730
  ref: imageRef,
5735
5731
  crossOrigin: crossOriginValue,
5736
- onError: didGetError
5732
+ onError: didGetError,
5733
+ decoding: "sync"
5737
5734
  });
5738
5735
  };
5739
5736
  var Img = forwardRef8(ImgRefForwarding);
@@ -5956,18 +5953,58 @@ var waitForRoot = (fn) => {
5956
5953
  import {
5957
5954
  useEffect as useEffect18,
5958
5955
  useLayoutEffect as useLayoutEffect8,
5959
- useMemo as useMemo25,
5956
+ useMemo as useMemo26,
5960
5957
  useRef as useRef15,
5961
5958
  useState as useState17
5962
5959
  } from "react";
5960
+
5961
+ // src/use-media-enabled.tsx
5962
+ import { createContext as createContext18, useContext as useContext30, useMemo as useMemo25 } from "react";
5963
5963
  import { jsx as jsx26 } from "react/jsx-runtime";
5964
+ var MediaEnabledContext = createContext18(null);
5965
+ var useVideoEnabled = () => {
5966
+ const context = useContext30(MediaEnabledContext);
5967
+ if (!context) {
5968
+ return window.remotion_videoEnabled;
5969
+ }
5970
+ if (context.videoEnabled === null) {
5971
+ return window.remotion_videoEnabled;
5972
+ }
5973
+ return context.videoEnabled;
5974
+ };
5975
+ var useAudioEnabled = () => {
5976
+ const context = useContext30(MediaEnabledContext);
5977
+ if (!context) {
5978
+ return window.remotion_audioEnabled;
5979
+ }
5980
+ if (context.audioEnabled === null) {
5981
+ return window.remotion_audioEnabled;
5982
+ }
5983
+ return context.audioEnabled;
5984
+ };
5985
+ var MediaEnabledProvider = ({
5986
+ children,
5987
+ videoEnabled,
5988
+ audioEnabled
5989
+ }) => {
5990
+ const value = useMemo25(() => ({ videoEnabled, audioEnabled }), [videoEnabled, audioEnabled]);
5991
+ return /* @__PURE__ */ jsx26(MediaEnabledContext.Provider, {
5992
+ value,
5993
+ children
5994
+ });
5995
+ };
5996
+
5997
+ // src/RemotionRoot.tsx
5998
+ import { jsx as jsx27 } from "react/jsx-runtime";
5964
5999
  var RemotionRoot = ({
5965
6000
  children,
5966
6001
  numberOfAudioTags,
5967
6002
  logLevel,
5968
6003
  onlyRenderComposition,
5969
6004
  currentCompositionMetadata,
5970
- audioLatencyHint
6005
+ audioLatencyHint,
6006
+ videoEnabled,
6007
+ audioEnabled
5971
6008
  }) => {
5972
6009
  const [remotionRootId] = useState17(() => String(random(null)));
5973
6010
  const [frame, setFrame] = useState17(() => getInitialFrameState());
@@ -6004,7 +6041,7 @@ var RemotionRoot = ({
6004
6041
  window.remotion_isPlayer = false;
6005
6042
  }, [continueRender2, delayRender2]);
6006
6043
  }
6007
- const timelineContextValue = useMemo25(() => {
6044
+ const timelineContextValue = useMemo26(() => {
6008
6045
  return {
6009
6046
  frame,
6010
6047
  playing,
@@ -6015,13 +6052,13 @@ var RemotionRoot = ({
6015
6052
  audioAndVideoTags
6016
6053
  };
6017
6054
  }, [frame, playbackRate, playing, remotionRootId]);
6018
- const setTimelineContextValue = useMemo25(() => {
6055
+ const setTimelineContextValue = useMemo26(() => {
6019
6056
  return {
6020
6057
  setFrame,
6021
6058
  setPlaying
6022
6059
  };
6023
6060
  }, []);
6024
- const nonceContext = useMemo25(() => {
6061
+ const nonceContext = useMemo26(() => {
6025
6062
  let counter = 0;
6026
6063
  return {
6027
6064
  getNonce: () => counter++,
@@ -6029,7 +6066,7 @@ var RemotionRoot = ({
6029
6066
  manualRefreshes
6030
6067
  };
6031
6068
  }, [fastRefreshes, manualRefreshes]);
6032
- const setNonceContext = useMemo25(() => {
6069
+ const setNonceContext = useMemo26(() => {
6033
6070
  return {
6034
6071
  increaseManualRefreshes: () => {
6035
6072
  setManualRefreshes((i) => i + 1);
@@ -6047,29 +6084,33 @@ var RemotionRoot = ({
6047
6084
  }
6048
6085
  }
6049
6086
  }, []);
6050
- const logging = useMemo25(() => {
6087
+ const logging = useMemo26(() => {
6051
6088
  return { logLevel, mountTime: Date.now() };
6052
6089
  }, [logLevel]);
6053
- return /* @__PURE__ */ jsx26(LogLevelContext.Provider, {
6090
+ return /* @__PURE__ */ jsx27(LogLevelContext.Provider, {
6054
6091
  value: logging,
6055
- children: /* @__PURE__ */ jsx26(NonceContext.Provider, {
6092
+ children: /* @__PURE__ */ jsx27(NonceContext.Provider, {
6056
6093
  value: nonceContext,
6057
- children: /* @__PURE__ */ jsx26(SetNonceContext.Provider, {
6094
+ children: /* @__PURE__ */ jsx27(SetNonceContext.Provider, {
6058
6095
  value: setNonceContext,
6059
- children: /* @__PURE__ */ jsx26(TimelineContext.Provider, {
6096
+ children: /* @__PURE__ */ jsx27(TimelineContext.Provider, {
6060
6097
  value: timelineContextValue,
6061
- children: /* @__PURE__ */ jsx26(SetTimelineContext.Provider, {
6098
+ children: /* @__PURE__ */ jsx27(SetTimelineContext.Provider, {
6062
6099
  value: setTimelineContextValue,
6063
- children: /* @__PURE__ */ jsx26(EditorPropsProvider, {
6064
- children: /* @__PURE__ */ jsx26(PrefetchProvider, {
6065
- children: /* @__PURE__ */ jsx26(CompositionManagerProvider, {
6066
- numberOfAudioTags,
6067
- onlyRenderComposition,
6068
- currentCompositionMetadata,
6069
- audioLatencyHint,
6070
- children: /* @__PURE__ */ jsx26(DurationsContextProvider, {
6071
- children: /* @__PURE__ */ jsx26(BufferingProvider, {
6072
- children
6100
+ children: /* @__PURE__ */ jsx27(MediaEnabledProvider, {
6101
+ videoEnabled,
6102
+ audioEnabled,
6103
+ children: /* @__PURE__ */ jsx27(EditorPropsProvider, {
6104
+ children: /* @__PURE__ */ jsx27(PrefetchProvider, {
6105
+ children: /* @__PURE__ */ jsx27(CompositionManagerProvider, {
6106
+ numberOfAudioTags,
6107
+ onlyRenderComposition,
6108
+ currentCompositionMetadata,
6109
+ audioLatencyHint,
6110
+ children: /* @__PURE__ */ jsx27(DurationsContextProvider, {
6111
+ children: /* @__PURE__ */ jsx27(BufferingProvider, {
6112
+ children
6113
+ })
6073
6114
  })
6074
6115
  })
6075
6116
  })
@@ -6110,9 +6151,9 @@ var setupEnvVariables = () => {
6110
6151
  };
6111
6152
 
6112
6153
  // src/use-current-scale.ts
6113
- import React26, { createContext as createContext18 } from "react";
6154
+ import React26, { createContext as createContext19 } from "react";
6114
6155
  var CurrentScaleContext = React26.createContext(null);
6115
- var PreviewSizeContext = createContext18({
6156
+ var PreviewSizeContext = createContext19({
6116
6157
  setSize: () => {
6117
6158
  return;
6118
6159
  },
@@ -6172,10 +6213,10 @@ import { useCallback as useCallback16 } from "react";
6172
6213
  // src/video/OffthreadVideoForRendering.tsx
6173
6214
  import {
6174
6215
  useCallback as useCallback15,
6175
- useContext as useContext30,
6216
+ useContext as useContext31,
6176
6217
  useEffect as useEffect19,
6177
6218
  useLayoutEffect as useLayoutEffect9,
6178
- useMemo as useMemo26,
6219
+ useMemo as useMemo27,
6179
6220
  useState as useState18
6180
6221
  } from "react";
6181
6222
 
@@ -6190,7 +6231,7 @@ var getOffthreadVideoSource = ({
6190
6231
  };
6191
6232
 
6192
6233
  // src/video/OffthreadVideoForRendering.tsx
6193
- import { jsx as jsx27 } from "react/jsx-runtime";
6234
+ import { jsx as jsx28 } from "react/jsx-runtime";
6194
6235
  var OffthreadVideoForRendering = ({
6195
6236
  onError,
6196
6237
  volume: volumeProp,
@@ -6214,13 +6255,13 @@ var OffthreadVideoForRendering = ({
6214
6255
  const frame = useCurrentFrame();
6215
6256
  const volumePropsFrame = useFrameForVolumeProp(loopVolumeCurveBehavior);
6216
6257
  const videoConfig = useUnsafeVideoConfig();
6217
- const sequenceContext = useContext30(SequenceContext);
6258
+ const sequenceContext = useContext31(SequenceContext);
6218
6259
  const mediaStartsAt = useMediaStartsAt();
6219
- const { registerRenderAsset, unregisterRenderAsset } = useContext30(RenderAssetManager);
6260
+ const { registerRenderAsset, unregisterRenderAsset } = useContext31(RenderAssetManager);
6220
6261
  if (!src) {
6221
6262
  throw new TypeError("No `src` was passed to <OffthreadVideo>.");
6222
6263
  }
6223
- const id = useMemo26(() => `offthreadvideo-${random(src)}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.relativeFrom}-${sequenceContext?.durationInFrames}`, [
6264
+ const id = useMemo27(() => `offthreadvideo-${random(src)}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.relativeFrom}-${sequenceContext?.durationInFrames}`, [
6224
6265
  src,
6225
6266
  sequenceContext?.cumulatedFrom,
6226
6267
  sequenceContext?.relativeFrom,
@@ -6275,14 +6316,14 @@ var OffthreadVideoForRendering = ({
6275
6316
  sequenceContext?.relativeFrom,
6276
6317
  audioStreamIndex
6277
6318
  ]);
6278
- const currentTime = useMemo26(() => {
6319
+ const currentTime = useMemo27(() => {
6279
6320
  return getExpectedMediaFrameUncorrected({
6280
6321
  frame,
6281
6322
  playbackRate: playbackRate || 1,
6282
6323
  startFrom: -mediaStartsAt
6283
6324
  }) / videoConfig.fps;
6284
6325
  }, [frame, mediaStartsAt, playbackRate, videoConfig.fps]);
6285
- const actualSrc = useMemo26(() => {
6326
+ const actualSrc = useMemo27(() => {
6286
6327
  return getOffthreadVideoSource({
6287
6328
  src,
6288
6329
  currentTime,
@@ -6370,7 +6411,7 @@ var OffthreadVideoForRendering = ({
6370
6411
  cancelRender("Failed to load image with src " + imageSrc);
6371
6412
  }
6372
6413
  }, [imageSrc, onError]);
6373
- const className = useMemo26(() => {
6414
+ const className = useMemo27(() => {
6374
6415
  return [OBJECTFIT_CONTAIN_CLASS_NAME, props2.className].filter(truthy).join(" ");
6375
6416
  }, [props2.className]);
6376
6417
  const onImageFrame = useCallback15((img) => {
@@ -6382,7 +6423,7 @@ var OffthreadVideoForRendering = ({
6382
6423
  return null;
6383
6424
  }
6384
6425
  continueRender2(imageSrc.handle);
6385
- return /* @__PURE__ */ jsx27(Img, {
6426
+ return /* @__PURE__ */ jsx28(Img, {
6386
6427
  src: imageSrc.src,
6387
6428
  delayRenderRetries,
6388
6429
  delayRenderTimeoutInMilliseconds,
@@ -6396,10 +6437,10 @@ var OffthreadVideoForRendering = ({
6396
6437
  // src/video/VideoForPreview.tsx
6397
6438
  import {
6398
6439
  forwardRef as forwardRef9,
6399
- useContext as useContext31,
6440
+ useContext as useContext32,
6400
6441
  useEffect as useEffect21,
6401
6442
  useImperativeHandle as useImperativeHandle9,
6402
- useMemo as useMemo27,
6443
+ useMemo as useMemo28,
6403
6444
  useRef as useRef16,
6404
6445
  useState as useState19
6405
6446
  } from "react";
@@ -6434,14 +6475,14 @@ var useEmitVideoFrame = ({
6434
6475
  };
6435
6476
 
6436
6477
  // src/video/VideoForPreview.tsx
6437
- import { jsx as jsx28 } from "react/jsx-runtime";
6478
+ import { jsx as jsx29 } from "react/jsx-runtime";
6438
6479
  var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
6439
- const context = useContext31(SharedAudioContext);
6480
+ const context = useContext32(SharedAudioContext);
6440
6481
  if (!context) {
6441
6482
  throw new Error("SharedAudioContext not found");
6442
6483
  }
6443
6484
  const videoRef = useRef16(null);
6444
- const sharedSource = useMemo27(() => {
6485
+ const sharedSource = useMemo28(() => {
6445
6486
  if (!context.audioContext) {
6446
6487
  return null;
6447
6488
  }
@@ -6484,8 +6525,8 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
6484
6525
  }
6485
6526
  const volumePropFrame = useFrameForVolumeProp(loopVolumeCurveBehavior ?? "repeat");
6486
6527
  const { fps, durationInFrames } = useVideoConfig();
6487
- const parentSequence = useContext31(SequenceContext);
6488
- const { hidden } = useContext31(SequenceVisibilityToggleContext);
6528
+ const parentSequence = useContext32(SequenceContext);
6529
+ const { hidden } = useContext32(SequenceVisibilityToggleContext);
6489
6530
  const logLevel = useLogLevel();
6490
6531
  const mountTime = useMountTime();
6491
6532
  const [timelineId] = useState19(() => String(Math.random()));
@@ -6619,7 +6660,7 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
6619
6660
  current.preload = "auto";
6620
6661
  }
6621
6662
  }, []);
6622
- const actualStyle = useMemo27(() => {
6663
+ const actualStyle = useMemo28(() => {
6623
6664
  return {
6624
6665
  ...style,
6625
6666
  opacity: isSequenceHidden ? 0 : style?.opacity ?? 1
@@ -6629,7 +6670,7 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
6629
6670
  crossOrigin,
6630
6671
  requestsVideoFrame: Boolean(onVideoFrame)
6631
6672
  });
6632
- return /* @__PURE__ */ jsx28("video", {
6673
+ return /* @__PURE__ */ jsx29("video", {
6633
6674
  ref: videoRef,
6634
6675
  muted: muted || mediaMuted || isSequenceHidden || userPreferredVolume <= 0,
6635
6676
  playsInline: true,
@@ -6644,7 +6685,7 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
6644
6685
  var VideoForPreview = forwardRef9(VideoForDevelopmentRefForwardingFunction);
6645
6686
 
6646
6687
  // src/video/OffthreadVideo.tsx
6647
- import { jsx as jsx29 } from "react/jsx-runtime";
6688
+ import { jsx as jsx30 } from "react/jsx-runtime";
6648
6689
  var InnerOffthreadVideo = (props2) => {
6649
6690
  const {
6650
6691
  startFrom,
@@ -6672,13 +6713,13 @@ var InnerOffthreadVideo = (props2) => {
6672
6713
  trimAfter
6673
6714
  });
6674
6715
  if (typeof trimBeforeValue !== "undefined" || typeof trimAfterValue !== "undefined") {
6675
- return /* @__PURE__ */ jsx29(Sequence, {
6716
+ return /* @__PURE__ */ jsx30(Sequence, {
6676
6717
  layout: "none",
6677
6718
  from: 0 - (trimBeforeValue ?? 0),
6678
6719
  showInTimeline: false,
6679
6720
  durationInFrames: trimAfterValue,
6680
6721
  name,
6681
- children: /* @__PURE__ */ jsx29(InnerOffthreadVideo, {
6722
+ children: /* @__PURE__ */ jsx30(InnerOffthreadVideo, {
6682
6723
  pauseWhenBuffering: pauseWhenBuffering ?? false,
6683
6724
  ...otherProps,
6684
6725
  trimAfter: undefined,
@@ -6693,7 +6734,7 @@ var InnerOffthreadVideo = (props2) => {
6693
6734
  }
6694
6735
  validateMediaProps(props2, "Video");
6695
6736
  if (environment.isRendering) {
6696
- return /* @__PURE__ */ jsx29(OffthreadVideoForRendering, {
6737
+ return /* @__PURE__ */ jsx30(OffthreadVideoForRendering, {
6697
6738
  pauseWhenBuffering: pauseWhenBuffering ?? false,
6698
6739
  ...otherProps,
6699
6740
  trimAfter: undefined,
@@ -6715,7 +6756,7 @@ var InnerOffthreadVideo = (props2) => {
6715
6756
  delayRenderTimeoutInMilliseconds,
6716
6757
  ...propsForPreview
6717
6758
  } = otherProps;
6718
- return /* @__PURE__ */ jsx29(VideoForPreview, {
6759
+ return /* @__PURE__ */ jsx30(VideoForPreview, {
6719
6760
  _remotionInternalStack: stack ?? null,
6720
6761
  onDuration,
6721
6762
  onlyWarnForMediaSeekingError: true,
@@ -6764,7 +6805,7 @@ var OffthreadVideo = ({
6764
6805
  if (imageFormat) {
6765
6806
  throw new TypeError(`The \`<OffthreadVideo>\` tag does no longer accept \`imageFormat\`. Use the \`transparent\` prop if you want to render a transparent video.`);
6766
6807
  }
6767
- return /* @__PURE__ */ jsx29(InnerOffthreadVideo, {
6808
+ return /* @__PURE__ */ jsx30(InnerOffthreadVideo, {
6768
6809
  acceptableTimeShiftInSeconds,
6769
6810
  allowAmplificationDuringRender: allowAmplificationDuringRender ?? true,
6770
6811
  audioStreamIndex: audioStreamIndex ?? 0,
@@ -6837,8 +6878,8 @@ var watchStaticFile = (fileName, callback) => {
6837
6878
  };
6838
6879
 
6839
6880
  // src/wrap-remotion-context.tsx
6840
- import React30, { useMemo as useMemo28 } from "react";
6841
- import { jsx as jsx30 } from "react/jsx-runtime";
6881
+ import React30, { useMemo as useMemo29 } from "react";
6882
+ import { jsx as jsx31 } from "react/jsx-runtime";
6842
6883
  function useRemotionContexts() {
6843
6884
  const compositionManagerCtx = React30.useContext(CompositionManager);
6844
6885
  const timelineContext = React30.useContext(TimelineContext);
@@ -6852,7 +6893,7 @@ function useRemotionContexts() {
6852
6893
  const sequenceManagerContext = React30.useContext(SequenceManager);
6853
6894
  const bufferManagerContext = React30.useContext(BufferingContextReact);
6854
6895
  const logLevelContext = React30.useContext(LogLevelContext);
6855
- return useMemo28(() => ({
6896
+ return useMemo29(() => ({
6856
6897
  compositionManagerCtx,
6857
6898
  timelineContext,
6858
6899
  setTimelineContext,
@@ -6882,29 +6923,29 @@ function useRemotionContexts() {
6882
6923
  }
6883
6924
  var RemotionContextProvider = (props2) => {
6884
6925
  const { children, contexts } = props2;
6885
- return /* @__PURE__ */ jsx30(LogLevelContext.Provider, {
6926
+ return /* @__PURE__ */ jsx31(LogLevelContext.Provider, {
6886
6927
  value: contexts.logLevelContext,
6887
- children: /* @__PURE__ */ jsx30(CanUseRemotionHooks.Provider, {
6928
+ children: /* @__PURE__ */ jsx31(CanUseRemotionHooks.Provider, {
6888
6929
  value: contexts.canUseRemotionHooksContext,
6889
- children: /* @__PURE__ */ jsx30(NonceContext.Provider, {
6930
+ children: /* @__PURE__ */ jsx31(NonceContext.Provider, {
6890
6931
  value: contexts.nonceContext,
6891
- children: /* @__PURE__ */ jsx30(PreloadContext.Provider, {
6932
+ children: /* @__PURE__ */ jsx31(PreloadContext.Provider, {
6892
6933
  value: contexts.preloadContext,
6893
- children: /* @__PURE__ */ jsx30(CompositionManager.Provider, {
6934
+ children: /* @__PURE__ */ jsx31(CompositionManager.Provider, {
6894
6935
  value: contexts.compositionManagerCtx,
6895
- children: /* @__PURE__ */ jsx30(SequenceManager.Provider, {
6936
+ children: /* @__PURE__ */ jsx31(SequenceManager.Provider, {
6896
6937
  value: contexts.sequenceManagerContext,
6897
- children: /* @__PURE__ */ jsx30(RenderAssetManager.Provider, {
6938
+ children: /* @__PURE__ */ jsx31(RenderAssetManager.Provider, {
6898
6939
  value: contexts.renderAssetManagerContext,
6899
- children: /* @__PURE__ */ jsx30(ResolveCompositionContext.Provider, {
6940
+ children: /* @__PURE__ */ jsx31(ResolveCompositionContext.Provider, {
6900
6941
  value: contexts.resolveCompositionContext,
6901
- children: /* @__PURE__ */ jsx30(TimelineContext.Provider, {
6942
+ children: /* @__PURE__ */ jsx31(TimelineContext.Provider, {
6902
6943
  value: contexts.timelineContext,
6903
- children: /* @__PURE__ */ jsx30(SetTimelineContext.Provider, {
6944
+ children: /* @__PURE__ */ jsx31(SetTimelineContext.Provider, {
6904
6945
  value: contexts.setTimelineContext,
6905
- children: /* @__PURE__ */ jsx30(SequenceContext.Provider, {
6946
+ children: /* @__PURE__ */ jsx31(SequenceContext.Provider, {
6906
6947
  value: contexts.sequenceContext,
6907
- children: /* @__PURE__ */ jsx30(BufferingContextReact.Provider, {
6948
+ children: /* @__PURE__ */ jsx31(BufferingContextReact.Provider, {
6908
6949
  value: contexts.bufferManagerContext,
6909
6950
  children
6910
6951
  })
@@ -7008,7 +7049,9 @@ var Internals = {
7008
7049
  InnerOffthreadVideo,
7009
7050
  useBasicMediaInTimeline,
7010
7051
  getInputPropsOverride,
7011
- setInputPropsOverride
7052
+ setInputPropsOverride,
7053
+ useVideoEnabled,
7054
+ useAudioEnabled
7012
7055
  };
7013
7056
  // src/interpolate-colors.ts
7014
7057
  var NUMBER = "[-+]?\\d*\\.?\\d+";
@@ -7374,7 +7417,7 @@ var validateFrame = ({
7374
7417
  }
7375
7418
  };
7376
7419
  // src/series/index.tsx
7377
- import { Children, forwardRef as forwardRef10, useMemo as useMemo29 } from "react";
7420
+ import { Children, forwardRef as forwardRef10, useMemo as useMemo30 } from "react";
7378
7421
 
7379
7422
  // src/series/flatten-children.tsx
7380
7423
  import React31 from "react";
@@ -7390,17 +7433,17 @@ var flattenChildren = (children) => {
7390
7433
  };
7391
7434
 
7392
7435
  // src/series/is-inside-series.tsx
7393
- import React32, { createContext as createContext19 } from "react";
7394
- import { jsx as jsx31 } from "react/jsx-runtime";
7395
- var IsInsideSeriesContext = createContext19(false);
7436
+ import React32, { createContext as createContext20 } from "react";
7437
+ import { jsx as jsx32 } from "react/jsx-runtime";
7438
+ var IsInsideSeriesContext = createContext20(false);
7396
7439
  var IsInsideSeriesContainer = ({ children }) => {
7397
- return /* @__PURE__ */ jsx31(IsInsideSeriesContext.Provider, {
7440
+ return /* @__PURE__ */ jsx32(IsInsideSeriesContext.Provider, {
7398
7441
  value: true,
7399
7442
  children
7400
7443
  });
7401
7444
  };
7402
7445
  var IsNotInsideSeriesProvider = ({ children }) => {
7403
- return /* @__PURE__ */ jsx31(IsInsideSeriesContext.Provider, {
7446
+ return /* @__PURE__ */ jsx32(IsInsideSeriesContext.Provider, {
7404
7447
  value: false,
7405
7448
  children
7406
7449
  });
@@ -7413,16 +7456,16 @@ var useRequireToBeInsideSeries = () => {
7413
7456
  };
7414
7457
 
7415
7458
  // src/series/index.tsx
7416
- import { jsx as jsx32 } from "react/jsx-runtime";
7459
+ import { jsx as jsx33 } from "react/jsx-runtime";
7417
7460
  var SeriesSequenceRefForwardingFunction = ({ children }, _ref) => {
7418
7461
  useRequireToBeInsideSeries();
7419
- return /* @__PURE__ */ jsx32(IsNotInsideSeriesProvider, {
7462
+ return /* @__PURE__ */ jsx33(IsNotInsideSeriesProvider, {
7420
7463
  children
7421
7464
  });
7422
7465
  };
7423
7466
  var SeriesSequence = forwardRef10(SeriesSequenceRefForwardingFunction);
7424
7467
  var Series = (props2) => {
7425
- const childrenValue = useMemo29(() => {
7468
+ const childrenValue = useMemo30(() => {
7426
7469
  let startFrame = 0;
7427
7470
  const flattenedChildren = flattenChildren(props2.children);
7428
7471
  return Children.map(flattenedChildren, (child, i) => {
@@ -7466,7 +7509,7 @@ var Series = (props2) => {
7466
7509
  }
7467
7510
  const currentStartFrame = startFrame + offset;
7468
7511
  startFrame += durationInFramesProp + offset;
7469
- return /* @__PURE__ */ jsx32(Sequence, {
7512
+ return /* @__PURE__ */ jsx33(Sequence, {
7470
7513
  name: name || "<Series.Sequence>",
7471
7514
  from: currentStartFrame,
7472
7515
  durationInFrames: durationInFramesProp,
@@ -7477,14 +7520,14 @@ var Series = (props2) => {
7477
7520
  });
7478
7521
  }, [props2.children]);
7479
7522
  if (ENABLE_V5_BREAKING_CHANGES) {
7480
- return /* @__PURE__ */ jsx32(IsInsideSeriesContainer, {
7481
- children: /* @__PURE__ */ jsx32(Sequence, {
7523
+ return /* @__PURE__ */ jsx33(IsInsideSeriesContainer, {
7524
+ children: /* @__PURE__ */ jsx33(Sequence, {
7482
7525
  ...props2,
7483
7526
  children: childrenValue
7484
7527
  })
7485
7528
  });
7486
7529
  }
7487
- return /* @__PURE__ */ jsx32(IsInsideSeriesContainer, {
7530
+ return /* @__PURE__ */ jsx33(IsInsideSeriesContainer, {
7488
7531
  children: childrenValue
7489
7532
  });
7490
7533
  };
@@ -7831,16 +7874,16 @@ var Still = (props2) => {
7831
7874
  return React34.createElement(Composition, newProps);
7832
7875
  };
7833
7876
  // src/video/Video.tsx
7834
- import { forwardRef as forwardRef12, useCallback as useCallback17, useContext as useContext33 } from "react";
7877
+ import { forwardRef as forwardRef12, useCallback as useCallback17, useContext as useContext34 } from "react";
7835
7878
 
7836
7879
  // src/video/VideoForRendering.tsx
7837
7880
  import {
7838
7881
  forwardRef as forwardRef11,
7839
- useContext as useContext32,
7882
+ useContext as useContext33,
7840
7883
  useEffect as useEffect22,
7841
7884
  useImperativeHandle as useImperativeHandle10,
7842
7885
  useLayoutEffect as useLayoutEffect10,
7843
- useMemo as useMemo30,
7886
+ useMemo as useMemo31,
7844
7887
  useRef as useRef17
7845
7888
  } from "react";
7846
7889
 
@@ -7969,7 +8012,7 @@ var seekToTimeMultipleUntilRight = ({
7969
8012
  };
7970
8013
 
7971
8014
  // src/video/VideoForRendering.tsx
7972
- import { jsx as jsx33 } from "react/jsx-runtime";
8015
+ import { jsx as jsx34 } from "react/jsx-runtime";
7973
8016
  var VideoForRenderingForwardFunction = ({
7974
8017
  onError,
7975
8018
  volume: volumeProp,
@@ -7990,14 +8033,14 @@ var VideoForRenderingForwardFunction = ({
7990
8033
  const volumePropsFrame = useFrameForVolumeProp(loopVolumeCurveBehavior ?? "repeat");
7991
8034
  const videoConfig = useUnsafeVideoConfig();
7992
8035
  const videoRef = useRef17(null);
7993
- const sequenceContext = useContext32(SequenceContext);
8036
+ const sequenceContext = useContext33(SequenceContext);
7994
8037
  const mediaStartsAt = useMediaStartsAt();
7995
8038
  const environment = useRemotionEnvironment();
7996
8039
  const logLevel = useLogLevel();
7997
8040
  const mountTime = useMountTime();
7998
8041
  const { delayRender: delayRender2, continueRender: continueRender2 } = useDelayRender();
7999
- const { registerRenderAsset, unregisterRenderAsset } = useContext32(RenderAssetManager);
8000
- const id = useMemo30(() => `video-${random(props2.src ?? "")}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.relativeFrom}-${sequenceContext?.durationInFrames}`, [
8042
+ const { registerRenderAsset, unregisterRenderAsset } = useContext33(RenderAssetManager);
8043
+ const id = useMemo31(() => `video-${random(props2.src ?? "")}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.relativeFrom}-${sequenceContext?.durationInFrames}`, [
8001
8044
  props2.src,
8002
8045
  sequenceContext?.cumulatedFrom,
8003
8046
  sequenceContext?.relativeFrom,
@@ -8173,7 +8216,7 @@ var VideoForRenderingForwardFunction = ({
8173
8216
  delayRender2
8174
8217
  ]);
8175
8218
  }
8176
- return /* @__PURE__ */ jsx33("video", {
8219
+ return /* @__PURE__ */ jsx34("video", {
8177
8220
  ref: videoRef,
8178
8221
  disableRemotePlayback: true,
8179
8222
  ...props2
@@ -8182,7 +8225,7 @@ var VideoForRenderingForwardFunction = ({
8182
8225
  var VideoForRendering = forwardRef11(VideoForRenderingForwardFunction);
8183
8226
 
8184
8227
  // src/video/Video.tsx
8185
- import { jsx as jsx34 } from "react/jsx-runtime";
8228
+ import { jsx as jsx35 } from "react/jsx-runtime";
8186
8229
  var VideoForwardingFunction = (props2, ref) => {
8187
8230
  const {
8188
8231
  startFrom,
@@ -8200,7 +8243,7 @@ var VideoForwardingFunction = (props2, ref) => {
8200
8243
  const { loop, ...propsOtherThanLoop } = props2;
8201
8244
  const { fps } = useVideoConfig();
8202
8245
  const environment = useRemotionEnvironment();
8203
- const { durations, setDurations } = useContext33(DurationsContext);
8246
+ const { durations, setDurations } = useContext34(DurationsContext);
8204
8247
  if (typeof ref === "string") {
8205
8248
  throw new Error("string refs are not supported");
8206
8249
  }
@@ -8222,14 +8265,14 @@ var VideoForwardingFunction = (props2, ref) => {
8222
8265
  });
8223
8266
  if (loop && durationFetched !== undefined) {
8224
8267
  if (!Number.isFinite(durationFetched)) {
8225
- return /* @__PURE__ */ jsx34(Html5Video, {
8268
+ return /* @__PURE__ */ jsx35(Html5Video, {
8226
8269
  ...propsOtherThanLoop,
8227
8270
  ref,
8228
8271
  _remotionInternalNativeLoopPassed: true
8229
8272
  });
8230
8273
  }
8231
8274
  const mediaDuration = durationFetched * fps;
8232
- return /* @__PURE__ */ jsx34(Loop, {
8275
+ return /* @__PURE__ */ jsx35(Loop, {
8233
8276
  durationInFrames: calculateMediaDuration({
8234
8277
  trimAfter: trimAfterValue,
8235
8278
  mediaDurationInFrames: mediaDuration,
@@ -8238,7 +8281,7 @@ var VideoForwardingFunction = (props2, ref) => {
8238
8281
  }),
8239
8282
  layout: "none",
8240
8283
  name,
8241
- children: /* @__PURE__ */ jsx34(Html5Video, {
8284
+ children: /* @__PURE__ */ jsx35(Html5Video, {
8242
8285
  ...propsOtherThanLoop,
8243
8286
  ref,
8244
8287
  _remotionInternalNativeLoopPassed: true
@@ -8246,13 +8289,13 @@ var VideoForwardingFunction = (props2, ref) => {
8246
8289
  });
8247
8290
  }
8248
8291
  if (typeof trimBeforeValue !== "undefined" || typeof trimAfterValue !== "undefined") {
8249
- return /* @__PURE__ */ jsx34(Sequence, {
8292
+ return /* @__PURE__ */ jsx35(Sequence, {
8250
8293
  layout: "none",
8251
8294
  from: 0 - (trimBeforeValue ?? 0),
8252
8295
  showInTimeline: false,
8253
8296
  durationInFrames: trimAfterValue,
8254
8297
  name,
8255
- children: /* @__PURE__ */ jsx34(Html5Video, {
8298
+ children: /* @__PURE__ */ jsx35(Html5Video, {
8256
8299
  pauseWhenBuffering: pauseWhenBuffering ?? false,
8257
8300
  ...otherProps,
8258
8301
  ref
@@ -8261,14 +8304,14 @@ var VideoForwardingFunction = (props2, ref) => {
8261
8304
  }
8262
8305
  validateMediaProps({ playbackRate: props2.playbackRate, volume: props2.volume }, "Html5Video");
8263
8306
  if (environment.isRendering) {
8264
- return /* @__PURE__ */ jsx34(VideoForRendering, {
8307
+ return /* @__PURE__ */ jsx35(VideoForRendering, {
8265
8308
  onDuration,
8266
8309
  onVideoFrame: onVideoFrame ?? null,
8267
8310
  ...otherProps,
8268
8311
  ref
8269
8312
  });
8270
8313
  }
8271
- return /* @__PURE__ */ jsx34(VideoForPreview, {
8314
+ return /* @__PURE__ */ jsx35(VideoForPreview, {
8272
8315
  onlyWarnForMediaSeekingError: false,
8273
8316
  ...otherProps,
8274
8317
  ref,
@@ -139,9 +139,9 @@ function truthy(value) {
139
139
  // src/delay-render.ts
140
140
  if (typeof window !== "undefined") {
141
141
  window.remotion_renderReady = false;
142
- }
143
- if (typeof window !== "undefined") {
144
- window.remotion_delayRenderTimeouts = {};
142
+ if (!window.remotion_delayRenderTimeouts) {
143
+ window.remotion_delayRenderTimeouts = {};
144
+ }
145
145
  }
146
146
  var DELAY_RENDER_CALLSTACK_TOKEN = "The delayRender was called:";
147
147
  var DELAY_RENDER_RETRIES_LEFT = "Retries left: ";
@@ -1,5 +1,5 @@
1
1
  // src/version.ts
2
- var VERSION = "4.0.362";
2
+ var VERSION = "4.0.364";
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.362",
6
+ "version": "4.0.364",
7
7
  "description": "Make videos programmatically",
8
8
  "main": "dist/cjs/index.js",
9
9
  "types": "dist/cjs/index.d.ts",
@@ -29,12 +29,12 @@
29
29
  "@testing-library/dom": "10.4.0",
30
30
  "@happy-dom/global-registrator": "14.5.1",
31
31
  "@types/dom-webcodecs": "0.1.11",
32
- "happy-dom": "15.10.2",
32
+ "happy-dom": "20.0.2",
33
33
  "react": "19.0.0",
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.362",
37
+ "@remotion/eslint-config-internal": "4.0.364",
38
38
  "eslint": "9.19.0"
39
39
  },
40
40
  "keywords": [