remotion 4.0.115 → 4.0.117
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/absolute-src.js +1 -1
- package/dist/cjs/audio/Audio.js +1 -1
- package/dist/cjs/audio/shared-audio-tags.js +2 -2
- package/dist/cjs/no-react.d.ts +2 -1
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/video/OffthreadVideo.js +1 -1
- package/dist/cjs/video/OffthreadVideoForRendering.js +8 -3
- package/dist/cjs/video/Video.js +1 -1
- package/dist/cjs/video/offthread-video-source.d.ts +2 -1
- package/dist/cjs/video/offthread-video-source.js +2 -2
- package/dist/cjs/video/props.d.ts +1 -0
- package/dist/cjs/watch-static-file.js +8 -2
- package/dist/esm/index.mjs +25 -14
- package/dist/esm/no-react.mjs +3 -3
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
package/dist/cjs/absolute-src.js
CHANGED
package/dist/cjs/audio/Audio.js
CHANGED
|
@@ -62,7 +62,7 @@ const AudioRefForwardingFunction = (props, ref) => {
|
|
|
62
62
|
(0, validate_start_from_props_js_1.validateStartFromProps)(startFrom, endAt);
|
|
63
63
|
const startFromFrameNo = startFrom !== null && startFrom !== void 0 ? startFrom : 0;
|
|
64
64
|
const endAtFrameNo = endAt !== null && endAt !== void 0 ? endAt : Infinity;
|
|
65
|
-
return ((0, jsx_runtime_1.jsx)(Sequence_js_1.Sequence, { layout: "none", from: 0 - startFromFrameNo, showInTimeline: false, durationInFrames: endAtFrameNo, name: name, children: (0, jsx_runtime_1.jsx)(exports.Audio, { _remotionInternalNeedsDurationCalculation: Boolean(loop), ...otherProps, ref: ref }) }));
|
|
65
|
+
return ((0, jsx_runtime_1.jsx)(Sequence_js_1.Sequence, { layout: "none", from: 0 - startFromFrameNo, showInTimeline: false, durationInFrames: endAtFrameNo, name: name, children: (0, jsx_runtime_1.jsx)(exports.Audio, { _remotionInternalNeedsDurationCalculation: Boolean(loop), pauseWhenBuffering: pauseWhenBuffering !== null && pauseWhenBuffering !== void 0 ? pauseWhenBuffering : false, ...otherProps, ref: ref }) }));
|
|
66
66
|
}
|
|
67
67
|
(0, validate_media_props_js_1.validateMediaProps)(props, 'Audio');
|
|
68
68
|
if (environment.isRendering) {
|
|
@@ -51,8 +51,8 @@ const didPropChange = (key, newProp, prevProp) => {
|
|
|
51
51
|
if (key === 'src' &&
|
|
52
52
|
!prevProp.startsWith('data:') &&
|
|
53
53
|
!newProp.startsWith('data:')) {
|
|
54
|
-
return (new URL(prevProp, window.
|
|
55
|
-
new URL(newProp, window.
|
|
54
|
+
return (new URL(prevProp, window.origin).toString() !==
|
|
55
|
+
new URL(newProp, window.origin).toString());
|
|
56
56
|
}
|
|
57
57
|
if (prevProp === newProp) {
|
|
58
58
|
return false;
|
package/dist/cjs/no-react.d.ts
CHANGED
|
@@ -29,10 +29,11 @@ export declare const NoReactInternals: {
|
|
|
29
29
|
bundleMapName: string;
|
|
30
30
|
deserializeJSONWithCustomFields: (data: string) => Record<string, unknown>;
|
|
31
31
|
DELAY_RENDER_CALLSTACK_TOKEN: string;
|
|
32
|
-
getOffthreadVideoSource: ({ src, transparent, currentTime, }: {
|
|
32
|
+
getOffthreadVideoSource: ({ src, transparent, currentTime, toneMapped, }: {
|
|
33
33
|
src: string;
|
|
34
34
|
transparent: boolean;
|
|
35
35
|
currentTime: number;
|
|
36
|
+
toneMapped: boolean;
|
|
36
37
|
}) => string;
|
|
37
38
|
getExpectedMediaFrameUncorrected: ({ frame, playbackRate, startFrom, }: {
|
|
38
39
|
frame: number;
|
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "4.0.
|
|
1
|
+
export declare const VERSION = "4.0.117";
|
package/dist/cjs/version.js
CHANGED
|
@@ -29,7 +29,7 @@ const OffthreadVideo = (props) => {
|
|
|
29
29
|
(0, validate_start_from_props_js_1.validateStartFromProps)(startFrom, endAt);
|
|
30
30
|
const startFromFrameNo = startFrom !== null && startFrom !== void 0 ? startFrom : 0;
|
|
31
31
|
const endAtFrameNo = endAt !== null && endAt !== void 0 ? endAt : Infinity;
|
|
32
|
-
return ((0, jsx_runtime_1.jsx)(Sequence_js_1.Sequence, { layout: "none", from: 0 - startFromFrameNo, showInTimeline: false, durationInFrames: endAtFrameNo, name: name, children: (0, jsx_runtime_1.jsx)(exports.OffthreadVideo, { ...otherProps }) }));
|
|
32
|
+
return ((0, jsx_runtime_1.jsx)(Sequence_js_1.Sequence, { layout: "none", from: 0 - startFromFrameNo, showInTimeline: false, durationInFrames: endAtFrameNo, name: name, children: (0, jsx_runtime_1.jsx)(exports.OffthreadVideo, { pauseWhenBuffering: pauseWhenBuffering !== null && pauseWhenBuffering !== void 0 ? pauseWhenBuffering : false, ...otherProps }) }));
|
|
33
33
|
}
|
|
34
34
|
(0, validate_media_props_js_1.validateMediaProps)(props, 'Video');
|
|
35
35
|
if (environment.isRendering) {
|
|
@@ -18,7 +18,7 @@ const use_unsafe_video_config_js_1 = require("../use-unsafe-video-config.js");
|
|
|
18
18
|
const volume_prop_js_1 = require("../volume-prop.js");
|
|
19
19
|
const get_current_time_js_1 = require("./get-current-time.js");
|
|
20
20
|
const offthread_video_source_js_1 = require("./offthread-video-source.js");
|
|
21
|
-
const OffthreadVideoForRendering = ({ onError, volume: volumeProp, playbackRate, src, muted, allowAmplificationDuringRender, transparent = false, toneFrequency, name, ...props }) => {
|
|
21
|
+
const OffthreadVideoForRendering = ({ onError, volume: volumeProp, playbackRate, src, muted, allowAmplificationDuringRender, transparent = false, toneMapped = true, toneFrequency, name, ...props }) => {
|
|
22
22
|
const absoluteFrame = (0, timeline_position_state_js_1.useTimelinePosition)();
|
|
23
23
|
const frame = (0, use_current_frame_js_1.useCurrentFrame)();
|
|
24
24
|
const volumePropsFrame = (0, use_audio_frame_js_1.useFrameForVolumeProp)();
|
|
@@ -92,8 +92,13 @@ const OffthreadVideoForRendering = ({ onError, volume: volumeProp, playbackRate,
|
|
|
92
92
|
}) / videoConfig.fps);
|
|
93
93
|
}, [frame, mediaStartsAt, playbackRate, videoConfig.fps]);
|
|
94
94
|
const actualSrc = (0, react_1.useMemo)(() => {
|
|
95
|
-
return (0, offthread_video_source_js_1.getOffthreadVideoSource)({
|
|
96
|
-
|
|
95
|
+
return (0, offthread_video_source_js_1.getOffthreadVideoSource)({
|
|
96
|
+
src,
|
|
97
|
+
currentTime,
|
|
98
|
+
transparent,
|
|
99
|
+
toneMapped,
|
|
100
|
+
});
|
|
101
|
+
}, [toneMapped, currentTime, src, transparent]);
|
|
97
102
|
const onErr = (0, react_1.useCallback)((e) => {
|
|
98
103
|
if (onError) {
|
|
99
104
|
onError === null || onError === void 0 ? void 0 : onError(e);
|
package/dist/cjs/video/Video.js
CHANGED
|
@@ -48,7 +48,7 @@ const VideoForwardingFunction = (props, ref) => {
|
|
|
48
48
|
(0, validate_start_from_props_js_1.validateStartFromProps)(startFrom, endAt);
|
|
49
49
|
const startFromFrameNo = startFrom !== null && startFrom !== void 0 ? startFrom : 0;
|
|
50
50
|
const endAtFrameNo = endAt !== null && endAt !== void 0 ? endAt : Infinity;
|
|
51
|
-
return ((0, jsx_runtime_1.jsx)(Sequence_js_1.Sequence, { layout: "none", from: 0 - startFromFrameNo, showInTimeline: false, durationInFrames: endAtFrameNo, name: name, children: (0, jsx_runtime_1.jsx)(exports.Video, { ...otherProps, ref: ref }) }));
|
|
51
|
+
return ((0, jsx_runtime_1.jsx)(Sequence_js_1.Sequence, { layout: "none", from: 0 - startFromFrameNo, showInTimeline: false, durationInFrames: endAtFrameNo, name: name, children: (0, jsx_runtime_1.jsx)(exports.Video, { pauseWhenBuffering: pauseWhenBuffering !== null && pauseWhenBuffering !== void 0 ? pauseWhenBuffering : false, ...otherProps, ref: ref }) }));
|
|
52
52
|
}
|
|
53
53
|
(0, validate_media_props_js_1.validateMediaProps)(props, 'Video');
|
|
54
54
|
if (environment.isRendering) {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
export declare const getOffthreadVideoSource: ({ src, transparent, currentTime, }: {
|
|
1
|
+
export declare const getOffthreadVideoSource: ({ src, transparent, currentTime, toneMapped, }: {
|
|
2
2
|
src: string;
|
|
3
3
|
transparent: boolean;
|
|
4
4
|
currentTime: number;
|
|
5
|
+
toneMapped: boolean;
|
|
5
6
|
}) => string;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getOffthreadVideoSource = void 0;
|
|
4
4
|
const absolute_src_1 = require("../absolute-src");
|
|
5
|
-
const getOffthreadVideoSource = ({ src, transparent, currentTime, }) => {
|
|
6
|
-
return `http://localhost:${window.remotion_proxyPort}/proxy?src=${encodeURIComponent((0, absolute_src_1.getAbsoluteSrc)(src))}&time=${encodeURIComponent(currentTime)}&transparent=${String(transparent)}`;
|
|
5
|
+
const getOffthreadVideoSource = ({ src, transparent, currentTime, toneMapped, }) => {
|
|
6
|
+
return `http://localhost:${window.remotion_proxyPort}/proxy?src=${encodeURIComponent((0, absolute_src_1.getAbsoluteSrc)(src))}&time=${encodeURIComponent(currentTime)}&transparent=${String(transparent)}&toneMapped=${String(toneMapped)}`;
|
|
7
7
|
};
|
|
8
8
|
exports.getOffthreadVideoSource = getOffthreadVideoSource;
|
|
@@ -17,12 +17,18 @@ const watchStaticFile = (fileName, callback) => {
|
|
|
17
17
|
console.warn('The API is only available while using the Remotion Studio.');
|
|
18
18
|
return { cancel: () => undefined };
|
|
19
19
|
}
|
|
20
|
-
|
|
20
|
+
const withoutStaticBase = fileName.startsWith(window.remotion_staticBase)
|
|
21
|
+
? fileName.replace(window.remotion_staticBase, '')
|
|
22
|
+
: fileName;
|
|
23
|
+
const withoutLeadingSlash = withoutStaticBase.startsWith('/')
|
|
24
|
+
? withoutStaticBase.slice(1)
|
|
25
|
+
: withoutStaticBase;
|
|
26
|
+
let prevFileData = window.remotion_staticFiles.find((file) => file.name === withoutLeadingSlash);
|
|
21
27
|
// Check if the specified static file has updated or deleted
|
|
22
28
|
const checkFile = (event) => {
|
|
23
29
|
const staticFiles = event.detail.files;
|
|
24
30
|
// Check for user specified file
|
|
25
|
-
const newFileData = staticFiles.find((file) => file.name ===
|
|
31
|
+
const newFileData = staticFiles.find((file) => file.name === withoutLeadingSlash);
|
|
26
32
|
if (!newFileData) {
|
|
27
33
|
// File is deleted
|
|
28
34
|
if (prevFileData !== undefined) {
|
package/dist/esm/index.mjs
CHANGED
|
@@ -105,7 +105,7 @@ function truthy(value) {
|
|
|
105
105
|
}
|
|
106
106
|
|
|
107
107
|
// Automatically generated on publish
|
|
108
|
-
const VERSION = '4.0.
|
|
108
|
+
const VERSION = '4.0.117';
|
|
109
109
|
|
|
110
110
|
const checkMultipleRemotionVersions = () => {
|
|
111
111
|
if (typeof globalThis === 'undefined') {
|
|
@@ -1084,7 +1084,7 @@ const getAbsoluteSrc = (relativeSrc) => {
|
|
|
1084
1084
|
if (typeof window === 'undefined') {
|
|
1085
1085
|
return relativeSrc;
|
|
1086
1086
|
}
|
|
1087
|
-
return new URL(relativeSrc, window.
|
|
1087
|
+
return new URL(relativeSrc, window.origin).href;
|
|
1088
1088
|
};
|
|
1089
1089
|
|
|
1090
1090
|
const calculateLoopDuration = ({ endAt, mediaDuration, playbackRate, startFrom, }) => {
|
|
@@ -2225,8 +2225,8 @@ const didPropChange = (key, newProp, prevProp) => {
|
|
|
2225
2225
|
if (key === 'src' &&
|
|
2226
2226
|
!prevProp.startsWith('data:') &&
|
|
2227
2227
|
!newProp.startsWith('data:')) {
|
|
2228
|
-
return (new URL(prevProp, window.
|
|
2229
|
-
new URL(newProp, window.
|
|
2228
|
+
return (new URL(prevProp, window.origin).toString() !==
|
|
2229
|
+
new URL(newProp, window.origin).toString());
|
|
2230
2230
|
}
|
|
2231
2231
|
if (prevProp === newProp) {
|
|
2232
2232
|
return false;
|
|
@@ -2786,7 +2786,7 @@ const AudioRefForwardingFunction = (props, ref) => {
|
|
|
2786
2786
|
validateStartFromProps(startFrom, endAt);
|
|
2787
2787
|
const startFromFrameNo = startFrom !== null && startFrom !== void 0 ? startFrom : 0;
|
|
2788
2788
|
const endAtFrameNo = endAt !== null && endAt !== void 0 ? endAt : Infinity;
|
|
2789
|
-
return (jsx(Sequence, { layout: "none", from: 0 - startFromFrameNo, showInTimeline: false, durationInFrames: endAtFrameNo, name: name, children: jsx(Audio, { _remotionInternalNeedsDurationCalculation: Boolean(loop), ...otherProps, ref: ref }) }));
|
|
2789
|
+
return (jsx(Sequence, { layout: "none", from: 0 - startFromFrameNo, showInTimeline: false, durationInFrames: endAtFrameNo, name: name, children: jsx(Audio, { _remotionInternalNeedsDurationCalculation: Boolean(loop), pauseWhenBuffering: pauseWhenBuffering !== null && pauseWhenBuffering !== void 0 ? pauseWhenBuffering : false, ...otherProps, ref: ref }) }));
|
|
2790
2790
|
}
|
|
2791
2791
|
validateMediaProps(props, 'Audio');
|
|
2792
2792
|
if (environment.isRendering) {
|
|
@@ -4142,12 +4142,18 @@ const watchStaticFile = (fileName, callback) => {
|
|
|
4142
4142
|
console.warn('The API is only available while using the Remotion Studio.');
|
|
4143
4143
|
return { cancel: () => undefined };
|
|
4144
4144
|
}
|
|
4145
|
-
|
|
4145
|
+
const withoutStaticBase = fileName.startsWith(window.remotion_staticBase)
|
|
4146
|
+
? fileName.replace(window.remotion_staticBase, '')
|
|
4147
|
+
: fileName;
|
|
4148
|
+
const withoutLeadingSlash = withoutStaticBase.startsWith('/')
|
|
4149
|
+
? withoutStaticBase.slice(1)
|
|
4150
|
+
: withoutStaticBase;
|
|
4151
|
+
let prevFileData = window.remotion_staticFiles.find((file) => file.name === withoutLeadingSlash);
|
|
4146
4152
|
// Check if the specified static file has updated or deleted
|
|
4147
4153
|
const checkFile = (event) => {
|
|
4148
4154
|
const staticFiles = event.detail.files;
|
|
4149
4155
|
// Check for user specified file
|
|
4150
|
-
const newFileData = staticFiles.find((file) => file.name ===
|
|
4156
|
+
const newFileData = staticFiles.find((file) => file.name === withoutLeadingSlash);
|
|
4151
4157
|
if (!newFileData) {
|
|
4152
4158
|
// File is deleted
|
|
4153
4159
|
if (prevFileData !== undefined) {
|
|
@@ -4302,8 +4308,8 @@ const validateFrame = ({ allowFloats, durationInFrames, frame, }) => {
|
|
|
4302
4308
|
}
|
|
4303
4309
|
};
|
|
4304
4310
|
|
|
4305
|
-
const getOffthreadVideoSource = ({ src, transparent, currentTime, }) => {
|
|
4306
|
-
return `http://localhost:${window.remotion_proxyPort}/proxy?src=${encodeURIComponent(getAbsoluteSrc(src))}&time=${encodeURIComponent(currentTime)}&transparent=${String(transparent)}`;
|
|
4311
|
+
const getOffthreadVideoSource = ({ src, transparent, currentTime, toneMapped, }) => {
|
|
4312
|
+
return `http://localhost:${window.remotion_proxyPort}/proxy?src=${encodeURIComponent(getAbsoluteSrc(src))}&time=${encodeURIComponent(currentTime)}&transparent=${String(transparent)}&toneMapped=${String(toneMapped)}`;
|
|
4307
4313
|
};
|
|
4308
4314
|
|
|
4309
4315
|
const flattenChildren = (children) => {
|
|
@@ -4659,7 +4665,7 @@ const Still = (props) => {
|
|
|
4659
4665
|
return React.createElement((Composition), newProps);
|
|
4660
4666
|
};
|
|
4661
4667
|
|
|
4662
|
-
const OffthreadVideoForRendering = ({ onError, volume: volumeProp, playbackRate, src, muted, allowAmplificationDuringRender, transparent = false, toneFrequency, name, ...props }) => {
|
|
4668
|
+
const OffthreadVideoForRendering = ({ onError, volume: volumeProp, playbackRate, src, muted, allowAmplificationDuringRender, transparent = false, toneMapped = true, toneFrequency, name, ...props }) => {
|
|
4663
4669
|
const absoluteFrame = useTimelinePosition();
|
|
4664
4670
|
const frame = useCurrentFrame();
|
|
4665
4671
|
const volumePropsFrame = useFrameForVolumeProp();
|
|
@@ -4733,8 +4739,13 @@ const OffthreadVideoForRendering = ({ onError, volume: volumeProp, playbackRate,
|
|
|
4733
4739
|
}) / videoConfig.fps);
|
|
4734
4740
|
}, [frame, mediaStartsAt, playbackRate, videoConfig.fps]);
|
|
4735
4741
|
const actualSrc = useMemo(() => {
|
|
4736
|
-
return getOffthreadVideoSource({
|
|
4737
|
-
|
|
4742
|
+
return getOffthreadVideoSource({
|
|
4743
|
+
src,
|
|
4744
|
+
currentTime,
|
|
4745
|
+
transparent,
|
|
4746
|
+
toneMapped,
|
|
4747
|
+
});
|
|
4748
|
+
}, [toneMapped, currentTime, src, transparent]);
|
|
4738
4749
|
const onErr = useCallback((e) => {
|
|
4739
4750
|
if (onError) {
|
|
4740
4751
|
onError === null || onError === void 0 ? void 0 : onError(e);
|
|
@@ -4905,7 +4916,7 @@ const OffthreadVideo = (props) => {
|
|
|
4905
4916
|
validateStartFromProps(startFrom, endAt);
|
|
4906
4917
|
const startFromFrameNo = startFrom !== null && startFrom !== void 0 ? startFrom : 0;
|
|
4907
4918
|
const endAtFrameNo = endAt !== null && endAt !== void 0 ? endAt : Infinity;
|
|
4908
|
-
return (jsx(Sequence, { layout: "none", from: 0 - startFromFrameNo, showInTimeline: false, durationInFrames: endAtFrameNo, name: name, children: jsx(OffthreadVideo, { ...otherProps }) }));
|
|
4919
|
+
return (jsx(Sequence, { layout: "none", from: 0 - startFromFrameNo, showInTimeline: false, durationInFrames: endAtFrameNo, name: name, children: jsx(OffthreadVideo, { pauseWhenBuffering: pauseWhenBuffering !== null && pauseWhenBuffering !== void 0 ? pauseWhenBuffering : false, ...otherProps }) }));
|
|
4909
4920
|
}
|
|
4910
4921
|
validateMediaProps(props, 'Video');
|
|
4911
4922
|
if (environment.isRendering) {
|
|
@@ -5212,7 +5223,7 @@ const VideoForwardingFunction = (props, ref) => {
|
|
|
5212
5223
|
validateStartFromProps(startFrom, endAt);
|
|
5213
5224
|
const startFromFrameNo = startFrom !== null && startFrom !== void 0 ? startFrom : 0;
|
|
5214
5225
|
const endAtFrameNo = endAt !== null && endAt !== void 0 ? endAt : Infinity;
|
|
5215
|
-
return (jsx(Sequence, { layout: "none", from: 0 - startFromFrameNo, showInTimeline: false, durationInFrames: endAtFrameNo, name: name, children: jsx(Video, { ...otherProps, ref: ref }) }));
|
|
5226
|
+
return (jsx(Sequence, { layout: "none", from: 0 - startFromFrameNo, showInTimeline: false, durationInFrames: endAtFrameNo, name: name, children: jsx(Video, { pauseWhenBuffering: pauseWhenBuffering !== null && pauseWhenBuffering !== void 0 ? pauseWhenBuffering : false, ...otherProps, ref: ref }) }));
|
|
5216
5227
|
}
|
|
5217
5228
|
validateMediaProps(props, 'Video');
|
|
5218
5229
|
if (environment.isRendering) {
|
package/dist/esm/no-react.mjs
CHANGED
|
@@ -740,11 +740,11 @@ const getAbsoluteSrc = (relativeSrc) => {
|
|
|
740
740
|
if (typeof window === 'undefined') {
|
|
741
741
|
return relativeSrc;
|
|
742
742
|
}
|
|
743
|
-
return new URL(relativeSrc, window.
|
|
743
|
+
return new URL(relativeSrc, window.origin).href;
|
|
744
744
|
};
|
|
745
745
|
|
|
746
|
-
const getOffthreadVideoSource = ({ src, transparent, currentTime, }) => {
|
|
747
|
-
return `http://localhost:${window.remotion_proxyPort}/proxy?src=${encodeURIComponent(getAbsoluteSrc(src))}&time=${encodeURIComponent(currentTime)}&transparent=${String(transparent)}`;
|
|
746
|
+
const getOffthreadVideoSource = ({ src, transparent, currentTime, toneMapped, }) => {
|
|
747
|
+
return `http://localhost:${window.remotion_proxyPort}/proxy?src=${encodeURIComponent(getAbsoluteSrc(src))}&time=${encodeURIComponent(currentTime)}&transparent=${String(transparent)}&toneMapped=${String(toneMapped)}`;
|
|
748
748
|
};
|
|
749
749
|
|
|
750
750
|
const NoReactInternals = {
|
package/dist/esm/version.mjs
CHANGED