remotion 4.0.17 → 4.0.19

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)}`;
@@ -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,
@@ -72,15 +65,15 @@ const useMediaPlayback = ({ mediaRef, src, mediaType, playbackRate: localPlaybac
72
65
  // Refer to the https://github.com/remotion-dev/video-buffering-example
73
66
  // which is fixed by only seeking conditionally.
74
67
  const makesSenseToSeek = Math.abs(mediaRef.current.currentTime - shouldBeTime) > 0.00001;
75
- if (!makesSenseToSeek) {
76
- return;
77
- }
78
68
  if (!playing || absoluteFrame === 0) {
79
- mediaRef.current.currentTime = shouldBeTime;
80
- return;
69
+ if (makesSenseToSeek) {
70
+ mediaRef.current.currentTime = shouldBeTime;
71
+ }
81
72
  }
82
73
  if (mediaRef.current.paused && !mediaRef.current.ended && playing) {
83
- mediaRef.current.currentTime = shouldBeTime;
74
+ if (makesSenseToSeek) {
75
+ mediaRef.current.currentTime = shouldBeTime;
76
+ }
84
77
  (0, play_and_handle_not_allowed_error_js_1.playAndHandleNotAllowedError)(mediaRef, mediaType);
85
78
  }
86
79
  }, [
@@ -1 +1 @@
1
- export declare const VERSION = "4.0.17";
1
+ export declare const VERSION = "4.0.19";
@@ -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.19';
@@ -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.19';
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,
@@ -1813,15 +1809,15 @@ const useMediaPlayback = ({ mediaRef, src, mediaType, playbackRate: localPlaybac
1813
1809
  // Refer to the https://github.com/remotion-dev/video-buffering-example
1814
1810
  // which is fixed by only seeking conditionally.
1815
1811
  const makesSenseToSeek = Math.abs(mediaRef.current.currentTime - shouldBeTime) > 0.00001;
1816
- if (!makesSenseToSeek) {
1817
- return;
1818
- }
1819
1812
  if (!playing || absoluteFrame === 0) {
1820
- mediaRef.current.currentTime = shouldBeTime;
1821
- return;
1813
+ if (makesSenseToSeek) {
1814
+ mediaRef.current.currentTime = shouldBeTime;
1815
+ }
1822
1816
  }
1823
1817
  if (mediaRef.current.paused && !mediaRef.current.ended && playing) {
1824
- mediaRef.current.currentTime = shouldBeTime;
1818
+ if (makesSenseToSeek) {
1819
+ mediaRef.current.currentTime = shouldBeTime;
1820
+ }
1825
1821
  playAndHandleNotAllowedError(mediaRef, mediaType);
1826
1822
  }
1827
1823
  }, [
@@ -1,4 +1,4 @@
1
1
  // Automatically generated on publish
2
- const VERSION = '4.0.17';
2
+ const VERSION = '4.0.19';
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.19",
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"