remotion 4.0.8 → 4.0.11
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/Img.js +2 -2
- package/dist/cjs/delay-render.js +22 -14
- package/dist/cjs/index.d.ts +8 -1
- package/dist/cjs/input-props-serialization.d.ts +1 -0
- package/dist/cjs/input-props-serialization.js +5 -5
- package/dist/cjs/internals.d.ts +1 -0
- package/dist/cjs/internals.js +1 -0
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/video/OffthreadVideo.js +2 -1
- package/dist/cjs/video/OffthreadVideoForRendering.js +8 -2
- package/dist/esm/index.mjs +35 -20
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
package/dist/cjs/Img.js
CHANGED
|
@@ -65,7 +65,7 @@ const ImgRefForwarding = ({ onError, maxRetries = 2, src, ...props }, ref) => {
|
|
|
65
65
|
if (process.env.NODE_ENV === 'test') {
|
|
66
66
|
return;
|
|
67
67
|
}
|
|
68
|
-
const newHandle = (0, delay_render_js_1.delayRender)('Loading <Img> with src=' +
|
|
68
|
+
const newHandle = (0, delay_render_js_1.delayRender)('Loading <Img> with src=' + actualSrc);
|
|
69
69
|
const { current } = imageRef;
|
|
70
70
|
const onComplete = () => {
|
|
71
71
|
var _a, _b, _c, _d;
|
|
@@ -89,7 +89,7 @@ const ImgRefForwarding = ({ onError, maxRetries = 2, src, ...props }, ref) => {
|
|
|
89
89
|
current === null || current === void 0 ? void 0 : current.removeEventListener('load', didLoad);
|
|
90
90
|
(0, delay_render_js_1.continueRender)(newHandle);
|
|
91
91
|
};
|
|
92
|
-
}, [
|
|
92
|
+
}, [actualSrc]);
|
|
93
93
|
}
|
|
94
94
|
return ((0, jsx_runtime_1.jsx)("img", { ...props, ref: imageRef, src: actualSrc, onError: didGetError }));
|
|
95
95
|
};
|
package/dist/cjs/delay-render.js
CHANGED
|
@@ -7,7 +7,9 @@ if (typeof window !== 'undefined') {
|
|
|
7
7
|
window.remotion_renderReady = false;
|
|
8
8
|
}
|
|
9
9
|
let handles = [];
|
|
10
|
-
|
|
10
|
+
if (typeof window !== 'undefined') {
|
|
11
|
+
window.remotion_delayRenderTimeouts = {};
|
|
12
|
+
}
|
|
11
13
|
exports.DELAY_RENDER_CALLSTACK_TOKEN = 'The delayRender was called:';
|
|
12
14
|
const defaultTimeout = 30000;
|
|
13
15
|
/**
|
|
@@ -29,18 +31,23 @@ const delayRender = (label) => {
|
|
|
29
31
|
const timeoutToUse = typeof window === 'undefined'
|
|
30
32
|
? defaultTimeout
|
|
31
33
|
: ((_c = window.remotion_puppeteerTimeout) !== null && _c !== void 0 ? _c : defaultTimeout) - 2000;
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
34
|
+
if (typeof window !== 'undefined') {
|
|
35
|
+
window.remotion_delayRenderTimeouts[handle] = {
|
|
36
|
+
label: label !== null && label !== void 0 ? label : null,
|
|
37
|
+
timeout: setTimeout(() => {
|
|
38
|
+
const message = [
|
|
39
|
+
`A delayRender()`,
|
|
40
|
+
label ? `"${label}"` : null,
|
|
41
|
+
`was called but not cleared after ${timeoutToUse}ms. See https://remotion.dev/docs/timeout for help.`,
|
|
42
|
+
exports.DELAY_RENDER_CALLSTACK_TOKEN,
|
|
43
|
+
called,
|
|
44
|
+
]
|
|
45
|
+
.filter(truthy_js_1.truthy)
|
|
46
|
+
.join(' ');
|
|
47
|
+
throw new Error(message);
|
|
48
|
+
}, timeoutToUse),
|
|
49
|
+
};
|
|
50
|
+
}
|
|
44
51
|
}
|
|
45
52
|
if (typeof window !== 'undefined') {
|
|
46
53
|
window.remotion_renderReady = false;
|
|
@@ -64,7 +71,8 @@ const continueRender = (handle) => {
|
|
|
64
71
|
handles = handles.filter((h) => {
|
|
65
72
|
if (h === handle) {
|
|
66
73
|
if ((0, get_environment_js_1.getRemotionEnvironment)() === 'rendering') {
|
|
67
|
-
clearTimeout(
|
|
74
|
+
clearTimeout(window.remotion_delayRenderTimeouts[handle].timeout);
|
|
75
|
+
delete window.remotion_delayRenderTimeouts[handle];
|
|
68
76
|
}
|
|
69
77
|
return false;
|
|
70
78
|
}
|
package/dist/cjs/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
1
2
|
import './asset-types.js';
|
|
2
3
|
import type { TAsset } from './CompositionManager.js';
|
|
3
4
|
import type { StaticFile } from './get-static-files.js';
|
|
@@ -6,6 +7,12 @@ import type { VideoConfig } from './video-config.js';
|
|
|
6
7
|
declare global {
|
|
7
8
|
interface Window {
|
|
8
9
|
remotion_renderReady: boolean;
|
|
10
|
+
remotion_delayRenderTimeouts: {
|
|
11
|
+
[key: string]: {
|
|
12
|
+
label: string | null;
|
|
13
|
+
timeout: number | NodeJS.Timeout;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
9
16
|
remotion_cancelledError: string | undefined;
|
|
10
17
|
remotion_getCompositionNames: () => string[];
|
|
11
18
|
getStaticCompositions: () => Promise<VideoConfig[]>;
|
|
@@ -34,7 +41,7 @@ declare global {
|
|
|
34
41
|
remotion_isPlayer: boolean;
|
|
35
42
|
remotion_isBuilding: undefined | (() => void);
|
|
36
43
|
remotion_finishedBuilding: undefined | (() => void);
|
|
37
|
-
siteVersion: '
|
|
44
|
+
siteVersion: '9';
|
|
38
45
|
remotion_version: string;
|
|
39
46
|
remotion_imported: string | boolean;
|
|
40
47
|
}
|
|
@@ -5,6 +5,7 @@ export type SerializedJSONWithCustomFields = {
|
|
|
5
5
|
mapUsed: boolean;
|
|
6
6
|
setUsed: boolean;
|
|
7
7
|
};
|
|
8
|
+
export declare const DATE_TOKEN = "remotion-date:";
|
|
8
9
|
export declare const FILE_TOKEN = "remotion-file:";
|
|
9
10
|
export declare const serializeJSONWithDate: ({ data, indent, staticBase, }: {
|
|
10
11
|
data: Record<string, unknown>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// Must keep this file in sync with the one in packages/lambda/src/shared/serialize-props.ts!
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.deserializeJSONWithCustomFields = exports.serializeJSONWithDate = exports.FILE_TOKEN = void 0;
|
|
4
|
+
exports.deserializeJSONWithCustomFields = exports.serializeJSONWithDate = exports.FILE_TOKEN = exports.DATE_TOKEN = void 0;
|
|
5
5
|
const static_file_js_1 = require("./static-file.js");
|
|
6
|
-
|
|
6
|
+
exports.DATE_TOKEN = 'remotion-date:';
|
|
7
7
|
exports.FILE_TOKEN = 'remotion-file:';
|
|
8
8
|
const serializeJSONWithDate = ({ data, indent, staticBase, }) => {
|
|
9
9
|
let customDateUsed = false;
|
|
@@ -14,7 +14,7 @@ const serializeJSONWithDate = ({ data, indent, staticBase, }) => {
|
|
|
14
14
|
const item = this[key];
|
|
15
15
|
if (item instanceof Date) {
|
|
16
16
|
customDateUsed = true;
|
|
17
|
-
return `${DATE_TOKEN}${item.toISOString()}`;
|
|
17
|
+
return `${exports.DATE_TOKEN}${item.toISOString()}`;
|
|
18
18
|
}
|
|
19
19
|
if (item instanceof Map) {
|
|
20
20
|
mapUsed = true;
|
|
@@ -37,8 +37,8 @@ const serializeJSONWithDate = ({ data, indent, staticBase, }) => {
|
|
|
37
37
|
exports.serializeJSONWithDate = serializeJSONWithDate;
|
|
38
38
|
const deserializeJSONWithCustomFields = (data) => {
|
|
39
39
|
return JSON.parse(data, (_, value) => {
|
|
40
|
-
if (typeof value === 'string' && value.startsWith(DATE_TOKEN)) {
|
|
41
|
-
return new Date(value.replace(DATE_TOKEN, ''));
|
|
40
|
+
if (typeof value === 'string' && value.startsWith(exports.DATE_TOKEN)) {
|
|
41
|
+
return new Date(value.replace(exports.DATE_TOKEN, ''));
|
|
42
42
|
}
|
|
43
43
|
if (typeof value === 'string' && value.startsWith(exports.FILE_TOKEN)) {
|
|
44
44
|
return (0, static_file_js_1.staticFile)(value.replace(exports.FILE_TOKEN, ''));
|
package/dist/cjs/internals.d.ts
CHANGED
|
@@ -138,6 +138,7 @@ export declare const Internals: {
|
|
|
138
138
|
}) => SerializedJSONWithCustomFields;
|
|
139
139
|
readonly deserializeJSONWithCustomFields: (data: string) => Record<string, unknown>;
|
|
140
140
|
readonly FILE_TOKEN: "remotion-file:";
|
|
141
|
+
readonly DATE_TOKEN: "remotion-date:";
|
|
141
142
|
readonly NativeLayersProvider: import("react").FC<{
|
|
142
143
|
children?: import("react").ReactNode;
|
|
143
144
|
}>;
|
package/dist/cjs/internals.js
CHANGED
|
@@ -127,6 +127,7 @@ exports.Internals = {
|
|
|
127
127
|
serializeJSONWithDate: input_props_serialization_js_1.serializeJSONWithDate,
|
|
128
128
|
deserializeJSONWithCustomFields: input_props_serialization_js_1.deserializeJSONWithCustomFields,
|
|
129
129
|
FILE_TOKEN: input_props_serialization_js_1.FILE_TOKEN,
|
|
130
|
+
DATE_TOKEN: input_props_serialization_js_1.DATE_TOKEN,
|
|
130
131
|
NativeLayersProvider: NativeLayers_js_1.NativeLayersProvider,
|
|
131
132
|
ClipComposition: Composition_js_1.ClipComposition,
|
|
132
133
|
};
|
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "4.0.
|
|
1
|
+
export declare const VERSION = "4.0.11";
|
package/dist/cjs/version.js
CHANGED
|
@@ -35,6 +35,7 @@ const OffthreadVideo = (props) => {
|
|
|
35
35
|
if (environment === 'rendering') {
|
|
36
36
|
return (0, jsx_runtime_1.jsx)(OffthreadVideoForRendering_js_1.OffthreadVideoForRendering, { ...otherProps });
|
|
37
37
|
}
|
|
38
|
-
|
|
38
|
+
const { transparent, ...withoutTransparent } = otherProps;
|
|
39
|
+
return ((0, jsx_runtime_1.jsx)(VideoForDevelopment_js_1.VideoForDevelopment, { onDuration: onDuration, onlyWarnForMediaSeekingError: true, ...withoutTransparent }));
|
|
39
40
|
};
|
|
40
41
|
exports.OffthreadVideo = OffthreadVideo;
|
|
@@ -6,6 +6,7 @@ const react_1 = require("react");
|
|
|
6
6
|
const absolute_src_js_1 = require("../absolute-src.js");
|
|
7
7
|
const AssetManager_js_1 = require("../AssetManager.js");
|
|
8
8
|
const use_audio_frame_js_1 = require("../audio/use-audio-frame.js");
|
|
9
|
+
const cancel_render_js_1 = require("../cancel-render.js");
|
|
9
10
|
const default_css_js_1 = require("../default-css.js");
|
|
10
11
|
const Img_js_1 = require("../Img.js");
|
|
11
12
|
const random_js_1 = require("../random.js");
|
|
@@ -91,8 +92,13 @@ const OffthreadVideoForRendering = ({ onError, volume: volumeProp, playbackRate,
|
|
|
91
92
|
return `http://localhost:${window.remotion_proxyPort}/proxy?src=${encodeURIComponent((0, absolute_src_js_1.getAbsoluteSrc)(src))}&time=${encodeURIComponent(currentTime)}&transparent=${String(transparent)}`;
|
|
92
93
|
}, [currentTime, src, transparent]);
|
|
93
94
|
const onErr = (0, react_1.useCallback)((e) => {
|
|
94
|
-
|
|
95
|
-
|
|
95
|
+
if (onError) {
|
|
96
|
+
onError === null || onError === void 0 ? void 0 : onError(e);
|
|
97
|
+
}
|
|
98
|
+
else {
|
|
99
|
+
(0, cancel_render_js_1.cancelRender)('Failed to load image with src ' + actualSrc);
|
|
100
|
+
}
|
|
101
|
+
}, [actualSrc, onError]);
|
|
96
102
|
const className = (0, react_1.useMemo)(() => {
|
|
97
103
|
return [default_css_js_1.OFFTHREAD_VIDEO_CLASS_NAME, props.className]
|
|
98
104
|
.filter(truthy_js_1.truthy)
|
package/dist/esm/index.mjs
CHANGED
|
@@ -59,7 +59,7 @@ function truthy(value) {
|
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
// Automatically generated on publish
|
|
62
|
-
const VERSION = '4.0.
|
|
62
|
+
const VERSION = '4.0.11';
|
|
63
63
|
|
|
64
64
|
const checkMultipleRemotionVersions = () => {
|
|
65
65
|
if (typeof globalThis === 'undefined') {
|
|
@@ -2240,7 +2240,9 @@ if (typeof window !== 'undefined') {
|
|
|
2240
2240
|
window.remotion_renderReady = false;
|
|
2241
2241
|
}
|
|
2242
2242
|
let handles = [];
|
|
2243
|
-
|
|
2243
|
+
if (typeof window !== 'undefined') {
|
|
2244
|
+
window.remotion_delayRenderTimeouts = {};
|
|
2245
|
+
}
|
|
2244
2246
|
const DELAY_RENDER_CALLSTACK_TOKEN = 'The delayRender was called:';
|
|
2245
2247
|
const defaultTimeout = 30000;
|
|
2246
2248
|
/**
|
|
@@ -2262,18 +2264,23 @@ const delayRender = (label) => {
|
|
|
2262
2264
|
const timeoutToUse = typeof window === 'undefined'
|
|
2263
2265
|
? defaultTimeout
|
|
2264
2266
|
: ((_c = window.remotion_puppeteerTimeout) !== null && _c !== void 0 ? _c : defaultTimeout) - 2000;
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2267
|
+
if (typeof window !== 'undefined') {
|
|
2268
|
+
window.remotion_delayRenderTimeouts[handle] = {
|
|
2269
|
+
label: label !== null && label !== void 0 ? label : null,
|
|
2270
|
+
timeout: setTimeout(() => {
|
|
2271
|
+
const message = [
|
|
2272
|
+
`A delayRender()`,
|
|
2273
|
+
label ? `"${label}"` : null,
|
|
2274
|
+
`was called but not cleared after ${timeoutToUse}ms. See https://remotion.dev/docs/timeout for help.`,
|
|
2275
|
+
DELAY_RENDER_CALLSTACK_TOKEN,
|
|
2276
|
+
called,
|
|
2277
|
+
]
|
|
2278
|
+
.filter(truthy)
|
|
2279
|
+
.join(' ');
|
|
2280
|
+
throw new Error(message);
|
|
2281
|
+
}, timeoutToUse),
|
|
2282
|
+
};
|
|
2283
|
+
}
|
|
2277
2284
|
}
|
|
2278
2285
|
if (typeof window !== 'undefined') {
|
|
2279
2286
|
window.remotion_renderReady = false;
|
|
@@ -2296,7 +2303,8 @@ const continueRender = (handle) => {
|
|
|
2296
2303
|
handles = handles.filter((h) => {
|
|
2297
2304
|
if (h === handle) {
|
|
2298
2305
|
if (getRemotionEnvironment() === 'rendering') {
|
|
2299
|
-
clearTimeout(
|
|
2306
|
+
clearTimeout(window.remotion_delayRenderTimeouts[handle].timeout);
|
|
2307
|
+
delete window.remotion_delayRenderTimeouts[handle];
|
|
2300
2308
|
}
|
|
2301
2309
|
return false;
|
|
2302
2310
|
}
|
|
@@ -3018,7 +3026,7 @@ const ImgRefForwarding = ({ onError, maxRetries = 2, src, ...props }, ref) => {
|
|
|
3018
3026
|
if (process.env.NODE_ENV === 'test') {
|
|
3019
3027
|
return;
|
|
3020
3028
|
}
|
|
3021
|
-
const newHandle = delayRender('Loading <Img> with src=' +
|
|
3029
|
+
const newHandle = delayRender('Loading <Img> with src=' + actualSrc);
|
|
3022
3030
|
const { current } = imageRef;
|
|
3023
3031
|
const onComplete = () => {
|
|
3024
3032
|
var _a, _b, _c, _d;
|
|
@@ -3042,7 +3050,7 @@ const ImgRefForwarding = ({ onError, maxRetries = 2, src, ...props }, ref) => {
|
|
|
3042
3050
|
current === null || current === void 0 ? void 0 : current.removeEventListener('load', didLoad);
|
|
3043
3051
|
continueRender(newHandle);
|
|
3044
3052
|
};
|
|
3045
|
-
}, [
|
|
3053
|
+
}, [actualSrc]);
|
|
3046
3054
|
}
|
|
3047
3055
|
return (jsx("img", { ...props, ref: imageRef, src: actualSrc, onError: didGetError }));
|
|
3048
3056
|
};
|
|
@@ -3836,6 +3844,7 @@ const Internals = {
|
|
|
3836
3844
|
serializeJSONWithDate,
|
|
3837
3845
|
deserializeJSONWithCustomFields,
|
|
3838
3846
|
FILE_TOKEN,
|
|
3847
|
+
DATE_TOKEN,
|
|
3839
3848
|
NativeLayersProvider,
|
|
3840
3849
|
ClipComposition,
|
|
3841
3850
|
};
|
|
@@ -4247,8 +4256,13 @@ const OffthreadVideoForRendering = ({ onError, volume: volumeProp, playbackRate,
|
|
|
4247
4256
|
return `http://localhost:${window.remotion_proxyPort}/proxy?src=${encodeURIComponent(getAbsoluteSrc(src))}&time=${encodeURIComponent(currentTime)}&transparent=${String(transparent)}`;
|
|
4248
4257
|
}, [currentTime, src, transparent]);
|
|
4249
4258
|
const onErr = useCallback((e) => {
|
|
4250
|
-
|
|
4251
|
-
|
|
4259
|
+
if (onError) {
|
|
4260
|
+
onError === null || onError === void 0 ? void 0 : onError(e);
|
|
4261
|
+
}
|
|
4262
|
+
else {
|
|
4263
|
+
cancelRender('Failed to load image with src ' + actualSrc);
|
|
4264
|
+
}
|
|
4265
|
+
}, [actualSrc, onError]);
|
|
4252
4266
|
const className = useMemo(() => {
|
|
4253
4267
|
return [OFFTHREAD_VIDEO_CLASS_NAME, props.className]
|
|
4254
4268
|
.filter(truthy)
|
|
@@ -4441,7 +4455,8 @@ const OffthreadVideo = (props) => {
|
|
|
4441
4455
|
if (environment === 'rendering') {
|
|
4442
4456
|
return jsx(OffthreadVideoForRendering, { ...otherProps });
|
|
4443
4457
|
}
|
|
4444
|
-
|
|
4458
|
+
const { transparent, ...withoutTransparent } = otherProps;
|
|
4459
|
+
return (jsx(VideoForDevelopment, { onDuration: onDuration, onlyWarnForMediaSeekingError: true, ...withoutTransparent }));
|
|
4445
4460
|
};
|
|
4446
4461
|
|
|
4447
4462
|
const VideoForRenderingForwardFunction = ({ onError, volume: volumeProp, allowAmplificationDuringRender, playbackRate, onDuration, ...props }, ref) => {
|
package/dist/esm/version.mjs
CHANGED