remotion 4.0.351 → 4.0.353
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/audio/use-audio-context.js +1 -1
- package/dist/cjs/default-css.d.ts +1 -1
- package/dist/cjs/default-css.js +5 -4
- package/dist/cjs/delay-render.js +2 -2
- package/dist/cjs/freeze.js +11 -1
- package/dist/cjs/index.d.ts +2 -0
- package/dist/cjs/internals.d.ts +21 -5
- package/dist/cjs/internals.js +2 -0
- package/dist/cjs/log.d.ts +10 -5
- package/dist/cjs/log.js +40 -23
- package/dist/cjs/playback-logging.js +1 -1
- package/dist/cjs/prefetch.js +1 -1
- package/dist/cjs/use-amplification.js +5 -5
- package/dist/cjs/use-media-playback.js +1 -1
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/video/OffthreadVideoForRendering.js +1 -1
- package/dist/esm/index.mjs +82 -49
- package/dist/esm/version.mjs +1 -1
- package/package.json +2 -2
- package/dist/cjs/video/use-audio-channel-index.d.ts +0 -4
- package/dist/cjs/video/use-audio-channel-index.js +0 -13
|
@@ -11,7 +11,7 @@ const warnOnce = (logLevel) => {
|
|
|
11
11
|
warned = true;
|
|
12
12
|
// Don't pullute logs if in SSR
|
|
13
13
|
if (typeof window !== 'undefined') {
|
|
14
|
-
log_1.Log.warn(logLevel, 'AudioContext is not supported in this browser');
|
|
14
|
+
log_1.Log.warn({ logLevel, tag: null }, 'AudioContext is not supported in this browser');
|
|
15
15
|
}
|
|
16
16
|
};
|
|
17
17
|
const useSingletonAudioContext = (logLevel, latencyHint) => {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export declare const injectCSS: (css: string) => void;
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const OBJECTFIT_CONTAIN_CLASS_NAME = "__remotion_objectfitcontain";
|
|
3
3
|
export declare const makeDefaultPreviewCSS: (scope: string | null, backgroundColor: string) => string;
|
package/dist/cjs/default-css.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.makeDefaultPreviewCSS = exports.
|
|
3
|
+
exports.makeDefaultPreviewCSS = exports.OBJECTFIT_CONTAIN_CLASS_NAME = exports.injectCSS = void 0;
|
|
4
4
|
const injected = {};
|
|
5
5
|
const injectCSS = (css) => {
|
|
6
6
|
// Skip in node
|
|
@@ -17,7 +17,8 @@ const injectCSS = (css) => {
|
|
|
17
17
|
injected[css] = true;
|
|
18
18
|
};
|
|
19
19
|
exports.injectCSS = injectCSS;
|
|
20
|
-
|
|
20
|
+
// make object-fit: contain low priority, so it can be overridden by another class name
|
|
21
|
+
exports.OBJECTFIT_CONTAIN_CLASS_NAME = '__remotion_objectfitcontain';
|
|
21
22
|
const makeDefaultPreviewCSS = (scope, backgroundColor) => {
|
|
22
23
|
if (!scope) {
|
|
23
24
|
return `
|
|
@@ -28,7 +29,7 @@ const makeDefaultPreviewCSS = (scope, backgroundColor) => {
|
|
|
28
29
|
margin: 0;
|
|
29
30
|
background-color: ${backgroundColor};
|
|
30
31
|
}
|
|
31
|
-
.${exports.
|
|
32
|
+
.${exports.OBJECTFIT_CONTAIN_CLASS_NAME} {
|
|
32
33
|
object-fit: contain;
|
|
33
34
|
}
|
|
34
35
|
`;
|
|
@@ -41,7 +42,7 @@ const makeDefaultPreviewCSS = (scope, backgroundColor) => {
|
|
|
41
42
|
width: 100%;
|
|
42
43
|
height: 100%;
|
|
43
44
|
}
|
|
44
|
-
${scope} .${exports.
|
|
45
|
+
${scope} .${exports.OBJECTFIT_CONTAIN_CLASS_NAME} {
|
|
45
46
|
object-fit: contain;
|
|
46
47
|
}
|
|
47
48
|
`;
|
package/dist/cjs/delay-render.js
CHANGED
|
@@ -92,13 +92,13 @@ const continueRenderInternal = (handle, environment) => {
|
|
|
92
92
|
const { label, startTime, timeout } = window.remotion_delayRenderTimeouts[handle];
|
|
93
93
|
clearTimeout(timeout);
|
|
94
94
|
const message = [
|
|
95
|
-
label ? `
|
|
95
|
+
label ? `"${label}"` : 'A handle',
|
|
96
96
|
exports.DELAY_RENDER_CLEAR_TOKEN,
|
|
97
97
|
`${Date.now() - startTime}ms`,
|
|
98
98
|
]
|
|
99
99
|
.filter(truthy_js_1.truthy)
|
|
100
100
|
.join(' ');
|
|
101
|
-
log_js_1.Log.verbose(window.remotion_logLevel, message);
|
|
101
|
+
log_js_1.Log.verbose({ logLevel: window.remotion_logLevel, tag: 'delayRender()' }, message);
|
|
102
102
|
delete window.remotion_delayRenderTimeouts[handle];
|
|
103
103
|
}
|
|
104
104
|
return false;
|
package/dist/cjs/freeze.js
CHANGED
|
@@ -53,6 +53,16 @@ const Freeze = ({ frame: frameToFreeze, children, active = true, }) => {
|
|
|
53
53
|
},
|
|
54
54
|
};
|
|
55
55
|
}, [isActive, timelineContext, videoConfig.id, frameToFreeze, relativeFrom]);
|
|
56
|
-
|
|
56
|
+
const newSequenceContext = (0, react_1.useMemo)(() => {
|
|
57
|
+
if (!sequenceContext) {
|
|
58
|
+
return null;
|
|
59
|
+
}
|
|
60
|
+
return {
|
|
61
|
+
...sequenceContext,
|
|
62
|
+
relativeFrom: 0,
|
|
63
|
+
cumulatedFrom: 0,
|
|
64
|
+
};
|
|
65
|
+
}, [sequenceContext]);
|
|
66
|
+
return ((0, jsx_runtime_1.jsx)(timeline_position_state_js_1.TimelineContext.Provider, { value: timelineValue, children: (0, jsx_runtime_1.jsx)(SequenceContext_js_1.SequenceContext.Provider, { value: newSequenceContext, children: children }) }));
|
|
57
67
|
};
|
|
58
68
|
exports.Freeze = Freeze;
|
package/dist/cjs/index.d.ts
CHANGED
|
@@ -48,6 +48,8 @@ declare global {
|
|
|
48
48
|
remotion_inputProps: string;
|
|
49
49
|
remotion_envVariables: string;
|
|
50
50
|
remotion_isMainTab: boolean;
|
|
51
|
+
remotion_mediaCacheSizeInBytes: number | null;
|
|
52
|
+
remotion_initialMemoryAvailable: number | null;
|
|
51
53
|
remotion_collectAssets: () => TRenderAsset[];
|
|
52
54
|
remotion_isPlayer: boolean;
|
|
53
55
|
remotion_isStudio: boolean;
|
package/dist/cjs/internals.d.ts
CHANGED
|
@@ -237,11 +237,26 @@ export declare const Internals: {
|
|
|
237
237
|
readonly PROPS_UPDATED_EXTERNALLY: "remotion.propsUpdatedExternally";
|
|
238
238
|
readonly validateRenderAsset: (artifact: TRenderAsset) => void;
|
|
239
239
|
readonly Log: {
|
|
240
|
-
trace: (
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
240
|
+
trace: (options: {
|
|
241
|
+
logLevel: import("./log.js").LogLevel;
|
|
242
|
+
tag: string | null;
|
|
243
|
+
}, message?: any, ...optionalParams: any[]) => void;
|
|
244
|
+
verbose: (options: {
|
|
245
|
+
logLevel: import("./log.js").LogLevel;
|
|
246
|
+
tag: string | null;
|
|
247
|
+
}, message?: any, ...optionalParams: any[]) => void;
|
|
248
|
+
info: (options: {
|
|
249
|
+
logLevel: import("./log.js").LogLevel;
|
|
250
|
+
tag: string | null;
|
|
251
|
+
}, message?: any, ...optionalParams: any[]) => void;
|
|
252
|
+
warn: (options: {
|
|
253
|
+
logLevel: import("./log.js").LogLevel;
|
|
254
|
+
tag: string | null;
|
|
255
|
+
}, message?: any, ...optionalParams: any[]) => void;
|
|
256
|
+
error: (options: {
|
|
257
|
+
logLevel: import("./log.js").LogLevel;
|
|
258
|
+
tag: string | null;
|
|
259
|
+
}, message?: any, ...optionalParams: any[]) => void;
|
|
245
260
|
};
|
|
246
261
|
readonly LogLevelContext: import("react").Context<LoggingContextValue>;
|
|
247
262
|
readonly useLogLevel: () => import("./log.js").LogLevel;
|
|
@@ -292,5 +307,6 @@ export declare const Internals: {
|
|
|
292
307
|
readonly stack?: string | undefined;
|
|
293
308
|
readonly onNativeError: React.ReactEventHandler<HTMLAudioElement>;
|
|
294
309
|
}, "ref"> & import("react").RefAttributes<HTMLAudioElement>>;
|
|
310
|
+
readonly OBJECTFIT_CONTAIN_CLASS_NAME: "__remotion_objectfitcontain";
|
|
295
311
|
};
|
|
296
312
|
export type { CompositionManagerContext, CompProps, LoggingContextValue, MediaVolumeContextValue, RemotionEnvironment, SerializedJSONWithCustomFields, SetMediaVolumeContextValue, SetTimelineContextValue, TCompMetadata, TComposition, TimelineContextValue, TRenderAsset, TSequence, WatchRemotionStaticFilesPayload, };
|
package/dist/cjs/internals.js
CHANGED
|
@@ -44,6 +44,7 @@ const CanUseRemotionHooks_js_1 = require("./CanUseRemotionHooks.js");
|
|
|
44
44
|
const CompositionManager_js_1 = require("./CompositionManager.js");
|
|
45
45
|
const CompositionManagerContext_js_1 = require("./CompositionManagerContext.js");
|
|
46
46
|
const CSSUtils = __importStar(require("./default-css.js"));
|
|
47
|
+
const default_css_js_1 = require("./default-css.js");
|
|
47
48
|
const EditorProps_js_1 = require("./EditorProps.js");
|
|
48
49
|
const enable_sequence_stack_traces_js_1 = require("./enable-sequence-stack-traces.js");
|
|
49
50
|
const get_preview_dom_element_js_1 = require("./get-preview-dom-element.js");
|
|
@@ -167,4 +168,5 @@ exports.Internals = {
|
|
|
167
168
|
RemotionEnvironmentContext: remotion_environment_context_js_1.RemotionEnvironmentContext,
|
|
168
169
|
warnAboutTooHighVolume: volume_safeguard_js_1.warnAboutTooHighVolume,
|
|
169
170
|
AudioForPreview: AudioForPreview_js_1.AudioForPreview,
|
|
171
|
+
OBJECTFIT_CONTAIN_CLASS_NAME: default_css_js_1.OBJECTFIT_CONTAIN_CLASS_NAME,
|
|
170
172
|
};
|
package/dist/cjs/log.d.ts
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
export declare const logLevels: readonly ["trace", "verbose", "info", "warn", "error"];
|
|
2
2
|
export type LogLevel = (typeof logLevels)[number];
|
|
3
3
|
export declare const isEqualOrBelowLogLevel: (currentLevel: LogLevel, level: LogLevel) => boolean;
|
|
4
|
+
type Options = {
|
|
5
|
+
logLevel: LogLevel;
|
|
6
|
+
tag: string | null;
|
|
7
|
+
};
|
|
4
8
|
export declare const Log: {
|
|
5
|
-
trace: (
|
|
6
|
-
verbose: (
|
|
7
|
-
info: (
|
|
8
|
-
warn: (
|
|
9
|
-
error: (message?: any, ...optionalParams: any[]) => void;
|
|
9
|
+
trace: (options: Options, message?: any, ...optionalParams: any[]) => void;
|
|
10
|
+
verbose: (options: Options, message?: any, ...optionalParams: any[]) => void;
|
|
11
|
+
info: (options: Options, message?: any, ...optionalParams: any[]) => void;
|
|
12
|
+
warn: (options: Options, message?: any, ...optionalParams: any[]) => void;
|
|
13
|
+
error: (options: Options, message?: any, ...optionalParams: any[]) => void;
|
|
10
14
|
};
|
|
15
|
+
export {};
|
package/dist/cjs/log.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Log = exports.isEqualOrBelowLogLevel = exports.logLevels = void 0;
|
|
4
|
+
const get_remotion_environment_1 = require("./get-remotion-environment");
|
|
4
5
|
/* eslint-disable no-console */
|
|
5
6
|
exports.logLevels = ['trace', 'verbose', 'info', 'warn', 'error'];
|
|
6
7
|
const getNumberForLogLevel = (level) => {
|
|
@@ -10,28 +11,44 @@ const isEqualOrBelowLogLevel = (currentLevel, level) => {
|
|
|
10
11
|
return getNumberForLogLevel(currentLevel) <= getNumberForLogLevel(level);
|
|
11
12
|
};
|
|
12
13
|
exports.isEqualOrBelowLogLevel = isEqualOrBelowLogLevel;
|
|
14
|
+
const transformArgs = ({ args, logLevel, tag, }) => {
|
|
15
|
+
const arr = [...args];
|
|
16
|
+
if ((0, get_remotion_environment_1.getRemotionEnvironment)().isRendering &&
|
|
17
|
+
!(0, get_remotion_environment_1.getRemotionEnvironment)().isClientSideRendering) {
|
|
18
|
+
arr.unshift(Symbol.for(`__remotion_level_${logLevel}`));
|
|
19
|
+
}
|
|
20
|
+
if (tag) {
|
|
21
|
+
arr.unshift(Symbol.for(`__remotion_tag_${tag}`));
|
|
22
|
+
}
|
|
23
|
+
return arr;
|
|
24
|
+
};
|
|
25
|
+
const verbose = (options, ...args) => {
|
|
26
|
+
if ((0, exports.isEqualOrBelowLogLevel)(options.logLevel, 'verbose')) {
|
|
27
|
+
return console.debug(...transformArgs({ args, logLevel: 'verbose', tag: options.tag }));
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
const trace = (options, ...args) => {
|
|
31
|
+
if ((0, exports.isEqualOrBelowLogLevel)(options.logLevel, 'trace')) {
|
|
32
|
+
return console.debug(...transformArgs({ args, logLevel: 'trace', tag: options.tag }));
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
const info = (options, ...args) => {
|
|
36
|
+
if ((0, exports.isEqualOrBelowLogLevel)(options.logLevel, 'info')) {
|
|
37
|
+
return console.log(...transformArgs({ args, logLevel: 'info', tag: options.tag }));
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
const warn = (options, ...args) => {
|
|
41
|
+
if ((0, exports.isEqualOrBelowLogLevel)(options.logLevel, 'warn')) {
|
|
42
|
+
return console.warn(...transformArgs({ args, logLevel: 'warn', tag: options.tag }));
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
const error = (options, ...args) => {
|
|
46
|
+
return console.error(...transformArgs({ args, logLevel: 'error', tag: options.tag }));
|
|
47
|
+
};
|
|
13
48
|
exports.Log = {
|
|
14
|
-
trace
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
verbose: (logLevel, ...args) => {
|
|
20
|
-
if ((0, exports.isEqualOrBelowLogLevel)(logLevel, 'verbose')) {
|
|
21
|
-
return console.log(...args);
|
|
22
|
-
}
|
|
23
|
-
},
|
|
24
|
-
info: (logLevel, ...args) => {
|
|
25
|
-
if ((0, exports.isEqualOrBelowLogLevel)(logLevel, 'info')) {
|
|
26
|
-
return console.log(...args);
|
|
27
|
-
}
|
|
28
|
-
},
|
|
29
|
-
warn: (logLevel, ...args) => {
|
|
30
|
-
if ((0, exports.isEqualOrBelowLogLevel)(logLevel, 'warn')) {
|
|
31
|
-
return console.warn(...args);
|
|
32
|
-
}
|
|
33
|
-
},
|
|
34
|
-
error: (...args) => {
|
|
35
|
-
return console.error(...args);
|
|
36
|
-
},
|
|
49
|
+
trace,
|
|
50
|
+
verbose,
|
|
51
|
+
info,
|
|
52
|
+
warn,
|
|
53
|
+
error,
|
|
37
54
|
};
|
|
@@ -6,6 +6,6 @@ const playbackLogging = ({ logLevel, tag, message, mountTime, }) => {
|
|
|
6
6
|
const tags = [mountTime ? Date.now() - mountTime + 'ms ' : null, tag]
|
|
7
7
|
.filter(Boolean)
|
|
8
8
|
.join(' ');
|
|
9
|
-
log_1.Log.trace(logLevel, `[${tags}]`, message);
|
|
9
|
+
log_1.Log.trace({ logLevel, tag: null }, `[${tags}]`, message);
|
|
10
10
|
};
|
|
11
11
|
exports.playbackLogging = playbackLogging;
|
package/dist/cjs/prefetch.js
CHANGED
|
@@ -87,7 +87,7 @@ const prefetch = (src, options) => {
|
|
|
87
87
|
waitUntilDone: () => Promise.resolve(srcWithoutHash),
|
|
88
88
|
};
|
|
89
89
|
}
|
|
90
|
-
log_js_1.Log.verbose(logLevel,
|
|
90
|
+
log_js_1.Log.verbose({ logLevel, tag: 'prefetch' }, `Starting prefetch ${srcWithoutHash}`);
|
|
91
91
|
let canceled = false;
|
|
92
92
|
let objectUrl = null;
|
|
93
93
|
let resolve = () => undefined;
|
|
@@ -12,9 +12,9 @@ const warnSafariOnce = (logLevel) => {
|
|
|
12
12
|
return;
|
|
13
13
|
}
|
|
14
14
|
warned = true;
|
|
15
|
-
log_1.Log.warn(logLevel, 'In Safari, setting a volume and a playback rate at the same time is buggy.');
|
|
16
|
-
log_1.Log.warn(logLevel, 'In Desktop Safari, only volumes <= 1 will be applied.');
|
|
17
|
-
log_1.Log.warn(logLevel, 'In Mobile Safari, the volume will be ignored and set to 1 if a playbackRate is set.');
|
|
15
|
+
log_1.Log.warn({ logLevel, tag: null }, 'In Safari, setting a volume and a playback rate at the same time is buggy.');
|
|
16
|
+
log_1.Log.warn({ logLevel, tag: null }, 'In Desktop Safari, only volumes <= 1 will be applied.');
|
|
17
|
+
log_1.Log.warn({ logLevel, tag: null }, logLevel, 'In Mobile Safari, the volume will be ignored and set to 1 if a playbackRate is set.');
|
|
18
18
|
};
|
|
19
19
|
/**
|
|
20
20
|
* [1] Bug case: In Safari, you cannot combine playbackRate and volume !== 1.
|
|
@@ -60,7 +60,7 @@ const useVolume = ({ mediaRef, volume, logLevel, source, shouldUseWebAudioApi, }
|
|
|
60
60
|
audioStuffRef.current = {
|
|
61
61
|
gainNode,
|
|
62
62
|
};
|
|
63
|
-
log_1.Log.trace(logLevel, `Starting to amplify ${(_a = mediaRef.current) === null || _a === void 0 ? void 0 : _a.src}. Gain = ${currentVolumeRef.current}, playbackRate = ${(_b = mediaRef.current) === null || _b === void 0 ? void 0 : _b.playbackRate}`);
|
|
63
|
+
log_1.Log.trace({ logLevel, tag: null }, `Starting to amplify ${(_a = mediaRef.current) === null || _a === void 0 ? void 0 : _a.src}. Gain = ${currentVolumeRef.current}, playbackRate = ${(_b = mediaRef.current) === null || _b === void 0 ? void 0 : _b.playbackRate}`);
|
|
64
64
|
return () => {
|
|
65
65
|
audioStuffRef.current = null;
|
|
66
66
|
gainNode.disconnect();
|
|
@@ -72,7 +72,7 @@ const useVolume = ({ mediaRef, volume, logLevel, source, shouldUseWebAudioApi, }
|
|
|
72
72
|
const valueToSet = volume;
|
|
73
73
|
if (!(0, is_approximately_the_same_1.isApproximatelyTheSame)(audioStuffRef.current.gainNode.gain.value, valueToSet)) {
|
|
74
74
|
audioStuffRef.current.gainNode.gain.value = valueToSet;
|
|
75
|
-
log_1.Log.trace(logLevel, `Setting gain to ${valueToSet} for ${(_a = mediaRef.current) === null || _a === void 0 ? void 0 : _a.src}`);
|
|
75
|
+
log_1.Log.trace({ logLevel, tag: null }, `Setting gain to ${valueToSet} for ${(_a = mediaRef.current) === null || _a === void 0 ? void 0 : _a.src}`);
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
78
|
const safariCase = (0, video_fragment_1.isSafari)() && mediaRef.current && ((_b = mediaRef.current) === null || _b === void 0 ? void 0 : _b.playbackRate) !== 1;
|
|
@@ -42,7 +42,7 @@ const useMediaPlayback = ({ mediaRef, src, mediaType, playbackRate: localPlaybac
|
|
|
42
42
|
if (isVariableFpsVideoMap.current[src]) {
|
|
43
43
|
return;
|
|
44
44
|
}
|
|
45
|
-
log_js_1.Log.verbose(logLevel, `Detected ${src} as a variable FPS video. Disabling buffering while seeking.`);
|
|
45
|
+
log_js_1.Log.verbose({ logLevel, tag: null }, `Detected ${src} as a variable FPS video. Disabling buffering while seeking.`);
|
|
46
46
|
isVariableFpsVideoMap.current[src] = true;
|
|
47
47
|
}, [logLevel, src]);
|
|
48
48
|
const rvcCurrentTime = (0, use_request_video_callback_time_js_1.useRequestVideoCallbackTime)({
|
package/dist/cjs/version.d.ts
CHANGED
package/dist/cjs/version.js
CHANGED
|
@@ -193,7 +193,7 @@ crossOrigin, audioStreamIndex, ...props }) => {
|
|
|
193
193
|
}
|
|
194
194
|
}, [imageSrc, onError]);
|
|
195
195
|
const className = (0, react_1.useMemo)(() => {
|
|
196
|
-
return [default_css_js_1.
|
|
196
|
+
return [default_css_js_1.OBJECTFIT_CONTAIN_CLASS_NAME, props.className]
|
|
197
197
|
.filter(truthy_js_1.truthy)
|
|
198
198
|
.join(' ');
|
|
199
199
|
}, [props.className]);
|
package/dist/esm/index.mjs
CHANGED
|
@@ -105,7 +105,7 @@ function truthy(value) {
|
|
|
105
105
|
}
|
|
106
106
|
|
|
107
107
|
// src/version.ts
|
|
108
|
-
var VERSION = "4.0.
|
|
108
|
+
var VERSION = "4.0.353";
|
|
109
109
|
|
|
110
110
|
// src/multiple-versions-warning.ts
|
|
111
111
|
var checkMultipleRemotionVersions = () => {
|
|
@@ -1332,9 +1332,22 @@ var Freeze = ({
|
|
|
1332
1332
|
}
|
|
1333
1333
|
};
|
|
1334
1334
|
}, [isActive, timelineContext, videoConfig.id, frameToFreeze, relativeFrom]);
|
|
1335
|
+
const newSequenceContext = useMemo8(() => {
|
|
1336
|
+
if (!sequenceContext) {
|
|
1337
|
+
return null;
|
|
1338
|
+
}
|
|
1339
|
+
return {
|
|
1340
|
+
...sequenceContext,
|
|
1341
|
+
relativeFrom: 0,
|
|
1342
|
+
cumulatedFrom: 0
|
|
1343
|
+
};
|
|
1344
|
+
}, [sequenceContext]);
|
|
1335
1345
|
return /* @__PURE__ */ jsx7(TimelineContext.Provider, {
|
|
1336
1346
|
value: timelineValue,
|
|
1337
|
-
children
|
|
1347
|
+
children: /* @__PURE__ */ jsx7(SequenceContext.Provider, {
|
|
1348
|
+
value: newSequenceContext,
|
|
1349
|
+
children
|
|
1350
|
+
})
|
|
1338
1351
|
});
|
|
1339
1352
|
};
|
|
1340
1353
|
|
|
@@ -1617,31 +1630,50 @@ var getNumberForLogLevel = (level) => {
|
|
|
1617
1630
|
var isEqualOrBelowLogLevel = (currentLevel, level) => {
|
|
1618
1631
|
return getNumberForLogLevel(currentLevel) <= getNumberForLogLevel(level);
|
|
1619
1632
|
};
|
|
1620
|
-
var
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
return console.error(...args);
|
|
1633
|
+
var transformArgs = ({
|
|
1634
|
+
args,
|
|
1635
|
+
logLevel,
|
|
1636
|
+
tag
|
|
1637
|
+
}) => {
|
|
1638
|
+
const arr = [...args];
|
|
1639
|
+
if (getRemotionEnvironment().isRendering && !getRemotionEnvironment().isClientSideRendering) {
|
|
1640
|
+
arr.unshift(Symbol.for(`__remotion_level_${logLevel}`));
|
|
1641
|
+
}
|
|
1642
|
+
if (tag) {
|
|
1643
|
+
arr.unshift(Symbol.for(`__remotion_tag_${tag}`));
|
|
1644
|
+
}
|
|
1645
|
+
return arr;
|
|
1646
|
+
};
|
|
1647
|
+
var verbose = (options, ...args) => {
|
|
1648
|
+
if (isEqualOrBelowLogLevel(options.logLevel, "verbose")) {
|
|
1649
|
+
return console.debug(...transformArgs({ args, logLevel: "verbose", tag: options.tag }));
|
|
1650
|
+
}
|
|
1651
|
+
};
|
|
1652
|
+
var trace = (options, ...args) => {
|
|
1653
|
+
if (isEqualOrBelowLogLevel(options.logLevel, "trace")) {
|
|
1654
|
+
return console.debug(...transformArgs({ args, logLevel: "trace", tag: options.tag }));
|
|
1643
1655
|
}
|
|
1644
1656
|
};
|
|
1657
|
+
var info = (options, ...args) => {
|
|
1658
|
+
if (isEqualOrBelowLogLevel(options.logLevel, "info")) {
|
|
1659
|
+
return console.log(...transformArgs({ args, logLevel: "info", tag: options.tag }));
|
|
1660
|
+
}
|
|
1661
|
+
};
|
|
1662
|
+
var warn = (options, ...args) => {
|
|
1663
|
+
if (isEqualOrBelowLogLevel(options.logLevel, "warn")) {
|
|
1664
|
+
return console.warn(...transformArgs({ args, logLevel: "warn", tag: options.tag }));
|
|
1665
|
+
}
|
|
1666
|
+
};
|
|
1667
|
+
var error = (options, ...args) => {
|
|
1668
|
+
return console.error(...transformArgs({ args, logLevel: "error", tag: options.tag }));
|
|
1669
|
+
};
|
|
1670
|
+
var Log = {
|
|
1671
|
+
trace,
|
|
1672
|
+
verbose,
|
|
1673
|
+
info,
|
|
1674
|
+
warn,
|
|
1675
|
+
error
|
|
1676
|
+
};
|
|
1645
1677
|
|
|
1646
1678
|
// src/delay-render.ts
|
|
1647
1679
|
if (typeof window !== "undefined") {
|
|
@@ -1709,11 +1741,11 @@ var continueRenderInternal = (handle, environment) => {
|
|
|
1709
1741
|
const { label, startTime, timeout } = window.remotion_delayRenderTimeouts[handle];
|
|
1710
1742
|
clearTimeout(timeout);
|
|
1711
1743
|
const message = [
|
|
1712
|
-
label ? `
|
|
1744
|
+
label ? `"${label}"` : "A handle",
|
|
1713
1745
|
DELAY_RENDER_CLEAR_TOKEN,
|
|
1714
1746
|
`${Date.now() - startTime}ms`
|
|
1715
1747
|
].filter(truthy).join(" ");
|
|
1716
|
-
Log.verbose(window.remotion_logLevel, message);
|
|
1748
|
+
Log.verbose({ logLevel: window.remotion_logLevel, tag: "delayRender()" }, message);
|
|
1717
1749
|
delete window.remotion_delayRenderTimeouts[handle];
|
|
1718
1750
|
}
|
|
1719
1751
|
return false;
|
|
@@ -2347,7 +2379,7 @@ var playbackLogging = ({
|
|
|
2347
2379
|
mountTime
|
|
2348
2380
|
}) => {
|
|
2349
2381
|
const tags = [mountTime ? Date.now() - mountTime + "ms " : null, tag].filter(Boolean).join(" ");
|
|
2350
|
-
Log.trace(logLevel, `[${tags}]`, message);
|
|
2382
|
+
Log.trace({ logLevel, tag: null }, `[${tags}]`, message);
|
|
2351
2383
|
};
|
|
2352
2384
|
|
|
2353
2385
|
// src/prefetch-state.tsx
|
|
@@ -2458,7 +2490,7 @@ var prefetch = (src, options) => {
|
|
|
2458
2490
|
waitUntilDone: () => Promise.resolve(srcWithoutHash)
|
|
2459
2491
|
};
|
|
2460
2492
|
}
|
|
2461
|
-
Log.verbose(logLevel,
|
|
2493
|
+
Log.verbose({ logLevel, tag: "prefetch" }, `Starting prefetch ${srcWithoutHash}`);
|
|
2462
2494
|
let canceled = false;
|
|
2463
2495
|
let objectUrl = null;
|
|
2464
2496
|
let resolve = () => {
|
|
@@ -2893,7 +2925,7 @@ var warnOnce = (logLevel) => {
|
|
|
2893
2925
|
}
|
|
2894
2926
|
warned = true;
|
|
2895
2927
|
if (typeof window !== "undefined") {
|
|
2896
|
-
Log.warn(logLevel, "AudioContext is not supported in this browser");
|
|
2928
|
+
Log.warn({ logLevel, tag: null }, "AudioContext is not supported in this browser");
|
|
2897
2929
|
}
|
|
2898
2930
|
};
|
|
2899
2931
|
var useSingletonAudioContext = (logLevel, latencyHint) => {
|
|
@@ -3272,9 +3304,9 @@ var warnSafariOnce = (logLevel) => {
|
|
|
3272
3304
|
return;
|
|
3273
3305
|
}
|
|
3274
3306
|
warned2 = true;
|
|
3275
|
-
Log.warn(logLevel, "In Safari, setting a volume and a playback rate at the same time is buggy.");
|
|
3276
|
-
Log.warn(logLevel, "In Desktop Safari, only volumes <= 1 will be applied.");
|
|
3277
|
-
Log.warn(logLevel, "In Mobile Safari, the volume will be ignored and set to 1 if a playbackRate is set.");
|
|
3307
|
+
Log.warn({ logLevel, tag: null }, "In Safari, setting a volume and a playback rate at the same time is buggy.");
|
|
3308
|
+
Log.warn({ logLevel, tag: null }, "In Desktop Safari, only volumes <= 1 will be applied.");
|
|
3309
|
+
Log.warn({ logLevel, tag: null }, logLevel, "In Mobile Safari, the volume will be ignored and set to 1 if a playbackRate is set.");
|
|
3278
3310
|
};
|
|
3279
3311
|
var useVolume = ({
|
|
3280
3312
|
mediaRef,
|
|
@@ -3318,7 +3350,7 @@ var useVolume = ({
|
|
|
3318
3350
|
audioStuffRef.current = {
|
|
3319
3351
|
gainNode
|
|
3320
3352
|
};
|
|
3321
|
-
Log.trace(logLevel, `Starting to amplify ${mediaRef.current?.src}. Gain = ${currentVolumeRef.current}, playbackRate = ${mediaRef.current?.playbackRate}`);
|
|
3353
|
+
Log.trace({ logLevel, tag: null }, `Starting to amplify ${mediaRef.current?.src}. Gain = ${currentVolumeRef.current}, playbackRate = ${mediaRef.current?.playbackRate}`);
|
|
3322
3354
|
return () => {
|
|
3323
3355
|
audioStuffRef.current = null;
|
|
3324
3356
|
gainNode.disconnect();
|
|
@@ -3330,7 +3362,7 @@ var useVolume = ({
|
|
|
3330
3362
|
const valueToSet = volume;
|
|
3331
3363
|
if (!isApproximatelyTheSame(audioStuffRef.current.gainNode.gain.value, valueToSet)) {
|
|
3332
3364
|
audioStuffRef.current.gainNode.gain.value = valueToSet;
|
|
3333
|
-
Log.trace(logLevel, `Setting gain to ${valueToSet} for ${mediaRef.current?.src}`);
|
|
3365
|
+
Log.trace({ logLevel, tag: null }, `Setting gain to ${valueToSet} for ${mediaRef.current?.src}`);
|
|
3334
3366
|
}
|
|
3335
3367
|
}
|
|
3336
3368
|
const safariCase = isSafari() && mediaRef.current && mediaRef.current?.playbackRate !== 1;
|
|
@@ -3755,8 +3787,8 @@ var useBufferUntilFirstFrame = ({
|
|
|
3755
3787
|
const onEndedOrPauseOrCanPlay = () => {
|
|
3756
3788
|
unblock();
|
|
3757
3789
|
};
|
|
3758
|
-
current.requestVideoFrameCallback((_,
|
|
3759
|
-
const differenceFromRequested = Math.abs(
|
|
3790
|
+
current.requestVideoFrameCallback((_, info2) => {
|
|
3791
|
+
const differenceFromRequested = Math.abs(info2.mediaTime - requestedTime);
|
|
3760
3792
|
if (differenceFromRequested > 0.5) {
|
|
3761
3793
|
onVariableFpsVideoDetected();
|
|
3762
3794
|
}
|
|
@@ -3995,16 +4027,16 @@ var useRequestVideoCallbackTime = ({
|
|
|
3995
4027
|
if (!videoTag) {
|
|
3996
4028
|
return;
|
|
3997
4029
|
}
|
|
3998
|
-
const cb = videoTag.requestVideoFrameCallback((_,
|
|
4030
|
+
const cb = videoTag.requestVideoFrameCallback((_, info2) => {
|
|
3999
4031
|
if (currentTime.current !== null) {
|
|
4000
|
-
const difference = Math.abs(currentTime.current.time -
|
|
4001
|
-
const differenceToLastSeek = Math.abs(lastSeek.current === null ? Infinity :
|
|
4002
|
-
if (difference > 0.5 && differenceToLastSeek > 0.5 &&
|
|
4032
|
+
const difference = Math.abs(currentTime.current.time - info2.mediaTime);
|
|
4033
|
+
const differenceToLastSeek = Math.abs(lastSeek.current === null ? Infinity : info2.mediaTime - lastSeek.current);
|
|
4034
|
+
if (difference > 0.5 && differenceToLastSeek > 0.5 && info2.mediaTime > currentTime.current.time) {
|
|
4003
4035
|
onVariableFpsVideoDetected();
|
|
4004
4036
|
}
|
|
4005
4037
|
}
|
|
4006
4038
|
currentTime.current = {
|
|
4007
|
-
time:
|
|
4039
|
+
time: info2.mediaTime,
|
|
4008
4040
|
lastUpdate: performance.now()
|
|
4009
4041
|
};
|
|
4010
4042
|
request();
|
|
@@ -4219,7 +4251,7 @@ var useMediaPlayback = ({
|
|
|
4219
4251
|
if (isVariableFpsVideoMap.current[src]) {
|
|
4220
4252
|
return;
|
|
4221
4253
|
}
|
|
4222
|
-
Log.verbose(logLevel, `Detected ${src} as a variable FPS video. Disabling buffering while seeking.`);
|
|
4254
|
+
Log.verbose({ logLevel, tag: null }, `Detected ${src} as a variable FPS video. Disabling buffering while seeking.`);
|
|
4223
4255
|
isVariableFpsVideoMap.current[src] = true;
|
|
4224
4256
|
}, [logLevel, src]);
|
|
4225
4257
|
const rvcCurrentTime = useRequestVideoCallbackTime({
|
|
@@ -5740,7 +5772,7 @@ var exports_default_css = {};
|
|
|
5740
5772
|
__export(exports_default_css, {
|
|
5741
5773
|
makeDefaultPreviewCSS: () => makeDefaultPreviewCSS,
|
|
5742
5774
|
injectCSS: () => injectCSS,
|
|
5743
|
-
|
|
5775
|
+
OBJECTFIT_CONTAIN_CLASS_NAME: () => OBJECTFIT_CONTAIN_CLASS_NAME
|
|
5744
5776
|
});
|
|
5745
5777
|
var injected = {};
|
|
5746
5778
|
var injectCSS = (css) => {
|
|
@@ -5756,7 +5788,7 @@ var injectCSS = (css) => {
|
|
|
5756
5788
|
head.prepend(style);
|
|
5757
5789
|
injected[css] = true;
|
|
5758
5790
|
};
|
|
5759
|
-
var
|
|
5791
|
+
var OBJECTFIT_CONTAIN_CLASS_NAME = "__remotion_objectfitcontain";
|
|
5760
5792
|
var makeDefaultPreviewCSS = (scope, backgroundColor) => {
|
|
5761
5793
|
if (!scope) {
|
|
5762
5794
|
return `
|
|
@@ -5767,7 +5799,7 @@ var makeDefaultPreviewCSS = (scope, backgroundColor) => {
|
|
|
5767
5799
|
margin: 0;
|
|
5768
5800
|
background-color: ${backgroundColor};
|
|
5769
5801
|
}
|
|
5770
|
-
.${
|
|
5802
|
+
.${OBJECTFIT_CONTAIN_CLASS_NAME} {
|
|
5771
5803
|
object-fit: contain;
|
|
5772
5804
|
}
|
|
5773
5805
|
`;
|
|
@@ -5780,7 +5812,7 @@ var makeDefaultPreviewCSS = (scope, backgroundColor) => {
|
|
|
5780
5812
|
width: 100%;
|
|
5781
5813
|
height: 100%;
|
|
5782
5814
|
}
|
|
5783
|
-
${scope} .${
|
|
5815
|
+
${scope} .${OBJECTFIT_CONTAIN_CLASS_NAME} {
|
|
5784
5816
|
object-fit: contain;
|
|
5785
5817
|
}
|
|
5786
5818
|
`;
|
|
@@ -6484,7 +6516,8 @@ var Internals = {
|
|
|
6484
6516
|
compositionSelectorRef,
|
|
6485
6517
|
RemotionEnvironmentContext,
|
|
6486
6518
|
warnAboutTooHighVolume,
|
|
6487
|
-
AudioForPreview
|
|
6519
|
+
AudioForPreview,
|
|
6520
|
+
OBJECTFIT_CONTAIN_CLASS_NAME
|
|
6488
6521
|
};
|
|
6489
6522
|
// src/interpolate-colors.ts
|
|
6490
6523
|
var NUMBER = "[-+]?\\d*\\.?\\d+";
|
|
@@ -7509,7 +7542,7 @@ var OffthreadVideoForRendering = ({
|
|
|
7509
7542
|
}
|
|
7510
7543
|
}, [imageSrc, onError]);
|
|
7511
7544
|
const className = useMemo29(() => {
|
|
7512
|
-
return [
|
|
7545
|
+
return [OBJECTFIT_CONTAIN_CLASS_NAME, props2.className].filter(truthy).join(" ");
|
|
7513
7546
|
}, [props2.className]);
|
|
7514
7547
|
const onImageFrame = useCallback15((img) => {
|
|
7515
7548
|
if (onVideoFrame) {
|
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.353",
|
|
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.353"
|
|
32
32
|
},
|
|
33
33
|
"keywords": [
|
|
34
34
|
"video",
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useAudioChannelIndex = void 0;
|
|
4
|
-
const react_1 = require("react");
|
|
5
|
-
const useAudioChannelIndex = ({ ref, audioChannelIndex, }) => {
|
|
6
|
-
(0, react_1.useEffect)(() => {
|
|
7
|
-
var _a;
|
|
8
|
-
// @ts-expect-error
|
|
9
|
-
const audioChannels = (_a = ref === null || ref === void 0 ? void 0 : ref.current) === null || _a === void 0 ? void 0 : _a.audioTracks;
|
|
10
|
-
console.log({ audioChannels, audioChannelIndex });
|
|
11
|
-
}, [ref, audioChannelIndex]);
|
|
12
|
-
};
|
|
13
|
-
exports.useAudioChannelIndex = useAudioChannelIndex;
|