remotion 4.0.142 → 4.0.144
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/LICENSE.md +4 -0
- package/bunfig.toml +2 -0
- package/dist/cjs/CanUseRemotionHooks.d.ts +1 -1
- package/dist/cjs/Img.js +3 -2
- package/dist/cjs/Sequence.d.ts +14 -13
- package/dist/cjs/audio/Audio.d.ts +2 -1
- package/dist/cjs/audio/AudioForPreview.d.ts +7 -6
- package/dist/cjs/audio/AudioForPreview.js +2 -2
- package/dist/cjs/audio/AudioForRendering.d.ts +1 -0
- package/dist/cjs/audio/AudioForRendering.js +2 -2
- package/dist/cjs/audio/props.d.ts +2 -0
- package/dist/cjs/audio/use-audio-frame.d.ts +2 -1
- package/dist/cjs/audio/use-audio-frame.js +7 -2
- package/dist/cjs/default-css.d.ts +1 -1
- package/dist/cjs/default-css.js +3 -3
- package/dist/cjs/get-static-files.js +4 -0
- package/dist/cjs/index.d.ts +3 -3
- package/dist/cjs/internals.d.ts +1 -6
- package/dist/cjs/internals.js +0 -5
- package/dist/cjs/interpolate.d.ts +1 -1
- package/dist/cjs/loop/index.d.ts +13 -5
- package/dist/cjs/loop/index.js +38 -3
- package/dist/cjs/no-react.d.ts +5 -0
- package/dist/cjs/no-react.js +4 -0
- package/dist/cjs/series/index.js +4 -3
- package/dist/cjs/series/is-inside-series.d.ts +9 -0
- package/dist/cjs/series/is-inside-series.js +44 -0
- package/dist/cjs/spring/index.d.ts +2 -2
- package/dist/cjs/spring/index.js +8 -9
- package/dist/cjs/spring/measure-spring.d.ts +1 -1
- package/dist/cjs/spring/measure-spring.js +0 -2
- package/dist/cjs/spring/spring-utils.d.ts +1 -3
- package/dist/cjs/spring/spring-utils.js +3 -3
- package/dist/cjs/use-video-config.d.ts +1 -2
- package/dist/cjs/use-video-config.js +1 -2
- package/dist/cjs/version.d.ts +6 -1
- package/dist/cjs/version.js +7 -2
- package/dist/cjs/video/OffthreadVideoForRendering.js +2 -2
- package/dist/cjs/video/Video.d.ts +3 -2
- package/dist/cjs/video/VideoForPreview.d.ts +7 -7
- package/dist/cjs/video/VideoForPreview.js +5 -7
- package/dist/cjs/video/VideoForRendering.d.ts +1 -0
- package/dist/cjs/video/VideoForRendering.js +2 -2
- package/dist/cjs/video/index.d.ts +1 -1
- package/dist/cjs/video/props.d.ts +3 -0
- package/dist/cjs/video/video-fragment.js +9 -5
- package/dist/cjs/watch-static-file.js +4 -0
- package/dist/esm/index.mjs +576 -546
- package/dist/esm/no-react.mjs +3 -0
- package/dist/esm/version.mjs +6 -1
- package/ensure-correct-version.ts +47 -0
- package/happydom.ts +6 -0
- package/package.json +3 -1
- package/test.ts +1 -0
|
@@ -11,9 +11,7 @@ export type SpringConfig = {
|
|
|
11
11
|
stiffness: number;
|
|
12
12
|
overshootClamping: boolean;
|
|
13
13
|
};
|
|
14
|
-
export declare function springCalculation({
|
|
15
|
-
from?: number;
|
|
16
|
-
to?: number;
|
|
14
|
+
export declare function springCalculation({ frame, fps, config, }: {
|
|
17
15
|
frame: number;
|
|
18
16
|
fps: number;
|
|
19
17
|
config?: Partial<SpringConfig>;
|
|
@@ -60,10 +60,10 @@ function advance({ animation, now, config, }) {
|
|
|
60
60
|
return animationNode;
|
|
61
61
|
}
|
|
62
62
|
const calculationCache = {};
|
|
63
|
-
function springCalculation({
|
|
63
|
+
function springCalculation({ frame, fps, config = {}, }) {
|
|
64
|
+
const from = 0;
|
|
65
|
+
const to = 1;
|
|
64
66
|
const cacheKey = [
|
|
65
|
-
from,
|
|
66
|
-
to,
|
|
67
67
|
frame,
|
|
68
68
|
fps,
|
|
69
69
|
config.damping,
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import type { VideoConfig } from './video-config.js';
|
|
2
2
|
/**
|
|
3
|
-
* /**
|
|
4
3
|
* @description Get some info about the context of the video that you are making.
|
|
5
4
|
* @see [Documentation](https://www.remotion.dev/docs/use-video-config)
|
|
6
|
-
* @returns Returns an object containing `fps`, `width`, `height
|
|
5
|
+
* @returns Returns an object containing `fps`, `width`, `height`, `durationInFrames`, `id` and `defaultProps`.
|
|
7
6
|
*/
|
|
8
7
|
export declare const useVideoConfig: () => VideoConfig;
|
|
@@ -6,10 +6,9 @@ const CanUseRemotionHooks_js_1 = require("./CanUseRemotionHooks.js");
|
|
|
6
6
|
const is_player_js_1 = require("./is-player.js");
|
|
7
7
|
const use_unsafe_video_config_js_1 = require("./use-unsafe-video-config.js");
|
|
8
8
|
/**
|
|
9
|
-
* /**
|
|
10
9
|
* @description Get some info about the context of the video that you are making.
|
|
11
10
|
* @see [Documentation](https://www.remotion.dev/docs/use-video-config)
|
|
12
|
-
* @returns Returns an object containing `fps`, `width`, `height
|
|
11
|
+
* @returns Returns an object containing `fps`, `width`, `height`, `durationInFrames`, `id` and `defaultProps`.
|
|
13
12
|
*/
|
|
14
13
|
const useVideoConfig = () => {
|
|
15
14
|
const videoConfig = (0, use_unsafe_video_config_js_1.useUnsafeVideoConfig)();
|
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* @description Provides the current version number of the Remotion library.
|
|
3
|
+
* @see [Documentation](https://remotion.dev/docs/version)
|
|
4
|
+
* @returns {string} The current version of the remotion package
|
|
5
|
+
*/
|
|
6
|
+
export declare const VERSION = "4.0.144";
|
package/dist/cjs/version.js
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
// Automatically generated on publish
|
|
2
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
4
|
exports.VERSION = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
5
|
+
/**
|
|
6
|
+
* @description Provides the current version number of the Remotion library.
|
|
7
|
+
* @see [Documentation](https://remotion.dev/docs/version)
|
|
8
|
+
* @returns {string} The current version of the remotion package
|
|
9
|
+
*/
|
|
10
|
+
exports.VERSION = '4.0.144';
|
|
@@ -18,10 +18,10 @@ const use_unsafe_video_config_js_1 = require("../use-unsafe-video-config.js");
|
|
|
18
18
|
const volume_prop_js_1 = require("../volume-prop.js");
|
|
19
19
|
const get_current_time_js_1 = require("./get-current-time.js");
|
|
20
20
|
const offthread_video_source_js_1 = require("./offthread-video-source.js");
|
|
21
|
-
const OffthreadVideoForRendering = ({ onError, volume: volumeProp, playbackRate, src, muted, allowAmplificationDuringRender, transparent = false, toneMapped = true, toneFrequency, name, ...props }) => {
|
|
21
|
+
const OffthreadVideoForRendering = ({ onError, volume: volumeProp, playbackRate, src, muted, allowAmplificationDuringRender, transparent = false, toneMapped = true, toneFrequency, name, loopVolumeCurveBehavior, ...props }) => {
|
|
22
22
|
const absoluteFrame = (0, timeline_position_state_js_1.useTimelinePosition)();
|
|
23
23
|
const frame = (0, use_current_frame_js_1.useCurrentFrame)();
|
|
24
|
-
const volumePropsFrame = (0, use_audio_frame_js_1.useFrameForVolumeProp)();
|
|
24
|
+
const volumePropsFrame = (0, use_audio_frame_js_1.useFrameForVolumeProp)(loopVolumeCurveBehavior !== null && loopVolumeCurveBehavior !== void 0 ? loopVolumeCurveBehavior : 'repeat');
|
|
25
25
|
const videoConfig = (0, use_unsafe_video_config_js_1.useUnsafeVideoConfig)();
|
|
26
26
|
const sequenceContext = (0, react_1.useContext)(SequenceContext_js_1.SequenceContext);
|
|
27
27
|
const mediaStartsAt = (0, use_audio_frame_js_1.useMediaStartsAt)();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { RemotionMainVideoProps } from './props
|
|
2
|
+
import type { RemotionMainVideoProps } from './props';
|
|
3
3
|
/**
|
|
4
4
|
* @description allows you to include a video file in your Remotion project. It wraps the native HTMLVideoElement.
|
|
5
5
|
* @see [Documentation](https://www.remotion.dev/docs/video)
|
|
@@ -14,10 +14,11 @@ export declare const Video: React.ForwardRefExoticComponent<Omit<Omit<React.Deta
|
|
|
14
14
|
pauseWhenBuffering?: boolean | undefined;
|
|
15
15
|
showInTimeline?: boolean | undefined;
|
|
16
16
|
delayRenderTimeoutInMilliseconds?: number | undefined;
|
|
17
|
+
loopVolumeCurveBehavior?: import("../audio/use-audio-frame.js").LoopVolumeCurveBehavior | undefined;
|
|
17
18
|
delayRenderRetries?: number | undefined;
|
|
18
19
|
} & RemotionMainVideoProps & {
|
|
19
20
|
/**
|
|
20
21
|
* @deprecated For internal use only
|
|
21
22
|
*/
|
|
22
|
-
stack?: string | undefined;
|
|
23
|
+
readonly stack?: string | undefined;
|
|
23
24
|
}, "ref"> & React.RefAttributes<HTMLVideoElement>>;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { RemotionVideoProps } from './props
|
|
2
|
+
import type { RemotionVideoProps } from './props';
|
|
3
3
|
type VideoForPreviewProps = RemotionVideoProps & {
|
|
4
|
-
onlyWarnForMediaSeekingError: boolean;
|
|
5
|
-
onDuration: (src: string, durationInSeconds: number) => void;
|
|
6
|
-
pauseWhenBuffering: boolean;
|
|
7
|
-
_remotionInternalNativeLoopPassed: boolean;
|
|
8
|
-
_remotionInternalStack: string | null;
|
|
9
|
-
showInTimeline: boolean;
|
|
4
|
+
readonly onlyWarnForMediaSeekingError: boolean;
|
|
5
|
+
readonly onDuration: (src: string, durationInSeconds: number) => void;
|
|
6
|
+
readonly pauseWhenBuffering: boolean;
|
|
7
|
+
readonly _remotionInternalNativeLoopPassed: boolean;
|
|
8
|
+
readonly _remotionInternalStack: string | null;
|
|
9
|
+
readonly showInTimeline: boolean;
|
|
10
10
|
};
|
|
11
11
|
export declare const VideoForPreview: React.ForwardRefExoticComponent<Omit<VideoForPreviewProps, "ref"> & React.RefAttributes<HTMLVideoElement>>;
|
|
12
12
|
export {};
|
|
@@ -18,15 +18,15 @@ const video_fragment_js_1 = require("./video-fragment.js");
|
|
|
18
18
|
const VideoForDevelopmentRefForwardingFunction = (props, ref) => {
|
|
19
19
|
var _a, _b, _c;
|
|
20
20
|
const videoRef = (0, react_1.useRef)(null);
|
|
21
|
-
const
|
|
21
|
+
const { volume, muted, playbackRate, onlyWarnForMediaSeekingError, src, onDuration,
|
|
22
|
+
// @ts-expect-error
|
|
23
|
+
acceptableTimeShift, acceptableTimeShiftInSeconds, toneFrequency, name, _remotionInternalNativeLoopPassed, _remotionInternalStack, style, pauseWhenBuffering, showInTimeline, loopVolumeCurveBehavior, ...nativeProps } = props;
|
|
24
|
+
const volumePropFrame = (0, use_audio_frame_js_1.useFrameForVolumeProp)(loopVolumeCurveBehavior !== null && loopVolumeCurveBehavior !== void 0 ? loopVolumeCurveBehavior : 'repeat');
|
|
22
25
|
const { fps, durationInFrames } = (0, use_video_config_js_1.useVideoConfig)();
|
|
23
26
|
const parentSequence = (0, react_1.useContext)(SequenceContext_js_1.SequenceContext);
|
|
24
27
|
const { hidden } = (0, react_1.useContext)(SequenceManager_js_1.SequenceVisibilityToggleContext);
|
|
25
28
|
const [timelineId] = (0, react_1.useState)(() => String(Math.random()));
|
|
26
29
|
const isSequenceHidden = (_a = hidden[timelineId]) !== null && _a !== void 0 ? _a : false;
|
|
27
|
-
const { volume, muted, playbackRate, onlyWarnForMediaSeekingError, src, onDuration,
|
|
28
|
-
// @ts-expect-error
|
|
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
|
}
|
|
@@ -66,9 +66,7 @@ const VideoForDevelopmentRefForwardingFunction = (props, ref) => {
|
|
|
66
66
|
shouldBuffer: pauseWhenBuffering,
|
|
67
67
|
isPremounting: Boolean(parentSequence === null || parentSequence === void 0 ? void 0 : parentSequence.premounting),
|
|
68
68
|
});
|
|
69
|
-
const actualFrom = parentSequence
|
|
70
|
-
? parentSequence.relativeFrom + parentSequence.cumulatedFrom
|
|
71
|
-
: 0;
|
|
69
|
+
const actualFrom = parentSequence ? parentSequence.relativeFrom : 0;
|
|
72
70
|
const duration = parentSequence
|
|
73
71
|
? Math.min(parentSequence.durationInFrames, durationInFrames)
|
|
74
72
|
: durationInFrames;
|
|
@@ -10,6 +10,7 @@ export declare const VideoForRendering: ForwardRefExoticComponent<Omit<React.Det
|
|
|
10
10
|
pauseWhenBuffering?: boolean | undefined;
|
|
11
11
|
showInTimeline?: boolean | undefined;
|
|
12
12
|
delayRenderTimeoutInMilliseconds?: number | undefined;
|
|
13
|
+
loopVolumeCurveBehavior?: import("../audio/use-audio-frame.js").LoopVolumeCurveBehavior | undefined;
|
|
13
14
|
delayRenderRetries?: number | undefined;
|
|
14
15
|
} & {
|
|
15
16
|
readonly onDuration: (src: string, durationInSeconds: number) => void;
|
|
@@ -17,10 +17,10 @@ const use_unsafe_video_config_js_1 = require("../use-unsafe-video-config.js");
|
|
|
17
17
|
const volume_prop_js_1 = require("../volume-prop.js");
|
|
18
18
|
const get_current_time_js_1 = require("./get-current-time.js");
|
|
19
19
|
const seek_until_right_js_1 = require("./seek-until-right.js");
|
|
20
|
-
const VideoForRenderingForwardFunction = ({ onError, volume: volumeProp, allowAmplificationDuringRender, playbackRate, onDuration, toneFrequency, name, acceptableTimeShiftInSeconds, delayRenderRetries, delayRenderTimeoutInMilliseconds, ...props }, ref) => {
|
|
20
|
+
const VideoForRenderingForwardFunction = ({ onError, volume: volumeProp, allowAmplificationDuringRender, playbackRate, onDuration, toneFrequency, name, acceptableTimeShiftInSeconds, delayRenderRetries, delayRenderTimeoutInMilliseconds, loopVolumeCurveBehavior, ...props }, ref) => {
|
|
21
21
|
const absoluteFrame = (0, timeline_position_state_js_1.useTimelinePosition)();
|
|
22
22
|
const frame = (0, use_current_frame_js_1.useCurrentFrame)();
|
|
23
|
-
const volumePropsFrame = (0, use_audio_frame_js_1.useFrameForVolumeProp)();
|
|
23
|
+
const volumePropsFrame = (0, use_audio_frame_js_1.useFrameForVolumeProp)(loopVolumeCurveBehavior !== null && loopVolumeCurveBehavior !== void 0 ? loopVolumeCurveBehavior : 'repeat');
|
|
24
24
|
const videoConfig = (0, use_unsafe_video_config_js_1.useUnsafeVideoConfig)();
|
|
25
25
|
const videoRef = (0, react_1.useRef)(null);
|
|
26
26
|
const sequenceContext = (0, react_1.useContext)(SequenceContext_js_1.SequenceContext);
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { OffthreadVideo } from './OffthreadVideo.js';
|
|
2
2
|
export { Video } from './Video.js';
|
|
3
|
-
export { RemotionMainVideoProps, OffthreadVideoProps as RemotionOffthreadVideoProps, RemotionVideoProps, } from './props
|
|
3
|
+
export type { RemotionMainVideoProps, OffthreadVideoProps as RemotionOffthreadVideoProps, RemotionVideoProps, } from './props';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
|
+
import type { LoopVolumeCurveBehavior } from '../audio/use-audio-frame.js';
|
|
2
3
|
import type { VolumeProp } from '../volume-prop.js';
|
|
3
4
|
export type RemotionMainVideoProps = {
|
|
4
5
|
startFrom?: number;
|
|
@@ -18,6 +19,7 @@ export type RemotionVideoProps = Omit<React.DetailedHTMLProps<React.VideoHTMLAtt
|
|
|
18
19
|
pauseWhenBuffering?: boolean;
|
|
19
20
|
showInTimeline?: boolean;
|
|
20
21
|
delayRenderTimeoutInMilliseconds?: number;
|
|
22
|
+
loopVolumeCurveBehavior?: LoopVolumeCurveBehavior;
|
|
21
23
|
delayRenderRetries?: number;
|
|
22
24
|
};
|
|
23
25
|
type DeprecatedOffthreadVideoProps = {
|
|
@@ -42,6 +44,7 @@ export type OffthreadVideoProps = {
|
|
|
42
44
|
transparent?: boolean;
|
|
43
45
|
toneMapped?: boolean;
|
|
44
46
|
pauseWhenBuffering?: boolean;
|
|
47
|
+
loopVolumeCurveBehavior?: LoopVolumeCurveBehavior;
|
|
45
48
|
/**
|
|
46
49
|
* @deprecated For internal use only
|
|
47
50
|
*/
|
|
@@ -41,15 +41,19 @@ const appendVideoFragment = ({ actualSrc, actualFrom, duration, fps, }) => {
|
|
|
41
41
|
return actualSrc;
|
|
42
42
|
};
|
|
43
43
|
exports.appendVideoFragment = appendVideoFragment;
|
|
44
|
-
const isSubsetOfDuration = (prevStartFrom, newStartFrom, prevDuration, newDuration) =>
|
|
45
|
-
|
|
46
|
-
prevStartFrom + prevDuration >= newStartFrom + newDuration);
|
|
47
|
-
};
|
|
44
|
+
const isSubsetOfDuration = ({ prevStartFrom, newStartFrom, prevDuration, newDuration, }) => prevStartFrom <= newStartFrom &&
|
|
45
|
+
prevStartFrom + prevDuration >= newStartFrom + newDuration;
|
|
48
46
|
const useAppendVideoFragment = ({ actualSrc: initialActualSrc, actualFrom: initialActualFrom, duration: initialDuration, fps, }) => {
|
|
49
47
|
const actualFromRef = (0, react_1.useRef)(initialActualFrom);
|
|
50
48
|
const actualDuration = (0, react_1.useRef)(initialDuration);
|
|
51
49
|
const actualSrc = (0, react_1.useRef)(initialActualSrc);
|
|
52
|
-
if (!isSubsetOfDuration
|
|
50
|
+
if (!isSubsetOfDuration({
|
|
51
|
+
prevStartFrom: actualFromRef.current,
|
|
52
|
+
newStartFrom: initialActualFrom,
|
|
53
|
+
prevDuration: actualDuration.current,
|
|
54
|
+
newDuration: initialDuration,
|
|
55
|
+
}) ||
|
|
56
|
+
initialActualSrc !== actualSrc.current) {
|
|
53
57
|
actualFromRef.current = initialActualFrom;
|
|
54
58
|
actualDuration.current = initialDuration;
|
|
55
59
|
actualSrc.current = initialActualSrc;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.watchStaticFile = exports.WATCH_REMOTION_STATIC_FILES = void 0;
|
|
4
4
|
const get_remotion_environment_1 = require("./get-remotion-environment");
|
|
5
|
+
const v5_flag_1 = require("./v5-flag");
|
|
5
6
|
exports.WATCH_REMOTION_STATIC_FILES = 'remotion_staticFilesChanged';
|
|
6
7
|
/**
|
|
7
8
|
* @description Watch for changes in a specific static file.
|
|
@@ -11,6 +12,9 @@ exports.WATCH_REMOTION_STATIC_FILES = 'remotion_staticFilesChanged';
|
|
|
11
12
|
* @see [Documentation](https://www.remotion.dev/docs/watchstaticfile)
|
|
12
13
|
*/
|
|
13
14
|
const watchStaticFile = (fileName, callback) => {
|
|
15
|
+
if (v5_flag_1.ENABLE_V5_BREAKING_CHANGES) {
|
|
16
|
+
throw new Error('watchStaticFile() has moved into the `@remotion/studio` package. Update your imports.');
|
|
17
|
+
}
|
|
14
18
|
// Check if function is called in Remotion Studio
|
|
15
19
|
if (!(0, get_remotion_environment_1.getRemotionEnvironment)().isStudio) {
|
|
16
20
|
// eslint-disable-next-line no-console
|