remotion 4.0.476 → 4.0.478
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 +5 -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 +57 -4
- 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/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/use-media-in-timeline.js +2 -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 +150 -72
- 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.478";
|
|
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]);
|
|
@@ -4260,6 +4285,11 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
4260
4285
|
const inheritedStack = other?.stack ?? null;
|
|
4261
4286
|
const stackRef = useRef6(null);
|
|
4262
4287
|
stackRef.current = stack ?? inheritedStack;
|
|
4288
|
+
const registeredFrozenFrame = typeof freeze === "number" ? freeze : null;
|
|
4289
|
+
const parentCumulatedNegativeFrom = parentSequence?.cumulatedNegativeFrom ?? 0;
|
|
4290
|
+
const startMediaFrom = isMedia && isMedia.type !== "image" ? isMedia.data.startMediaFrom + parentCumulatedNegativeFrom - cumulatedNegativeFrom : null;
|
|
4291
|
+
const mediaFrameAtSequenceZero = isMedia && isMedia.type !== "image" ? isMedia.data.startMediaFrom + parentCumulatedNegativeFrom : null;
|
|
4292
|
+
const frozenMediaFrame = isMedia && isMedia.type !== "image" && mediaFrameAtSequenceZero !== null ? registeredFrozenFrame === null ? null : mediaFrameAtSequenceZero + (loopDisplay ? registeredFrozenFrame % loopDisplay.durationInFrames : registeredFrozenFrame) * isMedia.data.playbackRate : null;
|
|
4263
4293
|
useEffect3(() => {
|
|
4264
4294
|
if (!env.isStudio) {
|
|
4265
4295
|
return;
|
|
@@ -4285,7 +4315,8 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
4285
4315
|
src: isMedia.src,
|
|
4286
4316
|
getStack: () => stackRef.current,
|
|
4287
4317
|
refForOutline: refForOutline ?? null,
|
|
4288
|
-
isInsideSeries
|
|
4318
|
+
isInsideSeries,
|
|
4319
|
+
frozenFrame: registeredFrozenFrame
|
|
4289
4320
|
});
|
|
4290
4321
|
} else {
|
|
4291
4322
|
registerSequence({
|
|
@@ -4308,10 +4339,12 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
4308
4339
|
showInTimeline,
|
|
4309
4340
|
src: isMedia.data.src,
|
|
4310
4341
|
getStack: () => stackRef.current,
|
|
4311
|
-
startMediaFrom: isMedia.data.startMediaFrom,
|
|
4342
|
+
startMediaFrom: startMediaFrom ?? isMedia.data.startMediaFrom,
|
|
4312
4343
|
volume: isMedia.data.volumes,
|
|
4313
4344
|
refForOutline: refForOutline ?? null,
|
|
4314
|
-
isInsideSeries
|
|
4345
|
+
isInsideSeries,
|
|
4346
|
+
frozenFrame: registeredFrozenFrame,
|
|
4347
|
+
frozenMediaFrame
|
|
4315
4348
|
});
|
|
4316
4349
|
}
|
|
4317
4350
|
return () => {
|
|
@@ -4336,7 +4369,8 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
4336
4369
|
controls: controls ?? null,
|
|
4337
4370
|
effects: _remotionInternalEffects ?? EMPTY_EFFECTS,
|
|
4338
4371
|
refForOutline: refForOutline ?? null,
|
|
4339
|
-
isInsideSeries
|
|
4372
|
+
isInsideSeries,
|
|
4373
|
+
frozenFrame: registeredFrozenFrame
|
|
4340
4374
|
});
|
|
4341
4375
|
return () => {
|
|
4342
4376
|
unregisterSequence(id);
|
|
@@ -4363,11 +4397,26 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
4363
4397
|
isMedia,
|
|
4364
4398
|
resolvedDocumentationLink,
|
|
4365
4399
|
refForOutline,
|
|
4366
|
-
isInsideSeries
|
|
4400
|
+
isInsideSeries,
|
|
4401
|
+
registeredFrozenFrame,
|
|
4402
|
+
startMediaFrom,
|
|
4403
|
+
frozenMediaFrame
|
|
4367
4404
|
]);
|
|
4368
4405
|
const endThreshold = Math.ceil(cumulatedFrom + from + durationInFrames - 1);
|
|
4369
4406
|
const content = absoluteFrame < cumulatedFrom + from ? null : absoluteFrame > endThreshold ? null : children;
|
|
4407
|
+
const frozenContent = content === null || typeof freeze === "undefined" || freeze === null ? content : /* @__PURE__ */ jsx12(Freeze, {
|
|
4408
|
+
frame: freeze,
|
|
4409
|
+
children: content
|
|
4410
|
+
});
|
|
4370
4411
|
const styleIfThere = other.layout === "none" ? undefined : other.style;
|
|
4412
|
+
const sequenceRef = useCallback6((node) => {
|
|
4413
|
+
wrapperRefForOutline.current = node;
|
|
4414
|
+
if (typeof ref === "function") {
|
|
4415
|
+
ref(node);
|
|
4416
|
+
} else if (ref) {
|
|
4417
|
+
ref.current = node;
|
|
4418
|
+
}
|
|
4419
|
+
}, [ref]);
|
|
4371
4420
|
const defaultStyle = useMemo14(() => {
|
|
4372
4421
|
return {
|
|
4373
4422
|
flexDirection: undefined,
|
|
@@ -4384,11 +4433,11 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
4384
4433
|
}
|
|
4385
4434
|
return /* @__PURE__ */ jsx12(SequenceContext.Provider, {
|
|
4386
4435
|
value: contextValue,
|
|
4387
|
-
children:
|
|
4388
|
-
ref,
|
|
4436
|
+
children: frozenContent === null ? null : other.layout === "none" ? frozenContent : /* @__PURE__ */ jsx12(AbsoluteFill, {
|
|
4437
|
+
ref: sequenceRef,
|
|
4389
4438
|
style: defaultStyle,
|
|
4390
4439
|
className: other.className,
|
|
4391
|
-
children:
|
|
4440
|
+
children: frozenContent
|
|
4392
4441
|
})
|
|
4393
4442
|
});
|
|
4394
4443
|
};
|
|
@@ -4468,11 +4517,13 @@ var SequenceInner = forwardRef3(SequenceRefForwardingFunction);
|
|
|
4468
4517
|
var SequenceWithoutSchema = SequenceInner;
|
|
4469
4518
|
var Sequence = wrapInSchema({
|
|
4470
4519
|
Component: SequenceInner,
|
|
4520
|
+
componentIdentity: "dev.remotion.remotion.Sequence",
|
|
4471
4521
|
schema: sequenceSchema,
|
|
4472
4522
|
supportsEffects: false
|
|
4473
4523
|
});
|
|
4474
4524
|
var SequenceWithoutFrom = wrapInSchema({
|
|
4475
4525
|
Component: SequenceInner,
|
|
4526
|
+
componentIdentity: null,
|
|
4476
4527
|
schema: sequenceSchemaWithoutFrom,
|
|
4477
4528
|
supportsEffects: false
|
|
4478
4529
|
});
|
|
@@ -4487,7 +4538,7 @@ import {
|
|
|
4487
4538
|
} from "react";
|
|
4488
4539
|
|
|
4489
4540
|
// src/animated-image/canvas.tsx
|
|
4490
|
-
import React15, { useCallback as
|
|
4541
|
+
import React15, { useCallback as useCallback7, useImperativeHandle, useMemo as useMemo16, useRef as useRef8 } from "react";
|
|
4491
4542
|
|
|
4492
4543
|
// src/calculate-image-fit.ts
|
|
4493
4544
|
var calculateImageFit = (fit, imageSize, canvasSize) => {
|
|
@@ -4819,7 +4870,7 @@ var CanvasRefForwardingFunction = ({ width, height, fit, className, style, effec
|
|
|
4819
4870
|
}
|
|
4820
4871
|
return document.createElement("canvas");
|
|
4821
4872
|
}, []);
|
|
4822
|
-
const draw =
|
|
4873
|
+
const draw = useCallback7((imageData) => {
|
|
4823
4874
|
const canvas = canvasRef.current;
|
|
4824
4875
|
const canvasWidth = width ?? imageData.displayWidth;
|
|
4825
4876
|
const canvasHeight = height ?? imageData.displayHeight;
|
|
@@ -5049,6 +5100,7 @@ import { jsx as jsx14 } from "react/jsx-runtime";
|
|
|
5049
5100
|
var animatedImageSchema = {
|
|
5050
5101
|
durationInFrames: durationInFramesField,
|
|
5051
5102
|
from: fromField,
|
|
5103
|
+
freeze: freezeField,
|
|
5052
5104
|
playbackRate: {
|
|
5053
5105
|
type: "number",
|
|
5054
5106
|
min: 0,
|
|
@@ -5248,6 +5300,7 @@ var AnimatedImageInner = ({
|
|
|
5248
5300
|
};
|
|
5249
5301
|
var AnimatedImage = wrapInSchema({
|
|
5250
5302
|
Component: AnimatedImageInner,
|
|
5303
|
+
componentIdentity: "dev.remotion.remotion.AnimatedImage",
|
|
5251
5304
|
schema: animatedImageSchema,
|
|
5252
5305
|
supportsEffects: true
|
|
5253
5306
|
});
|
|
@@ -5259,7 +5312,7 @@ import { useContext as useContext18, useLayoutEffect as useLayoutEffect4, useSta
|
|
|
5259
5312
|
// src/RenderAssetManager.tsx
|
|
5260
5313
|
import {
|
|
5261
5314
|
createContext as createContext17,
|
|
5262
|
-
useCallback as
|
|
5315
|
+
useCallback as useCallback8,
|
|
5263
5316
|
useImperativeHandle as useImperativeHandle3,
|
|
5264
5317
|
useLayoutEffect as useLayoutEffect3,
|
|
5265
5318
|
useMemo as useMemo17,
|
|
@@ -5312,7 +5365,7 @@ var RenderAssetManager = createContext17({
|
|
|
5312
5365
|
var RenderAssetManagerProvider = ({ children, collectAssets }) => {
|
|
5313
5366
|
const [renderAssets, setRenderAssets] = useState7([]);
|
|
5314
5367
|
const renderAssetsRef = useRef10([]);
|
|
5315
|
-
const registerRenderAsset =
|
|
5368
|
+
const registerRenderAsset = useCallback8((renderAsset) => {
|
|
5316
5369
|
validateRenderAsset(renderAsset);
|
|
5317
5370
|
renderAssetsRef.current = [...renderAssetsRef.current, renderAsset];
|
|
5318
5371
|
setRenderAssets(renderAssetsRef.current);
|
|
@@ -5329,7 +5382,7 @@ var RenderAssetManagerProvider = ({ children, collectAssets }) => {
|
|
|
5329
5382
|
};
|
|
5330
5383
|
}, []);
|
|
5331
5384
|
}
|
|
5332
|
-
const unregisterRenderAsset =
|
|
5385
|
+
const unregisterRenderAsset = useCallback8((id) => {
|
|
5333
5386
|
renderAssetsRef.current = renderAssetsRef.current.filter((a2) => a2.id !== id);
|
|
5334
5387
|
setRenderAssets(renderAssetsRef.current);
|
|
5335
5388
|
}, []);
|
|
@@ -5416,7 +5469,7 @@ var Artifact = ({ filename, content, downloadBehavior }) => {
|
|
|
5416
5469
|
};
|
|
5417
5470
|
Artifact.Thumbnail = ArtifactThumbnail;
|
|
5418
5471
|
// src/audio/html5-audio.tsx
|
|
5419
|
-
import { forwardRef as forwardRef7, useCallback as
|
|
5472
|
+
import { forwardRef as forwardRef7, useCallback as useCallback14, useContext as useContext30 } from "react";
|
|
5420
5473
|
|
|
5421
5474
|
// src/absolute-src.ts
|
|
5422
5475
|
var getAbsoluteSrc = (relativeSrc) => {
|
|
@@ -5886,7 +5939,7 @@ var DurationsContextProvider = ({ children }) => {
|
|
|
5886
5939
|
};
|
|
5887
5940
|
|
|
5888
5941
|
// src/audio/AudioForPreview.tsx
|
|
5889
|
-
import { useCallback as
|
|
5942
|
+
import { useCallback as useCallback13 } from "react";
|
|
5890
5943
|
import React22, {
|
|
5891
5944
|
forwardRef as forwardRef5,
|
|
5892
5945
|
useContext as useContext28,
|
|
@@ -5922,7 +5975,7 @@ import { useContext as useContext21, useLayoutEffect as useLayoutEffect5, useRef
|
|
|
5922
5975
|
import React19, {
|
|
5923
5976
|
createContext as createContext21,
|
|
5924
5977
|
createRef as createRef2,
|
|
5925
|
-
useCallback as
|
|
5978
|
+
useCallback as useCallback9,
|
|
5926
5979
|
useContext as useContext20,
|
|
5927
5980
|
useEffect as useEffect7,
|
|
5928
5981
|
useMemo as useMemo21,
|
|
@@ -6206,7 +6259,7 @@ var SharedAudioContextProvider = ({ children, audioLatencyHint, audioEnabled, pr
|
|
|
6206
6259
|
}, []);
|
|
6207
6260
|
const prevEndTimes = useRef12({ scheduledEndTime: null, mediaEndTime: null });
|
|
6208
6261
|
const nodesToResume = useRef12(new Map);
|
|
6209
|
-
const unscheduleAudioNode =
|
|
6262
|
+
const unscheduleAudioNode = useCallback9((node) => {
|
|
6210
6263
|
nodesToResume.current.delete(node);
|
|
6211
6264
|
}, []);
|
|
6212
6265
|
const scheduleAudioNode = useMemo21(() => {
|
|
@@ -6260,7 +6313,7 @@ var SharedAudioContextProvider = ({ children, audioLatencyHint, audioEnabled, pr
|
|
|
6260
6313
|
};
|
|
6261
6314
|
};
|
|
6262
6315
|
}, [ctxAndGain, logLevel]);
|
|
6263
|
-
const resume =
|
|
6316
|
+
const resume = useCallback9(() => {
|
|
6264
6317
|
if (!ctxAndGain) {
|
|
6265
6318
|
return Promise.resolve();
|
|
6266
6319
|
}
|
|
@@ -6287,10 +6340,10 @@ var SharedAudioContextProvider = ({ children, audioLatencyHint, audioEnabled, pr
|
|
|
6287
6340
|
});
|
|
6288
6341
|
return resumePromise.catch(() => {});
|
|
6289
6342
|
}, [ctxAndGain, logLevel]);
|
|
6290
|
-
const getIsResumingAudioContext =
|
|
6343
|
+
const getIsResumingAudioContext = useCallback9(() => {
|
|
6291
6344
|
return isResuming.current;
|
|
6292
6345
|
}, []);
|
|
6293
|
-
const suspend =
|
|
6346
|
+
const suspend = useCallback9(() => {
|
|
6294
6347
|
if (!ctxAndGain) {
|
|
6295
6348
|
return Promise.resolve();
|
|
6296
6349
|
}
|
|
@@ -6364,7 +6417,7 @@ var SharedAudioTagsContextProvider = ({ children, numberOfAudioTags }) => {
|
|
|
6364
6417
|
};
|
|
6365
6418
|
}, [refs]);
|
|
6366
6419
|
const takenAudios = useRef12(new Array(numberOfAudioTags).fill(false));
|
|
6367
|
-
const rerenderAudios =
|
|
6420
|
+
const rerenderAudios = useCallback9(() => {
|
|
6368
6421
|
refs.forEach(({ ref, id }) => {
|
|
6369
6422
|
const data = audios.current?.find((a2) => a2.id === id);
|
|
6370
6423
|
const { current } = ref;
|
|
@@ -6385,7 +6438,7 @@ var SharedAudioTagsContextProvider = ({ children, numberOfAudioTags }) => {
|
|
|
6385
6438
|
});
|
|
6386
6439
|
});
|
|
6387
6440
|
}, [refs]);
|
|
6388
|
-
const registerAudio =
|
|
6441
|
+
const registerAudio = useCallback9((options) => {
|
|
6389
6442
|
const { aud, audioId, premounting, postmounting } = options;
|
|
6390
6443
|
const found = audios.current?.find((a2) => a2.audioId === audioId);
|
|
6391
6444
|
if (found) {
|
|
@@ -6414,7 +6467,7 @@ var SharedAudioTagsContextProvider = ({ children, numberOfAudioTags }) => {
|
|
|
6414
6467
|
rerenderAudios();
|
|
6415
6468
|
return newElem;
|
|
6416
6469
|
}, [numberOfAudioTags, refs, rerenderAudios]);
|
|
6417
|
-
const unregisterAudio =
|
|
6470
|
+
const unregisterAudio = useCallback9((id) => {
|
|
6418
6471
|
const cloned = [...takenAudios.current];
|
|
6419
6472
|
const index = refs.findIndex((r) => r.id === id);
|
|
6420
6473
|
if (index === -1) {
|
|
@@ -6425,7 +6478,7 @@ var SharedAudioTagsContextProvider = ({ children, numberOfAudioTags }) => {
|
|
|
6425
6478
|
audios.current = audios.current?.filter((a2) => a2.id !== id);
|
|
6426
6479
|
rerenderAudios();
|
|
6427
6480
|
}, [refs, rerenderAudios]);
|
|
6428
|
-
const updateAudio =
|
|
6481
|
+
const updateAudio = useCallback9(({
|
|
6429
6482
|
aud,
|
|
6430
6483
|
audioId,
|
|
6431
6484
|
id,
|
|
@@ -6459,7 +6512,7 @@ var SharedAudioTagsContextProvider = ({ children, numberOfAudioTags }) => {
|
|
|
6459
6512
|
rerenderAudios();
|
|
6460
6513
|
}
|
|
6461
6514
|
}, [rerenderAudios]);
|
|
6462
|
-
const playAllAudios =
|
|
6515
|
+
const playAllAudios = useCallback9(() => {
|
|
6463
6516
|
refs.forEach((ref) => {
|
|
6464
6517
|
const audio = audios.current.find((a2) => a2.el === ref.ref);
|
|
6465
6518
|
if (audio?.premounting) {
|
|
@@ -6991,7 +7044,9 @@ var useMediaInTimeline = ({
|
|
|
6991
7044
|
controls: null,
|
|
6992
7045
|
effects: [],
|
|
6993
7046
|
refForOutline,
|
|
6994
|
-
isInsideSeries: false
|
|
7047
|
+
isInsideSeries: false,
|
|
7048
|
+
frozenFrame: null,
|
|
7049
|
+
frozenMediaFrame: null
|
|
6995
7050
|
});
|
|
6996
7051
|
return () => {
|
|
6997
7052
|
unregisterSequence(id);
|
|
@@ -7024,7 +7079,7 @@ var useMediaInTimeline = ({
|
|
|
7024
7079
|
|
|
7025
7080
|
// src/use-media-playback.ts
|
|
7026
7081
|
import {
|
|
7027
|
-
useCallback as
|
|
7082
|
+
useCallback as useCallback12,
|
|
7028
7083
|
useContext as useContext26,
|
|
7029
7084
|
useEffect as useEffect12,
|
|
7030
7085
|
useLayoutEffect as useLayoutEffect7,
|
|
@@ -7032,14 +7087,14 @@ import {
|
|
|
7032
7087
|
} from "react";
|
|
7033
7088
|
|
|
7034
7089
|
// src/buffer-until-first-frame.ts
|
|
7035
|
-
import { useCallback as
|
|
7090
|
+
import { useCallback as useCallback11, useMemo as useMemo25, useRef as useRef16 } from "react";
|
|
7036
7091
|
|
|
7037
7092
|
// src/use-buffer-state.ts
|
|
7038
7093
|
import { useContext as useContext25, useMemo as useMemo24 } from "react";
|
|
7039
7094
|
|
|
7040
7095
|
// src/buffering.tsx
|
|
7041
7096
|
import React20, {
|
|
7042
|
-
useCallback as
|
|
7097
|
+
useCallback as useCallback10,
|
|
7043
7098
|
useContext as useContext24,
|
|
7044
7099
|
useEffect as useEffect9,
|
|
7045
7100
|
useLayoutEffect as useLayoutEffect6,
|
|
@@ -7055,7 +7110,7 @@ var useBufferManager = (logLevel, mountTime) => {
|
|
|
7055
7110
|
const env = useRemotionEnvironment();
|
|
7056
7111
|
const rendering = env.isRendering;
|
|
7057
7112
|
const buffering = useRef15(false);
|
|
7058
|
-
const addBlock =
|
|
7113
|
+
const addBlock = useCallback10((block) => {
|
|
7059
7114
|
if (rendering) {
|
|
7060
7115
|
return {
|
|
7061
7116
|
unblock: () => {
|
|
@@ -7081,7 +7136,7 @@ var useBufferManager = (logLevel, mountTime) => {
|
|
|
7081
7136
|
}
|
|
7082
7137
|
};
|
|
7083
7138
|
}, [rendering]);
|
|
7084
|
-
const listenForBuffering =
|
|
7139
|
+
const listenForBuffering = useCallback10((callback) => {
|
|
7085
7140
|
setOnBufferingCallbacks((c2) => [...c2, callback]);
|
|
7086
7141
|
return {
|
|
7087
7142
|
remove: () => {
|
|
@@ -7089,7 +7144,7 @@ var useBufferManager = (logLevel, mountTime) => {
|
|
|
7089
7144
|
}
|
|
7090
7145
|
};
|
|
7091
7146
|
}, []);
|
|
7092
|
-
const listenForResume =
|
|
7147
|
+
const listenForResume = useCallback10((callback) => {
|
|
7093
7148
|
setOnResumeCallbacks((c2) => [...c2, callback]);
|
|
7094
7149
|
return {
|
|
7095
7150
|
remove: () => {
|
|
@@ -7207,7 +7262,7 @@ var useBufferUntilFirstFrame = ({
|
|
|
7207
7262
|
}) => {
|
|
7208
7263
|
const bufferingRef = useRef16(false);
|
|
7209
7264
|
const { delayPlayback } = useBufferState();
|
|
7210
|
-
const bufferUntilFirstFrame =
|
|
7265
|
+
const bufferUntilFirstFrame = useCallback11((requestedTime) => {
|
|
7211
7266
|
if (mediaType !== "video") {
|
|
7212
7267
|
return;
|
|
7213
7268
|
}
|
|
@@ -7614,7 +7669,7 @@ var useMediaPlayback = ({
|
|
|
7614
7669
|
throw new Error("useMediaPlayback must be used inside a <BufferingContext>");
|
|
7615
7670
|
}
|
|
7616
7671
|
const isVariableFpsVideoMap = useRef18({});
|
|
7617
|
-
const onVariableFpsVideoDetected =
|
|
7672
|
+
const onVariableFpsVideoDetected = useCallback12(() => {
|
|
7618
7673
|
if (!src) {
|
|
7619
7674
|
return;
|
|
7620
7675
|
}
|
|
@@ -8016,7 +8071,7 @@ var AudioForDevelopmentForwardRefFunction = (props, ref) => {
|
|
|
8016
8071
|
premounting: Boolean(sequenceContext?.premounting),
|
|
8017
8072
|
postmounting: Boolean(sequenceContext?.postmounting)
|
|
8018
8073
|
});
|
|
8019
|
-
const getStack =
|
|
8074
|
+
const getStack = useCallback13(() => {
|
|
8020
8075
|
return _remotionInternalStack ?? null;
|
|
8021
8076
|
}, [_remotionInternalStack]);
|
|
8022
8077
|
useMediaInTimeline({
|
|
@@ -8277,7 +8332,7 @@ var AudioRefForwardingFunction = (props, ref) => {
|
|
|
8277
8332
|
throw new TypeError(`The \`<Html5Audio>\` tag requires a string for \`src\`, but got ${JSON.stringify(props.src)} instead.`);
|
|
8278
8333
|
}
|
|
8279
8334
|
const preloadedSrc = usePreload(props.src);
|
|
8280
|
-
const onError =
|
|
8335
|
+
const onError = useCallback14((e) => {
|
|
8281
8336
|
console.log(e.currentTarget.error);
|
|
8282
8337
|
const errMessage = `Could not play audio with src ${preloadedSrc}: ${e.currentTarget.error}. See https://remotion.dev/docs/media-playback-error for help.`;
|
|
8283
8338
|
if (loop) {
|
|
@@ -8291,7 +8346,7 @@ var AudioRefForwardingFunction = (props, ref) => {
|
|
|
8291
8346
|
console.warn(errMessage);
|
|
8292
8347
|
}
|
|
8293
8348
|
}, [loop, onRemotionError, preloadedSrc]);
|
|
8294
|
-
const onDuration =
|
|
8349
|
+
const onDuration = useCallback14((src, durationInSeconds) => {
|
|
8295
8350
|
setDurations({ type: "got-duration", durationInSeconds, src });
|
|
8296
8351
|
}, [setDurations]);
|
|
8297
8352
|
const durationFetched = durations[getAbsoluteSrc(preloadedSrc)] ?? durations[getAbsoluteSrc(props.src)];
|
|
@@ -8374,7 +8429,7 @@ var Audio = Html5Audio;
|
|
|
8374
8429
|
// src/effects/Solid.tsx
|
|
8375
8430
|
import {
|
|
8376
8431
|
forwardRef as forwardRef8,
|
|
8377
|
-
useCallback as
|
|
8432
|
+
useCallback as useCallback15,
|
|
8378
8433
|
useEffect as useEffect16,
|
|
8379
8434
|
useImperativeHandle as useImperativeHandle6,
|
|
8380
8435
|
useMemo as useMemo29,
|
|
@@ -8394,6 +8449,7 @@ var resolveSolidPixelDensity = (pixelDensity) => {
|
|
|
8394
8449
|
var solidSchema = {
|
|
8395
8450
|
durationInFrames: durationInFramesField,
|
|
8396
8451
|
from: fromField,
|
|
8452
|
+
freeze: freezeField,
|
|
8397
8453
|
color: {
|
|
8398
8454
|
type: "color",
|
|
8399
8455
|
default: "transparent",
|
|
@@ -8448,7 +8504,7 @@ var SolidInner = ({
|
|
|
8448
8504
|
return canvas;
|
|
8449
8505
|
}, []);
|
|
8450
8506
|
const chainState = useEffectChainState();
|
|
8451
|
-
const canvasRef =
|
|
8507
|
+
const canvasRef = useCallback15((canvas) => {
|
|
8452
8508
|
setOutputCanvas(canvas);
|
|
8453
8509
|
if (typeof reference === "function") {
|
|
8454
8510
|
reference(canvas);
|
|
@@ -8532,6 +8588,7 @@ var SolidOuter = forwardRef8(({
|
|
|
8532
8588
|
style,
|
|
8533
8589
|
name,
|
|
8534
8590
|
from,
|
|
8591
|
+
freeze,
|
|
8535
8592
|
hidden,
|
|
8536
8593
|
showInTimeline,
|
|
8537
8594
|
pixelDensity,
|
|
@@ -8545,6 +8602,7 @@ var SolidOuter = forwardRef8(({
|
|
|
8545
8602
|
return /* @__PURE__ */ jsx24(Sequence, {
|
|
8546
8603
|
layout: "none",
|
|
8547
8604
|
from,
|
|
8605
|
+
freeze,
|
|
8548
8606
|
hidden,
|
|
8549
8607
|
showInTimeline,
|
|
8550
8608
|
_experimentalControls: controls,
|
|
@@ -8569,6 +8627,7 @@ var SolidOuter = forwardRef8(({
|
|
|
8569
8627
|
});
|
|
8570
8628
|
var Solid = wrapInSchema({
|
|
8571
8629
|
Component: SolidOuter,
|
|
8630
|
+
componentIdentity: "dev.remotion.remotion.Solid",
|
|
8572
8631
|
schema: solidSchema,
|
|
8573
8632
|
supportsEffects: true
|
|
8574
8633
|
});
|
|
@@ -8578,7 +8637,7 @@ addSequenceStackTraces(Solid);
|
|
|
8578
8637
|
import {
|
|
8579
8638
|
createContext as createContext23,
|
|
8580
8639
|
forwardRef as forwardRef9,
|
|
8581
|
-
useCallback as
|
|
8640
|
+
useCallback as useCallback16,
|
|
8582
8641
|
useContext as useContext31,
|
|
8583
8642
|
useLayoutEffect as useLayoutEffect9,
|
|
8584
8643
|
useMemo as useMemo30,
|
|
@@ -8669,7 +8728,7 @@ var HtmlInCanvasContent = forwardRef9(({
|
|
|
8669
8728
|
const offscreenRef = useRef22(null);
|
|
8670
8729
|
const divRef = useRef22(null);
|
|
8671
8730
|
const canvasSizeKey = `${width}x${height}@${resolvedPixelDensity}`;
|
|
8672
|
-
const setLayoutCanvasRef =
|
|
8731
|
+
const setLayoutCanvasRef = useCallback16((node) => {
|
|
8673
8732
|
canvas2dRef.current = node;
|
|
8674
8733
|
if (typeof ref === "function") {
|
|
8675
8734
|
ref(node);
|
|
@@ -8691,7 +8750,7 @@ var HtmlInCanvasContent = forwardRef9(({
|
|
|
8691
8750
|
const initializedRef = useRef22(false);
|
|
8692
8751
|
const onInitCleanupRef = useRef22(null);
|
|
8693
8752
|
const unmountedRef = useRef22(false);
|
|
8694
|
-
const onPaintCb =
|
|
8753
|
+
const onPaintCb = useCallback16(async () => {
|
|
8695
8754
|
const element = divRef.current;
|
|
8696
8755
|
if (!element) {
|
|
8697
8756
|
throw new Error("Canvas or scene element not found");
|
|
@@ -8864,7 +8923,7 @@ var HtmlInCanvasInner = forwardRef9(({
|
|
|
8864
8923
|
const resolvedDuration = durationInFrames ?? videoDuration;
|
|
8865
8924
|
const memoizedEffectDefinitions = useMemoizedEffectDefinitions(effects);
|
|
8866
8925
|
const actualRef = useRef22(null);
|
|
8867
|
-
const setCanvasRef =
|
|
8926
|
+
const setCanvasRef = useCallback16((node) => {
|
|
8868
8927
|
actualRef.current = node;
|
|
8869
8928
|
if (typeof ref === "function") {
|
|
8870
8929
|
ref(node);
|
|
@@ -8899,11 +8958,13 @@ HtmlInCanvasInner.displayName = "HtmlInCanvas";
|
|
|
8899
8958
|
var htmlInCanvasSchema = {
|
|
8900
8959
|
durationInFrames: durationInFramesField,
|
|
8901
8960
|
from: fromField,
|
|
8961
|
+
freeze: freezeField,
|
|
8902
8962
|
...sequenceVisualStyleSchema,
|
|
8903
8963
|
hidden: hiddenField
|
|
8904
8964
|
};
|
|
8905
8965
|
var HtmlInCanvasWrapped = wrapInSchema({
|
|
8906
8966
|
Component: HtmlInCanvasInner,
|
|
8967
|
+
componentIdentity: "dev.remotion.remotion.HtmlInCanvas",
|
|
8907
8968
|
schema: htmlInCanvasSchema,
|
|
8908
8969
|
supportsEffects: true
|
|
8909
8970
|
});
|
|
@@ -8915,7 +8976,7 @@ addSequenceStackTraces(HtmlInCanvas);
|
|
|
8915
8976
|
// src/canvas-image/CanvasImage.tsx
|
|
8916
8977
|
import {
|
|
8917
8978
|
forwardRef as forwardRef10,
|
|
8918
|
-
useCallback as
|
|
8979
|
+
useCallback as useCallback17,
|
|
8919
8980
|
useContext as useContext32,
|
|
8920
8981
|
useEffect as useEffect17,
|
|
8921
8982
|
useImperativeHandle as useImperativeHandle7,
|
|
@@ -8937,6 +8998,7 @@ import { jsx as jsx26 } from "react/jsx-runtime";
|
|
|
8937
8998
|
var canvasImageSchema = {
|
|
8938
8999
|
durationInFrames: durationInFramesField,
|
|
8939
9000
|
from: fromField,
|
|
9001
|
+
freeze: freezeField,
|
|
8940
9002
|
fit: {
|
|
8941
9003
|
type: "enum",
|
|
8942
9004
|
default: "fill",
|
|
@@ -9042,7 +9104,7 @@ var CanvasImageContent = forwardRef10(({
|
|
|
9042
9104
|
}
|
|
9043
9105
|
return document.createElement("canvas");
|
|
9044
9106
|
}, []);
|
|
9045
|
-
const canvasRef =
|
|
9107
|
+
const canvasRef = useCallback17((canvas) => {
|
|
9046
9108
|
setOutputCanvas(canvas);
|
|
9047
9109
|
if (refForOutline) {
|
|
9048
9110
|
refForOutline.current = canvas;
|
|
@@ -9189,6 +9251,7 @@ var CanvasImageInner = forwardRef10(({
|
|
|
9189
9251
|
delayRenderTimeoutInMilliseconds,
|
|
9190
9252
|
durationInFrames,
|
|
9191
9253
|
from,
|
|
9254
|
+
freeze,
|
|
9192
9255
|
hidden,
|
|
9193
9256
|
name,
|
|
9194
9257
|
showInTimeline,
|
|
@@ -9210,6 +9273,7 @@ var CanvasImageInner = forwardRef10(({
|
|
|
9210
9273
|
layout: "none",
|
|
9211
9274
|
from: from ?? 0,
|
|
9212
9275
|
durationInFrames: durationInFrames ?? Infinity,
|
|
9276
|
+
freeze,
|
|
9213
9277
|
hidden,
|
|
9214
9278
|
showInTimeline: showInTimeline ?? true,
|
|
9215
9279
|
name: name ?? "<CanvasImage>",
|
|
@@ -9242,6 +9306,7 @@ var CanvasImageInner = forwardRef10(({
|
|
|
9242
9306
|
});
|
|
9243
9307
|
var CanvasImage = wrapInSchema({
|
|
9244
9308
|
Component: CanvasImageInner,
|
|
9309
|
+
componentIdentity: "dev.remotion.remotion.CanvasImage",
|
|
9245
9310
|
schema: canvasImageSchema,
|
|
9246
9311
|
supportsEffects: true
|
|
9247
9312
|
});
|
|
@@ -9279,7 +9344,7 @@ var getStaticFiles = () => {
|
|
|
9279
9344
|
return window.remotion_staticFiles;
|
|
9280
9345
|
};
|
|
9281
9346
|
// src/IFrame.tsx
|
|
9282
|
-
import { forwardRef as forwardRef11, useCallback as
|
|
9347
|
+
import { forwardRef as forwardRef11, useCallback as useCallback18, useState as useState17 } from "react";
|
|
9283
9348
|
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
9284
9349
|
var IFrameRefForwarding = ({
|
|
9285
9350
|
onLoad,
|
|
@@ -9293,11 +9358,11 @@ var IFrameRefForwarding = ({
|
|
|
9293
9358
|
retries: delayRenderRetries ?? undefined,
|
|
9294
9359
|
timeoutInMilliseconds: delayRenderTimeoutInMilliseconds ?? undefined
|
|
9295
9360
|
}));
|
|
9296
|
-
const didLoad =
|
|
9361
|
+
const didLoad = useCallback18((e) => {
|
|
9297
9362
|
continueRender2(handle);
|
|
9298
9363
|
onLoad?.(e);
|
|
9299
9364
|
}, [handle, onLoad, continueRender2]);
|
|
9300
|
-
const didGetError =
|
|
9365
|
+
const didGetError = useCallback18((e) => {
|
|
9301
9366
|
continueRender2(handle);
|
|
9302
9367
|
if (onError) {
|
|
9303
9368
|
onError(e);
|
|
@@ -9315,7 +9380,7 @@ var IFrameRefForwarding = ({
|
|
|
9315
9380
|
};
|
|
9316
9381
|
var IFrame = forwardRef11(IFrameRefForwarding);
|
|
9317
9382
|
// src/Img.tsx
|
|
9318
|
-
import { useCallback as
|
|
9383
|
+
import { useCallback as useCallback19, useContext as useContext33, useLayoutEffect as useLayoutEffect10, useRef as useRef24 } from "react";
|
|
9319
9384
|
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
9320
9385
|
function exponentialBackoff2(errorCount) {
|
|
9321
9386
|
return 1000 * 2 ** (errorCount - 1);
|
|
@@ -9342,7 +9407,7 @@ var ImgContent = ({
|
|
|
9342
9407
|
if (!_propsValid) {
|
|
9343
9408
|
throw new Error("typecheck error");
|
|
9344
9409
|
}
|
|
9345
|
-
const imageCallbackRef =
|
|
9410
|
+
const imageCallbackRef = useCallback19((img) => {
|
|
9346
9411
|
imageRef.current = img;
|
|
9347
9412
|
refForOutline.current = img;
|
|
9348
9413
|
if (typeof ref === "function") {
|
|
@@ -9352,7 +9417,7 @@ var ImgContent = ({
|
|
|
9352
9417
|
}
|
|
9353
9418
|
}, [ref, refForOutline]);
|
|
9354
9419
|
const actualSrc = usePreload(src);
|
|
9355
|
-
const retryIn =
|
|
9420
|
+
const retryIn = useCallback19((timeout) => {
|
|
9356
9421
|
if (!imageRef.current) {
|
|
9357
9422
|
return;
|
|
9358
9423
|
}
|
|
@@ -9370,7 +9435,7 @@ var ImgContent = ({
|
|
|
9370
9435
|
}, timeout);
|
|
9371
9436
|
}, []);
|
|
9372
9437
|
const { delayRender: delayRender2, continueRender: continueRender2, cancelRender: cancelRender2 } = useDelayRender();
|
|
9373
|
-
const didGetError =
|
|
9438
|
+
const didGetError = useCallback19((e) => {
|
|
9374
9439
|
if (!errors.current) {
|
|
9375
9440
|
return;
|
|
9376
9441
|
}
|
|
@@ -9480,6 +9545,7 @@ var NativeImgInner = ({
|
|
|
9480
9545
|
src,
|
|
9481
9546
|
from,
|
|
9482
9547
|
durationInFrames,
|
|
9548
|
+
freeze,
|
|
9483
9549
|
_experimentalControls: controls,
|
|
9484
9550
|
_remotionInternalRefForOutline: refForOutline,
|
|
9485
9551
|
...props2
|
|
@@ -9491,6 +9557,7 @@ var NativeImgInner = ({
|
|
|
9491
9557
|
layout: "none",
|
|
9492
9558
|
from: from ?? 0,
|
|
9493
9559
|
durationInFrames: durationInFrames ?? Infinity,
|
|
9560
|
+
freeze,
|
|
9494
9561
|
_remotionInternalStack: stack,
|
|
9495
9562
|
_remotionInternalDocumentationLink: "https://www.remotion.dev/docs/img",
|
|
9496
9563
|
_remotionInternalIsMedia: { type: "image", src },
|
|
@@ -9510,6 +9577,7 @@ var CanvasImageWithPrivateProps = CanvasImage;
|
|
|
9510
9577
|
var imgSchema = {
|
|
9511
9578
|
durationInFrames: durationInFramesField,
|
|
9512
9579
|
from: fromField,
|
|
9580
|
+
freeze: freezeField,
|
|
9513
9581
|
...sequenceVisualStyleSchema,
|
|
9514
9582
|
hidden: hiddenField
|
|
9515
9583
|
};
|
|
@@ -9565,6 +9633,7 @@ var ImgInner = ({
|
|
|
9565
9633
|
src,
|
|
9566
9634
|
from,
|
|
9567
9635
|
durationInFrames,
|
|
9636
|
+
freeze,
|
|
9568
9637
|
_experimentalControls: controls,
|
|
9569
9638
|
width,
|
|
9570
9639
|
height,
|
|
@@ -9589,6 +9658,7 @@ var ImgInner = ({
|
|
|
9589
9658
|
src,
|
|
9590
9659
|
from,
|
|
9591
9660
|
durationInFrames,
|
|
9661
|
+
freeze,
|
|
9592
9662
|
_experimentalControls: controls,
|
|
9593
9663
|
width,
|
|
9594
9664
|
height,
|
|
@@ -9630,6 +9700,7 @@ var ImgInner = ({
|
|
|
9630
9700
|
delayRenderTimeoutInMilliseconds,
|
|
9631
9701
|
from,
|
|
9632
9702
|
durationInFrames,
|
|
9703
|
+
freeze,
|
|
9633
9704
|
hidden,
|
|
9634
9705
|
name: name ?? "<Img>",
|
|
9635
9706
|
showInTimeline,
|
|
@@ -9642,16 +9713,18 @@ var ImgInner = ({
|
|
|
9642
9713
|
};
|
|
9643
9714
|
var Img = wrapInSchema({
|
|
9644
9715
|
Component: ImgInner,
|
|
9716
|
+
componentIdentity: "dev.remotion.remotion.Img",
|
|
9645
9717
|
schema: imgSchema,
|
|
9646
9718
|
supportsEffects: true
|
|
9647
9719
|
});
|
|
9648
9720
|
addSequenceStackTraces(Img);
|
|
9649
9721
|
// src/Interactive.tsx
|
|
9650
|
-
import React29, { forwardRef as forwardRef12, useCallback as
|
|
9722
|
+
import React29, { forwardRef as forwardRef12, useCallback as useCallback20, useRef as useRef25 } from "react";
|
|
9651
9723
|
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
9652
9724
|
var interactiveElementSchema = {
|
|
9653
9725
|
durationInFrames: durationInFramesField,
|
|
9654
9726
|
from: fromField,
|
|
9727
|
+
freeze: freezeField,
|
|
9655
9728
|
...sequenceVisualStyleSchema,
|
|
9656
9729
|
hidden: hiddenField
|
|
9657
9730
|
};
|
|
@@ -9667,6 +9740,7 @@ var makeInteractiveElement = (tag, displayName) => {
|
|
|
9667
9740
|
const {
|
|
9668
9741
|
durationInFrames,
|
|
9669
9742
|
from,
|
|
9743
|
+
freeze,
|
|
9670
9744
|
hidden,
|
|
9671
9745
|
name,
|
|
9672
9746
|
showInTimeline,
|
|
@@ -9675,7 +9749,7 @@ var makeInteractiveElement = (tag, displayName) => {
|
|
|
9675
9749
|
...props2
|
|
9676
9750
|
} = propsWithControls;
|
|
9677
9751
|
const refForOutline = useRef25(null);
|
|
9678
|
-
const callbackRef =
|
|
9752
|
+
const callbackRef = useCallback20((element) => {
|
|
9679
9753
|
refForOutline.current = element;
|
|
9680
9754
|
setRef(ref, element);
|
|
9681
9755
|
}, [ref]);
|
|
@@ -9683,6 +9757,7 @@ var makeInteractiveElement = (tag, displayName) => {
|
|
|
9683
9757
|
layout: "none",
|
|
9684
9758
|
from: from ?? 0,
|
|
9685
9759
|
durationInFrames: durationInFrames ?? Infinity,
|
|
9760
|
+
freeze,
|
|
9686
9761
|
hidden,
|
|
9687
9762
|
name: name ?? displayName,
|
|
9688
9763
|
showInTimeline: showInTimeline ?? true,
|
|
@@ -9699,6 +9774,7 @@ var makeInteractiveElement = (tag, displayName) => {
|
|
|
9699
9774
|
Inner.displayName = displayName;
|
|
9700
9775
|
const Wrapped = wrapInSchema({
|
|
9701
9776
|
Component: Inner,
|
|
9777
|
+
componentIdentity: `dev.remotion.remotion.${displayName.slice(1, -1)}`,
|
|
9702
9778
|
schema: interactiveElementSchema,
|
|
9703
9779
|
supportsEffects: false
|
|
9704
9780
|
});
|
|
@@ -9752,7 +9828,7 @@ var compositionsRef = React30.createRef();
|
|
|
9752
9828
|
|
|
9753
9829
|
// src/CompositionManagerProvider.tsx
|
|
9754
9830
|
import {
|
|
9755
|
-
useCallback as
|
|
9831
|
+
useCallback as useCallback21,
|
|
9756
9832
|
useImperativeHandle as useImperativeHandle8,
|
|
9757
9833
|
useMemo as useMemo32,
|
|
9758
9834
|
useRef as useRef26,
|
|
@@ -9770,14 +9846,14 @@ var CompositionManagerProvider = ({
|
|
|
9770
9846
|
const [canvasContent, setCanvasContent] = useState18(initialCanvasContent);
|
|
9771
9847
|
const [compositions, setCompositions] = useState18(initialCompositions);
|
|
9772
9848
|
const currentcompositionsRef = useRef26(compositions);
|
|
9773
|
-
const updateCompositions =
|
|
9849
|
+
const updateCompositions = useCallback21((updateComps) => {
|
|
9774
9850
|
setCompositions((comps) => {
|
|
9775
9851
|
const updated = updateComps(comps);
|
|
9776
9852
|
currentcompositionsRef.current = updated;
|
|
9777
9853
|
return updated;
|
|
9778
9854
|
});
|
|
9779
9855
|
}, []);
|
|
9780
|
-
const registerComposition =
|
|
9856
|
+
const registerComposition = useCallback21((comp) => {
|
|
9781
9857
|
updateCompositions((comps) => {
|
|
9782
9858
|
if (comps.find((c2) => c2.id === comp.id)) {
|
|
9783
9859
|
throw new Error(`Multiple composition with id ${comp.id} are registered.`);
|
|
@@ -9785,12 +9861,12 @@ var CompositionManagerProvider = ({
|
|
|
9785
9861
|
return [...comps, comp];
|
|
9786
9862
|
});
|
|
9787
9863
|
}, [updateCompositions]);
|
|
9788
|
-
const unregisterComposition =
|
|
9864
|
+
const unregisterComposition = useCallback21((id) => {
|
|
9789
9865
|
setCompositions((comps) => {
|
|
9790
9866
|
return comps.filter((c2) => c2.id !== id);
|
|
9791
9867
|
});
|
|
9792
9868
|
}, []);
|
|
9793
|
-
const registerFolder =
|
|
9869
|
+
const registerFolder = useCallback21((name, parent, nonce, stack) => {
|
|
9794
9870
|
setFolders((prevFolders) => {
|
|
9795
9871
|
return [
|
|
9796
9872
|
...prevFolders,
|
|
@@ -9803,7 +9879,7 @@ var CompositionManagerProvider = ({
|
|
|
9803
9879
|
];
|
|
9804
9880
|
});
|
|
9805
9881
|
}, []);
|
|
9806
|
-
const unregisterFolder =
|
|
9882
|
+
const unregisterFolder = useCallback21((name, parent) => {
|
|
9807
9883
|
setFolders((prevFolders) => {
|
|
9808
9884
|
return prevFolders.filter((p) => !(p.name === name && p.parent === parent));
|
|
9809
9885
|
});
|
|
@@ -10366,11 +10442,11 @@ var usePixelDensity = (options) => {
|
|
|
10366
10442
|
};
|
|
10367
10443
|
|
|
10368
10444
|
// src/video/OffthreadVideo.tsx
|
|
10369
|
-
import { useCallback as
|
|
10445
|
+
import { useCallback as useCallback24 } from "react";
|
|
10370
10446
|
|
|
10371
10447
|
// src/video/OffthreadVideoForRendering.tsx
|
|
10372
10448
|
import {
|
|
10373
|
-
useCallback as
|
|
10449
|
+
useCallback as useCallback22,
|
|
10374
10450
|
useContext as useContext36,
|
|
10375
10451
|
useEffect as useEffect18,
|
|
10376
10452
|
useLayoutEffect as useLayoutEffect11,
|
|
@@ -10563,7 +10639,7 @@ var OffthreadVideoForRendering = ({
|
|
|
10563
10639
|
continueRender2,
|
|
10564
10640
|
delayRender2
|
|
10565
10641
|
]);
|
|
10566
|
-
const onErr =
|
|
10642
|
+
const onErr = useCallback22(() => {
|
|
10567
10643
|
if (onError) {
|
|
10568
10644
|
onError?.(new Error("Failed to load image with src " + imageSrc));
|
|
10569
10645
|
} else {
|
|
@@ -10573,7 +10649,7 @@ var OffthreadVideoForRendering = ({
|
|
|
10573
10649
|
const className = useMemo35(() => {
|
|
10574
10650
|
return [OBJECTFIT_CONTAIN_CLASS_NAME, props2.className].filter(truthy).join(" ");
|
|
10575
10651
|
}, [props2.className]);
|
|
10576
|
-
const onImageFrame =
|
|
10652
|
+
const onImageFrame = useCallback22((img) => {
|
|
10577
10653
|
if (onVideoFrame) {
|
|
10578
10654
|
onVideoFrame(img);
|
|
10579
10655
|
}
|
|
@@ -10596,7 +10672,7 @@ var OffthreadVideoForRendering = ({
|
|
|
10596
10672
|
// src/video/VideoForPreview.tsx
|
|
10597
10673
|
import React37, {
|
|
10598
10674
|
forwardRef as forwardRef13,
|
|
10599
|
-
useCallback as
|
|
10675
|
+
useCallback as useCallback23,
|
|
10600
10676
|
useContext as useContext37,
|
|
10601
10677
|
useEffect as useEffect20,
|
|
10602
10678
|
useImperativeHandle as useImperativeHandle9,
|
|
@@ -10725,7 +10801,7 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
|
|
|
10725
10801
|
mediaVolume
|
|
10726
10802
|
});
|
|
10727
10803
|
warnAboutTooHighVolume(userPreferredVolume);
|
|
10728
|
-
const getStack =
|
|
10804
|
+
const getStack = useCallback23(() => {
|
|
10729
10805
|
return _remotionInternalStack ?? null;
|
|
10730
10806
|
}, [_remotionInternalStack]);
|
|
10731
10807
|
useMediaInTimeline({
|
|
@@ -10904,7 +10980,7 @@ var InnerOffthreadVideo = (props2) => {
|
|
|
10904
10980
|
if (environment.isClientSideRendering) {
|
|
10905
10981
|
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
10982
|
}
|
|
10907
|
-
const onDuration =
|
|
10983
|
+
const onDuration = useCallback24(() => {
|
|
10908
10984
|
return;
|
|
10909
10985
|
}, []);
|
|
10910
10986
|
if (typeof props2.src !== "string") {
|
|
@@ -11325,6 +11401,7 @@ var Internals = {
|
|
|
11325
11401
|
getEffectPropStatusesCtx,
|
|
11326
11402
|
hiddenField,
|
|
11327
11403
|
durationInFramesField,
|
|
11404
|
+
freezeField,
|
|
11328
11405
|
fromField
|
|
11329
11406
|
};
|
|
11330
11407
|
// src/series/index.tsx
|
|
@@ -11422,6 +11499,7 @@ var SeriesInner = (props2) => {
|
|
|
11422
11499
|
};
|
|
11423
11500
|
var Series = Object.assign(wrapInSchema({
|
|
11424
11501
|
Component: SeriesInner,
|
|
11502
|
+
componentIdentity: "dev.remotion.remotion.Series",
|
|
11425
11503
|
schema: sequenceSchemaDefaultLayoutNone,
|
|
11426
11504
|
supportsEffects: false
|
|
11427
11505
|
}), {
|
|
@@ -11528,7 +11606,7 @@ var Still = (props2) => {
|
|
|
11528
11606
|
return React42.createElement(Composition, newProps);
|
|
11529
11607
|
};
|
|
11530
11608
|
// src/video/html5-video.tsx
|
|
11531
|
-
import { forwardRef as forwardRef16, useCallback as
|
|
11609
|
+
import { forwardRef as forwardRef16, useCallback as useCallback25, useContext as useContext39 } from "react";
|
|
11532
11610
|
|
|
11533
11611
|
// src/video/VideoForRendering.tsx
|
|
11534
11612
|
import {
|
|
@@ -11918,7 +11996,7 @@ var VideoForwardingFunction = (props2, ref) => {
|
|
|
11918
11996
|
throw new TypeError(`The \`<Html5Video>\` tag requires a string for \`src\`, but got ${JSON.stringify(props2.src)} instead.`);
|
|
11919
11997
|
}
|
|
11920
11998
|
const preloadedSrc = usePreload(props2.src);
|
|
11921
|
-
const onDuration =
|
|
11999
|
+
const onDuration = useCallback25((src, durationInSeconds) => {
|
|
11922
12000
|
setDurations({ type: "got-duration", durationInSeconds, src });
|
|
11923
12001
|
}, [setDurations]);
|
|
11924
12002
|
const durationFetched = durations[getAbsoluteSrc(preloadedSrc)] ?? durations[getAbsoluteSrc(props2.src)];
|