remotion 4.0.49 → 4.0.51
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.d.ts +1 -1
- package/dist/cjs/audio/Audio.d.ts +1 -1
- package/dist/cjs/index.d.ts +0 -1
- package/dist/cjs/resolve-video-config.js +2 -2
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/index.mjs +79 -74
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
package/dist/cjs/Img.d.ts
CHANGED
|
@@ -7,4 +7,4 @@ export type ImgProps = Omit<React.DetailedHTMLProps<React.ImgHTMLAttributes<HTML
|
|
|
7
7
|
* @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.
|
|
8
8
|
* @see [Documentation](https://www.remotion.dev/docs/img)
|
|
9
9
|
*/
|
|
10
|
-
export declare const Img: React.ForwardRefExoticComponent<Pick<ImgProps, "width" | "
|
|
10
|
+
export declare const Img: React.ForwardRefExoticComponent<Pick<ImgProps, "width" | "height" | "id" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "lang" | "nonce" | "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" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onResize" | "onResizeCapture" | "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" | "crossOrigin" | "src" | "loading" | "referrerPolicy" | "alt" | "decoding" | "sizes" | "srcSet" | "useMap" | "maxRetries"> & React.RefAttributes<HTMLImageElement>>;
|
|
@@ -11,4 +11,4 @@ export declare const Audio: React.ForwardRefExoticComponent<Pick<Omit<React.Deta
|
|
|
11
11
|
allowAmplificationDuringRender?: boolean | undefined;
|
|
12
12
|
_remotionInternalNeedsDurationCalculation?: boolean | undefined;
|
|
13
13
|
toneFrequency?: number | undefined;
|
|
14
|
-
} & RemotionMainAudioProps, "id" | "
|
|
14
|
+
} & 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" | "playbackRate" | "acceptableTimeShiftInSeconds" | "_remotionInternalNeedsDurationCalculation" | "toneFrequency" | keyof RemotionMainAudioProps> & React.RefAttributes<HTMLAudioElement>>;
|
package/dist/cjs/index.d.ts
CHANGED
|
@@ -22,7 +22,7 @@ const validateCalculated = ({ composition, calculated, }) => {
|
|
|
22
22
|
return { width, height, fps, durationInFrames };
|
|
23
23
|
};
|
|
24
24
|
const resolveVideoConfig = ({ composition, editorProps: editorPropsOrUndefined, signal, inputProps, }) => {
|
|
25
|
-
var _a, _b, _c, _d, _e, _f
|
|
25
|
+
var _a, _b, _c, _d, _e, _f;
|
|
26
26
|
const calculatedProm = composition.calculateMetadata
|
|
27
27
|
? composition.calculateMetadata({
|
|
28
28
|
defaultProps: (_a = composition.defaultProps) !== null && _a !== void 0 ? _a : {},
|
|
@@ -74,7 +74,7 @@ const resolveVideoConfig = ({ composition, editorProps: editorPropsOrUndefined,
|
|
|
74
74
|
...data,
|
|
75
75
|
id: composition.id,
|
|
76
76
|
defaultProps: (_e = composition.defaultProps) !== null && _e !== void 0 ? _e : {},
|
|
77
|
-
props: (
|
|
77
|
+
props: (_f = calculatedProm.props) !== null && _f !== void 0 ? _f : fallbackProps,
|
|
78
78
|
};
|
|
79
79
|
};
|
|
80
80
|
exports.resolveVideoConfig = resolveVideoConfig;
|
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "4.0.
|
|
1
|
+
export declare const VERSION = "4.0.51";
|
package/dist/cjs/version.js
CHANGED
package/dist/esm/index.mjs
CHANGED
|
@@ -59,7 +59,7 @@ function truthy(value) {
|
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
// Automatically generated on publish
|
|
62
|
-
const VERSION = '4.0.
|
|
62
|
+
const VERSION = '4.0.51';
|
|
63
63
|
|
|
64
64
|
const checkMultipleRemotionVersions = () => {
|
|
65
65
|
if (typeof globalThis === 'undefined') {
|
|
@@ -570,8 +570,25 @@ function validateFps(fps, location, isGif) {
|
|
|
570
570
|
}
|
|
571
571
|
}
|
|
572
572
|
|
|
573
|
+
const validateCalculated = ({ composition, calculated, }) => {
|
|
574
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
575
|
+
const calculateMetadataErrorLocation = `calculated by calculateMetadata() for the composition "${composition.id}"`;
|
|
576
|
+
const defaultErrorLocation = `of the "<Composition />" component with the id "${composition.id}"`;
|
|
577
|
+
const width = (_b = (_a = calculated === null || calculated === void 0 ? void 0 : calculated.width) !== null && _a !== void 0 ? _a : composition.width) !== null && _b !== void 0 ? _b : undefined;
|
|
578
|
+
validateDimension(width, 'width', (calculated === null || calculated === void 0 ? void 0 : calculated.width) ? calculateMetadataErrorLocation : defaultErrorLocation);
|
|
579
|
+
const height = (_d = (_c = calculated === null || calculated === void 0 ? void 0 : calculated.height) !== null && _c !== void 0 ? _c : composition.height) !== null && _d !== void 0 ? _d : undefined;
|
|
580
|
+
validateDimension(height, 'height', (calculated === null || calculated === void 0 ? void 0 : calculated.height) ? calculateMetadataErrorLocation : defaultErrorLocation);
|
|
581
|
+
const fps = (_f = (_e = calculated === null || calculated === void 0 ? void 0 : calculated.fps) !== null && _e !== void 0 ? _e : composition.fps) !== null && _f !== void 0 ? _f : null;
|
|
582
|
+
validateFps(fps, (calculated === null || calculated === void 0 ? void 0 : calculated.fps) ? calculateMetadataErrorLocation : defaultErrorLocation, false);
|
|
583
|
+
const durationInFrames = (_h = (_g = calculated === null || calculated === void 0 ? void 0 : calculated.durationInFrames) !== null && _g !== void 0 ? _g : composition.durationInFrames) !== null && _h !== void 0 ? _h : null;
|
|
584
|
+
validateDurationInFrames(durationInFrames, {
|
|
585
|
+
allowFloats: false,
|
|
586
|
+
component: `of the "<Composition />" component with the id "${composition.id}"`,
|
|
587
|
+
});
|
|
588
|
+
return { width, height, fps, durationInFrames };
|
|
589
|
+
};
|
|
573
590
|
const resolveVideoConfig = ({ composition, editorProps: editorPropsOrUndefined, signal, inputProps, }) => {
|
|
574
|
-
var _a, _b, _c, _d, _e, _f
|
|
591
|
+
var _a, _b, _c, _d, _e, _f;
|
|
575
592
|
const calculatedProm = composition.calculateMetadata
|
|
576
593
|
? composition.calculateMetadata({
|
|
577
594
|
defaultProps: (_a = composition.defaultProps) !== null && _a !== void 0 ? _a : {},
|
|
@@ -623,29 +640,15 @@ const resolveVideoConfig = ({ composition, editorProps: editorPropsOrUndefined,
|
|
|
623
640
|
...data,
|
|
624
641
|
id: composition.id,
|
|
625
642
|
defaultProps: (_e = composition.defaultProps) !== null && _e !== void 0 ? _e : {},
|
|
626
|
-
props: (
|
|
643
|
+
props: (_f = calculatedProm.props) !== null && _f !== void 0 ? _f : fallbackProps,
|
|
627
644
|
};
|
|
628
645
|
};
|
|
629
|
-
const validateCalculated = ({ composition, calculated, }) => {
|
|
630
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
631
|
-
const calculateMetadataErrorLocation = `calculated by calculateMetadata() for the composition "${composition.id}"`;
|
|
632
|
-
const defaultErrorLocation = `of the "<Composition />" component with the id "${composition.id}"`;
|
|
633
|
-
const width = (_b = (_a = calculated === null || calculated === void 0 ? void 0 : calculated.width) !== null && _a !== void 0 ? _a : composition.width) !== null && _b !== void 0 ? _b : undefined;
|
|
634
|
-
validateDimension(width, 'width', (calculated === null || calculated === void 0 ? void 0 : calculated.width) ? calculateMetadataErrorLocation : defaultErrorLocation);
|
|
635
|
-
const height = (_d = (_c = calculated === null || calculated === void 0 ? void 0 : calculated.height) !== null && _c !== void 0 ? _c : composition.height) !== null && _d !== void 0 ? _d : undefined;
|
|
636
|
-
validateDimension(height, 'height', (calculated === null || calculated === void 0 ? void 0 : calculated.height) ? calculateMetadataErrorLocation : defaultErrorLocation);
|
|
637
|
-
const fps = (_f = (_e = calculated === null || calculated === void 0 ? void 0 : calculated.fps) !== null && _e !== void 0 ? _e : composition.fps) !== null && _f !== void 0 ? _f : null;
|
|
638
|
-
validateFps(fps, (calculated === null || calculated === void 0 ? void 0 : calculated.fps) ? calculateMetadataErrorLocation : defaultErrorLocation, false);
|
|
639
|
-
const durationInFrames = (_h = (_g = calculated === null || calculated === void 0 ? void 0 : calculated.durationInFrames) !== null && _g !== void 0 ? _g : composition.durationInFrames) !== null && _h !== void 0 ? _h : null;
|
|
640
|
-
validateDurationInFrames(durationInFrames, {
|
|
641
|
-
allowFloats: false,
|
|
642
|
-
component: `of the "<Composition />" component with the id "${composition.id}"`,
|
|
643
|
-
});
|
|
644
|
-
return { width, height, fps, durationInFrames };
|
|
645
|
-
};
|
|
646
646
|
|
|
647
647
|
const ResolveCompositionContext = createContext(null);
|
|
648
648
|
const resolveCompositionsRef = createRef();
|
|
649
|
+
const needsResolution = (composition) => {
|
|
650
|
+
return Boolean(composition.calculateMetadata);
|
|
651
|
+
};
|
|
649
652
|
const ResolveCompositionConfig = ({ children }) => {
|
|
650
653
|
const [currentRenderModalComposition, setCurrentRenderModalComposition] = useState(null);
|
|
651
654
|
const { compositions, canvasContent, currentCompositionMetadata } = useContext(CompositionManager);
|
|
@@ -784,9 +787,6 @@ const ResolveCompositionConfig = ({ children }) => {
|
|
|
784
787
|
}, [compositions, resolvedConfigs]);
|
|
785
788
|
return (jsx(ResolveCompositionContext.Provider, { value: resolvedConfigsIncludingStaticOnes, children: children }));
|
|
786
789
|
};
|
|
787
|
-
const needsResolution = (composition) => {
|
|
788
|
-
return Boolean(composition.calculateMetadata);
|
|
789
|
-
};
|
|
790
790
|
const useResolvedVideoConfig = (preferredCompositionId) => {
|
|
791
791
|
const context = useContext(ResolveCompositionContext);
|
|
792
792
|
const { props: allEditorProps } = useContext(EditorPropsContext);
|
|
@@ -1765,33 +1765,6 @@ const getMediaTime = ({ fps, frame, src, playbackRate, startFrom, mediaType, })
|
|
|
1765
1765
|
const toSeconds = (time, fps) => {
|
|
1766
1766
|
return Math.round((time / fps) * 100) / 100;
|
|
1767
1767
|
};
|
|
1768
|
-
const isSubsetOfDuration = (prevStartFrom, newStartFrom, prevDuration, newDuration) => {
|
|
1769
|
-
return (prevStartFrom <= newStartFrom &&
|
|
1770
|
-
prevStartFrom + prevDuration >= newStartFrom + newDuration);
|
|
1771
|
-
};
|
|
1772
|
-
const useAppendVideoFragment = ({ actualSrc: initialActualSrc, actualFrom: initialActualFrom, duration: initialDuration, fps, }) => {
|
|
1773
|
-
const actualFromRef = useRef(initialActualFrom);
|
|
1774
|
-
const actualDuration = useRef(initialDuration);
|
|
1775
|
-
const actualSrc = useRef(initialActualSrc);
|
|
1776
|
-
if (!isSubsetOfDuration || initialActualSrc !== actualSrc.current) {
|
|
1777
|
-
actualFromRef.current = initialActualFrom;
|
|
1778
|
-
actualDuration.current = initialDuration;
|
|
1779
|
-
actualSrc.current = initialActualSrc;
|
|
1780
|
-
}
|
|
1781
|
-
const appended = appendVideoFragment({
|
|
1782
|
-
actualSrc: actualSrc.current,
|
|
1783
|
-
actualFrom: actualFromRef.current,
|
|
1784
|
-
duration: actualDuration.current,
|
|
1785
|
-
fps,
|
|
1786
|
-
});
|
|
1787
|
-
return appended;
|
|
1788
|
-
};
|
|
1789
|
-
const isIosSafari = () => {
|
|
1790
|
-
return typeof window === 'undefined'
|
|
1791
|
-
? false
|
|
1792
|
-
: /iP(ad|od|hone)/i.test(window.navigator.userAgent) &&
|
|
1793
|
-
Boolean(navigator.userAgent.match(/Version\/[\d.]+.*Safari/));
|
|
1794
|
-
};
|
|
1795
1768
|
// https://github.com/remotion-dev/remotion/issues/1655
|
|
1796
1769
|
const isIOSSafariCase = (actualSrc) => {
|
|
1797
1770
|
return typeof window === 'undefined'
|
|
@@ -1822,6 +1795,33 @@ const appendVideoFragment = ({ actualSrc, actualFrom, duration, fps, }) => {
|
|
|
1822
1795
|
actualSrc += `,${toSeconds(duration, fps)}`;
|
|
1823
1796
|
return actualSrc;
|
|
1824
1797
|
};
|
|
1798
|
+
const isSubsetOfDuration = (prevStartFrom, newStartFrom, prevDuration, newDuration) => {
|
|
1799
|
+
return (prevStartFrom <= newStartFrom &&
|
|
1800
|
+
prevStartFrom + prevDuration >= newStartFrom + newDuration);
|
|
1801
|
+
};
|
|
1802
|
+
const useAppendVideoFragment = ({ actualSrc: initialActualSrc, actualFrom: initialActualFrom, duration: initialDuration, fps, }) => {
|
|
1803
|
+
const actualFromRef = useRef(initialActualFrom);
|
|
1804
|
+
const actualDuration = useRef(initialDuration);
|
|
1805
|
+
const actualSrc = useRef(initialActualSrc);
|
|
1806
|
+
if (!isSubsetOfDuration || initialActualSrc !== actualSrc.current) {
|
|
1807
|
+
actualFromRef.current = initialActualFrom;
|
|
1808
|
+
actualDuration.current = initialDuration;
|
|
1809
|
+
actualSrc.current = initialActualSrc;
|
|
1810
|
+
}
|
|
1811
|
+
const appended = appendVideoFragment({
|
|
1812
|
+
actualSrc: actualSrc.current,
|
|
1813
|
+
actualFrom: actualFromRef.current,
|
|
1814
|
+
duration: actualDuration.current,
|
|
1815
|
+
fps,
|
|
1816
|
+
});
|
|
1817
|
+
return appended;
|
|
1818
|
+
};
|
|
1819
|
+
const isIosSafari = () => {
|
|
1820
|
+
return typeof window === 'undefined'
|
|
1821
|
+
? false
|
|
1822
|
+
: /iP(ad|od|hone)/i.test(window.navigator.userAgent) &&
|
|
1823
|
+
Boolean(navigator.userAgent.match(/Version\/[\d.]+.*Safari/));
|
|
1824
|
+
};
|
|
1825
1825
|
|
|
1826
1826
|
const alreadyWarned = {};
|
|
1827
1827
|
const warnAboutNonSeekableMedia = (ref, type) => {
|
|
@@ -2453,7 +2453,7 @@ const AudioForRenderingRefForwardingFunction = (props, ref) => {
|
|
|
2453
2453
|
var _a;
|
|
2454
2454
|
return `audio-${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}`;
|
|
2455
2455
|
}, [props.src, sequenceContext]);
|
|
2456
|
-
const { volume: volumeProp, playbackRate, allowAmplificationDuringRender, onDuration, _remotionInternalNeedsDurationCalculation, acceptableTimeShiftInSeconds, ...nativeProps } = props;
|
|
2456
|
+
const { volume: volumeProp, playbackRate, allowAmplificationDuringRender, onDuration, toneFrequency, _remotionInternalNeedsDurationCalculation, acceptableTimeShiftInSeconds, ...nativeProps } = props;
|
|
2457
2457
|
const volume = evaluateVolume({
|
|
2458
2458
|
volume: volumeProp,
|
|
2459
2459
|
frame: volumePropFrame,
|
|
@@ -2486,6 +2486,7 @@ const AudioForRenderingRefForwardingFunction = (props, ref) => {
|
|
|
2486
2486
|
mediaFrame: frame,
|
|
2487
2487
|
playbackRate: (_a = props.playbackRate) !== null && _a !== void 0 ? _a : 1,
|
|
2488
2488
|
allowAmplificationDuringRender: allowAmplificationDuringRender !== null && allowAmplificationDuringRender !== void 0 ? allowAmplificationDuringRender : false,
|
|
2489
|
+
toneFrequency: toneFrequency !== null && toneFrequency !== void 0 ? toneFrequency : null,
|
|
2489
2490
|
});
|
|
2490
2491
|
return () => unregisterRenderAsset(id);
|
|
2491
2492
|
}, [
|
|
@@ -2501,6 +2502,7 @@ const AudioForRenderingRefForwardingFunction = (props, ref) => {
|
|
|
2501
2502
|
playbackRate,
|
|
2502
2503
|
props.playbackRate,
|
|
2503
2504
|
allowAmplificationDuringRender,
|
|
2505
|
+
toneFrequency,
|
|
2504
2506
|
]);
|
|
2505
2507
|
const { src } = props;
|
|
2506
2508
|
// The <audio> tag is only rendered if the duration needs to be calculated for the `loop`
|
|
@@ -2595,6 +2597,8 @@ const AudioRefForwardingFunction = (props, ref) => {
|
|
|
2595
2597
|
*/
|
|
2596
2598
|
const Audio = forwardRef(AudioRefForwardingFunction);
|
|
2597
2599
|
|
|
2600
|
+
const getRegex$1 = () => /^([a-zA-Z0-9-])+$/g;
|
|
2601
|
+
const isFolderNameValid = (name) => name.match(getRegex$1());
|
|
2598
2602
|
const validateFolderName = (name) => {
|
|
2599
2603
|
if (name === undefined || name === null) {
|
|
2600
2604
|
throw new TypeError('You must pass a name to a <Folder />.');
|
|
@@ -2606,8 +2610,6 @@ const validateFolderName = (name) => {
|
|
|
2606
2610
|
throw new Error(`Folder name can only contain a-z, A-Z, 0-9 and -. You passed ${name}`);
|
|
2607
2611
|
}
|
|
2608
2612
|
};
|
|
2609
|
-
const getRegex$1 = () => /^([a-zA-Z0-9-])+$/g;
|
|
2610
|
-
const isFolderNameValid = (name) => name.match(getRegex$1());
|
|
2611
2613
|
|
|
2612
2614
|
const FolderContext = createContext({
|
|
2613
2615
|
folderName: null,
|
|
@@ -2710,13 +2712,13 @@ const useLazyComponent = (compProps) => {
|
|
|
2710
2712
|
return lazy;
|
|
2711
2713
|
};
|
|
2712
2714
|
|
|
2715
|
+
const getRegex = () => /^([a-zA-Z0-9-])+$/g;
|
|
2716
|
+
const isCompositionIdValid = (id) => id.match(getRegex());
|
|
2713
2717
|
const validateCompositionId = (id) => {
|
|
2714
2718
|
if (!isCompositionIdValid(id)) {
|
|
2715
2719
|
throw new Error(`Composition id can only contain a-z, A-Z, 0-9 and -. You passed ${id}`);
|
|
2716
2720
|
}
|
|
2717
2721
|
};
|
|
2718
|
-
const getRegex = () => /^([a-zA-Z0-9-])+$/g;
|
|
2719
|
-
const isCompositionIdValid = (id) => id.match(getRegex());
|
|
2720
2722
|
const invalidCompositionErrorMessage = `Composition ID must match ${String(getRegex())}`;
|
|
2721
2723
|
|
|
2722
2724
|
const validateDefaultAndInputProps = (defaultProps, name, compositionId) => {
|
|
@@ -2731,6 +2733,20 @@ const validateDefaultAndInputProps = (defaultProps, name, compositionId) => {
|
|
|
2731
2733
|
}
|
|
2732
2734
|
};
|
|
2733
2735
|
|
|
2736
|
+
const ClipComposition = ({ children }) => {
|
|
2737
|
+
const { clipRegion } = useContext(NativeLayersContext);
|
|
2738
|
+
const style = useMemo(() => {
|
|
2739
|
+
return {
|
|
2740
|
+
display: 'flex',
|
|
2741
|
+
flexDirection: 'row',
|
|
2742
|
+
opacity: clipRegion === 'hide' ? 0 : 1,
|
|
2743
|
+
clipPath: clipRegion && clipRegion !== 'hide'
|
|
2744
|
+
? `polygon(${clipRegion.x}px ${clipRegion.y}px, ${clipRegion.x}px ${clipRegion.height + clipRegion.y}px, ${clipRegion.width + clipRegion.x}px ${clipRegion.height + clipRegion.y}px, ${clipRegion.width + clipRegion.x}px ${clipRegion.y}px)`
|
|
2745
|
+
: undefined,
|
|
2746
|
+
};
|
|
2747
|
+
}, [clipRegion]);
|
|
2748
|
+
return jsx(AbsoluteFill, { style: style, children: children });
|
|
2749
|
+
};
|
|
2734
2750
|
const Fallback = () => {
|
|
2735
2751
|
useEffect(() => {
|
|
2736
2752
|
const fallback = delayRender('Waiting for Root component to unsuspend');
|
|
@@ -2816,20 +2832,6 @@ const Composition = ({ width, height, fps, durationInFrames, id, defaultProps, s
|
|
|
2816
2832
|
}
|
|
2817
2833
|
return null;
|
|
2818
2834
|
};
|
|
2819
|
-
const ClipComposition = ({ children }) => {
|
|
2820
|
-
const { clipRegion } = useContext(NativeLayersContext);
|
|
2821
|
-
const style = useMemo(() => {
|
|
2822
|
-
return {
|
|
2823
|
-
display: 'flex',
|
|
2824
|
-
flexDirection: 'row',
|
|
2825
|
-
opacity: clipRegion === 'hide' ? 0 : 1,
|
|
2826
|
-
clipPath: clipRegion && clipRegion !== 'hide'
|
|
2827
|
-
? `polygon(${clipRegion.x}px ${clipRegion.y}px, ${clipRegion.x}px ${clipRegion.height + clipRegion.y}px, ${clipRegion.width + clipRegion.x}px ${clipRegion.height + clipRegion.y}px, ${clipRegion.width + clipRegion.x}px ${clipRegion.y}px)`
|
|
2828
|
-
: undefined,
|
|
2829
|
-
};
|
|
2830
|
-
}, [clipRegion]);
|
|
2831
|
-
return jsx(AbsoluteFill, { style: style, children: children });
|
|
2832
|
-
};
|
|
2833
2835
|
|
|
2834
2836
|
// Taken from https://github.com/facebook/react-native/blob/0b9ea60b4fee8cacc36e7160e31b91fc114dbc0d/Libraries/Animated/src/bezier.js
|
|
2835
2837
|
const NEWTON_ITERATIONS = 4;
|
|
@@ -3924,12 +3926,11 @@ const RemotionContextProvider = (props) => {
|
|
|
3924
3926
|
return (jsx(CanUseRemotionHooks.Provider, { value: contexts.canUseRemotionHooksContext, children: jsx(NonceContext.Provider, { value: contexts.nonceContext, children: jsx(NativeLayersContext.Provider, { value: contexts.nativeLayersContext, children: jsx(PreloadContext.Provider, { value: contexts.preloadContext, children: jsx(CompositionManager.Provider, { value: contexts.compositionManagerCtx, children: jsx(SequenceManager.Provider, { value: contexts.sequenceManagerContext, children: jsx(RenderAssetManager.Provider, { value: contexts.renderAssetManagerContext, children: jsx(ResolveCompositionContext.Provider, { value: contexts.resolveCompositionContext, children: jsx(TimelineContext.Provider, { value: contexts.timelineContext, children: jsx(SetTimelineContext.Provider, { value: contexts.setTimelineContext, children: jsx(SequenceContext.Provider, { value: contexts.sequenceContext, children: children }) }) }) }) }) }) }) }) }) }) }));
|
|
3925
3927
|
};
|
|
3926
3928
|
|
|
3927
|
-
const Timeline = TimelinePosition;
|
|
3928
3929
|
// Mark them as Internals so use don't assume this is public
|
|
3929
3930
|
// API and are less likely to use it
|
|
3930
3931
|
const Internals = {
|
|
3931
3932
|
useUnsafeVideoConfig,
|
|
3932
|
-
Timeline,
|
|
3933
|
+
Timeline: TimelinePosition,
|
|
3933
3934
|
CompositionManager,
|
|
3934
3935
|
SequenceManager,
|
|
3935
3936
|
RemotionRoot,
|
|
@@ -4323,7 +4324,7 @@ const Still = (props) => {
|
|
|
4323
4324
|
return React.createElement((Composition), newProps);
|
|
4324
4325
|
};
|
|
4325
4326
|
|
|
4326
|
-
const OffthreadVideoForRendering = ({ onError, volume: volumeProp, playbackRate, src, muted, allowAmplificationDuringRender, transparent = false, ...props }) => {
|
|
4327
|
+
const OffthreadVideoForRendering = ({ onError, volume: volumeProp, playbackRate, src, muted, allowAmplificationDuringRender, transparent = false, toneFrequency, ...props }) => {
|
|
4327
4328
|
const absoluteFrame = useTimelinePosition();
|
|
4328
4329
|
const frame = useCurrentFrame();
|
|
4329
4330
|
const volumePropsFrame = useFrameForVolumeProp();
|
|
@@ -4373,6 +4374,7 @@ const OffthreadVideoForRendering = ({ onError, volume: volumeProp, playbackRate,
|
|
|
4373
4374
|
mediaFrame: frame,
|
|
4374
4375
|
playbackRate: playbackRate !== null && playbackRate !== void 0 ? playbackRate : 1,
|
|
4375
4376
|
allowAmplificationDuringRender: allowAmplificationDuringRender !== null && allowAmplificationDuringRender !== void 0 ? allowAmplificationDuringRender : false,
|
|
4377
|
+
toneFrequency: toneFrequency !== null && toneFrequency !== void 0 ? toneFrequency : null,
|
|
4376
4378
|
});
|
|
4377
4379
|
return () => unregisterRenderAsset(id);
|
|
4378
4380
|
}, [
|
|
@@ -4386,6 +4388,7 @@ const OffthreadVideoForRendering = ({ onError, volume: volumeProp, playbackRate,
|
|
|
4386
4388
|
absoluteFrame,
|
|
4387
4389
|
playbackRate,
|
|
4388
4390
|
allowAmplificationDuringRender,
|
|
4391
|
+
toneFrequency,
|
|
4389
4392
|
]);
|
|
4390
4393
|
const currentTime = useMemo(() => {
|
|
4391
4394
|
return (getExpectedMediaFrameUncorrected({
|
|
@@ -4421,7 +4424,7 @@ const VideoForDevelopmentRefForwardingFunction = (props, ref) => {
|
|
|
4421
4424
|
const parentSequence = useContext(SequenceContext);
|
|
4422
4425
|
const { volume, muted, playbackRate, onlyWarnForMediaSeekingError, src, onDuration,
|
|
4423
4426
|
// @ts-expect-error
|
|
4424
|
-
acceptableTimeShift, acceptableTimeShiftInSeconds, ...nativeProps } = props;
|
|
4427
|
+
acceptableTimeShift, acceptableTimeShiftInSeconds, toneFrequency, ...nativeProps } = props;
|
|
4425
4428
|
if (typeof acceptableTimeShift !== 'undefined') {
|
|
4426
4429
|
throw new Error('acceptableTimeShift has been removed. Use acceptableTimeShiftInSeconds instead.');
|
|
4427
4430
|
}
|
|
@@ -4550,7 +4553,7 @@ const OffthreadVideo = (props) => {
|
|
|
4550
4553
|
return (jsx(VideoForDevelopment, { onDuration: onDuration, onlyWarnForMediaSeekingError: true, ...withoutTransparent }));
|
|
4551
4554
|
};
|
|
4552
4555
|
|
|
4553
|
-
const VideoForRenderingForwardFunction = ({ onError, volume: volumeProp, allowAmplificationDuringRender, playbackRate, onDuration, ...props }, ref) => {
|
|
4556
|
+
const VideoForRenderingForwardFunction = ({ onError, volume: volumeProp, allowAmplificationDuringRender, playbackRate, onDuration, toneFrequency, ...props }, ref) => {
|
|
4554
4557
|
const absoluteFrame = useTimelinePosition();
|
|
4555
4558
|
const frame = useCurrentFrame();
|
|
4556
4559
|
const volumePropsFrame = useFrameForVolumeProp();
|
|
@@ -4602,6 +4605,7 @@ const VideoForRenderingForwardFunction = ({ onError, volume: volumeProp, allowAm
|
|
|
4602
4605
|
mediaFrame: frame,
|
|
4603
4606
|
playbackRate: playbackRate !== null && playbackRate !== void 0 ? playbackRate : 1,
|
|
4604
4607
|
allowAmplificationDuringRender: allowAmplificationDuringRender !== null && allowAmplificationDuringRender !== void 0 ? allowAmplificationDuringRender : false,
|
|
4608
|
+
toneFrequency: toneFrequency !== null && toneFrequency !== void 0 ? toneFrequency : null,
|
|
4605
4609
|
});
|
|
4606
4610
|
return () => unregisterRenderAsset(id);
|
|
4607
4611
|
}, [
|
|
@@ -4615,6 +4619,7 @@ const VideoForRenderingForwardFunction = ({ onError, volume: volumeProp, allowAm
|
|
|
4615
4619
|
absoluteFrame,
|
|
4616
4620
|
playbackRate,
|
|
4617
4621
|
allowAmplificationDuringRender,
|
|
4622
|
+
toneFrequency,
|
|
4618
4623
|
]);
|
|
4619
4624
|
useImperativeHandle(ref, () => {
|
|
4620
4625
|
return videoRef.current;
|
package/dist/esm/version.mjs
CHANGED