remotion 4.0.0-prefetch.11 → 4.0.0-prefetch.12

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.
Files changed (187) hide show
  1. package/.turbo/turbo-build.log +4 -5
  2. package/LICENSE.md +7 -7
  3. package/README.md +6 -0
  4. package/dist/AbsoluteFill.d.ts +0 -0
  5. package/dist/AbsoluteFill.js +0 -0
  6. package/dist/CanUseRemotionHooks.d.ts +0 -0
  7. package/dist/CanUseRemotionHooks.js +0 -0
  8. package/dist/Composition.d.ts +0 -0
  9. package/dist/Composition.js +0 -0
  10. package/dist/CompositionManager.d.ts +0 -0
  11. package/dist/CompositionManager.js +0 -0
  12. package/dist/Folder.d.ts +0 -0
  13. package/dist/Folder.js +0 -0
  14. package/dist/IFrame.d.ts +0 -0
  15. package/dist/IFrame.js +0 -0
  16. package/dist/Img.d.ts +0 -0
  17. package/dist/Img.js +28 -24
  18. package/dist/RemotionRoot.d.ts +0 -0
  19. package/dist/RemotionRoot.js +6 -5
  20. package/dist/Sequence.d.ts +0 -0
  21. package/dist/Sequence.js +0 -0
  22. package/dist/Still.d.ts +0 -0
  23. package/dist/Still.js +0 -0
  24. package/dist/absolute-src.d.ts +0 -0
  25. package/dist/absolute-src.js +0 -0
  26. package/dist/asset-types.d.ts +0 -0
  27. package/dist/asset-types.js +0 -0
  28. package/dist/audio/Audio.d.ts +2 -2
  29. package/dist/audio/Audio.js +15 -2
  30. package/dist/audio/AudioForDevelopment.d.ts +2 -1
  31. package/dist/audio/AudioForDevelopment.js +25 -4
  32. package/dist/audio/AudioForRendering.d.ts +3 -1
  33. package/dist/audio/AudioForRendering.js +33 -1
  34. package/dist/audio/index.d.ts +0 -0
  35. package/dist/audio/index.js +0 -0
  36. package/dist/audio/props.d.ts +1 -1
  37. package/dist/audio/props.js +0 -0
  38. package/dist/audio/shared-audio-tags.d.ts +0 -0
  39. package/dist/audio/shared-audio-tags.js +0 -0
  40. package/dist/audio/use-audio-frame.d.ts +0 -0
  41. package/dist/audio/use-audio-frame.js +0 -0
  42. package/dist/bezier.d.ts +0 -0
  43. package/dist/bezier.js +0 -0
  44. package/dist/config/input-props.d.ts +0 -0
  45. package/dist/config/input-props.js +0 -0
  46. package/dist/config.d.ts +17 -0
  47. package/dist/config.js +0 -0
  48. package/dist/default-css.d.ts +0 -0
  49. package/dist/default-css.js +0 -0
  50. package/dist/delay-render.d.ts +0 -0
  51. package/dist/delay-render.js +0 -0
  52. package/dist/easing.d.ts +0 -0
  53. package/dist/easing.js +0 -0
  54. package/dist/freeze.d.ts +0 -0
  55. package/dist/freeze.js +0 -0
  56. package/dist/get-asset-file-name.d.ts +0 -0
  57. package/dist/get-asset-file-name.js +0 -0
  58. package/dist/get-environment.d.ts +0 -0
  59. package/dist/get-environment.js +3 -3
  60. package/dist/get-preview-dom-element.d.ts +0 -0
  61. package/dist/get-preview-dom-element.js +0 -0
  62. package/dist/get-timeline-clip-name.d.ts +0 -0
  63. package/dist/get-timeline-clip-name.js +0 -0
  64. package/dist/index.d.ts +2 -2
  65. package/dist/index.js +5 -4
  66. package/dist/internals.d.ts +6 -0
  67. package/dist/internals.js +4 -0
  68. package/dist/interpolate-colors.d.ts +0 -0
  69. package/dist/interpolate-colors.js +0 -0
  70. package/dist/interpolate.d.ts +0 -0
  71. package/dist/interpolate.js +0 -0
  72. package/dist/is-approximately-the-same.d.ts +0 -0
  73. package/dist/is-approximately-the-same.js +0 -0
  74. package/dist/loading-indicator.d.ts +0 -0
  75. package/dist/loading-indicator.js +0 -0
  76. package/dist/loop/index.d.ts +0 -0
  77. package/dist/loop/index.js +0 -0
  78. package/dist/multiple-versions-warning.d.ts +0 -0
  79. package/dist/multiple-versions-warning.js +0 -0
  80. package/dist/nonce.d.ts +0 -0
  81. package/dist/nonce.js +0 -0
  82. package/dist/play-and-handle-not-allowed-error.d.ts +0 -0
  83. package/dist/play-and-handle-not-allowed-error.js +4 -0
  84. package/dist/portal-node.d.ts +0 -0
  85. package/dist/portal-node.js +0 -0
  86. package/dist/prefetch-state.d.ts +8 -0
  87. package/dist/prefetch-state.js +27 -0
  88. package/dist/prefetch.d.ts +9 -0
  89. package/dist/prefetch.js +108 -0
  90. package/dist/random.d.ts +2 -1
  91. package/dist/random.js +0 -0
  92. package/dist/register-root.d.ts +0 -0
  93. package/dist/register-root.js +3 -0
  94. package/dist/series/flatten-children.d.ts +0 -0
  95. package/dist/series/flatten-children.js +0 -0
  96. package/dist/series/index.d.ts +0 -0
  97. package/dist/series/index.js +0 -0
  98. package/dist/setup-env-variables.d.ts +0 -0
  99. package/dist/setup-env-variables.js +0 -0
  100. package/dist/spring/index.d.ts +0 -0
  101. package/dist/spring/index.js +0 -0
  102. package/dist/spring/measure-spring.d.ts +0 -0
  103. package/dist/spring/measure-spring.js +0 -0
  104. package/dist/spring/spring-utils.d.ts +0 -0
  105. package/dist/spring/spring-utils.js +0 -0
  106. package/dist/static-file.d.ts +0 -0
  107. package/dist/static-file.js +0 -0
  108. package/dist/timeline-position-state.d.ts +0 -0
  109. package/dist/timeline-position-state.js +0 -0
  110. package/dist/truthy.d.ts +0 -0
  111. package/dist/truthy.js +0 -0
  112. package/dist/use-current-frame.d.ts +0 -0
  113. package/dist/use-current-frame.js +0 -0
  114. package/dist/use-lazy-component.d.ts +0 -0
  115. package/dist/use-lazy-component.js +0 -0
  116. package/dist/use-media-in-timeline.d.ts +0 -0
  117. package/dist/use-media-in-timeline.js +0 -0
  118. package/dist/use-media-playback.d.ts +0 -0
  119. package/dist/use-media-playback.js +0 -0
  120. package/dist/use-media-tag-volume.d.ts +0 -0
  121. package/dist/use-media-tag-volume.js +0 -0
  122. package/dist/use-sync-volume-with-media-tag.d.ts +0 -0
  123. package/dist/use-sync-volume-with-media-tag.js +0 -0
  124. package/dist/use-unsafe-video-config.d.ts +0 -0
  125. package/dist/use-unsafe-video-config.js +0 -0
  126. package/dist/use-video-config.d.ts +0 -0
  127. package/dist/use-video-config.js +0 -0
  128. package/dist/use-video.d.ts +0 -0
  129. package/dist/use-video.js +0 -0
  130. package/dist/validate-media-props.d.ts +0 -0
  131. package/dist/validate-media-props.js +0 -0
  132. package/dist/validate-start-from-props.d.ts +0 -0
  133. package/dist/validate-start-from-props.js +0 -0
  134. package/dist/validation/validate-composition-id.d.ts +0 -0
  135. package/dist/validation/validate-composition-id.js +0 -0
  136. package/dist/validation/validate-dimensions.d.ts +0 -0
  137. package/dist/validation/validate-dimensions.js +0 -0
  138. package/dist/validation/validate-duration-in-frames.d.ts +0 -0
  139. package/dist/validation/validate-duration-in-frames.js +0 -0
  140. package/dist/validation/validate-folder-name.d.ts +0 -0
  141. package/dist/validation/validate-folder-name.js +0 -0
  142. package/dist/validation/validate-fps.d.ts +0 -0
  143. package/dist/validation/validate-fps.js +0 -0
  144. package/dist/validation/validate-offthreadvideo-image-format.d.ts +0 -0
  145. package/dist/validation/validate-offthreadvideo-image-format.js +0 -0
  146. package/dist/validation/validation-spring-duration.d.ts +0 -0
  147. package/dist/validation/validation-spring-duration.js +0 -0
  148. package/dist/version.d.ts +1 -1
  149. package/dist/version.js +1 -1
  150. package/dist/video/OffthreadVideo.d.ts +1 -1
  151. package/dist/video/OffthreadVideo.js +3 -1
  152. package/dist/video/OffthreadVideoForRendering.d.ts +0 -0
  153. package/dist/video/OffthreadVideoForRendering.js +0 -0
  154. package/dist/video/Video.d.ts +2 -2
  155. package/dist/video/Video.js +14 -2
  156. package/dist/video/VideoForDevelopment.d.ts +2 -1
  157. package/dist/video/VideoForDevelopment.js +25 -4
  158. package/dist/video/VideoForRendering.d.ts +3 -1
  159. package/dist/video/VideoForRendering.js +33 -2
  160. package/dist/video/duration-state.d.ts +17 -0
  161. package/dist/video/duration-state.js +34 -0
  162. package/dist/video/get-current-time.d.ts +0 -0
  163. package/dist/video/get-current-time.js +0 -0
  164. package/dist/video/index.d.ts +0 -0
  165. package/dist/video/index.js +0 -0
  166. package/dist/video/props.d.ts +1 -1
  167. package/dist/video/props.js +0 -0
  168. package/dist/video-config.d.ts +0 -0
  169. package/dist/video-config.js +0 -0
  170. package/dist/volume-position-state.d.ts +0 -0
  171. package/dist/volume-position-state.js +0 -0
  172. package/dist/volume-prop.d.ts +0 -0
  173. package/dist/volume-prop.js +0 -0
  174. package/dist/warn-about-non-seekable-media.d.ts +0 -0
  175. package/dist/warn-about-non-seekable-media.js +0 -0
  176. package/dist/wrap-remotion-context.d.ts +0 -0
  177. package/dist/wrap-remotion-context.js +0 -0
  178. package/package.json +7 -6
  179. package/dist/config/bundle-out-dir.d.ts +0 -2
  180. package/dist/config/bundle-out-dir.js +0 -12
  181. package/dist/config/public-path.d.ts +0 -2
  182. package/dist/config/public-path.js +0 -12
  183. package/dist/preload-state.d.ts +0 -13
  184. package/dist/preload-state.js +0 -26
  185. package/dist/preload.d.ts +0 -7
  186. package/dist/preload.js +0 -86
  187. package/ensure-correct-version.js +0 -24
