remotion 4.0.537 → 4.0.539
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/cjs/AbsoluteFill.d.ts +62 -62
- package/dist/cjs/AbsoluteFill.js +3 -3
- package/dist/cjs/AbsoluteFillElement.d.ts +1 -1
- package/dist/cjs/AbsoluteFillElement.js +43 -5
- package/dist/cjs/CanUseRemotionHooks.js +1 -1
- package/dist/cjs/Composition.js +5 -11
- package/dist/cjs/CompositionErrorBoundary.js +5 -2
- package/dist/cjs/CompositionManager.d.ts +1 -0
- package/dist/cjs/CompositionManagerProvider.d.ts +1 -1
- package/dist/cjs/CompositionManagerProvider.js +1 -1
- package/dist/cjs/CompositionRegistryProvider.d.ts +1 -1
- package/dist/cjs/CompositionRegistryProvider.js +1 -1
- package/dist/cjs/EditorProps.d.ts +2 -2
- package/dist/cjs/EditorProps.js +1 -1
- package/dist/cjs/Folder.js +1 -1
- package/dist/cjs/HtmlInCanvas.d.ts +58 -67
- package/dist/cjs/HtmlInCanvas.js +22 -9
- package/dist/cjs/HtmlInCanvasFallback.d.ts +6 -0
- package/dist/cjs/HtmlInCanvasFallback.js +39 -0
- package/dist/cjs/IFrame.d.ts +2 -2
- package/dist/cjs/IFrame.js +1 -1
- package/dist/cjs/Img.d.ts +62 -62
- package/dist/cjs/Img.js +160 -132
- package/dist/cjs/Interactive.d.ts +147 -145
- package/dist/cjs/Interactive.js +2 -2
- package/dist/cjs/RemotionRoot.js +1 -1
- package/dist/cjs/RenderAssetManager.js +1 -1
- package/dist/cjs/Sequence.js +37 -27
- package/dist/cjs/SequenceActivityBoundary.js +1 -1
- package/dist/cjs/SequenceActivityBudget.js +1 -1
- package/dist/cjs/SequenceActivitySuspensionProvider.js +1 -1
- package/dist/cjs/SequenceManager.d.ts +6 -0
- package/dist/cjs/SequenceManager.js +71 -27
- package/dist/cjs/SequenceRegistryProvider.js +16 -3
- package/dist/cjs/TimelineContext.js +1 -1
- package/dist/cjs/Track.js +2 -2
- package/dist/cjs/animated-image/AnimatedImage.d.ts +69 -69
- package/dist/cjs/animated-image/AnimatedImage.js +6 -6
- package/dist/cjs/animated-image/canvas.d.ts +6 -5
- package/dist/cjs/animated-image/canvas.js +1 -1
- package/dist/cjs/animated-image/create-image-decoder.d.ts +1 -1
- package/dist/cjs/animated-image/decode-image.d.ts +1 -1
- package/dist/cjs/animated-image/decode-image.js +2 -0
- package/dist/cjs/animated-image/get-duration-in-seconds.d.ts +1 -1
- package/dist/cjs/animated-image/index.js +1 -1
- package/dist/cjs/audio/AudioForPreview.js +5 -28
- package/dist/cjs/audio/AudioForRendering.d.ts +5 -20
- package/dist/cjs/audio/AudioForRendering.js +44 -5
- package/dist/cjs/audio/html5-audio.d.ts +36 -36
- package/dist/cjs/audio/html5-audio.js +8 -10
- package/dist/cjs/audio/index.js +1 -1
- package/dist/cjs/audio/shared-audio-tags.js +10 -16
- package/dist/cjs/audio/shared-element-source-node.d.ts +1 -1
- package/dist/cjs/audio/use-audio-context.d.ts +2 -1
- package/dist/cjs/audio/wait-until-actually-resumed.d.ts +2 -1
- package/dist/cjs/buffer-until-first-frame.d.ts +4 -3
- package/dist/cjs/buffering.js +1 -1
- package/dist/cjs/cancel-render.js +3 -0
- package/dist/cjs/canvas-image/CanvasImage.d.ts +71 -71
- package/dist/cjs/canvas-image/CanvasImage.js +27 -24
- package/dist/cjs/canvas-image/index.js +1 -1
- package/dist/cjs/codec.d.ts +1 -1
- package/dist/cjs/committed-metadata.d.ts +4 -2
- package/dist/cjs/composition-registry-fallback.d.ts +4 -2
- package/dist/cjs/composition-registry-fallback.js +12 -10
- package/dist/cjs/create-element-source-proxy.js +46 -6
- package/dist/cjs/default-css.d.ts +1 -1
- package/dist/cjs/delay-render.d.ts +2 -1
- package/dist/cjs/delay-render.js +4 -2
- package/dist/cjs/easing.js +3 -1
- package/dist/cjs/effects/Solid.d.ts +60 -60
- package/dist/cjs/effects/Solid.js +2 -2
- package/dist/cjs/effects/canvas-pool.js +6 -9
- package/dist/cjs/effects/create-curve-sampler.d.ts +1 -0
- package/dist/cjs/effects/create-curve-sampler.js +100 -0
- package/dist/cjs/effects/effect-source-observer.d.ts +13 -0
- package/dist/cjs/effects/effect-source-observer.js +177 -0
- package/dist/cjs/effects/index.js +1 -1
- package/dist/cjs/effects/run-effect-chain.js +3 -0
- package/dist/cjs/effects/use-memoized-effects.d.ts +2 -1
- package/dist/cjs/effects/use-memoized-effects.js +29 -13
- package/dist/cjs/freeze.js +2 -2
- package/dist/cjs/get-cross-origin-value.d.ts +1 -1
- package/dist/cjs/get-effective-visual-mode-value.d.ts +2 -2
- package/dist/cjs/index.d.ts +3 -1
- package/dist/cjs/index.js +32 -32
- package/dist/cjs/interactivity-schema.d.ts +286 -286
- package/dist/cjs/internals.d.ts +412 -595
- package/dist/cjs/internals.js +11 -0
- package/dist/cjs/interpolate-colors.d.ts +1 -1
- package/dist/cjs/interpolate-colors.js +28 -23
- package/dist/cjs/interpolate.d.ts +2 -9
- package/dist/cjs/interpolate.js +37 -33
- package/dist/cjs/is-player.js +1 -1
- package/dist/cjs/loading-indicator.js +2 -6
- package/dist/cjs/log-level-context.d.ts +1 -1
- package/dist/cjs/log.d.ts +12 -7
- package/dist/cjs/loop/index.js +1 -1
- package/dist/cjs/media-resource-manager.d.ts +1 -1
- package/dist/cjs/media-tag-current-time-timestamp.d.ts +1 -1
- package/dist/cjs/no-react.d.ts +85 -91
- package/dist/cjs/no-react.js +2 -2
- package/dist/cjs/nonce.d.ts +11 -0
- package/dist/cjs/nonce.js +42 -0
- package/dist/cjs/play-and-handle-not-allowed-error.d.ts +5 -4
- package/dist/cjs/playback-logging.d.ts +2 -1
- package/dist/cjs/playback-pitch-context.d.ts +1 -0
- package/dist/cjs/playback-pitch-context.js +5 -0
- package/dist/cjs/prefetch-state.js +1 -1
- package/dist/cjs/prefetch.d.ts +7 -6
- package/dist/cjs/prefetch.js +30 -5
- package/dist/cjs/props-if-has-props.d.ts +2 -1
- package/dist/cjs/prores-profile.d.ts +1 -1
- package/dist/cjs/register-root.d.ts +2 -2
- package/dist/cjs/render-resource-manager.d.ts +1 -1
- package/dist/cjs/render-types.d.ts +2 -2
- package/dist/cjs/resolve-video-config.d.ts +8 -8
- package/dist/cjs/runtime-value-store.d.ts +1 -1
- package/dist/cjs/scale-value.d.ts +1 -1
- package/dist/cjs/seek.d.ts +3 -2
- package/dist/cjs/sequence-activity-context.js +1 -1
- package/dist/cjs/sequence-crop.js +1 -4
- package/dist/cjs/sequence-order-marker.d.ts +58 -0
- package/dist/cjs/sequence-order-marker.js +44 -0
- package/dist/cjs/series/flatten-children.d.ts +3 -1
- package/dist/cjs/series/index.js +4 -5
- package/dist/cjs/series/is-inside-series.js +2 -2
- package/dist/cjs/spring/index.d.ts +1 -1
- package/dist/cjs/spring/index.js +2 -4
- package/dist/cjs/spring/measure-spring.d.ts +1 -1
- package/dist/cjs/spring/spring-utils.d.ts +1 -1
- package/dist/cjs/spring/spring-utils.js +11 -5
- package/dist/cjs/timeline-position-state.d.ts +1 -1
- package/dist/cjs/timeline-position-state.js +2 -2
- package/dist/cjs/use-amplification.d.ts +4 -7
- package/dist/cjs/use-current-scale.d.ts +2 -2
- package/dist/cjs/use-delay-render.d.ts +2 -1
- package/dist/cjs/use-lazy-component.d.ts +1 -1
- package/dist/cjs/use-lazy-component.js +20 -9
- package/dist/cjs/use-media-buffering.d.ts +3 -2
- package/dist/cjs/use-media-duration.d.ts +4 -0
- package/dist/cjs/use-media-duration.js +36 -0
- package/dist/cjs/use-media-enabled.d.ts +1 -1
- package/dist/cjs/use-media-enabled.js +1 -1
- package/dist/cjs/use-media-in-timeline.d.ts +1 -1
- package/dist/cjs/use-media-playback.d.ts +3 -3
- package/dist/cjs/use-media-tag.d.ts +2 -2
- package/dist/cjs/use-pixel-density.d.ts +1 -1
- package/dist/cjs/use-premounting.d.ts +1 -1
- package/dist/cjs/use-premounting.js +6 -2
- package/dist/cjs/use-request-video-callback-time.d.ts +3 -3
- package/dist/cjs/use-schema.d.ts +4 -4
- package/dist/cjs/use-video.js +1 -1
- package/dist/cjs/validate-media-props.d.ts +1 -1
- package/dist/cjs/validation/validate-default-props.d.ts +1 -1
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/video/MediaPlaybackError.js +0 -1
- package/dist/cjs/video/OffthreadVideo.js +5 -5
- package/dist/cjs/video/OffthreadVideoForRendering.js +9 -7
- package/dist/cjs/video/VideoForPreview.js +6 -28
- package/dist/cjs/video/VideoForRendering.d.ts +5 -3
- package/dist/cjs/video/VideoForRendering.js +4 -2
- package/dist/cjs/video/duration-state.d.ts +1 -0
- package/dist/cjs/video/duration-state.js +8 -2
- package/dist/cjs/video/emit-video-frame.d.ts +1 -1
- package/dist/cjs/video/html5-video.d.ts +36 -36
- package/dist/cjs/video/html5-video.js +8 -10
- package/dist/cjs/video/index.js +2 -2
- package/dist/cjs/video/seek-until-right.d.ts +3 -2
- package/dist/cjs/warn-about-non-seekable-media.d.ts +1 -1
- package/dist/cjs/with-interactivity-schema.d.ts +1 -1
- package/dist/cjs/with-interactivity-schema.js +3 -8
- package/dist/cjs/wrap-remotion-context.d.ts +4 -4
- package/dist/cjs/wrap-remotion-context.js +2 -2
- package/dist/esm/index.mjs +1304 -819
- package/dist/esm/no-react.mjs +74 -52
- package/dist/esm/version.mjs +1 -1
- package/package.json +4 -4
|
@@ -3,52 +3,52 @@ import type { SequenceControls } from '../CompositionManager.js';
|
|
|
3
3
|
import type { EffectsProp, EffectsOutputSize } from '../effects/effect-types.js';
|
|
4
4
|
export declare const animatedImageSchema: {
|
|
5
5
|
readonly 'style.transformOrigin': {
|
|
6
|
-
readonly type:
|
|
6
|
+
readonly type: 'transform-origin';
|
|
7
7
|
readonly step: 1;
|
|
8
|
-
readonly default:
|
|
9
|
-
readonly description:
|
|
8
|
+
readonly default: '50% 50%';
|
|
9
|
+
readonly description: 'Transform origin';
|
|
10
10
|
};
|
|
11
11
|
readonly 'style.translate': {
|
|
12
|
-
readonly type:
|
|
12
|
+
readonly type: 'translate';
|
|
13
13
|
readonly step: 1;
|
|
14
|
-
readonly default:
|
|
15
|
-
readonly description:
|
|
14
|
+
readonly default: '0px 0px';
|
|
15
|
+
readonly description: 'Offset';
|
|
16
16
|
};
|
|
17
17
|
readonly 'style.scale': {
|
|
18
|
-
readonly type:
|
|
18
|
+
readonly type: 'scale';
|
|
19
19
|
readonly max: 100;
|
|
20
20
|
readonly step: 0.01;
|
|
21
21
|
readonly default: 1;
|
|
22
|
-
readonly description:
|
|
23
|
-
readonly defaultKeyframeOutput:
|
|
22
|
+
readonly description: 'Scale';
|
|
23
|
+
readonly defaultKeyframeOutput: 'perceptual-scale';
|
|
24
24
|
};
|
|
25
25
|
readonly 'style.rotate': {
|
|
26
|
-
readonly type:
|
|
26
|
+
readonly type: 'rotation-css';
|
|
27
27
|
readonly step: 1;
|
|
28
|
-
readonly default:
|
|
29
|
-
readonly description:
|
|
28
|
+
readonly default: '0deg';
|
|
29
|
+
readonly description: 'Rotation';
|
|
30
30
|
};
|
|
31
31
|
readonly 'style.opacity': {
|
|
32
|
-
readonly type:
|
|
32
|
+
readonly type: 'number';
|
|
33
33
|
readonly min: 0;
|
|
34
34
|
readonly max: 1;
|
|
35
35
|
readonly step: 0.01;
|
|
36
36
|
readonly default: 1;
|
|
37
|
-
readonly description:
|
|
37
|
+
readonly description: 'Opacity';
|
|
38
38
|
readonly hiddenFromList: false;
|
|
39
39
|
};
|
|
40
40
|
readonly 'style.borderWidth': {
|
|
41
|
-
readonly type:
|
|
41
|
+
readonly type: 'number';
|
|
42
42
|
readonly default: undefined;
|
|
43
43
|
readonly min: 0;
|
|
44
44
|
readonly step: 1;
|
|
45
|
-
readonly description:
|
|
45
|
+
readonly description: 'Border width';
|
|
46
46
|
readonly hiddenFromList: false;
|
|
47
47
|
};
|
|
48
48
|
readonly 'style.borderStyle': {
|
|
49
|
-
readonly type:
|
|
50
|
-
readonly default:
|
|
51
|
-
readonly description:
|
|
49
|
+
readonly type: 'enum';
|
|
50
|
+
readonly default: 'none';
|
|
51
|
+
readonly description: 'Border style';
|
|
52
52
|
readonly variants: {
|
|
53
53
|
readonly none: {};
|
|
54
54
|
readonly hidden: {};
|
|
@@ -63,67 +63,67 @@ export declare const animatedImageSchema: {
|
|
|
63
63
|
};
|
|
64
64
|
};
|
|
65
65
|
readonly 'style.borderColor': {
|
|
66
|
-
readonly type:
|
|
66
|
+
readonly type: 'color';
|
|
67
67
|
readonly default: undefined;
|
|
68
|
-
readonly description:
|
|
68
|
+
readonly description: 'Border color';
|
|
69
69
|
};
|
|
70
70
|
readonly 'style.borderRadius': {
|
|
71
|
-
readonly type:
|
|
71
|
+
readonly type: 'number';
|
|
72
72
|
readonly default: 0;
|
|
73
73
|
readonly min: 0;
|
|
74
74
|
readonly step: 1;
|
|
75
|
-
readonly description:
|
|
75
|
+
readonly description: 'Border radius';
|
|
76
76
|
readonly hiddenFromList: false;
|
|
77
77
|
readonly keyframable: true;
|
|
78
78
|
};
|
|
79
79
|
readonly 'style.borderTopLeftRadius': {
|
|
80
|
-
readonly type:
|
|
80
|
+
readonly type: 'number';
|
|
81
81
|
readonly default: 0;
|
|
82
82
|
readonly min: 0;
|
|
83
83
|
readonly step: 1;
|
|
84
|
-
readonly description:
|
|
84
|
+
readonly description: 'Top left radius';
|
|
85
85
|
readonly hiddenFromList: false;
|
|
86
86
|
};
|
|
87
87
|
readonly 'style.borderTopRightRadius': {
|
|
88
|
-
readonly type:
|
|
88
|
+
readonly type: 'number';
|
|
89
89
|
readonly default: 0;
|
|
90
90
|
readonly min: 0;
|
|
91
91
|
readonly step: 1;
|
|
92
|
-
readonly description:
|
|
92
|
+
readonly description: 'Top right radius';
|
|
93
93
|
readonly hiddenFromList: false;
|
|
94
94
|
};
|
|
95
95
|
readonly 'style.borderBottomRightRadius': {
|
|
96
|
-
readonly type:
|
|
96
|
+
readonly type: 'number';
|
|
97
97
|
readonly default: 0;
|
|
98
98
|
readonly min: 0;
|
|
99
99
|
readonly step: 1;
|
|
100
|
-
readonly description:
|
|
100
|
+
readonly description: 'Bottom right radius';
|
|
101
101
|
readonly hiddenFromList: false;
|
|
102
102
|
};
|
|
103
103
|
readonly 'style.borderBottomLeftRadius': {
|
|
104
|
-
readonly type:
|
|
104
|
+
readonly type: 'number';
|
|
105
105
|
readonly default: 0;
|
|
106
106
|
readonly min: 0;
|
|
107
107
|
readonly step: 1;
|
|
108
|
-
readonly description:
|
|
108
|
+
readonly description: 'Bottom left radius';
|
|
109
109
|
readonly hiddenFromList: false;
|
|
110
110
|
};
|
|
111
111
|
readonly 'style.backgroundColor': {
|
|
112
|
-
readonly type:
|
|
113
|
-
readonly default:
|
|
114
|
-
readonly description:
|
|
112
|
+
readonly type: 'color';
|
|
113
|
+
readonly default: 'transparent';
|
|
114
|
+
readonly description: 'Color';
|
|
115
115
|
};
|
|
116
116
|
readonly premountFor: {
|
|
117
|
-
readonly type:
|
|
117
|
+
readonly type: 'number';
|
|
118
118
|
readonly default: undefined;
|
|
119
|
-
readonly description:
|
|
119
|
+
readonly description: 'Premount For';
|
|
120
120
|
readonly min: 0;
|
|
121
121
|
readonly step: 1;
|
|
122
122
|
readonly hiddenFromList: false;
|
|
123
123
|
readonly keyframable: false;
|
|
124
124
|
};
|
|
125
125
|
readonly postmountFor: {
|
|
126
|
-
readonly type:
|
|
126
|
+
readonly type: 'number';
|
|
127
127
|
readonly default: 0;
|
|
128
128
|
readonly min: 0;
|
|
129
129
|
readonly step: 1;
|
|
@@ -131,9 +131,9 @@ export declare const animatedImageSchema: {
|
|
|
131
131
|
readonly keyframable: false;
|
|
132
132
|
};
|
|
133
133
|
readonly cropLeft: {
|
|
134
|
-
readonly type:
|
|
134
|
+
readonly type: 'number';
|
|
135
135
|
readonly default: 0;
|
|
136
|
-
readonly description:
|
|
136
|
+
readonly description: 'Crop left';
|
|
137
137
|
readonly min: 0;
|
|
138
138
|
readonly max: 1;
|
|
139
139
|
readonly step: 0.01;
|
|
@@ -141,9 +141,9 @@ export declare const animatedImageSchema: {
|
|
|
141
141
|
readonly keyframable: true;
|
|
142
142
|
};
|
|
143
143
|
readonly cropRight: {
|
|
144
|
-
readonly type:
|
|
144
|
+
readonly type: 'number';
|
|
145
145
|
readonly default: 0;
|
|
146
|
-
readonly description:
|
|
146
|
+
readonly description: 'Crop right';
|
|
147
147
|
readonly min: 0;
|
|
148
148
|
readonly max: 1;
|
|
149
149
|
readonly step: 0.01;
|
|
@@ -151,9 +151,9 @@ export declare const animatedImageSchema: {
|
|
|
151
151
|
readonly keyframable: true;
|
|
152
152
|
};
|
|
153
153
|
readonly cropTop: {
|
|
154
|
-
readonly type:
|
|
154
|
+
readonly type: 'number';
|
|
155
155
|
readonly default: 0;
|
|
156
|
-
readonly description:
|
|
156
|
+
readonly description: 'Crop top';
|
|
157
157
|
readonly min: 0;
|
|
158
158
|
readonly max: 1;
|
|
159
159
|
readonly step: 0.01;
|
|
@@ -161,9 +161,9 @@ export declare const animatedImageSchema: {
|
|
|
161
161
|
readonly keyframable: true;
|
|
162
162
|
};
|
|
163
163
|
readonly cropBottom: {
|
|
164
|
-
readonly type:
|
|
164
|
+
readonly type: 'number';
|
|
165
165
|
readonly default: 0;
|
|
166
|
-
readonly description:
|
|
166
|
+
readonly description: 'Crop bottom';
|
|
167
167
|
readonly min: 0;
|
|
168
168
|
readonly max: 1;
|
|
169
169
|
readonly step: 0.01;
|
|
@@ -171,36 +171,36 @@ export declare const animatedImageSchema: {
|
|
|
171
171
|
readonly keyframable: true;
|
|
172
172
|
};
|
|
173
173
|
readonly durationInFrames: {
|
|
174
|
-
readonly type:
|
|
174
|
+
readonly type: 'number';
|
|
175
175
|
readonly default: undefined;
|
|
176
176
|
readonly min: 1;
|
|
177
177
|
readonly step: 1;
|
|
178
178
|
readonly hiddenFromList: true;
|
|
179
179
|
};
|
|
180
180
|
readonly from: {
|
|
181
|
-
readonly type:
|
|
181
|
+
readonly type: 'number';
|
|
182
182
|
readonly default: 0;
|
|
183
183
|
readonly step: 1;
|
|
184
184
|
readonly hiddenFromList: true;
|
|
185
185
|
};
|
|
186
186
|
readonly trimBefore: {
|
|
187
|
-
readonly type:
|
|
187
|
+
readonly type: 'number';
|
|
188
188
|
readonly default: 0;
|
|
189
189
|
readonly min: 0;
|
|
190
190
|
readonly step: 1;
|
|
191
191
|
readonly hiddenFromList: true;
|
|
192
192
|
};
|
|
193
193
|
readonly playbackRate: {
|
|
194
|
-
readonly type:
|
|
194
|
+
readonly type: 'number';
|
|
195
195
|
readonly default: 1;
|
|
196
196
|
readonly min: 0.01;
|
|
197
197
|
readonly step: 0.1;
|
|
198
|
-
readonly description:
|
|
198
|
+
readonly description: 'Playback rate';
|
|
199
199
|
readonly hiddenFromList: false;
|
|
200
200
|
readonly keyframable: false;
|
|
201
201
|
};
|
|
202
202
|
readonly freeze: {
|
|
203
|
-
readonly type:
|
|
203
|
+
readonly type: 'number';
|
|
204
204
|
readonly default: null;
|
|
205
205
|
readonly step: 1;
|
|
206
206
|
readonly hiddenFromList: true;
|
|
@@ -209,35 +209,35 @@ export declare const animatedImageSchema: {
|
|
|
209
209
|
readonly name: import("../interactivity-schema.js").HiddenFieldSchema;
|
|
210
210
|
readonly showInTimeline: import("../interactivity-schema.js").HiddenFieldSchema;
|
|
211
211
|
readonly src: {
|
|
212
|
-
readonly type:
|
|
213
|
-
readonly assetType:
|
|
212
|
+
readonly type: 'asset';
|
|
213
|
+
readonly assetType: 'image';
|
|
214
214
|
readonly default: undefined;
|
|
215
|
-
readonly description:
|
|
215
|
+
readonly description: 'Source';
|
|
216
216
|
readonly keyframable: false;
|
|
217
217
|
};
|
|
218
218
|
readonly loop: {
|
|
219
|
-
readonly type:
|
|
219
|
+
readonly type: 'boolean';
|
|
220
220
|
readonly default: false;
|
|
221
|
-
readonly description:
|
|
221
|
+
readonly description: 'Loop';
|
|
222
222
|
readonly keyframable: false;
|
|
223
223
|
};
|
|
224
224
|
};
|
|
225
225
|
export declare const AnimatedImage: React.ComponentType<import("../Interactive.js").InteractiveBaseProps & import("../Interactive.js").InteractiveCropProps & import("../Interactive.js").InteractivePremountProps & {
|
|
226
226
|
src: string;
|
|
227
|
-
width?: number
|
|
228
|
-
height?: number
|
|
229
|
-
onError?: (
|
|
230
|
-
fit?: import("
|
|
231
|
-
playbackRate?: number
|
|
232
|
-
style?: React.CSSProperties
|
|
233
|
-
loopBehavior?: import("./props").RemotionAnimatedImageLoopBehavior
|
|
234
|
-
id?: string
|
|
235
|
-
className?: string
|
|
236
|
-
requestInit?: RequestInit
|
|
227
|
+
width?: number;
|
|
228
|
+
height?: number;
|
|
229
|
+
onError?: (error: Error) => void;
|
|
230
|
+
fit?: import("./props").AnimatedImageFillMode;
|
|
231
|
+
playbackRate?: number;
|
|
232
|
+
style?: React.CSSProperties;
|
|
233
|
+
loopBehavior?: import("./props").RemotionAnimatedImageLoopBehavior;
|
|
234
|
+
id?: string;
|
|
235
|
+
className?: string;
|
|
236
|
+
requestInit?: RequestInit;
|
|
237
237
|
} & React.AriaAttributes & Record<`data-${string}`, string | undefined> & {
|
|
238
|
-
readonly effects?: EffectsProp
|
|
239
|
-
readonly effectsOutputSize?: EffectsOutputSize
|
|
238
|
+
readonly effects?: EffectsProp;
|
|
239
|
+
readonly effectsOutputSize?: EffectsOutputSize;
|
|
240
240
|
} & {
|
|
241
241
|
readonly controls?: SequenceControls | undefined;
|
|
242
|
-
readonly ref?: React.Ref<HTMLCanvasElement
|
|
242
|
+
readonly ref?: React.Ref<HTMLCanvasElement>;
|
|
243
243
|
}>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.AnimatedImage = exports.animatedImageSchema = void 0;
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
4
|
const react_1 = require("react");
|
|
5
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
6
|
const react_2 = require("react");
|
|
7
7
|
const use_memoized_effects_js_1 = require("../effects/use-memoized-effects.js");
|
|
8
8
|
const enable_sequence_stack_traces_js_1 = require("../enable-sequence-stack-traces.js");
|
|
@@ -204,7 +204,7 @@ const AnimatedImageContent = (0, react_2.forwardRef)(({ src, width, height, onEr
|
|
|
204
204
|
effectsOutputSize === null || effectsOutputSize === void 0 ? void 0 : effectsOutputSize.width,
|
|
205
205
|
effectsOutputSize === null || effectsOutputSize === void 0 ? void 0 : effectsOutputSize.height,
|
|
206
206
|
]);
|
|
207
|
-
return (jsx_runtime_1.jsx(canvas_1.Canvas, { ref: ref, width: width, height: height, fit: fit, effects: memoizedEffects, effectsOutputSize: effectsOutputSize !== null && effectsOutputSize !== void 0 ? effectsOutputSize : null, ...props }));
|
|
207
|
+
return ((0, jsx_runtime_1.jsx)(canvas_1.Canvas, { ref: ref, width: width, height: height, fit: fit, effects: memoizedEffects, effectsOutputSize: effectsOutputSize !== null && effectsOutputSize !== void 0 ? effectsOutputSize : null, ...props }));
|
|
208
208
|
});
|
|
209
209
|
AnimatedImageContent.displayName = 'AnimatedImageContent';
|
|
210
210
|
const AnimatedImageInner = ({ src, width, height, onError, fit, playbackRate, loopBehavior, id, className, style, durationInFrames, from, premountFor, postmountFor, styleWhilePremounted, styleWhilePostmounted, cropLeft, cropRight, cropTop, cropBottom, requestInit, effects = [], effectsOutputSize, controls, ref, ...sequenceProps }) => {
|
|
@@ -249,7 +249,7 @@ const AnimatedImageInner = ({ src, width, height, onError, fit, playbackRate, lo
|
|
|
249
249
|
requestInit,
|
|
250
250
|
...canvasProps,
|
|
251
251
|
};
|
|
252
|
-
return (jsx_runtime_1.jsx(freeze_js_1.Freeze, { frame: freezeFrame, active: isPremountingOrPostmounting, _remotionInternalIsPremounting: premountingActive, children: jsx_runtime_1.jsx(Sequence_js_1.Sequence, { layout: "none", from: from !== null && from !== void 0 ? from : 0, playbackRate: playbackRate, durationInFrames: durationInFrames, name: "<AnimatedImage>", _remotionInternalDocumentationLink: "https://www.remotion.dev/docs/animatedimage", controls: controls, _remotionInternalEffects: memoizedEffectDefinitions, _remotionInternalPremountDisplay: effectivePremountFor || null, _remotionInternalPostmountDisplay: effectivePostmountFor || null, _remotionInternalIsPremounting: premountingActive, _remotionInternalIsPostmounting: postmountingActive, ...sequenceProps, children: jsx_runtime_1.jsx(sequence_activity_context_js_1.SequenceContent, { children: jsx_runtime_1.jsx(AnimatedImageContent, { ...animatedImageProps, ref: actualRef, effects: effects, effectsOutputSize: effectsOutputSize !== null && effectsOutputSize !== void 0 ? effectsOutputSize : null, controls: controls }) }) }) }));
|
|
252
|
+
return ((0, jsx_runtime_1.jsx)(freeze_js_1.Freeze, { frame: freezeFrame, active: isPremountingOrPostmounting, _remotionInternalIsPremounting: premountingActive, children: (0, jsx_runtime_1.jsx)(Sequence_js_1.Sequence, { layout: "none", from: from !== null && from !== void 0 ? from : 0, playbackRate: playbackRate, durationInFrames: durationInFrames, name: "<AnimatedImage>", _remotionInternalDocumentationLink: "https://www.remotion.dev/docs/animatedimage", controls: controls, _remotionInternalEffects: memoizedEffectDefinitions, _remotionInternalPremountDisplay: effectivePremountFor || null, _remotionInternalPostmountDisplay: effectivePostmountFor || null, _remotionInternalIsPremounting: premountingActive, _remotionInternalIsPostmounting: postmountingActive, ...sequenceProps, children: (0, jsx_runtime_1.jsx)(sequence_activity_context_js_1.SequenceContent, { children: (0, jsx_runtime_1.jsx)(AnimatedImageContent, { ...animatedImageProps, ref: actualRef, effects: effects, effectsOutputSize: effectsOutputSize !== null && effectsOutputSize !== void 0 ? effectsOutputSize : null, controls: controls }) }) }) }));
|
|
253
253
|
};
|
|
254
254
|
const AnimatedImageWithIntrinsicDuration = (props) => {
|
|
255
255
|
const { fps } = (0, use_video_config_js_1.useVideoConfig)();
|
|
@@ -308,16 +308,16 @@ const AnimatedImageWithIntrinsicDuration = (props) => {
|
|
|
308
308
|
if (duration === null || failedHandle !== null) {
|
|
309
309
|
return null;
|
|
310
310
|
}
|
|
311
|
-
return (jsx_runtime_1.jsx(AnimatedImageInner, { ...props, durationInFrames: duration.durationInFrames }));
|
|
311
|
+
return ((0, jsx_runtime_1.jsx)(AnimatedImageInner, { ...props, durationInFrames: duration.durationInFrames }));
|
|
312
312
|
};
|
|
313
313
|
const AnimatedImageComponent = (props) => {
|
|
314
314
|
var _a;
|
|
315
315
|
if (props.loop && props.durationInFrames === undefined) {
|
|
316
316
|
const resolvedSrc = (0, resolve_image_source_1.resolveAnimatedImageSource)(props.src);
|
|
317
317
|
const requestInitKey = (0, request_init_1.serializeRequestInit)(props.requestInit);
|
|
318
|
-
return (react_1.createElement(AnimatedImageWithIntrinsicDuration, { ...props, key: `${resolvedSrc}-${requestInitKey}-${(_a = props.trimBefore) !== null && _a !== void 0 ? _a : 0}` }));
|
|
318
|
+
return ((0, react_1.createElement)(AnimatedImageWithIntrinsicDuration, { ...props, key: `${resolvedSrc}-${requestInitKey}-${(_a = props.trimBefore) !== null && _a !== void 0 ? _a : 0}` }));
|
|
319
319
|
}
|
|
320
|
-
return jsx_runtime_1.jsx(AnimatedImageInner, { ...props });
|
|
320
|
+
return (0, jsx_runtime_1.jsx)(AnimatedImageInner, { ...props });
|
|
321
321
|
};
|
|
322
322
|
exports.AnimatedImage = (0, with_interactivity_schema_js_1.withInteractivitySchema)({
|
|
323
323
|
Component: AnimatedImageComponent,
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { EffectDefinitionAndStack, EffectsOutputSize } from '../effects/effect-types.js';
|
|
3
|
+
import type { AnimatedImageFillMode } from './props';
|
|
3
4
|
export type AnimatedImageCanvasRef = {
|
|
4
5
|
readonly draw: (imageData: VideoFrame) => Promise<boolean>;
|
|
5
6
|
readonly getCanvas: () => HTMLCanvasElement | null;
|
|
6
7
|
clear: () => void;
|
|
7
8
|
};
|
|
8
9
|
export declare const Canvas: React.ForwardRefExoticComponent<{
|
|
9
|
-
readonly width?: number
|
|
10
|
-
readonly height?: number
|
|
11
|
-
readonly fit:
|
|
12
|
-
readonly className?: string
|
|
13
|
-
readonly style?: React.CSSProperties
|
|
10
|
+
readonly width?: number;
|
|
11
|
+
readonly height?: number;
|
|
12
|
+
readonly fit: AnimatedImageFillMode;
|
|
13
|
+
readonly className?: string;
|
|
14
|
+
readonly style?: React.CSSProperties;
|
|
14
15
|
readonly effects: EffectDefinitionAndStack<unknown>[];
|
|
15
16
|
readonly effectsOutputSize: EffectsOutputSize | null;
|
|
16
17
|
} & React.AriaAttributes & Record<`data-${string}`, string | undefined> & React.RefAttributes<AnimatedImageCanvasRef>>;
|
|
@@ -101,6 +101,6 @@ const CanvasRefForwardingFunction = ({ width, height, fit, className, style, eff
|
|
|
101
101
|
},
|
|
102
102
|
};
|
|
103
103
|
}, [draw]);
|
|
104
|
-
return (jsx_runtime_1.jsx("canvas", { ref: canvasRef, className: className, style: style, ...props }));
|
|
104
|
+
return ((0, jsx_runtime_1.jsx)("canvas", { ref: canvasRef, className: className, style: style, ...props }));
|
|
105
105
|
};
|
|
106
106
|
exports.Canvas = react_1.default.forwardRef(CanvasRefForwardingFunction);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export declare const createImageDecoder: ({ resolvedSrc, signal, requestInit, contentType, }: {
|
|
2
2
|
resolvedSrc: string;
|
|
3
3
|
signal: AbortSignal;
|
|
4
|
-
requestInit?: RequestInit
|
|
4
|
+
requestInit?: RequestInit;
|
|
5
5
|
contentType: string | null;
|
|
6
6
|
}) => Promise<{
|
|
7
7
|
decoder: ImageDecoder;
|
|
@@ -12,7 +12,7 @@ export type RemotionImageDecoder = {
|
|
|
12
12
|
export declare const decodeImage: ({ resolvedSrc, signal, requestInit, currentTime, initialLoopBehavior, }: {
|
|
13
13
|
resolvedSrc: string;
|
|
14
14
|
signal: AbortSignal;
|
|
15
|
-
requestInit?: RequestInit
|
|
15
|
+
requestInit?: RequestInit;
|
|
16
16
|
currentTime: number;
|
|
17
17
|
initialLoopBehavior: RemotionAnimatedImageLoopBehavior;
|
|
18
18
|
}) => Promise<RemotionImageDecoder>;
|
|
@@ -45,6 +45,7 @@ const decodeImage = async ({ resolvedSrc, signal, requestInit, currentTime, init
|
|
|
45
45
|
};
|
|
46
46
|
};
|
|
47
47
|
const clearCache = (closeToTimeInSec) => {
|
|
48
|
+
var _a;
|
|
48
49
|
const itemsInCache = cache.filter((c) => c.frame);
|
|
49
50
|
const sortByClosestToCurrentTime = itemsInCache.sort((a, b) => {
|
|
50
51
|
const aDiff = Math.abs(a.timeInSeconds - closeToTimeInSec);
|
|
@@ -56,6 +57,7 @@ const decodeImage = async ({ resolvedSrc, signal, requestInit, currentTime, init
|
|
|
56
57
|
continue;
|
|
57
58
|
}
|
|
58
59
|
const item = sortByClosestToCurrentTime[i];
|
|
60
|
+
(_a = item.frame) === null || _a === void 0 ? void 0 : _a.close();
|
|
59
61
|
item.frame = null;
|
|
60
62
|
}
|
|
61
63
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare const getAnimatedImageDurationInSeconds: ({ resolvedSrc, signal, requestInit, contentType, }: {
|
|
2
2
|
resolvedSrc: string;
|
|
3
3
|
signal: AbortSignal;
|
|
4
|
-
requestInit?: RequestInit
|
|
4
|
+
requestInit?: RequestInit;
|
|
5
5
|
contentType: string | null;
|
|
6
6
|
}) => Promise<number>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.AnimatedImage = void 0;
|
|
4
|
-
|
|
4
|
+
var AnimatedImage_1 = require("./AnimatedImage");
|
|
5
5
|
Object.defineProperty(exports, "AnimatedImage", { enumerable: true, get: function () { return AnimatedImage_1.AnimatedImage; } });
|
|
@@ -45,6 +45,7 @@ const random_js_1 = require("../random.js");
|
|
|
45
45
|
const sequence_activity_context_js_1 = require("../sequence-activity-context.js");
|
|
46
46
|
const SequenceContext_js_1 = require("../SequenceContext.js");
|
|
47
47
|
const use_amplification_js_1 = require("../use-amplification.js");
|
|
48
|
+
const use_media_duration_js_1 = require("../use-media-duration.js");
|
|
48
49
|
const use_media_in_timeline_js_1 = require("../use-media-in-timeline.js");
|
|
49
50
|
const use_media_playback_js_1 = require("../use-media-playback.js");
|
|
50
51
|
const use_media_tag_js_1 = require("../use-media-tag.js");
|
|
@@ -154,40 +155,16 @@ const AudioForDevelopmentForwardRefFunction = (props, ref) => {
|
|
|
154
155
|
// But useInsertionEffect will fire before other effects, meaning the
|
|
155
156
|
// nodes might still be used. Using rAF to ensure it's after other effects.
|
|
156
157
|
effectToUse(() => {
|
|
157
|
-
return ()
|
|
158
|
-
requestAnimationFrame(() => {
|
|
159
|
-
cleanupOnMediaTagUnmount();
|
|
160
|
-
});
|
|
161
|
-
};
|
|
158
|
+
return use_media_duration_js_1.scheduleMediaSourceCleanup.bind(null, cleanupOnMediaTagUnmount);
|
|
162
159
|
}, [cleanupOnMediaTagUnmount]);
|
|
163
160
|
(0, react_2.useImperativeHandle)(ref, () => {
|
|
164
161
|
return audioRef.current;
|
|
165
162
|
}, [audioRef]);
|
|
166
|
-
|
|
167
|
-
currentOnDurationCallback.current = onDuration;
|
|
168
|
-
(0, react_2.useEffect)(() => {
|
|
169
|
-
var _a;
|
|
170
|
-
const { current } = audioRef;
|
|
171
|
-
if (!current) {
|
|
172
|
-
return;
|
|
173
|
-
}
|
|
174
|
-
if (current.duration) {
|
|
175
|
-
(_a = currentOnDurationCallback.current) === null || _a === void 0 ? void 0 : _a.call(currentOnDurationCallback, current.src, current.duration);
|
|
176
|
-
return;
|
|
177
|
-
}
|
|
178
|
-
const onLoadedMetadata = () => {
|
|
179
|
-
var _a;
|
|
180
|
-
(_a = currentOnDurationCallback.current) === null || _a === void 0 ? void 0 : _a.call(currentOnDurationCallback, current.src, current.duration);
|
|
181
|
-
};
|
|
182
|
-
current.addEventListener('loadedmetadata', onLoadedMetadata);
|
|
183
|
-
return () => {
|
|
184
|
-
current.removeEventListener('loadedmetadata', onLoadedMetadata);
|
|
185
|
-
};
|
|
186
|
-
}, [audioRef, src]);
|
|
163
|
+
(0, use_media_duration_js_1.useMediaDuration)(audioRef, onDuration, src, true);
|
|
187
164
|
if (initialShouldPreMountAudioElements) {
|
|
188
165
|
return null;
|
|
189
166
|
}
|
|
190
|
-
const audio = (jsx_runtime_1.jsx("audio", { ref: audioRef, preload: "metadata", crossOrigin: crossOriginValue, ...propsToPass }));
|
|
167
|
+
const audio = ((0, jsx_runtime_1.jsx)("audio", { ref: audioRef, preload: "metadata", crossOrigin: crossOriginValue, ...propsToPass }));
|
|
191
168
|
return audio;
|
|
192
169
|
};
|
|
193
170
|
const AudioForPreviewContent = (0, react_2.forwardRef)(AudioForDevelopmentForwardRefFunction);
|
|
@@ -234,6 +211,6 @@ const AudioForPreviewRefForwardingFunction = (props, ref) => {
|
|
|
234
211
|
outlineChildrenRef: null,
|
|
235
212
|
}
|
|
236
213
|
: null, [isStudio, registration, timelineId]);
|
|
237
|
-
return (jsx_runtime_1.jsx(committed_metadata_js_1.CommittedMetadataProvider, { value: null, _remotionCommitMetadata: metadata, children: jsx_runtime_1.jsx(sequence_activity_context_js_1.SequenceContent, { children: jsx_runtime_1.jsx(AudioForPreviewContent, { ...props, ref: ref, timelineId: timelineId, userPreferredVolume: userPreferredVolume, isMutedForPlayback: isMutedForPlayback }) }) }));
|
|
214
|
+
return ((0, jsx_runtime_1.jsx)(committed_metadata_js_1.CommittedMetadataProvider, { value: null, _remotionCommitMetadata: metadata, children: (0, jsx_runtime_1.jsx)(sequence_activity_context_js_1.SequenceContent, { children: (0, jsx_runtime_1.jsx)(AudioForPreviewContent, { ...props, ref: ref, timelineId: timelineId, userPreferredVolume: userPreferredVolume, isMutedForPlayback: isMutedForPlayback }) }) }));
|
|
238
215
|
};
|
|
239
216
|
exports.AudioForPreview = (0, react_2.forwardRef)(AudioForPreviewRefForwardingFunction);
|
|
@@ -1,24 +1,9 @@
|
|
|
1
1
|
import type { ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
volume?: import("../volume-prop.js").VolumeProp | undefined;
|
|
6
|
-
playbackRate?: number | undefined;
|
|
7
|
-
preservePitch?: boolean | undefined;
|
|
8
|
-
acceptableTimeShiftInSeconds?: number | undefined;
|
|
9
|
-
allowAmplificationDuringRender?: boolean | undefined;
|
|
10
|
-
_remotionInternalNeedsDurationCalculation?: boolean | undefined;
|
|
11
|
-
_remotionInternalNativeLoopPassed?: boolean | undefined;
|
|
12
|
-
toneFrequency?: number | undefined;
|
|
13
|
-
useWebAudioApi?: boolean | undefined;
|
|
14
|
-
pauseWhenBuffering?: boolean | undefined;
|
|
15
|
-
showInTimeline?: boolean | undefined;
|
|
16
|
-
delayRenderTimeoutInMilliseconds?: number | undefined;
|
|
17
|
-
delayRenderRetries?: number | undefined;
|
|
18
|
-
loopVolumeCurveBehavior?: import("./use-audio-frame.js").LoopVolumeCurveBehavior | undefined;
|
|
19
|
-
onError?: ((err: Error) => void) | undefined;
|
|
20
|
-
audioStreamIndex?: number | undefined;
|
|
21
|
-
} & {
|
|
3
|
+
import type { RemotionAudioProps } from './props.js';
|
|
4
|
+
type AudioForRenderingProps = RemotionAudioProps & {
|
|
22
5
|
readonly onDuration: (src: string, durationInSeconds: number) => void;
|
|
23
6
|
readonly onNativeError: React.ReactEventHandler<HTMLAudioElement>;
|
|
24
|
-
}
|
|
7
|
+
};
|
|
8
|
+
export declare const AudioForRendering: ForwardRefExoticComponent<AudioForRenderingProps & RefAttributes<HTMLAudioElement>>;
|
|
9
|
+
export {};
|
|
@@ -1,8 +1,41 @@
|
|
|
1
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 () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
2
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
36
|
exports.AudioForRendering = void 0;
|
|
4
37
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const react_1 = require("react");
|
|
38
|
+
const react_1 = __importStar(require("react"));
|
|
6
39
|
const absolute_src_js_1 = require("../absolute-src.js");
|
|
7
40
|
const random_js_1 = require("../random.js");
|
|
8
41
|
const RenderAssetManager_js_1 = require("../RenderAssetManager.js");
|
|
@@ -18,14 +51,13 @@ const use_media_audio_state_js_1 = require("./use-media-audio-state.js");
|
|
|
18
51
|
const AudioForRenderingRefForwardingFunction = (props, ref) => {
|
|
19
52
|
var _a, _b;
|
|
20
53
|
const audioRef = (0, react_1.useRef)(null);
|
|
21
|
-
const { volume: volumeProp, playbackRate, allowAmplificationDuringRender, onDuration, toneFrequency, _remotionInternalNeedsDurationCalculation, _remotionInternalNativeLoopPassed, acceptableTimeShiftInSeconds, name, onNativeError, delayRenderRetries, delayRenderTimeoutInMilliseconds, loopVolumeCurveBehavior, pauseWhenBuffering, audioStreamIndex, preservePitch
|
|
54
|
+
const { registerRenderAsset, unregisterRenderAsset, volume: volumeProp, playbackRate, allowAmplificationDuringRender, onDuration, toneFrequency, _remotionInternalNeedsDurationCalculation, _remotionInternalNativeLoopPassed, acceptableTimeShiftInSeconds, name, onNativeError, delayRenderRetries, delayRenderTimeoutInMilliseconds, loopVolumeCurveBehavior, pauseWhenBuffering, audioStreamIndex, preservePitch, ...nativeProps } = props;
|
|
22
55
|
const absoluteFrame = (0, timeline_position_state_js_1.useTimelinePosition)();
|
|
23
56
|
const volumePropFrame = (0, use_audio_frame_js_1.useFrameForVolumeProp)(loopVolumeCurveBehavior !== null && loopVolumeCurveBehavior !== void 0 ? loopVolumeCurveBehavior : 'repeat');
|
|
24
57
|
const frame = (0, use_current_frame_js_1.useCurrentFrame)();
|
|
25
58
|
const sequenceContext = (0, react_1.useContext)(SequenceContext_js_1.SequenceContext);
|
|
26
59
|
const sequencePlaybackRate = (_a = sequenceContext === null || sequenceContext === void 0 ? void 0 : sequenceContext.playbackRate) !== null && _a !== void 0 ? _a : 1;
|
|
27
60
|
const audioStartFrame = (0, react_1.useContext)(use_audio_frame_js_1.Html5MediaTrimContext);
|
|
28
|
-
const { registerRenderAsset, unregisterRenderAsset } = (0, react_1.useContext)(RenderAssetManager_js_1.RenderAssetManager);
|
|
29
61
|
const { delayRender, continueRender } = (0, use_delay_render_js_1.useDelayRender)();
|
|
30
62
|
// Generate a string that's as unique as possible for this asset
|
|
31
63
|
// but at the same time the same on all threads
|
|
@@ -73,6 +105,7 @@ const AudioForRenderingRefForwardingFunction = (props, ref) => {
|
|
|
73
105
|
toneFrequency: toneFrequency !== null && toneFrequency !== void 0 ? toneFrequency : 1,
|
|
74
106
|
audioStartFrame,
|
|
75
107
|
audioStreamIndex: audioStreamIndex !== null && audioStreamIndex !== void 0 ? audioStreamIndex : 0,
|
|
108
|
+
preservePitch: preservePitch !== null && preservePitch !== void 0 ? preservePitch : true,
|
|
76
109
|
});
|
|
77
110
|
return () => unregisterRenderAsset(id);
|
|
78
111
|
}, [
|
|
@@ -91,6 +124,7 @@ const AudioForRenderingRefForwardingFunction = (props, ref) => {
|
|
|
91
124
|
audioStartFrame,
|
|
92
125
|
sequencePlaybackRate,
|
|
93
126
|
audioStreamIndex,
|
|
127
|
+
preservePitch,
|
|
94
128
|
]);
|
|
95
129
|
const { src } = props;
|
|
96
130
|
// The <audio> tag is only rendered if the duration needs to be calculated for the `loop`
|
|
@@ -140,6 +174,11 @@ const AudioForRenderingRefForwardingFunction = (props, ref) => {
|
|
|
140
174
|
if (!needsToRenderAudioTag) {
|
|
141
175
|
return null;
|
|
142
176
|
}
|
|
143
|
-
return jsx_runtime_1.jsx("audio", { ref: audioRef, ...nativeProps, onError: onNativeError });
|
|
177
|
+
return (0, jsx_runtime_1.jsx)("audio", { ref: audioRef, ...nativeProps, onError: onNativeError });
|
|
144
178
|
};
|
|
145
|
-
|
|
179
|
+
// Asset collection updates the context, but the audio component only needs its callbacks.
|
|
180
|
+
const MemoAudioForRendering = react_1.default.memo((0, react_1.forwardRef)(AudioForRenderingRefForwardingFunction));
|
|
181
|
+
exports.AudioForRendering = (0, react_1.forwardRef)((props, ref) => {
|
|
182
|
+
const { registerRenderAsset, unregisterRenderAsset } = (0, react_1.useContext)(RenderAssetManager_js_1.RenderAssetManager);
|
|
183
|
+
return ((0, jsx_runtime_1.jsx)(MemoAudioForRendering, { ...props, ref: ref, registerRenderAsset: registerRenderAsset, unregisterRenderAsset: unregisterRenderAsset }));
|
|
184
|
+
});
|