remotion 4.0.0-offthread.9 → 4.0.0-prefetch.10
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/.turbo/turbo-build.log +5 -5
- package/README.md +30 -19
- package/dist/AbsoluteFill.d.ts +6 -2
- package/dist/AbsoluteFill.js +7 -3
- package/dist/CanUseRemotionHooks.d.ts +5 -0
- package/dist/CanUseRemotionHooks.js +10 -0
- package/dist/Composition.d.ts +3 -6
- package/dist/Composition.js +40 -28
- package/dist/CompositionManager.d.ts +6 -11
- package/dist/CompositionManager.js +9 -3
- package/dist/Folder.d.ts +15 -0
- package/dist/Folder.js +33 -0
- package/dist/Img.js +9 -4
- package/dist/RemotionRoot.js +5 -4
- package/dist/{sequencing/index.d.ts → Sequence.d.ts} +13 -3
- package/dist/{sequencing/index.js → Sequence.js} +40 -34
- package/dist/Still.d.ts +1 -1
- package/dist/asset-types.d.ts +1 -4
- package/dist/audio/Audio.d.ts +3 -3
- package/dist/audio/Audio.js +3 -3
- package/dist/audio/AudioForDevelopment.d.ts +3 -2
- package/dist/audio/AudioForDevelopment.js +18 -5
- package/dist/audio/AudioForRendering.d.ts +5 -2
- package/dist/audio/AudioForRendering.js +14 -7
- package/dist/audio/props.d.ts +1 -1
- package/dist/audio/shared-audio-tags.d.ts +4 -3
- package/dist/audio/shared-audio-tags.js +109 -40
- package/dist/audio/use-audio-frame.js +4 -4
- package/dist/config/bundle-out-dir.d.ts +2 -0
- package/dist/config/bundle-out-dir.js +12 -0
- package/dist/config/input-props.js +12 -14
- package/dist/config/public-path.d.ts +2 -0
- package/dist/config/public-path.js +12 -0
- package/dist/{config/index.d.ts → config.d.ts} +68 -20
- package/dist/config.js +21 -0
- package/dist/default-css.d.ts +1 -0
- package/dist/default-css.js +9 -2
- package/dist/delay-render.js +4 -4
- package/dist/freeze.d.ts +2 -2
- package/dist/freeze.js +2 -2
- package/dist/get-timeline-clip-name.js +2 -1
- package/dist/index.d.ts +22 -8
- package/dist/index.js +13 -8
- package/dist/internals.d.ts +36 -100
- package/dist/internals.js +13 -92
- package/dist/{interpolateColors.d.ts → interpolate-colors.d.ts} +0 -0
- package/dist/{interpolateColors.js → interpolate-colors.js} +0 -0
- package/dist/loading-indicator.d.ts +2 -0
- package/dist/loading-indicator.js +35 -0
- package/dist/loop/index.js +4 -3
- package/dist/multiple-versions-warning.js +18 -4
- package/dist/play-and-handle-not-allowed-error.d.ts +1 -1
- package/dist/portal-node.d.ts +1 -0
- package/dist/portal-node.js +23 -0
- package/dist/preload-state.d.ts +13 -0
- package/dist/preload-state.js +26 -0
- package/dist/preload.d.ts +7 -0
- package/dist/preload.js +83 -0
- package/dist/register-root.d.ts +2 -1
- package/dist/register-root.js +20 -5
- package/dist/series/index.d.ts +2 -2
- package/dist/series/index.js +2 -2
- package/dist/spring/index.d.ts +8 -4
- package/dist/spring/index.js +21 -6
- package/dist/spring/measure-spring.d.ts +1 -1
- package/dist/spring/measure-spring.js +1 -1
- package/dist/static-file.js +6 -0
- package/dist/timeline-position-state.d.ts +1 -1
- package/dist/{use-frame.d.ts → use-current-frame.d.ts} +0 -1
- package/dist/use-current-frame.js +28 -0
- package/dist/use-lazy-component.d.ts +3 -3
- package/dist/use-media-in-timeline.d.ts +2 -2
- package/dist/use-media-in-timeline.js +10 -7
- package/dist/use-media-playback.d.ts +3 -2
- package/dist/use-media-playback.js +9 -6
- package/dist/use-media-tag-volume.d.ts +1 -1
- package/dist/use-sync-volume-with-media-tag.d.ts +2 -2
- package/dist/use-unsafe-video-config.d.ts +1 -1
- package/dist/use-unsafe-video-config.js +2 -2
- package/dist/use-video-config.d.ts +1 -1
- package/dist/use-video-config.js +6 -0
- package/dist/use-video.d.ts +13 -1
- package/dist/use-video.js +16 -3
- package/dist/validate-media-props.d.ts +3 -3
- package/dist/validation/validate-fps.d.ts +1 -1
- package/dist/validation/validate-fps.js +4 -1
- package/dist/validation/validate-offthreadvideo-image-format.d.ts +1 -0
- package/dist/validation/validate-offthreadvideo-image-format.js +15 -0
- package/dist/validation/validation-spring-duration.d.ts +1 -0
- package/dist/validation/validation-spring-duration.js +21 -0
- package/dist/version.d.ts +1 -0
- package/dist/version.js +5 -0
- package/dist/video/OffthreadVideo.d.ts +1 -1
- package/dist/video/OffthreadVideo.js +5 -3
- package/dist/video/OffthreadVideoForRendering.d.ts +1 -1
- package/dist/video/OffthreadVideoForRendering.js +25 -11
- package/dist/video/Video.d.ts +3 -3
- package/dist/video/Video.js +3 -3
- package/dist/video/VideoForDevelopment.d.ts +7 -2
- package/dist/video/VideoForDevelopment.js +28 -4
- package/dist/video/VideoForRendering.d.ts +5 -2
- package/dist/video/VideoForRendering.js +47 -25
- package/dist/video/get-current-time.d.ts +2 -1
- package/dist/video/get-current-time.js +7 -7
- package/dist/video/index.d.ts +1 -1
- package/dist/video/props.d.ts +4 -2
- package/dist/volume-prop.js +1 -1
- package/dist/warn-about-non-seekable-media.d.ts +1 -1
- package/dist/warn-about-non-seekable-media.js +14 -2
- package/dist/wrap-remotion-context.d.ts +2 -1
- package/dist/wrap-remotion-context.js +7 -3
- package/ensure-correct-version.js +24 -0
- package/package.json +9 -10
- package/version.d.ts +1 -0
- package/version.js +1 -0
- package/.turbo/turbo-lint.log +0 -11
- package/.turbo/turbo-test.log +0 -78
- package/dist/AbsoluteFill.d.ts.map +0 -1
- package/dist/AbsoluteFill.js.map +0 -1
- package/dist/Composition.d.ts.map +0 -1
- package/dist/Composition.js.map +0 -1
- package/dist/CompositionManager.d.ts.map +0 -1
- package/dist/CompositionManager.js.map +0 -1
- package/dist/IFrame.d.ts.map +0 -1
- package/dist/IFrame.js.map +0 -1
- package/dist/Img.d.ts.map +0 -1
- package/dist/Img.js.map +0 -1
- package/dist/RemotionRoot.d.ts.map +0 -1
- package/dist/RemotionRoot.js.map +0 -1
- package/dist/Still.d.ts.map +0 -1
- package/dist/Still.js.map +0 -1
- package/dist/absolute-src.d.ts.map +0 -1
- package/dist/absolute-src.js.map +0 -1
- package/dist/asset-types.d.ts.map +0 -1
- package/dist/asset-types.js.map +0 -1
- package/dist/audio/Audio.d.ts.map +0 -1
- package/dist/audio/Audio.js.map +0 -1
- package/dist/audio/AudioForDevelopment.d.ts.map +0 -1
- package/dist/audio/AudioForDevelopment.js.map +0 -1
- package/dist/audio/AudioForRendering.d.ts.map +0 -1
- package/dist/audio/AudioForRendering.js.map +0 -1
- package/dist/audio/index.d.ts.map +0 -1
- package/dist/audio/index.js.map +0 -1
- package/dist/audio/props.d.ts.map +0 -1
- package/dist/audio/props.js.map +0 -1
- package/dist/audio/shared-audio-tags.d.ts.map +0 -1
- package/dist/audio/shared-audio-tags.js.map +0 -1
- package/dist/audio/use-audio-frame.d.ts.map +0 -1
- package/dist/audio/use-audio-frame.js.map +0 -1
- package/dist/bezier.d.ts.map +0 -1
- package/dist/bezier.js.map +0 -1
- package/dist/compress-assets.d.ts +0 -7
- package/dist/compress-assets.d.ts.map +0 -1
- package/dist/compress-assets.js +0 -25
- package/dist/compress-assets.js.map +0 -1
- package/dist/config/browser-executable.d.ts +0 -3
- package/dist/config/browser-executable.d.ts.map +0 -1
- package/dist/config/browser-executable.js +0 -12
- package/dist/config/browser-executable.js.map +0 -1
- package/dist/config/browser.d.ts +0 -4
- package/dist/config/browser.d.ts.map +0 -1
- package/dist/config/browser.js +0 -19
- package/dist/config/browser.js.map +0 -1
- package/dist/config/chromium-flags.d.ts +0 -10
- package/dist/config/chromium-flags.d.ts.map +0 -1
- package/dist/config/chromium-flags.js +0 -34
- package/dist/config/chromium-flags.js.map +0 -1
- package/dist/config/codec.d.ts +0 -17
- package/dist/config/codec.d.ts.map +0 -1
- package/dist/config/codec.js +0 -103
- package/dist/config/codec.js.map +0 -1
- package/dist/config/concurrency.d.ts +0 -3
- package/dist/config/concurrency.d.ts.map +0 -1
- package/dist/config/concurrency.js +0 -15
- package/dist/config/concurrency.js.map +0 -1
- package/dist/config/crf.d.ts +0 -9
- package/dist/config/crf.d.ts.map +0 -1
- package/dist/config/crf.js +0 -83
- package/dist/config/crf.js.map +0 -1
- package/dist/config/env-file.d.ts +0 -2
- package/dist/config/env-file.d.ts.map +0 -1
- package/dist/config/env-file.js +0 -10
- package/dist/config/env-file.js.map +0 -1
- package/dist/config/ffmpeg-executable.d.ts +0 -3
- package/dist/config/ffmpeg-executable.d.ts.map +0 -1
- package/dist/config/ffmpeg-executable.js +0 -12
- package/dist/config/ffmpeg-executable.js.map +0 -1
- package/dist/config/frame-range.d.ts +0 -5
- package/dist/config/frame-range.d.ts.map +0 -1
- package/dist/config/frame-range.js +0 -80
- package/dist/config/frame-range.js.map +0 -1
- package/dist/config/image-format.d.ts +0 -8
- package/dist/config/image-format.d.ts.map +0 -1
- package/dist/config/image-format.js +0 -37
- package/dist/config/image-format.js.map +0 -1
- package/dist/config/image-sequence.d.ts +0 -3
- package/dist/config/image-sequence.d.ts.map +0 -1
- package/dist/config/image-sequence.js +0 -15
- package/dist/config/image-sequence.js.map +0 -1
- package/dist/config/index.d.ts.map +0 -1
- package/dist/config/index.js +0 -175
- package/dist/config/index.js.map +0 -1
- package/dist/config/input-props.d.ts.map +0 -1
- package/dist/config/input-props.js.map +0 -1
- package/dist/config/log.d.ts +0 -7
- package/dist/config/log.d.ts.map +0 -1
- package/dist/config/log.js +0 -25
- package/dist/config/log.js.map +0 -1
- package/dist/config/max-timeline-tracks.d.ts +0 -2
- package/dist/config/max-timeline-tracks.d.ts.map +0 -1
- package/dist/config/max-timeline-tracks.js +0 -24
- package/dist/config/max-timeline-tracks.js.map +0 -1
- package/dist/config/override-webpack.d.ts +0 -12
- package/dist/config/override-webpack.d.ts.map +0 -1
- package/dist/config/override-webpack.js +0 -14
- package/dist/config/override-webpack.js.map +0 -1
- package/dist/config/overwrite.d.ts +0 -3
- package/dist/config/overwrite.d.ts.map +0 -1
- package/dist/config/overwrite.js +0 -14
- package/dist/config/overwrite.js.map +0 -1
- package/dist/config/pixel-format.d.ts +0 -8
- package/dist/config/pixel-format.d.ts.map +0 -1
- package/dist/config/pixel-format.js +0 -38
- package/dist/config/pixel-format.js.map +0 -1
- package/dist/config/preview-server.d.ts +0 -2
- package/dist/config/preview-server.d.ts.map +0 -1
- package/dist/config/preview-server.js +0 -20
- package/dist/config/preview-server.js.map +0 -1
- package/dist/config/prores-profile.d.ts +0 -7
- package/dist/config/prores-profile.d.ts.map +0 -1
- package/dist/config/prores-profile.js +0 -32
- package/dist/config/prores-profile.js.map +0 -1
- package/dist/config/quality.d.ts +0 -2
- package/dist/config/quality.d.ts.map +0 -1
- package/dist/config/quality.js +0 -17
- package/dist/config/quality.js.map +0 -1
- package/dist/config/scale.d.ts +0 -3
- package/dist/config/scale.d.ts.map +0 -1
- package/dist/config/scale.js +0 -15
- package/dist/config/scale.js.map +0 -1
- package/dist/config/still-frame.d.ts +0 -2
- package/dist/config/still-frame.d.ts.map +0 -1
- package/dist/config/still-frame.js +0 -12
- package/dist/config/still-frame.js.map +0 -1
- package/dist/config/timeout.d.ts +0 -2
- package/dist/config/timeout.d.ts.map +0 -1
- package/dist/config/timeout.js +0 -17
- package/dist/config/timeout.js.map +0 -1
- package/dist/config/webpack-caching.d.ts +0 -3
- package/dist/config/webpack-caching.d.ts.map +0 -1
- package/dist/config/webpack-caching.js +0 -16
- package/dist/config/webpack-caching.js.map +0 -1
- package/dist/default-css.d.ts.map +0 -1
- package/dist/default-css.js.map +0 -1
- package/dist/delay-render.d.ts.map +0 -1
- package/dist/delay-render.js.map +0 -1
- package/dist/easing.d.ts.map +0 -1
- package/dist/easing.js.map +0 -1
- package/dist/feature-flags.d.ts +0 -1
- package/dist/feature-flags.d.ts.map +0 -1
- package/dist/feature-flags.js +0 -7
- package/dist/feature-flags.js.map +0 -1
- package/dist/freeze.d.ts.map +0 -1
- package/dist/freeze.js.map +0 -1
- package/dist/get-asset-file-name.d.ts.map +0 -1
- package/dist/get-asset-file-name.js.map +0 -1
- package/dist/get-environment.d.ts.map +0 -1
- package/dist/get-environment.js.map +0 -1
- package/dist/get-preview-dom-element.d.ts.map +0 -1
- package/dist/get-preview-dom-element.js.map +0 -1
- package/dist/get-timeline-clip-name.d.ts.map +0 -1
- package/dist/get-timeline-clip-name.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/initial-frame.d.ts +0 -2
- package/dist/initial-frame.d.ts.map +0 -1
- package/dist/initial-frame.js +0 -12
- package/dist/initial-frame.js.map +0 -1
- package/dist/internals.d.ts.map +0 -1
- package/dist/internals.js.map +0 -1
- package/dist/interpolate.d.ts.map +0 -1
- package/dist/interpolate.js.map +0 -1
- package/dist/interpolateColors.d.ts.map +0 -1
- package/dist/interpolateColors.js.map +0 -1
- package/dist/is-approximately-the-same.d.ts.map +0 -1
- package/dist/is-approximately-the-same.js.map +0 -1
- package/dist/is-audio-codec.d.ts +0 -2
- package/dist/is-audio-codec.d.ts.map +0 -1
- package/dist/is-audio-codec.js +0 -7
- package/dist/is-audio-codec.js.map +0 -1
- package/dist/loop/index.d.ts.map +0 -1
- package/dist/loop/index.js.map +0 -1
- package/dist/multiple-versions-warning.d.ts.map +0 -1
- package/dist/multiple-versions-warning.js.map +0 -1
- package/dist/nonce.d.ts.map +0 -1
- package/dist/nonce.js.map +0 -1
- package/dist/perf/index.d.ts +0 -5
- package/dist/perf/index.d.ts.map +0 -1
- package/dist/perf/index.js +0 -35
- package/dist/perf/index.js.map +0 -1
- package/dist/play-and-handle-not-allowed-error.d.ts.map +0 -1
- package/dist/play-and-handle-not-allowed-error.js.map +0 -1
- package/dist/random.d.ts.map +0 -1
- package/dist/random.js.map +0 -1
- package/dist/register-root.d.ts.map +0 -1
- package/dist/register-root.js.map +0 -1
- package/dist/sequencing/index.d.ts.map +0 -1
- package/dist/sequencing/index.js.map +0 -1
- package/dist/series/flatten-children.d.ts.map +0 -1
- package/dist/series/flatten-children.js.map +0 -1
- package/dist/series/index.d.ts.map +0 -1
- package/dist/series/index.js.map +0 -1
- package/dist/setup-env-variables.d.ts.map +0 -1
- package/dist/setup-env-variables.js.map +0 -1
- package/dist/spring/index.d.ts.map +0 -1
- package/dist/spring/index.js.map +0 -1
- package/dist/spring/measure-spring.d.ts.map +0 -1
- package/dist/spring/measure-spring.js.map +0 -1
- package/dist/spring/spring-utils.d.ts.map +0 -1
- package/dist/spring/spring-utils.js.map +0 -1
- package/dist/static-file.d.ts.map +0 -1
- package/dist/static-file.js.map +0 -1
- package/dist/timeline-inout-position-state.d.ts +0 -12
- package/dist/timeline-inout-position-state.d.ts.map +0 -1
- package/dist/timeline-inout-position-state.js +0 -23
- package/dist/timeline-inout-position-state.js.map +0 -1
- package/dist/timeline-position-state.d.ts.map +0 -1
- package/dist/timeline-position-state.js.map +0 -1
- package/dist/timeout.d.ts +0 -2
- package/dist/timeout.d.ts.map +0 -1
- package/dist/timeout.js +0 -12
- package/dist/timeout.js.map +0 -1
- package/dist/truthy.d.ts.map +0 -1
- package/dist/truthy.js.map +0 -1
- package/dist/use-frame.d.ts.map +0 -1
- package/dist/use-frame.js +0 -25
- package/dist/use-frame.js.map +0 -1
- package/dist/use-lazy-component.d.ts.map +0 -1
- package/dist/use-lazy-component.js.map +0 -1
- package/dist/use-media-in-timeline.d.ts.map +0 -1
- package/dist/use-media-in-timeline.js.map +0 -1
- package/dist/use-media-playback.d.ts.map +0 -1
- package/dist/use-media-playback.js.map +0 -1
- package/dist/use-media-tag-volume.d.ts.map +0 -1
- package/dist/use-media-tag-volume.js.map +0 -1
- package/dist/use-sync-volume-with-media-tag.d.ts.map +0 -1
- package/dist/use-sync-volume-with-media-tag.js.map +0 -1
- package/dist/use-unsafe-video-config.d.ts.map +0 -1
- package/dist/use-unsafe-video-config.js.map +0 -1
- package/dist/use-video-config.d.ts.map +0 -1
- package/dist/use-video-config.js.map +0 -1
- package/dist/use-video.d.ts.map +0 -1
- package/dist/use-video.js.map +0 -1
- package/dist/validate-media-props.d.ts.map +0 -1
- package/dist/validate-media-props.js.map +0 -1
- package/dist/validate-start-from-props.d.ts.map +0 -1
- package/dist/validate-start-from-props.js.map +0 -1
- package/dist/validation/validate-composition-id.d.ts.map +0 -1
- package/dist/validation/validate-composition-id.js.map +0 -1
- package/dist/validation/validate-dimensions.d.ts.map +0 -1
- package/dist/validation/validate-dimensions.js.map +0 -1
- package/dist/validation/validate-duration-in-frames.d.ts.map +0 -1
- package/dist/validation/validate-duration-in-frames.js.map +0 -1
- package/dist/validation/validate-folder-name.d.ts.map +0 -1
- package/dist/validation/validate-folder-name.js.map +0 -1
- package/dist/validation/validate-fps.d.ts.map +0 -1
- package/dist/validation/validate-fps.js.map +0 -1
- package/dist/validation/validate-frame.d.ts +0 -1
- package/dist/validation/validate-frame.d.ts.map +0 -1
- package/dist/validation/validate-frame.js +0 -24
- package/dist/validation/validate-frame.js.map +0 -1
- package/dist/validation/validate-image-format.d.ts +0 -2
- package/dist/validation/validate-image-format.d.ts.map +0 -1
- package/dist/validation/validate-image-format.js +0 -9
- package/dist/validation/validate-image-format.js.map +0 -1
- package/dist/validation/validate-opengl-renderer.d.ts +0 -4
- package/dist/validation/validate-opengl-renderer.d.ts.map +0 -1
- package/dist/validation/validate-opengl-renderer.js +0 -14
- package/dist/validation/validate-opengl-renderer.js.map +0 -1
- package/dist/validation/validate-quality.d.ts +0 -1
- package/dist/validation/validate-quality.d.ts.map +0 -1
- package/dist/validation/validate-quality.js +0 -21
- package/dist/validation/validate-quality.js.map +0 -1
- package/dist/video/Video.d.ts.map +0 -1
- package/dist/video/Video.js.map +0 -1
- package/dist/video/VideoForDevelopment.d.ts.map +0 -1
- package/dist/video/VideoForDevelopment.js.map +0 -1
- package/dist/video/VideoForRendering.d.ts.map +0 -1
- package/dist/video/VideoForRendering.js.map +0 -1
- package/dist/video/get-current-time.d.ts.map +0 -1
- package/dist/video/get-current-time.js.map +0 -1
- package/dist/video/index.d.ts.map +0 -1
- package/dist/video/index.js.map +0 -1
- package/dist/video/props.d.ts.map +0 -1
- package/dist/video/props.js.map +0 -1
- package/dist/video-config.d.ts.map +0 -1
- package/dist/video-config.js.map +0 -1
- package/dist/volume-position-state.d.ts.map +0 -1
- package/dist/volume-position-state.js.map +0 -1
- package/dist/volume-prop.d.ts.map +0 -1
- package/dist/volume-prop.js.map +0 -1
- package/dist/warn-about-non-seekable-media.d.ts.map +0 -1
- package/dist/warn-about-non-seekable-media.js.map +0 -1
- package/dist/wrap-remotion-context.d.ts.map +0 -1
- package/dist/wrap-remotion-context.js.map +0 -1
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
[
|
|
2
|
-
[
|
|
3
|
-
[
|
|
4
|
-
[
|
|
5
|
-
[
|
|
1
|
+
[35mremotion:build: [0mcache hit, replaying output [2ma583398c93291d66[0m
|
|
2
|
+
[35mremotion:build: [0m
|
|
3
|
+
[35mremotion:build: [0m> remotion@3.2.16 build /Users/jonathanburger/remotion/packages/core
|
|
4
|
+
[35mremotion:build: [0m> tsc -d
|
|
5
|
+
[35mremotion:build: [0m
|
package/README.md
CHANGED
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
<p align="center">
|
|
2
2
|
<a href="https://github.com/remotion-dev/logo">
|
|
3
|
-
<
|
|
3
|
+
<picture>
|
|
4
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://github.com/remotion-dev/logo/raw/main/animated-logo-banner-dark.gif">
|
|
5
|
+
<img alt="Animated Remotion Logo" src="https://github.com/remotion-dev/logo/raw/main/animated-logo-banner-light.gif">
|
|
6
|
+
</picture>
|
|
4
7
|
</a>
|
|
5
8
|
</p>
|
|
6
9
|
|
|
7
|
-
[](https://
|
|
8
|
-
[](https://remotion.dev/discord)
|
|
11
|
+
[](https://www.npmjs.org/package/remotion)
|
|
9
12
|
[](https://npmcharts.com/compare/remotion?minimal=true)
|
|
10
13
|
[](https://packagephobia.now.sh/result?p=remotion)
|
|
14
|
+
<a href="https://twitter.com/remotion_dev"><img src="https://img.shields.io/twitter/follow/remotion_dev?label=Twitter&style=social" alt="Twitter"></a>
|
|
11
15
|
|
|
12
|
-
Remotion is a
|
|
16
|
+
Remotion is a framework for **creating videos programmatically using React.**
|
|
13
17
|
|
|
14
18
|
## Why create videos in React?
|
|
15
19
|
|
|
@@ -17,35 +21,42 @@ Remotion is a suite of libraries building a foundation for **creating videos pro
|
|
|
17
21
|
- **Leverage programming**: Use variables, functions, APIs, math and algorithms to create new effects
|
|
18
22
|
- **Leverage React**: Reusable components, Powerful composition, Fast Refresh, Package ecosystem
|
|
19
23
|
|
|
20
|
-
##
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
24
|
+
## Created with Remotion
|
|
25
|
+
|
|
26
|
+
<table>
|
|
27
|
+
<tr>
|
|
28
|
+
<td align="center">
|
|
29
|
+
<img style="width: 290px" src="packages/docs/static/img/fireship-quick.gif" />
|
|
30
|
+
<p>"This video was made with code" <em>- Fireship</em> <a href="https://youtu.be/deg8bOoziaE">Watch</a> • <a href="https://github.com/wcandillon/remotion-fireship">Source</a></p>
|
|
31
|
+
</td>
|
|
32
|
+
<td align="center">
|
|
33
|
+
<img style="width: 240px" src="packages/docs/static/img/github-unwrapped.gif" />
|
|
34
|
+
<p>GitHub Unwrapped - Personalized year in Review <a href="https://githubunwrapped.com">Try</a> • <a href="https://github.com/remotion-dev/github-unwrapped">Source</a></p>
|
|
35
|
+
</td>
|
|
36
|
+
<td align="center">
|
|
37
|
+
<em>View more in the <a href="https://remotion.dev/showcase">Remotion Showcase</a>!</em>
|
|
38
|
+
</td>
|
|
39
|
+
</tr>
|
|
40
|
+
</table>
|
|
31
41
|
|
|
32
42
|
## Get started
|
|
33
43
|
|
|
34
|
-
If you already have
|
|
44
|
+
If you already have Node.JS installed, type
|
|
35
45
|
|
|
36
46
|
```console
|
|
37
|
-
|
|
47
|
+
npm init video
|
|
38
48
|
```
|
|
39
49
|
|
|
40
50
|
to get started. Otherwise, read the [installation page](https://www.remotion.dev/docs/) in the documentation.
|
|
41
51
|
|
|
42
52
|
## Documentation
|
|
43
53
|
|
|
44
|
-
|
|
54
|
+
Documentation: [**remotion.dev/docs**](https://www.remotion.dev/docs)
|
|
55
|
+
API Reference: [**remotion.dev/api**](https://www.remotion.dev/api)
|
|
45
56
|
|
|
46
57
|
## License
|
|
47
58
|
|
|
48
|
-
Be aware of that Remotion has a special license and requires obtaining a company license in some cases. Read the [LICENSE](LICENSE.md)
|
|
59
|
+
Be aware of that Remotion has a special license and requires obtaining a company license in some cases. Read the [LICENSE](LICENSE.md) page for more information.
|
|
49
60
|
|
|
50
61
|
## Contributing
|
|
51
62
|
|
package/dist/AbsoluteFill.d.ts
CHANGED
|
@@ -1,2 +1,6 @@
|
|
|
1
|
-
import React
|
|
2
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* An absolutely positioned <div> element with 100% width, height, and a column flex style
|
|
4
|
+
* @link https://www.remotion.dev/docs/absolute-fill
|
|
5
|
+
*/
|
|
6
|
+
export declare const AbsoluteFill: React.ForwardRefExoticComponent<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & React.RefAttributes<HTMLDivElement>>;
|
package/dist/AbsoluteFill.js
CHANGED
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.AbsoluteFill = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
|
-
const
|
|
6
|
+
const AbsoluteFillRefForwarding = (props, ref) => {
|
|
7
7
|
const { style, ...other } = props;
|
|
8
8
|
const actualStyle = (0, react_1.useMemo)(() => {
|
|
9
9
|
return {
|
|
@@ -19,6 +19,10 @@ const AbsoluteFill = (props) => {
|
|
|
19
19
|
...style,
|
|
20
20
|
};
|
|
21
21
|
}, [style]);
|
|
22
|
-
return (0, jsx_runtime_1.jsx)("div", { style: actualStyle, ...other });
|
|
22
|
+
return (0, jsx_runtime_1.jsx)("div", { ref: ref, style: actualStyle, ...other });
|
|
23
23
|
};
|
|
24
|
-
|
|
24
|
+
/**
|
|
25
|
+
* An absolutely positioned <div> element with 100% width, height, and a column flex style
|
|
26
|
+
* @link https://www.remotion.dev/docs/absolute-fill
|
|
27
|
+
*/
|
|
28
|
+
exports.AbsoluteFill = (0, react_1.forwardRef)(AbsoluteFillRefForwarding);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CanUseRemotionHooksProvider = exports.CanUseRemotionHooks = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
exports.CanUseRemotionHooks = (0, react_1.createContext)(false);
|
|
7
|
+
const CanUseRemotionHooksProvider = ({ children }) => {
|
|
8
|
+
return ((0, jsx_runtime_1.jsx)(exports.CanUseRemotionHooks.Provider, { value: true, children: children }));
|
|
9
|
+
};
|
|
10
|
+
exports.CanUseRemotionHooksProvider = CanUseRemotionHooksProvider;
|
package/dist/Composition.d.ts
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
name: string;
|
|
4
|
-
children: React.ReactNode;
|
|
5
|
-
}>;
|
|
1
|
+
import type { ComponentType } from 'react';
|
|
2
|
+
import React from 'react';
|
|
6
3
|
declare type LooseComponentType<T> = ComponentType<T> | ((props: T) => React.ReactNode);
|
|
7
4
|
export declare type CompProps<T> = {
|
|
8
5
|
lazyComponent: () => Promise<{
|
|
@@ -21,5 +18,5 @@ declare type CompositionProps<T> = StillProps<T> & {
|
|
|
21
18
|
fps: number;
|
|
22
19
|
durationInFrames: number;
|
|
23
20
|
};
|
|
24
|
-
export declare const Composition: <T>({ width, height, fps, durationInFrames, id, defaultProps, ...compProps }: CompositionProps<T>) => null;
|
|
21
|
+
export declare const Composition: <T>({ width, height, fps, durationInFrames, id, defaultProps, ...compProps }: CompositionProps<T>) => React.ReactPortal | null;
|
|
25
22
|
export {};
|
package/dist/Composition.js
CHANGED
|
@@ -1,47 +1,45 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Composition =
|
|
3
|
+
exports.Composition = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
|
+
const react_dom_1 = require("react-dom");
|
|
7
|
+
const CanUseRemotionHooks_1 = require("./CanUseRemotionHooks");
|
|
6
8
|
const CompositionManager_1 = require("./CompositionManager");
|
|
9
|
+
const input_props_1 = require("./config/input-props");
|
|
10
|
+
const delay_render_1 = require("./delay-render");
|
|
11
|
+
const Folder_1 = require("./Folder");
|
|
12
|
+
const get_environment_1 = require("./get-environment");
|
|
13
|
+
const internals_1 = require("./internals");
|
|
14
|
+
const loading_indicator_1 = require("./loading-indicator");
|
|
7
15
|
const nonce_1 = require("./nonce");
|
|
8
|
-
const
|
|
16
|
+
const portal_node_1 = require("./portal-node");
|
|
9
17
|
const use_lazy_component_1 = require("./use-lazy-component");
|
|
18
|
+
const use_video_1 = require("./use-video");
|
|
10
19
|
const validate_composition_id_1 = require("./validation/validate-composition-id");
|
|
11
20
|
const validate_dimensions_1 = require("./validation/validate-dimensions");
|
|
12
21
|
const validate_duration_in_frames_1 = require("./validation/validate-duration-in-frames");
|
|
13
|
-
const validate_folder_name_1 = require("./validation/validate-folder-name");
|
|
14
22
|
const validate_fps_1 = require("./validation/validate-fps");
|
|
15
|
-
const
|
|
16
|
-
folderName: null,
|
|
17
|
-
parentName: null,
|
|
18
|
-
});
|
|
19
|
-
const Folder = ({ name, children, }) => {
|
|
20
|
-
const parent = (0, react_1.useContext)(FolderContext);
|
|
21
|
-
const { registerFolder, unregisterFolder } = (0, react_1.useContext)(CompositionManager_1.CompositionManager);
|
|
22
|
-
(0, validate_folder_name_1.validateFolderName)(name);
|
|
23
|
-
const parentNameArr = [parent.parentName, parent.folderName].filter(truthy_1.truthy);
|
|
24
|
-
const parentName = parentNameArr.length === 0 ? null : parentNameArr.join('/');
|
|
25
|
-
const value = (0, react_1.useMemo)(() => {
|
|
26
|
-
return {
|
|
27
|
-
folderName: name,
|
|
28
|
-
parentName,
|
|
29
|
-
};
|
|
30
|
-
}, [name, parentName]);
|
|
23
|
+
const Fallback = () => {
|
|
31
24
|
(0, react_1.useEffect)(() => {
|
|
32
|
-
|
|
33
|
-
return () =>
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}, [name, parent.folderName, parentName, registerFolder, unregisterFolder]);
|
|
37
|
-
return ((0, jsx_runtime_1.jsx)(FolderContext.Provider, { value: value, children: children }));
|
|
25
|
+
const fallback = (0, delay_render_1.delayRender)('Waiting for Root component to unsuspend');
|
|
26
|
+
return () => (0, delay_render_1.continueRender)(fallback);
|
|
27
|
+
}, []);
|
|
28
|
+
return null;
|
|
38
29
|
};
|
|
39
|
-
exports.Folder = Folder;
|
|
40
30
|
const Composition = ({ width, height, fps, durationInFrames, id, defaultProps, ...compProps }) => {
|
|
41
31
|
const { registerComposition, unregisterComposition } = (0, react_1.useContext)(CompositionManager_1.CompositionManager);
|
|
32
|
+
const video = (0, use_video_1.useVideo)();
|
|
42
33
|
const lazy = (0, use_lazy_component_1.useLazyComponent)(compProps);
|
|
43
34
|
const nonce = (0, nonce_1.useNonce)();
|
|
44
|
-
const
|
|
35
|
+
const canUseComposition = (0, react_1.useContext)(internals_1.Internals.CanUseRemotionHooks);
|
|
36
|
+
if (canUseComposition) {
|
|
37
|
+
if (typeof window !== 'undefined' && window.remotion_isPlayer) {
|
|
38
|
+
throw new Error('<Composition> was mounted inside the `component` that was passed to the <Player>. See https://remotion.dev/docs/wrong-composition-mount for help.');
|
|
39
|
+
}
|
|
40
|
+
throw new Error('<Composition> mounted inside another composition. See https://remotion.dev/docs/wrong-composition-mount for help.');
|
|
41
|
+
}
|
|
42
|
+
const { folderName, parentName } = (0, react_1.useContext)(Folder_1.FolderContext);
|
|
45
43
|
(0, react_1.useEffect)(() => {
|
|
46
44
|
// Ensure it's a URL safe id
|
|
47
45
|
if (!id) {
|
|
@@ -51,7 +49,7 @@ const Composition = ({ width, height, fps, durationInFrames, id, defaultProps, .
|
|
|
51
49
|
(0, validate_dimensions_1.validateDimension)(width, 'width', 'of the <Composition/> component');
|
|
52
50
|
(0, validate_dimensions_1.validateDimension)(height, 'height', 'of the <Composition/> component');
|
|
53
51
|
(0, validate_duration_in_frames_1.validateDurationInFrames)(durationInFrames, 'of the <Composition/> component');
|
|
54
|
-
(0, validate_fps_1.validateFps)(fps, 'as a prop of the <Composition/> component');
|
|
52
|
+
(0, validate_fps_1.validateFps)(fps, 'as a prop of the <Composition/> component', false);
|
|
55
53
|
registerComposition({
|
|
56
54
|
durationInFrames,
|
|
57
55
|
fps,
|
|
@@ -81,6 +79,20 @@ const Composition = ({ width, height, fps, durationInFrames, id, defaultProps, .
|
|
|
81
79
|
nonce,
|
|
82
80
|
parentName,
|
|
83
81
|
]);
|
|
82
|
+
if ((0, get_environment_1.getRemotionEnvironment)() === 'preview' &&
|
|
83
|
+
video &&
|
|
84
|
+
video.component === lazy) {
|
|
85
|
+
const Comp = lazy;
|
|
86
|
+
const inputProps = (0, input_props_1.getInputProps)();
|
|
87
|
+
return (0, react_dom_1.createPortal)((0, jsx_runtime_1.jsx)(CanUseRemotionHooks_1.CanUseRemotionHooksProvider, { children: (0, jsx_runtime_1.jsx)(react_1.Suspense, { fallback: (0, jsx_runtime_1.jsx)(loading_indicator_1.Loading, {}), children: (0, jsx_runtime_1.jsx)(Comp, { ...defaultProps, ...inputProps }) }) }), (0, portal_node_1.portalNode)());
|
|
88
|
+
}
|
|
89
|
+
if ((0, get_environment_1.getRemotionEnvironment)() === 'rendering' &&
|
|
90
|
+
video &&
|
|
91
|
+
video.component === lazy) {
|
|
92
|
+
const Comp = lazy;
|
|
93
|
+
const inputProps = (0, input_props_1.getInputProps)();
|
|
94
|
+
return (0, react_dom_1.createPortal)((0, jsx_runtime_1.jsx)(CanUseRemotionHooks_1.CanUseRemotionHooksProvider, { children: (0, jsx_runtime_1.jsx)(react_1.Suspense, { fallback: (0, jsx_runtime_1.jsx)(Fallback, {}), children: (0, jsx_runtime_1.jsx)(Comp, { ...defaultProps, ...inputProps }) }) }), (0, portal_node_1.portalNode)());
|
|
95
|
+
}
|
|
84
96
|
return null;
|
|
85
97
|
};
|
|
86
98
|
exports.Composition = Composition;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type { ComponentType, LazyExoticComponent } from 'react';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import type { TFolder } from './Folder';
|
|
2
4
|
export declare type TComposition<T = unknown> = {
|
|
3
5
|
width: number;
|
|
4
6
|
height: number;
|
|
@@ -48,12 +50,7 @@ export declare type TAsset = {
|
|
|
48
50
|
mediaFrame: number;
|
|
49
51
|
playbackRate: number;
|
|
50
52
|
};
|
|
51
|
-
|
|
52
|
-
assets: TAsset[][];
|
|
53
|
-
imageSequenceName: string;
|
|
54
|
-
firstFrameIndex: number;
|
|
55
|
-
downloadDir: string;
|
|
56
|
-
};
|
|
53
|
+
declare type BaseMetadata = Pick<TCompMetadata, 'durationInFrames' | 'fps' | 'defaultProps' | 'height' | 'width'>;
|
|
57
54
|
export declare type CompositionManagerContext = {
|
|
58
55
|
compositions: TComposition[];
|
|
59
56
|
registerComposition: <T>(comp: TComposition<T>) => void;
|
|
@@ -62,6 +59,8 @@ export declare type CompositionManagerContext = {
|
|
|
62
59
|
unregisterFolder: (name: string, parent: string | null) => void;
|
|
63
60
|
currentComposition: string | null;
|
|
64
61
|
setCurrentComposition: (curr: string) => void;
|
|
62
|
+
setCurrentCompositionMetadata: (metadata: BaseMetadata) => void;
|
|
63
|
+
currentCompositionMetadata: BaseMetadata | null;
|
|
65
64
|
registerSequence: (seq: TSequence) => void;
|
|
66
65
|
unregisterSequence: (id: string) => void;
|
|
67
66
|
registerAsset: (asset: TAsset) => void;
|
|
@@ -74,10 +73,6 @@ export declare const CompositionManager: React.Context<CompositionManagerContext
|
|
|
74
73
|
export declare const compositionsRef: React.RefObject<{
|
|
75
74
|
getCompositions: () => TCompMetadata[];
|
|
76
75
|
}>;
|
|
77
|
-
export declare type TFolder = {
|
|
78
|
-
name: string;
|
|
79
|
-
parent: string | null;
|
|
80
|
-
};
|
|
81
76
|
export declare const CompositionManagerProvider: React.FC<{
|
|
82
77
|
children: React.ReactNode;
|
|
83
78
|
}>;
|
|
@@ -34,6 +34,7 @@ exports.CompositionManager = (0, react_1.createContext)({
|
|
|
34
34
|
unregisterFolder: () => undefined,
|
|
35
35
|
currentComposition: null,
|
|
36
36
|
setCurrentComposition: () => undefined,
|
|
37
|
+
setCurrentCompositionMetadata: () => undefined,
|
|
37
38
|
registerSequence: () => undefined,
|
|
38
39
|
unregisterSequence: () => undefined,
|
|
39
40
|
registerAsset: () => undefined,
|
|
@@ -41,6 +42,7 @@ exports.CompositionManager = (0, react_1.createContext)({
|
|
|
41
42
|
sequences: [],
|
|
42
43
|
assets: [],
|
|
43
44
|
folders: [],
|
|
45
|
+
currentCompositionMetadata: null,
|
|
44
46
|
});
|
|
45
47
|
exports.compositionsRef = react_1.default.createRef();
|
|
46
48
|
const CompositionManagerProvider = ({ children }) => {
|
|
@@ -51,6 +53,7 @@ const CompositionManagerProvider = ({ children }) => {
|
|
|
51
53
|
const [assets, setAssets] = (0, react_1.useState)([]);
|
|
52
54
|
const [folders, setFolders] = (0, react_1.useState)([]);
|
|
53
55
|
const [sequences, setSequences] = (0, react_1.useState)([]);
|
|
56
|
+
const [currentCompositionMetadata, setCurrentCompositionMetadata] = (0, react_1.useState)(null);
|
|
54
57
|
const registerComposition = (0, react_1.useCallback)((comp) => {
|
|
55
58
|
setCompositions((comps) => {
|
|
56
59
|
if (comps.find((c) => c.id === comp.id)) {
|
|
@@ -127,21 +130,24 @@ const CompositionManagerProvider = ({ children }) => {
|
|
|
127
130
|
folders,
|
|
128
131
|
registerFolder,
|
|
129
132
|
unregisterFolder,
|
|
133
|
+
currentCompositionMetadata,
|
|
134
|
+
setCurrentCompositionMetadata,
|
|
130
135
|
};
|
|
131
136
|
}, [
|
|
132
137
|
compositions,
|
|
133
|
-
currentComposition,
|
|
134
138
|
registerComposition,
|
|
135
|
-
registerSequence,
|
|
136
139
|
unregisterComposition,
|
|
140
|
+
currentComposition,
|
|
141
|
+
registerSequence,
|
|
137
142
|
unregisterSequence,
|
|
138
143
|
registerAsset,
|
|
139
144
|
unregisterAsset,
|
|
140
145
|
sequences,
|
|
141
146
|
assets,
|
|
147
|
+
folders,
|
|
142
148
|
registerFolder,
|
|
143
149
|
unregisterFolder,
|
|
144
|
-
|
|
150
|
+
currentCompositionMetadata,
|
|
145
151
|
]);
|
|
146
152
|
return ((0, jsx_runtime_1.jsx)(exports.CompositionManager.Provider, { value: contextValue, children: children }));
|
|
147
153
|
};
|
package/dist/Folder.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { FC } from 'react';
|
|
2
|
+
export declare type TFolder = {
|
|
3
|
+
name: string;
|
|
4
|
+
parent: string | null;
|
|
5
|
+
};
|
|
6
|
+
declare type FolderContextType = {
|
|
7
|
+
folderName: string | null;
|
|
8
|
+
parentName: string | null;
|
|
9
|
+
};
|
|
10
|
+
export declare const FolderContext: import("react").Context<FolderContextType>;
|
|
11
|
+
export declare const Folder: FC<{
|
|
12
|
+
name: string;
|
|
13
|
+
children: React.ReactNode;
|
|
14
|
+
}>;
|
|
15
|
+
export {};
|
package/dist/Folder.js
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Folder = exports.FolderContext = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const CompositionManager_1 = require("./CompositionManager");
|
|
7
|
+
const truthy_1 = require("./truthy");
|
|
8
|
+
const validate_folder_name_1 = require("./validation/validate-folder-name");
|
|
9
|
+
exports.FolderContext = (0, react_1.createContext)({
|
|
10
|
+
folderName: null,
|
|
11
|
+
parentName: null,
|
|
12
|
+
});
|
|
13
|
+
const Folder = ({ name, children, }) => {
|
|
14
|
+
const parent = (0, react_1.useContext)(exports.FolderContext);
|
|
15
|
+
const { registerFolder, unregisterFolder } = (0, react_1.useContext)(CompositionManager_1.CompositionManager);
|
|
16
|
+
(0, validate_folder_name_1.validateFolderName)(name);
|
|
17
|
+
const parentNameArr = [parent.parentName, parent.folderName].filter(truthy_1.truthy);
|
|
18
|
+
const parentName = parentNameArr.length === 0 ? null : parentNameArr.join('/');
|
|
19
|
+
const value = (0, react_1.useMemo)(() => {
|
|
20
|
+
return {
|
|
21
|
+
folderName: name,
|
|
22
|
+
parentName,
|
|
23
|
+
};
|
|
24
|
+
}, [name, parentName]);
|
|
25
|
+
(0, react_1.useEffect)(() => {
|
|
26
|
+
registerFolder(name, parentName);
|
|
27
|
+
return () => {
|
|
28
|
+
unregisterFolder(name, parentName);
|
|
29
|
+
};
|
|
30
|
+
}, [name, parent.folderName, parentName, registerFolder, unregisterFolder]);
|
|
31
|
+
return ((0, jsx_runtime_1.jsx)(exports.FolderContext.Provider, { value: value, children: children }));
|
|
32
|
+
};
|
|
33
|
+
exports.Folder = Folder;
|
package/dist/Img.js
CHANGED
|
@@ -4,11 +4,13 @@ exports.Img = void 0;
|
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const delay_render_1 = require("./delay-render");
|
|
7
|
-
const
|
|
7
|
+
const preload_1 = require("./preload");
|
|
8
|
+
const ImgRefForwarding = ({ onError, src, ...props }, ref) => {
|
|
8
9
|
const imageRef = (0, react_1.useRef)(null);
|
|
9
10
|
(0, react_1.useImperativeHandle)(ref, () => {
|
|
10
11
|
return imageRef.current;
|
|
11
12
|
});
|
|
13
|
+
const actualSrc = (0, preload_1.usePreload)(src);
|
|
12
14
|
const didGetError = (0, react_1.useCallback)((e) => {
|
|
13
15
|
var _a;
|
|
14
16
|
if (onError) {
|
|
@@ -20,7 +22,10 @@ const ImgRefForwarding = ({ onError, ...props }, ref) => {
|
|
|
20
22
|
}, [onError]);
|
|
21
23
|
// If image source switches, make new handle
|
|
22
24
|
(0, react_1.useLayoutEffect)(() => {
|
|
23
|
-
|
|
25
|
+
if (process.env.NODE_ENV === 'test') {
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
const newHandle = (0, delay_render_1.delayRender)('Loading <Img> with src=' + src);
|
|
24
29
|
const { current } = imageRef;
|
|
25
30
|
const didLoad = () => {
|
|
26
31
|
(0, delay_render_1.continueRender)(newHandle);
|
|
@@ -36,7 +41,7 @@ const ImgRefForwarding = ({ onError, ...props }, ref) => {
|
|
|
36
41
|
current === null || current === void 0 ? void 0 : current.removeEventListener('load', didLoad);
|
|
37
42
|
(0, delay_render_1.continueRender)(newHandle);
|
|
38
43
|
};
|
|
39
|
-
}, [
|
|
40
|
-
return (0, jsx_runtime_1.jsx)("img", { ...props, ref: imageRef, onError: didGetError });
|
|
44
|
+
}, [src]);
|
|
45
|
+
return ((0, jsx_runtime_1.jsx)("img", { ...props, ref: imageRef, src: actualSrc, onError: didGetError }));
|
|
41
46
|
};
|
|
42
47
|
exports.Img = (0, react_1.forwardRef)(ImgRefForwarding);
|
package/dist/RemotionRoot.js
CHANGED
|
@@ -7,6 +7,7 @@ const shared_audio_tags_1 = require("./audio/shared-audio-tags");
|
|
|
7
7
|
const CompositionManager_1 = require("./CompositionManager");
|
|
8
8
|
const delay_render_1 = require("./delay-render");
|
|
9
9
|
const nonce_1 = require("./nonce");
|
|
10
|
+
const preload_state_1 = require("./preload-state");
|
|
10
11
|
const random_1 = require("./random");
|
|
11
12
|
const timeline_position_state_1 = require("./timeline-position-state");
|
|
12
13
|
const RemotionRoot = ({ children }) => {
|
|
@@ -61,10 +62,10 @@ const RemotionRoot = ({ children }) => {
|
|
|
61
62
|
});
|
|
62
63
|
}
|
|
63
64
|
}, []);
|
|
64
|
-
return ((0, jsx_runtime_1.jsx)(nonce_1.NonceContext.Provider, { value: nonceContext, children: (0, jsx_runtime_1.jsx)(timeline_position_state_1.TimelineContext.Provider, { value: timelineContextValue, children: (0, jsx_runtime_1.jsx)(timeline_position_state_1.SetTimelineContext.Provider, { value: setTimelineContextValue, children: (0, jsx_runtime_1.jsx)(CompositionManager_1.CompositionManagerProvider, { children: (0, jsx_runtime_1.jsx)(shared_audio_tags_1.SharedAudioContextProvider
|
|
65
|
-
// In the preview, which is mostly played on Desktop, we opt out of the autoplay policy fix as described in https://github.com/remotion-dev/remotion/pull/554, as it mostly applies to mobile.
|
|
66
|
-
, {
|
|
65
|
+
return ((0, jsx_runtime_1.jsx)(nonce_1.NonceContext.Provider, { value: nonceContext, children: (0, jsx_runtime_1.jsx)(timeline_position_state_1.TimelineContext.Provider, { value: timelineContextValue, children: (0, jsx_runtime_1.jsx)(timeline_position_state_1.SetTimelineContext.Provider, { value: setTimelineContextValue, children: (0, jsx_runtime_1.jsx)(preload_state_1.PreloadProvider, { children: (0, jsx_runtime_1.jsx)(CompositionManager_1.CompositionManagerProvider, { children: (0, jsx_runtime_1.jsx)(shared_audio_tags_1.SharedAudioContextProvider
|
|
67
66
|
// In the preview, which is mostly played on Desktop, we opt out of the autoplay policy fix as described in https://github.com/remotion-dev/remotion/pull/554, as it mostly applies to mobile.
|
|
68
|
-
|
|
67
|
+
, {
|
|
68
|
+
// In the preview, which is mostly played on Desktop, we opt out of the autoplay policy fix as described in https://github.com/remotion-dev/remotion/pull/554, as it mostly applies to mobile.
|
|
69
|
+
numberOfAudioTags: 0, children: children }) }) }) }) }) }));
|
|
69
70
|
};
|
|
70
71
|
exports.RemotionRoot = RemotionRoot;
|
|
@@ -7,13 +7,23 @@ export declare type SequenceContextType = {
|
|
|
7
7
|
id: string;
|
|
8
8
|
};
|
|
9
9
|
export declare const SequenceContext: React.Context<SequenceContextType | null>;
|
|
10
|
+
declare type LayoutAndStyle = {
|
|
11
|
+
layout: 'none';
|
|
12
|
+
} | {
|
|
13
|
+
layout?: 'absolute-fill';
|
|
14
|
+
style?: React.CSSProperties;
|
|
15
|
+
};
|
|
10
16
|
export declare type SequenceProps = {
|
|
11
17
|
children: React.ReactNode;
|
|
12
18
|
from: number;
|
|
13
19
|
durationInFrames?: number;
|
|
14
20
|
name?: string;
|
|
15
|
-
layout?: 'absolute-fill' | 'none';
|
|
16
21
|
showInTimeline?: boolean;
|
|
17
22
|
showLoopTimesInTimeline?: number;
|
|
18
|
-
};
|
|
19
|
-
|
|
23
|
+
} & LayoutAndStyle;
|
|
24
|
+
/**
|
|
25
|
+
* A component that time-shifts its children and wraps them in an absolutely positioned <div>.
|
|
26
|
+
* @link https://www.remotion.dev/docs/sequence
|
|
27
|
+
*/
|
|
28
|
+
export declare const Sequence: React.ForwardRefExoticComponent<SequenceProps & React.RefAttributes<HTMLDivElement>>;
|
|
29
|
+
export {};
|
|
@@ -3,25 +3,30 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.Sequence = exports.SequenceContext = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
6
|
+
const AbsoluteFill_1 = require("./AbsoluteFill");
|
|
7
|
+
const CompositionManager_1 = require("./CompositionManager");
|
|
8
|
+
const get_environment_1 = require("./get-environment");
|
|
9
|
+
const get_timeline_clip_name_1 = require("./get-timeline-clip-name");
|
|
10
|
+
const nonce_1 = require("./nonce");
|
|
11
|
+
const timeline_position_state_1 = require("./timeline-position-state");
|
|
12
|
+
const use_video_config_1 = require("./use-video-config");
|
|
12
13
|
exports.SequenceContext = (0, react_1.createContext)(null);
|
|
13
|
-
const
|
|
14
|
+
const SequenceRefForwardingFunction = ({ from, durationInFrames = Infinity, children, name, showInTimeline = true, showLoopTimesInTimeline, ...other }, ref) => {
|
|
15
|
+
const { layout = 'absolute-fill' } = other;
|
|
14
16
|
const [id] = (0, react_1.useState)(() => String(Math.random()));
|
|
15
17
|
const parentSequence = (0, react_1.useContext)(exports.SequenceContext);
|
|
16
18
|
const { rootId } = (0, react_1.useContext)(timeline_position_state_1.TimelineContext);
|
|
17
19
|
const cumulatedFrom = parentSequence
|
|
18
20
|
? parentSequence.cumulatedFrom + parentSequence.relativeFrom
|
|
19
21
|
: 0;
|
|
20
|
-
const actualFrom = cumulatedFrom + from;
|
|
21
22
|
const nonce = (0, nonce_1.useNonce)();
|
|
22
23
|
if (layout !== 'absolute-fill' && layout !== 'none') {
|
|
23
24
|
throw new TypeError(`The layout prop of <Sequence /> expects either "absolute-fill" or "none", but you passed: ${layout}`);
|
|
24
25
|
}
|
|
26
|
+
// @ts-expect-error
|
|
27
|
+
if (layout === 'none' && typeof other.style !== 'undefined') {
|
|
28
|
+
throw new TypeError('If layout="none", you may not pass a style.');
|
|
29
|
+
}
|
|
25
30
|
if (typeof durationInFrames !== 'number') {
|
|
26
31
|
throw new TypeError(`You passed to durationInFrames an argument of type ${typeof durationInFrames}, but it must be a number.`);
|
|
27
32
|
}
|
|
@@ -38,16 +43,12 @@ const Sequence = ({ from, durationInFrames = Infinity, children, name, layout =
|
|
|
38
43
|
if (from % 1 !== 0) {
|
|
39
44
|
throw new TypeError(`The "from" prop of a sequence must be an integer, but got ${from}.`);
|
|
40
45
|
}
|
|
41
|
-
const absoluteFrame = (0,
|
|
42
|
-
const
|
|
43
|
-
const
|
|
44
|
-
?
|
|
45
|
-
:
|
|
46
|
-
const actualDurationInFrames = Math.min(
|
|
47
|
-
? Math.min(parentSequence.durationInFrames +
|
|
48
|
-
(parentSequence.cumulatedFrom + parentSequence.relativeFrom) -
|
|
49
|
-
actualFrom, durationInFrames)
|
|
50
|
-
: durationInFrames);
|
|
46
|
+
const absoluteFrame = (0, timeline_position_state_1.useTimelinePosition)();
|
|
47
|
+
const videoConfig = (0, use_video_config_1.useVideoConfig)();
|
|
48
|
+
const parentSequenceDuration = parentSequence
|
|
49
|
+
? Math.min(parentSequence.durationInFrames - from, durationInFrames)
|
|
50
|
+
: durationInFrames;
|
|
51
|
+
const actualDurationInFrames = Math.max(0, Math.min(videoConfig.durationInFrames - from, parentSequenceDuration));
|
|
51
52
|
const { registerSequence, unregisterSequence } = (0, react_1.useContext)(CompositionManager_1.CompositionManager);
|
|
52
53
|
const contextValue = (0, react_1.useMemo)(() => {
|
|
53
54
|
var _a;
|
|
@@ -70,6 +71,9 @@ const Sequence = ({ from, durationInFrames = Infinity, children, name, layout =
|
|
|
70
71
|
}, [children, name]);
|
|
71
72
|
(0, react_1.useEffect)(() => {
|
|
72
73
|
var _a;
|
|
74
|
+
if ((0, get_environment_1.getRemotionEnvironment)() !== 'preview') {
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
73
77
|
registerSequence({
|
|
74
78
|
from,
|
|
75
79
|
duration: actualDurationInFrames,
|
|
@@ -87,7 +91,6 @@ const Sequence = ({ from, durationInFrames = Infinity, children, name, layout =
|
|
|
87
91
|
};
|
|
88
92
|
}, [
|
|
89
93
|
durationInFrames,
|
|
90
|
-
actualFrom,
|
|
91
94
|
id,
|
|
92
95
|
name,
|
|
93
96
|
registerSequence,
|
|
@@ -101,23 +104,26 @@ const Sequence = ({ from, durationInFrames = Infinity, children, name, layout =
|
|
|
101
104
|
nonce,
|
|
102
105
|
showLoopTimesInTimeline,
|
|
103
106
|
]);
|
|
104
|
-
const endThreshold =
|
|
105
|
-
|
|
106
|
-
})();
|
|
107
|
-
const content = absoluteFrame < actualFrom
|
|
107
|
+
const endThreshold = cumulatedFrom + from + durationInFrames - 1;
|
|
108
|
+
const content = absoluteFrame < cumulatedFrom + from
|
|
108
109
|
? null
|
|
109
110
|
: absoluteFrame > endThreshold
|
|
110
111
|
? null
|
|
111
112
|
: children;
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
113
|
+
const styleIfThere = other.layout === 'none' ? undefined : other.style;
|
|
114
|
+
const defaultStyle = (0, react_1.useMemo)(() => {
|
|
115
|
+
return {
|
|
116
|
+
flexDirection: undefined,
|
|
117
|
+
...(styleIfThere !== null && styleIfThere !== void 0 ? styleIfThere : {}),
|
|
118
|
+
};
|
|
119
|
+
}, [styleIfThere]);
|
|
120
|
+
if (ref !== null && layout === 'none') {
|
|
121
|
+
throw new TypeError('It is not supported to pass both a `ref` and `layout="none"` to <Sequence />.');
|
|
122
|
+
}
|
|
123
|
+
return ((0, jsx_runtime_1.jsx)(exports.SequenceContext.Provider, { value: contextValue, children: content === null ? null : layout === 'absolute-fill' ? ((0, jsx_runtime_1.jsx)(AbsoluteFill_1.AbsoluteFill, { ref: ref, style: defaultStyle, children: content })) : (content) }));
|
|
122
124
|
};
|
|
123
|
-
|
|
125
|
+
/**
|
|
126
|
+
* A component that time-shifts its children and wraps them in an absolutely positioned <div>.
|
|
127
|
+
* @link https://www.remotion.dev/docs/sequence
|
|
128
|
+
*/
|
|
129
|
+
exports.Sequence = (0, react_1.forwardRef)(SequenceRefForwardingFunction);
|
package/dist/Still.d.ts
CHANGED