remotion 4.0.0-webhook.27 → 4.1.0-alpha2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +8 -8
- package/README.md +7 -7
- package/dist/{AbsoluteFill.d.ts → cjs/AbsoluteFill.d.ts} +2 -2
- package/dist/{AbsoluteFill.js → cjs/AbsoluteFill.js} +2 -2
- package/dist/cjs/AssetManager.d.ts +11 -0
- package/dist/cjs/AssetManager.js +40 -0
- package/dist/{CanUseRemotionHooks.d.ts → cjs/CanUseRemotionHooks.d.ts} +0 -0
- package/dist/{CanUseRemotionHooks.js → cjs/CanUseRemotionHooks.js} +0 -0
- package/dist/cjs/Clipper.d.ts +7 -0
- package/dist/cjs/Clipper.js +24 -0
- package/dist/cjs/Composition.d.ts +41 -0
- package/dist/cjs/Composition.js +132 -0
- package/dist/cjs/CompositionManager.d.ts +75 -0
- package/dist/{CompositionManager.js → cjs/CompositionManager.js} +29 -66
- package/dist/cjs/CompositionManagerContext.d.ts +18 -0
- package/dist/cjs/CompositionManagerContext.js +16 -0
- package/dist/cjs/EditorProps.d.ts +15 -0
- package/dist/cjs/EditorProps.js +53 -0
- package/dist/{Folder.d.ts → cjs/Folder.d.ts} +6 -2
- package/dist/{Folder.js → cjs/Folder.js} +10 -6
- package/dist/{IFrame.d.ts → cjs/IFrame.d.ts} +4 -0
- package/dist/{IFrame.js → cjs/IFrame.js} +8 -4
- package/dist/cjs/Img.d.ts +9 -0
- package/dist/cjs/Img.js +100 -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/{RemotionRoot.d.ts → cjs/RemotionRoot.d.ts} +1 -0
- package/dist/cjs/RemotionRoot.js +72 -0
- package/dist/cjs/ResolveCompositionConfig.d.ts +24 -0
- package/dist/cjs/ResolveCompositionConfig.js +192 -0
- package/dist/cjs/Sequence.d.ts +22 -0
- package/dist/{Sequence.js → cjs/Sequence.js} +27 -29
- package/dist/cjs/SequenceContext.d.ts +9 -0
- package/dist/cjs/SequenceContext.js +5 -0
- package/dist/cjs/SequenceManager.d.ts +11 -0
- package/dist/cjs/SequenceManager.js +57 -0
- package/dist/cjs/Still.d.ts +8 -0
- package/dist/cjs/Still.js +22 -0
- package/dist/{absolute-src.d.ts → cjs/absolute-src.d.ts} +0 -0
- package/dist/{absolute-src.js → cjs/absolute-src.js} +0 -0
- package/dist/{asset-types.d.ts → cjs/asset-types.d.ts} +0 -0
- package/dist/{asset-types.js → cjs/asset-types.js} +0 -0
- package/dist/{audio → cjs/audio}/Audio.d.ts +10 -4
- package/dist/cjs/audio/Audio.js +58 -0
- package/dist/cjs/audio/AudioForDevelopment.d.ts +11 -0
- package/dist/cjs/audio/AudioForDevelopment.js +101 -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/{audio → cjs/audio}/index.js +2 -2
- package/dist/cjs/audio/props.d.ts +12 -0
- package/dist/{audio → cjs/audio}/props.js +0 -0
- package/dist/{audio → cjs/audio}/shared-audio-tags.d.ts +10 -4
- package/dist/{audio → cjs/audio}/shared-audio-tags.js +35 -13
- package/dist/{audio → cjs/audio}/use-audio-frame.d.ts +0 -0
- package/dist/{audio → cjs/audio}/use-audio-frame.js +4 -4
- package/dist/{bezier.d.ts → cjs/bezier.d.ts} +0 -0
- package/dist/{bezier.js → cjs/bezier.js} +0 -0
- package/dist/cjs/cancel-render.d.ts +5 -0
- package/dist/cjs/cancel-render.js +47 -0
- package/dist/{config → cjs/config}/input-props.d.ts +0 -0
- package/dist/{config → cjs/config}/input-props.js +3 -3
- package/dist/{default-css.d.ts → cjs/default-css.d.ts} +0 -0
- package/dist/{default-css.js → cjs/default-css.js} +0 -0
- package/dist/{delay-render.d.ts → cjs/delay-render.d.ts} +4 -4
- package/dist/{delay-render.js → cjs/delay-render.js} +12 -12
- package/dist/{easing.d.ts → cjs/easing.d.ts} +4 -0
- package/dist/{easing.js → cjs/easing.js} +6 -2
- package/dist/cjs/freeze.d.ts +11 -0
- package/dist/{freeze.js → cjs/freeze.js} +8 -4
- package/dist/{get-asset-file-name.d.ts → cjs/get-asset-file-name.d.ts} +0 -0
- package/dist/{get-asset-file-name.js → cjs/get-asset-file-name.js} +0 -0
- package/dist/cjs/get-environment.d.ts +3 -0
- package/dist/{get-environment.js → cjs/get-environment.js} +14 -2
- package/dist/cjs/get-preview-dom-element.d.ts +2 -0
- package/dist/cjs/get-preview-dom-element.js +8 -0
- package/dist/cjs/get-static-files.d.ts +21 -0
- package/dist/cjs/get-static-files.js +35 -0
- package/dist/{get-timeline-clip-name.d.ts → cjs/get-timeline-clip-name.d.ts} +0 -0
- package/dist/{get-timeline-clip-name.js → cjs/get-timeline-clip-name.js} +0 -0
- package/dist/cjs/index.d.ts +102 -0
- package/dist/cjs/index.js +105 -0
- package/dist/cjs/internals.d.ts +131 -0
- package/dist/cjs/internals.js +120 -0
- package/dist/{interpolate-colors.d.ts → cjs/interpolate-colors.d.ts} +5 -0
- package/dist/{interpolate-colors.js → cjs/interpolate-colors.js} +10 -10
- package/dist/{interpolate.d.ts → cjs/interpolate.d.ts} +11 -7
- package/dist/{interpolate.js → cjs/interpolate.js} +0 -0
- package/dist/{is-approximately-the-same.d.ts → cjs/is-approximately-the-same.d.ts} +0 -0
- package/dist/{is-approximately-the-same.js → cjs/is-approximately-the-same.js} +0 -0
- package/dist/cjs/is-player.d.ts +3 -0
- package/dist/cjs/is-player.js +14 -0
- package/dist/{loading-indicator.d.ts → cjs/loading-indicator.d.ts} +0 -0
- package/dist/{loading-indicator.js → cjs/loading-indicator.js} +4 -4
- package/dist/cjs/loop/index.d.ts +13 -0
- package/dist/cjs/loop/index.js +46 -0
- package/dist/{multiple-versions-warning.d.ts → cjs/multiple-versions-warning.d.ts} +0 -0
- package/dist/{multiple-versions-warning.js → cjs/multiple-versions-warning.js} +11 -6
- package/dist/{nonce.d.ts → cjs/nonce.d.ts} +1 -1
- package/dist/{nonce.js → cjs/nonce.js} +6 -0
- package/dist/{play-and-handle-not-allowed-error.d.ts → cjs/play-and-handle-not-allowed-error.d.ts} +0 -0
- package/dist/{play-and-handle-not-allowed-error.js → cjs/play-and-handle-not-allowed-error.js} +4 -0
- package/dist/{portal-node.d.ts → cjs/portal-node.d.ts} +0 -0
- package/dist/{portal-node.js → cjs/portal-node.js} +0 -0
- package/dist/cjs/prefetch-state.d.ts +8 -0
- package/dist/cjs/prefetch-state.js +27 -0
- package/dist/cjs/prefetch.d.ts +13 -0
- package/dist/{prefetch.js → cjs/prefetch.js} +43 -17
- package/dist/cjs/props-if-has-props.d.ts +10 -0
- package/dist/{video-config.js → cjs/props-if-has-props.js} +0 -0
- package/dist/cjs/random.d.ts +6 -0
- package/dist/{random.js → cjs/random.js} +3 -3
- package/dist/{register-root.d.ts → cjs/register-root.d.ts} +4 -0
- package/dist/{register-root.js → cjs/register-root.js} +4 -0
- package/dist/cjs/resolve-video-config.d.ts +8 -0
- package/dist/cjs/resolve-video-config.js +89 -0
- package/dist/cjs/series/flatten-children.d.ts +2 -0
- package/dist/{series → cjs/series}/flatten-children.js +0 -0
- package/dist/cjs/series/index.d.ts +17 -0
- package/dist/{series → cjs/series}/index.js +22 -8
- package/dist/cjs/setup-env-variables.d.ts +1 -0
- package/dist/{setup-env-variables.js → cjs/setup-env-variables.js} +7 -9
- package/dist/{spring → cjs/spring}/index.d.ts +10 -6
- package/dist/cjs/spring/index.js +75 -0
- package/dist/cjs/spring/measure-spring.d.ts +12 -0
- package/dist/{spring → cjs/spring}/measure-spring.js +8 -4
- package/dist/{spring → cjs/spring}/spring-utils.d.ts +2 -2
- package/dist/{spring → cjs/spring}/spring-utils.js +0 -0
- package/dist/cjs/static-file.d.ts +33 -0
- package/dist/cjs/static-file.js +87 -0
- package/dist/{timeline-position-state.d.ts → cjs/timeline-position-state.d.ts} +4 -4
- package/dist/{timeline-position-state.js → cjs/timeline-position-state.js} +9 -1
- package/dist/cjs/truthy.d.ts +3 -0
- package/dist/{truthy.js → cjs/truthy.js} +0 -0
- package/dist/cjs/use-current-frame.d.ts +5 -0
- package/dist/{use-current-frame.js → cjs/use-current-frame.js} +8 -9
- package/dist/cjs/use-lazy-component.d.ts +7 -0
- package/dist/{use-lazy-component.js → cjs/use-lazy-component.js} +0 -0
- package/dist/{use-media-in-timeline.d.ts → cjs/use-media-in-timeline.d.ts} +3 -2
- package/dist/{use-media-in-timeline.js → cjs/use-media-in-timeline.js} +29 -25
- package/dist/{use-media-playback.d.ts → cjs/use-media-playback.d.ts} +3 -1
- package/dist/cjs/use-media-playback.js +86 -0
- package/dist/{use-media-tag-volume.d.ts → cjs/use-media-tag-volume.d.ts} +0 -0
- package/dist/{use-media-tag-volume.js → cjs/use-media-tag-volume.js} +0 -0
- package/dist/{use-sync-volume-with-media-tag.d.ts → cjs/use-sync-volume-with-media-tag.d.ts} +2 -2
- package/dist/{use-sync-volume-with-media-tag.js → cjs/use-sync-volume-with-media-tag.js} +5 -4
- package/dist/{use-unsafe-video-config.d.ts → cjs/use-unsafe-video-config.d.ts} +1 -1
- package/dist/{use-unsafe-video-config.js → cjs/use-unsafe-video-config.js} +4 -4
- package/dist/cjs/use-video-config.d.ts +8 -0
- package/dist/cjs/use-video-config.js +34 -0
- package/dist/cjs/use-video.d.ts +7 -0
- package/dist/cjs/use-video.js +38 -0
- package/dist/cjs/validate-frame.d.ts +5 -0
- package/dist/cjs/validate-frame.js +24 -0
- package/dist/cjs/validate-media-props.d.ts +4 -0
- package/dist/{validate-media-props.js → cjs/validate-media-props.js} +0 -0
- package/dist/{validate-start-from-props.d.ts → cjs/validate-start-from-props.d.ts} +0 -0
- package/dist/{validate-start-from-props.js → cjs/validate-start-from-props.js} +0 -0
- package/dist/{validation → cjs/validation}/validate-composition-id.d.ts +0 -0
- package/dist/{validation → cjs/validation}/validate-composition-id.js +0 -0
- package/dist/cjs/validation/validate-default-props.d.ts +1 -0
- package/dist/cjs/validation/validate-default-props.js +15 -0
- package/dist/{validation → cjs/validation}/validate-dimensions.d.ts +0 -0
- package/dist/{validation → cjs/validation}/validate-dimensions.js +0 -0
- package/dist/cjs/validation/validate-duration-in-frames.d.ts +5 -0
- package/dist/{validation → cjs/validation}/validate-duration-in-frames.js +5 -2
- package/dist/{validation → cjs/validation}/validate-folder-name.d.ts +0 -0
- package/dist/{validation → cjs/validation}/validate-folder-name.js +0 -0
- package/dist/{validation → cjs/validation}/validate-fps.d.ts +0 -0
- package/dist/{validation → cjs/validation}/validate-fps.js +0 -0
- package/dist/{validation → cjs/validation}/validation-spring-duration.d.ts +0 -0
- package/dist/{validation → cjs/validation}/validation-spring-duration.js +0 -0
- package/dist/cjs/version.d.ts +1 -0
- package/dist/{version.js → cjs/version.js} +1 -1
- package/dist/cjs/video/OffthreadVideo.d.ts +7 -0
- package/dist/cjs/video/OffthreadVideo.js +38 -0
- package/dist/{video → cjs/video}/OffthreadVideoForRendering.d.ts +1 -1
- package/dist/cjs/video/OffthreadVideoForRendering.js +103 -0
- package/dist/cjs/video/Video.d.ts +12 -0
- package/dist/cjs/video/Video.js +55 -0
- package/dist/{video → cjs/video}/VideoForDevelopment.d.ts +5 -2
- package/dist/cjs/video/VideoForDevelopment.js +117 -0
- package/dist/cjs/video/VideoForRendering.d.ts +10 -0
- package/dist/cjs/video/VideoForRendering.js +208 -0
- package/dist/cjs/video/duration-state.d.ts +17 -0
- package/dist/cjs/video/duration-state.js +35 -0
- package/dist/{video → cjs/video}/get-current-time.d.ts +0 -0
- package/dist/{video → cjs/video}/get-current-time.js +12 -11
- package/dist/cjs/video/index.d.ts +3 -0
- package/dist/{video → cjs/video}/index.js +4 -4
- package/dist/cjs/video/props.d.ts +32 -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/{video-config.d.ts → cjs/video-config.d.ts} +2 -2
- package/dist/{video/props.js → cjs/video-config.js} +0 -0
- package/dist/{volume-position-state.d.ts → cjs/volume-position-state.d.ts} +4 -4
- package/dist/{volume-position-state.js → cjs/volume-position-state.js} +0 -0
- package/dist/{volume-prop.d.ts → cjs/volume-prop.d.ts} +3 -2
- package/dist/{volume-prop.js → cjs/volume-prop.js} +4 -3
- package/dist/{warn-about-non-seekable-media.d.ts → cjs/warn-about-non-seekable-media.d.ts} +0 -0
- package/dist/{warn-about-non-seekable-media.js → cjs/warn-about-non-seekable-media.js} +2 -2
- package/dist/cjs/wrap-remotion-context.d.ts +31 -0
- package/dist/cjs/wrap-remotion-context.js +85 -0
- package/dist/esm/index.mjs +4623 -0
- package/dist/esm/version.mjs +4 -0
- package/package.json +80 -57
- package/version.js +2 -1
- package/.prettierrc.js +0 -14
- package/.turbo/turbo-build.log +0 -5
- package/dist/Composition.d.ts +0 -22
- package/dist/Composition.js +0 -98
- package/dist/CompositionManager.d.ts +0 -79
- package/dist/Img.d.ts +0 -2
- package/dist/Img.js +0 -51
- package/dist/RemotionRoot.js +0 -71
- package/dist/Sequence.d.ts +0 -29
- package/dist/Still.d.ts +0 -3
- package/dist/Still.js +0 -9
- package/dist/audio/Audio.js +0 -32
- package/dist/audio/AudioForDevelopment.d.ts +0 -8
- package/dist/audio/AudioForDevelopment.js +0 -71
- package/dist/audio/AudioForRendering.d.ts +0 -6
- package/dist/audio/AudioForRendering.js +0 -75
- package/dist/audio/index.d.ts +0 -2
- package/dist/audio/props.d.ts +0 -10
- package/dist/config.d.ts +0 -218
- package/dist/config.js +0 -21
- package/dist/freeze.d.ts +0 -7
- package/dist/get-environment.d.ts +0 -2
- package/dist/get-preview-dom-element.d.ts +0 -1
- package/dist/get-preview-dom-element.js +0 -7
- package/dist/index.d.ts +0 -72
- package/dist/index.js +0 -58
- package/dist/internals.d.ts +0 -88
- package/dist/internals.js +0 -93
- package/dist/loop/index.d.ts +0 -9
- package/dist/loop/index.js +0 -28
- package/dist/prefetch-state.d.ts +0 -13
- package/dist/prefetch-state.js +0 -26
- package/dist/prefetch.d.ts +0 -7
- package/dist/random.d.ts +0 -6
- package/dist/series/flatten-children.d.ts +0 -2
- package/dist/series/index.d.ts +0 -13
- package/dist/setup-env-variables.d.ts +0 -2
- package/dist/spring/index.js +0 -51
- package/dist/spring/measure-spring.d.ts +0 -8
- package/dist/static-file.d.ts +0 -1
- package/dist/static-file.js +0 -29
- package/dist/truthy.d.ts +0 -3
- package/dist/use-current-frame.d.ts +0 -6
- package/dist/use-lazy-component.d.ts +0 -7
- package/dist/use-media-playback.js +0 -75
- package/dist/use-video-config.d.ts +0 -7
- package/dist/use-video-config.js +0 -26
- package/dist/use-video.d.ts +0 -13
- package/dist/use-video.js +0 -28
- package/dist/validate-media-props.d.ts +0 -4
- package/dist/validation/validate-duration-in-frames.d.ts +0 -1
- package/dist/validation/validate-offthreadvideo-image-format.d.ts +0 -1
- package/dist/validation/validate-offthreadvideo-image-format.js +0 -15
- package/dist/version.d.ts +0 -1
- package/dist/video/LoopedVideo.d.ts +0 -3
- package/dist/video/LoopedVideo.js +0 -16
- package/dist/video/OffthreadVideo.d.ts +0 -3
- package/dist/video/OffthreadVideo.js +0 -27
- package/dist/video/OffthreadVideoForRendering.js +0 -101
- package/dist/video/Video.d.ts +0 -6
- package/dist/video/Video.js +0 -29
- package/dist/video/VideoForDevelopment.js +0 -69
- package/dist/video/VideoForRendering.d.ts +0 -6
- package/dist/video/VideoForRendering.js +0 -168
- package/dist/video/duration-state.d.ts +0 -8
- package/dist/video/duration-state.js +0 -15
- package/dist/video/index.d.ts +0 -3
- package/dist/video/props.d.ts +0 -21
- package/dist/wrap-remotion-context.d.ts +0 -14
- package/dist/wrap-remotion-context.js +0 -65
- package/ensure-correct-version.js +0 -24
- package/tsconfig.json +0 -12
- package/version.d.ts +0 -1
package/package.json
CHANGED
|
@@ -1,58 +1,81 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
2
|
+
"name": "remotion",
|
|
3
|
+
"version": "4.1.0-alpha2",
|
|
4
|
+
"description": "Render videos in React",
|
|
5
|
+
"main": "dist/cjs/index.js",
|
|
6
|
+
"types": "dist/cjs/index.d.ts",
|
|
7
|
+
"module": "dist/esm/index.mjs",
|
|
8
|
+
"repository": {
|
|
9
|
+
"url": "https://github.com/remotion-dev/remotion"
|
|
10
|
+
},
|
|
11
|
+
"bugs": {
|
|
12
|
+
"url": "https://github.com/remotion-dev/remotion/issues"
|
|
13
|
+
},
|
|
14
|
+
"author": "Jonny Burger <jonny@remotion.dev>",
|
|
15
|
+
"license": "SEE LICENSE IN LICENSE.md",
|
|
16
|
+
"peerDependencies": {
|
|
17
|
+
"react": ">=16.8.0",
|
|
18
|
+
"react-dom": ">=16.8.0"
|
|
19
|
+
},
|
|
20
|
+
"devDependencies": {
|
|
21
|
+
"@jonny/eslint-config": "3.0.273",
|
|
22
|
+
"@rollup/plugin-typescript": "^8.2.0",
|
|
23
|
+
"@testing-library/react": "14.0.0",
|
|
24
|
+
"@types/node": "18.14.6",
|
|
25
|
+
"@types/react": "18.0.26",
|
|
26
|
+
"@types/react-dom": "18.0.10",
|
|
27
|
+
"@vitejs/plugin-react": "^2.0.0",
|
|
28
|
+
"eslint": "8.42.0",
|
|
29
|
+
"eslint-plugin-require-extensions": "^0.1.2",
|
|
30
|
+
"jsdom": "21.1.0",
|
|
31
|
+
"prettier": "^2.7.1",
|
|
32
|
+
"prettier-plugin-organize-imports": "^2.3.4",
|
|
33
|
+
"react": "^18.0.0",
|
|
34
|
+
"react-dom": "^18.0.0",
|
|
35
|
+
"rimraf": "^3.0.2",
|
|
36
|
+
"rollup": "^2.70.1",
|
|
37
|
+
"typescript": "4.9.5",
|
|
38
|
+
"vitest": "0.31.1",
|
|
39
|
+
"webpack": "5.83.1",
|
|
40
|
+
"zod": "3.21.4"
|
|
41
|
+
},
|
|
42
|
+
"keywords": [
|
|
43
|
+
"remotion",
|
|
44
|
+
"ffmpeg",
|
|
45
|
+
"video",
|
|
46
|
+
"react",
|
|
47
|
+
"player"
|
|
48
|
+
],
|
|
49
|
+
"publishConfig": {
|
|
50
|
+
"access": "public"
|
|
51
|
+
},
|
|
52
|
+
"exports": {
|
|
53
|
+
"./package.json": "./package.json",
|
|
54
|
+
".": {
|
|
55
|
+
"types": "./dist/cjs/index.d.ts",
|
|
56
|
+
"module": "./dist/esm/index.mjs",
|
|
57
|
+
"import": "./dist/esm/index.mjs",
|
|
58
|
+
"require": "./dist/cjs/index.js"
|
|
59
|
+
},
|
|
60
|
+
"./version": {
|
|
61
|
+
"types": "./dist/cjs/version.d.ts",
|
|
62
|
+
"module": "./dist/esm/version.mjs",
|
|
63
|
+
"import": "./dist/esm/version.mjs",
|
|
64
|
+
"require": "./dist/cjs/version.js"
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
"typesVersions": {
|
|
68
|
+
">=1.0": {
|
|
69
|
+
"version": [
|
|
70
|
+
"dist/cjs/version.d.ts"
|
|
71
|
+
]
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
"scripts": {
|
|
75
|
+
"formatting": "prettier src --check",
|
|
76
|
+
"lint": "eslint src --ext ts,tsx",
|
|
77
|
+
"test": "vitest --run",
|
|
78
|
+
"build": "tsc -d && rollup --config rollup-version.config.js && rollup --config rollup.config.js",
|
|
79
|
+
"watch": "tsc -w"
|
|
80
|
+
}
|
|
81
|
+
}
|
package/version.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
// For backwards compatibility when you use `esm-wallaby`
|
|
2
|
+
module.exports = require('./dist/cjs/version');
|
package/.prettierrc.js
DELETED
package/.turbo/turbo-build.log
DELETED
package/dist/Composition.d.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import type { ComponentType } from 'react';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
declare type LooseComponentType<T> = ComponentType<T> | ((props: T) => React.ReactNode);
|
|
4
|
-
export declare type CompProps<T> = {
|
|
5
|
-
lazyComponent: () => Promise<{
|
|
6
|
-
default: LooseComponentType<T>;
|
|
7
|
-
}>;
|
|
8
|
-
} | {
|
|
9
|
-
component: LooseComponentType<T>;
|
|
10
|
-
};
|
|
11
|
-
export declare type StillProps<T> = {
|
|
12
|
-
width: number;
|
|
13
|
-
height: number;
|
|
14
|
-
id: string;
|
|
15
|
-
defaultProps?: T;
|
|
16
|
-
} & CompProps<T>;
|
|
17
|
-
declare type CompositionProps<T> = StillProps<T> & {
|
|
18
|
-
fps: number;
|
|
19
|
-
durationInFrames: number;
|
|
20
|
-
};
|
|
21
|
-
export declare const Composition: <T>({ width, height, fps, durationInFrames, id, defaultProps, ...compProps }: CompositionProps<T>) => React.ReactPortal | null;
|
|
22
|
-
export {};
|
package/dist/Composition.js
DELETED
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Composition = void 0;
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const react_1 = require("react");
|
|
6
|
-
const react_dom_1 = require("react-dom");
|
|
7
|
-
const CanUseRemotionHooks_1 = require("./CanUseRemotionHooks");
|
|
8
|
-
const CompositionManager_1 = require("./CompositionManager");
|
|
9
|
-
const input_props_1 = require("./config/input-props");
|
|
10
|
-
const delay_render_1 = require("./delay-render");
|
|
11
|
-
const Folder_1 = require("./Folder");
|
|
12
|
-
const get_environment_1 = require("./get-environment");
|
|
13
|
-
const internals_1 = require("./internals");
|
|
14
|
-
const loading_indicator_1 = require("./loading-indicator");
|
|
15
|
-
const nonce_1 = require("./nonce");
|
|
16
|
-
const portal_node_1 = require("./portal-node");
|
|
17
|
-
const use_lazy_component_1 = require("./use-lazy-component");
|
|
18
|
-
const use_video_1 = require("./use-video");
|
|
19
|
-
const validate_composition_id_1 = require("./validation/validate-composition-id");
|
|
20
|
-
const validate_dimensions_1 = require("./validation/validate-dimensions");
|
|
21
|
-
const validate_duration_in_frames_1 = require("./validation/validate-duration-in-frames");
|
|
22
|
-
const validate_fps_1 = require("./validation/validate-fps");
|
|
23
|
-
const Fallback = () => {
|
|
24
|
-
(0, react_1.useEffect)(() => {
|
|
25
|
-
const fallback = (0, delay_render_1.delayRender)('Waiting for Root component to unsuspend');
|
|
26
|
-
return () => (0, delay_render_1.continueRender)(fallback);
|
|
27
|
-
}, []);
|
|
28
|
-
return null;
|
|
29
|
-
};
|
|
30
|
-
const Composition = ({ width, height, fps, durationInFrames, id, defaultProps, ...compProps }) => {
|
|
31
|
-
const { registerComposition, unregisterComposition } = (0, react_1.useContext)(CompositionManager_1.CompositionManager);
|
|
32
|
-
const video = (0, use_video_1.useVideo)();
|
|
33
|
-
const lazy = (0, use_lazy_component_1.useLazyComponent)(compProps);
|
|
34
|
-
const nonce = (0, nonce_1.useNonce)();
|
|
35
|
-
const canUseComposition = (0, react_1.useContext)(internals_1.Internals.CanUseRemotionHooks);
|
|
36
|
-
if (canUseComposition) {
|
|
37
|
-
if (typeof window !== 'undefined' && window.remotion_isPlayer) {
|
|
38
|
-
throw new Error('<Composition> was mounted inside the `component` that was passed to the <Player>. See https://remotion.dev/docs/wrong-composition-mount for help.');
|
|
39
|
-
}
|
|
40
|
-
throw new Error('<Composition> mounted inside another composition. See https://remotion.dev/docs/wrong-composition-mount for help.');
|
|
41
|
-
}
|
|
42
|
-
const { folderName, parentName } = (0, react_1.useContext)(Folder_1.FolderContext);
|
|
43
|
-
(0, react_1.useEffect)(() => {
|
|
44
|
-
// Ensure it's a URL safe id
|
|
45
|
-
if (!id) {
|
|
46
|
-
throw new Error('No id for composition passed.');
|
|
47
|
-
}
|
|
48
|
-
(0, validate_composition_id_1.validateCompositionId)(id);
|
|
49
|
-
(0, validate_dimensions_1.validateDimension)(width, 'width', 'of the <Composition/> component');
|
|
50
|
-
(0, validate_dimensions_1.validateDimension)(height, 'height', 'of the <Composition/> component');
|
|
51
|
-
(0, validate_duration_in_frames_1.validateDurationInFrames)(durationInFrames, 'of the <Composition/> component');
|
|
52
|
-
(0, validate_fps_1.validateFps)(fps, 'as a prop of the <Composition/> component', false);
|
|
53
|
-
registerComposition({
|
|
54
|
-
durationInFrames,
|
|
55
|
-
fps,
|
|
56
|
-
height,
|
|
57
|
-
width,
|
|
58
|
-
id,
|
|
59
|
-
folderName,
|
|
60
|
-
component: lazy,
|
|
61
|
-
defaultProps,
|
|
62
|
-
nonce,
|
|
63
|
-
parentFolderName: parentName,
|
|
64
|
-
});
|
|
65
|
-
return () => {
|
|
66
|
-
unregisterComposition(id);
|
|
67
|
-
};
|
|
68
|
-
}, [
|
|
69
|
-
durationInFrames,
|
|
70
|
-
fps,
|
|
71
|
-
height,
|
|
72
|
-
lazy,
|
|
73
|
-
id,
|
|
74
|
-
folderName,
|
|
75
|
-
defaultProps,
|
|
76
|
-
registerComposition,
|
|
77
|
-
unregisterComposition,
|
|
78
|
-
width,
|
|
79
|
-
nonce,
|
|
80
|
-
parentName,
|
|
81
|
-
]);
|
|
82
|
-
if ((0, get_environment_1.getRemotionEnvironment)() === 'preview' &&
|
|
83
|
-
video &&
|
|
84
|
-
video.component === lazy) {
|
|
85
|
-
const Comp = lazy;
|
|
86
|
-
const inputProps = (0, input_props_1.getInputProps)();
|
|
87
|
-
return (0, react_dom_1.createPortal)((0, jsx_runtime_1.jsx)(CanUseRemotionHooks_1.CanUseRemotionHooksProvider, { children: (0, jsx_runtime_1.jsx)(react_1.Suspense, { fallback: (0, jsx_runtime_1.jsx)(loading_indicator_1.Loading, {}), children: (0, jsx_runtime_1.jsx)(Comp, { ...defaultProps, ...inputProps }) }) }), (0, portal_node_1.portalNode)());
|
|
88
|
-
}
|
|
89
|
-
if ((0, get_environment_1.getRemotionEnvironment)() === 'rendering' &&
|
|
90
|
-
video &&
|
|
91
|
-
video.component === lazy) {
|
|
92
|
-
const Comp = lazy;
|
|
93
|
-
const inputProps = (0, input_props_1.getInputProps)();
|
|
94
|
-
return (0, react_dom_1.createPortal)((0, jsx_runtime_1.jsx)(CanUseRemotionHooks_1.CanUseRemotionHooksProvider, { children: (0, jsx_runtime_1.jsx)(react_1.Suspense, { fallback: (0, jsx_runtime_1.jsx)(Fallback, {}), children: (0, jsx_runtime_1.jsx)(Comp, { ...defaultProps, ...inputProps }) }) }), (0, portal_node_1.portalNode)());
|
|
95
|
-
}
|
|
96
|
-
return null;
|
|
97
|
-
};
|
|
98
|
-
exports.Composition = Composition;
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import type { ComponentType, LazyExoticComponent } from 'react';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import type { TFolder } from './Folder';
|
|
4
|
-
export declare type TComposition<T = unknown> = {
|
|
5
|
-
width: number;
|
|
6
|
-
height: number;
|
|
7
|
-
fps: number;
|
|
8
|
-
durationInFrames: number;
|
|
9
|
-
id: string;
|
|
10
|
-
folderName: string | null;
|
|
11
|
-
parentFolderName: string | null;
|
|
12
|
-
component: LazyExoticComponent<ComponentType<T>>;
|
|
13
|
-
defaultProps: T | undefined;
|
|
14
|
-
nonce: number;
|
|
15
|
-
};
|
|
16
|
-
export declare type TCompMetadata = Pick<TComposition, 'id' | 'height' | 'width' | 'fps' | 'durationInFrames' | 'defaultProps'>;
|
|
17
|
-
export declare type SmallTCompMetadata = Pick<TComposition, 'id' | 'height' | 'width' | 'fps' | 'durationInFrames'> & Partial<Pick<TComposition, 'defaultProps'>>;
|
|
18
|
-
declare type EnhancedTSequenceData = {
|
|
19
|
-
type: 'sequence';
|
|
20
|
-
} | {
|
|
21
|
-
type: 'audio';
|
|
22
|
-
src: string;
|
|
23
|
-
volume: string | number;
|
|
24
|
-
doesVolumeChange: boolean;
|
|
25
|
-
startMediaFrom: number;
|
|
26
|
-
} | {
|
|
27
|
-
type: 'video';
|
|
28
|
-
src: string;
|
|
29
|
-
volume: string | number;
|
|
30
|
-
doesVolumeChange: boolean;
|
|
31
|
-
startMediaFrom: number;
|
|
32
|
-
};
|
|
33
|
-
export declare type TSequence = {
|
|
34
|
-
from: number;
|
|
35
|
-
duration: number;
|
|
36
|
-
id: string;
|
|
37
|
-
displayName: string;
|
|
38
|
-
parent: string | null;
|
|
39
|
-
rootId: string;
|
|
40
|
-
showInTimeline: boolean;
|
|
41
|
-
nonce: number;
|
|
42
|
-
showLoopTimesInTimeline: number | undefined;
|
|
43
|
-
} & EnhancedTSequenceData;
|
|
44
|
-
export declare type TAsset = {
|
|
45
|
-
type: 'audio' | 'video';
|
|
46
|
-
src: string;
|
|
47
|
-
id: string;
|
|
48
|
-
frame: number;
|
|
49
|
-
volume: number;
|
|
50
|
-
mediaFrame: number;
|
|
51
|
-
playbackRate: number;
|
|
52
|
-
};
|
|
53
|
-
declare type BaseMetadata = Pick<TCompMetadata, 'durationInFrames' | 'fps' | 'defaultProps' | 'height' | 'width'>;
|
|
54
|
-
export declare type CompositionManagerContext = {
|
|
55
|
-
compositions: TComposition[];
|
|
56
|
-
registerComposition: <T>(comp: TComposition<T>) => void;
|
|
57
|
-
unregisterComposition: (name: string) => void;
|
|
58
|
-
registerFolder: (name: string, parent: string | null) => void;
|
|
59
|
-
unregisterFolder: (name: string, parent: string | null) => void;
|
|
60
|
-
currentComposition: string | null;
|
|
61
|
-
setCurrentComposition: (curr: string) => void;
|
|
62
|
-
setCurrentCompositionMetadata: (metadata: BaseMetadata) => void;
|
|
63
|
-
currentCompositionMetadata: BaseMetadata | null;
|
|
64
|
-
registerSequence: (seq: TSequence) => void;
|
|
65
|
-
unregisterSequence: (id: string) => void;
|
|
66
|
-
registerAsset: (asset: TAsset) => void;
|
|
67
|
-
unregisterAsset: (id: string) => void;
|
|
68
|
-
sequences: TSequence[];
|
|
69
|
-
assets: TAsset[];
|
|
70
|
-
folders: TFolder[];
|
|
71
|
-
};
|
|
72
|
-
export declare const CompositionManager: React.Context<CompositionManagerContext>;
|
|
73
|
-
export declare const compositionsRef: React.RefObject<{
|
|
74
|
-
getCompositions: () => TCompMetadata[];
|
|
75
|
-
}>;
|
|
76
|
-
export declare const CompositionManagerProvider: React.FC<{
|
|
77
|
-
children: React.ReactNode;
|
|
78
|
-
}>;
|
|
79
|
-
export {};
|
package/dist/Img.d.ts
DELETED
package/dist/Img.js
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Img = void 0;
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const react_1 = require("react");
|
|
6
|
-
const delay_render_1 = require("./delay-render");
|
|
7
|
-
const get_environment_1 = require("./get-environment");
|
|
8
|
-
const prefetch_1 = require("./prefetch");
|
|
9
|
-
const ImgRefForwarding = ({ onError, src, ...props }, ref) => {
|
|
10
|
-
const imageRef = (0, react_1.useRef)(null);
|
|
11
|
-
(0, react_1.useImperativeHandle)(ref, () => {
|
|
12
|
-
return imageRef.current;
|
|
13
|
-
}, []);
|
|
14
|
-
const actualSrc = (0, prefetch_1.usePreload)(src);
|
|
15
|
-
const didGetError = (0, react_1.useCallback)((e) => {
|
|
16
|
-
var _a;
|
|
17
|
-
if (onError) {
|
|
18
|
-
onError(e);
|
|
19
|
-
}
|
|
20
|
-
else {
|
|
21
|
-
console.error('Error loading image with src:', (_a = imageRef.current) === null || _a === void 0 ? void 0 : _a.src, e, 'Handle the event using the onError() prop to make this message disappear.');
|
|
22
|
-
}
|
|
23
|
-
}, [onError]);
|
|
24
|
-
// If image source switches, make new handle
|
|
25
|
-
if ((0, get_environment_1.getRemotionEnvironment)() === 'rendering') {
|
|
26
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
27
|
-
(0, react_1.useLayoutEffect)(() => {
|
|
28
|
-
if (process.env.NODE_ENV === 'test') {
|
|
29
|
-
return;
|
|
30
|
-
}
|
|
31
|
-
const newHandle = (0, delay_render_1.delayRender)('Loading <Img> with src=' + src);
|
|
32
|
-
const { current } = imageRef;
|
|
33
|
-
const didLoad = () => {
|
|
34
|
-
(0, delay_render_1.continueRender)(newHandle);
|
|
35
|
-
};
|
|
36
|
-
if (current === null || current === void 0 ? void 0 : current.complete) {
|
|
37
|
-
(0, delay_render_1.continueRender)(newHandle);
|
|
38
|
-
}
|
|
39
|
-
else {
|
|
40
|
-
current === null || current === void 0 ? void 0 : current.addEventListener('load', didLoad, { once: true });
|
|
41
|
-
}
|
|
42
|
-
// If tag gets unmounted, clear pending handles because image is not going to load
|
|
43
|
-
return () => {
|
|
44
|
-
current === null || current === void 0 ? void 0 : current.removeEventListener('load', didLoad);
|
|
45
|
-
(0, delay_render_1.continueRender)(newHandle);
|
|
46
|
-
};
|
|
47
|
-
}, [src]);
|
|
48
|
-
}
|
|
49
|
-
return ((0, jsx_runtime_1.jsx)("img", { ...props, ref: imageRef, src: actualSrc, onError: didGetError }));
|
|
50
|
-
};
|
|
51
|
-
exports.Img = (0, react_1.forwardRef)(ImgRefForwarding);
|
package/dist/RemotionRoot.js
DELETED
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.RemotionRoot = void 0;
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const react_1 = require("react");
|
|
6
|
-
const shared_audio_tags_1 = require("./audio/shared-audio-tags");
|
|
7
|
-
const CompositionManager_1 = require("./CompositionManager");
|
|
8
|
-
const delay_render_1 = require("./delay-render");
|
|
9
|
-
const nonce_1 = require("./nonce");
|
|
10
|
-
const prefetch_state_1 = require("./prefetch-state");
|
|
11
|
-
const random_1 = require("./random");
|
|
12
|
-
const timeline_position_state_1 = require("./timeline-position-state");
|
|
13
|
-
const RemotionRoot = ({ children }) => {
|
|
14
|
-
var _a;
|
|
15
|
-
const [remotionRootId] = (0, react_1.useState)(() => String((0, random_1.random)(null)));
|
|
16
|
-
const [frame, setFrame] = (0, react_1.useState)((_a = window.remotion_initialFrame) !== null && _a !== void 0 ? _a : 0);
|
|
17
|
-
const [playing, setPlaying] = (0, react_1.useState)(false);
|
|
18
|
-
const imperativePlaying = (0, react_1.useRef)(false);
|
|
19
|
-
const [fastRefreshes, setFastRefreshes] = (0, react_1.useState)(0);
|
|
20
|
-
const [playbackRate, setPlaybackRate] = (0, react_1.useState)(1);
|
|
21
|
-
const audioAndVideoTags = (0, react_1.useRef)([]);
|
|
22
|
-
(0, react_1.useLayoutEffect)(() => {
|
|
23
|
-
if (typeof window !== 'undefined') {
|
|
24
|
-
window.remotion_setFrame = (f) => {
|
|
25
|
-
const id = (0, delay_render_1.delayRender)(`Setting the current frame to ${f}`);
|
|
26
|
-
setFrame(f);
|
|
27
|
-
requestAnimationFrame(() => (0, delay_render_1.continueRender)(id));
|
|
28
|
-
};
|
|
29
|
-
window.remotion_isPlayer = false;
|
|
30
|
-
}
|
|
31
|
-
}, []);
|
|
32
|
-
const timelineContextValue = (0, react_1.useMemo)(() => {
|
|
33
|
-
return {
|
|
34
|
-
frame,
|
|
35
|
-
playing,
|
|
36
|
-
imperativePlaying,
|
|
37
|
-
rootId: remotionRootId,
|
|
38
|
-
playbackRate,
|
|
39
|
-
setPlaybackRate,
|
|
40
|
-
audioAndVideoTags,
|
|
41
|
-
};
|
|
42
|
-
}, [frame, playbackRate, playing, remotionRootId]);
|
|
43
|
-
const setTimelineContextValue = (0, react_1.useMemo)(() => {
|
|
44
|
-
return {
|
|
45
|
-
setFrame,
|
|
46
|
-
setPlaying,
|
|
47
|
-
};
|
|
48
|
-
}, []);
|
|
49
|
-
const nonceContext = (0, react_1.useMemo)(() => {
|
|
50
|
-
let counter = 0;
|
|
51
|
-
return {
|
|
52
|
-
getNonce: () => counter++,
|
|
53
|
-
fastRefreshes,
|
|
54
|
-
};
|
|
55
|
-
}, [fastRefreshes]);
|
|
56
|
-
(0, react_1.useEffect)(() => {
|
|
57
|
-
if (module.hot) {
|
|
58
|
-
module.hot.addStatusHandler((status) => {
|
|
59
|
-
if (status === 'idle') {
|
|
60
|
-
setFastRefreshes((i) => i + 1);
|
|
61
|
-
}
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
}, []);
|
|
65
|
-
return ((0, jsx_runtime_1.jsx)(nonce_1.NonceContext.Provider, { value: nonceContext, children: (0, jsx_runtime_1.jsx)(timeline_position_state_1.TimelineContext.Provider, { value: timelineContextValue, children: (0, jsx_runtime_1.jsx)(timeline_position_state_1.SetTimelineContext.Provider, { value: setTimelineContextValue, children: (0, jsx_runtime_1.jsx)(prefetch_state_1.PrefetchProvider, { children: (0, jsx_runtime_1.jsx)(CompositionManager_1.CompositionManagerProvider, { children: (0, jsx_runtime_1.jsx)(shared_audio_tags_1.SharedAudioContextProvider
|
|
66
|
-
// In the preview, which is mostly played on Desktop, we opt out of the autoplay policy fix as described in https://github.com/remotion-dev/remotion/pull/554, as it mostly applies to mobile.
|
|
67
|
-
, {
|
|
68
|
-
// In the preview, which is mostly played on Desktop, we opt out of the autoplay policy fix as described in https://github.com/remotion-dev/remotion/pull/554, as it mostly applies to mobile.
|
|
69
|
-
numberOfAudioTags: 0, children: children }) }) }) }) }) }));
|
|
70
|
-
};
|
|
71
|
-
exports.RemotionRoot = RemotionRoot;
|
package/dist/Sequence.d.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
export declare type SequenceContextType = {
|
|
3
|
-
cumulatedFrom: number;
|
|
4
|
-
relativeFrom: number;
|
|
5
|
-
parentFrom: number;
|
|
6
|
-
durationInFrames: number;
|
|
7
|
-
id: string;
|
|
8
|
-
};
|
|
9
|
-
export declare const SequenceContext: React.Context<SequenceContextType | null>;
|
|
10
|
-
declare type LayoutAndStyle = {
|
|
11
|
-
layout: 'none';
|
|
12
|
-
} | {
|
|
13
|
-
layout?: 'absolute-fill';
|
|
14
|
-
style?: React.CSSProperties;
|
|
15
|
-
};
|
|
16
|
-
export declare type SequenceProps = {
|
|
17
|
-
children: React.ReactNode;
|
|
18
|
-
from: number;
|
|
19
|
-
durationInFrames?: number;
|
|
20
|
-
name?: string;
|
|
21
|
-
showInTimeline?: boolean;
|
|
22
|
-
showLoopTimesInTimeline?: number;
|
|
23
|
-
} & LayoutAndStyle;
|
|
24
|
-
/**
|
|
25
|
-
* A component that time-shifts its children and wraps them in an absolutely positioned <div>.
|
|
26
|
-
* @link https://www.remotion.dev/docs/sequence
|
|
27
|
-
*/
|
|
28
|
-
export declare const Sequence: React.ForwardRefExoticComponent<SequenceProps & React.RefAttributes<HTMLDivElement>>;
|
|
29
|
-
export {};
|
package/dist/Still.d.ts
DELETED
package/dist/Still.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Still = void 0;
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const Composition_1 = require("./Composition");
|
|
6
|
-
const Still = (props) => {
|
|
7
|
-
return (0, jsx_runtime_1.jsx)(Composition_1.Composition, { fps: 1, durationInFrames: 1, ...props });
|
|
8
|
-
};
|
|
9
|
-
exports.Still = Still;
|
package/dist/audio/Audio.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Audio = void 0;
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const react_1 = require("react");
|
|
6
|
-
const get_environment_1 = require("../get-environment");
|
|
7
|
-
const Sequence_1 = require("../Sequence");
|
|
8
|
-
const validate_media_props_1 = require("../validate-media-props");
|
|
9
|
-
const validate_start_from_props_1 = require("../validate-start-from-props");
|
|
10
|
-
const AudioForDevelopment_1 = require("./AudioForDevelopment");
|
|
11
|
-
const AudioForRendering_1 = require("./AudioForRendering");
|
|
12
|
-
const shared_audio_tags_1 = require("./shared-audio-tags");
|
|
13
|
-
const AudioRefForwardingFunction = (props, ref) => {
|
|
14
|
-
const audioContext = (0, react_1.useContext)(shared_audio_tags_1.SharedAudioContext);
|
|
15
|
-
const { startFrom, endAt, ...otherProps } = props;
|
|
16
|
-
const onError = (0, react_1.useCallback)((e) => {
|
|
17
|
-
console.log(e.currentTarget.error);
|
|
18
|
-
throw new Error(`Could not play audio with src ${otherProps.src}: ${e.currentTarget.error}. See https://remotion.dev/docs/media-playback-error for help.`);
|
|
19
|
-
}, [otherProps.src]);
|
|
20
|
-
if (typeof startFrom !== 'undefined' || typeof endAt !== 'undefined') {
|
|
21
|
-
(0, validate_start_from_props_1.validateStartFromProps)(startFrom, endAt);
|
|
22
|
-
const startFromFrameNo = startFrom !== null && startFrom !== void 0 ? startFrom : 0;
|
|
23
|
-
const endAtFrameNo = endAt !== null && endAt !== void 0 ? endAt : Infinity;
|
|
24
|
-
return ((0, jsx_runtime_1.jsx)(Sequence_1.Sequence, { layout: "none", from: 0 - startFromFrameNo, showInTimeline: false, durationInFrames: endAtFrameNo, children: (0, jsx_runtime_1.jsx)(exports.Audio, { ...otherProps, ref: ref }) }));
|
|
25
|
-
}
|
|
26
|
-
(0, validate_media_props_1.validateMediaProps)(props, 'Audio');
|
|
27
|
-
if ((0, get_environment_1.getRemotionEnvironment)() === 'rendering') {
|
|
28
|
-
return (0, jsx_runtime_1.jsx)(AudioForRendering_1.AudioForRendering, { ...props, ref: ref, onError: onError });
|
|
29
|
-
}
|
|
30
|
-
return ((0, jsx_runtime_1.jsx)(AudioForDevelopment_1.AudioForDevelopment, { shouldPreMountAudioTags: audioContext !== null && audioContext.numberOfAudioTags > 0, ...props, ref: ref, onError: onError }));
|
|
31
|
-
};
|
|
32
|
-
exports.Audio = (0, react_1.forwardRef)(AudioRefForwardingFunction);
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
export declare const AudioForDevelopment: ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.AudioHTMLAttributes<HTMLAudioElement>, HTMLAudioElement>, "onEnded" | "autoPlay" | "controls" | "loop"> & {
|
|
4
|
-
volume?: import("../volume-prop").VolumeProp | undefined;
|
|
5
|
-
playbackRate?: number | undefined;
|
|
6
|
-
} & {
|
|
7
|
-
shouldPreMountAudioTags: boolean;
|
|
8
|
-
} & RefAttributes<HTMLAudioElement>>;
|