remotion 4.0.46 → 4.0.48
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/LICENSE.md +1 -1
- package/dist/cjs/Composition.d.ts +1 -1
- package/dist/cjs/Composition.js +16 -16
- package/dist/cjs/CompositionManager.d.ts +1 -0
- package/dist/cjs/ResolveCompositionConfig.d.ts +1 -1
- package/dist/cjs/ResolveCompositionConfig.js +5 -5
- package/dist/cjs/audio/Audio.d.ts +2 -1
- package/dist/cjs/audio/Audio.js +1 -0
- package/dist/cjs/audio/AudioForDevelopment.d.ts +1 -0
- package/dist/cjs/audio/AudioForRendering.d.ts +1 -0
- package/dist/cjs/audio/AudioForRendering.js +3 -1
- package/dist/cjs/audio/props.d.ts +1 -0
- package/dist/cjs/internals.d.ts +1 -2
- package/dist/cjs/internals.js +1 -2
- package/dist/cjs/resolve-video-config.js +17 -17
- package/dist/cjs/validation/validate-composition-id.d.ts +1 -1
- package/dist/cjs/validation/validate-composition-id.js +4 -4
- package/dist/cjs/validation/validate-folder-name.d.ts +1 -1
- package/dist/cjs/validation/validate-folder-name.js +4 -4
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/video/OffthreadVideoForRendering.js +3 -1
- package/dist/cjs/video/Video.d.ts +1 -0
- package/dist/cjs/video/Video.js +1 -0
- package/dist/cjs/video/VideoForDevelopment.d.ts +1 -0
- package/dist/cjs/video/VideoForDevelopment.js +1 -1
- package/dist/cjs/video/VideoForRendering.d.ts +1 -0
- package/dist/cjs/video/VideoForRendering.js +3 -1
- package/dist/cjs/video/props.d.ts +2 -0
- package/dist/cjs/video/video-fragment.d.ts +3 -3
- package/dist/cjs/video/video-fragment.js +30 -30
- package/dist/esm/index.mjs +77 -72
- package/dist/esm/version.mjs +1 -1
- package/package.json +2 -2
package/LICENSE.md
CHANGED
|
@@ -38,4 +38,4 @@ Support is provided on a best-we-can-do basis via GitHub Issues and Discord.
|
|
|
38
38
|
|
|
39
39
|
You are required to obtain a company license to use Remotion if you are not within the group of entities eligible for a free license. This license will enable you to use Remotion for the allowed use cases specified in the free license, and give you access to prioritized support (read the [Support Policy](/docs/support)).
|
|
40
40
|
|
|
41
|
-
Visit [
|
|
41
|
+
Visit [remotion.pro](https://www.remotion.pro) for pricing and to buy a license.
|
|
@@ -44,6 +44,7 @@ export type StillProps<Schema extends AnyZodObject, Props extends Record<string,
|
|
|
44
44
|
id: string;
|
|
45
45
|
schema?: Schema;
|
|
46
46
|
} & StillCalculateMetadataOrExplicit<Schema, Props> & CompProps<Props> & PropsIfHasProps<Schema, Props>;
|
|
47
|
+
export declare const ClipComposition: React.FC<PropsWithChildren>;
|
|
47
48
|
export type CompositionProps<Schema extends AnyZodObject, Props extends Record<string, unknown>> = {
|
|
48
49
|
id: string;
|
|
49
50
|
schema?: Schema;
|
|
@@ -53,5 +54,4 @@ export type CompositionProps<Schema extends AnyZodObject, Props extends Record<s
|
|
|
53
54
|
* @see [Documentation](https://www.remotion.dev/docs/composition)
|
|
54
55
|
*/
|
|
55
56
|
export declare const Composition: <Schema extends AnyZodObject, Props extends Record<string, unknown>>({ width, height, fps, durationInFrames, id, defaultProps, schema, ...compProps }: CompositionProps<Schema, Props>) => React.ReactPortal | null;
|
|
56
|
-
export declare const ClipComposition: React.FC<PropsWithChildren>;
|
|
57
57
|
export {};
|
package/dist/cjs/Composition.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.Composition = exports.ClipComposition = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const react_dom_1 = require("react-dom");
|
|
@@ -20,6 +20,21 @@ const use_lazy_component_js_1 = require("./use-lazy-component.js");
|
|
|
20
20
|
const use_video_js_1 = require("./use-video.js");
|
|
21
21
|
const validate_composition_id_js_1 = require("./validation/validate-composition-id.js");
|
|
22
22
|
const validate_default_props_js_1 = require("./validation/validate-default-props.js");
|
|
23
|
+
const ClipComposition = ({ children }) => {
|
|
24
|
+
const { clipRegion } = (0, react_1.useContext)(NativeLayers_js_1.NativeLayersContext);
|
|
25
|
+
const style = (0, react_1.useMemo)(() => {
|
|
26
|
+
return {
|
|
27
|
+
display: 'flex',
|
|
28
|
+
flexDirection: 'row',
|
|
29
|
+
opacity: clipRegion === 'hide' ? 0 : 1,
|
|
30
|
+
clipPath: clipRegion && clipRegion !== 'hide'
|
|
31
|
+
? `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)`
|
|
32
|
+
: undefined,
|
|
33
|
+
};
|
|
34
|
+
}, [clipRegion]);
|
|
35
|
+
return (0, jsx_runtime_1.jsx)(AbsoluteFill_js_1.AbsoluteFill, { style: style, children: children });
|
|
36
|
+
};
|
|
37
|
+
exports.ClipComposition = ClipComposition;
|
|
23
38
|
const Fallback = () => {
|
|
24
39
|
(0, react_1.useEffect)(() => {
|
|
25
40
|
const fallback = (0, delay_render_js_1.delayRender)('Waiting for Root component to unsuspend');
|
|
@@ -106,18 +121,3 @@ const Composition = ({ width, height, fps, durationInFrames, id, defaultProps, s
|
|
|
106
121
|
return null;
|
|
107
122
|
};
|
|
108
123
|
exports.Composition = Composition;
|
|
109
|
-
const ClipComposition = ({ children }) => {
|
|
110
|
-
const { clipRegion } = (0, react_1.useContext)(NativeLayers_js_1.NativeLayersContext);
|
|
111
|
-
const style = (0, react_1.useMemo)(() => {
|
|
112
|
-
return {
|
|
113
|
-
display: 'flex',
|
|
114
|
-
flexDirection: 'row',
|
|
115
|
-
opacity: clipRegion === 'hide' ? 0 : 1,
|
|
116
|
-
clipPath: clipRegion && clipRegion !== 'hide'
|
|
117
|
-
? `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)`
|
|
118
|
-
: undefined,
|
|
119
|
-
};
|
|
120
|
-
}, [clipRegion]);
|
|
121
|
-
return (0, jsx_runtime_1.jsx)(AbsoluteFill_js_1.AbsoluteFill, { style: style, children: children });
|
|
122
|
-
};
|
|
123
|
-
exports.ClipComposition = ClipComposition;
|
|
@@ -63,6 +63,7 @@ export type TRenderAsset = {
|
|
|
63
63
|
mediaFrame: number;
|
|
64
64
|
playbackRate: number;
|
|
65
65
|
allowAmplificationDuringRender: boolean;
|
|
66
|
+
toneFrequency: number | null;
|
|
66
67
|
};
|
|
67
68
|
export declare const compositionsRef: React.RefObject<{
|
|
68
69
|
getCompositions: () => TCompMetadataWithCalcFunction<AnyZodObject, Record<string, unknown>>[];
|
|
@@ -16,9 +16,9 @@ type VideoConfigState = {
|
|
|
16
16
|
type: 'error';
|
|
17
17
|
error: Error;
|
|
18
18
|
};
|
|
19
|
+
export declare const needsResolution: (composition: AnyComposition) => boolean;
|
|
19
20
|
export declare const ResolveCompositionConfig: React.FC<PropsWithChildren<{
|
|
20
21
|
children: React.ReactNode;
|
|
21
22
|
}>>;
|
|
22
|
-
export declare const needsResolution: (composition: AnyComposition) => boolean;
|
|
23
23
|
export declare const useResolvedVideoConfig: (preferredCompositionId: string | null) => VideoConfigState | null;
|
|
24
24
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useResolvedVideoConfig = exports.
|
|
3
|
+
exports.useResolvedVideoConfig = exports.ResolveCompositionConfig = exports.needsResolution = exports.resolveCompositionsRef = exports.ResolveCompositionContext = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const CompositionManagerContext_js_1 = require("./CompositionManagerContext.js");
|
|
@@ -10,6 +10,10 @@ 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
11
|
exports.ResolveCompositionContext = (0, react_1.createContext)(null);
|
|
12
12
|
exports.resolveCompositionsRef = (0, react_1.createRef)();
|
|
13
|
+
const needsResolution = (composition) => {
|
|
14
|
+
return Boolean(composition.calculateMetadata);
|
|
15
|
+
};
|
|
16
|
+
exports.needsResolution = needsResolution;
|
|
13
17
|
const ResolveCompositionConfig = ({ children }) => {
|
|
14
18
|
const [currentRenderModalComposition, setCurrentRenderModalComposition] = (0, react_1.useState)(null);
|
|
15
19
|
const { compositions, canvasContent, currentCompositionMetadata } = (0, react_1.useContext)(CompositionManagerContext_js_1.CompositionManager);
|
|
@@ -149,10 +153,6 @@ const ResolveCompositionConfig = ({ children }) => {
|
|
|
149
153
|
return ((0, jsx_runtime_1.jsx)(exports.ResolveCompositionContext.Provider, { value: resolvedConfigsIncludingStaticOnes, children: children }));
|
|
150
154
|
};
|
|
151
155
|
exports.ResolveCompositionConfig = ResolveCompositionConfig;
|
|
152
|
-
const needsResolution = (composition) => {
|
|
153
|
-
return Boolean(composition.calculateMetadata);
|
|
154
|
-
};
|
|
155
|
-
exports.needsResolution = needsResolution;
|
|
156
156
|
const useResolvedVideoConfig = (preferredCompositionId) => {
|
|
157
157
|
const context = (0, react_1.useContext)(exports.ResolveCompositionContext);
|
|
158
158
|
const { props: allEditorProps } = (0, react_1.useContext)(EditorProps_js_1.EditorPropsContext);
|
|
@@ -10,4 +10,5 @@ export declare const Audio: React.ForwardRefExoticComponent<Pick<Omit<React.Deta
|
|
|
10
10
|
acceptableTimeShiftInSeconds?: number | undefined;
|
|
11
11
|
allowAmplificationDuringRender?: boolean | undefined;
|
|
12
12
|
_remotionInternalNeedsDurationCalculation?: boolean | undefined;
|
|
13
|
-
|
|
13
|
+
toneFrequency?: number | undefined;
|
|
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/audio/Audio.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Audio = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
/* eslint-disable @typescript-eslint/no-use-before-define */
|
|
5
6
|
const react_1 = require("react");
|
|
6
7
|
const absolute_src_js_1 = require("../absolute-src.js");
|
|
7
8
|
const calculate_loop_js_1 = require("../calculate-loop.js");
|
|
@@ -6,6 +6,7 @@ export declare const AudioForDevelopment: ForwardRefExoticComponent<Omit<React.D
|
|
|
6
6
|
acceptableTimeShiftInSeconds?: number | undefined;
|
|
7
7
|
allowAmplificationDuringRender?: boolean | undefined;
|
|
8
8
|
_remotionInternalNeedsDurationCalculation?: boolean | undefined;
|
|
9
|
+
toneFrequency?: number | undefined;
|
|
9
10
|
} & {
|
|
10
11
|
shouldPreMountAudioTags: boolean;
|
|
11
12
|
onDuration: (src: string, durationInSeconds: number) => void;
|
|
@@ -6,6 +6,7 @@ export declare const AudioForRendering: ForwardRefExoticComponent<Omit<React.Det
|
|
|
6
6
|
acceptableTimeShiftInSeconds?: number | undefined;
|
|
7
7
|
allowAmplificationDuringRender?: boolean | undefined;
|
|
8
8
|
_remotionInternalNeedsDurationCalculation?: boolean | undefined;
|
|
9
|
+
toneFrequency?: number | undefined;
|
|
9
10
|
} & {
|
|
10
11
|
onDuration: (src: string, durationInSeconds: number) => void;
|
|
11
12
|
} & RefAttributes<HTMLAudioElement>>;
|
|
@@ -25,7 +25,7 @@ const AudioForRenderingRefForwardingFunction = (props, ref) => {
|
|
|
25
25
|
var _a;
|
|
26
26
|
return `audio-${(0, random_js_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}`;
|
|
27
27
|
}, [props.src, sequenceContext]);
|
|
28
|
-
const { volume: volumeProp, playbackRate, allowAmplificationDuringRender, onDuration, _remotionInternalNeedsDurationCalculation, acceptableTimeShiftInSeconds, ...nativeProps } = props;
|
|
28
|
+
const { volume: volumeProp, playbackRate, allowAmplificationDuringRender, onDuration, toneFrequency, _remotionInternalNeedsDurationCalculation, acceptableTimeShiftInSeconds, ...nativeProps } = props;
|
|
29
29
|
const volume = (0, volume_prop_js_1.evaluateVolume)({
|
|
30
30
|
volume: volumeProp,
|
|
31
31
|
frame: volumePropFrame,
|
|
@@ -58,6 +58,7 @@ const AudioForRenderingRefForwardingFunction = (props, ref) => {
|
|
|
58
58
|
mediaFrame: frame,
|
|
59
59
|
playbackRate: (_a = props.playbackRate) !== null && _a !== void 0 ? _a : 1,
|
|
60
60
|
allowAmplificationDuringRender: allowAmplificationDuringRender !== null && allowAmplificationDuringRender !== void 0 ? allowAmplificationDuringRender : false,
|
|
61
|
+
toneFrequency: toneFrequency !== null && toneFrequency !== void 0 ? toneFrequency : null,
|
|
61
62
|
});
|
|
62
63
|
return () => unregisterRenderAsset(id);
|
|
63
64
|
}, [
|
|
@@ -73,6 +74,7 @@ const AudioForRenderingRefForwardingFunction = (props, ref) => {
|
|
|
73
74
|
playbackRate,
|
|
74
75
|
props.playbackRate,
|
|
75
76
|
allowAmplificationDuringRender,
|
|
77
|
+
toneFrequency,
|
|
76
78
|
]);
|
|
77
79
|
const { src } = props;
|
|
78
80
|
// The <audio> tag is only rendered if the duration needs to be calculated for the `loop`
|
package/dist/cjs/internals.d.ts
CHANGED
|
@@ -14,7 +14,6 @@ import { validateDurationInFrames } from './validation/validate-duration-in-fram
|
|
|
14
14
|
import { validateFps } from './validation/validate-fps.js';
|
|
15
15
|
import type { MediaVolumeContextValue, SetMediaVolumeContextValue } from './volume-position-state.js';
|
|
16
16
|
import { useRemotionContexts } from './wrap-remotion-context.js';
|
|
17
|
-
declare const Timeline: typeof TimelinePosition;
|
|
18
17
|
export declare const Internals: {
|
|
19
18
|
readonly useUnsafeVideoConfig: () => import("./video-config.js").VideoConfig | null;
|
|
20
19
|
readonly Timeline: typeof TimelinePosition;
|
|
@@ -146,4 +145,4 @@ export declare const Internals: {
|
|
|
146
145
|
}>;
|
|
147
146
|
readonly isIosSafari: () => boolean;
|
|
148
147
|
};
|
|
149
|
-
export type { TComposition, Timeline, TCompMetadata, TSequence, TRenderAsset as TAsset, TimelineContextValue, SetTimelineContextValue, CompProps, CompositionManagerContext, MediaVolumeContextValue, SetMediaVolumeContextValue, RemotionEnvironment, SerializedJSONWithCustomFields, };
|
|
148
|
+
export type { TComposition, TimelinePosition as Timeline, TCompMetadata, TSequence, TRenderAsset as TAsset, TimelineContextValue, SetTimelineContextValue, CompProps, CompositionManagerContext, MediaVolumeContextValue, SetMediaVolumeContextValue, RemotionEnvironment, SerializedJSONWithCustomFields, };
|
package/dist/cjs/internals.js
CHANGED
|
@@ -66,12 +66,11 @@ const duration_state_js_1 = require("./video/duration-state.js");
|
|
|
66
66
|
const video_fragment_js_1 = require("./video/video-fragment.js");
|
|
67
67
|
const volume_position_state_js_1 = require("./volume-position-state.js");
|
|
68
68
|
const wrap_remotion_context_js_1 = require("./wrap-remotion-context.js");
|
|
69
|
-
const Timeline = TimelinePosition;
|
|
70
69
|
// Mark them as Internals so use don't assume this is public
|
|
71
70
|
// API and are less likely to use it
|
|
72
71
|
exports.Internals = {
|
|
73
72
|
useUnsafeVideoConfig: use_unsafe_video_config_js_1.useUnsafeVideoConfig,
|
|
74
|
-
Timeline,
|
|
73
|
+
Timeline: TimelinePosition,
|
|
75
74
|
CompositionManager: CompositionManagerContext_js_1.CompositionManager,
|
|
76
75
|
SequenceManager: SequenceManager_js_1.SequenceManager,
|
|
77
76
|
RemotionRoot: RemotionRoot_js_1.RemotionRoot,
|
|
@@ -4,6 +4,23 @@ exports.resolveVideoConfig = void 0;
|
|
|
4
4
|
const validate_dimensions_js_1 = require("./validation/validate-dimensions.js");
|
|
5
5
|
const validate_duration_in_frames_js_1 = require("./validation/validate-duration-in-frames.js");
|
|
6
6
|
const validate_fps_js_1 = require("./validation/validate-fps.js");
|
|
7
|
+
const validateCalculated = ({ composition, calculated, }) => {
|
|
8
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
9
|
+
const calculateMetadataErrorLocation = `calculated by calculateMetadata() for the composition "${composition.id}"`;
|
|
10
|
+
const defaultErrorLocation = `of the "<Composition />" component with the id "${composition.id}"`;
|
|
11
|
+
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;
|
|
12
|
+
(0, validate_dimensions_js_1.validateDimension)(width, 'width', (calculated === null || calculated === void 0 ? void 0 : calculated.width) ? calculateMetadataErrorLocation : defaultErrorLocation);
|
|
13
|
+
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;
|
|
14
|
+
(0, validate_dimensions_js_1.validateDimension)(height, 'height', (calculated === null || calculated === void 0 ? void 0 : calculated.height) ? calculateMetadataErrorLocation : defaultErrorLocation);
|
|
15
|
+
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;
|
|
16
|
+
(0, validate_fps_js_1.validateFps)(fps, (calculated === null || calculated === void 0 ? void 0 : calculated.fps) ? calculateMetadataErrorLocation : defaultErrorLocation, false);
|
|
17
|
+
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;
|
|
18
|
+
(0, validate_duration_in_frames_js_1.validateDurationInFrames)(durationInFrames, {
|
|
19
|
+
allowFloats: false,
|
|
20
|
+
component: `of the "<Composition />" component with the id "${composition.id}"`,
|
|
21
|
+
});
|
|
22
|
+
return { width, height, fps, durationInFrames };
|
|
23
|
+
};
|
|
7
24
|
const resolveVideoConfig = ({ composition, editorProps: editorPropsOrUndefined, signal, inputProps, }) => {
|
|
8
25
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
9
26
|
const calculatedProm = composition.calculateMetadata
|
|
@@ -61,20 +78,3 @@ const resolveVideoConfig = ({ composition, editorProps: editorPropsOrUndefined,
|
|
|
61
78
|
};
|
|
62
79
|
};
|
|
63
80
|
exports.resolveVideoConfig = resolveVideoConfig;
|
|
64
|
-
const validateCalculated = ({ composition, calculated, }) => {
|
|
65
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
66
|
-
const calculateMetadataErrorLocation = `calculated by calculateMetadata() for the composition "${composition.id}"`;
|
|
67
|
-
const defaultErrorLocation = `of the "<Composition />" component with the id "${composition.id}"`;
|
|
68
|
-
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;
|
|
69
|
-
(0, validate_dimensions_js_1.validateDimension)(width, 'width', (calculated === null || calculated === void 0 ? void 0 : calculated.width) ? calculateMetadataErrorLocation : defaultErrorLocation);
|
|
70
|
-
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;
|
|
71
|
-
(0, validate_dimensions_js_1.validateDimension)(height, 'height', (calculated === null || calculated === void 0 ? void 0 : calculated.height) ? calculateMetadataErrorLocation : defaultErrorLocation);
|
|
72
|
-
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;
|
|
73
|
-
(0, validate_fps_js_1.validateFps)(fps, (calculated === null || calculated === void 0 ? void 0 : calculated.fps) ? calculateMetadataErrorLocation : defaultErrorLocation, false);
|
|
74
|
-
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;
|
|
75
|
-
(0, validate_duration_in_frames_js_1.validateDurationInFrames)(durationInFrames, {
|
|
76
|
-
allowFloats: false,
|
|
77
|
-
component: `of the "<Composition />" component with the id "${composition.id}"`,
|
|
78
|
-
});
|
|
79
|
-
return { width, height, fps, durationInFrames };
|
|
80
|
-
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare const validateCompositionId: (id: string) => void;
|
|
2
1
|
export declare const isCompositionIdValid: (id: string) => RegExpMatchArray | null;
|
|
2
|
+
export declare const validateCompositionId: (id: string) => void;
|
|
3
3
|
export declare const invalidCompositionErrorMessage: string;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.invalidCompositionErrorMessage = exports.
|
|
3
|
+
exports.invalidCompositionErrorMessage = exports.validateCompositionId = exports.isCompositionIdValid = void 0;
|
|
4
|
+
const getRegex = () => /^([a-zA-Z0-9-])+$/g;
|
|
5
|
+
const isCompositionIdValid = (id) => id.match(getRegex());
|
|
6
|
+
exports.isCompositionIdValid = isCompositionIdValid;
|
|
4
7
|
const validateCompositionId = (id) => {
|
|
5
8
|
if (!(0, exports.isCompositionIdValid)(id)) {
|
|
6
9
|
throw new Error(`Composition id can only contain a-z, A-Z, 0-9 and -. You passed ${id}`);
|
|
7
10
|
}
|
|
8
11
|
};
|
|
9
12
|
exports.validateCompositionId = validateCompositionId;
|
|
10
|
-
const getRegex = () => /^([a-zA-Z0-9-])+$/g;
|
|
11
|
-
const isCompositionIdValid = (id) => id.match(getRegex());
|
|
12
|
-
exports.isCompositionIdValid = isCompositionIdValid;
|
|
13
13
|
exports.invalidCompositionErrorMessage = `Composition ID must match ${String(getRegex())}`;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare const validateFolderName: (name: string | null) => void;
|
|
2
1
|
export declare const isFolderNameValid: (name: string) => RegExpMatchArray | null;
|
|
2
|
+
export declare const validateFolderName: (name: string | null) => void;
|
|
3
3
|
export declare const invalidFolderNameErrorMessage: string;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.invalidFolderNameErrorMessage = exports.
|
|
3
|
+
exports.invalidFolderNameErrorMessage = exports.validateFolderName = exports.isFolderNameValid = void 0;
|
|
4
|
+
const getRegex = () => /^([a-zA-Z0-9-])+$/g;
|
|
5
|
+
const isFolderNameValid = (name) => name.match(getRegex());
|
|
6
|
+
exports.isFolderNameValid = isFolderNameValid;
|
|
4
7
|
const validateFolderName = (name) => {
|
|
5
8
|
if (name === undefined || name === null) {
|
|
6
9
|
throw new TypeError('You must pass a name to a <Folder />.');
|
|
@@ -13,7 +16,4 @@ const validateFolderName = (name) => {
|
|
|
13
16
|
}
|
|
14
17
|
};
|
|
15
18
|
exports.validateFolderName = validateFolderName;
|
|
16
|
-
const getRegex = () => /^([a-zA-Z0-9-])+$/g;
|
|
17
|
-
const isFolderNameValid = (name) => name.match(getRegex());
|
|
18
|
-
exports.isFolderNameValid = isFolderNameValid;
|
|
19
19
|
exports.invalidFolderNameErrorMessage = `Folder name must match ${String(getRegex())}`;
|
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "4.0.
|
|
1
|
+
export declare const VERSION = "4.0.48";
|
package/dist/cjs/version.js
CHANGED
|
@@ -17,7 +17,7 @@ const use_current_frame_js_1 = require("../use-current-frame.js");
|
|
|
17
17
|
const use_unsafe_video_config_js_1 = require("../use-unsafe-video-config.js");
|
|
18
18
|
const volume_prop_js_1 = require("../volume-prop.js");
|
|
19
19
|
const get_current_time_js_1 = require("./get-current-time.js");
|
|
20
|
-
const OffthreadVideoForRendering = ({ onError, volume: volumeProp, playbackRate, src, muted, allowAmplificationDuringRender, transparent = false, ...props }) => {
|
|
20
|
+
const OffthreadVideoForRendering = ({ onError, volume: volumeProp, playbackRate, src, muted, allowAmplificationDuringRender, transparent = false, toneFrequency, ...props }) => {
|
|
21
21
|
const absoluteFrame = (0, timeline_position_state_js_1.useTimelinePosition)();
|
|
22
22
|
const frame = (0, use_current_frame_js_1.useCurrentFrame)();
|
|
23
23
|
const volumePropsFrame = (0, use_audio_frame_js_1.useFrameForVolumeProp)();
|
|
@@ -67,6 +67,7 @@ const OffthreadVideoForRendering = ({ onError, volume: volumeProp, playbackRate,
|
|
|
67
67
|
mediaFrame: frame,
|
|
68
68
|
playbackRate: playbackRate !== null && playbackRate !== void 0 ? playbackRate : 1,
|
|
69
69
|
allowAmplificationDuringRender: allowAmplificationDuringRender !== null && allowAmplificationDuringRender !== void 0 ? allowAmplificationDuringRender : false,
|
|
70
|
+
toneFrequency: toneFrequency !== null && toneFrequency !== void 0 ? toneFrequency : null,
|
|
70
71
|
});
|
|
71
72
|
return () => unregisterRenderAsset(id);
|
|
72
73
|
}, [
|
|
@@ -80,6 +81,7 @@ const OffthreadVideoForRendering = ({ onError, volume: volumeProp, playbackRate,
|
|
|
80
81
|
absoluteFrame,
|
|
81
82
|
playbackRate,
|
|
82
83
|
allowAmplificationDuringRender,
|
|
84
|
+
toneFrequency,
|
|
83
85
|
]);
|
|
84
86
|
const currentTime = (0, react_1.useMemo)(() => {
|
|
85
87
|
return ((0, get_current_time_js_1.getExpectedMediaFrameUncorrected)({
|
|
@@ -9,4 +9,5 @@ export declare const Video: (props: Omit<React.DetailedHTMLProps<React.VideoHTML
|
|
|
9
9
|
playbackRate?: number | undefined;
|
|
10
10
|
acceptableTimeShiftInSeconds?: number | undefined;
|
|
11
11
|
allowAmplificationDuringRender?: boolean | undefined;
|
|
12
|
+
toneFrequency?: number | undefined;
|
|
12
13
|
} & RemotionMainVideoProps & React.RefAttributes<HTMLVideoElement | null>) => React.ReactElement | null;
|
package/dist/cjs/video/Video.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Video = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
/* eslint-disable @typescript-eslint/no-use-before-define */
|
|
5
6
|
const react_1 = require("react");
|
|
6
7
|
const absolute_src_js_1 = require("../absolute-src.js");
|
|
7
8
|
const calculate_loop_js_1 = require("../calculate-loop.js");
|
|
@@ -5,6 +5,7 @@ export declare const VideoForDevelopment: ForwardRefExoticComponent<Omit<React.D
|
|
|
5
5
|
playbackRate?: number | undefined;
|
|
6
6
|
acceptableTimeShiftInSeconds?: number | undefined;
|
|
7
7
|
allowAmplificationDuringRender?: boolean | undefined;
|
|
8
|
+
toneFrequency?: number | undefined;
|
|
8
9
|
} & {
|
|
9
10
|
onlyWarnForMediaSeekingError: boolean;
|
|
10
11
|
onDuration: (src: string, durationInSeconds: number) => void;
|
|
@@ -21,7 +21,7 @@ const VideoForDevelopmentRefForwardingFunction = (props, ref) => {
|
|
|
21
21
|
const parentSequence = (0, react_1.useContext)(SequenceContext_js_1.SequenceContext);
|
|
22
22
|
const { volume, muted, playbackRate, onlyWarnForMediaSeekingError, src, onDuration,
|
|
23
23
|
// @ts-expect-error
|
|
24
|
-
acceptableTimeShift, acceptableTimeShiftInSeconds, ...nativeProps } = props;
|
|
24
|
+
acceptableTimeShift, acceptableTimeShiftInSeconds, toneFrequency, ...nativeProps } = props;
|
|
25
25
|
if (typeof acceptableTimeShift !== 'undefined') {
|
|
26
26
|
throw new Error('acceptableTimeShift has been removed. Use acceptableTimeShiftInSeconds instead.');
|
|
27
27
|
}
|
|
@@ -5,6 +5,7 @@ export declare const VideoForRendering: ForwardRefExoticComponent<Omit<React.Det
|
|
|
5
5
|
playbackRate?: number | undefined;
|
|
6
6
|
acceptableTimeShiftInSeconds?: number | undefined;
|
|
7
7
|
allowAmplificationDuringRender?: boolean | undefined;
|
|
8
|
+
toneFrequency?: number | undefined;
|
|
8
9
|
} & {
|
|
9
10
|
onDuration: (src: string, durationInSeconds: number) => void;
|
|
10
11
|
} & RefAttributes<HTMLVideoElement>>;
|
|
@@ -17,7 +17,7 @@ const use_unsafe_video_config_js_1 = require("../use-unsafe-video-config.js");
|
|
|
17
17
|
const volume_prop_js_1 = require("../volume-prop.js");
|
|
18
18
|
const warn_about_non_seekable_media_js_1 = require("../warn-about-non-seekable-media.js");
|
|
19
19
|
const get_current_time_js_1 = require("./get-current-time.js");
|
|
20
|
-
const VideoForRenderingForwardFunction = ({ onError, volume: volumeProp, allowAmplificationDuringRender, playbackRate, onDuration, ...props }, ref) => {
|
|
20
|
+
const VideoForRenderingForwardFunction = ({ onError, volume: volumeProp, allowAmplificationDuringRender, playbackRate, onDuration, toneFrequency, ...props }, ref) => {
|
|
21
21
|
const absoluteFrame = (0, timeline_position_state_js_1.useTimelinePosition)();
|
|
22
22
|
const frame = (0, use_current_frame_js_1.useCurrentFrame)();
|
|
23
23
|
const volumePropsFrame = (0, use_audio_frame_js_1.useFrameForVolumeProp)();
|
|
@@ -69,6 +69,7 @@ const VideoForRenderingForwardFunction = ({ onError, volume: volumeProp, allowAm
|
|
|
69
69
|
mediaFrame: frame,
|
|
70
70
|
playbackRate: playbackRate !== null && playbackRate !== void 0 ? playbackRate : 1,
|
|
71
71
|
allowAmplificationDuringRender: allowAmplificationDuringRender !== null && allowAmplificationDuringRender !== void 0 ? allowAmplificationDuringRender : false,
|
|
72
|
+
toneFrequency: toneFrequency !== null && toneFrequency !== void 0 ? toneFrequency : null,
|
|
72
73
|
});
|
|
73
74
|
return () => unregisterRenderAsset(id);
|
|
74
75
|
}, [
|
|
@@ -82,6 +83,7 @@ const VideoForRenderingForwardFunction = ({ onError, volume: volumeProp, allowAm
|
|
|
82
83
|
absoluteFrame,
|
|
83
84
|
playbackRate,
|
|
84
85
|
allowAmplificationDuringRender,
|
|
86
|
+
toneFrequency,
|
|
85
87
|
]);
|
|
86
88
|
(0, react_1.useImperativeHandle)(ref, () => {
|
|
87
89
|
return videoRef.current;
|
|
@@ -9,6 +9,7 @@ export type RemotionVideoProps = Omit<React.DetailedHTMLProps<React.VideoHTMLAtt
|
|
|
9
9
|
playbackRate?: number;
|
|
10
10
|
acceptableTimeShiftInSeconds?: number;
|
|
11
11
|
allowAmplificationDuringRender?: boolean;
|
|
12
|
+
toneFrequency?: number;
|
|
12
13
|
};
|
|
13
14
|
type DeprecatedOffthreadVideoProps = {
|
|
14
15
|
/**
|
|
@@ -27,6 +28,7 @@ export type OffthreadVideoProps = {
|
|
|
27
28
|
onError?: React.ReactEventHandler<HTMLVideoElement | HTMLImageElement>;
|
|
28
29
|
acceptableTimeShiftInSeconds?: number;
|
|
29
30
|
allowAmplificationDuringRender?: boolean;
|
|
31
|
+
toneFrequency?: number;
|
|
30
32
|
transparent?: boolean;
|
|
31
33
|
} & RemotionMainVideoProps & DeprecatedOffthreadVideoProps;
|
|
32
34
|
export {};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
export declare const
|
|
1
|
+
export declare const appendVideoFragment: ({ actualSrc, actualFrom, duration, fps, }: {
|
|
2
2
|
actualSrc: string;
|
|
3
3
|
actualFrom: number;
|
|
4
4
|
duration: number;
|
|
5
5
|
fps: number;
|
|
6
6
|
}) => string;
|
|
7
|
-
export declare const
|
|
8
|
-
export declare const appendVideoFragment: ({ actualSrc, actualFrom, duration, fps, }: {
|
|
7
|
+
export declare const useAppendVideoFragment: ({ actualSrc: initialActualSrc, actualFrom: initialActualFrom, duration: initialDuration, fps, }: {
|
|
9
8
|
actualSrc: string;
|
|
10
9
|
actualFrom: number;
|
|
11
10
|
duration: number;
|
|
12
11
|
fps: number;
|
|
13
12
|
}) => string;
|
|
13
|
+
export declare const isIosSafari: () => boolean;
|
|
@@ -1,39 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.isIosSafari = exports.useAppendVideoFragment = exports.appendVideoFragment = void 0;
|
|
4
4
|
const react_1 = require("react");
|
|
5
5
|
const toSeconds = (time, fps) => {
|
|
6
6
|
return Math.round((time / fps) * 100) / 100;
|
|
7
7
|
};
|
|
8
|
-
const isSubsetOfDuration = (prevStartFrom, newStartFrom, prevDuration, newDuration) => {
|
|
9
|
-
return (prevStartFrom <= newStartFrom &&
|
|
10
|
-
prevStartFrom + prevDuration >= newStartFrom + newDuration);
|
|
11
|
-
};
|
|
12
|
-
const useAppendVideoFragment = ({ actualSrc: initialActualSrc, actualFrom: initialActualFrom, duration: initialDuration, fps, }) => {
|
|
13
|
-
const actualFromRef = (0, react_1.useRef)(initialActualFrom);
|
|
14
|
-
const actualDuration = (0, react_1.useRef)(initialDuration);
|
|
15
|
-
const actualSrc = (0, react_1.useRef)(initialActualSrc);
|
|
16
|
-
if (!isSubsetOfDuration || initialActualSrc !== actualSrc.current) {
|
|
17
|
-
actualFromRef.current = initialActualFrom;
|
|
18
|
-
actualDuration.current = initialDuration;
|
|
19
|
-
actualSrc.current = initialActualSrc;
|
|
20
|
-
}
|
|
21
|
-
const appended = (0, exports.appendVideoFragment)({
|
|
22
|
-
actualSrc: actualSrc.current,
|
|
23
|
-
actualFrom: actualFromRef.current,
|
|
24
|
-
duration: actualDuration.current,
|
|
25
|
-
fps,
|
|
26
|
-
});
|
|
27
|
-
return appended;
|
|
28
|
-
};
|
|
29
|
-
exports.useAppendVideoFragment = useAppendVideoFragment;
|
|
30
|
-
const isIosSafari = () => {
|
|
31
|
-
return typeof window === 'undefined'
|
|
32
|
-
? false
|
|
33
|
-
: /iP(ad|od|hone)/i.test(window.navigator.userAgent) &&
|
|
34
|
-
Boolean(navigator.userAgent.match(/Version\/[\d.]+.*Safari/));
|
|
35
|
-
};
|
|
36
|
-
exports.isIosSafari = isIosSafari;
|
|
37
8
|
// https://github.com/remotion-dev/remotion/issues/1655
|
|
38
9
|
const isIOSSafariCase = (actualSrc) => {
|
|
39
10
|
return typeof window === 'undefined'
|
|
@@ -65,3 +36,32 @@ const appendVideoFragment = ({ actualSrc, actualFrom, duration, fps, }) => {
|
|
|
65
36
|
return actualSrc;
|
|
66
37
|
};
|
|
67
38
|
exports.appendVideoFragment = appendVideoFragment;
|
|
39
|
+
const isSubsetOfDuration = (prevStartFrom, newStartFrom, prevDuration, newDuration) => {
|
|
40
|
+
return (prevStartFrom <= newStartFrom &&
|
|
41
|
+
prevStartFrom + prevDuration >= newStartFrom + newDuration);
|
|
42
|
+
};
|
|
43
|
+
const useAppendVideoFragment = ({ actualSrc: initialActualSrc, actualFrom: initialActualFrom, duration: initialDuration, fps, }) => {
|
|
44
|
+
const actualFromRef = (0, react_1.useRef)(initialActualFrom);
|
|
45
|
+
const actualDuration = (0, react_1.useRef)(initialDuration);
|
|
46
|
+
const actualSrc = (0, react_1.useRef)(initialActualSrc);
|
|
47
|
+
if (!isSubsetOfDuration || initialActualSrc !== actualSrc.current) {
|
|
48
|
+
actualFromRef.current = initialActualFrom;
|
|
49
|
+
actualDuration.current = initialDuration;
|
|
50
|
+
actualSrc.current = initialActualSrc;
|
|
51
|
+
}
|
|
52
|
+
const appended = (0, exports.appendVideoFragment)({
|
|
53
|
+
actualSrc: actualSrc.current,
|
|
54
|
+
actualFrom: actualFromRef.current,
|
|
55
|
+
duration: actualDuration.current,
|
|
56
|
+
fps,
|
|
57
|
+
});
|
|
58
|
+
return appended;
|
|
59
|
+
};
|
|
60
|
+
exports.useAppendVideoFragment = useAppendVideoFragment;
|
|
61
|
+
const isIosSafari = () => {
|
|
62
|
+
return typeof window === 'undefined'
|
|
63
|
+
? false
|
|
64
|
+
: /iP(ad|od|hone)/i.test(window.navigator.userAgent) &&
|
|
65
|
+
Boolean(navigator.userAgent.match(/Version\/[\d.]+.*Safari/));
|
|
66
|
+
};
|
|
67
|
+
exports.isIosSafari = isIosSafari;
|
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.48';
|
|
63
63
|
|
|
64
64
|
const checkMultipleRemotionVersions = () => {
|
|
65
65
|
if (typeof globalThis === 'undefined') {
|
|
@@ -570,6 +570,23 @@ 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
591
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
575
592
|
const calculatedProm = composition.calculateMetadata
|
|
@@ -626,26 +643,12 @@ const resolveVideoConfig = ({ composition, editorProps: editorPropsOrUndefined,
|
|
|
626
643
|
props: (_g = (_f = calculatedProm.props) !== null && _f !== void 0 ? _f : composition.defaultProps) !== null && _g !== void 0 ? _g : {},
|
|
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
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "remotion",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.48",
|
|
4
4
|
"description": "Render videos in React",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"types": "dist/cjs/index.d.ts",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"react-dom": ">=16.8.0"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
|
-
"@jonny/eslint-config": "3.0.
|
|
21
|
+
"@jonny/eslint-config": "3.0.276",
|
|
22
22
|
"@rollup/plugin-typescript": "^8.2.0",
|
|
23
23
|
"@testing-library/react": "14.0.0",
|
|
24
24
|
"@types/node": "18.14.6",
|