remotion 4.0.0-lambda.3 → 4.0.0-newpathfunctions.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +8 -8
- package/README.md +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/Clipper.d.ts +7 -0
- package/dist/Clipper.js +24 -0
- package/dist/Composition.d.ts +3 -5
- package/dist/Composition.js +36 -38
- package/dist/CompositionManager.d.ts +9 -11
- package/dist/CompositionManager.js +9 -3
- package/dist/Folder.d.ts +15 -0
- package/dist/Folder.js +33 -0
- package/dist/IFrame.d.ts +0 -0
- package/dist/IFrame.js +0 -0
- package/dist/Img.d.ts +0 -0
- package/dist/Img.js +31 -21
- package/dist/LayerMaster.d.ts +8 -0
- package/dist/LayerMaster.js +39 -0
- package/dist/NativeLayers.d.ts +13 -0
- package/dist/NativeLayers.js +29 -0
- package/dist/Null.d.ts +2 -0
- package/dist/Null.js +25 -0
- package/dist/RemotionRoot.d.ts +1 -0
- package/dist/RemotionRoot.js +9 -6
- package/dist/{sequencing/index.d.ts → Sequence.d.ts} +13 -4
- package/dist/{sequencing/index.js → Sequence.js} +42 -34
- package/dist/Still.d.ts +1 -1
- package/dist/Still.js +0 -0
- package/dist/absolute-src.d.ts +0 -0
- package/dist/absolute-src.js +0 -0
- package/dist/asset-types.d.ts +1 -4
- package/dist/asset-types.js +0 -0
- package/dist/audio/Audio.d.ts +5 -3
- package/dist/audio/Audio.js +26 -6
- package/dist/audio/AudioForDevelopment.d.ts +6 -2
- package/dist/audio/AudioForDevelopment.js +42 -6
- package/dist/audio/AudioForRendering.d.ts +9 -2
- package/dist/audio/AudioForRendering.js +52 -9
- package/dist/audio/index.d.ts +0 -0
- package/dist/audio/index.js +0 -0
- package/dist/audio/props.d.ts +4 -2
- package/dist/audio/props.js +0 -0
- package/dist/audio/shared-audio-tags.d.ts +9 -4
- package/dist/audio/shared-audio-tags.js +117 -45
- package/dist/audio/use-audio-frame.d.ts +0 -0
- package/dist/audio/use-audio-frame.js +4 -4
- package/dist/bezier.d.ts +0 -0
- package/dist/bezier.js +0 -0
- package/dist/config/input-props.d.ts +0 -0
- package/dist/config/input-props.js +12 -14
- package/dist/config.d.ts +285 -0
- 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.d.ts +0 -0
- package/dist/delay-render.js +4 -4
- package/dist/easing.d.ts +0 -0
- package/dist/easing.js +0 -0
- package/dist/freeze.d.ts +2 -2
- package/dist/freeze.js +2 -2
- package/dist/get-asset-file-name.d.ts +0 -0
- package/dist/get-asset-file-name.js +0 -0
- package/dist/get-compositions-from-markup.d.ts +3 -0
- package/dist/get-compositions-from-markup.js +19 -0
- package/dist/get-environment.d.ts +1 -0
- package/dist/get-environment.js +14 -2
- package/dist/get-preview-dom-element.d.ts +0 -0
- package/dist/get-preview-dom-element.js +0 -0
- package/dist/get-static-files.d.ts +17 -0
- package/dist/get-static-files.js +31 -0
- package/dist/get-timeline-clip-name.d.ts +0 -0
- package/dist/get-timeline-clip-name.js +2 -1
- package/dist/index.d.ts +38 -9
- package/dist/index.js +25 -9
- package/dist/internals.d.ts +50 -102
- package/dist/internals.js +18 -93
- package/dist/{interpolateColors.d.ts → interpolate-colors.d.ts} +0 -0
- package/dist/{interpolateColors.js → interpolate-colors.js} +0 -0
- package/dist/interpolate.d.ts +0 -0
- package/dist/interpolate.js +0 -0
- package/dist/is-approximately-the-same.d.ts +0 -0
- package/dist/is-approximately-the-same.js +0 -0
- package/dist/is-player.d.ts +3 -0
- package/dist/is-player.js +14 -0
- package/dist/layers.d.ts +24 -0
- package/dist/layers.js +149 -0
- package/dist/loading-indicator.d.ts +0 -0
- package/dist/loading-indicator.js +0 -0
- package/dist/loop/index.d.ts +2 -2
- package/dist/loop/index.js +7 -5
- package/dist/multiple-versions-warning.d.ts +0 -0
- package/dist/multiple-versions-warning.js +23 -4
- package/dist/nonce.d.ts +0 -0
- package/dist/nonce.js +0 -0
- package/dist/play-and-handle-not-allowed-error.d.ts +1 -1
- package/dist/play-and-handle-not-allowed-error.js +4 -0
- package/dist/portal-node.d.ts +0 -0
- package/dist/portal-node.js +0 -0
- package/dist/prefetch-state.d.ts +8 -0
- package/dist/prefetch-state.js +27 -0
- package/dist/prefetch.d.ts +9 -0
- package/dist/prefetch.js +108 -0
- package/dist/random.d.ts +2 -1
- package/dist/random.js +0 -0
- package/dist/register-root.d.ts +1 -1
- package/dist/register-root.js +3 -0
- package/dist/series/flatten-children.d.ts +1 -1
- package/dist/series/flatten-children.js +0 -0
- package/dist/series/index.d.ts +4 -4
- package/dist/series/index.js +5 -3
- package/dist/setup-env-variables.d.ts +0 -0
- package/dist/setup-env-variables.js +0 -0
- 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/spring/spring-utils.d.ts +0 -0
- package/dist/spring/spring-utils.js +0 -0
- package/dist/static-file.d.ts +4 -0
- package/dist/static-file.js +10 -0
- package/dist/timeline-position-state.d.ts +1 -1
- package/dist/timeline-position-state.js +0 -0
- package/dist/truthy.d.ts +0 -0
- package/dist/truthy.js +0 -0
- 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-lazy-component.js +0 -0
- package/dist/use-media-in-timeline.d.ts +4 -3
- package/dist/use-media-in-timeline.js +15 -8
- package/dist/use-media-playback.d.ts +5 -2
- package/dist/use-media-playback.js +13 -8
- package/dist/use-media-tag-volume.d.ts +1 -1
- package/dist/use-media-tag-volume.js +0 -0
- package/dist/use-sync-volume-with-media-tag.d.ts +2 -2
- package/dist/use-sync-volume-with-media-tag.js +1 -0
- 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 +10 -1
- 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/validate-media-props.js +0 -0
- package/dist/validate-start-from-props.d.ts +0 -0
- package/dist/validate-start-from-props.js +0 -0
- package/dist/validation/validate-composition-id.d.ts +0 -0
- package/dist/validation/validate-composition-id.js +0 -0
- package/dist/validation/validate-dimensions.d.ts +0 -0
- package/dist/validation/validate-dimensions.js +0 -0
- package/dist/validation/validate-duration-in-frames.d.ts +0 -0
- package/dist/validation/validate-duration-in-frames.js +0 -0
- package/dist/validation/validate-folder-name.d.ts +0 -0
- package/dist/validation/validate-folder-name.js +0 -0
- 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/NativeVideo.d.ts +5 -0
- package/dist/video/NativeVideo.js +33 -0
- package/dist/video/NativeVideoForRendering.d.ts +8 -0
- package/dist/video/NativeVideoForRendering.js +14 -0
- package/dist/video/OffthreadVideo.d.ts +2 -2
- package/dist/video/OffthreadVideo.js +12 -4
- package/dist/video/OffthreadVideoForRendering.d.ts +1 -1
- package/dist/video/OffthreadVideoForRendering.js +28 -17
- package/dist/video/Video.d.ts +5 -3
- package/dist/video/Video.js +27 -6
- package/dist/video/VideoForDevelopment.d.ts +10 -2
- package/dist/video/VideoForDevelopment.js +75 -7
- package/dist/video/VideoForRendering.d.ts +9 -2
- package/dist/video/VideoForRendering.js +84 -27
- package/dist/video/duration-state.d.ts +17 -0
- package/dist/video/duration-state.js +34 -0
- 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/index.js +0 -0
- package/dist/video/props.d.ts +9 -3
- package/dist/video/props.js +0 -0
- package/dist/video/video-fragment.d.ts +12 -0
- package/dist/video/video-fragment.js +60 -0
- package/dist/video-config.d.ts +0 -0
- package/dist/video-config.js +0 -0
- package/dist/volume-position-state.d.ts +0 -0
- package/dist/volume-position-state.js +0 -0
- package/dist/volume-prop.d.ts +2 -1
- package/dist/volume-prop.js +4 -3
- 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 +6 -1
- package/dist/wrap-remotion-context.js +15 -3
- package/package.json +26 -16
- package/.turbo/turbo-build.log +0 -5
- 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/bundle-out-dir.d.ts +0 -2
- package/dist/config/bundle-out-dir.js +0 -12
- 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/every-nth-file.d.ts +0 -2
- package/dist/config/every-nth-file.js +0 -12
- package/dist/config/ffmpeg-executable.d.ts +0 -5
- package/dist/config/ffmpeg-executable.d.ts.map +0 -1
- package/dist/config/ffmpeg-executable.js +0 -21
- 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 +0 -167
- package/dist/config/index.d.ts.map +0 -1
- package/dist/config/index.js +0 -180
- 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/loop.d.ts +0 -3
- package/dist/config/loop.js +0 -15
- 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 -6
- 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/public-path.d.ts +0 -2
- package/dist/config/public-path.js +0 -12
- 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-every-nth-frame.d.ts +0 -1
- package/dist/validation/validate-every-nth-frame.js +0 -21
- 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
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LayerMaster = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const AbsoluteFill_1 = require("./AbsoluteFill");
|
|
7
|
+
const get_environment_1 = require("./get-environment");
|
|
8
|
+
const LayerMaster = ({ layers, defaultProps, inputProps, fallbackComponent: FallbackComponent, }) => {
|
|
9
|
+
return (
|
|
10
|
+
// TODO: Same styles as normal
|
|
11
|
+
(0, jsx_runtime_1.jsx)(AbsoluteFill_1.AbsoluteFill, { children: layers.map((layer, i) => {
|
|
12
|
+
const Comp = layer.component;
|
|
13
|
+
if (layer.type === 'web') {
|
|
14
|
+
if (FallbackComponent === null) {
|
|
15
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
16
|
+
return (0, jsx_runtime_1.jsx)(Comp, { ...defaultProps, ...inputProps }, String(i));
|
|
17
|
+
}
|
|
18
|
+
return (
|
|
19
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
20
|
+
(0, jsx_runtime_1.jsx)(react_1.Suspense, { fallback: (0, jsx_runtime_1.jsx)(FallbackComponent, {}), children: (0, jsx_runtime_1.jsx)(Comp, { ...defaultProps, ...inputProps }) }, String(i)));
|
|
21
|
+
}
|
|
22
|
+
// SVG should not support suspense
|
|
23
|
+
if (layer.type === 'svg') {
|
|
24
|
+
if ((0, get_environment_1.getRemotionEnvironment)() === 'rendering') {
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
27
|
+
return ((0, jsx_runtime_1.jsx)(AbsoluteFill_1.AbsoluteFill, { children: (0, jsx_runtime_1.jsx)(Comp, { ...defaultProps, ...inputProps }, String(i)) }));
|
|
28
|
+
}
|
|
29
|
+
if (layer.type === 'video') {
|
|
30
|
+
if ((0, get_environment_1.getRemotionEnvironment)() === 'rendering') {
|
|
31
|
+
return null;
|
|
32
|
+
}
|
|
33
|
+
// TODO: AbsoluteFill is different flex direction
|
|
34
|
+
return ((0, jsx_runtime_1.jsx)(AbsoluteFill_1.AbsoluteFill, { children: (0, jsx_runtime_1.jsx)(Comp, { ...defaultProps, ...inputProps }, String(i)) }));
|
|
35
|
+
}
|
|
36
|
+
throw new Error('Unknown layer type');
|
|
37
|
+
}) }));
|
|
38
|
+
};
|
|
39
|
+
exports.LayerMaster = LayerMaster;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { PropsWithChildren } from 'react';
|
|
2
|
+
export declare type ClipRegion = {
|
|
3
|
+
x: number;
|
|
4
|
+
y: number;
|
|
5
|
+
width: number;
|
|
6
|
+
height: number;
|
|
7
|
+
} | 'hide';
|
|
8
|
+
export declare type TNativeLayersContext = {
|
|
9
|
+
clipRegion: ClipRegion | null;
|
|
10
|
+
setClipRegion: React.Dispatch<React.SetStateAction<ClipRegion | null>>;
|
|
11
|
+
};
|
|
12
|
+
export declare const NativeLayersContext: import("react").Context<TNativeLayersContext>;
|
|
13
|
+
export declare const NativeLayersProvider: React.FC<PropsWithChildren>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NativeLayersProvider = exports.NativeLayersContext = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
exports.NativeLayersContext = (0, react_1.createContext)({
|
|
7
|
+
setClipRegion: () => {
|
|
8
|
+
throw new Error('NativeLayers not set');
|
|
9
|
+
},
|
|
10
|
+
clipRegion: null,
|
|
11
|
+
});
|
|
12
|
+
const NativeLayersProvider = ({ children, }) => {
|
|
13
|
+
const [clipRegion, setClipRegion] = (0, react_1.useState)(null);
|
|
14
|
+
const context = (0, react_1.useMemo)(() => {
|
|
15
|
+
return {
|
|
16
|
+
setClipRegion,
|
|
17
|
+
clipRegion,
|
|
18
|
+
};
|
|
19
|
+
}, [clipRegion, setClipRegion]);
|
|
20
|
+
(0, react_1.useLayoutEffect)(() => {
|
|
21
|
+
if (typeof window !== 'undefined') {
|
|
22
|
+
window.remotion_getClipRegion = () => {
|
|
23
|
+
return clipRegion;
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
}, [clipRegion, setClipRegion]);
|
|
27
|
+
return ((0, jsx_runtime_1.jsx)(exports.NativeLayersContext.Provider, { value: context, children: children }));
|
|
28
|
+
};
|
|
29
|
+
exports.NativeLayersProvider = NativeLayersProvider;
|
package/dist/Null.d.ts
ADDED
package/dist/Null.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Null = void 0;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const NativeLayers_1 = require("./NativeLayers");
|
|
6
|
+
const Null = () => {
|
|
7
|
+
const { setClipRegion } = (0, react_1.useContext)(NativeLayers_1.NativeLayersContext);
|
|
8
|
+
(0, react_1.useEffect)(() => {
|
|
9
|
+
setClipRegion((c) => {
|
|
10
|
+
if (c === null) {
|
|
11
|
+
return 'hide';
|
|
12
|
+
}
|
|
13
|
+
// Rendering multiple <Null> is fine, because they are all hidden
|
|
14
|
+
if (c === 'hide') {
|
|
15
|
+
return 'hide';
|
|
16
|
+
}
|
|
17
|
+
throw new Error('Cannot render <Null>, because another component clipping the region was already rendered (most likely <Clipper>)');
|
|
18
|
+
});
|
|
19
|
+
return () => {
|
|
20
|
+
setClipRegion(null);
|
|
21
|
+
};
|
|
22
|
+
}, [setClipRegion]);
|
|
23
|
+
return null;
|
|
24
|
+
};
|
|
25
|
+
exports.Null = Null;
|
package/dist/RemotionRoot.d.ts
CHANGED
package/dist/RemotionRoot.js
CHANGED
|
@@ -6,10 +6,13 @@ const react_1 = require("react");
|
|
|
6
6
|
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
|
+
const NativeLayers_1 = require("./NativeLayers");
|
|
9
10
|
const nonce_1 = require("./nonce");
|
|
11
|
+
const prefetch_state_1 = require("./prefetch-state");
|
|
10
12
|
const random_1 = require("./random");
|
|
11
13
|
const timeline_position_state_1 = require("./timeline-position-state");
|
|
12
|
-
const
|
|
14
|
+
const duration_state_1 = require("./video/duration-state");
|
|
15
|
+
const RemotionRoot = ({ children, numberOfAudioTags }) => {
|
|
13
16
|
var _a;
|
|
14
17
|
const [remotionRootId] = (0, react_1.useState)(() => String((0, random_1.random)(null)));
|
|
15
18
|
const [frame, setFrame] = (0, react_1.useState)((_a = window.remotion_initialFrame) !== null && _a !== void 0 ? _a : 0);
|
|
@@ -61,10 +64,10 @@ const RemotionRoot = ({ children }) => {
|
|
|
61
64
|
});
|
|
62
65
|
}
|
|
63
66
|
}, []);
|
|
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
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
67
|
+
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)(prefetch_state_1.PrefetchProvider, { children: (0, jsx_runtime_1.jsx)(NativeLayers_1.NativeLayersProvider, { children: (0, jsx_runtime_1.jsx)(CompositionManager_1.CompositionManagerProvider, { children: (0, jsx_runtime_1.jsx)(duration_state_1.DurationsContextProvider, { children: (0, jsx_runtime_1.jsx)(shared_audio_tags_1.SharedAudioContextProvider
|
|
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
|
+
, {
|
|
70
|
+
// 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.
|
|
71
|
+
numberOfAudioTags: numberOfAudioTags, children: children }) }) }) }) }) }) }) }));
|
|
69
72
|
};
|
|
70
73
|
exports.RemotionRoot = RemotionRoot;
|
|
@@ -7,13 +7,22 @@ export declare type SequenceContextType = {
|
|
|
7
7
|
id: string;
|
|
8
8
|
};
|
|
9
9
|
export declare const SequenceContext: React.Context<SequenceContextType | null>;
|
|
10
|
+
export 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
|
-
from
|
|
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>>;
|
|
@@ -3,25 +3,31 @@ 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 = 0, 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)();
|
|
23
|
+
const environment = (0, get_environment_1.useRemotionEnvironment)();
|
|
22
24
|
if (layout !== 'absolute-fill' && layout !== 'none') {
|
|
23
25
|
throw new TypeError(`The layout prop of <Sequence /> expects either "absolute-fill" or "none", but you passed: ${layout}`);
|
|
24
26
|
}
|
|
27
|
+
// @ts-expect-error
|
|
28
|
+
if (layout === 'none' && typeof other.style !== 'undefined') {
|
|
29
|
+
throw new TypeError('If layout="none", you may not pass a style.');
|
|
30
|
+
}
|
|
25
31
|
if (typeof durationInFrames !== 'number') {
|
|
26
32
|
throw new TypeError(`You passed to durationInFrames an argument of type ${typeof durationInFrames}, but it must be a number.`);
|
|
27
33
|
}
|
|
@@ -38,16 +44,12 @@ const Sequence = ({ from, durationInFrames = Infinity, children, name, layout =
|
|
|
38
44
|
if (from % 1 !== 0) {
|
|
39
45
|
throw new TypeError(`The "from" prop of a sequence must be an integer, but got ${from}.`);
|
|
40
46
|
}
|
|
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);
|
|
47
|
+
const absoluteFrame = (0, timeline_position_state_1.useTimelinePosition)();
|
|
48
|
+
const videoConfig = (0, use_video_config_1.useVideoConfig)();
|
|
49
|
+
const parentSequenceDuration = parentSequence
|
|
50
|
+
? Math.min(parentSequence.durationInFrames - from, durationInFrames)
|
|
51
|
+
: durationInFrames;
|
|
52
|
+
const actualDurationInFrames = Math.max(0, Math.min(videoConfig.durationInFrames - from, parentSequenceDuration));
|
|
51
53
|
const { registerSequence, unregisterSequence } = (0, react_1.useContext)(CompositionManager_1.CompositionManager);
|
|
52
54
|
const contextValue = (0, react_1.useMemo)(() => {
|
|
53
55
|
var _a;
|
|
@@ -70,6 +72,9 @@ const Sequence = ({ from, durationInFrames = Infinity, children, name, layout =
|
|
|
70
72
|
}, [children, name]);
|
|
71
73
|
(0, react_1.useEffect)(() => {
|
|
72
74
|
var _a;
|
|
75
|
+
if (environment !== 'preview') {
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
73
78
|
registerSequence({
|
|
74
79
|
from,
|
|
75
80
|
duration: actualDurationInFrames,
|
|
@@ -87,7 +92,6 @@ const Sequence = ({ from, durationInFrames = Infinity, children, name, layout =
|
|
|
87
92
|
};
|
|
88
93
|
}, [
|
|
89
94
|
durationInFrames,
|
|
90
|
-
actualFrom,
|
|
91
95
|
id,
|
|
92
96
|
name,
|
|
93
97
|
registerSequence,
|
|
@@ -100,24 +104,28 @@ const Sequence = ({ from, durationInFrames = Infinity, children, name, layout =
|
|
|
100
104
|
showInTimeline,
|
|
101
105
|
nonce,
|
|
102
106
|
showLoopTimesInTimeline,
|
|
107
|
+
environment,
|
|
103
108
|
]);
|
|
104
|
-
const endThreshold =
|
|
105
|
-
|
|
106
|
-
})();
|
|
107
|
-
const content = absoluteFrame < actualFrom
|
|
109
|
+
const endThreshold = cumulatedFrom + from + durationInFrames - 1;
|
|
110
|
+
const content = absoluteFrame < cumulatedFrom + from
|
|
108
111
|
? null
|
|
109
112
|
: absoluteFrame > endThreshold
|
|
110
113
|
? null
|
|
111
114
|
: children;
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
115
|
+
const styleIfThere = other.layout === 'none' ? undefined : other.style;
|
|
116
|
+
const defaultStyle = (0, react_1.useMemo)(() => {
|
|
117
|
+
return {
|
|
118
|
+
flexDirection: undefined,
|
|
119
|
+
...(styleIfThere !== null && styleIfThere !== void 0 ? styleIfThere : {}),
|
|
120
|
+
};
|
|
121
|
+
}, [styleIfThere]);
|
|
122
|
+
if (ref !== null && layout === 'none') {
|
|
123
|
+
throw new TypeError('It is not supported to pass both a `ref` and `layout="none"` to <Sequence />.');
|
|
124
|
+
}
|
|
125
|
+
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
126
|
};
|
|
123
|
-
|
|
127
|
+
/**
|
|
128
|
+
* A component that time-shifts its children and wraps them in an absolutely positioned <div>.
|
|
129
|
+
* @link https://www.remotion.dev/docs/sequence
|
|
130
|
+
*/
|
|
131
|
+
exports.Sequence = (0, react_1.forwardRef)(SequenceRefForwardingFunction);
|
package/dist/Still.d.ts
CHANGED
package/dist/Still.js
CHANGED
|
File without changes
|
package/dist/absolute-src.d.ts
CHANGED
|
File without changes
|
package/dist/absolute-src.js
CHANGED
|
File without changes
|
package/dist/asset-types.d.ts
CHANGED
package/dist/asset-types.js
CHANGED
|
File without changes
|
package/dist/audio/Audio.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { RemotionMainAudioProps } from './props';
|
|
3
|
-
export declare const Audio: React.ForwardRefExoticComponent<Pick<Omit<React.DetailedHTMLProps<React.AudioHTMLAttributes<HTMLAudioElement>, HTMLAudioElement>, "onEnded" | "
|
|
2
|
+
import type { RemotionMainAudioProps } from './props';
|
|
3
|
+
export declare const Audio: React.ForwardRefExoticComponent<Pick<Omit<React.DetailedHTMLProps<React.AudioHTMLAttributes<HTMLAudioElement>, HTMLAudioElement>, "nonce" | "onEnded" | "onResize" | "onResizeCapture" | "autoPlay" | "controls"> & {
|
|
4
4
|
volume?: import("../volume-prop").VolumeProp | undefined;
|
|
5
5
|
playbackRate?: number | undefined;
|
|
6
|
-
|
|
6
|
+
acceptableTimeShiftInSeconds?: number | undefined;
|
|
7
|
+
allowAmplificationDuringRender?: boolean | undefined;
|
|
8
|
+
} & RemotionMainAudioProps, "id" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "lang" | "placeholder" | "slot" | "spellCheck" | "style" | "tabIndex" | "title" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "src" | "volume" | "playbackRate" | "allowAmplificationDuringRender" | "controlsList" | "crossOrigin" | "loop" | "mediaGroup" | "muted" | "playsInline" | "preload" | "acceptableTimeShiftInSeconds" | keyof RemotionMainAudioProps> & React.RefAttributes<HTMLAudioElement>>;
|
package/dist/audio/Audio.js
CHANGED
|
@@ -4,29 +4,49 @@ exports.Audio = void 0;
|
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const get_environment_1 = require("../get-environment");
|
|
7
|
-
const
|
|
7
|
+
const loop_1 = require("../loop");
|
|
8
|
+
const Sequence_1 = require("../Sequence");
|
|
9
|
+
const use_video_config_1 = require("../use-video-config");
|
|
8
10
|
const validate_media_props_1 = require("../validate-media-props");
|
|
9
11
|
const validate_start_from_props_1 = require("../validate-start-from-props");
|
|
12
|
+
const duration_state_1 = require("../video/duration-state");
|
|
10
13
|
const AudioForDevelopment_1 = require("./AudioForDevelopment");
|
|
11
14
|
const AudioForRendering_1 = require("./AudioForRendering");
|
|
12
15
|
const shared_audio_tags_1 = require("./shared-audio-tags");
|
|
13
16
|
const AudioRefForwardingFunction = (props, ref) => {
|
|
17
|
+
var _a;
|
|
14
18
|
const audioContext = (0, react_1.useContext)(shared_audio_tags_1.SharedAudioContext);
|
|
15
19
|
const { startFrom, endAt, ...otherProps } = props;
|
|
20
|
+
const { loop, ...propsOtherThanLoop } = props;
|
|
21
|
+
const { fps } = (0, use_video_config_1.useVideoConfig)();
|
|
22
|
+
const environment = (0, get_environment_1.useRemotionEnvironment)();
|
|
23
|
+
const { durations, setDurations } = (0, react_1.useContext)(duration_state_1.DurationsContext);
|
|
24
|
+
if (typeof props.src !== 'string') {
|
|
25
|
+
throw new TypeError(`The \`<Audio>\` tag requires a string for \`src\`, but got ${JSON.stringify(props.src)} instead.`);
|
|
26
|
+
}
|
|
16
27
|
const onError = (0, react_1.useCallback)((e) => {
|
|
17
28
|
console.log(e.currentTarget.error);
|
|
18
|
-
throw new Error(`Could not play audio with src ${otherProps.src}: ${e.currentTarget.error}
|
|
29
|
+
throw new Error(`Could not play audio with src ${otherProps.src}: ${e.currentTarget.error}. See https://remotion.dev/docs/media-playback-error for help.`);
|
|
19
30
|
}, [otherProps.src]);
|
|
31
|
+
const onDuration = (0, react_1.useCallback)((src, durationInSeconds) => {
|
|
32
|
+
setDurations({ type: 'got-duration', durationInSeconds, src });
|
|
33
|
+
}, [setDurations]);
|
|
34
|
+
if (loop && props.src && durations[props.src] !== undefined) {
|
|
35
|
+
const duration = Math.floor(durations[props.src] * fps);
|
|
36
|
+
const playbackRate = (_a = props.playbackRate) !== null && _a !== void 0 ? _a : 1;
|
|
37
|
+
const actualDuration = duration / playbackRate;
|
|
38
|
+
return ((0, jsx_runtime_1.jsx)(loop_1.Loop, { layout: "none", durationInFrames: Math.floor(actualDuration), children: (0, jsx_runtime_1.jsx)(exports.Audio, { ...propsOtherThanLoop, ref: ref }) }));
|
|
39
|
+
}
|
|
20
40
|
if (typeof startFrom !== 'undefined' || typeof endAt !== 'undefined') {
|
|
21
41
|
(0, validate_start_from_props_1.validateStartFromProps)(startFrom, endAt);
|
|
22
42
|
const startFromFrameNo = startFrom !== null && startFrom !== void 0 ? startFrom : 0;
|
|
23
43
|
const endAtFrameNo = endAt !== null && endAt !== void 0 ? endAt : Infinity;
|
|
24
|
-
return ((0, jsx_runtime_1.jsx)(
|
|
44
|
+
return ((0, jsx_runtime_1.jsx)(Sequence_1.Sequence, { layout: "none", from: 0 - startFromFrameNo, showInTimeline: false, durationInFrames: endAtFrameNo, children: (0, jsx_runtime_1.jsx)(exports.Audio, { ...otherProps, ref: ref }) }));
|
|
25
45
|
}
|
|
26
46
|
(0, validate_media_props_1.validateMediaProps)(props, 'Audio');
|
|
27
|
-
if (
|
|
28
|
-
return (0, jsx_runtime_1.jsx)(AudioForRendering_1.AudioForRendering, { ...props, ref: ref, onError: onError });
|
|
47
|
+
if (environment === 'rendering') {
|
|
48
|
+
return ((0, jsx_runtime_1.jsx)(AudioForRendering_1.AudioForRendering, { onDuration: onDuration, ...props, ref: ref, onError: onError }));
|
|
29
49
|
}
|
|
30
|
-
return ((0, jsx_runtime_1.jsx)(AudioForDevelopment_1.AudioForDevelopment, { shouldPreMountAudioTags: audioContext !== null && audioContext.numberOfAudioTags > 0, ...props, ref: ref, onError: onError }));
|
|
50
|
+
return ((0, jsx_runtime_1.jsx)(AudioForDevelopment_1.AudioForDevelopment, { shouldPreMountAudioTags: audioContext !== null && audioContext.numberOfAudioTags > 0, ...props, ref: ref, onError: onError, onDuration: onDuration }));
|
|
31
51
|
};
|
|
32
52
|
exports.Audio = (0, react_1.forwardRef)(AudioRefForwardingFunction);
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
+
import type { ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
1
2
|
import React from 'react';
|
|
2
|
-
export declare const AudioForDevelopment:
|
|
3
|
+
export declare const AudioForDevelopment: ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.AudioHTMLAttributes<HTMLAudioElement>, HTMLAudioElement>, "nonce" | "onEnded" | "onResize" | "onResizeCapture" | "autoPlay" | "controls"> & {
|
|
3
4
|
volume?: import("../volume-prop").VolumeProp | undefined;
|
|
4
5
|
playbackRate?: number | undefined;
|
|
6
|
+
acceptableTimeShiftInSeconds?: number | undefined;
|
|
7
|
+
allowAmplificationDuringRender?: boolean | undefined;
|
|
5
8
|
} & {
|
|
6
9
|
shouldPreMountAudioTags: boolean;
|
|
7
|
-
|
|
10
|
+
onDuration: (src: string, durationInSeconds: number) => void;
|
|
11
|
+
} & RefAttributes<HTMLAudioElement>>;
|
|
@@ -3,6 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.AudioForDevelopment = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
|
+
const prefetch_1 = require("../prefetch");
|
|
7
|
+
const random_1 = require("../random");
|
|
8
|
+
const Sequence_1 = require("../Sequence");
|
|
6
9
|
const use_media_in_timeline_1 = require("../use-media-in-timeline");
|
|
7
10
|
const use_media_playback_1 = require("../use-media-playback");
|
|
8
11
|
const use_media_tag_volume_1 = require("../use-media-tag-volume");
|
|
@@ -18,14 +21,23 @@ const AudioForDevelopmentForwardRefFunction = (props, ref) => {
|
|
|
18
21
|
const [mediaVolume] = (0, volume_position_state_1.useMediaVolumeState)();
|
|
19
22
|
const [mediaMuted] = (0, volume_position_state_1.useMediaMutedState)();
|
|
20
23
|
const volumePropFrame = (0, use_audio_frame_1.useFrameForVolumeProp)();
|
|
21
|
-
const { volume, muted, playbackRate, shouldPreMountAudioTags, ...nativeProps } = props;
|
|
24
|
+
const { volume, muted, playbackRate, shouldPreMountAudioTags, src, onDuration, acceptableTimeShiftInSeconds, ...nativeProps } = props;
|
|
25
|
+
if (!src) {
|
|
26
|
+
throw new TypeError("No 'src' was passed to <Audio>.");
|
|
27
|
+
}
|
|
28
|
+
const preloadedSrc = (0, prefetch_1.usePreload)(src);
|
|
22
29
|
const propsToPass = (0, react_1.useMemo)(() => {
|
|
23
30
|
return {
|
|
24
31
|
muted: muted || mediaMuted,
|
|
32
|
+
src: preloadedSrc,
|
|
25
33
|
...nativeProps,
|
|
26
34
|
};
|
|
27
|
-
}, [mediaMuted, muted, nativeProps]);
|
|
28
|
-
const
|
|
35
|
+
}, [mediaMuted, muted, nativeProps, preloadedSrc]);
|
|
36
|
+
const sequenceContext = (0, react_1.useContext)(Sequence_1.SequenceContext);
|
|
37
|
+
// Generate a string that's as unique as possible for this asset
|
|
38
|
+
// but at the same time deterministic. We use it to combat strict mode issues.
|
|
39
|
+
const id = (0, react_1.useMemo)(() => `audio-${(0, random_1.random)(src !== null && src !== void 0 ? src : '')}-${sequenceContext === null || sequenceContext === void 0 ? void 0 : sequenceContext.relativeFrom}-${sequenceContext === null || sequenceContext === void 0 ? void 0 : sequenceContext.cumulatedFrom}-${sequenceContext === null || sequenceContext === void 0 ? void 0 : sequenceContext.durationInFrames}-muted:${props.muted}`, [props.muted, src, sequenceContext]);
|
|
40
|
+
const audioRef = (0, shared_audio_tags_1.useSharedAudio)(propsToPass, id).el;
|
|
29
41
|
const actualVolume = (0, use_media_tag_volume_1.useMediaTagVolume)(audioRef);
|
|
30
42
|
(0, use_sync_volume_with_media_tag_1.useSyncVolumeWithMediaTag)({
|
|
31
43
|
volumePropFrame,
|
|
@@ -38,18 +50,42 @@ const AudioForDevelopmentForwardRefFunction = (props, ref) => {
|
|
|
38
50
|
volume,
|
|
39
51
|
mediaVolume,
|
|
40
52
|
mediaRef: audioRef,
|
|
41
|
-
src
|
|
53
|
+
src,
|
|
42
54
|
mediaType: 'audio',
|
|
55
|
+
playbackRate: playbackRate !== null && playbackRate !== void 0 ? playbackRate : 1,
|
|
43
56
|
});
|
|
44
57
|
(0, use_media_playback_1.useMediaPlayback)({
|
|
45
58
|
mediaRef: audioRef,
|
|
46
|
-
src
|
|
59
|
+
src,
|
|
47
60
|
mediaType: 'audio',
|
|
48
61
|
playbackRate: playbackRate !== null && playbackRate !== void 0 ? playbackRate : 1,
|
|
62
|
+
onlyWarnForMediaSeekingError: false,
|
|
63
|
+
acceptableTimeshift: acceptableTimeShiftInSeconds !== null && acceptableTimeShiftInSeconds !== void 0 ? acceptableTimeShiftInSeconds : use_media_playback_1.DEFAULT_ACCEPTABLE_TIMESHIFT,
|
|
49
64
|
});
|
|
50
65
|
(0, react_1.useImperativeHandle)(ref, () => {
|
|
51
66
|
return audioRef.current;
|
|
52
|
-
});
|
|
67
|
+
}, [audioRef]);
|
|
68
|
+
const currentOnDurationCallback = (0, react_1.useRef)();
|
|
69
|
+
currentOnDurationCallback.current = onDuration;
|
|
70
|
+
(0, react_1.useEffect)(() => {
|
|
71
|
+
var _a;
|
|
72
|
+
const { current } = audioRef;
|
|
73
|
+
if (!current) {
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
if (current.duration) {
|
|
77
|
+
(_a = currentOnDurationCallback.current) === null || _a === void 0 ? void 0 : _a.call(currentOnDurationCallback, src, current.duration);
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
const onLoadedMetadata = () => {
|
|
81
|
+
var _a;
|
|
82
|
+
(_a = currentOnDurationCallback.current) === null || _a === void 0 ? void 0 : _a.call(currentOnDurationCallback, src, current.duration);
|
|
83
|
+
};
|
|
84
|
+
current.addEventListener('loadedmetadata', onLoadedMetadata);
|
|
85
|
+
return () => {
|
|
86
|
+
current.removeEventListener('loadedmetadata', onLoadedMetadata);
|
|
87
|
+
};
|
|
88
|
+
}, [audioRef, src]);
|
|
53
89
|
if (initialShouldPreMountAudioElements) {
|
|
54
90
|
return null;
|
|
55
91
|
}
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
import type { ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
1
2
|
import React from 'react';
|
|
2
|
-
|
|
3
|
-
|
|
3
|
+
export declare const AudioForRendering: ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.AudioHTMLAttributes<HTMLAudioElement>, HTMLAudioElement>, "nonce" | "onEnded" | "onResize" | "onResizeCapture" | "autoPlay" | "controls"> & {
|
|
4
|
+
volume?: import("../volume-prop").VolumeProp | undefined;
|
|
5
|
+
playbackRate?: number | undefined;
|
|
6
|
+
acceptableTimeShiftInSeconds?: number | undefined;
|
|
7
|
+
allowAmplificationDuringRender?: boolean | undefined;
|
|
8
|
+
} & {
|
|
9
|
+
onDuration: (src: string, durationInSeconds: number) => void;
|
|
10
|
+
} & RefAttributes<HTMLAudioElement>>;
|