remotion 3.3.15 → 3.3.16

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.
@@ -1,4 +1,4 @@
1
1
 
2
- > remotion@3.3.14 build /Users/jonathanburger/remotion/packages/core
2
+ > remotion@3.3.15 build /Users/jonathanburger/remotion/packages/core
3
3
  > tsc -d
4
4
 
package/README.md CHANGED
@@ -11,7 +11,7 @@
11
11
  [![NPM Version](https://img.shields.io/npm/v/remotion.svg?style=flat)](https://www.npmjs.org/package/remotion)
12
12
  [![NPM Downloads](https://img.shields.io/npm/dm/remotion.svg?style=flat)](https://npmcharts.com/compare/remotion?minimal=true)
13
13
  [![Install Size](https://packagephobia.now.sh/badge?p=remotion)](https://packagephobia.now.sh/result?p=remotion)
14
- <a href="https://twitter.com/remotion_dev"><img src="https://img.shields.io/twitter/follow/remotion_dev?label=Twitter&style=social" alt="Twitter"></a>
14
+ <a href="https://twitter.com/remotion"><img src="https://img.shields.io/twitter/follow/remotion?label=Twitter&style=social" alt="Twitter"></a>
15
15
 
16
16
  Remotion is a framework for **creating videos programmatically using React.**
17
17
 
@@ -30,7 +30,7 @@ Remotion is a framework for **creating videos programmatically using React.**
30
30
  <p>"This video was made with code" <em>- Fireship</em> <a href="https://youtu.be/deg8bOoziaE">Watch</a> • <a href="https://github.com/wcandillon/remotion-fireship">Source</a></p>
31
31
  </td>
32
32
  <td align="center">
33
- <img style="width: 240px" src="packages/docs/static/img/github-unwrapped.gif" />
33
+ <img style="width: 240px" src="packages/docs/static/img/unwrapped-2022.gif" />
34
34
  <p>GitHub Unwrapped - Personalized year in Review <a href="https://githubunwrapped.com">Try</a> • <a href="https://github.com/remotion-dev/github-unwrapped">Source</a></p>
35
35
  </td>
36
36
  <td align="center">
@@ -23,12 +23,14 @@ declare type EnhancedTSequenceData = {
23
23
  volume: string | number;
24
24
  doesVolumeChange: boolean;
25
25
  startMediaFrom: number;
26
+ playbackRate: number;
26
27
  } | {
27
28
  type: 'video';
28
29
  src: string;
29
30
  volume: string | number;
30
31
  doesVolumeChange: boolean;
31
32
  startMediaFrom: number;
33
+ playbackRate: number;
32
34
  };
33
35
  export declare type TSequence = {
34
36
  from: number;
@@ -14,6 +14,7 @@ const AudioForDevelopment_1 = require("./AudioForDevelopment");
14
14
  const AudioForRendering_1 = require("./AudioForRendering");
15
15
  const shared_audio_tags_1 = require("./shared-audio-tags");
16
16
  const AudioRefForwardingFunction = (props, ref) => {
17
+ var _a;
17
18
  const audioContext = (0, react_1.useContext)(shared_audio_tags_1.SharedAudioContext);
18
19
  const { startFrom, endAt, ...otherProps } = props;
19
20
  const { loop, ...propsOtherThanLoop } = props;
@@ -28,7 +29,9 @@ const AudioRefForwardingFunction = (props, ref) => {
28
29
  }, [setDurations]);
29
30
  if (loop && props.src && durations[props.src] !== undefined) {
30
31
  const duration = Math.floor(durations[props.src] * fps);
31
- return ((0, jsx_runtime_1.jsx)(loop_1.Loop, { layout: "none", durationInFrames: duration, children: (0, jsx_runtime_1.jsx)(exports.Audio, { ...propsOtherThanLoop, ref: ref }) }));
32
+ const playbackRate = (_a = props.playbackRate) !== null && _a !== void 0 ? _a : 1;
33
+ const actualDuration = duration / playbackRate;
34
+ return ((0, jsx_runtime_1.jsx)(loop_1.Loop, { layout: "none", durationInFrames: Math.floor(actualDuration), children: (0, jsx_runtime_1.jsx)(exports.Audio, { ...propsOtherThanLoop, ref: ref }) }));
32
35
  }
33
36
  if (typeof startFrom !== 'undefined' || typeof endAt !== 'undefined') {
34
37
  (0, validate_start_from_props_1.validateStartFromProps)(startFrom, endAt);
@@ -52,6 +52,7 @@ const AudioForDevelopmentForwardRefFunction = (props, ref) => {
52
52
  mediaRef: audioRef,
53
53
  src,
54
54
  mediaType: 'audio',
55
+ playbackRate: playbackRate !== null && playbackRate !== void 0 ? playbackRate : 1,
55
56
  });
56
57
  (0, use_media_playback_1.useMediaPlayback)({
57
58
  mediaRef: audioRef,
@@ -1,9 +1,10 @@
1
1
  import type { RefObject } from 'react';
2
2
  import type { VolumeProp } from './volume-prop';
3
- export declare const useMediaInTimeline: ({ volume, mediaVolume, mediaRef, src, mediaType, }: {
3
+ export declare const useMediaInTimeline: ({ volume, mediaVolume, mediaRef, src, mediaType, playbackRate, }: {
4
4
  volume: VolumeProp | undefined;
5
5
  mediaVolume: number;
6
6
  mediaRef: RefObject<HTMLAudioElement | HTMLVideoElement>;
7
7
  src: string | undefined;
8
8
  mediaType: 'audio' | 'video';
9
+ playbackRate: number;
9
10
  }) => void;
@@ -20,7 +20,7 @@ const warnOnce = (message) => {
20
20
  console.warn(message);
21
21
  didWarn[message] = true;
22
22
  };
23
- const useMediaInTimeline = ({ volume, mediaVolume, mediaRef, src, mediaType, }) => {
23
+ const useMediaInTimeline = ({ volume, mediaVolume, mediaRef, src, mediaType, playbackRate, }) => {
24
24
  const videoConfig = (0, use_video_config_1.useVideoConfig)();
25
25
  const { rootId, audioAndVideoTags } = (0, react_1.useContext)(timeline_position_state_1.TimelineContext);
26
26
  const parentSequence = (0, react_1.useContext)(Sequence_1.SequenceContext);
@@ -84,6 +84,7 @@ const useMediaInTimeline = ({ volume, mediaVolume, mediaRef, src, mediaType, })
84
84
  startMediaFrom: 0 - startsAt,
85
85
  doesVolumeChange,
86
86
  showLoopTimesInTimeline: undefined,
87
+ playbackRate,
87
88
  });
88
89
  return () => {
89
90
  unregisterSequence(id);
@@ -104,6 +105,7 @@ const useMediaInTimeline = ({ volume, mediaVolume, mediaRef, src, mediaType, })
104
105
  mediaRef,
105
106
  mediaType,
106
107
  startsAt,
108
+ playbackRate,
107
109
  ]);
108
110
  (0, react_1.useEffect)(() => {
109
111
  const tag = {
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const VERSION = "3.3.15";
1
+ export declare const VERSION = "3.3.16";
package/dist/version.js CHANGED
@@ -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.15';
5
+ exports.VERSION = '3.3.16';
@@ -13,6 +13,7 @@ const duration_state_1 = require("./duration-state");
13
13
  const VideoForDevelopment_1 = require("./VideoForDevelopment");
14
14
  const VideoForRendering_1 = require("./VideoForRendering");
15
15
  const VideoForwardingFunction = (props, ref) => {
16
+ var _a;
16
17
  const { startFrom, endAt, ...otherProps } = props;
17
18
  const { loop, ...propsOtherThanLoop } = props;
18
19
  const { fps } = (0, use_video_config_1.useVideoConfig)();
@@ -24,7 +25,10 @@ const VideoForwardingFunction = (props, ref) => {
24
25
  setDurations({ type: 'got-duration', durationInSeconds, src });
25
26
  }, [setDurations]);
26
27
  if (loop && props.src && durations[props.src] !== undefined) {
27
- return ((0, jsx_runtime_1.jsx)(loop_1.Loop, { durationInFrames: Math.round(durations[props.src] * fps), children: (0, jsx_runtime_1.jsx)(exports.Video, { ...propsOtherThanLoop, ref: ref }) }));
28
+ const naturalDuration = durations[props.src] * fps;
29
+ const playbackRate = (_a = props.playbackRate) !== null && _a !== void 0 ? _a : 1;
30
+ const durationInFrames = Math.floor(naturalDuration / playbackRate);
31
+ return ((0, jsx_runtime_1.jsx)(loop_1.Loop, { durationInFrames: durationInFrames, children: (0, jsx_runtime_1.jsx)(exports.Video, { ...propsOtherThanLoop, ref: ref }) }));
28
32
  }
29
33
  if (typeof startFrom !== 'undefined' || typeof endAt !== 'undefined') {
30
34
  (0, validate_start_from_props_1.validateStartFromProps)(startFrom, endAt);
@@ -14,7 +14,7 @@ const use_video_config_1 = require("../use-video-config");
14
14
  const volume_position_state_1 = require("../volume-position-state");
15
15
  const video_fragment_1 = require("./video-fragment");
16
16
  const VideoForDevelopmentRefForwardingFunction = (props, ref) => {
17
- var _a;
17
+ var _a, _b;
18
18
  const videoRef = (0, react_1.useRef)(null);
19
19
  const volumePropFrame = (0, use_audio_frame_1.useFrameForVolumeProp)();
20
20
  const { fps, durationInFrames } = (0, use_video_config_1.useVideoConfig)();
@@ -29,6 +29,7 @@ const VideoForDevelopmentRefForwardingFunction = (props, ref) => {
29
29
  mediaVolume,
30
30
  mediaType: 'video',
31
31
  src,
32
+ playbackRate: (_a = props.playbackRate) !== null && _a !== void 0 ? _a : 1,
32
33
  });
33
34
  (0, use_sync_volume_with_media_tag_1.useSyncVolumeWithMediaTag)({
34
35
  volumePropFrame,
@@ -41,7 +42,7 @@ const VideoForDevelopmentRefForwardingFunction = (props, ref) => {
41
42
  mediaRef: videoRef,
42
43
  src,
43
44
  mediaType: 'video',
44
- playbackRate: (_a = props.playbackRate) !== null && _a !== void 0 ? _a : 1,
45
+ playbackRate: (_b = props.playbackRate) !== null && _b !== void 0 ? _b : 1,
45
46
  onlyWarnForMediaSeekingError,
46
47
  acceptableTimeshift: acceptableTimeshift !== null && acceptableTimeshift !== void 0 ? acceptableTimeshift : use_media_playback_1.DEFAULT_ACCEPTABLE_TIMESHIFT,
47
48
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "remotion",
3
- "version": "3.3.15",
3
+ "version": "3.3.16",
4
4
  "description": "Render videos in React",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -55,5 +55,5 @@
55
55
  "publishConfig": {
56
56
  "access": "public"
57
57
  },
58
- "gitHead": "2fc46f12fd00b0f4eace6398e5eaa054210928ea"
58
+ "gitHead": "f9ad91106fe6fbcc61a25d917cc526a995d9322c"
59
59
  }
package/version.js CHANGED
@@ -1 +1,4 @@
1
+ 'use strict';
2
+ Object.defineProperty(exports, '__esModule', {value: true});
3
+
1
4
  module.exports = require('./dist/version');