remotion 3.1.4 → 3.1.7
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/.turbo/turbo-build.log +5 -5
- package/dist/Composition.js +1 -1
- package/dist/CompositionManager.d.ts +0 -6
- package/dist/Still.d.ts +0 -1
- package/dist/audio/Audio.d.ts +2 -2
- package/dist/audio/AudioForDevelopment.d.ts +2 -2
- package/dist/audio/AudioForDevelopment.js +10 -1
- package/dist/audio/AudioForRendering.d.ts +1 -1
- package/dist/audio/shared-audio-tags.d.ts +3 -2
- package/dist/audio/shared-audio-tags.js +83 -40
- package/dist/config/index.d.ts +6 -2
- package/dist/config/index.js +5 -0
- package/dist/config/log.d.ts +1 -1
- package/dist/config/output-location.d.ts +2 -0
- package/dist/config/output-location.js +16 -0
- package/dist/config.d.ts +188 -0
- package/dist/config.js +21 -0
- package/dist/delay-render.js +4 -4
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3 -2
- package/dist/internals.d.ts +12 -94
- package/dist/internals.js +3 -93
- package/dist/spring/measure-spring.js +1 -1
- package/dist/validation/validate-fps.d.ts +1 -2
- package/dist/validation/validate-fps.js +3 -3
- package/dist/video/Video.d.ts +2 -2
- package/dist/video/VideoForDevelopment.d.ts +2 -2
- package/dist/video/VideoForRendering.d.ts +1 -1
- package/package.json +2 -2
- package/dist/config/bundle-out-dir.d.ts +0 -2
- package/dist/config/bundle-out-dir.js +0 -12
- package/dist/config/every-nth-file.d.ts +0 -2
- package/dist/config/every-nth-file.js +0 -12
- package/dist/config/loop.d.ts +0 -4
- package/dist/config/loop.js +0 -18
- package/dist/config/public-path.d.ts +0 -2
- package/dist/config/public-path.js +0 -12
- package/dist/config/skip-n-frames.d.ts +0 -2
- package/dist/config/skip-n-frames.js +0 -12
- package/dist/initial-frame.d.ts +0 -2
- package/dist/initial-frame.js +0 -12
- package/dist/interpolateColors.d.ts +0 -5
- package/dist/interpolateColors.js +0 -401
- package/dist/preload.d.ts +0 -7
- package/dist/preload.js +0 -39
- package/dist/sequencing/index.d.ts +0 -19
- package/dist/sequencing/index.js +0 -123
- package/dist/use-frame.d.ts +0 -7
- package/dist/use-frame.js +0 -25
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
[
|
|
2
|
-
[
|
|
3
|
-
[
|
|
4
|
-
[
|
|
5
|
-
[
|
|
1
|
+
[32mremotion:build: [0mcache hit, replaying output [2ma033b7c456e7b58f[0m
|
|
2
|
+
[32mremotion:build: [0m
|
|
3
|
+
[32mremotion:build: [0m> remotion@3.1.6 build /Users/jonathanburger/remotion/packages/core
|
|
4
|
+
[32mremotion:build: [0m> tsc -d
|
|
5
|
+
[32mremotion:build: [0m
|
package/dist/Composition.js
CHANGED
|
@@ -49,7 +49,7 @@ const Composition = ({ width, height, fps, durationInFrames, id, defaultProps, .
|
|
|
49
49
|
(0, validate_dimensions_1.validateDimension)(width, 'width', 'of the <Composition/> component');
|
|
50
50
|
(0, validate_dimensions_1.validateDimension)(height, 'height', 'of the <Composition/> component');
|
|
51
51
|
(0, validate_duration_in_frames_1.validateDurationInFrames)(durationInFrames, 'of the <Composition/> component');
|
|
52
|
-
(0, validate_fps_1.validateFps)(fps, 'as a prop of the <Composition/> component',
|
|
52
|
+
(0, validate_fps_1.validateFps)(fps, 'as a prop of the <Composition/> component', false);
|
|
53
53
|
registerComposition({
|
|
54
54
|
durationInFrames,
|
|
55
55
|
fps,
|
|
@@ -50,12 +50,6 @@ export declare type TAsset = {
|
|
|
50
50
|
mediaFrame: number;
|
|
51
51
|
playbackRate: number;
|
|
52
52
|
};
|
|
53
|
-
export declare type RenderAssetInfo = {
|
|
54
|
-
assets: TAsset[][];
|
|
55
|
-
imageSequenceName: string;
|
|
56
|
-
downloadDir: string;
|
|
57
|
-
firstFrameIndex: number;
|
|
58
|
-
};
|
|
59
53
|
export declare type CompositionManagerContext = {
|
|
60
54
|
compositions: TComposition[];
|
|
61
55
|
registerComposition: <T>(comp: TComposition<T>) => void;
|
package/dist/Still.d.ts
CHANGED
package/dist/audio/Audio.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { RemotionMainAudioProps } from './props';
|
|
3
|
-
export declare const Audio: React.ForwardRefExoticComponent<Pick<Omit<React.DetailedHTMLProps<React.AudioHTMLAttributes<HTMLAudioElement>, HTMLAudioElement>, "
|
|
3
|
+
export declare const Audio: React.ForwardRefExoticComponent<Pick<Omit<React.DetailedHTMLProps<React.AudioHTMLAttributes<HTMLAudioElement>, HTMLAudioElement>, "onEnded" | "autoPlay" | "controls" | "loop"> & {
|
|
4
4
|
volume?: import("../volume-prop").VolumeProp | undefined;
|
|
5
5
|
playbackRate?: number | undefined;
|
|
6
|
-
} & RemotionMainAudioProps, "id" | "
|
|
6
|
+
} & RemotionMainAudioProps, "id" | "style" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "lang" | "placeholder" | "slot" | "spellCheck" | "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" | "src" | "volume" | "playbackRate" | "controlsList" | "crossOrigin" | "mediaGroup" | "muted" | "playsInline" | "preload" | "key" | keyof RemotionMainAudioProps> & React.RefAttributes<HTMLAudioElement>>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
export declare const AudioForDevelopment: React.ForwardRefExoticComponent<Pick<Omit<React.DetailedHTMLProps<React.AudioHTMLAttributes<HTMLAudioElement>, HTMLAudioElement>, "
|
|
2
|
+
export declare const AudioForDevelopment: React.ForwardRefExoticComponent<Pick<Omit<React.DetailedHTMLProps<React.AudioHTMLAttributes<HTMLAudioElement>, HTMLAudioElement>, "onEnded" | "autoPlay" | "controls" | "loop"> & {
|
|
3
3
|
volume?: import("../volume-prop").VolumeProp | undefined;
|
|
4
4
|
playbackRate?: number | undefined;
|
|
5
5
|
} & {
|
|
6
6
|
shouldPreMountAudioTags: boolean;
|
|
7
|
-
}, "id" | "
|
|
7
|
+
}, "id" | "style" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "lang" | "placeholder" | "slot" | "spellCheck" | "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" | "src" | "volume" | "playbackRate" | "controlsList" | "crossOrigin" | "mediaGroup" | "muted" | "playsInline" | "preload" | "key" | "shouldPreMountAudioTags"> & React.RefAttributes<HTMLAudioElement>>;
|
|
@@ -3,6 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.AudioForDevelopment = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
|
+
const random_1 = require("../random");
|
|
7
|
+
const Sequence_1 = require("../Sequence");
|
|
6
8
|
const use_media_in_timeline_1 = require("../use-media-in-timeline");
|
|
7
9
|
const use_media_playback_1 = require("../use-media-playback");
|
|
8
10
|
const use_media_tag_volume_1 = require("../use-media-tag-volume");
|
|
@@ -25,7 +27,14 @@ const AudioForDevelopmentForwardRefFunction = (props, ref) => {
|
|
|
25
27
|
...nativeProps,
|
|
26
28
|
};
|
|
27
29
|
}, [mediaMuted, muted, nativeProps]);
|
|
28
|
-
const
|
|
30
|
+
const sequenceContext = (0, react_1.useContext)(Sequence_1.SequenceContext);
|
|
31
|
+
// Generate a string that's as unique as possible for this asset
|
|
32
|
+
// but at the same time deterministic. We use it to combat strict mode issues.
|
|
33
|
+
const id = (0, react_1.useMemo)(() => {
|
|
34
|
+
var _a;
|
|
35
|
+
return `audio-${(0, random_1.random)((_a = props.src) !== null && _a !== void 0 ? _a : '')}-${sequenceContext === null || sequenceContext === void 0 ? void 0 : sequenceContext.relativeFrom}-${sequenceContext === null || sequenceContext === void 0 ? void 0 : sequenceContext.cumulatedFrom}-${sequenceContext === null || sequenceContext === void 0 ? void 0 : sequenceContext.durationInFrames}-muted:${props.muted}`;
|
|
36
|
+
}, [props.muted, props.src, sequenceContext]);
|
|
37
|
+
const audioRef = (0, shared_audio_tags_1.useSharedAudio)(propsToPass, id).el;
|
|
29
38
|
const actualVolume = (0, use_media_tag_volume_1.useMediaTagVolume)(audioRef);
|
|
30
39
|
(0, use_sync_volume_with_media_tag_1.useSyncVolumeWithMediaTag)({
|
|
31
40
|
volumePropFrame,
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { RemotionAudioProps } from './props';
|
|
3
|
-
export declare const AudioForRendering: React.ForwardRefExoticComponent<Pick<RemotionAudioProps, "id" | "
|
|
3
|
+
export declare const AudioForRendering: React.ForwardRefExoticComponent<Pick<RemotionAudioProps, "id" | "style" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "lang" | "placeholder" | "slot" | "spellCheck" | "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" | "src" | "volume" | "playbackRate" | "controlsList" | "crossOrigin" | "mediaGroup" | "muted" | "playsInline" | "preload" | "key"> & React.RefAttributes<HTMLAudioElement>>;
|
|
@@ -15,9 +15,10 @@ declare type AudioElem = {
|
|
|
15
15
|
id: number;
|
|
16
16
|
props: RemotionAudioProps;
|
|
17
17
|
el: React.RefObject<HTMLAudioElement>;
|
|
18
|
+
audioId: string;
|
|
18
19
|
};
|
|
19
20
|
declare type SharedContext = {
|
|
20
|
-
registerAudio: (aud: RemotionAudioProps) => AudioElem;
|
|
21
|
+
registerAudio: (aud: RemotionAudioProps, audioId: string) => AudioElem;
|
|
21
22
|
unregisterAudio: (id: number) => void;
|
|
22
23
|
updateAudio: (id: number, aud: RemotionAudioProps) => void;
|
|
23
24
|
playAllAudios: () => void;
|
|
@@ -28,5 +29,5 @@ export declare const SharedAudioContextProvider: React.FC<{
|
|
|
28
29
|
numberOfAudioTags: number;
|
|
29
30
|
children: React.ReactNode;
|
|
30
31
|
}>;
|
|
31
|
-
export declare const useSharedAudio: (aud: RemotionAudioProps) => AudioElem;
|
|
32
|
+
export declare const useSharedAudio: (aud: RemotionAudioProps, audioId: string) => AudioElem;
|
|
32
33
|
export {};
|
|
@@ -27,9 +27,22 @@ exports.useSharedAudio = exports.SharedAudioContextProvider = exports.SharedAudi
|
|
|
27
27
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
28
28
|
const react_1 = __importStar(require("react"));
|
|
29
29
|
const EMPTY_AUDIO = 'data:audio/mp3;base64,/+MYxAAJcAV8AAgAABn//////+/gQ5BAMA+D4Pg+BAQBAEAwD4Pg+D4EBAEAQDAPg++hYBH///hUFQVBUFREDQNHmf///////+MYxBUGkAGIMAAAAP/29Xt6lUxBTUUzLjEwMFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV/+MYxDUAAANIAAAAAFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV';
|
|
30
|
+
const compareProps = (obj1, obj2) => {
|
|
31
|
+
const keysA = Object.keys(obj1).sort();
|
|
32
|
+
const keysB = Object.keys(obj2).sort();
|
|
33
|
+
if (keysA.length !== keysB.length) {
|
|
34
|
+
return false;
|
|
35
|
+
}
|
|
36
|
+
for (let i = 0; i < keysA.length; i++) {
|
|
37
|
+
if (keysA[i] !== keysB[i]) {
|
|
38
|
+
return false;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
return true;
|
|
42
|
+
};
|
|
30
43
|
exports.SharedAudioContext = (0, react_1.createContext)(null);
|
|
31
44
|
const SharedAudioContextProvider = ({ children, numberOfAudioTags }) => {
|
|
32
|
-
const
|
|
45
|
+
const audios = (0, react_1.useRef)([]);
|
|
33
46
|
const [initialNumberOfAudioTags] = (0, react_1.useState)(numberOfAudioTags);
|
|
34
47
|
if (numberOfAudioTags !== initialNumberOfAudioTags) {
|
|
35
48
|
throw new Error('The number of shared audio tags has changed dynamically. Once you have set this property, you cannot change it afterwards.');
|
|
@@ -40,7 +53,30 @@ const SharedAudioContextProvider = ({ children, numberOfAudioTags }) => {
|
|
|
40
53
|
});
|
|
41
54
|
}, [numberOfAudioTags]);
|
|
42
55
|
const takenAudios = (0, react_1.useRef)(new Array(numberOfAudioTags).fill(false));
|
|
43
|
-
const
|
|
56
|
+
const rerenderAudios = (0, react_1.useCallback)(() => {
|
|
57
|
+
refs.forEach(({ ref, id }) => {
|
|
58
|
+
var _a;
|
|
59
|
+
const data = (_a = audios.current) === null || _a === void 0 ? void 0 : _a.find((a) => a.id === id);
|
|
60
|
+
const { current } = ref;
|
|
61
|
+
if (!current) {
|
|
62
|
+
throw new Error('Audio has no ref ' + id);
|
|
63
|
+
}
|
|
64
|
+
if (data === undefined) {
|
|
65
|
+
current.src = EMPTY_AUDIO;
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
if (!data) {
|
|
69
|
+
throw new TypeError('Expected audio data to be there');
|
|
70
|
+
}
|
|
71
|
+
Object.assign(current, data.props);
|
|
72
|
+
});
|
|
73
|
+
}, [refs]);
|
|
74
|
+
const registerAudio = (0, react_1.useCallback)((aud, audioId) => {
|
|
75
|
+
var _a, _b;
|
|
76
|
+
const found = (_a = audios.current) === null || _a === void 0 ? void 0 : _a.find((a) => a.audioId === audioId);
|
|
77
|
+
if (found) {
|
|
78
|
+
return found;
|
|
79
|
+
}
|
|
44
80
|
const firstFreeAudio = takenAudios.current.findIndex((a) => a === false);
|
|
45
81
|
if (firstFreeAudio === -1) {
|
|
46
82
|
throw new Error(`Tried to simultaneously mount ${numberOfAudioTags + 1} <Audio /> tags at the same time. With the current settings, the maximum amount of <Audio /> tags is limited to ${numberOfAudioTags} at the same time. Remotion pre-mounts silent audio tags to help avoid browser autoplay restrictions. See https://remotion.dev/docs/player/autoplay#use-the-numberofsharedaudiotags-property for more information on how to increase this limit.`);
|
|
@@ -53,17 +89,14 @@ const SharedAudioContextProvider = ({ children, numberOfAudioTags }) => {
|
|
|
53
89
|
props: aud,
|
|
54
90
|
id,
|
|
55
91
|
el: ref,
|
|
92
|
+
audioId,
|
|
56
93
|
};
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
// to be updated in the next tick.
|
|
60
|
-
// This can lead to a tiny delay of audio playback, improvement ideas are welcome.
|
|
61
|
-
setTimeout(() => {
|
|
62
|
-
setAudios((prevAudios) => [...prevAudios, newElem]);
|
|
63
|
-
}, 4);
|
|
94
|
+
(_b = audios.current) === null || _b === void 0 ? void 0 : _b.push(newElem);
|
|
95
|
+
rerenderAudios();
|
|
64
96
|
return newElem;
|
|
65
|
-
}, [numberOfAudioTags, refs]);
|
|
97
|
+
}, [numberOfAudioTags, refs, rerenderAudios]);
|
|
66
98
|
const unregisterAudio = (0, react_1.useCallback)((id) => {
|
|
99
|
+
var _a;
|
|
67
100
|
const cloned = [...takenAudios.current];
|
|
68
101
|
const index = refs.findIndex((r) => r.id === id);
|
|
69
102
|
if (index === -1) {
|
|
@@ -71,23 +104,30 @@ const SharedAudioContextProvider = ({ children, numberOfAudioTags }) => {
|
|
|
71
104
|
}
|
|
72
105
|
cloned[index] = false;
|
|
73
106
|
takenAudios.current = cloned;
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
}, [refs]);
|
|
107
|
+
audios.current = (_a = audios.current) === null || _a === void 0 ? void 0 : _a.filter((a) => a.id !== id);
|
|
108
|
+
rerenderAudios();
|
|
109
|
+
}, [refs, rerenderAudios]);
|
|
78
110
|
const updateAudio = (0, react_1.useCallback)((id, aud) => {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
111
|
+
var _a;
|
|
112
|
+
let changed = false;
|
|
113
|
+
audios.current = (_a = audios.current) === null || _a === void 0 ? void 0 : _a.map((prevA) => {
|
|
114
|
+
if (prevA.id === id) {
|
|
115
|
+
const isTheSame = compareProps(aud, prevA.props);
|
|
116
|
+
if (isTheSame) {
|
|
117
|
+
return prevA;
|
|
86
118
|
}
|
|
87
|
-
|
|
88
|
-
|
|
119
|
+
changed = true;
|
|
120
|
+
return {
|
|
121
|
+
...prevA,
|
|
122
|
+
props: aud,
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
return prevA;
|
|
89
126
|
});
|
|
90
|
-
|
|
127
|
+
if (changed) {
|
|
128
|
+
rerenderAudios();
|
|
129
|
+
}
|
|
130
|
+
}, [rerenderAudios]);
|
|
91
131
|
const playAllAudios = (0, react_1.useCallback)(() => {
|
|
92
132
|
refs.forEach((ref) => {
|
|
93
133
|
var _a;
|
|
@@ -110,41 +150,44 @@ const SharedAudioContextProvider = ({ children, numberOfAudioTags }) => {
|
|
|
110
150
|
updateAudio,
|
|
111
151
|
]);
|
|
112
152
|
return ((0, jsx_runtime_1.jsxs)(exports.SharedAudioContext.Provider, { value: value, children: [refs.map(({ id, ref }) => {
|
|
113
|
-
|
|
114
|
-
if (data === undefined) {
|
|
115
|
-
return (0, jsx_runtime_1.jsx)("audio", { ref: ref, src: EMPTY_AUDIO }, id);
|
|
116
|
-
}
|
|
117
|
-
if (!data) {
|
|
118
|
-
throw new TypeError('Expected audio data to be there');
|
|
119
|
-
}
|
|
120
|
-
return (0, jsx_runtime_1.jsx)("audio", { ref: ref, ...data.props }, id);
|
|
153
|
+
return (0, jsx_runtime_1.jsx)("audio", { ref: ref, src: EMPTY_AUDIO }, id);
|
|
121
154
|
}), children] }));
|
|
122
155
|
};
|
|
123
156
|
exports.SharedAudioContextProvider = SharedAudioContextProvider;
|
|
124
|
-
const useSharedAudio = (aud) => {
|
|
157
|
+
const useSharedAudio = (aud, audioId) => {
|
|
125
158
|
const ctx = (0, react_1.useContext)(exports.SharedAudioContext);
|
|
159
|
+
/**
|
|
160
|
+
* We work around this in React 18 so an audio tag will only register itself once
|
|
161
|
+
*/
|
|
126
162
|
const [elem] = (0, react_1.useState)(() => {
|
|
127
163
|
if (ctx && ctx.numberOfAudioTags > 0) {
|
|
128
|
-
return ctx.registerAudio(aud);
|
|
164
|
+
return ctx.registerAudio(aud, audioId);
|
|
129
165
|
}
|
|
130
166
|
return {
|
|
131
167
|
el: react_1.default.createRef(),
|
|
132
168
|
id: Math.random(),
|
|
133
169
|
props: aud,
|
|
170
|
+
audioId,
|
|
134
171
|
};
|
|
135
172
|
});
|
|
136
|
-
|
|
173
|
+
/**
|
|
174
|
+
* Effects in React 18 fire twice, and we are looking for a way to only fire it once.
|
|
175
|
+
* - useInsertionEffect only fires once. If it's available we are in React 18.
|
|
176
|
+
* - useLayoutEffect only fires once in React 17.
|
|
177
|
+
*/
|
|
178
|
+
const effectToUse = react_1.useInsertionEffect !== null && react_1.useInsertionEffect !== void 0 ? react_1.useInsertionEffect : react_1.useLayoutEffect;
|
|
179
|
+
effectToUse(() => {
|
|
180
|
+
if (ctx && ctx.numberOfAudioTags > 0) {
|
|
181
|
+
ctx.updateAudio(elem.id, aud);
|
|
182
|
+
}
|
|
183
|
+
}, [aud, ctx, elem.id]);
|
|
184
|
+
effectToUse(() => {
|
|
137
185
|
return () => {
|
|
138
186
|
if (ctx && ctx.numberOfAudioTags > 0) {
|
|
139
187
|
ctx.unregisterAudio(elem.id);
|
|
140
188
|
}
|
|
141
189
|
};
|
|
142
190
|
}, [ctx, elem.id]);
|
|
143
|
-
(0, react_1.useEffect)(() => {
|
|
144
|
-
if (ctx && ctx.numberOfAudioTags > 0) {
|
|
145
|
-
ctx.updateAudio(elem.id, aud);
|
|
146
|
-
}
|
|
147
|
-
}, [aud, ctx, elem.id]);
|
|
148
191
|
return elem;
|
|
149
192
|
};
|
|
150
193
|
exports.useSharedAudio = useSharedAudio;
|
package/dist/config/index.d.ts
CHANGED
|
@@ -44,7 +44,7 @@ export declare const Config: {
|
|
|
44
44
|
*
|
|
45
45
|
* Set this to 'verbose' to get browser logs and other IO.
|
|
46
46
|
*/
|
|
47
|
-
readonly setLevel: (newLogLevel: "
|
|
47
|
+
readonly setLevel: (newLogLevel: "verbose" | "info" | "warn" | "error") => void;
|
|
48
48
|
};
|
|
49
49
|
readonly Puppeteer: {
|
|
50
50
|
/**
|
|
@@ -135,6 +135,10 @@ export declare const Config: {
|
|
|
135
135
|
readonly setNumberOfGifLoops: (newLoop: import("./number-of-gif-loops").Loop) => void;
|
|
136
136
|
};
|
|
137
137
|
readonly Output: {
|
|
138
|
+
/**
|
|
139
|
+
* Set the output file location string. Default: `out/{composition}.{codec}`
|
|
140
|
+
*/
|
|
141
|
+
readonly setOutputLocation: (newOutputLocation: string) => void;
|
|
138
142
|
/**
|
|
139
143
|
* If the video file already exists, should Remotion overwrite
|
|
140
144
|
* the output? Default: true
|
|
@@ -172,7 +176,7 @@ export declare const Config: {
|
|
|
172
176
|
* Possible values: 4444-xq, 4444, hq, standard, light, proxy. Default: 'hq'
|
|
173
177
|
* See https://avpres.net/FFmpeg/im_ProRes.html for meaning of possible values.
|
|
174
178
|
*/
|
|
175
|
-
readonly setProResProfile: (profile: "4444-xq" | "4444" | "hq" | "standard" | "
|
|
179
|
+
readonly setProResProfile: (profile: "light" | "4444-xq" | "4444" | "hq" | "standard" | "proxy" | undefined) => void;
|
|
176
180
|
};
|
|
177
181
|
};
|
|
178
182
|
export type { PixelFormat, Concurrency, WebpackConfiguration, WebpackOverrideFn, BrowserExecutable, FfmpegExecutable, ImageFormat, Codec, Browser, FrameRange, LogLevel, StillImageFormat, };
|
package/dist/config/index.js
CHANGED
|
@@ -15,6 +15,7 @@ const image_sequence_1 = require("./image-sequence");
|
|
|
15
15
|
const log_1 = require("./log");
|
|
16
16
|
const max_timeline_tracks_1 = require("./max-timeline-tracks");
|
|
17
17
|
const number_of_gif_loops_1 = require("./number-of-gif-loops");
|
|
18
|
+
const output_location_1 = require("./output-location");
|
|
18
19
|
const override_webpack_1 = require("./override-webpack");
|
|
19
20
|
const overwrite_1 = require("./overwrite");
|
|
20
21
|
const pixel_format_1 = require("./pixel-format");
|
|
@@ -151,6 +152,10 @@ exports.Config = {
|
|
|
151
152
|
setNumberOfGifLoops: number_of_gif_loops_1.setNumberOfGifLoops,
|
|
152
153
|
},
|
|
153
154
|
Output: {
|
|
155
|
+
/**
|
|
156
|
+
* Set the output file location string. Default: `out/{composition}.{codec}`
|
|
157
|
+
*/
|
|
158
|
+
setOutputLocation: output_location_1.setOutputLocation,
|
|
154
159
|
/**
|
|
155
160
|
* If the video file already exists, should Remotion overwrite
|
|
156
161
|
* the output? Default: true
|
package/dist/config/log.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export declare const logLevels: readonly ["verbose", "info", "warn", "error"];
|
|
2
2
|
export declare type LogLevel = typeof logLevels[number];
|
|
3
3
|
export declare const DEFAULT_LOG_LEVEL: LogLevel;
|
|
4
|
-
export declare const getLogLevel: () => "
|
|
4
|
+
export declare const getLogLevel: () => "verbose" | "info" | "warn" | "error";
|
|
5
5
|
export declare const setLogLevel: (newLogLevel: LogLevel) => void;
|
|
6
6
|
export declare const isValidLogLevel: (level: string) => boolean;
|
|
7
7
|
export declare const isEqualOrBelowLogLevel: (currentLevel: LogLevel, level: LogLevel) => boolean;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getOutputLocation = exports.setOutputLocation = void 0;
|
|
4
|
+
let currentOutputLocation = null;
|
|
5
|
+
const setOutputLocation = (newOutputLocation) => {
|
|
6
|
+
if (typeof newOutputLocation !== 'string') {
|
|
7
|
+
throw new Error(`outputLocation must be a string but got ${typeof newOutputLocation} (${JSON.stringify(newOutputLocation)})`);
|
|
8
|
+
}
|
|
9
|
+
if (newOutputLocation.trim() === '') {
|
|
10
|
+
throw new Error(`outputLocation must not be an empty string`);
|
|
11
|
+
}
|
|
12
|
+
currentOutputLocation = newOutputLocation;
|
|
13
|
+
};
|
|
14
|
+
exports.setOutputLocation = setOutputLocation;
|
|
15
|
+
const getOutputLocation = () => currentOutputLocation;
|
|
16
|
+
exports.getOutputLocation = getOutputLocation;
|