remotion 4.0.0-oops.3 → 4.0.0-spawn.10

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 (45) hide show
  1. package/.turbo/turbo-build.log +5 -5
  2. package/dist/AbsoluteFill.js +1 -1
  3. package/dist/Composition.js +1 -1
  4. package/dist/CompositionManager.js +6 -2
  5. package/dist/IFrame.js +1 -1
  6. package/dist/Img.js +28 -16
  7. package/dist/RemotionRoot.js +1 -1
  8. package/dist/Still.js +1 -1
  9. package/dist/audio/Audio.js +3 -3
  10. package/dist/audio/AudioForDevelopment.js +1 -1
  11. package/dist/audio/AudioForRendering.js +1 -1
  12. package/dist/audio/index.js +5 -1
  13. package/dist/audio/shared-audio-tags.js +6 -2
  14. package/dist/config/chromium-flags.d.ts +1 -1
  15. package/dist/config/index.d.ts +3 -3
  16. package/dist/config/index.js +2 -2
  17. package/dist/delay-render.d.ts +1 -1
  18. package/dist/freeze.js +1 -1
  19. package/dist/index.d.ts +3 -2
  20. package/dist/index.js +8 -3
  21. package/dist/internals.d.ts +4 -5
  22. package/dist/internals.js +7 -4
  23. package/dist/loop/index.js +1 -1
  24. package/dist/sequencing/index.js +1 -1
  25. package/dist/series/index.js +3 -3
  26. package/dist/use-lazy-component.js +5 -1
  27. package/dist/validate-media-props.d.ts +2 -1
  28. package/dist/validation/validate-opengl-renderer.d.ts +1 -1
  29. package/dist/validation/validate-opengl-renderer.js +1 -1
  30. package/dist/video/OffthreadVideo.d.ts +3 -0
  31. package/dist/video/OffthreadVideo.js +25 -0
  32. package/dist/video/OffthreadVideoForRendering.d.ts +3 -0
  33. package/dist/video/OffthreadVideoForRendering.js +87 -0
  34. package/dist/video/Video.d.ts +2 -2
  35. package/dist/video/Video.js +3 -3
  36. package/dist/video/VideoForDevelopment.js +1 -1
  37. package/dist/video/VideoForRendering.d.ts +1 -1
  38. package/dist/video/VideoForRendering.js +18 -18
  39. package/dist/video/get-current-time.d.ts +5 -0
  40. package/dist/video/get-current-time.js +10 -2
  41. package/dist/video/index.d.ts +3 -2
  42. package/dist/video/index.js +5 -12
  43. package/dist/video/props.d.ts +10 -1
  44. package/dist/wrap-remotion-context.js +6 -2
  45. package/package.json +3 -3
@@ -1,5 +1,5 @@
1
- remotion:build: cache hit, replaying output 631f1a83aedea9d9
2
- remotion:build: 
3
- remotion:build: > remotion@3.0.7 build /Users/jonathanburger/remotion/packages/core
4
- remotion:build: > tsc -d
5
- remotion:build: 
1
+ remotion:build: cache hit, replaying output 3ddfe6800d8ef4db
2
+ remotion:build: 
3
+ remotion:build: > remotion@3.0.14 build /Users/jonathanburger/remotion/packages/core
4
+ remotion:build: > tsc -d
5
+ remotion:build: 
@@ -19,6 +19,6 @@ const AbsoluteFill = (props) => {
19
19
  ...style,
20
20
  };
21
21
  }, [style]);
22
- return (0, jsx_runtime_1.jsx)("div", { style: actualStyle, ...other }, void 0);
22
+ return (0, jsx_runtime_1.jsx)("div", { style: actualStyle, ...other });
23
23
  };
24
24
  exports.AbsoluteFill = AbsoluteFill;
@@ -34,7 +34,7 @@ const Folder = ({ name, children, }) => {
34
34
  unregisterFolder(name, parentName);
35
35
  };
36
36
  }, [name, parent.folderName, parentName, registerFolder, unregisterFolder]);
37
- return ((0, jsx_runtime_1.jsx)(FolderContext.Provider, { value: value, children: children }, void 0));
37
+ return ((0, jsx_runtime_1.jsx)(FolderContext.Provider, { value: value, children: children }));
38
38
  };
39
39
  exports.Folder = Folder;
40
40
  const Composition = ({ width, height, fps, durationInFrames, id, defaultProps, ...compProps }) => {
@@ -1,7 +1,11 @@
1
1
  "use strict";
2
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
3
  if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
5
9
  }) : (function(o, m, k, k2) {
6
10
  if (k2 === undefined) k2 = k;
7
11
  o[k2] = m[k];
@@ -139,6 +143,6 @@ const CompositionManagerProvider = ({ children }) => {
139
143
  unregisterFolder,
140
144
  folders,
141
145
  ]);
142
- return ((0, jsx_runtime_1.jsx)(exports.CompositionManager.Provider, { value: contextValue, children: children }, void 0));
146
+ return ((0, jsx_runtime_1.jsx)(exports.CompositionManager.Provider, { value: contextValue, children: children }));
143
147
  };
144
148
  exports.CompositionManagerProvider = CompositionManagerProvider;
package/dist/IFrame.js CHANGED
@@ -19,6 +19,6 @@ const IFrameRefForwarding = ({ onLoad, onError, ...props }, ref) => {
19
19
  console.error('Error loading iframe:', e, 'Handle the event using the onError() prop to make this message disappear.');
20
20
  }
21
21
  }, [handle, onError]);
22
- return (0, jsx_runtime_1.jsx)("iframe", { ...props, ref: ref, onError: didGetError, onLoad: didLoad }, void 0);
22
+ return (0, jsx_runtime_1.jsx)("iframe", { ...props, ref: ref, onError: didGetError, onLoad: didLoad });
23
23
  };
24
24
  exports.IFrame = (0, react_1.forwardRef)(IFrameRefForwarding);
