remotion 4.0.0-fastlambda.9 → 4.0.0-forcepublish.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +5 -5
- package/README.md +1 -1
- package/dist/AbsoluteFill.d.ts +6 -1
- package/dist/AbsoluteFill.js +5 -1
- package/dist/CanUseRemotionHooks.d.ts +5 -0
- package/dist/CanUseRemotionHooks.js +10 -0
- package/dist/Composition.d.ts +3 -6
- package/dist/Composition.js +40 -28
- package/dist/CompositionManager.d.ts +4 -12
- package/dist/CompositionManager.js +6 -2
- package/dist/Folder.d.ts +15 -0
- package/dist/Folder.js +33 -0
- package/dist/IFrame.js +1 -1
- package/dist/Img.js +29 -21
- package/dist/RemotionRoot.js +1 -1
- package/dist/{sequencing/index.d.ts → Sequence.d.ts} +8 -2
- package/dist/{sequencing/index.js → Sequence.js} +22 -18
- package/dist/Still.d.ts +1 -2
- package/dist/Still.js +1 -1
- package/dist/asset-types.d.ts +1 -4
- package/dist/audio/Audio.d.ts +2 -2
- package/dist/audio/Audio.js +5 -5
- package/dist/audio/AudioForDevelopment.d.ts +1 -1
- package/dist/audio/AudioForDevelopment.js +12 -2
- package/dist/audio/AudioForRendering.d.ts +2 -2
- package/dist/audio/AudioForRendering.js +9 -6
- package/dist/audio/index.js +5 -1
- package/dist/audio/props.d.ts +1 -1
- package/dist/audio/shared-audio-tags.d.ts +4 -3
- package/dist/audio/shared-audio-tags.js +115 -42
- package/dist/audio/use-audio-frame.js +4 -4
- package/dist/config/bundle-out-dir.d.ts +2 -0
- package/dist/config/bundle-out-dir.js +12 -0
- package/dist/config/input-props.js +12 -14
- package/dist/config/public-path.d.ts +2 -0
- package/dist/config/public-path.js +12 -0
- package/dist/{config/index.d.ts → config.d.ts} +58 -22
- 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 +1 -1
- package/dist/delay-render.js +4 -4
- package/dist/freeze.d.ts +2 -2
- package/dist/freeze.js +2 -2
- package/dist/get-timeline-clip-name.js +2 -1
- package/dist/index.d.ts +14 -7
- package/dist/index.js +15 -8
- package/dist/internals.d.ts +24 -101
- package/dist/internals.js +20 -94
- package/dist/{interpolateColors.d.ts → interpolate-colors.d.ts} +0 -0
- package/dist/{interpolateColors.js → interpolate-colors.js} +0 -0
- package/dist/loading-indicator.d.ts +2 -0
- package/dist/loading-indicator.js +35 -0
- package/dist/loop/index.js +1 -1
- package/dist/play-and-handle-not-allowed-error.d.ts +1 -1
- package/dist/portal-node.d.ts +1 -0
- package/dist/portal-node.js +23 -0
- package/dist/register-root.d.ts +2 -1
- package/dist/register-root.js +20 -5
- package/dist/series/index.d.ts +2 -2
- package/dist/series/index.js +4 -4
- package/dist/spring/index.d.ts +8 -4
- package/dist/spring/index.js +21 -6
- package/dist/spring/measure-spring.d.ts +1 -1
- package/dist/spring/measure-spring.js +1 -1
- package/dist/static-file.js +6 -0
- package/dist/timeline-position-state.d.ts +1 -1
- package/dist/{use-frame.d.ts → use-current-frame.d.ts} +0 -0
- package/dist/{use-frame.js → use-current-frame.js} +10 -2
- package/dist/use-lazy-component.d.ts +3 -3
- package/dist/use-lazy-component.js +5 -1
- package/dist/use-media-in-timeline.d.ts +2 -2
- package/dist/use-media-in-timeline.js +2 -2
- package/dist/use-media-playback.d.ts +3 -2
- package/dist/use-media-playback.js +9 -6
- package/dist/use-media-tag-volume.d.ts +1 -1
- package/dist/use-sync-volume-with-media-tag.d.ts +2 -2
- package/dist/use-unsafe-video-config.d.ts +1 -1
- package/dist/use-unsafe-video-config.js +2 -2
- package/dist/use-video-config.d.ts +1 -1
- package/dist/use-video-config.js +6 -0
- package/dist/validate-media-props.d.ts +4 -3
- package/dist/validation/validate-fps.d.ts +1 -1
- package/dist/validation/validate-fps.js +4 -1
- package/dist/validation/validate-offthreadvideo-image-format.d.ts +1 -0
- package/dist/validation/validate-offthreadvideo-image-format.js +15 -0
- package/dist/validation/validation-spring-duration.d.ts +1 -0
- package/dist/validation/validation-spring-duration.js +21 -0
- package/dist/video/OffthreadVideo.d.ts +3 -0
- package/dist/video/OffthreadVideo.js +27 -0
- package/dist/video/OffthreadVideoForRendering.d.ts +3 -0
- package/dist/video/OffthreadVideoForRendering.js +98 -0
- package/dist/video/Video.d.ts +2 -2
- package/dist/video/Video.js +4 -4
- package/dist/video/VideoForDevelopment.d.ts +6 -2
- package/dist/video/VideoForDevelopment.js +23 -2
- package/dist/video/VideoForRendering.d.ts +2 -2
- package/dist/video/VideoForRendering.js +47 -24
- package/dist/video/get-current-time.d.ts +7 -1
- package/dist/video/get-current-time.js +17 -9
- package/dist/video/index.d.ts +3 -2
- package/dist/video/index.js +5 -12
- package/dist/video/props.d.ts +13 -2
- package/dist/volume-prop.js +1 -1
- package/dist/warn-about-non-seekable-media.d.ts +1 -1
- package/dist/warn-about-non-seekable-media.js +14 -2
- package/dist/wrap-remotion-context.d.ts +2 -1
- package/dist/wrap-remotion-context.js +12 -4
- package/package.json +8 -9
- package/.turbo/turbo-lint.log +0 -11
- package/.turbo/turbo-test.log +0 -78
- package/dist/AbsoluteFill.d.ts.map +0 -1
- package/dist/AbsoluteFill.js.map +0 -1
- package/dist/Composition.d.ts.map +0 -1
- package/dist/Composition.js.map +0 -1
- package/dist/CompositionManager.d.ts.map +0 -1
- package/dist/CompositionManager.js.map +0 -1
- package/dist/IFrame.d.ts.map +0 -1
- package/dist/IFrame.js.map +0 -1
- package/dist/Img.d.ts.map +0 -1
- package/dist/Img.js.map +0 -1
- package/dist/RemotionRoot.d.ts.map +0 -1
- package/dist/RemotionRoot.js.map +0 -1
- package/dist/Still.d.ts.map +0 -1
- package/dist/Still.js.map +0 -1
- package/dist/absolute-src.d.ts.map +0 -1
- package/dist/absolute-src.js.map +0 -1
- package/dist/asset-types.d.ts.map +0 -1
- package/dist/asset-types.js.map +0 -1
- package/dist/audio/Audio.d.ts.map +0 -1
- package/dist/audio/Audio.js.map +0 -1
- package/dist/audio/AudioForDevelopment.d.ts.map +0 -1
- package/dist/audio/AudioForDevelopment.js.map +0 -1
- package/dist/audio/AudioForRendering.d.ts.map +0 -1
- package/dist/audio/AudioForRendering.js.map +0 -1
- package/dist/audio/index.d.ts.map +0 -1
- package/dist/audio/index.js.map +0 -1
- package/dist/audio/props.d.ts.map +0 -1
- package/dist/audio/props.js.map +0 -1
- package/dist/audio/shared-audio-tags.d.ts.map +0 -1
- package/dist/audio/shared-audio-tags.js.map +0 -1
- package/dist/audio/use-audio-frame.d.ts.map +0 -1
- package/dist/audio/use-audio-frame.js.map +0 -1
- package/dist/bezier.d.ts.map +0 -1
- package/dist/bezier.js.map +0 -1
- package/dist/compress-assets.d.ts +0 -7
- package/dist/compress-assets.d.ts.map +0 -1
- package/dist/compress-assets.js +0 -25
- package/dist/compress-assets.js.map +0 -1
- package/dist/config/browser-executable.d.ts +0 -3
- package/dist/config/browser-executable.d.ts.map +0 -1
- package/dist/config/browser-executable.js +0 -12
- package/dist/config/browser-executable.js.map +0 -1
- package/dist/config/browser.d.ts +0 -4
- package/dist/config/browser.d.ts.map +0 -1
- package/dist/config/browser.js +0 -19
- package/dist/config/browser.js.map +0 -1
- package/dist/config/chromium-flags.d.ts +0 -10
- package/dist/config/chromium-flags.d.ts.map +0 -1
- package/dist/config/chromium-flags.js +0 -34
- package/dist/config/chromium-flags.js.map +0 -1
- package/dist/config/codec.d.ts +0 -17
- package/dist/config/codec.d.ts.map +0 -1
- package/dist/config/codec.js +0 -103
- package/dist/config/codec.js.map +0 -1
- package/dist/config/concurrency.d.ts +0 -3
- package/dist/config/concurrency.d.ts.map +0 -1
- package/dist/config/concurrency.js +0 -15
- package/dist/config/concurrency.js.map +0 -1
- package/dist/config/crf.d.ts +0 -9
- package/dist/config/crf.d.ts.map +0 -1
- package/dist/config/crf.js +0 -83
- package/dist/config/crf.js.map +0 -1
- package/dist/config/env-file.d.ts +0 -2
- package/dist/config/env-file.d.ts.map +0 -1
- package/dist/config/env-file.js +0 -10
- package/dist/config/env-file.js.map +0 -1
- package/dist/config/ffmpeg-executable.d.ts +0 -3
- package/dist/config/ffmpeg-executable.d.ts.map +0 -1
- package/dist/config/ffmpeg-executable.js +0 -12
- package/dist/config/ffmpeg-executable.js.map +0 -1
- package/dist/config/frame-range.d.ts +0 -5
- package/dist/config/frame-range.d.ts.map +0 -1
- package/dist/config/frame-range.js +0 -80
- package/dist/config/frame-range.js.map +0 -1
- package/dist/config/image-format.d.ts +0 -8
- package/dist/config/image-format.d.ts.map +0 -1
- package/dist/config/image-format.js +0 -37
- package/dist/config/image-format.js.map +0 -1
- package/dist/config/image-sequence.d.ts +0 -3
- package/dist/config/image-sequence.d.ts.map +0 -1
- package/dist/config/image-sequence.js +0 -15
- package/dist/config/image-sequence.js.map +0 -1
- package/dist/config/index.d.ts.map +0 -1
- package/dist/config/index.js +0 -175
- package/dist/config/index.js.map +0 -1
- package/dist/config/input-props.d.ts.map +0 -1
- package/dist/config/input-props.js.map +0 -1
- package/dist/config/log.d.ts +0 -7
- package/dist/config/log.d.ts.map +0 -1
- package/dist/config/log.js +0 -25
- package/dist/config/log.js.map +0 -1
- package/dist/config/max-timeline-tracks.d.ts +0 -2
- package/dist/config/max-timeline-tracks.d.ts.map +0 -1
- package/dist/config/max-timeline-tracks.js +0 -24
- package/dist/config/max-timeline-tracks.js.map +0 -1
- package/dist/config/override-webpack.d.ts +0 -12
- package/dist/config/override-webpack.d.ts.map +0 -1
- package/dist/config/override-webpack.js +0 -14
- package/dist/config/override-webpack.js.map +0 -1
- package/dist/config/overwrite.d.ts +0 -3
- package/dist/config/overwrite.d.ts.map +0 -1
- package/dist/config/overwrite.js +0 -14
- package/dist/config/overwrite.js.map +0 -1
- package/dist/config/pixel-format.d.ts +0 -8
- package/dist/config/pixel-format.d.ts.map +0 -1
- package/dist/config/pixel-format.js +0 -38
- package/dist/config/pixel-format.js.map +0 -1
- package/dist/config/preview-server.d.ts +0 -2
- package/dist/config/preview-server.d.ts.map +0 -1
- package/dist/config/preview-server.js +0 -20
- package/dist/config/preview-server.js.map +0 -1
- package/dist/config/prores-profile.d.ts +0 -7
- package/dist/config/prores-profile.d.ts.map +0 -1
- package/dist/config/prores-profile.js +0 -32
- package/dist/config/prores-profile.js.map +0 -1
- package/dist/config/quality.d.ts +0 -2
- package/dist/config/quality.d.ts.map +0 -1
- package/dist/config/quality.js +0 -17
- package/dist/config/quality.js.map +0 -1
- package/dist/config/scale.d.ts +0 -3
- package/dist/config/scale.d.ts.map +0 -1
- package/dist/config/scale.js +0 -15
- package/dist/config/scale.js.map +0 -1
- package/dist/config/still-frame.d.ts +0 -2
- package/dist/config/still-frame.d.ts.map +0 -1
- package/dist/config/still-frame.js +0 -12
- package/dist/config/still-frame.js.map +0 -1
- package/dist/config/timeout.d.ts +0 -2
- package/dist/config/timeout.d.ts.map +0 -1
- package/dist/config/timeout.js +0 -17
- package/dist/config/timeout.js.map +0 -1
- package/dist/config/webpack-caching.d.ts +0 -3
- package/dist/config/webpack-caching.d.ts.map +0 -1
- package/dist/config/webpack-caching.js +0 -16
- package/dist/config/webpack-caching.js.map +0 -1
- package/dist/default-css.d.ts.map +0 -1
- package/dist/default-css.js.map +0 -1
- package/dist/delay-render.d.ts.map +0 -1
- package/dist/delay-render.js.map +0 -1
- package/dist/easing.d.ts.map +0 -1
- package/dist/easing.js.map +0 -1
- package/dist/feature-flags.d.ts +0 -1
- package/dist/feature-flags.d.ts.map +0 -1
- package/dist/feature-flags.js +0 -7
- package/dist/feature-flags.js.map +0 -1
- package/dist/freeze.d.ts.map +0 -1
- package/dist/freeze.js.map +0 -1
- package/dist/get-asset-file-name.d.ts.map +0 -1
- package/dist/get-asset-file-name.js.map +0 -1
- package/dist/get-environment.d.ts.map +0 -1
- package/dist/get-environment.js.map +0 -1
- package/dist/get-preview-dom-element.d.ts.map +0 -1
- package/dist/get-preview-dom-element.js.map +0 -1
- package/dist/get-timeline-clip-name.d.ts.map +0 -1
- package/dist/get-timeline-clip-name.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/initial-frame.d.ts +0 -2
- package/dist/initial-frame.d.ts.map +0 -1
- package/dist/initial-frame.js +0 -12
- package/dist/initial-frame.js.map +0 -1
- package/dist/internals.d.ts.map +0 -1
- package/dist/internals.js.map +0 -1
- package/dist/interpolate.d.ts.map +0 -1
- package/dist/interpolate.js.map +0 -1
- package/dist/interpolateColors.d.ts.map +0 -1
- package/dist/interpolateColors.js.map +0 -1
- package/dist/is-approximately-the-same.d.ts.map +0 -1
- package/dist/is-approximately-the-same.js.map +0 -1
- package/dist/is-audio-codec.d.ts +0 -2
- package/dist/is-audio-codec.d.ts.map +0 -1
- package/dist/is-audio-codec.js +0 -7
- package/dist/is-audio-codec.js.map +0 -1
- package/dist/loop/index.d.ts.map +0 -1
- package/dist/loop/index.js.map +0 -1
- package/dist/multiple-versions-warning.d.ts.map +0 -1
- package/dist/multiple-versions-warning.js.map +0 -1
- package/dist/nonce.d.ts.map +0 -1
- package/dist/nonce.js.map +0 -1
- package/dist/perf/index.d.ts +0 -5
- package/dist/perf/index.d.ts.map +0 -1
- package/dist/perf/index.js +0 -33
- package/dist/perf/index.js.map +0 -1
- package/dist/play-and-handle-not-allowed-error.d.ts.map +0 -1
- package/dist/play-and-handle-not-allowed-error.js.map +0 -1
- package/dist/random.d.ts.map +0 -1
- package/dist/random.js.map +0 -1
- package/dist/register-root.d.ts.map +0 -1
- package/dist/register-root.js.map +0 -1
- package/dist/sequencing/index.d.ts.map +0 -1
- package/dist/sequencing/index.js.map +0 -1
- package/dist/series/flatten-children.d.ts.map +0 -1
- package/dist/series/flatten-children.js.map +0 -1
- package/dist/series/index.d.ts.map +0 -1
- package/dist/series/index.js.map +0 -1
- package/dist/setup-env-variables.d.ts.map +0 -1
- package/dist/setup-env-variables.js.map +0 -1
- package/dist/spring/index.d.ts.map +0 -1
- package/dist/spring/index.js.map +0 -1
- package/dist/spring/measure-spring.d.ts.map +0 -1
- package/dist/spring/measure-spring.js.map +0 -1
- package/dist/spring/spring-utils.d.ts.map +0 -1
- package/dist/spring/spring-utils.js.map +0 -1
- package/dist/static-file.d.ts.map +0 -1
- package/dist/static-file.js.map +0 -1
- package/dist/timeline-inout-position-state.d.ts +0 -12
- package/dist/timeline-inout-position-state.d.ts.map +0 -1
- package/dist/timeline-inout-position-state.js +0 -23
- package/dist/timeline-inout-position-state.js.map +0 -1
- package/dist/timeline-position-state.d.ts.map +0 -1
- package/dist/timeline-position-state.js.map +0 -1
- package/dist/timeout.d.ts +0 -2
- package/dist/timeout.d.ts.map +0 -1
- package/dist/timeout.js +0 -12
- package/dist/timeout.js.map +0 -1
- package/dist/truthy.d.ts.map +0 -1
- package/dist/truthy.js.map +0 -1
- package/dist/use-frame.d.ts.map +0 -1
- package/dist/use-frame.js.map +0 -1
- package/dist/use-lazy-component.d.ts.map +0 -1
- package/dist/use-lazy-component.js.map +0 -1
- package/dist/use-media-in-timeline.d.ts.map +0 -1
- package/dist/use-media-in-timeline.js.map +0 -1
- package/dist/use-media-playback.d.ts.map +0 -1
- package/dist/use-media-playback.js.map +0 -1
- package/dist/use-media-tag-volume.d.ts.map +0 -1
- package/dist/use-media-tag-volume.js.map +0 -1
- package/dist/use-sync-volume-with-media-tag.d.ts.map +0 -1
- package/dist/use-sync-volume-with-media-tag.js.map +0 -1
- package/dist/use-unsafe-video-config.d.ts.map +0 -1
- package/dist/use-unsafe-video-config.js.map +0 -1
- package/dist/use-video-config.d.ts.map +0 -1
- package/dist/use-video-config.js.map +0 -1
- package/dist/use-video.d.ts.map +0 -1
- package/dist/use-video.js.map +0 -1
- package/dist/validate-media-props.d.ts.map +0 -1
- package/dist/validate-media-props.js.map +0 -1
- package/dist/validate-start-from-props.d.ts.map +0 -1
- package/dist/validate-start-from-props.js.map +0 -1
- package/dist/validation/validate-composition-id.d.ts.map +0 -1
- package/dist/validation/validate-composition-id.js.map +0 -1
- package/dist/validation/validate-dimensions.d.ts.map +0 -1
- package/dist/validation/validate-dimensions.js.map +0 -1
- package/dist/validation/validate-duration-in-frames.d.ts.map +0 -1
- package/dist/validation/validate-duration-in-frames.js.map +0 -1
- package/dist/validation/validate-folder-name.d.ts.map +0 -1
- package/dist/validation/validate-folder-name.js.map +0 -1
- package/dist/validation/validate-fps.d.ts.map +0 -1
- package/dist/validation/validate-fps.js.map +0 -1
- package/dist/validation/validate-frame.d.ts +0 -1
- package/dist/validation/validate-frame.d.ts.map +0 -1
- package/dist/validation/validate-frame.js +0 -24
- package/dist/validation/validate-frame.js.map +0 -1
- package/dist/validation/validate-image-format.d.ts +0 -2
- package/dist/validation/validate-image-format.d.ts.map +0 -1
- package/dist/validation/validate-image-format.js +0 -9
- package/dist/validation/validate-image-format.js.map +0 -1
- package/dist/validation/validate-opengl-renderer.d.ts +0 -4
- package/dist/validation/validate-opengl-renderer.d.ts.map +0 -1
- package/dist/validation/validate-opengl-renderer.js +0 -14
- package/dist/validation/validate-opengl-renderer.js.map +0 -1
- package/dist/validation/validate-quality.d.ts +0 -1
- package/dist/validation/validate-quality.d.ts.map +0 -1
- package/dist/validation/validate-quality.js +0 -21
- package/dist/validation/validate-quality.js.map +0 -1
- package/dist/video/Video.d.ts.map +0 -1
- package/dist/video/Video.js.map +0 -1
- package/dist/video/VideoForDevelopment.d.ts.map +0 -1
- package/dist/video/VideoForDevelopment.js.map +0 -1
- package/dist/video/VideoForRendering.d.ts.map +0 -1
- package/dist/video/VideoForRendering.js.map +0 -1
- package/dist/video/get-current-time.d.ts.map +0 -1
- package/dist/video/get-current-time.js.map +0 -1
- package/dist/video/index.d.ts.map +0 -1
- package/dist/video/index.js.map +0 -1
- package/dist/video/props.d.ts.map +0 -1
- package/dist/video/props.js.map +0 -1
- package/dist/video-config.d.ts.map +0 -1
- package/dist/video-config.js.map +0 -1
- package/dist/volume-position-state.d.ts.map +0 -1
- package/dist/volume-position-state.js.map +0 -1
- package/dist/volume-prop.d.ts.map +0 -1
- package/dist/volume-prop.js.map +0 -1
- package/dist/warn-about-non-seekable-media.d.ts.map +0 -1
- package/dist/warn-about-non-seekable-media.js.map +0 -1
- package/dist/wrap-remotion-context.d.ts.map +0 -1
- package/dist/wrap-remotion-context.js.map +0 -1
|
@@ -3,6 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.AudioForDevelopment = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
|
+
const random_1 = require("../random");
|
|
7
|
+
const Sequence_1 = require("../Sequence");
|
|
6
8
|
const use_media_in_timeline_1 = require("../use-media-in-timeline");
|
|
7
9
|
const use_media_playback_1 = require("../use-media-playback");
|
|
8
10
|
const use_media_tag_volume_1 = require("../use-media-tag-volume");
|
|
@@ -25,7 +27,14 @@ const AudioForDevelopmentForwardRefFunction = (props, ref) => {
|
|
|
25
27
|
...nativeProps,
|
|
26
28
|
};
|
|
27
29
|
}, [mediaMuted, muted, nativeProps]);
|
|
28
|
-
const
|
|
30
|
+
const sequenceContext = (0, react_1.useContext)(Sequence_1.SequenceContext);
|
|
31
|
+
// Generate a string that's as unique as possible for this asset
|
|
32
|
+
// but at the same time deterministic. We use it to combat strict mode issues.
|
|
33
|
+
const id = (0, react_1.useMemo)(() => {
|
|
34
|
+
var _a;
|
|
35
|
+
return `audio-${(0, random_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}-muted:${props.muted}`;
|
|
36
|
+
}, [props.muted, props.src, sequenceContext]);
|
|
37
|
+
const audioRef = (0, shared_audio_tags_1.useSharedAudio)(propsToPass, id).el;
|
|
29
38
|
const actualVolume = (0, use_media_tag_volume_1.useMediaTagVolume)(audioRef);
|
|
30
39
|
(0, use_sync_volume_with_media_tag_1.useSyncVolumeWithMediaTag)({
|
|
31
40
|
volumePropFrame,
|
|
@@ -46,6 +55,7 @@ const AudioForDevelopmentForwardRefFunction = (props, ref) => {
|
|
|
46
55
|
src: nativeProps.src,
|
|
47
56
|
mediaType: 'audio',
|
|
48
57
|
playbackRate: playbackRate !== null && playbackRate !== void 0 ? playbackRate : 1,
|
|
58
|
+
onlyWarnForMediaSeekingError: false,
|
|
49
59
|
});
|
|
50
60
|
(0, react_1.useImperativeHandle)(ref, () => {
|
|
51
61
|
return audioRef.current;
|
|
@@ -53,6 +63,6 @@ const AudioForDevelopmentForwardRefFunction = (props, ref) => {
|
|
|
53
63
|
if (initialShouldPreMountAudioElements) {
|
|
54
64
|
return null;
|
|
55
65
|
}
|
|
56
|
-
return (0, jsx_runtime_1.jsx)("audio", { ref: audioRef, ...propsToPass }
|
|
66
|
+
return (0, jsx_runtime_1.jsx)("audio", { ref: audioRef, ...propsToPass });
|
|
57
67
|
};
|
|
58
68
|
exports.AudioForDevelopment = (0, react_1.forwardRef)(AudioForDevelopmentForwardRefFunction);
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { RemotionAudioProps } from './props';
|
|
3
|
-
export declare const AudioForRendering: React.ForwardRefExoticComponent<Pick<RemotionAudioProps, "style" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "
|
|
2
|
+
import type { RemotionAudioProps } from './props';
|
|
3
|
+
export declare const AudioForRendering: React.ForwardRefExoticComponent<Pick<RemotionAudioProps, "id" | "style" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "lang" | "placeholder" | "slot" | "spellCheck" | "tabIndex" | "title" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "src" | "volume" | "playbackRate" | "controlsList" | "crossOrigin" | "mediaGroup" | "muted" | "playsInline" | "preload" | "key"> & React.RefAttributes<HTMLAudioElement>>;
|
|
@@ -6,16 +6,16 @@ const react_1 = require("react");
|
|
|
6
6
|
const absolute_src_1 = require("../absolute-src");
|
|
7
7
|
const CompositionManager_1 = require("../CompositionManager");
|
|
8
8
|
const random_1 = require("../random");
|
|
9
|
-
const
|
|
10
|
-
const
|
|
9
|
+
const Sequence_1 = require("../Sequence");
|
|
10
|
+
const use_current_frame_1 = require("../use-current-frame");
|
|
11
11
|
const volume_prop_1 = require("../volume-prop");
|
|
12
12
|
const use_audio_frame_1 = require("./use-audio-frame");
|
|
13
13
|
const AudioForRenderingRefForwardingFunction = (props, ref) => {
|
|
14
14
|
const audioRef = (0, react_1.useRef)(null);
|
|
15
|
-
const absoluteFrame = (0,
|
|
15
|
+
const absoluteFrame = (0, use_current_frame_1.useAbsoluteCurrentFrame)();
|
|
16
16
|
const volumePropFrame = (0, use_audio_frame_1.useFrameForVolumeProp)();
|
|
17
|
-
const frame = (0,
|
|
18
|
-
const sequenceContext = (0, react_1.useContext)(
|
|
17
|
+
const frame = (0, use_current_frame_1.useCurrentFrame)();
|
|
18
|
+
const sequenceContext = (0, react_1.useContext)(Sequence_1.SequenceContext);
|
|
19
19
|
const { registerAsset, unregisterAsset } = (0, react_1.useContext)(CompositionManager_1.CompositionManager);
|
|
20
20
|
// Generate a string that's as unique as possible for this asset
|
|
21
21
|
// but at the same time the same on all threads
|
|
@@ -37,6 +37,9 @@ const AudioForRenderingRefForwardingFunction = (props, ref) => {
|
|
|
37
37
|
if (!props.src) {
|
|
38
38
|
throw new Error('No src passed');
|
|
39
39
|
}
|
|
40
|
+
if (!window.remotion_audioEnabled) {
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
40
43
|
if (props.muted) {
|
|
41
44
|
return;
|
|
42
45
|
}
|
|
@@ -63,6 +66,6 @@ const AudioForRenderingRefForwardingFunction = (props, ref) => {
|
|
|
63
66
|
playbackRate,
|
|
64
67
|
props.playbackRate,
|
|
65
68
|
]);
|
|
66
|
-
return (0, jsx_runtime_1.jsx)("audio", { ref: audioRef, ...nativeProps }
|
|
69
|
+
return (0, jsx_runtime_1.jsx)("audio", { ref: audioRef, ...nativeProps });
|
|
67
70
|
};
|
|
68
71
|
exports.AudioForRendering = (0, react_1.forwardRef)(AudioForRenderingRefForwardingFunction);
|
package/dist/audio/index.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
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);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
package/dist/audio/props.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { RemotionAudioProps } from './props';
|
|
2
|
+
import type { RemotionAudioProps } from './props';
|
|
3
3
|
/**
|
|
4
4
|
* This functionality of Remotion will keep a certain amount
|
|
5
5
|
* of <audio> tags pre-mounted and by default filled with an empty audio track.
|
|
@@ -15,9 +15,10 @@ declare type AudioElem = {
|
|
|
15
15
|
id: number;
|
|
16
16
|
props: RemotionAudioProps;
|
|
17
17
|
el: React.RefObject<HTMLAudioElement>;
|
|
18
|
+
audioId: string;
|
|
18
19
|
};
|
|
19
20
|
declare type SharedContext = {
|
|
20
|
-
registerAudio: (aud: RemotionAudioProps) => AudioElem;
|
|
21
|
+
registerAudio: (aud: RemotionAudioProps, audioId: string) => AudioElem;
|
|
21
22
|
unregisterAudio: (id: number) => void;
|
|
22
23
|
updateAudio: (id: number, aud: RemotionAudioProps) => void;
|
|
23
24
|
playAllAudios: () => void;
|
|
@@ -28,5 +29,5 @@ export declare const SharedAudioContextProvider: React.FC<{
|
|
|
28
29
|
numberOfAudioTags: number;
|
|
29
30
|
children: React.ReactNode;
|
|
30
31
|
}>;
|
|
31
|
-
export declare const useSharedAudio: (aud: RemotionAudioProps) => AudioElem;
|
|
32
|
+
export declare const useSharedAudio: (aud: RemotionAudioProps, audioId: string) => AudioElem;
|
|
32
33
|
export {};
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
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);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -23,9 +27,40 @@ exports.useSharedAudio = exports.SharedAudioContextProvider = exports.SharedAudi
|
|
|
23
27
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
24
28
|
const react_1 = __importStar(require("react"));
|
|
25
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
|
+
};
|
|
26
61
|
exports.SharedAudioContext = (0, react_1.createContext)(null);
|
|
27
62
|
const SharedAudioContextProvider = ({ children, numberOfAudioTags }) => {
|
|
28
|
-
const
|
|
63
|
+
const audios = (0, react_1.useRef)([]);
|
|
29
64
|
const [initialNumberOfAudioTags] = (0, react_1.useState)(numberOfAudioTags);
|
|
30
65
|
if (numberOfAudioTags !== initialNumberOfAudioTags) {
|
|
31
66
|
throw new Error('The number of shared audio tags has changed dynamically. Once you have set this property, you cannot change it afterwards.');
|
|
@@ -36,7 +71,38 @@ const SharedAudioContextProvider = ({ children, numberOfAudioTags }) => {
|
|
|
36
71
|
});
|
|
37
72
|
}, [numberOfAudioTags]);
|
|
38
73
|
const takenAudios = (0, react_1.useRef)(new Array(numberOfAudioTags).fill(false));
|
|
39
|
-
const
|
|
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
|
+
}
|
|
40
106
|
const firstFreeAudio = takenAudios.current.findIndex((a) => a === false);
|
|
41
107
|
if (firstFreeAudio === -1) {
|
|
42
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.`);
|
|
@@ -49,17 +115,14 @@ const SharedAudioContextProvider = ({ children, numberOfAudioTags }) => {
|
|
|
49
115
|
props: aud,
|
|
50
116
|
id,
|
|
51
117
|
el: ref,
|
|
118
|
+
audioId,
|
|
52
119
|
};
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
// to be updated in the next tick.
|
|
56
|
-
// This can lead to a tiny delay of audio playback, improvement ideas are welcome.
|
|
57
|
-
setTimeout(() => {
|
|
58
|
-
setAudios((prevAudios) => [...prevAudios, newElem]);
|
|
59
|
-
}, 4);
|
|
120
|
+
(_b = audios.current) === null || _b === void 0 ? void 0 : _b.push(newElem);
|
|
121
|
+
rerenderAudios();
|
|
60
122
|
return newElem;
|
|
61
|
-
}, [numberOfAudioTags, refs]);
|
|
123
|
+
}, [numberOfAudioTags, refs, rerenderAudios]);
|
|
62
124
|
const unregisterAudio = (0, react_1.useCallback)((id) => {
|
|
125
|
+
var _a;
|
|
63
126
|
const cloned = [...takenAudios.current];
|
|
64
127
|
const index = refs.findIndex((r) => r.id === id);
|
|
65
128
|
if (index === -1) {
|
|
@@ -67,23 +130,30 @@ const SharedAudioContextProvider = ({ children, numberOfAudioTags }) => {
|
|
|
67
130
|
}
|
|
68
131
|
cloned[index] = false;
|
|
69
132
|
takenAudios.current = cloned;
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
}, [refs]);
|
|
133
|
+
audios.current = (_a = audios.current) === null || _a === void 0 ? void 0 : _a.filter((a) => a.id !== id);
|
|
134
|
+
rerenderAudios();
|
|
135
|
+
}, [refs, rerenderAudios]);
|
|
74
136
|
const updateAudio = (0, react_1.useCallback)((id, aud) => {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
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;
|
|
82
144
|
}
|
|
83
|
-
|
|
84
|
-
|
|
145
|
+
changed = true;
|
|
146
|
+
return {
|
|
147
|
+
...prevA,
|
|
148
|
+
props: aud,
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
return prevA;
|
|
85
152
|
});
|
|
86
|
-
|
|
153
|
+
if (changed) {
|
|
154
|
+
rerenderAudios();
|
|
155
|
+
}
|
|
156
|
+
}, [rerenderAudios]);
|
|
87
157
|
const playAllAudios = (0, react_1.useCallback)(() => {
|
|
88
158
|
refs.forEach((ref) => {
|
|
89
159
|
var _a;
|
|
@@ -106,41 +176,44 @@ const SharedAudioContextProvider = ({ children, numberOfAudioTags }) => {
|
|
|
106
176
|
updateAudio,
|
|
107
177
|
]);
|
|
108
178
|
return ((0, jsx_runtime_1.jsxs)(exports.SharedAudioContext.Provider, { value: value, children: [refs.map(({ id, ref }) => {
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
return (0, jsx_runtime_1.jsx)("audio", { ref: ref, src: EMPTY_AUDIO }, id);
|
|
112
|
-
}
|
|
113
|
-
if (!data) {
|
|
114
|
-
throw new TypeError('Expected audio data to be there');
|
|
115
|
-
}
|
|
116
|
-
return (0, jsx_runtime_1.jsx)("audio", { ref: ref, ...data.props }, id);
|
|
117
|
-
}), children] }, void 0));
|
|
179
|
+
return (0, jsx_runtime_1.jsx)("audio", { ref: ref, src: EMPTY_AUDIO }, id);
|
|
180
|
+
}), children] }));
|
|
118
181
|
};
|
|
119
182
|
exports.SharedAudioContextProvider = SharedAudioContextProvider;
|
|
120
|
-
const useSharedAudio = (aud) => {
|
|
183
|
+
const useSharedAudio = (aud, audioId) => {
|
|
121
184
|
const ctx = (0, react_1.useContext)(exports.SharedAudioContext);
|
|
185
|
+
/**
|
|
186
|
+
* We work around this in React 18 so an audio tag will only register itself once
|
|
187
|
+
*/
|
|
122
188
|
const [elem] = (0, react_1.useState)(() => {
|
|
123
189
|
if (ctx && ctx.numberOfAudioTags > 0) {
|
|
124
|
-
return ctx.registerAudio(aud);
|
|
190
|
+
return ctx.registerAudio(aud, audioId);
|
|
125
191
|
}
|
|
126
192
|
return {
|
|
127
193
|
el: react_1.default.createRef(),
|
|
128
194
|
id: Math.random(),
|
|
129
195
|
props: aud,
|
|
196
|
+
audioId,
|
|
130
197
|
};
|
|
131
198
|
});
|
|
132
|
-
|
|
199
|
+
/**
|
|
200
|
+
* Effects in React 18 fire twice, and we are looking for a way to only fire it once.
|
|
201
|
+
* - useInsertionEffect only fires once. If it's available we are in React 18.
|
|
202
|
+
* - useLayoutEffect only fires once in React 17.
|
|
203
|
+
*/
|
|
204
|
+
const effectToUse = react_1.useInsertionEffect !== null && react_1.useInsertionEffect !== void 0 ? react_1.useInsertionEffect : react_1.useLayoutEffect;
|
|
205
|
+
effectToUse(() => {
|
|
206
|
+
if (ctx && ctx.numberOfAudioTags > 0) {
|
|
207
|
+
ctx.updateAudio(elem.id, aud);
|
|
208
|
+
}
|
|
209
|
+
}, [aud, ctx, elem.id]);
|
|
210
|
+
effectToUse(() => {
|
|
133
211
|
return () => {
|
|
134
212
|
if (ctx && ctx.numberOfAudioTags > 0) {
|
|
135
213
|
ctx.unregisterAudio(elem.id);
|
|
136
214
|
}
|
|
137
215
|
};
|
|
138
216
|
}, [ctx, elem.id]);
|
|
139
|
-
(0, react_1.useEffect)(() => {
|
|
140
|
-
if (ctx && ctx.numberOfAudioTags > 0) {
|
|
141
|
-
ctx.updateAudio(elem.id, aud);
|
|
142
|
-
}
|
|
143
|
-
}, [aud, ctx, elem.id]);
|
|
144
217
|
return elem;
|
|
145
218
|
};
|
|
146
219
|
exports.useSharedAudio = useSharedAudio;
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.useFrameForVolumeProp = exports.useMediaStartsAt = void 0;
|
|
4
4
|
const react_1 = require("react");
|
|
5
|
-
const
|
|
6
|
-
const
|
|
5
|
+
const Sequence_1 = require("../Sequence");
|
|
6
|
+
const use_current_frame_1 = require("../use-current-frame");
|
|
7
7
|
const useMediaStartsAt = () => {
|
|
8
8
|
var _a;
|
|
9
|
-
const parentSequence = (0, react_1.useContext)(
|
|
9
|
+
const parentSequence = (0, react_1.useContext)(Sequence_1.SequenceContext);
|
|
10
10
|
const startsAt = Math.min(0, (_a = parentSequence === null || parentSequence === void 0 ? void 0 : parentSequence.relativeFrom) !== null && _a !== void 0 ? _a : 0);
|
|
11
11
|
return startsAt;
|
|
12
12
|
};
|
|
@@ -16,7 +16,7 @@ exports.useMediaStartsAt = useMediaStartsAt;
|
|
|
16
16
|
* we calculate the way more intuitive value for currentFrame
|
|
17
17
|
*/
|
|
18
18
|
const useFrameForVolumeProp = () => {
|
|
19
|
-
const frame = (0,
|
|
19
|
+
const frame = (0, use_current_frame_1.useCurrentFrame)();
|
|
20
20
|
const startsAt = (0, exports.useMediaStartsAt)();
|
|
21
21
|
return frame + startsAt;
|
|
22
22
|
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.setBundleOutDir = exports.getBundleOutDir = void 0;
|
|
4
|
+
let bundleOutDir = null;
|
|
5
|
+
const getBundleOutDir = () => {
|
|
6
|
+
return bundleOutDir;
|
|
7
|
+
};
|
|
8
|
+
exports.getBundleOutDir = getBundleOutDir;
|
|
9
|
+
const setBundleOutDir = (path) => {
|
|
10
|
+
bundleOutDir = path;
|
|
11
|
+
};
|
|
12
|
+
exports.setBundleOutDir = setBundleOutDir;
|
|
@@ -13,21 +13,19 @@ const warnOnceSSRImport = () => {
|
|
|
13
13
|
console.warn(" typeof window === 'undefined' ? {} : getInputProps()");
|
|
14
14
|
};
|
|
15
15
|
const getInputProps = () => {
|
|
16
|
-
if (
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
return {};
|
|
20
|
-
}
|
|
21
|
-
const param = window.remotion_inputProps;
|
|
22
|
-
if (!param) {
|
|
23
|
-
return {};
|
|
24
|
-
}
|
|
25
|
-
const parsed = JSON.parse(param);
|
|
26
|
-
return parsed;
|
|
16
|
+
if (typeof window === 'undefined') {
|
|
17
|
+
warnOnceSSRImport();
|
|
18
|
+
return {};
|
|
27
19
|
}
|
|
28
|
-
if ((0, get_environment_1.getRemotionEnvironment)() === '
|
|
29
|
-
|
|
20
|
+
if ((0, get_environment_1.getRemotionEnvironment)() === 'player-development' ||
|
|
21
|
+
(0, get_environment_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.');
|
|
30
23
|
}
|
|
31
|
-
|
|
24
|
+
const param = window.remotion_inputProps;
|
|
25
|
+
if (!param) {
|
|
26
|
+
return {};
|
|
27
|
+
}
|
|
28
|
+
const parsed = JSON.parse(param);
|
|
29
|
+
return parsed;
|
|
32
30
|
};
|
|
33
31
|
exports.getInputProps = getInputProps;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.setPublicPath = exports.getPublicPath = void 0;
|
|
4
|
+
let publicPath = null;
|
|
5
|
+
const getPublicPath = () => {
|
|
6
|
+
return publicPath;
|
|
7
|
+
};
|
|
8
|
+
exports.getPublicPath = getPublicPath;
|
|
9
|
+
const setPublicPath = (path) => {
|
|
10
|
+
publicPath = path;
|
|
11
|
+
};
|
|
12
|
+
exports.setPublicPath = setPublicPath;
|
|
@@ -1,14 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
/**
|
|
2
|
+
* The configuration has moved to @remotion/cli.
|
|
3
|
+
* For the moment the type definitions are going to stay here
|
|
4
|
+
*/
|
|
5
|
+
declare type Concurrency = number | null;
|
|
6
|
+
import type { Configuration } from 'webpack';
|
|
7
|
+
declare type WebpackConfiguration = Configuration;
|
|
8
|
+
declare type WebpackOverrideFn = (currentConfiguration: WebpackConfiguration) => WebpackConfiguration;
|
|
9
|
+
declare type BrowserExecutable = string | null;
|
|
10
|
+
declare type FrameRange = number | [number, number];
|
|
11
|
+
declare type FfmpegExecutable = string | null;
|
|
12
|
+
declare type Loop = number | null;
|
|
13
|
+
declare type CodecOrUndefined = 'h264' | 'h265' | 'vp8' | 'vp9' | 'mp3' | 'aac' | 'wav' | 'prores' | 'h264-mkv' | 'gif' | undefined;
|
|
14
|
+
declare type Crf = number | undefined;
|
|
15
|
+
export declare type ConfigType = {
|
|
12
16
|
readonly Preview: {
|
|
13
17
|
/**
|
|
14
18
|
* Change the maximum amount of tracks that are shown in the timeline.
|
|
@@ -44,7 +48,7 @@ export declare const Config: {
|
|
|
44
48
|
*
|
|
45
49
|
* Set this to 'verbose' to get browser logs and other IO.
|
|
46
50
|
*/
|
|
47
|
-
readonly setLevel: (newLogLevel:
|
|
51
|
+
readonly setLevel: (newLogLevel: 'verbose' | 'info' | 'warn' | 'error') => void;
|
|
48
52
|
};
|
|
49
53
|
readonly Puppeteer: {
|
|
50
54
|
/**
|
|
@@ -73,10 +77,10 @@ export declare const Config: {
|
|
|
73
77
|
*/
|
|
74
78
|
readonly setChromiumHeadlessMode: (should: boolean) => void;
|
|
75
79
|
/**
|
|
76
|
-
* Set the OpenGL rendering backend for Chrome. Possible values: 'egl', 'angle' and '
|
|
77
|
-
* Default: '
|
|
80
|
+
* Set the OpenGL rendering backend for Chrome. Possible values: 'egl', 'angle', 'swiftshader' and 'swangle'.
|
|
81
|
+
* Default: 'swangle' in Lambda, null elsewhere.
|
|
78
82
|
*/
|
|
79
|
-
readonly setChromiumOpenGlRenderer: (renderer:
|
|
83
|
+
readonly setChromiumOpenGlRenderer: (renderer: 'swangle' | 'angle' | 'egl' | 'swiftshader') => void;
|
|
80
84
|
};
|
|
81
85
|
readonly Rendering: {
|
|
82
86
|
/**
|
|
@@ -99,7 +103,7 @@ export declare const Config: {
|
|
|
99
103
|
/** Decide in which image format to render. Can be either 'jpeg' or 'png'.
|
|
100
104
|
* PNG is slower, but supports transparency.
|
|
101
105
|
*/
|
|
102
|
-
readonly setImageFormat: (format:
|
|
106
|
+
readonly setImageFormat: (format: 'png' | 'jpeg' | 'none') => void;
|
|
103
107
|
/**
|
|
104
108
|
* Render only a subset of a video.
|
|
105
109
|
* Pass in a tuple [20, 30] to only render frames 20-30 into a video.
|
|
@@ -112,13 +116,43 @@ export declare const Config: {
|
|
|
112
116
|
* Default: null, which will use ffmpeg available in PATH.
|
|
113
117
|
*/
|
|
114
118
|
readonly setFfmpegExecutable: (ffmpegPath: FfmpegExecutable) => void;
|
|
119
|
+
/**
|
|
120
|
+
* Specify local ffprobe executable.
|
|
121
|
+
* Default: null, which will use ffprobe available in PATH.
|
|
122
|
+
*/
|
|
123
|
+
readonly setFfprobeExecutable: (ffprobePath: FfmpegExecutable) => void;
|
|
115
124
|
/**
|
|
116
125
|
* Scales the output dimensions by a factor.
|
|
117
126
|
* Default: 1.
|
|
118
127
|
*/
|
|
119
128
|
readonly setScale: (newScale: number) => void;
|
|
129
|
+
/**
|
|
130
|
+
* Specify which frames should be picked for rendering a GIF
|
|
131
|
+
* Default: 1, which means every frame
|
|
132
|
+
* https://remotion.dev/docs/render-as-gif
|
|
133
|
+
*/
|
|
134
|
+
readonly setEveryNthFrame: (frame: number) => void;
|
|
135
|
+
/**
|
|
136
|
+
* Specify the number of Loop a GIF should have.
|
|
137
|
+
* Default: null (means GIF will loop infinite)
|
|
138
|
+
*/
|
|
139
|
+
readonly setNumberOfGifLoops: (newLoop: Loop) => void;
|
|
140
|
+
/**
|
|
141
|
+
* Disable audio output.
|
|
142
|
+
* Default: false
|
|
143
|
+
*/
|
|
144
|
+
readonly setMuted: (muted: boolean) => void;
|
|
145
|
+
/**
|
|
146
|
+
* Don't render an audio track if it would be silent.
|
|
147
|
+
* Default: true
|
|
148
|
+
*/
|
|
149
|
+
readonly setEnforceAudioTrack: (enforceAudioTrack: boolean) => void;
|
|
120
150
|
};
|
|
121
151
|
readonly Output: {
|
|
152
|
+
/**
|
|
153
|
+
* Set the output file location string. Default: `out/{composition}.{codec}`
|
|
154
|
+
*/
|
|
155
|
+
readonly setOutputLocation: (newOutputLocation: string) => void;
|
|
122
156
|
/**
|
|
123
157
|
* If the video file already exists, should Remotion overwrite
|
|
124
158
|
* the output? Default: true
|
|
@@ -129,23 +163,23 @@ export declare const Config: {
|
|
|
129
163
|
* See https://trac.ffmpeg.org/wiki/Chroma%20Subsampling for an explanation.
|
|
130
164
|
* You can override this using the `--pixel-format` Cli flag.
|
|
131
165
|
*/
|
|
132
|
-
readonly setPixelFormat: (format:
|
|
166
|
+
readonly setPixelFormat: (format: 'yuv420p' | 'yuva420p' | 'yuv422p' | 'yuv444p' | 'yuv420p10le' | 'yuv422p10le' | 'yuv444p10le' | 'yuva444p10le') => void;
|
|
133
167
|
/**
|
|
134
168
|
* @deprecated Use setCodec() and setImageSequence() instead.
|
|
135
169
|
* Specify what kind of output you, either `mp4` or `png-sequence`.
|
|
136
170
|
*/
|
|
137
|
-
readonly setOutputFormat: (newLegacyFormat:
|
|
171
|
+
readonly setOutputFormat: (newLegacyFormat: 'mp4' | 'png-sequence') => void;
|
|
138
172
|
/**
|
|
139
173
|
* Specify the codec for stitching the frames into a video.
|
|
140
174
|
* Can be `h264` (default), `h265`, `vp8` or `vp9`
|
|
141
175
|
*/
|
|
142
|
-
readonly setCodec: (newCodec:
|
|
176
|
+
readonly setCodec: (newCodec: CodecOrUndefined) => void;
|
|
143
177
|
/**
|
|
144
178
|
* Set the Constant Rate Factor to pass to FFMPEG.
|
|
145
179
|
* Lower values mean better quality, but be aware that the ranges of
|
|
146
180
|
* possible values greatly differs between codecs.
|
|
147
181
|
*/
|
|
148
|
-
readonly setCrf: (newCrf:
|
|
182
|
+
readonly setCrf: (newCrf: Crf) => void;
|
|
149
183
|
/**
|
|
150
184
|
* Set to true if don't want a video but an image sequence as the output.
|
|
151
185
|
*/
|
|
@@ -156,7 +190,9 @@ export declare const Config: {
|
|
|
156
190
|
* Possible values: 4444-xq, 4444, hq, standard, light, proxy. Default: 'hq'
|
|
157
191
|
* See https://avpres.net/FFmpeg/im_ProRes.html for meaning of possible values.
|
|
158
192
|
*/
|
|
159
|
-
readonly setProResProfile: (profile:
|
|
193
|
+
readonly setProResProfile: (profile: '4444-xq' | '4444' | 'hq' | 'standard' | 'light' | 'proxy' | undefined) => void;
|
|
160
194
|
};
|
|
161
195
|
};
|
|
162
|
-
export type {
|
|
196
|
+
export type { Concurrency, WebpackConfiguration, WebpackOverrideFn };
|
|
197
|
+
export declare const Config: ConfigType;
|
|
198
|
+
export declare const enableLegacyRemotionConfig: () => void;
|