remotion 4.0.0-lambda.1 → 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 +2 -2
- package/dist/AbsoluteFill.js +7 -7
- 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 -1
- package/dist/Composition.js +34 -10
- package/dist/CompositionManager.d.ts +9 -8
- package/dist/CompositionManager.js +9 -3
- package/dist/Folder.d.ts +1 -1
- package/dist/Folder.js +0 -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/Sequence.d.ts +13 -4
- package/dist/Sequence.js +38 -30
- 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 +24 -4
- 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 +48 -5
- 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 +0 -0
- 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 +0 -0
- package/dist/freeze.js +0 -0
- 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 +33 -5
- package/dist/index.js +18 -3
- package/dist/internals.d.ts +50 -101
- package/dist/internals.js +16 -91
- package/dist/interpolate-colors.d.ts +0 -0
- package/dist/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 +4 -2
- 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-current-frame.d.ts +0 -1
- package/dist/use-current-frame.js +10 -7
- 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 +13 -6
- package/dist/use-media-playback.d.ts +5 -2
- package/dist/use-media-playback.js +11 -6
- 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 +0 -0
- 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 +10 -2
- package/dist/video/OffthreadVideoForRendering.d.ts +1 -1
- package/dist/video/OffthreadVideoForRendering.js +24 -13
- package/dist/video/Video.d.ts +5 -3
- package/dist/video/Video.js +25 -4
- 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 +80 -23
- 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 +5 -0
- package/dist/wrap-remotion-context.js +13 -1
- 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 +0 -5
- package/dist/interpolateColors.d.ts.map +0 -1
- package/dist/interpolateColors.js +0 -401
- 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 +0 -19
- package/dist/sequencing/index.d.ts.map +0 -1
- package/dist/sequencing/index.js +0 -123
- 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 +0 -7
- 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,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.validateSpringDuration = void 0;
|
|
4
|
+
const validateSpringDuration = (dur) => {
|
|
5
|
+
if (typeof dur === 'undefined') {
|
|
6
|
+
return;
|
|
7
|
+
}
|
|
8
|
+
if (typeof dur !== 'number') {
|
|
9
|
+
throw new TypeError(`A "duration" of a spring must be a "number" but is "${typeof dur}"`);
|
|
10
|
+
}
|
|
11
|
+
if (Number.isNaN(dur)) {
|
|
12
|
+
throw new TypeError('A "duration" of a spring is NaN, which it must not be');
|
|
13
|
+
}
|
|
14
|
+
if (!Number.isFinite(dur)) {
|
|
15
|
+
throw new TypeError('A "duration" of a spring must be finite, but is ' + dur);
|
|
16
|
+
}
|
|
17
|
+
if (dur <= 0) {
|
|
18
|
+
throw new TypeError('A "duration" of a spring must be positive, but is ' + dur);
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
exports.validateSpringDuration = validateSpringDuration;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const VERSION = "4.0.0-newpathfunctions.13+40cc970bd";
|
package/dist/version.js
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NativeVideo = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const get_environment_1 = require("../get-environment");
|
|
7
|
+
const Sequence_1 = require("../Sequence");
|
|
8
|
+
const validate_media_props_1 = require("../validate-media-props");
|
|
9
|
+
const validate_start_from_props_1 = require("../validate-start-from-props");
|
|
10
|
+
const NativeVideoForRendering_1 = require("./NativeVideoForRendering");
|
|
11
|
+
const VideoForDevelopment_1 = require("./VideoForDevelopment");
|
|
12
|
+
const NativeVideo = (props) => {
|
|
13
|
+
const { startFrom, endAt, ...otherProps } = props;
|
|
14
|
+
const onDuration = (0, react_1.useCallback)(() => undefined, []);
|
|
15
|
+
if (typeof props.src !== 'string') {
|
|
16
|
+
throw new TypeError(`The \`<NativeVideo>\` tag requires a string for \`src\`, but got ${JSON.stringify(props.src)} instead.`);
|
|
17
|
+
}
|
|
18
|
+
if (typeof startFrom !== 'undefined' || typeof endAt !== 'undefined') {
|
|
19
|
+
(0, validate_start_from_props_1.validateStartFromProps)(startFrom, endAt);
|
|
20
|
+
const startFromFrameNo = startFrom !== null && startFrom !== void 0 ? startFrom : 0;
|
|
21
|
+
const endAtFrameNo = endAt !== null && endAt !== void 0 ? endAt : Infinity;
|
|
22
|
+
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.NativeVideo, { ...otherProps }) }));
|
|
23
|
+
}
|
|
24
|
+
(0, validate_media_props_1.validateMediaProps)(props, 'Video');
|
|
25
|
+
if ((0, get_environment_1.getRemotionEnvironment)() === 'rendering') {
|
|
26
|
+
throw new Error('Cannot render in the browser');
|
|
27
|
+
}
|
|
28
|
+
if ((0, get_environment_1.getRemotionEnvironment)() === 'server-rendering') {
|
|
29
|
+
return (0, jsx_runtime_1.jsx)(NativeVideoForRendering_1.NativeVideoForRendering, { ...otherProps });
|
|
30
|
+
}
|
|
31
|
+
return ((0, jsx_runtime_1.jsx)(VideoForDevelopment_1.VideoForDevelopment, { onDuration: onDuration, onlyWarnForMediaSeekingError: true, ...otherProps }));
|
|
32
|
+
};
|
|
33
|
+
exports.NativeVideo = NativeVideo;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NativeVideoForRendering = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const use_current_frame_1 = require("../use-current-frame");
|
|
6
|
+
const NativeVideoForRendering = ({ src }) => {
|
|
7
|
+
const frame = (0, use_current_frame_1.useCurrentFrame)();
|
|
8
|
+
return ((0, jsx_runtime_1.jsx)("div", {
|
|
9
|
+
// eslint-disable-next-line react/no-danger
|
|
10
|
+
dangerouslySetInnerHTML: {
|
|
11
|
+
__html: JSON.stringify({ src, frame }),
|
|
12
|
+
} }));
|
|
13
|
+
};
|
|
14
|
+
exports.NativeVideoForRendering = NativeVideoForRendering;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { OffthreadVideoProps, RemotionMainVideoProps } from './props';
|
|
3
|
-
export declare const OffthreadVideo: React.FC<OffthreadVideoProps & RemotionMainVideoProps
|
|
2
|
+
import type { OffthreadVideoProps, RemotionMainVideoProps } from './props';
|
|
3
|
+
export declare const OffthreadVideo: React.FC<Omit<OffthreadVideoProps & RemotionMainVideoProps, 'loop'>>;
|
|
@@ -2,14 +2,21 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.OffthreadVideo = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
5
6
|
const get_environment_1 = require("../get-environment");
|
|
6
7
|
const Sequence_1 = require("../Sequence");
|
|
7
8
|
const validate_media_props_1 = require("../validate-media-props");
|
|
8
9
|
const validate_start_from_props_1 = require("../validate-start-from-props");
|
|
10
|
+
const validate_offthreadvideo_image_format_1 = require("../validation/validate-offthreadvideo-image-format");
|
|
9
11
|
const OffthreadVideoForRendering_1 = require("./OffthreadVideoForRendering");
|
|
10
12
|
const VideoForDevelopment_1 = require("./VideoForDevelopment");
|
|
11
13
|
const OffthreadVideo = (props) => {
|
|
12
14
|
const { startFrom, endAt, ...otherProps } = props;
|
|
15
|
+
const environment = (0, get_environment_1.useRemotionEnvironment)();
|
|
16
|
+
const onDuration = (0, react_1.useCallback)(() => undefined, []);
|
|
17
|
+
if (typeof props.src !== 'string') {
|
|
18
|
+
throw new TypeError(`The \`<OffthreadVideo>\` tag requires a string for \`src\`, but got ${JSON.stringify(props.src)} instead.`);
|
|
19
|
+
}
|
|
13
20
|
if (typeof startFrom !== 'undefined' || typeof endAt !== 'undefined') {
|
|
14
21
|
(0, validate_start_from_props_1.validateStartFromProps)(startFrom, endAt);
|
|
15
22
|
const startFromFrameNo = startFrom !== null && startFrom !== void 0 ? startFrom : 0;
|
|
@@ -17,9 +24,10 @@ const OffthreadVideo = (props) => {
|
|
|
17
24
|
return ((0, jsx_runtime_1.jsx)(Sequence_1.Sequence, { layout: "none", from: 0 - startFromFrameNo, showInTimeline: false, durationInFrames: endAtFrameNo, children: (0, jsx_runtime_1.jsx)(exports.OffthreadVideo, { ...otherProps }) }));
|
|
18
25
|
}
|
|
19
26
|
(0, validate_media_props_1.validateMediaProps)(props, 'Video');
|
|
20
|
-
|
|
27
|
+
(0, validate_offthreadvideo_image_format_1.validateOffthreadVideoImageFormat)(props.imageFormat);
|
|
28
|
+
if (environment === 'rendering') {
|
|
21
29
|
return (0, jsx_runtime_1.jsx)(OffthreadVideoForRendering_1.OffthreadVideoForRendering, { ...otherProps });
|
|
22
30
|
}
|
|
23
|
-
return (0, jsx_runtime_1.jsx)(VideoForDevelopment_1.VideoForDevelopment, { ...otherProps });
|
|
31
|
+
return ((0, jsx_runtime_1.jsx)(VideoForDevelopment_1.VideoForDevelopment, { onDuration: onDuration, onlyWarnForMediaSeekingError: true, ...otherProps }));
|
|
24
32
|
};
|
|
25
33
|
exports.OffthreadVideo = OffthreadVideo;
|
|
@@ -6,15 +6,19 @@ const react_1 = require("react");
|
|
|
6
6
|
const absolute_src_1 = require("../absolute-src");
|
|
7
7
|
const use_audio_frame_1 = require("../audio/use-audio-frame");
|
|
8
8
|
const CompositionManager_1 = require("../CompositionManager");
|
|
9
|
+
const default_css_1 = require("../default-css");
|
|
9
10
|
const Img_1 = require("../Img");
|
|
11
|
+
const internals_1 = require("../internals");
|
|
10
12
|
const random_1 = require("../random");
|
|
11
13
|
const Sequence_1 = require("../Sequence");
|
|
14
|
+
const timeline_position_state_1 = require("../timeline-position-state");
|
|
12
15
|
const use_current_frame_1 = require("../use-current-frame");
|
|
13
16
|
const use_unsafe_video_config_1 = require("../use-unsafe-video-config");
|
|
14
17
|
const volume_prop_1 = require("../volume-prop");
|
|
15
18
|
const get_current_time_1 = require("./get-current-time");
|
|
16
|
-
const
|
|
17
|
-
|
|
19
|
+
const DEFAULT_IMAGE_FORMAT = 'jpeg';
|
|
20
|
+
const OffthreadVideoForRendering = ({ onError, volume: volumeProp, playbackRate, src, muted, imageFormat, allowAmplificationDuringRender, ...props }) => {
|
|
21
|
+
const absoluteFrame = (0, timeline_position_state_1.useTimelinePosition)();
|
|
18
22
|
const frame = (0, use_current_frame_1.useCurrentFrame)();
|
|
19
23
|
const volumePropsFrame = (0, use_audio_frame_1.useFrameForVolumeProp)();
|
|
20
24
|
const videoConfig = (0, use_unsafe_video_config_1.useUnsafeVideoConfig)();
|
|
@@ -26,9 +30,8 @@ const OffthreadVideoForRendering = ({ onError, volume: volumeProp, playbackRate,
|
|
|
26
30
|
}
|
|
27
31
|
// Generate a string that's as unique as possible for this asset
|
|
28
32
|
// but at the same time the same on all threads
|
|
29
|
-
const id = (0, react_1.useMemo)(() => `
|
|
33
|
+
const id = (0, react_1.useMemo)(() => `offthreadvideo-${(0, random_1.random)(src !== null && src !== void 0 ? src : '')}-${sequenceContext === null || sequenceContext === void 0 ? void 0 : sequenceContext.cumulatedFrom}-${sequenceContext === null || sequenceContext === void 0 ? void 0 : sequenceContext.relativeFrom}-${sequenceContext === null || sequenceContext === void 0 ? void 0 : sequenceContext.durationInFrames}`, [
|
|
30
34
|
src,
|
|
31
|
-
muted,
|
|
32
35
|
sequenceContext === null || sequenceContext === void 0 ? void 0 : sequenceContext.cumulatedFrom,
|
|
33
36
|
sequenceContext === null || sequenceContext === void 0 ? void 0 : sequenceContext.relativeFrom,
|
|
34
37
|
sequenceContext === null || sequenceContext === void 0 ? void 0 : sequenceContext.durationInFrames,
|
|
@@ -40,14 +43,21 @@ const OffthreadVideoForRendering = ({ onError, volume: volumeProp, playbackRate,
|
|
|
40
43
|
volume: volumeProp,
|
|
41
44
|
frame: volumePropsFrame,
|
|
42
45
|
mediaVolume: 1,
|
|
46
|
+
allowAmplificationDuringRender: allowAmplificationDuringRender !== null && allowAmplificationDuringRender !== void 0 ? allowAmplificationDuringRender : false,
|
|
43
47
|
});
|
|
44
48
|
(0, react_1.useEffect)(() => {
|
|
45
49
|
if (!src) {
|
|
46
50
|
throw new Error('No src passed');
|
|
47
51
|
}
|
|
52
|
+
if (!window.remotion_videoEnabled) {
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
48
55
|
if (muted) {
|
|
49
56
|
return;
|
|
50
57
|
}
|
|
58
|
+
if (volume <= 0) {
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
51
61
|
registerAsset({
|
|
52
62
|
type: 'video',
|
|
53
63
|
src: (0, absolute_src_1.getAbsoluteSrc)(src),
|
|
@@ -56,6 +66,7 @@ const OffthreadVideoForRendering = ({ onError, volume: volumeProp, playbackRate,
|
|
|
56
66
|
volume,
|
|
57
67
|
mediaFrame: frame,
|
|
58
68
|
playbackRate: playbackRate !== null && playbackRate !== void 0 ? playbackRate : 1,
|
|
69
|
+
allowAmplificationDuringRender: allowAmplificationDuringRender !== null && allowAmplificationDuringRender !== void 0 ? allowAmplificationDuringRender : false,
|
|
59
70
|
});
|
|
60
71
|
return () => unregisterAsset(id);
|
|
61
72
|
}, [
|
|
@@ -68,6 +79,7 @@ const OffthreadVideoForRendering = ({ onError, volume: volumeProp, playbackRate,
|
|
|
68
79
|
frame,
|
|
69
80
|
absoluteFrame,
|
|
70
81
|
playbackRate,
|
|
82
|
+
allowAmplificationDuringRender,
|
|
71
83
|
]);
|
|
72
84
|
const currentTime = (0, react_1.useMemo)(() => {
|
|
73
85
|
return ((0, get_current_time_1.getExpectedMediaFrameUncorrected)({
|
|
@@ -77,17 +89,16 @@ const OffthreadVideoForRendering = ({ onError, volume: volumeProp, playbackRate,
|
|
|
77
89
|
}) / videoConfig.fps);
|
|
78
90
|
}, [frame, mediaStartsAt, playbackRate, videoConfig.fps]);
|
|
79
91
|
const actualSrc = (0, react_1.useMemo)(() => {
|
|
80
|
-
return `http://localhost:${window.remotion_proxyPort}/proxy?src=${encodeURIComponent((0, absolute_src_1.getAbsoluteSrc)(src))}&time=${encodeURIComponent(currentTime)}`;
|
|
81
|
-
}, [currentTime, src]);
|
|
92
|
+
return `http://localhost:${window.remotion_proxyPort}/proxy?src=${encodeURIComponent((0, absolute_src_1.getAbsoluteSrc)(src))}&time=${encodeURIComponent(currentTime)}&imageFormat=${imageFormat !== null && imageFormat !== void 0 ? imageFormat : DEFAULT_IMAGE_FORMAT}`;
|
|
93
|
+
}, [currentTime, imageFormat, src]);
|
|
82
94
|
const onErr = (0, react_1.useCallback)((e) => {
|
|
83
95
|
onError === null || onError === void 0 ? void 0 : onError(e);
|
|
84
96
|
}, [onError]);
|
|
85
|
-
const
|
|
86
|
-
return
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
return (0, jsx_runtime_1.jsx)(Img_1.Img, { src: actualSrc, style: actualStyle, ...props, onError: onErr });
|
|
97
|
+
const className = (0, react_1.useMemo)(() => {
|
|
98
|
+
return [default_css_1.OFFTHREAD_VIDEO_CLASS_NAME, props.className]
|
|
99
|
+
.filter(internals_1.Internals.truthy)
|
|
100
|
+
.join(' ');
|
|
101
|
+
}, [props.className]);
|
|
102
|
+
return ((0, jsx_runtime_1.jsx)(Img_1.Img, { src: actualSrc, className: className, ...props, onError: onErr }));
|
|
92
103
|
};
|
|
93
104
|
exports.OffthreadVideoForRendering = OffthreadVideoForRendering;
|
package/dist/video/Video.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { RemotionMainVideoProps } from './props';
|
|
3
|
-
export declare const Video:
|
|
2
|
+
import type { RemotionMainVideoProps } from './props';
|
|
3
|
+
export declare const Video: (props: Omit<React.DetailedHTMLProps<React.VideoHTMLAttributes<HTMLVideoElement>, HTMLVideoElement>, "nonce" | "onEnded" | "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
|
+
} & RemotionMainVideoProps & React.RefAttributes<HTMLVideoElement | null>) => React.ReactElement | null;
|
package/dist/video/Video.js
CHANGED
|
@@ -4,16 +4,36 @@ exports.Video = 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 loop_1 = require("../loop");
|
|
7
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("./duration-state");
|
|
10
13
|
const VideoForDevelopment_1 = require("./VideoForDevelopment");
|
|
11
14
|
const VideoForRendering_1 = require("./VideoForRendering");
|
|
12
15
|
const VideoForwardingFunction = (props, ref) => {
|
|
16
|
+
var _a;
|
|
13
17
|
const { startFrom, endAt, ...otherProps } = props;
|
|
18
|
+
const { loop, ...propsOtherThanLoop } = props;
|
|
19
|
+
const { fps } = (0, use_video_config_1.useVideoConfig)();
|
|
20
|
+
const environment = (0, get_environment_1.useRemotionEnvironment)();
|
|
21
|
+
const { durations, setDurations } = (0, react_1.useContext)(duration_state_1.DurationsContext);
|
|
14
22
|
if (typeof ref === 'string') {
|
|
15
23
|
throw new Error('string refs are not supported');
|
|
16
24
|
}
|
|
25
|
+
if (typeof props.src !== 'string') {
|
|
26
|
+
throw new TypeError(`The \`<Video>\` tag requires a string for \`src\`, but got ${JSON.stringify(props.src)} instead.`);
|
|
27
|
+
}
|
|
28
|
+
const onDuration = (0, react_1.useCallback)((src, durationInSeconds) => {
|
|
29
|
+
setDurations({ type: 'got-duration', durationInSeconds, src });
|
|
30
|
+
}, [setDurations]);
|
|
31
|
+
if (loop && props.src && durations[props.src] !== undefined) {
|
|
32
|
+
const naturalDuration = durations[props.src] * fps;
|
|
33
|
+
const playbackRate = (_a = props.playbackRate) !== null && _a !== void 0 ? _a : 1;
|
|
34
|
+
const durationInFrames = Math.floor(naturalDuration / playbackRate);
|
|
35
|
+
return ((0, jsx_runtime_1.jsx)(loop_1.Loop, { durationInFrames: durationInFrames, children: (0, jsx_runtime_1.jsx)(exports.Video, { ...propsOtherThanLoop, ref: ref }) }));
|
|
36
|
+
}
|
|
17
37
|
if (typeof startFrom !== 'undefined' || typeof endAt !== 'undefined') {
|
|
18
38
|
(0, validate_start_from_props_1.validateStartFromProps)(startFrom, endAt);
|
|
19
39
|
const startFromFrameNo = startFrom !== null && startFrom !== void 0 ? startFrom : 0;
|
|
@@ -21,9 +41,10 @@ const VideoForwardingFunction = (props, ref) => {
|
|
|
21
41
|
return ((0, jsx_runtime_1.jsx)(Sequence_1.Sequence, { layout: "none", from: 0 - startFromFrameNo, showInTimeline: false, durationInFrames: endAtFrameNo, children: (0, jsx_runtime_1.jsx)(exports.Video, { ...otherProps, ref: ref }) }));
|
|
22
42
|
}
|
|
23
43
|
(0, validate_media_props_1.validateMediaProps)(props, 'Video');
|
|
24
|
-
if (
|
|
25
|
-
return (0, jsx_runtime_1.jsx)(VideoForRendering_1.VideoForRendering, { ...otherProps, ref: ref });
|
|
44
|
+
if (environment === 'rendering') {
|
|
45
|
+
return ((0, jsx_runtime_1.jsx)(VideoForRendering_1.VideoForRendering, { onDuration: onDuration, ...otherProps, ref: ref }));
|
|
26
46
|
}
|
|
27
|
-
return (0, jsx_runtime_1.jsx)(VideoForDevelopment_1.VideoForDevelopment, { ...otherProps, ref: ref });
|
|
47
|
+
return ((0, jsx_runtime_1.jsx)(VideoForDevelopment_1.VideoForDevelopment, { onlyWarnForMediaSeekingError: false, ...otherProps, ref: ref, onDuration: onDuration }));
|
|
28
48
|
};
|
|
29
|
-
|
|
49
|
+
const forward = react_1.forwardRef;
|
|
50
|
+
exports.Video = forward(VideoForwardingFunction);
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
import type { ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
1
2
|
import React from 'react';
|
|
2
|
-
|
|
3
|
-
|
|
3
|
+
export declare const VideoForDevelopment: ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.VideoHTMLAttributes<HTMLVideoElement>, HTMLVideoElement>, "nonce" | "onEnded" | "autoPlay" | "controls"> & {
|
|
4
|
+
volume?: import("../volume-prop").VolumeProp | undefined;
|
|
5
|
+
playbackRate?: number | undefined;
|
|
6
|
+
acceptableTimeShiftInSeconds?: number | undefined;
|
|
7
|
+
allowAmplificationDuringRender?: boolean | undefined;
|
|
8
|
+
} & {
|
|
9
|
+
onlyWarnForMediaSeekingError: boolean;
|
|
10
|
+
onDuration: (src: string, durationInSeconds: number) => void;
|
|
11
|
+
} & RefAttributes<HTMLVideoElement>>;
|
|
@@ -4,16 +4,27 @@ exports.VideoForDevelopment = void 0;
|
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const use_audio_frame_1 = require("../audio/use-audio-frame");
|
|
7
|
+
const prefetch_1 = require("../prefetch");
|
|
8
|
+
const Sequence_1 = require("../Sequence");
|
|
7
9
|
const use_media_in_timeline_1 = require("../use-media-in-timeline");
|
|
8
10
|
const use_media_playback_1 = require("../use-media-playback");
|
|
9
11
|
const use_media_tag_volume_1 = require("../use-media-tag-volume");
|
|
10
12
|
const use_sync_volume_with_media_tag_1 = require("../use-sync-volume-with-media-tag");
|
|
13
|
+
const use_video_config_1 = require("../use-video-config");
|
|
11
14
|
const volume_position_state_1 = require("../volume-position-state");
|
|
15
|
+
const video_fragment_1 = require("./video-fragment");
|
|
12
16
|
const VideoForDevelopmentRefForwardingFunction = (props, ref) => {
|
|
13
|
-
var _a;
|
|
17
|
+
var _a, _b;
|
|
14
18
|
const videoRef = (0, react_1.useRef)(null);
|
|
15
19
|
const volumePropFrame = (0, use_audio_frame_1.useFrameForVolumeProp)();
|
|
16
|
-
const {
|
|
20
|
+
const { fps, durationInFrames } = (0, use_video_config_1.useVideoConfig)();
|
|
21
|
+
const parentSequence = (0, react_1.useContext)(Sequence_1.SequenceContext);
|
|
22
|
+
const { volume, muted, playbackRate, onlyWarnForMediaSeekingError, src, onDuration,
|
|
23
|
+
// @ts-expect-error
|
|
24
|
+
acceptableTimeShift, acceptableTimeShiftInSeconds, ...nativeProps } = props;
|
|
25
|
+
if (typeof acceptableTimeShift !== 'undefined') {
|
|
26
|
+
throw new Error('acceptableTimeShift has been removed. Use acceptableTimeShiftInSeconds instead.');
|
|
27
|
+
}
|
|
17
28
|
const actualVolume = (0, use_media_tag_volume_1.useMediaTagVolume)(videoRef);
|
|
18
29
|
const [mediaVolume] = (0, volume_position_state_1.useMediaVolumeState)();
|
|
19
30
|
const [mediaMuted] = (0, volume_position_state_1.useMediaMutedState)();
|
|
@@ -22,7 +33,8 @@ const VideoForDevelopmentRefForwardingFunction = (props, ref) => {
|
|
|
22
33
|
volume,
|
|
23
34
|
mediaVolume,
|
|
24
35
|
mediaType: 'video',
|
|
25
|
-
src
|
|
36
|
+
src,
|
|
37
|
+
playbackRate: (_a = props.playbackRate) !== null && _a !== void 0 ? _a : 1,
|
|
26
38
|
});
|
|
27
39
|
(0, use_sync_volume_with_media_tag_1.useSyncVolumeWithMediaTag)({
|
|
28
40
|
volumePropFrame,
|
|
@@ -33,13 +45,69 @@ const VideoForDevelopmentRefForwardingFunction = (props, ref) => {
|
|
|
33
45
|
});
|
|
34
46
|
(0, use_media_playback_1.useMediaPlayback)({
|
|
35
47
|
mediaRef: videoRef,
|
|
36
|
-
src
|
|
48
|
+
src,
|
|
37
49
|
mediaType: 'video',
|
|
38
|
-
playbackRate: (
|
|
50
|
+
playbackRate: (_b = props.playbackRate) !== null && _b !== void 0 ? _b : 1,
|
|
51
|
+
onlyWarnForMediaSeekingError,
|
|
52
|
+
acceptableTimeshift: acceptableTimeShiftInSeconds !== null && acceptableTimeShiftInSeconds !== void 0 ? acceptableTimeShiftInSeconds : use_media_playback_1.DEFAULT_ACCEPTABLE_TIMESHIFT,
|
|
53
|
+
});
|
|
54
|
+
const actualFrom = parentSequence
|
|
55
|
+
? parentSequence.relativeFrom + parentSequence.cumulatedFrom
|
|
56
|
+
: 0;
|
|
57
|
+
const duration = parentSequence
|
|
58
|
+
? Math.min(parentSequence.durationInFrames, durationInFrames)
|
|
59
|
+
: durationInFrames;
|
|
60
|
+
const actualSrc = (0, video_fragment_1.useAppendVideoFragment)({
|
|
61
|
+
actualSrc: (0, prefetch_1.usePreload)(src),
|
|
62
|
+
actualFrom,
|
|
63
|
+
duration,
|
|
64
|
+
fps,
|
|
39
65
|
});
|
|
40
66
|
(0, react_1.useImperativeHandle)(ref, () => {
|
|
41
67
|
return videoRef.current;
|
|
42
|
-
});
|
|
43
|
-
|
|
68
|
+
}, []);
|
|
69
|
+
(0, react_1.useEffect)(() => {
|
|
70
|
+
const { current } = videoRef;
|
|
71
|
+
if (!current) {
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
const errorHandler = () => {
|
|
75
|
+
var _a;
|
|
76
|
+
if (current === null || current === void 0 ? void 0 : current.error) {
|
|
77
|
+
console.error('Error occurred in video', current === null || current === void 0 ? void 0 : current.error);
|
|
78
|
+
throw new Error(`The browser threw an error while playing the video ${src}: Code ${current.error.code} - ${(_a = current === null || current === void 0 ? void 0 : current.error) === null || _a === void 0 ? void 0 : _a.message}. See https://remotion.dev/docs/media-playback-error for help`);
|
|
79
|
+
}
|
|
80
|
+
else {
|
|
81
|
+
throw new Error('The browser threw an error');
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
current.addEventListener('error', errorHandler, { once: true });
|
|
85
|
+
return () => {
|
|
86
|
+
current.removeEventListener('error', errorHandler);
|
|
87
|
+
};
|
|
88
|
+
}, [src]);
|
|
89
|
+
const currentOnDurationCallback = (0, react_1.useRef)();
|
|
90
|
+
currentOnDurationCallback.current = onDuration;
|
|
91
|
+
(0, react_1.useEffect)(() => {
|
|
92
|
+
var _a;
|
|
93
|
+
const { current } = videoRef;
|
|
94
|
+
if (!current) {
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
if (current.duration) {
|
|
98
|
+
(_a = currentOnDurationCallback.current) === null || _a === void 0 ? void 0 : _a.call(currentOnDurationCallback, src, current.duration);
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
const onLoadedMetadata = () => {
|
|
102
|
+
var _a;
|
|
103
|
+
(_a = currentOnDurationCallback.current) === null || _a === void 0 ? void 0 : _a.call(currentOnDurationCallback, src, current.duration);
|
|
104
|
+
};
|
|
105
|
+
current.addEventListener('loadedmetadata', onLoadedMetadata);
|
|
106
|
+
return () => {
|
|
107
|
+
current.removeEventListener('loadedmetadata', onLoadedMetadata);
|
|
108
|
+
};
|
|
109
|
+
}, [src]);
|
|
110
|
+
return ((0, jsx_runtime_1.jsx)("video", { ref: videoRef, muted: muted || mediaMuted, playsInline: true, src: actualSrc, ...nativeProps }));
|
|
44
111
|
};
|
|
112
|
+
// Copy types from forwardRef but not necessary to remove ref
|
|
45
113
|
exports.VideoForDevelopment = (0, react_1.forwardRef)(VideoForDevelopmentRefForwardingFunction);
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
import type { ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
1
2
|
import React from 'react';
|
|
2
|
-
|
|
3
|
-
|
|
3
|
+
export declare const VideoForRendering: ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.VideoHTMLAttributes<HTMLVideoElement>, HTMLVideoElement>, "nonce" | "onEnded" | "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<HTMLVideoElement>>;
|