remotion 4.0.374 → 4.0.376
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/Artifact.js +1 -1
- package/dist/cjs/Composition.d.ts +1 -1
- package/dist/cjs/RemotionRoot.d.ts +1 -1
- package/dist/cjs/RemotionRoot.js +4 -6
- package/dist/cjs/RenderAssetManager.d.ts +4 -0
- package/dist/cjs/RenderAssetManager.js +15 -1
- package/dist/cjs/ResolveCompositionConfig.d.ts +1 -1
- package/dist/cjs/ResolveCompositionConfig.js +13 -5
- package/dist/cjs/config/input-props.js +4 -0
- package/dist/cjs/index.d.ts +1 -0
- package/dist/cjs/internals.d.ts +9 -4
- package/dist/cjs/internals.js +5 -2
- package/dist/cjs/max-video-cache-size.d.ts +2 -0
- package/dist/cjs/max-video-cache-size.js +8 -0
- package/dist/cjs/resolve-video-config.d.ts +2 -2
- package/dist/cjs/resolve-video-config.js +1 -1
- package/dist/cjs/use-delay-render.d.ts +2 -1
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/index.mjs +136 -114
- package/dist/esm/version.mjs +1 -1
- package/package.json +2 -2
package/dist/cjs/Artifact.js
CHANGED
|
@@ -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.
|
|
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
|
|
3
|
+
export declare const RemotionRootContexts: React.FC<{
|
|
4
4
|
readonly children: React.ReactNode;
|
|
5
5
|
readonly numberOfAudioTags: number;
|
|
6
6
|
readonly logLevel: LogLevel;
|
package/dist/cjs/RemotionRoot.js
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
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
|
-
const ResolveCompositionConfig_js_1 = require("./ResolveCompositionConfig.js");
|
|
9
7
|
const SequenceManager_js_1 = require("./SequenceManager.js");
|
|
10
8
|
const TimelineContext_js_1 = require("./TimelineContext.js");
|
|
11
9
|
const shared_audio_tags_js_1 = require("./audio/shared-audio-tags.js");
|
|
@@ -15,7 +13,7 @@ const nonce_js_1 = require("./nonce.js");
|
|
|
15
13
|
const prefetch_state_js_1 = require("./prefetch-state.js");
|
|
16
14
|
const use_media_enabled_js_1 = require("./use-media-enabled.js");
|
|
17
15
|
const duration_state_js_1 = require("./video/duration-state.js");
|
|
18
|
-
const
|
|
16
|
+
const RemotionRootContexts = ({ children, numberOfAudioTags, logLevel, audioLatencyHint, videoEnabled, audioEnabled, frameState, }) => {
|
|
19
17
|
const [fastRefreshes, setFastRefreshes] = (0, react_1.useState)(0);
|
|
20
18
|
const [manualRefreshes, setManualRefreshes] = (0, react_1.useState)(0);
|
|
21
19
|
const nonceContext = (0, react_1.useMemo)(() => {
|
|
@@ -47,6 +45,6 @@ const RemotionRoot = ({ children, numberOfAudioTags, logLevel, audioLatencyHint,
|
|
|
47
45
|
const logging = (0, react_1.useMemo)(() => {
|
|
48
46
|
return { logLevel, mountTime: Date.now() };
|
|
49
47
|
}, [logLevel]);
|
|
50
|
-
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)(
|
|
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 }) }) }) }) }) }) }) }) }) }) }));
|
|
51
49
|
};
|
|
52
|
-
exports.
|
|
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);
|
|
@@ -21,7 +21,7 @@ type VideoConfigState = {
|
|
|
21
21
|
};
|
|
22
22
|
export declare const needsResolution: (composition: AnyComposition) => boolean;
|
|
23
23
|
export declare const PROPS_UPDATED_EXTERNALLY = "remotion.propsUpdatedExternally";
|
|
24
|
-
export declare const
|
|
24
|
+
export declare const ResolveCompositionConfigInStudio: React.FC<PropsWithChildren<{
|
|
25
25
|
children: React.ReactNode;
|
|
26
26
|
}>>;
|
|
27
27
|
export declare const useResolvedVideoConfig: (preferredCompositionId: string | null) => VideoConfigState | null;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useResolvedVideoConfig = exports.
|
|
3
|
+
exports.useResolvedVideoConfig = exports.ResolveCompositionConfigInStudio = exports.PROPS_UPDATED_EXTERNALLY = exports.needsResolution = exports.resolveCompositionsRef = exports.ResolveCompositionContext = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const CompositionManagerContext_js_1 = require("./CompositionManagerContext.js");
|
|
@@ -19,7 +19,7 @@ const needsResolution = (composition) => {
|
|
|
19
19
|
};
|
|
20
20
|
exports.needsResolution = needsResolution;
|
|
21
21
|
exports.PROPS_UPDATED_EXTERNALLY = 'remotion.propsUpdatedExternally';
|
|
22
|
-
const
|
|
22
|
+
const ResolveCompositionConfigInStudio = ({ children }) => {
|
|
23
23
|
const [currentRenderModalComposition, setCurrentRenderModalComposition] = (0, react_1.useState)(null);
|
|
24
24
|
const { compositions, canvasContent, currentCompositionMetadata } = (0, react_1.useContext)(CompositionManagerContext_js_1.CompositionManager);
|
|
25
25
|
const { fastRefreshes, manualRefreshes } = (0, react_1.useContext)(nonce_js_1.NonceContext);
|
|
@@ -64,7 +64,7 @@ const ResolveCompositionConfig = ({ children }) => {
|
|
|
64
64
|
const result = (0, resolve_video_config_js_1.resolveVideoConfigOrCatch)({
|
|
65
65
|
compositionId,
|
|
66
66
|
calculateMetadata,
|
|
67
|
-
|
|
67
|
+
inputProps: combinedProps,
|
|
68
68
|
signal,
|
|
69
69
|
defaultProps,
|
|
70
70
|
compositionDurationInFrames,
|
|
@@ -286,7 +286,7 @@ const ResolveCompositionConfig = ({ children }) => {
|
|
|
286
286
|
}, [compositions, resolvedConfigs]);
|
|
287
287
|
return ((0, jsx_runtime_1.jsx)(exports.ResolveCompositionContext.Provider, { value: resolvedConfigsIncludingStaticOnes, children: children }));
|
|
288
288
|
};
|
|
289
|
-
exports.
|
|
289
|
+
exports.ResolveCompositionConfigInStudio = ResolveCompositionConfigInStudio;
|
|
290
290
|
const useResolvedVideoConfig = (preferredCompositionId) => {
|
|
291
291
|
const context = (0, react_1.useContext)(exports.ResolveCompositionContext);
|
|
292
292
|
const { props: allEditorProps } = (0, react_1.useContext)(EditorProps_js_1.EditorPropsContext);
|
|
@@ -334,7 +334,11 @@ const useResolvedVideoConfig = (preferredCompositionId) => {
|
|
|
334
334
|
props: {
|
|
335
335
|
...((_c = composition.defaultProps) !== null && _c !== void 0 ? _c : {}),
|
|
336
336
|
...(selectedEditorProps !== null && selectedEditorProps !== void 0 ? selectedEditorProps : {}),
|
|
337
|
-
...(typeof window === 'undefined' ||
|
|
337
|
+
...(typeof window === 'undefined' ||
|
|
338
|
+
env.isPlayer ||
|
|
339
|
+
// In tests, we don't set window.remotion_inputProps,
|
|
340
|
+
// otherwise it should be available here
|
|
341
|
+
!window.remotion_inputProps
|
|
338
342
|
? {}
|
|
339
343
|
: ((_d = (0, input_props_js_1.getInputProps)()) !== null && _d !== void 0 ? _d : {})),
|
|
340
344
|
},
|
|
@@ -346,6 +350,10 @@ const useResolvedVideoConfig = (preferredCompositionId) => {
|
|
|
346
350
|
},
|
|
347
351
|
};
|
|
348
352
|
}
|
|
353
|
+
// Could be the case in selectComposition()
|
|
354
|
+
if (!context) {
|
|
355
|
+
return null;
|
|
356
|
+
}
|
|
349
357
|
if (!context[composition.id]) {
|
|
350
358
|
return null;
|
|
351
359
|
}
|
|
@@ -29,6 +29,10 @@ const getInputProps = () => {
|
|
|
29
29
|
if (override) {
|
|
30
30
|
return override;
|
|
31
31
|
}
|
|
32
|
+
if (typeof window === 'undefined' ||
|
|
33
|
+
typeof window.remotion_inputProps === 'undefined') {
|
|
34
|
+
throw new Error('Cannot call `getInputProps()` - window.remotion_inputProps is not set. This API is only available if you are in the Studio, or while you are rendering server-side.');
|
|
35
|
+
}
|
|
32
36
|
const param = window.remotion_inputProps;
|
|
33
37
|
if (!param) {
|
|
34
38
|
return {};
|
package/dist/cjs/index.d.ts
CHANGED
|
@@ -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';
|
package/dist/cjs/internals.d.ts
CHANGED
|
@@ -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
|
|
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
|
-
|
|
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";
|
|
@@ -215,7 +216,7 @@ export declare const Internals: {
|
|
|
215
216
|
setCurrentRenderModalComposition: (compositionId: string | null) => void;
|
|
216
217
|
reloadCurrentlySelectedComposition: () => void;
|
|
217
218
|
} | null>;
|
|
218
|
-
readonly
|
|
219
|
+
readonly ResolveCompositionConfigInStudio: import("react").FC<import("react").PropsWithChildren<{
|
|
219
220
|
children: React.ReactNode;
|
|
220
221
|
}>>;
|
|
221
222
|
readonly REMOTION_STUDIO_CONTAINER_ELEMENT: "__remotion-studio-container";
|
|
@@ -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, };
|
package/dist/cjs/internals.js
CHANGED
|
@@ -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
|
-
|
|
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,
|
|
@@ -153,7 +155,7 @@ exports.Internals = {
|
|
|
153
155
|
resolveVideoConfig: resolve_video_config_js_1.resolveVideoConfig,
|
|
154
156
|
useResolvedVideoConfig: ResolveCompositionConfig_js_1.useResolvedVideoConfig,
|
|
155
157
|
resolveCompositionsRef: ResolveCompositionConfig_js_1.resolveCompositionsRef,
|
|
156
|
-
|
|
158
|
+
ResolveCompositionConfigInStudio: ResolveCompositionConfig_js_1.ResolveCompositionConfigInStudio,
|
|
157
159
|
REMOTION_STUDIO_CONTAINER_ELEMENT: get_preview_dom_element_js_1.REMOTION_STUDIO_CONTAINER_ELEMENT,
|
|
158
160
|
RenderAssetManager: RenderAssetManager_js_1.RenderAssetManager,
|
|
159
161
|
persistCurrentFrame: timeline_position_state_js_1.persistCurrentFrame,
|
|
@@ -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,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
|
-
|
|
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 =
|
|
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;
|
package/dist/cjs/version.d.ts
CHANGED
package/dist/cjs/version.js
CHANGED
package/dist/esm/index.mjs
CHANGED
|
@@ -110,7 +110,7 @@ function truthy(value) {
|
|
|
110
110
|
}
|
|
111
111
|
|
|
112
112
|
// src/version.ts
|
|
113
|
-
var VERSION = "4.0.
|
|
113
|
+
var VERSION = "4.0.376";
|
|
114
114
|
|
|
115
115
|
// src/multiple-versions-warning.ts
|
|
116
116
|
var checkMultipleRemotionVersions = () => {
|
|
@@ -586,6 +586,9 @@ var getInputProps = () => {
|
|
|
586
586
|
if (override) {
|
|
587
587
|
return override;
|
|
588
588
|
}
|
|
589
|
+
if (typeof window === "undefined" || typeof window.remotion_inputProps === "undefined") {
|
|
590
|
+
throw new Error("Cannot call `getInputProps()` - window.remotion_inputProps is not set. This API is only available if you are in the Studio, or while you are rendering server-side.");
|
|
591
|
+
}
|
|
589
592
|
const param = window.remotion_inputProps;
|
|
590
593
|
if (!param) {
|
|
591
594
|
return {};
|
|
@@ -748,7 +751,7 @@ var resolveVideoConfig = ({
|
|
|
748
751
|
calculateMetadata,
|
|
749
752
|
signal,
|
|
750
753
|
defaultProps,
|
|
751
|
-
originalProps,
|
|
754
|
+
inputProps: originalProps,
|
|
752
755
|
compositionId,
|
|
753
756
|
compositionDurationInFrames,
|
|
754
757
|
compositionFps,
|
|
@@ -854,7 +857,7 @@ var needsResolution = (composition) => {
|
|
|
854
857
|
return Boolean(composition.calculateMetadata);
|
|
855
858
|
};
|
|
856
859
|
var PROPS_UPDATED_EXTERNALLY = "remotion.propsUpdatedExternally";
|
|
857
|
-
var
|
|
860
|
+
var ResolveCompositionConfigInStudio = ({ children }) => {
|
|
858
861
|
const [currentRenderModalComposition, setCurrentRenderModalComposition] = useState4(null);
|
|
859
862
|
const { compositions, canvasContent, currentCompositionMetadata } = useContext4(CompositionManager);
|
|
860
863
|
const { fastRefreshes, manualRefreshes } = useContext4(NonceContext);
|
|
@@ -894,7 +897,7 @@ var ResolveCompositionConfig = ({ children }) => {
|
|
|
894
897
|
const result = resolveVideoConfigOrCatch({
|
|
895
898
|
compositionId,
|
|
896
899
|
calculateMetadata,
|
|
897
|
-
|
|
900
|
+
inputProps: combinedProps,
|
|
898
901
|
signal,
|
|
899
902
|
defaultProps,
|
|
900
903
|
compositionDurationInFrames,
|
|
@@ -1151,7 +1154,7 @@ var useResolvedVideoConfig = (preferredCompositionId) => {
|
|
|
1151
1154
|
props: {
|
|
1152
1155
|
...composition.defaultProps ?? {},
|
|
1153
1156
|
...selectedEditorProps ?? {},
|
|
1154
|
-
...typeof window === "undefined" || env.isPlayer ? {} : getInputProps() ?? {}
|
|
1157
|
+
...typeof window === "undefined" || env.isPlayer || !window.remotion_inputProps ? {} : getInputProps() ?? {}
|
|
1155
1158
|
},
|
|
1156
1159
|
defaultCodec: null,
|
|
1157
1160
|
defaultOutName: null,
|
|
@@ -1161,6 +1164,9 @@ var useResolvedVideoConfig = (preferredCompositionId) => {
|
|
|
1161
1164
|
}
|
|
1162
1165
|
};
|
|
1163
1166
|
}
|
|
1167
|
+
if (!context) {
|
|
1168
|
+
return null;
|
|
1169
|
+
}
|
|
1164
1170
|
if (!context[composition.id]) {
|
|
1165
1171
|
return null;
|
|
1166
1172
|
}
|
|
@@ -2346,16 +2352,18 @@ var AnimatedImage = forwardRef3(({
|
|
|
2346
2352
|
});
|
|
2347
2353
|
});
|
|
2348
2354
|
// src/Artifact.tsx
|
|
2349
|
-
import { useContext as useContext14,
|
|
2355
|
+
import { useContext as useContext14, useLayoutEffect as useLayoutEffect4, useState as useState9 } from "react";
|
|
2350
2356
|
|
|
2351
2357
|
// src/RenderAssetManager.tsx
|
|
2352
2358
|
import {
|
|
2353
2359
|
createContext as createContext12,
|
|
2354
2360
|
useCallback as useCallback6,
|
|
2361
|
+
useImperativeHandle as useImperativeHandle5,
|
|
2355
2362
|
useLayoutEffect as useLayoutEffect3,
|
|
2356
2363
|
useMemo as useMemo11,
|
|
2357
2364
|
useState as useState8
|
|
2358
2365
|
} from "react";
|
|
2366
|
+
import { flushSync } from "react-dom";
|
|
2359
2367
|
|
|
2360
2368
|
// src/validation/validate-artifact.ts
|
|
2361
2369
|
var validateArtifactFilename = (filename) => {
|
|
@@ -2399,7 +2407,7 @@ var RenderAssetManager = createContext12({
|
|
|
2399
2407
|
},
|
|
2400
2408
|
renderAssets: []
|
|
2401
2409
|
});
|
|
2402
|
-
var RenderAssetManagerProvider = ({ children }) => {
|
|
2410
|
+
var RenderAssetManagerProvider = ({ children, collectAssets }) => {
|
|
2403
2411
|
const [renderAssets, setRenderAssets] = useState8([]);
|
|
2404
2412
|
const registerRenderAsset = useCallback6((renderAsset) => {
|
|
2405
2413
|
validateRenderAsset(renderAsset);
|
|
@@ -2407,6 +2415,18 @@ var RenderAssetManagerProvider = ({ children }) => {
|
|
|
2407
2415
|
return [...assets, renderAsset];
|
|
2408
2416
|
});
|
|
2409
2417
|
}, []);
|
|
2418
|
+
if (collectAssets) {
|
|
2419
|
+
useImperativeHandle5(collectAssets, () => {
|
|
2420
|
+
return {
|
|
2421
|
+
collectAssets: () => {
|
|
2422
|
+
flushSync(() => {
|
|
2423
|
+
setRenderAssets([]);
|
|
2424
|
+
});
|
|
2425
|
+
return renderAssets;
|
|
2426
|
+
}
|
|
2427
|
+
};
|
|
2428
|
+
}, [renderAssets]);
|
|
2429
|
+
}
|
|
2410
2430
|
const unregisterRenderAsset = useCallback6((id) => {
|
|
2411
2431
|
setRenderAssets((assts) => {
|
|
2412
2432
|
return assts.filter((a) => a.id !== id);
|
|
@@ -2442,7 +2462,7 @@ var Artifact = ({ filename, content, downloadBehavior }) => {
|
|
|
2442
2462
|
const [id] = useState9(() => {
|
|
2443
2463
|
return String(Math.random());
|
|
2444
2464
|
});
|
|
2445
|
-
|
|
2465
|
+
useLayoutEffect4(() => {
|
|
2446
2466
|
if (!env.isRendering) {
|
|
2447
2467
|
return;
|
|
2448
2468
|
}
|
|
@@ -2597,7 +2617,7 @@ var playbackLogging = ({
|
|
|
2597
2617
|
};
|
|
2598
2618
|
|
|
2599
2619
|
// src/prefetch-state.tsx
|
|
2600
|
-
import { createContext as createContext14, useEffect as
|
|
2620
|
+
import { createContext as createContext14, useEffect as useEffect5, useState as useState10 } from "react";
|
|
2601
2621
|
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
2602
2622
|
var PreloadContext = createContext14({});
|
|
2603
2623
|
var preloads = {};
|
|
@@ -2608,7 +2628,7 @@ var setPreloads = (updater) => {
|
|
|
2608
2628
|
};
|
|
2609
2629
|
var PrefetchProvider = ({ children }) => {
|
|
2610
2630
|
const [_preloads, _setPreloads] = useState10(() => preloads);
|
|
2611
|
-
|
|
2631
|
+
useEffect5(() => {
|
|
2612
2632
|
const updaterFunction = () => {
|
|
2613
2633
|
_setPreloads(preloads);
|
|
2614
2634
|
};
|
|
@@ -2954,8 +2974,8 @@ var DurationsContextProvider = ({ children }) => {
|
|
|
2954
2974
|
import {
|
|
2955
2975
|
forwardRef as forwardRef4,
|
|
2956
2976
|
useContext as useContext25,
|
|
2957
|
-
useEffect as
|
|
2958
|
-
useImperativeHandle as
|
|
2977
|
+
useEffect as useEffect13,
|
|
2978
|
+
useImperativeHandle as useImperativeHandle6,
|
|
2959
2979
|
useMemo as useMemo21,
|
|
2960
2980
|
useRef as useRef12,
|
|
2961
2981
|
useState as useState15
|
|
@@ -2976,7 +2996,7 @@ var getCrossOriginValue = ({
|
|
|
2976
2996
|
};
|
|
2977
2997
|
|
|
2978
2998
|
// src/use-amplification.ts
|
|
2979
|
-
import { useContext as useContext17, useLayoutEffect as
|
|
2999
|
+
import { useContext as useContext17, useLayoutEffect as useLayoutEffect5, useRef as useRef7 } from "react";
|
|
2980
3000
|
|
|
2981
3001
|
// src/audio/shared-audio-tags.tsx
|
|
2982
3002
|
import React15, {
|
|
@@ -2984,7 +3004,7 @@ import React15, {
|
|
|
2984
3004
|
createRef as createRef2,
|
|
2985
3005
|
useCallback as useCallback7,
|
|
2986
3006
|
useContext as useContext16,
|
|
2987
|
-
useEffect as
|
|
3007
|
+
useEffect as useEffect6,
|
|
2988
3008
|
useMemo as useMemo15,
|
|
2989
3009
|
useRef as useRef5,
|
|
2990
3010
|
useState as useState11
|
|
@@ -3279,7 +3299,7 @@ var SharedAudioContextProvider = ({ children, numberOfAudioTags, audioLatencyHin
|
|
|
3279
3299
|
audios.current = [];
|
|
3280
3300
|
rerenderAudios();
|
|
3281
3301
|
}, [numberOfAudioTags, rerenderAudios]);
|
|
3282
|
-
|
|
3302
|
+
useEffect6(() => {
|
|
3283
3303
|
return () => {
|
|
3284
3304
|
resetAudio();
|
|
3285
3305
|
};
|
|
@@ -3484,7 +3504,7 @@ var useVolume = ({
|
|
|
3484
3504
|
}
|
|
3485
3505
|
const { audioContext } = sharedAudioContext;
|
|
3486
3506
|
if (typeof window !== "undefined") {
|
|
3487
|
-
|
|
3507
|
+
useLayoutEffect5(() => {
|
|
3488
3508
|
if (!audioContext) {
|
|
3489
3509
|
return;
|
|
3490
3510
|
}
|
|
@@ -3534,7 +3554,7 @@ var useVolume = ({
|
|
|
3534
3554
|
};
|
|
3535
3555
|
|
|
3536
3556
|
// src/use-media-in-timeline.ts
|
|
3537
|
-
import { useContext as useContext19, useEffect as
|
|
3557
|
+
import { useContext as useContext19, useEffect as useEffect7, useMemo as useMemo16, useState as useState12 } from "react";
|
|
3538
3558
|
|
|
3539
3559
|
// src/audio/use-audio-frame.ts
|
|
3540
3560
|
import { useContext as useContext18 } from "react";
|
|
@@ -3632,7 +3652,7 @@ var useBasicMediaInTimeline = ({
|
|
|
3632
3652
|
});
|
|
3633
3653
|
}).join(",");
|
|
3634
3654
|
}, [duration, startsAt, volume, mediaVolume]);
|
|
3635
|
-
|
|
3655
|
+
useEffect7(() => {
|
|
3636
3656
|
if (typeof volume === "number" && volume !== initialVolume) {
|
|
3637
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`);
|
|
3638
3658
|
}
|
|
@@ -3686,7 +3706,7 @@ var useMediaInTimeline = ({
|
|
|
3686
3706
|
trimBefore: undefined,
|
|
3687
3707
|
playbackRate
|
|
3688
3708
|
});
|
|
3689
|
-
|
|
3709
|
+
useEffect7(() => {
|
|
3690
3710
|
if (!src) {
|
|
3691
3711
|
throw new Error("No src passed");
|
|
3692
3712
|
}
|
|
@@ -3747,8 +3767,8 @@ var useMediaInTimeline = ({
|
|
|
3747
3767
|
import {
|
|
3748
3768
|
useCallback as useCallback10,
|
|
3749
3769
|
useContext as useContext22,
|
|
3750
|
-
useEffect as
|
|
3751
|
-
useLayoutEffect as
|
|
3770
|
+
useEffect as useEffect11,
|
|
3771
|
+
useLayoutEffect as useLayoutEffect7,
|
|
3752
3772
|
useRef as useRef11
|
|
3753
3773
|
} from "react";
|
|
3754
3774
|
|
|
@@ -3762,8 +3782,8 @@ import { useContext as useContext21, useMemo as useMemo18 } from "react";
|
|
|
3762
3782
|
import React16, {
|
|
3763
3783
|
useCallback as useCallback8,
|
|
3764
3784
|
useContext as useContext20,
|
|
3765
|
-
useEffect as
|
|
3766
|
-
useLayoutEffect as
|
|
3785
|
+
useEffect as useEffect8,
|
|
3786
|
+
useLayoutEffect as useLayoutEffect6,
|
|
3767
3787
|
useMemo as useMemo17,
|
|
3768
3788
|
useRef as useRef8,
|
|
3769
3789
|
useState as useState13
|
|
@@ -3804,7 +3824,7 @@ var useBufferManager = (logLevel, mountTime) => {
|
|
|
3804
3824
|
}
|
|
3805
3825
|
};
|
|
3806
3826
|
}, []);
|
|
3807
|
-
|
|
3827
|
+
useEffect8(() => {
|
|
3808
3828
|
if (blocks.length > 0) {
|
|
3809
3829
|
onBufferingCallbacks.forEach((c) => c());
|
|
3810
3830
|
playbackLogging({
|
|
@@ -3816,7 +3836,7 @@ var useBufferManager = (logLevel, mountTime) => {
|
|
|
3816
3836
|
}
|
|
3817
3837
|
}, [blocks]);
|
|
3818
3838
|
if (typeof window !== "undefined") {
|
|
3819
|
-
|
|
3839
|
+
useLayoutEffect6(() => {
|
|
3820
3840
|
if (blocks.length === 0) {
|
|
3821
3841
|
onResumeCallbacks.forEach((c) => c());
|
|
3822
3842
|
playbackLogging({
|
|
@@ -3843,7 +3863,7 @@ var BufferingProvider = ({ children }) => {
|
|
|
3843
3863
|
};
|
|
3844
3864
|
var useIsPlayerBuffering = (bufferManager) => {
|
|
3845
3865
|
const [isBuffering, setIsBuffering] = useState13(bufferManager.buffering.current);
|
|
3846
|
-
|
|
3866
|
+
useEffect8(() => {
|
|
3847
3867
|
const onBuffer = () => {
|
|
3848
3868
|
setIsBuffering(true);
|
|
3849
3869
|
};
|
|
@@ -4012,7 +4032,7 @@ var seek = ({
|
|
|
4012
4032
|
};
|
|
4013
4033
|
|
|
4014
4034
|
// src/use-media-buffering.ts
|
|
4015
|
-
import { useEffect as
|
|
4035
|
+
import { useEffect as useEffect9, useState as useState14 } from "react";
|
|
4016
4036
|
var useMediaBuffering = ({
|
|
4017
4037
|
element,
|
|
4018
4038
|
shouldBuffer,
|
|
@@ -4024,7 +4044,7 @@ var useMediaBuffering = ({
|
|
|
4024
4044
|
}) => {
|
|
4025
4045
|
const buffer = useBufferState();
|
|
4026
4046
|
const [isBuffering, setIsBuffering] = useState14(false);
|
|
4027
|
-
|
|
4047
|
+
useEffect9(() => {
|
|
4028
4048
|
let cleanupFns = [];
|
|
4029
4049
|
const { current } = element;
|
|
4030
4050
|
if (!current) {
|
|
@@ -4152,7 +4172,7 @@ var useMediaBuffering = ({
|
|
|
4152
4172
|
};
|
|
4153
4173
|
|
|
4154
4174
|
// src/use-request-video-callback-time.ts
|
|
4155
|
-
import { useEffect as
|
|
4175
|
+
import { useEffect as useEffect10, useRef as useRef10 } from "react";
|
|
4156
4176
|
var useRequestVideoCallbackTime = ({
|
|
4157
4177
|
mediaRef,
|
|
4158
4178
|
mediaType,
|
|
@@ -4160,7 +4180,7 @@ var useRequestVideoCallbackTime = ({
|
|
|
4160
4180
|
onVariableFpsVideoDetected
|
|
4161
4181
|
}) => {
|
|
4162
4182
|
const currentTime = useRef10(null);
|
|
4163
|
-
|
|
4183
|
+
useEffect10(() => {
|
|
4164
4184
|
const { current } = mediaRef;
|
|
4165
4185
|
if (current) {
|
|
4166
4186
|
currentTime.current = {
|
|
@@ -4454,7 +4474,7 @@ var useMediaPlayback = ({
|
|
|
4454
4474
|
return acceptableTimeshift ?? defaultAcceptableTimeshift;
|
|
4455
4475
|
})();
|
|
4456
4476
|
const isPlayerBuffering = useIsPlayerBuffering(buffering);
|
|
4457
|
-
|
|
4477
|
+
useEffect11(() => {
|
|
4458
4478
|
if (mediaRef.current?.paused) {
|
|
4459
4479
|
return;
|
|
4460
4480
|
}
|
|
@@ -4493,13 +4513,13 @@ var useMediaPlayback = ({
|
|
|
4493
4513
|
isPostmounting
|
|
4494
4514
|
]);
|
|
4495
4515
|
const env = useRemotionEnvironment();
|
|
4496
|
-
|
|
4516
|
+
useLayoutEffect7(() => {
|
|
4497
4517
|
const playbackRateToSet = Math.max(0, playbackRate);
|
|
4498
4518
|
if (mediaRef.current && mediaRef.current.playbackRate !== playbackRateToSet) {
|
|
4499
4519
|
mediaRef.current.playbackRate = playbackRateToSet;
|
|
4500
4520
|
}
|
|
4501
4521
|
}, [mediaRef, playbackRate]);
|
|
4502
|
-
|
|
4522
|
+
useEffect11(() => {
|
|
4503
4523
|
const tagName = mediaType === "audio" ? "<Html5Audio>" : "<Html5Video>";
|
|
4504
4524
|
if (!mediaRef.current) {
|
|
4505
4525
|
throw new Error(`No ${mediaType} ref found`);
|
|
@@ -4618,7 +4638,7 @@ var useMediaPlayback = ({
|
|
|
4618
4638
|
};
|
|
4619
4639
|
|
|
4620
4640
|
// src/use-media-tag.ts
|
|
4621
|
-
import { useContext as useContext23, useEffect as
|
|
4641
|
+
import { useContext as useContext23, useEffect as useEffect12 } from "react";
|
|
4622
4642
|
var useMediaTag = ({
|
|
4623
4643
|
mediaRef,
|
|
4624
4644
|
id,
|
|
@@ -4631,7 +4651,7 @@ var useMediaTag = ({
|
|
|
4631
4651
|
const logLevel = useLogLevel();
|
|
4632
4652
|
const mountTime = useMountTime();
|
|
4633
4653
|
const env = useRemotionEnvironment();
|
|
4634
|
-
|
|
4654
|
+
useEffect12(() => {
|
|
4635
4655
|
const tag = {
|
|
4636
4656
|
id,
|
|
4637
4657
|
play: (reason) => {
|
|
@@ -4843,12 +4863,12 @@ var AudioForDevelopmentForwardRefFunction = (props, ref) => {
|
|
|
4843
4863
|
volume: userPreferredVolume,
|
|
4844
4864
|
shouldUseWebAudioApi: useWebAudioApi ?? false
|
|
4845
4865
|
});
|
|
4846
|
-
|
|
4866
|
+
useImperativeHandle6(ref, () => {
|
|
4847
4867
|
return audioRef.current;
|
|
4848
4868
|
}, [audioRef]);
|
|
4849
4869
|
const currentOnDurationCallback = useRef12(onDuration);
|
|
4850
4870
|
currentOnDurationCallback.current = onDuration;
|
|
4851
|
-
|
|
4871
|
+
useEffect13(() => {
|
|
4852
4872
|
const { current } = audioRef;
|
|
4853
4873
|
if (!current) {
|
|
4854
4874
|
return;
|
|
@@ -4881,9 +4901,9 @@ var AudioForPreview = forwardRef4(AudioForDevelopmentForwardRefFunction);
|
|
|
4881
4901
|
import {
|
|
4882
4902
|
forwardRef as forwardRef5,
|
|
4883
4903
|
useContext as useContext26,
|
|
4884
|
-
useEffect as
|
|
4885
|
-
useImperativeHandle as
|
|
4886
|
-
useLayoutEffect as
|
|
4904
|
+
useEffect as useEffect14,
|
|
4905
|
+
useImperativeHandle as useImperativeHandle7,
|
|
4906
|
+
useLayoutEffect as useLayoutEffect8,
|
|
4887
4907
|
useMemo as useMemo22,
|
|
4888
4908
|
useRef as useRef13
|
|
4889
4909
|
} from "react";
|
|
@@ -4926,10 +4946,10 @@ var AudioForRenderingRefForwardingFunction = (props, ref) => {
|
|
|
4926
4946
|
mediaVolume: 1
|
|
4927
4947
|
});
|
|
4928
4948
|
warnAboutTooHighVolume(volume);
|
|
4929
|
-
|
|
4949
|
+
useImperativeHandle7(ref, () => {
|
|
4930
4950
|
return audioRef.current;
|
|
4931
4951
|
}, []);
|
|
4932
|
-
|
|
4952
|
+
useEffect14(() => {
|
|
4933
4953
|
if (!props.src) {
|
|
4934
4954
|
throw new Error("No src passed");
|
|
4935
4955
|
}
|
|
@@ -4973,7 +4993,7 @@ var AudioForRenderingRefForwardingFunction = (props, ref) => {
|
|
|
4973
4993
|
]);
|
|
4974
4994
|
const { src } = props;
|
|
4975
4995
|
const needsToRenderAudioTag = ref || _remotionInternalNeedsDurationCalculation;
|
|
4976
|
-
|
|
4996
|
+
useLayoutEffect8(() => {
|
|
4977
4997
|
if (window.process?.env?.NODE_ENV === "test") {
|
|
4978
4998
|
return;
|
|
4979
4999
|
}
|
|
@@ -5136,11 +5156,11 @@ var Html5Audio = forwardRef6(AudioRefForwardingFunction);
|
|
|
5136
5156
|
addSequenceStackTraces(Html5Audio);
|
|
5137
5157
|
var Audio = Html5Audio;
|
|
5138
5158
|
// src/Composition.tsx
|
|
5139
|
-
import { Suspense, useContext as useContext29, useEffect as
|
|
5159
|
+
import { Suspense, useContext as useContext29, useEffect as useEffect16 } from "react";
|
|
5140
5160
|
import { createPortal } from "react-dom";
|
|
5141
5161
|
|
|
5142
5162
|
// src/Folder.tsx
|
|
5143
|
-
import { createContext as createContext18, useContext as useContext28, useEffect as
|
|
5163
|
+
import { createContext as createContext18, useContext as useContext28, useEffect as useEffect15, useMemo as useMemo23 } from "react";
|
|
5144
5164
|
|
|
5145
5165
|
// src/validation/validate-folder-name.ts
|
|
5146
5166
|
var getRegex = () => /^([a-zA-Z0-9-\u4E00-\u9FFF])+$/g;
|
|
@@ -5176,7 +5196,7 @@ var Folder = ({ name, children }) => {
|
|
|
5176
5196
|
parentName
|
|
5177
5197
|
};
|
|
5178
5198
|
}, [name, parentName]);
|
|
5179
|
-
|
|
5199
|
+
useEffect15(() => {
|
|
5180
5200
|
registerFolder(name, parentName);
|
|
5181
5201
|
return () => {
|
|
5182
5202
|
unregisterFolder(name, parentName);
|
|
@@ -5331,7 +5351,7 @@ var validateDefaultAndInputProps = (defaultProps, name, compositionId) => {
|
|
|
5331
5351
|
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
5332
5352
|
var Fallback = () => {
|
|
5333
5353
|
const { continueRender: continueRender2, delayRender: delayRender2 } = useDelayRender();
|
|
5334
|
-
|
|
5354
|
+
useEffect16(() => {
|
|
5335
5355
|
const fallback = delayRender2("Waiting for Root component to unsuspend");
|
|
5336
5356
|
return () => continueRender2(fallback);
|
|
5337
5357
|
}, [continueRender2, delayRender2]);
|
|
@@ -5369,7 +5389,7 @@ var InnerComposition = ({
|
|
|
5369
5389
|
throw new Error("<Composition> mounted inside another composition. See https://remotion.dev/docs/wrong-composition-mount for help.");
|
|
5370
5390
|
}
|
|
5371
5391
|
const { folderName, parentName } = useContext29(FolderContext);
|
|
5372
|
-
|
|
5392
|
+
useEffect16(() => {
|
|
5373
5393
|
if (!id) {
|
|
5374
5394
|
throw new Error("No id for composition passed.");
|
|
5375
5395
|
}
|
|
@@ -5408,7 +5428,7 @@ var InnerComposition = ({
|
|
|
5408
5428
|
registerComposition,
|
|
5409
5429
|
unregisterComposition
|
|
5410
5430
|
]);
|
|
5411
|
-
|
|
5431
|
+
useEffect16(() => {
|
|
5412
5432
|
window.dispatchEvent(new CustomEvent(PROPS_UPDATED_EXTERNALLY, {
|
|
5413
5433
|
detail: {
|
|
5414
5434
|
resetUnsaved: id
|
|
@@ -5709,8 +5729,8 @@ import {
|
|
|
5709
5729
|
forwardRef as forwardRef8,
|
|
5710
5730
|
useCallback as useCallback13,
|
|
5711
5731
|
useContext as useContext30,
|
|
5712
|
-
useImperativeHandle as
|
|
5713
|
-
useLayoutEffect as
|
|
5732
|
+
useImperativeHandle as useImperativeHandle8,
|
|
5733
|
+
useLayoutEffect as useLayoutEffect9,
|
|
5714
5734
|
useRef as useRef14
|
|
5715
5735
|
} from "react";
|
|
5716
5736
|
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
@@ -5739,7 +5759,7 @@ var ImgRefForwarding = ({
|
|
|
5739
5759
|
if (!_propsValid) {
|
|
5740
5760
|
throw new Error("typecheck error");
|
|
5741
5761
|
}
|
|
5742
|
-
|
|
5762
|
+
useImperativeHandle8(ref, () => {
|
|
5743
5763
|
return imageRef.current;
|
|
5744
5764
|
}, []);
|
|
5745
5765
|
const actualSrc = usePreload(src);
|
|
@@ -5781,7 +5801,7 @@ var ImgRefForwarding = ({
|
|
|
5781
5801
|
if (typeof window !== "undefined") {
|
|
5782
5802
|
const isPremounting = Boolean(sequenceContext?.premounting);
|
|
5783
5803
|
const isPostmounting = Boolean(sequenceContext?.postmounting);
|
|
5784
|
-
|
|
5804
|
+
useLayoutEffect9(() => {
|
|
5785
5805
|
if (window.process?.env?.NODE_ENV === "test") {
|
|
5786
5806
|
if (imageRef.current) {
|
|
5787
5807
|
imageRef.current.src = actualSrc;
|
|
@@ -5870,7 +5890,7 @@ var compositionsRef = React25.createRef();
|
|
|
5870
5890
|
// src/CompositionManagerProvider.tsx
|
|
5871
5891
|
import {
|
|
5872
5892
|
useCallback as useCallback14,
|
|
5873
|
-
useImperativeHandle as
|
|
5893
|
+
useImperativeHandle as useImperativeHandle9,
|
|
5874
5894
|
useMemo as useMemo25,
|
|
5875
5895
|
useRef as useRef15,
|
|
5876
5896
|
useState as useState17
|
|
@@ -5924,7 +5944,7 @@ var CompositionManagerProvider = ({
|
|
|
5924
5944
|
return prevFolders.filter((p) => !(p.name === name && p.parent === parent));
|
|
5925
5945
|
});
|
|
5926
5946
|
}, []);
|
|
5927
|
-
|
|
5947
|
+
useImperativeHandle9(compositionsRef, () => {
|
|
5928
5948
|
return {
|
|
5929
5949
|
getCompositions: () => currentcompositionsRef.current
|
|
5930
5950
|
};
|
|
@@ -6035,6 +6055,10 @@ var getPreviewDomElement = () => {
|
|
|
6035
6055
|
return document.getElementById(REMOTION_STUDIO_CONTAINER_ELEMENT);
|
|
6036
6056
|
};
|
|
6037
6057
|
|
|
6058
|
+
// src/max-video-cache-size.ts
|
|
6059
|
+
import React26 from "react";
|
|
6060
|
+
var MaxMediaCacheSizeContext = React26.createContext(null);
|
|
6061
|
+
|
|
6038
6062
|
// src/register-root.ts
|
|
6039
6063
|
var Root = null;
|
|
6040
6064
|
var listeners = [];
|
|
@@ -6067,7 +6091,7 @@ var waitForRoot = (fn) => {
|
|
|
6067
6091
|
};
|
|
6068
6092
|
|
|
6069
6093
|
// src/RemotionRoot.tsx
|
|
6070
|
-
import { useEffect as
|
|
6094
|
+
import { useEffect as useEffect17, useMemo as useMemo27, useState as useState18 } from "react";
|
|
6071
6095
|
|
|
6072
6096
|
// src/use-media-enabled.tsx
|
|
6073
6097
|
import { createContext as createContext19, useContext as useContext31, useMemo as useMemo26 } from "react";
|
|
@@ -6107,7 +6131,7 @@ var MediaEnabledProvider = ({
|
|
|
6107
6131
|
|
|
6108
6132
|
// src/RemotionRoot.tsx
|
|
6109
6133
|
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
6110
|
-
var
|
|
6134
|
+
var RemotionRootContexts = ({
|
|
6111
6135
|
children,
|
|
6112
6136
|
numberOfAudioTags,
|
|
6113
6137
|
logLevel,
|
|
@@ -6133,7 +6157,7 @@ var RemotionRoot = ({
|
|
|
6133
6157
|
}
|
|
6134
6158
|
};
|
|
6135
6159
|
}, []);
|
|
6136
|
-
|
|
6160
|
+
useEffect17(() => {
|
|
6137
6161
|
if (typeof __webpack_module__ !== "undefined") {
|
|
6138
6162
|
if (__webpack_module__.hot) {
|
|
6139
6163
|
__webpack_module__.hot.addStatusHandler((status) => {
|
|
@@ -6161,16 +6185,12 @@ var RemotionRoot = ({
|
|
|
6161
6185
|
children: /* @__PURE__ */ jsx28(EditorPropsProvider, {
|
|
6162
6186
|
children: /* @__PURE__ */ jsx28(PrefetchProvider, {
|
|
6163
6187
|
children: /* @__PURE__ */ jsx28(SequenceManagerProvider, {
|
|
6164
|
-
children: /* @__PURE__ */ jsx28(
|
|
6165
|
-
|
|
6166
|
-
|
|
6167
|
-
|
|
6168
|
-
|
|
6169
|
-
children
|
|
6170
|
-
children: /* @__PURE__ */ jsx28(BufferingProvider, {
|
|
6171
|
-
children
|
|
6172
|
-
})
|
|
6173
|
-
})
|
|
6188
|
+
children: /* @__PURE__ */ jsx28(SharedAudioContextProvider, {
|
|
6189
|
+
numberOfAudioTags,
|
|
6190
|
+
audioLatencyHint,
|
|
6191
|
+
children: /* @__PURE__ */ jsx28(DurationsContextProvider, {
|
|
6192
|
+
children: /* @__PURE__ */ jsx28(BufferingProvider, {
|
|
6193
|
+
children
|
|
6174
6194
|
})
|
|
6175
6195
|
})
|
|
6176
6196
|
})
|
|
@@ -6212,8 +6232,8 @@ var setupEnvVariables = () => {
|
|
|
6212
6232
|
};
|
|
6213
6233
|
|
|
6214
6234
|
// src/use-current-scale.ts
|
|
6215
|
-
import
|
|
6216
|
-
var CurrentScaleContext =
|
|
6235
|
+
import React28, { createContext as createContext20 } from "react";
|
|
6236
|
+
var CurrentScaleContext = React28.createContext(null);
|
|
6217
6237
|
var PreviewSizeContext = createContext20({
|
|
6218
6238
|
setSize: () => {
|
|
6219
6239
|
return;
|
|
@@ -6238,8 +6258,8 @@ var calculateScale = ({
|
|
|
6238
6258
|
return Number(previewSize);
|
|
6239
6259
|
};
|
|
6240
6260
|
var useCurrentScale = (options) => {
|
|
6241
|
-
const hasContext =
|
|
6242
|
-
const zoomContext =
|
|
6261
|
+
const hasContext = React28.useContext(CurrentScaleContext);
|
|
6262
|
+
const zoomContext = React28.useContext(PreviewSizeContext);
|
|
6243
6263
|
const config = useUnsafeVideoConfig();
|
|
6244
6264
|
const env = useRemotionEnvironment();
|
|
6245
6265
|
if (hasContext === null || config === null || zoomContext === null) {
|
|
@@ -6275,8 +6295,8 @@ import { useCallback as useCallback16 } from "react";
|
|
|
6275
6295
|
import {
|
|
6276
6296
|
useCallback as useCallback15,
|
|
6277
6297
|
useContext as useContext32,
|
|
6278
|
-
useEffect as
|
|
6279
|
-
useLayoutEffect as
|
|
6298
|
+
useEffect as useEffect18,
|
|
6299
|
+
useLayoutEffect as useLayoutEffect10,
|
|
6280
6300
|
useMemo as useMemo28,
|
|
6281
6301
|
useState as useState19
|
|
6282
6302
|
} from "react";
|
|
@@ -6337,7 +6357,7 @@ var OffthreadVideoForRendering = ({
|
|
|
6337
6357
|
mediaVolume: 1
|
|
6338
6358
|
});
|
|
6339
6359
|
warnAboutTooHighVolume(volume);
|
|
6340
|
-
|
|
6360
|
+
useEffect18(() => {
|
|
6341
6361
|
if (!src) {
|
|
6342
6362
|
throw new Error("No src passed");
|
|
6343
6363
|
}
|
|
@@ -6394,7 +6414,7 @@ var OffthreadVideoForRendering = ({
|
|
|
6394
6414
|
}, [toneMapped, currentTime, src, transparent]);
|
|
6395
6415
|
const [imageSrc, setImageSrc] = useState19(null);
|
|
6396
6416
|
const { delayRender: delayRender2, continueRender: continueRender2 } = useDelayRender();
|
|
6397
|
-
|
|
6417
|
+
useLayoutEffect10(() => {
|
|
6398
6418
|
if (!window.remotion_videoEnabled) {
|
|
6399
6419
|
return;
|
|
6400
6420
|
}
|
|
@@ -6499,20 +6519,20 @@ var OffthreadVideoForRendering = ({
|
|
|
6499
6519
|
import {
|
|
6500
6520
|
forwardRef as forwardRef9,
|
|
6501
6521
|
useContext as useContext33,
|
|
6502
|
-
useEffect as
|
|
6503
|
-
useImperativeHandle as
|
|
6522
|
+
useEffect as useEffect20,
|
|
6523
|
+
useImperativeHandle as useImperativeHandle10,
|
|
6504
6524
|
useMemo as useMemo29,
|
|
6505
6525
|
useRef as useRef16,
|
|
6506
6526
|
useState as useState20
|
|
6507
6527
|
} from "react";
|
|
6508
6528
|
|
|
6509
6529
|
// src/video/emit-video-frame.ts
|
|
6510
|
-
import { useEffect as
|
|
6530
|
+
import { useEffect as useEffect19 } from "react";
|
|
6511
6531
|
var useEmitVideoFrame = ({
|
|
6512
6532
|
ref,
|
|
6513
6533
|
onVideoFrame
|
|
6514
6534
|
}) => {
|
|
6515
|
-
|
|
6535
|
+
useEffect19(() => {
|
|
6516
6536
|
const { current } = ref;
|
|
6517
6537
|
if (!current) {
|
|
6518
6538
|
return;
|
|
@@ -6653,7 +6673,7 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
|
|
|
6653
6673
|
duration,
|
|
6654
6674
|
fps
|
|
6655
6675
|
});
|
|
6656
|
-
|
|
6676
|
+
useImperativeHandle10(ref, () => {
|
|
6657
6677
|
return videoRef.current;
|
|
6658
6678
|
}, []);
|
|
6659
6679
|
useState20(() => playbackLogging({
|
|
@@ -6662,7 +6682,7 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
|
|
|
6662
6682
|
tag: "video",
|
|
6663
6683
|
mountTime
|
|
6664
6684
|
}));
|
|
6665
|
-
|
|
6685
|
+
useEffect20(() => {
|
|
6666
6686
|
const { current } = videoRef;
|
|
6667
6687
|
if (!current) {
|
|
6668
6688
|
return;
|
|
@@ -6693,7 +6713,7 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
|
|
|
6693
6713
|
const currentOnDurationCallback = useRef16(onDuration);
|
|
6694
6714
|
currentOnDurationCallback.current = onDuration;
|
|
6695
6715
|
useEmitVideoFrame({ ref: videoRef, onVideoFrame });
|
|
6696
|
-
|
|
6716
|
+
useEffect20(() => {
|
|
6697
6717
|
const { current } = videoRef;
|
|
6698
6718
|
if (!current) {
|
|
6699
6719
|
return;
|
|
@@ -6710,7 +6730,7 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
|
|
|
6710
6730
|
current.removeEventListener("loadedmetadata", onLoadedMetadata);
|
|
6711
6731
|
};
|
|
6712
6732
|
}, [src]);
|
|
6713
|
-
|
|
6733
|
+
useEffect20(() => {
|
|
6714
6734
|
const { current } = videoRef;
|
|
6715
6735
|
if (!current) {
|
|
6716
6736
|
return;
|
|
@@ -6939,21 +6959,21 @@ var watchStaticFile = (fileName, callback) => {
|
|
|
6939
6959
|
};
|
|
6940
6960
|
|
|
6941
6961
|
// src/wrap-remotion-context.tsx
|
|
6942
|
-
import
|
|
6962
|
+
import React32, { useMemo as useMemo30 } from "react";
|
|
6943
6963
|
import { jsx as jsx32 } from "react/jsx-runtime";
|
|
6944
6964
|
function useRemotionContexts() {
|
|
6945
|
-
const compositionManagerCtx =
|
|
6946
|
-
const timelineContext =
|
|
6947
|
-
const setTimelineContext =
|
|
6948
|
-
const sequenceContext =
|
|
6949
|
-
const nonceContext =
|
|
6950
|
-
const canUseRemotionHooksContext =
|
|
6951
|
-
const preloadContext =
|
|
6952
|
-
const resolveCompositionContext =
|
|
6953
|
-
const renderAssetManagerContext =
|
|
6954
|
-
const sequenceManagerContext =
|
|
6955
|
-
const bufferManagerContext =
|
|
6956
|
-
const 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);
|
|
6957
6977
|
return useMemo30(() => ({
|
|
6958
6978
|
compositionManagerCtx,
|
|
6959
6979
|
timelineContext,
|
|
@@ -7026,6 +7046,7 @@ var RemotionContextProvider = (props2) => {
|
|
|
7026
7046
|
// src/internals.ts
|
|
7027
7047
|
var compositionSelectorRef = createRef3();
|
|
7028
7048
|
var Internals = {
|
|
7049
|
+
MaxMediaCacheSizeContext,
|
|
7029
7050
|
useUnsafeVideoConfig,
|
|
7030
7051
|
useFrameForVolumeProp,
|
|
7031
7052
|
useTimelinePosition,
|
|
@@ -7040,7 +7061,7 @@ var Internals = {
|
|
|
7040
7061
|
CompositionSetters,
|
|
7041
7062
|
SequenceManager,
|
|
7042
7063
|
SequenceVisibilityToggleContext,
|
|
7043
|
-
|
|
7064
|
+
RemotionRootContexts,
|
|
7044
7065
|
CompositionManagerProvider,
|
|
7045
7066
|
useVideo,
|
|
7046
7067
|
getRoot,
|
|
@@ -7081,7 +7102,7 @@ var Internals = {
|
|
|
7081
7102
|
resolveVideoConfig,
|
|
7082
7103
|
useResolvedVideoConfig,
|
|
7083
7104
|
resolveCompositionsRef,
|
|
7084
|
-
|
|
7105
|
+
ResolveCompositionConfigInStudio,
|
|
7085
7106
|
REMOTION_STUDIO_CONTAINER_ELEMENT,
|
|
7086
7107
|
RenderAssetManager,
|
|
7087
7108
|
persistCurrentFrame,
|
|
@@ -7118,7 +7139,8 @@ var Internals = {
|
|
|
7118
7139
|
useIsPlayerBuffering,
|
|
7119
7140
|
TimelinePosition: exports_timeline_position_state,
|
|
7120
7141
|
DelayRenderContextType,
|
|
7121
|
-
TimelineContext
|
|
7142
|
+
TimelineContext,
|
|
7143
|
+
RenderAssetManagerProvider
|
|
7122
7144
|
};
|
|
7123
7145
|
// src/interpolate-colors.ts
|
|
7124
7146
|
var NUMBER = "[-+]?\\d*\\.?\\d+";
|
|
@@ -7487,11 +7509,11 @@ var validateFrame = ({
|
|
|
7487
7509
|
import { Children, forwardRef as forwardRef10, useMemo as useMemo31 } from "react";
|
|
7488
7510
|
|
|
7489
7511
|
// src/series/flatten-children.tsx
|
|
7490
|
-
import
|
|
7512
|
+
import React33 from "react";
|
|
7491
7513
|
var flattenChildren = (children) => {
|
|
7492
|
-
const childrenArray =
|
|
7514
|
+
const childrenArray = React33.Children.toArray(children);
|
|
7493
7515
|
return childrenArray.reduce((flatChildren, child) => {
|
|
7494
|
-
if (child.type ===
|
|
7516
|
+
if (child.type === React33.Fragment) {
|
|
7495
7517
|
return flatChildren.concat(flattenChildren(child.props.children));
|
|
7496
7518
|
}
|
|
7497
7519
|
flatChildren.push(child);
|
|
@@ -7500,7 +7522,7 @@ var flattenChildren = (children) => {
|
|
|
7500
7522
|
};
|
|
7501
7523
|
|
|
7502
7524
|
// src/series/is-inside-series.tsx
|
|
7503
|
-
import
|
|
7525
|
+
import React34, { createContext as createContext21 } from "react";
|
|
7504
7526
|
import { jsx as jsx33 } from "react/jsx-runtime";
|
|
7505
7527
|
var IsInsideSeriesContext = createContext21(false);
|
|
7506
7528
|
var IsInsideSeriesContainer = ({ children }) => {
|
|
@@ -7516,7 +7538,7 @@ var IsNotInsideSeriesProvider = ({ children }) => {
|
|
|
7516
7538
|
});
|
|
7517
7539
|
};
|
|
7518
7540
|
var useRequireToBeInsideSeries = () => {
|
|
7519
|
-
const isInsideSeries =
|
|
7541
|
+
const isInsideSeries = React34.useContext(IsInsideSeriesContext);
|
|
7520
7542
|
if (!isInsideSeries) {
|
|
7521
7543
|
throw new Error("This component must be inside a <Series /> component.");
|
|
7522
7544
|
}
|
|
@@ -7931,14 +7953,14 @@ var staticFile = (path) => {
|
|
|
7931
7953
|
return preparsed;
|
|
7932
7954
|
};
|
|
7933
7955
|
// src/Still.tsx
|
|
7934
|
-
import
|
|
7956
|
+
import React36 from "react";
|
|
7935
7957
|
var Still = (props2) => {
|
|
7936
7958
|
const newProps = {
|
|
7937
7959
|
...props2,
|
|
7938
7960
|
durationInFrames: 1,
|
|
7939
7961
|
fps: 1
|
|
7940
7962
|
};
|
|
7941
|
-
return
|
|
7963
|
+
return React36.createElement(Composition, newProps);
|
|
7942
7964
|
};
|
|
7943
7965
|
// src/video/Video.tsx
|
|
7944
7966
|
import { forwardRef as forwardRef12, useCallback as useCallback17, useContext as useContext35 } from "react";
|
|
@@ -7947,9 +7969,9 @@ import { forwardRef as forwardRef12, useCallback as useCallback17, useContext as
|
|
|
7947
7969
|
import {
|
|
7948
7970
|
forwardRef as forwardRef11,
|
|
7949
7971
|
useContext as useContext34,
|
|
7950
|
-
useEffect as
|
|
7951
|
-
useImperativeHandle as
|
|
7952
|
-
useLayoutEffect as
|
|
7972
|
+
useEffect as useEffect21,
|
|
7973
|
+
useImperativeHandle as useImperativeHandle11,
|
|
7974
|
+
useLayoutEffect as useLayoutEffect11,
|
|
7953
7975
|
useMemo as useMemo32,
|
|
7954
7976
|
useRef as useRef17
|
|
7955
7977
|
} from "react";
|
|
@@ -8122,7 +8144,7 @@ var VideoForRenderingForwardFunction = ({
|
|
|
8122
8144
|
mediaVolume: 1
|
|
8123
8145
|
});
|
|
8124
8146
|
warnAboutTooHighVolume(volume);
|
|
8125
|
-
|
|
8147
|
+
useEffect21(() => {
|
|
8126
8148
|
if (!props2.src) {
|
|
8127
8149
|
throw new Error("No src passed");
|
|
8128
8150
|
}
|
|
@@ -8162,10 +8184,10 @@ var VideoForRenderingForwardFunction = ({
|
|
|
8162
8184
|
sequenceContext?.relativeFrom,
|
|
8163
8185
|
audioStreamIndex
|
|
8164
8186
|
]);
|
|
8165
|
-
|
|
8187
|
+
useImperativeHandle11(ref, () => {
|
|
8166
8188
|
return videoRef.current;
|
|
8167
8189
|
}, []);
|
|
8168
|
-
|
|
8190
|
+
useEffect21(() => {
|
|
8169
8191
|
if (!window.remotion_videoEnabled) {
|
|
8170
8192
|
return;
|
|
8171
8193
|
}
|
|
@@ -8249,7 +8271,7 @@ var VideoForRenderingForwardFunction = ({
|
|
|
8249
8271
|
]);
|
|
8250
8272
|
const { src } = props2;
|
|
8251
8273
|
if (environment.isRendering) {
|
|
8252
|
-
|
|
8274
|
+
useLayoutEffect11(() => {
|
|
8253
8275
|
if (window.process?.env?.NODE_ENV === "test") {
|
|
8254
8276
|
return;
|
|
8255
8277
|
}
|
package/dist/esm/version.mjs
CHANGED
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.
|
|
6
|
+
"version": "4.0.376",
|
|
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.
|
|
37
|
+
"@remotion/eslint-config-internal": "4.0.376",
|
|
38
38
|
"eslint": "9.19.0"
|
|
39
39
|
},
|
|
40
40
|
"keywords": [
|