remotion 4.0.0-webhook.27 → 4.1.0-alpha1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +8 -8
- package/README.md +7 -7
- package/dist/{AbsoluteFill.d.ts → cjs/AbsoluteFill.d.ts} +2 -2
- package/dist/{AbsoluteFill.js → cjs/AbsoluteFill.js} +2 -2
- package/dist/cjs/AssetManager.d.ts +11 -0
- package/dist/cjs/AssetManager.js +40 -0
- package/dist/{CanUseRemotionHooks.d.ts → cjs/CanUseRemotionHooks.d.ts} +0 -0
- package/dist/{CanUseRemotionHooks.js → cjs/CanUseRemotionHooks.js} +0 -0
- package/dist/cjs/Clipper.d.ts +7 -0
- package/dist/cjs/Clipper.js +24 -0
- package/dist/cjs/Composition.d.ts +41 -0
- package/dist/cjs/Composition.js +132 -0
- package/dist/cjs/CompositionManager.d.ts +75 -0
- package/dist/{CompositionManager.js → cjs/CompositionManager.js} +29 -66
- package/dist/cjs/CompositionManagerContext.d.ts +18 -0
- package/dist/cjs/CompositionManagerContext.js +16 -0
- package/dist/cjs/EditorProps.d.ts +15 -0
- package/dist/cjs/EditorProps.js +53 -0
- package/dist/{Folder.d.ts → cjs/Folder.d.ts} +6 -2
- package/dist/{Folder.js → cjs/Folder.js} +10 -6
- package/dist/{IFrame.d.ts → cjs/IFrame.d.ts} +4 -0
- package/dist/{IFrame.js → cjs/IFrame.js} +8 -4
- package/dist/cjs/Img.d.ts +9 -0
- package/dist/cjs/Img.js +100 -0
- package/dist/cjs/NativeLayers.d.ts +13 -0
- package/dist/cjs/NativeLayers.js +29 -0
- package/dist/cjs/Null.d.ts +2 -0
- package/dist/cjs/Null.js +25 -0
- package/dist/{RemotionRoot.d.ts → cjs/RemotionRoot.d.ts} +1 -0
- package/dist/cjs/RemotionRoot.js +72 -0
- package/dist/cjs/ResolveCompositionConfig.d.ts +24 -0
- package/dist/cjs/ResolveCompositionConfig.js +192 -0
- package/dist/cjs/Sequence.d.ts +22 -0
- package/dist/{Sequence.js → cjs/Sequence.js} +27 -29
- package/dist/cjs/SequenceContext.d.ts +9 -0
- package/dist/cjs/SequenceContext.js +5 -0
- package/dist/cjs/SequenceManager.d.ts +11 -0
- package/dist/cjs/SequenceManager.js +57 -0
- package/dist/cjs/Still.d.ts +8 -0
- package/dist/cjs/Still.js +22 -0
- package/dist/{absolute-src.d.ts → cjs/absolute-src.d.ts} +0 -0
- package/dist/{absolute-src.js → cjs/absolute-src.js} +0 -0
- package/dist/{asset-types.d.ts → cjs/asset-types.d.ts} +0 -0
- package/dist/{asset-types.js → cjs/asset-types.js} +0 -0
- package/dist/{audio → cjs/audio}/Audio.d.ts +10 -4
- package/dist/cjs/audio/Audio.js +58 -0
- package/dist/cjs/audio/AudioForDevelopment.d.ts +11 -0
- package/dist/cjs/audio/AudioForDevelopment.js +101 -0
- package/dist/cjs/audio/AudioForRendering.d.ts +10 -0
- package/dist/cjs/audio/AudioForRendering.js +111 -0
- package/dist/cjs/audio/index.d.ts +2 -0
- package/dist/{audio → cjs/audio}/index.js +2 -2
- package/dist/cjs/audio/props.d.ts +12 -0
- package/dist/{audio → cjs/audio}/props.js +0 -0
- package/dist/{audio → cjs/audio}/shared-audio-tags.d.ts +10 -4
- package/dist/{audio → cjs/audio}/shared-audio-tags.js +35 -13
- package/dist/{audio → cjs/audio}/use-audio-frame.d.ts +0 -0
- package/dist/{audio → cjs/audio}/use-audio-frame.js +4 -4
- package/dist/{bezier.d.ts → cjs/bezier.d.ts} +0 -0
- package/dist/{bezier.js → cjs/bezier.js} +0 -0
- package/dist/cjs/cancel-render.d.ts +5 -0
- package/dist/cjs/cancel-render.js +47 -0
- package/dist/{config → cjs/config}/input-props.d.ts +0 -0
- package/dist/{config → cjs/config}/input-props.js +3 -3
- package/dist/{default-css.d.ts → cjs/default-css.d.ts} +0 -0
- package/dist/{default-css.js → cjs/default-css.js} +0 -0
- package/dist/{delay-render.d.ts → cjs/delay-render.d.ts} +4 -4
- package/dist/{delay-render.js → cjs/delay-render.js} +12 -12
- package/dist/{easing.d.ts → cjs/easing.d.ts} +4 -0
- package/dist/{easing.js → cjs/easing.js} +6 -2
- package/dist/cjs/freeze.d.ts +11 -0
- package/dist/{freeze.js → cjs/freeze.js} +8 -4
- package/dist/{get-asset-file-name.d.ts → cjs/get-asset-file-name.d.ts} +0 -0
- package/dist/{get-asset-file-name.js → cjs/get-asset-file-name.js} +0 -0
- package/dist/cjs/get-environment.d.ts +3 -0
- package/dist/{get-environment.js → cjs/get-environment.js} +14 -2
- package/dist/cjs/get-preview-dom-element.d.ts +2 -0
- package/dist/cjs/get-preview-dom-element.js +8 -0
- package/dist/cjs/get-static-files.d.ts +21 -0
- package/dist/cjs/get-static-files.js +35 -0
- package/dist/{get-timeline-clip-name.d.ts → cjs/get-timeline-clip-name.d.ts} +0 -0
- package/dist/{get-timeline-clip-name.js → cjs/get-timeline-clip-name.js} +0 -0
- package/dist/cjs/index.d.ts +102 -0
- package/dist/cjs/index.js +105 -0
- package/dist/cjs/internals.d.ts +131 -0
- package/dist/cjs/internals.js +120 -0
- package/dist/{interpolate-colors.d.ts → cjs/interpolate-colors.d.ts} +5 -0
- package/dist/{interpolate-colors.js → cjs/interpolate-colors.js} +10 -10
- package/dist/{interpolate.d.ts → cjs/interpolate.d.ts} +11 -7
- package/dist/{interpolate.js → cjs/interpolate.js} +0 -0
- package/dist/{is-approximately-the-same.d.ts → cjs/is-approximately-the-same.d.ts} +0 -0
- package/dist/{is-approximately-the-same.js → cjs/is-approximately-the-same.js} +0 -0
- package/dist/cjs/is-player.d.ts +3 -0
- package/dist/cjs/is-player.js +14 -0
- package/dist/{loading-indicator.d.ts → cjs/loading-indicator.d.ts} +0 -0
- package/dist/{loading-indicator.js → cjs/loading-indicator.js} +4 -4
- package/dist/cjs/loop/index.d.ts +13 -0
- package/dist/cjs/loop/index.js +46 -0
- package/dist/{multiple-versions-warning.d.ts → cjs/multiple-versions-warning.d.ts} +0 -0
- package/dist/{multiple-versions-warning.js → cjs/multiple-versions-warning.js} +11 -6
- package/dist/{nonce.d.ts → cjs/nonce.d.ts} +1 -1
- package/dist/{nonce.js → cjs/nonce.js} +6 -0
- package/dist/{play-and-handle-not-allowed-error.d.ts → cjs/play-and-handle-not-allowed-error.d.ts} +0 -0
- package/dist/{play-and-handle-not-allowed-error.js → cjs/play-and-handle-not-allowed-error.js} +4 -0
- package/dist/{portal-node.d.ts → cjs/portal-node.d.ts} +0 -0
- package/dist/{portal-node.js → cjs/portal-node.js} +0 -0
- package/dist/cjs/prefetch-state.d.ts +8 -0
- package/dist/cjs/prefetch-state.js +27 -0
- package/dist/cjs/prefetch.d.ts +13 -0
- package/dist/{prefetch.js → cjs/prefetch.js} +43 -17
- package/dist/cjs/props-if-has-props.d.ts +10 -0
- package/dist/{video-config.js → cjs/props-if-has-props.js} +0 -0
- package/dist/cjs/random.d.ts +6 -0
- package/dist/{random.js → cjs/random.js} +3 -3
- package/dist/{register-root.d.ts → cjs/register-root.d.ts} +4 -0
- package/dist/{register-root.js → cjs/register-root.js} +4 -0
- package/dist/cjs/resolve-video-config.d.ts +8 -0
- package/dist/cjs/resolve-video-config.js +89 -0
- package/dist/cjs/series/flatten-children.d.ts +2 -0
- package/dist/{series → cjs/series}/flatten-children.js +0 -0
- package/dist/cjs/series/index.d.ts +17 -0
- package/dist/{series → cjs/series}/index.js +22 -8
- package/dist/cjs/setup-env-variables.d.ts +1 -0
- package/dist/{setup-env-variables.js → cjs/setup-env-variables.js} +7 -9
- package/dist/{spring → cjs/spring}/index.d.ts +10 -6
- package/dist/cjs/spring/index.js +75 -0
- package/dist/cjs/spring/measure-spring.d.ts +12 -0
- package/dist/{spring → cjs/spring}/measure-spring.js +8 -4
- package/dist/{spring → cjs/spring}/spring-utils.d.ts +2 -2
- package/dist/{spring → cjs/spring}/spring-utils.js +0 -0
- package/dist/cjs/static-file.d.ts +33 -0
- package/dist/cjs/static-file.js +87 -0
- package/dist/{timeline-position-state.d.ts → cjs/timeline-position-state.d.ts} +4 -4
- package/dist/{timeline-position-state.js → cjs/timeline-position-state.js} +9 -1
- package/dist/cjs/truthy.d.ts +3 -0
- package/dist/{truthy.js → cjs/truthy.js} +0 -0
- package/dist/cjs/use-current-frame.d.ts +5 -0
- package/dist/{use-current-frame.js → cjs/use-current-frame.js} +8 -9
- package/dist/cjs/use-lazy-component.d.ts +7 -0
- package/dist/{use-lazy-component.js → cjs/use-lazy-component.js} +0 -0
- package/dist/{use-media-in-timeline.d.ts → cjs/use-media-in-timeline.d.ts} +3 -2
- package/dist/{use-media-in-timeline.js → cjs/use-media-in-timeline.js} +29 -25
- package/dist/{use-media-playback.d.ts → cjs/use-media-playback.d.ts} +3 -1
- package/dist/cjs/use-media-playback.js +86 -0
- package/dist/{use-media-tag-volume.d.ts → cjs/use-media-tag-volume.d.ts} +0 -0
- package/dist/{use-media-tag-volume.js → cjs/use-media-tag-volume.js} +0 -0
- package/dist/{use-sync-volume-with-media-tag.d.ts → cjs/use-sync-volume-with-media-tag.d.ts} +2 -2
- package/dist/{use-sync-volume-with-media-tag.js → cjs/use-sync-volume-with-media-tag.js} +5 -4
- package/dist/{use-unsafe-video-config.d.ts → cjs/use-unsafe-video-config.d.ts} +1 -1
- package/dist/{use-unsafe-video-config.js → cjs/use-unsafe-video-config.js} +4 -4
- package/dist/cjs/use-video-config.d.ts +8 -0
- package/dist/cjs/use-video-config.js +34 -0
- package/dist/cjs/use-video.d.ts +7 -0
- package/dist/cjs/use-video.js +38 -0
- package/dist/cjs/validate-frame.d.ts +5 -0
- package/dist/cjs/validate-frame.js +24 -0
- package/dist/cjs/validate-media-props.d.ts +4 -0
- package/dist/{validate-media-props.js → cjs/validate-media-props.js} +0 -0
- package/dist/{validate-start-from-props.d.ts → cjs/validate-start-from-props.d.ts} +0 -0
- package/dist/{validate-start-from-props.js → cjs/validate-start-from-props.js} +0 -0
- package/dist/{validation → cjs/validation}/validate-composition-id.d.ts +0 -0
- package/dist/{validation → cjs/validation}/validate-composition-id.js +0 -0
- package/dist/cjs/validation/validate-default-props.d.ts +1 -0
- package/dist/cjs/validation/validate-default-props.js +15 -0
- package/dist/{validation → cjs/validation}/validate-dimensions.d.ts +0 -0
- package/dist/{validation → cjs/validation}/validate-dimensions.js +0 -0
- package/dist/cjs/validation/validate-duration-in-frames.d.ts +5 -0
- package/dist/{validation → cjs/validation}/validate-duration-in-frames.js +5 -2
- package/dist/{validation → cjs/validation}/validate-folder-name.d.ts +0 -0
- package/dist/{validation → cjs/validation}/validate-folder-name.js +0 -0
- package/dist/{validation → cjs/validation}/validate-fps.d.ts +0 -0
- package/dist/{validation → cjs/validation}/validate-fps.js +0 -0
- package/dist/{validation → cjs/validation}/validation-spring-duration.d.ts +0 -0
- package/dist/{validation → cjs/validation}/validation-spring-duration.js +0 -0
- package/dist/cjs/version.d.ts +1 -0
- package/dist/{version.js → cjs/version.js} +1 -1
- package/dist/cjs/video/OffthreadVideo.d.ts +7 -0
- package/dist/cjs/video/OffthreadVideo.js +38 -0
- package/dist/{video → cjs/video}/OffthreadVideoForRendering.d.ts +1 -1
- package/dist/cjs/video/OffthreadVideoForRendering.js +103 -0
- package/dist/cjs/video/Video.d.ts +12 -0
- package/dist/cjs/video/Video.js +55 -0
- package/dist/{video → cjs/video}/VideoForDevelopment.d.ts +5 -2
- package/dist/cjs/video/VideoForDevelopment.js +117 -0
- package/dist/cjs/video/VideoForRendering.d.ts +10 -0
- package/dist/cjs/video/VideoForRendering.js +208 -0
- package/dist/cjs/video/duration-state.d.ts +17 -0
- package/dist/cjs/video/duration-state.js +35 -0
- package/dist/{video → cjs/video}/get-current-time.d.ts +0 -0
- package/dist/{video → cjs/video}/get-current-time.js +12 -11
- package/dist/cjs/video/index.d.ts +3 -0
- package/dist/{video → cjs/video}/index.js +4 -4
- package/dist/cjs/video/props.d.ts +32 -0
- package/dist/cjs/video/props.js +2 -0
- package/dist/cjs/video/video-fragment.d.ts +12 -0
- package/dist/cjs/video/video-fragment.js +60 -0
- package/dist/{video-config.d.ts → cjs/video-config.d.ts} +2 -2
- package/dist/{video/props.js → cjs/video-config.js} +0 -0
- package/dist/{volume-position-state.d.ts → cjs/volume-position-state.d.ts} +4 -4
- package/dist/{volume-position-state.js → cjs/volume-position-state.js} +0 -0
- package/dist/{volume-prop.d.ts → cjs/volume-prop.d.ts} +3 -2
- package/dist/{volume-prop.js → cjs/volume-prop.js} +4 -3
- package/dist/{warn-about-non-seekable-media.d.ts → cjs/warn-about-non-seekable-media.d.ts} +0 -0
- package/dist/{warn-about-non-seekable-media.js → cjs/warn-about-non-seekable-media.js} +2 -2
- package/dist/cjs/wrap-remotion-context.d.ts +31 -0
- package/dist/cjs/wrap-remotion-context.js +85 -0
- package/dist/esm/index.mjs +4623 -0
- package/dist/esm/version.mjs +4 -0
- package/package.json +80 -57
- package/version.js +2 -1
- package/.prettierrc.js +0 -14
- package/.turbo/turbo-build.log +0 -5
- package/dist/Composition.d.ts +0 -22
- package/dist/Composition.js +0 -98
- package/dist/CompositionManager.d.ts +0 -79
- package/dist/Img.d.ts +0 -2
- package/dist/Img.js +0 -51
- package/dist/RemotionRoot.js +0 -71
- package/dist/Sequence.d.ts +0 -29
- package/dist/Still.d.ts +0 -3
- package/dist/Still.js +0 -9
- package/dist/audio/Audio.js +0 -32
- package/dist/audio/AudioForDevelopment.d.ts +0 -8
- package/dist/audio/AudioForDevelopment.js +0 -71
- package/dist/audio/AudioForRendering.d.ts +0 -6
- package/dist/audio/AudioForRendering.js +0 -75
- package/dist/audio/index.d.ts +0 -2
- package/dist/audio/props.d.ts +0 -10
- package/dist/config.d.ts +0 -218
- package/dist/config.js +0 -21
- package/dist/freeze.d.ts +0 -7
- package/dist/get-environment.d.ts +0 -2
- package/dist/get-preview-dom-element.d.ts +0 -1
- package/dist/get-preview-dom-element.js +0 -7
- package/dist/index.d.ts +0 -72
- package/dist/index.js +0 -58
- package/dist/internals.d.ts +0 -88
- package/dist/internals.js +0 -93
- package/dist/loop/index.d.ts +0 -9
- package/dist/loop/index.js +0 -28
- package/dist/prefetch-state.d.ts +0 -13
- package/dist/prefetch-state.js +0 -26
- package/dist/prefetch.d.ts +0 -7
- package/dist/random.d.ts +0 -6
- package/dist/series/flatten-children.d.ts +0 -2
- package/dist/series/index.d.ts +0 -13
- package/dist/setup-env-variables.d.ts +0 -2
- package/dist/spring/index.js +0 -51
- package/dist/spring/measure-spring.d.ts +0 -8
- package/dist/static-file.d.ts +0 -1
- package/dist/static-file.js +0 -29
- package/dist/truthy.d.ts +0 -3
- package/dist/use-current-frame.d.ts +0 -6
- package/dist/use-lazy-component.d.ts +0 -7
- package/dist/use-media-playback.js +0 -75
- package/dist/use-video-config.d.ts +0 -7
- package/dist/use-video-config.js +0 -26
- package/dist/use-video.d.ts +0 -13
- package/dist/use-video.js +0 -28
- package/dist/validate-media-props.d.ts +0 -4
- package/dist/validation/validate-duration-in-frames.d.ts +0 -1
- package/dist/validation/validate-offthreadvideo-image-format.d.ts +0 -1
- package/dist/validation/validate-offthreadvideo-image-format.js +0 -15
- package/dist/version.d.ts +0 -1
- package/dist/video/LoopedVideo.d.ts +0 -3
- package/dist/video/LoopedVideo.js +0 -16
- package/dist/video/OffthreadVideo.d.ts +0 -3
- package/dist/video/OffthreadVideo.js +0 -27
- package/dist/video/OffthreadVideoForRendering.js +0 -101
- package/dist/video/Video.d.ts +0 -6
- package/dist/video/Video.js +0 -29
- package/dist/video/VideoForDevelopment.js +0 -69
- package/dist/video/VideoForRendering.d.ts +0 -6
- package/dist/video/VideoForRendering.js +0 -168
- package/dist/video/duration-state.d.ts +0 -8
- package/dist/video/duration-state.js +0 -15
- package/dist/video/index.d.ts +0 -3
- package/dist/video/props.d.ts +0 -21
- package/dist/wrap-remotion-context.d.ts +0 -14
- package/dist/wrap-remotion-context.js +0 -65
- package/ensure-correct-version.js +0 -24
- package/tsconfig.json +0 -12
- package/version.d.ts +0 -1
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { VolumeProp } from '../volume-prop.js';
|
|
3
|
+
export type RemotionMainAudioProps = {
|
|
4
|
+
startFrom?: number;
|
|
5
|
+
endAt?: number;
|
|
6
|
+
};
|
|
7
|
+
export type RemotionAudioProps = Omit<React.DetailedHTMLProps<React.AudioHTMLAttributes<HTMLAudioElement>, HTMLAudioElement>, 'autoPlay' | 'controls' | 'onEnded' | 'nonce' | 'onResize' | 'onResizeCapture'> & {
|
|
8
|
+
volume?: VolumeProp;
|
|
9
|
+
playbackRate?: number;
|
|
10
|
+
acceptableTimeShiftInSeconds?: number;
|
|
11
|
+
allowAmplificationDuringRender?: boolean;
|
|
12
|
+
};
|
|
File without changes
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import type { ComponentType, LazyExoticComponent } from 'react';
|
|
1
2
|
import React from 'react';
|
|
2
|
-
import type { RemotionAudioProps } from './props';
|
|
3
|
+
import type { RemotionAudioProps } from './props.js';
|
|
3
4
|
/**
|
|
4
5
|
* This functionality of Remotion will keep a certain amount
|
|
5
6
|
* of <audio> tags pre-mounted and by default filled with an empty audio track.
|
|
@@ -11,16 +12,20 @@ import type { RemotionAudioProps } from './props';
|
|
|
11
12
|
*
|
|
12
13
|
* The behavior can be disabled by passing `0` as the number of shared audio tracks.
|
|
13
14
|
*/
|
|
14
|
-
|
|
15
|
+
type AudioElem = {
|
|
15
16
|
id: number;
|
|
16
17
|
props: RemotionAudioProps;
|
|
17
18
|
el: React.RefObject<HTMLAudioElement>;
|
|
18
19
|
audioId: string;
|
|
19
20
|
};
|
|
20
|
-
|
|
21
|
+
type SharedContext = {
|
|
21
22
|
registerAudio: (aud: RemotionAudioProps, audioId: string) => AudioElem;
|
|
22
23
|
unregisterAudio: (id: number) => void;
|
|
23
|
-
updateAudio: (
|
|
24
|
+
updateAudio: (options: {
|
|
25
|
+
id: number;
|
|
26
|
+
aud: RemotionAudioProps;
|
|
27
|
+
audioId: string;
|
|
28
|
+
}) => void;
|
|
24
29
|
playAllAudios: () => void;
|
|
25
30
|
numberOfAudioTags: number;
|
|
26
31
|
};
|
|
@@ -28,6 +33,7 @@ export declare const SharedAudioContext: React.Context<SharedContext | null>;
|
|
|
28
33
|
export declare const SharedAudioContextProvider: React.FC<{
|
|
29
34
|
numberOfAudioTags: number;
|
|
30
35
|
children: React.ReactNode;
|
|
36
|
+
component: LazyExoticComponent<ComponentType<Record<string, unknown> | undefined>> | null;
|
|
31
37
|
}>;
|
|
32
38
|
export declare const useSharedAudio: (aud: RemotionAudioProps, audioId: string) => AudioElem;
|
|
33
39
|
export {};
|
|
@@ -59,7 +59,7 @@ const didPropChange = (key, newProp, prevProp) => {
|
|
|
59
59
|
return true;
|
|
60
60
|
};
|
|
61
61
|
exports.SharedAudioContext = (0, react_1.createContext)(null);
|
|
62
|
-
const SharedAudioContextProvider = ({ children, numberOfAudioTags }) => {
|
|
62
|
+
const SharedAudioContextProvider = ({ children, numberOfAudioTags, component }) => {
|
|
63
63
|
const audios = (0, react_1.useRef)([]);
|
|
64
64
|
const [initialNumberOfAudioTags] = (0, react_1.useState)(numberOfAudioTags);
|
|
65
65
|
if (numberOfAudioTags !== initialNumberOfAudioTags) {
|
|
@@ -133,7 +133,7 @@ const SharedAudioContextProvider = ({ children, numberOfAudioTags }) => {
|
|
|
133
133
|
audios.current = (_a = audios.current) === null || _a === void 0 ? void 0 : _a.filter((a) => a.id !== id);
|
|
134
134
|
rerenderAudios();
|
|
135
135
|
}, [refs, rerenderAudios]);
|
|
136
|
-
const updateAudio = (0, react_1.useCallback)((id,
|
|
136
|
+
const updateAudio = (0, react_1.useCallback)(({ aud, audioId, id, }) => {
|
|
137
137
|
var _a;
|
|
138
138
|
let changed = false;
|
|
139
139
|
audios.current = (_a = audios.current) === null || _a === void 0 ? void 0 : _a.map((prevA) => {
|
|
@@ -146,6 +146,7 @@ const SharedAudioContextProvider = ({ children, numberOfAudioTags }) => {
|
|
|
146
146
|
return {
|
|
147
147
|
...prevA,
|
|
148
148
|
props: aud,
|
|
149
|
+
audioId,
|
|
149
150
|
};
|
|
150
151
|
}
|
|
151
152
|
return prevA;
|
|
@@ -175,12 +176,29 @@ const SharedAudioContextProvider = ({ children, numberOfAudioTags }) => {
|
|
|
175
176
|
unregisterAudio,
|
|
176
177
|
updateAudio,
|
|
177
178
|
]);
|
|
179
|
+
// Fixing a bug: In React, if a component is unmounted using useInsertionEffect, then
|
|
180
|
+
// the cleanup function does sometimes not work properly. That is why when we
|
|
181
|
+
// are changing the composition, we reset the audio state.
|
|
182
|
+
// TODO: Possibly this does not save the problem completely, since the
|
|
183
|
+
// if an audio tag that is inside a sequence will also not be removed
|
|
184
|
+
// from the shared audios.
|
|
185
|
+
const resetAudio = (0, react_1.useCallback)(() => {
|
|
186
|
+
takenAudios.current = new Array(numberOfAudioTags).fill(false);
|
|
187
|
+
audios.current = [];
|
|
188
|
+
rerenderAudios();
|
|
189
|
+
}, [numberOfAudioTags, rerenderAudios]);
|
|
190
|
+
(0, react_1.useEffect)(() => {
|
|
191
|
+
return () => {
|
|
192
|
+
resetAudio();
|
|
193
|
+
};
|
|
194
|
+
}, [component, resetAudio]);
|
|
178
195
|
return ((0, jsx_runtime_1.jsxs)(exports.SharedAudioContext.Provider, { value: value, children: [refs.map(({ id, ref }) => {
|
|
179
196
|
return (0, jsx_runtime_1.jsx)("audio", { ref: ref, src: EMPTY_AUDIO }, id);
|
|
180
197
|
}), children] }));
|
|
181
198
|
};
|
|
182
199
|
exports.SharedAudioContextProvider = SharedAudioContextProvider;
|
|
183
200
|
const useSharedAudio = (aud, audioId) => {
|
|
201
|
+
var _a;
|
|
184
202
|
const ctx = (0, react_1.useContext)(exports.SharedAudioContext);
|
|
185
203
|
/**
|
|
186
204
|
* We work around this in React 18 so an audio tag will only register itself once
|
|
@@ -200,20 +218,24 @@ const useSharedAudio = (aud, audioId) => {
|
|
|
200
218
|
* Effects in React 18 fire twice, and we are looking for a way to only fire it once.
|
|
201
219
|
* - useInsertionEffect only fires once. If it's available we are in React 18.
|
|
202
220
|
* - useLayoutEffect only fires once in React 17.
|
|
221
|
+
*
|
|
222
|
+
* Need to import it from React to fix React 17 ESM support.
|
|
203
223
|
*/
|
|
204
|
-
const effectToUse = react_1.useInsertionEffect !== null &&
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
ctx.updateAudio(elem.id, aud);
|
|
208
|
-
}
|
|
209
|
-
}, [aud, ctx, elem.id]);
|
|
210
|
-
effectToUse(() => {
|
|
211
|
-
return () => {
|
|
224
|
+
const effectToUse = (_a = react_1.default.useInsertionEffect) !== null && _a !== void 0 ? _a : react_1.default.useLayoutEffect;
|
|
225
|
+
if (typeof document !== 'undefined') {
|
|
226
|
+
effectToUse(() => {
|
|
212
227
|
if (ctx && ctx.numberOfAudioTags > 0) {
|
|
213
|
-
ctx.
|
|
228
|
+
ctx.updateAudio({ id: elem.id, aud, audioId });
|
|
214
229
|
}
|
|
215
|
-
};
|
|
216
|
-
|
|
230
|
+
}, [aud, ctx, elem.id, audioId]);
|
|
231
|
+
effectToUse(() => {
|
|
232
|
+
return () => {
|
|
233
|
+
if (ctx && ctx.numberOfAudioTags > 0) {
|
|
234
|
+
ctx.unregisterAudio(elem.id);
|
|
235
|
+
}
|
|
236
|
+
};
|
|
237
|
+
}, [ctx, elem.id]);
|
|
238
|
+
}
|
|
217
239
|
return elem;
|
|
218
240
|
};
|
|
219
241
|
exports.useSharedAudio = useSharedAudio;
|
|
File without changes
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.useFrameForVolumeProp = exports.useMediaStartsAt = void 0;
|
|
4
4
|
const react_1 = require("react");
|
|
5
|
-
const
|
|
6
|
-
const
|
|
5
|
+
const SequenceContext_js_1 = require("../SequenceContext.js");
|
|
6
|
+
const use_current_frame_js_1 = require("../use-current-frame.js");
|
|
7
7
|
const useMediaStartsAt = () => {
|
|
8
8
|
var _a;
|
|
9
|
-
const parentSequence = (0, react_1.useContext)(
|
|
9
|
+
const parentSequence = (0, react_1.useContext)(SequenceContext_js_1.SequenceContext);
|
|
10
10
|
const startsAt = Math.min(0, (_a = parentSequence === null || parentSequence === void 0 ? void 0 : parentSequence.relativeFrom) !== null && _a !== void 0 ? _a : 0);
|
|
11
11
|
return startsAt;
|
|
12
12
|
};
|
|
@@ -16,7 +16,7 @@ exports.useMediaStartsAt = useMediaStartsAt;
|
|
|
16
16
|
* we calculate the way more intuitive value for currentFrame
|
|
17
17
|
*/
|
|
18
18
|
const useFrameForVolumeProp = () => {
|
|
19
|
-
const frame = (0,
|
|
19
|
+
const frame = (0, use_current_frame_js_1.useCurrentFrame)();
|
|
20
20
|
const startsAt = (0, exports.useMediaStartsAt)();
|
|
21
21
|
return frame + startsAt;
|
|
22
22
|
};
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.cancelRender = void 0;
|
|
4
|
+
const isErrorLike = (err) => {
|
|
5
|
+
if (err === null) {
|
|
6
|
+
return false;
|
|
7
|
+
}
|
|
8
|
+
if (typeof err !== 'object') {
|
|
9
|
+
return false;
|
|
10
|
+
}
|
|
11
|
+
if (!('stack' in err)) {
|
|
12
|
+
return false;
|
|
13
|
+
}
|
|
14
|
+
// eslint-disable-next-line @typescript-eslint/prefer-ts-expect-error
|
|
15
|
+
// @ts-ignore we just asserted
|
|
16
|
+
if (typeof err.stack !== 'string') {
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
19
|
+
if (!('message' in err)) {
|
|
20
|
+
return false;
|
|
21
|
+
}
|
|
22
|
+
// eslint-disable-next-line @typescript-eslint/prefer-ts-expect-error
|
|
23
|
+
// @ts-ignore we just asserted
|
|
24
|
+
if (typeof err.message !== 'string') {
|
|
25
|
+
return false;
|
|
26
|
+
}
|
|
27
|
+
return true;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* @description When you invoke this function, Remotion will stop rendering all the frames without any retries
|
|
31
|
+
* @see [Documentation](https://www.remotion.dev/docs/cancel-render)
|
|
32
|
+
*/
|
|
33
|
+
function cancelRender(err) {
|
|
34
|
+
let error;
|
|
35
|
+
if (isErrorLike(err)) {
|
|
36
|
+
error = err;
|
|
37
|
+
}
|
|
38
|
+
else if (typeof err === 'string') {
|
|
39
|
+
error = Error(err);
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
error = Error('Rendering was cancelled');
|
|
43
|
+
}
|
|
44
|
+
window.remotion_cancelledError = error.stack;
|
|
45
|
+
throw error;
|
|
46
|
+
}
|
|
47
|
+
exports.cancelRender = cancelRender;
|
|
File without changes
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getInputProps = void 0;
|
|
4
|
-
const
|
|
4
|
+
const get_environment_js_1 = require("../get-environment.js");
|
|
5
5
|
let didWarnSSRImport = false;
|
|
6
6
|
const warnOnceSSRImport = () => {
|
|
7
7
|
if (didWarnSSRImport) {
|
|
@@ -17,8 +17,8 @@ const getInputProps = () => {
|
|
|
17
17
|
warnOnceSSRImport();
|
|
18
18
|
return {};
|
|
19
19
|
}
|
|
20
|
-
if ((0,
|
|
21
|
-
(0,
|
|
20
|
+
if ((0, get_environment_js_1.getRemotionEnvironment)() === 'player-development' ||
|
|
21
|
+
(0, get_environment_js_1.getRemotionEnvironment)() === 'player-production') {
|
|
22
22
|
throw new Error('You cannot call `getInputProps()` from a <Player>. Instead, the props are available as React props from component that you passed as `component` prop.');
|
|
23
23
|
}
|
|
24
24
|
const param = window.remotion_inputProps;
|
|
File without changes
|
|
File without changes
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
export declare const DELAY_RENDER_CALLSTACK_TOKEN = "The delayRender was called:";
|
|
2
2
|
/**
|
|
3
|
-
* Call this function to tell Remotion to wait before capturing this frame until data has loaded. Use continueRender() to unblock the render.
|
|
3
|
+
* @description Call this function to tell Remotion to wait before capturing this frame until data has loaded. Use continueRender() to unblock the render.
|
|
4
4
|
* @param label _optional_ A label to identify the call in case it does time out.
|
|
5
5
|
* @returns {number} An identifier to be passed to continueRender().
|
|
6
|
-
* @
|
|
6
|
+
* @see [Documentation](https://www.remotion.dev/docs/delay-render)
|
|
7
7
|
*/
|
|
8
8
|
export declare const delayRender: (label?: string) => number;
|
|
9
9
|
/**
|
|
10
|
-
* Unblock a render that has been blocked by delayRender()
|
|
10
|
+
* @description Unblock a render that has been blocked by delayRender()
|
|
11
11
|
* @param handle The return value of delayRender().
|
|
12
|
-
* @
|
|
12
|
+
* @see [Documentation](https://www.remotion.dev/docs/continue-render)
|
|
13
13
|
*/
|
|
14
14
|
export declare const continueRender: (handle: number) => void;
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.continueRender = exports.delayRender = exports.DELAY_RENDER_CALLSTACK_TOKEN = void 0;
|
|
4
|
-
const
|
|
5
|
-
const
|
|
4
|
+
const get_environment_js_1 = require("./get-environment.js");
|
|
5
|
+
const truthy_js_1 = require("./truthy.js");
|
|
6
6
|
if (typeof window !== 'undefined') {
|
|
7
|
-
window.
|
|
7
|
+
window.remotion_renderReady = false;
|
|
8
8
|
}
|
|
9
9
|
let handles = [];
|
|
10
10
|
const timeouts = {};
|
|
11
11
|
exports.DELAY_RENDER_CALLSTACK_TOKEN = 'The delayRender was called:';
|
|
12
12
|
const defaultTimeout = 30000;
|
|
13
13
|
/**
|
|
14
|
-
* Call this function to tell Remotion to wait before capturing this frame until data has loaded. Use continueRender() to unblock the render.
|
|
14
|
+
* @description Call this function to tell Remotion to wait before capturing this frame until data has loaded. Use continueRender() to unblock the render.
|
|
15
15
|
* @param label _optional_ A label to identify the call in case it does time out.
|
|
16
16
|
* @returns {number} An identifier to be passed to continueRender().
|
|
17
|
-
* @
|
|
17
|
+
* @see [Documentation](https://www.remotion.dev/docs/delay-render)
|
|
18
18
|
*/
|
|
19
19
|
const delayRender = (label) => {
|
|
20
20
|
var _a, _b, _c;
|
|
@@ -25,7 +25,7 @@ const delayRender = (label) => {
|
|
|
25
25
|
const handle = Math.random();
|
|
26
26
|
handles.push(handle);
|
|
27
27
|
const called = (_b = (_a = Error().stack) === null || _a === void 0 ? void 0 : _a.replace(/^Error/g, '')) !== null && _b !== void 0 ? _b : '';
|
|
28
|
-
if ((0,
|
|
28
|
+
if ((0, get_environment_js_1.getRemotionEnvironment)() === 'rendering') {
|
|
29
29
|
const timeoutToUse = typeof window === 'undefined'
|
|
30
30
|
? defaultTimeout
|
|
31
31
|
: ((_c = window.remotion_puppeteerTimeout) !== null && _c !== void 0 ? _c : defaultTimeout) - 2000;
|
|
@@ -37,21 +37,21 @@ const delayRender = (label) => {
|
|
|
37
37
|
exports.DELAY_RENDER_CALLSTACK_TOKEN,
|
|
38
38
|
called,
|
|
39
39
|
]
|
|
40
|
-
.filter(
|
|
40
|
+
.filter(truthy_js_1.truthy)
|
|
41
41
|
.join(' ');
|
|
42
42
|
throw new Error(message);
|
|
43
43
|
}, timeoutToUse);
|
|
44
44
|
}
|
|
45
45
|
if (typeof window !== 'undefined') {
|
|
46
|
-
window.
|
|
46
|
+
window.remotion_renderReady = false;
|
|
47
47
|
}
|
|
48
48
|
return handle;
|
|
49
49
|
};
|
|
50
50
|
exports.delayRender = delayRender;
|
|
51
51
|
/**
|
|
52
|
-
* Unblock a render that has been blocked by delayRender()
|
|
52
|
+
* @description Unblock a render that has been blocked by delayRender()
|
|
53
53
|
* @param handle The return value of delayRender().
|
|
54
|
-
* @
|
|
54
|
+
* @see [Documentation](https://www.remotion.dev/docs/continue-render)
|
|
55
55
|
*/
|
|
56
56
|
const continueRender = (handle) => {
|
|
57
57
|
if (typeof handle === 'undefined') {
|
|
@@ -63,7 +63,7 @@ const continueRender = (handle) => {
|
|
|
63
63
|
}
|
|
64
64
|
handles = handles.filter((h) => {
|
|
65
65
|
if (h === handle) {
|
|
66
|
-
if ((0,
|
|
66
|
+
if ((0, get_environment_js_1.getRemotionEnvironment)() === 'rendering') {
|
|
67
67
|
clearTimeout(timeouts[handle]);
|
|
68
68
|
}
|
|
69
69
|
return false;
|
|
@@ -71,7 +71,7 @@ const continueRender = (handle) => {
|
|
|
71
71
|
return true;
|
|
72
72
|
});
|
|
73
73
|
if (handles.length === 0 && typeof window !== 'undefined') {
|
|
74
|
-
window.
|
|
74
|
+
window.remotion_renderReady = true;
|
|
75
75
|
}
|
|
76
76
|
};
|
|
77
77
|
exports.continueRender = continueRender;
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description The Easing module implements common easing functions. You can use it with the interpolate() API.
|
|
3
|
+
* @see [Documentation](https://www.remotion.dev/docs/easing)
|
|
4
|
+
*/
|
|
1
5
|
export declare class Easing {
|
|
2
6
|
static step0(n: number): number;
|
|
3
7
|
static step1(n: number): number;
|
|
@@ -2,7 +2,11 @@
|
|
|
2
2
|
// Taken from https://github.com/facebook/react-native/blob/0b9ea60b4fee8cacc36e7160e31b91fc114dbc0d/Libraries/Animated/src/Easing.js
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.Easing = void 0;
|
|
5
|
-
const
|
|
5
|
+
const bezier_js_1 = require("./bezier.js");
|
|
6
|
+
/**
|
|
7
|
+
* @description The Easing module implements common easing functions. You can use it with the interpolate() API.
|
|
8
|
+
* @see [Documentation](https://www.remotion.dev/docs/easing)
|
|
9
|
+
*/
|
|
6
10
|
class Easing {
|
|
7
11
|
static step0(n) {
|
|
8
12
|
return n > 0 ? 1 : 0;
|
|
@@ -57,7 +61,7 @@ class Easing {
|
|
|
57
61
|
return 7.5625 * t2 * t2 + 0.984375;
|
|
58
62
|
}
|
|
59
63
|
static bezier(x1, y1, x2, y2) {
|
|
60
|
-
return (0,
|
|
64
|
+
return (0, bezier_js_1.bezier)(x1, y1, x2, y2);
|
|
61
65
|
}
|
|
62
66
|
static in(easing) {
|
|
63
67
|
return easing;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
type FreezeProps = {
|
|
3
|
+
frame: number;
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* @description This method freezes all of its children to the frame that you specify as a prop
|
|
8
|
+
* @see [Documentation](https://www.remotion.dev/docs/freeze)
|
|
9
|
+
*/
|
|
10
|
+
export declare const Freeze: React.FC<FreezeProps>;
|
|
11
|
+
export {};
|
|
@@ -3,8 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.Freeze = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
|
-
const
|
|
7
|
-
const
|
|
6
|
+
const SequenceContext_js_1 = require("./SequenceContext.js");
|
|
7
|
+
const timeline_position_state_js_1 = require("./timeline-position-state.js");
|
|
8
|
+
/**
|
|
9
|
+
* @description This method freezes all of its children to the frame that you specify as a prop
|
|
10
|
+
* @see [Documentation](https://www.remotion.dev/docs/freeze)
|
|
11
|
+
*/
|
|
8
12
|
const Freeze = ({ frame, children }) => {
|
|
9
13
|
if (typeof frame === 'undefined') {
|
|
10
14
|
throw new Error(`The <Freeze /> component requires a 'frame' prop, but none was passed.`);
|
|
@@ -18,7 +22,7 @@ const Freeze = ({ frame, children }) => {
|
|
|
18
22
|
if (!Number.isFinite(frame)) {
|
|
19
23
|
throw new Error(`The 'frame' prop of <Freeze /> must be a finite number, but it is ${frame}.`);
|
|
20
24
|
}
|
|
21
|
-
const context = (0, react_1.useContext)(
|
|
25
|
+
const context = (0, react_1.useContext)(timeline_position_state_js_1.TimelineContext);
|
|
22
26
|
const value = (0, react_1.useMemo)(() => {
|
|
23
27
|
return {
|
|
24
28
|
...context,
|
|
@@ -29,6 +33,6 @@ const Freeze = ({ frame, children }) => {
|
|
|
29
33
|
frame,
|
|
30
34
|
};
|
|
31
35
|
}, [context, frame]);
|
|
32
|
-
return ((0, jsx_runtime_1.jsx)(
|
|
36
|
+
return ((0, jsx_runtime_1.jsx)(timeline_position_state_js_1.TimelineContext.Provider, { value: value, children: (0, jsx_runtime_1.jsx)(SequenceContext_js_1.SequenceContext.Provider, { value: null, children: children }) }));
|
|
33
37
|
};
|
|
34
38
|
exports.Freeze = Freeze;
|
|
File without changes
|
|
File without changes
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getRemotionEnvironment = void 0;
|
|
3
|
+
exports.useRemotionEnvironment = exports.getRemotionEnvironment = void 0;
|
|
4
|
+
const is_player_js_1 = require("./is-player.js");
|
|
4
5
|
const getRemotionEnvironment = () => {
|
|
5
6
|
if (process.env.NODE_ENV === 'production') {
|
|
6
7
|
if (typeof window !== 'undefined' && window.remotion_isPlayer) {
|
|
@@ -8,7 +9,7 @@ const getRemotionEnvironment = () => {
|
|
|
8
9
|
}
|
|
9
10
|
return 'rendering';
|
|
10
11
|
}
|
|
11
|
-
// The
|
|
12
|
+
// The Vitest framework sets NODE_ENV as test.
|
|
12
13
|
// Right now we don't need to treat it in a special
|
|
13
14
|
// way which is good - defaulting to `rendering`.
|
|
14
15
|
if (process.env.NODE_ENV === 'test') {
|
|
@@ -20,3 +21,14 @@ const getRemotionEnvironment = () => {
|
|
|
20
21
|
return 'preview';
|
|
21
22
|
};
|
|
22
23
|
exports.getRemotionEnvironment = getRemotionEnvironment;
|
|
24
|
+
const useRemotionEnvironment = () => {
|
|
25
|
+
const isPlayer = (0, is_player_js_1.useIsPlayer)();
|
|
26
|
+
if (isPlayer) {
|
|
27
|
+
if (process.env.NODE_ENV === 'production') {
|
|
28
|
+
return 'player-production';
|
|
29
|
+
}
|
|
30
|
+
return 'player-development';
|
|
31
|
+
}
|
|
32
|
+
return (0, exports.getRemotionEnvironment)();
|
|
33
|
+
};
|
|
34
|
+
exports.useRemotionEnvironment = useRemotionEnvironment;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getPreviewDomElement = exports.REMOTION_STUDIO_CONTAINER_ELEMENT = void 0;
|
|
4
|
+
exports.REMOTION_STUDIO_CONTAINER_ELEMENT = '__remotion-studio-container';
|
|
5
|
+
const getPreviewDomElement = () => {
|
|
6
|
+
return document.getElementById(exports.REMOTION_STUDIO_CONTAINER_ELEMENT);
|
|
7
|
+
};
|
|
8
|
+
exports.getPreviewDomElement = getPreviewDomElement;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description The function array containing all files in the public/ folder. You can reference them by using staticFile().
|
|
3
|
+
* @see [Documentation](https://www.remotion.dev/docs/getstaticfiles)
|
|
4
|
+
*/
|
|
5
|
+
export declare const getStaticFiles: () => StaticFile[];
|
|
6
|
+
export type StaticFile = {
|
|
7
|
+
/**
|
|
8
|
+
* A string that you can pass to the `src` attribute of an `<Audio>`, `<Img>` and `<Video>` element.
|
|
9
|
+
*/
|
|
10
|
+
src: string;
|
|
11
|
+
/**
|
|
12
|
+
* The filepath of the file, relative to the public folder.
|
|
13
|
+
* Example: `subfolder/image.png`
|
|
14
|
+
*/
|
|
15
|
+
name: string;
|
|
16
|
+
sizeInBytes: number;
|
|
17
|
+
/**
|
|
18
|
+
* UNIX timestamp in milliseconds
|
|
19
|
+
*/
|
|
20
|
+
lastModified: number;
|
|
21
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getStaticFiles = void 0;
|
|
4
|
+
let warnedServer = false;
|
|
5
|
+
let warnedPlayer = false;
|
|
6
|
+
const warnServerOnce = () => {
|
|
7
|
+
if (warnedServer) {
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
warnedServer = true;
|
|
11
|
+
console.warn('Called getStaticFiles() on the server. The API is only available in the browser. An empty array was returned.');
|
|
12
|
+
};
|
|
13
|
+
const warnPlayerOnce = () => {
|
|
14
|
+
if (warnedPlayer) {
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
warnedPlayer = true;
|
|
18
|
+
console.warn('Called getStaticFiles() while using the Remotion Player. The API is only available while using the Remotion Studio. An empty array was returned.');
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* @description The function array containing all files in the public/ folder. You can reference them by using staticFile().
|
|
22
|
+
* @see [Documentation](https://www.remotion.dev/docs/getstaticfiles)
|
|
23
|
+
*/
|
|
24
|
+
const getStaticFiles = () => {
|
|
25
|
+
if (typeof document === 'undefined') {
|
|
26
|
+
warnServerOnce();
|
|
27
|
+
return [];
|
|
28
|
+
}
|
|
29
|
+
if (window.remotion_isPlayer) {
|
|
30
|
+
warnPlayerOnce();
|
|
31
|
+
return [];
|
|
32
|
+
}
|
|
33
|
+
return window.remotion_staticFiles;
|
|
34
|
+
};
|
|
35
|
+
exports.getStaticFiles = getStaticFiles;
|
|
File without changes
|
|
File without changes
|