remotion 4.0.477 → 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 +3 -0
- package/dist/cjs/Sequence.js +28 -2
- 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/esm/index.mjs +21 -7
- package/dist/esm/version.mjs +1 -1
- package/package.json +2 -2
- package/dist/cjs/interpolate-translate.d.ts +0 -8
- package/dist/cjs/interpolate-translate.js +0 -70
|
@@ -34,6 +34,7 @@ type EnhancedTSequenceData = {
|
|
|
34
34
|
doesVolumeChange: boolean;
|
|
35
35
|
startMediaFrom: number;
|
|
36
36
|
playbackRate: number;
|
|
37
|
+
frozenMediaFrame: number | null;
|
|
37
38
|
} | {
|
|
38
39
|
type: 'video';
|
|
39
40
|
src: string;
|
|
@@ -41,6 +42,7 @@ type EnhancedTSequenceData = {
|
|
|
41
42
|
doesVolumeChange: boolean;
|
|
42
43
|
startMediaFrom: number;
|
|
43
44
|
playbackRate: number;
|
|
45
|
+
frozenMediaFrame: number | null;
|
|
44
46
|
} | {
|
|
45
47
|
type: 'image';
|
|
46
48
|
src: string;
|
|
@@ -76,6 +78,7 @@ export type TSequence = {
|
|
|
76
78
|
refForOutline: React.RefObject<Element | null> | null;
|
|
77
79
|
effects: readonly EffectDefinition<unknown>[];
|
|
78
80
|
isInsideSeries: boolean;
|
|
81
|
+
frozenFrame: number | null;
|
|
79
82
|
} & EnhancedTSequenceData;
|
|
80
83
|
export type AudioOrVideoAsset = {
|
|
81
84
|
type: 'audio' | 'video';
|
package/dist/cjs/Sequence.js
CHANGED
|
@@ -20,7 +20,7 @@ const v5_flag_js_1 = require("./v5-flag.js");
|
|
|
20
20
|
const wrap_in_schema_js_1 = require("./wrap-in-schema.js");
|
|
21
21
|
const EMPTY_EFFECTS = [];
|
|
22
22
|
const RegularSequenceRefForwardingFunction = ({ from = 0, freeze, durationInFrames = Infinity, children, name, height, width, showInTimeline = true, hidden = false, _experimentalControls: controls, _remotionInternalEffects, _remotionInternalLoopDisplay: loopDisplay, _remotionInternalStack: stack, _remotionInternalDocumentationLink: documentationLink, _remotionInternalPremountDisplay: premountDisplay, _remotionInternalPostmountDisplay: postmountDisplay, _remotionInternalIsMedia: isMedia, _remotionInternalRefForOutline: passedRefForOutline, ...other }, ref) => {
|
|
23
|
-
var _a, _b;
|
|
23
|
+
var _a, _b, _c;
|
|
24
24
|
const { layout = 'absolute-fill' } = other;
|
|
25
25
|
const [id] = (0, react_1.useState)(() => String(Math.random()));
|
|
26
26
|
const parentSequence = (0, react_1.useContext)(SequenceContext_js_1.SequenceContext);
|
|
@@ -148,6 +148,25 @@ const RegularSequenceRefForwardingFunction = ({ from = 0, freeze, durationInFram
|
|
|
148
148
|
// and if it changes, it would lead to-remounting of the sequence.
|
|
149
149
|
const stackRef = (0, react_1.useRef)(null);
|
|
150
150
|
stackRef.current = stack !== null && stack !== void 0 ? stack : inheritedStack;
|
|
151
|
+
const registeredFrozenFrame = typeof freeze === 'number' ? freeze : null;
|
|
152
|
+
const parentCumulatedNegativeFrom = (_c = parentSequence === null || parentSequence === void 0 ? void 0 : parentSequence.cumulatedNegativeFrom) !== null && _c !== void 0 ? _c : 0;
|
|
153
|
+
const startMediaFrom = isMedia && isMedia.type !== 'image'
|
|
154
|
+
? isMedia.data.startMediaFrom +
|
|
155
|
+
parentCumulatedNegativeFrom -
|
|
156
|
+
cumulatedNegativeFrom
|
|
157
|
+
: null;
|
|
158
|
+
const mediaFrameAtSequenceZero = isMedia && isMedia.type !== 'image'
|
|
159
|
+
? isMedia.data.startMediaFrom + parentCumulatedNegativeFrom
|
|
160
|
+
: null;
|
|
161
|
+
const frozenMediaFrame = isMedia && isMedia.type !== 'image' && mediaFrameAtSequenceZero !== null
|
|
162
|
+
? registeredFrozenFrame === null
|
|
163
|
+
? null
|
|
164
|
+
: mediaFrameAtSequenceZero +
|
|
165
|
+
(loopDisplay
|
|
166
|
+
? registeredFrozenFrame % loopDisplay.durationInFrames
|
|
167
|
+
: registeredFrozenFrame) *
|
|
168
|
+
isMedia.data.playbackRate
|
|
169
|
+
: null;
|
|
151
170
|
(0, react_1.useEffect)(() => {
|
|
152
171
|
var _a, _b, _c;
|
|
153
172
|
if (!env.isStudio) {
|
|
@@ -175,6 +194,7 @@ const RegularSequenceRefForwardingFunction = ({ from = 0, freeze, durationInFram
|
|
|
175
194
|
getStack: () => stackRef.current,
|
|
176
195
|
refForOutline: refForOutline !== null && refForOutline !== void 0 ? refForOutline : null,
|
|
177
196
|
isInsideSeries,
|
|
197
|
+
frozenFrame: registeredFrozenFrame,
|
|
178
198
|
});
|
|
179
199
|
}
|
|
180
200
|
else {
|
|
@@ -198,10 +218,12 @@ const RegularSequenceRefForwardingFunction = ({ from = 0, freeze, durationInFram
|
|
|
198
218
|
showInTimeline,
|
|
199
219
|
src: isMedia.data.src,
|
|
200
220
|
getStack: () => stackRef.current,
|
|
201
|
-
startMediaFrom: isMedia.data.startMediaFrom,
|
|
221
|
+
startMediaFrom: startMediaFrom !== null && startMediaFrom !== void 0 ? startMediaFrom : isMedia.data.startMediaFrom,
|
|
202
222
|
volume: isMedia.data.volumes,
|
|
203
223
|
refForOutline: refForOutline !== null && refForOutline !== void 0 ? refForOutline : null,
|
|
204
224
|
isInsideSeries,
|
|
225
|
+
frozenFrame: registeredFrozenFrame,
|
|
226
|
+
frozenMediaFrame,
|
|
205
227
|
});
|
|
206
228
|
}
|
|
207
229
|
return () => {
|
|
@@ -227,6 +249,7 @@ const RegularSequenceRefForwardingFunction = ({ from = 0, freeze, durationInFram
|
|
|
227
249
|
effects: _remotionInternalEffects !== null && _remotionInternalEffects !== void 0 ? _remotionInternalEffects : EMPTY_EFFECTS,
|
|
228
250
|
refForOutline: refForOutline !== null && refForOutline !== void 0 ? refForOutline : null,
|
|
229
251
|
isInsideSeries,
|
|
252
|
+
frozenFrame: registeredFrozenFrame,
|
|
230
253
|
});
|
|
231
254
|
return () => {
|
|
232
255
|
unregisterSequence(id);
|
|
@@ -254,6 +277,9 @@ const RegularSequenceRefForwardingFunction = ({ from = 0, freeze, durationInFram
|
|
|
254
277
|
resolvedDocumentationLink,
|
|
255
278
|
refForOutline,
|
|
256
279
|
isInsideSeries,
|
|
280
|
+
registeredFrozenFrame,
|
|
281
|
+
startMediaFrom,
|
|
282
|
+
frozenMediaFrame,
|
|
257
283
|
]);
|
|
258
284
|
// Ceil to support floats
|
|
259
285
|
// https://github.com/remotion-dev/remotion/issues/2958
|
package/dist/cjs/version.d.ts
CHANGED
package/dist/cjs/version.js
CHANGED
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 = () => {
|
|
@@ -4285,6 +4285,11 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
4285
4285
|
const inheritedStack = other?.stack ?? null;
|
|
4286
4286
|
const stackRef = useRef6(null);
|
|
4287
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;
|
|
4288
4293
|
useEffect3(() => {
|
|
4289
4294
|
if (!env.isStudio) {
|
|
4290
4295
|
return;
|
|
@@ -4310,7 +4315,8 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
4310
4315
|
src: isMedia.src,
|
|
4311
4316
|
getStack: () => stackRef.current,
|
|
4312
4317
|
refForOutline: refForOutline ?? null,
|
|
4313
|
-
isInsideSeries
|
|
4318
|
+
isInsideSeries,
|
|
4319
|
+
frozenFrame: registeredFrozenFrame
|
|
4314
4320
|
});
|
|
4315
4321
|
} else {
|
|
4316
4322
|
registerSequence({
|
|
@@ -4333,10 +4339,12 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
4333
4339
|
showInTimeline,
|
|
4334
4340
|
src: isMedia.data.src,
|
|
4335
4341
|
getStack: () => stackRef.current,
|
|
4336
|
-
startMediaFrom: isMedia.data.startMediaFrom,
|
|
4342
|
+
startMediaFrom: startMediaFrom ?? isMedia.data.startMediaFrom,
|
|
4337
4343
|
volume: isMedia.data.volumes,
|
|
4338
4344
|
refForOutline: refForOutline ?? null,
|
|
4339
|
-
isInsideSeries
|
|
4345
|
+
isInsideSeries,
|
|
4346
|
+
frozenFrame: registeredFrozenFrame,
|
|
4347
|
+
frozenMediaFrame
|
|
4340
4348
|
});
|
|
4341
4349
|
}
|
|
4342
4350
|
return () => {
|
|
@@ -4361,7 +4369,8 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
4361
4369
|
controls: controls ?? null,
|
|
4362
4370
|
effects: _remotionInternalEffects ?? EMPTY_EFFECTS,
|
|
4363
4371
|
refForOutline: refForOutline ?? null,
|
|
4364
|
-
isInsideSeries
|
|
4372
|
+
isInsideSeries,
|
|
4373
|
+
frozenFrame: registeredFrozenFrame
|
|
4365
4374
|
});
|
|
4366
4375
|
return () => {
|
|
4367
4376
|
unregisterSequence(id);
|
|
@@ -4388,7 +4397,10 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
4388
4397
|
isMedia,
|
|
4389
4398
|
resolvedDocumentationLink,
|
|
4390
4399
|
refForOutline,
|
|
4391
|
-
isInsideSeries
|
|
4400
|
+
isInsideSeries,
|
|
4401
|
+
registeredFrozenFrame,
|
|
4402
|
+
startMediaFrom,
|
|
4403
|
+
frozenMediaFrame
|
|
4392
4404
|
]);
|
|
4393
4405
|
const endThreshold = Math.ceil(cumulatedFrom + from + durationInFrames - 1);
|
|
4394
4406
|
const content = absoluteFrame < cumulatedFrom + from ? null : absoluteFrame > endThreshold ? null : children;
|
|
@@ -7032,7 +7044,9 @@ var useMediaInTimeline = ({
|
|
|
7032
7044
|
controls: null,
|
|
7033
7045
|
effects: [],
|
|
7034
7046
|
refForOutline,
|
|
7035
|
-
isInsideSeries: false
|
|
7047
|
+
isInsideSeries: false,
|
|
7048
|
+
frozenFrame: null,
|
|
7049
|
+
frozenMediaFrame: null
|
|
7036
7050
|
});
|
|
7037
7051
|
return () => {
|
|
7038
7052
|
unregisterSequence(id);
|
package/dist/esm/version.mjs
CHANGED
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"url": "https://github.com/remotion-dev/remotion/tree/main/packages/core"
|
|
4
4
|
},
|
|
5
5
|
"name": "remotion",
|
|
6
|
-
"version": "4.0.
|
|
6
|
+
"version": "4.0.478",
|
|
7
7
|
"description": "Make videos programmatically",
|
|
8
8
|
"main": "dist/cjs/index.js",
|
|
9
9
|
"types": "dist/cjs/index.d.ts",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"react-dom": "19.2.3",
|
|
36
36
|
"webpack": "5.105.0",
|
|
37
37
|
"zod": "4.3.6",
|
|
38
|
-
"@remotion/eslint-config-internal": "4.0.
|
|
38
|
+
"@remotion/eslint-config-internal": "4.0.478",
|
|
39
39
|
"eslint": "9.19.0",
|
|
40
40
|
"@typescript/native-preview": "7.0.0-dev.20260217.1"
|
|
41
41
|
},
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { type InterpolateOptions } from './interpolate.js';
|
|
2
|
-
export type InterpolateTranslateOptions = InterpolateOptions;
|
|
3
|
-
export declare const interpolateTranslate: (input: number, inputRange: readonly number[], outputRange: readonly string[], options?: Partial<{
|
|
4
|
-
easing: import("./interpolate.js").EasingFunction | readonly import("./interpolate.js").EasingFunction[];
|
|
5
|
-
extrapolateLeft: import("./interpolate.js").ExtrapolateType;
|
|
6
|
-
extrapolateRight: import("./interpolate.js").ExtrapolateType;
|
|
7
|
-
posterize: number;
|
|
8
|
-
}> | undefined) => string;
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.interpolateTranslate = void 0;
|
|
4
|
-
const interpolate_js_1 = require("./interpolate.js");
|
|
5
|
-
const pixelValueRegex = /^([+-]?(?:\d+\.?\d*|\.\d+))px$/;
|
|
6
|
-
const parseTranslate = (value) => {
|
|
7
|
-
if (typeof value !== 'string') {
|
|
8
|
-
throw new TypeError(`outputRange must contain only strings, but got ${typeof value}`);
|
|
9
|
-
}
|
|
10
|
-
const parts = value.trim().split(/\s+/);
|
|
11
|
-
if (parts.length < 1 || parts.length > 3 || parts[0] === '') {
|
|
12
|
-
throw new TypeError(`translate values must contain 1 to 3 pixel values, but got "${value}"`);
|
|
13
|
-
}
|
|
14
|
-
return parts.map((part) => {
|
|
15
|
-
const match = pixelValueRegex.exec(part);
|
|
16
|
-
if (match === null) {
|
|
17
|
-
throw new TypeError(`interpolateTranslate() only supports px values, but got "${part}" in "${value}"`);
|
|
18
|
-
}
|
|
19
|
-
return Number(match[1]);
|
|
20
|
-
});
|
|
21
|
-
};
|
|
22
|
-
/*
|
|
23
|
-
* @description Allows you to map a range of values to CSS translate values using pixel units.
|
|
24
|
-
* @see [Documentation](https://remotion.dev/docs/interpolate-translate)
|
|
25
|
-
*/
|
|
26
|
-
const interpolateTranslate = (input, inputRange, outputRange, options) => {
|
|
27
|
-
var _a;
|
|
28
|
-
if (typeof input === 'undefined') {
|
|
29
|
-
throw new TypeError('input can not be undefined');
|
|
30
|
-
}
|
|
31
|
-
if (typeof inputRange === 'undefined') {
|
|
32
|
-
throw new TypeError('inputRange can not be undefined');
|
|
33
|
-
}
|
|
34
|
-
if (typeof outputRange === 'undefined') {
|
|
35
|
-
throw new TypeError('outputRange can not be undefined');
|
|
36
|
-
}
|
|
37
|
-
if (inputRange.length !== outputRange.length) {
|
|
38
|
-
throw new TypeError('inputRange (' +
|
|
39
|
-
inputRange.length +
|
|
40
|
-
' values provided) and outputRange (' +
|
|
41
|
-
outputRange.length +
|
|
42
|
-
' values provided) must have the same length');
|
|
43
|
-
}
|
|
44
|
-
const parsedOutputRange = outputRange.map((translateValue) => parseTranslate(translateValue));
|
|
45
|
-
const firstValueLength = (_a = parsedOutputRange[0]) === null || _a === void 0 ? void 0 : _a.length;
|
|
46
|
-
if (firstValueLength === undefined) {
|
|
47
|
-
throw new TypeError('outputRange must have at least 1 element');
|
|
48
|
-
}
|
|
49
|
-
for (const parsedTranslate of parsedOutputRange) {
|
|
50
|
-
if (parsedTranslate.length !== firstValueLength) {
|
|
51
|
-
throw new TypeError(`All translate values must have the same number of pixel values, but got ${firstValueLength} and ${parsedTranslate.length}`);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
return new Array(firstValueLength)
|
|
55
|
-
.fill(true)
|
|
56
|
-
.map((_, index) => {
|
|
57
|
-
const outputValues = [];
|
|
58
|
-
for (const translateValue of parsedOutputRange) {
|
|
59
|
-
const value = translateValue[index];
|
|
60
|
-
if (value === undefined) {
|
|
61
|
-
throw new TypeError(`All translate values must have the same number of pixel values, but got ${firstValueLength} and ${translateValue.length}`);
|
|
62
|
-
}
|
|
63
|
-
outputValues.push(value);
|
|
64
|
-
}
|
|
65
|
-
const interpolatedValue = (0, interpolate_js_1.interpolate)(input, inputRange, outputValues, options);
|
|
66
|
-
return `${interpolatedValue}px`;
|
|
67
|
-
})
|
|
68
|
-
.join(' ');
|
|
69
|
-
};
|
|
70
|
-
exports.interpolateTranslate = interpolateTranslate;
|