@remotion/promo-pages 4.0.344 → 4.0.345
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/.turbo/turbo-make.log +2 -2
- package/dist/Homepage.js +332 -273
- package/package.json +10 -10
- package/src/components/homepage/Demo/DisplayedEmoji.tsx +3 -7
package/dist/Homepage.js
CHANGED
|
@@ -19,12 +19,13 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
|
|
|
19
19
|
|
|
20
20
|
// ../core/dist/esm/index.mjs
|
|
21
21
|
import { createContext } from "react";
|
|
22
|
+
import React22 from "react";
|
|
22
23
|
import React4 from "react";
|
|
23
24
|
import { createContext as createContext2, useContext } from "react";
|
|
24
25
|
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
25
26
|
import {
|
|
26
27
|
forwardRef as forwardRef2,
|
|
27
|
-
useContext as
|
|
28
|
+
useContext as useContext11,
|
|
28
29
|
useEffect as useEffect3,
|
|
29
30
|
useMemo as useMemo9,
|
|
30
31
|
useState as useState5
|
|
@@ -32,24 +33,24 @@ import {
|
|
|
32
33
|
import { forwardRef, useMemo as useMemo2 } from "react";
|
|
33
34
|
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
34
35
|
import { createContext as createContext3 } from "react";
|
|
35
|
-
import
|
|
36
|
+
import React42, { useCallback as useCallback2, useMemo as useMemo22, useState as useState2 } from "react";
|
|
36
37
|
import { jsx as jsx32 } from "react/jsx-runtime";
|
|
37
38
|
import { createContext as createContext4, useContext as useContext2, useEffect as useEffect2, useRef, useState as useState22 } from "react";
|
|
38
|
-
import { createContext as createContext8, useContext as
|
|
39
|
-
import { useState as useState3 } from "react";
|
|
40
|
-
import { useContext as
|
|
39
|
+
import { createContext as createContext8, useContext as useContext6, useMemo as useMemo6 } from "react";
|
|
40
|
+
import { useContext as useContext3, useState as useState3 } from "react";
|
|
41
|
+
import { useContext as useContext5, useMemo as useMemo5 } from "react";
|
|
41
42
|
import { createContext as createContext5 } from "react";
|
|
42
43
|
import {
|
|
43
44
|
createContext as createContext7,
|
|
44
45
|
createRef,
|
|
45
46
|
useCallback as useCallback3,
|
|
46
|
-
useContext as
|
|
47
|
+
useContext as useContext4,
|
|
47
48
|
useEffect as useEffect22,
|
|
48
49
|
useImperativeHandle as useImperativeHandle2,
|
|
49
50
|
useMemo as useMemo4,
|
|
50
51
|
useState as useState4
|
|
51
52
|
} from "react";
|
|
52
|
-
import
|
|
53
|
+
import React5, {
|
|
53
54
|
createContext as createContext6,
|
|
54
55
|
useCallback as useCallback22,
|
|
55
56
|
useImperativeHandle,
|
|
@@ -57,12 +58,12 @@ import React42, {
|
|
|
57
58
|
} from "react";
|
|
58
59
|
import { jsx as jsx42 } from "react/jsx-runtime";
|
|
59
60
|
import { jsx as jsx52 } from "react/jsx-runtime";
|
|
60
|
-
import { useContext as
|
|
61
|
+
import { useContext as useContext8 } from "react";
|
|
61
62
|
import { createContext as createContext9 } from "react";
|
|
62
63
|
import { jsx as jsx62 } from "react/jsx-runtime";
|
|
63
|
-
import { useContext as
|
|
64
|
-
import { useContext as
|
|
65
|
-
import { useContext as
|
|
64
|
+
import { useContext as useContext7, useMemo as useMemo7 } from "react";
|
|
65
|
+
import { useContext as useContext10, useMemo as useMemo8 } from "react";
|
|
66
|
+
import { useContext as useContext9 } from "react";
|
|
66
67
|
import { jsx as jsx72 } from "react/jsx-runtime";
|
|
67
68
|
import { jsx as jsx82 } from "react/jsx-runtime";
|
|
68
69
|
import {
|
|
@@ -73,29 +74,30 @@ import {
|
|
|
73
74
|
useRef as useRef3,
|
|
74
75
|
useState as useState6
|
|
75
76
|
} from "react";
|
|
76
|
-
import
|
|
77
|
+
import { useCallback as useCallback4 } from "react";
|
|
78
|
+
import React9, { useCallback as useCallback5, useImperativeHandle as useImperativeHandle3, useRef as useRef2 } from "react";
|
|
77
79
|
import { jsx as jsx92 } from "react/jsx-runtime";
|
|
78
80
|
import { jsx as jsx102 } from "react/jsx-runtime";
|
|
79
|
-
import { useContext as
|
|
81
|
+
import { useContext as useContext12, useEffect as useEffect5, useState as useState8 } from "react";
|
|
80
82
|
import {
|
|
81
83
|
createContext as createContext10,
|
|
82
|
-
useCallback as
|
|
84
|
+
useCallback as useCallback6,
|
|
83
85
|
useLayoutEffect as useLayoutEffect2,
|
|
84
86
|
useMemo as useMemo10,
|
|
85
87
|
useState as useState7
|
|
86
88
|
} from "react";
|
|
87
89
|
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
88
|
-
import { forwardRef as forwardRef6, useCallback as
|
|
89
|
-
import
|
|
90
|
+
import { forwardRef as forwardRef6, useCallback as useCallback11, useContext as useContext25 } from "react";
|
|
91
|
+
import React10, { createContext as createContext11, useMemo as useMemo11 } from "react";
|
|
90
92
|
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
91
|
-
import { useContext as
|
|
93
|
+
import { useContext as useContext13 } from "react";
|
|
92
94
|
import { createContext as createContext12, useEffect as useEffect6, useState as useState9 } from "react";
|
|
93
95
|
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
94
96
|
import { createContext as createContext13, useMemo as useMemo12, useReducer } from "react";
|
|
95
97
|
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
96
98
|
import {
|
|
97
99
|
forwardRef as forwardRef4,
|
|
98
|
-
useContext as
|
|
100
|
+
useContext as useContext23,
|
|
99
101
|
useEffect as useEffect13,
|
|
100
102
|
useImperativeHandle as useImperativeHandle5,
|
|
101
103
|
useMemo as useMemo20,
|
|
@@ -103,13 +105,13 @@ import {
|
|
|
103
105
|
useState as useState14
|
|
104
106
|
} from "react";
|
|
105
107
|
import { createContext as createContext14 } from "react";
|
|
106
|
-
import * as
|
|
107
|
-
import { useContext as
|
|
108
|
-
import
|
|
108
|
+
import * as React13 from "react";
|
|
109
|
+
import { useContext as useContext16, useLayoutEffect as useLayoutEffect3, useRef as useRef6 } from "react";
|
|
110
|
+
import React14, {
|
|
109
111
|
createContext as createContext15,
|
|
110
112
|
createRef as createRef2,
|
|
111
|
-
useCallback as
|
|
112
|
-
useContext as
|
|
113
|
+
useCallback as useCallback7,
|
|
114
|
+
useContext as useContext15,
|
|
113
115
|
useEffect as useEffect7,
|
|
114
116
|
useMemo as useMemo14,
|
|
115
117
|
useRef as useRef4,
|
|
@@ -118,20 +120,20 @@ import React13, {
|
|
|
118
120
|
import { useMemo as useMemo13 } from "react";
|
|
119
121
|
import { jsx as jsx15, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
120
122
|
import { useRef as useRef5 } from "react";
|
|
121
|
-
import { useContext as
|
|
122
|
-
import { useContext as
|
|
123
|
+
import { useContext as useContext18, useEffect as useEffect8, useMemo as useMemo15, useState as useState11 } from "react";
|
|
124
|
+
import { useContext as useContext17 } from "react";
|
|
123
125
|
import {
|
|
124
|
-
useCallback as
|
|
125
|
-
useContext as
|
|
126
|
+
useCallback as useCallback10,
|
|
127
|
+
useContext as useContext21,
|
|
126
128
|
useEffect as useEffect12,
|
|
127
129
|
useLayoutEffect as useLayoutEffect5,
|
|
128
130
|
useRef as useRef10
|
|
129
131
|
} from "react";
|
|
130
|
-
import { useCallback as
|
|
131
|
-
import { useContext as
|
|
132
|
-
import
|
|
133
|
-
useCallback as
|
|
134
|
-
useContext as
|
|
132
|
+
import { useCallback as useCallback9, useMemo as useMemo18, useRef as useRef8 } from "react";
|
|
133
|
+
import { useContext as useContext20, useMemo as useMemo17 } from "react";
|
|
134
|
+
import React15, {
|
|
135
|
+
useCallback as useCallback8,
|
|
136
|
+
useContext as useContext19,
|
|
135
137
|
useEffect as useEffect9,
|
|
136
138
|
useLayoutEffect as useLayoutEffect4,
|
|
137
139
|
useMemo as useMemo16,
|
|
@@ -139,14 +141,14 @@ import React14, {
|
|
|
139
141
|
useState as useState12
|
|
140
142
|
} from "react";
|
|
141
143
|
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
142
|
-
import
|
|
144
|
+
import React16 from "react";
|
|
143
145
|
import { useEffect as useEffect10, useState as useState13 } from "react";
|
|
144
146
|
import { useEffect as useEffect11, useRef as useRef9 } from "react";
|
|
145
|
-
import { createContext as createContext16, useContext as
|
|
147
|
+
import { createContext as createContext16, useContext as useContext22, useMemo as useMemo19 } from "react";
|
|
146
148
|
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
147
149
|
import {
|
|
148
150
|
forwardRef as forwardRef5,
|
|
149
|
-
useContext as
|
|
151
|
+
useContext as useContext24,
|
|
150
152
|
useEffect as useEffect14,
|
|
151
153
|
useImperativeHandle as useImperativeHandle6,
|
|
152
154
|
useLayoutEffect as useLayoutEffect6,
|
|
@@ -155,27 +157,27 @@ import {
|
|
|
155
157
|
} from "react";
|
|
156
158
|
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
157
159
|
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
158
|
-
import { Suspense, useContext as
|
|
160
|
+
import { Suspense, useContext as useContext27, useEffect as useEffect16 } from "react";
|
|
159
161
|
import { createPortal } from "react-dom";
|
|
160
|
-
import { createContext as createContext17, useContext as
|
|
162
|
+
import { createContext as createContext17, useContext as useContext26, useEffect as useEffect15, useMemo as useMemo222 } from "react";
|
|
161
163
|
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
162
164
|
import { jsx as jsx21, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
163
|
-
import
|
|
165
|
+
import React20, { useMemo as useMemo23 } from "react";
|
|
164
166
|
import { jsx as jsx222 } from "react/jsx-runtime";
|
|
165
|
-
import { forwardRef as forwardRef7, useCallback as
|
|
167
|
+
import { forwardRef as forwardRef7, useCallback as useCallback12, useState as useState15 } from "react";
|
|
166
168
|
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
167
169
|
import {
|
|
168
170
|
forwardRef as forwardRef8,
|
|
169
|
-
useCallback as
|
|
170
|
-
useContext as
|
|
171
|
+
useCallback as useCallback13,
|
|
172
|
+
useContext as useContext28,
|
|
171
173
|
useImperativeHandle as useImperativeHandle7,
|
|
172
174
|
useLayoutEffect as useLayoutEffect7,
|
|
173
175
|
useRef as useRef13
|
|
174
176
|
} from "react";
|
|
175
177
|
import { jsx as jsx24 } from "react/jsx-runtime";
|
|
176
178
|
import { createRef as createRef3 } from "react";
|
|
177
|
-
import
|
|
178
|
-
useCallback as
|
|
179
|
+
import React24, {
|
|
180
|
+
useCallback as useCallback14,
|
|
179
181
|
useImperativeHandle as useImperativeHandle8,
|
|
180
182
|
useMemo as useMemo24,
|
|
181
183
|
useRef as useRef14,
|
|
@@ -190,10 +192,10 @@ import {
|
|
|
190
192
|
useState as useState17
|
|
191
193
|
} from "react";
|
|
192
194
|
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
193
|
-
import
|
|
195
|
+
import React26, { createContext as createContext18 } from "react";
|
|
194
196
|
import {
|
|
195
197
|
forwardRef as forwardRef9,
|
|
196
|
-
useContext as
|
|
198
|
+
useContext as useContext29,
|
|
197
199
|
useEffect as useEffect19,
|
|
198
200
|
useImperativeHandle as useImperativeHandle9,
|
|
199
201
|
useMemo as useMemo26,
|
|
@@ -202,19 +204,18 @@ import {
|
|
|
202
204
|
} from "react";
|
|
203
205
|
import { useEffect as useEffect18 } from "react";
|
|
204
206
|
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
205
|
-
import
|
|
207
|
+
import React28, { useMemo as useMemo27 } from "react";
|
|
206
208
|
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
207
209
|
import { Children, forwardRef as forwardRef10, useMemo as useMemo28 } from "react";
|
|
208
|
-
import
|
|
209
|
-
import
|
|
210
|
+
import React29 from "react";
|
|
211
|
+
import React30, { createContext as createContext19 } from "react";
|
|
210
212
|
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
211
213
|
import { jsx as jsx30 } from "react/jsx-runtime";
|
|
212
|
-
import
|
|
213
|
-
import { useCallback as useCallback14 } from "react";
|
|
214
|
+
import React32 from "react";
|
|
214
215
|
import { useCallback as useCallback16 } from "react";
|
|
215
216
|
import {
|
|
216
217
|
useCallback as useCallback15,
|
|
217
|
-
useContext as
|
|
218
|
+
useContext as useContext30,
|
|
218
219
|
useEffect as useEffect20,
|
|
219
220
|
useLayoutEffect as useLayoutEffect9,
|
|
220
221
|
useMemo as useMemo29,
|
|
@@ -222,10 +223,10 @@ import {
|
|
|
222
223
|
} from "react";
|
|
223
224
|
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
224
225
|
import { jsx as jsx322 } from "react/jsx-runtime";
|
|
225
|
-
import { forwardRef as forwardRef12, useCallback as useCallback17, useContext as
|
|
226
|
+
import { forwardRef as forwardRef12, useCallback as useCallback17, useContext as useContext32 } from "react";
|
|
226
227
|
import {
|
|
227
228
|
forwardRef as forwardRef11,
|
|
228
|
-
useContext as
|
|
229
|
+
useContext as useContext31,
|
|
229
230
|
useEffect as useEffect21,
|
|
230
231
|
useImperativeHandle as useImperativeHandle10,
|
|
231
232
|
useLayoutEffect as useLayoutEffect10,
|
|
@@ -438,18 +439,18 @@ function exponentialBackoff(errorCount) {
|
|
|
438
439
|
return 1000 * 2 ** (errorCount - 1);
|
|
439
440
|
}
|
|
440
441
|
function useRemotionContexts() {
|
|
441
|
-
const compositionManagerCtx =
|
|
442
|
-
const timelineContext =
|
|
443
|
-
const setTimelineContext =
|
|
444
|
-
const sequenceContext =
|
|
445
|
-
const nonceContext =
|
|
446
|
-
const canUseRemotionHooksContext =
|
|
447
|
-
const preloadContext =
|
|
448
|
-
const resolveCompositionContext =
|
|
449
|
-
const renderAssetManagerContext =
|
|
450
|
-
const sequenceManagerContext =
|
|
451
|
-
const bufferManagerContext =
|
|
452
|
-
const logLevelContext =
|
|
442
|
+
const compositionManagerCtx = React28.useContext(CompositionManager);
|
|
443
|
+
const timelineContext = React28.useContext(TimelineContext);
|
|
444
|
+
const setTimelineContext = React28.useContext(SetTimelineContext);
|
|
445
|
+
const sequenceContext = React28.useContext(SequenceContext);
|
|
446
|
+
const nonceContext = React28.useContext(NonceContext);
|
|
447
|
+
const canUseRemotionHooksContext = React28.useContext(CanUseRemotionHooks);
|
|
448
|
+
const preloadContext = React28.useContext(PreloadContext);
|
|
449
|
+
const resolveCompositionContext = React28.useContext(ResolveCompositionContext);
|
|
450
|
+
const renderAssetManagerContext = React28.useContext(RenderAssetManager);
|
|
451
|
+
const sequenceManagerContext = React28.useContext(SequenceManager);
|
|
452
|
+
const bufferManagerContext = React28.useContext(BufferingContextReact);
|
|
453
|
+
const logLevelContext = React28.useContext(LogLevelContext);
|
|
453
454
|
return useMemo27(() => ({
|
|
454
455
|
compositionManagerCtx,
|
|
455
456
|
timelineContext,
|
|
@@ -705,9 +706,10 @@ var __defProp2, __export2 = (target, all) => {
|
|
|
705
706
|
isStudio,
|
|
706
707
|
isRendering,
|
|
707
708
|
isPlayer,
|
|
708
|
-
isReadOnlyStudio
|
|
709
|
+
isReadOnlyStudio,
|
|
710
|
+
isClientSideRendering: false
|
|
709
711
|
};
|
|
710
|
-
}, originalCreateElement, componentsToAddStacksTo, enableSequenceStackTraces = () => {
|
|
712
|
+
}, RemotionEnvironmentContext, originalCreateElement, componentsToAddStacksTo, enableSequenceStackTraces = () => {
|
|
711
713
|
if (!getRemotionEnvironment().isStudio) {
|
|
712
714
|
return;
|
|
713
715
|
}
|
|
@@ -724,7 +726,7 @@ var __defProp2, __export2 = (target, all) => {
|
|
|
724
726
|
return Reflect.apply(target, thisArg, argArray);
|
|
725
727
|
}
|
|
726
728
|
});
|
|
727
|
-
|
|
729
|
+
React22.createElement = proxy;
|
|
728
730
|
}, addSequenceStackTraces = (component) => {
|
|
729
731
|
componentsToAddStacksTo.push(component);
|
|
730
732
|
enableSequenceStackTraces();
|
|
@@ -737,7 +739,7 @@ var __defProp2, __export2 = (target, all) => {
|
|
|
737
739
|
});
|
|
738
740
|
}, useIsPlayer = () => {
|
|
739
741
|
return useContext(IsPlayerContext);
|
|
740
|
-
}, VERSION = "4.0.
|
|
742
|
+
}, VERSION = "4.0.345", checkMultipleRemotionVersions = () => {
|
|
741
743
|
if (typeof globalThis === "undefined") {
|
|
742
744
|
return;
|
|
743
745
|
}
|
|
@@ -896,10 +898,11 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
896
898
|
}, [context]);
|
|
897
899
|
return nonce;
|
|
898
900
|
}, exports_timeline_position_state, useRemotionEnvironment = () => {
|
|
901
|
+
const context = useContext3(RemotionEnvironmentContext);
|
|
899
902
|
const [env] = useState3(() => getRemotionEnvironment());
|
|
900
|
-
return env;
|
|
903
|
+
return context ?? env;
|
|
901
904
|
}, CompositionManager, CompositionSetters, EditorPropsContext, editorPropsProviderRef, timeValueRef, EditorPropsProvider = ({ children }) => {
|
|
902
|
-
const [props, setProps] =
|
|
905
|
+
const [props, setProps] = React5.useState({});
|
|
903
906
|
const updateProps = useCallback22(({
|
|
904
907
|
defaultProps,
|
|
905
908
|
id,
|
|
@@ -1147,14 +1150,14 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
1147
1150
|
return Boolean(composition.calculateMetadata);
|
|
1148
1151
|
}, PROPS_UPDATED_EXTERNALLY = "remotion.propsUpdatedExternally", ResolveCompositionConfig = ({ children }) => {
|
|
1149
1152
|
const [currentRenderModalComposition, setCurrentRenderModalComposition] = useState4(null);
|
|
1150
|
-
const { compositions, canvasContent, currentCompositionMetadata } =
|
|
1151
|
-
const { fastRefreshes, manualRefreshes } =
|
|
1153
|
+
const { compositions, canvasContent, currentCompositionMetadata } = useContext4(CompositionManager);
|
|
1154
|
+
const { fastRefreshes, manualRefreshes } = useContext4(NonceContext);
|
|
1152
1155
|
if (manualRefreshes) {}
|
|
1153
1156
|
const selectedComposition = useMemo4(() => {
|
|
1154
1157
|
return compositions.find((c) => canvasContent && canvasContent.type === "composition" && canvasContent.compositionId === c.id);
|
|
1155
1158
|
}, [canvasContent, compositions]);
|
|
1156
1159
|
const renderModalComposition = compositions.find((c) => c.id === currentRenderModalComposition);
|
|
1157
|
-
const { props: allEditorProps } =
|
|
1160
|
+
const { props: allEditorProps } = useContext4(EditorPropsContext);
|
|
1158
1161
|
const env = useRemotionEnvironment();
|
|
1159
1162
|
const inputProps = useMemo4(() => {
|
|
1160
1163
|
return typeof window === "undefined" || env.isPlayer ? {} : getInputProps() ?? {};
|
|
@@ -1397,9 +1400,9 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
1397
1400
|
children
|
|
1398
1401
|
});
|
|
1399
1402
|
}, useResolvedVideoConfig = (preferredCompositionId) => {
|
|
1400
|
-
const context =
|
|
1401
|
-
const { props: allEditorProps } =
|
|
1402
|
-
const { compositions, canvasContent, currentCompositionMetadata } =
|
|
1403
|
+
const context = useContext4(ResolveCompositionContext);
|
|
1404
|
+
const { props: allEditorProps } = useContext4(EditorPropsContext);
|
|
1405
|
+
const { compositions, canvasContent, currentCompositionMetadata } = useContext4(CompositionManager);
|
|
1403
1406
|
const currentComposition = canvasContent?.type === "composition" ? canvasContent.compositionId : null;
|
|
1404
1407
|
const compositionId = preferredCompositionId ?? currentComposition;
|
|
1405
1408
|
const composition = compositions.find((c) => c.id === compositionId);
|
|
@@ -1462,7 +1465,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
1462
1465
|
env.isPlayer
|
|
1463
1466
|
]);
|
|
1464
1467
|
}, useVideo = () => {
|
|
1465
|
-
const { canvasContent, compositions, currentCompositionMetadata } =
|
|
1468
|
+
const { canvasContent, compositions, currentCompositionMetadata } = useContext5(CompositionManager);
|
|
1466
1469
|
const selected = compositions.find((c) => {
|
|
1467
1470
|
return canvasContent?.type === "composition" && c.id === canvasContent.compositionId;
|
|
1468
1471
|
});
|
|
@@ -1508,7 +1511,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
1508
1511
|
return window.remotion_initialFrame ?? 0;
|
|
1509
1512
|
}, useTimelinePosition = () => {
|
|
1510
1513
|
const videoConfig = useVideo();
|
|
1511
|
-
const state =
|
|
1514
|
+
const state = useContext6(TimelineContext);
|
|
1512
1515
|
const env = useRemotionEnvironment();
|
|
1513
1516
|
if (!videoConfig) {
|
|
1514
1517
|
return typeof window === "undefined" ? 0 : window.remotion_initialFrame ?? 0;
|
|
@@ -1516,11 +1519,11 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
1516
1519
|
const unclamped = state.frame[videoConfig.id] ?? (env.isPlayer ? 0 : getFrameForComposition(videoConfig.id));
|
|
1517
1520
|
return Math.min(videoConfig.durationInFrames - 1, unclamped);
|
|
1518
1521
|
}, useTimelineSetFrame = () => {
|
|
1519
|
-
const { setFrame } =
|
|
1522
|
+
const { setFrame } = useContext6(SetTimelineContext);
|
|
1520
1523
|
return setFrame;
|
|
1521
1524
|
}, usePlayingState = () => {
|
|
1522
|
-
const { playing, imperativePlaying } =
|
|
1523
|
-
const { setPlaying } =
|
|
1525
|
+
const { playing, imperativePlaying } = useContext6(TimelineContext);
|
|
1526
|
+
const { setPlaying } = useContext6(SetTimelineContext);
|
|
1524
1527
|
return useMemo6(() => [playing, setPlaying, imperativePlaying], [imperativePlaying, playing, setPlaying]);
|
|
1525
1528
|
}, CanUseRemotionHooks, CanUseRemotionHooksProvider = ({ children }) => {
|
|
1526
1529
|
return /* @__PURE__ */ jsx62(CanUseRemotionHooks.Provider, {
|
|
@@ -1528,7 +1531,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
1528
1531
|
children
|
|
1529
1532
|
});
|
|
1530
1533
|
}, useUnsafeVideoConfig = () => {
|
|
1531
|
-
const context =
|
|
1534
|
+
const context = useContext7(SequenceContext);
|
|
1532
1535
|
const ctxWidth = context?.width ?? null;
|
|
1533
1536
|
const ctxHeight = context?.height ?? null;
|
|
1534
1537
|
const ctxDuration = context?.durationInFrames ?? null;
|
|
@@ -1566,7 +1569,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
1566
1569
|
}, [ctxDuration, ctxHeight, ctxWidth, video]);
|
|
1567
1570
|
}, useVideoConfig = () => {
|
|
1568
1571
|
const videoConfig = useUnsafeVideoConfig();
|
|
1569
|
-
const context =
|
|
1572
|
+
const context = useContext8(CanUseRemotionHooks);
|
|
1570
1573
|
const isPlayer = useIsPlayer();
|
|
1571
1574
|
if (!videoConfig) {
|
|
1572
1575
|
if (typeof window !== "undefined" && window.remotion_isPlayer || isPlayer) {
|
|
@@ -1583,7 +1586,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
1583
1586
|
}
|
|
1584
1587
|
return videoConfig;
|
|
1585
1588
|
}, useCurrentFrame = () => {
|
|
1586
|
-
const canUseRemotionHooks =
|
|
1589
|
+
const canUseRemotionHooks = useContext9(CanUseRemotionHooks);
|
|
1587
1590
|
const env = useRemotionEnvironment();
|
|
1588
1591
|
if (!canUseRemotionHooks) {
|
|
1589
1592
|
if (env.isPlayer) {
|
|
@@ -1592,7 +1595,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
1592
1595
|
throw new Error(`useCurrentFrame() can only be called inside a component that was registered as a composition. See https://www.remotion.dev/docs/the-fundamentals#defining-compositions`);
|
|
1593
1596
|
}
|
|
1594
1597
|
const frame = useTimelinePosition();
|
|
1595
|
-
const context =
|
|
1598
|
+
const context = useContext9(SequenceContext);
|
|
1596
1599
|
const contextOffset = context ? context.cumulatedFrom + context.relativeFrom : 0;
|
|
1597
1600
|
return frame - contextOffset;
|
|
1598
1601
|
}, Freeze = ({
|
|
@@ -1622,8 +1625,8 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
1622
1625
|
return active(frame);
|
|
1623
1626
|
}
|
|
1624
1627
|
}, [active, frame]);
|
|
1625
|
-
const timelineContext =
|
|
1626
|
-
const sequenceContext =
|
|
1628
|
+
const timelineContext = useContext10(TimelineContext);
|
|
1629
|
+
const sequenceContext = useContext10(SequenceContext);
|
|
1627
1630
|
const relativeFrom = sequenceContext?.relativeFrom ?? 0;
|
|
1628
1631
|
const timelineValue = useMemo8(() => {
|
|
1629
1632
|
if (!isActive) {
|
|
@@ -1660,8 +1663,8 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
1660
1663
|
}, ref) => {
|
|
1661
1664
|
const { layout = "absolute-fill" } = other;
|
|
1662
1665
|
const [id] = useState5(() => String(Math.random()));
|
|
1663
|
-
const parentSequence =
|
|
1664
|
-
const { rootId } =
|
|
1666
|
+
const parentSequence = useContext11(SequenceContext);
|
|
1667
|
+
const { rootId } = useContext11(TimelineContext);
|
|
1665
1668
|
const cumulatedFrom = parentSequence ? parentSequence.cumulatedFrom + parentSequence.relativeFrom : 0;
|
|
1666
1669
|
const nonce = useNonce();
|
|
1667
1670
|
if (layout !== "absolute-fill" && layout !== "none") {
|
|
@@ -1686,8 +1689,8 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
1686
1689
|
const videoConfig = useVideoConfig();
|
|
1687
1690
|
const parentSequenceDuration = parentSequence ? Math.min(parentSequence.durationInFrames - from, durationInFrames) : durationInFrames;
|
|
1688
1691
|
const actualDurationInFrames = Math.max(0, Math.min(videoConfig.durationInFrames - from, parentSequenceDuration));
|
|
1689
|
-
const { registerSequence, unregisterSequence } =
|
|
1690
|
-
const { hidden } =
|
|
1692
|
+
const { registerSequence, unregisterSequence } = useContext11(SequenceManager);
|
|
1693
|
+
const { hidden } = useContext11(SequenceVisibilityToggleContext);
|
|
1691
1694
|
const premounting = useMemo9(() => {
|
|
1692
1695
|
return parentSequence?.premounting || Boolean(other._remotionInternalIsPremounting);
|
|
1693
1696
|
}, [other._remotionInternalIsPremounting, parentSequence?.premounting]);
|
|
@@ -1913,8 +1916,6 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
1913
1916
|
window.remotion_renderReady = false;
|
|
1914
1917
|
}
|
|
1915
1918
|
return handle;
|
|
1916
|
-
}, delayRender = (label, options) => {
|
|
1917
|
-
return delayRenderInternal(getRemotionEnvironment(), label, options);
|
|
1918
1919
|
}, continueRenderInternal = (handle, environment) => {
|
|
1919
1920
|
if (typeof handle === "undefined") {
|
|
1920
1921
|
throw new TypeError("The continueRender() method must be called with a parameter that is the return value of delayRender(). No value was passed.");
|
|
@@ -1945,8 +1946,15 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
1945
1946
|
if (handles.length === 0 && typeof window !== "undefined") {
|
|
1946
1947
|
window.remotion_renderReady = true;
|
|
1947
1948
|
}
|
|
1948
|
-
},
|
|
1949
|
-
|
|
1949
|
+
}, useDelayRender = () => {
|
|
1950
|
+
const environment = useRemotionEnvironment();
|
|
1951
|
+
const delayRender2 = useCallback4((label, options) => {
|
|
1952
|
+
return delayRenderInternal(environment, label, options);
|
|
1953
|
+
}, [environment]);
|
|
1954
|
+
const continueRender2 = useCallback4((handle) => {
|
|
1955
|
+
continueRenderInternal(handle, environment);
|
|
1956
|
+
}, [environment]);
|
|
1957
|
+
return { delayRender: delayRender2, continueRender: continueRender2 };
|
|
1950
1958
|
}, calcArgs = (fit, frameSize, canvasSize) => {
|
|
1951
1959
|
switch (fit) {
|
|
1952
1960
|
case "fill": {
|
|
@@ -1996,7 +2004,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
1996
2004
|
}
|
|
1997
2005
|
}, CanvasRefForwardingFunction = ({ width, height, fit, className, style }, ref) => {
|
|
1998
2006
|
const canvasRef = useRef2(null);
|
|
1999
|
-
const draw =
|
|
2007
|
+
const draw = useCallback5((imageData) => {
|
|
2000
2008
|
const canvas = canvasRef.current;
|
|
2001
2009
|
const canvasWidth = width ?? imageData.displayWidth;
|
|
2002
2010
|
const canvasHeight = height ?? imageData.displayHeight;
|
|
@@ -2210,13 +2218,13 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
2210
2218
|
validateContent(artifact.content);
|
|
2211
2219
|
}, RenderAssetManager, RenderAssetManagerProvider = ({ children }) => {
|
|
2212
2220
|
const [renderAssets, setRenderAssets] = useState7([]);
|
|
2213
|
-
const registerRenderAsset =
|
|
2221
|
+
const registerRenderAsset = useCallback6((renderAsset) => {
|
|
2214
2222
|
validateRenderAsset(renderAsset);
|
|
2215
2223
|
setRenderAssets((assets) => {
|
|
2216
2224
|
return [...assets, renderAsset];
|
|
2217
2225
|
});
|
|
2218
2226
|
}, []);
|
|
2219
|
-
const unregisterRenderAsset =
|
|
2227
|
+
const unregisterRenderAsset = useCallback6((id) => {
|
|
2220
2228
|
setRenderAssets((assts) => {
|
|
2221
2229
|
return assts.filter((a) => a.id !== id);
|
|
2222
2230
|
});
|
|
@@ -2241,7 +2249,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
2241
2249
|
children
|
|
2242
2250
|
});
|
|
2243
2251
|
}, ArtifactThumbnail, Artifact = ({ filename, content, downloadBehavior }) => {
|
|
2244
|
-
const { registerRenderAsset, unregisterRenderAsset } =
|
|
2252
|
+
const { registerRenderAsset, unregisterRenderAsset } = useContext12(RenderAssetManager);
|
|
2245
2253
|
const env = useRemotionEnvironment();
|
|
2246
2254
|
const frame = useCurrentFrame();
|
|
2247
2255
|
const [id] = useState8(() => {
|
|
@@ -2319,7 +2327,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
2319
2327
|
const actualDuration = duration / playbackRate;
|
|
2320
2328
|
return Math.floor(actualDuration);
|
|
2321
2329
|
}, LoopContext, useLoop = () => {
|
|
2322
|
-
return
|
|
2330
|
+
return React10.useContext(LoopContext);
|
|
2323
2331
|
}, Loop = ({ durationInFrames, times = Infinity, children, name, ...props }) => {
|
|
2324
2332
|
const currentFrame = useCurrentFrame();
|
|
2325
2333
|
const { durationInFrames: compDuration } = useVideoConfig();
|
|
@@ -2407,7 +2415,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
2407
2415
|
}
|
|
2408
2416
|
return src.slice(0, hashIndex);
|
|
2409
2417
|
}, usePreload = (src) => {
|
|
2410
|
-
const preloads2 =
|
|
2418
|
+
const preloads2 = useContext13(PreloadContext);
|
|
2411
2419
|
const hashFragmentIndex = removeAndGetHashFragment(src);
|
|
2412
2420
|
const withoutHashFragment = getSrcWithoutHash(src);
|
|
2413
2421
|
if (!preloads2[withoutHashFragment]) {
|
|
@@ -2704,13 +2712,13 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
2704
2712
|
}
|
|
2705
2713
|
return;
|
|
2706
2714
|
}, LogLevelContext, useLogLevel = () => {
|
|
2707
|
-
const { logLevel } =
|
|
2715
|
+
const { logLevel } = React13.useContext(LogLevelContext);
|
|
2708
2716
|
if (logLevel === null) {
|
|
2709
2717
|
throw new Error("useLogLevel must be used within a LogLevelProvider");
|
|
2710
2718
|
}
|
|
2711
2719
|
return logLevel;
|
|
2712
2720
|
}, useMountTime = () => {
|
|
2713
|
-
const { mountTime } =
|
|
2721
|
+
const { mountTime } = React13.useContext(LogLevelContext);
|
|
2714
2722
|
if (mountTime === null) {
|
|
2715
2723
|
throw new Error("useMountTime must be used within a LogLevelProvider");
|
|
2716
2724
|
}
|
|
@@ -2871,7 +2879,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
2871
2879
|
});
|
|
2872
2880
|
}, [audioContext, numberOfAudioTags]);
|
|
2873
2881
|
const takenAudios = useRef4(new Array(numberOfAudioTags).fill(false));
|
|
2874
|
-
const rerenderAudios =
|
|
2882
|
+
const rerenderAudios = useCallback7(() => {
|
|
2875
2883
|
refs.forEach(({ ref, id }) => {
|
|
2876
2884
|
const data = audios.current?.find((a) => a.id === id);
|
|
2877
2885
|
const { current } = ref;
|
|
@@ -2892,7 +2900,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
2892
2900
|
});
|
|
2893
2901
|
});
|
|
2894
2902
|
}, [refs]);
|
|
2895
|
-
const registerAudio =
|
|
2903
|
+
const registerAudio = useCallback7((options) => {
|
|
2896
2904
|
const { aud, audioId, premounting } = options;
|
|
2897
2905
|
const found = audios.current?.find((a) => a.audioId === audioId);
|
|
2898
2906
|
if (found) {
|
|
@@ -2918,7 +2926,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
2918
2926
|
rerenderAudios();
|
|
2919
2927
|
return newElem;
|
|
2920
2928
|
}, [numberOfAudioTags, refs, rerenderAudios]);
|
|
2921
|
-
const unregisterAudio =
|
|
2929
|
+
const unregisterAudio = useCallback7((id) => {
|
|
2922
2930
|
const cloned = [...takenAudios.current];
|
|
2923
2931
|
const index = refs.findIndex((r2) => r2.id === id);
|
|
2924
2932
|
if (index === -1) {
|
|
@@ -2929,7 +2937,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
2929
2937
|
audios.current = audios.current?.filter((a) => a.id !== id);
|
|
2930
2938
|
rerenderAudios();
|
|
2931
2939
|
}, [refs, rerenderAudios]);
|
|
2932
|
-
const updateAudio =
|
|
2940
|
+
const updateAudio = useCallback7(({
|
|
2933
2941
|
aud,
|
|
2934
2942
|
audioId,
|
|
2935
2943
|
id,
|
|
@@ -2958,7 +2966,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
2958
2966
|
}, [rerenderAudios]);
|
|
2959
2967
|
const mountTime = useMountTime();
|
|
2960
2968
|
const env = useRemotionEnvironment();
|
|
2961
|
-
const playAllAudios =
|
|
2969
|
+
const playAllAudios = useCallback7(() => {
|
|
2962
2970
|
refs.forEach((ref) => {
|
|
2963
2971
|
const audio = audios.current.find((a) => a.el === ref.ref);
|
|
2964
2972
|
if (audio?.premounting) {
|
|
@@ -2993,7 +3001,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
2993
3001
|
updateAudio,
|
|
2994
3002
|
audioContext
|
|
2995
3003
|
]);
|
|
2996
|
-
const resetAudio =
|
|
3004
|
+
const resetAudio = useCallback7(() => {
|
|
2997
3005
|
takenAudios.current = new Array(numberOfAudioTags).fill(false);
|
|
2998
3006
|
audios.current = [];
|
|
2999
3007
|
rerenderAudios();
|
|
@@ -3021,12 +3029,12 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
3021
3029
|
audioId,
|
|
3022
3030
|
premounting
|
|
3023
3031
|
}) => {
|
|
3024
|
-
const ctx =
|
|
3032
|
+
const ctx = useContext15(SharedAudioContext);
|
|
3025
3033
|
const [elem] = useState10(() => {
|
|
3026
3034
|
if (ctx && ctx.numberOfAudioTags > 0) {
|
|
3027
3035
|
return ctx.registerAudio({ aud, audioId, premounting });
|
|
3028
3036
|
}
|
|
3029
|
-
const el =
|
|
3037
|
+
const el = React14.createRef();
|
|
3030
3038
|
const mediaElementSourceNode = ctx?.audioContext ? makeSharedElementSourceNode({
|
|
3031
3039
|
audioContext: ctx.audioContext,
|
|
3032
3040
|
ref: el
|
|
@@ -3040,7 +3048,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
3040
3048
|
premounting
|
|
3041
3049
|
};
|
|
3042
3050
|
});
|
|
3043
|
-
const effectToUse =
|
|
3051
|
+
const effectToUse = React14.useInsertionEffect ?? React14.useLayoutEffect;
|
|
3044
3052
|
if (typeof document !== "undefined") {
|
|
3045
3053
|
effectToUse(() => {
|
|
3046
3054
|
if (ctx && ctx.numberOfAudioTags > 0) {
|
|
@@ -3175,7 +3183,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
3175
3183
|
const audioStuffRef = useRef6(null);
|
|
3176
3184
|
const currentVolumeRef = useRef6(volume);
|
|
3177
3185
|
currentVolumeRef.current = volume;
|
|
3178
|
-
const sharedAudioContext =
|
|
3186
|
+
const sharedAudioContext = useContext16(SharedAudioContext);
|
|
3179
3187
|
if (!sharedAudioContext) {
|
|
3180
3188
|
throw new Error("useAmplification must be used within a SharedAudioContext");
|
|
3181
3189
|
}
|
|
@@ -3229,7 +3237,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
3229
3237
|
}
|
|
3230
3238
|
return audioStuffRef;
|
|
3231
3239
|
}, useMediaStartsAt = () => {
|
|
3232
|
-
const parentSequence =
|
|
3240
|
+
const parentSequence = useContext17(SequenceContext);
|
|
3233
3241
|
const startsAt = Math.min(0, parentSequence?.relativeFrom ?? 0);
|
|
3234
3242
|
return startsAt;
|
|
3235
3243
|
}, useFrameForVolumeProp = (behavior) => {
|
|
@@ -3292,12 +3300,12 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
3292
3300
|
isPostmounting
|
|
3293
3301
|
}) => {
|
|
3294
3302
|
const videoConfig = useVideoConfig();
|
|
3295
|
-
const { rootId, audioAndVideoTags } =
|
|
3296
|
-
const parentSequence =
|
|
3303
|
+
const { rootId, audioAndVideoTags } = useContext18(TimelineContext);
|
|
3304
|
+
const parentSequence = useContext18(SequenceContext);
|
|
3297
3305
|
const actualFrom = parentSequence ? parentSequence.relativeFrom + parentSequence.cumulatedFrom : 0;
|
|
3298
|
-
const { imperativePlaying } =
|
|
3306
|
+
const { imperativePlaying } = useContext18(TimelineContext);
|
|
3299
3307
|
const startsAt = useMediaStartsAt();
|
|
3300
|
-
const { registerSequence, unregisterSequence } =
|
|
3308
|
+
const { registerSequence, unregisterSequence } = useContext18(SequenceManager);
|
|
3301
3309
|
const [initialVolume] = useState11(() => volume);
|
|
3302
3310
|
const logLevel = useLogLevel();
|
|
3303
3311
|
const mountTime = useMountTime();
|
|
@@ -3425,7 +3433,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
3425
3433
|
const [onBufferingCallbacks, setOnBufferingCallbacks] = useState12([]);
|
|
3426
3434
|
const [onResumeCallbacks, setOnResumeCallbacks] = useState12([]);
|
|
3427
3435
|
const buffering = useRef7(false);
|
|
3428
|
-
const addBlock =
|
|
3436
|
+
const addBlock = useCallback8((block) => {
|
|
3429
3437
|
setBlocks((b) => [...b, block]);
|
|
3430
3438
|
return {
|
|
3431
3439
|
unblock: () => {
|
|
@@ -3439,7 +3447,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
3439
3447
|
}
|
|
3440
3448
|
};
|
|
3441
3449
|
}, []);
|
|
3442
|
-
const listenForBuffering =
|
|
3450
|
+
const listenForBuffering = useCallback8((callback) => {
|
|
3443
3451
|
setOnBufferingCallbacks((c) => [...c, callback]);
|
|
3444
3452
|
return {
|
|
3445
3453
|
remove: () => {
|
|
@@ -3447,7 +3455,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
3447
3455
|
}
|
|
3448
3456
|
};
|
|
3449
3457
|
}, []);
|
|
3450
|
-
const listenForResume =
|
|
3458
|
+
const listenForResume = useCallback8((callback) => {
|
|
3451
3459
|
setOnResumeCallbacks((c) => [...c, callback]);
|
|
3452
3460
|
return {
|
|
3453
3461
|
remove: () => {
|
|
@@ -3483,7 +3491,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
3483
3491
|
return { addBlock, listenForBuffering, listenForResume, buffering };
|
|
3484
3492
|
}, [addBlock, buffering, listenForBuffering, listenForResume]);
|
|
3485
3493
|
}, BufferingContextReact, BufferingProvider = ({ children }) => {
|
|
3486
|
-
const { logLevel, mountTime } =
|
|
3494
|
+
const { logLevel, mountTime } = useContext19(LogLevelContext);
|
|
3487
3495
|
const bufferManager = useBufferManager(logLevel ?? "info", mountTime);
|
|
3488
3496
|
return /* @__PURE__ */ jsx16(BufferingContextReact.Provider, {
|
|
3489
3497
|
value: bufferManager,
|
|
@@ -3511,7 +3519,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
3511
3519
|
}, [bufferManager]);
|
|
3512
3520
|
return isBuffering;
|
|
3513
3521
|
}, useBufferState = () => {
|
|
3514
|
-
const buffer =
|
|
3522
|
+
const buffer = useContext20(BufferingContextReact);
|
|
3515
3523
|
const addBlock = buffer ? buffer.addBlock : null;
|
|
3516
3524
|
return useMemo17(() => ({
|
|
3517
3525
|
delayPlayback: () => {
|
|
@@ -3537,7 +3545,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
3537
3545
|
}) => {
|
|
3538
3546
|
const bufferingRef = useRef8(false);
|
|
3539
3547
|
const { delayPlayback } = useBufferState();
|
|
3540
|
-
const bufferUntilFirstFrame =
|
|
3548
|
+
const bufferUntilFirstFrame = useCallback9((requestedTime) => {
|
|
3541
3549
|
if (mediaType !== "video") {
|
|
3542
3550
|
return;
|
|
3543
3551
|
}
|
|
@@ -3615,7 +3623,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
3615
3623
|
};
|
|
3616
3624
|
}, [bufferUntilFirstFrame]);
|
|
3617
3625
|
}, useCurrentTimeOfMediaTagWithUpdateTimeStamp = (mediaRef) => {
|
|
3618
|
-
const lastUpdate =
|
|
3626
|
+
const lastUpdate = React16.useRef({
|
|
3619
3627
|
time: mediaRef.current?.currentTime ?? 0,
|
|
3620
3628
|
lastUpdate: performance.now()
|
|
3621
3629
|
});
|
|
@@ -3902,11 +3910,11 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
3902
3910
|
isPostmounting,
|
|
3903
3911
|
onAutoPlayError
|
|
3904
3912
|
}) => {
|
|
3905
|
-
const { playbackRate: globalPlaybackRate } =
|
|
3913
|
+
const { playbackRate: globalPlaybackRate } = useContext21(TimelineContext);
|
|
3906
3914
|
const frame = useCurrentFrame();
|
|
3907
3915
|
const absoluteFrame = useTimelinePosition();
|
|
3908
3916
|
const [playing] = usePlayingState();
|
|
3909
|
-
const buffering =
|
|
3917
|
+
const buffering = useContext21(BufferingContextReact);
|
|
3910
3918
|
const { fps } = useVideoConfig();
|
|
3911
3919
|
const mediaStartsAt = useMediaStartsAt();
|
|
3912
3920
|
const lastSeekDueToShift = useRef10(null);
|
|
@@ -3917,7 +3925,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
3917
3925
|
throw new Error("useMediaPlayback must be used inside a <BufferingContext>");
|
|
3918
3926
|
}
|
|
3919
3927
|
const isVariableFpsVideoMap = useRef10({});
|
|
3920
|
-
const onVariableFpsVideoDetected =
|
|
3928
|
+
const onVariableFpsVideoDetected = useCallback10(() => {
|
|
3921
3929
|
if (!src) {
|
|
3922
3930
|
return;
|
|
3923
3931
|
}
|
|
@@ -4130,14 +4138,14 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
4130
4138
|
env.isPlayer
|
|
4131
4139
|
]);
|
|
4132
4140
|
}, MediaVolumeContext, SetMediaVolumeContext, useMediaVolumeState = () => {
|
|
4133
|
-
const { mediaVolume } =
|
|
4134
|
-
const { setMediaVolume } =
|
|
4141
|
+
const { mediaVolume } = useContext22(MediaVolumeContext);
|
|
4142
|
+
const { setMediaVolume } = useContext22(SetMediaVolumeContext);
|
|
4135
4143
|
return useMemo19(() => {
|
|
4136
4144
|
return [mediaVolume, setMediaVolume];
|
|
4137
4145
|
}, [mediaVolume, setMediaVolume]);
|
|
4138
4146
|
}, useMediaMutedState = () => {
|
|
4139
|
-
const { mediaMuted } =
|
|
4140
|
-
const { setMediaMuted } =
|
|
4147
|
+
const { mediaMuted } = useContext22(MediaVolumeContext);
|
|
4148
|
+
const { setMediaMuted } = useContext22(SetMediaVolumeContext);
|
|
4141
4149
|
return useMemo19(() => {
|
|
4142
4150
|
return [mediaMuted, setMediaMuted];
|
|
4143
4151
|
}, [mediaMuted, setMediaMuted]);
|
|
@@ -4181,12 +4189,12 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
4181
4189
|
const [mediaVolume] = useMediaVolumeState();
|
|
4182
4190
|
const [mediaMuted] = useMediaMutedState();
|
|
4183
4191
|
const volumePropFrame = useFrameForVolumeProp(loopVolumeCurveBehavior ?? "repeat");
|
|
4184
|
-
const { hidden } =
|
|
4192
|
+
const { hidden } = useContext23(SequenceVisibilityToggleContext);
|
|
4185
4193
|
if (!src) {
|
|
4186
4194
|
throw new TypeError("No 'src' was passed to <Audio>.");
|
|
4187
4195
|
}
|
|
4188
4196
|
const preloadedSrc = usePreload(src);
|
|
4189
|
-
const sequenceContext =
|
|
4197
|
+
const sequenceContext = useContext23(SequenceContext);
|
|
4190
4198
|
const [timelineId] = useState14(() => String(Math.random()));
|
|
4191
4199
|
const isSequenceHidden = hidden[timelineId] ?? false;
|
|
4192
4200
|
const userPreferredVolume = evaluateVolume({
|
|
@@ -4224,7 +4232,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
4224
4232
|
props.muted,
|
|
4225
4233
|
props.loop
|
|
4226
4234
|
]);
|
|
4227
|
-
const context =
|
|
4235
|
+
const context = useContext23(SharedAudioContext);
|
|
4228
4236
|
if (!context) {
|
|
4229
4237
|
throw new Error("SharedAudioContext not found");
|
|
4230
4238
|
}
|
|
@@ -4323,8 +4331,9 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
4323
4331
|
const absoluteFrame = useTimelinePosition();
|
|
4324
4332
|
const volumePropFrame = useFrameForVolumeProp(loopVolumeCurveBehavior ?? "repeat");
|
|
4325
4333
|
const frame = useCurrentFrame();
|
|
4326
|
-
const sequenceContext =
|
|
4327
|
-
const { registerRenderAsset, unregisterRenderAsset } =
|
|
4334
|
+
const sequenceContext = useContext24(SequenceContext);
|
|
4335
|
+
const { registerRenderAsset, unregisterRenderAsset } = useContext24(RenderAssetManager);
|
|
4336
|
+
const { delayRender: delayRender2, continueRender: continueRender2 } = useDelayRender();
|
|
4328
4337
|
const id = useMemo21(() => `audio-${random(props.src ?? "")}-${sequenceContext?.relativeFrom}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.durationInFrames}`, [
|
|
4329
4338
|
props.src,
|
|
4330
4339
|
sequenceContext?.relativeFrom,
|
|
@@ -4390,7 +4399,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
4390
4399
|
if (!needsToRenderAudioTag) {
|
|
4391
4400
|
return;
|
|
4392
4401
|
}
|
|
4393
|
-
const newHandle =
|
|
4402
|
+
const newHandle = delayRender2("Loading <Audio> duration with src=" + src, {
|
|
4394
4403
|
retries: delayRenderRetries ?? undefined,
|
|
4395
4404
|
timeoutInMilliseconds: delayRenderTimeoutInMilliseconds ?? undefined
|
|
4396
4405
|
});
|
|
@@ -4399,24 +4408,26 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
4399
4408
|
if (current?.duration) {
|
|
4400
4409
|
onDuration(current.src, current.duration);
|
|
4401
4410
|
}
|
|
4402
|
-
|
|
4411
|
+
continueRender2(newHandle);
|
|
4403
4412
|
};
|
|
4404
4413
|
if (current?.duration) {
|
|
4405
4414
|
onDuration(current.src, current.duration);
|
|
4406
|
-
|
|
4415
|
+
continueRender2(newHandle);
|
|
4407
4416
|
} else {
|
|
4408
4417
|
current?.addEventListener("loadedmetadata", didLoad, { once: true });
|
|
4409
4418
|
}
|
|
4410
4419
|
return () => {
|
|
4411
4420
|
current?.removeEventListener("loadedmetadata", didLoad);
|
|
4412
|
-
|
|
4421
|
+
continueRender2(newHandle);
|
|
4413
4422
|
};
|
|
4414
4423
|
}, [
|
|
4415
4424
|
src,
|
|
4416
4425
|
onDuration,
|
|
4417
4426
|
needsToRenderAudioTag,
|
|
4418
4427
|
delayRenderRetries,
|
|
4419
|
-
delayRenderTimeoutInMilliseconds
|
|
4428
|
+
delayRenderTimeoutInMilliseconds,
|
|
4429
|
+
continueRender2,
|
|
4430
|
+
delayRender2
|
|
4420
4431
|
]);
|
|
4421
4432
|
if (!needsToRenderAudioTag) {
|
|
4422
4433
|
return null;
|
|
@@ -4427,7 +4438,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
4427
4438
|
onError: onNativeError
|
|
4428
4439
|
});
|
|
4429
4440
|
}, AudioForRendering, AudioRefForwardingFunction = (props, ref) => {
|
|
4430
|
-
const audioContext =
|
|
4441
|
+
const audioContext = useContext25(SharedAudioContext);
|
|
4431
4442
|
const {
|
|
4432
4443
|
startFrom,
|
|
4433
4444
|
endAt,
|
|
@@ -4443,12 +4454,12 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
4443
4454
|
const { loop, ...propsOtherThanLoop } = props;
|
|
4444
4455
|
const { fps } = useVideoConfig();
|
|
4445
4456
|
const environment = useRemotionEnvironment();
|
|
4446
|
-
const { durations, setDurations } =
|
|
4457
|
+
const { durations, setDurations } = useContext25(DurationsContext);
|
|
4447
4458
|
if (typeof props.src !== "string") {
|
|
4448
4459
|
throw new TypeError(`The \`<Audio>\` tag requires a string for \`src\`, but got ${JSON.stringify(props.src)} instead.`);
|
|
4449
4460
|
}
|
|
4450
4461
|
const preloadedSrc = usePreload(props.src);
|
|
4451
|
-
const onError =
|
|
4462
|
+
const onError = useCallback11((e) => {
|
|
4452
4463
|
console.log(e.currentTarget.error);
|
|
4453
4464
|
const errMessage = `Could not play audio with src ${preloadedSrc}: ${e.currentTarget.error}. See https://remotion.dev/docs/media-playback-error for help.`;
|
|
4454
4465
|
if (loop) {
|
|
@@ -4462,7 +4473,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
4462
4473
|
console.warn(errMessage);
|
|
4463
4474
|
}
|
|
4464
4475
|
}, [loop, onRemotionError, preloadedSrc]);
|
|
4465
|
-
const onDuration =
|
|
4476
|
+
const onDuration = useCallback11((src, durationInSeconds) => {
|
|
4466
4477
|
setDurations({ type: "got-duration", durationInSeconds, src });
|
|
4467
4478
|
}, [setDurations]);
|
|
4468
4479
|
const durationFetched = durations[getAbsoluteSrc(preloadedSrc)] ?? durations[getAbsoluteSrc(props.src)];
|
|
@@ -4614,13 +4625,13 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
4614
4625
|
if (typeof compProps.component === "undefined") {
|
|
4615
4626
|
throw new Error(`A value of \`undefined\` was passed to the \`component\` prop. Check the value you are passing to the <${componentName}/> component.`);
|
|
4616
4627
|
}
|
|
4617
|
-
return
|
|
4628
|
+
return React20.lazy(() => Promise.resolve({ default: compProps.component }));
|
|
4618
4629
|
}
|
|
4619
4630
|
if ("lazyComponent" in compProps && typeof compProps.lazyComponent !== "undefined") {
|
|
4620
4631
|
if (typeof compProps.lazyComponent === "undefined") {
|
|
4621
4632
|
throw new Error(`A value of \`undefined\` was passed to the \`lazyComponent\` prop. Check the value you are passing to the <${componentName}/> component.`);
|
|
4622
4633
|
}
|
|
4623
|
-
return
|
|
4634
|
+
return React20.lazy(compProps.lazyComponent);
|
|
4624
4635
|
}
|
|
4625
4636
|
throw new Error("You must pass either 'component' or 'lazyComponent'");
|
|
4626
4637
|
}, [compProps.component, compProps.lazyComponent]);
|
|
@@ -4640,10 +4651,11 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
4640
4651
|
throw new Error(`"${name}" must be an object, an array was passed ${compositionId ? `for composition "${compositionId}"` : ""}`);
|
|
4641
4652
|
}
|
|
4642
4653
|
}, Fallback = () => {
|
|
4654
|
+
const { continueRender: continueRender2, delayRender: delayRender2 } = useDelayRender();
|
|
4643
4655
|
useEffect16(() => {
|
|
4644
|
-
const fallback =
|
|
4645
|
-
return () =>
|
|
4646
|
-
}, []);
|
|
4656
|
+
const fallback = delayRender2("Waiting for Root component to unsuspend");
|
|
4657
|
+
return () => continueRender2(fallback);
|
|
4658
|
+
}, [continueRender2, delayRender2]);
|
|
4647
4659
|
return null;
|
|
4648
4660
|
}, InnerComposition = ({
|
|
4649
4661
|
width,
|
|
@@ -4655,7 +4667,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
4655
4667
|
schema,
|
|
4656
4668
|
...compProps
|
|
4657
4669
|
}) => {
|
|
4658
|
-
const compManager =
|
|
4670
|
+
const compManager = useContext27(CompositionSetters);
|
|
4659
4671
|
const { registerComposition, unregisterComposition } = compManager;
|
|
4660
4672
|
const video = useVideo();
|
|
4661
4673
|
const lazy = useLazyComponent({
|
|
@@ -4666,14 +4678,14 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
4666
4678
|
const nonce = useNonce();
|
|
4667
4679
|
const isPlayer = useIsPlayer();
|
|
4668
4680
|
const environment = useRemotionEnvironment();
|
|
4669
|
-
const canUseComposition =
|
|
4681
|
+
const canUseComposition = useContext27(CanUseRemotionHooks);
|
|
4670
4682
|
if (canUseComposition) {
|
|
4671
4683
|
if (isPlayer) {
|
|
4672
4684
|
throw new Error("<Composition> was mounted inside the `component` that was passed to the <Player>. See https://remotion.dev/docs/wrong-composition-mount for help.");
|
|
4673
4685
|
}
|
|
4674
4686
|
throw new Error("<Composition> mounted inside another composition. See https://remotion.dev/docs/wrong-composition-mount for help.");
|
|
4675
4687
|
}
|
|
4676
|
-
const { folderName, parentName } =
|
|
4688
|
+
const { folderName, parentName } = useContext27(FolderContext);
|
|
4677
4689
|
useEffect16(() => {
|
|
4678
4690
|
if (!id) {
|
|
4679
4691
|
throw new Error("No id for composition passed.");
|
|
@@ -4751,7 +4763,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
4751
4763
|
}
|
|
4752
4764
|
return null;
|
|
4753
4765
|
}, Composition = (props2) => {
|
|
4754
|
-
const { onlyRenderComposition } =
|
|
4766
|
+
const { onlyRenderComposition } = useContext27(CompositionSetters);
|
|
4755
4767
|
if (onlyRenderComposition && onlyRenderComposition !== props2.id) {
|
|
4756
4768
|
return null;
|
|
4757
4769
|
}
|
|
@@ -4765,22 +4777,23 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
4765
4777
|
delayRenderTimeoutInMilliseconds,
|
|
4766
4778
|
...props2
|
|
4767
4779
|
}, ref) => {
|
|
4768
|
-
const
|
|
4780
|
+
const { delayRender: delayRender2, continueRender: continueRender2 } = useDelayRender();
|
|
4781
|
+
const [handle] = useState15(() => delayRender2(`Loading <IFrame> with source ${props2.src}`, {
|
|
4769
4782
|
retries: delayRenderRetries ?? undefined,
|
|
4770
4783
|
timeoutInMilliseconds: delayRenderTimeoutInMilliseconds ?? undefined
|
|
4771
4784
|
}));
|
|
4772
|
-
const didLoad =
|
|
4773
|
-
|
|
4785
|
+
const didLoad = useCallback12((e) => {
|
|
4786
|
+
continueRender2(handle);
|
|
4774
4787
|
onLoad?.(e);
|
|
4775
|
-
}, [handle, onLoad]);
|
|
4776
|
-
const didGetError =
|
|
4777
|
-
|
|
4788
|
+
}, [handle, onLoad, continueRender2]);
|
|
4789
|
+
const didGetError = useCallback12((e) => {
|
|
4790
|
+
continueRender2(handle);
|
|
4778
4791
|
if (onError) {
|
|
4779
4792
|
onError(e);
|
|
4780
4793
|
} else {
|
|
4781
4794
|
console.error("Error loading iframe:", e, "Handle the event using the onError() prop to make this message disappear.");
|
|
4782
4795
|
}
|
|
4783
|
-
}, [handle, onError]);
|
|
4796
|
+
}, [handle, onError, continueRender2]);
|
|
4784
4797
|
return /* @__PURE__ */ jsx23("iframe", {
|
|
4785
4798
|
...props2,
|
|
4786
4799
|
ref,
|
|
@@ -4801,7 +4814,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
4801
4814
|
const imageRef = useRef13(null);
|
|
4802
4815
|
const errors = useRef13({});
|
|
4803
4816
|
const { delayPlayback } = useBufferState();
|
|
4804
|
-
const sequenceContext =
|
|
4817
|
+
const sequenceContext = useContext28(SequenceContext);
|
|
4805
4818
|
if (!src) {
|
|
4806
4819
|
throw new Error('No "src" prop was passed to <Img>.');
|
|
4807
4820
|
}
|
|
@@ -4813,7 +4826,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
4813
4826
|
return imageRef.current;
|
|
4814
4827
|
}, []);
|
|
4815
4828
|
const actualSrc = usePreload(src);
|
|
4816
|
-
const retryIn =
|
|
4829
|
+
const retryIn = useCallback13((timeout) => {
|
|
4817
4830
|
if (!imageRef.current) {
|
|
4818
4831
|
return;
|
|
4819
4832
|
}
|
|
@@ -4830,7 +4843,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
4830
4843
|
imageRef.current.setAttribute("src", newSrc);
|
|
4831
4844
|
}, timeout);
|
|
4832
4845
|
}, []);
|
|
4833
|
-
const didGetError =
|
|
4846
|
+
const didGetError = useCallback13((e) => {
|
|
4834
4847
|
if (!errors.current) {
|
|
4835
4848
|
return;
|
|
4836
4849
|
}
|
|
@@ -4847,6 +4860,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
4847
4860
|
}
|
|
4848
4861
|
cancelRender("Error loading image with src: " + imageRef.current?.src);
|
|
4849
4862
|
}, [maxRetries, onError, retryIn]);
|
|
4863
|
+
const { delayRender: delayRender2, continueRender: continueRender2 } = useDelayRender();
|
|
4850
4864
|
if (typeof window !== "undefined") {
|
|
4851
4865
|
const isPremounting = Boolean(sequenceContext?.premounting);
|
|
4852
4866
|
const isPostmounting = Boolean(sequenceContext?.postmounting);
|
|
@@ -4861,7 +4875,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
4861
4875
|
if (!current) {
|
|
4862
4876
|
return;
|
|
4863
4877
|
}
|
|
4864
|
-
const newHandle =
|
|
4878
|
+
const newHandle = delayRender2("Loading <Img> with src=" + actualSrc, {
|
|
4865
4879
|
retries: delayRenderRetries ?? undefined,
|
|
4866
4880
|
timeoutInMilliseconds: delayRenderTimeoutInMilliseconds ?? undefined
|
|
4867
4881
|
});
|
|
@@ -4871,7 +4885,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
4871
4885
|
let unmounted = false;
|
|
4872
4886
|
const onComplete = () => {
|
|
4873
4887
|
if (unmounted) {
|
|
4874
|
-
|
|
4888
|
+
continueRender2(newHandle);
|
|
4875
4889
|
return;
|
|
4876
4890
|
}
|
|
4877
4891
|
if ((errors.current[imageRef.current?.src] ?? 0) > 0) {
|
|
@@ -4882,7 +4896,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
4882
4896
|
onImageFrame?.(current);
|
|
4883
4897
|
}
|
|
4884
4898
|
unblock();
|
|
4885
|
-
|
|
4899
|
+
continueRender2(newHandle);
|
|
4886
4900
|
};
|
|
4887
4901
|
if (!imageRef.current) {
|
|
4888
4902
|
onComplete();
|
|
@@ -4905,7 +4919,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
4905
4919
|
unmounted = true;
|
|
4906
4920
|
current.removeEventListener("load", onComplete);
|
|
4907
4921
|
unblock();
|
|
4908
|
-
|
|
4922
|
+
continueRender2(newHandle);
|
|
4909
4923
|
};
|
|
4910
4924
|
}, [
|
|
4911
4925
|
actualSrc,
|
|
@@ -4915,7 +4929,9 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
4915
4929
|
pauseWhenLoading,
|
|
4916
4930
|
isPremounting,
|
|
4917
4931
|
isPostmounting,
|
|
4918
|
-
onImageFrame
|
|
4932
|
+
onImageFrame,
|
|
4933
|
+
continueRender2,
|
|
4934
|
+
delayRender2
|
|
4919
4935
|
]);
|
|
4920
4936
|
}
|
|
4921
4937
|
const crossOriginValue = getCrossOriginValue({
|
|
@@ -4939,14 +4955,14 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
4939
4955
|
const currentcompositionsRef = useRef14(compositions);
|
|
4940
4956
|
const [folders, setFolders] = useState16([]);
|
|
4941
4957
|
const [canvasContent, setCanvasContent] = useState16(null);
|
|
4942
|
-
const updateCompositions =
|
|
4958
|
+
const updateCompositions = useCallback14((updateComps) => {
|
|
4943
4959
|
setCompositions((comps) => {
|
|
4944
4960
|
const updated = updateComps(comps);
|
|
4945
4961
|
currentcompositionsRef.current = updated;
|
|
4946
4962
|
return updated;
|
|
4947
4963
|
});
|
|
4948
4964
|
}, []);
|
|
4949
|
-
const registerComposition =
|
|
4965
|
+
const registerComposition = useCallback14((comp) => {
|
|
4950
4966
|
updateCompositions((comps) => {
|
|
4951
4967
|
if (comps.find((c2) => c2.id === comp.id)) {
|
|
4952
4968
|
throw new Error(`Multiple composition with id ${comp.id} are registered.`);
|
|
@@ -4955,12 +4971,12 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
4955
4971
|
return value;
|
|
4956
4972
|
});
|
|
4957
4973
|
}, [updateCompositions]);
|
|
4958
|
-
const unregisterComposition =
|
|
4974
|
+
const unregisterComposition = useCallback14((id) => {
|
|
4959
4975
|
setCompositions((comps) => {
|
|
4960
4976
|
return comps.filter((c2) => c2.id !== id);
|
|
4961
4977
|
});
|
|
4962
4978
|
}, []);
|
|
4963
|
-
const registerFolder =
|
|
4979
|
+
const registerFolder = useCallback14((name, parent) => {
|
|
4964
4980
|
setFolders((prevFolders) => {
|
|
4965
4981
|
return [
|
|
4966
4982
|
...prevFolders,
|
|
@@ -4971,7 +4987,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
4971
4987
|
];
|
|
4972
4988
|
});
|
|
4973
4989
|
}, []);
|
|
4974
|
-
const unregisterFolder =
|
|
4990
|
+
const unregisterFolder = useCallback14((name, parent) => {
|
|
4975
4991
|
setFolders((prevFolders) => {
|
|
4976
4992
|
return prevFolders.filter((p) => !(p.name === name && p.parent === parent));
|
|
4977
4993
|
});
|
|
@@ -4982,7 +4998,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
4982
4998
|
};
|
|
4983
4999
|
}, []);
|
|
4984
5000
|
const composition = compositions.find((c2) => canvasContent?.type === "composition" ? c2.id === canvasContent.compositionId : null);
|
|
4985
|
-
const updateCompositionDefaultProps =
|
|
5001
|
+
const updateCompositionDefaultProps = useCallback14((id, newDefaultProps) => {
|
|
4986
5002
|
setCompositions((comps) => {
|
|
4987
5003
|
const updated = comps.map((c2) => {
|
|
4988
5004
|
if (c2.id === id) {
|
|
@@ -5110,11 +5126,12 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
5110
5126
|
const [manualRefreshes, setManualRefreshes] = useState17(0);
|
|
5111
5127
|
const [playbackRate, setPlaybackRate] = useState17(1);
|
|
5112
5128
|
const audioAndVideoTags = useRef15([]);
|
|
5129
|
+
const { delayRender: delayRender2, continueRender: continueRender2 } = useDelayRender();
|
|
5113
5130
|
if (typeof window !== "undefined") {
|
|
5114
5131
|
useLayoutEffect8(() => {
|
|
5115
5132
|
window.remotion_setFrame = (f, composition, attempt) => {
|
|
5116
5133
|
window.remotion_attempt = attempt;
|
|
5117
|
-
const id =
|
|
5134
|
+
const id = delayRender2(`Setting the current frame to ${f}`);
|
|
5118
5135
|
let asyncUpdate = true;
|
|
5119
5136
|
setFrame((s) => {
|
|
5120
5137
|
const currentFrame = s[composition] ?? window.remotion_initialFrame;
|
|
@@ -5128,13 +5145,13 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
5128
5145
|
};
|
|
5129
5146
|
});
|
|
5130
5147
|
if (asyncUpdate) {
|
|
5131
|
-
requestAnimationFrame(() =>
|
|
5148
|
+
requestAnimationFrame(() => continueRender2(id));
|
|
5132
5149
|
} else {
|
|
5133
|
-
|
|
5150
|
+
continueRender2(id);
|
|
5134
5151
|
}
|
|
5135
5152
|
};
|
|
5136
5153
|
window.remotion_isPlayer = false;
|
|
5137
|
-
}, []);
|
|
5154
|
+
}, [continueRender2, delayRender2]);
|
|
5138
5155
|
}
|
|
5139
5156
|
const timelineContextValue = useMemo25(() => {
|
|
5140
5157
|
return {
|
|
@@ -5277,7 +5294,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
5277
5294
|
};
|
|
5278
5295
|
}, [onVideoFrame, ref]);
|
|
5279
5296
|
}, VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
|
|
5280
|
-
const context =
|
|
5297
|
+
const context = useContext29(SharedAudioContext);
|
|
5281
5298
|
if (!context) {
|
|
5282
5299
|
throw new Error("SharedAudioContext not found");
|
|
5283
5300
|
}
|
|
@@ -5325,8 +5342,8 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
5325
5342
|
}
|
|
5326
5343
|
const volumePropFrame = useFrameForVolumeProp(loopVolumeCurveBehavior ?? "repeat");
|
|
5327
5344
|
const { fps, durationInFrames } = useVideoConfig();
|
|
5328
|
-
const parentSequence =
|
|
5329
|
-
const { hidden } =
|
|
5345
|
+
const parentSequence = useContext29(SequenceContext);
|
|
5346
|
+
const { hidden } = useContext29(SequenceVisibilityToggleContext);
|
|
5330
5347
|
const logLevel = useLogLevel();
|
|
5331
5348
|
const mountTime = useMountTime();
|
|
5332
5349
|
const [timelineId] = useState18(() => String(Math.random()));
|
|
@@ -5538,9 +5555,9 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
5538
5555
|
throw new RangeError(`Cannot use frame ${frame}: Duration of composition is ${durationInFrames}, therefore the highest frame that can be rendered is ${durationInFrames - 1}`);
|
|
5539
5556
|
}
|
|
5540
5557
|
}, flattenChildren = (children) => {
|
|
5541
|
-
const childrenArray =
|
|
5558
|
+
const childrenArray = React29.Children.toArray(children);
|
|
5542
5559
|
return childrenArray.reduce((flatChildren, child) => {
|
|
5543
|
-
if (child.type ===
|
|
5560
|
+
if (child.type === React29.Fragment) {
|
|
5544
5561
|
return flatChildren.concat(flattenChildren(child.props.children));
|
|
5545
5562
|
}
|
|
5546
5563
|
flatChildren.push(child);
|
|
@@ -5557,7 +5574,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
5557
5574
|
children
|
|
5558
5575
|
});
|
|
5559
5576
|
}, useRequireToBeInsideSeries = () => {
|
|
5560
|
-
const isInsideSeries =
|
|
5577
|
+
const isInsideSeries = React30.useContext(IsInsideSeriesContext);
|
|
5561
5578
|
if (!isInsideSeries) {
|
|
5562
5579
|
throw new Error("This component must be inside a <Series /> component.");
|
|
5563
5580
|
}
|
|
@@ -5849,12 +5866,13 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
5849
5866
|
const volumePropsFrame = useFrameForVolumeProp(loopVolumeCurveBehavior ?? "repeat");
|
|
5850
5867
|
const videoConfig = useUnsafeVideoConfig();
|
|
5851
5868
|
const videoRef = useRef17(null);
|
|
5852
|
-
const sequenceContext =
|
|
5869
|
+
const sequenceContext = useContext31(SequenceContext);
|
|
5853
5870
|
const mediaStartsAt = useMediaStartsAt();
|
|
5854
5871
|
const environment = useRemotionEnvironment();
|
|
5855
5872
|
const logLevel = useLogLevel();
|
|
5856
5873
|
const mountTime = useMountTime();
|
|
5857
|
-
const {
|
|
5874
|
+
const { delayRender: delayRender2, continueRender: continueRender2 } = useDelayRender();
|
|
5875
|
+
const { registerRenderAsset, unregisterRenderAsset } = useContext31(RenderAssetManager);
|
|
5858
5876
|
const id = useMemo30(() => `video-${random(props2.src ?? "")}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.relativeFrom}-${sequenceContext?.durationInFrames}`, [
|
|
5859
5877
|
props2.src,
|
|
5860
5878
|
sequenceContext?.cumulatedFrom,
|
|
@@ -5926,21 +5944,21 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
5926
5944
|
startFrom: -mediaStartsAt,
|
|
5927
5945
|
fps: videoConfig.fps
|
|
5928
5946
|
});
|
|
5929
|
-
const handle =
|
|
5947
|
+
const handle = delayRender2(`Rendering <Video /> with src="${props2.src}" at time ${currentTime}`, {
|
|
5930
5948
|
retries: delayRenderRetries ?? undefined,
|
|
5931
5949
|
timeoutInMilliseconds: delayRenderTimeoutInMilliseconds ?? undefined
|
|
5932
5950
|
});
|
|
5933
5951
|
if (window.process?.env?.NODE_ENV === "test") {
|
|
5934
|
-
|
|
5952
|
+
continueRender2(handle);
|
|
5935
5953
|
return;
|
|
5936
5954
|
}
|
|
5937
5955
|
if (isApproximatelyTheSame(current.currentTime, currentTime)) {
|
|
5938
5956
|
if (current.readyState >= 2) {
|
|
5939
|
-
|
|
5957
|
+
continueRender2(handle);
|
|
5940
5958
|
return;
|
|
5941
5959
|
}
|
|
5942
5960
|
const loadedDataHandler = () => {
|
|
5943
|
-
|
|
5961
|
+
continueRender2(handle);
|
|
5944
5962
|
};
|
|
5945
5963
|
current.addEventListener("loadeddata", loadedDataHandler, { once: true });
|
|
5946
5964
|
return () => {
|
|
@@ -5948,7 +5966,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
5948
5966
|
};
|
|
5949
5967
|
}
|
|
5950
5968
|
const endedHandler = () => {
|
|
5951
|
-
|
|
5969
|
+
continueRender2(handle);
|
|
5952
5970
|
};
|
|
5953
5971
|
const seek2 = seekToTimeMultipleUntilRight({
|
|
5954
5972
|
element: current,
|
|
@@ -5958,7 +5976,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
5958
5976
|
mountTime
|
|
5959
5977
|
});
|
|
5960
5978
|
seek2.prom.then(() => {
|
|
5961
|
-
|
|
5979
|
+
continueRender2(handle);
|
|
5962
5980
|
});
|
|
5963
5981
|
current.addEventListener("ended", endedHandler, { once: true });
|
|
5964
5982
|
const errorHandler = () => {
|
|
@@ -5977,7 +5995,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
5977
5995
|
seek2.cancel();
|
|
5978
5996
|
current.removeEventListener("ended", endedHandler);
|
|
5979
5997
|
current.removeEventListener("error", errorHandler);
|
|
5980
|
-
|
|
5998
|
+
continueRender2(handle);
|
|
5981
5999
|
};
|
|
5982
6000
|
}, [
|
|
5983
6001
|
volumePropsFrame,
|
|
@@ -5990,7 +6008,9 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
5990
6008
|
delayRenderRetries,
|
|
5991
6009
|
delayRenderTimeoutInMilliseconds,
|
|
5992
6010
|
logLevel,
|
|
5993
|
-
mountTime
|
|
6011
|
+
mountTime,
|
|
6012
|
+
continueRender2,
|
|
6013
|
+
delayRender2
|
|
5994
6014
|
]);
|
|
5995
6015
|
const { src } = props2;
|
|
5996
6016
|
if (environment.isRendering) {
|
|
@@ -5998,7 +6018,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
5998
6018
|
if (window.process?.env?.NODE_ENV === "test") {
|
|
5999
6019
|
return;
|
|
6000
6020
|
}
|
|
6001
|
-
const newHandle =
|
|
6021
|
+
const newHandle = delayRender2("Loading <Video> duration with src=" + src, {
|
|
6002
6022
|
retries: delayRenderRetries ?? undefined,
|
|
6003
6023
|
timeoutInMilliseconds: delayRenderTimeoutInMilliseconds ?? undefined
|
|
6004
6024
|
});
|
|
@@ -6007,19 +6027,26 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
6007
6027
|
if (current?.duration) {
|
|
6008
6028
|
onDuration(src, current.duration);
|
|
6009
6029
|
}
|
|
6010
|
-
|
|
6030
|
+
continueRender2(newHandle);
|
|
6011
6031
|
};
|
|
6012
6032
|
if (current?.duration) {
|
|
6013
6033
|
onDuration(src, current.duration);
|
|
6014
|
-
|
|
6034
|
+
continueRender2(newHandle);
|
|
6015
6035
|
} else {
|
|
6016
6036
|
current?.addEventListener("loadedmetadata", didLoad, { once: true });
|
|
6017
6037
|
}
|
|
6018
6038
|
return () => {
|
|
6019
6039
|
current?.removeEventListener("loadedmetadata", didLoad);
|
|
6020
|
-
|
|
6040
|
+
continueRender2(newHandle);
|
|
6021
6041
|
};
|
|
6022
|
-
}, [
|
|
6042
|
+
}, [
|
|
6043
|
+
src,
|
|
6044
|
+
onDuration,
|
|
6045
|
+
delayRenderRetries,
|
|
6046
|
+
delayRenderTimeoutInMilliseconds,
|
|
6047
|
+
continueRender2,
|
|
6048
|
+
delayRender2
|
|
6049
|
+
]);
|
|
6023
6050
|
}
|
|
6024
6051
|
return /* @__PURE__ */ jsx33("video", {
|
|
6025
6052
|
ref: videoRef,
|
|
@@ -6043,7 +6070,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
6043
6070
|
const { loop, ...propsOtherThanLoop } = props2;
|
|
6044
6071
|
const { fps } = useVideoConfig();
|
|
6045
6072
|
const environment = useRemotionEnvironment();
|
|
6046
|
-
const { durations, setDurations } =
|
|
6073
|
+
const { durations, setDurations } = useContext32(DurationsContext);
|
|
6047
6074
|
if (typeof ref === "string") {
|
|
6048
6075
|
throw new Error("string refs are not supported");
|
|
6049
6076
|
}
|
|
@@ -6141,12 +6168,13 @@ var init_esm = __esm(() => {
|
|
|
6141
6168
|
throw new Error(err.join(`
|
|
6142
6169
|
`));
|
|
6143
6170
|
}
|
|
6144
|
-
|
|
6171
|
+
RemotionEnvironmentContext = React4.createContext(null);
|
|
6172
|
+
originalCreateElement = React22.createElement;
|
|
6145
6173
|
componentsToAddStacksTo = [];
|
|
6146
6174
|
IsPlayerContext = createContext2(false);
|
|
6147
6175
|
AbsoluteFill = forwardRef(AbsoluteFillRefForwarding);
|
|
6148
6176
|
SequenceContext = createContext3(null);
|
|
6149
|
-
SequenceManager =
|
|
6177
|
+
SequenceManager = React42.createContext({
|
|
6150
6178
|
registerSequence: () => {
|
|
6151
6179
|
throw new Error("SequenceManagerContext not initialized");
|
|
6152
6180
|
},
|
|
@@ -6155,7 +6183,7 @@ var init_esm = __esm(() => {
|
|
|
6155
6183
|
},
|
|
6156
6184
|
sequences: []
|
|
6157
6185
|
});
|
|
6158
|
-
SequenceVisibilityToggleContext =
|
|
6186
|
+
SequenceVisibilityToggleContext = React42.createContext({
|
|
6159
6187
|
hidden: {},
|
|
6160
6188
|
setHidden: () => {
|
|
6161
6189
|
throw new Error("SequenceVisibilityToggle not initialized");
|
|
@@ -6216,8 +6244,8 @@ var init_esm = __esm(() => {
|
|
|
6216
6244
|
throw new Error("Not implemented");
|
|
6217
6245
|
}
|
|
6218
6246
|
});
|
|
6219
|
-
editorPropsProviderRef =
|
|
6220
|
-
timeValueRef =
|
|
6247
|
+
editorPropsProviderRef = React5.createRef();
|
|
6248
|
+
timeValueRef = React5.createRef();
|
|
6221
6249
|
validCodecs = [
|
|
6222
6250
|
"h264",
|
|
6223
6251
|
"h265",
|
|
@@ -6291,7 +6319,7 @@ var init_esm = __esm(() => {
|
|
|
6291
6319
|
if (typeof window !== "undefined") {
|
|
6292
6320
|
window.remotion_delayRenderTimeouts = {};
|
|
6293
6321
|
}
|
|
6294
|
-
Canvas =
|
|
6322
|
+
Canvas = React9.forwardRef(CanvasRefForwardingFunction);
|
|
6295
6323
|
AnimatedImage = forwardRef3(({
|
|
6296
6324
|
src,
|
|
6297
6325
|
width,
|
|
@@ -6312,7 +6340,8 @@ var init_esm = __esm(() => {
|
|
|
6312
6340
|
}, []);
|
|
6313
6341
|
const resolvedSrc = resolveAnimatedImageSource(src);
|
|
6314
6342
|
const [imageDecoder, setImageDecoder] = useState6(null);
|
|
6315
|
-
const
|
|
6343
|
+
const { delayRender: delayRender2, continueRender: continueRender2 } = useDelayRender();
|
|
6344
|
+
const [decodeHandle] = useState6(() => delayRender2(`Rendering <AnimatedImage/> with src="${resolvedSrc}"`));
|
|
6316
6345
|
const frame = useCurrentFrame();
|
|
6317
6346
|
const { fps } = useVideoConfig();
|
|
6318
6347
|
const currentTime = frame / playbackRate / fps;
|
|
@@ -6336,15 +6365,15 @@ var init_esm = __esm(() => {
|
|
|
6336
6365
|
initialLoopBehavior
|
|
6337
6366
|
}).then((d) => {
|
|
6338
6367
|
setImageDecoder(d);
|
|
6339
|
-
|
|
6368
|
+
continueRender2(decodeHandle);
|
|
6340
6369
|
}).catch((err) => {
|
|
6341
6370
|
if (err.name === "AbortError") {
|
|
6342
|
-
|
|
6371
|
+
continueRender2(decodeHandle);
|
|
6343
6372
|
return;
|
|
6344
6373
|
}
|
|
6345
6374
|
if (onError) {
|
|
6346
6375
|
onError?.(err);
|
|
6347
|
-
|
|
6376
|
+
continueRender2(decodeHandle);
|
|
6348
6377
|
} else {
|
|
6349
6378
|
cancelRender(err);
|
|
6350
6379
|
}
|
|
@@ -6352,12 +6381,18 @@ var init_esm = __esm(() => {
|
|
|
6352
6381
|
return () => {
|
|
6353
6382
|
controller.abort();
|
|
6354
6383
|
};
|
|
6355
|
-
}, [
|
|
6384
|
+
}, [
|
|
6385
|
+
resolvedSrc,
|
|
6386
|
+
decodeHandle,
|
|
6387
|
+
onError,
|
|
6388
|
+
initialLoopBehavior,
|
|
6389
|
+
continueRender2
|
|
6390
|
+
]);
|
|
6356
6391
|
useLayoutEffect(() => {
|
|
6357
6392
|
if (!imageDecoder) {
|
|
6358
6393
|
return;
|
|
6359
6394
|
}
|
|
6360
|
-
const delay =
|
|
6395
|
+
const delay = delayRender2(`Rendering frame at ${currentTime} of <AnimatedImage src="${src}"/>`);
|
|
6361
6396
|
imageDecoder.getFrame(currentTime, loopBehavior).then((videoFrame) => {
|
|
6362
6397
|
if (mountState.current.isMounted) {
|
|
6363
6398
|
if (videoFrame === null) {
|
|
@@ -6366,16 +6401,24 @@ var init_esm = __esm(() => {
|
|
|
6366
6401
|
ref.current?.draw(videoFrame.frame);
|
|
6367
6402
|
}
|
|
6368
6403
|
}
|
|
6369
|
-
|
|
6404
|
+
continueRender2(delay);
|
|
6370
6405
|
}).catch((err) => {
|
|
6371
6406
|
if (onError) {
|
|
6372
6407
|
onError(err);
|
|
6373
|
-
|
|
6408
|
+
continueRender2(delay);
|
|
6374
6409
|
} else {
|
|
6375
6410
|
cancelRender(err);
|
|
6376
6411
|
}
|
|
6377
6412
|
});
|
|
6378
|
-
}, [
|
|
6413
|
+
}, [
|
|
6414
|
+
currentTime,
|
|
6415
|
+
imageDecoder,
|
|
6416
|
+
loopBehavior,
|
|
6417
|
+
onError,
|
|
6418
|
+
src,
|
|
6419
|
+
continueRender2,
|
|
6420
|
+
delayRender2
|
|
6421
|
+
]);
|
|
6379
6422
|
return /* @__PURE__ */ jsx102(Canvas, {
|
|
6380
6423
|
ref,
|
|
6381
6424
|
width,
|
|
@@ -6412,7 +6455,7 @@ var init_esm = __esm(() => {
|
|
|
6412
6455
|
});
|
|
6413
6456
|
SharedAudioContext = createContext15(null);
|
|
6414
6457
|
didWarn = {};
|
|
6415
|
-
BufferingContextReact =
|
|
6458
|
+
BufferingContextReact = React15.createContext(null);
|
|
6416
6459
|
alreadyWarned = {};
|
|
6417
6460
|
MediaVolumeContext = createContext16({
|
|
6418
6461
|
mediaMuted: false,
|
|
@@ -6451,7 +6494,7 @@ var init_esm = __esm(() => {
|
|
|
6451
6494
|
kSampleStepSize = 1 / (kSplineTableSize - 1);
|
|
6452
6495
|
IFrame = forwardRef7(IFrameRefForwarding);
|
|
6453
6496
|
Img = forwardRef8(ImgRefForwarding);
|
|
6454
|
-
compositionsRef =
|
|
6497
|
+
compositionsRef = React24.createRef();
|
|
6455
6498
|
exports_default_css = {};
|
|
6456
6499
|
__export2(exports_default_css, {
|
|
6457
6500
|
makeDefaultPreviewCSS: () => makeDefaultPreviewCSS,
|
|
@@ -6460,7 +6503,7 @@ var init_esm = __esm(() => {
|
|
|
6460
6503
|
});
|
|
6461
6504
|
injected = {};
|
|
6462
6505
|
listeners = [];
|
|
6463
|
-
CurrentScaleContext =
|
|
6506
|
+
CurrentScaleContext = React26.createContext(null);
|
|
6464
6507
|
PreviewSizeContext = createContext18({
|
|
6465
6508
|
setSize: () => {
|
|
6466
6509
|
return;
|
|
@@ -6544,7 +6587,8 @@ var init_esm = __esm(() => {
|
|
|
6544
6587
|
useLogLevel,
|
|
6545
6588
|
playbackLogging,
|
|
6546
6589
|
timeValueRef,
|
|
6547
|
-
compositionSelectorRef
|
|
6590
|
+
compositionSelectorRef,
|
|
6591
|
+
RemotionEnvironmentContext
|
|
6548
6592
|
};
|
|
6549
6593
|
PERCENTAGE = NUMBER + "%";
|
|
6550
6594
|
IsInsideSeriesContext = createContext19(false);
|
|
@@ -6684,12 +6728,13 @@ var getLottieMetadata = (animationData) => {
|
|
|
6684
6728
|
const containerRef = useRef21(null);
|
|
6685
6729
|
const onAnimationLoadedRef = useRef21(onAnimationLoaded);
|
|
6686
6730
|
onAnimationLoadedRef.current = onAnimationLoaded;
|
|
6731
|
+
const { delayRender, continueRender } = useDelayRender();
|
|
6687
6732
|
const [handle] = useState24(() => delayRender("Waiting for Lottie animation to load"));
|
|
6688
6733
|
useEffect26(() => {
|
|
6689
6734
|
return () => {
|
|
6690
6735
|
continueRender(handle);
|
|
6691
6736
|
};
|
|
6692
|
-
}, [handle]);
|
|
6737
|
+
}, [handle, continueRender]);
|
|
6693
6738
|
const frame = useCurrentFrame();
|
|
6694
6739
|
currentFrameRef.current = frame;
|
|
6695
6740
|
useEffect26(() => {
|
|
@@ -6734,7 +6779,8 @@ var getLottieMetadata = (animationData) => {
|
|
|
6734
6779
|
loop,
|
|
6735
6780
|
playbackRate,
|
|
6736
6781
|
preserveAspectRatio,
|
|
6737
|
-
renderer
|
|
6782
|
+
renderer,
|
|
6783
|
+
continueRender
|
|
6738
6784
|
]);
|
|
6739
6785
|
useEffect26(() => {
|
|
6740
6786
|
if (animationRef.current && direction) {
|
|
@@ -6770,7 +6816,7 @@ var getLottieMetadata = (animationData) => {
|
|
|
6770
6816
|
}, { once: true });
|
|
6771
6817
|
img.setAttributeNS("http://www.w3.org/1999/xlink", "xlink:href", img.href.baseVal);
|
|
6772
6818
|
});
|
|
6773
|
-
}, [direction, frame, loop, playbackRate]);
|
|
6819
|
+
}, [direction, frame, loop, playbackRate, delayRender, continueRender]);
|
|
6774
6820
|
return /* @__PURE__ */ jsx41("div", {
|
|
6775
6821
|
ref: containerRef,
|
|
6776
6822
|
className: className2,
|
|
@@ -11738,15 +11784,15 @@ init_esm();
|
|
|
11738
11784
|
init_esm();
|
|
11739
11785
|
import { jsx as jsx35, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
11740
11786
|
import { jsx as jsx210, jsxs as jsxs23, Fragment } from "react/jsx-runtime";
|
|
11741
|
-
import
|
|
11787
|
+
import React8 from "react";
|
|
11742
11788
|
import { useContext as useContext210, useEffect as useEffect23, useState as useState20 } from "react";
|
|
11743
|
-
import { useContext as
|
|
11789
|
+
import { useContext as useContext33, useEffect as useEffect24 } from "react";
|
|
11744
11790
|
import { jsx as jsx36 } from "react/jsx-runtime";
|
|
11745
11791
|
import { useCallback as useCallback18, useRef as useRef18 } from "react";
|
|
11746
11792
|
import { useEffect as useEffect32, useState as useState23 } from "react";
|
|
11747
11793
|
import { useContext as useContext42, useEffect as useEffect62, useRef as useRef42 } from "react";
|
|
11748
11794
|
import { useEffect as useEffect42 } from "react";
|
|
11749
|
-
import { useCallback as useCallback23, useContext as
|
|
11795
|
+
import { useCallback as useCallback23, useContext as useContext34, useMemo as useMemo31, useRef as useRef22, useState as useState32 } from "react";
|
|
11750
11796
|
import { useEffect as useEffect52, useRef as useRef32 } from "react";
|
|
11751
11797
|
import { useCallback as useCallback32, useEffect as useEffect72, useMemo as useMemo210, useState as useState42 } from "react";
|
|
11752
11798
|
import {
|
|
@@ -11758,7 +11804,7 @@ import {
|
|
|
11758
11804
|
useRef as useRef112,
|
|
11759
11805
|
useState as useState132
|
|
11760
11806
|
} from "react";
|
|
11761
|
-
import
|
|
11807
|
+
import React102, {
|
|
11762
11808
|
Suspense as Suspense2,
|
|
11763
11809
|
forwardRef as forwardRef13,
|
|
11764
11810
|
useCallback as useCallback112,
|
|
@@ -11801,6 +11847,7 @@ import { useCallback as useCallback122, useMemo as useMemo132, useState as useSt
|
|
|
11801
11847
|
import { jsx as jsx132 } from "react/jsx-runtime";
|
|
11802
11848
|
|
|
11803
11849
|
// ../core/dist/esm/no-react.mjs
|
|
11850
|
+
import React6 from "react";
|
|
11804
11851
|
function interpolateFunction2(input, inputRange, outputRange, options) {
|
|
11805
11852
|
const { extrapolateLeft, extrapolateRight, easing } = options;
|
|
11806
11853
|
let result = input;
|
|
@@ -11900,6 +11947,7 @@ function interpolate2(input, inputRange, outputRange, options) {
|
|
|
11900
11947
|
extrapolateRight
|
|
11901
11948
|
});
|
|
11902
11949
|
}
|
|
11950
|
+
var RemotionEnvironmentContext2 = React6.createContext(null);
|
|
11903
11951
|
function truthy2(value) {
|
|
11904
11952
|
return Boolean(value);
|
|
11905
11953
|
}
|
|
@@ -12758,8 +12806,8 @@ var calculateOuter = ({
|
|
|
12758
12806
|
overflow: overflowVisible ? "visible" : "hidden"
|
|
12759
12807
|
};
|
|
12760
12808
|
};
|
|
12761
|
-
var PlayerEventEmitterContext =
|
|
12762
|
-
var ThumbnailEmitterContext =
|
|
12809
|
+
var PlayerEventEmitterContext = React8.createContext(undefined);
|
|
12810
|
+
var ThumbnailEmitterContext = React8.createContext(undefined);
|
|
12763
12811
|
|
|
12764
12812
|
class PlayerEmitter {
|
|
12765
12813
|
listeners = {
|
|
@@ -12873,7 +12921,7 @@ class ThumbnailEmitter {
|
|
|
12873
12921
|
};
|
|
12874
12922
|
}
|
|
12875
12923
|
var useBufferStateEmitter = (emitter) => {
|
|
12876
|
-
const bufferManager =
|
|
12924
|
+
const bufferManager = useContext33(Internals.BufferingContextReact);
|
|
12877
12925
|
if (!bufferManager) {
|
|
12878
12926
|
throw new Error("BufferingContextReact not found");
|
|
12879
12927
|
}
|
|
@@ -12956,20 +13004,20 @@ var usePlayer = () => {
|
|
|
12956
13004
|
const playStart = useRef22(frame);
|
|
12957
13005
|
const setFrame = Internals.Timeline.useTimelineSetFrame();
|
|
12958
13006
|
const setTimelinePosition = Internals.Timeline.useTimelineSetFrame();
|
|
12959
|
-
const audioContext =
|
|
12960
|
-
const { audioAndVideoTags } =
|
|
13007
|
+
const audioContext = useContext34(Internals.SharedAudioContext);
|
|
13008
|
+
const { audioAndVideoTags } = useContext34(Internals.Timeline.TimelineContext);
|
|
12961
13009
|
const frameRef = useRef22(frame);
|
|
12962
13010
|
frameRef.current = frame;
|
|
12963
13011
|
const video = Internals.useVideo();
|
|
12964
13012
|
const config = Internals.useUnsafeVideoConfig();
|
|
12965
|
-
const emitter =
|
|
13013
|
+
const emitter = useContext34(PlayerEventEmitterContext);
|
|
12966
13014
|
const lastFrame = (config?.durationInFrames ?? 1) - 1;
|
|
12967
13015
|
const isLastFrame = frame === lastFrame;
|
|
12968
13016
|
const isFirstFrame = frame === 0;
|
|
12969
13017
|
if (!emitter) {
|
|
12970
13018
|
throw new TypeError("Expected Player event emitter context");
|
|
12971
13019
|
}
|
|
12972
|
-
const bufferingContext =
|
|
13020
|
+
const bufferingContext = useContext34(Internals.BufferingContextReact);
|
|
12973
13021
|
if (!bufferingContext) {
|
|
12974
13022
|
throw new Error("Missing the buffering context. Most likely you have a Remotion version mismatch.");
|
|
12975
13023
|
}
|
|
@@ -14628,7 +14676,7 @@ var useClickPreventionOnDoubleClick = (onClick, onDoubleClick, doubleClickToFull
|
|
|
14628
14676
|
}, [doubleClickToFullscreen, handleDoubleClick, handlePointerDown, onClick]);
|
|
14629
14677
|
return returnValue;
|
|
14630
14678
|
};
|
|
14631
|
-
var reactVersion =
|
|
14679
|
+
var reactVersion = React102.version.split(".")[0];
|
|
14632
14680
|
if (reactVersion === "0") {
|
|
14633
14681
|
throw new Error(`Version ${reactVersion} of "react" is not supported by Remotion`);
|
|
14634
14682
|
}
|
|
@@ -15192,26 +15240,38 @@ var SharedPlayerContexts = ({
|
|
|
15192
15240
|
mountTime: Date.now()
|
|
15193
15241
|
};
|
|
15194
15242
|
}, [logLevel]);
|
|
15195
|
-
|
|
15196
|
-
|
|
15197
|
-
|
|
15198
|
-
|
|
15199
|
-
|
|
15200
|
-
|
|
15201
|
-
|
|
15202
|
-
|
|
15203
|
-
|
|
15204
|
-
|
|
15205
|
-
|
|
15206
|
-
|
|
15207
|
-
|
|
15208
|
-
|
|
15209
|
-
|
|
15210
|
-
|
|
15211
|
-
|
|
15212
|
-
|
|
15213
|
-
|
|
15214
|
-
|
|
15243
|
+
const env = useMemo132(() => {
|
|
15244
|
+
return {
|
|
15245
|
+
isPlayer: true,
|
|
15246
|
+
isRendering: false,
|
|
15247
|
+
isStudio: false,
|
|
15248
|
+
isClientSideRendering: false,
|
|
15249
|
+
isReadOnlyStudio: false
|
|
15250
|
+
};
|
|
15251
|
+
}, []);
|
|
15252
|
+
return /* @__PURE__ */ jsx132(Internals.RemotionEnvironmentContext, {
|
|
15253
|
+
value: env,
|
|
15254
|
+
children: /* @__PURE__ */ jsx132(Internals.LogLevelContext.Provider, {
|
|
15255
|
+
value: logLevelContext,
|
|
15256
|
+
children: /* @__PURE__ */ jsx132(Internals.CanUseRemotionHooksProvider, {
|
|
15257
|
+
children: /* @__PURE__ */ jsx132(Internals.Timeline.TimelineContext.Provider, {
|
|
15258
|
+
value: timelineContext,
|
|
15259
|
+
children: /* @__PURE__ */ jsx132(Internals.CompositionManager.Provider, {
|
|
15260
|
+
value: compositionManagerContext,
|
|
15261
|
+
children: /* @__PURE__ */ jsx132(Internals.ResolveCompositionConfig, {
|
|
15262
|
+
children: /* @__PURE__ */ jsx132(Internals.PrefetchProvider, {
|
|
15263
|
+
children: /* @__PURE__ */ jsx132(Internals.DurationsContextProvider, {
|
|
15264
|
+
children: /* @__PURE__ */ jsx132(Internals.MediaVolumeContext.Provider, {
|
|
15265
|
+
value: mediaVolumeContextValue,
|
|
15266
|
+
children: /* @__PURE__ */ jsx132(Internals.SetMediaVolumeContext.Provider, {
|
|
15267
|
+
value: setMediaVolumeContextValue,
|
|
15268
|
+
children: /* @__PURE__ */ jsx132(Internals.SharedAudioContextProvider, {
|
|
15269
|
+
numberOfAudioTags: numberOfSharedAudioTags,
|
|
15270
|
+
component,
|
|
15271
|
+
audioLatencyHint,
|
|
15272
|
+
children: /* @__PURE__ */ jsx132(Internals.BufferingProvider, {
|
|
15273
|
+
children
|
|
15274
|
+
})
|
|
15215
15275
|
})
|
|
15216
15276
|
})
|
|
15217
15277
|
})
|
|
@@ -15381,9 +15441,7 @@ var PlayerFn = ({
|
|
|
15381
15441
|
...componentProps
|
|
15382
15442
|
}, ref) => {
|
|
15383
15443
|
if (typeof window !== "undefined") {
|
|
15384
|
-
|
|
15385
|
-
window.remotion_isPlayer = true;
|
|
15386
|
-
}, []);
|
|
15444
|
+
window.remotion_isPlayer = true;
|
|
15387
15445
|
}
|
|
15388
15446
|
if (componentProps.defaultProps !== undefined) {
|
|
15389
15447
|
throw new Error("The <Player /> component does not accept `defaultProps`, but some were passed. Use `inputProps` instead.");
|
|
@@ -16535,9 +16593,9 @@ var UNDERLAY_RED = curriedTransparentize$1(0.9, RED);
|
|
|
16535
16593
|
var BLUE_TEXT = curriedDarken$1(0.3, "#42e9f5");
|
|
16536
16594
|
|
|
16537
16595
|
// src/components/homepage/layout/use-color-mode.tsx
|
|
16538
|
-
import
|
|
16596
|
+
import React11, { useContext as useContext35, useMemo as useMemo33 } from "react";
|
|
16539
16597
|
import { jsx as jsx37 } from "react/jsx-runtime";
|
|
16540
|
-
var Context =
|
|
16598
|
+
var Context = React11.createContext(undefined);
|
|
16541
16599
|
var ColorModeProvider = ({
|
|
16542
16600
|
children,
|
|
16543
16601
|
colorMode,
|
|
@@ -16552,7 +16610,7 @@ var ColorModeProvider = ({
|
|
|
16552
16610
|
});
|
|
16553
16611
|
};
|
|
16554
16612
|
function useColorMode() {
|
|
16555
|
-
const context =
|
|
16613
|
+
const context = useContext35(Context);
|
|
16556
16614
|
if (context === null || context === undefined) {
|
|
16557
16615
|
throw new Error("ColorModeProvider");
|
|
16558
16616
|
}
|
|
@@ -16952,6 +17010,7 @@ var DisplayedEmoji = ({ emoji }) => {
|
|
|
16952
17010
|
const [data, setData] = useState26(null);
|
|
16953
17011
|
const { durationInFrames, fps } = useVideoConfig();
|
|
16954
17012
|
const [browser, setBrowser] = useState26(typeof document !== "undefined");
|
|
17013
|
+
const { delayRender, continueRender } = useDelayRender();
|
|
16955
17014
|
const src = useMemo34(() => {
|
|
16956
17015
|
if (emoji === "melting") {
|
|
16957
17016
|
return "https://fonts.gstatic.com/s/e/notoemoji/latest/1fae0/lottie.json";
|
|
@@ -16982,7 +17041,7 @@ var DisplayedEmoji = ({ emoji }) => {
|
|
|
16982
17041
|
}).catch((err) => {
|
|
16983
17042
|
cancelRender(err);
|
|
16984
17043
|
});
|
|
16985
|
-
}, [handle, src]);
|
|
17044
|
+
}, [handle, src, continueRender]);
|
|
16986
17045
|
useEffect27(() => {
|
|
16987
17046
|
if (typeof document !== "undefined") {
|
|
16988
17047
|
setBrowser(true);
|
|
@@ -17679,7 +17738,7 @@ var DemoError = () => {
|
|
|
17679
17738
|
};
|
|
17680
17739
|
|
|
17681
17740
|
// src/components/homepage/Demo/DemoRender.tsx
|
|
17682
|
-
import
|
|
17741
|
+
import React37, { useCallback as useCallback28 } from "react";
|
|
17683
17742
|
import { z } from "zod";
|
|
17684
17743
|
|
|
17685
17744
|
// src/components/homepage/Demo/DemoErrorIcon.tsx
|
|
@@ -17753,7 +17812,7 @@ var DoneCheckmark = () => {
|
|
|
17753
17812
|
};
|
|
17754
17813
|
|
|
17755
17814
|
// ../shapes/dist/esm/index.mjs
|
|
17756
|
-
import
|
|
17815
|
+
import React34, { useMemo as useMemo37 } from "react";
|
|
17757
17816
|
import { version } from "react-dom";
|
|
17758
17817
|
import { jsx as jsx60, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
17759
17818
|
import { jsx as jsx212 } from "react/jsx-runtime";
|
|
@@ -18035,7 +18094,7 @@ var style2 = {
|
|
|
18035
18094
|
justifyContent: "center"
|
|
18036
18095
|
};
|
|
18037
18096
|
var RenderButton = ({ renderData, onError }) => {
|
|
18038
|
-
const [state, setState] =
|
|
18097
|
+
const [state, setState] = React37.useState({
|
|
18039
18098
|
type: "idle"
|
|
18040
18099
|
});
|
|
18041
18100
|
const triggerRender = useCallback28(async () => {
|
|
@@ -18612,7 +18671,7 @@ var PlayerVolume = ({ playerRef }) => {
|
|
|
18612
18671
|
};
|
|
18613
18672
|
|
|
18614
18673
|
// src/components/homepage/Demo/PlayPauseButton.tsx
|
|
18615
|
-
import
|
|
18674
|
+
import React40, { useCallback as useCallback33, useEffect as useEffect36 } from "react";
|
|
18616
18675
|
import { jsx as jsx77 } from "react/jsx-runtime";
|
|
18617
18676
|
var playerButtonStyle2 = {
|
|
18618
18677
|
appearance: "none",
|
|
@@ -18629,7 +18688,7 @@ var playerButtonStyle2 = {
|
|
|
18629
18688
|
color: PALETTE.TEXT_COLOR
|
|
18630
18689
|
};
|
|
18631
18690
|
var PlayPauseButton = ({ playerRef }) => {
|
|
18632
|
-
const [playing, setPlaying] =
|
|
18691
|
+
const [playing, setPlaying] = React40.useState(true);
|
|
18633
18692
|
useEffect36(() => {
|
|
18634
18693
|
const { current } = playerRef;
|
|
18635
18694
|
if (!current) {
|
|
@@ -18667,7 +18726,7 @@ var PlayPauseButton = ({ playerRef }) => {
|
|
|
18667
18726
|
};
|
|
18668
18727
|
|
|
18669
18728
|
// src/components/homepage/Demo/TimeDisplay.tsx
|
|
18670
|
-
import
|
|
18729
|
+
import React41, { useEffect as useEffect37 } from "react";
|
|
18671
18730
|
import { jsx as jsx78 } from "react/jsx-runtime";
|
|
18672
18731
|
var formatTime2 = (timeInSeconds) => {
|
|
18673
18732
|
const minutes = Math.floor(timeInSeconds / 60);
|
|
@@ -18675,7 +18734,7 @@ var formatTime2 = (timeInSeconds) => {
|
|
|
18675
18734
|
return `${String(minutes)}:${String(seconds).padStart(2, "0")}`;
|
|
18676
18735
|
};
|
|
18677
18736
|
var TimeDisplay = ({ fps, playerRef }) => {
|
|
18678
|
-
const [time, setTime] =
|
|
18737
|
+
const [time, setTime] = React41.useState(0);
|
|
18679
18738
|
useEffect37(() => {
|
|
18680
18739
|
const { current } = playerRef;
|
|
18681
18740
|
if (!current) {
|
|
@@ -18754,7 +18813,7 @@ var PlayerControls = ({ playerRef, durationInFrames, fps, children }) => {
|
|
|
18754
18813
|
};
|
|
18755
18814
|
|
|
18756
18815
|
// src/components/homepage/Demo/ThemeNudge.tsx
|
|
18757
|
-
import
|
|
18816
|
+
import React43 from "react";
|
|
18758
18817
|
import { jsx as jsx80, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
18759
18818
|
var origWidth3 = 21;
|
|
18760
18819
|
var scale3 = 0.4;
|
|
@@ -18776,7 +18835,7 @@ var Icon3 = () => {
|
|
|
18776
18835
|
};
|
|
18777
18836
|
var ThemeNudge = () => {
|
|
18778
18837
|
const { colorMode, setColorMode } = useColorMode();
|
|
18779
|
-
const toggleTheme =
|
|
18838
|
+
const toggleTheme = React43.useCallback((e) => {
|
|
18780
18839
|
e.preventDefault();
|
|
18781
18840
|
setColorMode(colorMode === "dark" ? "light" : "dark");
|
|
18782
18841
|
}, [colorMode, setColorMode]);
|