package/dist/Img.js CHANGED
@@ -4,27 +4,39 @@ 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 ImgRefForwarding = ({ onLoad, onError, ...props }, ref) => {
8
- const [handle] = (0, react_1.useState)(() => (0, delay_render_1.delayRender)('Loading <Img> with src=' + props.src));
9
- (0, react_1.useEffect)(() => {
10
- if (ref &&
11
- ref.current.complete) {
12
- (0, delay_render_1.continueRender)(handle);
13
- }
14
- }, [handle, ref]);
15
- const didLoad = (0, react_1.useCallback)((e) => {
16
- (0, delay_render_1.continueRender)(handle);
17
- onLoad === null || onLoad === void 0 ? void 0 : onLoad(e);
18
- }, [handle, onLoad]);
7
+ const ImgRefForwarding = ({ onError, ...props }, ref) => {
8
+ const imageRef = (0, react_1.useRef)(null);
9
+ (0, react_1.useImperativeHandle)(ref, () => {
10
+ return imageRef.current;
11
+ });
19
12
  const didGetError = (0, react_1.useCallback)((e) => {
20
- (0, delay_render_1.continueRender)(handle);
13
+ var _a;
21
14
  if (onError) {
22
15
  onError(e);
23
16
  }
24
17
  else {
25
- console.error('Error loading image:', e, 'Handle the event using the onError() prop to make this message disappear.');
18
+ console.error('Error loading image with src:', (_a = imageRef.current) === null || _a === void 0 ? void 0 : _a.src, e, 'Handle the event using the onError() prop to make this message disappear.');
19
+ }
20
+ }, [onError]);
21
+ // If image source switches, make new handle
22
+ (0, react_1.useLayoutEffect)(() => {
23
+ const newHandle = (0, delay_render_1.delayRender)('Loading <Img> with src=' + props.src);
24
+ const { current } = imageRef;
25
+ const didLoad = () => {
26
+ (0, delay_render_1.continueRender)(newHandle);
27
+ };
28
+ if (current === null || current === void 0 ? void 0 : current.complete) {
29
+ (0, delay_render_1.continueRender)(newHandle);
30
+ }
31
+ else {
32
+ current === null || current === void 0 ? void 0 : current.addEventListener('load', didLoad, { once: true });
26
33
  }
27
- }, [handle, onError]);
28
- return (0, jsx_runtime_1.jsx)("img", { ...props, ref: ref, onLoad: didLoad, onError: didGetError }, void 0);
34
+ // If tag gets unmounted, clear pending handles because image is not going to load
35
+ return () => {
36
+ current === null || current === void 0 ? void 0 : current.removeEventListener('load', didLoad);
37
+ (0, delay_render_1.continueRender)(newHandle);
38
+ };
39
+ }, [props.src]);
40
+ return (0, jsx_runtime_1.jsx)("img", { ...props, ref: imageRef, onError: didGetError });
29
41
  };
30
42
  exports.Img = (0, react_1.forwardRef)(ImgRefForwarding);
@@ -65,6 +65,6 @@ const RemotionRoot = ({ children }) => {
65
65
  // 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.
66
66
  , {
67
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.
68
- numberOfAudioTags: 0, children: children }, void 0) }, void 0) }, void 0) }, void 0) }, void 0));
68
+ numberOfAudioTags: 0, children: children }) }) }) }) }));
69
69
  };
70
70
  exports.RemotionRoot = RemotionRoot;
package/dist/Still.js CHANGED
@@ -4,6 +4,6 @@ exports.Still = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const Composition_1 = require("./Composition");
6
6
  const Still = (props) => {
7
- return (0, jsx_runtime_1.jsx)(Composition_1.Composition, { fps: 1, durationInFrames: 1, ...props }, void 0);
7
+ return (0, jsx_runtime_1.jsx)(Composition_1.Composition, { fps: 1, durationInFrames: 1, ...props });
8
8
  };
9
9
  exports.Still = Still;
@@ -21,12 +21,12 @@ const AudioRefForwardingFunction = (props, ref) => {
21
21
  (0, validate_start_from_props_1.validateStartFromProps)(startFrom, endAt);
22
22
  const startFromFrameNo = startFrom !== null && startFrom !== void 0 ? startFrom : 0;
23
23
  const endAtFrameNo = endAt !== null && endAt !== void 0 ? endAt : Infinity;
24
- return ((0, jsx_runtime_1.jsx)(sequencing_1.Sequence, { layout: "none", from: 0 - startFromFrameNo, showInTimeline: false, durationInFrames: endAtFrameNo, children: (0, jsx_runtime_1.jsx)(exports.Audio, { ...otherProps, ref: ref }, void 0) }, void 0));
24
+ return ((0, jsx_runtime_1.jsx)(sequencing_1.Sequence, { layout: "none", from: 0 - startFromFrameNo, showInTimeline: false, durationInFrames: endAtFrameNo, children: (0, jsx_runtime_1.jsx)(exports.Audio, { ...otherProps, ref: ref }) }));
25
25
  }
26
26
  (0, validate_media_props_1.validateMediaProps)(props, 'Audio');
27
27
  if ((0, get_environment_1.getRemotionEnvironment)() === 'rendering') {
28
- return (0, jsx_runtime_1.jsx)(AudioForRendering_1.AudioForRendering, { ...props, ref: ref, onError: onError }, void 0);
28
+ return (0, jsx_runtime_1.jsx)(AudioForRendering_1.AudioForRendering, { ...props, ref: ref, onError: onError });
29
29
  }
30
- return ((0, jsx_runtime_1.jsx)(AudioForDevelopment_1.AudioForDevelopment, { shouldPreMountAudioTags: audioContext !== null && audioContext.numberOfAudioTags > 0, ...props, ref: ref, onError: onError }, void 0));
30
+ return ((0, jsx_runtime_1.jsx)(AudioForDevelopment_1.AudioForDevelopment, { shouldPreMountAudioTags: audioContext !== null && audioContext.numberOfAudioTags > 0, ...props, ref: ref, onError: onError }));
31
31
  };
32
32
  exports.Audio = (0, react_1.forwardRef)(AudioRefForwardingFunction);
@@ -53,6 +53,6 @@ const AudioForDevelopmentForwardRefFunction = (props, ref) => {
53
53
  if (initialShouldPreMountAudioElements) {
54
54
  return null;
55
55
  }
56
- return (0, jsx_runtime_1.jsx)("audio", { ref: audioRef, ...propsToPass }, void 0);
56
+ return (0, jsx_runtime_1.jsx)("audio", { ref: audioRef, ...propsToPass });
57
57
  };
58
58
  exports.AudioForDevelopment = (0, react_1.forwardRef)(AudioForDevelopmentForwardRefFunction);
@@ -63,6 +63,6 @@ const AudioForRenderingRefForwardingFunction = (props, ref) => {
63
63
  playbackRate,
64
64
  props.playbackRate,
65
65
  ]);
66
- return (0, jsx_runtime_1.jsx)("audio", { ref: audioRef, ...nativeProps }, void 0);
66
+ return (0, jsx_runtime_1.jsx)("audio", { ref: audioRef, ...nativeProps });
67
67
  };
