remotion 4.0.470 → 4.0.472

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.
Files changed (149) hide show
  1. package/dist/cjs/AbsoluteFill.js +1 -1
  2. package/dist/cjs/CanUseRemotionHooks.js +1 -1
  3. package/dist/cjs/Composition.d.ts +1 -1
  4. package/dist/cjs/Composition.js +3 -3
  5. package/dist/cjs/CompositionErrorBoundary.js +2 -5
  6. package/dist/cjs/CompositionManager.d.ts +2 -0
  7. package/dist/cjs/CompositionManagerContext.d.ts +1 -1
  8. package/dist/cjs/CompositionManagerProvider.d.ts +2 -2
  9. package/dist/cjs/CompositionManagerProvider.js +3 -2
  10. package/dist/cjs/EditorProps.d.ts +2 -2
  11. package/dist/cjs/EditorProps.js +1 -1
  12. package/dist/cjs/Folder.d.ts +1 -0
  13. package/dist/cjs/Folder.js +7 -3
  14. package/dist/cjs/HtmlInCanvas.d.ts +15 -3
  15. package/dist/cjs/HtmlInCanvas.js +77 -16
  16. package/dist/cjs/IFrame.d.ts +2 -2
  17. package/dist/cjs/IFrame.js +1 -1
  18. package/dist/cjs/Img.d.ts +27 -13
  19. package/dist/cjs/Img.js +37 -21
  20. package/dist/cjs/RemotionRoot.js +1 -1
  21. package/dist/cjs/RenderAssetManager.js +1 -1
  22. package/dist/cjs/Sequence.js +19 -8
  23. package/dist/cjs/SequenceManager.d.ts +4 -3
  24. package/dist/cjs/SequenceManager.js +1 -1
  25. package/dist/cjs/Still.js +1 -1
  26. package/dist/cjs/TimelineContext.js +1 -1
  27. package/dist/cjs/animated-image/AnimatedImage.d.ts +4 -4
  28. package/dist/cjs/animated-image/AnimatedImage.js +24 -5
  29. package/dist/cjs/animated-image/canvas.js +1 -1
  30. package/dist/cjs/animated-image/decode-image.d.ts +2 -1
  31. package/dist/cjs/animated-image/decode-image.js +2 -2
  32. package/dist/cjs/animated-image/index.js +1 -1
  33. package/dist/cjs/animated-image/props.d.ts +1 -0
  34. package/dist/cjs/animated-image/request-init.d.ts +1 -0
  35. package/dist/cjs/animated-image/request-init.js +16 -0
  36. package/dist/cjs/audio/AudioForPreview.js +1 -1
  37. package/dist/cjs/audio/AudioForRendering.d.ts +20 -5
  38. package/dist/cjs/audio/AudioForRendering.js +1 -1
  39. package/dist/cjs/audio/html5-audio.d.ts +36 -36
  40. package/dist/cjs/audio/html5-audio.js +6 -6
  41. package/dist/cjs/audio/index.js +1 -1
  42. package/dist/cjs/audio/props.d.ts +1 -1
  43. package/dist/cjs/audio/shared-audio-tags.js +7 -4
  44. package/dist/cjs/audio/shared-element-source-node.d.ts +1 -1
  45. package/dist/cjs/audio/use-audio-context.d.ts +1 -2
  46. package/dist/cjs/audio/wait-until-actually-resumed.d.ts +1 -2
  47. package/dist/cjs/audio/wait-until-actually-resumed.js +2 -1
  48. package/dist/cjs/buffer-until-first-frame.d.ts +3 -4
  49. package/dist/cjs/buffering.js +1 -1
  50. package/dist/cjs/canvas-image/CanvasImage.d.ts +34 -18
  51. package/dist/cjs/canvas-image/CanvasImage.js +19 -6
  52. package/dist/cjs/canvas-image/index.js +1 -1
  53. package/dist/cjs/canvas-image/props.d.ts +4 -0
  54. package/dist/cjs/default-css.d.ts +1 -1
  55. package/dist/cjs/delay-render.d.ts +2 -3
  56. package/dist/cjs/delay-render.js +2 -1
  57. package/dist/cjs/effects/Solid.d.ts +2 -1
  58. package/dist/cjs/effects/Solid.js +39 -10
  59. package/dist/cjs/effects/canvas-pool.js +4 -2
  60. package/dist/cjs/effects/use-memoized-effects.d.ts +1 -1
  61. package/dist/cjs/effects/use-memoized-effects.js +13 -3
  62. package/dist/cjs/freeze.js +1 -1
  63. package/dist/cjs/get-effective-visual-mode-value.d.ts +15 -4
  64. package/dist/cjs/get-effective-visual-mode-value.js +35 -4
  65. package/dist/cjs/index.d.ts +6 -3
  66. package/dist/cjs/index.js +33 -29
  67. package/dist/cjs/internals.d.ts +183 -133
  68. package/dist/cjs/internals.js +11 -0
  69. package/dist/cjs/interpolate-colors.d.ts +1 -1
  70. package/dist/cjs/interpolate-keyframed-status.d.ts +1 -1
  71. package/dist/cjs/interpolate-keyframed-status.js +0 -6
  72. package/dist/cjs/interpolate.d.ts +2 -0
  73. package/dist/cjs/interpolate.js +218 -37
  74. package/dist/cjs/is-player.js +1 -1
  75. package/dist/cjs/loading-indicator.js +4 -2
  76. package/dist/cjs/log-level-context.d.ts +1 -1
  77. package/dist/cjs/log.d.ts +1 -1
  78. package/dist/cjs/loop/index.js +1 -1
  79. package/dist/cjs/media-tag-current-time-timestamp.d.ts +1 -1
  80. package/dist/cjs/media-tag-current-time-timestamp.js +4 -3
  81. package/dist/cjs/no-react.d.ts +39 -18
  82. package/dist/cjs/no-react.js +5 -2
  83. package/dist/cjs/normalize-number.d.ts +1 -0
  84. package/dist/cjs/normalize-number.js +7 -0
  85. package/dist/cjs/play-and-handle-not-allowed-error.d.ts +3 -4
  86. package/dist/cjs/playback-logging.d.ts +1 -2
  87. package/dist/cjs/prefetch-state.js +1 -1
  88. package/dist/cjs/prefetch.d.ts +6 -7
  89. package/dist/cjs/props-if-has-props.d.ts +1 -2
  90. package/dist/cjs/register-root.d.ts +2 -2
  91. package/dist/cjs/resolve-video-config.d.ts +2 -2
  92. package/dist/cjs/scale-value.d.ts +4 -0
  93. package/dist/cjs/scale-value.js +48 -0
  94. package/dist/cjs/seek.d.ts +2 -3
  95. package/dist/cjs/sequence-field-schema.d.ts +133 -40
  96. package/dist/cjs/sequence-field-schema.js +25 -4
  97. package/dist/cjs/series/flatten-children.d.ts +1 -3
  98. package/dist/cjs/series/index.d.ts +1 -2
  99. package/dist/cjs/series/index.js +8 -4
  100. package/dist/cjs/series/is-inside-series.js +2 -2
  101. package/dist/cjs/spring/index.d.ts +1 -1
  102. package/dist/cjs/spring/index.js +1 -1
  103. package/dist/cjs/spring/measure-spring.d.ts +1 -1
  104. package/dist/cjs/spring/spring-utils.d.ts +1 -1
  105. package/dist/cjs/timeline-position-state.d.ts +1 -1
  106. package/dist/cjs/use-amplification.d.ts +6 -4
  107. package/dist/cjs/use-current-scale.d.ts +2 -2
  108. package/dist/cjs/use-delay-render.d.ts +1 -2
  109. package/dist/cjs/use-lazy-component.d.ts +1 -1
  110. package/dist/cjs/use-media-buffering.d.ts +2 -3
  111. package/dist/cjs/use-media-enabled.d.ts +1 -1
  112. package/dist/cjs/use-media-enabled.js +1 -1
  113. package/dist/cjs/use-media-in-timeline.d.ts +2 -2
  114. package/dist/cjs/use-media-in-timeline.js +3 -1
  115. package/dist/cjs/use-media-playback.d.ts +2 -2
  116. package/dist/cjs/use-media-playback.js +4 -3
  117. package/dist/cjs/use-media-tag.d.ts +1 -1
  118. package/dist/cjs/use-pixel-density.d.ts +7 -0
  119. package/dist/cjs/use-pixel-density.js +66 -0
  120. package/dist/cjs/use-request-video-callback-time.d.ts +3 -3
  121. package/dist/cjs/use-schema.d.ts +26 -12
  122. package/dist/cjs/use-schema.js +66 -12
  123. package/dist/cjs/validate-media-props.d.ts +1 -1
  124. package/dist/cjs/version.d.ts +1 -1
  125. package/dist/cjs/version.js +1 -1
  126. package/dist/cjs/video/MediaPlaybackError.js +1 -0
  127. package/dist/cjs/video/OffthreadVideo.js +5 -5
  128. package/dist/cjs/video/OffthreadVideoForRendering.js +1 -1
  129. package/dist/cjs/video/VideoForPreview.d.ts +1 -1
  130. package/dist/cjs/video/VideoForPreview.js +1 -1
  131. package/dist/cjs/video/VideoForRendering.d.ts +3 -5
  132. package/dist/cjs/video/VideoForRendering.js +3 -1
  133. package/dist/cjs/video/duration-state.js +1 -1
  134. package/dist/cjs/video/emit-video-frame.d.ts +1 -1
  135. package/dist/cjs/video/emit-video-frame.js +10 -4
  136. package/dist/cjs/video/html5-video.d.ts +36 -34
  137. package/dist/cjs/video/html5-video.js +8 -9
  138. package/dist/cjs/video/index.js +2 -2
  139. package/dist/cjs/video/props.d.ts +5 -5
  140. package/dist/cjs/video/seek-until-right.d.ts +2 -3
  141. package/dist/cjs/warn-about-non-seekable-media.d.ts +1 -1
  142. package/dist/cjs/wrap-in-schema.d.ts +7 -3
  143. package/dist/cjs/wrap-in-schema.js +2 -1
  144. package/dist/cjs/wrap-remotion-context.d.ts +1 -1
  145. package/dist/cjs/wrap-remotion-context.js +1 -1
  146. package/dist/esm/index.mjs +1132 -589
  147. package/dist/esm/no-react.mjs +293 -35
  148. package/dist/esm/version.mjs +1 -1
  149. package/package.json +2 -2
