remotion 3.3.45 → 3.3.52
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/dist/Sequence.js +1 -1
- package/dist/Still.d.ts +0 -1
- package/dist/audio/Audio.d.ts +2 -2
- package/dist/audio/AudioForDevelopment.d.ts +1 -1
- package/dist/audio/AudioForRendering.d.ts +1 -1
- package/dist/cjs/AbsoluteFill.d.ts +6 -0
- package/dist/cjs/AbsoluteFill.js +28 -0
- package/dist/cjs/CanUseRemotionHooks.d.ts +5 -0
- package/dist/cjs/CanUseRemotionHooks.js +10 -0
- package/dist/cjs/Clipper.d.ts +7 -0
- package/dist/cjs/Clipper.js +24 -0
- package/dist/cjs/Composition.d.ts +23 -0
- package/dist/cjs/Composition.js +113 -0
- package/dist/cjs/CompositionManager.d.ts +82 -0
- package/dist/cjs/CompositionManager.js +164 -0
- package/dist/cjs/Folder.d.ts +15 -0
- package/dist/cjs/Folder.js +33 -0
- package/dist/cjs/IFrame.d.ts +2 -0
- package/dist/cjs/IFrame.js +24 -0
- package/dist/cjs/Img.d.ts +2 -0
- package/dist/cjs/Img.js +52 -0
- package/dist/cjs/NativeLayers.d.ts +13 -0
- package/dist/cjs/NativeLayers.js +29 -0
- package/dist/cjs/Null.d.ts +2 -0
- package/dist/cjs/Null.js +25 -0
- package/dist/cjs/RemotionRoot.d.ts +5 -0
- package/dist/cjs/RemotionRoot.js +73 -0
- package/dist/cjs/Sequence.d.ts +29 -0
- package/dist/cjs/Sequence.js +131 -0
- package/dist/cjs/Still.d.ts +3 -0
- package/dist/cjs/Still.js +9 -0
- package/dist/cjs/absolute-src.d.ts +1 -0
- package/dist/cjs/absolute-src.js +7 -0
- package/dist/cjs/asset-types.d.ts +50 -0
- package/dist/cjs/asset-types.js +1 -0
- package/dist/cjs/audio/Audio.d.ts +8 -0
- package/dist/cjs/audio/Audio.js +52 -0
- package/dist/cjs/audio/AudioForDevelopment.d.ts +11 -0
- package/dist/cjs/audio/AudioForDevelopment.js +94 -0
- package/dist/cjs/audio/AudioForRendering.d.ts +10 -0
- package/dist/cjs/audio/AudioForRendering.js +111 -0
- package/dist/cjs/audio/index.d.ts +2 -0
- package/dist/cjs/audio/index.js +18 -0
- package/dist/cjs/audio/props.d.ts +12 -0
- package/dist/cjs/audio/props.js +2 -0
- package/dist/cjs/audio/shared-audio-tags.d.ts +37 -0
- package/dist/cjs/audio/shared-audio-tags.js +222 -0
- package/dist/cjs/audio/use-audio-frame.d.ts +6 -0
- package/dist/cjs/audio/use-audio-frame.js +23 -0
- package/dist/cjs/bezier.d.ts +1 -0
- package/dist/cjs/bezier.js +114 -0
- package/dist/cjs/cancel-render.d.ts +1 -0
- package/dist/cjs/cancel-render.js +43 -0
- package/dist/cjs/config/input-props.d.ts +1 -0
- package/dist/cjs/config/input-props.js +31 -0
- package/dist/cjs/config.d.ts +285 -0
- package/dist/cjs/config.js +21 -0
- package/dist/cjs/default-css.d.ts +3 -0
- package/dist/cjs/default-css.js +49 -0
- package/dist/cjs/delay-render.d.ts +14 -0
- package/dist/cjs/delay-render.js +77 -0
- package/dist/cjs/easing.d.ts +19 -0
- package/dist/cjs/easing.js +77 -0
- package/dist/cjs/freeze.d.ts +7 -0
- package/dist/cjs/freeze.js +34 -0
- package/dist/cjs/get-asset-file-name.d.ts +1 -0
- package/dist/cjs/get-asset-file-name.js +14 -0
- package/dist/cjs/get-environment.d.ts +3 -0
- package/dist/cjs/get-environment.js +34 -0
- package/dist/cjs/get-preview-dom-element.d.ts +1 -0
- package/dist/cjs/get-preview-dom-element.js +7 -0
- package/dist/cjs/get-static-files.d.ts +17 -0
- package/dist/cjs/get-static-files.js +31 -0
- package/dist/cjs/get-timeline-clip-name.d.ts +1 -0
- package/dist/cjs/get-timeline-clip-name.js +25 -0
- package/dist/cjs/index.d.ts +92 -0
- package/dist/cjs/index.js +73 -0
- package/dist/cjs/internals.d.ts +99 -0
- package/dist/cjs/internals.js +101 -0
- package/dist/cjs/interpolate-colors.d.ts +5 -0
- package/dist/cjs/interpolate-colors.js +401 -0
- package/dist/cjs/interpolate.d.ts +18 -0
- package/dist/cjs/interpolate.js +123 -0
- package/dist/cjs/is-approximately-the-same.d.ts +1 -0
- package/dist/cjs/is-approximately-the-same.js +8 -0
- package/dist/cjs/is-player.d.ts +3 -0
- package/dist/cjs/is-player.js +14 -0
- package/dist/cjs/loading-indicator.d.ts +2 -0
- package/dist/cjs/loading-indicator.js +35 -0
- package/dist/cjs/loop/index.d.ts +9 -0
- package/dist/cjs/loop/index.js +29 -0
- package/dist/cjs/multiple-versions-warning.d.ts +1 -0
- package/dist/cjs/multiple-versions-warning.js +32 -0
- package/dist/cjs/nonce.d.ts +7 -0
- package/dist/cjs/nonce.js +17 -0
- package/dist/cjs/play-and-handle-not-allowed-error.d.ts +2 -0
- package/dist/cjs/play-and-handle-not-allowed-error.js +44 -0
- package/dist/cjs/portal-node.d.ts +1 -0
- package/dist/cjs/portal-node.js +23 -0
- package/dist/cjs/prefetch-state.d.ts +8 -0
- package/dist/cjs/prefetch-state.js +27 -0
- package/dist/cjs/prefetch.d.ts +9 -0
- package/dist/cjs/prefetch.js +108 -0
- package/dist/cjs/random.d.ts +7 -0
- package/dist/cjs/random.js +42 -0
- package/dist/cjs/register-root.d.ts +4 -0
- package/dist/cjs/register-root.js +33 -0
- package/dist/cjs/series/flatten-children.d.ts +2 -0
- package/dist/cjs/series/flatten-children.js +19 -0
- package/dist/cjs/series/index.d.ts +13 -0
- package/dist/cjs/series/index.js +60 -0
- package/dist/cjs/setup-env-variables.d.ts +2 -0
- package/dist/cjs/setup-env-variables.js +36 -0
- package/dist/cjs/spring/index.d.ts +27 -0
- package/dist/cjs/spring/index.js +55 -0
- package/dist/cjs/spring/measure-spring.d.ts +8 -0
- package/dist/cjs/spring/measure-spring.js +64 -0
- package/dist/cjs/spring/spring-utils.d.ts +21 -0
- package/dist/cjs/spring/spring-utils.js +103 -0
- package/dist/cjs/static-file.d.ts +5 -0
- package/dist/cjs/static-file.js +33 -0
- package/dist/cjs/test/Img.test.d.ts +1 -0
- package/dist/cjs/test/Img.test.js +25 -0
- package/dist/cjs/test/absolute-src.test.d.ts +1 -0
- package/dist/cjs/test/absolute-src.test.js +18 -0
- package/dist/cjs/test/audio-for-rendering.test.d.ts +1 -0
- package/dist/cjs/test/audio-for-rendering.test.js +88 -0
- package/dist/cjs/test/audio.test.d.ts +1 -0
- package/dist/cjs/test/audio.test.js +76 -0
- package/dist/cjs/test/bezier.test.d.ts +1 -0
- package/dist/cjs/test/bezier.test.js +52 -0
- package/dist/cjs/test/composition-rules.test.d.ts +1 -0
- package/dist/cjs/test/composition-rules.test.js +30 -0
- package/dist/cjs/test/composition-validation.test.d.ts +1 -0
- package/dist/cjs/test/composition-validation.test.js +99 -0
- package/dist/cjs/test/easing.test.d.ts +1 -0
- package/dist/cjs/test/easing.test.js +191 -0
- package/dist/cjs/test/expect-to-throw.d.ts +1 -0
- package/dist/cjs/test/expect-to-throw.js +15 -0
- package/dist/cjs/test/freeze.test.d.ts +1 -0
- package/dist/cjs/test/freeze.test.js +65 -0
- package/dist/cjs/test/get-asset-file-name.test.d.ts +1 -0
- package/dist/cjs/test/get-asset-file-name.test.js +14 -0
- package/dist/cjs/test/get-current-time.test.d.ts +1 -0
- package/dist/cjs/test/get-current-time.test.js +74 -0
- package/dist/cjs/test/input-props.test.d.ts +1 -0
- package/dist/cjs/test/input-props.test.js +31 -0
- package/dist/cjs/test/interpolate.test.d.ts +1 -0
- package/dist/cjs/test/interpolate.test.js +138 -0
- package/dist/cjs/test/interpolateColors.test.d.ts +1 -0
- package/dist/cjs/test/interpolateColors.test.js +63 -0
- package/dist/cjs/test/loop-validation.test.d.ts +1 -0
- package/dist/cjs/test/loop-validation.test.js +93 -0
- package/dist/cjs/test/measure-spring.test.d.ts +1 -0
- package/dist/cjs/test/measure-spring.test.js +45 -0
- package/dist/cjs/test/media-validation.test.d.ts +1 -0
- package/dist/cjs/test/media-validation.test.js +47 -0
- package/dist/cjs/test/nested-sequences.test.d.ts +1 -0
- package/dist/cjs/test/nested-sequences.test.js +132 -0
- package/dist/cjs/test/not-all-props-in-media-tags.test.d.ts +1 -0
- package/dist/cjs/test/not-all-props-in-media-tags.test.js +33 -0
- package/dist/cjs/test/random.test.d.ts +1 -0
- package/dist/cjs/test/random.test.js +60 -0
- package/dist/cjs/test/ready-manager.test.d.ts +1 -0
- package/dist/cjs/test/ready-manager.test.js +29 -0
- package/dist/cjs/test/render-hook.d.ts +23 -0
- package/dist/cjs/test/render-hook.js +27 -0
- package/dist/cjs/test/sequence-from-initial-offset.test.d.ts +4 -0
- package/dist/cjs/test/sequence-from-initial-offset.test.js +35 -0
- package/dist/cjs/test/sequence-validation.test.d.ts +1 -0
- package/dist/cjs/test/sequence-validation.test.js +47 -0
- package/dist/cjs/test/series.test.d.ts +1 -0
- package/dist/cjs/test/series.test.js +115 -0
- package/dist/cjs/test/spring.test.d.ts +1 -0
- package/dist/cjs/test/spring.test.js +38 -0
- package/dist/cjs/test/truthy.test.d.ts +1 -0
- package/dist/cjs/test/truthy.test.js +24 -0
- package/dist/cjs/test/use-audio-frame.test.d.ts +1 -0
- package/dist/cjs/test/use-audio-frame.test.js +78 -0
- package/dist/cjs/test/use-media-in-timeline.test.d.ts +1 -0
- package/dist/cjs/test/use-media-in-timeline.test.js +74 -0
- package/dist/cjs/test/use-media-tag-volume.test.d.ts +1 -0
- package/dist/cjs/test/use-media-tag-volume.test.js +49 -0
- package/dist/cjs/test/use-sync-volume-with-media-tag.test.d.ts +1 -0
- package/dist/cjs/test/use-sync-volume-with-media-tag.test.js +55 -0
- package/dist/cjs/test/validate-start-from-props.test.d.ts +1 -0
- package/dist/cjs/test/validate-start-from-props.test.js +39 -0
- package/dist/cjs/test/video.test.d.ts +1 -0
- package/dist/cjs/test/video.test.js +80 -0
- package/dist/cjs/test/volume-prop.test.d.ts +1 -0
- package/dist/cjs/test/volume-prop.test.js +95 -0
- package/dist/cjs/test/wrap-sequence-context.d.ts +6 -0
- package/dist/cjs/test/wrap-sequence-context.js +41 -0
- package/dist/cjs/timeline-position-state.d.ts +29 -0
- package/dist/cjs/timeline-position-state.js +41 -0
- package/dist/cjs/truthy.d.ts +3 -0
- package/dist/cjs/truthy.js +7 -0
- package/dist/cjs/use-current-frame.d.ts +6 -0
- package/dist/cjs/use-current-frame.js +28 -0
- package/dist/cjs/use-lazy-component.d.ts +7 -0
- package/dist/cjs/use-lazy-component.js +49 -0
- package/dist/cjs/use-media-in-timeline.d.ts +10 -0
- package/dist/cjs/use-media-in-timeline.js +129 -0
- package/dist/cjs/use-media-playback.d.ts +10 -0
- package/dist/cjs/use-media-playback.js +77 -0
- package/dist/cjs/use-media-tag-volume.d.ts +2 -0
- package/dist/cjs/use-media-tag-volume.js +31 -0
- package/dist/cjs/use-sync-volume-with-media-tag.d.ts +10 -0
- package/dist/cjs/use-sync-volume-with-media-tag.js +21 -0
- package/dist/cjs/use-unsafe-video-config.d.ts +2 -0
- package/dist/cjs/use-unsafe-video-config.js +27 -0
- package/dist/cjs/use-video-config.d.ts +7 -0
- package/dist/cjs/use-video-config.js +29 -0
- package/dist/cjs/use-video.d.ts +13 -0
- package/dist/cjs/use-video.js +28 -0
- package/dist/cjs/validate-frame.d.ts +1 -0
- package/dist/cjs/validate-frame.js +24 -0
- package/dist/cjs/validate-media-props.d.ts +4 -0
- package/dist/cjs/validate-media-props.js +24 -0
- package/dist/cjs/validate-start-from-props.d.ts +1 -0
- package/dist/cjs/validate-start-from-props.js +31 -0
- package/dist/cjs/validation/validate-composition-id.d.ts +3 -0
- package/dist/cjs/validation/validate-composition-id.js +13 -0
- package/dist/cjs/validation/validate-dimensions.d.ts +1 -0
- package/dist/cjs/validation/validate-dimensions.js +21 -0
- package/dist/cjs/validation/validate-duration-in-frames.d.ts +1 -0
- package/dist/cjs/validation/validate-duration-in-frames.js +15 -0
- package/dist/cjs/validation/validate-folder-name.d.ts +3 -0
- package/dist/cjs/validation/validate-folder-name.js +19 -0
- package/dist/cjs/validation/validate-fps.d.ts +1 -0
- package/dist/cjs/validation/validate-fps.js +21 -0
- package/dist/cjs/validation/validate-offthreadvideo-image-format.d.ts +1 -0
- package/dist/cjs/validation/validate-offthreadvideo-image-format.js +15 -0
- package/dist/cjs/validation/validation-spring-duration.d.ts +1 -0
- package/dist/cjs/validation/validation-spring-duration.js +21 -0
- package/dist/cjs/version.d.ts +1 -0
- package/dist/cjs/version.js +5 -0
- package/dist/cjs/video/OffthreadVideo.d.ts +3 -0
- package/dist/cjs/video/OffthreadVideo.js +33 -0
- package/dist/cjs/video/OffthreadVideoForRendering.d.ts +3 -0
- package/dist/cjs/video/OffthreadVideoForRendering.js +104 -0
- package/dist/cjs/video/Video.d.ts +8 -0
- package/dist/cjs/video/Video.js +50 -0
- package/dist/cjs/video/VideoForDevelopment.d.ts +11 -0
- package/dist/cjs/video/VideoForDevelopment.js +113 -0
- package/dist/cjs/video/VideoForRendering.d.ts +10 -0
- package/dist/cjs/video/VideoForRendering.js +203 -0
- package/dist/cjs/video/duration-state.d.ts +17 -0
- package/dist/cjs/video/duration-state.js +34 -0
- package/dist/cjs/video/get-current-time.d.ts +13 -0
- package/dist/cjs/video/get-current-time.js +31 -0
- package/dist/cjs/video/index.d.ts +3 -0
- package/dist/cjs/video/index.js +7 -0
- package/dist/cjs/video/props.d.ts +25 -0
- package/dist/cjs/video/props.js +2 -0
- package/dist/cjs/video/video-fragment.d.ts +12 -0
- package/dist/cjs/video/video-fragment.js +60 -0
- package/dist/cjs/video-config.d.ts +8 -0
- package/dist/cjs/video-config.js +2 -0
- package/dist/cjs/volume-position-state.d.ts +19 -0
- package/dist/cjs/volume-position-state.js +32 -0
- package/dist/cjs/volume-prop.d.ts +7 -0
- package/dist/cjs/volume-prop.js +24 -0
- package/dist/cjs/warn-about-non-seekable-media.d.ts +1 -0
- package/dist/cjs/warn-about-non-seekable-media.js +34 -0
- package/dist/cjs/wrap-remotion-context.d.ts +18 -0
- package/dist/cjs/wrap-remotion-context.js +73 -0
- package/dist/esm/AbsoluteFill.d.ts +6 -0
- package/dist/esm/AbsoluteFill.js +25 -0
- package/dist/esm/CanUseRemotionHooks.d.ts +5 -0
- package/dist/esm/CanUseRemotionHooks.js +6 -0
- package/dist/esm/Clipper.d.ts +7 -0
- package/dist/esm/Clipper.js +20 -0
- package/dist/esm/Composition.d.ts +23 -0
- package/dist/esm/Composition.js +108 -0
- package/dist/esm/CompositionManager.d.ts +82 -0
- package/dist/esm/CompositionManager.js +137 -0
- package/dist/esm/Folder.d.ts +15 -0
- package/dist/esm/Folder.js +29 -0
- package/dist/esm/IFrame.d.ts +2 -0
- package/dist/esm/IFrame.js +21 -0
- package/dist/esm/Img.d.ts +2 -0
- package/dist/esm/Img.js +49 -0
- package/dist/esm/NativeLayers.d.ts +13 -0
- package/dist/esm/NativeLayers.js +25 -0
- package/dist/esm/Null.d.ts +2 -0
- package/dist/esm/Null.js +21 -0
- package/dist/esm/RemotionRoot.d.ts +5 -0
- package/dist/esm/RemotionRoot.js +69 -0
- package/dist/esm/Sequence.d.ts +29 -0
- package/dist/esm/Sequence.js +128 -0
- package/dist/esm/Still.d.ts +3 -0
- package/dist/esm/Still.js +5 -0
- package/dist/esm/absolute-src.d.ts +1 -0
- package/dist/esm/absolute-src.js +3 -0
- package/dist/esm/asset-types.d.ts +50 -0
- package/dist/esm/asset-types.js +1 -0
- package/dist/esm/audio/Audio.d.ts +8 -0
- package/dist/esm/audio/Audio.js +49 -0
- package/dist/esm/audio/AudioForDevelopment.d.ts +11 -0
- package/dist/esm/audio/AudioForDevelopment.js +91 -0
- package/dist/esm/audio/AudioForRendering.d.ts +10 -0
- package/dist/esm/audio/AudioForRendering.js +108 -0
- package/dist/esm/audio/index.d.ts +2 -0
- package/dist/esm/audio/index.js +2 -0
- package/dist/esm/audio/props.d.ts +12 -0
- package/dist/esm/audio/props.js +1 -0
- package/dist/esm/audio/shared-audio-tags.d.ts +37 -0
- package/dist/esm/audio/shared-audio-tags.js +194 -0
- package/dist/esm/audio/use-audio-frame.d.ts +6 -0
- package/dist/esm/audio/use-audio-frame.js +18 -0
- package/dist/esm/bezier.d.ts +1 -0
- package/dist/esm/bezier.js +110 -0
- package/dist/esm/cancel-render.d.ts +1 -0
- package/dist/esm/cancel-render.js +39 -0
- package/dist/esm/config/input-props.d.ts +1 -0
- package/dist/esm/config/input-props.js +27 -0
- package/dist/esm/config.d.ts +285 -0
- package/dist/esm/config.js +17 -0
- package/dist/esm/default-css.d.ts +3 -0
- package/dist/esm/default-css.js +44 -0
- package/dist/esm/delay-render.d.ts +14 -0
- package/dist/esm/delay-render.js +72 -0
- package/dist/esm/easing.d.ts +19 -0
- package/dist/esm/easing.js +73 -0
- package/dist/esm/freeze.d.ts +7 -0
- package/dist/esm/freeze.js +30 -0
- package/dist/esm/get-asset-file-name.d.ts +1 -0
- package/dist/esm/get-asset-file-name.js +10 -0
- package/dist/esm/get-environment.d.ts +3 -0
- package/dist/esm/get-environment.js +29 -0
- package/dist/esm/get-preview-dom-element.d.ts +1 -0
- package/dist/esm/get-preview-dom-element.js +3 -0
- package/dist/esm/get-static-files.d.ts +17 -0
- package/dist/esm/get-static-files.js +27 -0
- package/dist/esm/get-timeline-clip-name.d.ts +1 -0
- package/dist/esm/get-timeline-clip-name.js +21 -0
- package/dist/esm/index.d.ts +92 -0
- package/dist/esm/index.js +41 -0
- package/dist/esm/internals.d.ts +99 -0
- package/dist/esm/internals.js +75 -0
- package/dist/esm/interpolate-colors.d.ts +5 -0
- package/dist/esm/interpolate-colors.js +397 -0
- package/dist/esm/interpolate.d.ts +18 -0
- package/dist/esm/interpolate.js +119 -0
- package/dist/esm/is-approximately-the-same.d.ts +1 -0
- package/dist/esm/is-approximately-the-same.js +4 -0
- package/dist/esm/is-player.d.ts +3 -0
- package/dist/esm/is-player.js +9 -0
- package/dist/esm/loading-indicator.d.ts +2 -0
- package/dist/esm/loading-indicator.js +31 -0
- package/dist/esm/loop/index.d.ts +9 -0
- package/dist/esm/loop/index.js +25 -0
- package/dist/esm/multiple-versions-warning.d.ts +1 -0
- package/dist/esm/multiple-versions-warning.js +28 -0
- package/dist/esm/nonce.d.ts +7 -0
- package/dist/esm/nonce.js +13 -0
- package/dist/esm/play-and-handle-not-allowed-error.d.ts +2 -0
- package/dist/esm/play-and-handle-not-allowed-error.js +40 -0
- package/dist/esm/portal-node.d.ts +1 -0
- package/dist/esm/portal-node.js +19 -0
- package/dist/esm/prefetch-state.d.ts +8 -0
- package/dist/esm/prefetch-state.js +22 -0
- package/dist/esm/prefetch.d.ts +9 -0
- package/dist/esm/prefetch.js +103 -0
- package/dist/esm/random.d.ts +7 -0
- package/dist/esm/random.js +38 -0
- package/dist/esm/register-root.d.ts +4 -0
- package/dist/esm/register-root.js +27 -0
- package/dist/esm/series/flatten-children.d.ts +2 -0
- package/dist/esm/series/flatten-children.js +12 -0
- package/dist/esm/series/index.d.ts +13 -0
- package/dist/esm/series/index.js +57 -0
- package/dist/esm/setup-env-variables.d.ts +2 -0
- package/dist/esm/setup-env-variables.js +32 -0
- package/dist/esm/spring/index.d.ts +27 -0
- package/dist/esm/spring/index.js +50 -0
- package/dist/esm/spring/measure-spring.d.ts +8 -0
- package/dist/esm/spring/measure-spring.js +60 -0
- package/dist/esm/spring/spring-utils.d.ts +21 -0
- package/dist/esm/spring/spring-utils.js +99 -0
- package/dist/esm/static-file.d.ts +5 -0
- package/dist/esm/static-file.js +29 -0
- package/dist/esm/test/Img.test.d.ts +1 -0
- package/dist/esm/test/Img.test.js +20 -0
- package/dist/esm/test/absolute-src.test.d.ts +1 -0
- package/dist/esm/test/absolute-src.test.js +16 -0
- package/dist/esm/test/audio-for-rendering.test.d.ts +1 -0
- package/dist/esm/test/audio-for-rendering.test.js +83 -0
- package/dist/esm/test/audio.test.d.ts +1 -0
- package/dist/esm/test/audio.test.js +51 -0
- package/dist/esm/test/bezier.test.d.ts +1 -0
- package/dist/esm/test/bezier.test.js +50 -0
- package/dist/esm/test/composition-rules.test.d.ts +1 -0
- package/dist/esm/test/composition-rules.test.js +28 -0
- package/dist/esm/test/composition-validation.test.d.ts +1 -0
- package/dist/esm/test/composition-validation.test.js +97 -0
- package/dist/esm/test/easing.test.d.ts +1 -0
- package/dist/esm/test/easing.test.js +189 -0
- package/dist/esm/test/expect-to-throw.d.ts +1 -0
- package/dist/esm/test/expect-to-throw.js +11 -0
- package/dist/esm/test/freeze.test.d.ts +1 -0
- package/dist/esm/test/freeze.test.js +63 -0
- package/dist/esm/test/get-asset-file-name.test.d.ts +1 -0
- package/dist/esm/test/get-asset-file-name.test.js +12 -0
- package/dist/esm/test/get-current-time.test.d.ts +1 -0
- package/dist/esm/test/get-current-time.test.js +72 -0
- package/dist/esm/test/input-props.test.d.ts +1 -0
- package/dist/esm/test/input-props.test.js +29 -0
- package/dist/esm/test/interpolate.test.d.ts +1 -0
- package/dist/esm/test/interpolate.test.js +136 -0
- package/dist/esm/test/interpolateColors.test.d.ts +1 -0
- package/dist/esm/test/interpolateColors.test.js +61 -0
- package/dist/esm/test/loop-validation.test.d.ts +1 -0
- package/dist/esm/test/loop-validation.test.js +68 -0
- package/dist/esm/test/measure-spring.test.d.ts +1 -0
- package/dist/esm/test/measure-spring.test.js +43 -0
- package/dist/esm/test/media-validation.test.d.ts +1 -0
- package/dist/esm/test/media-validation.test.js +45 -0
- package/dist/esm/test/nested-sequences.test.d.ts +1 -0
- package/dist/esm/test/nested-sequences.test.js +130 -0
- package/dist/esm/test/not-all-props-in-media-tags.test.d.ts +1 -0
- package/dist/esm/test/not-all-props-in-media-tags.test.js +28 -0
- package/dist/esm/test/random.test.d.ts +1 -0
- package/dist/esm/test/random.test.js +58 -0
- package/dist/esm/test/ready-manager.test.d.ts +1 -0
- package/dist/esm/test/ready-manager.test.js +27 -0
- package/dist/esm/test/render-hook.d.ts +23 -0
- package/dist/esm/test/render-hook.js +20 -0
- package/dist/esm/test/sequence-from-initial-offset.test.d.ts +4 -0
- package/dist/esm/test/sequence-from-initial-offset.test.js +33 -0
- package/dist/esm/test/sequence-validation.test.d.ts +1 -0
- package/dist/esm/test/sequence-validation.test.js +45 -0
- package/dist/esm/test/series.test.d.ts +1 -0
- package/dist/esm/test/series.test.js +113 -0
- package/dist/esm/test/spring.test.d.ts +1 -0
- package/dist/esm/test/spring.test.js +36 -0
- package/dist/esm/test/truthy.test.d.ts +1 -0
- package/dist/esm/test/truthy.test.js +22 -0
- package/dist/esm/test/use-audio-frame.test.d.ts +1 -0
- package/dist/esm/test/use-audio-frame.test.js +53 -0
- package/dist/esm/test/use-media-in-timeline.test.d.ts +1 -0
- package/dist/esm/test/use-media-in-timeline.test.js +49 -0
- package/dist/esm/test/use-media-tag-volume.test.d.ts +1 -0
- package/dist/esm/test/use-media-tag-volume.test.js +44 -0
- package/dist/esm/test/use-sync-volume-with-media-tag.test.d.ts +1 -0
- package/dist/esm/test/use-sync-volume-with-media-tag.test.js +53 -0
- package/dist/esm/test/validate-start-from-props.test.d.ts +1 -0
- package/dist/esm/test/validate-start-from-props.test.js +37 -0
- package/dist/esm/test/video.test.d.ts +1 -0
- package/dist/esm/test/video.test.js +55 -0
- package/dist/esm/test/volume-prop.test.d.ts +1 -0
- package/dist/esm/test/volume-prop.test.js +93 -0
- package/dist/esm/test/wrap-sequence-context.d.ts +6 -0
- package/dist/esm/test/wrap-sequence-context.js +37 -0
- package/dist/esm/timeline-position-state.d.ts +29 -0
- package/dist/esm/timeline-position-state.js +35 -0
- package/dist/esm/truthy.d.ts +3 -0
- package/dist/esm/truthy.js +3 -0
- package/dist/esm/use-current-frame.d.ts +6 -0
- package/dist/esm/use-current-frame.js +24 -0
- package/dist/esm/use-lazy-component.d.ts +7 -0
- package/dist/esm/use-lazy-component.js +22 -0
- package/dist/esm/use-media-in-timeline.d.ts +10 -0
- package/dist/esm/use-media-in-timeline.js +125 -0
- package/dist/esm/use-media-playback.d.ts +10 -0
- package/dist/esm/use-media-playback.js +73 -0
- package/dist/esm/use-media-tag-volume.d.ts +2 -0
- package/dist/esm/use-media-tag-volume.js +27 -0
- package/dist/esm/use-sync-volume-with-media-tag.d.ts +10 -0
- package/dist/esm/use-sync-volume-with-media-tag.js +17 -0
- package/dist/esm/use-unsafe-video-config.d.ts +2 -0
- package/dist/esm/use-unsafe-video-config.js +23 -0
- package/dist/esm/use-video-config.d.ts +7 -0
- package/dist/esm/use-video-config.js +25 -0
- package/dist/esm/use-video.d.ts +13 -0
- package/dist/esm/use-video.js +24 -0
- package/dist/esm/validate-frame.d.ts +1 -0
- package/dist/esm/validate-frame.js +20 -0
- package/dist/esm/validate-media-props.d.ts +4 -0
- package/dist/esm/validate-media-props.js +20 -0
- package/dist/esm/validate-start-from-props.d.ts +1 -0
- package/dist/esm/validate-start-from-props.js +27 -0
- package/dist/esm/validation/validate-composition-id.d.ts +3 -0
- package/dist/esm/validation/validate-composition-id.js +8 -0
- package/dist/esm/validation/validate-dimensions.d.ts +1 -0
- package/dist/esm/validation/validate-dimensions.js +17 -0
- package/dist/esm/validation/validate-duration-in-frames.d.ts +1 -0
- package/dist/esm/validation/validate-duration-in-frames.js +11 -0
- package/dist/esm/validation/validate-folder-name.d.ts +3 -0
- package/dist/esm/validation/validate-folder-name.js +14 -0
- package/dist/esm/validation/validate-fps.d.ts +1 -0
- package/dist/esm/validation/validate-fps.js +17 -0
- package/dist/esm/validation/validate-offthreadvideo-image-format.d.ts +1 -0
- package/dist/esm/validation/validate-offthreadvideo-image-format.js +11 -0
- package/dist/esm/validation/validation-spring-duration.d.ts +1 -0
- package/dist/esm/validation/validation-spring-duration.js +17 -0
- package/dist/esm/version.d.ts +1 -0
- package/dist/esm/version.js +2 -0
- package/dist/esm/video/OffthreadVideo.d.ts +3 -0
- package/dist/esm/video/OffthreadVideo.js +29 -0
- package/dist/esm/video/OffthreadVideoForRendering.d.ts +3 -0
- package/dist/esm/video/OffthreadVideoForRendering.js +100 -0
- package/dist/esm/video/Video.d.ts +8 -0
- package/dist/esm/video/Video.js +47 -0
- package/dist/esm/video/VideoForDevelopment.d.ts +11 -0
- package/dist/esm/video/VideoForDevelopment.js +110 -0
- package/dist/esm/video/VideoForRendering.d.ts +10 -0
- package/dist/esm/video/VideoForRendering.js +200 -0
- package/dist/esm/video/duration-state.d.ts +17 -0
- package/dist/esm/video/duration-state.js +29 -0
- package/dist/esm/video/get-current-time.d.ts +13 -0
- package/dist/esm/video/get-current-time.js +26 -0
- package/dist/esm/video/index.d.ts +3 -0
- package/dist/esm/video/index.js +2 -0
- package/dist/esm/video/props.d.ts +25 -0
- package/dist/esm/video/props.js +1 -0
- package/dist/esm/video/video-fragment.d.ts +12 -0
- package/dist/esm/video/video-fragment.js +55 -0
- package/dist/esm/video-config.d.ts +8 -0
- package/dist/esm/video-config.js +1 -0
- package/dist/esm/volume-position-state.d.ts +19 -0
- package/dist/esm/volume-position-state.js +27 -0
- package/dist/esm/volume-prop.d.ts +7 -0
- package/dist/esm/volume-prop.js +20 -0
- package/dist/esm/warn-about-non-seekable-media.d.ts +1 -0
- package/dist/esm/warn-about-non-seekable-media.js +30 -0
- package/dist/esm/wrap-remotion-context.d.ts +18 -0
- package/dist/esm/wrap-remotion-context.js +45 -0
- package/dist/internals.d.ts +0 -1
- package/dist/series/index.js +5 -2
- package/dist/tsconfig-cjs.tsbuildinfo +1 -0
- package/dist/use-video.d.ts +0 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/video/Video.d.ts +1 -1
- package/dist/video/VideoForDevelopment.d.ts +1 -1
- package/dist/video/VideoForRendering.d.ts +1 -1
- package/package.json +23 -12
- package/tsconfig-cjs.json +11 -0
- package/tsconfig.json +3 -3
- package/dist/LayerMaster.d.ts +0 -8
- package/dist/LayerMaster.js +0 -39
- package/dist/Satori.d.ts +0 -5
- package/dist/Satori.js +0 -92
- package/dist/get-compositions-from-markup.d.ts +0 -3
- package/dist/get-compositions-from-markup.js +0 -19
- package/dist/layers.d.ts +0 -24
- package/dist/layers.js +0 -149
- package/dist/video/NativeVideo.d.ts +0 -5
- package/dist/video/NativeVideo.js +0 -33
- package/dist/video/NativeVideoForRendering.d.ts +0 -8
- package/dist/video/NativeVideoForRendering.js +0 -14
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AudioForRendering = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const absolute_src_js_1 = require("../absolute-src.js");
|
|
7
|
+
const CompositionManager_js_1 = require("../CompositionManager.js");
|
|
8
|
+
const delay_render_js_1 = require("../delay-render.js");
|
|
9
|
+
const get_environment_js_1 = require("../get-environment.js");
|
|
10
|
+
const random_js_1 = require("../random.js");
|
|
11
|
+
const Sequence_js_1 = require("../Sequence.js");
|
|
12
|
+
const timeline_position_state_js_1 = require("../timeline-position-state.js");
|
|
13
|
+
const use_current_frame_js_1 = require("../use-current-frame.js");
|
|
14
|
+
const volume_prop_js_1 = require("../volume-prop.js");
|
|
15
|
+
const use_audio_frame_js_1 = require("./use-audio-frame.js");
|
|
16
|
+
const AudioForRenderingRefForwardingFunction = (props, ref) => {
|
|
17
|
+
const audioRef = (0, react_1.useRef)(null);
|
|
18
|
+
const absoluteFrame = (0, timeline_position_state_js_1.useTimelinePosition)();
|
|
19
|
+
const volumePropFrame = (0, use_audio_frame_js_1.useFrameForVolumeProp)();
|
|
20
|
+
const frame = (0, use_current_frame_js_1.useCurrentFrame)();
|
|
21
|
+
const sequenceContext = (0, react_1.useContext)(Sequence_js_1.SequenceContext);
|
|
22
|
+
const { registerAsset, unregisterAsset } = (0, react_1.useContext)(CompositionManager_js_1.CompositionManager);
|
|
23
|
+
const environment = (0, get_environment_js_1.useRemotionEnvironment)();
|
|
24
|
+
// Generate a string that's as unique as possible for this asset
|
|
25
|
+
// but at the same time the same on all threads
|
|
26
|
+
const id = (0, react_1.useMemo)(() => {
|
|
27
|
+
var _a;
|
|
28
|
+
return `audio-${(0, random_js_1.random)((_a = props.src) !== null && _a !== void 0 ? _a : '')}-${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}`;
|
|
29
|
+
}, [props.src, sequenceContext]);
|
|
30
|
+
const { volume: volumeProp, playbackRate, allowAmplificationDuringRender, onDuration, ...nativeProps } = props;
|
|
31
|
+
const volume = (0, volume_prop_js_1.evaluateVolume)({
|
|
32
|
+
volume: volumeProp,
|
|
33
|
+
frame: volumePropFrame,
|
|
34
|
+
mediaVolume: 1,
|
|
35
|
+
allowAmplificationDuringRender: allowAmplificationDuringRender !== null && allowAmplificationDuringRender !== void 0 ? allowAmplificationDuringRender : false,
|
|
36
|
+
});
|
|
37
|
+
(0, react_1.useImperativeHandle)(ref, () => {
|
|
38
|
+
return audioRef.current;
|
|
39
|
+
}, []);
|
|
40
|
+
(0, react_1.useEffect)(() => {
|
|
41
|
+
var _a;
|
|
42
|
+
if (!props.src) {
|
|
43
|
+
throw new Error('No src passed');
|
|
44
|
+
}
|
|
45
|
+
if (!window.remotion_audioEnabled) {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
if (props.muted) {
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
if (volume <= 0) {
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
registerAsset({
|
|
55
|
+
type: 'audio',
|
|
56
|
+
src: (0, absolute_src_js_1.getAbsoluteSrc)(props.src),
|
|
57
|
+
id,
|
|
58
|
+
frame: absoluteFrame,
|
|
59
|
+
volume,
|
|
60
|
+
mediaFrame: frame,
|
|
61
|
+
playbackRate: (_a = props.playbackRate) !== null && _a !== void 0 ? _a : 1,
|
|
62
|
+
allowAmplificationDuringRender: allowAmplificationDuringRender !== null && allowAmplificationDuringRender !== void 0 ? allowAmplificationDuringRender : false,
|
|
63
|
+
});
|
|
64
|
+
return () => unregisterAsset(id);
|
|
65
|
+
}, [
|
|
66
|
+
props.muted,
|
|
67
|
+
props.src,
|
|
68
|
+
registerAsset,
|
|
69
|
+
absoluteFrame,
|
|
70
|
+
id,
|
|
71
|
+
unregisterAsset,
|
|
72
|
+
volume,
|
|
73
|
+
volumePropFrame,
|
|
74
|
+
frame,
|
|
75
|
+
playbackRate,
|
|
76
|
+
props.playbackRate,
|
|
77
|
+
allowAmplificationDuringRender,
|
|
78
|
+
]);
|
|
79
|
+
const { src } = props;
|
|
80
|
+
// If audio source switches, make new handle
|
|
81
|
+
if (environment === 'rendering') {
|
|
82
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
83
|
+
(0, react_1.useLayoutEffect)(() => {
|
|
84
|
+
if (process.env.NODE_ENV === 'test') {
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
const newHandle = (0, delay_render_js_1.delayRender)('Loading <Audio> duration with src=' + src);
|
|
88
|
+
const { current } = audioRef;
|
|
89
|
+
const didLoad = () => {
|
|
90
|
+
if (current === null || current === void 0 ? void 0 : current.duration) {
|
|
91
|
+
onDuration(src, current.duration);
|
|
92
|
+
}
|
|
93
|
+
(0, delay_render_js_1.continueRender)(newHandle);
|
|
94
|
+
};
|
|
95
|
+
if (current === null || current === void 0 ? void 0 : current.duration) {
|
|
96
|
+
onDuration(src, current.duration);
|
|
97
|
+
(0, delay_render_js_1.continueRender)(newHandle);
|
|
98
|
+
}
|
|
99
|
+
else {
|
|
100
|
+
current === null || current === void 0 ? void 0 : current.addEventListener('loadedmetadata', didLoad, { once: true });
|
|
101
|
+
}
|
|
102
|
+
// If tag gets unmounted, clear pending handles because video metadata is not going to load
|
|
103
|
+
return () => {
|
|
104
|
+
current === null || current === void 0 ? void 0 : current.removeEventListener('loadedmetadata', didLoad);
|
|
105
|
+
(0, delay_render_js_1.continueRender)(newHandle);
|
|
106
|
+
};
|
|
107
|
+
}, [src, onDuration]);
|
|
108
|
+
}
|
|
109
|
+
return (0, jsx_runtime_1.jsx)("audio", { ref: audioRef, ...nativeProps });
|
|
110
|
+
};
|
|
111
|
+
exports.AudioForRendering = (0, react_1.forwardRef)(AudioForRenderingRefForwardingFunction);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./Audio.js"), exports);
|
|
18
|
+
__exportStar(require("./props.js"), exports);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { VolumeProp } from '../volume-prop.js';
|
|
3
|
+
export declare type RemotionMainAudioProps = {
|
|
4
|
+
startFrom?: number;
|
|
5
|
+
endAt?: number;
|
|
6
|
+
};
|
|
7
|
+
export declare type RemotionAudioProps = Omit<React.DetailedHTMLProps<React.AudioHTMLAttributes<HTMLAudioElement>, HTMLAudioElement>, 'autoPlay' | 'controls' | 'onEnded' | 'nonce' | 'onResize' | 'onResizeCapture'> & {
|
|
8
|
+
volume?: VolumeProp;
|
|
9
|
+
playbackRate?: number;
|
|
10
|
+
acceptableTimeShiftInSeconds?: number;
|
|
11
|
+
allowAmplificationDuringRender?: boolean;
|
|
12
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { RemotionAudioProps } from './props.js';
|
|
3
|
+
/**
|
|
4
|
+
* This functionality of Remotion will keep a certain amount
|
|
5
|
+
* of <audio> tags pre-mounted and by default filled with an empty audio track.
|
|
6
|
+
* If the user interacts, the empty audio will be played.
|
|
7
|
+
* If one of Remotions <Audio /> tags get mounted, the audio will not be rendered at this location, but into one of the prerendered audio tags.
|
|
8
|
+
*
|
|
9
|
+
* This helps with autoplay issues on iOS Safari and soon other browsers,
|
|
10
|
+
* which only allow audio playback upon user interaction.
|
|
11
|
+
*
|
|
12
|
+
* The behavior can be disabled by passing `0` as the number of shared audio tracks.
|
|
13
|
+
*/
|
|
14
|
+
declare type AudioElem = {
|
|
15
|
+
id: number;
|
|
16
|
+
props: RemotionAudioProps;
|
|
17
|
+
el: React.RefObject<HTMLAudioElement>;
|
|
18
|
+
audioId: string;
|
|
19
|
+
};
|
|
20
|
+
declare type SharedContext = {
|
|
21
|
+
registerAudio: (aud: RemotionAudioProps, audioId: string) => AudioElem;
|
|
22
|
+
unregisterAudio: (id: number) => void;
|
|
23
|
+
updateAudio: (options: {
|
|
24
|
+
id: number;
|
|
25
|
+
aud: RemotionAudioProps;
|
|
26
|
+
audioId: string;
|
|
27
|
+
}) => void;
|
|
28
|
+
playAllAudios: () => void;
|
|
29
|
+
numberOfAudioTags: number;
|
|
30
|
+
};
|
|
31
|
+
export declare const SharedAudioContext: React.Context<SharedContext | null>;
|
|
32
|
+
export declare const SharedAudioContextProvider: React.FC<{
|
|
33
|
+
numberOfAudioTags: number;
|
|
34
|
+
children: React.ReactNode;
|
|
35
|
+
}>;
|
|
36
|
+
export declare const useSharedAudio: (aud: RemotionAudioProps, audioId: string) => AudioElem;
|
|
37
|
+
export {};
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.useSharedAudio = exports.SharedAudioContextProvider = exports.SharedAudioContext = void 0;
|
|
27
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
28
|
+
const react_1 = __importStar(require("react"));
|
|
29
|
+
const EMPTY_AUDIO = 'data:audio/mp3;base64,/+MYxAAJcAV8AAgAABn//////+/gQ5BAMA+D4Pg+BAQBAEAwD4Pg+D4EBAEAQDAPg++hYBH///hUFQVBUFREDQNHmf///////+MYxBUGkAGIMAAAAP/29Xt6lUxBTUUzLjEwMFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV/+MYxDUAAANIAAAAAFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV';
|
|
30
|
+
const compareProps = (obj1, obj2) => {
|
|
31
|
+
const keysA = Object.keys(obj1).sort();
|
|
32
|
+
const keysB = Object.keys(obj2).sort();
|
|
33
|
+
if (keysA.length !== keysB.length) {
|
|
34
|
+
return false;
|
|
35
|
+
}
|
|
36
|
+
for (let i = 0; i < keysA.length; i++) {
|
|
37
|
+
// Not the same keys
|
|
38
|
+
if (keysA[i] !== keysB[i]) {
|
|
39
|
+
return false;
|
|
40
|
+
}
|
|
41
|
+
// Not the same values
|
|
42
|
+
if (obj1[keysA[i]] !== obj2[keysB[i]]) {
|
|
43
|
+
return false;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
return true;
|
|
47
|
+
};
|
|
48
|
+
const didPropChange = (key, newProp, prevProp) => {
|
|
49
|
+
// /music.mp3 and http://localhost:3000/music.mp3 are the same
|
|
50
|
+
if (key === 'src' &&
|
|
51
|
+
!prevProp.startsWith('data:') &&
|
|
52
|
+
!newProp.startsWith('data:')) {
|
|
53
|
+
return (new URL(prevProp, window.location.origin).toString() !==
|
|
54
|
+
new URL(newProp, window.location.origin).toString());
|
|
55
|
+
}
|
|
56
|
+
if (prevProp === newProp) {
|
|
57
|
+
return false;
|
|
58
|
+
}
|
|
59
|
+
return true;
|
|
60
|
+
};
|
|
61
|
+
exports.SharedAudioContext = (0, react_1.createContext)(null);
|
|
62
|
+
const SharedAudioContextProvider = ({ children, numberOfAudioTags }) => {
|
|
63
|
+
const audios = (0, react_1.useRef)([]);
|
|
64
|
+
const [initialNumberOfAudioTags] = (0, react_1.useState)(numberOfAudioTags);
|
|
65
|
+
if (numberOfAudioTags !== initialNumberOfAudioTags) {
|
|
66
|
+
throw new Error('The number of shared audio tags has changed dynamically. Once you have set this property, you cannot change it afterwards.');
|
|
67
|
+
}
|
|
68
|
+
const refs = (0, react_1.useMemo)(() => {
|
|
69
|
+
return new Array(numberOfAudioTags).fill(true).map(() => {
|
|
70
|
+
return { id: Math.random(), ref: (0, react_1.createRef)() };
|
|
71
|
+
});
|
|
72
|
+
}, [numberOfAudioTags]);
|
|
73
|
+
const takenAudios = (0, react_1.useRef)(new Array(numberOfAudioTags).fill(false));
|
|
74
|
+
const rerenderAudios = (0, react_1.useCallback)(() => {
|
|
75
|
+
refs.forEach(({ ref, id }) => {
|
|
76
|
+
var _a;
|
|
77
|
+
const data = (_a = audios.current) === null || _a === void 0 ? void 0 : _a.find((a) => a.id === id);
|
|
78
|
+
const { current } = ref;
|
|
79
|
+
if (!current) {
|
|
80
|
+
// Whole player has been unmounted, the refs don't exist anymore.
|
|
81
|
+
// It is not an error anymore though
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
if (data === undefined) {
|
|
85
|
+
current.src = EMPTY_AUDIO;
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
if (!data) {
|
|
89
|
+
throw new TypeError('Expected audio data to be there');
|
|
90
|
+
}
|
|
91
|
+
Object.keys(data.props).forEach((key) => {
|
|
92
|
+
// @ts-expect-error
|
|
93
|
+
if (didPropChange(key, data.props[key], current[key])) {
|
|
94
|
+
// @ts-expect-error
|
|
95
|
+
current[key] = data.props[key];
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
});
|
|
99
|
+
}, [refs]);
|
|
100
|
+
const registerAudio = (0, react_1.useCallback)((aud, audioId) => {
|
|
101
|
+
var _a, _b;
|
|
102
|
+
const found = (_a = audios.current) === null || _a === void 0 ? void 0 : _a.find((a) => a.audioId === audioId);
|
|
103
|
+
if (found) {
|
|
104
|
+
return found;
|
|
105
|
+
}
|
|
106
|
+
const firstFreeAudio = takenAudios.current.findIndex((a) => a === false);
|
|
107
|
+
if (firstFreeAudio === -1) {
|
|
108
|
+
throw new Error(`Tried to simultaneously mount ${numberOfAudioTags + 1} <Audio /> tags at the same time. With the current settings, the maximum amount of <Audio /> tags is limited to ${numberOfAudioTags} at the same time. Remotion pre-mounts silent audio tags to help avoid browser autoplay restrictions. See https://remotion.dev/docs/player/autoplay#use-the-numberofsharedaudiotags-property for more information on how to increase this limit.`);
|
|
109
|
+
}
|
|
110
|
+
const { id, ref } = refs[firstFreeAudio];
|
|
111
|
+
const cloned = [...takenAudios.current];
|
|
112
|
+
cloned[firstFreeAudio] = id;
|
|
113
|
+
takenAudios.current = cloned;
|
|
114
|
+
const newElem = {
|
|
115
|
+
props: aud,
|
|
116
|
+
id,
|
|
117
|
+
el: ref,
|
|
118
|
+
audioId,
|
|
119
|
+
};
|
|
120
|
+
(_b = audios.current) === null || _b === void 0 ? void 0 : _b.push(newElem);
|
|
121
|
+
rerenderAudios();
|
|
122
|
+
return newElem;
|
|
123
|
+
}, [numberOfAudioTags, refs, rerenderAudios]);
|
|
124
|
+
const unregisterAudio = (0, react_1.useCallback)((id) => {
|
|
125
|
+
var _a;
|
|
126
|
+
const cloned = [...takenAudios.current];
|
|
127
|
+
const index = refs.findIndex((r) => r.id === id);
|
|
128
|
+
if (index === -1) {
|
|
129
|
+
throw new TypeError('Error occured in ');
|
|
130
|
+
}
|
|
131
|
+
cloned[index] = false;
|
|
132
|
+
takenAudios.current = cloned;
|
|
133
|
+
audios.current = (_a = audios.current) === null || _a === void 0 ? void 0 : _a.filter((a) => a.id !== id);
|
|
134
|
+
rerenderAudios();
|
|
135
|
+
}, [refs, rerenderAudios]);
|
|
136
|
+
const updateAudio = (0, react_1.useCallback)(({ aud, audioId, id, }) => {
|
|
137
|
+
var _a;
|
|
138
|
+
let changed = false;
|
|
139
|
+
audios.current = (_a = audios.current) === null || _a === void 0 ? void 0 : _a.map((prevA) => {
|
|
140
|
+
if (prevA.id === id) {
|
|
141
|
+
const isTheSame = compareProps(aud, prevA.props);
|
|
142
|
+
if (isTheSame) {
|
|
143
|
+
return prevA;
|
|
144
|
+
}
|
|
145
|
+
changed = true;
|
|
146
|
+
return {
|
|
147
|
+
...prevA,
|
|
148
|
+
props: aud,
|
|
149
|
+
audioId,
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
return prevA;
|
|
153
|
+
});
|
|
154
|
+
if (changed) {
|
|
155
|
+
rerenderAudios();
|
|
156
|
+
}
|
|
157
|
+
}, [rerenderAudios]);
|
|
158
|
+
const playAllAudios = (0, react_1.useCallback)(() => {
|
|
159
|
+
refs.forEach((ref) => {
|
|
160
|
+
var _a;
|
|
161
|
+
(_a = ref.ref.current) === null || _a === void 0 ? void 0 : _a.play();
|
|
162
|
+
});
|
|
163
|
+
}, [refs]);
|
|
164
|
+
const value = (0, react_1.useMemo)(() => {
|
|
165
|
+
return {
|
|
166
|
+
registerAudio,
|
|
167
|
+
unregisterAudio,
|
|
168
|
+
updateAudio,
|
|
169
|
+
playAllAudios,
|
|
170
|
+
numberOfAudioTags,
|
|
171
|
+
};
|
|
172
|
+
}, [
|
|
173
|
+
numberOfAudioTags,
|
|
174
|
+
playAllAudios,
|
|
175
|
+
registerAudio,
|
|
176
|
+
unregisterAudio,
|
|
177
|
+
updateAudio,
|
|
178
|
+
]);
|
|
179
|
+
return ((0, jsx_runtime_1.jsxs)(exports.SharedAudioContext.Provider, { value: value, children: [refs.map(({ id, ref }) => {
|
|
180
|
+
return (0, jsx_runtime_1.jsx)("audio", { ref: ref, src: EMPTY_AUDIO }, id);
|
|
181
|
+
}), children] }));
|
|
182
|
+
};
|
|
183
|
+
exports.SharedAudioContextProvider = SharedAudioContextProvider;
|
|
184
|
+
const useSharedAudio = (aud, audioId) => {
|
|
185
|
+
const ctx = (0, react_1.useContext)(exports.SharedAudioContext);
|
|
186
|
+
/**
|
|
187
|
+
* We work around this in React 18 so an audio tag will only register itself once
|
|
188
|
+
*/
|
|
189
|
+
const [elem] = (0, react_1.useState)(() => {
|
|
190
|
+
if (ctx && ctx.numberOfAudioTags > 0) {
|
|
191
|
+
return ctx.registerAudio(aud, audioId);
|
|
192
|
+
}
|
|
193
|
+
return {
|
|
194
|
+
el: react_1.default.createRef(),
|
|
195
|
+
id: Math.random(),
|
|
196
|
+
props: aud,
|
|
197
|
+
audioId,
|
|
198
|
+
};
|
|
199
|
+
});
|
|
200
|
+
/**
|
|
201
|
+
* Effects in React 18 fire twice, and we are looking for a way to only fire it once.
|
|
202
|
+
* - useInsertionEffect only fires once. If it's available we are in React 18.
|
|
203
|
+
* - useLayoutEffect only fires once in React 17.
|
|
204
|
+
*/
|
|
205
|
+
const effectToUse = react_1.useInsertionEffect !== null && react_1.useInsertionEffect !== void 0 ? react_1.useInsertionEffect : react_1.useLayoutEffect;
|
|
206
|
+
if (typeof document !== 'undefined') {
|
|
207
|
+
effectToUse(() => {
|
|
208
|
+
if (ctx && ctx.numberOfAudioTags > 0) {
|
|
209
|
+
ctx.updateAudio({ id: elem.id, aud, audioId });
|
|
210
|
+
}
|
|
211
|
+
}, [aud, ctx, elem.id, audioId]);
|
|
212
|
+
effectToUse(() => {
|
|
213
|
+
return () => {
|
|
214
|
+
if (ctx && ctx.numberOfAudioTags > 0) {
|
|
215
|
+
ctx.unregisterAudio(elem.id);
|
|
216
|
+
}
|
|
217
|
+
};
|
|
218
|
+
}, [ctx, elem.id]);
|
|
219
|
+
}
|
|
220
|
+
return elem;
|
|
221
|
+
};
|
|
222
|
+
exports.useSharedAudio = useSharedAudio;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useFrameForVolumeProp = exports.useMediaStartsAt = void 0;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const Sequence_js_1 = require("../Sequence.js");
|
|
6
|
+
const use_current_frame_js_1 = require("../use-current-frame.js");
|
|
7
|
+
const useMediaStartsAt = () => {
|
|
8
|
+
var _a;
|
|
9
|
+
const parentSequence = (0, react_1.useContext)(Sequence_js_1.SequenceContext);
|
|
10
|
+
const startsAt = Math.min(0, (_a = parentSequence === null || parentSequence === void 0 ? void 0 : parentSequence.relativeFrom) !== null && _a !== void 0 ? _a : 0);
|
|
11
|
+
return startsAt;
|
|
12
|
+
};
|
|
13
|
+
exports.useMediaStartsAt = useMediaStartsAt;
|
|
14
|
+
/**
|
|
15
|
+
* When passing a function as the prop for `volume`,
|
|
16
|
+
* we calculate the way more intuitive value for currentFrame
|
|
17
|
+
*/
|
|
18
|
+
const useFrameForVolumeProp = () => {
|
|
19
|
+
const frame = (0, use_current_frame_js_1.useCurrentFrame)();
|
|
20
|
+
const startsAt = (0, exports.useMediaStartsAt)();
|
|
21
|
+
return frame + startsAt;
|
|
22
|
+
};
|
|
23
|
+
exports.useFrameForVolumeProp = useFrameForVolumeProp;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function bezier(mX1: number, mY1: number, mX2: number, mY2: number): (x: number) => number;
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Taken from https://github.com/facebook/react-native/blob/0b9ea60b4fee8cacc36e7160e31b91fc114dbc0d/Libraries/Animated/src/bezier.js
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.bezier = void 0;
|
|
5
|
+
const NEWTON_ITERATIONS = 4;
|
|
6
|
+
const NEWTON_MIN_SLOPE = 0.001;
|
|
7
|
+
const SUBDIVISION_PRECISION = 0.0000001;
|
|
8
|
+
const SUBDIVISION_MAX_ITERATIONS = 10;
|
|
9
|
+
const kSplineTableSize = 11;
|
|
10
|
+
const kSampleStepSize = 1.0 / (kSplineTableSize - 1.0);
|
|
11
|
+
const float32ArraySupported = typeof Float32Array === 'function';
|
|
12
|
+
function a(aA1, aA2) {
|
|
13
|
+
return 1.0 - 3.0 * aA2 + 3.0 * aA1;
|
|
14
|
+
}
|
|
15
|
+
function b(aA1, aA2) {
|
|
16
|
+
return 3.0 * aA2 - 6.0 * aA1;
|
|
17
|
+
}
|
|
18
|
+
function c(aA1) {
|
|
19
|
+
return 3.0 * aA1;
|
|
20
|
+
}
|
|
21
|
+
// Returns x(t) given t, x1, and x2, or y(t) given t, y1, and y2.
|
|
22
|
+
function calcBezier(aT, aA1, aA2) {
|
|
23
|
+
return ((a(aA1, aA2) * aT + b(aA1, aA2)) * aT + c(aA1)) * aT;
|
|
24
|
+
}
|
|
25
|
+
// Returns dx/dt given t, x1, and x2, or dy/dt given t, y1, and y2.
|
|
26
|
+
function getSlope(aT, aA1, aA2) {
|
|
27
|
+
return 3.0 * a(aA1, aA2) * aT * aT + 2.0 * b(aA1, aA2) * aT + c(aA1);
|
|
28
|
+
}
|
|
29
|
+
function binarySubdivide({ aX, _aA, _aB, mX1, mX2, }) {
|
|
30
|
+
let currentX;
|
|
31
|
+
let currentT;
|
|
32
|
+
let i = 0;
|
|
33
|
+
let aA = _aA;
|
|
34
|
+
let aB = _aB;
|
|
35
|
+
do {
|
|
36
|
+
currentT = aA + (aB - aA) / 2.0;
|
|
37
|
+
currentX = calcBezier(currentT, mX1, mX2) - aX;
|
|
38
|
+
if (currentX > 0.0) {
|
|
39
|
+
aB = currentT;
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
aA = currentT;
|
|
43
|
+
}
|
|
44
|
+
} while (Math.abs(currentX) > SUBDIVISION_PRECISION &&
|
|
45
|
+
++i < SUBDIVISION_MAX_ITERATIONS);
|
|
46
|
+
return currentT;
|
|
47
|
+
}
|
|
48
|
+
function newtonRaphsonIterate(aX, _aGuessT, mX1, mX2) {
|
|
49
|
+
let aGuessT = _aGuessT;
|
|
50
|
+
for (let i = 0; i < NEWTON_ITERATIONS; ++i) {
|
|
51
|
+
const currentSlope = getSlope(aGuessT, mX1, mX2);
|
|
52
|
+
if (currentSlope === 0.0) {
|
|
53
|
+
return aGuessT;
|
|
54
|
+
}
|
|
55
|
+
const currentX = calcBezier(aGuessT, mX1, mX2) - aX;
|
|
56
|
+
aGuessT -= currentX / currentSlope;
|
|
57
|
+
}
|
|
58
|
+
return aGuessT;
|
|
59
|
+
}
|
|
60
|
+
function bezier(mX1, mY1, mX2, mY2) {
|
|
61
|
+
if (!(mX1 >= 0 && mX1 <= 1 && mX2 >= 0 && mX2 <= 1)) {
|
|
62
|
+
throw new Error('bezier x values must be in [0, 1] range');
|
|
63
|
+
}
|
|
64
|
+
// Precompute samples table
|
|
65
|
+
const sampleValues = float32ArraySupported
|
|
66
|
+
? new Float32Array(kSplineTableSize)
|
|
67
|
+
: new Array(kSplineTableSize);
|
|
68
|
+
if (mX1 !== mY1 || mX2 !== mY2) {
|
|
69
|
+
for (let i = 0; i < kSplineTableSize; ++i) {
|
|
70
|
+
sampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
function getTForX(aX) {
|
|
74
|
+
let intervalStart = 0.0;
|
|
75
|
+
let currentSample = 1;
|
|
76
|
+
const lastSample = kSplineTableSize - 1;
|
|
77
|
+
for (; currentSample !== lastSample && sampleValues[currentSample] <= aX; ++currentSample) {
|
|
78
|
+
intervalStart += kSampleStepSize;
|
|
79
|
+
}
|
|
80
|
+
--currentSample;
|
|
81
|
+
// Interpolate to provide an initial guess for t
|
|
82
|
+
const dist = (aX - sampleValues[currentSample]) /
|
|
83
|
+
(sampleValues[currentSample + 1] - sampleValues[currentSample]);
|
|
84
|
+
const guessForT = intervalStart + dist * kSampleStepSize;
|
|
85
|
+
const initialSlope = getSlope(guessForT, mX1, mX2);
|
|
86
|
+
if (initialSlope >= NEWTON_MIN_SLOPE) {
|
|
87
|
+
return newtonRaphsonIterate(aX, guessForT, mX1, mX2);
|
|
88
|
+
}
|
|
89
|
+
if (initialSlope === 0.0) {
|
|
90
|
+
return guessForT;
|
|
91
|
+
}
|
|
92
|
+
return binarySubdivide({
|
|
93
|
+
aX,
|
|
94
|
+
_aA: intervalStart,
|
|
95
|
+
_aB: intervalStart + kSampleStepSize,
|
|
96
|
+
mX1,
|
|
97
|
+
mX2,
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
return function (x) {
|
|
101
|
+
if (mX1 === mY1 && mX2 === mY2) {
|
|
102
|
+
return x; // linear
|
|
103
|
+
}
|
|
104
|
+
// Because JavaScript number are imprecise, we should guarantee the extremes are right.
|
|
105
|
+
if (x === 0) {
|
|
106
|
+
return 0;
|
|
107
|
+
}
|
|
108
|
+
if (x === 1) {
|
|
109
|
+
return 1;
|
|
110
|
+
}
|
|
111
|
+
return calcBezier(getTForX(x), mY1, mY2);
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
exports.bezier = bezier;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function cancelRender(err: unknown): never;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.cancelRender = void 0;
|
|
4
|
+
const isErrorLike = (err) => {
|
|
5
|
+
if (err === null) {
|
|
6
|
+
return false;
|
|
7
|
+
}
|
|
8
|
+
if (typeof err !== 'object') {
|
|
9
|
+
return false;
|
|
10
|
+
}
|
|
11
|
+
if (!('stack' in err)) {
|
|
12
|
+
return false;
|
|
13
|
+
}
|
|
14
|
+
// eslint-disable-next-line @typescript-eslint/prefer-ts-expect-error
|
|
15
|
+
// @ts-ignore we just asserted
|
|
16
|
+
if (typeof err.stack !== 'string') {
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
19
|
+
if (!('message' in err)) {
|
|
20
|
+
return false;
|
|
21
|
+
}
|
|
22
|
+
// eslint-disable-next-line @typescript-eslint/prefer-ts-expect-error
|
|
23
|
+
// @ts-ignore we just asserted
|
|
24
|
+
if (typeof err.message !== 'string') {
|
|
25
|
+
return false;
|
|
26
|
+
}
|
|
27
|
+
return true;
|
|
28
|
+
};
|
|
29
|
+
function cancelRender(err) {
|
|
30
|
+
let error;
|
|
31
|
+
if (isErrorLike(err)) {
|
|
32
|
+
error = err;
|
|
33
|
+
}
|
|
34
|
+
else if (typeof err === 'string') {
|
|
35
|
+
error = Error(err);
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
error = Error('Rendering was cancelled');
|
|
39
|
+
}
|
|
40
|
+
window.remotion_cancelledError = error.stack;
|
|
41
|
+
throw error;
|
|
42
|
+
}
|
|
43
|
+
exports.cancelRender = cancelRender;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getInputProps: () => any;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getInputProps = void 0;
|
|
4
|
+
const get_environment_js_1 = require("../get-environment.js");
|
|
5
|
+
let didWarnSSRImport = false;
|
|
6
|
+
const warnOnceSSRImport = () => {
|
|
7
|
+
if (didWarnSSRImport) {
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
didWarnSSRImport = true;
|
|
11
|
+
console.warn('Called `getInputProps()` on the server. This function is not available server-side and has returned an empty object.');
|
|
12
|
+
console.warn("To hide this warning, don't call this function on the server:");
|
|
13
|
+
console.warn(" typeof window === 'undefined' ? {} : getInputProps()");
|
|
14
|
+
};
|
|
15
|
+
const getInputProps = () => {
|
|
16
|
+
if (typeof window === 'undefined') {
|
|
17
|
+
warnOnceSSRImport();
|
|
18
|
+
return {};
|
|
19
|
+
}
|
|
20
|
+
if ((0, get_environment_js_1.getRemotionEnvironment)() === 'player-development' ||
|
|
21
|
+
(0, get_environment_js_1.getRemotionEnvironment)() === 'player-production') {
|
|
22
|
+
throw new Error('You cannot call `getInputProps()` from a <Player>. Instead, the props are available as React props from component that you passed as `component` prop.');
|
|
23
|
+
}
|
|
24
|
+
const param = window.remotion_inputProps;
|
|
25
|
+
if (!param) {
|
|
26
|
+
return {};
|
|
27
|
+
}
|
|
28
|
+
const parsed = JSON.parse(param);
|
|
29
|
+
return parsed;
|
|
30
|
+
};
|
|
31
|
+
exports.getInputProps = getInputProps;
|