remotion 4.0.17 → 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.
@@ -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.17";
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.17';
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.17';
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)}`;
@@ -1777,13 +1780,6 @@ const useMediaPlayback = ({ mediaRef, src, mediaType, playbackRate: localPlaybac
1777
1780
  if (mediaRef.current.playbackRate !== playbackRateToSet) {
1778
1781
  mediaRef.current.playbackRate = playbackRateToSet;
1779
1782
  }
1780
- // Let's throttle the seeking to only every 10 frames when a video is playing to avoid bottlenecking
1781
- // the video tag.
1782
- if (playing) {
1783
- if (absoluteFrame % 10 !== 0) {
1784
- return;
1785
- }
1786
- }
1787
1783
  const desiredUnclampedTime = getMediaTime({
1788
1784
  fps,
1789
1785
  frame,
@@ -1,4 +1,4 @@
1
1
  // Automatically generated on publish
2
- const VERSION = '4.0.17';
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.17",
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"