remotion 4.0.497 → 4.0.499

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/dist/cjs/Img.js CHANGED
@@ -16,6 +16,7 @@ const use_buffer_state_js_1 = require("./use-buffer-state.js");
16
16
  const use_delay_render_js_1 = require("./use-delay-render.js");
17
17
  const use_premounting_js_1 = require("./use-premounting.js");
18
18
  const use_remotion_environment_js_1 = require("./use-remotion-environment.js");
19
+ const v5_flag_js_1 = require("./v5-flag.js");
19
20
  const with_interactivity_schema_js_1 = require("./with-interactivity-schema.js");
20
21
  function exponentialBackoff(errorCount) {
21
22
  return 1000 * 2 ** (errorCount - 1);
@@ -266,8 +267,9 @@ const getFitFromObjectFit = (style) => {
266
267
  const ImgInner = ({ effects = [], ref, hidden, name, stack, showInTimeline, src, from, trimBefore, durationInFrames, freeze, premountFor, postmountFor, styleWhilePremounted, styleWhilePostmounted, controls, width, height, className, style, id, pauseWhenLoading, maxRetries, delayRenderRetries, delayRenderTimeoutInMilliseconds, ...props }) => {
267
268
  var _a;
268
269
  const refForOutline = (0, react_1.useRef)(null);
270
+ const shouldPauseWhenLoading = (0, v5_flag_js_1.resolveV5Default)(pauseWhenLoading);
269
271
  if (effects.length === 0) {
270
- return (jsx_runtime_1.jsx(NativeImgInner, { ...props, ref: ref, hidden: hidden, name: name, stack: stack, showInTimeline: showInTimeline, src: src, from: from, trimBefore: trimBefore, durationInFrames: durationInFrames, freeze: freeze, premountFor: premountFor, postmountFor: postmountFor, styleWhilePremounted: styleWhilePremounted, styleWhilePostmounted: styleWhilePostmounted, controls: controls, width: width, height: height, className: className, style: style, id: id, pauseWhenLoading: pauseWhenLoading, maxRetries: maxRetries, delayRenderRetries: delayRenderRetries, delayRenderTimeoutInMilliseconds: delayRenderTimeoutInMilliseconds, outlineRef: refForOutline }));
272
+ return (jsx_runtime_1.jsx(NativeImgInner, { ...props, ref: ref, hidden: hidden, name: name, stack: stack, showInTimeline: showInTimeline, src: src, from: from, trimBefore: trimBefore, durationInFrames: durationInFrames, freeze: freeze, premountFor: premountFor, postmountFor: postmountFor, styleWhilePremounted: styleWhilePremounted, styleWhilePostmounted: styleWhilePostmounted, controls: controls, width: width, height: height, className: className, style: style, id: id, pauseWhenLoading: shouldPauseWhenLoading, maxRetries: maxRetries, delayRenderRetries: delayRenderRetries, delayRenderTimeoutInMilliseconds: delayRenderTimeoutInMilliseconds, outlineRef: refForOutline }));
271
273
  }
272
274
  if (!src) {
273
275
  throw new Error('No "src" prop was passed to <Img>.');
@@ -282,7 +284,7 @@ const ImgInner = ({ effects = [], ref, hidden, name, stack, showInTimeline, src,
282
284
  const canvasHeight = typeof height === 'number' ? height : undefined;
283
285
  const canvasProps = props;
284
286
  const canvasFit = (_a = getFitFromObjectFit(style)) !== null && _a !== void 0 ? _a : 'fill';
285
- return (jsx_runtime_1.jsx(CanvasImageWithPrivateProps, { src: src, width: canvasWidth, height: canvasHeight, fit: canvasFit, effects: effects, className: className, style: style, id: id, pauseWhenLoading: pauseWhenLoading, maxRetries: maxRetries, delayRenderRetries: delayRenderRetries, delayRenderTimeoutInMilliseconds: delayRenderTimeoutInMilliseconds, from: from, trimBefore: trimBefore, durationInFrames: durationInFrames, freeze: freeze, premountFor: premountFor, postmountFor: postmountFor, styleWhilePremounted: styleWhilePremounted, styleWhilePostmounted: styleWhilePostmounted, hidden: hidden, name: name !== null && name !== void 0 ? name : '<Img>', showInTimeline: showInTimeline, stack: stack, _remotionInternalDocumentationLink: "https://www.remotion.dev/docs/img", controls: controls, outlineRef: refForOutline, ...canvasProps }));
287
+ return (jsx_runtime_1.jsx(CanvasImageWithPrivateProps, { src: src, width: canvasWidth, height: canvasHeight, fit: canvasFit, effects: effects, className: className, style: style, id: id, pauseWhenLoading: shouldPauseWhenLoading, maxRetries: maxRetries, delayRenderRetries: delayRenderRetries, delayRenderTimeoutInMilliseconds: delayRenderTimeoutInMilliseconds, from: from, trimBefore: trimBefore, durationInFrames: durationInFrames, freeze: freeze, premountFor: premountFor, postmountFor: postmountFor, styleWhilePremounted: styleWhilePremounted, styleWhilePostmounted: styleWhilePostmounted, hidden: hidden, name: name !== null && name !== void 0 ? name : '<Img>', showInTimeline: showInTimeline, stack: stack, _remotionInternalDocumentationLink: "https://www.remotion.dev/docs/img", controls: controls, outlineRef: refForOutline, ...canvasProps }));
286
288
  };
287
289
  /*
288
290
  * @description Works just like a regular HTML img tag. When you use the <Img> tag, Remotion will ensure that the image is loaded before rendering the frame.
@@ -13,6 +13,7 @@ const prefetch_js_1 = require("../prefetch.js");
13
13
  const Sequence_js_1 = require("../Sequence.js");
14
14
  const use_remotion_environment_js_1 = require("../use-remotion-environment.js");
15
15
  const use_video_config_js_1 = require("../use-video-config.js");
16
+ const v5_flag_js_1 = require("../v5-flag.js");
16
17
  const validate_media_props_js_1 = require("../validate-media-props.js");
17
18
  const validate_start_from_props_js_1 = require("../validate-start-from-props.js");
18
19
  const duration_state_js_1 = require("../video/duration-state.js");
@@ -27,6 +28,7 @@ const AudioRefForwardingFunction = (props, ref) => {
27
28
  const { loop, freeze: _freeze, ...propsOtherThanLoop } = propsWithFreeze;
28
29
  const { fps } = (0, use_video_config_js_1.useVideoConfig)();
29
30
  const environment = (0, use_remotion_environment_js_1.useRemotionEnvironment)();
31
+ const shouldPauseWhenBuffering = (0, v5_flag_js_1.resolveV5Default)(pauseWhenBuffering);
30
32
  if (environment.isClientSideRendering) {
31
33
  throw new Error('<Html5Audio> is not supported in @remotion/web-renderer. Use <Audio> from @remotion/media instead. See https://remotion.dev/docs/client-side-rendering/limitations');
32
34
  }
@@ -82,7 +84,7 @@ const AudioRefForwardingFunction = (props, ref) => {
82
84
  }
83
85
  if (typeof trimBeforeValue !== 'undefined' ||
84
86
  typeof trimAfterValue !== 'undefined') {
85
- return (jsx_runtime_1.jsx(Sequence_js_1.Sequence, { layout: "none", from: 0 - (trimBeforeValue !== null && trimBeforeValue !== void 0 ? trimBeforeValue : 0), showInTimeline: false, durationInFrames: trimAfterValue, name: name, children: jsx_runtime_1.jsx(exports.Html5Audio, { _remotionInternalNeedsDurationCalculation: Boolean(loop), pauseWhenBuffering: pauseWhenBuffering !== null && pauseWhenBuffering !== void 0 ? pauseWhenBuffering : false, ...otherProps, ref: ref }) }));
87
+ return (jsx_runtime_1.jsx(Sequence_js_1.Sequence, { layout: "none", from: 0 - (trimBeforeValue !== null && trimBeforeValue !== void 0 ? trimBeforeValue : 0), showInTimeline: false, durationInFrames: trimAfterValue, name: name, children: jsx_runtime_1.jsx(exports.Html5Audio, { _remotionInternalNeedsDurationCalculation: Boolean(loop), pauseWhenBuffering: shouldPauseWhenBuffering, ...otherProps, ref: ref }) }));
86
88
  }
87
89
  (0, validate_media_props_js_1.validateMediaProps)({
88
90
  playbackRate: props.playbackRate,
@@ -92,9 +94,7 @@ const AudioRefForwardingFunction = (props, ref) => {
92
94
  if (environment.isRendering) {
93
95
  return (jsx_runtime_1.jsx(AudioForRendering_js_1.AudioForRendering, { onDuration: onDuration, ...props, ref: ref, onNativeError: onError, _remotionInternalNeedsDurationCalculation: Boolean(loop) }));
94
96
  }
95
- return (jsx_runtime_1.jsx(AudioForPreview_js_1.AudioForPreview, { _remotionInternalNativeLoopPassed: (_c = props._remotionInternalNativeLoopPassed) !== null && _c !== void 0 ? _c : false, _remotionInternalStack: stack !== null && stack !== void 0 ? stack : null, shouldPreMountAudioTags: audioTagsContext !== null && audioTagsContext.numberOfAudioTags > 0, ...props, ref: ref, onNativeError: onError, onDuration: onDuration,
96
- // Proposal: Make this default to true in v5
97
- pauseWhenBuffering: pauseWhenBuffering !== null && pauseWhenBuffering !== void 0 ? pauseWhenBuffering : false, _remotionInternalNeedsDurationCalculation: Boolean(loop), showInTimeline: showInTimeline !== null && showInTimeline !== void 0 ? showInTimeline : true }));
97
+ return (jsx_runtime_1.jsx(AudioForPreview_js_1.AudioForPreview, { _remotionInternalNativeLoopPassed: (_c = props._remotionInternalNativeLoopPassed) !== null && _c !== void 0 ? _c : false, _remotionInternalStack: stack !== null && stack !== void 0 ? stack : null, shouldPreMountAudioTags: audioTagsContext !== null && audioTagsContext.numberOfAudioTags > 0, ...props, ref: ref, onNativeError: onError, onDuration: onDuration, pauseWhenBuffering: shouldPauseWhenBuffering, _remotionInternalNeedsDurationCalculation: Boolean(loop), showInTimeline: showInTimeline !== null && showInTimeline !== void 0 ? showInTimeline : true }));
98
98
  };
99
99
  /**
100
100
  * @description With this component, you can add audio to your video. All audio formats which are supported by Chromium are supported by the component.
@@ -49,6 +49,7 @@ export declare const NoReactInternals: {
49
49
  ENABLE_V5_BREAKING_CHANGES: false;
50
50
  MIN_NODE_VERSION: number;
51
51
  MIN_BUN_VERSION: string;
52
+ MIN_ESLINT_VERSION: string;
52
53
  colorNames: {
53
54
  [key: string]: number;
54
55
  };
@@ -44,8 +44,9 @@ exports.NoReactInternals = {
44
44
  getOffthreadVideoSource: offthread_video_source_1.getOffthreadVideoSource,
45
45
  getExpectedMediaFrameUncorrected: get_current_time_1.getExpectedMediaFrameUncorrected,
46
46
  ENABLE_V5_BREAKING_CHANGES: v5_flag_1.ENABLE_V5_BREAKING_CHANGES,
47
- MIN_NODE_VERSION: v5_flag_1.ENABLE_V5_BREAKING_CHANGES ? 18 : 16,
47
+ MIN_NODE_VERSION: v5_flag_1.ENABLE_V5_BREAKING_CHANGES ? 22 : 16,
48
48
  MIN_BUN_VERSION: v5_flag_1.ENABLE_V5_BREAKING_CHANGES ? '1.1.3' : '1.0.3',
49
+ MIN_ESLINT_VERSION: v5_flag_1.ENABLE_V5_BREAKING_CHANGES ? '8.57.0' : '7.15.0',
49
50
  colorNames: interpolate_colors_1.colorNames,
50
51
  DATE_TOKEN: input_props_serialization_js_1.DATE_TOKEN,
51
52
  FILE_TOKEN: input_props_serialization_js_1.FILE_TOKEN,
@@ -1 +1,2 @@
1
1
  export declare const ENABLE_V5_BREAKING_CHANGES: false;
2
+ export declare const resolveV5Default: (value: boolean | undefined) => boolean;
@@ -1,4 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ENABLE_V5_BREAKING_CHANGES = void 0;
3
+ exports.resolveV5Default = exports.ENABLE_V5_BREAKING_CHANGES = void 0;
4
4
  exports.ENABLE_V5_BREAKING_CHANGES = false;
5
+ const resolveV5Default = (value) => {
6
+ return value !== null && value !== void 0 ? value : exports.ENABLE_V5_BREAKING_CHANGES;
7
+ };
8
+ exports.resolveV5Default = resolveV5Default;
@@ -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.497";
6
+ export declare const VERSION = "4.0.499";
@@ -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.497';
10
+ exports.VERSION = '4.0.499';
@@ -6,6 +6,7 @@ const react_1 = require("react");
6
6
  const enable_sequence_stack_traces_js_1 = require("../enable-sequence-stack-traces.js");
7
7
  const Sequence_js_1 = require("../Sequence.js");
8
8
  const use_remotion_environment_js_1 = require("../use-remotion-environment.js");
9
+ const v5_flag_js_1 = require("../v5-flag.js");
9
10
  const validate_media_props_js_1 = require("../validate-media-props.js");
10
11
  const validate_start_from_props_js_1 = require("../validate-start-from-props.js");
11
12
  const OffthreadVideoForRendering_js_1 = require("./OffthreadVideoForRendering.js");
@@ -15,6 +16,7 @@ const InnerOffthreadVideo = (props) => {
15
16
  // rest gets drilled down
16
17
  const { startFrom, endAt, trimBefore, trimAfter, name, pauseWhenBuffering, stack, showInTimeline, ...otherProps } = props;
17
18
  const environment = (0, use_remotion_environment_js_1.useRemotionEnvironment)();
19
+ const shouldPauseWhenBuffering = (0, v5_flag_js_1.resolveV5Default)(pauseWhenBuffering);
18
20
  if (environment.isClientSideRendering) {
19
21
  throw new Error('<OffthreadVideo> is not supported in @remotion/web-renderer. Use <Video> from @remotion/media instead. See https://remotion.dev/docs/client-side-rendering/limitations');
20
22
  }
@@ -31,14 +33,14 @@ const InnerOffthreadVideo = (props) => {
31
33
  });
32
34
  if (typeof trimBeforeValue !== 'undefined' ||
33
35
  typeof trimAfterValue !== 'undefined') {
34
- return (jsx_runtime_1.jsx(Sequence_js_1.Sequence, { layout: "none", from: 0 - (trimBeforeValue !== null && trimBeforeValue !== void 0 ? trimBeforeValue : 0), showInTimeline: false, durationInFrames: trimAfterValue, name: name, children: jsx_runtime_1.jsx(exports.InnerOffthreadVideo, { pauseWhenBuffering: pauseWhenBuffering !== null && pauseWhenBuffering !== void 0 ? pauseWhenBuffering : false, ...otherProps, trimAfter: undefined, name: undefined, showInTimeline: showInTimeline, trimBefore: undefined, stack: undefined, startFrom: undefined, endAt: undefined }) }));
36
+ return (jsx_runtime_1.jsx(Sequence_js_1.Sequence, { layout: "none", from: 0 - (trimBeforeValue !== null && trimBeforeValue !== void 0 ? trimBeforeValue : 0), showInTimeline: false, durationInFrames: trimAfterValue, name: name, children: jsx_runtime_1.jsx(exports.InnerOffthreadVideo, { pauseWhenBuffering: shouldPauseWhenBuffering, ...otherProps, trimAfter: undefined, name: undefined, showInTimeline: showInTimeline, trimBefore: undefined, stack: undefined, startFrom: undefined, endAt: undefined }) }));
35
37
  }
36
38
  (0, validate_media_props_js_1.validateMediaProps)(props, 'Video');
37
39
  if (environment.isRendering) {
38
- return (jsx_runtime_1.jsx(OffthreadVideoForRendering_js_1.OffthreadVideoForRendering, { pauseWhenBuffering: pauseWhenBuffering !== null && pauseWhenBuffering !== void 0 ? pauseWhenBuffering : false, ...otherProps, trimAfter: undefined, name: undefined, showInTimeline: showInTimeline, trimBefore: undefined, stack: undefined, startFrom: undefined, endAt: undefined }));
40
+ return (jsx_runtime_1.jsx(OffthreadVideoForRendering_js_1.OffthreadVideoForRendering, { pauseWhenBuffering: shouldPauseWhenBuffering, ...otherProps, trimAfter: undefined, name: undefined, showInTimeline: showInTimeline, trimBefore: undefined, stack: undefined, startFrom: undefined, endAt: undefined }));
39
41
  }
40
42
  const { transparent, toneMapped, onAutoPlayError, onVideoFrame, crossOrigin, delayRenderRetries, delayRenderTimeoutInMilliseconds, ...propsForPreview } = otherProps;
41
- return (jsx_runtime_1.jsx(VideoForPreview_js_1.VideoForPreview, { _remotionInternalStack: stack !== null && stack !== void 0 ? stack : null, onDuration: onDuration, onlyWarnForMediaSeekingError: true, pauseWhenBuffering: pauseWhenBuffering !== null && pauseWhenBuffering !== void 0 ? pauseWhenBuffering : false, showInTimeline: showInTimeline !== null && showInTimeline !== void 0 ? showInTimeline : true, onAutoPlayError: onAutoPlayError !== null && onAutoPlayError !== void 0 ? onAutoPlayError : undefined, onVideoFrame: onVideoFrame !== null && onVideoFrame !== void 0 ? onVideoFrame : null, crossOrigin: crossOrigin, ...propsForPreview, _remotionInternalNativeLoopPassed: false }));
43
+ return (jsx_runtime_1.jsx(VideoForPreview_js_1.VideoForPreview, { _remotionInternalStack: stack !== null && stack !== void 0 ? stack : null, onDuration: onDuration, onlyWarnForMediaSeekingError: true, pauseWhenBuffering: shouldPauseWhenBuffering, showInTimeline: showInTimeline !== null && showInTimeline !== void 0 ? showInTimeline : true, onAutoPlayError: onAutoPlayError !== null && onAutoPlayError !== void 0 ? onAutoPlayError : undefined, onVideoFrame: onVideoFrame !== null && onVideoFrame !== void 0 ? onVideoFrame : null, crossOrigin: crossOrigin, ...propsForPreview, _remotionInternalNativeLoopPassed: false }));
42
44
  };
43
45
  exports.InnerOffthreadVideo = InnerOffthreadVideo;
44
46
  /*
@@ -49,7 +51,7 @@ const OffthreadVideo = ({ src, acceptableTimeShiftInSeconds, allowAmplificationD
49
51
  if (imageFormat) {
50
52
  throw new TypeError(`The \`<OffthreadVideo>\` tag does no longer accept \`imageFormat\`. Use the \`transparent\` prop if you want to render a transparent video.`);
51
53
  }
52
- return (jsx_runtime_1.jsx(exports.InnerOffthreadVideo, { acceptableTimeShiftInSeconds: acceptableTimeShiftInSeconds, allowAmplificationDuringRender: allowAmplificationDuringRender !== null && allowAmplificationDuringRender !== void 0 ? allowAmplificationDuringRender : true, audioStreamIndex: audioStreamIndex !== null && audioStreamIndex !== void 0 ? audioStreamIndex : 0, crossOrigin: crossOrigin, delayRenderRetries: delayRenderRetries, delayRenderTimeoutInMilliseconds: delayRenderTimeoutInMilliseconds, loopVolumeCurveBehavior: loopVolumeCurveBehavior !== null && loopVolumeCurveBehavior !== void 0 ? loopVolumeCurveBehavior : 'repeat', muted: muted !== null && muted !== void 0 ? muted : false, name: name, onAutoPlayError: onAutoPlayError !== null && onAutoPlayError !== void 0 ? onAutoPlayError : null, onError: onError, onVideoFrame: onVideoFrame, pauseWhenBuffering: pauseWhenBuffering !== null && pauseWhenBuffering !== void 0 ? pauseWhenBuffering : true, playbackRate: playbackRate !== null && playbackRate !== void 0 ? playbackRate : 1, preservePitch: preservePitch, toneFrequency: toneFrequency !== null && toneFrequency !== void 0 ? toneFrequency : 1, showInTimeline: showInTimeline !== null && showInTimeline !== void 0 ? showInTimeline : true, src: src, stack: stack, startFrom: startFrom, _remotionInternalNativeLoopPassed: _remotionInternalNativeLoopPassed !== null && _remotionInternalNativeLoopPassed !== void 0 ? _remotionInternalNativeLoopPassed : false, endAt: endAt, style: style, toneMapped: toneMapped !== null && toneMapped !== void 0 ? toneMapped : true, transparent: transparent !== null && transparent !== void 0 ? transparent : false, trimAfter: trimAfter, trimBefore: trimBefore, useWebAudioApi: useWebAudioApi !== null && useWebAudioApi !== void 0 ? useWebAudioApi : false, volume: volume, ...props }));
54
+ return (jsx_runtime_1.jsx(exports.InnerOffthreadVideo, { acceptableTimeShiftInSeconds: acceptableTimeShiftInSeconds, allowAmplificationDuringRender: allowAmplificationDuringRender !== null && allowAmplificationDuringRender !== void 0 ? allowAmplificationDuringRender : true, audioStreamIndex: audioStreamIndex !== null && audioStreamIndex !== void 0 ? audioStreamIndex : 0, crossOrigin: crossOrigin, delayRenderRetries: delayRenderRetries, delayRenderTimeoutInMilliseconds: delayRenderTimeoutInMilliseconds, loopVolumeCurveBehavior: loopVolumeCurveBehavior !== null && loopVolumeCurveBehavior !== void 0 ? loopVolumeCurveBehavior : 'repeat', muted: muted !== null && muted !== void 0 ? muted : false, name: name, onAutoPlayError: onAutoPlayError !== null && onAutoPlayError !== void 0 ? onAutoPlayError : null, onError: onError, onVideoFrame: onVideoFrame, pauseWhenBuffering: (0, v5_flag_js_1.resolveV5Default)(pauseWhenBuffering), playbackRate: playbackRate !== null && playbackRate !== void 0 ? playbackRate : 1, preservePitch: preservePitch, toneFrequency: toneFrequency !== null && toneFrequency !== void 0 ? toneFrequency : 1, showInTimeline: showInTimeline !== null && showInTimeline !== void 0 ? showInTimeline : true, src: src, stack: stack, startFrom: startFrom, _remotionInternalNativeLoopPassed: _remotionInternalNativeLoopPassed !== null && _remotionInternalNativeLoopPassed !== void 0 ? _remotionInternalNativeLoopPassed : false, endAt: endAt, style: style, toneMapped: toneMapped !== null && toneMapped !== void 0 ? toneMapped : true, transparent: transparent !== null && transparent !== void 0 ? transparent : false, trimAfter: trimAfter, trimBefore: trimBefore, useWebAudioApi: useWebAudioApi !== null && useWebAudioApi !== void 0 ? useWebAudioApi : false, volume: volume, ...props }));
53
55
  };
54
56
  exports.OffthreadVideo = OffthreadVideo;
55
57
  (0, enable_sequence_stack_traces_js_1.addSequenceStackTraces)(exports.OffthreadVideo);
@@ -12,6 +12,7 @@ const prefetch_js_1 = require("../prefetch.js");
12
12
  const Sequence_js_1 = require("../Sequence.js");
13
13
  const use_remotion_environment_js_1 = require("../use-remotion-environment.js");
14
14
  const use_video_config_js_1 = require("../use-video-config.js");
15
+ const v5_flag_js_1 = require("../v5-flag.js");
15
16
  const validate_media_props_js_1 = require("../validate-media-props.js");
16
17
  const validate_start_from_props_js_1 = require("../validate-start-from-props.js");
17
18
  const duration_state_js_1 = require("./duration-state.js");
@@ -23,6 +24,7 @@ const VideoForwardingFunction = (props, ref) => {
23
24
  const { loop, ...propsOtherThanLoop } = props;
24
25
  const { fps } = (0, use_video_config_js_1.useVideoConfig)();
25
26
  const environment = (0, use_remotion_environment_js_1.useRemotionEnvironment)();
27
+ const shouldPauseWhenBuffering = (0, v5_flag_js_1.resolveV5Default)(pauseWhenBuffering);
26
28
  if (environment.isClientSideRendering) {
27
29
  throw new Error('<Html5Video> is not supported in @remotion/web-renderer. Use <Video> from @remotion/media instead. See https://remotion.dev/docs/client-side-rendering/limitations');
28
30
  }
@@ -61,7 +63,7 @@ const VideoForwardingFunction = (props, ref) => {
61
63
  typeof trimAfterValue !== 'undefined') {
62
64
  return (jsx_runtime_1.jsx(Sequence_js_1.Sequence, { layout: "none", from: 0 - (trimBeforeValue !== null && trimBeforeValue !== void 0 ? trimBeforeValue : 0), showInTimeline: false, durationInFrames: trimAfterValue === undefined
63
65
  ? undefined
64
- : trimAfterValue / ((_c = props.playbackRate) !== null && _c !== void 0 ? _c : 1), name: name, children: jsx_runtime_1.jsx(exports.Html5Video, { pauseWhenBuffering: pauseWhenBuffering !== null && pauseWhenBuffering !== void 0 ? pauseWhenBuffering : false, onVideoFrame: onVideoFrame, ...otherProps, ref: ref, stack: stack }) }));
66
+ : trimAfterValue / ((_c = props.playbackRate) !== null && _c !== void 0 ? _c : 1), name: name, children: jsx_runtime_1.jsx(exports.Html5Video, { pauseWhenBuffering: shouldPauseWhenBuffering, onVideoFrame: onVideoFrame, ...otherProps, ref: ref, stack: stack }) }));
65
67
  }
66
68
  (0, validate_media_props_js_1.validateMediaProps)({
67
69
  playbackRate: props.playbackRate,
@@ -71,9 +73,7 @@ const VideoForwardingFunction = (props, ref) => {
71
73
  if (environment.isRendering) {
72
74
  return (jsx_runtime_1.jsx(VideoForRendering_js_1.VideoForRendering, { onDuration: onDuration, onVideoFrame: onVideoFrame !== null && onVideoFrame !== void 0 ? onVideoFrame : null, ...otherProps, ref: ref }));
73
75
  }
74
- return (jsx_runtime_1.jsx(VideoForPreview_js_1.VideoForPreview, { onlyWarnForMediaSeekingError: false, ...otherProps, ref: ref, onVideoFrame: onVideoFrame !== null && onVideoFrame !== void 0 ? onVideoFrame : null,
75
- // Proposal: Make this default to true in v5
76
- pauseWhenBuffering: pauseWhenBuffering !== null && pauseWhenBuffering !== void 0 ? pauseWhenBuffering : false, onDuration: onDuration, _remotionInternalStack: stack !== null && stack !== void 0 ? stack : null, _remotionInternalNativeLoopPassed: _remotionInternalNativeLoopPassed !== null && _remotionInternalNativeLoopPassed !== void 0 ? _remotionInternalNativeLoopPassed : false, showInTimeline: showInTimeline !== null && showInTimeline !== void 0 ? showInTimeline : true, onAutoPlayError: onAutoPlayError !== null && onAutoPlayError !== void 0 ? onAutoPlayError : undefined }));
76
+ return (jsx_runtime_1.jsx(VideoForPreview_js_1.VideoForPreview, { onlyWarnForMediaSeekingError: false, ...otherProps, ref: ref, onVideoFrame: onVideoFrame !== null && onVideoFrame !== void 0 ? onVideoFrame : null, pauseWhenBuffering: shouldPauseWhenBuffering, onDuration: onDuration, _remotionInternalStack: stack !== null && stack !== void 0 ? stack : null, _remotionInternalNativeLoopPassed: _remotionInternalNativeLoopPassed !== null && _remotionInternalNativeLoopPassed !== void 0 ? _remotionInternalNativeLoopPassed : false, showInTimeline: showInTimeline !== null && showInTimeline !== void 0 ? showInTimeline : true, onAutoPlayError: onAutoPlayError !== null && onAutoPlayError !== void 0 ? onAutoPlayError : undefined }));
77
77
  };
78
78
  /**
79
79
  * @description Wraps the native `<video>` element to include video in your component that is synchronized with Remotion's time.
@@ -1310,7 +1310,7 @@ var getSingleChildComponent = (children) => {
1310
1310
  };
1311
1311
 
1312
1312
  // src/version.ts
1313
- var VERSION = "4.0.497";
1313
+ var VERSION = "4.0.499";
1314
1314
 
1315
1315
  // src/multiple-versions-warning.ts
1316
1316
  var checkMultipleRemotionVersions = () => {
@@ -2223,6 +2223,9 @@ var PremountContext = createContext15({
2223
2223
 
2224
2224
  // src/v5-flag.ts
2225
2225
  var ENABLE_V5_BREAKING_CHANGES = false;
2226
+ var resolveV5Default = (value) => {
2227
+ return value ?? ENABLE_V5_BREAKING_CHANGES;
2228
+ };
2226
2229
 
2227
2230
  // src/use-premounting.ts
2228
2231
  var usePremounting = ({
@@ -8978,6 +8981,7 @@ var AudioRefForwardingFunction = (props, ref) => {
8978
8981
  const { loop, freeze: _freeze, ...propsOtherThanLoop } = propsWithFreeze;
8979
8982
  const { fps } = useVideoConfig();
8980
8983
  const environment = useRemotionEnvironment();
8984
+ const shouldPauseWhenBuffering = resolveV5Default(pauseWhenBuffering);
8981
8985
  if (environment.isClientSideRendering) {
8982
8986
  throw new Error("<Html5Audio> is not supported in @remotion/web-renderer. Use <Audio> from @remotion/media instead. See https://remotion.dev/docs/client-side-rendering/limitations");
8983
8987
  }
@@ -9047,7 +9051,7 @@ var AudioRefForwardingFunction = (props, ref) => {
9047
9051
  name,
9048
9052
  children: /* @__PURE__ */ jsx23(Html5Audio, {
9049
9053
  _remotionInternalNeedsDurationCalculation: Boolean(loop),
9050
- pauseWhenBuffering: pauseWhenBuffering ?? false,
9054
+ pauseWhenBuffering: shouldPauseWhenBuffering,
9051
9055
  ...otherProps,
9052
9056
  ref
9053
9057
  })
@@ -9075,7 +9079,7 @@ var AudioRefForwardingFunction = (props, ref) => {
9075
9079
  ref,
9076
9080
  onNativeError: onError,
9077
9081
  onDuration,
9078
- pauseWhenBuffering: pauseWhenBuffering ?? false,
9082
+ pauseWhenBuffering: shouldPauseWhenBuffering,
9079
9083
  _remotionInternalNeedsDurationCalculation: Boolean(loop),
9080
9084
  showInTimeline: showInTimeline ?? true
9081
9085
  });
@@ -10563,6 +10567,7 @@ var ImgInner = ({
10563
10567
  ...props2
10564
10568
  }) => {
10565
10569
  const refForOutline = useRef24(null);
10570
+ const shouldPauseWhenLoading = resolveV5Default(pauseWhenLoading);
10566
10571
  if (effects.length === 0) {
10567
10572
  return /* @__PURE__ */ jsx28(NativeImgInner, {
10568
10573
  ...props2,
@@ -10586,7 +10591,7 @@ var ImgInner = ({
10586
10591
  className,
10587
10592
  style,
10588
10593
  id,
10589
- pauseWhenLoading,
10594
+ pauseWhenLoading: shouldPauseWhenLoading,
10590
10595
  maxRetries,
10591
10596
  delayRenderRetries,
10592
10597
  delayRenderTimeoutInMilliseconds,
@@ -10615,7 +10620,7 @@ var ImgInner = ({
10615
10620
  className,
10616
10621
  style,
10617
10622
  id,
10618
- pauseWhenLoading,
10623
+ pauseWhenLoading: shouldPauseWhenLoading,
10619
10624
  maxRetries,
10620
10625
  delayRenderRetries,
10621
10626
  delayRenderTimeoutInMilliseconds,
@@ -11970,6 +11975,7 @@ var InnerOffthreadVideo = (props2) => {
11970
11975
  ...otherProps
11971
11976
  } = props2;
11972
11977
  const environment = useRemotionEnvironment();
11978
+ const shouldPauseWhenBuffering = resolveV5Default(pauseWhenBuffering);
11973
11979
  if (environment.isClientSideRendering) {
11974
11980
  throw new Error("<OffthreadVideo> is not supported in @remotion/web-renderer. Use <Video> from @remotion/media instead. See https://remotion.dev/docs/client-side-rendering/limitations");
11975
11981
  }
@@ -11994,7 +12000,7 @@ var InnerOffthreadVideo = (props2) => {
11994
12000
  durationInFrames: trimAfterValue,
11995
12001
  name,
11996
12002
  children: /* @__PURE__ */ jsx35(InnerOffthreadVideo, {
11997
- pauseWhenBuffering: pauseWhenBuffering ?? false,
12003
+ pauseWhenBuffering: shouldPauseWhenBuffering,
11998
12004
  ...otherProps,
11999
12005
  trimAfter: undefined,
12000
12006
  name: undefined,
@@ -12009,7 +12015,7 @@ var InnerOffthreadVideo = (props2) => {
12009
12015
  validateMediaProps(props2, "Video");
12010
12016
  if (environment.isRendering) {
12011
12017
  return /* @__PURE__ */ jsx35(OffthreadVideoForRendering, {
12012
- pauseWhenBuffering: pauseWhenBuffering ?? false,
12018
+ pauseWhenBuffering: shouldPauseWhenBuffering,
12013
12019
  ...otherProps,
12014
12020
  trimAfter: undefined,
12015
12021
  name: undefined,
@@ -12034,7 +12040,7 @@ var InnerOffthreadVideo = (props2) => {
12034
12040
  _remotionInternalStack: stack ?? null,
12035
12041
  onDuration,
12036
12042
  onlyWarnForMediaSeekingError: true,
12037
- pauseWhenBuffering: pauseWhenBuffering ?? false,
12043
+ pauseWhenBuffering: shouldPauseWhenBuffering,
12038
12044
  showInTimeline: showInTimeline ?? true,
12039
12045
  onAutoPlayError: onAutoPlayError ?? undefined,
12040
12046
  onVideoFrame: onVideoFrame ?? null,
@@ -12092,7 +12098,7 @@ var OffthreadVideo = ({
12092
12098
  onAutoPlayError: onAutoPlayError ?? null,
12093
12099
  onError,
12094
12100
  onVideoFrame,
12095
- pauseWhenBuffering: pauseWhenBuffering ?? true,
12101
+ pauseWhenBuffering: resolveV5Default(pauseWhenBuffering),
12096
12102
  playbackRate: playbackRate ?? 1,
12097
12103
  preservePitch,
12098
12104
  toneFrequency: toneFrequency ?? 1,
@@ -13052,6 +13058,7 @@ var VideoForwardingFunction = (props2, ref) => {
13052
13058
  const { loop, ...propsOtherThanLoop } = props2;
13053
13059
  const { fps } = useVideoConfig();
13054
13060
  const environment = useRemotionEnvironment();
13061
+ const shouldPauseWhenBuffering = resolveV5Default(pauseWhenBuffering);
13055
13062
  if (environment.isClientSideRendering) {
13056
13063
  throw new Error("<Html5Video> is not supported in @remotion/web-renderer. Use <Video> from @remotion/media instead. See https://remotion.dev/docs/client-side-rendering/limitations");
13057
13064
  }
@@ -13110,7 +13117,7 @@ var VideoForwardingFunction = (props2, ref) => {
13110
13117
  durationInFrames: trimAfterValue === undefined ? undefined : trimAfterValue / (props2.playbackRate ?? 1),
13111
13118
  name,
13112
13119
  children: /* @__PURE__ */ jsx39(Html5Video, {
13113
- pauseWhenBuffering: pauseWhenBuffering ?? false,
13120
+ pauseWhenBuffering: shouldPauseWhenBuffering,
13114
13121
  onVideoFrame,
13115
13122
  ...otherProps,
13116
13123
  ref,
@@ -13136,7 +13143,7 @@ var VideoForwardingFunction = (props2, ref) => {
13136
13143
  ...otherProps,
13137
13144
  ref,
13138
13145
  onVideoFrame: onVideoFrame ?? null,
13139
- pauseWhenBuffering: pauseWhenBuffering ?? false,
13146
+ pauseWhenBuffering: shouldPauseWhenBuffering,
13140
13147
  onDuration,
13141
13148
  _remotionInternalStack: stack ?? null,
13142
13149
  _remotionInternalNativeLoopPassed: _remotionInternalNativeLoopPassed ?? false,
@@ -1587,8 +1587,9 @@ var NoReactInternals = {
1587
1587
  getOffthreadVideoSource,
1588
1588
  getExpectedMediaFrameUncorrected,
1589
1589
  ENABLE_V5_BREAKING_CHANGES,
1590
- MIN_NODE_VERSION: ENABLE_V5_BREAKING_CHANGES ? 18 : 16,
1590
+ MIN_NODE_VERSION: ENABLE_V5_BREAKING_CHANGES ? 22 : 16,
1591
1591
  MIN_BUN_VERSION: ENABLE_V5_BREAKING_CHANGES ? "1.1.3" : "1.0.3",
1592
+ MIN_ESLINT_VERSION: ENABLE_V5_BREAKING_CHANGES ? "8.57.0" : "7.15.0",
1592
1593
  colorNames,
1593
1594
  DATE_TOKEN,
1594
1595
  FILE_TOKEN,
@@ -1,5 +1,5 @@
1
1
  // src/version.ts
2
- var VERSION = "4.0.497";
2
+ var VERSION = "4.0.499";
3
3
  export {
4
4
  VERSION
5
5
  };
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "url": "https://github.com/remotion-dev/remotion/tree/main/packages/core"
4
4
  },
5
5
  "name": "remotion",
6
- "version": "4.0.497",
6
+ "version": "4.0.499",
7
7
  "description": "Make videos programmatically",
8
8
  "main": "dist/cjs/index.js",
9
9
  "types": "dist/cjs/index.d.ts",
@@ -34,8 +34,8 @@
34
34
  "react": "19.2.3",
35
35
  "react-dom": "19.2.3",
36
36
  "webpack": "5.105.0",
37
- "zod": "4.3.6",
38
- "@remotion/eslint-config-internal": "4.0.497",
37
+ "zod": "4.4.3",
38
+ "@remotion/eslint-config-internal": "4.0.499",
39
39
  "eslint": "9.19.0",
40
40
  "@typescript/native-preview": "7.0.0-dev.20260217.1"
41
41
  },