remotion 4.0.16 → 4.0.18

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.
@@ -17,11 +17,15 @@ const resolveVideoConfig = ({ composition, editorProps: editorPropsOrUndefined,
17
17
  abortSignal: signal,
18
18
  })
19
19
  : null;
20
+ const fallbackProps = {
21
+ ...((_c = composition.defaultProps) !== null && _c !== void 0 ? _c : {}),
22
+ ...(inputProps !== null && inputProps !== void 0 ? inputProps : {}),
23
+ };
20
24
  if (calculatedProm !== null &&
21
25
  typeof calculatedProm === 'object' &&
22
26
  'then' in calculatedProm) {
23
27
  return calculatedProm.then((c) => {
24
- var _a, _b, _c;
28
+ var _a, _b;
25
29
  const { height, width, durationInFrames, fps } = validateCalculated({
26
30
  calculated: c,
27
31
  composition,
@@ -33,7 +37,7 @@ const resolveVideoConfig = ({ composition, editorProps: editorPropsOrUndefined,
33
37
  durationInFrames,
34
38
  id: composition.id,
35
39
  defaultProps: (_a = composition.defaultProps) !== null && _a !== void 0 ? _a : {},
36
- props: (_c = (_b = c.props) !== null && _b !== void 0 ? _b : composition.defaultProps) !== null && _c !== void 0 ? _c : {},
40
+ props: (_b = c.props) !== null && _b !== void 0 ? _b : fallbackProps,
37
41
  };
38
42
  });
39
43
  }
@@ -45,11 +49,8 @@ const resolveVideoConfig = ({ composition, editorProps: editorPropsOrUndefined,
45
49
  return {
46
50
  ...data,
47
51
  id: composition.id,
48
- defaultProps: (_c = composition.defaultProps) !== null && _c !== void 0 ? _c : {},
49
- props: {
50
- ...((_d = composition.defaultProps) !== null && _d !== void 0 ? _d : {}),
51
- ...(inputProps !== null && inputProps !== void 0 ? inputProps : {}),
52
- },
52
+ defaultProps: (_d = composition.defaultProps) !== null && _d !== void 0 ? _d : {},
53
+ props: fallbackProps,
53
54
  };
54
55
  }
55
56
  return {
@@ -45,6 +45,9 @@ const trimLeadingSlash = (path) => {
45
45
  };
46
46
  const inner = (path) => {
47
47
  if (typeof window !== 'undefined' && window.remotion_staticBase) {
48
+ if (path.startsWith(window.remotion_staticBase)) {
49
+ throw new Error(`The value "${path}" is already prefixed with the static base ${window.remotion_staticBase}. You don't need to call staticFile() on it.`);
50
+ }
48
51
  return `${window.remotion_staticBase}/${trimLeadingSlash(path)}`;
49
52
  }
50
53
  return `/${trimLeadingSlash(path)}`;
@@ -0,0 +1,7 @@
1
+ type ContinueRenderFnBinded = () => void;
2
+ /**
3
+ * @description Same as delayRender(), but as a hook.
4
+ * @see [Documentation](https://remotion.dev/docs/use-delay-render)
5
+ */
6
+ export declare const useDelayRender: (label?: string) => ContinueRenderFnBinded;
7
+ export {};
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useDelayRender = void 0;
4
+ const react_1 = require("react");
5
+ const delay_render_js_1 = require("./delay-render.js");
6
+ /**
7
+ * @description Same as delayRender(), but as a hook.
8
+ * @see [Documentation](https://remotion.dev/docs/use-delay-render)
9
+ */
10
+ const useDelayRender = (label) => {
11
+ const [handle] = (0, react_1.useState)(() => (0, delay_render_js_1.delayRender)(label));
12
+ return (0, react_1.useCallback)(() => {
13
+ (0, delay_render_js_1.continueRender)(handle);
14
+ }, [handle]);
15
+ };
16
+ exports.useDelayRender = useDelayRender;
@@ -36,13 +36,6 @@ const useMediaPlayback = ({ mediaRef, src, mediaType, playbackRate: localPlaybac
36
36
  if (mediaRef.current.playbackRate !== playbackRateToSet) {
37
37
  mediaRef.current.playbackRate = playbackRateToSet;
38
38
  }
39
- // Let's throttle the seeking to only every 10 frames when a video is playing to avoid bottlenecking
40
- // the video tag.
41
- if (playing) {
42
- if (absoluteFrame % 10 !== 0) {
43
- return;
44
- }
45
- }
46
39
  const desiredUnclampedTime = (0, get_current_time_js_1.getMediaTime)({
47
40
  fps,
48
41
  frame,
@@ -1 +1 @@
1
- export declare const VERSION = "4.0.16";
1
+ export declare const VERSION = "4.0.18";
@@ -2,4 +2,4 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
4
  // Automatically generated on publish
5
- exports.VERSION = '4.0.16';
5
+ exports.VERSION = '4.0.18';
@@ -59,7 +59,7 @@ function truthy(value) {
59
59
  }
60
60
 
61
61
  // Automatically generated on publish
62
- const VERSION = '4.0.16';
62
+ const VERSION = '4.0.18';
63
63
 
64
64
  const checkMultipleRemotionVersions = () => {
65
65
  if (typeof globalThis === 'undefined') {
@@ -336,6 +336,9 @@ const trimLeadingSlash = (path) => {
336
336
  };
337
337
  const inner = (path) => {
338
338
  if (typeof window !== 'undefined' && window.remotion_staticBase) {
339
+ if (path.startsWith(window.remotion_staticBase)) {
340
+ throw new Error(`The value "${path}" is already prefixed with the static base ${window.remotion_staticBase}. You don't need to call staticFile() on it.`);
341
+ }
339
342
  return `${window.remotion_staticBase}/${trimLeadingSlash(path)}`;
340
343
  }
341
344
  return `/${trimLeadingSlash(path)}`;
@@ -549,11 +552,15 @@ const resolveVideoConfig = ({ composition, editorProps: editorPropsOrUndefined,
549
552
  abortSignal: signal,
550
553
  })
551
554
  : null;
555
+ const fallbackProps = {
556
+ ...((_c = composition.defaultProps) !== null && _c !== void 0 ? _c : {}),
557
+ ...(inputProps !== null && inputProps !== void 0 ? inputProps : {}),
558
+ };
552
559
  if (calculatedProm !== null &&
553
560
  typeof calculatedProm === 'object' &&
554
561
  'then' in calculatedProm) {
555
562
  return calculatedProm.then((c) => {
556
- var _a, _b, _c;
563
+ var _a, _b;
557
564
  const { height, width, durationInFrames, fps } = validateCalculated({
558
565
  calculated: c,
559
566
  composition,
@@ -565,7 +572,7 @@ const resolveVideoConfig = ({ composition, editorProps: editorPropsOrUndefined,
565
572
  durationInFrames,
566
573
  id: composition.id,
567
574
  defaultProps: (_a = composition.defaultProps) !== null && _a !== void 0 ? _a : {},
568
- props: (_c = (_b = c.props) !== null && _b !== void 0 ? _b : composition.defaultProps) !== null && _c !== void 0 ? _c : {},
575
+ props: (_b = c.props) !== null && _b !== void 0 ? _b : fallbackProps,
569
576
  };
570
577
  });
571
578
  }
@@ -577,11 +584,8 @@ const resolveVideoConfig = ({ composition, editorProps: editorPropsOrUndefined,
577
584
  return {
578
585
  ...data,
579
586
  id: composition.id,
580
- defaultProps: (_c = composition.defaultProps) !== null && _c !== void 0 ? _c : {},
581
- props: {
582
- ...((_d = composition.defaultProps) !== null && _d !== void 0 ? _d : {}),
583
- ...(inputProps !== null && inputProps !== void 0 ? inputProps : {}),
584
- },
587
+ defaultProps: (_d = composition.defaultProps) !== null && _d !== void 0 ? _d : {},
588
+ props: fallbackProps,
585
589
  };
586
590
  }
587
591
  return {
@@ -1776,13 +1780,6 @@ const useMediaPlayback = ({ mediaRef, src, mediaType, playbackRate: localPlaybac
1776
1780
  if (mediaRef.current.playbackRate !== playbackRateToSet) {
1777
1781
  mediaRef.current.playbackRate = playbackRateToSet;
1778
1782
  }
1779
- // Let's throttle the seeking to only every 10 frames when a video is playing to avoid bottlenecking
1780
- // the video tag.
1781
- if (playing) {
1782
- if (absoluteFrame % 10 !== 0) {
1783
- return;
1784
- }
1785
- }
1786
1783
  const desiredUnclampedTime = getMediaTime({
1787
1784
  fps,
1788
1785
  frame,
@@ -1,4 +1,4 @@
1
1
  // Automatically generated on publish
2
- const VERSION = '4.0.16';
2
+ const VERSION = '4.0.18';
3
3
 
4
4
  export { VERSION };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "remotion",
3
- "version": "4.0.16",
3
+ "version": "4.0.18",
4
4
  "description": "Render videos in React",
5
5
  "main": "dist/cjs/index.js",
6
6
  "types": "dist/cjs/index.d.ts",
@@ -34,7 +34,6 @@
34
34
  "react-dom": "^18.0.0",
35
35
  "rimraf": "^3.0.2",
36
36
  "rollup": "^2.70.1",
37
- "typescript": "4.9.5",
38
37
  "vitest": "0.31.1",
39
38
  "webpack": "5.83.1",
40
39
  "zod": "3.21.4"