remotion 4.0.69 → 4.0.71
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/audio/Audio.d.ts +2 -1
- package/dist/cjs/audio/Audio.js +2 -2
- package/dist/cjs/audio/AudioForDevelopment.d.ts +1 -0
- package/dist/cjs/audio/AudioForDevelopment.js +2 -1
- package/dist/cjs/audio/AudioForRendering.d.ts +1 -0
- package/dist/cjs/audio/AudioForRendering.js +1 -1
- package/dist/cjs/audio/props.d.ts +1 -0
- package/dist/cjs/use-media-in-timeline.d.ts +2 -1
- package/dist/cjs/use-media-in-timeline.js +3 -2
- package/dist/cjs/validation/validate-composition-id.js +1 -1
- package/dist/cjs/validation/validate-folder-name.js +1 -1
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/video/OffthreadVideo.js +2 -2
- package/dist/cjs/video/OffthreadVideoForRendering.js +1 -1
- package/dist/cjs/video/Video.d.ts +1 -0
- package/dist/cjs/video/Video.js +3 -3
- package/dist/cjs/video/VideoForDevelopment.d.ts +1 -0
- package/dist/cjs/video/VideoForDevelopment.js +17 -3
- package/dist/cjs/video/VideoForRendering.d.ts +1 -0
- package/dist/cjs/video/VideoForRendering.js +1 -1
- package/dist/cjs/video/props.d.ts +2 -0
- package/dist/cjs/video/video-fragment.d.ts +1 -1
- package/dist/cjs/video/video-fragment.js +11 -17
- package/dist/esm/index.mjs +44 -34
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
|
@@ -5,10 +5,11 @@ import type { RemotionMainAudioProps } from './props.js';
|
|
|
5
5
|
* @see [Documentation](https://www.remotion.dev/docs/audio)
|
|
6
6
|
*/
|
|
7
7
|
export declare const Audio: React.ForwardRefExoticComponent<Pick<Omit<React.DetailedHTMLProps<React.AudioHTMLAttributes<HTMLAudioElement>, HTMLAudioElement>, "nonce" | "onEnded" | "onResize" | "onResizeCapture" | "autoPlay" | "controls"> & {
|
|
8
|
+
name?: string | undefined;
|
|
8
9
|
volume?: import("../volume-prop.js").VolumeProp | undefined;
|
|
9
10
|
playbackRate?: number | undefined;
|
|
10
11
|
acceptableTimeShiftInSeconds?: number | undefined;
|
|
11
12
|
allowAmplificationDuringRender?: boolean | undefined;
|
|
12
13
|
_remotionInternalNeedsDurationCalculation?: boolean | undefined;
|
|
13
14
|
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>>;
|
|
15
|
+
} & RemotionMainAudioProps, "id" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "lang" | "placeholder" | "slot" | "spellCheck" | "style" | "tabIndex" | "title" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "volume" | "allowAmplificationDuringRender" | "controlsList" | "crossOrigin" | "loop" | "mediaGroup" | "muted" | "playsInline" | "preload" | "src" | "name" | "playbackRate" | "acceptableTimeShiftInSeconds" | "_remotionInternalNeedsDurationCalculation" | "toneFrequency" | keyof RemotionMainAudioProps> & React.RefAttributes<HTMLAudioElement>>;
|
package/dist/cjs/audio/Audio.js
CHANGED
|
@@ -21,7 +21,7 @@ const shared_audio_tags_js_1 = require("./shared-audio-tags.js");
|
|
|
21
21
|
const AudioRefForwardingFunction = (props, ref) => {
|
|
22
22
|
var _a;
|
|
23
23
|
const audioContext = (0, react_1.useContext)(shared_audio_tags_js_1.SharedAudioContext);
|
|
24
|
-
const { startFrom, endAt, ...otherProps } = props;
|
|
24
|
+
const { startFrom, endAt, name, ...otherProps } = props;
|
|
25
25
|
const { loop, ...propsOtherThanLoop } = props;
|
|
26
26
|
const { fps } = (0, use_video_config_js_1.useVideoConfig)();
|
|
27
27
|
const environment = (0, get_remotion_environment_js_1.getRemotionEnvironment)();
|
|
@@ -58,7 +58,7 @@ const AudioRefForwardingFunction = (props, ref) => {
|
|
|
58
58
|
(0, validate_start_from_props_js_1.validateStartFromProps)(startFrom, endAt);
|
|
59
59
|
const startFromFrameNo = startFrom !== null && startFrom !== void 0 ? startFrom : 0;
|
|
60
60
|
const endAtFrameNo = endAt !== null && endAt !== void 0 ? endAt : Infinity;
|
|
61
|
-
return ((0, jsx_runtime_1.jsx)(Sequence_js_1.Sequence, { layout: "none", from: 0 - startFromFrameNo, showInTimeline: false, durationInFrames: endAtFrameNo, children: (0, jsx_runtime_1.jsx)(exports.Audio, { _remotionInternalNeedsDurationCalculation: Boolean(loop), ...otherProps, ref: ref }) }));
|
|
61
|
+
return ((0, jsx_runtime_1.jsx)(Sequence_js_1.Sequence, { layout: "none", from: 0 - startFromFrameNo, showInTimeline: false, durationInFrames: endAtFrameNo, name: name, children: (0, jsx_runtime_1.jsx)(exports.Audio, { _remotionInternalNeedsDurationCalculation: Boolean(loop), ...otherProps, ref: ref }) }));
|
|
62
62
|
}
|
|
63
63
|
(0, validate_media_props_js_1.validateMediaProps)(props, 'Audio');
|
|
64
64
|
if (environment.isRendering) {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
export declare const AudioForDevelopment: ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.AudioHTMLAttributes<HTMLAudioElement>, HTMLAudioElement>, "nonce" | "onEnded" | "onResize" | "onResizeCapture" | "autoPlay" | "controls"> & {
|
|
4
|
+
name?: string | undefined;
|
|
4
5
|
volume?: import("../volume-prop.js").VolumeProp | undefined;
|
|
5
6
|
playbackRate?: number | undefined;
|
|
6
7
|
acceptableTimeShiftInSeconds?: number | undefined;
|
|
@@ -21,7 +21,7 @@ const AudioForDevelopmentForwardRefFunction = (props, ref) => {
|
|
|
21
21
|
const [mediaVolume] = (0, volume_position_state_js_1.useMediaVolumeState)();
|
|
22
22
|
const [mediaMuted] = (0, volume_position_state_js_1.useMediaMutedState)();
|
|
23
23
|
const volumePropFrame = (0, use_audio_frame_js_1.useFrameForVolumeProp)();
|
|
24
|
-
const { volume, muted, playbackRate, shouldPreMountAudioTags, src, onDuration, acceptableTimeShiftInSeconds, _remotionInternalNeedsDurationCalculation, allowAmplificationDuringRender, ...nativeProps } = props;
|
|
24
|
+
const { volume, muted, playbackRate, shouldPreMountAudioTags, src, onDuration, acceptableTimeShiftInSeconds, _remotionInternalNeedsDurationCalculation, allowAmplificationDuringRender, name, ...nativeProps } = props;
|
|
25
25
|
if (!src) {
|
|
26
26
|
throw new TypeError("No 'src' was passed to <Audio>.");
|
|
27
27
|
}
|
|
@@ -60,6 +60,7 @@ const AudioForDevelopmentForwardRefFunction = (props, ref) => {
|
|
|
60
60
|
src,
|
|
61
61
|
mediaType: 'audio',
|
|
62
62
|
playbackRate: playbackRate !== null && playbackRate !== void 0 ? playbackRate : 1,
|
|
63
|
+
displayName: name !== null && name !== void 0 ? name : null,
|
|
63
64
|
});
|
|
64
65
|
(0, use_media_playback_js_1.useMediaPlayback)({
|
|
65
66
|
mediaRef: audioRef,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
export declare const AudioForRendering: ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.AudioHTMLAttributes<HTMLAudioElement>, HTMLAudioElement>, "nonce" | "onEnded" | "onResize" | "onResizeCapture" | "autoPlay" | "controls"> & {
|
|
4
|
+
name?: string | undefined;
|
|
4
5
|
volume?: import("../volume-prop.js").VolumeProp | undefined;
|
|
5
6
|
playbackRate?: number | undefined;
|
|
6
7
|
acceptableTimeShiftInSeconds?: number | undefined;
|
|
@@ -30,7 +30,7 @@ const AudioForRenderingRefForwardingFunction = (props, ref) => {
|
|
|
30
30
|
sequenceContext === null || sequenceContext === void 0 ? void 0 : sequenceContext.cumulatedFrom,
|
|
31
31
|
sequenceContext === null || sequenceContext === void 0 ? void 0 : sequenceContext.durationInFrames,
|
|
32
32
|
]);
|
|
33
|
-
const { volume: volumeProp, playbackRate, allowAmplificationDuringRender, onDuration, toneFrequency, _remotionInternalNeedsDurationCalculation, acceptableTimeShiftInSeconds, ...nativeProps } = props;
|
|
33
|
+
const { volume: volumeProp, playbackRate, allowAmplificationDuringRender, onDuration, toneFrequency, _remotionInternalNeedsDurationCalculation, acceptableTimeShiftInSeconds, name, ...nativeProps } = props;
|
|
34
34
|
const volume = (0, volume_prop_js_1.evaluateVolume)({
|
|
35
35
|
volume: volumeProp,
|
|
36
36
|
frame: volumePropFrame,
|
|
@@ -5,6 +5,7 @@ export type RemotionMainAudioProps = {
|
|
|
5
5
|
endAt?: number;
|
|
6
6
|
};
|
|
7
7
|
export type RemotionAudioProps = Omit<React.DetailedHTMLProps<React.AudioHTMLAttributes<HTMLAudioElement>, HTMLAudioElement>, 'autoPlay' | 'controls' | 'onEnded' | 'nonce' | 'onResize' | 'onResizeCapture'> & {
|
|
8
|
+
name?: string;
|
|
8
9
|
volume?: VolumeProp;
|
|
9
10
|
playbackRate?: number;
|
|
10
11
|
acceptableTimeShiftInSeconds?: number;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import type { RefObject } from 'react';
|
|
2
2
|
import type { VolumeProp } from './volume-prop.js';
|
|
3
|
-
export declare const useMediaInTimeline: ({ volume, mediaVolume, mediaRef, src, mediaType, playbackRate, }: {
|
|
3
|
+
export declare const useMediaInTimeline: ({ volume, mediaVolume, mediaRef, src, mediaType, playbackRate, displayName, }: {
|
|
4
4
|
volume: VolumeProp | undefined;
|
|
5
5
|
mediaVolume: number;
|
|
6
6
|
mediaRef: RefObject<HTMLAudioElement | HTMLVideoElement>;
|
|
7
7
|
src: string | undefined;
|
|
8
8
|
mediaType: 'audio' | 'video';
|
|
9
9
|
playbackRate: number;
|
|
10
|
+
displayName: string | null;
|
|
10
11
|
}) => void;
|
|
@@ -20,7 +20,7 @@ const warnOnce = (message) => {
|
|
|
20
20
|
console.warn(message);
|
|
21
21
|
didWarn[message] = true;
|
|
22
22
|
};
|
|
23
|
-
const useMediaInTimeline = ({ volume, mediaVolume, mediaRef, src, mediaType, playbackRate, }) => {
|
|
23
|
+
const useMediaInTimeline = ({ volume, mediaVolume, mediaRef, src, mediaType, playbackRate, displayName, }) => {
|
|
24
24
|
const videoConfig = (0, use_video_config_js_1.useVideoConfig)();
|
|
25
25
|
const { rootId, audioAndVideoTags } = (0, react_1.useContext)(timeline_position_state_js_1.TimelineContext);
|
|
26
26
|
const parentSequence = (0, react_1.useContext)(SequenceContext_js_1.SequenceContext);
|
|
@@ -76,7 +76,7 @@ const useMediaInTimeline = ({ volume, mediaVolume, mediaRef, src, mediaType, pla
|
|
|
76
76
|
duration,
|
|
77
77
|
from: 0,
|
|
78
78
|
parent: (_a = parentSequence === null || parentSequence === void 0 ? void 0 : parentSequence.id) !== null && _a !== void 0 ? _a : null,
|
|
79
|
-
displayName: (0, get_asset_file_name_js_1.getAssetDisplayName)(src),
|
|
79
|
+
displayName: displayName !== null && displayName !== void 0 ? displayName : (0, get_asset_file_name_js_1.getAssetDisplayName)(src),
|
|
80
80
|
rootId,
|
|
81
81
|
volume: volumes,
|
|
82
82
|
showInTimeline: true,
|
|
@@ -106,6 +106,7 @@ const useMediaInTimeline = ({ volume, mediaVolume, mediaRef, src, mediaType, pla
|
|
|
106
106
|
mediaType,
|
|
107
107
|
startsAt,
|
|
108
108
|
playbackRate,
|
|
109
|
+
displayName,
|
|
109
110
|
]);
|
|
110
111
|
(0, react_1.useEffect)(() => {
|
|
111
112
|
const tag = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.invalidCompositionErrorMessage = exports.validateCompositionId = exports.isCompositionIdValid = void 0;
|
|
4
|
-
const getRegex = () => /^([a-zA-Z0-9
|
|
4
|
+
const getRegex = () => /^([a-zA-Z0-9-\u4E00-\u9FFF])+$/g;
|
|
5
5
|
const isCompositionIdValid = (id) => id.match(getRegex());
|
|
6
6
|
exports.isCompositionIdValid = isCompositionIdValid;
|
|
7
7
|
const validateCompositionId = (id) => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.invalidFolderNameErrorMessage = exports.validateFolderName = exports.isFolderNameValid = void 0;
|
|
4
|
-
const getRegex = () => /^([a-zA-Z0-9
|
|
4
|
+
const getRegex = () => /^([a-zA-Z0-9-\u4E00-\u9FFF])+$/g;
|
|
5
5
|
const isFolderNameValid = (name) => name.match(getRegex());
|
|
6
6
|
exports.isFolderNameValid = isFolderNameValid;
|
|
7
7
|
const validateFolderName = (name) => {
|
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "4.0.
|
|
1
|
+
export declare const VERSION = "4.0.71";
|
package/dist/cjs/version.js
CHANGED
|
@@ -16,7 +16,7 @@ const VideoForDevelopment_js_1 = require("./VideoForDevelopment.js");
|
|
|
16
16
|
const OffthreadVideo = (props) => {
|
|
17
17
|
// Should only destruct `startFrom` and `endAt` from props,
|
|
18
18
|
// rest gets drilled down
|
|
19
|
-
const { startFrom, endAt, ...otherProps } = props;
|
|
19
|
+
const { startFrom, endAt, name, ...otherProps } = props;
|
|
20
20
|
const environment = (0, get_remotion_environment_js_1.getRemotionEnvironment)();
|
|
21
21
|
const onDuration = (0, react_1.useCallback)(() => undefined, []);
|
|
22
22
|
if (typeof props.src !== 'string') {
|
|
@@ -29,7 +29,7 @@ const OffthreadVideo = (props) => {
|
|
|
29
29
|
(0, validate_start_from_props_js_1.validateStartFromProps)(startFrom, endAt);
|
|
30
30
|
const startFromFrameNo = startFrom !== null && startFrom !== void 0 ? startFrom : 0;
|
|
31
31
|
const endAtFrameNo = endAt !== null && endAt !== void 0 ? endAt : Infinity;
|
|
32
|
-
return ((0, jsx_runtime_1.jsx)(Sequence_js_1.Sequence, { layout: "none", from: 0 - startFromFrameNo, showInTimeline: false, durationInFrames: endAtFrameNo, children: (0, jsx_runtime_1.jsx)(exports.OffthreadVideo, { ...otherProps }) }));
|
|
32
|
+
return ((0, jsx_runtime_1.jsx)(Sequence_js_1.Sequence, { layout: "none", from: 0 - startFromFrameNo, showInTimeline: false, durationInFrames: endAtFrameNo, name: name, children: (0, jsx_runtime_1.jsx)(exports.OffthreadVideo, { ...otherProps }) }));
|
|
33
33
|
}
|
|
34
34
|
(0, validate_media_props_js_1.validateMediaProps)(props, 'Video');
|
|
35
35
|
if (environment.isRendering) {
|
|
@@ -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, toneFrequency, ...props }) => {
|
|
20
|
+
const OffthreadVideoForRendering = ({ onError, volume: volumeProp, playbackRate, src, muted, allowAmplificationDuringRender, transparent = false, toneFrequency, name, ...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)();
|
|
@@ -5,6 +5,7 @@ import type { RemotionMainVideoProps } from './props.js';
|
|
|
5
5
|
* @see [Documentation](https://www.remotion.dev/docs/video)
|
|
6
6
|
*/
|
|
7
7
|
export declare const Video: (props: Omit<React.DetailedHTMLProps<React.VideoHTMLAttributes<HTMLVideoElement>, HTMLVideoElement>, "nonce" | "onEnded" | "autoPlay" | "controls"> & {
|
|
8
|
+
name?: string | undefined;
|
|
8
9
|
volume?: import("../volume-prop.js").VolumeProp | undefined;
|
|
9
10
|
playbackRate?: number | undefined;
|
|
10
11
|
acceptableTimeShiftInSeconds?: number | undefined;
|
package/dist/cjs/video/Video.js
CHANGED
|
@@ -18,7 +18,7 @@ const VideoForDevelopment_js_1 = require("./VideoForDevelopment.js");
|
|
|
18
18
|
const VideoForRendering_js_1 = require("./VideoForRendering.js");
|
|
19
19
|
const VideoForwardingFunction = (props, ref) => {
|
|
20
20
|
var _a;
|
|
21
|
-
const { startFrom, endAt, ...otherProps } = props;
|
|
21
|
+
const { startFrom, endAt, name, ...otherProps } = props;
|
|
22
22
|
const { loop, ...propsOtherThanLoop } = props;
|
|
23
23
|
const { fps } = (0, use_video_config_js_1.useVideoConfig)();
|
|
24
24
|
const environment = (0, get_remotion_environment_js_1.getRemotionEnvironment)();
|
|
@@ -40,13 +40,13 @@ const VideoForwardingFunction = (props, ref) => {
|
|
|
40
40
|
mediaDuration,
|
|
41
41
|
playbackRate: (_a = props.playbackRate) !== null && _a !== void 0 ? _a : 1,
|
|
42
42
|
startFrom,
|
|
43
|
-
}), layout: "none", children: (0, jsx_runtime_1.jsx)(exports.Video, { ...propsOtherThanLoop, ref: ref }) }));
|
|
43
|
+
}), layout: "none", name: name, children: (0, jsx_runtime_1.jsx)(exports.Video, { ...propsOtherThanLoop, ref: ref }) }));
|
|
44
44
|
}
|
|
45
45
|
if (typeof startFrom !== 'undefined' || typeof endAt !== 'undefined') {
|
|
46
46
|
(0, validate_start_from_props_js_1.validateStartFromProps)(startFrom, endAt);
|
|
47
47
|
const startFromFrameNo = startFrom !== null && startFrom !== void 0 ? startFrom : 0;
|
|
48
48
|
const endAtFrameNo = endAt !== null && endAt !== void 0 ? endAt : Infinity;
|
|
49
|
-
return ((0, jsx_runtime_1.jsx)(Sequence_js_1.Sequence, { layout: "none", from: 0 - startFromFrameNo, showInTimeline: false, durationInFrames: endAtFrameNo, children: (0, jsx_runtime_1.jsx)(exports.Video, { ...otherProps, ref: ref }) }));
|
|
49
|
+
return ((0, jsx_runtime_1.jsx)(Sequence_js_1.Sequence, { layout: "none", from: 0 - startFromFrameNo, showInTimeline: false, durationInFrames: endAtFrameNo, name: name, children: (0, jsx_runtime_1.jsx)(exports.Video, { ...otherProps, ref: ref }) }));
|
|
50
50
|
}
|
|
51
51
|
(0, validate_media_props_js_1.validateMediaProps)(props, 'Video');
|
|
52
52
|
if (environment.isRendering) {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
export declare const VideoForDevelopment: ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.VideoHTMLAttributes<HTMLVideoElement>, HTMLVideoElement>, "nonce" | "onEnded" | "autoPlay" | "controls"> & {
|
|
4
|
+
name?: string | undefined;
|
|
4
5
|
volume?: import("../volume-prop.js").VolumeProp | undefined;
|
|
5
6
|
playbackRate?: number | undefined;
|
|
6
7
|
acceptableTimeShiftInSeconds?: number | undefined;
|
|
@@ -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, toneFrequency, ...nativeProps } = props;
|
|
24
|
+
acceptableTimeShift, acceptableTimeShiftInSeconds, toneFrequency, name, ...nativeProps } = props;
|
|
25
25
|
if (typeof acceptableTimeShift !== 'undefined') {
|
|
26
26
|
throw new Error('acceptableTimeShift has been removed. Use acceptableTimeShiftInSeconds instead.');
|
|
27
27
|
}
|
|
@@ -35,6 +35,7 @@ const VideoForDevelopmentRefForwardingFunction = (props, ref) => {
|
|
|
35
35
|
mediaType: 'video',
|
|
36
36
|
src,
|
|
37
37
|
playbackRate: (_a = props.playbackRate) !== null && _a !== void 0 ? _a : 1,
|
|
38
|
+
displayName: name !== null && name !== void 0 ? name : null,
|
|
38
39
|
});
|
|
39
40
|
(0, use_sync_volume_with_media_tag_js_1.useSyncVolumeWithMediaTag)({
|
|
40
41
|
volumePropFrame,
|
|
@@ -111,11 +112,24 @@ const VideoForDevelopmentRefForwardingFunction = (props, ref) => {
|
|
|
111
112
|
current.removeEventListener('loadedmetadata', onLoadedMetadata);
|
|
112
113
|
};
|
|
113
114
|
}, [src]);
|
|
114
|
-
|
|
115
|
+
(0, react_1.useEffect)(() => {
|
|
116
|
+
const { current } = videoRef;
|
|
117
|
+
if (!current) {
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
115
120
|
// Without this, on iOS Safari, the video cannot be seeked.
|
|
116
121
|
// if a seek is triggered before `loadedmetadata` is fired,
|
|
117
122
|
// the video will not seek, even if `loadedmetadata` is fired afterwards.
|
|
118
|
-
|
|
123
|
+
// Also, this needs to happen in a useEffect, because otherwise
|
|
124
|
+
// the SSR props will be applied.
|
|
125
|
+
if ((0, video_fragment_js_1.isIosSafari)()) {
|
|
126
|
+
current.preload = 'metadata';
|
|
127
|
+
}
|
|
128
|
+
else {
|
|
129
|
+
current.preload = 'auto';
|
|
130
|
+
}
|
|
131
|
+
}, []);
|
|
132
|
+
return ((0, jsx_runtime_1.jsx)("video", { ref: videoRef, muted: muted || mediaMuted, playsInline: true, src: actualSrc, ...nativeProps }));
|
|
119
133
|
};
|
|
120
134
|
// Copy types from forwardRef but not necessary to remove ref
|
|
121
135
|
exports.VideoForDevelopment = (0, react_1.forwardRef)(VideoForDevelopmentRefForwardingFunction);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
export declare const VideoForRendering: ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.VideoHTMLAttributes<HTMLVideoElement>, HTMLVideoElement>, "nonce" | "onEnded" | "autoPlay" | "controls"> & {
|
|
4
|
+
name?: string | undefined;
|
|
4
5
|
volume?: import("../volume-prop.js").VolumeProp | undefined;
|
|
5
6
|
playbackRate?: number | undefined;
|
|
6
7
|
acceptableTimeShiftInSeconds?: number | undefined;
|
|
@@ -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, toneFrequency, ...props }, ref) => {
|
|
20
|
+
const VideoForRenderingForwardFunction = ({ onError, volume: volumeProp, allowAmplificationDuringRender, playbackRate, onDuration, toneFrequency, name, ...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)();
|
|
@@ -5,6 +5,7 @@ export type RemotionMainVideoProps = {
|
|
|
5
5
|
endAt?: number;
|
|
6
6
|
};
|
|
7
7
|
export type RemotionVideoProps = Omit<React.DetailedHTMLProps<React.VideoHTMLAttributes<HTMLVideoElement>, HTMLVideoElement>, 'autoPlay' | 'controls' | 'onEnded' | 'nonce'> & {
|
|
8
|
+
name?: string;
|
|
8
9
|
volume?: VolumeProp;
|
|
9
10
|
playbackRate?: number;
|
|
10
11
|
acceptableTimeShiftInSeconds?: number;
|
|
@@ -20,6 +21,7 @@ type DeprecatedOffthreadVideoProps = {
|
|
|
20
21
|
export type OffthreadVideoProps = {
|
|
21
22
|
src: string;
|
|
22
23
|
className?: string;
|
|
24
|
+
name?: string;
|
|
23
25
|
id?: string;
|
|
24
26
|
style?: React.CSSProperties;
|
|
25
27
|
volume?: VolumeProp;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export declare const isIosSafari: () => boolean;
|
|
1
2
|
export declare const appendVideoFragment: ({ actualSrc, actualFrom, duration, fps, }: {
|
|
2
3
|
actualSrc: string;
|
|
3
4
|
actualFrom: number;
|
|
@@ -10,4 +11,3 @@ export declare const useAppendVideoFragment: ({ actualSrc: initialActualSrc, act
|
|
|
10
11
|
duration: number;
|
|
11
12
|
fps: number;
|
|
12
13
|
}) => string;
|
|
13
|
-
export declare const isIosSafari: () => boolean;
|
|
@@ -1,23 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.useAppendVideoFragment = exports.appendVideoFragment = exports.isIosSafari = 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 isIosSafari = () => {
|
|
9
|
+
return typeof window === 'undefined'
|
|
10
|
+
? false
|
|
11
|
+
: /iP(ad|od|hone)/i.test(window.navigator.userAgent) &&
|
|
12
|
+
Boolean(navigator.userAgent.match(/Version\/[\d.]+.*Safari/));
|
|
13
|
+
};
|
|
14
|
+
exports.isIosSafari = isIosSafari;
|
|
8
15
|
// https://github.com/remotion-dev/remotion/issues/1655
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
return false;
|
|
12
|
-
}
|
|
13
|
-
const isIpadIPodIPhone = /iP(ad|od|hone)/i.test(window.navigator.userAgent);
|
|
14
|
-
const isSafari = Boolean(navigator.userAgent.match(/Version\/[\d.]+.*Safari/));
|
|
15
|
-
const isChrome = Boolean(navigator.userAgent.match(/CriOS\//));
|
|
16
|
-
return (isIpadIPodIPhone && (isSafari || isChrome) && actualSrc.startsWith('blob:'));
|
|
16
|
+
const isIOSSafariAndBlob = (actualSrc) => {
|
|
17
|
+
return (0, exports.isIosSafari)() && actualSrc.startsWith('blob:');
|
|
17
18
|
};
|
|
18
19
|
const appendVideoFragment = ({ actualSrc, actualFrom, duration, fps, }) => {
|
|
19
20
|
var _a;
|
|
20
|
-
if (
|
|
21
|
+
if (isIOSSafariAndBlob(actualSrc)) {
|
|
21
22
|
return actualSrc;
|
|
22
23
|
}
|
|
23
24
|
if (actualSrc.startsWith('data:')) {
|
|
@@ -60,10 +61,3 @@ const useAppendVideoFragment = ({ actualSrc: initialActualSrc, actualFrom: initi
|
|
|
60
61
|
return appended;
|
|
61
62
|
};
|
|
62
63
|
exports.useAppendVideoFragment = useAppendVideoFragment;
|
|
63
|
-
const isIosSafari = () => {
|
|
64
|
-
return typeof window === 'undefined'
|
|
65
|
-
? false
|
|
66
|
-
: /iP(ad|od|hone)/i.test(window.navigator.userAgent) &&
|
|
67
|
-
Boolean(navigator.userAgent.match(/Version\/[\d.]+.*Safari/));
|
|
68
|
-
};
|
|
69
|
-
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.71';
|
|
63
63
|
|
|
64
64
|
const checkMultipleRemotionVersions = () => {
|
|
65
65
|
if (typeof globalThis === 'undefined') {
|
|
@@ -1552,7 +1552,7 @@ const warnOnce = (message) => {
|
|
|
1552
1552
|
console.warn(message);
|
|
1553
1553
|
didWarn[message] = true;
|
|
1554
1554
|
};
|
|
1555
|
-
const useMediaInTimeline = ({ volume, mediaVolume, mediaRef, src, mediaType, playbackRate, }) => {
|
|
1555
|
+
const useMediaInTimeline = ({ volume, mediaVolume, mediaRef, src, mediaType, playbackRate, displayName, }) => {
|
|
1556
1556
|
const videoConfig = useVideoConfig();
|
|
1557
1557
|
const { rootId, audioAndVideoTags } = useContext(TimelineContext);
|
|
1558
1558
|
const parentSequence = useContext(SequenceContext);
|
|
@@ -1608,7 +1608,7 @@ const useMediaInTimeline = ({ volume, mediaVolume, mediaRef, src, mediaType, pla
|
|
|
1608
1608
|
duration,
|
|
1609
1609
|
from: 0,
|
|
1610
1610
|
parent: (_a = parentSequence === null || parentSequence === void 0 ? void 0 : parentSequence.id) !== null && _a !== void 0 ? _a : null,
|
|
1611
|
-
displayName: getAssetDisplayName(src),
|
|
1611
|
+
displayName: displayName !== null && displayName !== void 0 ? displayName : getAssetDisplayName(src),
|
|
1612
1612
|
rootId,
|
|
1613
1613
|
volume: volumes,
|
|
1614
1614
|
showInTimeline: true,
|
|
@@ -1638,6 +1638,7 @@ const useMediaInTimeline = ({ volume, mediaVolume, mediaRef, src, mediaType, pla
|
|
|
1638
1638
|
mediaType,
|
|
1639
1639
|
startsAt,
|
|
1640
1640
|
playbackRate,
|
|
1641
|
+
displayName,
|
|
1641
1642
|
]);
|
|
1642
1643
|
useEffect(() => {
|
|
1643
1644
|
const tag = {
|
|
@@ -1801,19 +1802,19 @@ const getMediaTime = ({ fps, frame, src, playbackRate, startFrom, mediaType, })
|
|
|
1801
1802
|
const toSeconds = (time, fps) => {
|
|
1802
1803
|
return Math.round((time / fps) * 100) / 100;
|
|
1803
1804
|
};
|
|
1805
|
+
const isIosSafari = () => {
|
|
1806
|
+
return typeof window === 'undefined'
|
|
1807
|
+
? false
|
|
1808
|
+
: /iP(ad|od|hone)/i.test(window.navigator.userAgent) &&
|
|
1809
|
+
Boolean(navigator.userAgent.match(/Version\/[\d.]+.*Safari/));
|
|
1810
|
+
};
|
|
1804
1811
|
// https://github.com/remotion-dev/remotion/issues/1655
|
|
1805
|
-
const
|
|
1806
|
-
|
|
1807
|
-
return false;
|
|
1808
|
-
}
|
|
1809
|
-
const isIpadIPodIPhone = /iP(ad|od|hone)/i.test(window.navigator.userAgent);
|
|
1810
|
-
const isSafari = Boolean(navigator.userAgent.match(/Version\/[\d.]+.*Safari/));
|
|
1811
|
-
const isChrome = Boolean(navigator.userAgent.match(/CriOS\//));
|
|
1812
|
-
return (isIpadIPodIPhone && (isSafari || isChrome) && actualSrc.startsWith('blob:'));
|
|
1812
|
+
const isIOSSafariAndBlob = (actualSrc) => {
|
|
1813
|
+
return isIosSafari() && actualSrc.startsWith('blob:');
|
|
1813
1814
|
};
|
|
1814
1815
|
const appendVideoFragment = ({ actualSrc, actualFrom, duration, fps, }) => {
|
|
1815
1816
|
var _a;
|
|
1816
|
-
if (
|
|
1817
|
+
if (isIOSSafariAndBlob(actualSrc)) {
|
|
1817
1818
|
return actualSrc;
|
|
1818
1819
|
}
|
|
1819
1820
|
if (actualSrc.startsWith('data:')) {
|
|
@@ -1854,12 +1855,6 @@ const useAppendVideoFragment = ({ actualSrc: initialActualSrc, actualFrom: initi
|
|
|
1854
1855
|
});
|
|
1855
1856
|
return appended;
|
|
1856
1857
|
};
|
|
1857
|
-
const isIosSafari = () => {
|
|
1858
|
-
return typeof window === 'undefined'
|
|
1859
|
-
? false
|
|
1860
|
-
: /iP(ad|od|hone)/i.test(window.navigator.userAgent) &&
|
|
1861
|
-
Boolean(navigator.userAgent.match(/Version\/[\d.]+.*Safari/));
|
|
1862
|
-
};
|
|
1863
1858
|
|
|
1864
1859
|
const alreadyWarned = {};
|
|
1865
1860
|
const warnAboutNonSeekableMedia = (ref, type) => {
|
|
@@ -2284,7 +2279,7 @@ const AudioForDevelopmentForwardRefFunction = (props, ref) => {
|
|
|
2284
2279
|
const [mediaVolume] = useMediaVolumeState();
|
|
2285
2280
|
const [mediaMuted] = useMediaMutedState();
|
|
2286
2281
|
const volumePropFrame = useFrameForVolumeProp();
|
|
2287
|
-
const { volume, muted, playbackRate, shouldPreMountAudioTags, src, onDuration, acceptableTimeShiftInSeconds, _remotionInternalNeedsDurationCalculation, allowAmplificationDuringRender, ...nativeProps } = props;
|
|
2282
|
+
const { volume, muted, playbackRate, shouldPreMountAudioTags, src, onDuration, acceptableTimeShiftInSeconds, _remotionInternalNeedsDurationCalculation, allowAmplificationDuringRender, name, ...nativeProps } = props;
|
|
2288
2283
|
if (!src) {
|
|
2289
2284
|
throw new TypeError("No 'src' was passed to <Audio>.");
|
|
2290
2285
|
}
|
|
@@ -2323,6 +2318,7 @@ const AudioForDevelopmentForwardRefFunction = (props, ref) => {
|
|
|
2323
2318
|
src,
|
|
2324
2319
|
mediaType: 'audio',
|
|
2325
2320
|
playbackRate: playbackRate !== null && playbackRate !== void 0 ? playbackRate : 1,
|
|
2321
|
+
displayName: name !== null && name !== void 0 ? name : null,
|
|
2326
2322
|
});
|
|
2327
2323
|
useMediaPlayback({
|
|
2328
2324
|
mediaRef: audioRef,
|
|
@@ -2496,7 +2492,7 @@ const AudioForRenderingRefForwardingFunction = (props, ref) => {
|
|
|
2496
2492
|
sequenceContext === null || sequenceContext === void 0 ? void 0 : sequenceContext.cumulatedFrom,
|
|
2497
2493
|
sequenceContext === null || sequenceContext === void 0 ? void 0 : sequenceContext.durationInFrames,
|
|
2498
2494
|
]);
|
|
2499
|
-
const { volume: volumeProp, playbackRate, allowAmplificationDuringRender, onDuration, toneFrequency, _remotionInternalNeedsDurationCalculation, acceptableTimeShiftInSeconds, ...nativeProps } = props;
|
|
2495
|
+
const { volume: volumeProp, playbackRate, allowAmplificationDuringRender, onDuration, toneFrequency, _remotionInternalNeedsDurationCalculation, acceptableTimeShiftInSeconds, name, ...nativeProps } = props;
|
|
2500
2496
|
const volume = evaluateVolume({
|
|
2501
2497
|
volume: volumeProp,
|
|
2502
2498
|
frame: volumePropFrame,
|
|
@@ -2590,7 +2586,7 @@ const AudioForRendering = forwardRef(AudioForRenderingRefForwardingFunction);
|
|
|
2590
2586
|
const AudioRefForwardingFunction = (props, ref) => {
|
|
2591
2587
|
var _a;
|
|
2592
2588
|
const audioContext = useContext(SharedAudioContext);
|
|
2593
|
-
const { startFrom, endAt, ...otherProps } = props;
|
|
2589
|
+
const { startFrom, endAt, name, ...otherProps } = props;
|
|
2594
2590
|
const { loop, ...propsOtherThanLoop } = props;
|
|
2595
2591
|
const { fps } = useVideoConfig();
|
|
2596
2592
|
const environment = getRemotionEnvironment();
|
|
@@ -2627,7 +2623,7 @@ const AudioRefForwardingFunction = (props, ref) => {
|
|
|
2627
2623
|
validateStartFromProps(startFrom, endAt);
|
|
2628
2624
|
const startFromFrameNo = startFrom !== null && startFrom !== void 0 ? startFrom : 0;
|
|
2629
2625
|
const endAtFrameNo = endAt !== null && endAt !== void 0 ? endAt : Infinity;
|
|
2630
|
-
return (jsx(Sequence, { layout: "none", from: 0 - startFromFrameNo, showInTimeline: false, durationInFrames: endAtFrameNo, children: jsx(Audio, { _remotionInternalNeedsDurationCalculation: Boolean(loop), ...otherProps, ref: ref }) }));
|
|
2626
|
+
return (jsx(Sequence, { layout: "none", from: 0 - startFromFrameNo, showInTimeline: false, durationInFrames: endAtFrameNo, name: name, children: jsx(Audio, { _remotionInternalNeedsDurationCalculation: Boolean(loop), ...otherProps, ref: ref }) }));
|
|
2631
2627
|
}
|
|
2632
2628
|
validateMediaProps(props, 'Audio');
|
|
2633
2629
|
if (environment.isRendering) {
|
|
@@ -2641,7 +2637,7 @@ const AudioRefForwardingFunction = (props, ref) => {
|
|
|
2641
2637
|
*/
|
|
2642
2638
|
const Audio = forwardRef(AudioRefForwardingFunction);
|
|
2643
2639
|
|
|
2644
|
-
const getRegex$1 = () => /^([a-zA-Z0-9
|
|
2640
|
+
const getRegex$1 = () => /^([a-zA-Z0-9-\u4E00-\u9FFF])+$/g;
|
|
2645
2641
|
const isFolderNameValid = (name) => name.match(getRegex$1());
|
|
2646
2642
|
const validateFolderName = (name) => {
|
|
2647
2643
|
if (name === undefined || name === null) {
|
|
@@ -2756,7 +2752,7 @@ const useLazyComponent = (compProps) => {
|
|
|
2756
2752
|
return lazy;
|
|
2757
2753
|
};
|
|
2758
2754
|
|
|
2759
|
-
const getRegex = () => /^([a-zA-Z0-9
|
|
2755
|
+
const getRegex = () => /^([a-zA-Z0-9-\u4E00-\u9FFF])+$/g;
|
|
2760
2756
|
const isCompositionIdValid = (id) => id.match(getRegex());
|
|
2761
2757
|
const validateCompositionId = (id) => {
|
|
2762
2758
|
if (!isCompositionIdValid(id)) {
|
|
@@ -4430,7 +4426,7 @@ const Still = (props) => {
|
|
|
4430
4426
|
return React.createElement((Composition), newProps);
|
|
4431
4427
|
};
|
|
4432
4428
|
|
|
4433
|
-
const OffthreadVideoForRendering = ({ onError, volume: volumeProp, playbackRate, src, muted, allowAmplificationDuringRender, transparent = false, toneFrequency, ...props }) => {
|
|
4429
|
+
const OffthreadVideoForRendering = ({ onError, volume: volumeProp, playbackRate, src, muted, allowAmplificationDuringRender, transparent = false, toneFrequency, name, ...props }) => {
|
|
4434
4430
|
const absoluteFrame = useTimelinePosition();
|
|
4435
4431
|
const frame = useCurrentFrame();
|
|
4436
4432
|
const volumePropsFrame = useFrameForVolumeProp();
|
|
@@ -4530,7 +4526,7 @@ const VideoForDevelopmentRefForwardingFunction = (props, ref) => {
|
|
|
4530
4526
|
const parentSequence = useContext(SequenceContext);
|
|
4531
4527
|
const { volume, muted, playbackRate, onlyWarnForMediaSeekingError, src, onDuration,
|
|
4532
4528
|
// @ts-expect-error
|
|
4533
|
-
acceptableTimeShift, acceptableTimeShiftInSeconds, toneFrequency, ...nativeProps } = props;
|
|
4529
|
+
acceptableTimeShift, acceptableTimeShiftInSeconds, toneFrequency, name, ...nativeProps } = props;
|
|
4534
4530
|
if (typeof acceptableTimeShift !== 'undefined') {
|
|
4535
4531
|
throw new Error('acceptableTimeShift has been removed. Use acceptableTimeShiftInSeconds instead.');
|
|
4536
4532
|
}
|
|
@@ -4544,6 +4540,7 @@ const VideoForDevelopmentRefForwardingFunction = (props, ref) => {
|
|
|
4544
4540
|
mediaType: 'video',
|
|
4545
4541
|
src,
|
|
4546
4542
|
playbackRate: (_a = props.playbackRate) !== null && _a !== void 0 ? _a : 1,
|
|
4543
|
+
displayName: name !== null && name !== void 0 ? name : null,
|
|
4547
4544
|
});
|
|
4548
4545
|
useSyncVolumeWithMediaTag({
|
|
4549
4546
|
volumePropFrame,
|
|
@@ -4620,11 +4617,24 @@ const VideoForDevelopmentRefForwardingFunction = (props, ref) => {
|
|
|
4620
4617
|
current.removeEventListener('loadedmetadata', onLoadedMetadata);
|
|
4621
4618
|
};
|
|
4622
4619
|
}, [src]);
|
|
4623
|
-
|
|
4620
|
+
useEffect(() => {
|
|
4621
|
+
const { current } = videoRef;
|
|
4622
|
+
if (!current) {
|
|
4623
|
+
return;
|
|
4624
|
+
}
|
|
4624
4625
|
// Without this, on iOS Safari, the video cannot be seeked.
|
|
4625
4626
|
// if a seek is triggered before `loadedmetadata` is fired,
|
|
4626
4627
|
// the video will not seek, even if `loadedmetadata` is fired afterwards.
|
|
4627
|
-
|
|
4628
|
+
// Also, this needs to happen in a useEffect, because otherwise
|
|
4629
|
+
// the SSR props will be applied.
|
|
4630
|
+
if (isIosSafari()) {
|
|
4631
|
+
current.preload = 'metadata';
|
|
4632
|
+
}
|
|
4633
|
+
else {
|
|
4634
|
+
current.preload = 'auto';
|
|
4635
|
+
}
|
|
4636
|
+
}, []);
|
|
4637
|
+
return (jsx("video", { ref: videoRef, muted: muted || mediaMuted, playsInline: true, src: actualSrc, ...nativeProps }));
|
|
4628
4638
|
};
|
|
4629
4639
|
// Copy types from forwardRef but not necessary to remove ref
|
|
4630
4640
|
const VideoForDevelopment = forwardRef(VideoForDevelopmentRefForwardingFunction);
|
|
@@ -4636,7 +4646,7 @@ const VideoForDevelopment = forwardRef(VideoForDevelopmentRefForwardingFunction)
|
|
|
4636
4646
|
const OffthreadVideo = (props) => {
|
|
4637
4647
|
// Should only destruct `startFrom` and `endAt` from props,
|
|
4638
4648
|
// rest gets drilled down
|
|
4639
|
-
const { startFrom, endAt, ...otherProps } = props;
|
|
4649
|
+
const { startFrom, endAt, name, ...otherProps } = props;
|
|
4640
4650
|
const environment = getRemotionEnvironment();
|
|
4641
4651
|
const onDuration = useCallback(() => undefined, []);
|
|
4642
4652
|
if (typeof props.src !== 'string') {
|
|
@@ -4649,7 +4659,7 @@ const OffthreadVideo = (props) => {
|
|
|
4649
4659
|
validateStartFromProps(startFrom, endAt);
|
|
4650
4660
|
const startFromFrameNo = startFrom !== null && startFrom !== void 0 ? startFrom : 0;
|
|
4651
4661
|
const endAtFrameNo = endAt !== null && endAt !== void 0 ? endAt : Infinity;
|
|
4652
|
-
return (jsx(Sequence, { layout: "none", from: 0 - startFromFrameNo, showInTimeline: false, durationInFrames: endAtFrameNo, children: jsx(OffthreadVideo, { ...otherProps }) }));
|
|
4662
|
+
return (jsx(Sequence, { layout: "none", from: 0 - startFromFrameNo, showInTimeline: false, durationInFrames: endAtFrameNo, name: name, children: jsx(OffthreadVideo, { ...otherProps }) }));
|
|
4653
4663
|
}
|
|
4654
4664
|
validateMediaProps(props, 'Video');
|
|
4655
4665
|
if (environment.isRendering) {
|
|
@@ -4659,7 +4669,7 @@ const OffthreadVideo = (props) => {
|
|
|
4659
4669
|
return (jsx(VideoForDevelopment, { onDuration: onDuration, onlyWarnForMediaSeekingError: true, ...withoutTransparent }));
|
|
4660
4670
|
};
|
|
4661
4671
|
|
|
4662
|
-
const VideoForRenderingForwardFunction = ({ onError, volume: volumeProp, allowAmplificationDuringRender, playbackRate, onDuration, toneFrequency, ...props }, ref) => {
|
|
4672
|
+
const VideoForRenderingForwardFunction = ({ onError, volume: volumeProp, allowAmplificationDuringRender, playbackRate, onDuration, toneFrequency, name, ...props }, ref) => {
|
|
4663
4673
|
const absoluteFrame = useTimelinePosition();
|
|
4664
4674
|
const frame = useCurrentFrame();
|
|
4665
4675
|
const volumePropsFrame = useFrameForVolumeProp();
|
|
@@ -4853,7 +4863,7 @@ const VideoForRendering = forwardRef(VideoForRenderingForwardFunction);
|
|
|
4853
4863
|
|
|
4854
4864
|
const VideoForwardingFunction = (props, ref) => {
|
|
4855
4865
|
var _a;
|
|
4856
|
-
const { startFrom, endAt, ...otherProps } = props;
|
|
4866
|
+
const { startFrom, endAt, name, ...otherProps } = props;
|
|
4857
4867
|
const { loop, ...propsOtherThanLoop } = props;
|
|
4858
4868
|
const { fps } = useVideoConfig();
|
|
4859
4869
|
const environment = getRemotionEnvironment();
|
|
@@ -4875,13 +4885,13 @@ const VideoForwardingFunction = (props, ref) => {
|
|
|
4875
4885
|
mediaDuration,
|
|
4876
4886
|
playbackRate: (_a = props.playbackRate) !== null && _a !== void 0 ? _a : 1,
|
|
4877
4887
|
startFrom,
|
|
4878
|
-
}), layout: "none", children: jsx(Video, { ...propsOtherThanLoop, ref: ref }) }));
|
|
4888
|
+
}), layout: "none", name: name, children: jsx(Video, { ...propsOtherThanLoop, ref: ref }) }));
|
|
4879
4889
|
}
|
|
4880
4890
|
if (typeof startFrom !== 'undefined' || typeof endAt !== 'undefined') {
|
|
4881
4891
|
validateStartFromProps(startFrom, endAt);
|
|
4882
4892
|
const startFromFrameNo = startFrom !== null && startFrom !== void 0 ? startFrom : 0;
|
|
4883
4893
|
const endAtFrameNo = endAt !== null && endAt !== void 0 ? endAt : Infinity;
|
|
4884
|
-
return (jsx(Sequence, { layout: "none", from: 0 - startFromFrameNo, showInTimeline: false, durationInFrames: endAtFrameNo, children: jsx(Video, { ...otherProps, ref: ref }) }));
|
|
4894
|
+
return (jsx(Sequence, { layout: "none", from: 0 - startFromFrameNo, showInTimeline: false, durationInFrames: endAtFrameNo, name: name, children: jsx(Video, { ...otherProps, ref: ref }) }));
|
|
4885
4895
|
}
|
|
4886
4896
|
validateMediaProps(props, 'Video');
|
|
4887
4897
|
if (environment.isRendering) {
|
package/dist/esm/version.mjs
CHANGED