remotion 3.3.52 → 3.3.53
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/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/version.d.ts +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/tsconfig-cjs.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/dist/AbsoluteFill.d.ts +0 -6
- package/dist/AbsoluteFill.js +0 -28
- package/dist/CanUseRemotionHooks.d.ts +0 -5
- package/dist/CanUseRemotionHooks.js +0 -10
- package/dist/Clipper.d.ts +0 -7
- package/dist/Clipper.js +0 -24
- package/dist/Composition.d.ts +0 -23
- package/dist/Composition.js +0 -113
- package/dist/CompositionManager.d.ts +0 -82
- package/dist/CompositionManager.js +0 -164
- package/dist/Folder.d.ts +0 -15
- package/dist/Folder.js +0 -33
- package/dist/IFrame.d.ts +0 -2
- package/dist/IFrame.js +0 -24
- package/dist/Img.d.ts +0 -2
- package/dist/Img.js +0 -52
- package/dist/NativeLayers.d.ts +0 -13
- package/dist/NativeLayers.js +0 -29
- package/dist/Null.d.ts +0 -2
- package/dist/Null.js +0 -25
- package/dist/RemotionRoot.d.ts +0 -5
- package/dist/RemotionRoot.js +0 -73
- package/dist/Sequence.d.ts +0 -29
- package/dist/Sequence.js +0 -131
- package/dist/Still.d.ts +0 -2
- package/dist/Still.js +0 -9
- package/dist/absolute-src.d.ts +0 -1
- package/dist/absolute-src.js +0 -7
- package/dist/asset-types.d.ts +0 -50
- package/dist/asset-types.js +0 -1
- package/dist/audio/Audio.d.ts +0 -8
- package/dist/audio/Audio.js +0 -52
- package/dist/audio/AudioForDevelopment.d.ts +0 -11
- package/dist/audio/AudioForDevelopment.js +0 -94
- package/dist/audio/AudioForRendering.d.ts +0 -10
- package/dist/audio/AudioForRendering.js +0 -111
- package/dist/audio/index.d.ts +0 -2
- package/dist/audio/index.js +0 -18
- package/dist/audio/props.d.ts +0 -12
- package/dist/audio/props.js +0 -2
- package/dist/audio/shared-audio-tags.d.ts +0 -37
- package/dist/audio/shared-audio-tags.js +0 -222
- package/dist/audio/use-audio-frame.d.ts +0 -6
- package/dist/audio/use-audio-frame.js +0 -23
- package/dist/bezier.d.ts +0 -1
- package/dist/bezier.js +0 -114
- package/dist/cancel-render.d.ts +0 -1
- package/dist/cancel-render.js +0 -43
- package/dist/config/input-props.d.ts +0 -1
- package/dist/config/input-props.js +0 -31
- package/dist/config.d.ts +0 -285
- package/dist/config.js +0 -21
- package/dist/default-css.d.ts +0 -3
- package/dist/default-css.js +0 -49
- package/dist/delay-render.d.ts +0 -14
- package/dist/delay-render.js +0 -77
- package/dist/easing.d.ts +0 -19
- package/dist/easing.js +0 -77
- package/dist/freeze.d.ts +0 -7
- package/dist/freeze.js +0 -34
- package/dist/get-asset-file-name.d.ts +0 -1
- package/dist/get-asset-file-name.js +0 -14
- package/dist/get-environment.d.ts +0 -3
- package/dist/get-environment.js +0 -34
- package/dist/get-preview-dom-element.d.ts +0 -1
- package/dist/get-preview-dom-element.js +0 -7
- package/dist/get-static-files.d.ts +0 -17
- package/dist/get-static-files.js +0 -31
- package/dist/get-timeline-clip-name.d.ts +0 -1
- package/dist/get-timeline-clip-name.js +0 -25
- package/dist/index.d.ts +0 -92
- package/dist/index.js +0 -73
- package/dist/internals.d.ts +0 -97
- package/dist/internals.js +0 -99
- package/dist/interpolate-colors.d.ts +0 -5
- package/dist/interpolate-colors.js +0 -401
- package/dist/interpolate.d.ts +0 -18
- package/dist/interpolate.js +0 -123
- package/dist/is-approximately-the-same.d.ts +0 -1
- package/dist/is-approximately-the-same.js +0 -8
- package/dist/is-player.d.ts +0 -3
- package/dist/is-player.js +0 -14
- package/dist/loading-indicator.d.ts +0 -2
- package/dist/loading-indicator.js +0 -35
- package/dist/loop/index.d.ts +0 -9
- package/dist/loop/index.js +0 -29
- package/dist/multiple-versions-warning.d.ts +0 -1
- package/dist/multiple-versions-warning.js +0 -32
- package/dist/nonce.d.ts +0 -7
- package/dist/nonce.js +0 -17
- package/dist/play-and-handle-not-allowed-error.d.ts +0 -2
- package/dist/play-and-handle-not-allowed-error.js +0 -44
- package/dist/portal-node.d.ts +0 -1
- package/dist/portal-node.js +0 -23
- package/dist/prefetch-state.d.ts +0 -8
- package/dist/prefetch-state.js +0 -27
- package/dist/prefetch.d.ts +0 -9
- package/dist/prefetch.js +0 -108
- package/dist/random.d.ts +0 -7
- package/dist/random.js +0 -41
- package/dist/register-root.d.ts +0 -4
- package/dist/register-root.js +0 -33
- package/dist/series/flatten-children.d.ts +0 -2
- package/dist/series/flatten-children.js +0 -19
- package/dist/series/index.d.ts +0 -13
- package/dist/series/index.js +0 -60
- package/dist/setup-env-variables.d.ts +0 -2
- package/dist/setup-env-variables.js +0 -36
- package/dist/spring/index.d.ts +0 -27
- package/dist/spring/index.js +0 -51
- package/dist/spring/measure-spring.d.ts +0 -8
- package/dist/spring/measure-spring.js +0 -64
- package/dist/spring/spring-utils.d.ts +0 -21
- package/dist/spring/spring-utils.js +0 -103
- package/dist/static-file.d.ts +0 -5
- package/dist/static-file.js +0 -33
- package/dist/timeline-position-state.d.ts +0 -29
- package/dist/timeline-position-state.js +0 -41
- package/dist/truthy.d.ts +0 -3
- package/dist/truthy.js +0 -7
- package/dist/use-current-frame.d.ts +0 -6
- package/dist/use-current-frame.js +0 -28
- package/dist/use-lazy-component.d.ts +0 -7
- package/dist/use-lazy-component.js +0 -49
- package/dist/use-media-in-timeline.d.ts +0 -10
- package/dist/use-media-in-timeline.js +0 -129
- package/dist/use-media-playback.d.ts +0 -10
- package/dist/use-media-playback.js +0 -77
- package/dist/use-media-tag-volume.d.ts +0 -2
- package/dist/use-media-tag-volume.js +0 -31
- package/dist/use-sync-volume-with-media-tag.d.ts +0 -10
- package/dist/use-sync-volume-with-media-tag.js +0 -21
- package/dist/use-unsafe-video-config.d.ts +0 -2
- package/dist/use-unsafe-video-config.js +0 -27
- package/dist/use-video-config.d.ts +0 -7
- package/dist/use-video-config.js +0 -29
- package/dist/use-video.d.ts +0 -12
- package/dist/use-video.js +0 -28
- package/dist/validate-media-props.d.ts +0 -4
- package/dist/validate-media-props.js +0 -24
- package/dist/validate-start-from-props.d.ts +0 -1
- package/dist/validate-start-from-props.js +0 -31
- package/dist/validation/validate-composition-id.d.ts +0 -3
- package/dist/validation/validate-composition-id.js +0 -13
- package/dist/validation/validate-dimensions.d.ts +0 -1
- package/dist/validation/validate-dimensions.js +0 -21
- package/dist/validation/validate-duration-in-frames.d.ts +0 -1
- package/dist/validation/validate-duration-in-frames.js +0 -15
- package/dist/validation/validate-folder-name.d.ts +0 -3
- package/dist/validation/validate-folder-name.js +0 -19
- package/dist/validation/validate-fps.d.ts +0 -1
- package/dist/validation/validate-fps.js +0 -21
- package/dist/validation/validate-offthreadvideo-image-format.d.ts +0 -1
- package/dist/validation/validate-offthreadvideo-image-format.js +0 -15
- package/dist/validation/validation-spring-duration.d.ts +0 -1
- package/dist/validation/validation-spring-duration.js +0 -21
- package/dist/version.d.ts +0 -1
- package/dist/version.js +0 -5
- package/dist/video/OffthreadVideo.d.ts +0 -3
- package/dist/video/OffthreadVideo.js +0 -33
- package/dist/video/OffthreadVideoForRendering.d.ts +0 -3
- package/dist/video/OffthreadVideoForRendering.js +0 -104
- package/dist/video/Video.d.ts +0 -8
- package/dist/video/Video.js +0 -50
- package/dist/video/VideoForDevelopment.d.ts +0 -11
- package/dist/video/VideoForDevelopment.js +0 -113
- package/dist/video/VideoForRendering.d.ts +0 -10
- package/dist/video/VideoForRendering.js +0 -203
- package/dist/video/duration-state.d.ts +0 -17
- package/dist/video/duration-state.js +0 -34
- package/dist/video/get-current-time.d.ts +0 -13
- package/dist/video/get-current-time.js +0 -31
- package/dist/video/index.d.ts +0 -3
- package/dist/video/index.js +0 -7
- package/dist/video/props.d.ts +0 -25
- package/dist/video/props.js +0 -2
- package/dist/video/video-fragment.d.ts +0 -12
- package/dist/video/video-fragment.js +0 -60
- package/dist/video-config.d.ts +0 -8
- package/dist/video-config.js +0 -2
- package/dist/volume-position-state.d.ts +0 -19
- package/dist/volume-position-state.js +0 -32
- package/dist/volume-prop.d.ts +0 -7
- package/dist/volume-prop.js +0 -24
- package/dist/warn-about-non-seekable-media.d.ts +0 -1
- package/dist/warn-about-non-seekable-media.js +0 -34
- package/dist/wrap-remotion-context.d.ts +0 -18
- package/dist/wrap-remotion-context.js +0 -73
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useMediaTagVolume = void 0;
|
|
4
|
-
const react_1 = require("react");
|
|
5
|
-
// Returns the real volume of the audio or video while playing,
|
|
6
|
-
// no matter what the supposed volume should be
|
|
7
|
-
const useMediaTagVolume = (mediaRef) => {
|
|
8
|
-
const [actualVolume, setActualVolume] = (0, react_1.useState)(1);
|
|
9
|
-
(0, react_1.useEffect)(() => {
|
|
10
|
-
const ref = mediaRef.current;
|
|
11
|
-
if (!ref) {
|
|
12
|
-
return;
|
|
13
|
-
}
|
|
14
|
-
const onChange = () => {
|
|
15
|
-
setActualVolume(ref.volume);
|
|
16
|
-
};
|
|
17
|
-
ref.addEventListener('volumechange', onChange);
|
|
18
|
-
return () => ref.removeEventListener('volumechange', onChange);
|
|
19
|
-
}, [mediaRef]);
|
|
20
|
-
(0, react_1.useEffect)(() => {
|
|
21
|
-
const ref = mediaRef.current;
|
|
22
|
-
if (!ref) {
|
|
23
|
-
return;
|
|
24
|
-
}
|
|
25
|
-
if (ref.volume !== actualVolume) {
|
|
26
|
-
setActualVolume(ref.volume);
|
|
27
|
-
}
|
|
28
|
-
}, [actualVolume, mediaRef]);
|
|
29
|
-
return actualVolume;
|
|
30
|
-
};
|
|
31
|
-
exports.useMediaTagVolume = useMediaTagVolume;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { RefObject } from 'react';
|
|
2
|
-
import type { VolumeProp } from './volume-prop';
|
|
3
|
-
export declare type UseSyncVolumeWithMediaTagOptions = {
|
|
4
|
-
volumePropFrame: number;
|
|
5
|
-
actualVolume: number;
|
|
6
|
-
volume?: VolumeProp;
|
|
7
|
-
mediaVolume: number;
|
|
8
|
-
mediaRef: RefObject<HTMLVideoElement | HTMLAudioElement>;
|
|
9
|
-
};
|
|
10
|
-
export declare const useSyncVolumeWithMediaTag: ({ volumePropFrame, actualVolume, volume, mediaVolume, mediaRef, }: UseSyncVolumeWithMediaTagOptions) => void;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useSyncVolumeWithMediaTag = void 0;
|
|
4
|
-
const react_1 = require("react");
|
|
5
|
-
const is_approximately_the_same_1 = require("./is-approximately-the-same");
|
|
6
|
-
const volume_prop_1 = require("./volume-prop");
|
|
7
|
-
const useSyncVolumeWithMediaTag = ({ volumePropFrame, actualVolume, volume, mediaVolume, mediaRef, }) => {
|
|
8
|
-
(0, react_1.useEffect)(() => {
|
|
9
|
-
const userPreferredVolume = (0, volume_prop_1.evaluateVolume)({
|
|
10
|
-
frame: volumePropFrame,
|
|
11
|
-
volume,
|
|
12
|
-
mediaVolume,
|
|
13
|
-
allowAmplificationDuringRender: false,
|
|
14
|
-
});
|
|
15
|
-
if (!(0, is_approximately_the_same_1.isApproximatelyTheSame)(userPreferredVolume, actualVolume) &&
|
|
16
|
-
mediaRef.current) {
|
|
17
|
-
mediaRef.current.volume = userPreferredVolume;
|
|
18
|
-
}
|
|
19
|
-
}, [actualVolume, volumePropFrame, mediaRef, volume, mediaVolume]);
|
|
20
|
-
};
|
|
21
|
-
exports.useSyncVolumeWithMediaTag = useSyncVolumeWithMediaTag;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useUnsafeVideoConfig = void 0;
|
|
4
|
-
const react_1 = require("react");
|
|
5
|
-
const Sequence_1 = require("./Sequence");
|
|
6
|
-
const use_video_1 = require("./use-video");
|
|
7
|
-
const useUnsafeVideoConfig = () => {
|
|
8
|
-
var _a;
|
|
9
|
-
const context = (0, react_1.useContext)(Sequence_1.SequenceContext);
|
|
10
|
-
const ctxDuration = (_a = context === null || context === void 0 ? void 0 : context.durationInFrames) !== null && _a !== void 0 ? _a : null;
|
|
11
|
-
const video = (0, use_video_1.useVideo)();
|
|
12
|
-
return (0, react_1.useMemo)(() => {
|
|
13
|
-
if (!video) {
|
|
14
|
-
return null;
|
|
15
|
-
}
|
|
16
|
-
const { id, durationInFrames, fps, height, width, defaultProps } = video;
|
|
17
|
-
return {
|
|
18
|
-
id,
|
|
19
|
-
width,
|
|
20
|
-
height,
|
|
21
|
-
fps,
|
|
22
|
-
durationInFrames: ctxDuration !== null && ctxDuration !== void 0 ? ctxDuration : durationInFrames,
|
|
23
|
-
defaultProps,
|
|
24
|
-
};
|
|
25
|
-
}, [ctxDuration, video]);
|
|
26
|
-
};
|
|
27
|
-
exports.useUnsafeVideoConfig = useUnsafeVideoConfig;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { VideoConfig } from './video-config';
|
|
2
|
-
/**
|
|
3
|
-
* Get some info about the context of the video that you are making.
|
|
4
|
-
* Returns an object containing `fps`, `width`, `height` and `durationInFrames`, all of type `number`.
|
|
5
|
-
* @link https://www.remotion.dev/docs/use-video-config
|
|
6
|
-
*/
|
|
7
|
-
export declare const useVideoConfig: () => VideoConfig;
|
package/dist/use-video-config.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useVideoConfig = void 0;
|
|
4
|
-
const react_1 = require("react");
|
|
5
|
-
const CanUseRemotionHooks_1 = require("./CanUseRemotionHooks");
|
|
6
|
-
const is_player_1 = require("./is-player");
|
|
7
|
-
const use_unsafe_video_config_1 = require("./use-unsafe-video-config");
|
|
8
|
-
/**
|
|
9
|
-
* Get some info about the context of the video that you are making.
|
|
10
|
-
* Returns an object containing `fps`, `width`, `height` and `durationInFrames`, all of type `number`.
|
|
11
|
-
* @link https://www.remotion.dev/docs/use-video-config
|
|
12
|
-
*/
|
|
13
|
-
const useVideoConfig = () => {
|
|
14
|
-
const videoConfig = (0, use_unsafe_video_config_1.useUnsafeVideoConfig)();
|
|
15
|
-
const context = (0, react_1.useContext)(CanUseRemotionHooks_1.CanUseRemotionHooks);
|
|
16
|
-
const isPlayer = (0, is_player_1.useIsPlayer)();
|
|
17
|
-
if (!videoConfig) {
|
|
18
|
-
if ((typeof window !== 'undefined' && window.remotion_isPlayer) ||
|
|
19
|
-
isPlayer) {
|
|
20
|
-
throw new Error('No video config found. You are probably calling useVideoConfig() from outside the component passed to <Player />. See https://www.remotion.dev/docs/player/examples for how to set up the Player correctly.');
|
|
21
|
-
}
|
|
22
|
-
throw new Error('No video config found. You are probably calling useVideoConfig() from a component which has not been registered as a <Composition />. See https://www.remotion.dev/docs/the-fundamentals#defining-compositions for more information.');
|
|
23
|
-
}
|
|
24
|
-
if (!context) {
|
|
25
|
-
throw new Error('Called useVideoConfig() outside a Remotion composition.');
|
|
26
|
-
}
|
|
27
|
-
return videoConfig;
|
|
28
|
-
};
|
|
29
|
-
exports.useVideoConfig = useVideoConfig;
|
package/dist/use-video.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export declare const useVideo: () => {
|
|
2
|
-
height: number;
|
|
3
|
-
width: number;
|
|
4
|
-
fps: number;
|
|
5
|
-
durationInFrames: number;
|
|
6
|
-
defaultProps: unknown;
|
|
7
|
-
id: string;
|
|
8
|
-
folderName: string | null;
|
|
9
|
-
parentFolderName: string | null;
|
|
10
|
-
component: import("react").LazyExoticComponent<import("react").ComponentType<unknown>>;
|
|
11
|
-
nonce: number;
|
|
12
|
-
} | null;
|
package/dist/use-video.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useVideo = void 0;
|
|
4
|
-
const react_1 = require("react");
|
|
5
|
-
const CompositionManager_1 = require("./CompositionManager");
|
|
6
|
-
const useVideo = () => {
|
|
7
|
-
const context = (0, react_1.useContext)(CompositionManager_1.CompositionManager);
|
|
8
|
-
return (0, react_1.useMemo)(() => {
|
|
9
|
-
var _a;
|
|
10
|
-
const selected = context.compositions.find((c) => {
|
|
11
|
-
return c.id === context.currentComposition;
|
|
12
|
-
});
|
|
13
|
-
if (selected) {
|
|
14
|
-
return {
|
|
15
|
-
...selected,
|
|
16
|
-
// We override the selected metadata with the metadata that was passed to renderMedia(),
|
|
17
|
-
// and don't allow it to be changed during render anymore
|
|
18
|
-
...((_a = context.currentCompositionMetadata) !== null && _a !== void 0 ? _a : {}),
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
return null;
|
|
22
|
-
}, [
|
|
23
|
-
context.compositions,
|
|
24
|
-
context.currentComposition,
|
|
25
|
-
context.currentCompositionMetadata,
|
|
26
|
-
]);
|
|
27
|
-
};
|
|
28
|
-
exports.useVideo = useVideo;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { RemotionAudioProps } from './audio';
|
|
2
|
-
import type { RemotionVideoProps } from './video';
|
|
3
|
-
import type { OffthreadVideoProps } from './video/props';
|
|
4
|
-
export declare const validateMediaProps: (props: RemotionVideoProps | RemotionAudioProps | OffthreadVideoProps, component: 'Video' | 'Audio') => void;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.validateMediaProps = void 0;
|
|
4
|
-
const validateMediaProps = (props, component) => {
|
|
5
|
-
if (typeof props.volume !== 'number' &&
|
|
6
|
-
typeof props.volume !== 'function' &&
|
|
7
|
-
typeof props.volume !== 'undefined') {
|
|
8
|
-
throw new TypeError(`You have passed a volume of type ${typeof props.volume} to your <${component} /> component. Volume must be a number or a function with the signature '(frame: number) => number' undefined.`);
|
|
9
|
-
}
|
|
10
|
-
if (typeof props.volume === 'number' && props.volume < 0) {
|
|
11
|
-
throw new TypeError(`You have passed a volume below 0 to your <${component} /> component. Volume must be between 0 and 1`);
|
|
12
|
-
}
|
|
13
|
-
if (typeof props.playbackRate !== 'number' &&
|
|
14
|
-
typeof props.playbackRate !== 'undefined') {
|
|
15
|
-
throw new TypeError(`You have passed a playbackRate of type ${typeof props.playbackRate} to your <${component} /> component. Playback rate must a real number or undefined.`);
|
|
16
|
-
}
|
|
17
|
-
if (typeof props.playbackRate === 'number' &&
|
|
18
|
-
(isNaN(props.playbackRate) ||
|
|
19
|
-
!Number.isFinite(props.playbackRate) ||
|
|
20
|
-
props.playbackRate <= 0)) {
|
|
21
|
-
throw new TypeError(`You have passed a playbackRate of ${props.playbackRate} to your <${component} /> component. Playback rate must be a real number above 0.`);
|
|
22
|
-
}
|
|
23
|
-
};
|
|
24
|
-
exports.validateMediaProps = validateMediaProps;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const validateStartFromProps: (startFrom: number | undefined, endAt: number | undefined) => void;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.validateStartFromProps = void 0;
|
|
4
|
-
const validateStartFromProps = (startFrom, endAt) => {
|
|
5
|
-
if (typeof startFrom !== 'undefined') {
|
|
6
|
-
if (typeof startFrom !== 'number') {
|
|
7
|
-
throw new TypeError(`type of startFrom prop must be a number, instead got type ${typeof startFrom}.`);
|
|
8
|
-
}
|
|
9
|
-
if (isNaN(startFrom) || startFrom === Infinity) {
|
|
10
|
-
throw new TypeError('startFrom prop can not be NaN or Infinity.');
|
|
11
|
-
}
|
|
12
|
-
if (startFrom < 0) {
|
|
13
|
-
throw new TypeError(`startFrom must be greater than equal to 0 instead got ${startFrom}.`);
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
if (typeof endAt !== 'undefined') {
|
|
17
|
-
if (typeof endAt !== 'number') {
|
|
18
|
-
throw new TypeError(`type of endAt prop must be a number, instead got type ${typeof endAt}.`);
|
|
19
|
-
}
|
|
20
|
-
if (isNaN(endAt)) {
|
|
21
|
-
throw new TypeError('endAt prop can not be NaN.');
|
|
22
|
-
}
|
|
23
|
-
if (endAt <= 0) {
|
|
24
|
-
throw new TypeError(`endAt must be a positive number, instead got ${endAt}.`);
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
if (endAt < startFrom) {
|
|
28
|
-
throw new TypeError('endAt prop must be greater than startFrom prop.');
|
|
29
|
-
}
|
|
30
|
-
};
|
|
31
|
-
exports.validateStartFromProps = validateStartFromProps;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.invalidCompositionErrorMessage = exports.isCompositionIdValid = exports.validateCompositionId = void 0;
|
|
4
|
-
const validateCompositionId = (id) => {
|
|
5
|
-
if (!(0, exports.isCompositionIdValid)(id)) {
|
|
6
|
-
throw new Error(`Composition id can only contain a-z, A-Z, 0-9 and -. You passed ${id}`);
|
|
7
|
-
}
|
|
8
|
-
};
|
|
9
|
-
exports.validateCompositionId = validateCompositionId;
|
|
10
|
-
const getRegex = () => /^([a-zA-Z0-9-])+$/g;
|
|
11
|
-
const isCompositionIdValid = (id) => id.match(getRegex());
|
|
12
|
-
exports.isCompositionIdValid = isCompositionIdValid;
|
|
13
|
-
exports.invalidCompositionErrorMessage = `Composition ID must match ${String(getRegex())}`;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const validateDimension: (amount: number, nameOfProp: string, location: string) => void;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.validateDimension = void 0;
|
|
4
|
-
const validateDimension = (amount, nameOfProp, location) => {
|
|
5
|
-
if (typeof amount !== 'number') {
|
|
6
|
-
throw new Error(`The "${nameOfProp}" prop ${location} must be a number, but you passed a value of type ${typeof amount}`);
|
|
7
|
-
}
|
|
8
|
-
if (isNaN(amount)) {
|
|
9
|
-
throw new TypeError(`The "${nameOfProp}" prop ${location} must not be NaN, but is NaN.`);
|
|
10
|
-
}
|
|
11
|
-
if (!Number.isFinite(amount)) {
|
|
12
|
-
throw new TypeError(`The "${nameOfProp}" prop ${location} must be finite, but is ${amount}.`);
|
|
13
|
-
}
|
|
14
|
-
if (amount % 1 !== 0) {
|
|
15
|
-
throw new TypeError(`The "${nameOfProp}" prop ${location} must be an integer, but is ${amount}.`);
|
|
16
|
-
}
|
|
17
|
-
if (amount <= 0) {
|
|
18
|
-
throw new TypeError(`The "${nameOfProp}" prop ${location} must be positive, but got ${amount}.`);
|
|
19
|
-
}
|
|
20
|
-
};
|
|
21
|
-
exports.validateDimension = validateDimension;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const validateDurationInFrames: (durationInFrames: number, component: string) => void;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.validateDurationInFrames = void 0;
|
|
4
|
-
const validateDurationInFrames = (durationInFrames, component) => {
|
|
5
|
-
if (typeof durationInFrames !== 'number') {
|
|
6
|
-
throw new Error(`The "durationInFrames" prop ${component} must be a number, but you passed a value of type ${typeof durationInFrames}`);
|
|
7
|
-
}
|
|
8
|
-
if (durationInFrames <= 0) {
|
|
9
|
-
throw new TypeError(`The "durationInFrames" prop ${component} must be positive, but got ${durationInFrames}.`);
|
|
10
|
-
}
|
|
11
|
-
if (durationInFrames % 1 !== 0) {
|
|
12
|
-
throw new TypeError(`The "durationInFrames" prop ${component} must be an integer, but got ${durationInFrames}.`);
|
|
13
|
-
}
|
|
14
|
-
};
|
|
15
|
-
exports.validateDurationInFrames = validateDurationInFrames;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.invalidFolderNameErrorMessage = exports.isFolderNameValid = exports.validateFolderName = void 0;
|
|
4
|
-
const validateFolderName = (name) => {
|
|
5
|
-
if (name === undefined || name === null) {
|
|
6
|
-
throw new TypeError('You must pass a name to a <Folder />.');
|
|
7
|
-
}
|
|
8
|
-
if (typeof name !== 'string') {
|
|
9
|
-
throw new TypeError(`The "name" you pass into <Folder /> must be a string. Got: ${typeof name}`);
|
|
10
|
-
}
|
|
11
|
-
if (!(0, exports.isFolderNameValid)(name)) {
|
|
12
|
-
throw new Error(`Folder name can only contain a-z, A-Z, 0-9 and -. You passed ${name}`);
|
|
13
|
-
}
|
|
14
|
-
};
|
|
15
|
-
exports.validateFolderName = validateFolderName;
|
|
16
|
-
const getRegex = () => /^([a-zA-Z0-9-])+$/g;
|
|
17
|
-
const isFolderNameValid = (name) => name.match(getRegex());
|
|
18
|
-
exports.isFolderNameValid = isFolderNameValid;
|
|
19
|
-
exports.invalidFolderNameErrorMessage = `Folder name must match ${String(getRegex())}`;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const validateFps: (fps: number, location: string, isGif: boolean) => void;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.validateFps = void 0;
|
|
4
|
-
const validateFps = (fps, location, isGif) => {
|
|
5
|
-
if (typeof fps !== 'number') {
|
|
6
|
-
throw new Error(`"fps" must be a number, but you passed a value of type ${typeof fps} ${location}`);
|
|
7
|
-
}
|
|
8
|
-
if (!Number.isFinite(fps)) {
|
|
9
|
-
throw new Error(`"fps" must be a finite, but you passed ${fps} ${location}`);
|
|
10
|
-
}
|
|
11
|
-
if (isNaN(fps)) {
|
|
12
|
-
throw new Error(`"fps" must not be NaN, but got ${fps} ${location}`);
|
|
13
|
-
}
|
|
14
|
-
if (fps <= 0) {
|
|
15
|
-
throw new TypeError(`"fps" must be positive, but got ${fps} ${location}`);
|
|
16
|
-
}
|
|
17
|
-
if (isGif && fps > 50) {
|
|
18
|
-
throw new TypeError(`The FPS for a GIF cannot be higher than 50. Use the --every-nth-frame option to lower the FPS: https://remotion.dev/docs/render-as-gif`);
|
|
19
|
-
}
|
|
20
|
-
};
|
|
21
|
-
exports.validateFps = validateFps;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const validateOffthreadVideoImageFormat: (input: unknown) => void;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.validateOffthreadVideoImageFormat = void 0;
|
|
4
|
-
const validateOffthreadVideoImageFormat = (input) => {
|
|
5
|
-
if (typeof input === 'undefined') {
|
|
6
|
-
return;
|
|
7
|
-
}
|
|
8
|
-
if (typeof input !== 'string') {
|
|
9
|
-
throw new TypeError(`<OffthreadVideo imageFormat=""> must be a string, but got ${JSON.stringify(input)} instead.`);
|
|
10
|
-
}
|
|
11
|
-
if (input !== 'png' && input !== 'jpeg') {
|
|
12
|
-
throw new TypeError(`<OffthreadVideo imageFormat=""> must be either "png" or "jpeg", but got ${input}`);
|
|
13
|
-
}
|
|
14
|
-
};
|
|
15
|
-
exports.validateOffthreadVideoImageFormat = validateOffthreadVideoImageFormat;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const validateSpringDuration: (dur: unknown) => void;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.validateSpringDuration = void 0;
|
|
4
|
-
const validateSpringDuration = (dur) => {
|
|
5
|
-
if (typeof dur === 'undefined') {
|
|
6
|
-
return;
|
|
7
|
-
}
|
|
8
|
-
if (typeof dur !== 'number') {
|
|
9
|
-
throw new TypeError(`A "duration" of a spring must be a "number" but is "${typeof dur}"`);
|
|
10
|
-
}
|
|
11
|
-
if (Number.isNaN(dur)) {
|
|
12
|
-
throw new TypeError('A "duration" of a spring is NaN, which it must not be');
|
|
13
|
-
}
|
|
14
|
-
if (!Number.isFinite(dur)) {
|
|
15
|
-
throw new TypeError('A "duration" of a spring must be finite, but is ' + dur);
|
|
16
|
-
}
|
|
17
|
-
if (dur <= 0) {
|
|
18
|
-
throw new TypeError('A "duration" of a spring must be positive, but is ' + dur);
|
|
19
|
-
}
|
|
20
|
-
};
|
|
21
|
-
exports.validateSpringDuration = validateSpringDuration;
|
package/dist/version.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const VERSION = "3.3.44";
|
package/dist/version.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.OffthreadVideo = void 0;
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const react_1 = require("react");
|
|
6
|
-
const get_environment_1 = require("../get-environment");
|
|
7
|
-
const Sequence_1 = require("../Sequence");
|
|
8
|
-
const validate_media_props_1 = require("../validate-media-props");
|
|
9
|
-
const validate_start_from_props_1 = require("../validate-start-from-props");
|
|
10
|
-
const validate_offthreadvideo_image_format_1 = require("../validation/validate-offthreadvideo-image-format");
|
|
11
|
-
const OffthreadVideoForRendering_1 = require("./OffthreadVideoForRendering");
|
|
12
|
-
const VideoForDevelopment_1 = require("./VideoForDevelopment");
|
|
13
|
-
const OffthreadVideo = (props) => {
|
|
14
|
-
const { startFrom, endAt, ...otherProps } = props;
|
|
15
|
-
const environment = (0, get_environment_1.useRemotionEnvironment)();
|
|
16
|
-
const onDuration = (0, react_1.useCallback)(() => undefined, []);
|
|
17
|
-
if (typeof props.src !== 'string') {
|
|
18
|
-
throw new TypeError(`The \`<OffthreadVideo>\` tag requires a string for \`src\`, but got ${JSON.stringify(props.src)} instead.`);
|
|
19
|
-
}
|
|
20
|
-
if (typeof startFrom !== 'undefined' || typeof endAt !== 'undefined') {
|
|
21
|
-
(0, validate_start_from_props_1.validateStartFromProps)(startFrom, endAt);
|
|
22
|
-
const startFromFrameNo = startFrom !== null && startFrom !== void 0 ? startFrom : 0;
|
|
23
|
-
const endAtFrameNo = endAt !== null && endAt !== void 0 ? endAt : Infinity;
|
|
24
|
-
return ((0, jsx_runtime_1.jsx)(Sequence_1.Sequence, { layout: "none", from: 0 - startFromFrameNo, showInTimeline: false, durationInFrames: endAtFrameNo, children: (0, jsx_runtime_1.jsx)(exports.OffthreadVideo, { ...otherProps }) }));
|
|
25
|
-
}
|
|
26
|
-
(0, validate_media_props_1.validateMediaProps)(props, 'Video');
|
|
27
|
-
(0, validate_offthreadvideo_image_format_1.validateOffthreadVideoImageFormat)(props.imageFormat);
|
|
28
|
-
if (environment === 'rendering') {
|
|
29
|
-
return (0, jsx_runtime_1.jsx)(OffthreadVideoForRendering_1.OffthreadVideoForRendering, { ...otherProps });
|
|
30
|
-
}
|
|
31
|
-
return ((0, jsx_runtime_1.jsx)(VideoForDevelopment_1.VideoForDevelopment, { onDuration: onDuration, onlyWarnForMediaSeekingError: true, ...otherProps }));
|
|
32
|
-
};
|
|
33
|
-
exports.OffthreadVideo = OffthreadVideo;
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.OffthreadVideoForRendering = void 0;
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const react_1 = require("react");
|
|
6
|
-
const absolute_src_1 = require("../absolute-src");
|
|
7
|
-
const use_audio_frame_1 = require("../audio/use-audio-frame");
|
|
8
|
-
const CompositionManager_1 = require("../CompositionManager");
|
|
9
|
-
const default_css_1 = require("../default-css");
|
|
10
|
-
const Img_1 = require("../Img");
|
|
11
|
-
const internals_1 = require("../internals");
|
|
12
|
-
const random_1 = require("../random");
|
|
13
|
-
const Sequence_1 = require("../Sequence");
|
|
14
|
-
const timeline_position_state_1 = require("../timeline-position-state");
|
|
15
|
-
const use_current_frame_1 = require("../use-current-frame");
|
|
16
|
-
const use_unsafe_video_config_1 = require("../use-unsafe-video-config");
|
|
17
|
-
const volume_prop_1 = require("../volume-prop");
|
|
18
|
-
const get_current_time_1 = require("./get-current-time");
|
|
19
|
-
const DEFAULT_IMAGE_FORMAT = 'jpeg';
|
|
20
|
-
const OffthreadVideoForRendering = ({ onError, volume: volumeProp, playbackRate, src, muted, imageFormat, allowAmplificationDuringRender, ...props }) => {
|
|
21
|
-
const absoluteFrame = (0, timeline_position_state_1.useTimelinePosition)();
|
|
22
|
-
const frame = (0, use_current_frame_1.useCurrentFrame)();
|
|
23
|
-
const volumePropsFrame = (0, use_audio_frame_1.useFrameForVolumeProp)();
|
|
24
|
-
const videoConfig = (0, use_unsafe_video_config_1.useUnsafeVideoConfig)();
|
|
25
|
-
const sequenceContext = (0, react_1.useContext)(Sequence_1.SequenceContext);
|
|
26
|
-
const mediaStartsAt = (0, use_audio_frame_1.useMediaStartsAt)();
|
|
27
|
-
const { registerAsset, unregisterAsset } = (0, react_1.useContext)(CompositionManager_1.CompositionManager);
|
|
28
|
-
if (!src) {
|
|
29
|
-
throw new TypeError('No `src` was passed to <OffthreadVideo>.');
|
|
30
|
-
}
|
|
31
|
-
// Generate a string that's as unique as possible for this asset
|
|
32
|
-
// but at the same time the same on all threads
|
|
33
|
-
const id = (0, react_1.useMemo)(() => `offthreadvideo-${(0, random_1.random)(src !== null && src !== void 0 ? src : '')}-${sequenceContext === null || sequenceContext === void 0 ? void 0 : sequenceContext.cumulatedFrom}-${sequenceContext === null || sequenceContext === void 0 ? void 0 : sequenceContext.relativeFrom}-${sequenceContext === null || sequenceContext === void 0 ? void 0 : sequenceContext.durationInFrames}`, [
|
|
34
|
-
src,
|
|
35
|
-
sequenceContext === null || sequenceContext === void 0 ? void 0 : sequenceContext.cumulatedFrom,
|
|
36
|
-
sequenceContext === null || sequenceContext === void 0 ? void 0 : sequenceContext.relativeFrom,
|
|
37
|
-
sequenceContext === null || sequenceContext === void 0 ? void 0 : sequenceContext.durationInFrames,
|
|
38
|
-
]);
|
|
39
|
-
if (!videoConfig) {
|
|
40
|
-
throw new Error('No video config found');
|
|
41
|
-
}
|
|
42
|
-
const volume = (0, volume_prop_1.evaluateVolume)({
|
|
43
|
-
volume: volumeProp,
|
|
44
|
-
frame: volumePropsFrame,
|
|
45
|
-
mediaVolume: 1,
|
|
46
|
-
allowAmplificationDuringRender: allowAmplificationDuringRender !== null && allowAmplificationDuringRender !== void 0 ? allowAmplificationDuringRender : false,
|
|
47
|
-
});
|
|
48
|
-
(0, react_1.useEffect)(() => {
|
|
49
|
-
if (!src) {
|
|
50
|
-
throw new Error('No src passed');
|
|
51
|
-
}
|
|
52
|
-
if (!window.remotion_videoEnabled) {
|
|
53
|
-
return;
|
|
54
|
-
}
|
|
55
|
-
if (muted) {
|
|
56
|
-
return;
|
|
57
|
-
}
|
|
58
|
-
if (volume <= 0) {
|
|
59
|
-
return;
|
|
60
|
-
}
|
|
61
|
-
registerAsset({
|
|
62
|
-
type: 'video',
|
|
63
|
-
src: (0, absolute_src_1.getAbsoluteSrc)(src),
|
|
64
|
-
id,
|
|
65
|
-
frame: absoluteFrame,
|
|
66
|
-
volume,
|
|
67
|
-
mediaFrame: frame,
|
|
68
|
-
playbackRate: playbackRate !== null && playbackRate !== void 0 ? playbackRate : 1,
|
|
69
|
-
allowAmplificationDuringRender: allowAmplificationDuringRender !== null && allowAmplificationDuringRender !== void 0 ? allowAmplificationDuringRender : false,
|
|
70
|
-
});
|
|
71
|
-
return () => unregisterAsset(id);
|
|
72
|
-
}, [
|
|
73
|
-
muted,
|
|
74
|
-
src,
|
|
75
|
-
registerAsset,
|
|
76
|
-
id,
|
|
77
|
-
unregisterAsset,
|
|
78
|
-
volume,
|
|
79
|
-
frame,
|
|
80
|
-
absoluteFrame,
|
|
81
|
-
playbackRate,
|
|
82
|
-
allowAmplificationDuringRender,
|
|
83
|
-
]);
|
|
84
|
-
const currentTime = (0, react_1.useMemo)(() => {
|
|
85
|
-
return ((0, get_current_time_1.getExpectedMediaFrameUncorrected)({
|
|
86
|
-
frame,
|
|
87
|
-
playbackRate: playbackRate || 1,
|
|
88
|
-
startFrom: -mediaStartsAt,
|
|
89
|
-
}) / videoConfig.fps);
|
|
90
|
-
}, [frame, mediaStartsAt, playbackRate, videoConfig.fps]);
|
|
91
|
-
const actualSrc = (0, react_1.useMemo)(() => {
|
|
92
|
-
return `http://localhost:${window.remotion_proxyPort}/proxy?src=${encodeURIComponent((0, absolute_src_1.getAbsoluteSrc)(src))}&time=${encodeURIComponent(currentTime)}&imageFormat=${imageFormat !== null && imageFormat !== void 0 ? imageFormat : DEFAULT_IMAGE_FORMAT}`;
|
|
93
|
-
}, [currentTime, imageFormat, src]);
|
|
94
|
-
const onErr = (0, react_1.useCallback)((e) => {
|
|
95
|
-
onError === null || onError === void 0 ? void 0 : onError(e);
|
|
96
|
-
}, [onError]);
|
|
97
|
-
const className = (0, react_1.useMemo)(() => {
|
|
98
|
-
return [default_css_1.OFFTHREAD_VIDEO_CLASS_NAME, props.className]
|
|
99
|
-
.filter(internals_1.Internals.truthy)
|
|
100
|
-
.join(' ');
|
|
101
|
-
}, [props.className]);
|
|
102
|
-
return ((0, jsx_runtime_1.jsx)(Img_1.Img, { src: actualSrc, className: className, ...props, onError: onErr }));
|
|
103
|
-
};
|
|
104
|
-
exports.OffthreadVideoForRendering = OffthreadVideoForRendering;
|
package/dist/video/Video.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { RemotionMainVideoProps } from './props';
|
|
3
|
-
export declare const Video: (props: Omit<React.DetailedHTMLProps<React.VideoHTMLAttributes<HTMLVideoElement>, HTMLVideoElement>, "nonce" | "autoPlay" | "controls" | "onEnded"> & {
|
|
4
|
-
volume?: import("../volume-prop").VolumeProp | undefined;
|
|
5
|
-
playbackRate?: number | undefined;
|
|
6
|
-
acceptableTimeShiftInSeconds?: number | undefined;
|
|
7
|
-
allowAmplificationDuringRender?: boolean | undefined;
|
|
8
|
-
} & RemotionMainVideoProps & React.RefAttributes<HTMLVideoElement | null>) => React.ReactElement | null;
|
package/dist/video/Video.js
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Video = void 0;
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const react_1 = require("react");
|
|
6
|
-
const get_environment_1 = require("../get-environment");
|
|
7
|
-
const loop_1 = require("../loop");
|
|
8
|
-
const Sequence_1 = require("../Sequence");
|
|
9
|
-
const use_video_config_1 = require("../use-video-config");
|
|
10
|
-
const validate_media_props_1 = require("../validate-media-props");
|
|
11
|
-
const validate_start_from_props_1 = require("../validate-start-from-props");
|
|
12
|
-
const duration_state_1 = require("./duration-state");
|
|
13
|
-
const VideoForDevelopment_1 = require("./VideoForDevelopment");
|
|
14
|
-
const VideoForRendering_1 = require("./VideoForRendering");
|
|
15
|
-
const VideoForwardingFunction = (props, ref) => {
|
|
16
|
-
var _a;
|
|
17
|
-
const { startFrom, endAt, ...otherProps } = props;
|
|
18
|
-
const { loop, ...propsOtherThanLoop } = props;
|
|
19
|
-
const { fps } = (0, use_video_config_1.useVideoConfig)();
|
|
20
|
-
const environment = (0, get_environment_1.useRemotionEnvironment)();
|
|
21
|
-
const { durations, setDurations } = (0, react_1.useContext)(duration_state_1.DurationsContext);
|
|
22
|
-
if (typeof ref === 'string') {
|
|
23
|
-
throw new Error('string refs are not supported');
|
|
24
|
-
}
|
|
25
|
-
if (typeof props.src !== 'string') {
|
|
26
|
-
throw new TypeError(`The \`<Video>\` tag requires a string for \`src\`, but got ${JSON.stringify(props.src)} instead.`);
|
|
27
|
-
}
|
|
28
|
-
const onDuration = (0, react_1.useCallback)((src, durationInSeconds) => {
|
|
29
|
-
setDurations({ type: 'got-duration', durationInSeconds, src });
|
|
30
|
-
}, [setDurations]);
|
|
31
|
-
if (loop && props.src && durations[props.src] !== undefined) {
|
|
32
|
-
const naturalDuration = durations[props.src] * fps;
|
|
33
|
-
const playbackRate = (_a = props.playbackRate) !== null && _a !== void 0 ? _a : 1;
|
|
34
|
-
const durationInFrames = Math.floor(naturalDuration / playbackRate);
|
|
35
|
-
return ((0, jsx_runtime_1.jsx)(loop_1.Loop, { durationInFrames: durationInFrames, children: (0, jsx_runtime_1.jsx)(exports.Video, { ...propsOtherThanLoop, ref: ref }) }));
|
|
36
|
-
}
|
|
37
|
-
if (typeof startFrom !== 'undefined' || typeof endAt !== 'undefined') {
|
|
38
|
-
(0, validate_start_from_props_1.validateStartFromProps)(startFrom, endAt);
|
|
39
|
-
const startFromFrameNo = startFrom !== null && startFrom !== void 0 ? startFrom : 0;
|
|
40
|
-
const endAtFrameNo = endAt !== null && endAt !== void 0 ? endAt : Infinity;
|
|
41
|
-
return ((0, jsx_runtime_1.jsx)(Sequence_1.Sequence, { layout: "none", from: 0 - startFromFrameNo, showInTimeline: false, durationInFrames: endAtFrameNo, children: (0, jsx_runtime_1.jsx)(exports.Video, { ...otherProps, ref: ref }) }));
|
|
42
|
-
}
|
|
43
|
-
(0, validate_media_props_1.validateMediaProps)(props, 'Video');
|
|
44
|
-
if (environment === 'rendering') {
|
|
45
|
-
return ((0, jsx_runtime_1.jsx)(VideoForRendering_1.VideoForRendering, { onDuration: onDuration, ...otherProps, ref: ref }));
|
|
46
|
-
}
|
|
47
|
-
return ((0, jsx_runtime_1.jsx)(VideoForDevelopment_1.VideoForDevelopment, { onlyWarnForMediaSeekingError: false, ...otherProps, ref: ref, onDuration: onDuration }));
|
|
48
|
-
};
|
|
49
|
-
const forward = react_1.forwardRef;
|
|
50
|
-
exports.Video = forward(VideoForwardingFunction);
|