remotion 4.0.148 → 4.0.149

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/bundle.ts ADDED
@@ -0,0 +1,35 @@
1
+ import {build} from 'bun';
2
+
3
+ const output = await build({
4
+ entrypoints: ['src/index.ts'],
5
+ naming: '[name].mjs',
6
+ target: 'browser',
7
+ external: ['remotion', 'remotion/no-react', 'react', 'react-dom'],
8
+ });
9
+
10
+ const [file] = output.outputs;
11
+ const text = (await file.text())
12
+ .replace(/jsxDEV/g, 'jsx')
13
+ .replace(/react\/jsx-dev-runtime/g, 'react/jsx-runtime');
14
+
15
+ await Bun.write('dist/esm/index.mjs', text);
16
+
17
+ const versionOutput = await build({
18
+ entrypoints: ['src/version.ts'],
19
+ naming: '[name].mjs',
20
+ target: 'browser',
21
+ });
22
+
23
+ const [versionFile] = versionOutput.outputs;
24
+ await Bun.write('dist/esm/version.mjs', await versionFile.text());
25
+
26
+ const noReactOutput = await build({
27
+ entrypoints: ['src/no-react.ts'],
28
+ naming: '[name].mjs',
29
+ target: 'browser',
30
+ external: ['remotion', 'react', 'react-dom'],
31
+ });
32
+ const [noReactFile] = noReactOutput.outputs;
33
+ await Bun.write('dist/esm/no-react.mjs', await noReactFile.text());
34
+
35
+ export {};
package/dist/cjs/Img.js CHANGED
@@ -68,7 +68,8 @@ const ImgRefForwarding = ({ onError, maxRetries = 2, src, pauseWhenLoading, dela
68
68
  const isPremounting = Boolean(sequenceContext === null || sequenceContext === void 0 ? void 0 : sequenceContext.premounting);
69
69
  // eslint-disable-next-line react-hooks/rules-of-hooks
70
70
  (0, react_1.useLayoutEffect)(() => {
71
- if (process.env.NODE_ENV === 'test') {
71
+ var _a, _b;
72
+ if (((_b = (_a = window.process) === null || _a === void 0 ? void 0 : _a.env) === null || _b === void 0 ? void 0 : _b.NODE_ENV) === 'test') {
72
73
  return;
73
74
  }
74
75
  const newHandle = (0, delay_render_js_1.delayRender)('Loading <Img> with src=' + actualSrc, {
@@ -89,7 +89,8 @@ const AudioForRenderingRefForwardingFunction = (props, ref) => {
89
89
  const needsToRenderAudioTag = ref || _remotionInternalNeedsDurationCalculation;
90
90
  // If audio source switches, make new handle
91
91
  (0, react_1.useLayoutEffect)(() => {
92
- if (process.env.NODE_ENV === 'test') {
92
+ var _a, _b;
93
+ if (((_b = (_a = window.process) === null || _a === void 0 ? void 0 : _a.env) === null || _b === void 0 ? void 0 : _b.NODE_ENV) === 'test') {
93
94
  return;
94
95
  }
95
96
  if (!needsToRenderAudioTag) {
@@ -7,10 +7,13 @@ exports.getRemotionEnvironment = void 0;
7
7
  */
8
8
  const getRemotionEnvironment = () => {
9
9
  const isPlayer = typeof window !== 'undefined' && window.remotion_isPlayer;
10
- const isRendering = process.env.NODE_ENV === 'test' ||
11
- (process.env.NODE_ENV === 'production' &&
12
- typeof window !== 'undefined' &&
13
- typeof window.remotion_puppeteerTimeout !== 'undefined');
10
+ const isRendering = typeof window !== 'undefined' &&
11
+ typeof window.process !== 'undefined' &&
12
+ typeof window.process.env !== 'undefined' &&
13
+ (window.process.env.NODE_ENV === 'test' ||
14
+ (window.process.env.NODE_ENV === 'production' &&
15
+ typeof window !== 'undefined' &&
16
+ typeof window.remotion_puppeteerTimeout !== 'undefined'));
14
17
  const isStudio = typeof window !== 'undefined' && window.remotion_isStudio;
15
18
  return {
16
19
  isStudio,
@@ -59,14 +59,15 @@ const useMediaInTimeline = ({ volume, mediaVolume, mediaRef, src, mediaType, pla
59
59
  }
60
60
  }, [initialVolume, mediaType, src, volume]);
61
61
  (0, react_1.useEffect)(() => {
62
- var _a;
62
+ var _a, _b, _c;
63
63
  if (!mediaRef.current) {
64
64
  return;
65
65
  }
66
66
  if (!src) {
67
67
  throw new Error('No src passed');
68
68
  }
69
- if (!(0, get_remotion_environment_js_1.getRemotionEnvironment)().isStudio && process.env.NODE_ENV !== 'test') {
69
+ if (!(0, get_remotion_environment_js_1.getRemotionEnvironment)().isStudio &&
70
+ ((_b = (_a = window.process) === null || _a === void 0 ? void 0 : _a.env) === null || _b === void 0 ? void 0 : _b.NODE_ENV) !== 'test') {
70
71
  return;
71
72
  }
72
73
  if (!showInTimeline) {
@@ -78,7 +79,7 @@ const useMediaInTimeline = ({ volume, mediaVolume, mediaRef, src, mediaType, pla
78
79
  id,
79
80
  duration,
80
81
  from: 0,
81
- parent: (_a = parentSequence === null || parentSequence === void 0 ? void 0 : parentSequence.id) !== null && _a !== void 0 ? _a : null,
82
+ parent: (_c = parentSequence === null || parentSequence === void 0 ? void 0 : parentSequence.id) !== null && _c !== void 0 ? _c : null,
82
83
  displayName: displayName !== null && displayName !== void 0 ? displayName : (0, get_asset_file_name_js_1.getAssetDisplayName)(src),
83
84
  rootId,
84
85
  volume: volumes,
@@ -3,4 +3,4 @@
3
3
  * @see [Documentation](https://remotion.dev/docs/version)
4
4
  * @returns {string} The current version of the remotion package
5
5
  */
6
- export declare const VERSION = "4.0.148";
6
+ export declare const VERSION = "4.0.149";
@@ -7,4 +7,4 @@ exports.VERSION = void 0;
7
7
  * @see [Documentation](https://remotion.dev/docs/version)
8
8
  * @returns {string} The current version of the remotion package
9
9
  */
10
- exports.VERSION = '4.0.148';
10
+ exports.VERSION = '4.0.149';
@@ -92,6 +92,7 @@ const VideoForRenderingForwardFunction = ({ onError, volume: volumeProp, allowAm
92
92
  return videoRef.current;
93
93
  }, []);
94
94
  (0, react_1.useEffect)(() => {
95
+ var _a, _b;
95
96
  if (!window.remotion_videoEnabled) {
96
97
  return;
97
98
  }
@@ -109,7 +110,7 @@ const VideoForRenderingForwardFunction = ({ onError, volume: volumeProp, allowAm
109
110
  retries: delayRenderRetries !== null && delayRenderRetries !== void 0 ? delayRenderRetries : undefined,
110
111
  timeoutInMilliseconds: delayRenderTimeoutInMilliseconds !== null && delayRenderTimeoutInMilliseconds !== void 0 ? delayRenderTimeoutInMilliseconds : undefined,
111
112
  });
112
- if (process.env.NODE_ENV === 'test') {
113
+ if (((_b = (_a = window.process) === null || _a === void 0 ? void 0 : _a.env) === null || _b === void 0 ? void 0 : _b.NODE_ENV) === 'test') {
113
114
  (0, delay_render_js_1.continueRender)(handle);
114
115
  return;
115
116
  }
@@ -173,7 +174,8 @@ const VideoForRenderingForwardFunction = ({ onError, volume: volumeProp, allowAm
173
174
  if (environment.isRendering) {
174
175
  // eslint-disable-next-line react-hooks/rules-of-hooks
175
176
  (0, react_1.useLayoutEffect)(() => {
176
- if (process.env.NODE_ENV === 'test') {
177
+ var _a, _b;
178
+ if (((_b = (_a = window.process) === null || _a === void 0 ? void 0 : _a.env) === null || _b === void 0 ? void 0 : _b.NODE_ENV) === 'test') {
177
179
  return;
178
180
  }
179
181
  const newHandle = (0, delay_render_js_1.delayRender)('Loading <Video> duration with src=' + src, {