package/dist/cjs/Img.js CHANGED
@@ -18,7 +18,7 @@ const wrap_in_schema_js_1 = require("./wrap-in-schema.js");
18
18
  function exponentialBackoff(errorCount) {
19
19
  return 1000 * 2 ** (errorCount - 1);
20
20
  }
21
- const ImgContent = ({ onError, maxRetries = 2, src, pauseWhenLoading, delayRenderRetries, delayRenderTimeoutInMilliseconds, onImageFrame, crossOrigin, decoding, ref, ...props }) => {
21
+ const ImgContent = ({ onError, maxRetries = 2, src, pauseWhenLoading, delayRenderRetries, delayRenderTimeoutInMilliseconds, onImageFrame, crossOrigin, decoding, ref, refForOutline, ...props }) => {
22
22
  const imageRef = (0, react_1.useRef)(null);
23
23
  const errors = (0, react_1.useRef)({});
24
24
  const { delayPlayback } = (0, use_buffer_state_js_1.useBufferState)();
@@ -27,9 +27,16 @@ const ImgContent = ({ onError, maxRetries = 2, src, pauseWhenLoading, delayRende
27
27
  if (!_propsValid) {
28
28
  throw new Error('typecheck error');
29
29
  }
30
- (0, react_1.useImperativeHandle)(ref, () => {
31
- return imageRef.current;
32
- }, []);
30
+ const imageCallbackRef = (0, react_1.useCallback)((img) => {
31
+ imageRef.current = img;
32
+ refForOutline.current = img;
33
+ if (typeof ref === 'function') {
34
+ ref(img);
35
+ }
36
+ else if (ref) {
37
+ ref.current = img;
38
+ }
39
+ }, [ref, refForOutline]);
33
40
  const actualSrc = (0, prefetch_js_1.usePreload)(src);
34
41
  const retryIn = (0, react_1.useCallback)((timeout) => {
35
42
  if (!imageRef.current) {
@@ -53,27 +60,28 @@ const ImgContent = ({ onError, maxRetries = 2, src, pauseWhenLoading, delayRende
53
60
  }, []);
54
61
  const { delayRender, continueRender, cancelRender } = (0, use_delay_render_js_1.useDelayRender)();
55
62
  const didGetError = (0, react_1.useCallback)((e) => {
56
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
63
+ var _a, _b, _c, _d, _e, _f, _g;
64
+ var _h, _j, _k, _l;
57
65
  if (!errors.current) {
58
66
  return;
59
67
  }
60
68
  errors.current[(_a = imageRef.current) === null || _a === void 0 ? void 0 : _a.src] =
61
- ((_c = errors.current[(_b = imageRef.current) === null || _b === void 0 ? void 0 : _b.src]) !== null && _c !== void 0 ? _c : 0) + 1;
69
+ ((_h = errors.current[(_b = imageRef.current) === null || _b === void 0 ? void 0 : _b.src]) !== null && _h !== void 0 ? _h : 0) + 1;
62
70
  if (onError &&
63
- ((_e = errors.current[(_d = imageRef.current) === null || _d === void 0 ? void 0 : _d.src]) !== null && _e !== void 0 ? _e : 0) > maxRetries) {
71
+ ((_j = errors.current[(_c = imageRef.current) === null || _c === void 0 ? void 0 : _c.src]) !== null && _j !== void 0 ? _j : 0) > maxRetries) {
64
72
  onError(e);
65
73
  return;
66
74
  }
67
- if (((_g = errors.current[(_f = imageRef.current) === null || _f === void 0 ? void 0 : _f.src]) !== null && _g !== void 0 ? _g : 0) <= maxRetries) {
68
- const backoff = exponentialBackoff((_j = errors.current[(_h = imageRef.current) === null || _h === void 0 ? void 0 : _h.src]) !== null && _j !== void 0 ? _j : 0);
75
+ if (((_k = errors.current[(_d = imageRef.current) === null || _d === void 0 ? void 0 : _d.src]) !== null && _k !== void 0 ? _k : 0) <= maxRetries) {
76
+ const backoff = exponentialBackoff((_l = errors.current[(_e = imageRef.current) === null || _e === void 0 ? void 0 : _e.src]) !== null && _l !== void 0 ? _l : 0);
69
77
  // eslint-disable-next-line no-console
70
- console.warn(`Could not load image with source ${(0, truncate_src_for_label_js_1.truncateSrcForLabel)((_k = imageRef.current) === null || _k === void 0 ? void 0 : _k.src)}, retrying again in ${backoff}ms`);
78
+ console.warn(`Could not load image with source ${(0, truncate_src_for_label_js_1.truncateSrcForLabel)((_f = imageRef.current) === null || _f === void 0 ? void 0 : _f.src)}, retrying again in ${backoff}ms`);
71
79
  retryIn(backoff);
72
80
  return;
73
81
  }
74
82
  try {
75
83
  cancelRender('Error loading image with src: ' +
76
- (0, truncate_src_for_label_js_1.truncateSrcForLabel)((_l = imageRef.current) === null || _l === void 0 ? void 0 : _l.src));
84
+ (0, truncate_src_for_label_js_1.truncateSrcForLabel)((_g = imageRef.current) === null || _g === void 0 ? void 0 : _g.src));
77
85
  }
78
86
  catch (_m) {
79
87
  // cancelRender() intentionally throws after storing the error in scope.
@@ -105,16 +113,17 @@ const ImgContent = ({ onError, maxRetries = 2, src, pauseWhenLoading, delayRende
105
113
  : () => undefined;
106
114
  let unmounted = false;
107
115
  const onComplete = () => {
108
- var _a, _b, _c, _d;
116
+ var _a, _b, _c;
117
+ var _d;
109
118
  // the decode() promise isn't cancelable -- it may still resolve after unmounting
110
119
  if (unmounted) {
111
120
  continueRender(newHandle);
112
121
  return;
113
122
  }
114
- if (((_b = errors.current[(_a = imageRef.current) === null || _a === void 0 ? void 0 : _a.src]) !== null && _b !== void 0 ? _b : 0) > 0) {
115
- delete errors.current[(_c = imageRef.current) === null || _c === void 0 ? void 0 : _c.src];
123
+ if (((_d = errors.current[(_a = imageRef.current) === null || _a === void 0 ? void 0 : _a.src]) !== null && _d !== void 0 ? _d : 0) > 0) {
124
+ delete errors.current[(_b = imageRef.current) === null || _b === void 0 ? void 0 : _b.src];
116
125
  // eslint-disable-next-line no-console
117
- console.info(`Retry successful - ${(0, truncate_src_for_label_js_1.truncateSrcForLabel)((_d = imageRef.current) === null || _d === void 0 ? void 0 : _d.src)} is now loaded`);
126
+ console.info(`Retry successful - ${(0, truncate_src_for_label_js_1.truncateSrcForLabel)((_c = imageRef.current) === null || _c === void 0 ? void 0 : _c.src)} is now loaded`);
118
127
  }
119
128
  if (current) {
120
129
  onImageFrame === null || onImageFrame === void 0 ? void 0 : onImageFrame(current);
@@ -172,16 +181,18 @@ const ImgContent = ({ onError, maxRetries = 2, src, pauseWhenLoading, delayRende
172
181
  isClientSideRendering,
173
182
  });
174
183
  // src gets set once we've loaded and decoded the image.
175
- return ((0, jsx_runtime_1.jsx)("img", { ...props, ref: imageRef, crossOrigin: crossOriginValue, onError: didGetError, decoding: isRendering ? 'sync' : decoding }));
184
+ return (jsx_runtime_1.jsx("img", { ...props, ref: imageCallbackRef, crossOrigin: crossOriginValue, onError: didGetError, decoding: isRendering ? 'sync' : decoding }));
176
185
  };
177
- const NativeImgInner = ({ hidden, name, stack, showInTimeline, src, from, durationInFrames, _experimentalControls: controls, ...props }) => {
186
+ const NativeImgInner = ({ hidden, name, stack, showInTimeline, src, from, durationInFrames, _experimentalControls: controls, _remotionInternalRefForOutline: refForOutline, ...props }) => {
178
187
  if (!src) {
179
188
  throw new Error('No "src" prop was passed to <Img>.');
180
189
  }
181
- return ((0, jsx_runtime_1.jsx)(Sequence_js_1.Sequence, { layout: "none", from: from !== null && from !== void 0 ? from : 0, durationInFrames: durationInFrames !== null && durationInFrames !== void 0 ? durationInFrames : Infinity, _remotionInternalStack: stack, _remotionInternalDocumentationLink: name === undefined ? 'https://www.remotion.dev/docs/img' : undefined, _remotionInternalIsMedia: { type: 'image', src }, name: name !== null && name !== void 0 ? name : '<Img>', _experimentalControls: controls, showInTimeline: showInTimeline !== null && showInTimeline !== void 0 ? showInTimeline : true, hidden: hidden, children: (0, jsx_runtime_1.jsx)(ImgContent, { src: src, ...props }) }));
190
+ return (jsx_runtime_1.jsx(Sequence_js_1.Sequence, { layout: "none", from: from !== null && from !== void 0 ? from : 0, durationInFrames: durationInFrames !== null && durationInFrames !== void 0 ? durationInFrames : Infinity, _remotionInternalStack: stack, _remotionInternalDocumentationLink: name === undefined ? 'https://www.remotion.dev/docs/img' : undefined, _remotionInternalIsMedia: { type: 'image', src }, name: name !== null && name !== void 0 ? name : '<Img>', _experimentalControls: controls, showInTimeline: showInTimeline !== null && showInTimeline !== void 0 ? showInTimeline : true, hidden: hidden, _remotionInternalRefForOutline: refForOutline, children: jsx_runtime_1.jsx(ImgContent, { src: src, refForOutline: refForOutline, ...props }) }));
182
191
  };
183
192
  const CanvasImageWithPrivateProps = index_js_1.CanvasImage;
184
193
  exports.imgSchema = {
194
+ durationInFrames: sequence_field_schema_js_1.durationInFramesField,
195
+ from: sequence_field_schema_js_1.fromField,
185
196
  ...sequence_field_schema_js_1.sequenceVisualStyleSchema,
186
197
  hidden: sequence_field_schema_js_1.hiddenField,
187
198
  };
@@ -226,8 +237,9 @@ const getFitFromObjectFit = (style) => {
226
237
  };
227
238
  const ImgInner = ({ effects = [], ref, hidden, name, stack, showInTimeline, src, from, durationInFrames, _experimentalControls: controls, width, height, className, style, id, pauseWhenLoading, maxRetries, delayRenderRetries, delayRenderTimeoutInMilliseconds, ...props }) => {
228
239
  var _a;
240
+ const refForOutline = (0, react_1.useRef)(null);
229
241
  if (effects.length === 0) {
230
- return ((0, jsx_runtime_1.jsx)(NativeImgInner, { ...props, ref: ref, hidden: hidden, name: name, stack: stack, showInTimeline: showInTimeline, src: src, from: from, durationInFrames: durationInFrames, _experimentalControls: controls, width: width, height: height, className: className, style: style, id: id, pauseWhenLoading: pauseWhenLoading, maxRetries: maxRetries, delayRenderRetries: delayRenderRetries, delayRenderTimeoutInMilliseconds: delayRenderTimeoutInMilliseconds }));
242
+ return (jsx_runtime_1.jsx(NativeImgInner, { ...props, ref: ref, hidden: hidden, name: name, stack: stack, showInTimeline: showInTimeline, src: src, from: from, durationInFrames: durationInFrames, _experimentalControls: controls, width: width, height: height, className: className, style: style, id: id, pauseWhenLoading: pauseWhenLoading, maxRetries: maxRetries, delayRenderRetries: delayRenderRetries, delayRenderTimeoutInMilliseconds: delayRenderTimeoutInMilliseconds, _remotionInternalRefForOutline: refForOutline }));
231
243
  }
232
244
  if (!src) {
233
245
  throw new Error('No "src" prop was passed to <Img>.');
@@ -242,11 +254,15 @@ const ImgInner = ({ effects = [], ref, hidden, name, stack, showInTimeline, src,
242
254
  const canvasHeight = typeof height === 'number' ? height : undefined;
243
255
  const canvasProps = props;
244
256
  const canvasFit = (_a = getFitFromObjectFit(style)) !== null && _a !== void 0 ? _a : 'fill';
245
- return ((0, jsx_runtime_1.jsx)(CanvasImageWithPrivateProps, { src: src, width: canvasWidth, height: canvasHeight, fit: canvasFit, effects: effects, className: className, style: style, id: id, pauseWhenLoading: pauseWhenLoading, maxRetries: maxRetries, delayRenderRetries: delayRenderRetries, delayRenderTimeoutInMilliseconds: delayRenderTimeoutInMilliseconds, from: from, durationInFrames: durationInFrames, hidden: hidden, name: name !== null && name !== void 0 ? name : '<Img>', showInTimeline: showInTimeline, stack: stack, _remotionInternalDocumentationLink: name === undefined ? 'https://www.remotion.dev/docs/img' : undefined, _experimentalControls: controls, ...canvasProps }));
257
+ return (jsx_runtime_1.jsx(CanvasImageWithPrivateProps, { src: src, width: canvasWidth, height: canvasHeight, fit: canvasFit, effects: effects, className: className, style: style, id: id, pauseWhenLoading: pauseWhenLoading, maxRetries: maxRetries, delayRenderRetries: delayRenderRetries, delayRenderTimeoutInMilliseconds: delayRenderTimeoutInMilliseconds, from: from, durationInFrames: durationInFrames, hidden: hidden, name: name !== null && name !== void 0 ? name : '<Img>', showInTimeline: showInTimeline, stack: stack, _remotionInternalDocumentationLink: name === undefined ? 'https://www.remotion.dev/docs/img' : undefined, _experimentalControls: controls, _remotionInternalRefForOutline: refForOutline, ...canvasProps }));
246
258
  };
247
259
  /*
248
260
  * @description Works just like a regular HTML img tag. When you use the <Img> tag, Remotion will ensure that the image is loaded before rendering the frame.
249
261
  * @see [Documentation](https://remotion.dev/docs/img)
250
262
  */
251
- exports.Img = (0, wrap_in_schema_js_1.wrapInSchema)(ImgInner, exports.imgSchema);
263
+ exports.Img = (0, wrap_in_schema_js_1.wrapInSchema)({
264
+ Component: ImgInner,
265
+ schema: exports.imgSchema,
266
+ supportsEffects: true,
267
+ });
252
268
  (0, enable_sequence_stack_traces_js_1.addSequenceStackTraces)(exports.Img);
@@ -23,6 +23,6 @@ const RemotionRootContexts = ({ children, numberOfAudioTags, logLevel, audioLate
23
23
  const logging = (0, react_1.useMemo)(() => {
24
24
  return { logLevel, mountTime: Date.now() };
25
25
  }, [logLevel]);
26
- return ((0, jsx_runtime_1.jsx)(log_level_context_js_1.LogLevelContext.Provider, { value: logging, children: (0, jsx_runtime_1.jsx)(nonce_js_1.NonceContext.Provider, { value: nonceContext, children: (0, jsx_runtime_1.jsx)(TimelineContext_js_1.TimelineContextProvider, { frameState: frameState, children: (0, jsx_runtime_1.jsx)(use_media_enabled_js_1.MediaEnabledProvider, { videoEnabled: videoEnabled, audioEnabled: audioEnabled, children: (0, jsx_runtime_1.jsx)(EditorProps_js_1.EditorPropsProvider, { children: (0, jsx_runtime_1.jsx)(prefetch_state_js_1.PrefetchProvider, { children: (0, jsx_runtime_1.jsx)(SequenceManager_js_1.SequenceManagerProvider, { children: (0, jsx_runtime_1.jsx)(duration_state_js_1.DurationsContextProvider, { children: (0, jsx_runtime_1.jsx)(buffering_js_1.BufferingProvider, { children: (0, jsx_runtime_1.jsx)(shared_audio_tags_js_1.SharedAudioContextProvider, { audioLatencyHint: audioLatencyHint, audioEnabled: audioEnabled, previewSampleRate: previewSampleRate, children: (0, jsx_runtime_1.jsx)(shared_audio_tags_js_1.SharedAudioTagsContextProvider, { numberOfAudioTags: numberOfAudioTags, children: children }) }) }) }) }) }) }) }) }) }) }));
26
+ return (jsx_runtime_1.jsx(log_level_context_js_1.LogLevelContext.Provider, { value: logging, children: jsx_runtime_1.jsx(nonce_js_1.NonceContext.Provider, { value: nonceContext, children: jsx_runtime_1.jsx(TimelineContext_js_1.TimelineContextProvider, { frameState: frameState, children: jsx_runtime_1.jsx(use_media_enabled_js_1.MediaEnabledProvider, { videoEnabled: videoEnabled, audioEnabled: audioEnabled, children: jsx_runtime_1.jsx(EditorProps_js_1.EditorPropsProvider, { children: jsx_runtime_1.jsx(prefetch_state_js_1.PrefetchProvider, { children: jsx_runtime_1.jsx(SequenceManager_js_1.SequenceManagerProvider, { children: jsx_runtime_1.jsx(duration_state_js_1.DurationsContextProvider, { children: jsx_runtime_1.jsx(buffering_js_1.BufferingProvider, { children: jsx_runtime_1.jsx(shared_audio_tags_js_1.SharedAudioContextProvider, { audioLatencyHint: audioLatencyHint, audioEnabled: audioEnabled, previewSampleRate: previewSampleRate, children: jsx_runtime_1.jsx(shared_audio_tags_js_1.SharedAudioTagsContextProvider, { numberOfAudioTags: numberOfAudioTags, children: children }) }) }) }) }) }) }) }) }) }) }));
27
27
  };
28
28
  exports.RemotionRootContexts = RemotionRootContexts;
@@ -52,6 +52,6 @@ const RenderAssetManagerProvider = ({ children, collectAssets }) => {
52
52
  renderAssets,
53
53
  };
54
54
  }, [renderAssets, registerRenderAsset, unregisterRenderAsset]);
55
- return ((0, jsx_runtime_1.jsx)(exports.RenderAssetManager.Provider, { value: contextValue, children: children }));
55
+ return (jsx_runtime_1.jsx(exports.RenderAssetManager.Provider, { value: contextValue, children: children }));
56
56
  };
57
57
  exports.RenderAssetManagerProvider = RenderAssetManagerProvider;
@@ -11,12 +11,14 @@ const PremountContext_js_1 = require("./PremountContext.js");
11
11
  const sequence_field_schema_js_1 = require("./sequence-field-schema.js");
12
12
  const SequenceContext_js_1 = require("./SequenceContext.js");
13
13
  const SequenceManager_js_1 = require("./SequenceManager.js");
14
+ const is_inside_series_js_1 = require("./series/is-inside-series.js");
14
15
  const timeline_position_state_js_1 = require("./timeline-position-state.js");
15
16
  const use_current_frame_1 = require("./use-current-frame");
16
17
  const use_remotion_environment_js_1 = require("./use-remotion-environment.js");
17
18
  const use_video_config_js_1 = require("./use-video-config.js");
18
19
  const v5_flag_js_1 = require("./v5-flag.js");
19
20
  const wrap_in_schema_js_1 = require("./wrap-in-schema.js");
21
+ const EMPTY_EFFECTS = [];
20
22
  const RegularSequenceRefForwardingFunction = ({ from = 0, durationInFrames = Infinity, children, name, height, width, showInTimeline = true, hidden = false, _experimentalControls: controls, _remotionInternalEffects, _remotionInternalLoopDisplay: loopDisplay, _remotionInternalStack: stack, _remotionInternalDocumentationLink: documentationLink, _remotionInternalPremountDisplay: premountDisplay, _remotionInternalPostmountDisplay: postmountDisplay, _remotionInternalIsMedia: isMedia, _remotionInternalRefForOutline: refForOutline, ...other }, ref) => {
21
23
  var _a;
22
24
  const { layout = 'absolute-fill' } = other;
@@ -122,6 +124,7 @@ const RegularSequenceRefForwardingFunction = ({ from = 0, durationInFrames = Inf
122
124
  }, [name]);
123
125
  const resolvedDocumentationLink = documentationLink !== null && documentationLink !== void 0 ? documentationLink : (name === undefined ? 'https://www.remotion.dev/docs/sequence' : null);
124
126
  const env = (0, use_remotion_environment_js_1.useRemotionEnvironment)();
127
+ const isInsideSeries = (0, react_1.useContext)(is_inside_series_js_1.IsInsideSeriesContext);
125
128
  const inheritedStack = (_a = other === null || other === void 0 ? void 0 : other.stack) !== null && _a !== void 0 ? _a : null;
126
129
  // Our assumption: Stack doesnt' change. After we symbolicate we assign it a nodePath
127
130
  // and if it changes, it would lead to-remounting of the sequence.
@@ -137,7 +140,7 @@ const RegularSequenceRefForwardingFunction = ({ from = 0, durationInFrames = Inf
137
140
  registerSequence({
138
141
  type: 'image',
139
142
  controls: controls !== null && controls !== void 0 ? controls : null,
140
- effects: _remotionInternalEffects !== null && _remotionInternalEffects !== void 0 ? _remotionInternalEffects : [],
143
+ effects: _remotionInternalEffects !== null && _remotionInternalEffects !== void 0 ? _remotionInternalEffects : EMPTY_EFFECTS,
141
144
  displayName: timelineClipName,
142
145
  documentationLink: resolvedDocumentationLink,
143
146
  duration: actualDurationInFrames,
@@ -153,13 +156,14 @@ const RegularSequenceRefForwardingFunction = ({ from = 0, durationInFrames = Inf
153
156
  src: isMedia.src,
154
157
  getStack: () => stackRef.current,
155
158
  refForOutline: refForOutline !== null && refForOutline !== void 0 ? refForOutline : null,
159
+ isInsideSeries,
156
160
  });
157
161
  }
158
162
  else {
159
163
  registerSequence({
160
164
  type: isMedia.type,
161
165
  controls: controls !== null && controls !== void 0 ? controls : null,
162
- effects: _remotionInternalEffects !== null && _remotionInternalEffects !== void 0 ? _remotionInternalEffects : [],
166
+ effects: _remotionInternalEffects !== null && _remotionInternalEffects !== void 0 ? _remotionInternalEffects : EMPTY_EFFECTS,
163
167
  displayName: timelineClipName,
164
168
  documentationLink: resolvedDocumentationLink,
165
169
  doesVolumeChange: isMedia.data.doesVolumeChange,
@@ -179,6 +183,7 @@ const RegularSequenceRefForwardingFunction = ({ from = 0, durationInFrames = Inf
179
183
  startMediaFrom: isMedia.data.startMediaFrom,
180
184
  volume: isMedia.data.volumes,
181
185
  refForOutline: refForOutline !== null && refForOutline !== void 0 ? refForOutline : null,
186
+ isInsideSeries,
182
187
  });
183
188
  }
184
189
  return () => {
@@ -201,8 +206,9 @@ const RegularSequenceRefForwardingFunction = ({ from = 0, durationInFrames = Inf
201
206
  premountDisplay: premountDisplay !== null && premountDisplay !== void 0 ? premountDisplay : null,
202
207
  postmountDisplay: postmountDisplay !== null && postmountDisplay !== void 0 ? postmountDisplay : null,
203
208
  controls: controls !== null && controls !== void 0 ? controls : null,
204
- effects: _remotionInternalEffects !== null && _remotionInternalEffects !== void 0 ? _remotionInternalEffects : [],
209
+ effects: _remotionInternalEffects !== null && _remotionInternalEffects !== void 0 ? _remotionInternalEffects : EMPTY_EFFECTS,
205
210
  refForOutline: refForOutline !== null && refForOutline !== void 0 ? refForOutline : null,
211
+ isInsideSeries,
206
212
  });
207
213
  return () => {
208
214
  unregisterSequence(id);
@@ -229,6 +235,7 @@ const RegularSequenceRefForwardingFunction = ({ from = 0, durationInFrames = Inf
229
235
  isMedia,
230
236
  resolvedDocumentationLink,
231
237
  refForOutline,
238
+ isInsideSeries,
232
239
  ]);
233
240
  // Ceil to support floats
234
241
  // https://github.com/remotion-dev/remotion/issues/2958
@@ -253,7 +260,7 @@ const RegularSequenceRefForwardingFunction = ({ from = 0, durationInFrames = Inf
253
260
  if (hidden) {
254
261
  return null;
255
262
  }
256
- return ((0, jsx_runtime_1.jsx)(SequenceContext_js_1.SequenceContext.Provider, { value: contextValue, children: content === null ? null : other.layout === 'none' ? (content) : ((0, jsx_runtime_1.jsx)(AbsoluteFill_js_1.AbsoluteFill, { ref: ref, style: defaultStyle, className: other.className, children: content })) }));
263
+ return (jsx_runtime_1.jsx(SequenceContext_js_1.SequenceContext.Provider, { value: contextValue, children: content === null ? null : other.layout === 'none' ? (content) : (jsx_runtime_1.jsx(AbsoluteFill_js_1.AbsoluteFill, { ref: ref, style: defaultStyle, className: other.className, children: content })) }));
257
264
  };
258
265
  const RegularSequence = (0, react_1.forwardRef)(RegularSequenceRefForwardingFunction);
259
266
  const PremountedPostmountedSequenceRefForwardingFunction = (props, ref) => {
@@ -291,7 +298,7 @@ const PremountedPostmountedSequenceRefForwardingFunction = (props, ref) => {
291
298
  styleWhilePremounted,
292
299
  styleWhilePostmounted,
293
300
  ]);
294
- return ((0, jsx_runtime_1.jsx)(freeze_js_1.Freeze, { frame: freezeFrame, active: isFreezingActive, children: (0, jsx_runtime_1.jsx)(SequenceInner, { ref: ref, from: from, durationInFrames: durationInFrames, style: style, _remotionInternalPremountDisplay: premountFor, _remotionInternalPostmountDisplay: postmountFor, _remotionInternalIsPremounting: premountingActive, _remotionInternalIsPostmounting: postmountingActive, ...otherProps }) }));
301
+ return (jsx_runtime_1.jsx(freeze_js_1.Freeze, { frame: freezeFrame, active: isFreezingActive, children: jsx_runtime_1.jsx(SequenceInner, { ref: ref, from: from, durationInFrames: durationInFrames, style: style, _remotionInternalPremountDisplay: premountFor, _remotionInternalPostmountDisplay: postmountFor, _remotionInternalIsPremounting: premountingActive, _remotionInternalIsPostmounting: postmountingActive, ...otherProps }) }));
295
302
  };
296
303
  const PremountedPostmountedSequence = (0, react_1.forwardRef)(PremountedPostmountedSequenceRefForwardingFunction);
297
304
  const SequenceRefForwardingFunction = (props, ref) => {
@@ -303,14 +310,18 @@ const SequenceRefForwardingFunction = (props, ref) => {
303
310
  ? ((_a = props.premountFor) !== null && _a !== void 0 ? _a : fps)
304
311
  : props.premountFor;
305
312
  if (effectivePremountFor || props.postmountFor) {
306
- return ((0, jsx_runtime_1.jsx)(PremountedPostmountedSequence, { ref: ref, ...props, premountFor: effectivePremountFor }));
313
+ return (jsx_runtime_1.jsx(PremountedPostmountedSequence, { ref: ref, ...props, premountFor: effectivePremountFor }));
307
314
  }
308
315
  }
309
- return (0, jsx_runtime_1.jsx)(RegularSequence, { ...props, ref: ref });
316
+ return jsx_runtime_1.jsx(RegularSequence, { ...props, ref: ref });
310
317
  };
311
318
  const SequenceInner = (0, react_1.forwardRef)(SequenceRefForwardingFunction);
312
319
  /*
313
320
  * @description A component that time-shifts its children and wraps them in an absolutely positioned <div>.
314
321
  * @see [Documentation](https://www.remotion.dev/docs/sequence)
315
322
  */
316
- exports.Sequence = (0, wrap_in_schema_js_1.wrapInSchema)(SequenceInner, sequence_field_schema_js_1.sequenceSchema);
323
+ exports.Sequence = (0, wrap_in_schema_js_1.wrapInSchema)({
324
+ Component: SequenceInner,
325
+ schema: sequence_field_schema_js_1.sequenceSchema,
326
+ supportsEffects: false,
327
+ });
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import type { TSequence } from './CompositionManager.js';
3
- import type { CanUpdateSequencePropStatus, CodeValues, GetDragOverrides, GetEffectDragOverrides } from './use-schema.js';
3
+ import type { CanUpdateSequencePropStatus, CodeValues, DragOverrideValue, GetDragOverrides, GetEffectDragOverrides } from './use-schema.js';
4
4
  export type SequenceManagerContext = {
5
5
  registerSequence: (seq: TSequence) => void;
6
6
  unregisterSequence: (id: string) => void;
@@ -16,15 +16,16 @@ export type VisualModeDragOverrides = {
16
16
  getEffectDragOverrides: GetEffectDragOverrides;
17
17
  };
18
18
  export type VisualModeSetters = {
19
- setDragOverrides: (nodePath: SequencePropsSubscriptionKey, key: string, value: unknown) => void;
19
+ setDragOverrides: (nodePath: SequencePropsSubscriptionKey, key: string, value: DragOverrideValue) => void;
20
20
  clearDragOverrides: (nodePath: SequencePropsSubscriptionKey) => void;
21
- setEffectDragOverrides: (nodePath: SequencePropsSubscriptionKey, effectIndex: number, key: string, value: unknown) => void;
21
+ setEffectDragOverrides: (nodePath: SequencePropsSubscriptionKey, effectIndex: number, key: string, value: DragOverrideValue) => void;
22
22
  clearEffectDragOverrides: (nodePath: SequencePropsSubscriptionKey, effectIndex: number) => void;
23
23
  setCodeValues: (nodePath: SequencePropsSubscriptionKey, values: (prev: CanUpdateSequencePropsResponse) => CanUpdateSequencePropsResponse) => void;
24
24
  };
25
25
  export type CanUpdateEffectPropsResponseTrue = {
26
26
  canUpdate: true;
27
27
  callee: string;
28
+ importPath: string | null;
28
29
  effectIndex: number;
29
30
  props: Record<string, CanUpdateSequencePropStatus>;
30
31
  };
@@ -188,6 +188,6 @@ const SequenceManagerProvider = ({ children }) => {
188
188
  clearEffectDragOverrides,
189
189
  setCodeValues,
190
190
  ]);
191
- return ((0, jsx_runtime_1.jsx)(exports.SequenceManager.Provider, { value: sequenceContext, children: (0, jsx_runtime_1.jsx)(exports.VisualModeCodeValuesContext.Provider, { value: codeValuesContext, children: (0, jsx_runtime_1.jsx)(exports.VisualModeDragOverridesContext.Provider, { value: dragOverridesContext, children: (0, jsx_runtime_1.jsx)(exports.VisualModeSettersContext.Provider, { value: settersContext, children: children }) }) }) }));
191
+ return (jsx_runtime_1.jsx(exports.SequenceManager.Provider, { value: sequenceContext, children: jsx_runtime_1.jsx(exports.VisualModeCodeValuesContext.Provider, { value: codeValuesContext, children: jsx_runtime_1.jsx(exports.VisualModeDragOverridesContext.Provider, { value: dragOverridesContext, children: jsx_runtime_1.jsx(exports.VisualModeSettersContext.Provider, { value: settersContext, children: children }) }) }) }));
192
192
  };
193
193
  exports.SequenceManagerProvider = SequenceManagerProvider;
package/dist/cjs/Still.js CHANGED
@@ -17,6 +17,6 @@ const Still = (props) => {
17
17
  fps: 1,
18
18
  };
19
19
  // @ts-expect-error TypeScript does not understand it, but should still fail on type mismatch
20
- return react_1.default.createElement((Composition_js_1.Composition), newProps);
20
+ return react_1.default.createElement(Composition_js_1.Composition, newProps);
21
21
  };
22
22
  exports.Still = Still;
@@ -78,6 +78,6 @@ const TimelineContextProvider = ({ children, frameState }) => {
78
78
  setPlaying,
79
79
  };
80
80
  }, []);
81
- return ((0, jsx_runtime_1.jsx)(exports.AbsoluteTimeContext.Provider, { value: timelineContextValue, children: (0, jsx_runtime_1.jsx)(exports.PlaybackRateContext.Provider, { value: playbackRateContextValue, children: (0, jsx_runtime_1.jsx)(exports.TimelineContext.Provider, { value: timelineContextValue, children: (0, jsx_runtime_1.jsx)(exports.SetTimelineContext.Provider, { value: setTimelineContextValue, children: children }) }) }) }));
81
+ return (jsx_runtime_1.jsx(exports.AbsoluteTimeContext.Provider, { value: timelineContextValue, children: jsx_runtime_1.jsx(exports.PlaybackRateContext.Provider, { value: playbackRateContextValue, children: jsx_runtime_1.jsx(exports.TimelineContext.Provider, { value: timelineContextValue, children: jsx_runtime_1.jsx(exports.SetTimelineContext.Provider, { value: setTimelineContextValue, children: children }) }) }) }));
82
82
  };
83
83
  exports.TimelineContextProvider = TimelineContextProvider;
@@ -2,10 +2,10 @@ import type React from 'react';
2
2
  import type { SequenceControls } from '../CompositionManager.js';
3
3
  import type { EffectsProp } from '../effects/effect-types.js';
4
4
  import type { RemotionAnimatedImageProps } from './props';
5
- export declare const AnimatedImage: React.ComponentType<Omit<import("../Sequence.js").SequenceProps, "children" | "layout" | "durationInFrames" | "_remotionInternalEffects"> & RemotionAnimatedImageProps & {
6
- readonly durationInFrames?: number;
7
- readonly effects?: EffectsProp;
5
+ export declare const AnimatedImage: React.ComponentType<Omit<import("../Sequence.js").SequenceProps, "_remotionInternalEffects" | "children" | "durationInFrames" | "layout"> & RemotionAnimatedImageProps & {
6
+ readonly durationInFrames?: number | undefined;
7
+ readonly effects?: EffectsProp | undefined;
8
8
  } & {
9
9
  readonly _experimentalControls?: SequenceControls | undefined;
10
- readonly ref?: React.Ref<HTMLCanvasElement>;
10
+ readonly ref?: React.Ref<HTMLCanvasElement> | undefined;
11
11
  }>;
@@ -14,8 +14,11 @@ const use_video_config_js_1 = require("../use-video-config.js");
14
14
  const wrap_in_schema_js_1 = require("../wrap-in-schema.js");
15
15
  const canvas_1 = require("./canvas");
16
16
  const decode_image_js_1 = require("./decode-image.js");
17
+ const request_init_1 = require("./request-init");
17
18
  const resolve_image_source_1 = require("./resolve-image-source");
18
19
  const animatedImageSchema = {
20
+ durationInFrames: sequence_field_schema_js_1.durationInFramesField,
21
+ from: sequence_field_schema_js_1.fromField,
19
22
  playbackRate: {
20
23
  type: 'number',
21
24
  min: 0,
@@ -23,11 +26,13 @@ const animatedImageSchema = {
23
26
  step: 0.1,
24
27
  default: 1,
25
28
  description: 'Playback Rate',
29
+ hiddenFromList: false,
30
+ keyframable: false,
26
31
  },
27
32
  ...sequence_field_schema_js_1.sequenceVisualStyleSchema,
28
33
  hidden: sequence_field_schema_js_1.hiddenField,
29
34
  };
30
- const AnimatedImageContent = (0, react_1.forwardRef)(({ src, width, height, onError, loopBehavior = 'loop', playbackRate = 1, fit = 'fill', effects, controls, ...props }, canvasRef) => {
35
+ const AnimatedImageContent = (0, react_1.forwardRef)(({ src, width, height, onError, loopBehavior = 'loop', playbackRate = 1, fit = 'fill', requestInit, effects, controls, ...props }, canvasRef) => {
31
36
  var _a;
32
37
  const resolvedSrc = (0, resolve_image_source_1.resolveAnimatedImageSource)(src);
33
38
  const [imageDecoder, setImageDecoder] = (0, react_1.useState)(null);
@@ -38,6 +43,9 @@ const AnimatedImageContent = (0, react_1.forwardRef)(({ src, width, height, onEr
38
43
  const currentTime = frame / playbackRate / fps;
39
44
  const currentTimeRef = (0, react_1.useRef)(currentTime);
40
45
  currentTimeRef.current = currentTime;
46
+ const requestInitKey = (0, request_init_1.serializeRequestInit)(requestInit);
47
+ const requestInitRef = (0, react_1.useRef)(requestInit);
48
+ requestInitRef.current = requestInit;
41
49
  const ref = (0, react_1.useRef)(null);
42
50
  const memoizedEffects = (0, use_memoized_effects_js_1.useMemoizedEffects)({
43
51
  effects,
@@ -57,6 +65,7 @@ const AnimatedImageContent = (0, react_1.forwardRef)(({ src, width, height, onEr
57
65
  (0, decode_image_js_1.decodeImage)({
58
66
  resolvedSrc,
59
67
  signal: controller.signal,
68
+ requestInit: requestInitRef.current,
60
69
  currentTime: currentTimeRef.current,
61
70
  initialLoopBehavior,
62
71
  })
@@ -84,6 +93,7 @@ const AnimatedImageContent = (0, react_1.forwardRef)(({ src, width, height, onEr
84
93
  resolvedSrc,
85
94
  decodeHandle,
86
95
  onError,
96
+ requestInitKey,
87
97
  initialLoopBehavior,
88
98
  continueRender,
89
99
  ]);
@@ -139,13 +149,17 @@ const AnimatedImageContent = (0, react_1.forwardRef)(({ src, width, height, onEr
139
149
  width,
140
150
  height,
141
151
  ]);
142
- return ((0, jsx_runtime_1.jsx)(canvas_1.Canvas, { ref: ref, width: width, height: height, fit: fit, effects: memoizedEffects, ...props }));
152
+ return (jsx_runtime_1.jsx(canvas_1.Canvas, { ref: ref, width: width, height: height, fit: fit, effects: memoizedEffects, ...props }));
143
153
  });
144
154
  AnimatedImageContent.displayName = 'AnimatedImageContent';
145
- const AnimatedImageInner = ({ src, width, height, onError, fit, playbackRate, loopBehavior, id, className, style, durationInFrames, effects = [], _experimentalControls: controls, ref, ...sequenceProps }) => {
155
+ const AnimatedImageInner = ({ src, width, height, onError, fit, playbackRate, loopBehavior, id, className, style, durationInFrames, requestInit, effects = [], _experimentalControls: controls, ref, ...sequenceProps }) => {
146
156
  const { durationInFrames: videoDuration } = (0, use_video_config_js_1.useVideoConfig)();
147
157
  const resolvedDuration = durationInFrames !== null && durationInFrames !== void 0 ? durationInFrames : videoDuration;
158
+ const actualRef = (0, react_1.useRef)(null);
148
159
  const memoizedEffectDefinitions = (0, use_memoized_effects_js_1.useMemoizedEffectDefinitions)(effects);
160
+ (0, react_1.useImperativeHandle)(ref, () => {
161
+ return actualRef.current;
162
+ }, []);
149
163
  const animatedImageProps = {
150
164
  src,
151
165
  width,
@@ -157,9 +171,14 @@ const AnimatedImageInner = ({ src, width, height, onError, fit, playbackRate, lo
157
171
  id,
158
172
  className,
159
173
  style,
174
+ requestInit,
160
175
  };
161
- return ((0, jsx_runtime_1.jsx)(Sequence_js_1.Sequence, { layout: "none", durationInFrames: resolvedDuration, name: "<AnimatedImage>", _remotionInternalDocumentationLink: "https://www.remotion.dev/docs/animatedimage", _experimentalControls: controls, _remotionInternalEffects: memoizedEffectDefinitions, ...sequenceProps, children: (0, jsx_runtime_1.jsx)(AnimatedImageContent, { ...animatedImageProps, ref: ref, effects: effects, controls: controls }) }));
176
+ return (jsx_runtime_1.jsx(Sequence_js_1.Sequence, { layout: "none", durationInFrames: resolvedDuration, name: "<AnimatedImage>", _remotionInternalDocumentationLink: "https://www.remotion.dev/docs/animatedimage", _experimentalControls: controls, _remotionInternalEffects: memoizedEffectDefinitions, ...sequenceProps, _remotionInternalRefForOutline: actualRef, children: jsx_runtime_1.jsx(AnimatedImageContent, { ...animatedImageProps, ref: actualRef, effects: effects, controls: controls }) }));
162
177
  };
163
- exports.AnimatedImage = (0, wrap_in_schema_js_1.wrapInSchema)(AnimatedImageInner, animatedImageSchema);
178
+ exports.AnimatedImage = (0, wrap_in_schema_js_1.wrapInSchema)({
179
+ Component: AnimatedImageInner,
180
+ schema: animatedImageSchema,
181
+ supportsEffects: true,
182
+ });
164
183
  exports.AnimatedImage.displayName = 'AnimatedImage';
165
184
  (0, enable_sequence_stack_traces_js_1.addSequenceStackTraces)(exports.AnimatedImage);
@@ -101,6 +101,6 @@ const CanvasRefForwardingFunction = ({ width, height, fit, className, style, eff
101
101
  },
102
102
  };
103
103
  }, [draw]);
104
- return (0, jsx_runtime_1.jsx)("canvas", { ref: canvasRef, className: className, style: style });
104
+ return jsx_runtime_1.jsx("canvas", { ref: canvasRef, className: className, style: style });
105
105
  };
106
106
  exports.Canvas = react_1.default.forwardRef(CanvasRefForwardingFunction);
@@ -8,9 +8,10 @@ export type RemotionImageDecoder = {
8
8
  getFrame: (i: number, loopBehavior: RemotionAnimatedImageLoopBehavior) => Promise<AnimatedImageCacheItem | null>;
9
9
  frameCount: number;
10
10
  };
11
- export declare const decodeImage: ({ resolvedSrc, signal, currentTime, initialLoopBehavior, }: {
11
+ export declare const decodeImage: ({ resolvedSrc, signal, requestInit, currentTime, initialLoopBehavior, }: {
12
12
  resolvedSrc: string;
13
13
  signal: AbortSignal;
14
+ requestInit?: RequestInit | undefined;
14
15
  currentTime: number;
15
16
  initialLoopBehavior: RemotionAnimatedImageLoopBehavior;
16
17
  }) => Promise<RemotionImageDecoder>;
@@ -9,11 +9,11 @@ const getActualTime = ({ loopBehavior, durationFound, timeInSec, }) => {
9
9
  : timeInSec
10
10
  : Math.min(timeInSec, durationFound || Infinity);
11
11
  };
12
- const decodeImage = async ({ resolvedSrc, signal, currentTime, initialLoopBehavior, }) => {
12
+ const decodeImage = async ({ resolvedSrc, signal, requestInit, currentTime, initialLoopBehavior, }) => {
13
13
  if (typeof ImageDecoder === 'undefined') {
14
14
  throw new Error('Your browser does not support the WebCodecs ImageDecoder API.');
15
15
  }
16
- const res = await fetch(resolvedSrc, { signal });
16
+ const res = await fetch(resolvedSrc, { ...requestInit, signal });
17
17
  const { body } = res;
18
18
  if (!body) {
19
19
  throw new Error('Got no body');
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.AnimatedImage = void 0;
4
- var AnimatedImage_1 = require("./AnimatedImage");
4
+ const AnimatedImage_1 = require("./AnimatedImage");
5
5
  Object.defineProperty(exports, "AnimatedImage", { enumerable: true, get: function () { return AnimatedImage_1.AnimatedImage; } });
@@ -13,6 +13,7 @@ export type RemotionAnimatedImageProps = {
13
13
  loopBehavior?: RemotionAnimatedImageLoopBehavior;
14
14
  id?: string;
15
15
  className?: string;
16
+ requestInit?: RequestInit;
16
17
  };
17
18
  export type AnimatedImageProps = Omit<SequenceProps, 'children' | 'durationInFrames' | 'layout' | '_remotionInternalEffects'> & RemotionAnimatedImageProps & {
18
19
  readonly durationInFrames?: number;
@@ -0,0 +1 @@
1
+ export declare const serializeRequestInit: (requestInit: RequestInit | undefined) => string | null;
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.serializeRequestInit = void 0;
4
+ const serializeRequestInit = (requestInit) => {
5
+ if (!requestInit) {
6
+ return null;
7
+ }
8
+ const requestInitWithoutSignal = { ...requestInit };
9
+ delete requestInitWithoutSignal.signal;
10
+ const { headers, ...rest } = requestInitWithoutSignal;
11
+ return JSON.stringify({
12
+ ...rest,
13
+ headers: headers ? Array.from(new Headers(headers).entries()) : null,
14
+ });
15
+ };
16
+ exports.serializeRequestInit = serializeRequestInit;
@@ -213,6 +213,6 @@ const AudioForDevelopmentForwardRefFunction = (props, ref) => {
213
213
  if (initialShouldPreMountAudioElements) {
214
214
  return null;
215
215
  }
216
- return ((0, jsx_runtime_1.jsx)("audio", { ref: audioRef, preload: "metadata", crossOrigin: crossOriginValue, ...propsToPass }));
216
+ return (jsx_runtime_1.jsx("audio", { ref: audioRef, preload: "metadata", crossOrigin: crossOriginValue, ...propsToPass }));
217
217
  };
218
218
  exports.AudioForPreview = (0, react_2.forwardRef)(AudioForDevelopmentForwardRefFunction);
@@ -1,9 +1,24 @@
1
1
  import type { ForwardRefExoticComponent, RefAttributes } from 'react';
2
2
  import React from 'react';
3
- import type { RemotionAudioProps } from './props.js';
4
- type AudioForRenderingProps = RemotionAudioProps & {
3
+ export declare const AudioForRendering: ForwardRefExoticComponent<import("./props.js").NativeAudioProps & {
4
+ name?: string | undefined;
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
+ } & {
5
22
  readonly onDuration: (src: string, durationInSeconds: number) => void;
6
23
  readonly onNativeError: React.ReactEventHandler<HTMLAudioElement>;
7
- };
8
- export declare const AudioForRendering: ForwardRefExoticComponent<AudioForRenderingProps & RefAttributes<HTMLAudioElement>>;
9
- export {};
24
+ } & RefAttributes<HTMLAudioElement>>;
@@ -133,6 +133,6 @@ const AudioForRenderingRefForwardingFunction = (props, ref) => {
133
133
  if (!needsToRenderAudioTag) {
134
134
  return null;
135
135
  }
136
- return (0, jsx_runtime_1.jsx)("audio", { ref: audioRef, ...nativeProps, onError: onNativeError });
136
+ return jsx_runtime_1.jsx("audio", { ref: audioRef, ...nativeProps, onError: onNativeError });
137
137
  };
138
138
  exports.AudioForRendering = (0, react_1.forwardRef)(AudioForRenderingRefForwardingFunction);