remotion 4.0.285 → 4.0.287
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.js +17 -7
- package/dist/cjs/EditorProps.d.ts +4 -0
- package/dist/cjs/EditorProps.js +17 -7
- package/dist/cjs/Sequence.js +3 -2
- package/dist/cjs/SequenceManager.js +17 -7
- package/dist/cjs/animated-image/canvas.js +17 -7
- package/dist/cjs/audio/shared-audio-tags.js +17 -7
- package/dist/cjs/buffering.js +17 -7
- package/dist/cjs/internals.d.ts +24 -16
- package/dist/cjs/internals.js +21 -7
- package/dist/cjs/log.d.ts +5 -5
- package/dist/cjs/loop/index.js +17 -7
- package/dist/cjs/prefetch.d.ts +2 -0
- package/dist/cjs/prefetch.js +36 -12
- package/dist/cjs/propagate.d.ts +1 -0
- package/dist/cjs/propagate.js +6 -0
- package/dist/cjs/series/is-inside-series.js +17 -7
- package/dist/cjs/use-current-scale.js +17 -7
- package/dist/cjs/use-lazy-component.js +17 -7
- package/dist/cjs/validate-media-props.d.ts +2 -2
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/video/OffthreadVideo.d.ts +2 -2
- package/dist/cjs/video/OffthreadVideoForRendering.d.ts +2 -2
- package/dist/cjs/video/VideoForPreview.js +2 -1
- package/dist/cjs/video/index.d.ts +1 -1
- package/dist/cjs/video/props.d.ts +1 -1
- package/dist/cjs/wrap-remotion-context.js +17 -7
- package/dist/esm/index.mjs +50 -28
- package/dist/esm/no-react.mjs +2 -4
- package/dist/esm/version.mjs +1 -1
- package/package.json +2 -2
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
36
|
exports.CompositionManagerProvider = exports.compositionsRef = void 0;
|
|
27
37
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { SyntheticEvent } from 'react';
|
|
1
2
|
import React from 'react';
|
|
2
3
|
type Props = Record<string, Record<string, unknown>>;
|
|
3
4
|
export type EditorPropsContextType = {
|
|
@@ -17,6 +18,9 @@ export declare const editorPropsProviderRef: React.RefObject<{
|
|
|
17
18
|
export declare const timeValueRef: React.RefObject<{
|
|
18
19
|
goToFrame: () => void;
|
|
19
20
|
seek: (newFrame: number) => void;
|
|
21
|
+
play: (e?: SyntheticEvent | PointerEvent) => void;
|
|
22
|
+
pause: () => void;
|
|
23
|
+
toggle: (e?: SyntheticEvent | PointerEvent) => void;
|
|
20
24
|
} | null>;
|
|
21
25
|
export declare const EditorPropsProvider: React.FC<{
|
|
22
26
|
readonly children: React.ReactNode;
|
package/dist/cjs/EditorProps.js
CHANGED
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
36
|
exports.EditorPropsProvider = exports.timeValueRef = exports.editorPropsProviderRef = exports.EditorPropsContext = void 0;
|
|
27
37
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
package/dist/cjs/Sequence.js
CHANGED
|
@@ -51,8 +51,9 @@ const RegularSequenceRefForwardingFunction = ({ from = 0, durationInFrames = Inf
|
|
|
51
51
|
const { registerSequence, unregisterSequence } = (0, react_1.useContext)(SequenceManager_js_1.SequenceManager);
|
|
52
52
|
const { hidden } = (0, react_1.useContext)(SequenceManager_js_1.SequenceVisibilityToggleContext);
|
|
53
53
|
const premounting = (0, react_1.useMemo)(() => {
|
|
54
|
-
|
|
55
|
-
return ((
|
|
54
|
+
// || is intentional, ?? would not trigger on `false`
|
|
55
|
+
return ((parentSequence === null || parentSequence === void 0 ? void 0 : parentSequence.premounting) ||
|
|
56
|
+
Boolean(other._remotionInternalIsPremounting));
|
|
56
57
|
}, [other._remotionInternalIsPremounting, parentSequence === null || parentSequence === void 0 ? void 0 : parentSequence.premounting]);
|
|
57
58
|
const contextValue = (0, react_1.useMemo)(() => {
|
|
58
59
|
var _a, _b, _c;
|
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
36
|
exports.SequenceManagerProvider = exports.SequenceVisibilityToggleContext = exports.SequenceManager = void 0;
|
|
27
37
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
36
|
exports.Canvas = void 0;
|
|
27
37
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
36
|
exports.useSharedAudio = exports.SharedAudioContextProvider = exports.SharedAudioContext = void 0;
|
|
27
37
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
package/dist/cjs/buffering.js
CHANGED
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
36
|
exports.useIsPlayerBuffering = exports.BufferingProvider = exports.BufferingContextReact = void 0;
|
|
27
37
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
package/dist/cjs/internals.d.ts
CHANGED
|
@@ -19,7 +19,7 @@ export declare const Internals: {
|
|
|
19
19
|
readonly SequenceManager: import("react").Context<import("./SequenceManager.js").SequenceManagerContext>;
|
|
20
20
|
readonly SequenceVisibilityToggleContext: import("react").Context<import("./SequenceManager.js").SequenceVisibilityToggleState>;
|
|
21
21
|
readonly RemotionRoot: import("react").FC<{
|
|
22
|
-
readonly children:
|
|
22
|
+
readonly children: React.ReactNode;
|
|
23
23
|
readonly numberOfAudioTags: number;
|
|
24
24
|
readonly logLevel: import("./log.js").LogLevel;
|
|
25
25
|
readonly onlyRenderComposition: string | null;
|
|
@@ -51,7 +51,7 @@ export declare const Internals: {
|
|
|
51
51
|
registerAudio: (aud: import("./index.js").RemotionAudioProps, audioId: string) => {
|
|
52
52
|
id: number;
|
|
53
53
|
props: import("./index.js").RemotionAudioProps;
|
|
54
|
-
el:
|
|
54
|
+
el: React.RefObject<HTMLAudioElement | null>;
|
|
55
55
|
audioId: string;
|
|
56
56
|
};
|
|
57
57
|
unregisterAudio: (id: number) => void;
|
|
@@ -65,7 +65,7 @@ export declare const Internals: {
|
|
|
65
65
|
} | null>;
|
|
66
66
|
readonly SharedAudioContextProvider: import("react").FC<{
|
|
67
67
|
readonly numberOfAudioTags: number;
|
|
68
|
-
readonly children:
|
|
68
|
+
readonly children: React.ReactNode;
|
|
69
69
|
readonly component: import("react").LazyExoticComponent<import("react").ComponentType<Record<string, unknown>>> | null;
|
|
70
70
|
}>;
|
|
71
71
|
readonly invalidCompositionErrorMessage: string;
|
|
@@ -75,23 +75,23 @@ export declare const Internals: {
|
|
|
75
75
|
getCompositions: () => import("./CompositionManager.js").AnyComposition[];
|
|
76
76
|
} | null>;
|
|
77
77
|
readonly portalNode: () => HTMLElement;
|
|
78
|
-
readonly waitForRoot: (fn: (comp:
|
|
78
|
+
readonly waitForRoot: (fn: (comp: React.FC) => void) => (() => void);
|
|
79
79
|
readonly CanUseRemotionHooksProvider: import("react").FC<{
|
|
80
|
-
readonly children:
|
|
80
|
+
readonly children: React.ReactNode;
|
|
81
81
|
}>;
|
|
82
82
|
readonly CanUseRemotionHooks: import("react").Context<boolean>;
|
|
83
83
|
readonly PrefetchProvider: import("react").FC<{
|
|
84
|
-
readonly children:
|
|
84
|
+
readonly children: React.ReactNode;
|
|
85
85
|
}>;
|
|
86
86
|
readonly DurationsContextProvider: import("react").FC<{
|
|
87
|
-
readonly children:
|
|
87
|
+
readonly children: React.ReactNode;
|
|
88
88
|
}>;
|
|
89
89
|
readonly IsPlayerContextProvider: import("react").FC<{
|
|
90
90
|
children?: import("react").ReactNode | undefined;
|
|
91
91
|
}>;
|
|
92
92
|
readonly useIsPlayer: () => boolean;
|
|
93
93
|
readonly EditorPropsProvider: import("react").FC<{
|
|
94
|
-
readonly children:
|
|
94
|
+
readonly children: React.ReactNode;
|
|
95
95
|
}>;
|
|
96
96
|
readonly EditorPropsContext: import("react").Context<import("./EditorProps.js").EditorPropsContextType>;
|
|
97
97
|
readonly usePreload: (src: string) => string;
|
|
@@ -137,7 +137,7 @@ export declare const Internals: {
|
|
|
137
137
|
readonly addSequenceStackTraces: (component: unknown) => void;
|
|
138
138
|
readonly useMediaStartsAt: () => number;
|
|
139
139
|
readonly BufferingProvider: import("react").FC<{
|
|
140
|
-
readonly children:
|
|
140
|
+
readonly children: React.ReactNode;
|
|
141
141
|
}>;
|
|
142
142
|
readonly BufferingContextReact: import("react").Context<{
|
|
143
143
|
addBlock: (block: {
|
|
@@ -151,7 +151,7 @@ export declare const Internals: {
|
|
|
151
151
|
listenForResume: (callback: () => void) => {
|
|
152
152
|
remove: () => void;
|
|
153
153
|
};
|
|
154
|
-
buffering:
|
|
154
|
+
buffering: React.MutableRefObject<boolean>;
|
|
155
155
|
} | null>;
|
|
156
156
|
readonly enableSequenceStackTraces: () => void;
|
|
157
157
|
readonly CurrentScaleContext: import("react").Context<import("./use-current-scale.js").CurrentScaleContextType | null>;
|
|
@@ -169,18 +169,18 @@ export declare const Internals: {
|
|
|
169
169
|
getProps: () => {
|
|
170
170
|
[x: string]: Record<string, unknown>;
|
|
171
171
|
};
|
|
172
|
-
setProps:
|
|
172
|
+
setProps: React.Dispatch<React.SetStateAction<{
|
|
173
173
|
[x: string]: Record<string, unknown>;
|
|
174
174
|
}>>;
|
|
175
175
|
} | null>;
|
|
176
176
|
readonly PROPS_UPDATED_EXTERNALLY: "remotion.propsUpdatedExternally";
|
|
177
177
|
readonly validateRenderAsset: (artifact: TRenderAsset) => void;
|
|
178
178
|
readonly Log: {
|
|
179
|
-
trace: (logLevel: import("./log.js").LogLevel, ...
|
|
180
|
-
verbose: (logLevel: import("./log.js").LogLevel, ...
|
|
181
|
-
info: (logLevel: import("./log.js").LogLevel, ...
|
|
182
|
-
warn: (logLevel: import("./log.js").LogLevel, ...
|
|
183
|
-
error: (...
|
|
179
|
+
trace: (logLevel: import("./log.js").LogLevel, message?: any, ...optionalParams: any[]) => void;
|
|
180
|
+
verbose: (logLevel: import("./log.js").LogLevel, message?: any, ...optionalParams: any[]) => void;
|
|
181
|
+
info: (logLevel: import("./log.js").LogLevel, message?: any, ...optionalParams: any[]) => void;
|
|
182
|
+
warn: (logLevel: import("./log.js").LogLevel, message?: any, ...optionalParams: any[]) => void;
|
|
183
|
+
error: (message?: any, ...optionalParams: any[]) => void;
|
|
184
184
|
};
|
|
185
185
|
readonly LogLevelContext: import("react").Context<LoggingContextValue>;
|
|
186
186
|
readonly useLogLevel: () => import("./log.js").LogLevel;
|
|
@@ -193,6 +193,14 @@ export declare const Internals: {
|
|
|
193
193
|
readonly timeValueRef: import("react").RefObject<{
|
|
194
194
|
goToFrame: () => void;
|
|
195
195
|
seek: (newFrame: number) => void;
|
|
196
|
+
play: (e?: import("react").SyntheticEvent | PointerEvent) => void;
|
|
197
|
+
pause: () => void;
|
|
198
|
+
toggle: (e?: import("react").SyntheticEvent | PointerEvent) => void;
|
|
199
|
+
} | null>;
|
|
200
|
+
readonly compositionSelectorRef: import("react").RefObject<{
|
|
201
|
+
expandComposition: (compName: string) => void;
|
|
202
|
+
selectComposition: (compName: string) => void;
|
|
203
|
+
toggleFolder: (folderName: string, parentName: string | null) => void;
|
|
196
204
|
} | null>;
|
|
197
205
|
};
|
|
198
206
|
export type { CompositionManagerContext, CompProps, LoggingContextValue, MediaVolumeContextValue, RemotionEnvironment, SerializedJSONWithCustomFields, SetMediaVolumeContextValue, SetTimelineContextValue, TCompMetadata, TComposition, TimelineContextValue, TRenderAsset, TSequence, WatchRemotionStaticFilesPayload, };
|
package/dist/cjs/internals.js
CHANGED
|
@@ -15,15 +15,26 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
36
|
exports.Internals = void 0;
|
|
37
|
+
const react_1 = require("react");
|
|
27
38
|
const shared_audio_tags_js_1 = require("./audio/shared-audio-tags.js");
|
|
28
39
|
const use_audio_frame_js_1 = require("./audio/use-audio-frame.js");
|
|
29
40
|
const buffering_js_1 = require("./buffering.js");
|
|
@@ -65,6 +76,8 @@ const video_fragment_js_1 = require("./video/video-fragment.js");
|
|
|
65
76
|
const volume_position_state_js_1 = require("./volume-position-state.js");
|
|
66
77
|
const watch_static_file_js_1 = require("./watch-static-file.js");
|
|
67
78
|
const wrap_remotion_context_js_1 = require("./wrap-remotion-context.js");
|
|
79
|
+
// needs to be in core package so gets deduplicated in studio
|
|
80
|
+
const compositionSelectorRef = (0, react_1.createRef)();
|
|
68
81
|
// Mark them as Internals so use don't assume this is public
|
|
69
82
|
// API and are less likely to use it
|
|
70
83
|
exports.Internals = {
|
|
@@ -133,4 +146,5 @@ exports.Internals = {
|
|
|
133
146
|
useLogLevel: log_level_context_js_1.useLogLevel,
|
|
134
147
|
playbackLogging: playback_logging_js_1.playbackLogging,
|
|
135
148
|
timeValueRef: EditorProps_js_1.timeValueRef,
|
|
149
|
+
compositionSelectorRef,
|
|
136
150
|
};
|
package/dist/cjs/log.d.ts
CHANGED
|
@@ -2,9 +2,9 @@ export declare const logLevels: readonly ["trace", "verbose", "info", "warn", "e
|
|
|
2
2
|
export type LogLevel = (typeof logLevels)[number];
|
|
3
3
|
export declare const isEqualOrBelowLogLevel: (currentLevel: LogLevel, level: LogLevel) => boolean;
|
|
4
4
|
export declare const Log: {
|
|
5
|
-
trace: (logLevel: LogLevel, ...
|
|
6
|
-
verbose: (logLevel: LogLevel, ...
|
|
7
|
-
info: (logLevel: LogLevel, ...
|
|
8
|
-
warn: (logLevel: LogLevel, ...
|
|
9
|
-
error: (...
|
|
5
|
+
trace: (logLevel: LogLevel, message?: any, ...optionalParams: any[]) => void;
|
|
6
|
+
verbose: (logLevel: LogLevel, message?: any, ...optionalParams: any[]) => void;
|
|
7
|
+
info: (logLevel: LogLevel, message?: any, ...optionalParams: any[]) => void;
|
|
8
|
+
warn: (logLevel: LogLevel, message?: any, ...optionalParams: any[]) => void;
|
|
9
|
+
error: (message?: any, ...optionalParams: any[]) => void;
|
|
10
10
|
};
|
package/dist/cjs/loop/index.js
CHANGED
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
36
|
exports.Loop = void 0;
|
|
27
37
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
package/dist/cjs/prefetch.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import type { LogLevel } from './log.js';
|
|
2
|
+
export declare const removeAndGetHashFragment: (src: string) => number | null;
|
|
3
|
+
export declare const getSrcWithoutHash: (src: string) => string;
|
|
2
4
|
export declare const usePreload: (src: string) => string;
|
|
3
5
|
type FetchAndPreload = {
|
|
4
6
|
free: () => void;
|
package/dist/cjs/prefetch.js
CHANGED
|
@@ -1,15 +1,38 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.prefetch = exports.usePreload = void 0;
|
|
3
|
+
exports.prefetch = exports.usePreload = exports.getSrcWithoutHash = exports.removeAndGetHashFragment = void 0;
|
|
4
4
|
const react_1 = require("react");
|
|
5
5
|
const get_remotion_environment_js_1 = require("./get-remotion-environment.js");
|
|
6
6
|
const log_js_1 = require("./log.js");
|
|
7
7
|
const playback_logging_js_1 = require("./playback-logging.js");
|
|
8
8
|
const prefetch_state_js_1 = require("./prefetch-state.js");
|
|
9
|
+
const removeAndGetHashFragment = (src) => {
|
|
10
|
+
const hashIndex = src.indexOf('#');
|
|
11
|
+
if (hashIndex === -1) {
|
|
12
|
+
return null;
|
|
13
|
+
}
|
|
14
|
+
return hashIndex;
|
|
15
|
+
};
|
|
16
|
+
exports.removeAndGetHashFragment = removeAndGetHashFragment;
|
|
17
|
+
const getSrcWithoutHash = (src) => {
|
|
18
|
+
const hashIndex = (0, exports.removeAndGetHashFragment)(src);
|
|
19
|
+
if (hashIndex === null) {
|
|
20
|
+
return src;
|
|
21
|
+
}
|
|
22
|
+
return src.slice(0, hashIndex);
|
|
23
|
+
};
|
|
24
|
+
exports.getSrcWithoutHash = getSrcWithoutHash;
|
|
9
25
|
const usePreload = (src) => {
|
|
10
|
-
var _a;
|
|
11
26
|
const preloads = (0, react_1.useContext)(prefetch_state_js_1.PreloadContext);
|
|
12
|
-
|
|
27
|
+
const hashFragmentIndex = (0, exports.removeAndGetHashFragment)(src);
|
|
28
|
+
const withoutHashFragment = (0, exports.getSrcWithoutHash)(src);
|
|
29
|
+
if (!preloads[withoutHashFragment]) {
|
|
30
|
+
return src;
|
|
31
|
+
}
|
|
32
|
+
if (hashFragmentIndex !== null) {
|
|
33
|
+
return preloads[withoutHashFragment] + src.slice(hashFragmentIndex);
|
|
34
|
+
}
|
|
35
|
+
return preloads[withoutHashFragment];
|
|
13
36
|
};
|
|
14
37
|
exports.usePreload = usePreload;
|
|
15
38
|
const blobToBase64 = function (blob) {
|
|
@@ -57,13 +80,14 @@ const prefetch = (src, options) => {
|
|
|
57
80
|
var _a, _b, _c;
|
|
58
81
|
const method = (_a = options === null || options === void 0 ? void 0 : options.method) !== null && _a !== void 0 ? _a : 'blob-url';
|
|
59
82
|
const logLevel = (_b = options === null || options === void 0 ? void 0 : options.logLevel) !== null && _b !== void 0 ? _b : 'info';
|
|
83
|
+
const srcWithoutHash = (0, exports.getSrcWithoutHash)(src);
|
|
60
84
|
if ((0, get_remotion_environment_js_1.getRemotionEnvironment)().isRendering) {
|
|
61
85
|
return {
|
|
62
86
|
free: () => undefined,
|
|
63
|
-
waitUntilDone: () => Promise.resolve(
|
|
87
|
+
waitUntilDone: () => Promise.resolve(srcWithoutHash),
|
|
64
88
|
};
|
|
65
89
|
}
|
|
66
|
-
log_js_1.Log.verbose(logLevel, `[prefetch] Starting prefetch ${
|
|
90
|
+
log_js_1.Log.verbose(logLevel, `[prefetch] Starting prefetch ${srcWithoutHash}`);
|
|
67
91
|
let canceled = false;
|
|
68
92
|
let objectUrl = null;
|
|
69
93
|
let resolve = () => undefined;
|
|
@@ -74,7 +98,7 @@ const prefetch = (src, options) => {
|
|
|
74
98
|
});
|
|
75
99
|
const controller = new AbortController();
|
|
76
100
|
let canBeAborted = true;
|
|
77
|
-
fetch(
|
|
101
|
+
fetch(srcWithoutHash, {
|
|
78
102
|
signal: controller.signal,
|
|
79
103
|
credentials: (_c = options === null || options === void 0 ? void 0 : options.credentials) !== null && _c !== void 0 ? _c : undefined,
|
|
80
104
|
})
|
|
@@ -95,10 +119,10 @@ const prefetch = (src, options) => {
|
|
|
95
119
|
contentType.startsWith('image/'));
|
|
96
120
|
if (!hasProperContentType) {
|
|
97
121
|
// eslint-disable-next-line no-console
|
|
98
|
-
console.warn(`Called prefetch() on ${
|
|
122
|
+
console.warn(`Called prefetch() on ${srcWithoutHash} which returned a "Content-Type" of ${headerContentType}. Prefetched content should have a proper content type (video/... or audio/...) or a contentType passed the options of prefetch(). Otherwise, prefetching will not work properly in all browsers.`);
|
|
99
123
|
}
|
|
100
124
|
if (!res.body) {
|
|
101
|
-
throw new Error(`HTTP response of ${
|
|
125
|
+
throw new Error(`HTTP response of ${srcWithoutHash} has no body`);
|
|
102
126
|
}
|
|
103
127
|
const reader = res.body.getReader();
|
|
104
128
|
return getBlobFromReader({
|
|
@@ -129,13 +153,13 @@ const prefetch = (src, options) => {
|
|
|
129
153
|
(0, playback_logging_js_1.playbackLogging)({
|
|
130
154
|
logLevel,
|
|
131
155
|
tag: 'prefetch',
|
|
132
|
-
message: `Finished prefetch ${
|
|
156
|
+
message: `Finished prefetch ${srcWithoutHash} with method ${method}`,
|
|
133
157
|
mountTime: null,
|
|
134
158
|
});
|
|
135
159
|
objectUrl = url;
|
|
136
160
|
(0, prefetch_state_js_1.setPreloads)((p) => ({
|
|
137
161
|
...p,
|
|
138
|
-
[
|
|
162
|
+
[srcWithoutHash]: objectUrl,
|
|
139
163
|
}));
|
|
140
164
|
resolve(objectUrl);
|
|
141
165
|
})
|
|
@@ -150,7 +174,7 @@ const prefetch = (src, options) => {
|
|
|
150
174
|
(0, playback_logging_js_1.playbackLogging)({
|
|
151
175
|
logLevel,
|
|
152
176
|
tag: 'prefetch',
|
|
153
|
-
message: `Freeing ${
|
|
177
|
+
message: `Freeing ${srcWithoutHash}`,
|
|
154
178
|
mountTime: null,
|
|
155
179
|
});
|
|
156
180
|
if (objectUrl) {
|
|
@@ -159,7 +183,7 @@ const prefetch = (src, options) => {
|
|
|
159
183
|
}
|
|
160
184
|
(0, prefetch_state_js_1.setPreloads)((p) => {
|
|
161
185
|
const copy = { ...p };
|
|
162
|
-
delete copy[
|
|
186
|
+
delete copy[srcWithoutHash];
|
|
163
187
|
return copy;
|
|
164
188
|
});
|
|
165
189
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
+
const ForwardOffthread = () => {
|
|
5
|
+
return ((0, jsx_runtime_1.jsx)(OffthreadVideo, { src: "https://assets.remotion.dev/sample-video.mp4", startFrom: 0, endAt: 100 }));
|
|
6
|
+
};
|
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
36
|
exports.useRequireToBeInsideSeries = exports.IsNotInsideSeriesProvider = exports.IsInsideSeriesContainer = exports.IsInsideSeriesContext = void 0;
|
|
27
37
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
36
|
exports.useCurrentScale = exports.calculateScale = exports.PreviewSizeContext = exports.CurrentScaleContext = void 0;
|
|
27
37
|
const react_1 = __importStar(require("react"));
|
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
36
|
exports.useLazyComponent = void 0;
|
|
27
37
|
const react_1 = __importStar(require("react"));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { RemotionAudioProps } from './audio/index.js';
|
|
2
2
|
import type { RemotionVideoProps } from './video/index.js';
|
|
3
|
-
import type {
|
|
4
|
-
export declare const validateMediaProps: (props: RemotionVideoProps | RemotionAudioProps |
|
|
3
|
+
import type { RemotionOffthreadVideoProps } from './video/props.js';
|
|
4
|
+
export declare const validateMediaProps: (props: RemotionVideoProps | RemotionAudioProps | RemotionOffthreadVideoProps, component: "Video" | "Audio") => void;
|
package/dist/cjs/version.d.ts
CHANGED
package/dist/cjs/version.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type {
|
|
3
|
-
export declare const OffthreadVideo: React.FC<
|
|
2
|
+
import type { RemotionOffthreadVideoProps } from './props.js';
|
|
3
|
+
export declare const OffthreadVideo: React.FC<RemotionOffthreadVideoProps>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type {
|
|
3
|
-
export declare const OffthreadVideoForRendering: React.FC<
|
|
2
|
+
import type { RemotionOffthreadVideoProps } from './props.js';
|
|
3
|
+
export declare const OffthreadVideoForRendering: React.FC<RemotionOffthreadVideoProps>;
|
|
@@ -84,8 +84,9 @@ const VideoForDevelopmentRefForwardingFunction = (props, ref) => {
|
|
|
84
84
|
const duration = parentSequence
|
|
85
85
|
? Math.min(parentSequence.durationInFrames, durationInFrames)
|
|
86
86
|
: durationInFrames;
|
|
87
|
+
const preloadedSrc = (0, prefetch_js_1.usePreload)(src);
|
|
87
88
|
const actualSrc = (0, video_fragment_js_1.useAppendVideoFragment)({
|
|
88
|
-
actualSrc:
|
|
89
|
+
actualSrc: preloadedSrc,
|
|
89
90
|
actualFrom,
|
|
90
91
|
duration,
|
|
91
92
|
fps,
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { OffthreadVideo } from './OffthreadVideo.js';
|
|
2
|
-
export type {
|
|
2
|
+
export type { RemotionOffthreadVideoProps as OffthreadVideoProps, RemotionMainVideoProps, RemotionOffthreadVideoProps, RemotionVideoProps, } from './props';
|
|
3
3
|
export { Video } from './Video.js';
|
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
36
|
exports.RemotionContextProvider = void 0;
|
|
27
37
|
exports.useRemotionContexts = useRemotionContexts;
|
package/dist/esm/index.mjs
CHANGED
|
@@ -104,7 +104,7 @@ function truthy(value) {
|
|
|
104
104
|
}
|
|
105
105
|
|
|
106
106
|
// src/version.ts
|
|
107
|
-
var VERSION = "4.0.
|
|
107
|
+
var VERSION = "4.0.287";
|
|
108
108
|
|
|
109
109
|
// src/multiple-versions-warning.ts
|
|
110
110
|
var checkMultipleRemotionVersions = () => {
|
|
@@ -1287,7 +1287,7 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
1287
1287
|
const { registerSequence, unregisterSequence } = useContext10(SequenceManager);
|
|
1288
1288
|
const { hidden } = useContext10(SequenceVisibilityToggleContext);
|
|
1289
1289
|
const premounting = useMemo9(() => {
|
|
1290
|
-
return parentSequence?.premounting
|
|
1290
|
+
return parentSequence?.premounting || Boolean(other._remotionInternalIsPremounting);
|
|
1291
1291
|
}, [other._remotionInternalIsPremounting, parentSequence?.premounting]);
|
|
1292
1292
|
const contextValue = useMemo9(() => {
|
|
1293
1293
|
return {
|
|
@@ -2195,9 +2195,31 @@ var PrefetchProvider = ({ children }) => {
|
|
|
2195
2195
|
};
|
|
2196
2196
|
|
|
2197
2197
|
// src/prefetch.ts
|
|
2198
|
+
var removeAndGetHashFragment = (src) => {
|
|
2199
|
+
const hashIndex = src.indexOf("#");
|
|
2200
|
+
if (hashIndex === -1) {
|
|
2201
|
+
return null;
|
|
2202
|
+
}
|
|
2203
|
+
return hashIndex;
|
|
2204
|
+
};
|
|
2205
|
+
var getSrcWithoutHash = (src) => {
|
|
2206
|
+
const hashIndex = removeAndGetHashFragment(src);
|
|
2207
|
+
if (hashIndex === null) {
|
|
2208
|
+
return src;
|
|
2209
|
+
}
|
|
2210
|
+
return src.slice(0, hashIndex);
|
|
2211
|
+
};
|
|
2198
2212
|
var usePreload = (src) => {
|
|
2199
2213
|
const preloads2 = useContext12(PreloadContext);
|
|
2200
|
-
|
|
2214
|
+
const hashFragmentIndex = removeAndGetHashFragment(src);
|
|
2215
|
+
const withoutHashFragment = getSrcWithoutHash(src);
|
|
2216
|
+
if (!preloads2[withoutHashFragment]) {
|
|
2217
|
+
return src;
|
|
2218
|
+
}
|
|
2219
|
+
if (hashFragmentIndex !== null) {
|
|
2220
|
+
return preloads2[withoutHashFragment] + src.slice(hashFragmentIndex);
|
|
2221
|
+
}
|
|
2222
|
+
return preloads2[withoutHashFragment];
|
|
2201
2223
|
};
|
|
2202
2224
|
var blobToBase64 = function(blob) {
|
|
2203
2225
|
const reader = new FileReader;
|
|
@@ -2244,15 +2266,16 @@ var getBlobFromReader = async ({
|
|
|
2244
2266
|
var prefetch = (src, options) => {
|
|
2245
2267
|
const method = options?.method ?? "blob-url";
|
|
2246
2268
|
const logLevel = options?.logLevel ?? "info";
|
|
2269
|
+
const srcWithoutHash = getSrcWithoutHash(src);
|
|
2247
2270
|
if (getRemotionEnvironment().isRendering) {
|
|
2248
2271
|
return {
|
|
2249
2272
|
free: () => {
|
|
2250
2273
|
return;
|
|
2251
2274
|
},
|
|
2252
|
-
waitUntilDone: () => Promise.resolve(
|
|
2275
|
+
waitUntilDone: () => Promise.resolve(srcWithoutHash)
|
|
2253
2276
|
};
|
|
2254
2277
|
}
|
|
2255
|
-
Log.verbose(logLevel, `[prefetch] Starting prefetch ${
|
|
2278
|
+
Log.verbose(logLevel, `[prefetch] Starting prefetch ${srcWithoutHash}`);
|
|
2256
2279
|
let canceled = false;
|
|
2257
2280
|
let objectUrl = null;
|
|
2258
2281
|
let resolve = () => {
|
|
@@ -2267,7 +2290,7 @@ var prefetch = (src, options) => {
|
|
|
2267
2290
|
});
|
|
2268
2291
|
const controller = new AbortController;
|
|
2269
2292
|
let canBeAborted = true;
|
|
2270
|
-
fetch(
|
|
2293
|
+
fetch(srcWithoutHash, {
|
|
2271
2294
|
signal: controller.signal,
|
|
2272
2295
|
credentials: options?.credentials ?? undefined
|
|
2273
2296
|
}).then((res) => {
|
|
@@ -2282,10 +2305,10 @@ var prefetch = (src, options) => {
|
|
|
2282
2305
|
const contentType = options?.contentType ?? headerContentType;
|
|
2283
2306
|
const hasProperContentType = contentType && (contentType.startsWith("video/") || contentType.startsWith("audio/") || contentType.startsWith("image/"));
|
|
2284
2307
|
if (!hasProperContentType) {
|
|
2285
|
-
console.warn(`Called prefetch() on ${
|
|
2308
|
+
console.warn(`Called prefetch() on ${srcWithoutHash} which returned a "Content-Type" of ${headerContentType}. Prefetched content should have a proper content type (video/... or audio/...) or a contentType passed the options of prefetch(). Otherwise, prefetching will not work properly in all browsers.`);
|
|
2286
2309
|
}
|
|
2287
2310
|
if (!res.body) {
|
|
2288
|
-
throw new Error(`HTTP response of ${
|
|
2311
|
+
throw new Error(`HTTP response of ${srcWithoutHash} has no body`);
|
|
2289
2312
|
}
|
|
2290
2313
|
const reader = res.body.getReader();
|
|
2291
2314
|
return getBlobFromReader({
|
|
@@ -2310,13 +2333,13 @@ var prefetch = (src, options) => {
|
|
|
2310
2333
|
playbackLogging({
|
|
2311
2334
|
logLevel,
|
|
2312
2335
|
tag: "prefetch",
|
|
2313
|
-
message: `Finished prefetch ${
|
|
2336
|
+
message: `Finished prefetch ${srcWithoutHash} with method ${method}`,
|
|
2314
2337
|
mountTime: null
|
|
2315
2338
|
});
|
|
2316
2339
|
objectUrl = url;
|
|
2317
2340
|
setPreloads((p) => ({
|
|
2318
2341
|
...p,
|
|
2319
|
-
[
|
|
2342
|
+
[srcWithoutHash]: objectUrl
|
|
2320
2343
|
}));
|
|
2321
2344
|
resolve(objectUrl);
|
|
2322
2345
|
}).catch((err) => {
|
|
@@ -2330,7 +2353,7 @@ var prefetch = (src, options) => {
|
|
|
2330
2353
|
playbackLogging({
|
|
2331
2354
|
logLevel,
|
|
2332
2355
|
tag: "prefetch",
|
|
2333
|
-
message: `Freeing ${
|
|
2356
|
+
message: `Freeing ${srcWithoutHash}`,
|
|
2334
2357
|
mountTime: null
|
|
2335
2358
|
});
|
|
2336
2359
|
if (objectUrl) {
|
|
@@ -2339,7 +2362,7 @@ var prefetch = (src, options) => {
|
|
|
2339
2362
|
}
|
|
2340
2363
|
setPreloads((p) => {
|
|
2341
2364
|
const copy = { ...p };
|
|
2342
|
-
delete copy[
|
|
2365
|
+
delete copy[srcWithoutHash];
|
|
2343
2366
|
return copy;
|
|
2344
2367
|
});
|
|
2345
2368
|
} else {
|
|
@@ -2347,8 +2370,7 @@ var prefetch = (src, options) => {
|
|
|
2347
2370
|
if (canBeAborted) {
|
|
2348
2371
|
try {
|
|
2349
2372
|
controller.abort(new Error("free() called"));
|
|
2350
|
-
} catch {
|
|
2351
|
-
}
|
|
2373
|
+
} catch {}
|
|
2352
2374
|
}
|
|
2353
2375
|
}
|
|
2354
2376
|
},
|
|
@@ -3371,8 +3393,7 @@ function interpolateFunction(input, inputRange, outputRange, options) {
|
|
|
3371
3393
|
} else if (extrapolateLeft === "wrap") {
|
|
3372
3394
|
const range = inputMax - inputMin;
|
|
3373
3395
|
result = ((result - inputMin) % range + range) % range + inputMin;
|
|
3374
|
-
} else if (extrapolateLeft === "extend") {
|
|
3375
|
-
}
|
|
3396
|
+
} else if (extrapolateLeft === "extend") {}
|
|
3376
3397
|
}
|
|
3377
3398
|
if (result > inputMax) {
|
|
3378
3399
|
if (extrapolateRight === "identity") {
|
|
@@ -3383,8 +3404,7 @@ function interpolateFunction(input, inputRange, outputRange, options) {
|
|
|
3383
3404
|
} else if (extrapolateRight === "wrap") {
|
|
3384
3405
|
const range = inputMax - inputMin;
|
|
3385
3406
|
result = ((result - inputMin) % range + range) % range + inputMin;
|
|
3386
|
-
} else if (extrapolateRight === "extend") {
|
|
3387
|
-
}
|
|
3407
|
+
} else if (extrapolateRight === "extend") {}
|
|
3388
3408
|
}
|
|
3389
3409
|
if (outputMin === outputMax) {
|
|
3390
3410
|
return outputMin;
|
|
@@ -5109,6 +5129,9 @@ var ImgRefForwarding = ({
|
|
|
5109
5129
|
});
|
|
5110
5130
|
};
|
|
5111
5131
|
var Img = forwardRef8(ImgRefForwarding);
|
|
5132
|
+
// src/internals.ts
|
|
5133
|
+
import { createRef as createRef3 } from "react";
|
|
5134
|
+
|
|
5112
5135
|
// src/CompositionManager.tsx
|
|
5113
5136
|
import React22, {
|
|
5114
5137
|
useCallback as useCallback14,
|
|
@@ -5443,8 +5466,7 @@ var getEnvVariables = () => {
|
|
|
5443
5466
|
}
|
|
5444
5467
|
return { ...JSON.parse(param), NODE_ENV: "production" };
|
|
5445
5468
|
}
|
|
5446
|
-
if (false) {
|
|
5447
|
-
}
|
|
5469
|
+
if (false) {}
|
|
5448
5470
|
return {
|
|
5449
5471
|
NODE_ENV: "production"
|
|
5450
5472
|
};
|
|
@@ -5635,6 +5657,7 @@ var RemotionContextProvider = (props2) => {
|
|
|
5635
5657
|
};
|
|
5636
5658
|
|
|
5637
5659
|
// src/internals.ts
|
|
5660
|
+
var compositionSelectorRef = createRef3();
|
|
5638
5661
|
var Internals = {
|
|
5639
5662
|
useUnsafeVideoConfig,
|
|
5640
5663
|
Timeline: exports_timeline_position_state,
|
|
@@ -5700,7 +5723,8 @@ var Internals = {
|
|
|
5700
5723
|
LogLevelContext,
|
|
5701
5724
|
useLogLevel,
|
|
5702
5725
|
playbackLogging,
|
|
5703
|
-
timeValueRef
|
|
5726
|
+
timeValueRef,
|
|
5727
|
+
compositionSelectorRef
|
|
5704
5728
|
};
|
|
5705
5729
|
// src/interpolate-colors.ts
|
|
5706
5730
|
var NUMBER = "[-+]?\\d*\\.?\\d+";
|
|
@@ -6865,8 +6889,9 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
|
|
|
6865
6889
|
});
|
|
6866
6890
|
const actualFrom = parentSequence ? parentSequence.relativeFrom : 0;
|
|
6867
6891
|
const duration = parentSequence ? Math.min(parentSequence.durationInFrames, durationInFrames) : durationInFrames;
|
|
6892
|
+
const preloadedSrc = usePreload(src);
|
|
6868
6893
|
const actualSrc = useAppendVideoFragment({
|
|
6869
|
-
actualSrc:
|
|
6894
|
+
actualSrc: preloadedSrc,
|
|
6870
6895
|
actualFrom,
|
|
6871
6896
|
duration,
|
|
6872
6897
|
fps
|
|
@@ -7054,8 +7079,7 @@ var seekToTime = ({
|
|
|
7054
7079
|
if (isApproximatelyTheSame(element.currentTime, desiredTime)) {
|
|
7055
7080
|
return {
|
|
7056
7081
|
wait: Promise.resolve(desiredTime),
|
|
7057
|
-
cancel: () => {
|
|
7058
|
-
}
|
|
7082
|
+
cancel: () => {}
|
|
7059
7083
|
};
|
|
7060
7084
|
}
|
|
7061
7085
|
seek({
|
|
@@ -7112,8 +7136,7 @@ var seekToTimeMultipleUntilRight = ({
|
|
|
7112
7136
|
if (Number.isFinite(element.duration) && element.currentTime >= element.duration && desiredTime >= element.duration) {
|
|
7113
7137
|
return {
|
|
7114
7138
|
prom: Promise.resolve(),
|
|
7115
|
-
cancel: () => {
|
|
7116
|
-
}
|
|
7139
|
+
cancel: () => {}
|
|
7117
7140
|
};
|
|
7118
7141
|
}
|
|
7119
7142
|
const prom = new Promise((resolve, reject) => {
|
|
@@ -7394,8 +7417,7 @@ var VideoForwardingFunction = (props2, ref) => {
|
|
|
7394
7417
|
const onDuration = useCallback17((src, durationInSeconds) => {
|
|
7395
7418
|
setDurations({ type: "got-duration", durationInSeconds, src });
|
|
7396
7419
|
}, [setDurations]);
|
|
7397
|
-
const onVideoFrame = useCallback17(() => {
|
|
7398
|
-
}, []);
|
|
7420
|
+
const onVideoFrame = useCallback17(() => {}, []);
|
|
7399
7421
|
const durationFetched = durations[getAbsoluteSrc(preloadedSrc)] ?? durations[getAbsoluteSrc(props2.src)];
|
|
7400
7422
|
if (loop && durationFetched !== undefined) {
|
|
7401
7423
|
if (!Number.isFinite(durationFetched)) {
|
package/dist/esm/no-react.mjs
CHANGED
|
@@ -13,8 +13,7 @@ function interpolateFunction(input, inputRange, outputRange, options) {
|
|
|
13
13
|
} else if (extrapolateLeft === "wrap") {
|
|
14
14
|
const range = inputMax - inputMin;
|
|
15
15
|
result = ((result - inputMin) % range + range) % range + inputMin;
|
|
16
|
-
} else if (extrapolateLeft === "extend") {
|
|
17
|
-
}
|
|
16
|
+
} else if (extrapolateLeft === "extend") {}
|
|
18
17
|
}
|
|
19
18
|
if (result > inputMax) {
|
|
20
19
|
if (extrapolateRight === "identity") {
|
|
@@ -25,8 +24,7 @@ function interpolateFunction(input, inputRange, outputRange, options) {
|
|
|
25
24
|
} else if (extrapolateRight === "wrap") {
|
|
26
25
|
const range = inputMax - inputMin;
|
|
27
26
|
result = ((result - inputMin) % range + range) % range + inputMin;
|
|
28
|
-
} else if (extrapolateRight === "extend") {
|
|
29
|
-
}
|
|
27
|
+
} else if (extrapolateRight === "extend") {}
|
|
30
28
|
}
|
|
31
29
|
if (outputMin === outputMax) {
|
|
32
30
|
return outputMin;
|
package/dist/esm/version.mjs
CHANGED
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"url": "https://github.com/remotion-dev/remotion/tree/main/packages/core"
|
|
4
4
|
},
|
|
5
5
|
"name": "remotion",
|
|
6
|
-
"version": "4.0.
|
|
6
|
+
"version": "4.0.287",
|
|
7
7
|
"description": "Make videos programmatically",
|
|
8
8
|
"main": "dist/cjs/index.js",
|
|
9
9
|
"types": "dist/cjs/index.d.ts",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"webpack": "5.96.1",
|
|
29
29
|
"zod": "3.22.3",
|
|
30
30
|
"eslint": "9.19.0",
|
|
31
|
-
"@remotion/eslint-config-internal": "4.0.
|
|
31
|
+
"@remotion/eslint-config-internal": "4.0.287"
|
|
32
32
|
},
|
|
33
33
|
"keywords": [
|
|
34
34
|
"remotion",
|