remotion 4.0.76 → 4.0.79

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.
package/README.md CHANGED
@@ -30,8 +30,8 @@ Remotion is a framework for **creating videos programmatically using React.**
30
30
  <p>"This video was made with code" <em>- Fireship</em> <a href="https://youtu.be/deg8bOoziaE">Watch</a> • <a href="https://github.com/wcandillon/remotion-fireship">Source</a></p>
31
31
  </td>
32
32
  <td align="center">
33
- <img style="width: 240px" src="packages/docs/static/img/unwrapped-2022.gif" />
34
- <p>GitHub Unwrapped - Personalized Year in Review <a href="https://www.githubunwrapped.com">Try</a> • <a href="https://github.com/remotion-dev/github-unwrapped-2022">Source</a></p>
33
+ <img style="width: 240px" src="packages/docs/static/img/unwrapped-2023.gif" />
34
+ <p>GitHub Unwrapped - Personalized Year in Review <a href="https://www.githubunwrapped.com">Try</a> • <a href="https://github.com/remotion-dev/github-unwrapped-2023">Source</a></p>
35
35
  </td>
36
36
  <td align="center">
37
37
  <em>View more in the <a href="https://remotion.dev/showcase">Remotion Showcase</a>!</em>
@@ -65,6 +65,7 @@ const prefetch = (src, options) => {
65
65
  }