68
68
  exports.AudioForRendering = (0, react_1.forwardRef)(AudioForRenderingRefForwardingFunction);
@@ -1,7 +1,11 @@
1
1
  "use strict";
2
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
3
  if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
5
9
  }) : (function(o, m, k, k2) {
6
10
  if (k2 === undefined) k2 = k;
7
11
  o[k2] = m[k];
@@ -1,7 +1,11 @@
1
1
  "use strict";
2
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
3
  if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
5
9
  }) : (function(o, m, k, k2) {
6
10
  if (k2 === undefined) k2 = k;
7
11
  o[k2] = m[k];
@@ -114,7 +118,7 @@ const SharedAudioContextProvider = ({ children, numberOfAudioTags }) => {
114
118
  throw new TypeError('Expected audio data to be there');
115
119
  }
116
120
  return (0, jsx_runtime_1.jsx)("audio", { ref: ref, ...data.props }, id);
117
- }), children] }, void 0));
121
+ }), children] }));
118
122
  };
119
123
  exports.SharedAudioContextProvider = SharedAudioContextProvider;
120
124
  const useSharedAudio = (aud) => {
@@ -4,7 +4,7 @@ export declare const getChromiumDisableWebSecurity: () => boolean;
4
4
  export declare const setChromiumDisableWebSecurity: (should: boolean) => void;
5
5
  export declare const getIgnoreCertificateErrors: () => boolean;
6
6
  export declare const setChromiumIgnoreCertificateErrors: (should: boolean) => void;
7
- export declare const getChromiumOpenGlRenderer: () => "angle" | "egl" | "swiftshader" | null;
7
+ export declare const getChromiumOpenGlRenderer: () => "swangle" | "angle" | "egl" | "swiftshader" | null;
8
8
  export declare const setChromiumOpenGlRenderer: (renderer: OpenGlRenderer) => void;
9
9
  export declare const getChromiumHeadlessMode: () => boolean;
10
10
  export declare const setChromiumHeadlessMode: (should: boolean) => void;
@@ -73,10 +73,10 @@ export declare const Config: {
73
73
  */
74
74
  readonly setChromiumHeadlessMode: (should: boolean) => void;
75
75
  /**
76
- * Set the OpenGL rendering backend for Chrome. Possible values: 'egl', 'angle' and 'swiftshader'.
77
- * Default: 'swiftshader' in Lambda, 'angle' elsewhere.
76
+ * Set the OpenGL rendering backend for Chrome. Possible values: 'egl', 'angle', 'swiftshader' and 'swangle'.
77
+ * Default: 'swangle' in Lambda, null elsewhere.
78
78
  */
79
- readonly setChromiumOpenGlRenderer: (renderer: "angle" | "egl" | "swiftshader") => void;
79
+ readonly setChromiumOpenGlRenderer: (renderer: "swangle" | "angle" | "egl" | "swiftshader") => void;
80
80
  };
81
81
  readonly Rendering: {
82
82
  /**
@@ -87,8 +87,8 @@ exports.Config = {
87
87
  */
88
88
  setChromiumHeadlessMode: chromium_flags_1.setChromiumHeadlessMode,
89
89
  /**
90
- * Set the OpenGL rendering backend for Chrome. Possible values: 'egl', 'angle' and 'swiftshader'.
91
- * Default: 'swiftshader' in Lambda, 'angle' elsewhere.
90
+ * Set the OpenGL rendering backend for Chrome. Possible values: 'egl', 'angle', 'swiftshader' and 'swangle'.
91
+ * Default: 'swangle' in Lambda, null elsewhere.
92
92
  */
93
93
  setChromiumOpenGlRenderer: chromium_flags_1.setChromiumOpenGlRenderer,
94
94
  },
@@ -5,7 +5,7 @@ export declare const DELAY_RENDER_CALLSTACK_TOKEN = "The delayRender was called:
5
5
  * @returns {number} An identifier to be passed to continueRender().
6
6
  * @link https://www.remotion.dev/docs/delay-render
7
7
  */
8
- export declare const delayRender: (label?: string | undefined) => number;
8
+ export declare const delayRender: (label?: string) => number;
9
9
  /**
10
10
  * Unblock a render that has been blocked by delayRender()
11
11
  * @param handle The return value of delayRender().
package/dist/freeze.js CHANGED
@@ -29,6 +29,6 @@ const Freeze = ({ frame, children }) => {
29
29
  frame,
30
30
  };
31
31
  }, [context, frame]);
32
- return ((0, jsx_runtime_1.jsx)(timeline_position_state_1.TimelineContext.Provider, { value: value, children: (0, jsx_runtime_1.jsx)(sequencing_1.SequenceContext.Provider, { value: null, children: children }, void 0) }, void 0));
32
+ return ((0, jsx_runtime_1.jsx)(timeline_position_state_1.TimelineContext.Provider, { value: value, children: (0, jsx_runtime_1.jsx)(sequencing_1.SequenceContext.Provider, { value: null, children: children }) }));
33
33
  };
34
34
  exports.Freeze = Freeze;
package/dist/index.d.ts CHANGED
@@ -11,13 +11,14 @@ declare global {
11
11
  remotion_cwd: string;
12
12
  remotion_setFrame: (frame: number) => void;
13
13
  remotion_initialFrame: number;
14
+ remotion_proxyPort: number;
14
15
  remotion_puppeteerTimeout: number;
15
16
  remotion_inputProps: string;
16
17
  remotion_envVariables: string;
17
18
  remotion_collectAssets: () => TAsset[];
18
19
  remotion_isPlayer: boolean;
19
20
  remotion_imported: boolean;
20
- siteVersion: '2';
21
+ siteVersion: '3';
21
22
  }
22
23
  }
23
24
  export declare type BundleState = {
@@ -51,7 +52,7 @@ export * from './spring';
51
52
  export { staticFile } from './static-file';
52
53
  export * from './Still';
53
54
  export type { PlayableMediaTag } from './timeline-position-state';
54
- export * from './use-frame';
55
+ export { useCurrentFrame } from './use-frame';
55
56
  export * from './use-video-config';
56
57
  export * from './video';
57
58
  export * from './video-config';
package/dist/index.js CHANGED
@@ -1,7 +1,11 @@
1
1
  "use strict";
2
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
3
  if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
5
9
  }) : (function(o, m, k, k2) {
6
10
  if (k2 === undefined) k2 = k;
7
11
  o[k2] = m[k];
@@ -10,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
15
  };
12
16
  Object.defineProperty(exports, "__esModule", { value: true });
13
- exports.staticFile = exports.Series = exports.Sequence = exports.registerRoot = exports.Loop = exports.interpolateColors = exports.getInputProps = void 0;
17
+ exports.useCurrentFrame = exports.staticFile = exports.Series = exports.Sequence = exports.registerRoot = exports.Loop = exports.interpolateColors = exports.getInputProps = void 0;
14
18
  require("./asset-types");
15
19
  const multiple_versions_warning_1 = require("./multiple-versions-warning");
16
20
  (0, multiple_versions_warning_1.checkMultipleRemotionVersions)();
@@ -42,7 +46,8 @@ __exportStar(require("./spring"), exports);
42
46
  var static_file_1 = require("./static-file");
43
47
  Object.defineProperty(exports, "staticFile", { enumerable: true, get: function () { return static_file_1.staticFile; } });
44
48
  __exportStar(require("./Still"), exports);
45
- __exportStar(require("./use-frame"), exports);
49
+ var use_frame_1 = require("./use-frame");
50
+ Object.defineProperty(exports, "useCurrentFrame", { enumerable: true, get: function () { return use_frame_1.useCurrentFrame; } });
46
51
  __exportStar(require("./use-video-config"), exports);
47
52
  __exportStar(require("./video"), exports);
48
53
  __exportStar(require("./video-config"), exports);
@@ -93,9 +93,7 @@ export declare const Internals: {
93
93
  RemotionContextProvider: (props: import("./wrap-remotion-context").RemotionContextProviderProps) => JSX.Element;
94
94
  CSSUtils: typeof CSSUtils;
95
95
  setupEnvVariables: () => void;
96
- setupInitialFrame: () => void;
97
96
  ENV_VARIABLES_ENV_NAME: "ENV_VARIABLES";
98
- INITIAL_FRAME_LOCAL_STORAGE_KEY: string;
99
97
  getDotEnvLocation: () => string | null;
100
98
  getServerPort: () => number | undefined;
101
99
  MediaVolumeContext: import("react").Context<MediaVolumeContextValue>;
@@ -138,14 +136,15 @@ export declare const Internals: {
138
136
  getCurrentPuppeteerTimeout: () => number;
139
137
  getChromiumDisableWebSecurity: () => boolean;
140
138
  getIgnoreCertificateErrors: () => boolean;
141
- validateOpenGlRenderer: (option: "angle" | "egl" | "swiftshader" | null) => "angle" | "egl" | "swiftshader" | null;
142
- getChromiumOpenGlRenderer: () => "angle" | "egl" | "swiftshader" | null;
139
+ validateOpenGlRenderer: (option: "swangle" | "angle" | "egl" | "swiftshader" | null) => "swangle" | "angle" | "egl" | "swiftshader" | null;
140
+ getChromiumOpenGlRenderer: () => "swangle" | "angle" | "egl" | "swiftshader" | null;
143
141
  getChromiumHeadlessMode: () => boolean;
144
- DEFAULT_OPENGL_RENDERER: "angle" | "egl" | "swiftshader" | null;
142
+ DEFAULT_OPENGL_RENDERER: "swangle" | "angle" | "egl" | "swiftshader" | null;
145
143
  getPreviewDomElement: () => HTMLElement | null;
146
144
  compositionsRef: import("react").RefObject<{
147
145
  getCompositions: () => TCompMetadata[];
148
146
  }>;
149
147
  DELAY_RENDER_CALLSTACK_TOKEN: string;
148
+ useAbsoluteCurrentFrame: () => number;
150
149
  };
151
150
  export type { TComposition, Timeline, TCompMetadata, TSequence, WebpackOverrideFn, TAsset, RenderAssetInfo, TimelineContextValue, SetTimelineContextValue, TimelineInOutContextValue, SetTimelineInOutContextValue, CompProps, CompositionManagerContext, MediaVolumeContextValue, SetMediaVolumeContextValue, RemotionEnvironment, ProResProfile, OpenGlRenderer, };
package/dist/internals.js CHANGED
@@ -1,7 +1,11 @@
1
1
  "use strict";
2
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
3
  if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
5
9
  }) : (function(o, m, k, k2) {
6
10
  if (k2 === undefined) k2 = k;
7
11
  o[k2] = m[k];
@@ -51,7 +55,6 @@ const delay_render_1 = require("./delay-render");
51
55
  const feature_flags_1 = require("./feature-flags");
52
56
  const get_environment_1 = require("./get-environment");
53
57
  const get_preview_dom_element_1 = require("./get-preview-dom-element");
54
- const initial_frame_1 = require("./initial-frame");
55
58
  const is_audio_codec_1 = require("./is-audio-codec");
56
59
  const perf = __importStar(require("./perf"));
57
60
  const register_root_1 = require("./register-root");
@@ -62,6 +65,7 @@ const TimelineInOutPosition = __importStar(require("./timeline-inout-position-st
62
65
  const TimelinePosition = __importStar(require("./timeline-position-state"));
63
66
  const timeout_2 = require("./timeout");
64
67
  const truthy_1 = require("./truthy");
68
+ const use_frame_1 = require("./use-frame");
65
69
  const use_lazy_component_1 = require("./use-lazy-component");
66
70
  const use_unsafe_video_config_1 = require("./use-unsafe-video-config");
67
71
  const use_video_1 = require("./use-video");
@@ -125,9 +129,7 @@ exports.Internals = {
125
129
  RemotionContextProvider: wrap_remotion_context_1.RemotionContextProvider,
126
130
  CSSUtils,
127
131
  setupEnvVariables: setup_env_variables_1.setupEnvVariables,
128
- setupInitialFrame: initial_frame_1.setupInitialFrame,
129
132
  ENV_VARIABLES_ENV_NAME: setup_env_variables_1.ENV_VARIABLES_ENV_NAME,
130
- INITIAL_FRAME_LOCAL_STORAGE_KEY: initial_frame_1.INITIAL_FRAME_LOCAL_STORAGE_KEY,
131
133
  getDotEnvLocation: env_file_1.getDotEnvLocation,
132
134
  getServerPort: preview_server_1.getServerPort,
133
135
  MediaVolumeContext: volume_position_state_1.MediaVolumeContext,
@@ -164,4 +166,5 @@ exports.Internals = {
164
166
  getPreviewDomElement: get_preview_dom_element_1.getPreviewDomElement,
165
167
  compositionsRef: CompositionManager_1.compositionsRef,
166
168
  DELAY_RENDER_CALLSTACK_TOKEN: delay_render_1.DELAY_RENDER_CALLSTACK_TOKEN,
169
+ useAbsoluteCurrentFrame: use_frame_1.useAbsoluteCurrentFrame,
167
170
  };
@@ -22,6 +22,6 @@ const Loop = ({ durationInFrames, times = Infinity, children, layout, name, }) =
22
22
  return ((0, jsx_runtime_1.jsx)(__1.Sequence
23
23
  // eslint-disable-next-line react/no-array-index-key
24
24
  , { durationInFrames: durationInFrames, from: i * durationInFrames, layout: layout, name: name, showLoopTimesInTimeline: actualTimes, showInTimeline: i === 0, children: children }, `loop-${i}`));
25
- }) }, void 0));
25
+ }) }));
26
26
  };
27
27
  exports.Loop = Loop;
@@ -118,6 +118,6 @@ const Sequence = ({ from, durationInFrames = Infinity, children, name, layout =
118
118
  bottom: 0,
119
119
  left: 0,
120
120
  right: 0,
121
- }, children: content }, void 0)) : (content) }, void 0));
121
+ }, children: content })) : (content) }));
122
122
  };
123
123
  exports.Sequence = Sequence;
@@ -8,7 +8,7 @@ const validate_duration_in_frames_1 = require("../validation/validate-duration-i
8
8
  const flatten_children_1 = require("./flatten-children");
9
9
  const SeriesSequence = ({ children }) => {
10
10
  // eslint-disable-next-line react/jsx-no-useless-fragment
11
- return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: children }, void 0);
11
+ return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: children });
12
12
  };
13
13
  const Series = ({ children }) => {
14
14
  const childrenValue = (0, react_1.useMemo)(() => {
@@ -45,11 +45,11 @@ const Series = ({ children }) => {
45
45
  }
46
46
  const currentStartFrame = startFrame + offset;
47
47
  startFrame += durationInFramesProp + offset;
48
- return ((0, jsx_runtime_1.jsx)(sequencing_1.Sequence, { from: currentStartFrame, durationInFrames: durationInFramesProp, ...passedProps, children: child }, void 0));
48
+ return ((0, jsx_runtime_1.jsx)(sequencing_1.Sequence, { from: currentStartFrame, durationInFrames: durationInFramesProp, ...passedProps, children: child }));
49
49
  });
50
50
  }, [children]);
51
51
  /* eslint-disable react/jsx-no-useless-fragment */
52
- return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: childrenValue }, void 0);
52
+ return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: childrenValue });
53
53
  };