@@ -1,5 +1,4 @@
1
- remotion:build: cache hit, replaying output 0af0606516a25196
2
- remotion:build: 
3
- remotion:build: > remotion@3.2.16 build /Users/jonathanburger/remotion/packages/core
4
- remotion:build: > tsc -d
5
- remotion:build: 
1
+
2
+ > remotion@3.2.34 build /Users/jonathanburger/remotion/packages/core
3
+ > tsc -d
4
+
package/LICENSE.md CHANGED
@@ -1,34 +1,34 @@
1
1
  # Remotion License
2
2
 
3
- Depending on the type of your legal entity, you are granted permission to use Remotion for your project. Individuals and small companies are allowed to use Remotion create videos for free (even commercial), while a company license is required for for-profit organisations of a certain size. This two-tier system was designed to ensure funding for this project while still allowing the source code to be available and the program to be free for most. Read below for the exact terms of use.
3
+ Depending on the type of your legal entity, you are granted permission to use Remotion for your project. Individuals and small companies are allowed to use Remotion to create videos for free (even commercial), while a company license is required for for-profit organizations of a certain size. This two-tier system was designed to ensure funding for this project while still allowing the source code to be available and the program to be free for most. Read below for the exact terms of use.
4
4
 
5
5
  - [Free license](#free-license)
6
6
  - [Company license](#company-license)
7
7
 
8
8
  ## Free license
9
9
 
10
- Copyright © 2022 [Jonny Burger](https://jonny.io)
10
+ Copyright © 2022 [Remotion](https://www.remotion.dev/)
11
11
 
12
12
  ### Eligibility
13
13
 
14
14
  You are eligible to use Remotion for free if you are:
15
15
 
16
16
  - an individual
17
- - a for-profit organisation with up to 3 employees
18
- - a non-profit or not-for-profit organisation
17
+ - a for-profit organization with up to 3 employees
18
+ - a non-profit or not-for-profit organization
19
19
  - evaluating whether Remotion is a good fit, and are not yet using it in a commercial way
20
20
 
21
21
  ### Allowed use cases
22
22
 
23
- Permission is hereby granted, free of charge, to any person eligible for the "Free license", to use the software non-commercially or commercially for the purpose of creating videos and images and to modify and the software to their own liking, for the purpose of fulfilling their custom use case or to contribute bug fixes or improvements back to Remotion.
23
+ Permission is hereby granted, free of charge, to any person eligible for the "Free license", to use the software non-commercially or commercially for the purpose of creating videos and images and to modify the software to their own liking, for the purpose of fulfilling their custom use case or to contribute bug fixes or improvements back to Remotion.
24
24
 
25
25
  ### Disallowed use cases
26
26
 
27
- It is not allowed to copy or modify Remotion code for the purpose of selling, renting, licensing, relicensing, sublicensing your own derivate of Remotion.
27
+ It is not allowed to copy or modify Remotion code for the purpose of selling, renting, licensing, relicensing, or sublicensing your own derivate of Remotion.
28
28
 
29
29
  ### Warranty notice
30
30
 
31
- The software is provided "as is", without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In no event shall the author or copyright holders be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the software or the use or other dealings in the software.
31
+ The software is provided "as is", without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose, and non-infringement. In no event shall the author or copyright holders be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the software or the use or other dealings in the software.
32
32
 
33
33
  ### Support
34
34
 
package/README.md CHANGED
@@ -13,6 +13,12 @@
13
13
  [![Install Size](https://packagephobia.now.sh/badge?p=remotion)](https://packagephobia.now.sh/result?p=remotion)
14
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>
15
15
 
16
+ <p style="color: orange">
17
+ <a href="https://remotion.dev/hacktoberfest"><strong style="color: orange">
18
+ 🎃 Hack on Remotion and earn bounties! $4000 are up for grabs in Hacktoberfest.
19
+ </strong></a> <a href="https://codechem.com">Sponsored by CodeChem!</a>
20
+ </p>
21
+
16
22
  Remotion is a framework for **creating videos programmatically using React.**
17
23
 
18
24
  ## Why create videos in React?
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
package/dist/Folder.d.ts CHANGED
File without changes
package/dist/Folder.js CHANGED
File without changes
package/dist/IFrame.d.ts CHANGED
File without changes
package/dist/IFrame.js CHANGED
File without changes
package/dist/Img.d.ts CHANGED
File without changes
package/dist/Img.js CHANGED
@@ -4,13 +4,14 @@ exports.Img = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_1 = require("react");
6
6
  const delay_render_1 = require("./delay-render");
7
- const preload_1 = require("./preload");
7
+ const get_environment_1 = require("./get-environment");
8
+ const prefetch_1 = require("./prefetch");
8
9
  const ImgRefForwarding = ({ onError, src, ...props }, ref) => {
9
10
  const imageRef = (0, react_1.useRef)(null);
10
11
  (0, react_1.useImperativeHandle)(ref, () => {
11
12
  return imageRef.current;
12
- });
13
- const actualSrc = (0, preload_1.usePreload)(src);
13
+ }, []);
14
+ const actualSrc = (0, prefetch_1.usePreload)(src);
14
15
  const didGetError = (0, react_1.useCallback)((e) => {
15
16
  var _a;
16
17
  if (onError) {
@@ -21,27 +22,30 @@ const ImgRefForwarding = ({ onError, src, ...props }, ref) => {
21
22
  }
22
23
  }, [onError]);
23
24
  // If image source switches, make new handle
24
- (0, react_1.useLayoutEffect)(() => {
25
- if (process.env.NODE_ENV === 'test') {
26
- return;
27
- }
28
- const newHandle = (0, delay_render_1.delayRender)('Loading <Img> with src=' + src);
29
- const { current } = imageRef;
30
- const didLoad = () => {
31
- (0, delay_render_1.continueRender)(newHandle);
32
- };
33
- if (current === null || current === void 0 ? void 0 : current.complete) {
34
- (0, delay_render_1.continueRender)(newHandle);
35
- }
36
- else {
37
- current === null || current === void 0 ? void 0 : current.addEventListener('load', didLoad, { once: true });
38
- }
39
- // If tag gets unmounted, clear pending handles because image is not going to load
40
- return () => {
41
- current === null || current === void 0 ? void 0 : current.removeEventListener('load', didLoad);
42
- (0, delay_render_1.continueRender)(newHandle);
43
- };
44
- }, [src]);
25
+ if ((0, get_environment_1.getRemotionEnvironment)() === 'rendering') {
26
+ // eslint-disable-next-line react-hooks/rules-of-hooks
27
+ (0, react_1.useLayoutEffect)(() => {
28
+ if (process.env.NODE_ENV === 'test') {
29
+ return;
30
+ }
31
+ const newHandle = (0, delay_render_1.delayRender)('Loading <Img> with src=' + src);
32
+ const { current } = imageRef;
33
+ const didLoad = () => {
34
+ (0, delay_render_1.continueRender)(newHandle);
35
+ };
36
+ if (current === null || current === void 0 ? void 0 : current.complete) {
37
+ (0, delay_render_1.continueRender)(newHandle);
38
+ }
39
+ else {
40
+ current === null || current === void 0 ? void 0 : current.addEventListener('load', didLoad, { once: true });
41
+ }
42
+ // If tag gets unmounted, clear pending handles because image is not going to load
43
+ return () => {
44
+ current === null || current === void 0 ? void 0 : current.removeEventListener('load', didLoad);
45
+ (0, delay_render_1.continueRender)(newHandle);
46
+ };
47
+ }, [src]);
48
+ }
45
49
  return ((0, jsx_runtime_1.jsx)("img", { ...props, ref: imageRef, src: actualSrc, onError: didGetError }));
46
50
  };
47
51
  exports.Img = (0, react_1.forwardRef)(ImgRefForwarding);
File without changes
@@ -7,9 +7,10 @@ const shared_audio_tags_1 = require("./audio/shared-audio-tags");
7
7
  const CompositionManager_1 = require("./CompositionManager");
8
8
  const delay_render_1 = require("./delay-render");
9
9
  const nonce_1 = require("./nonce");
10
- const preload_state_1 = require("./preload-state");
10
+ const prefetch_state_1 = require("./prefetch-state");
11
11
  const random_1 = require("./random");
12
12
  const timeline_position_state_1 = require("./timeline-position-state");
13
+ const duration_state_1 = require("./video/duration-state");
13
14
  const RemotionRoot = ({ children }) => {
14
15
  var _a;
15
16
  const [remotionRootId] = (0, react_1.useState)(() => String((0, random_1.random)(null)));
@@ -62,10 +63,10 @@ const RemotionRoot = ({ children }) => {
62
63
  });
63
64
  }
64
65
  }, []);
65
- return ((0, jsx_runtime_1.jsx)(nonce_1.NonceContext.Provider, { value: nonceContext, children: (0, jsx_runtime_1.jsx)(timeline_position_state_1.TimelineContext.Provider, { value: timelineContextValue, children: (0, jsx_runtime_1.jsx)(timeline_position_state_1.SetTimelineContext.Provider, { value: setTimelineContextValue, children: (0, jsx_runtime_1.jsx)(preload_state_1.PreloadProvider, { children: (0, jsx_runtime_1.jsx)(CompositionManager_1.CompositionManagerProvider, { children: (0, jsx_runtime_1.jsx)(shared_audio_tags_1.SharedAudioContextProvider
66
- // In the preview, which is mostly played on Desktop, we opt out of the autoplay policy fix as described in https://github.com/remotion-dev/remotion/pull/554, as it mostly applies to mobile.
67
- , {
66
+ return ((0, jsx_runtime_1.jsx)(nonce_1.NonceContext.Provider, { value: nonceContext, children: (0, jsx_runtime_1.jsx)(timeline_position_state_1.TimelineContext.Provider, { value: timelineContextValue, children: (0, jsx_runtime_1.jsx)(timeline_position_state_1.SetTimelineContext.Provider, { value: setTimelineContextValue, children: (0, jsx_runtime_1.jsx)(prefetch_state_1.PrefetchProvider, { children: (0, jsx_runtime_1.jsx)(CompositionManager_1.CompositionManagerProvider, { children: (0, jsx_runtime_1.jsx)(duration_state_1.DurationsContextProvider, { children: (0, jsx_runtime_1.jsx)(shared_audio_tags_1.SharedAudioContextProvider
68
67
  // In the preview, which is mostly played on Desktop, we opt out of the autoplay policy fix as described in https://github.com/remotion-dev/remotion/pull/554, as it mostly applies to mobile.
69
- numberOfAudioTags: 0, children: children }) }) }) }) }) }));
68
+ , {
69
+ // In the preview, which is mostly played on Desktop, we opt out of the autoplay policy fix as described in https://github.com/remotion-dev/remotion/pull/554, as it mostly applies to mobile.
70
+ numberOfAudioTags: 0, children: children }) }) }) }) }) }) }));
70
71
  };
71
72
  exports.RemotionRoot = RemotionRoot;
File without changes
package/dist/Sequence.js CHANGED
File without changes
package/dist/Still.d.ts CHANGED
File without changes
package/dist/Still.js CHANGED
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import type { RemotionMainAudioProps } from './props';
3
- export declare const Audio: React.ForwardRefExoticComponent<Pick<Omit<React.DetailedHTMLProps<React.AudioHTMLAttributes<HTMLAudioElement>, HTMLAudioElement>, "onEnded" | "autoPlay" | "controls" | "loop"> & {
3
+ export declare const Audio: React.ForwardRefExoticComponent<Pick<Omit<React.DetailedHTMLProps<React.AudioHTMLAttributes<HTMLAudioElement>, HTMLAudioElement>, "onEnded" | "autoPlay" | "controls"> & {
4
4
  volume?: import("../volume-prop").VolumeProp | undefined;
5
5
  playbackRate?: number | undefined;
6
- } & RemotionMainAudioProps, "id" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "lang" | "placeholder" | "slot" | "spellCheck" | "style" | "tabIndex" | "title" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "src" | "volume" | "playbackRate" | "controlsList" | "crossOrigin" | "mediaGroup" | "muted" | "playsInline" | "preload" | keyof RemotionMainAudioProps> & React.RefAttributes<HTMLAudioElement>>;
6
+ } & RemotionMainAudioProps, "id" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "lang" | "placeholder" | "slot" | "spellCheck" | "style" | "tabIndex" | "title" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "src" | "volume" | "playbackRate" | "controlsList" | "crossOrigin" | "loop" | "mediaGroup" | "muted" | "playsInline" | "preload" | keyof RemotionMainAudioProps> & React.RefAttributes<HTMLAudioElement>>;
@@ -4,19 +4,32 @@ exports.Audio = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_1 = require("react");
6
6
  const get_environment_1 = require("../get-environment");
7
+ const loop_1 = require("../loop");
7
8
  const Sequence_1 = require("../Sequence");
9
+ const use_video_config_1 = require("../use-video-config");
8
10
  const validate_media_props_1 = require("../validate-media-props");
9
11
  const validate_start_from_props_1 = require("../validate-start-from-props");
12
+ const duration_state_1 = require("../video/duration-state");
10
13
  const AudioForDevelopment_1 = require("./AudioForDevelopment");
11
14
  const AudioForRendering_1 = require("./AudioForRendering");
12
15
  const shared_audio_tags_1 = require("./shared-audio-tags");
13
16
  const AudioRefForwardingFunction = (props, ref) => {
14
17
  const audioContext = (0, react_1.useContext)(shared_audio_tags_1.SharedAudioContext);
15
18
  const { startFrom, endAt, ...otherProps } = props;
19
+ const { loop, ...propsOtherThanLoop } = props;
20
+ const { fps } = (0, use_video_config_1.useVideoConfig)();
21
+ const { durations, setDurations } = (0, react_1.useContext)(duration_state_1.DurationsContext);
16
22
  const onError = (0, react_1.useCallback)((e) => {
17
23
  console.log(e.currentTarget.error);
18
24
  throw new Error(`Could not play audio with src ${otherProps.src}: ${e.currentTarget.error}. See https://remotion.dev/docs/media-playback-error for help.`);
19
25
  }, [otherProps.src]);
26
+ const onDuration = (0, react_1.useCallback)((src, durationInSeconds) => {
27
+ setDurations({ type: 'got-duration', durationInSeconds, src });
28
+ }, [setDurations]);
29
+ if (loop && props.src && durations[props.src] !== undefined) {
30
+ 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
+ }
20
33
  if (typeof startFrom !== 'undefined' || typeof endAt !== 'undefined') {
21
34
  (0, validate_start_from_props_1.validateStartFromProps)(startFrom, endAt);
22
35
  const startFromFrameNo = startFrom !== null && startFrom !== void 0 ? startFrom : 0;
@@ -25,8 +38,8 @@ const AudioRefForwardingFunction = (props, ref) => {
25
38
  }
26
39
  (0, validate_media_props_1.validateMediaProps)(props, 'Audio');
27
40
  if ((0, get_environment_1.getRemotionEnvironment)() === 'rendering') {
28
- return (0, jsx_runtime_1.jsx)(AudioForRendering_1.AudioForRendering, { ...props, ref: ref, onError: onError });
41
+ return ((0, jsx_runtime_1.jsx)(AudioForRendering_1.AudioForRendering, { onDuration: onDuration, ...props, ref: ref, onError: onError }));
29
42
  }
30
- return ((0, jsx_runtime_1.jsx)(AudioForDevelopment_1.AudioForDevelopment, { shouldPreMountAudioTags: audioContext !== null && audioContext.numberOfAudioTags > 0, ...props, ref: ref, onError: onError }));
43
+ return ((0, jsx_runtime_1.jsx)(AudioForDevelopment_1.AudioForDevelopment, { shouldPreMountAudioTags: audioContext !== null && audioContext.numberOfAudioTags > 0, ...props, ref: ref, onError: onError, onDuration: onDuration }));
31
44
  };
32
45
  exports.Audio = (0, react_1.forwardRef)(AudioRefForwardingFunction);
@@ -1,8 +1,9 @@
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>, "onEnded" | "autoPlay" | "controls" | "loop"> & {
3
+ export declare const AudioForDevelopment: ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.AudioHTMLAttributes<HTMLAudioElement>, HTMLAudioElement>, "onEnded" | "autoPlay" | "controls"> & {
4
4
  volume?: import("../volume-prop").VolumeProp | undefined;
5
5
  playbackRate?: number | undefined;
6
6
  } & {
7
7
  shouldPreMountAudioTags: boolean;
8
+ onDuration: (src: string, durationInSeconds: number) => void;
8
9
  } & RefAttributes<HTMLAudioElement>>;
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.AudioForDevelopment = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_1 = require("react");
6
- const preload_1 = require("../preload");
6
+ const prefetch_1 = require("../prefetch");
7
7
  const random_1 = require("../random");
8
8
  const Sequence_1 = require("../Sequence");
9
9
  const use_media_in_timeline_1 = require("../use-media-in-timeline");
@@ -21,11 +21,11 @@ const AudioForDevelopmentForwardRefFunction = (props, ref) => {
21
21
  const [mediaVolume] = (0, volume_position_state_1.useMediaVolumeState)();
22
22
  const [mediaMuted] = (0, volume_position_state_1.useMediaMutedState)();
23
23
  const volumePropFrame = (0, use_audio_frame_1.useFrameForVolumeProp)();
24
- const { volume, muted, playbackRate, shouldPreMountAudioTags, src, ...nativeProps } = props;
24
+ const { volume, muted, playbackRate, shouldPreMountAudioTags, src, onDuration, ...nativeProps } = props;
25
25
  if (!src) {
26
26
  throw new TypeError("No 'src' was passed to <Audio>.");
27
27
  }
28
- const preloadedSrc = (0, preload_1.usePreload)(src);
28
+ const preloadedSrc = (0, prefetch_1.usePreload)(src);
29
29
  const propsToPass = (0, react_1.useMemo)(() => {
30
30
  return {
31
31
  muted: muted || mediaMuted,
@@ -62,7 +62,28 @@ const AudioForDevelopmentForwardRefFunction = (props, ref) => {
62
62
  });
63
63
  (0, react_1.useImperativeHandle)(ref, () => {
64
64
  return audioRef.current;
65
- });
65
+ }, [audioRef]);
66
+ const currentOnDurationCallback = (0, react_1.useRef)();
67
+ currentOnDurationCallback.current = onDuration;
68
+ (0, react_1.useEffect)(() => {
69
+ var _a;
70
+ const { current } = audioRef;
71
+ if (!current) {
72
+ return;
73
+ }
74
+ if (current.duration) {
75
+ (_a = currentOnDurationCallback.current) === null || _a === void 0 ? void 0 : _a.call(currentOnDurationCallback, src, current.duration);
76
+ return;
77
+ }
78
+ const onLoadedMetadata = () => {
79
+ var _a;
80
+ (_a = currentOnDurationCallback.current) === null || _a === void 0 ? void 0 : _a.call(currentOnDurationCallback, src, current.duration);
81
+ };
82
+ current.addEventListener('loadedmetadata', onLoadedMetadata);
83
+ return () => {
84
+ current.removeEventListener('loadedmetadata', onLoadedMetadata);
85
+ };
86
+ }, [audioRef, src]);
66
87
  if (initialShouldPreMountAudioElements) {
67
88
  return null;
68
89
  }
@@ -1,6 +1,8 @@
1
1
  import type { ForwardRefExoticComponent, RefAttributes } from 'react';
2
2
  import React from 'react';
3
- export declare const AudioForRendering: ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.AudioHTMLAttributes<HTMLAudioElement>, HTMLAudioElement>, "onEnded" | "autoPlay" | "controls" | "loop"> & {
3
+ export declare const AudioForRendering: ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.AudioHTMLAttributes<HTMLAudioElement>, HTMLAudioElement>, "onEnded" | "autoPlay" | "controls"> & {
4
4
  volume?: import("../volume-prop").VolumeProp | undefined;
5
5
  playbackRate?: number | undefined;
6
+ } & {
7
+ onDuration: (src: string, durationInSeconds: number) => void;
6
8
  } & RefAttributes<HTMLAudioElement>>;
@@ -5,6 +5,8 @@ const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const react_1 = require("react");
6
6
  const absolute_src_1 = require("../absolute-src");
7
7
  const CompositionManager_1 = require("../CompositionManager");
8
+ const delay_render_1 = require("../delay-render");
9
+ const get_environment_1 = require("../get-environment");
8
10
  const random_1 = require("../random");
9
11
  const Sequence_1 = require("../Sequence");
10
12
  const timeline_position_state_1 = require("../timeline-position-state");
@@ -32,7 +34,7 @@ const AudioForRenderingRefForwardingFunction = (props, ref) => {
32
34
  });
33
35
  (0, react_1.useImperativeHandle)(ref, () => {
34
36
  return audioRef.current;
35
- });
37
+ }, []);
36
38
  (0, react_1.useEffect)(() => {
37
39
  var _a;
38
40
  if (!props.src) {
@@ -70,6 +72,36 @@ const AudioForRenderingRefForwardingFunction = (props, ref) => {
70
72
  playbackRate,
71
73
  props.playbackRate,
72
74
  ]);
75
+ const { src, onDuration } = props;
76
+ // If audio source switches, make new handle
77
+ if ((0, get_environment_1.getRemotionEnvironment)() === 'rendering') {
78
+ // eslint-disable-next-line react-hooks/rules-of-hooks
79
+ (0, react_1.useLayoutEffect)(() => {
80
+ if (process.env.NODE_ENV === 'test') {
81
+ return;
82
+ }
83
+ const newHandle = (0, delay_render_1.delayRender)('Loading <Audio> duration with src=' + src);
84
+ const { current } = audioRef;
85
+ const didLoad = () => {
86
+ if (current) {
87
+ onDuration(src, current.duration);
88
+ }
89
+ (0, delay_render_1.continueRender)(newHandle);
90
+ };
91
+ if (current === null || current === void 0 ? void 0 : current.duration) {
92
+ onDuration(src, current.duration);
93
+ (0, delay_render_1.continueRender)(newHandle);
94
+ }
95
+ else {
96
+ current === null || current === void 0 ? void 0 : current.addEventListener('loadedmetadata', didLoad, { once: true });
97
+ }
98
+ // If tag gets unmounted, clear pending handles because video metadata is not going to load
99
+ return () => {
100
+ current === null || current === void 0 ? void 0 : current.removeEventListener('loadedmetadata', didLoad);
101
+ (0, delay_render_1.continueRender)(newHandle);
102
+ };
103
+ }, [src, onDuration]);
104
+ }
73
105
  return (0, jsx_runtime_1.jsx)("audio", { ref: audioRef, ...nativeProps });
74
106
  };
75
107
  exports.AudioForRendering = (0, react_1.forwardRef)(AudioForRenderingRefForwardingFunction);
File without changes
File without changes
@@ -4,7 +4,7 @@ export declare type RemotionMainAudioProps = {
4
4
  startFrom?: number;
5
5
  endAt?: number;
6
6
  };
7
- export declare type RemotionAudioProps = Omit<React.DetailedHTMLProps<React.AudioHTMLAttributes<HTMLAudioElement>, HTMLAudioElement>, 'autoPlay' | 'controls' | 'loop' | 'onEnded'> & {
7
+ export declare type RemotionAudioProps = Omit<React.DetailedHTMLProps<React.AudioHTMLAttributes<HTMLAudioElement>, HTMLAudioElement>, 'autoPlay' | 'controls' | 'onEnded'> & {
8
8
  volume?: VolumeProp;
9
9
  playbackRate?: number;
10
10
  };
File without changes
File without changes
File without changes
File without changes
File without changes
package/dist/bezier.d.ts CHANGED
File without changes
package/dist/bezier.js CHANGED
File without changes
File without changes
File without changes
package/dist/config.d.ts CHANGED
@@ -203,6 +203,23 @@ export declare type ConfigType = {
203
203
  * See https://avpres.net/FFmpeg/im_ProRes.html for meaning of possible values.
204
204
  */
205
205
  readonly setProResProfile: (profile: '4444-xq' | '4444' | 'hq' | 'standard' | 'light' | 'proxy' | undefined) => void;
206
+ /**
207
+ * Override the arguments that Remotion passes to FFMPEG.
208
+ * Consult https://remotion.dev/docs/renderer/render-media#ffmpegoverride before using this feature.
209
+ */
210
+ readonly overrideFfmpegCommand: (command: (info: {
211
+ type: 'pre-stitcher' | 'stitcher';
212
+ args: string[];
213
+ }) => string[]) => void;
214
+ /**
215
+ * Set a target audio bitrate to be passed to FFMPEG.
216
+ */
217
+ readonly setAudioBitrate: (bitrate: string | null) => void;
218
+ /**
219
+ * Set a target video bitrate to be passed to FFMPEG.
220
+ * Mutually exclusive with setCrf().
221
+ */
222
+ readonly setVideoBitrate: (bitrate: string | null) => void;
206
223
  };
207
224
  };
208
225
  export type { Concurrency, WebpackConfiguration, WebpackOverrideFn };
package/dist/config.js CHANGED
File without changes
File without changes
File without changes
File without changes
File without changes
package/dist/easing.d.ts CHANGED
File without changes
package/dist/easing.js CHANGED
File without changes
package/dist/freeze.d.ts CHANGED
File without changes
package/dist/freeze.js CHANGED
File without changes
File without changes
File without changes
File without changes
@@ -2,16 +2,16 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getRemotionEnvironment = void 0;
4
4
  const getRemotionEnvironment = () => {
5
- if (typeof process !== 'undefined' && process.env.NODE_ENV === 'production') {
5
+ if (process.env.NODE_ENV === 'production') {
6
6
  if (typeof window !== 'undefined' && window.remotion_isPlayer) {
7
7
  return 'player-production';
8
8
  }
9
9
  return 'rendering';
10
10
  }
11
- // The Jest framework sets NODE_ENV as test.
11
+ // The Vitest framework sets NODE_ENV as test.
12
12
  // Right now we don't need to treat it in a special
13
13
  // way which is good - defaulting to `rendering`.
14
- if (typeof process !== 'undefined' && process.env.NODE_ENV === 'test') {
14
+ if (process.env.NODE_ENV === 'test') {
15
15
  return 'rendering';
16
16
  }
17
17
  if (typeof window !== 'undefined' && window.remotion_isPlayer) {
File without changes
File without changes
File without changes
File without changes
package/dist/index.d.ts CHANGED
@@ -56,8 +56,8 @@ export * from './internals';
56
56
  export * from './interpolate';
57
57
  export { interpolateColors } from './interpolate-colors';
58
58
  export { Loop } from './loop';
59
- export { fetchAndPreload } from './preload';
60
- export * from './random';
59
+ export { prefetch } from './prefetch';
60
+ export { random, RandomSeed } from './random';
61
61
  export { registerRoot } from './register-root';
62
62
  export { Sequence } from './Sequence';
63
63
  export { Series } from './series';
package/dist/index.js CHANGED
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.useCurrentFrame = exports.staticFile = exports.Series = exports.Sequence = exports.registerRoot = exports.fetchAndPreload = exports.Loop = exports.interpolateColors = exports.getInputProps = exports.Config = void 0;
17
+ exports.useCurrentFrame = exports.staticFile = exports.Series = exports.Sequence = exports.registerRoot = exports.random = exports.prefetch = exports.Loop = exports.interpolateColors = exports.getInputProps = exports.Config = void 0;
18
18
  require("./asset-types");
19
19
  const multiple_versions_warning_1 = require("./multiple-versions-warning");
20
20
  (0, multiple_versions_warning_1.checkMultipleRemotionVersions)();
@@ -37,9 +37,10 @@ var interpolate_colors_1 = require("./interpolate-colors");
37
37
  Object.defineProperty(exports, "interpolateColors", { enumerable: true, get: function () { return interpolate_colors_1.interpolateColors; } });
38
38
  var loop_1 = require("./loop");
39
39
  Object.defineProperty(exports, "Loop", { enumerable: true, get: function () { return loop_1.Loop; } });
40
- var preload_1 = require("./preload");
41
- Object.defineProperty(exports, "fetchAndPreload", { enumerable: true, get: function () { return preload_1.fetchAndPreload; } });
42
- __exportStar(require("./random"), exports);
40
+ var prefetch_1 = require("./prefetch");
41
+ Object.defineProperty(exports, "prefetch", { enumerable: true, get: function () { return prefetch_1.prefetch; } });
42
+ var random_1 = require("./random");
43
+ Object.defineProperty(exports, "random", { enumerable: true, get: function () { return random_1.random; } });
43
44
  var register_root_1 = require("./register-root");
44
45
  Object.defineProperty(exports, "registerRoot", { enumerable: true, get: function () { return register_root_1.registerRoot; } });
45
46
  var Sequence_1 = require("./Sequence");