66
66
  if (!buf.type.startsWith('video/') &&
67
67
  !buf.type.startsWith('audio/') &&
68
+ !buf.type.startsWith('image/') &&
68
69
  !(options === null || options === void 0 ? void 0 : options.contentType)) {
69
70
  // eslint-disable-next-line no-console
70
71
  console.warn(`Called prefetch() on ${src} which returned a "Content-Type" of ${buf.type}. Prefetched content should have a proper content type (video/... or audio/...) or a contentType passed the options of prefetch(). Otherwise, prefetching will not work properly in all browsers.`);
@@ -25,22 +25,19 @@ const validateCalculated = ({ composition, calculated, }) => {
25
25
  return { width, height, fps, durationInFrames, defaultCodec };
26
26
  };
27
27
  const resolveVideoConfig = ({ composition, editorProps: editorPropsOrUndefined, signal, inputProps, }) => {
28
- var _a, _b, _c, _d, _e, _f, _g;
28
+ var _a, _b, _c, _d, _e, _f;
29
+ const originalProps = {
30
+ ...((_a = composition.defaultProps) !== null && _a !== void 0 ? _a : {}),
31
+ ...(editorPropsOrUndefined !== null && editorPropsOrUndefined !== void 0 ? editorPropsOrUndefined : {}),
32
+ ...(inputProps !== null && inputProps !== void 0 ? inputProps : {}),
33
+ };
29
34
  const calculatedProm = composition.calculateMetadata
30
35
  ? composition.calculateMetadata({
31
- defaultProps: (_a = composition.defaultProps) !== null && _a !== void 0 ? _a : {},
32
- props: {
33
- ...((_b = composition.defaultProps) !== null && _b !== void 0 ? _b : {}),
34
- ...(editorPropsOrUndefined !== null && editorPropsOrUndefined !== void 0 ? editorPropsOrUndefined : {}),
35
- ...inputProps,
36
- },
36
+ defaultProps: (_b = composition.defaultProps) !== null && _b !== void 0 ? _b : {},
37
+ props: originalProps,
37
38
  abortSignal: signal,
38
39
  })
39
40
  : null;
40
- const fallbackProps = {
41
- ...((_c = composition.defaultProps) !== null && _c !== void 0 ? _c : {}),
42
- ...(inputProps !== null && inputProps !== void 0 ? inputProps : {}),
43
- };
44
41
  if (calculatedProm !== null &&
45
42
  typeof calculatedProm === 'object' &&
46
43
  'then' in calculatedProm) {
@@ -57,7 +54,7 @@ const resolveVideoConfig = ({ composition, editorProps: editorPropsOrUndefined,
57
54
  durationInFrames,
58
55
  id: composition.id,
59
56
  defaultProps: (_a = composition.defaultProps) !== null && _a !== void 0 ? _a : {},
60
- props: (_b = c.props) !== null && _b !== void 0 ? _b : fallbackProps,
57
+ props: (_b = c.props) !== null && _b !== void 0 ? _b : originalProps,
61
58
  defaultCodec: defaultCodec !== null && defaultCodec !== void 0 ? defaultCodec : null,
62
59
  };
63
60
  });
@@ -70,17 +67,17 @@ const resolveVideoConfig = ({ composition, editorProps: editorPropsOrUndefined,
70
67
  return {
71
68
  ...data,
72
69
  id: composition.id,
73
- defaultProps: (_d = composition.defaultProps) !== null && _d !== void 0 ? _d : {},
74
- props: fallbackProps,
70
+ defaultProps: (_c = composition.defaultProps) !== null && _c !== void 0 ? _c : {},
71
+ props: originalProps,
75
72
  defaultCodec: null,
76
73
  };
77
74
  }
78
75
  return {
79
76
  ...data,
80
77
  id: composition.id,
81
- defaultProps: (_e = composition.defaultProps) !== null && _e !== void 0 ? _e : {},
82
- props: (_f = calculatedProm.props) !== null && _f !== void 0 ? _f : fallbackProps,
83
- defaultCodec: (_g = calculatedProm.defaultCodec) !== null && _g !== void 0 ? _g : null,
78
+ defaultProps: (_d = composition.defaultProps) !== null && _d !== void 0 ? _d : {},
79
+ props: (_e = calculatedProm.props) !== null && _e !== void 0 ? _e : originalProps,
80
+ defaultCodec: (_f = calculatedProm.defaultCodec) !== null && _f !== void 0 ? _f : null,
84
81
  };
85
82
  };
86
83
  exports.resolveVideoConfig = resolveVideoConfig;
@@ -1 +1 @@
1
- export declare const VERSION = "4.0.76";
1
+ export declare const VERSION = "4.0.79";
@@ -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.76';
5
+ exports.VERSION = '4.0.79';
@@ -59,7 +59,7 @@ function truthy(value) {
59
59
  }
60
60
 
61
61
  // Automatically generated on publish
62
- const VERSION = '4.0.76';
62
+ const VERSION = '4.0.79';
63
63
 
64
64
  const checkMultipleRemotionVersions = () => {
65
65
  if (typeof globalThis === 'undefined') {
@@ -593,22 +593,19 @@ const validateCalculated = ({ composition, calculated, }) => {
593
593
  return { width, height, fps, durationInFrames, defaultCodec };
594
594
  };
595
595
  const resolveVideoConfig = ({ composition, editorProps: editorPropsOrUndefined, signal, inputProps, }) => {
596
- var _a, _b, _c, _d, _e, _f, _g;
596
+ var _a, _b, _c, _d, _e, _f;
597
+ const originalProps = {
598
+ ...((_a = composition.defaultProps) !== null && _a !== void 0 ? _a : {}),
599
+ ...(editorPropsOrUndefined !== null && editorPropsOrUndefined !== void 0 ? editorPropsOrUndefined : {}),
600
+ ...(inputProps !== null && inputProps !== void 0 ? inputProps : {}),
601
+ };
597
602
  const calculatedProm = composition.calculateMetadata
598
603
  ? composition.calculateMetadata({
599
- defaultProps: (_a = composition.defaultProps) !== null && _a !== void 0 ? _a : {},
600
- props: {
601
- ...((_b = composition.defaultProps) !== null && _b !== void 0 ? _b : {}),
602
- ...(editorPropsOrUndefined !== null && editorPropsOrUndefined !== void 0 ? editorPropsOrUndefined : {}),
603
- ...inputProps,
604
- },
604
+ defaultProps: (_b = composition.defaultProps) !== null && _b !== void 0 ? _b : {},
605
+ props: originalProps,
605
606
  abortSignal: signal,
606
607
  })
607
608
  : null;
608
- const fallbackProps = {
609
- ...((_c = composition.defaultProps) !== null && _c !== void 0 ? _c : {}),
610
- ...(inputProps !== null && inputProps !== void 0 ? inputProps : {}),
611
- };
612
609
  if (calculatedProm !== null &&
613
610
  typeof calculatedProm === 'object' &&
614
611
  'then' in calculatedProm) {
@@ -625,7 +622,7 @@ const resolveVideoConfig = ({ composition, editorProps: editorPropsOrUndefined,
625
622
  durationInFrames,
626
623
  id: composition.id,
627
624
  defaultProps: (_a = composition.defaultProps) !== null && _a !== void 0 ? _a : {},
628
- props: (_b = c.props) !== null && _b !== void 0 ? _b : fallbackProps,
625
+ props: (_b = c.props) !== null && _b !== void 0 ? _b : originalProps,
629
626
  defaultCodec: defaultCodec !== null && defaultCodec !== void 0 ? defaultCodec : null,
630
627
  };
631
628
  });
@@ -638,17 +635,17 @@ const resolveVideoConfig = ({ composition, editorProps: editorPropsOrUndefined,
638
635
  return {
639
636
  ...data,
640
637
  id: composition.id,
641
- defaultProps: (_d = composition.defaultProps) !== null && _d !== void 0 ? _d : {},
642
- props: fallbackProps,
638
+ defaultProps: (_c = composition.defaultProps) !== null && _c !== void 0 ? _c : {},
639
+ props: originalProps,
643
640
  defaultCodec: null,
644
641
  };
645
642
  }
646
643
  return {
647
644
  ...data,
648
645
  id: composition.id,
649
- defaultProps: (_e = composition.defaultProps) !== null && _e !== void 0 ? _e : {},
650
- props: (_f = calculatedProm.props) !== null && _f !== void 0 ? _f : fallbackProps,
651
- defaultCodec: (_g = calculatedProm.defaultCodec) !== null && _g !== void 0 ? _g : null,
646
+ defaultProps: (_d = composition.defaultProps) !== null && _d !== void 0 ? _d : {},
647
+ props: (_e = calculatedProm.props) !== null && _e !== void 0 ? _e : originalProps,
648
+ defaultCodec: (_f = calculatedProm.defaultCodec) !== null && _f !== void 0 ? _f : null,
652
649
  };
653
650
  };
654
651
 
@@ -1269,6 +1266,7 @@ const prefetch = (src, options) => {
1269
1266
  }
1270
1267
  if (!buf.type.startsWith('video/') &&
1271
1268
  !buf.type.startsWith('audio/') &&
1269
+ !buf.type.startsWith('image/') &&
1272
1270
  !(options === null || options === void 0 ? void 0 : options.contentType)) {
1273
1271
  // eslint-disable-next-line no-console
1274
1272
  console.warn(`Called prefetch() on ${src} which returned a "Content-Type" of ${buf.type}. Prefetched content should have a proper content type (video/... or audio/...) or a contentType passed the options of prefetch(). Otherwise, prefetching will not work properly in all browsers.`);
@@ -1,4 +1,4 @@
1
1
  // Automatically generated on publish
2
- const VERSION = '4.0.76';
2
+ const VERSION = '4.0.79';
3
3
 
4
4
  export { VERSION };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "remotion",
3
- "version": "4.0.76",
3
+ "version": "4.0.79",
4
4
  "description": "Render videos in React",
5
5
  "main": "dist/cjs/index.js",
6
6
  "types": "dist/cjs/index.d.ts",
@@ -1,8 +0,0 @@
1
- export declare const seekToTime: (element: HTMLVideoElement, desiredTime: number) => {
2
- wait: Promise<number>;
3
- cancel: () => void;
4
- };
5
- export declare const seekToTimeMultipleUntilRight: (element: HTMLVideoElement, desiredTime: number, fps: number) => {
6
- prom: Promise<void>;
7
- cancel: () => void;
8
- };
@@ -1,60 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.seekToTimeMultipleUntilRight = exports.seekToTime = void 0;
4
- const seekToTime = (element, desiredTime) => {
5
- element.currentTime = desiredTime;
6
- let cancel;
7
- const prom = new Promise((resolve) => {
8
- cancel = element.requestVideoFrameCallback((_cb, metadata) => {
9
- resolve(metadata.mediaTime);
10
- });
11
- });
12
- return {
13
- wait: prom,
14
- cancel: () => {
15
- element.cancelVideoFrameCallback(cancel);
16
- },
17
- };
18
- };
19
- exports.seekToTime = seekToTime;
20
- const seekToTimeMultipleUntilRight = (element, desiredTime, fps) => {
21
- const threshold = 1 / fps / 2;
22
- let currentCancel = () => undefined;
23
- const prom = new Promise((resolve, reject) => {
24
- const firstSeek = (0, exports.seekToTime)(element, desiredTime + threshold);
25
- firstSeek.wait.then((seekedTo) => {
26
- const difference = Math.abs(desiredTime - seekedTo);
27
- const ident = Math.random();
28
- if (difference < threshold) {
29
- return resolve();
30
- }
31
- const sign = desiredTime > seekedTo ? 1 : -1;
32
- const newSeek = (0, exports.seekToTime)(element, seekedTo + threshold * sign);
33
- currentCancel = newSeek.cancel;
34
- newSeek.wait
35
- .then((newTime) => {
36
- const newDifference = Math.abs(desiredTime - newTime);
37
- console.log(ident, 'before', seekedTo, 'after', newTime, 'desired', desiredTime);
38
- if (newDifference < threshold) {
39
- return resolve();
40
- }
41
- const thirdSeek = (0, exports.seekToTime)(element, desiredTime);
42
- currentCancel = thirdSeek.cancel;
43
- thirdSeek.wait.then(() => {
44
- resolve();
45
- });
46
- })
47
- .catch((err) => {
48
- reject(err);
49
- });
50
- });
51
- currentCancel = firstSeek.cancel;
52
- });
53
- return {
54
- prom,
55
- cancel: () => {
56
- currentCancel();
57
- },
58
- };
59
- };
60
- exports.seekToTimeMultipleUntilRight = seekToTimeMultipleUntilRight;