remotion 4.0.120 → 4.0.122
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/Audio.d.ts +1 -0
- package/dist/cjs/audio/Audio.js +2 -2
- package/dist/cjs/audio/AudioForDevelopment.d.ts +1 -1
- package/dist/cjs/audio/AudioForPreview.d.ts +1 -0
- package/dist/cjs/audio/AudioForPreview.js +3 -2
- package/dist/cjs/audio/AudioForRendering.d.ts +1 -0
- package/dist/cjs/audio/props.d.ts +1 -0
- package/dist/cjs/get-timeline-clip-name.d.ts +1 -0
- package/dist/cjs/get-timeline-clip-name.js +25 -0
- package/dist/cjs/setup-env-variables.js +7 -3
- package/dist/cjs/use-media-in-timeline.d.ts +2 -1
- package/dist/cjs/use-media-in-timeline.js +5 -1
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/video/OffthreadVideo.js +2 -2
- package/dist/cjs/video/Video.d.ts +1 -0
- package/dist/cjs/video/Video.js +2 -2
- package/dist/cjs/video/VideoForDevelopment.d.ts +1 -1
- package/dist/cjs/video/VideoForPreview.d.ts +1 -0
- package/dist/cjs/video/VideoForPreview.js +3 -2
- package/dist/cjs/video/VideoForRendering.d.ts +1 -0
- package/dist/cjs/video/props.d.ts +2 -0
- package/dist/esm/index.mjs +25 -15
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/dist/cjs/use-buffer.d.ts +0 -5
- package/dist/cjs/use-buffer.js +0 -28
|
@@ -14,6 +14,7 @@ export declare const Audio: React.ForwardRefExoticComponent<Omit<Omit<React.Deta
|
|
|
14
14
|
_remotionInternalNativeLoopPassed?: boolean | undefined;
|
|
15
15
|
toneFrequency?: number | undefined;
|
|
16
16
|
pauseWhenBuffering?: boolean | undefined;
|
|
17
|
+
showInTimeline?: boolean | undefined;
|
|
17
18
|
} & RemotionMainAudioProps & {
|
|
18
19
|
/**
|
|
19
20
|
* @deprecated For internal use only
|
package/dist/cjs/audio/Audio.js
CHANGED
|
@@ -22,7 +22,7 @@ const shared_audio_tags_js_1 = require("./shared-audio-tags.js");
|
|
|
22
22
|
const AudioRefForwardingFunction = (props, ref) => {
|
|
23
23
|
var _a, _b, _c;
|
|
24
24
|
const audioContext = (0, react_1.useContext)(shared_audio_tags_js_1.SharedAudioContext);
|
|
25
|
-
const { startFrom, endAt, name, stack, pauseWhenBuffering, ...otherProps } = props;
|
|
25
|
+
const { startFrom, endAt, name, stack, pauseWhenBuffering, showInTimeline, ...otherProps } = props;
|
|
26
26
|
const { loop, ...propsOtherThanLoop } = props;
|
|
27
27
|
const { fps } = (0, use_video_config_js_1.useVideoConfig)();
|
|
28
28
|
const environment = (0, get_remotion_environment_js_1.getRemotionEnvironment)();
|
|
@@ -70,7 +70,7 @@ const AudioRefForwardingFunction = (props, ref) => {
|
|
|
70
70
|
}
|
|
71
71
|
return ((0, jsx_runtime_1.jsx)(AudioForPreview_js_1.AudioForPreview, { _remotionInternalNativeLoopPassed: (_c = props._remotionInternalNativeLoopPassed) !== null && _c !== void 0 ? _c : false, _remotionInternalStack: stack !== null && stack !== void 0 ? stack : null, shouldPreMountAudioTags: audioContext !== null && audioContext.numberOfAudioTags > 0, ...props, ref: ref, onError: onError, onDuration: onDuration,
|
|
72
72
|
// Proposal: Make this default to true in v5
|
|
73
|
-
pauseWhenBuffering: pauseWhenBuffering !== null && pauseWhenBuffering !== void 0 ? pauseWhenBuffering : false, _remotionInternalNeedsDurationCalculation: Boolean(loop) }));
|
|
73
|
+
pauseWhenBuffering: pauseWhenBuffering !== null && pauseWhenBuffering !== void 0 ? pauseWhenBuffering : false, _remotionInternalNeedsDurationCalculation: Boolean(loop), showInTimeline: showInTimeline !== null && showInTimeline !== void 0 ? showInTimeline : true }));
|
|
74
74
|
};
|
|
75
75
|
/**
|
|
76
76
|
* @description With this component, you can add audio to your video. All audio formats which are supported by Chromium are supported by the component.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
export declare const AudioForDevelopment: ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.AudioHTMLAttributes<HTMLAudioElement>, HTMLAudioElement>, "
|
|
3
|
+
export declare const AudioForDevelopment: ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.AudioHTMLAttributes<HTMLAudioElement>, HTMLAudioElement>, "nonce" | "onEnded" | "onResize" | "onResizeCapture" | "autoPlay" | "controls"> & {
|
|
4
4
|
name?: string | undefined;
|
|
5
5
|
volume?: import("../volume-prop.js").VolumeProp | undefined;
|
|
6
6
|
playbackRate?: number | undefined;
|
|
@@ -6,6 +6,7 @@ type AudioForPreviewProps = RemotionAudioProps & {
|
|
|
6
6
|
pauseWhenBuffering: boolean;
|
|
7
7
|
_remotionInternalNativeLoopPassed: boolean;
|
|
8
8
|
_remotionInternalStack: string | null;
|
|
9
|
+
showInTimeline: boolean;
|
|
9
10
|
};
|
|
10
11
|
export declare const AudioForPreview: React.ForwardRefExoticComponent<Omit<AudioForPreviewProps, "ref"> & React.RefAttributes<HTMLAudioElement>>;
|
|
11
12
|
export {};
|
|
@@ -24,7 +24,7 @@ const AudioForDevelopmentForwardRefFunction = (props, ref) => {
|
|
|
24
24
|
const [mediaVolume] = (0, volume_position_state_js_1.useMediaVolumeState)();
|
|
25
25
|
const [mediaMuted] = (0, volume_position_state_js_1.useMediaMutedState)();
|
|
26
26
|
const volumePropFrame = (0, use_audio_frame_js_1.useFrameForVolumeProp)();
|
|
27
|
-
const { volume, muted, playbackRate, shouldPreMountAudioTags, src, onDuration, acceptableTimeShiftInSeconds, _remotionInternalNeedsDurationCalculation, _remotionInternalNativeLoopPassed, _remotionInternalStack, allowAmplificationDuringRender, name, pauseWhenBuffering, ...nativeProps } = props;
|
|
27
|
+
const { volume, muted, playbackRate, shouldPreMountAudioTags, src, onDuration, acceptableTimeShiftInSeconds, _remotionInternalNeedsDurationCalculation, _remotionInternalNativeLoopPassed, _remotionInternalStack, allowAmplificationDuringRender, name, pauseWhenBuffering, showInTimeline, ...nativeProps } = props;
|
|
28
28
|
const { hidden } = (0, react_1.useContext)(SequenceManager_js_1.SequenceVisibilityToggleContext);
|
|
29
29
|
if (!src) {
|
|
30
30
|
throw new TypeError("No 'src' was passed to <Audio>.");
|
|
@@ -76,7 +76,8 @@ const AudioForDevelopmentForwardRefFunction = (props, ref) => {
|
|
|
76
76
|
playbackRate: playbackRate !== null && playbackRate !== void 0 ? playbackRate : 1,
|
|
77
77
|
displayName: name !== null && name !== void 0 ? name : null,
|
|
78
78
|
id: timelineId,
|
|
79
|
-
stack:
|
|
79
|
+
stack: _remotionInternalStack,
|
|
80
|
+
showInTimeline,
|
|
80
81
|
});
|
|
81
82
|
(0, use_media_playback_js_1.useMediaPlayback)({
|
|
82
83
|
mediaRef: audioRef,
|
|
@@ -10,6 +10,7 @@ export declare const AudioForRendering: ForwardRefExoticComponent<Omit<React.Det
|
|
|
10
10
|
_remotionInternalNativeLoopPassed?: boolean | undefined;
|
|
11
11
|
toneFrequency?: number | undefined;
|
|
12
12
|
pauseWhenBuffering?: boolean | undefined;
|
|
13
|
+
showInTimeline?: boolean | undefined;
|
|
13
14
|
} & {
|
|
14
15
|
onDuration: (src: string, durationInSeconds: number) => void;
|
|
15
16
|
} & RefAttributes<HTMLAudioElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getTimelineClipName: (children: React.ReactNode) => string;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getTimelineClipName = void 0;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const HIDDEN_NAMES = ['__WEBPACK_DEFAULT_EXPORT__'];
|
|
6
|
+
const getTimelineClipName = (children) => {
|
|
7
|
+
var _a;
|
|
8
|
+
const tree = (_a = react_1.Children.map(children, (ch) => {
|
|
9
|
+
if (!(0, react_1.isValidElement)(ch)) {
|
|
10
|
+
return null;
|
|
11
|
+
}
|
|
12
|
+
// Must be name, not ID
|
|
13
|
+
const name = typeof ch.type !== 'string' && ch.type.name;
|
|
14
|
+
if (name && !HIDDEN_NAMES.includes(name)) {
|
|
15
|
+
return name;
|
|
16
|
+
}
|
|
17
|
+
if (ch.props.children) {
|
|
18
|
+
const chName = (0, exports.getTimelineClipName)(ch.props.children);
|
|
19
|
+
return chName;
|
|
20
|
+
}
|
|
21
|
+
return null;
|
|
22
|
+
})) === null || _a === void 0 ? void 0 : _a.filter(Boolean);
|
|
23
|
+
return (tree === null || tree === void 0 ? void 0 : tree.length) ? tree[0] : '';
|
|
24
|
+
};
|
|
25
|
+
exports.getTimelineClipName = getTimelineClipName;
|
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.setupEnvVariables = void 0;
|
|
4
4
|
const get_remotion_environment_js_1 = require("./get-remotion-environment.js");
|
|
5
|
+
// https://github.com/remotion-dev/remotion/issues/3412#issuecomment-1910120552
|
|
6
|
+
// eslint-disable-next-line no-useless-concat
|
|
7
|
+
function getEnvVar() {
|
|
8
|
+
const parts = ['proc', 'ess', '.', 'en', 'v', '.', 'NOD', 'E_EN', 'V'];
|
|
9
|
+
return parts.join('');
|
|
10
|
+
}
|
|
5
11
|
const getEnvVariables = () => {
|
|
6
12
|
if ((0, get_remotion_environment_js_1.getRemotionEnvironment)().isRendering) {
|
|
7
13
|
const param = window.remotion_envVariables;
|
|
@@ -13,9 +19,7 @@ const getEnvVariables = () => {
|
|
|
13
19
|
// For the Studio, we already set the environment variables in index-html.ts.
|
|
14
20
|
// We just add NODE_ENV here.
|
|
15
21
|
if (!process.env.NODE_ENV) {
|
|
16
|
-
|
|
17
|
-
// eslint-disable-next-line no-useless-concat
|
|
18
|
-
throw new Error('process.en' + '' + 'v.NODE_ENV is not set');
|
|
22
|
+
throw new Error(`${getEnvVar()} is not set`);
|
|
19
23
|
}
|
|
20
24
|
return {
|
|
21
25
|
NODE_ENV: process.env.NODE_ENV,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { RefObject } from 'react';
|
|
2
2
|
import type { VolumeProp } from './volume-prop.js';
|
|
3
|
-
export declare const useMediaInTimeline: ({ volume, mediaVolume, mediaRef, src, mediaType, playbackRate, displayName, id, stack, }: {
|
|
3
|
+
export declare const useMediaInTimeline: ({ volume, mediaVolume, mediaRef, src, mediaType, playbackRate, displayName, id, stack, showInTimeline, }: {
|
|
4
4
|
volume: VolumeProp | undefined;
|
|
5
5
|
mediaVolume: number;
|
|
6
6
|
mediaRef: RefObject<HTMLAudioElement | HTMLVideoElement>;
|
|
@@ -10,4 +10,5 @@ export declare const useMediaInTimeline: ({ volume, mediaVolume, mediaRef, src,
|
|
|
10
10
|
displayName: string | null;
|
|
11
11
|
id: string;
|
|
12
12
|
stack: string | null;
|
|
13
|
+
showInTimeline: boolean;
|
|
13
14
|
}) => void;
|
|
@@ -21,7 +21,7 @@ const warnOnce = (message) => {
|
|
|
21
21
|
console.warn(message);
|
|
22
22
|
didWarn[message] = true;
|
|
23
23
|
};
|
|
24
|
-
const useMediaInTimeline = ({ volume, mediaVolume, mediaRef, src, mediaType, playbackRate, displayName, id, stack, }) => {
|
|
24
|
+
const useMediaInTimeline = ({ volume, mediaVolume, mediaRef, src, mediaType, playbackRate, displayName, id, stack, showInTimeline, }) => {
|
|
25
25
|
const videoConfig = (0, use_video_config_js_1.useVideoConfig)();
|
|
26
26
|
const { rootId, audioAndVideoTags } = (0, react_1.useContext)(timeline_position_state_js_1.TimelineContext);
|
|
27
27
|
const parentSequence = (0, react_1.useContext)(SequenceContext_js_1.SequenceContext);
|
|
@@ -69,6 +69,9 @@ const useMediaInTimeline = ({ volume, mediaVolume, mediaRef, src, mediaType, pla
|
|
|
69
69
|
if (!(0, get_remotion_environment_js_1.getRemotionEnvironment)().isStudio && process.env.NODE_ENV !== 'test') {
|
|
70
70
|
return;
|
|
71
71
|
}
|
|
72
|
+
if (!showInTimeline) {
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
72
75
|
registerSequence({
|
|
73
76
|
type: mediaType,
|
|
74
77
|
src,
|
|
@@ -109,6 +112,7 @@ const useMediaInTimeline = ({ volume, mediaVolume, mediaRef, src, mediaType, pla
|
|
|
109
112
|
playbackRate,
|
|
110
113
|
displayName,
|
|
111
114
|
stack,
|
|
115
|
+
showInTimeline,
|
|
112
116
|
]);
|
|
113
117
|
(0, react_1.useEffect)(() => {
|
|
114
118
|
const tag = {
|
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "4.0.
|
|
1
|
+
export declare const VERSION = "4.0.122";
|
package/dist/cjs/version.js
CHANGED
|
@@ -16,7 +16,7 @@ const VideoForPreview_js_1 = require("./VideoForPreview.js");
|
|
|
16
16
|
const OffthreadVideo = (props) => {
|
|
17
17
|
// Should only destruct `startFrom` and `endAt` from props,
|
|
18
18
|
// rest gets drilled down
|
|
19
|
-
const { startFrom, endAt, name, pauseWhenBuffering, stack, ...otherProps } = props;
|
|
19
|
+
const { startFrom, endAt, name, pauseWhenBuffering, stack, showInTimeline, ...otherProps } = props;
|
|
20
20
|
const environment = (0, get_remotion_environment_js_1.getRemotionEnvironment)();
|
|
21
21
|
const onDuration = (0, react_1.useCallback)(() => undefined, []);
|
|
22
22
|
if (typeof props.src !== 'string') {
|
|
@@ -36,6 +36,6 @@ const OffthreadVideo = (props) => {
|
|
|
36
36
|
return (0, jsx_runtime_1.jsx)(OffthreadVideoForRendering_js_1.OffthreadVideoForRendering, { ...otherProps });
|
|
37
37
|
}
|
|
38
38
|
const { transparent, toneMapped, ...withoutTransparent } = otherProps;
|
|
39
|
-
return ((0, jsx_runtime_1.jsx)(VideoForPreview_js_1.VideoForPreview, { _remotionInternalStack: stack !== null && stack !== void 0 ? stack : null, _remotionInternalNativeLoopPassed: false, onDuration: onDuration, onlyWarnForMediaSeekingError: true, pauseWhenBuffering: pauseWhenBuffering !== null && pauseWhenBuffering !== void 0 ? pauseWhenBuffering : false, ...withoutTransparent }));
|
|
39
|
+
return ((0, jsx_runtime_1.jsx)(VideoForPreview_js_1.VideoForPreview, { _remotionInternalStack: stack !== null && stack !== void 0 ? stack : null, _remotionInternalNativeLoopPassed: false, onDuration: onDuration, onlyWarnForMediaSeekingError: true, pauseWhenBuffering: pauseWhenBuffering !== null && pauseWhenBuffering !== void 0 ? pauseWhenBuffering : false, showInTimeline: showInTimeline !== null && showInTimeline !== void 0 ? showInTimeline : true, ...withoutTransparent }));
|
|
40
40
|
};
|
|
41
41
|
exports.OffthreadVideo = OffthreadVideo;
|
|
@@ -12,6 +12,7 @@ export declare const Video: React.ForwardRefExoticComponent<Omit<Omit<React.Deta
|
|
|
12
12
|
allowAmplificationDuringRender?: boolean | undefined;
|
|
13
13
|
toneFrequency?: number | undefined;
|
|
14
14
|
pauseWhenBuffering?: boolean | undefined;
|
|
15
|
+
showInTimeline?: boolean | undefined;
|
|
15
16
|
} & RemotionMainVideoProps & {
|
|
16
17
|
/**
|
|
17
18
|
* @deprecated For internal use only
|
package/dist/cjs/video/Video.js
CHANGED
|
@@ -19,7 +19,7 @@ const VideoForPreview_js_1 = require("./VideoForPreview.js");
|
|
|
19
19
|
const VideoForRendering_js_1 = require("./VideoForRendering.js");
|
|
20
20
|
const VideoForwardingFunction = (props, ref) => {
|
|
21
21
|
var _a, _b;
|
|
22
|
-
const { startFrom, endAt, name, pauseWhenBuffering, stack, _remotionInternalNativeLoopPassed, ...otherProps } = props;
|
|
22
|
+
const { startFrom, endAt, name, pauseWhenBuffering, stack, _remotionInternalNativeLoopPassed, showInTimeline, ...otherProps } = props;
|
|
23
23
|
const { loop, ...propsOtherThanLoop } = props;
|
|
24
24
|
const { fps } = (0, use_video_config_js_1.useVideoConfig)();
|
|
25
25
|
const environment = (0, get_remotion_environment_js_1.getRemotionEnvironment)();
|
|
@@ -56,7 +56,7 @@ const VideoForwardingFunction = (props, ref) => {
|
|
|
56
56
|
}
|
|
57
57
|
return ((0, jsx_runtime_1.jsx)(VideoForPreview_js_1.VideoForPreview, { onlyWarnForMediaSeekingError: false, ...otherProps, ref: ref,
|
|
58
58
|
// Proposal: Make this default to true in v5
|
|
59
|
-
pauseWhenBuffering: pauseWhenBuffering !== null && pauseWhenBuffering !== void 0 ? pauseWhenBuffering : false, onDuration: onDuration, _remotionInternalStack: stack !== null && stack !== void 0 ? stack : null, _remotionInternalNativeLoopPassed: _remotionInternalNativeLoopPassed !== null && _remotionInternalNativeLoopPassed !== void 0 ? _remotionInternalNativeLoopPassed : false }));
|
|
59
|
+
pauseWhenBuffering: pauseWhenBuffering !== null && pauseWhenBuffering !== void 0 ? pauseWhenBuffering : false, onDuration: onDuration, _remotionInternalStack: stack !== null && stack !== void 0 ? stack : null, _remotionInternalNativeLoopPassed: _remotionInternalNativeLoopPassed !== null && _remotionInternalNativeLoopPassed !== void 0 ? _remotionInternalNativeLoopPassed : false, showInTimeline: showInTimeline !== null && showInTimeline !== void 0 ? showInTimeline : true }));
|
|
60
60
|
};
|
|
61
61
|
/**
|
|
62
62
|
* @description allows you to include a video file in your Remotion project. It wraps the native HTMLVideoElement.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
export declare const VideoForDevelopment: ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.VideoHTMLAttributes<HTMLVideoElement>, HTMLVideoElement>, "
|
|
3
|
+
export declare const VideoForDevelopment: ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.VideoHTMLAttributes<HTMLVideoElement>, HTMLVideoElement>, "nonce" | "onEnded" | "autoPlay" | "controls"> & {
|
|
4
4
|
name?: string | undefined;
|
|
5
5
|
volume?: import("../volume-prop.js").VolumeProp | undefined;
|
|
6
6
|
playbackRate?: number | undefined;
|
|
@@ -6,6 +6,7 @@ type VideoForPreviewProps = RemotionVideoProps & {
|
|
|
6
6
|
pauseWhenBuffering: boolean;
|
|
7
7
|
_remotionInternalNativeLoopPassed: boolean;
|
|
8
8
|
_remotionInternalStack: string | null;
|
|
9
|
+
showInTimeline: boolean;
|
|
9
10
|
};
|
|
10
11
|
export declare const VideoForPreview: React.ForwardRefExoticComponent<Omit<VideoForPreviewProps, "ref"> & React.RefAttributes<HTMLVideoElement>>;
|
|
11
12
|
export {};
|
|
@@ -26,7 +26,7 @@ const VideoForDevelopmentRefForwardingFunction = (props, ref) => {
|
|
|
26
26
|
const isSequenceHidden = (_a = hidden[timelineId]) !== null && _a !== void 0 ? _a : false;
|
|
27
27
|
const { volume, muted, playbackRate, onlyWarnForMediaSeekingError, src, onDuration,
|
|
28
28
|
// @ts-expect-error
|
|
29
|
-
acceptableTimeShift, acceptableTimeShiftInSeconds, toneFrequency, name, _remotionInternalNativeLoopPassed, _remotionInternalStack, style, pauseWhenBuffering, ...nativeProps } = props;
|
|
29
|
+
acceptableTimeShift, acceptableTimeShiftInSeconds, toneFrequency, name, _remotionInternalNativeLoopPassed, _remotionInternalStack, style, pauseWhenBuffering, showInTimeline, ...nativeProps } = props;
|
|
30
30
|
if (typeof acceptableTimeShift !== 'undefined') {
|
|
31
31
|
throw new Error('acceptableTimeShift has been removed. Use acceptableTimeShiftInSeconds instead.');
|
|
32
32
|
}
|
|
@@ -42,7 +42,8 @@ const VideoForDevelopmentRefForwardingFunction = (props, ref) => {
|
|
|
42
42
|
playbackRate: (_b = props.playbackRate) !== null && _b !== void 0 ? _b : 1,
|
|
43
43
|
displayName: name !== null && name !== void 0 ? name : null,
|
|
44
44
|
id: timelineId,
|
|
45
|
-
stack:
|
|
45
|
+
stack: _remotionInternalStack,
|
|
46
|
+
showInTimeline,
|
|
46
47
|
});
|
|
47
48
|
(0, use_sync_volume_with_media_tag_js_1.useSyncVolumeWithMediaTag)({
|
|
48
49
|
volumePropFrame,
|
|
@@ -8,6 +8,7 @@ export declare const VideoForRendering: ForwardRefExoticComponent<Omit<React.Det
|
|
|
8
8
|
allowAmplificationDuringRender?: boolean | undefined;
|
|
9
9
|
toneFrequency?: number | undefined;
|
|
10
10
|
pauseWhenBuffering?: boolean | undefined;
|
|
11
|
+
showInTimeline?: boolean | undefined;
|
|
11
12
|
} & {
|
|
12
13
|
onDuration: (src: string, durationInSeconds: number) => void;
|
|
13
14
|
} & RefAttributes<HTMLVideoElement>>;
|
|
@@ -16,6 +16,7 @@ export type RemotionVideoProps = Omit<React.DetailedHTMLProps<React.VideoHTMLAtt
|
|
|
16
16
|
allowAmplificationDuringRender?: boolean;
|
|
17
17
|
toneFrequency?: number;
|
|
18
18
|
pauseWhenBuffering?: boolean;
|
|
19
|
+
showInTimeline?: boolean;
|
|
19
20
|
};
|
|
20
21
|
type DeprecatedOffthreadVideoProps = {
|
|
21
22
|
/**
|
|
@@ -43,5 +44,6 @@ export type OffthreadVideoProps = {
|
|
|
43
44
|
* @deprecated For internal use only
|
|
44
45
|
*/
|
|
45
46
|
stack?: string;
|
|
47
|
+
showInTimeline?: boolean;
|
|
46
48
|
} & RemotionMainVideoProps & DeprecatedOffthreadVideoProps;
|
|
47
49
|
export {};
|
package/dist/esm/index.mjs
CHANGED
|
@@ -105,7 +105,7 @@ function truthy(value) {
|
|
|
105
105
|
}
|
|
106
106
|
|
|
107
107
|
// Automatically generated on publish
|
|
108
|
-
const VERSION = '4.0.
|
|
108
|
+
const VERSION = '4.0.122';
|
|
109
109
|
|
|
110
110
|
const checkMultipleRemotionVersions = () => {
|
|
111
111
|
if (typeof globalThis === 'undefined') {
|
|
@@ -1691,7 +1691,7 @@ const warnOnce = (message) => {
|
|
|
1691
1691
|
console.warn(message);
|
|
1692
1692
|
didWarn[message] = true;
|
|
1693
1693
|
};
|
|
1694
|
-
const useMediaInTimeline = ({ volume, mediaVolume, mediaRef, src, mediaType, playbackRate, displayName, id, stack, }) => {
|
|
1694
|
+
const useMediaInTimeline = ({ volume, mediaVolume, mediaRef, src, mediaType, playbackRate, displayName, id, stack, showInTimeline, }) => {
|
|
1695
1695
|
const videoConfig = useVideoConfig();
|
|
1696
1696
|
const { rootId, audioAndVideoTags } = useContext(TimelineContext);
|
|
1697
1697
|
const parentSequence = useContext(SequenceContext);
|
|
@@ -1739,6 +1739,9 @@ const useMediaInTimeline = ({ volume, mediaVolume, mediaRef, src, mediaType, pla
|
|
|
1739
1739
|
if (!getRemotionEnvironment().isStudio && process.env.NODE_ENV !== 'test') {
|
|
1740
1740
|
return;
|
|
1741
1741
|
}
|
|
1742
|
+
if (!showInTimeline) {
|
|
1743
|
+
return;
|
|
1744
|
+
}
|
|
1742
1745
|
registerSequence({
|
|
1743
1746
|
type: mediaType,
|
|
1744
1747
|
src,
|
|
@@ -1779,6 +1782,7 @@ const useMediaInTimeline = ({ volume, mediaVolume, mediaRef, src, mediaType, pla
|
|
|
1779
1782
|
playbackRate,
|
|
1780
1783
|
displayName,
|
|
1781
1784
|
stack,
|
|
1785
|
+
showInTimeline,
|
|
1782
1786
|
]);
|
|
1783
1787
|
useEffect(() => {
|
|
1784
1788
|
const tag = {
|
|
@@ -2425,7 +2429,7 @@ const AudioForDevelopmentForwardRefFunction = (props, ref) => {
|
|
|
2425
2429
|
const [mediaVolume] = useMediaVolumeState();
|
|
2426
2430
|
const [mediaMuted] = useMediaMutedState();
|
|
2427
2431
|
const volumePropFrame = useFrameForVolumeProp();
|
|
2428
|
-
const { volume, muted, playbackRate, shouldPreMountAudioTags, src, onDuration, acceptableTimeShiftInSeconds, _remotionInternalNeedsDurationCalculation, _remotionInternalNativeLoopPassed, _remotionInternalStack, allowAmplificationDuringRender, name, pauseWhenBuffering, ...nativeProps } = props;
|
|
2432
|
+
const { volume, muted, playbackRate, shouldPreMountAudioTags, src, onDuration, acceptableTimeShiftInSeconds, _remotionInternalNeedsDurationCalculation, _remotionInternalNativeLoopPassed, _remotionInternalStack, allowAmplificationDuringRender, name, pauseWhenBuffering, showInTimeline, ...nativeProps } = props;
|
|
2429
2433
|
const { hidden } = useContext(SequenceVisibilityToggleContext);
|
|
2430
2434
|
if (!src) {
|
|
2431
2435
|
throw new TypeError("No 'src' was passed to <Audio>.");
|
|
@@ -2477,7 +2481,8 @@ const AudioForDevelopmentForwardRefFunction = (props, ref) => {
|
|
|
2477
2481
|
playbackRate: playbackRate !== null && playbackRate !== void 0 ? playbackRate : 1,
|
|
2478
2482
|
displayName: name !== null && name !== void 0 ? name : null,
|
|
2479
2483
|
id: timelineId,
|
|
2480
|
-
stack:
|
|
2484
|
+
stack: _remotionInternalStack,
|
|
2485
|
+
showInTimeline,
|
|
2481
2486
|
});
|
|
2482
2487
|
useMediaPlayback({
|
|
2483
2488
|
mediaRef: audioRef,
|
|
@@ -2746,7 +2751,7 @@ const AudioForRendering = forwardRef(AudioForRenderingRefForwardingFunction);
|
|
|
2746
2751
|
const AudioRefForwardingFunction = (props, ref) => {
|
|
2747
2752
|
var _a, _b, _c;
|
|
2748
2753
|
const audioContext = useContext(SharedAudioContext);
|
|
2749
|
-
const { startFrom, endAt, name, stack, pauseWhenBuffering, ...otherProps } = props;
|
|
2754
|
+
const { startFrom, endAt, name, stack, pauseWhenBuffering, showInTimeline, ...otherProps } = props;
|
|
2750
2755
|
const { loop, ...propsOtherThanLoop } = props;
|
|
2751
2756
|
const { fps } = useVideoConfig();
|
|
2752
2757
|
const environment = getRemotionEnvironment();
|
|
@@ -2794,7 +2799,7 @@ const AudioRefForwardingFunction = (props, ref) => {
|
|
|
2794
2799
|
}
|
|
2795
2800
|
return (jsx(AudioForPreview, { _remotionInternalNativeLoopPassed: (_c = props._remotionInternalNativeLoopPassed) !== null && _c !== void 0 ? _c : false, _remotionInternalStack: stack !== null && stack !== void 0 ? stack : null, shouldPreMountAudioTags: audioContext !== null && audioContext.numberOfAudioTags > 0, ...props, ref: ref, onError: onError, onDuration: onDuration,
|
|
2796
2801
|
// Proposal: Make this default to true in v5
|
|
2797
|
-
pauseWhenBuffering: pauseWhenBuffering !== null && pauseWhenBuffering !== void 0 ? pauseWhenBuffering : false, _remotionInternalNeedsDurationCalculation: Boolean(loop) }));
|
|
2802
|
+
pauseWhenBuffering: pauseWhenBuffering !== null && pauseWhenBuffering !== void 0 ? pauseWhenBuffering : false, _remotionInternalNeedsDurationCalculation: Boolean(loop), showInTimeline: showInTimeline !== null && showInTimeline !== void 0 ? showInTimeline : true }));
|
|
2798
2803
|
};
|
|
2799
2804
|
/**
|
|
2800
2805
|
* @description With this component, you can add audio to your video. All audio formats which are supported by Chromium are supported by the component.
|
|
@@ -4054,6 +4059,12 @@ const RemotionRoot = ({ children, numberOfAudioTags }) => {
|
|
|
4054
4059
|
return (jsx(NonceContext.Provider, { value: nonceContext, children: jsx(TimelineContext.Provider, { value: timelineContextValue, children: jsx(SetTimelineContext.Provider, { value: setTimelineContextValue, children: jsx(EditorPropsProvider, { children: jsx(PrefetchProvider, { children: jsx(NativeLayersProvider, { children: jsx(CompositionManagerProvider, { numberOfAudioTags: numberOfAudioTags, children: jsx(DurationsContextProvider, { children: jsx(BufferingProvider, { children: children }) }) }) }) }) }) }) }) }));
|
|
4055
4060
|
};
|
|
4056
4061
|
|
|
4062
|
+
// https://github.com/remotion-dev/remotion/issues/3412#issuecomment-1910120552
|
|
4063
|
+
// eslint-disable-next-line no-useless-concat
|
|
4064
|
+
function getEnvVar() {
|
|
4065
|
+
const parts = ['proc', 'ess', '.', 'en', 'v', '.', 'NOD', 'E_EN', 'V'];
|
|
4066
|
+
return parts.join('');
|
|
4067
|
+
}
|
|
4057
4068
|
const getEnvVariables = () => {
|
|
4058
4069
|
if (getRemotionEnvironment().isRendering) {
|
|
4059
4070
|
const param = window.remotion_envVariables;
|
|
@@ -4065,9 +4076,7 @@ const getEnvVariables = () => {
|
|
|
4065
4076
|
// For the Studio, we already set the environment variables in index-html.ts.
|
|
4066
4077
|
// We just add NODE_ENV here.
|
|
4067
4078
|
if (!process.env.NODE_ENV) {
|
|
4068
|
-
|
|
4069
|
-
// eslint-disable-next-line no-useless-concat
|
|
4070
|
-
throw new Error('process.en' + '' + 'v.NODE_ENV is not set');
|
|
4079
|
+
throw new Error(`${getEnvVar()} is not set`);
|
|
4071
4080
|
}
|
|
4072
4081
|
return {
|
|
4073
4082
|
NODE_ENV: process.env.NODE_ENV,
|
|
@@ -4773,7 +4782,7 @@ const VideoForDevelopmentRefForwardingFunction = (props, ref) => {
|
|
|
4773
4782
|
const isSequenceHidden = (_a = hidden[timelineId]) !== null && _a !== void 0 ? _a : false;
|
|
4774
4783
|
const { volume, muted, playbackRate, onlyWarnForMediaSeekingError, src, onDuration,
|
|
4775
4784
|
// @ts-expect-error
|
|
4776
|
-
acceptableTimeShift, acceptableTimeShiftInSeconds, toneFrequency, name, _remotionInternalNativeLoopPassed, _remotionInternalStack, style, pauseWhenBuffering, ...nativeProps } = props;
|
|
4785
|
+
acceptableTimeShift, acceptableTimeShiftInSeconds, toneFrequency, name, _remotionInternalNativeLoopPassed, _remotionInternalStack, style, pauseWhenBuffering, showInTimeline, ...nativeProps } = props;
|
|
4777
4786
|
if (typeof acceptableTimeShift !== 'undefined') {
|
|
4778
4787
|
throw new Error('acceptableTimeShift has been removed. Use acceptableTimeShiftInSeconds instead.');
|
|
4779
4788
|
}
|
|
@@ -4789,7 +4798,8 @@ const VideoForDevelopmentRefForwardingFunction = (props, ref) => {
|
|
|
4789
4798
|
playbackRate: (_b = props.playbackRate) !== null && _b !== void 0 ? _b : 1,
|
|
4790
4799
|
displayName: name !== null && name !== void 0 ? name : null,
|
|
4791
4800
|
id: timelineId,
|
|
4792
|
-
stack:
|
|
4801
|
+
stack: _remotionInternalStack,
|
|
4802
|
+
showInTimeline,
|
|
4793
4803
|
});
|
|
4794
4804
|
useSyncVolumeWithMediaTag({
|
|
4795
4805
|
volumePropFrame,
|
|
@@ -4903,7 +4913,7 @@ const VideoForPreview = forwardRef(VideoForDevelopmentRefForwardingFunction);
|
|
|
4903
4913
|
const OffthreadVideo = (props) => {
|
|
4904
4914
|
// Should only destruct `startFrom` and `endAt` from props,
|
|
4905
4915
|
// rest gets drilled down
|
|
4906
|
-
const { startFrom, endAt, name, pauseWhenBuffering, stack, ...otherProps } = props;
|
|
4916
|
+
const { startFrom, endAt, name, pauseWhenBuffering, stack, showInTimeline, ...otherProps } = props;
|
|
4907
4917
|
const environment = getRemotionEnvironment();
|
|
4908
4918
|
const onDuration = useCallback(() => undefined, []);
|
|
4909
4919
|
if (typeof props.src !== 'string') {
|
|
@@ -4923,7 +4933,7 @@ const OffthreadVideo = (props) => {
|
|
|
4923
4933
|
return jsx(OffthreadVideoForRendering, { ...otherProps });
|
|
4924
4934
|
}
|
|
4925
4935
|
const { transparent, toneMapped, ...withoutTransparent } = otherProps;
|
|
4926
|
-
return (jsx(VideoForPreview, { _remotionInternalStack: stack !== null && stack !== void 0 ? stack : null, _remotionInternalNativeLoopPassed: false, onDuration: onDuration, onlyWarnForMediaSeekingError: true, pauseWhenBuffering: pauseWhenBuffering !== null && pauseWhenBuffering !== void 0 ? pauseWhenBuffering : false, ...withoutTransparent }));
|
|
4936
|
+
return (jsx(VideoForPreview, { _remotionInternalStack: stack !== null && stack !== void 0 ? stack : null, _remotionInternalNativeLoopPassed: false, onDuration: onDuration, onlyWarnForMediaSeekingError: true, pauseWhenBuffering: pauseWhenBuffering !== null && pauseWhenBuffering !== void 0 ? pauseWhenBuffering : false, showInTimeline: showInTimeline !== null && showInTimeline !== void 0 ? showInTimeline : true, ...withoutTransparent }));
|
|
4927
4937
|
};
|
|
4928
4938
|
|
|
4929
4939
|
const roundTo6Commas = (num) => {
|
|
@@ -5194,7 +5204,7 @@ const VideoForRendering = forwardRef(VideoForRenderingForwardFunction);
|
|
|
5194
5204
|
|
|
5195
5205
|
const VideoForwardingFunction = (props, ref) => {
|
|
5196
5206
|
var _a, _b;
|
|
5197
|
-
const { startFrom, endAt, name, pauseWhenBuffering, stack, _remotionInternalNativeLoopPassed, ...otherProps } = props;
|
|
5207
|
+
const { startFrom, endAt, name, pauseWhenBuffering, stack, _remotionInternalNativeLoopPassed, showInTimeline, ...otherProps } = props;
|
|
5198
5208
|
const { loop, ...propsOtherThanLoop } = props;
|
|
5199
5209
|
const { fps } = useVideoConfig();
|
|
5200
5210
|
const environment = getRemotionEnvironment();
|
|
@@ -5231,7 +5241,7 @@ const VideoForwardingFunction = (props, ref) => {
|
|
|
5231
5241
|
}
|
|
5232
5242
|
return (jsx(VideoForPreview, { onlyWarnForMediaSeekingError: false, ...otherProps, ref: ref,
|
|
5233
5243
|
// Proposal: Make this default to true in v5
|
|
5234
|
-
pauseWhenBuffering: pauseWhenBuffering !== null && pauseWhenBuffering !== void 0 ? pauseWhenBuffering : false, onDuration: onDuration, _remotionInternalStack: stack !== null && stack !== void 0 ? stack : null, _remotionInternalNativeLoopPassed: _remotionInternalNativeLoopPassed !== null && _remotionInternalNativeLoopPassed !== void 0 ? _remotionInternalNativeLoopPassed : false }));
|
|
5244
|
+
pauseWhenBuffering: pauseWhenBuffering !== null && pauseWhenBuffering !== void 0 ? pauseWhenBuffering : false, onDuration: onDuration, _remotionInternalStack: stack !== null && stack !== void 0 ? stack : null, _remotionInternalNativeLoopPassed: _remotionInternalNativeLoopPassed !== null && _remotionInternalNativeLoopPassed !== void 0 ? _remotionInternalNativeLoopPassed : false, showInTimeline: showInTimeline !== null && showInTimeline !== void 0 ? showInTimeline : true }));
|
|
5235
5245
|
};
|
|
5236
5246
|
/**
|
|
5237
5247
|
* @description allows you to include a video file in your Remotion project. It wraps the native HTMLVideoElement.
|
package/dist/esm/version.mjs
CHANGED
package/package.json
CHANGED
package/dist/cjs/use-buffer.d.ts
DELETED
package/dist/cjs/use-buffer.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useBufferState = void 0;
|
|
4
|
-
const react_1 = require("react");
|
|
5
|
-
const buffering_1 = require("./buffering");
|
|
6
|
-
const CanUseRemotionHooks_1 = require("./CanUseRemotionHooks");
|
|
7
|
-
const useBufferState = () => {
|
|
8
|
-
const canUseRemotionHooks = (0, react_1.useContext)(CanUseRemotionHooks_1.CanUseRemotionHooks);
|
|
9
|
-
if (!canUseRemotionHooks) {
|
|
10
|
-
if (typeof window !== 'undefined' && window.remotion_isPlayer) {
|
|
11
|
-
throw new Error(`useCurrentFrame can only be called inside a component that was passed to <Player>. See: https://www.remotion.dev/docs/player/examples`);
|
|
12
|
-
}
|
|
13
|
-
throw new Error(`useCurrentFrame() can only be called inside a component that was registered as a composition. See https://www.remotion.dev/docs/the-fundamentals#defining-compositions`);
|
|
14
|
-
}
|
|
15
|
-
const buffer = (0, react_1.useContext)(buffering_1.BufferingContextReact);
|
|
16
|
-
if (!buffer) {
|
|
17
|
-
throw new Error('BufferingContextReact was unexpectedly not found. Most likely your Remotion versions are mismatching.');
|
|
18
|
-
}
|
|
19
|
-
return (0, react_1.useMemo)(() => ({
|
|
20
|
-
delayPlayback: () => {
|
|
21
|
-
const { unblock } = buffer.addBlock({
|
|
22
|
-
id: String(Math.random()),
|
|
23
|
-
});
|
|
24
|
-
return { unblock };
|
|
25
|
-
},
|
|
26
|
-
}), [buffer]);
|
|
27
|
-
};
|
|
28
|
-
exports.useBufferState = useBufferState;
|