54
54
  exports.Series = Series;
55
55
  Series.Sequence = SeriesSequence;
@@ -1,7 +1,11 @@
1
1
  "use strict";
2
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
3
  if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
5
9
  }) : (function(o, m, k, k2) {
6
10
  if (k2 === undefined) k2 = k;
7
11
  o[k2] = m[k];
@@ -1,3 +1,4 @@
1
1
  import { RemotionAudioProps } from './audio';
2
2
  import { RemotionVideoProps } from './video';
3
- export declare const validateMediaProps: (props: RemotionVideoProps | RemotionAudioProps, component: 'Video' | 'Audio') => void;
3
+ import { OffthreadVideoProps } from './video/props';
4
+ export declare const validateMediaProps: (props: RemotionVideoProps | RemotionAudioProps | OffthreadVideoProps, component: 'Video' | 'Audio') => void;
@@ -1,4 +1,4 @@
1
- declare const validRenderers: readonly ["angle", "egl", "swiftshader"];
1
+ declare const validRenderers: readonly ["swangle", "angle", "egl", "swiftshader"];
2
2
  export declare type OpenGlRenderer = typeof validRenderers[number];
3
3
  export declare const validateOpenGlRenderer: (option: OpenGlRenderer | null) => OpenGlRenderer | null;
4
4
  export {};
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.validateOpenGlRenderer = void 0;
4
- const validRenderers = ['angle', 'egl', 'swiftshader'];
4
+ const validRenderers = ['swangle', 'angle', 'egl', 'swiftshader'];
5
5
  const validateOpenGlRenderer = (option) => {
6
6
  if (option === null) {
7
7
  return null;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ import { OffthreadVideoProps, RemotionMainVideoProps } from './props';
3
+ export declare const OffthreadVideo: React.FC<OffthreadVideoProps & RemotionMainVideoProps>;
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.OffthreadVideo = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const get_environment_1 = require("../get-environment");
6
+ const sequencing_1 = require("../sequencing");
7
+ const validate_media_props_1 = require("../validate-media-props");
8
+ const validate_start_from_props_1 = require("../validate-start-from-props");
9
+ const OffthreadVideoForRendering_1 = require("./OffthreadVideoForRendering");
10
+ const VideoForDevelopment_1 = require("./VideoForDevelopment");
11
+ const OffthreadVideo = (props) => {
12
+ const { startFrom, endAt, ...otherProps } = props;
13
+ if (typeof startFrom !== 'undefined' || typeof endAt !== 'undefined') {
14
+ (0, validate_start_from_props_1.validateStartFromProps)(startFrom, endAt);
15
+ const startFromFrameNo = startFrom !== null && startFrom !== void 0 ? startFrom : 0;
16
+ const endAtFrameNo = endAt !== null && endAt !== void 0 ? endAt : Infinity;
17
+ return ((0, jsx_runtime_1.jsx)(sequencing_1.Sequence, { layout: "none", from: 0 - startFromFrameNo, showInTimeline: false, durationInFrames: endAtFrameNo, children: (0, jsx_runtime_1.jsx)(exports.OffthreadVideo, { ...otherProps }) }));
18
+ }
19
+ (0, validate_media_props_1.validateMediaProps)(props, 'Video');
20
+ if ((0, get_environment_1.getRemotionEnvironment)() === 'rendering') {
21
+ return (0, jsx_runtime_1.jsx)(OffthreadVideoForRendering_1.OffthreadVideoForRendering, { ...otherProps });
22
+ }
23
+ return (0, jsx_runtime_1.jsx)(VideoForDevelopment_1.VideoForDevelopment, { ...otherProps });
24
+ };
25
+ exports.OffthreadVideo = OffthreadVideo;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ import { OffthreadVideoProps } from './props';
3
+ export declare const OffthreadVideoForRendering: React.FC<OffthreadVideoProps>;
@@ -0,0 +1,87 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.OffthreadVideoForRendering = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const react_1 = require("react");
6
+ const absolute_src_1 = require("../absolute-src");
7
+ const use_audio_frame_1 = require("../audio/use-audio-frame");
8
+ const CompositionManager_1 = require("../CompositionManager");
9
+ const Img_1 = require("../Img");
10
+ const random_1 = require("../random");
11
+ const sequencing_1 = require("../sequencing");
12
+ const use_frame_1 = require("../use-frame");
13
+ const use_unsafe_video_config_1 = require("../use-unsafe-video-config");
14
+ const volume_prop_1 = require("../volume-prop");
15
+ const get_current_time_1 = require("./get-current-time");
16
+ const OffthreadVideoForRendering = ({ onError, volume: volumeProp, playbackRate, src, muted, ...props }) => {
17
+ const absoluteFrame = (0, use_frame_1.useAbsoluteCurrentFrame)();
18
+ const frame = (0, use_frame_1.useCurrentFrame)();
19
+ const volumePropsFrame = (0, use_audio_frame_1.useFrameForVolumeProp)();
20
+ const videoConfig = (0, use_unsafe_video_config_1.useUnsafeVideoConfig)();
21
+ const sequenceContext = (0, react_1.useContext)(sequencing_1.SequenceContext);
22
+ const mediaStartsAt = (0, use_audio_frame_1.useMediaStartsAt)();
23
+ const { registerAsset, unregisterAsset } = (0, react_1.useContext)(CompositionManager_1.CompositionManager);
24
+ if (!src) {
25
+ throw new TypeError('No `src` was passed to <OffthreadVideo>.');
26
+ }
27
+ // Generate a string that's as unique as possible for this asset
28
+ // but at the same time the same on all threads
29
+ const id = (0, react_1.useMemo)(() => `video-${(0, random_1.random)(src !== null && src !== void 0 ? src : '')}-${sequenceContext === null || sequenceContext === void 0 ? void 0 : sequenceContext.cumulatedFrom}-${sequenceContext === null || sequenceContext === void 0 ? void 0 : sequenceContext.relativeFrom}-${sequenceContext === null || sequenceContext === void 0 ? void 0 : sequenceContext.durationInFrames}-muted:${muted}`, [
30
+ src,
31
+ muted,
32
+ sequenceContext === null || sequenceContext === void 0 ? void 0 : sequenceContext.cumulatedFrom,
33
+ sequenceContext === null || sequenceContext === void 0 ? void 0 : sequenceContext.relativeFrom,
34
+ sequenceContext === null || sequenceContext === void 0 ? void 0 : sequenceContext.durationInFrames,
35
+ ]);
36
+ if (!videoConfig) {
37
+ throw new Error('No video config found');
38
+ }
39
+ const volume = (0, volume_prop_1.evaluateVolume)({
40
+ volume: volumeProp,
41
+ frame: volumePropsFrame,
42
+ mediaVolume: 1,
43
+ });
44
+ (0, react_1.useEffect)(() => {
45
+ if (!src) {
46
+ throw new Error('No src passed');
47
+ }
48
+ if (muted) {
49
+ return;
50
+ }
51
+ registerAsset({
52
+ type: 'video',
53
+ src: (0, absolute_src_1.getAbsoluteSrc)(src),
54
+ id,
55
+ frame: absoluteFrame,
56
+ volume,
57
+ mediaFrame: frame,
58
+ playbackRate: playbackRate !== null && playbackRate !== void 0 ? playbackRate : 1,
59
+ });
60
+ return () => unregisterAsset(id);
61
+ }, [
62
+ muted,
63
+ src,
64
+ registerAsset,
65
+ id,
66
+ unregisterAsset,
67
+ volume,
68
+ frame,
69
+ absoluteFrame,
70
+ playbackRate,
71
+ ]);
72
+ const currentTime = (0, react_1.useMemo)(() => {
73
+ return ((0, get_current_time_1.getExpectedMediaFrameUncorrected)({
74
+ frame,
75
+ playbackRate: playbackRate || 1,
76
+ startFrom: -mediaStartsAt,
77
+ }) / videoConfig.fps);
78
+ }, [frame, mediaStartsAt, playbackRate, videoConfig.fps]);
79
+ const actualSrc = (0, react_1.useMemo)(() => {
80
+ return `http://localhost:${window.remotion_proxyPort}/proxy?src=${encodeURIComponent((0, absolute_src_1.getAbsoluteSrc)(src))}&time=${encodeURIComponent(currentTime)}`;
81
+ }, [currentTime, src]);
82
+ const onErr = (0, react_1.useCallback)((e) => {
83
+ onError === null || onError === void 0 ? void 0 : onError(e);
84
+ }, [onError]);
85
+ return (0, jsx_runtime_1.jsx)(Img_1.Img, { src: actualSrc, ...props, onError: onErr });
86
+ };
87
+ exports.OffthreadVideoForRendering = OffthreadVideoForRendering;
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { RemotionMainVideoProps } from './props';
3
- export declare const Video: React.ForwardRefExoticComponent<Pick<Omit<React.DetailedHTMLProps<React.VideoHTMLAttributes<HTMLVideoElement>, HTMLVideoElement>, "autoPlay" | "controls" | "loop" | "onEnded"> & {
3
+ export declare const Video: React.ForwardRefExoticComponent<Pick<Omit<React.DetailedHTMLProps<React.VideoHTMLAttributes<HTMLVideoElement>, HTMLVideoElement>, "onEnded" | "autoPlay" | "controls" | "loop"> & {
4
4
  volume?: import("../volume-prop").VolumeProp | undefined;
5
5
  playbackRate?: number | undefined;
6
- } & RemotionMainVideoProps, "key" | "height" | "playsInline" | "poster" | "width" | "disablePictureInPicture" | "disableRemotePlayback" | "controlsList" | "crossOrigin" | "mediaGroup" | "muted" | "preload" | "src" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "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" | "volume" | "playbackRate" | keyof RemotionMainVideoProps> & React.RefAttributes<HTMLVideoElement>>;
6
+ } & RemotionMainVideoProps, "style" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "slot" | "spellCheck" | "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" | "height" | "width" | "src" | "volume" | "playbackRate" | "controlsList" | "crossOrigin" | "mediaGroup" | "muted" | "playsInline" | "preload" | "key" | "poster" | "disablePictureInPicture" | "disableRemotePlayback" | keyof RemotionMainVideoProps> & React.RefAttributes<HTMLVideoElement>>;
@@ -18,12 +18,12 @@ const VideoForwardingFunction = (props, ref) => {
18
18
  (0, validate_start_from_props_1.validateStartFromProps)(startFrom, endAt);
19
19
  const startFromFrameNo = startFrom !== null && startFrom !== void 0 ? startFrom : 0;
20
20
  const endAtFrameNo = endAt !== null && endAt !== void 0 ? endAt : Infinity;
21
- return ((0, jsx_runtime_1.jsx)(sequencing_1.Sequence, { layout: "none", from: 0 - startFromFrameNo, showInTimeline: false, durationInFrames: endAtFrameNo, children: (0, jsx_runtime_1.jsx)(exports.Video, { ...otherProps, ref: ref }, void 0) }, void 0));
21
+ return ((0, jsx_runtime_1.jsx)(sequencing_1.Sequence, { layout: "none", from: 0 - startFromFrameNo, showInTimeline: false, durationInFrames: endAtFrameNo, children: (0, jsx_runtime_1.jsx)(exports.Video, { ...otherProps, ref: ref }) }));
22
22
  }
23
23
  (0, validate_media_props_1.validateMediaProps)(props, 'Video');
24
24
  if ((0, get_environment_1.getRemotionEnvironment)() === 'rendering') {
25
- return (0, jsx_runtime_1.jsx)(VideoForRendering_1.VideoForRendering, { ...otherProps, ref: ref }, void 0);
25
+ return (0, jsx_runtime_1.jsx)(VideoForRendering_1.VideoForRendering, { ...otherProps, ref: ref });
26
26
  }
27
- return (0, jsx_runtime_1.jsx)(VideoForDevelopment_1.VideoForDevelopment, { ...otherProps, ref: ref }, void 0);
27
+ return (0, jsx_runtime_1.jsx)(VideoForDevelopment_1.VideoForDevelopment, { ...otherProps, ref: ref });
28
28
  };
29
29
  exports.Video = (0, react_1.forwardRef)(VideoForwardingFunction);
@@ -40,6 +40,6 @@ const VideoForDevelopmentRefForwardingFunction = (props, ref) => {
40
40
  (0, react_1.useImperativeHandle)(ref, () => {
41
41
  return videoRef.current;
42
42
  });
43
- return ((0, jsx_runtime_1.jsx)("video", { ref: videoRef, muted: muted || mediaMuted, playsInline: true, ...nativeProps }, void 0));
43
+ return ((0, jsx_runtime_1.jsx)("video", { ref: videoRef, muted: muted || mediaMuted, playsInline: true, ...nativeProps }));
44
44
  };
45
45
  exports.VideoForDevelopment = (0, react_1.forwardRef)(VideoForDevelopmentRefForwardingFunction);
@@ -1,3 +1,3 @@
1
1
  import React from 'react';
2
2
  import { RemotionVideoProps } from './props';
3
- export declare const VideoForRendering: React.ForwardRefExoticComponent<Pick<RemotionVideoProps, "key" | "height" | "playsInline" | "poster" | "width" | "disablePictureInPicture" | "disableRemotePlayback" | "controlsList" | "crossOrigin" | "mediaGroup" | "muted" | "preload" | "src" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "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" | "volume" | "playbackRate"> & React.RefAttributes<HTMLVideoElement>>;
3
+ export declare const VideoForRendering: React.ForwardRefExoticComponent<Pick<RemotionVideoProps, "style" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "slot" | "spellCheck" | "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" | "height" | "width" | "src" | "volume" | "playbackRate" | "controlsList" | "crossOrigin" | "mediaGroup" | "muted" | "playsInline" | "preload" | "key" | "poster" | "disablePictureInPicture" | "disableRemotePlayback"> & React.RefAttributes<HTMLVideoElement>>;
@@ -103,36 +103,36 @@ const VideoForRenderingForwardFunction = ({ onError, volume: volumeProp, playbac
103
103
  return;
104
104
  }
105
105
  videoRef.current.currentTime = currentTime;
106
- // @ts-expect-error
107
- videoRef.current.requestVideoFrameCallback((now, metadata) => {
108
- window.requestAnimationFrame(() => {
109
- var _a, _b, _c, _d;
110
- if (window.navigator.platform.startsWith('Mac')) {
111
- // Improve me: This is ensures frame perfectness but slows down render.
112
- // Please see this issue for context: https://github.com/remotion-dev/remotion/issues/200
113
- // Only affects macOS since it uses VideoToolbox decoding.
114
- console.log('new frame ', frame, now, JSON.stringify(metadata), (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.readyState, (_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.currentTime, currentTime);
106
+ videoRef.current.addEventListener('seeked', () => {
107
+ if (window.navigator.platform.startsWith('Mac')) {
108
+ // Improve me: This is ensures frame perfectness but slows down render.
109
+ // Please see this issue for context: https://github.com/remotion-dev/remotion/issues/200
110
+ // Only affects macOS since it uses VideoToolbox decoding.
111
+ setTimeout(() => {
115
112
  (0, delay_render_1.continueRender)(handle);
116
- }
117
- else {
118
- console.log('new frame ', frame, now, JSON.stringify(metadata), (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.readyState, (_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.currentTime, currentTime);
119
- (0, delay_render_1.continueRender)(handle);
120
- }
121
- });
122
- });
113
+ }, 100);
114
+ }
115
+ else {
116
+ (0, delay_render_1.continueRender)(handle);
117
+ }
118
+ }, { once: true });
123
119
  videoRef.current.addEventListener('ended', () => {
124
120
  (0, delay_render_1.continueRender)(handle);
125
121
  }, { once: true });
126
122
  videoRef.current.addEventListener('error', () => {
127
123
  var _a, _b, _c, _d;
128
124
  if ((_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.error) {
129
- console.error('Error occurred in video', (_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.error.toString());
125
+ console.error('Error occurred in video', (_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.error);
130
126
  throw new Error(`The browser threw an error while playing the video: ${(_d = (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.error) === null || _d === void 0 ? void 0 : _d.message}`);
131
127
  }
132
128
  else {
133
129
  throw new Error('The browser threw an errir');
134
130
  }
135
131
  }, { once: true });
132
+ // If video skips to another frame or unmounts, we clear the created handle
133
+ return () => {
134
+ (0, delay_render_1.continueRender)(handle);
135
+ };
136
136
  }, [
137
137
  volumePropsFrame,
138
138
  props.src,
@@ -141,6 +141,6 @@ const VideoForRenderingForwardFunction = ({ onError, volume: volumeProp, playbac
141
141
  frame,
142
142
  mediaStartsAt,
143
143
  ]);
144
- return (0, jsx_runtime_1.jsx)("video", { ref: videoRef, ...props, onError: onError }, void 0);
144
+ return (0, jsx_runtime_1.jsx)("video", { ref: videoRef, ...props, onError: onError });
145
145
  };
146
146
  exports.VideoForRendering = (0, react_1.forwardRef)(VideoForRenderingForwardFunction);
@@ -1,3 +1,8 @@
1
+ export declare const getExpectedMediaFrameUncorrected: ({ frame, playbackRate, startFrom, }: {
2
+ frame: number;
3
+ playbackRate: number;
4
+ startFrom: number;
5
+ }) => number;
1
6
  export declare const getMediaTime: ({ fps, frame, src, playbackRate, startFrom, }: {
2
7
  fps: number;
3
8
  frame: number;
@@ -1,10 +1,18 @@
1
1
  "use strict";
2
2
  // Calculate the `.currentTime` of a video or audio element
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.getMediaTime = void 0;
4
+ exports.getMediaTime = exports.getExpectedMediaFrameUncorrected = void 0;
5
5
  const interpolate_1 = require("../interpolate");
6
+ const getExpectedMediaFrameUncorrected = ({ frame, playbackRate, startFrom, }) => {
7
+ return (0, interpolate_1.interpolate)(frame, [-1, startFrom, startFrom + 1], [-1, startFrom, startFrom + playbackRate]);
8
+ };
9
+ exports.getExpectedMediaFrameUncorrected = getExpectedMediaFrameUncorrected;
6
10
  const getMediaTime = ({ fps, frame, src, playbackRate, startFrom, }) => {
7
- const expectedFrame = (0, interpolate_1.interpolate)(frame, [-1, startFrom, startFrom + 1], [-1, startFrom, startFrom + playbackRate]);
11
+ const expectedFrame = (0, exports.getExpectedMediaFrameUncorrected)({
12
+ frame,
13
+ playbackRate,
14
+ startFrom,
15
+ });
8
16
  if (src.endsWith('mp4')) {
9
17
  // In Chrome, for MP4s, if 30fps, the first frame is still displayed at 0.033333
10
18
  // even though after that it increases by 0.033333333 each.
@@ -1,2 +1,3 @@
1
- export * from './props';
2
- export * from './Video';
1
+ export { OffthreadVideo } from './OffthreadVideo';
2
+ export { OffthreadVideoProps as RemotionOffthreadVideoProps, RemotionMainVideoProps, RemotionVideoProps, } from './props';
3
+ export { Video } from './Video';
@@ -1,14 +1,7 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
- }) : (function(o, m, k, k2) {
6
- if (k2 === undefined) k2 = k;
7
- o[k2] = m[k];
8
- }));
9
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
- };
12
2
  Object.defineProperty(exports, "__esModule", { value: true });
13
- __exportStar(require("./props"), exports);
14
- __exportStar(require("./Video"), exports);
3
+ exports.Video = exports.OffthreadVideo = void 0;
4
+ var OffthreadVideo_1 = require("./OffthreadVideo");
5
+ Object.defineProperty(exports, "OffthreadVideo", { enumerable: true, get: function () { return OffthreadVideo_1.OffthreadVideo; } });
6
+ var Video_1 = require("./Video");
7
+ Object.defineProperty(exports, "Video", { enumerable: true, get: function () { return Video_1.Video; } });
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  import { VolumeProp } from '../volume-prop';
3
3
  export declare type RemotionMainVideoProps = {
4
4
  startFrom?: number;
@@ -8,3 +8,12 @@ export declare type RemotionVideoProps = Omit<React.DetailedHTMLProps<React.Vide
8
8
  volume?: VolumeProp;
9
9
  playbackRate?: number;
10
10
  };
11
+ export declare type OffthreadVideoProps = {
12
+ src: string;
13
+ className?: string;
14
+ style?: React.CSSProperties;
15
+ volume?: VolumeProp;
16
+ playbackRate?: number;
17
+ muted?: boolean;
18
+ onError?: React.ReactEventHandler<HTMLVideoElement | HTMLImageElement>;
19
+ };
@@ -1,7 +1,11 @@
1
1
  "use strict";
2
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
3
  if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
5
9
  }) : (function(o, m, k, k2) {
6
10
  if (k2 === undefined) k2 = k;
7
11
  o[k2] = m[k];
@@ -52,6 +56,6 @@ function useRemotionContexts() {
52
56
  exports.useRemotionContexts = useRemotionContexts;
53
57
  const RemotionContextProvider = (props) => {
54
58
  const { children, contexts } = props;
55
- return ((0, jsx_runtime_1.jsx)(nonce_1.NonceContext.Provider, { value: contexts.nonceContext, children: (0, jsx_runtime_1.jsx)(CompositionManager_1.CompositionManager.Provider, { value: contexts.compositionManagerCtx, children: (0, jsx_runtime_1.jsx)(timeline_position_state_1.TimelineContext.Provider, { value: contexts.timelineContext, children: (0, jsx_runtime_1.jsx)(timeline_position_state_1.SetTimelineContext.Provider, { value: contexts.setTimelineContext, children: (0, jsx_runtime_1.jsx)(sequencing_1.SequenceContext.Provider, { value: contexts.sequenceContext, children: children }, void 0) }, void 0) }, void 0) }, void 0) }, void 0));
59
+ return ((0, jsx_runtime_1.jsx)(nonce_1.NonceContext.Provider, { value: contexts.nonceContext, children: (0, jsx_runtime_1.jsx)(CompositionManager_1.CompositionManager.Provider, { value: contexts.compositionManagerCtx, children: (0, jsx_runtime_1.jsx)(timeline_position_state_1.TimelineContext.Provider, { value: contexts.timelineContext, children: (0, jsx_runtime_1.jsx)(timeline_position_state_1.SetTimelineContext.Provider, { value: contexts.setTimelineContext, children: (0, jsx_runtime_1.jsx)(sequencing_1.SequenceContext.Provider, { value: contexts.sequenceContext, children: children }) }) }) }) }));
56
60
  };
57
61
  exports.RemotionContextProvider = RemotionContextProvider;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "remotion",
3
- "version": "4.0.0-oops.3+31c506229",
3
+ "version": "4.0.0-spawn.10+911177607",
4
4
  "description": "Render videos in React",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -41,7 +41,7 @@
41
41
  "react-test-renderer": "^18.0.0",
42
42
  "rimraf": "^3.0.2",
43
43
  "ts-jest": "^27.0.5",
44
- "typescript": "^4.5.5",
44
+ "typescript": "^4.7.0",
45
45
  "webpack": "5.72.0"
46
46
  },
47
47
  "keywords": [
@@ -55,5 +55,5 @@
55
55
  "publishConfig": {
56
56
  "access": "public"
57
57
  },
58
- "gitHead": "31c506229ccf43f67dee263b0edce90ebbb2e22e"
58
+ "gitHead": "911177607ac127d9f4d1c014ad8ae32fd14947dd"
59
59
  }