remotion 4.0.0-prefetch.7 → 4.0.0-prefetchapi.16
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/AbsoluteFill.d.ts +0 -0
- package/dist/AbsoluteFill.js +0 -0
- package/dist/CanUseRemotionHooks.d.ts +0 -0
- package/dist/CanUseRemotionHooks.js +0 -0
- package/dist/Composition.d.ts +0 -0
- package/dist/Composition.js +0 -0
- package/dist/CompositionManager.d.ts +0 -0
- package/dist/CompositionManager.js +0 -0
- package/dist/Folder.d.ts +0 -0
- package/dist/Folder.js +0 -0
- package/dist/IFrame.d.ts +0 -0
- package/dist/IFrame.js +0 -0
- package/dist/Img.d.ts +0 -0
- package/dist/Img.js +2 -2
- package/dist/RemotionRoot.d.ts +0 -0
- package/dist/RemotionRoot.js +5 -4
- package/dist/Sequence.d.ts +0 -0
- package/dist/Sequence.js +0 -0
- package/dist/Still.d.ts +0 -0
- package/dist/Still.js +0 -0
- package/dist/absolute-src.d.ts +0 -0
- package/dist/absolute-src.js +0 -0
- package/dist/asset-types.d.ts +0 -0
- package/dist/asset-types.js +0 -0
- package/dist/audio/Audio.d.ts +0 -0
- package/dist/audio/Audio.js +0 -0
- package/dist/audio/AudioForDevelopment.d.ts +0 -0
- package/dist/audio/AudioForDevelopment.js +2 -2
- package/dist/audio/AudioForRendering.d.ts +0 -0
- package/dist/audio/AudioForRendering.js +0 -0
- package/dist/audio/index.d.ts +0 -0
- package/dist/audio/index.js +0 -0
- package/dist/audio/props.d.ts +0 -0
- package/dist/audio/props.js +0 -0
- package/dist/audio/shared-audio-tags.d.ts +0 -0
- package/dist/audio/shared-audio-tags.js +0 -0
- package/dist/audio/use-audio-frame.d.ts +0 -0
- package/dist/audio/use-audio-frame.js +0 -0
- package/dist/bezier.d.ts +0 -0
- package/dist/bezier.js +0 -0
- package/dist/config/input-props.d.ts +0 -0
- package/dist/config/input-props.js +0 -0
- package/dist/config.d.ts +0 -0
- package/dist/config.js +0 -0
- package/dist/default-css.d.ts +0 -0
- package/dist/default-css.js +0 -0
- package/dist/delay-render.d.ts +0 -0
- package/dist/delay-render.js +0 -0
- package/dist/easing.d.ts +0 -0
- package/dist/easing.js +0 -0
- package/dist/freeze.d.ts +0 -0
- package/dist/freeze.js +0 -0
- package/dist/get-asset-file-name.d.ts +0 -0
- package/dist/get-asset-file-name.js +0 -0
- package/dist/get-environment.d.ts +0 -0
- package/dist/get-environment.js +2 -2
- package/dist/get-preview-dom-element.d.ts +0 -0
- package/dist/get-preview-dom-element.js +0 -0
- package/dist/get-timeline-clip-name.d.ts +0 -0
- package/dist/get-timeline-clip-name.js +0 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3 -3
- package/dist/internals.d.ts +3 -0
- package/dist/internals.js +2 -0
- package/dist/interpolate-colors.d.ts +0 -0
- package/dist/interpolate-colors.js +0 -0
- package/dist/interpolate.d.ts +0 -0
- package/dist/interpolate.js +0 -0
- package/dist/is-approximately-the-same.d.ts +0 -0
- package/dist/is-approximately-the-same.js +0 -0
- package/dist/loading-indicator.d.ts +0 -0
- package/dist/loading-indicator.js +0 -0
- package/dist/loop/index.d.ts +0 -0
- package/dist/loop/index.js +0 -0
- package/dist/multiple-versions-warning.d.ts +0 -0
- package/dist/multiple-versions-warning.js +0 -0
- package/dist/nonce.d.ts +0 -0
- package/dist/nonce.js +0 -0
- package/dist/play-and-handle-not-allowed-error.d.ts +0 -0
- package/dist/play-and-handle-not-allowed-error.js +0 -0
- package/dist/portal-node.d.ts +0 -0
- package/dist/portal-node.js +0 -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/preload.js +16 -13
- package/dist/random.d.ts +0 -0
- package/dist/random.js +0 -0
- package/dist/register-root.d.ts +0 -0
- package/dist/register-root.js +0 -0
- package/dist/series/flatten-children.d.ts +0 -0
- package/dist/series/flatten-children.js +0 -0
- package/dist/series/index.d.ts +0 -0
- package/dist/series/index.js +0 -0
- package/dist/setup-env-variables.d.ts +0 -0
- package/dist/setup-env-variables.js +0 -0
- package/dist/spring/index.d.ts +0 -0
- package/dist/spring/index.js +0 -0
- package/dist/spring/measure-spring.d.ts +0 -0
- package/dist/spring/measure-spring.js +0 -0
- package/dist/spring/spring-utils.d.ts +0 -0
- package/dist/spring/spring-utils.js +0 -0
- package/dist/static-file.d.ts +0 -0
- package/dist/static-file.js +0 -0
- package/dist/timeline-position-state.d.ts +0 -0
- package/dist/timeline-position-state.js +0 -0
- package/dist/truthy.d.ts +0 -0
- package/dist/truthy.js +0 -0
- package/dist/use-current-frame.d.ts +0 -0
- package/dist/use-current-frame.js +0 -0
- package/dist/use-lazy-component.d.ts +0 -0
- package/dist/use-lazy-component.js +0 -0
- package/dist/use-media-in-timeline.d.ts +0 -0
- package/dist/use-media-in-timeline.js +0 -0
- package/dist/use-media-playback.d.ts +0 -0
- package/dist/use-media-playback.js +0 -0
- package/dist/use-media-tag-volume.d.ts +0 -0
- package/dist/use-media-tag-volume.js +0 -0
- package/dist/use-sync-volume-with-media-tag.d.ts +0 -0
- package/dist/use-sync-volume-with-media-tag.js +0 -0
- package/dist/use-unsafe-video-config.d.ts +0 -0
- package/dist/use-unsafe-video-config.js +0 -0
- package/dist/use-video-config.d.ts +0 -0
- package/dist/use-video-config.js +0 -0
- package/dist/use-video.d.ts +0 -0
- package/dist/use-video.js +0 -0
- package/dist/validate-media-props.d.ts +0 -0
- package/dist/validate-media-props.js +0 -0
- package/dist/validate-start-from-props.d.ts +0 -0
- package/dist/validate-start-from-props.js +0 -0
- package/dist/validation/validate-composition-id.d.ts +0 -0
- package/dist/validation/validate-composition-id.js +0 -0
- package/dist/validation/validate-dimensions.d.ts +0 -0
- package/dist/validation/validate-dimensions.js +0 -0
- package/dist/validation/validate-duration-in-frames.d.ts +0 -0
- package/dist/validation/validate-duration-in-frames.js +0 -0
- package/dist/validation/validate-folder-name.d.ts +0 -0
- package/dist/validation/validate-folder-name.js +0 -0
- package/dist/validation/validate-fps.d.ts +0 -0
- package/dist/validation/validate-fps.js +0 -0
- package/dist/validation/validate-offthreadvideo-image-format.d.ts +0 -0
- package/dist/validation/validate-offthreadvideo-image-format.js +0 -0
- package/dist/validation/validation-spring-duration.d.ts +0 -0
- package/dist/validation/validation-spring-duration.js +0 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/video/OffthreadVideo.d.ts +0 -0
- package/dist/video/OffthreadVideo.js +0 -0
- package/dist/video/OffthreadVideoForRendering.d.ts +0 -0
- package/dist/video/OffthreadVideoForRendering.js +0 -0
- package/dist/video/Video.d.ts +0 -0
- package/dist/video/Video.js +0 -0
- package/dist/video/VideoForDevelopment.d.ts +0 -0
- package/dist/video/VideoForDevelopment.js +2 -2
- package/dist/video/VideoForRendering.d.ts +0 -0
- package/dist/video/VideoForRendering.js +0 -0
- package/dist/video/get-current-time.d.ts +0 -0
- package/dist/video/get-current-time.js +0 -0
- package/dist/video/index.d.ts +0 -0
- package/dist/video/index.js +0 -0
- package/dist/video/props.d.ts +0 -0
- package/dist/video/props.js +0 -0
- package/dist/video-config.d.ts +0 -0
- package/dist/video-config.js +0 -0
- package/dist/volume-position-state.d.ts +0 -0
- package/dist/volume-position-state.js +0 -0
- package/dist/volume-prop.d.ts +0 -0
- package/dist/volume-prop.js +0 -0
- package/dist/warn-about-non-seekable-media.d.ts +0 -0
- package/dist/warn-about-non-seekable-media.js +0 -0
- package/dist/wrap-remotion-context.d.ts +0 -0
- package/dist/wrap-remotion-context.js +0 -0
- package/package.json +2 -2
- package/dist/config/bundle-out-dir.d.ts +0 -2
- package/dist/config/bundle-out-dir.js +0 -12
- package/dist/config/public-path.d.ts +0 -2
- package/dist/config/public-path.js +0 -12
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
[
|
|
2
|
-
[
|
|
3
|
-
[
|
|
4
|
-
[
|
|
5
|
-
[
|
|
1
|
+
[32mremotion:build: [0mcache hit, replaying output [2m28df07482870d016[0m
|
|
2
|
+
[32mremotion:build: [0m
|
|
3
|
+
[32mremotion:build: [0m> remotion@3.2.16 build /Users/jonathanburger/remotion/packages/core
|
|
4
|
+
[32mremotion:build: [0m> tsc -d
|
|
5
|
+
[32mremotion:build: [0m
|
package/dist/AbsoluteFill.d.ts
CHANGED
|
File without changes
|
package/dist/AbsoluteFill.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/dist/Composition.d.ts
CHANGED
|
File without changes
|
package/dist/Composition.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/dist/Folder.d.ts
CHANGED
|
File without changes
|
package/dist/Folder.js
CHANGED
|
File without changes
|
package/dist/IFrame.d.ts
CHANGED
|
File without changes
|
package/dist/IFrame.js
CHANGED
|
File without changes
|
package/dist/Img.d.ts
CHANGED
|
File without changes
|
package/dist/Img.js
CHANGED
|
@@ -4,13 +4,13 @@ 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
|
|
7
|
+
const prefetch_1 = require("./prefetch");
|
|
8
8
|
const ImgRefForwarding = ({ onError, src, ...props }, ref) => {
|
|
9
9
|
const imageRef = (0, react_1.useRef)(null);
|
|
10
10
|
(0, react_1.useImperativeHandle)(ref, () => {
|
|
11
11
|
return imageRef.current;
|
|
12
12
|
});
|
|
13
|
-
const actualSrc = (0,
|
|
13
|
+
const actualSrc = (0, prefetch_1.usePreload)(src);
|
|
14
14
|
const didGetError = (0, react_1.useCallback)((e) => {
|
|
15
15
|
var _a;
|
|
16
16
|
if (onError) {
|
package/dist/RemotionRoot.d.ts
CHANGED
|
File without changes
|
package/dist/RemotionRoot.js
CHANGED
|
@@ -7,6 +7,7 @@ const shared_audio_tags_1 = require("./audio/shared-audio-tags");
|
|
|
7
7
|
const CompositionManager_1 = require("./CompositionManager");
|
|
8
8
|
const delay_render_1 = require("./delay-render");
|
|
9
9
|
const nonce_1 = require("./nonce");
|
|
10
|
+
const preload_state_1 = require("./preload-state");
|
|
10
11
|
const random_1 = require("./random");
|
|
11
12
|
const timeline_position_state_1 = require("./timeline-position-state");
|
|
12
13
|
const RemotionRoot = ({ children }) => {
|
|
@@ -61,10 +62,10 @@ const RemotionRoot = ({ children }) => {
|
|
|
61
62
|
});
|
|
62
63
|
}
|
|
63
64
|
}, []);
|
|
64
|
-
return ((0, jsx_runtime_1.jsx)(nonce_1.NonceContext.Provider, { value: nonceContext, children: (0, jsx_runtime_1.jsx)(timeline_position_state_1.TimelineContext.Provider, { value: timelineContextValue, children: (0, jsx_runtime_1.jsx)(timeline_position_state_1.SetTimelineContext.Provider, { value: setTimelineContextValue, children: (0, jsx_runtime_1.jsx)(CompositionManager_1.CompositionManagerProvider, { children: (0, jsx_runtime_1.jsx)(shared_audio_tags_1.SharedAudioContextProvider
|
|
65
|
-
// In the preview, which is mostly played on Desktop, we opt out of the autoplay policy fix as described in https://github.com/remotion-dev/remotion/pull/554, as it mostly applies to mobile.
|
|
66
|
-
, {
|
|
65
|
+
return ((0, jsx_runtime_1.jsx)(nonce_1.NonceContext.Provider, { value: nonceContext, children: (0, jsx_runtime_1.jsx)(timeline_position_state_1.TimelineContext.Provider, { value: timelineContextValue, children: (0, jsx_runtime_1.jsx)(timeline_position_state_1.SetTimelineContext.Provider, { value: setTimelineContextValue, children: (0, jsx_runtime_1.jsx)(preload_state_1.PreloadProvider, { children: (0, jsx_runtime_1.jsx)(CompositionManager_1.CompositionManagerProvider, { children: (0, jsx_runtime_1.jsx)(shared_audio_tags_1.SharedAudioContextProvider
|
|
67
66
|
// In the preview, which is mostly played on Desktop, we opt out of the autoplay policy fix as described in https://github.com/remotion-dev/remotion/pull/554, as it mostly applies to mobile.
|
|
68
|
-
|
|
67
|
+
, {
|
|
68
|
+
// In the preview, which is mostly played on Desktop, we opt out of the autoplay policy fix as described in https://github.com/remotion-dev/remotion/pull/554, as it mostly applies to mobile.
|
|
69
|
+
numberOfAudioTags: 0, children: children }) }) }) }) }) }));
|
|
69
70
|
};
|
|
70
71
|
exports.RemotionRoot = RemotionRoot;
|
package/dist/Sequence.d.ts
CHANGED
|
File without changes
|
package/dist/Sequence.js
CHANGED
|
File without changes
|
package/dist/Still.d.ts
CHANGED
|
File without changes
|
package/dist/Still.js
CHANGED
|
File without changes
|
package/dist/absolute-src.d.ts
CHANGED
|
File without changes
|
package/dist/absolute-src.js
CHANGED
|
File without changes
|
package/dist/asset-types.d.ts
CHANGED
|
File without changes
|
package/dist/asset-types.js
CHANGED
|
File without changes
|
package/dist/audio/Audio.d.ts
CHANGED
|
File without changes
|
package/dist/audio/Audio.js
CHANGED
|
File without changes
|
|
File without changes
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.AudioForDevelopment = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
|
-
const
|
|
6
|
+
const prefetch_1 = require("../prefetch");
|
|
7
7
|
const random_1 = require("../random");
|
|
8
8
|
const Sequence_1 = require("../Sequence");
|
|
9
9
|
const use_media_in_timeline_1 = require("../use-media-in-timeline");
|
|
@@ -25,7 +25,7 @@ const AudioForDevelopmentForwardRefFunction = (props, ref) => {
|
|
|
25
25
|
if (!src) {
|
|
26
26
|
throw new TypeError("No 'src' was passed to <Audio>.");
|
|
27
27
|
}
|
|
28
|
-
const preloadedSrc = (0,
|
|
28
|
+
const preloadedSrc = (0, prefetch_1.usePreload)(src);
|
|
29
29
|
const propsToPass = (0, react_1.useMemo)(() => {
|
|
30
30
|
return {
|
|
31
31
|
muted: muted || mediaMuted,
|
|
File without changes
|
|
File without changes
|
package/dist/audio/index.d.ts
CHANGED
|
File without changes
|
package/dist/audio/index.js
CHANGED
|
File without changes
|
package/dist/audio/props.d.ts
CHANGED
|
File without changes
|
package/dist/audio/props.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/dist/bezier.d.ts
CHANGED
|
File without changes
|
package/dist/bezier.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/dist/config.d.ts
CHANGED
|
File without changes
|
package/dist/config.js
CHANGED
|
File without changes
|
package/dist/default-css.d.ts
CHANGED
|
File without changes
|
package/dist/default-css.js
CHANGED
|
File without changes
|
package/dist/delay-render.d.ts
CHANGED
|
File without changes
|
package/dist/delay-render.js
CHANGED
|
File without changes
|
package/dist/easing.d.ts
CHANGED
|
File without changes
|
package/dist/easing.js
CHANGED
|
File without changes
|
package/dist/freeze.d.ts
CHANGED
|
File without changes
|
package/dist/freeze.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/dist/get-environment.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getRemotionEnvironment = void 0;
|
|
4
4
|
const getRemotionEnvironment = () => {
|
|
5
|
-
if (process.env.NODE_ENV === 'production') {
|
|
5
|
+
if (typeof process !== 'undefined' && process.env.NODE_ENV === 'production') {
|
|
6
6
|
if (typeof window !== 'undefined' && window.remotion_isPlayer) {
|
|
7
7
|
return 'player-production';
|
|
8
8
|
}
|
|
@@ -11,7 +11,7 @@ const getRemotionEnvironment = () => {
|
|
|
11
11
|
// The Jest framework sets NODE_ENV as test.
|
|
12
12
|
// Right now we don't need to treat it in a special
|
|
13
13
|
// way which is good - defaulting to `rendering`.
|
|
14
|
-
if (process.env.NODE_ENV === 'test') {
|
|
14
|
+
if (typeof process !== 'undefined' && process.env.NODE_ENV === 'test') {
|
|
15
15
|
return 'rendering';
|
|
16
16
|
}
|
|
17
17
|
if (typeof window !== 'undefined' && window.remotion_isPlayer) {
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/dist/index.d.ts
CHANGED
|
@@ -56,7 +56,7 @@ export * from './internals';
|
|
|
56
56
|
export * from './interpolate';
|
|
57
57
|
export { interpolateColors } from './interpolate-colors';
|
|
58
58
|
export { Loop } from './loop';
|
|
59
|
-
export {
|
|
59
|
+
export { prefetch } from './prefetch';
|
|
60
60
|
export * from './random';
|
|
61
61
|
export { registerRoot } from './register-root';
|
|
62
62
|
export { Sequence } from './Sequence';
|
package/dist/index.js
CHANGED
|
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.useCurrentFrame = exports.staticFile = exports.Series = exports.Sequence = exports.registerRoot = exports.
|
|
17
|
+
exports.useCurrentFrame = exports.staticFile = exports.Series = exports.Sequence = exports.registerRoot = exports.prefetch = exports.Loop = exports.interpolateColors = exports.getInputProps = exports.Config = void 0;
|
|
18
18
|
require("./asset-types");
|
|
19
19
|
const multiple_versions_warning_1 = require("./multiple-versions-warning");
|
|
20
20
|
(0, multiple_versions_warning_1.checkMultipleRemotionVersions)();
|
|
@@ -37,8 +37,8 @@ var interpolate_colors_1 = require("./interpolate-colors");
|
|
|
37
37
|
Object.defineProperty(exports, "interpolateColors", { enumerable: true, get: function () { return interpolate_colors_1.interpolateColors; } });
|
|
38
38
|
var loop_1 = require("./loop");
|
|
39
39
|
Object.defineProperty(exports, "Loop", { enumerable: true, get: function () { return loop_1.Loop; } });
|
|
40
|
-
var
|
|
41
|
-
Object.defineProperty(exports, "
|
|
40
|
+
var prefetch_1 = require("./prefetch");
|
|
41
|
+
Object.defineProperty(exports, "prefetch", { enumerable: true, get: function () { return prefetch_1.prefetch; } });
|
|
42
42
|
__exportStar(require("./random"), exports);
|
|
43
43
|
var register_root_1 = require("./register-root");
|
|
44
44
|
Object.defineProperty(exports, "registerRoot", { enumerable: true, get: function () { return register_root_1.registerRoot; } });
|
package/dist/internals.d.ts
CHANGED
|
@@ -79,6 +79,9 @@ export declare const Internals: {
|
|
|
79
79
|
}>;
|
|
80
80
|
CanUseRemotionHooks: import("react").Context<boolean>;
|
|
81
81
|
enableLegacyRemotionConfig: () => void;
|
|
82
|
+
PreloadProvider: import("react").FC<{
|
|
83
|
+
children: import("react").ReactNode;
|
|
84
|
+
}>;
|
|
82
85
|
};
|
|
83
86
|
declare type WebpackConfiguration = Configuration;
|
|
84
87
|
declare type WebpackOverrideFn = (currentConfiguration: WebpackConfiguration) => WebpackConfiguration;
|
package/dist/internals.js
CHANGED
|
@@ -33,6 +33,7 @@ const delay_render_1 = require("./delay-render");
|
|
|
33
33
|
const get_environment_1 = require("./get-environment");
|
|
34
34
|
const get_preview_dom_element_1 = require("./get-preview-dom-element");
|
|
35
35
|
const portal_node_1 = require("./portal-node");
|
|
36
|
+
const preload_state_1 = require("./preload-state");
|
|
36
37
|
const register_root_1 = require("./register-root");
|
|
37
38
|
const RemotionRoot_1 = require("./RemotionRoot");
|
|
38
39
|
const Sequence_1 = require("./Sequence");
|
|
@@ -88,4 +89,5 @@ exports.Internals = {
|
|
|
88
89
|
CanUseRemotionHooksProvider: CanUseRemotionHooks_1.CanUseRemotionHooksProvider,
|
|
89
90
|
CanUseRemotionHooks: CanUseRemotionHooks_1.CanUseRemotionHooks,
|
|
90
91
|
enableLegacyRemotionConfig: config_1.enableLegacyRemotionConfig,
|
|
92
|
+
PreloadProvider: preload_state_1.PreloadProvider,
|
|
91
93
|
};
|
|
File without changes
|
|
File without changes
|
package/dist/interpolate.d.ts
CHANGED
|
File without changes
|
package/dist/interpolate.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/dist/loop/index.d.ts
CHANGED
|
File without changes
|
package/dist/loop/index.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/dist/nonce.d.ts
CHANGED
|
File without changes
|
package/dist/nonce.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/dist/portal-node.d.ts
CHANGED
|
File without changes
|
package/dist/portal-node.js
CHANGED
|
File without changes
|
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/preload.js
CHANGED
|
@@ -3,15 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.fetchAndPreload = exports.usePreload = void 0;
|
|
4
4
|
const react_1 = require("react");
|
|
5
5
|
const get_environment_1 = require("./get-environment");
|
|
6
|
-
const
|
|
6
|
+
const preload_state_1 = require("./preload-state");
|
|
7
7
|
const usePreload = (src) => {
|
|
8
8
|
var _a;
|
|
9
|
-
const
|
|
10
|
-
(0, react_1.useImperativeHandle)(preloadRef, () => {
|
|
11
|
-
return {
|
|
12
|
-
setPreloads,
|
|
13
|
-
};
|
|
14
|
-
});
|
|
9
|
+
const { preloads } = (0, react_1.useContext)(preload_state_1.PreloadContext);
|
|
15
10
|
return (_a = preloads[src]) !== null && _a !== void 0 ? _a : src;
|
|
16
11
|
};
|
|
17
12
|
exports.usePreload = usePreload;
|
|
@@ -30,10 +25,14 @@ const fetchAndPreload = (src) => {
|
|
|
30
25
|
resolve = res;
|
|
31
26
|
reject = rej;
|
|
32
27
|
});
|
|
33
|
-
|
|
28
|
+
const controller = new AbortController();
|
|
29
|
+
let canBeAborted = true;
|
|
30
|
+
fetch(src, {
|
|
31
|
+
signal: controller.signal,
|
|
32
|
+
})
|
|
34
33
|
.then((res) => {
|
|
34
|
+
canBeAborted = false;
|
|
35
35
|
if (canceled) {
|
|
36
|
-
reject(new Error('Preloading cancelled'));
|
|
37
36
|
return null;
|
|
38
37
|
}
|
|
39
38
|
if (!res.ok) {
|
|
@@ -44,12 +43,11 @@ const fetchAndPreload = (src) => {
|
|
|
44
43
|
.then((buf) => {
|
|
45
44
|
var _a;
|
|
46
45
|
if (canceled) {
|
|
47
|
-
reject(new Error('Preloading cancelled'));
|
|
48
46
|
return;
|
|
49
47
|
}
|
|
50
48
|
if (buf) {
|
|
51
49
|
objectUrl = URL.createObjectURL(buf);
|
|
52
|
-
(_a = preloadRef.current) === null || _a === void 0 ? void 0 : _a.setPreloads((p) => ({
|
|
50
|
+
(_a = preload_state_1.preloadRef.current) === null || _a === void 0 ? void 0 : _a.setPreloads((p) => ({
|
|
53
51
|
...p,
|
|
54
52
|
[src]: objectUrl,
|
|
55
53
|
}));
|
|
@@ -64,7 +62,7 @@ const fetchAndPreload = (src) => {
|
|
|
64
62
|
var _a;
|
|
65
63
|
if (objectUrl) {
|
|
66
64
|
URL.revokeObjectURL(objectUrl);
|
|
67
|
-
(_a = preloadRef.current) === null || _a === void 0 ? void 0 : _a.setPreloads((p) => {
|
|
65
|
+
(_a = preload_state_1.preloadRef.current) === null || _a === void 0 ? void 0 : _a.setPreloads((p) => {
|
|
68
66
|
const copy = { ...p };
|
|
69
67
|
delete copy[src];
|
|
70
68
|
return copy;
|
|
@@ -72,7 +70,12 @@ const fetchAndPreload = (src) => {
|
|
|
72
70
|
}
|
|
73
71
|
else {
|
|
74
72
|
canceled = true;
|
|
75
|
-
|
|
73
|
+
if (canBeAborted) {
|
|
74
|
+
try {
|
|
75
|
+
controller.abort();
|
|
76
|
+
}
|
|
77
|
+
catch (e) { }
|
|
78
|
+
}
|
|
76
79
|
}
|
|
77
80
|
},
|
|
78
81
|
waitForDone: () => {
|
package/dist/random.d.ts
CHANGED
|
File without changes
|
package/dist/random.js
CHANGED
|
File without changes
|
package/dist/register-root.d.ts
CHANGED
|
File without changes
|
package/dist/register-root.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/dist/series/index.d.ts
CHANGED
|
File without changes
|
package/dist/series/index.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/dist/spring/index.d.ts
CHANGED
|
File without changes
|
package/dist/spring/index.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/dist/static-file.d.ts
CHANGED
|
File without changes
|
package/dist/static-file.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/dist/truthy.d.ts
CHANGED
|
File without changes
|
package/dist/truthy.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/dist/use-video-config.js
CHANGED
|
File without changes
|
package/dist/use-video.d.ts
CHANGED
|
File without changes
|
package/dist/use-video.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "4.0.0-
|
|
1
|
+
export declare const VERSION = "4.0.0-prefetchapi.16+486ce6105";
|
package/dist/version.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/dist/video/Video.d.ts
CHANGED
|
File without changes
|
package/dist/video/Video.js
CHANGED
|
File without changes
|
|
File without changes
|
|
@@ -4,7 +4,7 @@ exports.VideoForDevelopment = void 0;
|
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const use_audio_frame_1 = require("../audio/use-audio-frame");
|
|
7
|
-
const
|
|
7
|
+
const prefetch_1 = require("../prefetch");
|
|
8
8
|
const use_media_in_timeline_1 = require("../use-media-in-timeline");
|
|
9
9
|
const use_media_playback_1 = require("../use-media-playback");
|
|
10
10
|
const use_media_tag_volume_1 = require("../use-media-tag-volume");
|
|
@@ -39,7 +39,7 @@ const VideoForDevelopmentRefForwardingFunction = (props, ref) => {
|
|
|
39
39
|
playbackRate: (_a = props.playbackRate) !== null && _a !== void 0 ? _a : 1,
|
|
40
40
|
onlyWarnForMediaSeekingError,
|
|
41
41
|
});
|
|
42
|
-
const actualSrc = (0,
|
|
42
|
+
const actualSrc = (0, prefetch_1.usePreload)(src);
|
|
43
43
|
(0, react_1.useImperativeHandle)(ref, () => {
|
|
44
44
|
return videoRef.current;
|
|
45
45
|
});
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/dist/video/index.d.ts
CHANGED
|
File without changes
|
package/dist/video/index.js
CHANGED
|
File without changes
|
package/dist/video/props.d.ts
CHANGED
|
File without changes
|
package/dist/video/props.js
CHANGED
|
File without changes
|
package/dist/video-config.d.ts
CHANGED
|
File without changes
|
package/dist/video-config.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/dist/volume-prop.d.ts
CHANGED
|
File without changes
|
package/dist/volume-prop.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "remotion",
|
|
3
|
-
"version": "4.0.0-
|
|
3
|
+
"version": "4.0.0-prefetchapi.16+486ce6105",
|
|
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": "486ce6105d52f9494351e4fbf564f6cfb0b10408"
|
|
58
58
|
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.setBundleOutDir = exports.getBundleOutDir = void 0;
|
|
4
|
-
let bundleOutDir = null;
|
|
5
|
-
const getBundleOutDir = () => {
|
|
6
|
-
return bundleOutDir;
|
|
7
|
-
};
|
|
8
|
-
exports.getBundleOutDir = getBundleOutDir;
|
|
9
|
-
const setBundleOutDir = (path) => {
|
|
10
|
-
bundleOutDir = path;
|
|
11
|
-
};
|
|
12
|
-
exports.setBundleOutDir = setBundleOutDir;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.setPublicPath = exports.getPublicPath = void 0;
|
|
4
|
-
let publicPath = null;
|
|
5
|
-
const getPublicPath = () => {
|
|
6
|
-
return publicPath;
|
|
7
|
-
};
|
|
8
|
-
exports.getPublicPath = getPublicPath;
|
|
9
|
-
const setPublicPath = (path) => {
|
|
10
|
-
publicPath = path;
|
|
11
|
-
};
|
|
12
|
-
exports.setPublicPath = setPublicPath;
|