remotion 4.0.537 → 4.0.539
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/AbsoluteFill.d.ts +62 -62
- package/dist/cjs/AbsoluteFill.js +3 -3
- package/dist/cjs/AbsoluteFillElement.d.ts +1 -1
- package/dist/cjs/AbsoluteFillElement.js +43 -5
- package/dist/cjs/CanUseRemotionHooks.js +1 -1
- package/dist/cjs/Composition.js +5 -11
- package/dist/cjs/CompositionErrorBoundary.js +5 -2
- package/dist/cjs/CompositionManager.d.ts +1 -0
- package/dist/cjs/CompositionManagerProvider.d.ts +1 -1
- package/dist/cjs/CompositionManagerProvider.js +1 -1
- package/dist/cjs/CompositionRegistryProvider.d.ts +1 -1
- package/dist/cjs/CompositionRegistryProvider.js +1 -1
- package/dist/cjs/EditorProps.d.ts +2 -2
- package/dist/cjs/EditorProps.js +1 -1
- package/dist/cjs/Folder.js +1 -1
- package/dist/cjs/HtmlInCanvas.d.ts +58 -67
- package/dist/cjs/HtmlInCanvas.js +22 -9
- package/dist/cjs/HtmlInCanvasFallback.d.ts +6 -0
- package/dist/cjs/HtmlInCanvasFallback.js +39 -0
- package/dist/cjs/IFrame.d.ts +2 -2
- package/dist/cjs/IFrame.js +1 -1
- package/dist/cjs/Img.d.ts +62 -62
- package/dist/cjs/Img.js +160 -132
- package/dist/cjs/Interactive.d.ts +147 -145
- package/dist/cjs/Interactive.js +2 -2
- package/dist/cjs/RemotionRoot.js +1 -1
- package/dist/cjs/RenderAssetManager.js +1 -1
- package/dist/cjs/Sequence.js +37 -27
- package/dist/cjs/SequenceActivityBoundary.js +1 -1
- package/dist/cjs/SequenceActivityBudget.js +1 -1
- package/dist/cjs/SequenceActivitySuspensionProvider.js +1 -1
- package/dist/cjs/SequenceManager.d.ts +6 -0
- package/dist/cjs/SequenceManager.js +71 -27
- package/dist/cjs/SequenceRegistryProvider.js +16 -3
- package/dist/cjs/TimelineContext.js +1 -1
- package/dist/cjs/Track.js +2 -2
- package/dist/cjs/animated-image/AnimatedImage.d.ts +69 -69
- package/dist/cjs/animated-image/AnimatedImage.js +6 -6
- package/dist/cjs/animated-image/canvas.d.ts +6 -5
- package/dist/cjs/animated-image/canvas.js +1 -1
- package/dist/cjs/animated-image/create-image-decoder.d.ts +1 -1
- package/dist/cjs/animated-image/decode-image.d.ts +1 -1
- package/dist/cjs/animated-image/decode-image.js +2 -0
- package/dist/cjs/animated-image/get-duration-in-seconds.d.ts +1 -1
- package/dist/cjs/animated-image/index.js +1 -1
- package/dist/cjs/audio/AudioForPreview.js +5 -28
- package/dist/cjs/audio/AudioForRendering.d.ts +5 -20
- package/dist/cjs/audio/AudioForRendering.js +44 -5
- package/dist/cjs/audio/html5-audio.d.ts +36 -36
- package/dist/cjs/audio/html5-audio.js +8 -10
- package/dist/cjs/audio/index.js +1 -1
- package/dist/cjs/audio/shared-audio-tags.js +10 -16
- package/dist/cjs/audio/shared-element-source-node.d.ts +1 -1
- package/dist/cjs/audio/use-audio-context.d.ts +2 -1
- package/dist/cjs/audio/wait-until-actually-resumed.d.ts +2 -1
- package/dist/cjs/buffer-until-first-frame.d.ts +4 -3
- package/dist/cjs/buffering.js +1 -1
- package/dist/cjs/cancel-render.js +3 -0
- package/dist/cjs/canvas-image/CanvasImage.d.ts +71 -71
- package/dist/cjs/canvas-image/CanvasImage.js +27 -24
- package/dist/cjs/canvas-image/index.js +1 -1
- package/dist/cjs/codec.d.ts +1 -1
- package/dist/cjs/committed-metadata.d.ts +4 -2
- package/dist/cjs/composition-registry-fallback.d.ts +4 -2
- package/dist/cjs/composition-registry-fallback.js +12 -10
- package/dist/cjs/create-element-source-proxy.js +46 -6
- package/dist/cjs/default-css.d.ts +1 -1
- package/dist/cjs/delay-render.d.ts +2 -1
- package/dist/cjs/delay-render.js +4 -2
- package/dist/cjs/easing.js +3 -1
- package/dist/cjs/effects/Solid.d.ts +60 -60
- package/dist/cjs/effects/Solid.js +2 -2
- package/dist/cjs/effects/canvas-pool.js +6 -9
- package/dist/cjs/effects/create-curve-sampler.d.ts +1 -0
- package/dist/cjs/effects/create-curve-sampler.js +100 -0
- package/dist/cjs/effects/effect-source-observer.d.ts +13 -0
- package/dist/cjs/effects/effect-source-observer.js +177 -0
- package/dist/cjs/effects/index.js +1 -1
- package/dist/cjs/effects/run-effect-chain.js +3 -0
- package/dist/cjs/effects/use-memoized-effects.d.ts +2 -1
- package/dist/cjs/effects/use-memoized-effects.js +29 -13
- package/dist/cjs/freeze.js +2 -2
- package/dist/cjs/get-cross-origin-value.d.ts +1 -1
- package/dist/cjs/get-effective-visual-mode-value.d.ts +2 -2
- package/dist/cjs/index.d.ts +3 -1
- package/dist/cjs/index.js +32 -32
- package/dist/cjs/interactivity-schema.d.ts +286 -286
- package/dist/cjs/internals.d.ts +412 -595
- package/dist/cjs/internals.js +11 -0
- package/dist/cjs/interpolate-colors.d.ts +1 -1
- package/dist/cjs/interpolate-colors.js +28 -23
- package/dist/cjs/interpolate.d.ts +2 -9
- package/dist/cjs/interpolate.js +37 -33
- package/dist/cjs/is-player.js +1 -1
- package/dist/cjs/loading-indicator.js +2 -6
- package/dist/cjs/log-level-context.d.ts +1 -1
- package/dist/cjs/log.d.ts +12 -7
- package/dist/cjs/loop/index.js +1 -1
- package/dist/cjs/media-resource-manager.d.ts +1 -1
- package/dist/cjs/media-tag-current-time-timestamp.d.ts +1 -1
- package/dist/cjs/no-react.d.ts +85 -91
- package/dist/cjs/no-react.js +2 -2
- package/dist/cjs/nonce.d.ts +11 -0
- package/dist/cjs/nonce.js +42 -0
- package/dist/cjs/play-and-handle-not-allowed-error.d.ts +5 -4
- package/dist/cjs/playback-logging.d.ts +2 -1
- package/dist/cjs/playback-pitch-context.d.ts +1 -0
- package/dist/cjs/playback-pitch-context.js +5 -0
- package/dist/cjs/prefetch-state.js +1 -1
- package/dist/cjs/prefetch.d.ts +7 -6
- package/dist/cjs/prefetch.js +30 -5
- package/dist/cjs/props-if-has-props.d.ts +2 -1
- package/dist/cjs/prores-profile.d.ts +1 -1
- package/dist/cjs/register-root.d.ts +2 -2
- package/dist/cjs/render-resource-manager.d.ts +1 -1
- package/dist/cjs/render-types.d.ts +2 -2
- package/dist/cjs/resolve-video-config.d.ts +8 -8
- package/dist/cjs/runtime-value-store.d.ts +1 -1
- package/dist/cjs/scale-value.d.ts +1 -1
- package/dist/cjs/seek.d.ts +3 -2
- package/dist/cjs/sequence-activity-context.js +1 -1
- package/dist/cjs/sequence-crop.js +1 -4
- package/dist/cjs/sequence-order-marker.d.ts +58 -0
- package/dist/cjs/sequence-order-marker.js +44 -0
- package/dist/cjs/series/flatten-children.d.ts +3 -1
- package/dist/cjs/series/index.js +4 -5
- package/dist/cjs/series/is-inside-series.js +2 -2
- package/dist/cjs/spring/index.d.ts +1 -1
- package/dist/cjs/spring/index.js +2 -4
- package/dist/cjs/spring/measure-spring.d.ts +1 -1
- package/dist/cjs/spring/spring-utils.d.ts +1 -1
- package/dist/cjs/spring/spring-utils.js +11 -5
- package/dist/cjs/timeline-position-state.d.ts +1 -1
- package/dist/cjs/timeline-position-state.js +2 -2
- package/dist/cjs/use-amplification.d.ts +4 -7
- package/dist/cjs/use-current-scale.d.ts +2 -2
- package/dist/cjs/use-delay-render.d.ts +2 -1
- package/dist/cjs/use-lazy-component.d.ts +1 -1
- package/dist/cjs/use-lazy-component.js +20 -9
- package/dist/cjs/use-media-buffering.d.ts +3 -2
- package/dist/cjs/use-media-duration.d.ts +4 -0
- package/dist/cjs/use-media-duration.js +36 -0
- package/dist/cjs/use-media-enabled.d.ts +1 -1
- package/dist/cjs/use-media-enabled.js +1 -1
- package/dist/cjs/use-media-in-timeline.d.ts +1 -1
- package/dist/cjs/use-media-playback.d.ts +3 -3
- package/dist/cjs/use-media-tag.d.ts +2 -2
- package/dist/cjs/use-pixel-density.d.ts +1 -1
- package/dist/cjs/use-premounting.d.ts +1 -1
- package/dist/cjs/use-premounting.js +6 -2
- package/dist/cjs/use-request-video-callback-time.d.ts +3 -3
- package/dist/cjs/use-schema.d.ts +4 -4
- package/dist/cjs/use-video.js +1 -1
- package/dist/cjs/validate-media-props.d.ts +1 -1
- package/dist/cjs/validation/validate-default-props.d.ts +1 -1
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/video/MediaPlaybackError.js +0 -1
- package/dist/cjs/video/OffthreadVideo.js +5 -5
- package/dist/cjs/video/OffthreadVideoForRendering.js +9 -7
- package/dist/cjs/video/VideoForPreview.js +6 -28
- package/dist/cjs/video/VideoForRendering.d.ts +5 -3
- package/dist/cjs/video/VideoForRendering.js +4 -2
- package/dist/cjs/video/duration-state.d.ts +1 -0
- package/dist/cjs/video/duration-state.js +8 -2
- package/dist/cjs/video/emit-video-frame.d.ts +1 -1
- package/dist/cjs/video/html5-video.d.ts +36 -36
- package/dist/cjs/video/html5-video.js +8 -10
- package/dist/cjs/video/index.js +2 -2
- package/dist/cjs/video/seek-until-right.d.ts +3 -2
- package/dist/cjs/warn-about-non-seekable-media.d.ts +1 -1
- package/dist/cjs/with-interactivity-schema.d.ts +1 -1
- package/dist/cjs/with-interactivity-schema.js +3 -8
- package/dist/cjs/wrap-remotion-context.d.ts +4 -4
- package/dist/cjs/wrap-remotion-context.js +2 -2
- package/dist/esm/index.mjs +1304 -819
- package/dist/esm/no-react.mjs +74 -52
- package/dist/esm/version.mjs +1 -1
- package/package.json +4 -4
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { RefObject } from 'react';
|
|
2
2
|
export declare const useRequestVideoCallbackTime: ({ mediaRef, mediaType, lastSeek, onVariableFpsVideoDetected, }: {
|
|
3
|
-
mediaRef: RefObject<
|
|
4
|
-
mediaType:
|
|
5
|
-
lastSeek: RefObject<number | null>;
|
|
3
|
+
mediaRef: RefObject<HTMLVideoElement | HTMLAudioElement | null>;
|
|
4
|
+
mediaType: 'video' | 'audio';
|
|
5
|
+
lastSeek: React.RefObject<number | null>;
|
|
6
6
|
onVariableFpsVideoDetected: () => void;
|
|
7
7
|
}) => RefObject<{
|
|
8
8
|
time: number;
|
package/dist/cjs/use-schema.d.ts
CHANGED
|
@@ -119,18 +119,18 @@ export type GetDragOverrides = (nodePath: SequencePropsSubscriptionKey) => DragO
|
|
|
119
119
|
export type GetEffectDragOverrides = (nodePath: SequencePropsSubscriptionKey, effectIndex: number) => Record<string, DragOverrideValue>;
|
|
120
120
|
export declare const makeStaticDragOverride: (value: unknown) => DragOverrideValue;
|
|
121
121
|
export declare const makeKeyframedDragOverride: ({ status, frame, value, defaultEasing, }: {
|
|
122
|
-
status: CanUpdateSequencePropStatusKeyframed
|
|
122
|
+
status: CanUpdateSequencePropStatusKeyframed;
|
|
123
123
|
frame: number;
|
|
124
124
|
value: unknown;
|
|
125
|
-
defaultEasing?: CanUpdateSequencePropStatusEasing
|
|
125
|
+
defaultEasing?: CanUpdateSequencePropStatusEasing;
|
|
126
126
|
}) => DragOverrideValue;
|
|
127
127
|
export declare const getStaticDragOverrideValue: (dragOverrideValue: DragOverrideValue | undefined) => unknown;
|
|
128
|
-
export declare const isKeyframedStatus: (status: CanUpdateSequencePropStatus
|
|
128
|
+
export declare const isKeyframedStatus: (status: CanUpdateSequencePropStatus | null) => status is CanUpdateSequencePropStatusKeyframed;
|
|
129
129
|
export declare const computeEffectiveSchemaValuesDotNotation: ({ schema, currentValue, overrideValues, propStatus, frame, }: {
|
|
130
130
|
schema: InteractivitySchema;
|
|
131
131
|
currentValue: Record<string, unknown>;
|
|
132
132
|
overrideValues: Record<string, DragOverrideValue>;
|
|
133
|
-
propStatus: Record<string, CanUpdateSequencePropStatus
|
|
133
|
+
propStatus: Record<string, CanUpdateSequencePropStatus> | undefined;
|
|
134
134
|
frame: number | null;
|
|
135
135
|
}) => {
|
|
136
136
|
merged: Record<string, unknown>;
|
package/dist/cjs/use-video.js
CHANGED
|
@@ -55,7 +55,7 @@ const VideoProvider = ({ children }) => {
|
|
|
55
55
|
resolved,
|
|
56
56
|
selected,
|
|
57
57
|
]);
|
|
58
|
-
return (jsx_runtime_1.jsx(exports.VideoContext.Provider, { value: video, children: children }));
|
|
58
|
+
return ((0, jsx_runtime_1.jsx)(exports.VideoContext.Provider, { value: video, children: children }));
|
|
59
59
|
};
|
|
60
60
|
exports.VideoProvider = VideoProvider;
|
|
61
61
|
const useVideo = () => {
|
|
@@ -3,4 +3,4 @@ export declare const validateMediaProps: (props: {
|
|
|
3
3
|
volume: VolumeProp | undefined;
|
|
4
4
|
playbackRate: number | undefined;
|
|
5
5
|
preservePitch?: boolean | undefined;
|
|
6
|
-
}, component:
|
|
6
|
+
}, component: 'Html5Video' | 'Html5Audio' | 'Audio' | 'Video') => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const validateDefaultAndInputProps: (defaultProps: unknown, name:
|
|
1
|
+
export declare const validateDefaultAndInputProps: (defaultProps: unknown, name: 'defaultProps' | 'inputProps', compositionId: string | null) => void;
|
package/dist/cjs/version.d.ts
CHANGED
package/dist/cjs/version.js
CHANGED
|
@@ -48,18 +48,18 @@ const InnerOffthreadVideo = (props) => {
|
|
|
48
48
|
});
|
|
49
49
|
if (typeof trimBeforeValue !== 'undefined' ||
|
|
50
50
|
typeof effectiveTrimAfter !== 'undefined') {
|
|
51
|
-
return (jsx_runtime_1.jsx(use_audio_frame_js_1.Html5MediaTrimContext.Provider, { value: trimBeforeValue !== null && trimBeforeValue !== void 0 ? trimBeforeValue : 0, children: jsx_runtime_1.jsx(Sequence_js_1.Sequence, { layout: "none", from: 0 - (trimBeforeValue !== null && trimBeforeValue !== void 0 ? trimBeforeValue : 0), showInTimeline: false, durationInFrames: effectiveTrimAfter === undefined
|
|
51
|
+
return ((0, jsx_runtime_1.jsx)(use_audio_frame_js_1.Html5MediaTrimContext.Provider, { value: trimBeforeValue !== null && trimBeforeValue !== void 0 ? trimBeforeValue : 0, children: (0, jsx_runtime_1.jsx)(Sequence_js_1.Sequence, { layout: "none", from: 0 - (trimBeforeValue !== null && trimBeforeValue !== void 0 ? trimBeforeValue : 0), showInTimeline: false, durationInFrames: effectiveTrimAfter === undefined
|
|
52
52
|
? undefined
|
|
53
53
|
: (trimBeforeValue !== null && trimBeforeValue !== void 0 ? trimBeforeValue : 0) +
|
|
54
54
|
(effectiveTrimAfter - (trimBeforeValue !== null && trimBeforeValue !== void 0 ? trimBeforeValue : 0)) /
|
|
55
|
-
((_a = props.playbackRate) !== null && _a !== void 0 ? _a : 1), name: name, children: jsx_runtime_1.jsx(exports.InnerOffthreadVideo, { pauseWhenBuffering: shouldPauseWhenBuffering, ...otherProps, trimAfter: undefined, durationInFrames: undefined, name: undefined, showInTimeline: showInTimeline, trimBefore: undefined, _remotionInternalStack: undefined, startFrom: undefined, endAt: undefined }) }) }));
|
|
55
|
+
((_a = props.playbackRate) !== null && _a !== void 0 ? _a : 1), name: name, children: (0, jsx_runtime_1.jsx)(exports.InnerOffthreadVideo, { pauseWhenBuffering: shouldPauseWhenBuffering, ...otherProps, trimAfter: undefined, durationInFrames: undefined, name: undefined, showInTimeline: showInTimeline, trimBefore: undefined, _remotionInternalStack: undefined, startFrom: undefined, endAt: undefined }) }) }));
|
|
56
56
|
}
|
|
57
57
|
(0, validate_media_props_js_1.validateMediaProps)(props, 'Video');
|
|
58
58
|
if (environment.isRendering) {
|
|
59
|
-
return (jsx_runtime_1.jsx(OffthreadVideoForRendering_js_1.OffthreadVideoForRendering, { pauseWhenBuffering: shouldPauseWhenBuffering, ...otherProps, trimAfter: undefined, durationInFrames: undefined, name: undefined, showInTimeline: showInTimeline, trimBefore: undefined, _remotionInternalStack: undefined, startFrom: undefined, endAt: undefined }));
|
|
59
|
+
return ((0, jsx_runtime_1.jsx)(OffthreadVideoForRendering_js_1.OffthreadVideoForRendering, { pauseWhenBuffering: shouldPauseWhenBuffering, ...otherProps, trimAfter: undefined, durationInFrames: undefined, name: undefined, showInTimeline: showInTimeline, trimBefore: undefined, _remotionInternalStack: undefined, startFrom: undefined, endAt: undefined }));
|
|
60
60
|
}
|
|
61
61
|
const { transparent, toneMapped, onAutoPlayError, onVideoFrame, crossOrigin, delayRenderRetries, delayRenderTimeoutInMilliseconds, ...propsForPreview } = otherProps;
|
|
62
|
-
return (jsx_runtime_1.jsx(VideoForPreview_js_1.VideoForPreview, { _remotionInternalStack: _remotionInternalStack !== null && _remotionInternalStack !== void 0 ? _remotionInternalStack : null, onDuration: onDuration, onlyWarnForMediaSeekingError: true, pauseWhenBuffering: shouldPauseWhenBuffering, showInTimeline: showInTimeline !== null && showInTimeline !== void 0 ? showInTimeline : true, onAutoPlayError: onAutoPlayError !== null && onAutoPlayError !== void 0 ? onAutoPlayError : undefined, onVideoFrame: onVideoFrame !== null && onVideoFrame !== void 0 ? onVideoFrame : null, crossOrigin: crossOrigin, ...propsForPreview, _remotionInternalNativeLoopPassed: false }));
|
|
62
|
+
return ((0, jsx_runtime_1.jsx)(VideoForPreview_js_1.VideoForPreview, { _remotionInternalStack: _remotionInternalStack !== null && _remotionInternalStack !== void 0 ? _remotionInternalStack : null, onDuration: onDuration, onlyWarnForMediaSeekingError: true, pauseWhenBuffering: shouldPauseWhenBuffering, showInTimeline: showInTimeline !== null && showInTimeline !== void 0 ? showInTimeline : true, onAutoPlayError: onAutoPlayError !== null && onAutoPlayError !== void 0 ? onAutoPlayError : undefined, onVideoFrame: onVideoFrame !== null && onVideoFrame !== void 0 ? onVideoFrame : null, crossOrigin: crossOrigin, ...propsForPreview, _remotionInternalNativeLoopPassed: false }));
|
|
63
63
|
};
|
|
64
64
|
exports.InnerOffthreadVideo = InnerOffthreadVideo;
|
|
65
65
|
/*
|
|
@@ -70,7 +70,7 @@ const OffthreadVideo = ({ src, acceptableTimeShiftInSeconds, allowAmplificationD
|
|
|
70
70
|
if (imageFormat) {
|
|
71
71
|
throw new TypeError(`The \`<OffthreadVideo>\` tag does no longer accept \`imageFormat\`. Use the \`transparent\` prop if you want to render a transparent video.`);
|
|
72
72
|
}
|
|
73
|
-
return (jsx_runtime_1.jsx(exports.InnerOffthreadVideo, { acceptableTimeShiftInSeconds: acceptableTimeShiftInSeconds, allowAmplificationDuringRender: allowAmplificationDuringRender !== null && allowAmplificationDuringRender !== void 0 ? allowAmplificationDuringRender : true, audioStreamIndex: audioStreamIndex !== null && audioStreamIndex !== void 0 ? audioStreamIndex : 0, crossOrigin: crossOrigin, delayRenderRetries: delayRenderRetries, delayRenderTimeoutInMilliseconds: delayRenderTimeoutInMilliseconds, loopVolumeCurveBehavior: loopVolumeCurveBehavior !== null && loopVolumeCurveBehavior !== void 0 ? loopVolumeCurveBehavior : 'repeat', muted: muted !== null && muted !== void 0 ? muted : false, name: name, onAutoPlayError: onAutoPlayError !== null && onAutoPlayError !== void 0 ? onAutoPlayError : null, onError: onError, onVideoFrame: onVideoFrame, pauseWhenBuffering: (0, v5_flag_js_1.resolveV5Default)(pauseWhenBuffering), playbackRate: playbackRate !== null && playbackRate !== void 0 ? playbackRate : 1, preservePitch: preservePitch, toneFrequency: toneFrequency !== null && toneFrequency !== void 0 ? toneFrequency : 1, showInTimeline: showInTimeline !== null && showInTimeline !== void 0 ? showInTimeline : true, src: src, _remotionInternalStack: _remotionInternalStack, startFrom: startFrom, _remotionInternalNativeLoopPassed: _remotionInternalNativeLoopPassed !== null && _remotionInternalNativeLoopPassed !== void 0 ? _remotionInternalNativeLoopPassed : false, endAt: endAt, style: style, toneMapped: toneMapped !== null && toneMapped !== void 0 ? toneMapped : true, transparent: transparent !== null && transparent !== void 0 ? transparent : false, trimAfter: trimAfter, durationInFrames: durationInFrames, trimBefore: trimBefore, useWebAudioApi: useWebAudioApi !== null && useWebAudioApi !== void 0 ? useWebAudioApi : false, volume: volume, ...props }));
|
|
73
|
+
return ((0, jsx_runtime_1.jsx)(exports.InnerOffthreadVideo, { acceptableTimeShiftInSeconds: acceptableTimeShiftInSeconds, allowAmplificationDuringRender: allowAmplificationDuringRender !== null && allowAmplificationDuringRender !== void 0 ? allowAmplificationDuringRender : true, audioStreamIndex: audioStreamIndex !== null && audioStreamIndex !== void 0 ? audioStreamIndex : 0, crossOrigin: crossOrigin, delayRenderRetries: delayRenderRetries, delayRenderTimeoutInMilliseconds: delayRenderTimeoutInMilliseconds, loopVolumeCurveBehavior: loopVolumeCurveBehavior !== null && loopVolumeCurveBehavior !== void 0 ? loopVolumeCurveBehavior : 'repeat', muted: muted !== null && muted !== void 0 ? muted : false, name: name, onAutoPlayError: onAutoPlayError !== null && onAutoPlayError !== void 0 ? onAutoPlayError : null, onError: onError, onVideoFrame: onVideoFrame, pauseWhenBuffering: (0, v5_flag_js_1.resolveV5Default)(pauseWhenBuffering), playbackRate: playbackRate !== null && playbackRate !== void 0 ? playbackRate : 1, preservePitch: preservePitch, toneFrequency: toneFrequency !== null && toneFrequency !== void 0 ? toneFrequency : 1, showInTimeline: showInTimeline !== null && showInTimeline !== void 0 ? showInTimeline : true, src: src, _remotionInternalStack: _remotionInternalStack, startFrom: startFrom, _remotionInternalNativeLoopPassed: _remotionInternalNativeLoopPassed !== null && _remotionInternalNativeLoopPassed !== void 0 ? _remotionInternalNativeLoopPassed : false, endAt: endAt, style: style, toneMapped: toneMapped !== null && toneMapped !== void 0 ? toneMapped : true, transparent: transparent !== null && transparent !== void 0 ? transparent : false, trimAfter: trimAfter, durationInFrames: durationInFrames, trimBefore: trimBefore, useWebAudioApi: useWebAudioApi !== null && useWebAudioApi !== void 0 ? useWebAudioApi : false, volume: volume, ...props }));
|
|
74
74
|
};
|
|
75
75
|
exports.OffthreadVideo = OffthreadVideo;
|
|
76
76
|
(0, enable_sequence_stack_traces_js_1.addSequenceStackTraces)(exports.OffthreadVideo);
|
|
@@ -6,7 +6,6 @@ const react_1 = require("react");
|
|
|
6
6
|
const absolute_src_js_1 = require("../absolute-src.js");
|
|
7
7
|
const use_audio_frame_js_1 = require("../audio/use-audio-frame.js");
|
|
8
8
|
const use_media_audio_state_js_1 = require("../audio/use-media-audio-state.js");
|
|
9
|
-
const cancel_render_js_1 = require("../cancel-render.js");
|
|
10
9
|
const default_css_js_1 = require("../default-css.js");
|
|
11
10
|
const Img_js_1 = require("../Img.js");
|
|
12
11
|
const random_js_1 = require("../random.js");
|
|
@@ -25,7 +24,7 @@ const offthread_video_source_js_1 = require("./offthread-video-source.js");
|
|
|
25
24
|
const OffthreadVideoForRendering = ({ onError, volume: volumeProp, playbackRate, src, muted, allowAmplificationDuringRender, transparent, toneMapped, toneFrequency, name, loopVolumeCurveBehavior, delayRenderRetries, delayRenderTimeoutInMilliseconds, onVideoFrame,
|
|
26
25
|
// Remove crossOrigin prop during rendering
|
|
27
26
|
// https://discord.com/channels/809501355504959528/844143007183667220/1311639632496033813
|
|
28
|
-
crossOrigin, audioStreamIndex, preservePitch
|
|
27
|
+
crossOrigin, audioStreamIndex, preservePitch, ...props }) => {
|
|
29
28
|
var _a;
|
|
30
29
|
const absoluteFrame = (0, timeline_position_state_js_1.useTimelinePosition)();
|
|
31
30
|
const frame = (0, use_current_frame_js_1.useCurrentFrame)();
|
|
@@ -80,6 +79,7 @@ crossOrigin, audioStreamIndex, preservePitch: _preservePitch, ...props }) => {
|
|
|
80
79
|
toneFrequency,
|
|
81
80
|
audioStartFrame,
|
|
82
81
|
audioStreamIndex,
|
|
82
|
+
preservePitch: preservePitch !== null && preservePitch !== void 0 ? preservePitch : true,
|
|
83
83
|
});
|
|
84
84
|
return () => unregisterRenderAsset(id);
|
|
85
85
|
}, [
|
|
@@ -96,6 +96,7 @@ crossOrigin, audioStreamIndex, preservePitch: _preservePitch, ...props }) => {
|
|
|
96
96
|
audioStartFrame,
|
|
97
97
|
sequencePlaybackRate,
|
|
98
98
|
audioStreamIndex,
|
|
99
|
+
preservePitch,
|
|
99
100
|
]);
|
|
100
101
|
const currentTime = (0, react_1.useMemo)(() => {
|
|
101
102
|
return ((0, get_current_time_js_1.getExpectedMediaFrameUncorrected)({
|
|
@@ -113,7 +114,7 @@ crossOrigin, audioStreamIndex, preservePitch: _preservePitch, ...props }) => {
|
|
|
113
114
|
});
|
|
114
115
|
}, [toneMapped, currentTime, src, transparent]);
|
|
115
116
|
const [imageSrc, setImageSrc] = (0, react_1.useState)(null);
|
|
116
|
-
const { delayRender, continueRender } = (0, use_delay_render_js_1.useDelayRender)();
|
|
117
|
+
const { delayRender, continueRender, cancelRender } = (0, use_delay_render_js_1.useDelayRender)();
|
|
117
118
|
(0, react_1.useLayoutEffect)(() => {
|
|
118
119
|
if (!window.remotion_videoEnabled) {
|
|
119
120
|
return;
|
|
@@ -167,7 +168,7 @@ crossOrigin, audioStreamIndex, preservePitch: _preservePitch, ...props }) => {
|
|
|
167
168
|
onError(err);
|
|
168
169
|
}
|
|
169
170
|
else {
|
|
170
|
-
|
|
171
|
+
cancelRender(err);
|
|
171
172
|
}
|
|
172
173
|
}
|
|
173
174
|
};
|
|
@@ -187,6 +188,7 @@ crossOrigin, audioStreamIndex, preservePitch: _preservePitch, ...props }) => {
|
|
|
187
188
|
delayRenderTimeoutInMilliseconds,
|
|
188
189
|
onError,
|
|
189
190
|
continueRender,
|
|
191
|
+
cancelRender,
|
|
190
192
|
delayRender,
|
|
191
193
|
]);
|
|
192
194
|
const onErr = (0, react_1.useCallback)(() => {
|
|
@@ -194,9 +196,9 @@ crossOrigin, audioStreamIndex, preservePitch: _preservePitch, ...props }) => {
|
|
|
194
196
|
onError === null || onError === void 0 ? void 0 : onError(new Error('Failed to load image with src ' + imageSrc));
|
|
195
197
|
}
|
|
196
198
|
else {
|
|
197
|
-
|
|
199
|
+
cancelRender('Failed to load image with src ' + imageSrc);
|
|
198
200
|
}
|
|
199
|
-
}, [imageSrc, onError]);
|
|
201
|
+
}, [imageSrc, onError, cancelRender]);
|
|
200
202
|
const className = (0, react_1.useMemo)(() => {
|
|
201
203
|
return [default_css_js_1.OBJECTFIT_CONTAIN_CLASS_NAME, props.className]
|
|
202
204
|
.filter(truthy_js_1.truthy)
|
|
@@ -211,6 +213,6 @@ crossOrigin, audioStreamIndex, preservePitch: _preservePitch, ...props }) => {
|
|
|
211
213
|
return null;
|
|
212
214
|
}
|
|
213
215
|
continueRender(imageSrc.handle);
|
|
214
|
-
return (jsx_runtime_1.jsx(Img_js_1.Img, { src: imageSrc.src, delayRenderRetries: delayRenderRetries, delayRenderTimeoutInMilliseconds: delayRenderTimeoutInMilliseconds, onImageFrame: onImageFrame, ...props, onError: onErr, className: className }));
|
|
216
|
+
return ((0, jsx_runtime_1.jsx)(Img_js_1.Img, { src: imageSrc.src, delayRenderRetries: delayRenderRetries, delayRenderTimeoutInMilliseconds: delayRenderTimeoutInMilliseconds, onImageFrame: onImageFrame, ...props, onError: onErr, className: className }));
|
|
215
217
|
};
|
|
216
218
|
exports.OffthreadVideoForRendering = OffthreadVideoForRendering;
|
|
@@ -48,6 +48,7 @@ const prefetch_js_1 = require("../prefetch.js");
|
|
|
48
48
|
const sequence_activity_context_js_1 = require("../sequence-activity-context.js");
|
|
49
49
|
const SequenceContext_js_1 = require("../SequenceContext.js");
|
|
50
50
|
const use_amplification_js_1 = require("../use-amplification.js");
|
|
51
|
+
const use_media_duration_js_1 = require("../use-media-duration.js");
|
|
51
52
|
const use_media_in_timeline_js_1 = require("../use-media-in-timeline.js");
|
|
52
53
|
const use_media_playback_js_1 = require("../use-media-playback.js");
|
|
53
54
|
const use_media_tag_js_1 = require("../use-media-tag.js");
|
|
@@ -89,11 +90,8 @@ const VideoForDevelopmentRefForwardingFunction = (props, ref) => {
|
|
|
89
90
|
// But useInsertionEffect will fire before other effects, meaning the
|
|
90
91
|
// nodes might still be used. Using rAF to ensure it's after other effects.
|
|
91
92
|
effectToUse(() => {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
sharedSource === null || sharedSource === void 0 ? void 0 : sharedSource.cleanup();
|
|
95
|
-
});
|
|
96
|
-
};
|
|
93
|
+
var _a;
|
|
94
|
+
return use_media_duration_js_1.scheduleMediaSourceCleanup.bind(null, (_a = sharedSource === null || sharedSource === void 0 ? void 0 : sharedSource.cleanup) !== null && _a !== void 0 ? _a : null);
|
|
97
95
|
}, [sharedSource]);
|
|
98
96
|
const { timelineId, userPreferredVolume, isMutedForPlayback, volume, muted, playbackRate, preservePitch, onlyWarnForMediaSeekingError, src, onDuration,
|
|
99
97
|
// @ts-expect-error
|
|
@@ -205,28 +203,8 @@ const VideoForDevelopmentRefForwardingFunction = (props, ref) => {
|
|
|
205
203
|
current.removeEventListener('error', errorHandler);
|
|
206
204
|
};
|
|
207
205
|
}, [onError, src]);
|
|
208
|
-
const currentOnDurationCallback = (0, react_1.useRef)(onDuration);
|
|
209
|
-
currentOnDurationCallback.current = onDuration;
|
|
210
206
|
(0, emit_video_frame_js_1.useEmitVideoFrame)({ ref: videoRef, onVideoFrame });
|
|
211
|
-
(0,
|
|
212
|
-
var _a;
|
|
213
|
-
const { current } = videoRef;
|
|
214
|
-
if (!current) {
|
|
215
|
-
return;
|
|
216
|
-
}
|
|
217
|
-
if (current.duration) {
|
|
218
|
-
(_a = currentOnDurationCallback.current) === null || _a === void 0 ? void 0 : _a.call(currentOnDurationCallback, src, current.duration);
|
|
219
|
-
return;
|
|
220
|
-
}
|
|
221
|
-
const onLoadedMetadata = () => {
|
|
222
|
-
var _a;
|
|
223
|
-
(_a = currentOnDurationCallback.current) === null || _a === void 0 ? void 0 : _a.call(currentOnDurationCallback, src, current.duration);
|
|
224
|
-
};
|
|
225
|
-
current.addEventListener('loadedmetadata', onLoadedMetadata);
|
|
226
|
-
return () => {
|
|
227
|
-
current.removeEventListener('loadedmetadata', onLoadedMetadata);
|
|
228
|
-
};
|
|
229
|
-
}, [src]);
|
|
207
|
+
(0, use_media_duration_js_1.useMediaDuration)(videoRef, onDuration, src, false);
|
|
230
208
|
(0, react_1.useEffect)(() => {
|
|
231
209
|
const { current } = videoRef;
|
|
232
210
|
if (!current) {
|
|
@@ -254,7 +232,7 @@ const VideoForDevelopmentRefForwardingFunction = (props, ref) => {
|
|
|
254
232
|
requestsVideoFrame: Boolean(onVideoFrame),
|
|
255
233
|
isClientSideRendering: false,
|
|
256
234
|
});
|
|
257
|
-
const video = (jsx_runtime_1.jsx("video", { ...nativeProps, ref: videoRef, muted: isMutedForPlayback, playsInline: true, src: actualSrc, loop: _remotionInternalNativeLoopPassed, style: actualStyle, disableRemotePlayback: true, crossOrigin: crossOriginValue, controls: false }));
|
|
235
|
+
const video = ((0, jsx_runtime_1.jsx)("video", { ...nativeProps, ref: videoRef, muted: isMutedForPlayback, playsInline: true, src: actualSrc, loop: _remotionInternalNativeLoopPassed, style: actualStyle, disableRemotePlayback: true, crossOrigin: crossOriginValue, controls: false }));
|
|
258
236
|
return video;
|
|
259
237
|
};
|
|
260
238
|
const VideoForPreviewContent = (0, react_1.forwardRef)(VideoForDevelopmentRefForwardingFunction);
|
|
@@ -303,6 +281,6 @@ const VideoForPreviewRefForwardingFunction = (props, ref) => {
|
|
|
303
281
|
outlineChildrenRef: automaticOutlineRef,
|
|
304
282
|
}
|
|
305
283
|
: null, [automaticOutlineRef, isStudio, registration, timelineId]);
|
|
306
|
-
return (jsx_runtime_1.jsx(committed_metadata_js_1.CommittedMetadataProvider, { value: null, _remotionCommitMetadata: metadata, children: jsx_runtime_1.jsx(sequence_activity_context_js_1.SequenceContent, { children: jsx_runtime_1.jsx(VideoForPreviewContent, { ...props, ref: ref, timelineId: timelineId, userPreferredVolume: userPreferredVolume, isMutedForPlayback: isMutedForPlayback }) }) }));
|
|
284
|
+
return ((0, jsx_runtime_1.jsx)(committed_metadata_js_1.CommittedMetadataProvider, { value: null, _remotionCommitMetadata: metadata, children: (0, jsx_runtime_1.jsx)(sequence_activity_context_js_1.SequenceContent, { children: (0, jsx_runtime_1.jsx)(VideoForPreviewContent, { ...props, ref: ref, timelineId: timelineId, userPreferredVolume: userPreferredVolume, isMutedForPlayback: isMutedForPlayback }) }) }));
|
|
307
285
|
};
|
|
308
286
|
exports.VideoForPreview = (0, react_1.forwardRef)(VideoForPreviewRefForwardingFunction);
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
2
2
|
import type { OnVideoFrame, RemotionVideoProps } from './props';
|
|
3
|
-
|
|
3
|
+
type VideoForRenderingProps = Omit<RemotionVideoProps, 'onVideoFrame'> & {
|
|
4
4
|
readonly onDuration: (src: string, durationInSeconds: number) => void;
|
|
5
|
-
readonly onVideoFrame:
|
|
6
|
-
}
|
|
5
|
+
readonly onVideoFrame: null | OnVideoFrame;
|
|
6
|
+
};
|
|
7
|
+
export declare const VideoForRendering: ForwardRefExoticComponent<VideoForRenderingProps & RefAttributes<HTMLVideoElement>>;
|
|
8
|
+
export {};
|
|
@@ -23,7 +23,7 @@ const emit_video_frame_js_1 = require("./emit-video-frame.js");
|
|
|
23
23
|
const get_current_time_js_1 = require("./get-current-time.js");
|
|
24
24
|
const MediaPlaybackError_js_1 = require("./MediaPlaybackError.js");
|
|
25
25
|
const seek_until_right_js_1 = require("./seek-until-right.js");
|
|
26
|
-
const VideoForRenderingForwardFunction = ({ onError, volume: volumeProp, allowAmplificationDuringRender, playbackRate, onDuration, toneFrequency, name, acceptableTimeShiftInSeconds, delayRenderRetries, delayRenderTimeoutInMilliseconds, loopVolumeCurveBehavior, audioStreamIndex, onVideoFrame, preservePitch
|
|
26
|
+
const VideoForRenderingForwardFunction = ({ onError, volume: volumeProp, allowAmplificationDuringRender, playbackRate, onDuration, toneFrequency, name, acceptableTimeShiftInSeconds, delayRenderRetries, delayRenderTimeoutInMilliseconds, loopVolumeCurveBehavior, audioStreamIndex, onVideoFrame, preservePitch, ...props }, ref) => {
|
|
27
27
|
var _a, _b;
|
|
28
28
|
const absoluteFrame = (0, timeline_position_state_js_1.useTimelinePosition)();
|
|
29
29
|
const frame = (0, use_current_frame_js_1.useCurrentFrame)();
|
|
@@ -83,6 +83,7 @@ const VideoForRenderingForwardFunction = ({ onError, volume: volumeProp, allowAm
|
|
|
83
83
|
toneFrequency: toneFrequency !== null && toneFrequency !== void 0 ? toneFrequency : 1,
|
|
84
84
|
audioStartFrame,
|
|
85
85
|
audioStreamIndex: audioStreamIndex !== null && audioStreamIndex !== void 0 ? audioStreamIndex : 0,
|
|
86
|
+
preservePitch: preservePitch !== null && preservePitch !== void 0 ? preservePitch : true,
|
|
86
87
|
});
|
|
87
88
|
return () => unregisterRenderAsset(id);
|
|
88
89
|
}, [
|
|
@@ -99,6 +100,7 @@ const VideoForRenderingForwardFunction = ({ onError, volume: volumeProp, allowAm
|
|
|
99
100
|
audioStartFrame,
|
|
100
101
|
sequencePlaybackRate,
|
|
101
102
|
audioStreamIndex,
|
|
103
|
+
preservePitch,
|
|
102
104
|
]);
|
|
103
105
|
(0, react_1.useImperativeHandle)(ref, () => {
|
|
104
106
|
return videoRef.current;
|
|
@@ -239,6 +241,6 @@ const VideoForRenderingForwardFunction = ({ onError, volume: volumeProp, allowAm
|
|
|
239
241
|
delayRender,
|
|
240
242
|
]);
|
|
241
243
|
}
|
|
242
|
-
return jsx_runtime_1.jsx("video", { ref: videoRef, disableRemotePlayback: true, ...props });
|
|
244
|
+
return (0, jsx_runtime_1.jsx)("video", { ref: videoRef, disableRemotePlayback: true, ...props });
|
|
243
245
|
};
|
|
244
246
|
exports.VideoForRendering = (0, react_1.forwardRef)(VideoForRenderingForwardFunction);
|
|
@@ -10,6 +10,7 @@ type TDurationsContext = {
|
|
|
10
10
|
durations: DurationState;
|
|
11
11
|
setDurations: React.Dispatch<DurationAction>;
|
|
12
12
|
};
|
|
13
|
+
export declare const onMediaDuration: (setDurations: TDurationsContext['setDurations'], src: string, durationInSeconds: number) => void;
|
|
13
14
|
export declare const DurationsContext: React.Context<TDurationsContext>;
|
|
14
15
|
export declare const DurationsContextProvider: React.FC<{
|
|
15
16
|
readonly children: React.ReactNode;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DurationsContextProvider = exports.DurationsContext = exports.durationReducer = void 0;
|
|
3
|
+
exports.DurationsContextProvider = exports.DurationsContext = exports.onMediaDuration = exports.durationReducer = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const absolute_src_js_1 = require("../absolute-src.js");
|
|
@@ -21,6 +21,12 @@ const durationReducer = (state, action) => {
|
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
23
|
exports.durationReducer = durationReducer;
|
|
24
|
+
// Bind this function outside component render scopes so the stable duration
|
|
25
|
+
// callback cannot keep unrelated, replaced media props alive.
|
|
26
|
+
const onMediaDuration = (setDurations, src, durationInSeconds) => {
|
|
27
|
+
setDurations({ type: 'got-duration', durationInSeconds, src });
|
|
28
|
+
};
|
|
29
|
+
exports.onMediaDuration = onMediaDuration;
|
|
24
30
|
exports.DurationsContext = (0, react_1.createContext)({
|
|
25
31
|
durations: {},
|
|
26
32
|
setDurations: () => {
|
|
@@ -35,6 +41,6 @@ const DurationsContextProvider = ({ children }) => {
|
|
|
35
41
|
setDurations,
|
|
36
42
|
};
|
|
37
43
|
}, [durations]);
|
|
38
|
-
return (jsx_runtime_1.jsx(exports.DurationsContext.Provider, { value: value, children: children }));
|
|
44
|
+
return ((0, jsx_runtime_1.jsx)(exports.DurationsContext.Provider, { value: value, children: children }));
|
|
39
45
|
};
|
|
40
46
|
exports.DurationsContextProvider = DurationsContextProvider;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { OnVideoFrame } from './props';
|
|
2
2
|
export declare const useEmitVideoFrame: ({ ref, onVideoFrame, }: {
|
|
3
|
-
ref:
|
|
3
|
+
ref: React.RefObject<HTMLVideoElement | null>;
|
|
4
4
|
onVideoFrame: OnVideoFrame | null;
|
|
5
5
|
}) => void;
|
|
@@ -4,54 +4,54 @@ import React from 'react';
|
|
|
4
4
|
* @see [Documentation](https://www.remotion.dev/docs/html5-video)
|
|
5
5
|
*/
|
|
6
6
|
export declare const Html5Video: React.ForwardRefExoticComponent<Omit<import("./props").NativeVideoProps & {
|
|
7
|
-
name?: string
|
|
8
|
-
volume?: import("../volume-prop.js").VolumeProp
|
|
9
|
-
playbackRate?: number
|
|
10
|
-
preservePitch?: boolean
|
|
11
|
-
acceptableTimeShiftInSeconds?: number
|
|
12
|
-
allowAmplificationDuringRender?: boolean
|
|
13
|
-
useWebAudioApi?: boolean
|
|
14
|
-
toneFrequency?: number
|
|
15
|
-
pauseWhenBuffering?: boolean
|
|
16
|
-
showInTimeline?: boolean
|
|
17
|
-
delayRenderTimeoutInMilliseconds?: number
|
|
18
|
-
loopVolumeCurveBehavior?: import("../index.js").LoopVolumeCurveBehavior
|
|
19
|
-
delayRenderRetries?: number
|
|
20
|
-
onError?: (
|
|
21
|
-
onAutoPlayError?: (() => void)
|
|
22
|
-
onVideoFrame?: import("./props").OnVideoFrame
|
|
23
|
-
audioStreamIndex?: number
|
|
7
|
+
name?: string;
|
|
8
|
+
volume?: import("../volume-prop.js").VolumeProp;
|
|
9
|
+
playbackRate?: number;
|
|
10
|
+
preservePitch?: boolean;
|
|
11
|
+
acceptableTimeShiftInSeconds?: number;
|
|
12
|
+
allowAmplificationDuringRender?: boolean;
|
|
13
|
+
useWebAudioApi?: boolean;
|
|
14
|
+
toneFrequency?: number;
|
|
15
|
+
pauseWhenBuffering?: boolean;
|
|
16
|
+
showInTimeline?: boolean;
|
|
17
|
+
delayRenderTimeoutInMilliseconds?: number;
|
|
18
|
+
loopVolumeCurveBehavior?: import("../index.js").LoopVolumeCurveBehavior;
|
|
19
|
+
delayRenderRetries?: number;
|
|
20
|
+
onError?: (err: Error) => void;
|
|
21
|
+
onAutoPlayError?: null | (() => void);
|
|
22
|
+
onVideoFrame?: import("./props").OnVideoFrame;
|
|
23
|
+
audioStreamIndex?: number;
|
|
24
24
|
} & Partial<import("./props").CommonVideoProps> & {
|
|
25
25
|
/**
|
|
26
26
|
* @deprecated For internal use only
|
|
27
27
|
*/
|
|
28
|
-
readonly _remotionInternalStack?: string
|
|
28
|
+
readonly _remotionInternalStack?: string;
|
|
29
29
|
}, "ref"> & React.RefAttributes<HTMLVideoElement>>;
|
|
30
30
|
/**
|
|
31
31
|
* @deprecated This component has been renamed to `Html5Video`.
|
|
32
32
|
* @see [Documentation](https://www.remotion.dev/docs/html5-video)
|
|
33
33
|
*/
|
|
34
34
|
export declare const Video: React.ForwardRefExoticComponent<Omit<import("./props").NativeVideoProps & {
|
|
35
|
-
name?: string
|
|
36
|
-
volume?: import("../volume-prop.js").VolumeProp
|
|
37
|
-
playbackRate?: number
|
|
38
|
-
preservePitch?: boolean
|
|
39
|
-
acceptableTimeShiftInSeconds?: number
|
|
40
|
-
allowAmplificationDuringRender?: boolean
|
|
41
|
-
useWebAudioApi?: boolean
|
|
42
|
-
toneFrequency?: number
|
|
43
|
-
pauseWhenBuffering?: boolean
|
|
44
|
-
showInTimeline?: boolean
|
|
45
|
-
delayRenderTimeoutInMilliseconds?: number
|
|
46
|
-
loopVolumeCurveBehavior?: import("../index.js").LoopVolumeCurveBehavior
|
|
47
|
-
delayRenderRetries?: number
|
|
48
|
-
onError?: (
|
|
49
|
-
onAutoPlayError?: (() => void)
|
|
50
|
-
onVideoFrame?: import("./props").OnVideoFrame
|
|
51
|
-
audioStreamIndex?: number
|
|
35
|
+
name?: string;
|
|
36
|
+
volume?: import("../volume-prop.js").VolumeProp;
|
|
37
|
+
playbackRate?: number;
|
|
38
|
+
preservePitch?: boolean;
|
|
39
|
+
acceptableTimeShiftInSeconds?: number;
|
|
40
|
+
allowAmplificationDuringRender?: boolean;
|
|
41
|
+
useWebAudioApi?: boolean;
|
|
42
|
+
toneFrequency?: number;
|
|
43
|
+
pauseWhenBuffering?: boolean;
|
|
44
|
+
showInTimeline?: boolean;
|
|
45
|
+
delayRenderTimeoutInMilliseconds?: number;
|
|
46
|
+
loopVolumeCurveBehavior?: import("../index.js").LoopVolumeCurveBehavior;
|
|
47
|
+
delayRenderRetries?: number;
|
|
48
|
+
onError?: (err: Error) => void;
|
|
49
|
+
onAutoPlayError?: null | (() => void);
|
|
50
|
+
onVideoFrame?: import("./props").OnVideoFrame;
|
|
51
|
+
audioStreamIndex?: number;
|
|
52
52
|
} & Partial<import("./props").CommonVideoProps> & {
|
|
53
53
|
/**
|
|
54
54
|
* @deprecated For internal use only
|
|
55
55
|
*/
|
|
56
|
-
readonly _remotionInternalStack?: string
|
|
56
|
+
readonly _remotionInternalStack?: string;
|
|
57
57
|
}, "ref"> & React.RefAttributes<HTMLVideoElement>>;
|
|
@@ -38,9 +38,7 @@ const VideoForwardingFunction = (props, ref) => {
|
|
|
38
38
|
throw new TypeError(`The \`<Html5Video>\` tag requires a string for \`src\`, but got ${JSON.stringify(props.src)} instead.`);
|
|
39
39
|
}
|
|
40
40
|
const preloadedSrc = (0, prefetch_js_1.usePreload)(props.src);
|
|
41
|
-
const onDuration = (0, react_1.
|
|
42
|
-
setDurations({ type: 'got-duration', durationInSeconds, src });
|
|
43
|
-
}, [setDurations]);
|
|
41
|
+
const onDuration = (0, react_1.useMemo)(() => duration_state_js_1.onMediaDuration.bind(null, setDurations), [setDurations]);
|
|
44
42
|
const durationFetched = (_a = durations[(0, absolute_src_js_1.getAbsoluteSrc)(preloadedSrc)]) !== null && _a !== void 0 ? _a : durations[(0, absolute_src_js_1.getAbsoluteSrc)(props.src)];
|
|
45
43
|
(0, validate_start_from_props_js_1.validateMediaTrimProps)({ startFrom, endAt, trimBefore, trimAfter });
|
|
46
44
|
if (durationInFrames !== undefined) {
|
|
@@ -65,22 +63,22 @@ const VideoForwardingFunction = (props, ref) => {
|
|
|
65
63
|
const loopDuration = effectiveTrimAfter !== null && effectiveTrimAfter !== void 0 ? effectiveTrimAfter : (durationFetched === undefined ? undefined : durationFetched * fps);
|
|
66
64
|
if (loop && loopDuration !== undefined) {
|
|
67
65
|
if (!Number.isFinite(loopDuration)) {
|
|
68
|
-
return (jsx_runtime_1.jsx(exports.Html5Video, { ...propsOtherThanLoop, ref: ref, _remotionInternalStack: _remotionInternalStack, _remotionInternalNativeLoopPassed: true }));
|
|
66
|
+
return ((0, jsx_runtime_1.jsx)(exports.Html5Video, { ...propsOtherThanLoop, ref: ref, _remotionInternalStack: _remotionInternalStack, _remotionInternalNativeLoopPassed: true }));
|
|
69
67
|
}
|
|
70
|
-
return (jsx_runtime_1.jsx(index_js_1.Loop, { durationInFrames: (0, calculate_media_duration_js_1.calculateMediaDuration)({
|
|
68
|
+
return ((0, jsx_runtime_1.jsx)(index_js_1.Loop, { durationInFrames: (0, calculate_media_duration_js_1.calculateMediaDuration)({
|
|
71
69
|
trimAfter: effectiveTrimAfter,
|
|
72
70
|
mediaDurationInFrames: loopDuration,
|
|
73
71
|
playbackRate: (_b = props.playbackRate) !== null && _b !== void 0 ? _b : 1,
|
|
74
72
|
trimBefore: trimBeforeValue,
|
|
75
|
-
}), layout: "none", name: name, showInTimeline: false, children: jsx_runtime_1.jsx(exports.Html5Video, { ...propsOtherThanLoop, ref: ref, _remotionInternalStack: _remotionInternalStack, _remotionInternalNativeLoopPassed: true }) }));
|
|
73
|
+
}), layout: "none", name: name, showInTimeline: false, children: (0, jsx_runtime_1.jsx)(exports.Html5Video, { ...propsOtherThanLoop, ref: ref, _remotionInternalStack: _remotionInternalStack, _remotionInternalNativeLoopPassed: true }) }));
|
|
76
74
|
}
|
|
77
75
|
if (typeof trimBeforeValue !== 'undefined' ||
|
|
78
76
|
typeof effectiveTrimAfter !== 'undefined') {
|
|
79
|
-
return (jsx_runtime_1.jsx(use_audio_frame_js_1.Html5MediaTrimContext.Provider, { value: trimBeforeValue !== null && trimBeforeValue !== void 0 ? trimBeforeValue : 0, children: jsx_runtime_1.jsx(Sequence_js_1.Sequence, { layout: "none", from: 0 - (trimBeforeValue !== null && trimBeforeValue !== void 0 ? trimBeforeValue : 0), showInTimeline: false, durationInFrames: effectiveTrimAfter === undefined
|
|
77
|
+
return ((0, jsx_runtime_1.jsx)(use_audio_frame_js_1.Html5MediaTrimContext.Provider, { value: trimBeforeValue !== null && trimBeforeValue !== void 0 ? trimBeforeValue : 0, children: (0, jsx_runtime_1.jsx)(Sequence_js_1.Sequence, { layout: "none", from: 0 - (trimBeforeValue !== null && trimBeforeValue !== void 0 ? trimBeforeValue : 0), showInTimeline: false, durationInFrames: effectiveTrimAfter === undefined
|
|
80
78
|
? undefined
|
|
81
79
|
: (trimBeforeValue !== null && trimBeforeValue !== void 0 ? trimBeforeValue : 0) +
|
|
82
80
|
(effectiveTrimAfter - (trimBeforeValue !== null && trimBeforeValue !== void 0 ? trimBeforeValue : 0)) /
|
|
83
|
-
((_c = props.playbackRate) !== null && _c !== void 0 ? _c : 1), name: name, children: jsx_runtime_1.jsx(exports.Html5Video, { pauseWhenBuffering: shouldPauseWhenBuffering, onVideoFrame: onVideoFrame, ...otherProps, ref: ref, showInTimeline: showInTimeline, _remotionInternalStack: _remotionInternalStack }) }) }));
|
|
81
|
+
((_c = props.playbackRate) !== null && _c !== void 0 ? _c : 1), name: name, children: (0, jsx_runtime_1.jsx)(exports.Html5Video, { pauseWhenBuffering: shouldPauseWhenBuffering, onVideoFrame: onVideoFrame, ...otherProps, ref: ref, showInTimeline: showInTimeline, _remotionInternalStack: _remotionInternalStack }) }) }));
|
|
84
82
|
}
|
|
85
83
|
(0, validate_media_props_js_1.validateMediaProps)({
|
|
86
84
|
playbackRate: props.playbackRate,
|
|
@@ -88,9 +86,9 @@ const VideoForwardingFunction = (props, ref) => {
|
|
|
88
86
|
volume: props.volume,
|
|
89
87
|
}, 'Html5Video');
|
|
90
88
|
if (environment.isRendering) {
|
|
91
|
-
return (jsx_runtime_1.jsx(VideoForRendering_js_1.VideoForRendering, { onDuration: onDuration, onVideoFrame: onVideoFrame !== null && onVideoFrame !== void 0 ? onVideoFrame : null, ...otherProps, ref: ref }));
|
|
89
|
+
return ((0, jsx_runtime_1.jsx)(VideoForRendering_js_1.VideoForRendering, { onDuration: onDuration, onVideoFrame: onVideoFrame !== null && onVideoFrame !== void 0 ? onVideoFrame : null, ...otherProps, ref: ref }));
|
|
92
90
|
}
|
|
93
|
-
return (jsx_runtime_1.jsx(VideoForPreview_js_1.VideoForPreview, { onlyWarnForMediaSeekingError: false, ...otherProps, ref: ref, onVideoFrame: onVideoFrame !== null && onVideoFrame !== void 0 ? onVideoFrame : null, pauseWhenBuffering: shouldPauseWhenBuffering, onDuration: onDuration, _remotionInternalStack: _remotionInternalStack !== null && _remotionInternalStack !== void 0 ? _remotionInternalStack : null, _remotionInternalNativeLoopPassed: _remotionInternalNativeLoopPassed !== null && _remotionInternalNativeLoopPassed !== void 0 ? _remotionInternalNativeLoopPassed : false, showInTimeline: showInTimeline !== null && showInTimeline !== void 0 ? showInTimeline : true, onAutoPlayError: onAutoPlayError !== null && onAutoPlayError !== void 0 ? onAutoPlayError : undefined }));
|
|
91
|
+
return ((0, jsx_runtime_1.jsx)(VideoForPreview_js_1.VideoForPreview, { onlyWarnForMediaSeekingError: false, ...otherProps, ref: ref, onVideoFrame: onVideoFrame !== null && onVideoFrame !== void 0 ? onVideoFrame : null, pauseWhenBuffering: shouldPauseWhenBuffering, onDuration: onDuration, _remotionInternalStack: _remotionInternalStack !== null && _remotionInternalStack !== void 0 ? _remotionInternalStack : null, _remotionInternalNativeLoopPassed: _remotionInternalNativeLoopPassed !== null && _remotionInternalNativeLoopPassed !== void 0 ? _remotionInternalNativeLoopPassed : false, showInTimeline: showInTimeline !== null && showInTimeline !== void 0 ? showInTimeline : true, onAutoPlayError: onAutoPlayError !== null && onAutoPlayError !== void 0 ? onAutoPlayError : undefined }));
|
|
94
92
|
};
|
|
95
93
|
/**
|
|
96
94
|
* @description Wraps the native `<video>` element to include video in your component that is synchronized with Remotion's time.
|
package/dist/cjs/video/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Video = exports.Html5Video = exports.OffthreadVideo = void 0;
|
|
4
|
-
|
|
4
|
+
var OffthreadVideo_js_1 = require("./OffthreadVideo.js");
|
|
5
5
|
Object.defineProperty(exports, "OffthreadVideo", { enumerable: true, get: function () { return OffthreadVideo_js_1.OffthreadVideo; } });
|
|
6
|
-
|
|
6
|
+
var html5_video_js_1 = require("./html5-video.js");
|
|
7
7
|
Object.defineProperty(exports, "Html5Video", { enumerable: true, get: function () { return html5_video_js_1.Html5Video; } });
|
|
8
8
|
Object.defineProperty(exports, "Video", { enumerable: true, get: function () { return html5_video_js_1.Video; } });
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { type LogLevel } from '../log';
|
|
1
2
|
export declare const seekToTime: ({ element, desiredTime, logLevel, mountTime, }: {
|
|
2
3
|
element: HTMLVideoElement;
|
|
3
4
|
desiredTime: number;
|
|
4
|
-
logLevel:
|
|
5
|
+
logLevel: LogLevel;
|
|
5
6
|
mountTime: number;
|
|
6
7
|
}) => {
|
|
7
8
|
wait: Promise<number>;
|
|
@@ -11,7 +12,7 @@ export declare const seekToTimeMultipleUntilRight: ({ element, desiredTime, fps,
|
|
|
11
12
|
element: HTMLVideoElement;
|
|
12
13
|
desiredTime: number;
|
|
13
14
|
fps: number;
|
|
14
|
-
logLevel:
|
|
15
|
+
logLevel: LogLevel;
|
|
15
16
|
mountTime: number;
|
|
16
17
|
}) => {
|
|
17
18
|
prom: Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const warnAboutNonSeekableMedia: (ref: HTMLMediaElement | null, type:
|
|
1
|
+
export declare const warnAboutNonSeekableMedia: (ref: HTMLMediaElement | null, type: 'console-warning' | 'console-error' | 'exception') => void;
|
|
@@ -7,7 +7,7 @@ export declare const getRuntimeValueForSchemaKey: ({ flatSchema, key, props, }:
|
|
|
7
7
|
key: string;
|
|
8
8
|
props: Record<string, unknown>;
|
|
9
9
|
}) => unknown;
|
|
10
|
-
export declare const readValuesFromProps: (props: Record<string, unknown>, keys: string[], flatSchema?: InteractivitySchema
|
|
10
|
+
export declare const readValuesFromProps: (props: Record<string, unknown>, keys: string[], flatSchema?: InteractivitySchema) => Record<string, unknown>;
|
|
11
11
|
export declare const selectActiveKeys: (schema: InteractivitySchema, values: Record<string, unknown>) => string[];
|
|
12
12
|
export declare const mergeValues: ({ flatSchema, props, valuesDotNotation, schemaKeys, propsToDelete, }: {
|
|
13
13
|
flatSchema: InteractivitySchema;
|
|
@@ -167,8 +167,6 @@ const withInteractivitySchema = ({ Component, componentName, componentIdentity =
|
|
|
167
167
|
});
|
|
168
168
|
}
|
|
169
169
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
170
|
-
const { propStatuses } = (0, react_1.useContext)(SequenceManager_js_1.VisualModePropStatusesContext);
|
|
171
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
172
170
|
const nodePathMapping = (0, react_1.useContext)(sequence_node_path_js_1.OverrideIdsToNodePathsGettersContext);
|
|
173
171
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
174
172
|
const videoConfig = (0, use_unsafe_video_config_js_1.useUnsafeVideoConfig)();
|
|
@@ -228,12 +226,9 @@ const withInteractivitySchema = ({ Component, componentName, componentIdentity =
|
|
|
228
226
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
229
227
|
const dragOverrides = (0, SequenceManager_js_1.useDragOverridesForNodePath)(nodePath);
|
|
230
228
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
231
|
-
const
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
...nodePath,
|
|
235
|
-
videoConfigValues,
|
|
236
|
-
}), [nodePath, propStatuses, videoConfigValues]);
|
|
229
|
+
const sequenceStatus = (0, SequenceManager_js_1.usePropStatusForNodePath)(nodePath);
|
|
230
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
231
|
+
const propStatus = (0, react_1.useMemo)(() => (0, use_memoized_effects_js_1.getPropStatusesForSequenceStatus)(sequenceStatus, videoConfigValues), [sequenceStatus, videoConfigValues]);
|
|
237
232
|
// Runtime props already update through their owner. Only overrides with
|
|
238
233
|
// keyframes need this wrapper to subscribe to the advancing clock.
|
|
239
234
|
const needsFrame = flatKeys.some((key) => {
|
|
@@ -16,17 +16,17 @@ export declare function useRemotionContexts(): {
|
|
|
16
16
|
};
|
|
17
17
|
resolveCompositionContext: {
|
|
18
18
|
[x: string]: ({
|
|
19
|
-
type:
|
|
19
|
+
type: 'loading';
|
|
20
20
|
} | {
|
|
21
|
-
type:
|
|
21
|
+
type: 'success';
|
|
22
22
|
result: import("./video-config.js").VideoConfig;
|
|
23
23
|
metadataSource: import("./resolve-video-config.js").VideoConfigMetadataSource | null;
|
|
24
24
|
} | {
|
|
25
|
-
type:
|
|
25
|
+
type: 'success-and-refreshing';
|
|
26
26
|
result: import("./video-config.js").VideoConfig;
|
|
27
27
|
metadataSource: import("./resolve-video-config.js").VideoConfigMetadataSource | null;
|
|
28
28
|
} | {
|
|
29
|
-
type:
|
|
29
|
+
type: 'error';
|
|
30
30
|
error: Error;
|
|
31
31
|
}) | undefined;
|
|
32
32
|
} | null;
|