remotion 4.0.479 → 4.0.482
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.d.ts +74 -0
- package/dist/cjs/HtmlInCanvas.js +13 -10
- package/dist/cjs/Img.d.ts +7 -0
- package/dist/cjs/Img.js +6 -5
- package/dist/cjs/Interactive.d.ts +88 -2
- package/dist/cjs/Interactive.js +5 -2
- package/dist/cjs/Sequence.d.ts +1 -0
- package/dist/cjs/Sequence.js +27 -6
- package/dist/cjs/animated-image/AnimatedImage.js +1 -0
- package/dist/cjs/audio/AudioForPreview.js +3 -3
- package/dist/cjs/canvas-image/CanvasImage.d.ts +7 -0
- package/dist/cjs/canvas-image/CanvasImage.js +3 -2
- package/dist/cjs/effects/Solid.d.ts +95 -0
- package/dist/cjs/effects/Solid.js +15 -5
- package/dist/cjs/interactivity-schema.d.ts +106 -0
- package/dist/cjs/interactivity-schema.js +81 -1
- package/dist/cjs/internals.d.ts +86 -1
- package/dist/cjs/internals.js +2 -1
- package/dist/cjs/no-react.d.ts +7 -0
- package/dist/cjs/prefetch.js +15 -10
- package/dist/cjs/series/index.js +1 -0
- package/dist/cjs/use-media-in-timeline.js +1 -0
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/video/VideoForPreview.js +2 -2
- package/dist/cjs/volume-position-state.d.ts +4 -4
- package/dist/cjs/volume-position-state.js +9 -9
- package/dist/cjs/with-interactivity-schema.d.ts +2 -1
- package/dist/cjs/with-interactivity-schema.js +2 -1
- package/dist/esm/index.mjs +184 -35
- package/dist/esm/no-react.mjs +9 -0
- package/dist/esm/version.mjs +1 -1
- package/package.json +2 -2
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
export type MediaVolumeContextValue = {
|
|
2
|
-
|
|
2
|
+
playerMuted: boolean;
|
|
3
3
|
mediaVolume: number;
|
|
4
4
|
};
|
|
5
5
|
export type SetMediaVolumeContextValue = {
|
|
6
|
-
|
|
6
|
+
setPlayerMuted: (u: React.SetStateAction<boolean>) => void;
|
|
7
7
|
setMediaVolume: (u: number) => void;
|
|
8
8
|
};
|
|
9
9
|
export declare const MediaVolumeContext: import("react").Context<MediaVolumeContextValue>;
|
|
10
10
|
export declare const SetMediaVolumeContext: import("react").Context<SetMediaVolumeContextValue>;
|
|
11
11
|
type MediaVolumeReturnType = readonly [number, (u: number) => void];
|
|
12
12
|
export declare const useMediaVolumeState: () => MediaVolumeReturnType;
|
|
13
|
-
type
|
|
13
|
+
type PlayerMutedReturnType = readonly [
|
|
14
14
|
boolean,
|
|
15
15
|
(u: React.SetStateAction<boolean>) => void
|
|
16
16
|
];
|
|
17
|
-
export declare const
|
|
17
|
+
export declare const usePlayerMutedState: () => PlayerMutedReturnType;
|
|
18
18
|
export {};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.usePlayerMutedState = exports.useMediaVolumeState = exports.SetMediaVolumeContext = exports.MediaVolumeContext = void 0;
|
|
4
4
|
const react_1 = require("react");
|
|
5
5
|
exports.MediaVolumeContext = (0, react_1.createContext)({
|
|
6
|
-
|
|
6
|
+
playerMuted: false,
|
|
7
7
|
mediaVolume: 1,
|
|
8
8
|
});
|
|
9
9
|
exports.SetMediaVolumeContext = (0, react_1.createContext)({
|
|
10
|
-
|
|
10
|
+
setPlayerMuted: () => {
|
|
11
11
|
throw new Error('default');
|
|
12
12
|
},
|
|
13
13
|
setMediaVolume: () => {
|
|
@@ -22,11 +22,11 @@ const useMediaVolumeState = () => {
|
|
|
22
22
|
}, [mediaVolume, setMediaVolume]);
|
|
23
23
|
};
|
|
24
24
|
exports.useMediaVolumeState = useMediaVolumeState;
|
|
25
|
-
const
|
|
26
|
-
const {
|
|
27
|
-
const {
|
|
25
|
+
const usePlayerMutedState = () => {
|
|
26
|
+
const { playerMuted } = (0, react_1.useContext)(exports.MediaVolumeContext);
|
|
27
|
+
const { setPlayerMuted } = (0, react_1.useContext)(exports.SetMediaVolumeContext);
|
|
28
28
|
return (0, react_1.useMemo)(() => {
|
|
29
|
-
return [
|
|
30
|
-
}, [
|
|
29
|
+
return [playerMuted, setPlayerMuted];
|
|
30
|
+
}, [playerMuted, setPlayerMuted]);
|
|
31
31
|
};
|
|
32
|
-
exports.
|
|
32
|
+
exports.usePlayerMutedState = usePlayerMutedState;
|
|
@@ -10,10 +10,11 @@ export declare const mergeValues: ({ props, valuesDotNotation, schemaKeys, props
|
|
|
10
10
|
schemaKeys: string[];
|
|
11
11
|
propsToDelete: Set<string>;
|
|
12
12
|
}) => Record<string, unknown>;
|
|
13
|
-
export declare const withInteractivitySchema: <S extends InteractivitySchema, Props extends object>({ Component, componentIdentity, schema, supportsEffects, }: {
|
|
13
|
+
export declare const withInteractivitySchema: <S extends InteractivitySchema, Props extends object>({ Component, componentName, componentIdentity, schema, supportsEffects, }: {
|
|
14
14
|
Component: React.ComponentType<Props & {
|
|
15
15
|
readonly controls: SequenceControls | undefined;
|
|
16
16
|
}>;
|
|
17
|
+
componentName: string;
|
|
17
18
|
componentIdentity: string | null;
|
|
18
19
|
schema: S;
|
|
19
20
|
supportsEffects: boolean;
|
|
@@ -98,7 +98,7 @@ const mergeValues = ({ props, valuesDotNotation, schemaKeys, propsToDelete, }) =
|
|
|
98
98
|
};
|
|
99
99
|
exports.mergeValues = mergeValues;
|
|
100
100
|
const stackToOverrideMap = {};
|
|
101
|
-
const withInteractivitySchema = ({ Component, componentIdentity, schema, supportsEffects, }) => {
|
|
101
|
+
const withInteractivitySchema = ({ Component, componentName, componentIdentity, schema, supportsEffects, }) => {
|
|
102
102
|
// Schema is static for a component, so we move this outside
|
|
103
103
|
const schemaWithSequenceName = (0, interactivity_schema_js_1.extendSchemaWithSequenceName)(schema);
|
|
104
104
|
const flatSchema = (0, flatten_schema_js_1.getFlatSchemaWithAllKeys)(schemaWithSequenceName);
|
|
@@ -161,6 +161,7 @@ const withInteractivitySchema = ({ Component, componentIdentity, schema, support
|
|
|
161
161
|
overrideId,
|
|
162
162
|
supportsEffects,
|
|
163
163
|
componentIdentity,
|
|
164
|
+
componentName,
|
|
164
165
|
};
|
|
165
166
|
}, [currentRuntimeValueDotNotation, overrideId]);
|
|
166
167
|
// 3. Apply drag/code overrides on top of the runtime values.
|
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.482";
|
|
1295
1295
|
|
|
1296
1296
|
// src/multiple-versions-warning.ts
|
|
1297
1297
|
var checkMultipleRemotionVersions = () => {
|
|
@@ -1750,6 +1750,77 @@ var transformSchema = {
|
|
|
1750
1750
|
}
|
|
1751
1751
|
};
|
|
1752
1752
|
var sequenceVisualStyleSchema = transformSchema;
|
|
1753
|
+
var textSchema = {
|
|
1754
|
+
"style.color": {
|
|
1755
|
+
type: "color",
|
|
1756
|
+
default: undefined,
|
|
1757
|
+
description: "Color"
|
|
1758
|
+
},
|
|
1759
|
+
"style.fontSize": {
|
|
1760
|
+
type: "number",
|
|
1761
|
+
default: undefined,
|
|
1762
|
+
min: 0,
|
|
1763
|
+
step: 1,
|
|
1764
|
+
description: "Font size",
|
|
1765
|
+
hiddenFromList: false
|
|
1766
|
+
},
|
|
1767
|
+
"style.lineHeight": {
|
|
1768
|
+
type: "number",
|
|
1769
|
+
default: undefined,
|
|
1770
|
+
min: 0,
|
|
1771
|
+
step: 0.05,
|
|
1772
|
+
description: "Line height",
|
|
1773
|
+
hiddenFromList: false
|
|
1774
|
+
},
|
|
1775
|
+
"style.fontWeight": {
|
|
1776
|
+
type: "enum",
|
|
1777
|
+
default: "400",
|
|
1778
|
+
description: "Font weight",
|
|
1779
|
+
variants: {
|
|
1780
|
+
"100": {},
|
|
1781
|
+
"200": {},
|
|
1782
|
+
"300": {},
|
|
1783
|
+
"400": {},
|
|
1784
|
+
"500": {},
|
|
1785
|
+
"600": {},
|
|
1786
|
+
"700": {},
|
|
1787
|
+
"800": {},
|
|
1788
|
+
"900": {},
|
|
1789
|
+
normal: {},
|
|
1790
|
+
bold: {}
|
|
1791
|
+
}
|
|
1792
|
+
},
|
|
1793
|
+
"style.fontStyle": {
|
|
1794
|
+
type: "enum",
|
|
1795
|
+
default: "normal",
|
|
1796
|
+
description: "Font style",
|
|
1797
|
+
variants: {
|
|
1798
|
+
normal: {},
|
|
1799
|
+
italic: {},
|
|
1800
|
+
oblique: {}
|
|
1801
|
+
}
|
|
1802
|
+
},
|
|
1803
|
+
"style.textAlign": {
|
|
1804
|
+
type: "enum",
|
|
1805
|
+
default: "left",
|
|
1806
|
+
description: "Text align",
|
|
1807
|
+
variants: {
|
|
1808
|
+
left: {},
|
|
1809
|
+
center: {},
|
|
1810
|
+
right: {},
|
|
1811
|
+
justify: {},
|
|
1812
|
+
start: {},
|
|
1813
|
+
end: {}
|
|
1814
|
+
}
|
|
1815
|
+
},
|
|
1816
|
+
"style.letterSpacing": {
|
|
1817
|
+
type: "number",
|
|
1818
|
+
default: undefined,
|
|
1819
|
+
step: 0.1,
|
|
1820
|
+
description: "Letter spacing",
|
|
1821
|
+
hiddenFromList: false
|
|
1822
|
+
}
|
|
1823
|
+
};
|
|
1753
1824
|
var premountSchema = {
|
|
1754
1825
|
premountFor: {
|
|
1755
1826
|
type: "number",
|
|
@@ -1808,6 +1879,13 @@ var fromField = {
|
|
|
1808
1879
|
step: 1,
|
|
1809
1880
|
hiddenFromList: true
|
|
1810
1881
|
};
|
|
1882
|
+
var trimBeforeField = {
|
|
1883
|
+
type: "number",
|
|
1884
|
+
default: 0,
|
|
1885
|
+
min: 0,
|
|
1886
|
+
step: 1,
|
|
1887
|
+
hiddenFromList: true
|
|
1888
|
+
};
|
|
1811
1889
|
var freezeField = {
|
|
1812
1890
|
type: "number",
|
|
1813
1891
|
default: null,
|
|
@@ -1817,6 +1895,7 @@ var freezeField = {
|
|
|
1817
1895
|
var baseSchema = {
|
|
1818
1896
|
durationInFrames: durationInFramesField,
|
|
1819
1897
|
from: fromField,
|
|
1898
|
+
trimBefore: trimBeforeField,
|
|
1820
1899
|
freeze: freezeField,
|
|
1821
1900
|
hidden: hiddenField,
|
|
1822
1901
|
name: sequenceNameField,
|
|
@@ -1836,6 +1915,7 @@ var sequenceSchema = {
|
|
|
1836
1915
|
};
|
|
1837
1916
|
var baseSchemaWithoutFrom = {
|
|
1838
1917
|
durationInFrames: durationInFramesField,
|
|
1918
|
+
trimBefore: trimBeforeField,
|
|
1839
1919
|
freeze: freezeField,
|
|
1840
1920
|
hidden: hiddenField,
|
|
1841
1921
|
name: sequenceNameField,
|
|
@@ -4108,6 +4188,7 @@ var mergeValues = ({
|
|
|
4108
4188
|
var stackToOverrideMap = {};
|
|
4109
4189
|
var withInteractivitySchema = ({
|
|
4110
4190
|
Component,
|
|
4191
|
+
componentName,
|
|
4111
4192
|
componentIdentity,
|
|
4112
4193
|
schema,
|
|
4113
4194
|
supportsEffects
|
|
@@ -4156,7 +4237,8 @@ var withInteractivitySchema = ({
|
|
|
4156
4237
|
currentRuntimeValueDotNotation,
|
|
4157
4238
|
overrideId,
|
|
4158
4239
|
supportsEffects,
|
|
4159
|
-
componentIdentity
|
|
4240
|
+
componentIdentity,
|
|
4241
|
+
componentName
|
|
4160
4242
|
};
|
|
4161
4243
|
}, [currentRuntimeValueDotNotation, overrideId]);
|
|
4162
4244
|
const { merged: valuesDotNotation, propsToDelete } = useMemo13(() => {
|
|
@@ -4196,6 +4278,7 @@ import { jsx as jsx12 } from "react/jsx-runtime";
|
|
|
4196
4278
|
var EMPTY_EFFECTS = [];
|
|
4197
4279
|
var RegularSequenceRefForwardingFunction = ({
|
|
4198
4280
|
from = 0,
|
|
4281
|
+
trimBefore = 0,
|
|
4199
4282
|
freeze,
|
|
4200
4283
|
durationInFrames = Infinity,
|
|
4201
4284
|
children,
|
|
@@ -4220,7 +4303,6 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
4220
4303
|
const parentSequence = useContext17(SequenceContext);
|
|
4221
4304
|
const { rootId } = useTimelineContext();
|
|
4222
4305
|
const cumulatedFrom = parentSequence ? parentSequence.cumulatedFrom + parentSequence.relativeFrom : 0;
|
|
4223
|
-
const absoluteFrom = (parentSequence?.absoluteFrom ?? 0) + from;
|
|
4224
4306
|
const nonce = useNonce();
|
|
4225
4307
|
if (layout !== "absolute-fill" && layout !== "none") {
|
|
4226
4308
|
throw new TypeError(`The layout prop of <Sequence /> expects either "absolute-fill" or "none", but you passed: ${layout}`);
|
|
@@ -4240,6 +4322,18 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
4240
4322
|
if (!Number.isFinite(from)) {
|
|
4241
4323
|
throw new TypeError(`The "from" prop of a sequence must be finite, but got ${from}.`);
|
|
4242
4324
|
}
|
|
4325
|
+
if (typeof trimBefore !== "number") {
|
|
4326
|
+
throw new TypeError(`You passed to the "trimBefore" prop of your <Sequence> an argument of type ${typeof trimBefore}, but it must be a number.`);
|
|
4327
|
+
}
|
|
4328
|
+
if (trimBefore < 0) {
|
|
4329
|
+
throw new TypeError(`The "trimBefore" prop of <Sequence /> must be greater than or equal to 0, but got ${trimBefore}.`);
|
|
4330
|
+
}
|
|
4331
|
+
if (Number.isNaN(trimBefore)) {
|
|
4332
|
+
throw new TypeError('The "trimBefore" prop of <Sequence /> must be a real number, but it is NaN.');
|
|
4333
|
+
}
|
|
4334
|
+
if (!Number.isFinite(trimBefore)) {
|
|
4335
|
+
throw new TypeError(`The "trimBefore" prop of <Sequence /> must be finite, but it is ${trimBefore}.`);
|
|
4336
|
+
}
|
|
4243
4337
|
if (typeof freeze !== "undefined" && freeze !== null) {
|
|
4244
4338
|
if (typeof freeze !== "number") {
|
|
4245
4339
|
throw new TypeError(`The "freeze" prop of <Sequence /> must be a number, but is of type ${typeof freeze}.`);
|
|
@@ -4253,7 +4347,9 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
4253
4347
|
}
|
|
4254
4348
|
const absoluteFrame = useTimelinePosition();
|
|
4255
4349
|
const videoConfig = useVideoConfig();
|
|
4256
|
-
const
|
|
4350
|
+
const effectiveRelativeFrom = from - trimBefore;
|
|
4351
|
+
const absoluteFrom = (parentSequence?.absoluteFrom ?? 0) + effectiveRelativeFrom;
|
|
4352
|
+
const parentSequenceDuration = parentSequence ? Math.min(parentSequence.durationInFrames - effectiveRelativeFrom, durationInFrames) : durationInFrames;
|
|
4257
4353
|
const actualDurationInFrames = Math.max(0, Math.min(videoConfig.durationInFrames - from, parentSequenceDuration));
|
|
4258
4354
|
const { registerSequence, unregisterSequence } = useContext17(SequenceManager);
|
|
4259
4355
|
const wrapperRefForOutline = useRef6(null);
|
|
@@ -4264,7 +4360,7 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
4264
4360
|
const postmounting = useMemo14(() => {
|
|
4265
4361
|
return parentSequence?.postmounting || Boolean(other._remotionInternalIsPostmounting);
|
|
4266
4362
|
}, [other._remotionInternalIsPostmounting, parentSequence?.postmounting]);
|
|
4267
|
-
const currentSequenceStart = cumulatedFrom +
|
|
4363
|
+
const currentSequenceStart = cumulatedFrom + effectiveRelativeFrom;
|
|
4268
4364
|
const parentSequenceStart = parentSequence ? parentSequence.cumulatedFrom + parentSequence.relativeFrom : 0;
|
|
4269
4365
|
const parentFirstFrame = parentSequence ? parentSequenceStart - parentSequence.cumulatedNegativeFrom : 0;
|
|
4270
4366
|
const firstFrame = Math.max(0, parentFirstFrame, currentSequenceStart);
|
|
@@ -4273,7 +4369,7 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
4273
4369
|
return {
|
|
4274
4370
|
absoluteFrom,
|
|
4275
4371
|
cumulatedFrom,
|
|
4276
|
-
relativeFrom:
|
|
4372
|
+
relativeFrom: effectiveRelativeFrom,
|
|
4277
4373
|
cumulatedNegativeFrom,
|
|
4278
4374
|
durationInFrames: actualDurationInFrames,
|
|
4279
4375
|
parentFrom: parentSequence?.relativeFrom ?? 0,
|
|
@@ -4288,7 +4384,7 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
4288
4384
|
}, [
|
|
4289
4385
|
cumulatedFrom,
|
|
4290
4386
|
absoluteFrom,
|
|
4291
|
-
|
|
4387
|
+
effectiveRelativeFrom,
|
|
4292
4388
|
actualDurationInFrames,
|
|
4293
4389
|
parentSequence,
|
|
4294
4390
|
id,
|
|
@@ -4310,6 +4406,7 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
4310
4406
|
const stackRef = useRef6(null);
|
|
4311
4407
|
stackRef.current = stack ?? inheritedStack;
|
|
4312
4408
|
const registeredFrozenFrame = typeof freeze === "number" ? freeze : null;
|
|
4409
|
+
const registeredTrimBefore = trimBefore === 0 ? null : trimBefore;
|
|
4313
4410
|
const parentCumulatedNegativeFrom = parentSequence?.cumulatedNegativeFrom ?? 0;
|
|
4314
4411
|
const startMediaFrom = isMedia && isMedia.type !== "image" ? isMedia.data.startMediaFrom + parentCumulatedNegativeFrom - cumulatedNegativeFrom : null;
|
|
4315
4412
|
const mediaFrameAtSequenceZero = isMedia && isMedia.type !== "image" ? isMedia.data.startMediaFrom + parentCumulatedNegativeFrom : null;
|
|
@@ -4328,6 +4425,7 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
4328
4425
|
documentationLink: resolvedDocumentationLink,
|
|
4329
4426
|
duration: actualDurationInFrames,
|
|
4330
4427
|
from,
|
|
4428
|
+
trimBefore: registeredTrimBefore,
|
|
4331
4429
|
id,
|
|
4332
4430
|
loopDisplay,
|
|
4333
4431
|
nonce: nonce.get(),
|
|
@@ -4352,6 +4450,7 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
4352
4450
|
doesVolumeChange: isMedia.data.doesVolumeChange,
|
|
4353
4451
|
duration: actualDurationInFrames,
|
|
4354
4452
|
from,
|
|
4453
|
+
trimBefore: registeredTrimBefore,
|
|
4355
4454
|
id,
|
|
4356
4455
|
loopDisplay,
|
|
4357
4456
|
nonce: nonce.get(),
|
|
@@ -4377,6 +4476,7 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
4377
4476
|
}
|
|
4378
4477
|
registerSequence({
|
|
4379
4478
|
from,
|
|
4479
|
+
trimBefore: registeredTrimBefore,
|
|
4380
4480
|
duration: actualDurationInFrames,
|
|
4381
4481
|
id,
|
|
4382
4482
|
displayName: timelineClipName,
|
|
@@ -4410,6 +4510,8 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
4410
4510
|
actualDurationInFrames,
|
|
4411
4511
|
rootId,
|
|
4412
4512
|
from,
|
|
4513
|
+
trimBefore,
|
|
4514
|
+
registeredTrimBefore,
|
|
4413
4515
|
showInTimeline,
|
|
4414
4516
|
nonce,
|
|
4415
4517
|
loopDisplay,
|
|
@@ -4541,12 +4643,14 @@ var SequenceInner = forwardRef3(SequenceRefForwardingFunction);
|
|
|
4541
4643
|
var SequenceWithoutSchema = SequenceInner;
|
|
4542
4644
|
var Sequence = withInteractivitySchema({
|
|
4543
4645
|
Component: SequenceInner,
|
|
4646
|
+
componentName: "<Sequence>",
|
|
4544
4647
|
componentIdentity: "dev.remotion.remotion.Sequence",
|
|
4545
4648
|
schema: sequenceSchema,
|
|
4546
4649
|
supportsEffects: false
|
|
4547
4650
|
});
|
|
4548
4651
|
var SequenceWithoutFrom = withInteractivitySchema({
|
|
4549
4652
|
Component: SequenceInner,
|
|
4653
|
+
componentName: "<Sequence>",
|
|
4550
4654
|
componentIdentity: null,
|
|
4551
4655
|
schema: sequenceSchemaWithoutFrom,
|
|
4552
4656
|
supportsEffects: false
|
|
@@ -5321,6 +5425,7 @@ var AnimatedImageInner = ({
|
|
|
5321
5425
|
};
|
|
5322
5426
|
var AnimatedImage = withInteractivitySchema({
|
|
5323
5427
|
Component: AnimatedImageInner,
|
|
5428
|
+
componentName: "<AnimatedImage>",
|
|
5324
5429
|
componentIdentity: "dev.remotion.remotion.AnimatedImage",
|
|
5325
5430
|
schema: animatedImageSchema,
|
|
5326
5431
|
supportsEffects: true
|
|
@@ -5754,13 +5859,15 @@ var prefetch = (src, options) => {
|
|
|
5754
5859
|
resolve = res;
|
|
5755
5860
|
reject = rej;
|
|
5756
5861
|
});
|
|
5862
|
+
waitUntilDone.catch(() => {
|
|
5863
|
+
return;
|
|
5864
|
+
});
|
|
5757
5865
|
const controller = new AbortController;
|
|
5758
|
-
let
|
|
5866
|
+
let reader = null;
|
|
5759
5867
|
fetch(srcWithoutHash, {
|
|
5760
5868
|
signal: controller.signal,
|
|
5761
5869
|
credentials: options?.credentials ?? undefined
|
|
5762
5870
|
}).then((res) => {
|
|
5763
|
-
canBeAborted = false;
|
|
5764
5871
|
if (canceled) {
|
|
5765
5872
|
return null;
|
|
5766
5873
|
}
|
|
@@ -5776,15 +5883,16 @@ var prefetch = (src, options) => {
|
|
|
5776
5883
|
if (!res.body) {
|
|
5777
5884
|
throw new Error(`HTTP response of ${srcWithoutHash} has no body`);
|
|
5778
5885
|
}
|
|
5779
|
-
const
|
|
5886
|
+
const responseReader = res.body.getReader();
|
|
5887
|
+
reader = responseReader;
|
|
5780
5888
|
return getBlobFromReader({
|
|
5781
|
-
reader,
|
|
5889
|
+
reader: responseReader,
|
|
5782
5890
|
contentType: options?.contentType ?? headerContentType ?? null,
|
|
5783
5891
|
contentLength: res.headers.get("Content-Length") ? parseInt(res.headers.get("Content-Length"), 10) : null,
|
|
5784
5892
|
onProgress: options?.onProgress
|
|
5785
5893
|
});
|
|
5786
5894
|
}).then((buf) => {
|
|
5787
|
-
if (!buf) {
|
|
5895
|
+
if (!buf || canceled) {
|
|
5788
5896
|
return;
|
|
5789
5897
|
}
|
|
5790
5898
|
const actualBlob = options?.contentType ? new Blob([buf], { type: options.contentType }) : buf;
|
|
@@ -5832,12 +5940,18 @@ var prefetch = (src, options) => {
|
|
|
5832
5940
|
return copy;
|
|
5833
5941
|
});
|
|
5834
5942
|
} else {
|
|
5835
|
-
canceled
|
|
5836
|
-
|
|
5837
|
-
try {
|
|
5838
|
-
controller.abort(new Error("free() called"));
|
|
5839
|
-
} catch {}
|
|
5943
|
+
if (canceled) {
|
|
5944
|
+
return;
|
|
5840
5945
|
}
|
|
5946
|
+
canceled = true;
|
|
5947
|
+
const cancellationError = new Error("free() called");
|
|
5948
|
+
reject(cancellationError);
|
|
5949
|
+
try {
|
|
5950
|
+
controller.abort(cancellationError);
|
|
5951
|
+
} catch {}
|
|
5952
|
+
reader?.cancel(cancellationError).catch(() => {
|
|
5953
|
+
return;
|
|
5954
|
+
});
|
|
5841
5955
|
}
|
|
5842
5956
|
},
|
|
5843
5957
|
waitUntilDone: () => {
|
|
@@ -7079,6 +7193,7 @@ var useMediaInTimeline = ({
|
|
|
7079
7193
|
id,
|
|
7080
7194
|
duration,
|
|
7081
7195
|
from: 0,
|
|
7196
|
+
trimBefore: null,
|
|
7082
7197
|
parent: parentSequence?.id ?? null,
|
|
7083
7198
|
displayName: finalDisplayName,
|
|
7084
7199
|
documentationLink,
|
|
@@ -7995,11 +8110,11 @@ var useMediaTag = ({
|
|
|
7995
8110
|
// src/volume-position-state.ts
|
|
7996
8111
|
import { createContext as createContext22, useContext as useContext27, useMemo as useMemo26 } from "react";
|
|
7997
8112
|
var MediaVolumeContext = createContext22({
|
|
7998
|
-
|
|
8113
|
+
playerMuted: false,
|
|
7999
8114
|
mediaVolume: 1
|
|
8000
8115
|
});
|
|
8001
8116
|
var SetMediaVolumeContext = createContext22({
|
|
8002
|
-
|
|
8117
|
+
setPlayerMuted: () => {
|
|
8003
8118
|
throw new Error("default");
|
|
8004
8119
|
},
|
|
8005
8120
|
setMediaVolume: () => {
|
|
@@ -8013,12 +8128,12 @@ var useMediaVolumeState = () => {
|
|
|
8013
8128
|
return [mediaVolume, setMediaVolume];
|
|
8014
8129
|
}, [mediaVolume, setMediaVolume]);
|
|
8015
8130
|
};
|
|
8016
|
-
var
|
|
8017
|
-
const {
|
|
8018
|
-
const {
|
|
8131
|
+
var usePlayerMutedState = () => {
|
|
8132
|
+
const { playerMuted } = useContext27(MediaVolumeContext);
|
|
8133
|
+
const { setPlayerMuted } = useContext27(SetMediaVolumeContext);
|
|
8019
8134
|
return useMemo26(() => {
|
|
8020
|
-
return [
|
|
8021
|
-
}, [
|
|
8135
|
+
return [playerMuted, setPlayerMuted];
|
|
8136
|
+
}, [playerMuted, setPlayerMuted]);
|
|
8022
8137
|
};
|
|
8023
8138
|
|
|
8024
8139
|
// src/volume-safeguard.ts
|
|
@@ -8069,7 +8184,7 @@ var AudioForDevelopmentForwardRefFunction = (props, ref) => {
|
|
|
8069
8184
|
throw new Error("typecheck error");
|
|
8070
8185
|
}
|
|
8071
8186
|
const [mediaVolume] = useMediaVolumeState();
|
|
8072
|
-
const [
|
|
8187
|
+
const [playerMuted] = usePlayerMutedState();
|
|
8073
8188
|
const volumePropFrame = useFrameForVolumeProp(loopVolumeCurveBehavior ?? "repeat");
|
|
8074
8189
|
if (!src) {
|
|
8075
8190
|
throw new TypeError("No 'src' was passed to <Html5Audio>.");
|
|
@@ -8090,7 +8205,7 @@ var AudioForDevelopmentForwardRefFunction = (props, ref) => {
|
|
|
8090
8205
|
});
|
|
8091
8206
|
const propsToPass = useMemo27(() => {
|
|
8092
8207
|
return {
|
|
8093
|
-
muted: muted ||
|
|
8208
|
+
muted: muted || playerMuted || userPreferredVolume <= 0,
|
|
8094
8209
|
src: preloadedSrc,
|
|
8095
8210
|
loop: _remotionInternalNativeLoopPassed,
|
|
8096
8211
|
crossOrigin: crossOriginValue,
|
|
@@ -8098,7 +8213,7 @@ var AudioForDevelopmentForwardRefFunction = (props, ref) => {
|
|
|
8098
8213
|
};
|
|
8099
8214
|
}, [
|
|
8100
8215
|
_remotionInternalNativeLoopPassed,
|
|
8101
|
-
|
|
8216
|
+
playerMuted,
|
|
8102
8217
|
muted,
|
|
8103
8218
|
nativeProps,
|
|
8104
8219
|
preloadedSrc,
|
|
@@ -8521,6 +8636,15 @@ var solidSchema = {
|
|
|
8521
8636
|
description: "Height",
|
|
8522
8637
|
hiddenFromList: false
|
|
8523
8638
|
},
|
|
8639
|
+
pixelDensity: {
|
|
8640
|
+
type: "number",
|
|
8641
|
+
min: 1,
|
|
8642
|
+
max: 3,
|
|
8643
|
+
step: 0.1,
|
|
8644
|
+
default: 1,
|
|
8645
|
+
description: "Pixel density",
|
|
8646
|
+
hiddenFromList: false
|
|
8647
|
+
},
|
|
8524
8648
|
...transformSchema
|
|
8525
8649
|
};
|
|
8526
8650
|
var SolidInner = ({
|
|
@@ -8637,6 +8761,7 @@ var SolidOuter = forwardRef8(({
|
|
|
8637
8761
|
style,
|
|
8638
8762
|
name,
|
|
8639
8763
|
from,
|
|
8764
|
+
trimBefore,
|
|
8640
8765
|
freeze,
|
|
8641
8766
|
hidden,
|
|
8642
8767
|
showInTimeline,
|
|
@@ -8651,6 +8776,7 @@ var SolidOuter = forwardRef8(({
|
|
|
8651
8776
|
return /* @__PURE__ */ jsx24(Sequence, {
|
|
8652
8777
|
layout: "none",
|
|
8653
8778
|
from,
|
|
8779
|
+
trimBefore,
|
|
8654
8780
|
freeze,
|
|
8655
8781
|
hidden,
|
|
8656
8782
|
showInTimeline,
|
|
@@ -8676,6 +8802,7 @@ var SolidOuter = forwardRef8(({
|
|
|
8676
8802
|
});
|
|
8677
8803
|
var Solid = withInteractivitySchema({
|
|
8678
8804
|
Component: SolidOuter,
|
|
8805
|
+
componentName: "<Solid>",
|
|
8679
8806
|
componentIdentity: "dev.remotion.remotion.Solid",
|
|
8680
8807
|
schema: solidSchema,
|
|
8681
8808
|
supportsEffects: true
|
|
@@ -8818,10 +8945,6 @@ var HtmlInCanvasContent = forwardRef9(({
|
|
|
8818
8945
|
if (!placeholderCanvas) {
|
|
8819
8946
|
throw new Error("Canvas not found");
|
|
8820
8947
|
}
|
|
8821
|
-
const offscreen2d = offscreen.getContext("2d");
|
|
8822
|
-
if (!offscreen2d) {
|
|
8823
|
-
throw new Error("Failed to acquire 2D context for <HtmlInCanvas> offscreen canvas");
|
|
8824
|
-
}
|
|
8825
8948
|
const handle = delayRender("onPaint");
|
|
8826
8949
|
if (!initializedRef.current) {
|
|
8827
8950
|
initializedRef.current = true;
|
|
@@ -9006,10 +9129,20 @@ var HtmlInCanvasInner = forwardRef9(({
|
|
|
9006
9129
|
HtmlInCanvasInner.displayName = "HtmlInCanvas";
|
|
9007
9130
|
var htmlInCanvasSchema = {
|
|
9008
9131
|
...baseSchema,
|
|
9132
|
+
pixelDensity: {
|
|
9133
|
+
type: "number",
|
|
9134
|
+
min: 1,
|
|
9135
|
+
max: 3,
|
|
9136
|
+
step: 0.1,
|
|
9137
|
+
default: 1,
|
|
9138
|
+
description: "Pixel density",
|
|
9139
|
+
hiddenFromList: false
|
|
9140
|
+
},
|
|
9009
9141
|
...transformSchema
|
|
9010
9142
|
};
|
|
9011
9143
|
var HtmlInCanvasWrapped = withInteractivitySchema({
|
|
9012
9144
|
Component: HtmlInCanvasInner,
|
|
9145
|
+
componentName: "<HtmlInCanvas>",
|
|
9013
9146
|
componentIdentity: "dev.remotion.remotion.HtmlInCanvas",
|
|
9014
9147
|
schema: htmlInCanvasSchema,
|
|
9015
9148
|
supportsEffects: true
|
|
@@ -9338,6 +9471,7 @@ var CanvasImageInner = forwardRef10(({
|
|
|
9338
9471
|
delayRenderTimeoutInMilliseconds,
|
|
9339
9472
|
durationInFrames,
|
|
9340
9473
|
from,
|
|
9474
|
+
trimBefore,
|
|
9341
9475
|
freeze,
|
|
9342
9476
|
hidden,
|
|
9343
9477
|
name,
|
|
@@ -9359,6 +9493,7 @@ var CanvasImageInner = forwardRef10(({
|
|
|
9359
9493
|
return /* @__PURE__ */ jsx26(Sequence, {
|
|
9360
9494
|
layout: "none",
|
|
9361
9495
|
from: from ?? 0,
|
|
9496
|
+
trimBefore,
|
|
9362
9497
|
durationInFrames: durationInFrames ?? Infinity,
|
|
9363
9498
|
freeze,
|
|
9364
9499
|
hidden,
|
|
@@ -9393,6 +9528,7 @@ var CanvasImageInner = forwardRef10(({
|
|
|
9393
9528
|
});
|
|
9394
9529
|
var CanvasImage = withInteractivitySchema({
|
|
9395
9530
|
Component: CanvasImageInner,
|
|
9531
|
+
componentName: "<CanvasImage>",
|
|
9396
9532
|
componentIdentity: "dev.remotion.remotion.CanvasImage",
|
|
9397
9533
|
schema: canvasImageSchema,
|
|
9398
9534
|
supportsEffects: true
|
|
@@ -9631,6 +9767,7 @@ var NativeImgInner = ({
|
|
|
9631
9767
|
showInTimeline,
|
|
9632
9768
|
src,
|
|
9633
9769
|
from,
|
|
9770
|
+
trimBefore,
|
|
9634
9771
|
durationInFrames,
|
|
9635
9772
|
freeze,
|
|
9636
9773
|
controls,
|
|
@@ -9643,6 +9780,7 @@ var NativeImgInner = ({
|
|
|
9643
9780
|
return /* @__PURE__ */ jsx28(Sequence, {
|
|
9644
9781
|
layout: "none",
|
|
9645
9782
|
from: from ?? 0,
|
|
9783
|
+
trimBefore,
|
|
9646
9784
|
durationInFrames: durationInFrames ?? Infinity,
|
|
9647
9785
|
freeze,
|
|
9648
9786
|
_remotionInternalStack: stack,
|
|
@@ -9716,6 +9854,7 @@ var ImgInner = ({
|
|
|
9716
9854
|
showInTimeline,
|
|
9717
9855
|
src,
|
|
9718
9856
|
from,
|
|
9857
|
+
trimBefore,
|
|
9719
9858
|
durationInFrames,
|
|
9720
9859
|
freeze,
|
|
9721
9860
|
controls,
|
|
@@ -9741,6 +9880,7 @@ var ImgInner = ({
|
|
|
9741
9880
|
showInTimeline,
|
|
9742
9881
|
src,
|
|
9743
9882
|
from,
|
|
9883
|
+
trimBefore,
|
|
9744
9884
|
durationInFrames,
|
|
9745
9885
|
freeze,
|
|
9746
9886
|
controls,
|
|
@@ -9783,6 +9923,7 @@ var ImgInner = ({
|
|
|
9783
9923
|
delayRenderRetries,
|
|
9784
9924
|
delayRenderTimeoutInMilliseconds,
|
|
9785
9925
|
from,
|
|
9926
|
+
trimBefore,
|
|
9786
9927
|
durationInFrames,
|
|
9787
9928
|
freeze,
|
|
9788
9929
|
hidden,
|
|
@@ -9797,6 +9938,7 @@ var ImgInner = ({
|
|
|
9797
9938
|
};
|
|
9798
9939
|
var Img = withInteractivitySchema({
|
|
9799
9940
|
Component: ImgInner,
|
|
9941
|
+
componentName: "<Img>",
|
|
9800
9942
|
componentIdentity: "dev.remotion.remotion.Img",
|
|
9801
9943
|
schema: imgSchema,
|
|
9802
9944
|
supportsEffects: true
|
|
@@ -9807,7 +9949,8 @@ import React29, { forwardRef as forwardRef12, useCallback as useCallback20, useR
|
|
|
9807
9949
|
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
9808
9950
|
var interactiveElementSchema = {
|
|
9809
9951
|
...baseSchema,
|
|
9810
|
-
...transformSchema
|
|
9952
|
+
...transformSchema,
|
|
9953
|
+
...textSchema
|
|
9811
9954
|
};
|
|
9812
9955
|
var setRef = (ref, value) => {
|
|
9813
9956
|
if (typeof ref === "function") {
|
|
@@ -9821,6 +9964,7 @@ var makeInteractiveElement = (tag, displayName) => {
|
|
|
9821
9964
|
const {
|
|
9822
9965
|
durationInFrames,
|
|
9823
9966
|
from,
|
|
9967
|
+
trimBefore,
|
|
9824
9968
|
freeze,
|
|
9825
9969
|
hidden,
|
|
9826
9970
|
name,
|
|
@@ -9837,6 +9981,7 @@ var makeInteractiveElement = (tag, displayName) => {
|
|
|
9837
9981
|
return /* @__PURE__ */ jsx29(Sequence, {
|
|
9838
9982
|
layout: "none",
|
|
9839
9983
|
from: from ?? 0,
|
|
9984
|
+
trimBefore,
|
|
9840
9985
|
durationInFrames: durationInFrames ?? Infinity,
|
|
9841
9986
|
freeze,
|
|
9842
9987
|
hidden,
|
|
@@ -9855,6 +10000,7 @@ var makeInteractiveElement = (tag, displayName) => {
|
|
|
9855
10000
|
Inner.displayName = displayName;
|
|
9856
10001
|
const Wrapped = withInteractivitySchema({
|
|
9857
10002
|
Component: Inner,
|
|
10003
|
+
componentName: displayName,
|
|
9858
10004
|
componentIdentity: `dev.remotion.remotion.${displayName.slice(1, -1)}`,
|
|
9859
10005
|
schema: interactiveElementSchema,
|
|
9860
10006
|
supportsEffects: false
|
|
@@ -9866,6 +10012,7 @@ var makeInteractiveElement = (tag, displayName) => {
|
|
|
9866
10012
|
var Interactive = {
|
|
9867
10013
|
baseSchema,
|
|
9868
10014
|
transformSchema,
|
|
10015
|
+
textSchema,
|
|
9869
10016
|
premountSchema,
|
|
9870
10017
|
sequenceSchema,
|
|
9871
10018
|
withSchema: withInteractivitySchema,
|
|
@@ -10848,7 +10995,7 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
|
|
|
10848
10995
|
throw new Error("acceptableTimeShift has been removed. Use acceptableTimeShiftInSeconds instead.");
|
|
10849
10996
|
}
|
|
10850
10997
|
const [mediaVolume] = useMediaVolumeState();
|
|
10851
|
-
const [
|
|
10998
|
+
const [playerMuted] = usePlayerMutedState();
|
|
10852
10999
|
const userPreferredVolume = evaluateVolume({
|
|
10853
11000
|
frame: volumePropFrame,
|
|
10854
11001
|
volume,
|
|
@@ -11004,7 +11151,7 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
|
|
|
11004
11151
|
return /* @__PURE__ */ jsx34("video", {
|
|
11005
11152
|
...nativeProps,
|
|
11006
11153
|
ref: videoRef,
|
|
11007
|
-
muted: muted ||
|
|
11154
|
+
muted: muted || playerMuted || userPreferredVolume <= 0,
|
|
11008
11155
|
playsInline: true,
|
|
11009
11156
|
src: actualSrc,
|
|
11010
11157
|
loop: _remotionInternalNativeLoopPassed,
|
|
@@ -11340,6 +11487,7 @@ var Internals = {
|
|
|
11340
11487
|
sequenceStyleSchema,
|
|
11341
11488
|
sequenceVisualStyleSchema,
|
|
11342
11489
|
sequencePremountSchema,
|
|
11490
|
+
textSchema,
|
|
11343
11491
|
transformSchema,
|
|
11344
11492
|
premountSchema,
|
|
11345
11493
|
flattenActiveSchema,
|
|
@@ -11349,7 +11497,7 @@ var Internals = {
|
|
|
11349
11497
|
useVideo,
|
|
11350
11498
|
getRoot,
|
|
11351
11499
|
useMediaVolumeState,
|
|
11352
|
-
|
|
11500
|
+
usePlayerMutedState,
|
|
11353
11501
|
useMediaInTimeline,
|
|
11354
11502
|
useLazyComponent,
|
|
11355
11503
|
truthy,
|
|
@@ -11555,6 +11703,7 @@ var SeriesInner = (props2) => {
|
|
|
11555
11703
|
};
|
|
11556
11704
|
var Series = Object.assign(withInteractivitySchema({
|
|
11557
11705
|
Component: SeriesInner,
|
|
11706
|
+
componentName: "<Series>",
|
|
11558
11707
|
componentIdentity: "dev.remotion.remotion.Series",
|
|
11559
11708
|
schema: sequenceSchemaDefaultLayoutNone,
|
|
11560
11709
|
supportsEffects: false
|