remotion 4.0.75 → 4.0.77

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.
@@ -8,6 +8,9 @@ const input_props_js_1 = require("./config/input-props.js");
8
8
  const EditorProps_js_1 = require("./EditorProps.js");
9
9
  const get_remotion_environment_js_1 = require("./get-remotion-environment.js");
10
10
  const resolve_video_config_js_1 = require("./resolve-video-config.js");
11
+ const validate_dimensions_js_1 = require("./validation/validate-dimensions.js");
12
+ const validate_duration_in_frames_js_1 = require("./validation/validate-duration-in-frames.js");
13
+ const validate_fps_js_1 = require("./validation/validate-fps.js");
11
14
  exports.ResolveCompositionContext = (0, react_1.createContext)(null);
12
15
  exports.resolveCompositionsRef = (0, react_1.createRef)();
13
16
  const needsResolution = (composition) => {
@@ -182,6 +185,13 @@ const useResolvedVideoConfig = (preferredCompositionId) => {
182
185
  };
183
186
  }
184
187
  if (!(0, exports.needsResolution)(composition)) {
188
+ (0, validate_duration_in_frames_js_1.validateDurationInFrames)(composition.durationInFrames, {
189
+ allowFloats: false,
190
+ component: `in <Composition id="${composition.id}">`,
191
+ });
192
+ (0, validate_fps_js_1.validateFps)(composition.fps, `in <Composition id="${composition.id}">`, false);
193
+ (0, validate_dimensions_js_1.validateDimension)(composition.width, 'width', `in <Composition id="${composition.id}">`);
194
+ (0, validate_dimensions_js_1.validateDimension)(composition.height, 'height', `in <Composition id="${composition.id}">`);
185
195
  return {
186
196
  type: 'success',
187
197
  result: {
@@ -13,4 +13,4 @@ export declare const Audio: React.ForwardRefExoticComponent<Pick<Omit<React.Deta
13
13
  _remotionInternalNeedsDurationCalculation?: boolean | undefined;
14
14
  _remotionInternalNativeLoopPassed?: boolean | undefined;
15
15
  toneFrequency?: number | undefined;
16
- } & RemotionMainAudioProps, "id" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "lang" | "placeholder" | "slot" | "spellCheck" | "style" | "tabIndex" | "title" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "volume" | "allowAmplificationDuringRender" | "controlsList" | "crossOrigin" | "loop" | "mediaGroup" | "muted" | "playsInline" | "preload" | "src" | "name" | "playbackRate" | "acceptableTimeShiftInSeconds" | "_remotionInternalNeedsDurationCalculation" | "_remotionInternalNativeLoopPassed" | "toneFrequency" | keyof RemotionMainAudioProps> & React.RefAttributes<HTMLAudioElement>>;
16
+ } & RemotionMainAudioProps, "id" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "lang" | "placeholder" | "slot" | "spellCheck" | "style" | "tabIndex" | "title" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "muted" | "volume" | "allowAmplificationDuringRender" | "controlsList" | "crossOrigin" | "loop" | "mediaGroup" | "playsInline" | "preload" | "src" | "name" | "playbackRate" | "acceptableTimeShiftInSeconds" | "_remotionInternalNeedsDurationCalculation" | "_remotionInternalNativeLoopPassed" | "toneFrequency" | keyof RemotionMainAudioProps> & React.RefAttributes<HTMLAudioElement>>;
@@ -26,6 +26,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
26
26
  exports.useSharedAudio = exports.SharedAudioContextProvider = exports.SharedAudioContext = void 0;
27
27
  const jsx_runtime_1 = require("react/jsx-runtime");
28
28
  const react_1 = __importStar(require("react"));
29
+ const play_and_handle_not_allowed_error_js_1 = require("../play-and-handle-not-allowed-error.js");
29
30
  const EMPTY_AUDIO = 'data:audio/mp3;base64,/+MYxAAJcAV8AAgAABn//////+/gQ5BAMA+D4Pg+BAQBAEAwD4Pg+D4EBAEAQDAPg++hYBH///hUFQVBUFREDQNHmf///////+MYxBUGkAGIMAAAAP/29Xt6lUxBTUUzLjEwMFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV/+MYxDUAAANIAAAAAFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV';
30
31
  const compareProps = (obj1, obj2) => {
31
32
  const keysA = Object.keys(obj1).sort();
@@ -157,8 +158,7 @@ const SharedAudioContextProvider = ({ children, numberOfAudioTags, component })
157
158
  }, [rerenderAudios]);
158
159
  const playAllAudios = (0, react_1.useCallback)(() => {
159
160
  refs.forEach((ref) => {
160
- var _a;
161
- (_a = ref.ref.current) === null || _a === void 0 ? void 0 : _a.play();
161
+ (0, play_and_handle_not_allowed_error_js_1.playAndHandleNotAllowedError)(ref.ref, 'audio');
162
162
  });
163
163
  }, [refs]);
164
164
  const value = (0, react_1.useMemo)(() => {
@@ -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.75";
1
+ export declare const VERSION = "4.0.77";
@@ -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.75';
5
+ exports.VERSION = '4.0.77';
@@ -0,0 +1,8 @@
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
+ };
@@ -0,0 +1,60 @@
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;
@@ -59,7 +59,7 @@ function truthy(value) {
59
59
  }
60
60
 
61
61
  // Automatically generated on publish
62
- const VERSION = '4.0.75';
62
+ const VERSION = '4.0.77';
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
 
@@ -824,6 +821,13 @@ const useResolvedVideoConfig = (preferredCompositionId) => {
824
821
  };
825
822
  }
826
823
  if (!needsResolution(composition)) {
824
+ validateDurationInFrames(composition.durationInFrames, {
825
+ allowFloats: false,
826
+ component: `in <Composition id="${composition.id}">`,
827
+ });
828
+ validateFps(composition.fps, `in <Composition id="${composition.id}">`, false);
829
+ validateDimension(composition.width, 'width', `in <Composition id="${composition.id}">`);
830
+ validateDimension(composition.height, 'height', `in <Composition id="${composition.id}">`);
827
831
  return {
828
832
  type: 'success',
829
833
  result: {
@@ -1262,6 +1266,7 @@ const prefetch = (src, options) => {
1262
1266
  }
1263
1267
  if (!buf.type.startsWith('video/') &&
1264
1268
  !buf.type.startsWith('audio/') &&
1269
+ !buf.type.startsWith('image/') &&
1265
1270
  !(options === null || options === void 0 ? void 0 : options.contentType)) {
1266
1271
  // eslint-disable-next-line no-console
1267
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.`);
@@ -2176,8 +2181,7 @@ const SharedAudioContextProvider = ({ children, numberOfAudioTags, component })
2176
2181
  }, [rerenderAudios]);
2177
2182
  const playAllAudios = useCallback(() => {
2178
2183
  refs.forEach((ref) => {
2179
- var _a;
2180
- (_a = ref.ref.current) === null || _a === void 0 ? void 0 : _a.play();
2184
+ playAndHandleNotAllowedError(ref.ref, 'audio');
2181
2185
  });
2182
2186
  }, [refs]);
2183
2187
  const value = useMemo(() => {
@@ -1,4 +1,4 @@
1
1
  // Automatically generated on publish
2
- const VERSION = '4.0.75';
2
+ const VERSION = '4.0.77';
3
3
 
4
4
  export { VERSION };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "remotion",
3
- "version": "4.0.75",
3
+ "version": "4.0.77",
4
4
  "description": "Render videos in React",
5
5
  "main": "dist/cjs/index.js",
6
6
  "types": "dist/cjs/index.d.ts",