remotion 4.0.108 → 4.0.110

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.
@@ -13,9 +13,6 @@ export type SequencePropsWithoutDuration = {
13
13
  height?: number;
14
14
  from?: number;
15
15
  name?: string;
16
- /**
17
- * @deprecated For internal use only.
18
- */
19
16
  showInTimeline?: boolean;
20
17
  /**
21
18
  * @deprecated For internal use only.
@@ -0,0 +1 @@
1
+ export declare const getTimelineClipName: (children: React.ReactNode) => string;
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getTimelineClipName = void 0;
4
+ const react_1 = require("react");
5
+ const HIDDEN_NAMES = ['__WEBPACK_DEFAULT_EXPORT__'];
6
+ const getTimelineClipName = (children) => {
7
+ var _a;
8
+ const tree = (_a = react_1.Children.map(children, (ch) => {
9
+ if (!(0, react_1.isValidElement)(ch)) {
10
+ return null;
11
+ }
12
+ // Must be name, not ID
13
+ const name = typeof ch.type !== 'string' && ch.type.name;
14
+ if (name && !HIDDEN_NAMES.includes(name)) {
15
+ return name;
16
+ }
17
+ if (ch.props.children) {
18
+ const chName = (0, exports.getTimelineClipName)(ch.props.children);
19
+ return chName;
20
+ }
21
+ return null;
22
+ })) === null || _a === void 0 ? void 0 : _a.filter(Boolean);
23
+ return (tree === null || tree === void 0 ? void 0 : tree.length) ? tree[0] : '';
24
+ };
25
+ exports.getTimelineClipName = getTimelineClipName;
@@ -24,6 +24,7 @@ const useMediaBuffering = (element, shouldBuffer) => {
24
24
  });
25
25
  cleanup = () => {
26
26
  current.removeEventListener('canplay', onCanPlay);
27
+ unblock();
27
28
  return undefined;
28
29
  };
29
30
  };
@@ -1 +1 @@
1
- export declare const VERSION = "4.0.108";
1
+ export declare const VERSION = "4.0.110";
@@ -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.108';
5
+ exports.VERSION = '4.0.110';
@@ -1,6 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.seekToTimeMultipleUntilRight = exports.seekToTime = void 0;
4
+ const roundTo6Commas = (num) => {
5
+ return Math.round(num * 100000) / 100000;
6
+ };
4
7
  const seekToTime = (element, desiredTime) => {
5
8
  element.currentTime = desiredTime;
6
9
  let cancel;
@@ -61,13 +64,17 @@ const seekToTimeMultipleUntilRight = (element, desiredTime, fps) => {
61
64
  newSeek.wait
62
65
  .then((newTime) => {
63
66
  const newDifference = Math.abs(desiredTime - newTime);
64
- if (newDifference <= threshold) {
67
+ if (roundTo6Commas(newDifference) <= roundTo6Commas(threshold)) {
65
68
  return resolve();
66
69
  }
67
- const thirdSeek = (0, exports.seekToTime)(element, desiredTime);
70
+ const thirdSeek = (0, exports.seekToTime)(element, desiredTime + threshold);
68
71
  currentCancel = thirdSeek.cancel;
69
- return thirdSeek.wait.then(() => {
72
+ return thirdSeek.wait
73
+ .then(() => {
70
74
  resolve();
75
+ })
76
+ .catch((err) => {
77
+ reject(err);
71
78
  });
72
79
  })
73
80
  .catch((err) => {
@@ -105,7 +105,7 @@ function truthy(value) {
105
105
  }
106
106
 
107
107
  // Automatically generated on publish
108
- const VERSION = '4.0.108';
108
+ const VERSION = '4.0.110';
109
109
 
110
110
  const checkMultipleRemotionVersions = () => {
111
111
  if (typeof globalThis === 'undefined') {
@@ -4754,6 +4754,9 @@ const OffthreadVideo = (props) => {
4754
4754
  return (jsx(VideoForDevelopment, { _remotionInternalStack: stack !== null && stack !== void 0 ? stack : null, _remotionInternalNativeLoopPassed: false, onDuration: onDuration, onlyWarnForMediaSeekingError: true, ...withoutTransparent }));
4755
4755
  };
4756
4756
 
4757
+ const roundTo6Commas = (num) => {
4758
+ return Math.round(num * 100000) / 100000;
4759
+ };
4757
4760
  const seekToTime = (element, desiredTime) => {
4758
4761
  element.currentTime = desiredTime;
4759
4762
  let cancel;
@@ -4813,13 +4816,17 @@ const seekToTimeMultipleUntilRight = (element, desiredTime, fps) => {
4813
4816
  newSeek.wait
4814
4817
  .then((newTime) => {
4815
4818
  const newDifference = Math.abs(desiredTime - newTime);
4816
- if (newDifference <= threshold) {
4819
+ if (roundTo6Commas(newDifference) <= roundTo6Commas(threshold)) {
4817
4820
  return resolve();
4818
4821
  }
4819
- const thirdSeek = seekToTime(element, desiredTime);
4822
+ const thirdSeek = seekToTime(element, desiredTime + threshold);
4820
4823
  currentCancel = thirdSeek.cancel;
4821
- return thirdSeek.wait.then(() => {
4824
+ return thirdSeek.wait
4825
+ .then(() => {
4822
4826
  resolve();
4827
+ })
4828
+ .catch((err) => {
4829
+ reject(err);
4823
4830
  });
4824
4831
  })
4825
4832
  .catch((err) => {
@@ -1,4 +1,4 @@
1
1
  // Automatically generated on publish
2
- const VERSION = '4.0.108';
2
+ const VERSION = '4.0.110';
3
3
 
4
4
  export { VERSION };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "remotion",
3
- "version": "4.0.108",
3
+ "version": "4.0.110",
4
4
  "description": "Render videos in React",
5
5
  "main": "dist/cjs/index.js",
6
6
  "types": "dist/cjs/index.d.ts",
@@ -1,5 +0,0 @@
1
- export declare const useBufferState: () => {
2
- delayPlayback: () => {
3
- unblock: () => void;
4
- };
5
- };
@@ -1,28 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useBufferState = void 0;
4
- const react_1 = require("react");
5
- const buffering_1 = require("./buffering");
6
- const CanUseRemotionHooks_1 = require("./CanUseRemotionHooks");
7
- const useBufferState = () => {
8
- const canUseRemotionHooks = (0, react_1.useContext)(CanUseRemotionHooks_1.CanUseRemotionHooks);
9
- if (!canUseRemotionHooks) {
10
- if (typeof window !== 'undefined' && window.remotion_isPlayer) {
11
- throw new Error(`useCurrentFrame can only be called inside a component that was passed to <Player>. See: https://www.remotion.dev/docs/player/examples`);
12
- }
13
- throw new Error(`useCurrentFrame() can only be called inside a component that was registered as a composition. See https://www.remotion.dev/docs/the-fundamentals#defining-compositions`);
14
- }
15
- const buffer = (0, react_1.useContext)(buffering_1.BufferingContextReact);
16
- if (!buffer) {
17
- throw new Error('BufferingContextReact was unexpectedly not found. Most likely your Remotion versions are mismatching.');
18
- }
19
- return (0, react_1.useMemo)(() => ({
20
- delayPlayback: () => {
21
- const { unblock } = buffer.addBlock({
22
- id: String(Math.random()),
23
- });
24
- return { unblock };
25
- },
26
- }), [buffer]);
27
- };
28
- exports.useBufferState = useBufferState;