remotion 3.3.89 → 3.3.91

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.
@@ -13,8 +13,9 @@ import type { SpringConfig } from './spring-utils.js';
13
13
  * @param {?number} [config.to] The end value of the animation. Default `1`
14
14
  * @param {?number} [config.durationInFrames] Stretch the duration of an animation to a set value.. Default `undefined`
15
15
  * @param {?number} [config.durationThreshold] How close to the end the animation is considered to be done. Default `0.005`
16
+ * @param {?number} [config.delay] Delay the animation for this amount of frames. Default `0`
16
17
  */
17
- export declare function spring({ frame, fps, config, from, to, durationInFrames, durationRestThreshold, }: {
18
+ export declare function spring({ frame: passedFrame, fps, config, from, to, durationInFrames, durationRestThreshold, delay, }: {
18
19
  frame: number;
19
20
  fps: number;
20
21
  config?: Partial<SpringConfig>;
@@ -22,6 +23,7 @@ export declare function spring({ frame, fps, config, from, to, durationInFrames,
22
23
  to?: number;
23
24
  durationInFrames?: number;
24
25
  durationRestThreshold?: number;
26
+ delay?: number;
25
27
  }): number;
26
28
  export { measureSpring } from './measure-spring.js';
27
29
  export { SpringConfig } from './spring-utils.js';
@@ -20,10 +20,15 @@ const spring_utils_js_1 = require("./spring-utils.js");
20
20
  * @param {?number} [config.to] The end value of the animation. Default `1`
21
21
  * @param {?number} [config.durationInFrames] Stretch the duration of an animation to a set value.. Default `undefined`
22
22
  * @param {?number} [config.durationThreshold] How close to the end the animation is considered to be done. Default `0.005`
23
+ * @param {?number} [config.delay] Delay the animation for this amount of frames. Default `0`
23
24
  */
24
- function spring({ frame, fps, config = {}, from = 0, to = 1, durationInFrames, durationRestThreshold, }) {
25
+ function spring({ frame: passedFrame, fps, config = {}, from = 0, to = 1, durationInFrames, durationRestThreshold, delay = 0, }) {
25
26
  (0, validation_spring_duration_js_1.validateSpringDuration)(durationInFrames);
26
- (0, validate_frame_js_1.validateFrame)({ frame, durationInFrames: Infinity, allowFloats: true });
27
+ (0, validate_frame_js_1.validateFrame)({
28
+ frame: passedFrame,
29
+ durationInFrames: Infinity,
30
+ allowFloats: true,
31
+ });
27
32
  (0, validate_fps_js_1.validateFps)(fps, 'to spring()', false);
28
33
  const durationRatio = durationInFrames === undefined
29
34
  ? 1
@@ -35,6 +40,8 @@ function spring({ frame, fps, config = {}, from = 0, to = 1, durationInFrames, d
35
40
  to,
36
41
  threshold: durationRestThreshold,
37
42
  });
43
+ // Delay the spring by telling the calculation we're at an earlier frame.
44
+ const frame = passedFrame - delay;
38
45
  const spr = (0, spring_utils_js_1.springCalculation)({
39
46
  fps,
40
47
  frame: frame / durationRatio,
@@ -1 +1 @@
1
- export declare const VERSION = "3.3.89";
1
+ export declare const VERSION = "3.3.91";
@@ -2,4 +2,4 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
4
  // Automatically generated on publish
5
- exports.VERSION = '3.3.89';
5
+ exports.VERSION = '3.3.91';
@@ -15,7 +15,7 @@ const VideoForDevelopment_js_1 = require("./VideoForDevelopment.js");
15
15
  * @see [Documentation](https://www.remotion.dev/docs/offthreadvideo)
16
16
  */
17
17
  const OffthreadVideo = (props) => {
18
- const { startFrom, endAt, ...otherProps } = props;
18
+ const { startFrom, endAt, imageFormat, ...otherProps } = props;
19
19
  const environment = (0, get_environment_js_1.useRemotionEnvironment)();
20
20
  const onDuration = (0, react_1.useCallback)(() => undefined, []);
21
21
  if (typeof props.src !== 'string') {
@@ -30,7 +30,7 @@ const OffthreadVideo = (props) => {
30
30
  (0, validate_media_props_js_1.validateMediaProps)(props, 'Video');
31
31
  (0, validate_offthreadvideo_image_format_js_1.validateOffthreadVideoImageFormat)(props.imageFormat);
32
32
  if (environment === 'rendering') {
33
- return (0, jsx_runtime_1.jsx)(OffthreadVideoForRendering_js_1.OffthreadVideoForRendering, { ...otherProps });
33
+ return ((0, jsx_runtime_1.jsx)(OffthreadVideoForRendering_js_1.OffthreadVideoForRendering, { imageFormat: imageFormat, ...otherProps }));
34
34
  }
35
35
  return ((0, jsx_runtime_1.jsx)(VideoForDevelopment_js_1.VideoForDevelopment, { onDuration: onDuration, onlyWarnForMediaSeekingError: true, ...otherProps }));
36
36
  };
@@ -58,7 +58,7 @@ function truthy(value) {
58
58
  }
59
59
 
60
60
  // Automatically generated on publish
61
- const VERSION = '3.3.89';
61
+ const VERSION = '3.3.91';
62
62
 
63
63
  const checkMultipleRemotionVersions = () => {
64
64
  if (typeof globalThis === 'undefined') {
@@ -3571,10 +3571,15 @@ function measureSpring({ fps, config = {}, threshold = 0.005, from = 0, to = 1,
3571
3571
  * @param {?number} [config.to] The end value of the animation. Default `1`
3572
3572
  * @param {?number} [config.durationInFrames] Stretch the duration of an animation to a set value.. Default `undefined`
3573
3573
  * @param {?number} [config.durationThreshold] How close to the end the animation is considered to be done. Default `0.005`
3574
+ * @param {?number} [config.delay] Delay the animation for this amount of frames. Default `0`
3574
3575
  */
3575
- function spring({ frame, fps, config = {}, from = 0, to = 1, durationInFrames, durationRestThreshold, }) {
3576
+ function spring({ frame: passedFrame, fps, config = {}, from = 0, to = 1, durationInFrames, durationRestThreshold, delay = 0, }) {
3576
3577
  validateSpringDuration(durationInFrames);
3577
- validateFrame({ frame, durationInFrames: Infinity, allowFloats: true });
3578
+ validateFrame({
3579
+ frame: passedFrame,
3580
+ durationInFrames: Infinity,
3581
+ allowFloats: true,
3582
+ });
3578
3583
  validateFps(fps, 'to spring()', false);
3579
3584
  const durationRatio = durationInFrames === undefined
3580
3585
  ? 1
@@ -3586,6 +3591,8 @@ function spring({ frame, fps, config = {}, from = 0, to = 1, durationInFrames, d
3586
3591
  to,
3587
3592
  threshold: durationRestThreshold,
3588
3593
  });
3594
+ // Delay the spring by telling the calculation we're at an earlier frame.
3595
+ const frame = passedFrame - delay;
3589
3596
  const spr = springCalculation({
3590
3597
  fps,
3591
3598
  frame: frame / durationRatio,
@@ -3903,7 +3910,7 @@ const VideoForDevelopment = forwardRef(VideoForDevelopmentRefForwardingFunction)
3903
3910
  * @see [Documentation](https://www.remotion.dev/docs/offthreadvideo)
3904
3911
  */
3905
3912
  const OffthreadVideo = (props) => {
3906
- const { startFrom, endAt, ...otherProps } = props;
3913
+ const { startFrom, endAt, imageFormat, ...otherProps } = props;
3907
3914
  const environment = useRemotionEnvironment();
3908
3915
  const onDuration = useCallback(() => undefined, []);
3909
3916
  if (typeof props.src !== 'string') {
@@ -3918,7 +3925,7 @@ const OffthreadVideo = (props) => {
3918
3925
  validateMediaProps(props, 'Video');
3919
3926
  validateOffthreadVideoImageFormat(props.imageFormat);
3920
3927
  if (environment === 'rendering') {
3921
- return jsx(OffthreadVideoForRendering, { ...otherProps });
3928
+ return (jsx(OffthreadVideoForRendering, { imageFormat: imageFormat, ...otherProps }));
3922
3929
  }
3923
3930
  return (jsx(VideoForDevelopment, { onDuration: onDuration, onlyWarnForMediaSeekingError: true, ...otherProps }));
3924
3931
  };
@@ -1,4 +1,4 @@
1
1
  // Automatically generated on publish
2
- const VERSION = '3.3.89';
2
+ const VERSION = '3.3.91';
3
3
 
4
4
  export { VERSION };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "remotion",
3
- "version": "3.3.89",
3
+ "version": "3.3.91",
4
4
  "description": "Render videos in React",
5
5
  "main": "dist/cjs/index.js",
6
6
  "types": "dist/cjs/index.d.ts",