remotion 3.3.44 → 3.3.51
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/README.md +1 -1
- package/dist/{Clipper.js → cjs/Clipper.js} +2 -2
- package/dist/{Composition.js → cjs/Composition.js} +38 -38
- package/dist/{CompositionManager.d.ts → cjs/CompositionManager.d.ts} +1 -1
- package/dist/{CompositionManager.js → cjs/CompositionManager.js} +14 -4
- package/dist/{Folder.js → cjs/Folder.js} +6 -6
- package/dist/{IFrame.js → cjs/IFrame.js} +4 -4
- package/dist/{Img.js → cjs/Img.js} +9 -9
- package/dist/{Null.js → cjs/Null.js} +2 -2
- package/dist/{RemotionRoot.js → cjs/RemotionRoot.js} +13 -13
- package/dist/{Sequence.d.ts → cjs/Sequence.d.ts} +1 -0
- package/dist/{Sequence.js → cjs/Sequence.js} +15 -15
- package/dist/{Still.d.ts → cjs/Still.d.ts} +1 -1
- package/dist/{Still.js → cjs/Still.js} +2 -2
- package/dist/{audio → cjs/audio}/Audio.d.ts +2 -2
- package/dist/{audio → cjs/audio}/Audio.js +18 -18
- package/dist/{audio → cjs/audio}/AudioForDevelopment.d.ts +1 -1
- package/dist/{audio → cjs/audio}/AudioForDevelopment.js +22 -22
- package/dist/{audio → cjs/audio}/AudioForRendering.d.ts +1 -1
- package/dist/{audio → cjs/audio}/AudioForRendering.js +23 -23
- package/dist/cjs/audio/index.d.ts +2 -0
- package/dist/{audio → cjs/audio}/index.js +2 -2
- package/dist/{audio → cjs/audio}/props.d.ts +1 -1
- package/dist/{audio → cjs/audio}/shared-audio-tags.d.ts +1 -1
- package/dist/{audio → cjs/audio}/use-audio-frame.js +4 -4
- package/dist/{config → cjs/config}/input-props.js +3 -3
- package/dist/cjs/config.d.ts +285 -0
- package/dist/{delay-render.js → cjs/delay-render.js} +5 -5
- package/dist/{easing.js → cjs/easing.js} +2 -2
- package/dist/{freeze.js → cjs/freeze.js} +4 -4
- package/dist/{get-environment.js → cjs/get-environment.js} +2 -2
- package/dist/{index.d.ts → cjs/index.d.ts} +32 -31
- package/dist/{index.js → cjs/index.js} +45 -45
- package/dist/{internals.d.ts → cjs/internals.d.ts} +13 -15
- package/dist/cjs/internals.js +101 -0
- package/dist/{interpolate-colors.js → cjs/interpolate-colors.js} +2 -2
- package/dist/{loading-indicator.js → cjs/loading-indicator.js} +2 -2
- package/dist/{loop → cjs/loop}/index.d.ts +1 -1
- package/dist/{loop → cjs/loop}/index.js +6 -6
- package/dist/{multiple-versions-warning.js → cjs/multiple-versions-warning.js} +7 -7
- package/dist/{prefetch.js → cjs/prefetch.js} +6 -6
- package/dist/{random.js → cjs/random.js} +1 -0
- package/dist/{series → cjs/series}/index.d.ts +1 -1
- package/dist/{series → cjs/series}/index.js +6 -6
- package/dist/{setup-env-variables.js → cjs/setup-env-variables.js} +3 -3
- package/dist/{spring → cjs/spring}/index.d.ts +3 -3
- package/dist/{spring → cjs/spring}/index.js +12 -8
- package/dist/{spring → cjs/spring}/measure-spring.d.ts +1 -1
- package/dist/{spring → cjs/spring}/measure-spring.js +4 -4
- package/dist/cjs/test/Img.test.d.ts +1 -0
- package/dist/cjs/test/Img.test.js +25 -0
- package/dist/cjs/test/absolute-src.test.d.ts +1 -0
- package/dist/cjs/test/absolute-src.test.js +18 -0
- package/dist/cjs/test/audio-for-rendering.test.d.ts +1 -0
- package/dist/cjs/test/audio-for-rendering.test.js +88 -0
- package/dist/cjs/test/audio.test.d.ts +1 -0
- package/dist/cjs/test/audio.test.js +76 -0
- package/dist/cjs/test/bezier.test.d.ts +1 -0
- package/dist/cjs/test/bezier.test.js +52 -0
- package/dist/cjs/test/composition-rules.test.d.ts +1 -0
- package/dist/cjs/test/composition-rules.test.js +30 -0
- package/dist/cjs/test/composition-validation.test.d.ts +1 -0
- package/dist/cjs/test/composition-validation.test.js +99 -0
- package/dist/cjs/test/easing.test.d.ts +1 -0
- package/dist/cjs/test/easing.test.js +191 -0
- package/dist/cjs/test/expect-to-throw.d.ts +1 -0
- package/dist/cjs/test/expect-to-throw.js +15 -0
- package/dist/cjs/test/freeze.test.d.ts +1 -0
- package/dist/cjs/test/freeze.test.js +65 -0
- package/dist/cjs/test/get-asset-file-name.test.d.ts +1 -0
- package/dist/cjs/test/get-asset-file-name.test.js +14 -0
- package/dist/cjs/test/get-current-time.test.d.ts +1 -0
- package/dist/cjs/test/get-current-time.test.js +74 -0
- package/dist/cjs/test/input-props.test.d.ts +1 -0
- package/dist/cjs/test/input-props.test.js +31 -0
- package/dist/cjs/test/interpolate.test.d.ts +1 -0
- package/dist/cjs/test/interpolate.test.js +138 -0
- package/dist/cjs/test/interpolateColors.test.d.ts +1 -0
- package/dist/cjs/test/interpolateColors.test.js +63 -0
- package/dist/cjs/test/loop-validation.test.d.ts +1 -0
- package/dist/cjs/test/loop-validation.test.js +93 -0
- package/dist/cjs/test/measure-spring.test.d.ts +1 -0
- package/dist/cjs/test/measure-spring.test.js +45 -0
- package/dist/cjs/test/media-validation.test.d.ts +1 -0
- package/dist/cjs/test/media-validation.test.js +47 -0
- package/dist/cjs/test/nested-sequences.test.d.ts +1 -0
- package/dist/cjs/test/nested-sequences.test.js +132 -0
- package/dist/cjs/test/not-all-props-in-media-tags.test.d.ts +1 -0
- package/dist/cjs/test/not-all-props-in-media-tags.test.js +33 -0
- package/dist/cjs/test/random.test.d.ts +1 -0
- package/dist/cjs/test/random.test.js +60 -0
- package/dist/cjs/test/ready-manager.test.d.ts +1 -0
- package/dist/cjs/test/ready-manager.test.js +29 -0
- package/dist/cjs/test/render-hook.d.ts +23 -0
- package/dist/cjs/test/render-hook.js +27 -0
- package/dist/cjs/test/sequence-from-initial-offset.test.d.ts +4 -0
- package/dist/cjs/test/sequence-from-initial-offset.test.js +35 -0
- package/dist/cjs/test/sequence-validation.test.d.ts +1 -0
- package/dist/cjs/test/sequence-validation.test.js +47 -0
- package/dist/cjs/test/series.test.d.ts +1 -0
- package/dist/cjs/test/series.test.js +110 -0
- package/dist/cjs/test/spring.test.d.ts +1 -0
- package/dist/cjs/test/spring.test.js +38 -0
- package/dist/cjs/test/truthy.test.d.ts +1 -0
- package/dist/cjs/test/truthy.test.js +24 -0
- package/dist/cjs/test/use-audio-frame.test.d.ts +1 -0
- package/dist/cjs/test/use-audio-frame.test.js +78 -0
- package/dist/cjs/test/use-media-in-timeline.test.d.ts +1 -0
- package/dist/cjs/test/use-media-in-timeline.test.js +74 -0
- package/dist/cjs/test/use-media-tag-volume.test.d.ts +1 -0
- package/dist/cjs/test/use-media-tag-volume.test.js +49 -0
- package/dist/cjs/test/use-sync-volume-with-media-tag.test.d.ts +1 -0
- package/dist/cjs/test/use-sync-volume-with-media-tag.test.js +55 -0
- package/dist/cjs/test/validate-start-from-props.test.d.ts +1 -0
- package/dist/cjs/test/validate-start-from-props.test.js +39 -0
- package/dist/cjs/test/video.test.d.ts +1 -0
- package/dist/cjs/test/video.test.js +80 -0
- package/dist/cjs/test/volume-prop.test.d.ts +1 -0
- package/dist/cjs/test/volume-prop.test.js +95 -0
- package/dist/cjs/test/wrap-sequence-context.d.ts +6 -0
- package/dist/cjs/test/wrap-sequence-context.js +41 -0
- package/dist/{use-current-frame.js → cjs/use-current-frame.js} +6 -6
- package/dist/{use-lazy-component.d.ts → cjs/use-lazy-component.d.ts} +1 -1
- package/dist/{use-media-in-timeline.d.ts → cjs/use-media-in-timeline.d.ts} +1 -1
- package/dist/{use-media-in-timeline.js → cjs/use-media-in-timeline.js} +21 -21
- package/dist/{use-media-playback.js → cjs/use-media-playback.js} +16 -16
- package/dist/{use-sync-volume-with-media-tag.d.ts → cjs/use-sync-volume-with-media-tag.d.ts} +1 -1
- package/dist/{use-sync-volume-with-media-tag.js → cjs/use-sync-volume-with-media-tag.js} +4 -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/{use-video-config.d.ts → cjs/use-video-config.d.ts} +1 -1
- package/dist/{use-video-config.js → cjs/use-video-config.js} +6 -6
- package/dist/{use-video.js → cjs/use-video.js} +2 -2
- package/dist/cjs/validate-frame.d.ts +1 -0
- package/dist/cjs/validate-frame.js +24 -0
- package/dist/{validate-media-props.d.ts → cjs/validate-media-props.d.ts} +1 -1
- package/dist/cjs/version.d.ts +1 -0
- package/dist/{version.js → cjs/version.js} +1 -1
- package/dist/{video → cjs/video}/OffthreadVideo.d.ts +1 -1
- package/dist/cjs/video/OffthreadVideo.js +33 -0
- package/dist/{video → cjs/video}/OffthreadVideoForRendering.d.ts +1 -1
- package/dist/{video → cjs/video}/OffthreadVideoForRendering.js +28 -28
- package/dist/{video → cjs/video}/Video.d.ts +2 -2
- package/dist/{video → cjs/video}/Video.js +16 -16
- package/dist/{video → cjs/video}/VideoForDevelopment.d.ts +1 -1
- package/dist/{video → cjs/video}/VideoForDevelopment.js +22 -22
- package/dist/{video → cjs/video}/VideoForRendering.d.ts +1 -1
- package/dist/{video → cjs/video}/VideoForRendering.js +40 -40
- package/dist/{video → cjs/video}/get-current-time.js +2 -2
- package/dist/{video → cjs/video}/index.d.ts +3 -3
- package/dist/{video → cjs/video}/index.js +4 -4
- package/dist/{video → cjs/video}/props.d.ts +1 -1
- package/dist/cjs/wrap-remotion-context.d.ts +18 -0
- package/dist/{wrap-remotion-context.js → cjs/wrap-remotion-context.js} +16 -16
- package/dist/esm/AbsoluteFill.d.ts +6 -0
- package/dist/esm/AbsoluteFill.js +25 -0
- package/dist/esm/CanUseRemotionHooks.d.ts +5 -0
- package/dist/esm/CanUseRemotionHooks.js +6 -0
- package/dist/esm/Clipper.d.ts +7 -0
- package/dist/esm/Clipper.js +20 -0
- package/dist/esm/Composition.d.ts +23 -0
- package/dist/esm/Composition.js +108 -0
- package/dist/esm/CompositionManager.d.ts +82 -0
- package/dist/esm/CompositionManager.js +137 -0
- package/dist/esm/Folder.d.ts +15 -0
- package/dist/esm/Folder.js +29 -0
- package/dist/esm/IFrame.d.ts +2 -0
- package/dist/esm/IFrame.js +21 -0
- package/dist/esm/Img.d.ts +2 -0
- package/dist/esm/Img.js +49 -0
- package/dist/esm/NativeLayers.d.ts +13 -0
- package/dist/esm/NativeLayers.js +25 -0
- package/dist/esm/Null.d.ts +2 -0
- package/dist/esm/Null.js +21 -0
- package/dist/esm/RemotionRoot.d.ts +5 -0
- package/dist/esm/RemotionRoot.js +69 -0
- package/dist/esm/Sequence.d.ts +29 -0
- package/dist/esm/Sequence.js +128 -0
- package/dist/esm/Still.d.ts +3 -0
- package/dist/esm/Still.js +5 -0
- package/dist/esm/absolute-src.d.ts +1 -0
- package/dist/esm/absolute-src.js +3 -0
- package/dist/esm/asset-types.d.ts +50 -0
- package/dist/esm/asset-types.js +1 -0
- package/dist/esm/audio/Audio.d.ts +8 -0
- package/dist/esm/audio/Audio.js +49 -0
- package/dist/esm/audio/AudioForDevelopment.d.ts +11 -0
- package/dist/esm/audio/AudioForDevelopment.js +91 -0
- package/dist/esm/audio/AudioForRendering.d.ts +10 -0
- package/dist/esm/audio/AudioForRendering.js +108 -0
- package/dist/esm/audio/index.d.ts +2 -0
- package/dist/esm/audio/index.js +2 -0
- package/dist/esm/audio/props.d.ts +12 -0
- package/dist/esm/audio/props.js +1 -0
- package/dist/esm/audio/shared-audio-tags.d.ts +37 -0
- package/dist/esm/audio/shared-audio-tags.js +194 -0
- package/dist/esm/audio/use-audio-frame.d.ts +6 -0
- package/dist/esm/audio/use-audio-frame.js +18 -0
- package/dist/esm/bezier.d.ts +1 -0
- package/dist/esm/bezier.js +110 -0
- package/dist/esm/cancel-render.d.ts +1 -0
- package/dist/esm/cancel-render.js +39 -0
- package/dist/esm/config/input-props.d.ts +1 -0
- package/dist/esm/config/input-props.js +27 -0
- package/dist/esm/config.d.ts +285 -0
- package/dist/esm/config.js +17 -0
- package/dist/esm/default-css.d.ts +3 -0
- package/dist/esm/default-css.js +44 -0
- package/dist/esm/delay-render.d.ts +14 -0
- package/dist/esm/delay-render.js +72 -0
- package/dist/esm/easing.d.ts +19 -0
- package/dist/esm/easing.js +73 -0
- package/dist/esm/freeze.d.ts +7 -0
- package/dist/esm/freeze.js +30 -0
- package/dist/esm/get-asset-file-name.d.ts +1 -0
- package/dist/esm/get-asset-file-name.js +10 -0
- package/dist/esm/get-environment.d.ts +3 -0
- package/dist/esm/get-environment.js +29 -0
- package/dist/esm/get-preview-dom-element.d.ts +1 -0
- package/dist/esm/get-preview-dom-element.js +3 -0
- package/dist/esm/get-static-files.d.ts +17 -0
- package/dist/esm/get-static-files.js +27 -0
- package/dist/esm/get-timeline-clip-name.d.ts +1 -0
- package/dist/esm/get-timeline-clip-name.js +21 -0
- package/dist/esm/index.d.ts +92 -0
- package/dist/esm/index.js +41 -0
- package/dist/esm/internals.d.ts +99 -0
- package/dist/esm/internals.js +75 -0
- package/dist/esm/interpolate-colors.d.ts +5 -0
- package/dist/esm/interpolate-colors.js +397 -0
- package/dist/esm/interpolate.d.ts +18 -0
- package/dist/esm/interpolate.js +119 -0
- package/dist/esm/is-approximately-the-same.d.ts +1 -0
- package/dist/esm/is-approximately-the-same.js +4 -0
- package/dist/esm/is-player.d.ts +3 -0
- package/dist/esm/is-player.js +9 -0
- package/dist/esm/loading-indicator.d.ts +2 -0
- package/dist/esm/loading-indicator.js +31 -0
- package/dist/esm/loop/index.d.ts +9 -0
- package/dist/esm/loop/index.js +25 -0
- package/dist/esm/multiple-versions-warning.d.ts +1 -0
- package/dist/esm/multiple-versions-warning.js +28 -0
- package/dist/esm/nonce.d.ts +7 -0
- package/dist/esm/nonce.js +13 -0
- package/dist/esm/play-and-handle-not-allowed-error.d.ts +2 -0
- package/dist/esm/play-and-handle-not-allowed-error.js +40 -0
- package/dist/esm/portal-node.d.ts +1 -0
- package/dist/esm/portal-node.js +19 -0
- package/dist/esm/prefetch-state.d.ts +8 -0
- package/dist/esm/prefetch-state.js +22 -0
- package/dist/esm/prefetch.d.ts +9 -0
- package/dist/esm/prefetch.js +103 -0
- package/dist/esm/random.d.ts +7 -0
- package/dist/esm/random.js +38 -0
- package/dist/esm/register-root.d.ts +4 -0
- package/dist/esm/register-root.js +27 -0
- package/dist/esm/series/flatten-children.d.ts +2 -0
- package/dist/esm/series/flatten-children.js +12 -0
- package/dist/esm/series/index.d.ts +13 -0
- package/dist/esm/series/index.js +54 -0
- package/dist/esm/setup-env-variables.d.ts +2 -0
- package/dist/esm/setup-env-variables.js +32 -0
- package/dist/esm/spring/index.d.ts +27 -0
- package/dist/esm/spring/index.js +50 -0
- package/dist/esm/spring/measure-spring.d.ts +8 -0
- package/dist/esm/spring/measure-spring.js +60 -0
- package/dist/esm/spring/spring-utils.d.ts +21 -0
- package/dist/esm/spring/spring-utils.js +99 -0
- package/dist/esm/static-file.d.ts +5 -0
- package/dist/esm/static-file.js +29 -0
- package/dist/esm/test/Img.test.d.ts +1 -0
- package/dist/esm/test/Img.test.js +20 -0
- package/dist/esm/test/absolute-src.test.d.ts +1 -0
- package/dist/esm/test/absolute-src.test.js +16 -0
- package/dist/esm/test/audio-for-rendering.test.d.ts +1 -0
- package/dist/esm/test/audio-for-rendering.test.js +83 -0
- package/dist/esm/test/audio.test.d.ts +1 -0
- package/dist/esm/test/audio.test.js +51 -0
- package/dist/esm/test/bezier.test.d.ts +1 -0
- package/dist/esm/test/bezier.test.js +50 -0
- package/dist/esm/test/composition-rules.test.d.ts +1 -0
- package/dist/esm/test/composition-rules.test.js +28 -0
- package/dist/esm/test/composition-validation.test.d.ts +1 -0
- package/dist/esm/test/composition-validation.test.js +97 -0
- package/dist/esm/test/easing.test.d.ts +1 -0
- package/dist/esm/test/easing.test.js +189 -0
- package/dist/esm/test/expect-to-throw.d.ts +1 -0
- package/dist/esm/test/expect-to-throw.js +11 -0
- package/dist/esm/test/freeze.test.d.ts +1 -0
- package/dist/esm/test/freeze.test.js +63 -0
- package/dist/esm/test/get-asset-file-name.test.d.ts +1 -0
- package/dist/esm/test/get-asset-file-name.test.js +12 -0
- package/dist/esm/test/get-current-time.test.d.ts +1 -0
- package/dist/esm/test/get-current-time.test.js +72 -0
- package/dist/esm/test/input-props.test.d.ts +1 -0
- package/dist/esm/test/input-props.test.js +29 -0
- package/dist/esm/test/interpolate.test.d.ts +1 -0
- package/dist/esm/test/interpolate.test.js +136 -0
- package/dist/esm/test/interpolateColors.test.d.ts +1 -0
- package/dist/esm/test/interpolateColors.test.js +61 -0
- package/dist/esm/test/loop-validation.test.d.ts +1 -0
- package/dist/esm/test/loop-validation.test.js +68 -0
- package/dist/esm/test/measure-spring.test.d.ts +1 -0
- package/dist/esm/test/measure-spring.test.js +43 -0
- package/dist/esm/test/media-validation.test.d.ts +1 -0
- package/dist/esm/test/media-validation.test.js +45 -0
- package/dist/esm/test/nested-sequences.test.d.ts +1 -0
- package/dist/esm/test/nested-sequences.test.js +130 -0
- package/dist/esm/test/not-all-props-in-media-tags.test.d.ts +1 -0
- package/dist/esm/test/not-all-props-in-media-tags.test.js +28 -0
- package/dist/esm/test/random.test.d.ts +1 -0
- package/dist/esm/test/random.test.js +58 -0
- package/dist/esm/test/ready-manager.test.d.ts +1 -0
- package/dist/esm/test/ready-manager.test.js +27 -0
- package/dist/esm/test/render-hook.d.ts +23 -0
- package/dist/esm/test/render-hook.js +20 -0
- package/dist/esm/test/sequence-from-initial-offset.test.d.ts +4 -0
- package/dist/esm/test/sequence-from-initial-offset.test.js +33 -0
- package/dist/esm/test/sequence-validation.test.d.ts +1 -0
- package/dist/esm/test/sequence-validation.test.js +45 -0
- package/dist/esm/test/series.test.d.ts +1 -0
- package/dist/esm/test/series.test.js +108 -0
- package/dist/esm/test/spring.test.d.ts +1 -0
- package/dist/esm/test/spring.test.js +36 -0
- package/dist/esm/test/truthy.test.d.ts +1 -0
- package/dist/esm/test/truthy.test.js +22 -0
- package/dist/esm/test/use-audio-frame.test.d.ts +1 -0
- package/dist/esm/test/use-audio-frame.test.js +53 -0
- package/dist/esm/test/use-media-in-timeline.test.d.ts +1 -0
- package/dist/esm/test/use-media-in-timeline.test.js +49 -0
- package/dist/esm/test/use-media-tag-volume.test.d.ts +1 -0
- package/dist/esm/test/use-media-tag-volume.test.js +44 -0
- package/dist/esm/test/use-sync-volume-with-media-tag.test.d.ts +1 -0
- package/dist/esm/test/use-sync-volume-with-media-tag.test.js +53 -0
- package/dist/esm/test/validate-start-from-props.test.d.ts +1 -0
- package/dist/esm/test/validate-start-from-props.test.js +37 -0
- package/dist/esm/test/video.test.d.ts +1 -0
- package/dist/esm/test/video.test.js +55 -0
- package/dist/esm/test/volume-prop.test.d.ts +1 -0
- package/dist/esm/test/volume-prop.test.js +93 -0
- package/dist/esm/test/wrap-sequence-context.d.ts +6 -0
- package/dist/esm/test/wrap-sequence-context.js +37 -0
- package/dist/esm/timeline-position-state.d.ts +29 -0
- package/dist/esm/timeline-position-state.js +35 -0
- package/dist/esm/truthy.d.ts +3 -0
- package/dist/esm/truthy.js +3 -0
- package/dist/esm/use-current-frame.d.ts +6 -0
- package/dist/esm/use-current-frame.js +24 -0
- package/dist/esm/use-lazy-component.d.ts +7 -0
- package/dist/esm/use-lazy-component.js +22 -0
- package/dist/esm/use-media-in-timeline.d.ts +10 -0
- package/dist/esm/use-media-in-timeline.js +125 -0
- package/dist/esm/use-media-playback.d.ts +10 -0
- package/dist/esm/use-media-playback.js +73 -0
- package/dist/esm/use-media-tag-volume.d.ts +2 -0
- package/dist/esm/use-media-tag-volume.js +27 -0
- package/dist/esm/use-sync-volume-with-media-tag.d.ts +10 -0
- package/dist/esm/use-sync-volume-with-media-tag.js +17 -0
- package/dist/esm/use-unsafe-video-config.d.ts +2 -0
- package/dist/esm/use-unsafe-video-config.js +23 -0
- package/dist/esm/use-video-config.d.ts +7 -0
- package/dist/esm/use-video-config.js +25 -0
- package/dist/esm/use-video.d.ts +13 -0
- package/dist/esm/use-video.js +24 -0
- package/dist/esm/validate-frame.d.ts +1 -0
- package/dist/esm/validate-frame.js +20 -0
- package/dist/esm/validate-media-props.d.ts +4 -0
- package/dist/esm/validate-media-props.js +20 -0
- package/dist/esm/validate-start-from-props.d.ts +1 -0
- package/dist/esm/validate-start-from-props.js +27 -0
- package/dist/esm/validation/validate-composition-id.d.ts +3 -0
- package/dist/esm/validation/validate-composition-id.js +8 -0
- package/dist/esm/validation/validate-dimensions.d.ts +1 -0
- package/dist/esm/validation/validate-dimensions.js +17 -0
- package/dist/esm/validation/validate-duration-in-frames.d.ts +1 -0
- package/dist/esm/validation/validate-duration-in-frames.js +11 -0
- package/dist/esm/validation/validate-folder-name.d.ts +3 -0
- package/dist/esm/validation/validate-folder-name.js +14 -0
- package/dist/esm/validation/validate-fps.d.ts +1 -0
- package/dist/esm/validation/validate-fps.js +17 -0
- package/dist/esm/validation/validate-offthreadvideo-image-format.d.ts +1 -0
- package/dist/esm/validation/validate-offthreadvideo-image-format.js +11 -0
- package/dist/esm/validation/validation-spring-duration.d.ts +1 -0
- package/dist/esm/validation/validation-spring-duration.js +17 -0
- package/dist/esm/version.d.ts +1 -0
- package/dist/esm/version.js +2 -0
- package/dist/esm/video/OffthreadVideo.d.ts +3 -0
- package/dist/esm/video/OffthreadVideo.js +29 -0
- package/dist/esm/video/OffthreadVideoForRendering.d.ts +3 -0
- package/dist/esm/video/OffthreadVideoForRendering.js +100 -0
- package/dist/esm/video/Video.d.ts +8 -0
- package/dist/esm/video/Video.js +47 -0
- package/dist/esm/video/VideoForDevelopment.d.ts +11 -0
- package/dist/esm/video/VideoForDevelopment.js +110 -0
- package/dist/esm/video/VideoForRendering.d.ts +10 -0
- package/dist/esm/video/VideoForRendering.js +200 -0
- package/dist/esm/video/duration-state.d.ts +17 -0
- package/dist/esm/video/duration-state.js +29 -0
- package/dist/esm/video/get-current-time.d.ts +13 -0
- package/dist/esm/video/get-current-time.js +26 -0
- package/dist/esm/video/index.d.ts +3 -0
- package/dist/esm/video/index.js +2 -0
- package/dist/esm/video/props.d.ts +25 -0
- package/dist/esm/video/props.js +1 -0
- package/dist/esm/video/video-fragment.d.ts +12 -0
- package/dist/esm/video/video-fragment.js +55 -0
- package/dist/esm/video-config.d.ts +8 -0
- package/dist/esm/video-config.js +1 -0
- package/dist/esm/volume-position-state.d.ts +19 -0
- package/dist/esm/volume-position-state.js +27 -0
- package/dist/esm/volume-prop.d.ts +7 -0
- package/dist/esm/volume-prop.js +20 -0
- package/dist/esm/warn-about-non-seekable-media.d.ts +1 -0
- package/dist/esm/warn-about-non-seekable-media.js +30 -0
- package/dist/esm/wrap-remotion-context.d.ts +18 -0
- package/dist/esm/wrap-remotion-context.js +45 -0
- package/dist/tsconfig-cjs.tsbuildinfo +1 -0
- package/package.json +22 -11
- package/tsconfig-cjs.json +11 -0
- package/tsconfig.json +3 -3
- package/dist/LayerMaster.d.ts +0 -8
- package/dist/LayerMaster.js +0 -39
- package/dist/Satori.d.ts +0 -5
- package/dist/Satori.js +0 -92
- package/dist/audio/index.d.ts +0 -2
- package/dist/config.d.ts +0 -291
- package/dist/get-compositions-from-markup.d.ts +0 -3
- package/dist/get-compositions-from-markup.js +0 -19
- package/dist/internals.js +0 -99
- package/dist/layers.d.ts +0 -24
- package/dist/layers.js +0 -149
- package/dist/version.d.ts +0 -1
- package/dist/video/NativeVideo.d.ts +0 -5
- package/dist/video/NativeVideo.js +0 -33
- package/dist/video/NativeVideoForRendering.d.ts +0 -8
- package/dist/video/NativeVideoForRendering.js +0 -14
- package/dist/video/OffthreadVideo.js +0 -33
- package/dist/wrap-remotion-context.d.ts +0 -18
- /package/dist/{AbsoluteFill.d.ts → cjs/AbsoluteFill.d.ts} +0 -0
- /package/dist/{AbsoluteFill.js → cjs/AbsoluteFill.js} +0 -0
- /package/dist/{CanUseRemotionHooks.d.ts → cjs/CanUseRemotionHooks.d.ts} +0 -0
- /package/dist/{CanUseRemotionHooks.js → cjs/CanUseRemotionHooks.js} +0 -0
- /package/dist/{Clipper.d.ts → cjs/Clipper.d.ts} +0 -0
- /package/dist/{Composition.d.ts → cjs/Composition.d.ts} +0 -0
- /package/dist/{Folder.d.ts → cjs/Folder.d.ts} +0 -0
- /package/dist/{IFrame.d.ts → cjs/IFrame.d.ts} +0 -0
- /package/dist/{Img.d.ts → cjs/Img.d.ts} +0 -0
- /package/dist/{NativeLayers.d.ts → cjs/NativeLayers.d.ts} +0 -0
- /package/dist/{NativeLayers.js → cjs/NativeLayers.js} +0 -0
- /package/dist/{Null.d.ts → cjs/Null.d.ts} +0 -0
- /package/dist/{RemotionRoot.d.ts → cjs/RemotionRoot.d.ts} +0 -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}/props.js +0 -0
- /package/dist/{audio → cjs/audio}/shared-audio-tags.js +0 -0
- /package/dist/{audio → cjs/audio}/use-audio-frame.d.ts +0 -0
- /package/dist/{bezier.d.ts → cjs/bezier.d.ts} +0 -0
- /package/dist/{bezier.js → cjs/bezier.js} +0 -0
- /package/dist/{cancel-render.d.ts → cjs/cancel-render.d.ts} +0 -0
- /package/dist/{cancel-render.js → cjs/cancel-render.js} +0 -0
- /package/dist/{config → cjs/config}/input-props.d.ts +0 -0
- /package/dist/{config.js → cjs/config.js} +0 -0
- /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} +0 -0
- /package/dist/{easing.d.ts → cjs/easing.d.ts} +0 -0
- /package/dist/{freeze.d.ts → cjs/freeze.d.ts} +0 -0
- /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/{get-environment.d.ts → cjs/get-environment.d.ts} +0 -0
- /package/dist/{get-preview-dom-element.d.ts → cjs/get-preview-dom-element.d.ts} +0 -0
- /package/dist/{get-preview-dom-element.js → cjs/get-preview-dom-element.js} +0 -0
- /package/dist/{get-static-files.d.ts → cjs/get-static-files.d.ts} +0 -0
- /package/dist/{get-static-files.js → cjs/get-static-files.js} +0 -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/{interpolate-colors.d.ts → cjs/interpolate-colors.d.ts} +0 -0
- /package/dist/{interpolate.d.ts → cjs/interpolate.d.ts} +0 -0
- /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/{is-player.d.ts → cjs/is-player.d.ts} +0 -0
- /package/dist/{is-player.js → cjs/is-player.js} +0 -0
- /package/dist/{loading-indicator.d.ts → cjs/loading-indicator.d.ts} +0 -0
- /package/dist/{multiple-versions-warning.d.ts → cjs/multiple-versions-warning.d.ts} +0 -0
- /package/dist/{nonce.d.ts → cjs/nonce.d.ts} +0 -0
- /package/dist/{nonce.js → cjs/nonce.js} +0 -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} +0 -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/{prefetch-state.d.ts → cjs/prefetch-state.d.ts} +0 -0
- /package/dist/{prefetch-state.js → cjs/prefetch-state.js} +0 -0
- /package/dist/{prefetch.d.ts → cjs/prefetch.d.ts} +0 -0
- /package/dist/{random.d.ts → cjs/random.d.ts} +0 -0
- /package/dist/{register-root.d.ts → cjs/register-root.d.ts} +0 -0
- /package/dist/{register-root.js → cjs/register-root.js} +0 -0
- /package/dist/{series → cjs/series}/flatten-children.d.ts +0 -0
- /package/dist/{series → cjs/series}/flatten-children.js +0 -0
- /package/dist/{setup-env-variables.d.ts → cjs/setup-env-variables.d.ts} +0 -0
- /package/dist/{spring → cjs/spring}/spring-utils.d.ts +0 -0
- /package/dist/{spring → cjs/spring}/spring-utils.js +0 -0
- /package/dist/{static-file.d.ts → cjs/static-file.d.ts} +0 -0
- /package/dist/{static-file.js → cjs/static-file.js} +0 -0
- /package/dist/{timeline-position-state.d.ts → cjs/timeline-position-state.d.ts} +0 -0
- /package/dist/{timeline-position-state.js → cjs/timeline-position-state.js} +0 -0
- /package/dist/{truthy.d.ts → cjs/truthy.d.ts} +0 -0
- /package/dist/{truthy.js → cjs/truthy.js} +0 -0
- /package/dist/{use-current-frame.d.ts → cjs/use-current-frame.d.ts} +0 -0
- /package/dist/{use-lazy-component.js → cjs/use-lazy-component.js} +0 -0
- /package/dist/{use-media-playback.d.ts → cjs/use-media-playback.d.ts} +0 -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-video.d.ts → cjs/use-video.d.ts} +0 -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/{validation → cjs/validation}/validate-dimensions.d.ts +0 -0
- /package/dist/{validation → cjs/validation}/validate-dimensions.js +0 -0
- /package/dist/{validation → cjs/validation}/validate-duration-in-frames.d.ts +0 -0
- /package/dist/{validation → cjs/validation}/validate-duration-in-frames.js +0 -0
- /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}/validate-offthreadvideo-image-format.d.ts +0 -0
- /package/dist/{validation → cjs/validation}/validate-offthreadvideo-image-format.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/{video → cjs/video}/duration-state.d.ts +0 -0
- /package/dist/{video → cjs/video}/duration-state.js +0 -0
- /package/dist/{video → cjs/video}/get-current-time.d.ts +0 -0
- /package/dist/{video → cjs/video}/props.js +0 -0
- /package/dist/{video → cjs/video}/video-fragment.d.ts +0 -0
- /package/dist/{video → cjs/video}/video-fragment.js +0 -0
- /package/dist/{video-config.d.ts → cjs/video-config.d.ts} +0 -0
- /package/dist/{video-config.js → cjs/video-config.js} +0 -0
- /package/dist/{volume-position-state.d.ts → cjs/volume-position-state.d.ts} +0 -0
- /package/dist/{volume-position-state.js → cjs/volume-position-state.js} +0 -0
- /package/dist/{volume-prop.d.ts → cjs/volume-prop.d.ts} +0 -0
- /package/dist/{volume-prop.js → cjs/volume-prop.js} +0 -0
- /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} +0 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export const playAndHandleNotAllowedError = (mediaRef, mediaType) => {
|
|
2
|
+
const { current } = mediaRef;
|
|
3
|
+
if (!current) {
|
|
4
|
+
return;
|
|
5
|
+
}
|
|
6
|
+
const prom = current.play();
|
|
7
|
+
if (prom.catch) {
|
|
8
|
+
prom.catch((err) => {
|
|
9
|
+
if (!current) {
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
// Pause was called after play in Chrome
|
|
13
|
+
if (err.message.includes('request was interrupted by a call to pause')) {
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
// Pause was called after play in Safari
|
|
17
|
+
if (err.message.includes('The operation was aborted.')) {
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
// Pause was called after play in Firefox
|
|
21
|
+
if (err.message.includes('The fetching process for the media resource was aborted by the user agent')) {
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
// Got replaced by a different audio source in Chromium
|
|
25
|
+
if (err.message.includes('request was interrupted by a new load request')) {
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
// Audio tag got unmounted
|
|
29
|
+
if (err.message.includes('because the media was removed from the document')) {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
console.log(`Could not play ${mediaType} due to following error: `, err);
|
|
33
|
+
if (!current.muted) {
|
|
34
|
+
console.log(`The video will be muted and we'll retry playing it.`, err);
|
|
35
|
+
current.muted = true;
|
|
36
|
+
current.play();
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const portalNode: () => HTMLElement;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
let _portalNode = null;
|
|
2
|
+
export const portalNode = () => {
|
|
3
|
+
if (!_portalNode) {
|
|
4
|
+
if (typeof document === 'undefined') {
|
|
5
|
+
throw new Error('Tried to call an API that only works in the browser from outside the browser');
|
|
6
|
+
}
|
|
7
|
+
_portalNode = document.createElement('div');
|
|
8
|
+
_portalNode.style.position = 'absolute';
|
|
9
|
+
_portalNode.style.top = '0px';
|
|
10
|
+
_portalNode.style.left = '0px';
|
|
11
|
+
_portalNode.style.right = '0px';
|
|
12
|
+
_portalNode.style.bottom = '0px';
|
|
13
|
+
_portalNode.style.width = '100%';
|
|
14
|
+
_portalNode.style.height = '100%';
|
|
15
|
+
_portalNode.style.display = 'flex';
|
|
16
|
+
_portalNode.style.flexDirection = 'column';
|
|
17
|
+
}
|
|
18
|
+
return _portalNode;
|
|
19
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
declare type Value = Record<string, string>;
|
|
3
|
+
export declare const PreloadContext: React.Context<Value>;
|
|
4
|
+
export declare const setPreloads: (updater: (p: Value) => Value) => void;
|
|
5
|
+
export declare const PrefetchProvider: React.FC<{
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
}>;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { createContext, useEffect, useState } from 'react';
|
|
3
|
+
export const PreloadContext = createContext({});
|
|
4
|
+
let preloads = {};
|
|
5
|
+
let updaters = [];
|
|
6
|
+
export const setPreloads = (updater) => {
|
|
7
|
+
preloads = updater(preloads);
|
|
8
|
+
updaters.forEach((u) => u());
|
|
9
|
+
};
|
|
10
|
+
export const PrefetchProvider = ({ children }) => {
|
|
11
|
+
const [_preloads, _setPreloads] = useState(() => preloads);
|
|
12
|
+
useEffect(() => {
|
|
13
|
+
const updaterFunction = () => {
|
|
14
|
+
_setPreloads(preloads);
|
|
15
|
+
};
|
|
16
|
+
updaters.push(updaterFunction);
|
|
17
|
+
return () => {
|
|
18
|
+
updaters = updaters.filter((u) => u !== updaterFunction);
|
|
19
|
+
};
|
|
20
|
+
}, []);
|
|
21
|
+
return (_jsx(PreloadContext.Provider, { value: _preloads, children: children }));
|
|
22
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const usePreload: (src: string) => string;
|
|
2
|
+
declare type FetchAndPreload = {
|
|
3
|
+
free: () => void;
|
|
4
|
+
waitUntilDone: () => Promise<string>;
|
|
5
|
+
};
|
|
6
|
+
export declare const prefetch: (src: string, options?: {
|
|
7
|
+
method?: 'blob-url' | 'base64';
|
|
8
|
+
}) => FetchAndPreload;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { useContext } from 'react';
|
|
2
|
+
import { getRemotionEnvironment } from './get-environment.js';
|
|
3
|
+
import { PreloadContext, setPreloads } from './prefetch-state.js';
|
|
4
|
+
export const usePreload = (src) => {
|
|
5
|
+
var _a;
|
|
6
|
+
const preloads = useContext(PreloadContext);
|
|
7
|
+
return (_a = preloads[src]) !== null && _a !== void 0 ? _a : src;
|
|
8
|
+
};
|
|
9
|
+
const blobToBase64 = function (blob) {
|
|
10
|
+
const reader = new FileReader();
|
|
11
|
+
return new Promise((resolve, reject) => {
|
|
12
|
+
reader.onload = function () {
|
|
13
|
+
const dataUrl = reader.result;
|
|
14
|
+
resolve(dataUrl);
|
|
15
|
+
};
|
|
16
|
+
reader.onerror = (err) => {
|
|
17
|
+
return reject(err);
|
|
18
|
+
};
|
|
19
|
+
reader.readAsDataURL(blob);
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
export const prefetch = (src, options) => {
|
|
23
|
+
var _a;
|
|
24
|
+
const method = (_a = options === null || options === void 0 ? void 0 : options.method) !== null && _a !== void 0 ? _a : 'blob-url';
|
|
25
|
+
if (getRemotionEnvironment() === 'rendering') {
|
|
26
|
+
return {
|
|
27
|
+
free: () => undefined,
|
|
28
|
+
waitUntilDone: () => Promise.resolve(src),
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
let canceled = false;
|
|
32
|
+
let objectUrl = null;
|
|
33
|
+
let resolve = () => undefined;
|
|
34
|
+
let reject = () => undefined;
|
|
35
|
+
const waitUntilDone = new Promise((res, rej) => {
|
|
36
|
+
resolve = res;
|
|
37
|
+
reject = rej;
|
|
38
|
+
});
|
|
39
|
+
const controller = new AbortController();
|
|
40
|
+
let canBeAborted = true;
|
|
41
|
+
fetch(src, {
|
|
42
|
+
signal: controller.signal,
|
|
43
|
+
})
|
|
44
|
+
.then((res) => {
|
|
45
|
+
canBeAborted = false;
|
|
46
|
+
if (canceled) {
|
|
47
|
+
return null;
|
|
48
|
+
}
|
|
49
|
+
if (!res.ok) {
|
|
50
|
+
throw new Error(`HTTP error, status = ${res.status}`);
|
|
51
|
+
}
|
|
52
|
+
return res.blob();
|
|
53
|
+
})
|
|
54
|
+
.then((buf) => {
|
|
55
|
+
if (!buf) {
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
if (method === 'base64') {
|
|
59
|
+
return blobToBase64(buf);
|
|
60
|
+
}
|
|
61
|
+
return URL.createObjectURL(buf);
|
|
62
|
+
})
|
|
63
|
+
.then((url) => {
|
|
64
|
+
if (canceled) {
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
objectUrl = url;
|
|
68
|
+
setPreloads((p) => ({
|
|
69
|
+
...p,
|
|
70
|
+
[src]: objectUrl,
|
|
71
|
+
}));
|
|
72
|
+
resolve(objectUrl);
|
|
73
|
+
})
|
|
74
|
+
.catch((err) => {
|
|
75
|
+
reject(err);
|
|
76
|
+
});
|
|
77
|
+
return {
|
|
78
|
+
free: () => {
|
|
79
|
+
if (objectUrl) {
|
|
80
|
+
if (method === 'blob-url') {
|
|
81
|
+
URL.revokeObjectURL(objectUrl);
|
|
82
|
+
}
|
|
83
|
+
setPreloads((p) => {
|
|
84
|
+
const copy = { ...p };
|
|
85
|
+
delete copy[src];
|
|
86
|
+
return copy;
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
else {
|
|
90
|
+
canceled = true;
|
|
91
|
+
if (canBeAborted) {
|
|
92
|
+
try {
|
|
93
|
+
controller.abort();
|
|
94
|
+
}
|
|
95
|
+
catch (e) { }
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
waitUntilDone: () => {
|
|
100
|
+
return waitUntilDone;
|
|
101
|
+
},
|
|
102
|
+
};
|
|
103
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare type RandomSeed = number | string | null;
|
|
2
|
+
/**
|
|
3
|
+
* A deterministic pseudo-random number generator.
|
|
4
|
+
* Pass in the same seed and get the same pseudorandom number.
|
|
5
|
+
* See: https://remotion.dev/docs/random
|
|
6
|
+
*/
|
|
7
|
+
export declare const random: (seed: RandomSeed, dummy?: unknown) => number;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/* eslint-disable no-bitwise */
|
|
2
|
+
function mulberry32(a) {
|
|
3
|
+
let t = a + 0x6d2b79f5;
|
|
4
|
+
t = Math.imul(t ^ (t >>> 15), t | 1);
|
|
5
|
+
t ^= t + Math.imul(t ^ (t >>> 7), t | 61);
|
|
6
|
+
return ((t ^ (t >>> 14)) >>> 0) / 4294967296;
|
|
7
|
+
}
|
|
8
|
+
function hashCode(str) {
|
|
9
|
+
let i = 0;
|
|
10
|
+
let chr = 0;
|
|
11
|
+
let hash = 0;
|
|
12
|
+
for (i = 0; i < str.length; i++) {
|
|
13
|
+
chr = str.charCodeAt(i);
|
|
14
|
+
hash = (hash << 5) - hash + chr;
|
|
15
|
+
hash |= 0; // Convert to 32bit integer
|
|
16
|
+
}
|
|
17
|
+
return hash;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* A deterministic pseudo-random number generator.
|
|
21
|
+
* Pass in the same seed and get the same pseudorandom number.
|
|
22
|
+
* See: https://remotion.dev/docs/random
|
|
23
|
+
*/
|
|
24
|
+
export const random = (seed, dummy) => {
|
|
25
|
+
if (dummy !== undefined) {
|
|
26
|
+
throw new TypeError('random() takes only one argument');
|
|
27
|
+
}
|
|
28
|
+
if (seed === null) {
|
|
29
|
+
return Math.random();
|
|
30
|
+
}
|
|
31
|
+
if (typeof seed === 'string') {
|
|
32
|
+
return mulberry32(hashCode(seed));
|
|
33
|
+
}
|
|
34
|
+
if (typeof seed === 'number') {
|
|
35
|
+
return mulberry32(seed * 10000000000);
|
|
36
|
+
}
|
|
37
|
+
throw new Error('random() argument must be a number or a string');
|
|
38
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
let Root = null;
|
|
2
|
+
let listeners = [];
|
|
3
|
+
export const registerRoot = (comp) => {
|
|
4
|
+
if (!comp) {
|
|
5
|
+
throw new Error(`You must pass a React component to registerRoot(), but ${JSON.stringify(comp)} was passed.`);
|
|
6
|
+
}
|
|
7
|
+
if (Root) {
|
|
8
|
+
throw new Error('registerRoot() was called more than once.');
|
|
9
|
+
}
|
|
10
|
+
Root = comp;
|
|
11
|
+
listeners.forEach((l) => {
|
|
12
|
+
l(comp);
|
|
13
|
+
});
|
|
14
|
+
};
|
|
15
|
+
export const getRoot = () => {
|
|
16
|
+
return Root;
|
|
17
|
+
};
|
|
18
|
+
export const waitForRoot = (fn) => {
|
|
19
|
+
if (Root) {
|
|
20
|
+
fn(Root);
|
|
21
|
+
return () => undefined;
|
|
22
|
+
}
|
|
23
|
+
listeners.push(fn);
|
|
24
|
+
return () => {
|
|
25
|
+
listeners = listeners.filter((l) => l !== fn);
|
|
26
|
+
};
|
|
27
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export const flattenChildren = (children) => {
|
|
3
|
+
const childrenArray = React.Children.toArray(children);
|
|
4
|
+
return childrenArray.reduce((flatChildren, child) => {
|
|
5
|
+
if (child.type === React.Fragment) {
|
|
6
|
+
return flatChildren.concat(flattenChildren(child.props
|
|
7
|
+
.children));
|
|
8
|
+
}
|
|
9
|
+
flatChildren.push(child);
|
|
10
|
+
return flatChildren;
|
|
11
|
+
}, []);
|
|
12
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { FC, PropsWithChildren } from 'react';
|
|
2
|
+
import type { LayoutAndStyle, SequenceProps } from '../Sequence.js';
|
|
3
|
+
declare type SeriesSequenceProps = PropsWithChildren<{
|
|
4
|
+
durationInFrames: number;
|
|
5
|
+
offset?: number;
|
|
6
|
+
} & Pick<SequenceProps, 'layout' | 'name'> & LayoutAndStyle>;
|
|
7
|
+
declare const SeriesSequence: import("react").ForwardRefExoticComponent<SeriesSequenceProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
8
|
+
declare const Series: FC<{
|
|
9
|
+
children: React.ReactNode;
|
|
10
|
+
}> & {
|
|
11
|
+
Sequence: typeof SeriesSequence;
|
|
12
|
+
};
|
|
13
|
+
export { Series };
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Children, forwardRef, useMemo } from 'react';
|
|
3
|
+
import { Sequence } from '../Sequence.js';
|
|
4
|
+
import { validateDurationInFrames } from '../validation/validate-duration-in-frames.js';
|
|
5
|
+
import { flattenChildren } from './flatten-children.js';
|
|
6
|
+
const SeriesSequenceRefForwardingFunction = ({ children }, _ref) => {
|
|
7
|
+
// Discard ref
|
|
8
|
+
// eslint-disable-next-line react/jsx-no-useless-fragment
|
|
9
|
+
return _jsx(_Fragment, { children: children });
|
|
10
|
+
};
|
|
11
|
+
const SeriesSequence = forwardRef(SeriesSequenceRefForwardingFunction);
|
|
12
|
+
const Series = ({ children }) => {
|
|
13
|
+
const childrenValue = useMemo(() => {
|
|
14
|
+
let startFrame = 0;
|
|
15
|
+
return Children.map(flattenChildren(children), (child, i) => {
|
|
16
|
+
var _a;
|
|
17
|
+
const castedChild = child;
|
|
18
|
+
if (typeof castedChild === 'string') {
|
|
19
|
+
// Don't throw if it's just some accidential whitespace
|
|
20
|
+
if (castedChild.trim() === '') {
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
throw new TypeError(`The <Series /> component only accepts a list of <Series.Sequence /> components as it's children, but you passed a string "${castedChild}"`);
|
|
24
|
+
}
|
|
25
|
+
if (castedChild.type !== SeriesSequence) {
|
|
26
|
+
throw new TypeError(`The <Series /> component only accepts a list of <Series.Sequence /> components as it's children, but got ${castedChild} instead`);
|
|
27
|
+
}
|
|
28
|
+
const debugInfo = `index = ${i}, duration = ${castedChild.props.durationInFrames}`;
|
|
29
|
+
if (!castedChild || !castedChild.props.children) {
|
|
30
|
+
throw new TypeError(`A <Series.Sequence /> component (${debugInfo}) was detected to not have any children. Delete it to fix this error.`);
|
|
31
|
+
}
|
|
32
|
+
const durationInFramesProp = castedChild.props.durationInFrames;
|
|
33
|
+
const { durationInFrames, children: _children, ...passedProps } = castedChild.props;
|
|
34
|
+
validateDurationInFrames(durationInFramesProp, `of a <Series.Sequence /> component`);
|
|
35
|
+
const offset = (_a = castedChild.props.offset) !== null && _a !== void 0 ? _a : 0;
|
|
36
|
+
if (Number.isNaN(offset)) {
|
|
37
|
+
throw new TypeError(`The "offset" property of a <Series.Sequence /> must not be NaN, but got NaN (${debugInfo}).`);
|
|
38
|
+
}
|
|
39
|
+
if (!Number.isFinite(offset)) {
|
|
40
|
+
throw new TypeError(`The "offset" property of a <Series.Sequence /> must be finite, but got ${offset} (${debugInfo}).`);
|
|
41
|
+
}
|
|
42
|
+
if (offset % 1 !== 0) {
|
|
43
|
+
throw new TypeError(`The "offset" property of a <Series.Sequence /> must be finite, but got ${offset} (${debugInfo}).`);
|
|
44
|
+
}
|
|
45
|
+
const currentStartFrame = startFrame + offset;
|
|
46
|
+
startFrame += durationInFramesProp + offset;
|
|
47
|
+
return (_jsx(Sequence, { from: currentStartFrame, durationInFrames: durationInFramesProp, ...passedProps, ref: castedChild.ref, children: child }));
|
|
48
|
+
});
|
|
49
|
+
}, [children]);
|
|
50
|
+
/* eslint-disable react/jsx-no-useless-fragment */
|
|
51
|
+
return _jsx(_Fragment, { children: childrenValue });
|
|
52
|
+
};
|
|
53
|
+
Series.Sequence = SeriesSequence;
|
|
54
|
+
export { Series };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { getRemotionEnvironment } from './get-environment.js';
|
|
2
|
+
export const ENV_VARIABLES_ENV_NAME = 'ENV_VARIABLES';
|
|
3
|
+
const getEnvVariables = () => {
|
|
4
|
+
if (getRemotionEnvironment() === 'rendering') {
|
|
5
|
+
const param = window.remotion_envVariables;
|
|
6
|
+
if (!param) {
|
|
7
|
+
return {};
|
|
8
|
+
}
|
|
9
|
+
return { ...JSON.parse(param), NODE_ENV: process.env.NODE_ENV };
|
|
10
|
+
}
|
|
11
|
+
if (getRemotionEnvironment() === 'preview') {
|
|
12
|
+
// Webpack will convert this to an object at compile time.
|
|
13
|
+
// Don't convert this syntax to a computed property.
|
|
14
|
+
return {
|
|
15
|
+
...process.env.ENV_VARIABLES,
|
|
16
|
+
NODE_ENV: process.env.NODE_ENV,
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
throw new Error('Can only call getEnvVariables() if environment is `rendering` or `preview`');
|
|
20
|
+
};
|
|
21
|
+
export const setupEnvVariables = () => {
|
|
22
|
+
const env = getEnvVariables();
|
|
23
|
+
if (!window.process) {
|
|
24
|
+
window.process = {};
|
|
25
|
+
}
|
|
26
|
+
if (!window.process.env) {
|
|
27
|
+
window.process.env = {};
|
|
28
|
+
}
|
|
29
|
+
Object.keys(env).forEach((key) => {
|
|
30
|
+
window.process.env[key] = env[key];
|
|
31
|
+
});
|
|
32
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { SpringConfig } from './spring-utils.js';
|
|
2
|
+
/**
|
|
3
|
+
* Calculates a position based on physical parameters, start and end value, and time.
|
|
4
|
+
* @link https://www.remotion.dev/docs/spring
|
|
5
|
+
* @param {number} frame The current time value. Most of the time you want to pass in the return value of useCurrentFrame.
|
|
6
|
+
* @param {number} fps The framerate at which the animation runs. Pass in the value obtained by `useVideoConfig()`.
|
|
7
|
+
* @param {?Object} config optional object that allows you to customize the physical properties of the animation.
|
|
8
|
+
* @param {number} [config.mass=1] The weight of the spring. If you reduce the mass, the animation becomes faster!
|
|
9
|
+
* @param {number} [config.damping=10] How hard the animation decelerates.
|
|
10
|
+
* @param {number} [config.stiffness=100] Affects bounciness of the animation.
|
|
11
|
+
* @param {boolean} [config.overshootClamping=false] Whether to prevent the animation going beyond the target value.
|
|
12
|
+
* @param {?number} [config.from] The initial value of the animation. Default `0`
|
|
13
|
+
* @param {?number} [config.to] The end value of the animation. Default `1`
|
|
14
|
+
* @param {?number} [config.durationInFrames] Stretch the duration of an animation to a set value.. Default `undefined`
|
|
15
|
+
* @param {?number} [config.durationThreshold] How close to the end the animation is considered to be done. Default `0.005`
|
|
16
|
+
*/
|
|
17
|
+
export declare function spring({ frame, fps, config, from, to, durationInFrames, durationRestThreshold, }: {
|
|
18
|
+
frame: number;
|
|
19
|
+
fps: number;
|
|
20
|
+
config?: Partial<SpringConfig>;
|
|
21
|
+
from?: number;
|
|
22
|
+
to?: number;
|
|
23
|
+
durationInFrames?: number;
|
|
24
|
+
durationRestThreshold?: number;
|
|
25
|
+
}): number;
|
|
26
|
+
export { measureSpring } from './measure-spring.js';
|
|
27
|
+
export { SpringConfig } from './spring-utils.js';
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { validateFrame } from '../validate-frame.js';
|
|
2
|
+
import { validateFps } from '../validation/validate-fps.js';
|
|
3
|
+
import { validateSpringDuration } from '../validation/validation-spring-duration.js';
|
|
4
|
+
import { measureSpring } from './measure-spring.js';
|
|
5
|
+
import { springCalculation } from './spring-utils.js';
|
|
6
|
+
/**
|
|
7
|
+
* Calculates a position based on physical parameters, start and end value, and time.
|
|
8
|
+
* @link https://www.remotion.dev/docs/spring
|
|
9
|
+
* @param {number} frame The current time value. Most of the time you want to pass in the return value of useCurrentFrame.
|
|
10
|
+
* @param {number} fps The framerate at which the animation runs. Pass in the value obtained by `useVideoConfig()`.
|
|
11
|
+
* @param {?Object} config optional object that allows you to customize the physical properties of the animation.
|
|
12
|
+
* @param {number} [config.mass=1] The weight of the spring. If you reduce the mass, the animation becomes faster!
|
|
13
|
+
* @param {number} [config.damping=10] How hard the animation decelerates.
|
|
14
|
+
* @param {number} [config.stiffness=100] Affects bounciness of the animation.
|
|
15
|
+
* @param {boolean} [config.overshootClamping=false] Whether to prevent the animation going beyond the target value.
|
|
16
|
+
* @param {?number} [config.from] The initial value of the animation. Default `0`
|
|
17
|
+
* @param {?number} [config.to] The end value of the animation. Default `1`
|
|
18
|
+
* @param {?number} [config.durationInFrames] Stretch the duration of an animation to a set value.. Default `undefined`
|
|
19
|
+
* @param {?number} [config.durationThreshold] How close to the end the animation is considered to be done. Default `0.005`
|
|
20
|
+
*/
|
|
21
|
+
export function spring({ frame, fps, config = {}, from = 0, to = 1, durationInFrames, durationRestThreshold, }) {
|
|
22
|
+
validateSpringDuration(durationInFrames);
|
|
23
|
+
validateFrame(frame, Infinity);
|
|
24
|
+
validateFps(fps, 'to spring()', false);
|
|
25
|
+
const durationRatio = durationInFrames === undefined
|
|
26
|
+
? 1
|
|
27
|
+
: durationInFrames /
|
|
28
|
+
measureSpring({
|
|
29
|
+
fps,
|
|
30
|
+
config,
|
|
31
|
+
from,
|
|
32
|
+
to,
|
|
33
|
+
threshold: durationRestThreshold,
|
|
34
|
+
});
|
|
35
|
+
const spr = springCalculation({
|
|
36
|
+
fps,
|
|
37
|
+
frame: frame / durationRatio,
|
|
38
|
+
config,
|
|
39
|
+
from,
|
|
40
|
+
to,
|
|
41
|
+
});
|
|
42
|
+
if (!config.overshootClamping) {
|
|
43
|
+
return spr.current;
|
|
44
|
+
}
|
|
45
|
+
if (to >= from) {
|
|
46
|
+
return Math.min(spr.current, to);
|
|
47
|
+
}
|
|
48
|
+
return Math.max(spr.current, to);
|
|
49
|
+
}
|
|
50
|
+
export { measureSpring } from './measure-spring.js';
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { validateFps } from '../validation/validate-fps.js';
|
|
2
|
+
import { springCalculation } from './spring-utils.js';
|
|
3
|
+
export function measureSpring({ fps, config = {}, threshold = 0.005, from = 0, to = 1, }) {
|
|
4
|
+
if (typeof threshold !== 'number') {
|
|
5
|
+
throw new TypeError(`threshold must be a number, got ${threshold} of type ${typeof threshold}`);
|
|
6
|
+
}
|
|
7
|
+
if (threshold === 0) {
|
|
8
|
+
return Infinity;
|
|
9
|
+
}
|
|
10
|
+
if (threshold === 1) {
|
|
11
|
+
return 0;
|
|
12
|
+
}
|
|
13
|
+
if (isNaN(threshold)) {
|
|
14
|
+
throw new TypeError('Threshold is NaN');
|
|
15
|
+
}
|
|
16
|
+
if (!Number.isFinite(threshold)) {
|
|
17
|
+
throw new TypeError('Threshold is not finite');
|
|
18
|
+
}
|
|
19
|
+
if (threshold < 0) {
|
|
20
|
+
throw new TypeError('Threshold is below 0');
|
|
21
|
+
}
|
|
22
|
+
validateFps(fps, 'to the measureSpring() function', false);
|
|
23
|
+
const range = Math.abs(from - to);
|
|
24
|
+
let frame = 0;
|
|
25
|
+
let finishedFrame = 0;
|
|
26
|
+
const calc = () => {
|
|
27
|
+
return springCalculation({
|
|
28
|
+
fps,
|
|
29
|
+
frame,
|
|
30
|
+
config,
|
|
31
|
+
from,
|
|
32
|
+
to,
|
|
33
|
+
});
|
|
34
|
+
};
|
|
35
|
+
let animation = calc();
|
|
36
|
+
const calcDifference = () => {
|
|
37
|
+
return (Math.abs(animation.current - animation.toValue) /
|
|
38
|
+
(range === 0 ? 1 : range));
|
|
39
|
+
};
|
|
40
|
+
let difference = calcDifference();
|
|
41
|
+
while (difference >= threshold) {
|
|
42
|
+
frame++;
|
|
43
|
+
animation = calc();
|
|
44
|
+
difference = calcDifference();
|
|
45
|
+
}
|
|
46
|
+
// Since spring is bouncy, just because it's under the threshold we
|
|
47
|
+
// cannot be sure it's done. We need to animate further until it stays in the
|
|
48
|
+
// threshold for, say, 20 frames.
|
|
49
|
+
finishedFrame = frame;
|
|
50
|
+
for (let i = 0; i < 20; i++) {
|
|
51
|
+
frame++;
|
|
52
|
+
animation = calc();
|
|
53
|
+
difference = calcDifference();
|
|
54
|
+
if (difference >= threshold) {
|
|
55
|
+
i = 0;
|
|
56
|
+
finishedFrame = frame + 1;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
return finishedFrame;
|
|
60
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
declare type AnimationNode = {
|
|
2
|
+
lastTimestamp: number;
|
|
3
|
+
toValue: number;
|
|
4
|
+
current: number;
|
|
5
|
+
velocity: number;
|
|
6
|
+
prevPosition?: number;
|
|
7
|
+
};
|
|
8
|
+
export declare type SpringConfig = {
|
|
9
|
+
damping: number;
|
|
10
|
+
mass: number;
|
|
11
|
+
stiffness: number;
|
|
12
|
+
overshootClamping: boolean;
|
|
13
|
+
};
|
|
14
|
+
export declare function springCalculation({ from, to, frame, fps, config, }: {
|
|
15
|
+
from?: number;
|
|
16
|
+
to?: number;
|
|
17
|
+
frame: number;
|
|
18
|
+
fps: number;
|
|
19
|
+
config?: Partial<SpringConfig>;
|
|
20
|
+
}): AnimationNode;
|
|
21
|
+
export {};
|