remotion 4.0.476 → 4.0.477
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/CompositionManager.d.ts +2 -0
- package/dist/cjs/HtmlInCanvas.js +2 -0
- package/dist/cjs/Img.d.ts +8 -2
- package/dist/cjs/Img.js +7 -5
- package/dist/cjs/Interactive.d.ts +1 -1
- package/dist/cjs/Interactive.js +4 -2
- package/dist/cjs/Sequence.d.ts +1 -0
- package/dist/cjs/Sequence.js +29 -2
- package/dist/cjs/animated-image/AnimatedImage.js +2 -0
- package/dist/cjs/canvas-image/CanvasImage.d.ts +7 -1
- package/dist/cjs/canvas-image/CanvasImage.js +4 -2
- package/dist/cjs/canvas-image/props.d.ts +1 -1
- package/dist/cjs/effects/Solid.d.ts +1 -1
- package/dist/cjs/effects/Solid.js +4 -2
- package/dist/cjs/index.d.ts +2 -2
- package/dist/cjs/internals.d.ts +16 -3
- package/dist/cjs/internals.js +1 -0
- package/dist/cjs/interpolate-translate.d.ts +8 -0
- package/dist/cjs/interpolate-translate.js +70 -0
- package/dist/cjs/no-react.d.ts +6 -0
- package/dist/cjs/sequence-field-schema.d.ts +19 -1
- package/dist/cjs/sequence-field-schema.js +9 -1
- package/dist/cjs/series/index.d.ts +1 -1
- package/dist/cjs/series/index.js +1 -0
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/wrap-in-schema.d.ts +2 -1
- package/dist/cjs/wrap-in-schema.js +2 -1
- package/dist/esm/index.mjs +130 -66
- package/dist/esm/no-react.mjs +8 -0
- package/dist/esm/version.mjs +1 -1
- package/package.json +2 -2
package/dist/esm/index.mjs
CHANGED
|
@@ -1291,7 +1291,7 @@ var addSequenceStackTraces = (component) => {
|
|
|
1291
1291
|
};
|
|
1292
1292
|
|
|
1293
1293
|
// src/version.ts
|
|
1294
|
-
var VERSION = "4.0.
|
|
1294
|
+
var VERSION = "4.0.477";
|
|
1295
1295
|
|
|
1296
1296
|
// src/multiple-versions-warning.ts
|
|
1297
1297
|
var checkMultipleRemotionVersions = () => {
|
|
@@ -1330,6 +1330,7 @@ var Null = () => {
|
|
|
1330
1330
|
// src/Sequence.tsx
|
|
1331
1331
|
import {
|
|
1332
1332
|
forwardRef as forwardRef3,
|
|
1333
|
+
useCallback as useCallback6,
|
|
1333
1334
|
useContext as useContext17,
|
|
1334
1335
|
useEffect as useEffect3,
|
|
1335
1336
|
useMemo as useMemo14,
|
|
@@ -1811,10 +1812,17 @@ var fromField = {
|
|
|
1811
1812
|
step: 1,
|
|
1812
1813
|
hiddenFromList: true
|
|
1813
1814
|
};
|
|
1815
|
+
var freezeField = {
|
|
1816
|
+
type: "number",
|
|
1817
|
+
default: null,
|
|
1818
|
+
step: 1,
|
|
1819
|
+
hiddenFromList: true
|
|
1820
|
+
};
|
|
1814
1821
|
var sequenceSchema = extendSchemaWithSequenceName({
|
|
1815
1822
|
hidden: hiddenField,
|
|
1816
1823
|
showInTimeline: showInTimelineField,
|
|
1817
1824
|
from: fromField,
|
|
1825
|
+
freeze: freezeField,
|
|
1818
1826
|
durationInFrames: durationInFramesField,
|
|
1819
1827
|
layout: {
|
|
1820
1828
|
type: "enum",
|
|
@@ -1829,6 +1837,7 @@ var sequenceSchema = extendSchemaWithSequenceName({
|
|
|
1829
1837
|
var sequenceSchemaWithoutFrom = extendSchemaWithSequenceName({
|
|
1830
1838
|
hidden: hiddenField,
|
|
1831
1839
|
showInTimeline: showInTimelineField,
|
|
1840
|
+
freeze: freezeField,
|
|
1832
1841
|
durationInFrames: durationInFramesField,
|
|
1833
1842
|
layout: sequenceSchema.layout
|
|
1834
1843
|
});
|
|
@@ -4075,6 +4084,7 @@ var mergeValues = ({
|
|
|
4075
4084
|
var stackToOverrideMap = {};
|
|
4076
4085
|
var wrapInSchema = ({
|
|
4077
4086
|
Component,
|
|
4087
|
+
componentIdentity,
|
|
4078
4088
|
schema,
|
|
4079
4089
|
supportsEffects
|
|
4080
4090
|
}) => {
|
|
@@ -4121,7 +4131,8 @@ var wrapInSchema = ({
|
|
|
4121
4131
|
schema: schemaWithSequenceName,
|
|
4122
4132
|
currentRuntimeValueDotNotation,
|
|
4123
4133
|
overrideId,
|
|
4124
|
-
supportsEffects
|
|
4134
|
+
supportsEffects,
|
|
4135
|
+
componentIdentity
|
|
4125
4136
|
};
|
|
4126
4137
|
}, [currentRuntimeValueDotNotation, overrideId]);
|
|
4127
4138
|
const { merged: valuesDotNotation, propsToDelete } = useMemo13(() => {
|
|
@@ -4161,6 +4172,7 @@ import { jsx as jsx12 } from "react/jsx-runtime";
|
|
|
4161
4172
|
var EMPTY_EFFECTS = [];
|
|
4162
4173
|
var RegularSequenceRefForwardingFunction = ({
|
|
4163
4174
|
from = 0,
|
|
4175
|
+
freeze,
|
|
4164
4176
|
durationInFrames = Infinity,
|
|
4165
4177
|
children,
|
|
4166
4178
|
name,
|
|
@@ -4176,7 +4188,7 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
4176
4188
|
_remotionInternalPremountDisplay: premountDisplay,
|
|
4177
4189
|
_remotionInternalPostmountDisplay: postmountDisplay,
|
|
4178
4190
|
_remotionInternalIsMedia: isMedia,
|
|
4179
|
-
_remotionInternalRefForOutline:
|
|
4191
|
+
_remotionInternalRefForOutline: passedRefForOutline,
|
|
4180
4192
|
...other
|
|
4181
4193
|
}, ref) => {
|
|
4182
4194
|
const { layout = "absolute-fill" } = other;
|
|
@@ -4204,11 +4216,24 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
4204
4216
|
if (!Number.isFinite(from)) {
|
|
4205
4217
|
throw new TypeError(`The "from" prop of a sequence must be finite, but got ${from}.`);
|
|
4206
4218
|
}
|
|
4219
|
+
if (typeof freeze !== "undefined" && freeze !== null) {
|
|
4220
|
+
if (typeof freeze !== "number") {
|
|
4221
|
+
throw new TypeError(`The "freeze" prop of <Sequence /> must be a number, but is of type ${typeof freeze}.`);
|
|
4222
|
+
}
|
|
4223
|
+
if (Number.isNaN(freeze)) {
|
|
4224
|
+
throw new TypeError(`The "freeze" prop of <Sequence /> must be a real number, but it is NaN.`);
|
|
4225
|
+
}
|
|
4226
|
+
if (!Number.isFinite(freeze)) {
|
|
4227
|
+
throw new TypeError(`The "freeze" prop of <Sequence /> must be finite, but it is ${freeze}.`);
|
|
4228
|
+
}
|
|
4229
|
+
}
|
|
4207
4230
|
const absoluteFrame = useTimelinePosition();
|
|
4208
4231
|
const videoConfig = useVideoConfig();
|
|
4209
4232
|
const parentSequenceDuration = parentSequence ? Math.min(parentSequence.durationInFrames - from, durationInFrames) : durationInFrames;
|
|
4210
4233
|
const actualDurationInFrames = Math.max(0, Math.min(videoConfig.durationInFrames - from, parentSequenceDuration));
|
|
4211
4234
|
const { registerSequence, unregisterSequence } = useContext17(SequenceManager);
|
|
4235
|
+
const wrapperRefForOutline = useRef6(null);
|
|
4236
|
+
const refForOutline = other.layout === "none" ? passedRefForOutline ?? null : passedRefForOutline ?? wrapperRefForOutline;
|
|
4212
4237
|
const premounting = useMemo14(() => {
|
|
4213
4238
|
return parentSequence?.premounting || Boolean(other._remotionInternalIsPremounting);
|
|
4214
4239
|
}, [other._remotionInternalIsPremounting, parentSequence?.premounting]);
|
|
@@ -4367,7 +4392,19 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
4367
4392
|
]);
|
|
4368
4393
|
const endThreshold = Math.ceil(cumulatedFrom + from + durationInFrames - 1);
|
|
4369
4394
|
const content = absoluteFrame < cumulatedFrom + from ? null : absoluteFrame > endThreshold ? null : children;
|
|
4395
|
+
const frozenContent = content === null || typeof freeze === "undefined" || freeze === null ? content : /* @__PURE__ */ jsx12(Freeze, {
|
|
4396
|
+
frame: freeze,
|
|
4397
|
+
children: content
|
|
4398
|
+
});
|
|
4370
4399
|
const styleIfThere = other.layout === "none" ? undefined : other.style;
|
|
4400
|
+
const sequenceRef = useCallback6((node) => {
|
|
4401
|
+
wrapperRefForOutline.current = node;
|
|
4402
|
+
if (typeof ref === "function") {
|
|
4403
|
+
ref(node);
|
|
4404
|
+
} else if (ref) {
|
|
4405
|
+
ref.current = node;
|
|
4406
|
+
}
|
|
4407
|
+
}, [ref]);
|
|
4371
4408
|
const defaultStyle = useMemo14(() => {
|
|
4372
4409
|
return {
|
|
4373
4410
|
flexDirection: undefined,
|
|
@@ -4384,11 +4421,11 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
4384
4421
|
}
|
|
4385
4422
|
return /* @__PURE__ */ jsx12(SequenceContext.Provider, {
|
|
4386
4423
|
value: contextValue,
|
|
4387
|
-
children:
|
|
4388
|
-
ref,
|
|
4424
|
+
children: frozenContent === null ? null : other.layout === "none" ? frozenContent : /* @__PURE__ */ jsx12(AbsoluteFill, {
|
|
4425
|
+
ref: sequenceRef,
|
|
4389
4426
|
style: defaultStyle,
|
|
4390
4427
|
className: other.className,
|
|
4391
|
-
children:
|
|
4428
|
+
children: frozenContent
|
|
4392
4429
|
})
|
|
4393
4430
|
});
|
|
4394
4431
|
};
|
|
@@ -4468,11 +4505,13 @@ var SequenceInner = forwardRef3(SequenceRefForwardingFunction);
|
|
|
4468
4505
|
var SequenceWithoutSchema = SequenceInner;
|
|
4469
4506
|
var Sequence = wrapInSchema({
|
|
4470
4507
|
Component: SequenceInner,
|
|
4508
|
+
componentIdentity: "dev.remotion.remotion.Sequence",
|
|
4471
4509
|
schema: sequenceSchema,
|
|
4472
4510
|
supportsEffects: false
|
|
4473
4511
|
});
|
|
4474
4512
|
var SequenceWithoutFrom = wrapInSchema({
|
|
4475
4513
|
Component: SequenceInner,
|
|
4514
|
+
componentIdentity: null,
|
|
4476
4515
|
schema: sequenceSchemaWithoutFrom,
|
|
4477
4516
|
supportsEffects: false
|
|
4478
4517
|
});
|
|
@@ -4487,7 +4526,7 @@ import {
|
|
|
4487
4526
|
} from "react";
|
|
4488
4527
|
|
|
4489
4528
|
// src/animated-image/canvas.tsx
|
|
4490
|
-
import React15, { useCallback as
|
|
4529
|
+
import React15, { useCallback as useCallback7, useImperativeHandle, useMemo as useMemo16, useRef as useRef8 } from "react";
|
|
4491
4530
|
|
|
4492
4531
|
// src/calculate-image-fit.ts
|
|
4493
4532
|
var calculateImageFit = (fit, imageSize, canvasSize) => {
|
|
@@ -4819,7 +4858,7 @@ var CanvasRefForwardingFunction = ({ width, height, fit, className, style, effec
|
|
|
4819
4858
|
}
|
|
4820
4859
|
return document.createElement("canvas");
|
|
4821
4860
|
}, []);
|
|
4822
|
-
const draw =
|
|
4861
|
+
const draw = useCallback7((imageData) => {
|
|
4823
4862
|
const canvas = canvasRef.current;
|
|
4824
4863
|
const canvasWidth = width ?? imageData.displayWidth;
|
|
4825
4864
|
const canvasHeight = height ?? imageData.displayHeight;
|
|
@@ -5049,6 +5088,7 @@ import { jsx as jsx14 } from "react/jsx-runtime";
|
|
|
5049
5088
|
var animatedImageSchema = {
|
|
5050
5089
|
durationInFrames: durationInFramesField,
|
|
5051
5090
|
from: fromField,
|
|
5091
|
+
freeze: freezeField,
|
|
5052
5092
|
playbackRate: {
|
|
5053
5093
|
type: "number",
|
|
5054
5094
|
min: 0,
|
|
@@ -5248,6 +5288,7 @@ var AnimatedImageInner = ({
|
|
|
5248
5288
|
};
|
|
5249
5289
|
var AnimatedImage = wrapInSchema({
|
|
5250
5290
|
Component: AnimatedImageInner,
|
|
5291
|
+
componentIdentity: "dev.remotion.remotion.AnimatedImage",
|
|
5251
5292
|
schema: animatedImageSchema,
|
|
5252
5293
|
supportsEffects: true
|
|
5253
5294
|
});
|
|
@@ -5259,7 +5300,7 @@ import { useContext as useContext18, useLayoutEffect as useLayoutEffect4, useSta
|
|
|
5259
5300
|
// src/RenderAssetManager.tsx
|
|
5260
5301
|
import {
|
|
5261
5302
|
createContext as createContext17,
|
|
5262
|
-
useCallback as
|
|
5303
|
+
useCallback as useCallback8,
|
|
5263
5304
|
useImperativeHandle as useImperativeHandle3,
|
|
5264
5305
|
useLayoutEffect as useLayoutEffect3,
|
|
5265
5306
|
useMemo as useMemo17,
|
|
@@ -5312,7 +5353,7 @@ var RenderAssetManager = createContext17({
|
|
|
5312
5353
|
var RenderAssetManagerProvider = ({ children, collectAssets }) => {
|
|
5313
5354
|
const [renderAssets, setRenderAssets] = useState7([]);
|
|
5314
5355
|
const renderAssetsRef = useRef10([]);
|
|
5315
|
-
const registerRenderAsset =
|
|
5356
|
+
const registerRenderAsset = useCallback8((renderAsset) => {
|
|
5316
5357
|
validateRenderAsset(renderAsset);
|
|
5317
5358
|
renderAssetsRef.current = [...renderAssetsRef.current, renderAsset];
|
|
5318
5359
|
setRenderAssets(renderAssetsRef.current);
|
|
@@ -5329,7 +5370,7 @@ var RenderAssetManagerProvider = ({ children, collectAssets }) => {
|
|
|
5329
5370
|
};
|
|
5330
5371
|
}, []);
|
|
5331
5372
|
}
|
|
5332
|
-
const unregisterRenderAsset =
|
|
5373
|
+
const unregisterRenderAsset = useCallback8((id) => {
|
|
5333
5374
|
renderAssetsRef.current = renderAssetsRef.current.filter((a2) => a2.id !== id);
|
|
5334
5375
|
setRenderAssets(renderAssetsRef.current);
|
|
5335
5376
|
}, []);
|
|
@@ -5416,7 +5457,7 @@ var Artifact = ({ filename, content, downloadBehavior }) => {
|
|
|
5416
5457
|
};
|
|
5417
5458
|
Artifact.Thumbnail = ArtifactThumbnail;
|
|
5418
5459
|
// src/audio/html5-audio.tsx
|
|
5419
|
-
import { forwardRef as forwardRef7, useCallback as
|
|
5460
|
+
import { forwardRef as forwardRef7, useCallback as useCallback14, useContext as useContext30 } from "react";
|
|
5420
5461
|
|
|
5421
5462
|
// src/absolute-src.ts
|
|
5422
5463
|
var getAbsoluteSrc = (relativeSrc) => {
|
|
@@ -5886,7 +5927,7 @@ var DurationsContextProvider = ({ children }) => {
|
|
|
5886
5927
|
};
|
|
5887
5928
|
|
|
5888
5929
|
// src/audio/AudioForPreview.tsx
|
|
5889
|
-
import { useCallback as
|
|
5930
|
+
import { useCallback as useCallback13 } from "react";
|
|
5890
5931
|
import React22, {
|
|
5891
5932
|
forwardRef as forwardRef5,
|
|
5892
5933
|
useContext as useContext28,
|
|
@@ -5922,7 +5963,7 @@ import { useContext as useContext21, useLayoutEffect as useLayoutEffect5, useRef
|
|
|
5922
5963
|
import React19, {
|
|
5923
5964
|
createContext as createContext21,
|
|
5924
5965
|
createRef as createRef2,
|
|
5925
|
-
useCallback as
|
|
5966
|
+
useCallback as useCallback9,
|
|
5926
5967
|
useContext as useContext20,
|
|
5927
5968
|
useEffect as useEffect7,
|
|
5928
5969
|
useMemo as useMemo21,
|
|
@@ -6206,7 +6247,7 @@ var SharedAudioContextProvider = ({ children, audioLatencyHint, audioEnabled, pr
|
|
|
6206
6247
|
}, []);
|
|
6207
6248
|
const prevEndTimes = useRef12({ scheduledEndTime: null, mediaEndTime: null });
|
|
6208
6249
|
const nodesToResume = useRef12(new Map);
|
|
6209
|
-
const unscheduleAudioNode =
|
|
6250
|
+
const unscheduleAudioNode = useCallback9((node) => {
|
|
6210
6251
|
nodesToResume.current.delete(node);
|
|
6211
6252
|
}, []);
|
|
6212
6253
|
const scheduleAudioNode = useMemo21(() => {
|
|
@@ -6260,7 +6301,7 @@ var SharedAudioContextProvider = ({ children, audioLatencyHint, audioEnabled, pr
|
|
|
6260
6301
|
};
|
|
6261
6302
|
};
|
|
6262
6303
|
}, [ctxAndGain, logLevel]);
|
|
6263
|
-
const resume =
|
|
6304
|
+
const resume = useCallback9(() => {
|
|
6264
6305
|
if (!ctxAndGain) {
|
|
6265
6306
|
return Promise.resolve();
|
|
6266
6307
|
}
|
|
@@ -6287,10 +6328,10 @@ var SharedAudioContextProvider = ({ children, audioLatencyHint, audioEnabled, pr
|
|
|
6287
6328
|
});
|
|
6288
6329
|
return resumePromise.catch(() => {});
|
|
6289
6330
|
}, [ctxAndGain, logLevel]);
|
|
6290
|
-
const getIsResumingAudioContext =
|
|
6331
|
+
const getIsResumingAudioContext = useCallback9(() => {
|
|
6291
6332
|
return isResuming.current;
|
|
6292
6333
|
}, []);
|
|
6293
|
-
const suspend =
|
|
6334
|
+
const suspend = useCallback9(() => {
|
|
6294
6335
|
if (!ctxAndGain) {
|
|
6295
6336
|
return Promise.resolve();
|
|
6296
6337
|
}
|
|
@@ -6364,7 +6405,7 @@ var SharedAudioTagsContextProvider = ({ children, numberOfAudioTags }) => {
|
|
|
6364
6405
|
};
|
|
6365
6406
|
}, [refs]);
|
|
6366
6407
|
const takenAudios = useRef12(new Array(numberOfAudioTags).fill(false));
|
|
6367
|
-
const rerenderAudios =
|
|
6408
|
+
const rerenderAudios = useCallback9(() => {
|
|
6368
6409
|
refs.forEach(({ ref, id }) => {
|
|
6369
6410
|
const data = audios.current?.find((a2) => a2.id === id);
|
|
6370
6411
|
const { current } = ref;
|
|
@@ -6385,7 +6426,7 @@ var SharedAudioTagsContextProvider = ({ children, numberOfAudioTags }) => {
|
|
|
6385
6426
|
});
|
|
6386
6427
|
});
|
|
6387
6428
|
}, [refs]);
|
|
6388
|
-
const registerAudio =
|
|
6429
|
+
const registerAudio = useCallback9((options) => {
|
|
6389
6430
|
const { aud, audioId, premounting, postmounting } = options;
|
|
6390
6431
|
const found = audios.current?.find((a2) => a2.audioId === audioId);
|
|
6391
6432
|
if (found) {
|
|
@@ -6414,7 +6455,7 @@ var SharedAudioTagsContextProvider = ({ children, numberOfAudioTags }) => {
|
|
|
6414
6455
|
rerenderAudios();
|
|
6415
6456
|
return newElem;
|
|
6416
6457
|
}, [numberOfAudioTags, refs, rerenderAudios]);
|
|
6417
|
-
const unregisterAudio =
|
|
6458
|
+
const unregisterAudio = useCallback9((id) => {
|
|
6418
6459
|
const cloned = [...takenAudios.current];
|
|
6419
6460
|
const index = refs.findIndex((r) => r.id === id);
|
|
6420
6461
|
if (index === -1) {
|
|
@@ -6425,7 +6466,7 @@ var SharedAudioTagsContextProvider = ({ children, numberOfAudioTags }) => {
|
|
|
6425
6466
|
audios.current = audios.current?.filter((a2) => a2.id !== id);
|
|
6426
6467
|
rerenderAudios();
|
|
6427
6468
|
}, [refs, rerenderAudios]);
|
|
6428
|
-
const updateAudio =
|
|
6469
|
+
const updateAudio = useCallback9(({
|
|
6429
6470
|
aud,
|
|
6430
6471
|
audioId,
|
|
6431
6472
|
id,
|
|
@@ -6459,7 +6500,7 @@ var SharedAudioTagsContextProvider = ({ children, numberOfAudioTags }) => {
|
|
|
6459
6500
|
rerenderAudios();
|
|
6460
6501
|
}
|
|
6461
6502
|
}, [rerenderAudios]);
|
|
6462
|
-
const playAllAudios =
|
|
6503
|
+
const playAllAudios = useCallback9(() => {
|
|
6463
6504
|
refs.forEach((ref) => {
|
|
6464
6505
|
const audio = audios.current.find((a2) => a2.el === ref.ref);
|
|
6465
6506
|
if (audio?.premounting) {
|
|
@@ -7024,7 +7065,7 @@ var useMediaInTimeline = ({
|
|
|
7024
7065
|
|
|
7025
7066
|
// src/use-media-playback.ts
|
|
7026
7067
|
import {
|
|
7027
|
-
useCallback as
|
|
7068
|
+
useCallback as useCallback12,
|
|
7028
7069
|
useContext as useContext26,
|
|
7029
7070
|
useEffect as useEffect12,
|
|
7030
7071
|
useLayoutEffect as useLayoutEffect7,
|
|
@@ -7032,14 +7073,14 @@ import {
|
|
|
7032
7073
|
} from "react";
|
|
7033
7074
|
|
|
7034
7075
|
// src/buffer-until-first-frame.ts
|
|
7035
|
-
import { useCallback as
|
|
7076
|
+
import { useCallback as useCallback11, useMemo as useMemo25, useRef as useRef16 } from "react";
|
|
7036
7077
|
|
|
7037
7078
|
// src/use-buffer-state.ts
|
|
7038
7079
|
import { useContext as useContext25, useMemo as useMemo24 } from "react";
|
|
7039
7080
|
|
|
7040
7081
|
// src/buffering.tsx
|
|
7041
7082
|
import React20, {
|
|
7042
|
-
useCallback as
|
|
7083
|
+
useCallback as useCallback10,
|
|
7043
7084
|
useContext as useContext24,
|
|
7044
7085
|
useEffect as useEffect9,
|
|
7045
7086
|
useLayoutEffect as useLayoutEffect6,
|
|
@@ -7055,7 +7096,7 @@ var useBufferManager = (logLevel, mountTime) => {
|
|
|
7055
7096
|
const env = useRemotionEnvironment();
|
|
7056
7097
|
const rendering = env.isRendering;
|
|
7057
7098
|
const buffering = useRef15(false);
|
|
7058
|
-
const addBlock =
|
|
7099
|
+
const addBlock = useCallback10((block) => {
|
|
7059
7100
|
if (rendering) {
|
|
7060
7101
|
return {
|
|
7061
7102
|
unblock: () => {
|
|
@@ -7081,7 +7122,7 @@ var useBufferManager = (logLevel, mountTime) => {
|
|
|
7081
7122
|
}
|
|
7082
7123
|
};
|
|
7083
7124
|
}, [rendering]);
|
|
7084
|
-
const listenForBuffering =
|
|
7125
|
+
const listenForBuffering = useCallback10((callback) => {
|
|
7085
7126
|
setOnBufferingCallbacks((c2) => [...c2, callback]);
|
|
7086
7127
|
return {
|
|
7087
7128
|
remove: () => {
|
|
@@ -7089,7 +7130,7 @@ var useBufferManager = (logLevel, mountTime) => {
|
|
|
7089
7130
|
}
|
|
7090
7131
|
};
|
|
7091
7132
|
}, []);
|
|
7092
|
-
const listenForResume =
|
|
7133
|
+
const listenForResume = useCallback10((callback) => {
|
|
7093
7134
|
setOnResumeCallbacks((c2) => [...c2, callback]);
|
|
7094
7135
|
return {
|
|
7095
7136
|
remove: () => {
|
|
@@ -7207,7 +7248,7 @@ var useBufferUntilFirstFrame = ({
|
|
|
7207
7248
|
}) => {
|
|
7208
7249
|
const bufferingRef = useRef16(false);
|
|
7209
7250
|
const { delayPlayback } = useBufferState();
|
|
7210
|
-
const bufferUntilFirstFrame =
|
|
7251
|
+
const bufferUntilFirstFrame = useCallback11((requestedTime) => {
|
|
7211
7252
|
if (mediaType !== "video") {
|
|
7212
7253
|
return;
|
|
7213
7254
|
}
|
|
@@ -7614,7 +7655,7 @@ var useMediaPlayback = ({
|
|
|
7614
7655
|
throw new Error("useMediaPlayback must be used inside a <BufferingContext>");
|
|
7615
7656
|
}
|
|
7616
7657
|
const isVariableFpsVideoMap = useRef18({});
|
|
7617
|
-
const onVariableFpsVideoDetected =
|
|
7658
|
+
const onVariableFpsVideoDetected = useCallback12(() => {
|
|
7618
7659
|
if (!src) {
|
|
7619
7660
|
return;
|
|
7620
7661
|
}
|
|
@@ -8016,7 +8057,7 @@ var AudioForDevelopmentForwardRefFunction = (props, ref) => {
|
|
|
8016
8057
|
premounting: Boolean(sequenceContext?.premounting),
|
|
8017
8058
|
postmounting: Boolean(sequenceContext?.postmounting)
|
|
8018
8059
|
});
|
|
8019
|
-
const getStack =
|
|
8060
|
+
const getStack = useCallback13(() => {
|
|
8020
8061
|
return _remotionInternalStack ?? null;
|
|
8021
8062
|
}, [_remotionInternalStack]);
|
|
8022
8063
|
useMediaInTimeline({
|
|
@@ -8277,7 +8318,7 @@ var AudioRefForwardingFunction = (props, ref) => {
|
|
|
8277
8318
|
throw new TypeError(`The \`<Html5Audio>\` tag requires a string for \`src\`, but got ${JSON.stringify(props.src)} instead.`);
|
|
8278
8319
|
}
|
|
8279
8320
|
const preloadedSrc = usePreload(props.src);
|
|
8280
|
-
const onError =
|
|
8321
|
+
const onError = useCallback14((e) => {
|
|
8281
8322
|
console.log(e.currentTarget.error);
|
|
8282
8323
|
const errMessage = `Could not play audio with src ${preloadedSrc}: ${e.currentTarget.error}. See https://remotion.dev/docs/media-playback-error for help.`;
|
|
8283
8324
|
if (loop) {
|
|
@@ -8291,7 +8332,7 @@ var AudioRefForwardingFunction = (props, ref) => {
|
|
|
8291
8332
|
console.warn(errMessage);
|
|
8292
8333
|
}
|
|
8293
8334
|
}, [loop, onRemotionError, preloadedSrc]);
|
|
8294
|
-
const onDuration =
|
|
8335
|
+
const onDuration = useCallback14((src, durationInSeconds) => {
|
|
8295
8336
|
setDurations({ type: "got-duration", durationInSeconds, src });
|
|
8296
8337
|
}, [setDurations]);
|
|
8297
8338
|
const durationFetched = durations[getAbsoluteSrc(preloadedSrc)] ?? durations[getAbsoluteSrc(props.src)];
|
|
@@ -8374,7 +8415,7 @@ var Audio = Html5Audio;
|
|
|
8374
8415
|
// src/effects/Solid.tsx
|
|
8375
8416
|
import {
|
|
8376
8417
|
forwardRef as forwardRef8,
|
|
8377
|
-
useCallback as
|
|
8418
|
+
useCallback as useCallback15,
|
|
8378
8419
|
useEffect as useEffect16,
|
|
8379
8420
|
useImperativeHandle as useImperativeHandle6,
|
|
8380
8421
|
useMemo as useMemo29,
|
|
@@ -8394,6 +8435,7 @@ var resolveSolidPixelDensity = (pixelDensity) => {
|
|
|
8394
8435
|
var solidSchema = {
|
|
8395
8436
|
durationInFrames: durationInFramesField,
|
|
8396
8437
|
from: fromField,
|
|
8438
|
+
freeze: freezeField,
|
|
8397
8439
|
color: {
|
|
8398
8440
|
type: "color",
|
|
8399
8441
|
default: "transparent",
|
|
@@ -8448,7 +8490,7 @@ var SolidInner = ({
|
|
|
8448
8490
|
return canvas;
|
|
8449
8491
|
}, []);
|
|
8450
8492
|
const chainState = useEffectChainState();
|
|
8451
|
-
const canvasRef =
|
|
8493
|
+
const canvasRef = useCallback15((canvas) => {
|
|
8452
8494
|
setOutputCanvas(canvas);
|
|
8453
8495
|
if (typeof reference === "function") {
|
|
8454
8496
|
reference(canvas);
|
|
@@ -8532,6 +8574,7 @@ var SolidOuter = forwardRef8(({
|
|
|
8532
8574
|
style,
|
|
8533
8575
|
name,
|
|
8534
8576
|
from,
|
|
8577
|
+
freeze,
|
|
8535
8578
|
hidden,
|
|
8536
8579
|
showInTimeline,
|
|
8537
8580
|
pixelDensity,
|
|
@@ -8545,6 +8588,7 @@ var SolidOuter = forwardRef8(({
|
|
|
8545
8588
|
return /* @__PURE__ */ jsx24(Sequence, {
|
|
8546
8589
|
layout: "none",
|
|
8547
8590
|
from,
|
|
8591
|
+
freeze,
|
|
8548
8592
|
hidden,
|
|
8549
8593
|
showInTimeline,
|
|
8550
8594
|
_experimentalControls: controls,
|
|
@@ -8569,6 +8613,7 @@ var SolidOuter = forwardRef8(({
|
|
|
8569
8613
|
});
|
|
8570
8614
|
var Solid = wrapInSchema({
|
|
8571
8615
|
Component: SolidOuter,
|
|
8616
|
+
componentIdentity: "dev.remotion.remotion.Solid",
|
|
8572
8617
|
schema: solidSchema,
|
|
8573
8618
|
supportsEffects: true
|
|
8574
8619
|
});
|
|
@@ -8578,7 +8623,7 @@ addSequenceStackTraces(Solid);
|
|
|
8578
8623
|
import {
|
|
8579
8624
|
createContext as createContext23,
|
|
8580
8625
|
forwardRef as forwardRef9,
|
|
8581
|
-
useCallback as
|
|
8626
|
+
useCallback as useCallback16,
|
|
8582
8627
|
useContext as useContext31,
|
|
8583
8628
|
useLayoutEffect as useLayoutEffect9,
|
|
8584
8629
|
useMemo as useMemo30,
|
|
@@ -8669,7 +8714,7 @@ var HtmlInCanvasContent = forwardRef9(({
|
|
|
8669
8714
|
const offscreenRef = useRef22(null);
|
|
8670
8715
|
const divRef = useRef22(null);
|
|
8671
8716
|
const canvasSizeKey = `${width}x${height}@${resolvedPixelDensity}`;
|
|
8672
|
-
const setLayoutCanvasRef =
|
|
8717
|
+
const setLayoutCanvasRef = useCallback16((node) => {
|
|
8673
8718
|
canvas2dRef.current = node;
|
|
8674
8719
|
if (typeof ref === "function") {
|
|
8675
8720
|
ref(node);
|
|
@@ -8691,7 +8736,7 @@ var HtmlInCanvasContent = forwardRef9(({
|
|
|
8691
8736
|
const initializedRef = useRef22(false);
|
|
8692
8737
|
const onInitCleanupRef = useRef22(null);
|
|
8693
8738
|
const unmountedRef = useRef22(false);
|
|
8694
|
-
const onPaintCb =
|
|
8739
|
+
const onPaintCb = useCallback16(async () => {
|
|
8695
8740
|
const element = divRef.current;
|
|
8696
8741
|
if (!element) {
|
|
8697
8742
|
throw new Error("Canvas or scene element not found");
|
|
@@ -8864,7 +8909,7 @@ var HtmlInCanvasInner = forwardRef9(({
|
|
|
8864
8909
|
const resolvedDuration = durationInFrames ?? videoDuration;
|
|
8865
8910
|
const memoizedEffectDefinitions = useMemoizedEffectDefinitions(effects);
|
|
8866
8911
|
const actualRef = useRef22(null);
|
|
8867
|
-
const setCanvasRef =
|
|
8912
|
+
const setCanvasRef = useCallback16((node) => {
|
|
8868
8913
|
actualRef.current = node;
|
|
8869
8914
|
if (typeof ref === "function") {
|
|
8870
8915
|
ref(node);
|
|
@@ -8899,11 +8944,13 @@ HtmlInCanvasInner.displayName = "HtmlInCanvas";
|
|
|
8899
8944
|
var htmlInCanvasSchema = {
|
|
8900
8945
|
durationInFrames: durationInFramesField,
|
|
8901
8946
|
from: fromField,
|
|
8947
|
+
freeze: freezeField,
|
|
8902
8948
|
...sequenceVisualStyleSchema,
|
|
8903
8949
|
hidden: hiddenField
|
|
8904
8950
|
};
|
|
8905
8951
|
var HtmlInCanvasWrapped = wrapInSchema({
|
|
8906
8952
|
Component: HtmlInCanvasInner,
|
|
8953
|
+
componentIdentity: "dev.remotion.remotion.HtmlInCanvas",
|
|
8907
8954
|
schema: htmlInCanvasSchema,
|
|
8908
8955
|
supportsEffects: true
|
|
8909
8956
|
});
|
|
@@ -8915,7 +8962,7 @@ addSequenceStackTraces(HtmlInCanvas);
|
|
|
8915
8962
|
// src/canvas-image/CanvasImage.tsx
|
|
8916
8963
|
import {
|
|
8917
8964
|
forwardRef as forwardRef10,
|
|
8918
|
-
useCallback as
|
|
8965
|
+
useCallback as useCallback17,
|
|
8919
8966
|
useContext as useContext32,
|
|
8920
8967
|
useEffect as useEffect17,
|
|
8921
8968
|
useImperativeHandle as useImperativeHandle7,
|
|
@@ -8937,6 +8984,7 @@ import { jsx as jsx26 } from "react/jsx-runtime";
|
|
|
8937
8984
|
var canvasImageSchema = {
|
|
8938
8985
|
durationInFrames: durationInFramesField,
|
|
8939
8986
|
from: fromField,
|
|
8987
|
+
freeze: freezeField,
|
|
8940
8988
|
fit: {
|
|
8941
8989
|
type: "enum",
|
|
8942
8990
|
default: "fill",
|
|
@@ -9042,7 +9090,7 @@ var CanvasImageContent = forwardRef10(({
|
|
|
9042
9090
|
}
|
|
9043
9091
|
return document.createElement("canvas");
|
|
9044
9092
|
}, []);
|
|
9045
|
-
const canvasRef =
|
|
9093
|
+
const canvasRef = useCallback17((canvas) => {
|
|
9046
9094
|
setOutputCanvas(canvas);
|
|
9047
9095
|
if (refForOutline) {
|
|
9048
9096
|
refForOutline.current = canvas;
|
|
@@ -9189,6 +9237,7 @@ var CanvasImageInner = forwardRef10(({
|
|
|
9189
9237
|
delayRenderTimeoutInMilliseconds,
|
|
9190
9238
|
durationInFrames,
|
|
9191
9239
|
from,
|
|
9240
|
+
freeze,
|
|
9192
9241
|
hidden,
|
|
9193
9242
|
name,
|
|
9194
9243
|
showInTimeline,
|
|
@@ -9210,6 +9259,7 @@ var CanvasImageInner = forwardRef10(({
|
|
|
9210
9259
|
layout: "none",
|
|
9211
9260
|
from: from ?? 0,
|
|
9212
9261
|
durationInFrames: durationInFrames ?? Infinity,
|
|
9262
|
+
freeze,
|
|
9213
9263
|
hidden,
|
|
9214
9264
|
showInTimeline: showInTimeline ?? true,
|
|
9215
9265
|
name: name ?? "<CanvasImage>",
|
|
@@ -9242,6 +9292,7 @@ var CanvasImageInner = forwardRef10(({
|
|
|
9242
9292
|
});
|
|
9243
9293
|
var CanvasImage = wrapInSchema({
|
|
9244
9294
|
Component: CanvasImageInner,
|
|
9295
|
+
componentIdentity: "dev.remotion.remotion.CanvasImage",
|
|
9245
9296
|
schema: canvasImageSchema,
|
|
9246
9297
|
supportsEffects: true
|
|
9247
9298
|
});
|
|
@@ -9279,7 +9330,7 @@ var getStaticFiles = () => {
|
|
|
9279
9330
|
return window.remotion_staticFiles;
|
|
9280
9331
|
};
|
|
9281
9332
|
// src/IFrame.tsx
|
|
9282
|
-
import { forwardRef as forwardRef11, useCallback as
|
|
9333
|
+
import { forwardRef as forwardRef11, useCallback as useCallback18, useState as useState17 } from "react";
|
|
9283
9334
|
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
9284
9335
|
var IFrameRefForwarding = ({
|
|
9285
9336
|
onLoad,
|
|
@@ -9293,11 +9344,11 @@ var IFrameRefForwarding = ({
|
|
|
9293
9344
|
retries: delayRenderRetries ?? undefined,
|
|
9294
9345
|
timeoutInMilliseconds: delayRenderTimeoutInMilliseconds ?? undefined
|
|
9295
9346
|
}));
|
|
9296
|
-
const didLoad =
|
|
9347
|
+
const didLoad = useCallback18((e) => {
|
|
9297
9348
|
continueRender2(handle);
|
|
9298
9349
|
onLoad?.(e);
|
|
9299
9350
|
}, [handle, onLoad, continueRender2]);
|
|
9300
|
-
const didGetError =
|
|
9351
|
+
const didGetError = useCallback18((e) => {
|
|
9301
9352
|
continueRender2(handle);
|
|
9302
9353
|
if (onError) {
|
|
9303
9354
|
onError(e);
|
|
@@ -9315,7 +9366,7 @@ var IFrameRefForwarding = ({
|
|
|
9315
9366
|
};
|
|
9316
9367
|
var IFrame = forwardRef11(IFrameRefForwarding);
|
|
9317
9368
|
// src/Img.tsx
|
|
9318
|
-
import { useCallback as
|
|
9369
|
+
import { useCallback as useCallback19, useContext as useContext33, useLayoutEffect as useLayoutEffect10, useRef as useRef24 } from "react";
|
|
9319
9370
|
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
9320
9371
|
function exponentialBackoff2(errorCount) {
|
|
9321
9372
|
return 1000 * 2 ** (errorCount - 1);
|
|
@@ -9342,7 +9393,7 @@ var ImgContent = ({
|
|
|
9342
9393
|
if (!_propsValid) {
|
|
9343
9394
|
throw new Error("typecheck error");
|
|
9344
9395
|
}
|
|
9345
|
-
const imageCallbackRef =
|
|
9396
|
+
const imageCallbackRef = useCallback19((img) => {
|
|
9346
9397
|
imageRef.current = img;
|
|
9347
9398
|
refForOutline.current = img;
|
|
9348
9399
|
if (typeof ref === "function") {
|
|
@@ -9352,7 +9403,7 @@ var ImgContent = ({
|
|
|
9352
9403
|
}
|
|
9353
9404
|
}, [ref, refForOutline]);
|
|
9354
9405
|
const actualSrc = usePreload(src);
|
|
9355
|
-
const retryIn =
|
|
9406
|
+
const retryIn = useCallback19((timeout) => {
|
|
9356
9407
|
if (!imageRef.current) {
|
|
9357
9408
|
return;
|
|
9358
9409
|
}
|
|
@@ -9370,7 +9421,7 @@ var ImgContent = ({
|
|
|
9370
9421
|
}, timeout);
|
|
9371
9422
|
}, []);
|
|
9372
9423
|
const { delayRender: delayRender2, continueRender: continueRender2, cancelRender: cancelRender2 } = useDelayRender();
|
|
9373
|
-
const didGetError =
|
|
9424
|
+
const didGetError = useCallback19((e) => {
|
|
9374
9425
|
if (!errors.current) {
|
|
9375
9426
|
return;
|
|
9376
9427
|
}
|
|
@@ -9480,6 +9531,7 @@ var NativeImgInner = ({
|
|
|
9480
9531
|
src,
|
|
9481
9532
|
from,
|
|
9482
9533
|
durationInFrames,
|
|
9534
|
+
freeze,
|
|
9483
9535
|
_experimentalControls: controls,
|
|
9484
9536
|
_remotionInternalRefForOutline: refForOutline,
|
|
9485
9537
|
...props2
|
|
@@ -9491,6 +9543,7 @@ var NativeImgInner = ({
|
|
|
9491
9543
|
layout: "none",
|
|
9492
9544
|
from: from ?? 0,
|
|
9493
9545
|
durationInFrames: durationInFrames ?? Infinity,
|
|
9546
|
+
freeze,
|
|
9494
9547
|
_remotionInternalStack: stack,
|
|
9495
9548
|
_remotionInternalDocumentationLink: "https://www.remotion.dev/docs/img",
|
|
9496
9549
|
_remotionInternalIsMedia: { type: "image", src },
|
|
@@ -9510,6 +9563,7 @@ var CanvasImageWithPrivateProps = CanvasImage;
|
|
|
9510
9563
|
var imgSchema = {
|
|
9511
9564
|
durationInFrames: durationInFramesField,
|
|
9512
9565
|
from: fromField,
|
|
9566
|
+
freeze: freezeField,
|
|
9513
9567
|
...sequenceVisualStyleSchema,
|
|
9514
9568
|
hidden: hiddenField
|
|
9515
9569
|
};
|
|
@@ -9565,6 +9619,7 @@ var ImgInner = ({
|
|
|
9565
9619
|
src,
|
|
9566
9620
|
from,
|
|
9567
9621
|
durationInFrames,
|
|
9622
|
+
freeze,
|
|
9568
9623
|
_experimentalControls: controls,
|
|
9569
9624
|
width,
|
|
9570
9625
|
height,
|
|
@@ -9589,6 +9644,7 @@ var ImgInner = ({
|
|
|
9589
9644
|
src,
|
|
9590
9645
|
from,
|
|
9591
9646
|
durationInFrames,
|
|
9647
|
+
freeze,
|
|
9592
9648
|
_experimentalControls: controls,
|
|
9593
9649
|
width,
|
|
9594
9650
|
height,
|
|
@@ -9630,6 +9686,7 @@ var ImgInner = ({
|
|
|
9630
9686
|
delayRenderTimeoutInMilliseconds,
|
|
9631
9687
|
from,
|
|
9632
9688
|
durationInFrames,
|
|
9689
|
+
freeze,
|
|
9633
9690
|
hidden,
|
|
9634
9691
|
name: name ?? "<Img>",
|
|
9635
9692
|
showInTimeline,
|
|
@@ -9642,16 +9699,18 @@ var ImgInner = ({
|
|
|
9642
9699
|
};
|
|
9643
9700
|
var Img = wrapInSchema({
|
|
9644
9701
|
Component: ImgInner,
|
|
9702
|
+
componentIdentity: "dev.remotion.remotion.Img",
|
|
9645
9703
|
schema: imgSchema,
|
|
9646
9704
|
supportsEffects: true
|
|
9647
9705
|
});
|
|
9648
9706
|
addSequenceStackTraces(Img);
|
|
9649
9707
|
// src/Interactive.tsx
|
|
9650
|
-
import React29, { forwardRef as forwardRef12, useCallback as
|
|
9708
|
+
import React29, { forwardRef as forwardRef12, useCallback as useCallback20, useRef as useRef25 } from "react";
|
|
9651
9709
|
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
9652
9710
|
var interactiveElementSchema = {
|
|
9653
9711
|
durationInFrames: durationInFramesField,
|
|
9654
9712
|
from: fromField,
|
|
9713
|
+
freeze: freezeField,
|
|
9655
9714
|
...sequenceVisualStyleSchema,
|
|
9656
9715
|
hidden: hiddenField
|
|
9657
9716
|
};
|
|
@@ -9667,6 +9726,7 @@ var makeInteractiveElement = (tag, displayName) => {
|
|
|
9667
9726
|
const {
|
|
9668
9727
|
durationInFrames,
|
|
9669
9728
|
from,
|
|
9729
|
+
freeze,
|
|
9670
9730
|
hidden,
|
|
9671
9731
|
name,
|
|
9672
9732
|
showInTimeline,
|
|
@@ -9675,7 +9735,7 @@ var makeInteractiveElement = (tag, displayName) => {
|
|
|
9675
9735
|
...props2
|
|
9676
9736
|
} = propsWithControls;
|
|
9677
9737
|
const refForOutline = useRef25(null);
|
|
9678
|
-
const callbackRef =
|
|
9738
|
+
const callbackRef = useCallback20((element) => {
|
|
9679
9739
|
refForOutline.current = element;
|
|
9680
9740
|
setRef(ref, element);
|
|
9681
9741
|
}, [ref]);
|
|
@@ -9683,6 +9743,7 @@ var makeInteractiveElement = (tag, displayName) => {
|
|
|
9683
9743
|
layout: "none",
|
|
9684
9744
|
from: from ?? 0,
|
|
9685
9745
|
durationInFrames: durationInFrames ?? Infinity,
|
|
9746
|
+
freeze,
|
|
9686
9747
|
hidden,
|
|
9687
9748
|
name: name ?? displayName,
|
|
9688
9749
|
showInTimeline: showInTimeline ?? true,
|
|
@@ -9699,6 +9760,7 @@ var makeInteractiveElement = (tag, displayName) => {
|
|
|
9699
9760
|
Inner.displayName = displayName;
|
|
9700
9761
|
const Wrapped = wrapInSchema({
|
|
9701
9762
|
Component: Inner,
|
|
9763
|
+
componentIdentity: `dev.remotion.remotion.${displayName.slice(1, -1)}`,
|
|
9702
9764
|
schema: interactiveElementSchema,
|
|
9703
9765
|
supportsEffects: false
|
|
9704
9766
|
});
|
|
@@ -9752,7 +9814,7 @@ var compositionsRef = React30.createRef();
|
|
|
9752
9814
|
|
|
9753
9815
|
// src/CompositionManagerProvider.tsx
|
|
9754
9816
|
import {
|
|
9755
|
-
useCallback as
|
|
9817
|
+
useCallback as useCallback21,
|
|
9756
9818
|
useImperativeHandle as useImperativeHandle8,
|
|
9757
9819
|
useMemo as useMemo32,
|
|
9758
9820
|
useRef as useRef26,
|
|
@@ -9770,14 +9832,14 @@ var CompositionManagerProvider = ({
|
|
|
9770
9832
|
const [canvasContent, setCanvasContent] = useState18(initialCanvasContent);
|
|
9771
9833
|
const [compositions, setCompositions] = useState18(initialCompositions);
|
|
9772
9834
|
const currentcompositionsRef = useRef26(compositions);
|
|
9773
|
-
const updateCompositions =
|
|
9835
|
+
const updateCompositions = useCallback21((updateComps) => {
|
|
9774
9836
|
setCompositions((comps) => {
|
|
9775
9837
|
const updated = updateComps(comps);
|
|
9776
9838
|
currentcompositionsRef.current = updated;
|
|
9777
9839
|
return updated;
|
|
9778
9840
|
});
|
|
9779
9841
|
}, []);
|
|
9780
|
-
const registerComposition =
|
|
9842
|
+
const registerComposition = useCallback21((comp) => {
|
|
9781
9843
|
updateCompositions((comps) => {
|
|
9782
9844
|
if (comps.find((c2) => c2.id === comp.id)) {
|
|
9783
9845
|
throw new Error(`Multiple composition with id ${comp.id} are registered.`);
|
|
@@ -9785,12 +9847,12 @@ var CompositionManagerProvider = ({
|
|
|
9785
9847
|
return [...comps, comp];
|
|
9786
9848
|
});
|
|
9787
9849
|
}, [updateCompositions]);
|
|
9788
|
-
const unregisterComposition =
|
|
9850
|
+
const unregisterComposition = useCallback21((id) => {
|
|
9789
9851
|
setCompositions((comps) => {
|
|
9790
9852
|
return comps.filter((c2) => c2.id !== id);
|
|
9791
9853
|
});
|
|
9792
9854
|
}, []);
|
|
9793
|
-
const registerFolder =
|
|
9855
|
+
const registerFolder = useCallback21((name, parent, nonce, stack) => {
|
|
9794
9856
|
setFolders((prevFolders) => {
|
|
9795
9857
|
return [
|
|
9796
9858
|
...prevFolders,
|
|
@@ -9803,7 +9865,7 @@ var CompositionManagerProvider = ({
|
|
|
9803
9865
|
];
|
|
9804
9866
|
});
|
|
9805
9867
|
}, []);
|
|
9806
|
-
const unregisterFolder =
|
|
9868
|
+
const unregisterFolder = useCallback21((name, parent) => {
|
|
9807
9869
|
setFolders((prevFolders) => {
|
|
9808
9870
|
return prevFolders.filter((p) => !(p.name === name && p.parent === parent));
|
|
9809
9871
|
});
|
|
@@ -10366,11 +10428,11 @@ var usePixelDensity = (options) => {
|
|
|
10366
10428
|
};
|
|
10367
10429
|
|
|
10368
10430
|
// src/video/OffthreadVideo.tsx
|
|
10369
|
-
import { useCallback as
|
|
10431
|
+
import { useCallback as useCallback24 } from "react";
|
|
10370
10432
|
|
|
10371
10433
|
// src/video/OffthreadVideoForRendering.tsx
|
|
10372
10434
|
import {
|
|
10373
|
-
useCallback as
|
|
10435
|
+
useCallback as useCallback22,
|
|
10374
10436
|
useContext as useContext36,
|
|
10375
10437
|
useEffect as useEffect18,
|
|
10376
10438
|
useLayoutEffect as useLayoutEffect11,
|
|
@@ -10563,7 +10625,7 @@ var OffthreadVideoForRendering = ({
|
|
|
10563
10625
|
continueRender2,
|
|
10564
10626
|
delayRender2
|
|
10565
10627
|
]);
|
|
10566
|
-
const onErr =
|
|
10628
|
+
const onErr = useCallback22(() => {
|
|
10567
10629
|
if (onError) {
|
|
10568
10630
|
onError?.(new Error("Failed to load image with src " + imageSrc));
|
|
10569
10631
|
} else {
|
|
@@ -10573,7 +10635,7 @@ var OffthreadVideoForRendering = ({
|
|
|
10573
10635
|
const className = useMemo35(() => {
|
|
10574
10636
|
return [OBJECTFIT_CONTAIN_CLASS_NAME, props2.className].filter(truthy).join(" ");
|
|
10575
10637
|
}, [props2.className]);
|
|
10576
|
-
const onImageFrame =
|
|
10638
|
+
const onImageFrame = useCallback22((img) => {
|
|
10577
10639
|
if (onVideoFrame) {
|
|
10578
10640
|
onVideoFrame(img);
|
|
10579
10641
|
}
|
|
@@ -10596,7 +10658,7 @@ var OffthreadVideoForRendering = ({
|
|
|
10596
10658
|
// src/video/VideoForPreview.tsx
|
|
10597
10659
|
import React37, {
|
|
10598
10660
|
forwardRef as forwardRef13,
|
|
10599
|
-
useCallback as
|
|
10661
|
+
useCallback as useCallback23,
|
|
10600
10662
|
useContext as useContext37,
|
|
10601
10663
|
useEffect as useEffect20,
|
|
10602
10664
|
useImperativeHandle as useImperativeHandle9,
|
|
@@ -10725,7 +10787,7 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
|
|
|
10725
10787
|
mediaVolume
|
|
10726
10788
|
});
|
|
10727
10789
|
warnAboutTooHighVolume(userPreferredVolume);
|
|
10728
|
-
const getStack =
|
|
10790
|
+
const getStack = useCallback23(() => {
|
|
10729
10791
|
return _remotionInternalStack ?? null;
|
|
10730
10792
|
}, [_remotionInternalStack]);
|
|
10731
10793
|
useMediaInTimeline({
|
|
@@ -10904,7 +10966,7 @@ var InnerOffthreadVideo = (props2) => {
|
|
|
10904
10966
|
if (environment.isClientSideRendering) {
|
|
10905
10967
|
throw new Error("<OffthreadVideo> is not supported in @remotion/web-renderer. Use <Video> from @remotion/media instead. See https://remotion.dev/docs/client-side-rendering/limitations");
|
|
10906
10968
|
}
|
|
10907
|
-
const onDuration =
|
|
10969
|
+
const onDuration = useCallback24(() => {
|
|
10908
10970
|
return;
|
|
10909
10971
|
}, []);
|
|
10910
10972
|
if (typeof props2.src !== "string") {
|
|
@@ -11325,6 +11387,7 @@ var Internals = {
|
|
|
11325
11387
|
getEffectPropStatusesCtx,
|
|
11326
11388
|
hiddenField,
|
|
11327
11389
|
durationInFramesField,
|
|
11390
|
+
freezeField,
|
|
11328
11391
|
fromField
|
|
11329
11392
|
};
|
|
11330
11393
|
// src/series/index.tsx
|
|
@@ -11422,6 +11485,7 @@ var SeriesInner = (props2) => {
|
|
|
11422
11485
|
};
|
|
11423
11486
|
var Series = Object.assign(wrapInSchema({
|
|
11424
11487
|
Component: SeriesInner,
|
|
11488
|
+
componentIdentity: "dev.remotion.remotion.Series",
|
|
11425
11489
|
schema: sequenceSchemaDefaultLayoutNone,
|
|
11426
11490
|
supportsEffects: false
|
|
11427
11491
|
}), {
|
|
@@ -11528,7 +11592,7 @@ var Still = (props2) => {
|
|
|
11528
11592
|
return React42.createElement(Composition, newProps);
|
|
11529
11593
|
};
|
|
11530
11594
|
// src/video/html5-video.tsx
|
|
11531
|
-
import { forwardRef as forwardRef16, useCallback as
|
|
11595
|
+
import { forwardRef as forwardRef16, useCallback as useCallback25, useContext as useContext39 } from "react";
|
|
11532
11596
|
|
|
11533
11597
|
// src/video/VideoForRendering.tsx
|
|
11534
11598
|
import {
|
|
@@ -11918,7 +11982,7 @@ var VideoForwardingFunction = (props2, ref) => {
|
|
|
11918
11982
|
throw new TypeError(`The \`<Html5Video>\` tag requires a string for \`src\`, but got ${JSON.stringify(props2.src)} instead.`);
|
|
11919
11983
|
}
|
|
11920
11984
|
const preloadedSrc = usePreload(props2.src);
|
|
11921
|
-
const onDuration =
|
|
11985
|
+
const onDuration = useCallback25((src, durationInSeconds) => {
|
|
11922
11986
|
setDurations({ type: "got-duration", durationInSeconds, src });
|
|
11923
11987
|
}, [setDurations]);
|
|
11924
11988
|
const durationFetched = durations[getAbsoluteSrc(preloadedSrc)] ?? durations[getAbsoluteSrc(props2.src)];
|