remotion 3.2.20 → 3.2.22
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/.turbo/turbo-build.log +5 -5
- package/dist/Img.js +25 -21
- package/dist/config.d.ts +8 -0
- package/dist/prefetch.d.ts +7 -0
- package/dist/prefetch.js +86 -0
- package/dist/preload-state.d.ts +13 -0
- package/dist/preload-state.js +26 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +2 -2
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
[
|
|
2
|
-
[
|
|
3
|
-
[
|
|
4
|
-
[
|
|
5
|
-
[
|
|
1
|
+
[36mremotion:build: [0mcache hit, replaying output [2m9c88e751e5828f60[0m
|
|
2
|
+
[36mremotion:build: [0m
|
|
3
|
+
[36mremotion:build: [0m> remotion@3.2.21 build /Users/jonathanburger/remotion/packages/core
|
|
4
|
+
[36mremotion:build: [0m> tsc -d
|
|
5
|
+
[36mremotion:build: [0m
|
package/dist/Img.js
CHANGED
|
@@ -4,6 +4,7 @@ exports.Img = void 0;
|
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const delay_render_1 = require("./delay-render");
|
|
7
|
+
const get_environment_1 = require("./get-environment");
|
|
7
8
|
const ImgRefForwarding = ({ onError, ...props }, ref) => {
|
|
8
9
|
const imageRef = (0, react_1.useRef)(null);
|
|
9
10
|
(0, react_1.useImperativeHandle)(ref, () => {
|
|
@@ -19,27 +20,30 @@ const ImgRefForwarding = ({ onError, ...props }, ref) => {
|
|
|
19
20
|
}
|
|
20
21
|
}, [onError]);
|
|
21
22
|
// If image source switches, make new handle
|
|
22
|
-
(0,
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
23
|
+
if ((0, get_environment_1.getRemotionEnvironment)() === 'rendering') {
|
|
24
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
25
|
+
(0, react_1.useLayoutEffect)(() => {
|
|
26
|
+
if (process.env.NODE_ENV === 'test') {
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
const newHandle = (0, delay_render_1.delayRender)('Loading <Img> with src=' + props.src);
|
|
30
|
+
const { current } = imageRef;
|
|
31
|
+
const didLoad = () => {
|
|
32
|
+
(0, delay_render_1.continueRender)(newHandle);
|
|
33
|
+
};
|
|
34
|
+
if (current === null || current === void 0 ? void 0 : current.complete) {
|
|
35
|
+
(0, delay_render_1.continueRender)(newHandle);
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
current === null || current === void 0 ? void 0 : current.addEventListener('load', didLoad, { once: true });
|
|
39
|
+
}
|
|
40
|
+
// If tag gets unmounted, clear pending handles because image is not going to load
|
|
41
|
+
return () => {
|
|
42
|
+
current === null || current === void 0 ? void 0 : current.removeEventListener('load', didLoad);
|
|
43
|
+
(0, delay_render_1.continueRender)(newHandle);
|
|
44
|
+
};
|
|
45
|
+
}, [props.src]);
|
|
46
|
+
}
|
|
43
47
|
return (0, jsx_runtime_1.jsx)("img", { ...props, ref: imageRef, onError: didGetError });
|
|
44
48
|
};
|
|
45
49
|
exports.Img = (0, react_1.forwardRef)(ImgRefForwarding);
|
package/dist/config.d.ts
CHANGED
|
@@ -203,6 +203,14 @@ export declare type ConfigType = {
|
|
|
203
203
|
* See https://avpres.net/FFmpeg/im_ProRes.html for meaning of possible values.
|
|
204
204
|
*/
|
|
205
205
|
readonly setProResProfile: (profile: '4444-xq' | '4444' | 'hq' | 'standard' | 'light' | 'proxy' | undefined) => void;
|
|
206
|
+
/**
|
|
207
|
+
* Override the arguments that Remotion passes to FFMPEG.
|
|
208
|
+
* Consult https://remotion.dev/docs/renderer/render-media#ffmpegoverride before using this feature.
|
|
209
|
+
*/
|
|
210
|
+
readonly overrideFfmpegCommand: (command: (info: {
|
|
211
|
+
type: 'pre-stitcher' | 'stitcher';
|
|
212
|
+
args: string[];
|
|
213
|
+
}) => string[]) => void;
|
|
206
214
|
};
|
|
207
215
|
};
|
|
208
216
|
export type { Concurrency, WebpackConfiguration, WebpackOverrideFn };
|
package/dist/prefetch.js
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.prefetch = exports.usePreload = void 0;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const get_environment_1 = require("./get-environment");
|
|
6
|
+
const preload_state_1 = require("./preload-state");
|
|
7
|
+
const usePreload = (src) => {
|
|
8
|
+
var _a;
|
|
9
|
+
const { preloads } = (0, react_1.useContext)(preload_state_1.PreloadContext);
|
|
10
|
+
return (_a = preloads[src]) !== null && _a !== void 0 ? _a : src;
|
|
11
|
+
};
|
|
12
|
+
exports.usePreload = usePreload;
|
|
13
|
+
const prefetch = (src) => {
|
|
14
|
+
if ((0, get_environment_1.getRemotionEnvironment)() === 'rendering') {
|
|
15
|
+
return {
|
|
16
|
+
unpreload: () => undefined,
|
|
17
|
+
waitForDone: () => Promise.resolve(src),
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
let canceled = false;
|
|
21
|
+
let objectUrl = null;
|
|
22
|
+
let resolve = () => undefined;
|
|
23
|
+
let reject = () => undefined;
|
|
24
|
+
const waitUntilDone = new Promise((res, rej) => {
|
|
25
|
+
resolve = res;
|
|
26
|
+
reject = rej;
|
|
27
|
+
});
|
|
28
|
+
const controller = new AbortController();
|
|
29
|
+
let canBeAborted = true;
|
|
30
|
+
fetch(src, {
|
|
31
|
+
signal: controller.signal,
|
|
32
|
+
})
|
|
33
|
+
.then((res) => {
|
|
34
|
+
canBeAborted = false;
|
|
35
|
+
if (canceled) {
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
if (!res.ok) {
|
|
39
|
+
throw new Error(`HTTP error, status = ${res.status}`);
|
|
40
|
+
}
|
|
41
|
+
return res.blob();
|
|
42
|
+
})
|
|
43
|
+
.then((buf) => {
|
|
44
|
+
var _a;
|
|
45
|
+
if (canceled) {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
if (buf) {
|
|
49
|
+
objectUrl = URL.createObjectURL(buf);
|
|
50
|
+
(_a = preload_state_1.preloadRef.current) === null || _a === void 0 ? void 0 : _a.setPreloads((p) => ({
|
|
51
|
+
...p,
|
|
52
|
+
[src]: objectUrl,
|
|
53
|
+
}));
|
|
54
|
+
resolve(objectUrl);
|
|
55
|
+
}
|
|
56
|
+
})
|
|
57
|
+
.catch((err) => {
|
|
58
|
+
reject(err);
|
|
59
|
+
});
|
|
60
|
+
return {
|
|
61
|
+
unpreload: () => {
|
|
62
|
+
var _a;
|
|
63
|
+
if (objectUrl) {
|
|
64
|
+
URL.revokeObjectURL(objectUrl);
|
|
65
|
+
(_a = preload_state_1.preloadRef.current) === null || _a === void 0 ? void 0 : _a.setPreloads((p) => {
|
|
66
|
+
const copy = { ...p };
|
|
67
|
+
delete copy[src];
|
|
68
|
+
return copy;
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
canceled = true;
|
|
73
|
+
if (canBeAborted) {
|
|
74
|
+
try {
|
|
75
|
+
controller.abort();
|
|
76
|
+
}
|
|
77
|
+
catch (e) { }
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
waitForDone: () => {
|
|
82
|
+
return waitUntilDone;
|
|
83
|
+
},
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
exports.prefetch = prefetch;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
declare type Value = {
|
|
3
|
+
preloads: Record<string, string>;
|
|
4
|
+
setPreloads: React.Dispatch<React.SetStateAction<Record<string, string>>>;
|
|
5
|
+
};
|
|
6
|
+
export declare const preloadRef: React.RefObject<{
|
|
7
|
+
setPreloads: React.Dispatch<React.SetStateAction<Record<string, string>>>;
|
|
8
|
+
}>;
|
|
9
|
+
export declare const PreloadContext: React.Context<Value>;
|
|
10
|
+
export declare const PreloadProvider: React.FC<{
|
|
11
|
+
children: React.ReactNode;
|
|
12
|
+
}>;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PreloadProvider = exports.PreloadContext = exports.preloadRef = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
exports.preloadRef = (0, react_1.createRef)();
|
|
7
|
+
exports.PreloadContext = (0, react_1.createContext)({
|
|
8
|
+
preloads: {},
|
|
9
|
+
setPreloads: () => undefined,
|
|
10
|
+
});
|
|
11
|
+
const PreloadProvider = ({ children }) => {
|
|
12
|
+
const [preloads, setPreloads] = (0, react_1.useState)({});
|
|
13
|
+
const value = (0, react_1.useMemo)(() => {
|
|
14
|
+
return {
|
|
15
|
+
preloads,
|
|
16
|
+
setPreloads,
|
|
17
|
+
};
|
|
18
|
+
}, [preloads]);
|
|
19
|
+
(0, react_1.useImperativeHandle)(exports.preloadRef, () => {
|
|
20
|
+
return {
|
|
21
|
+
setPreloads,
|
|
22
|
+
};
|
|
23
|
+
});
|
|
24
|
+
return ((0, jsx_runtime_1.jsx)(exports.PreloadContext.Provider, { value: value, children: children }));
|
|
25
|
+
};
|
|
26
|
+
exports.PreloadProvider = PreloadProvider;
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "3.2.
|
|
1
|
+
export declare const VERSION = "3.2.22";
|
package/dist/version.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "remotion",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.22",
|
|
4
4
|
"description": "Render videos in React",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -54,5 +54,5 @@
|
|
|
54
54
|
"publishConfig": {
|
|
55
55
|
"access": "public"
|
|
56
56
|
},
|
|
57
|
-
"gitHead": "
|
|
57
|
+
"gitHead": "1c35638566717760bb394e0748b088cea15faff4"
|
|
58
58
|
}
|