@remotion/promo-pages 4.0.496 → 4.0.498

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.
@@ -22913,7 +22913,7 @@ var getSingleChildComponent = (children) => {
22913
22913
  }
22914
22914
  return child.type;
22915
22915
  };
22916
- var VERSION = "4.0.496";
22916
+ var VERSION = "4.0.498";
22917
22917
  var checkMultipleRemotionVersions = () => {
22918
22918
  if (typeof globalThis === "undefined") {
22919
22919
  return;
@@ -23391,6 +23391,45 @@ var textSchema = {
23391
23391
  hiddenFromList: false
23392
23392
  }
23393
23393
  };
23394
+ var borderSchema = {
23395
+ "style.borderWidth": {
23396
+ type: "number",
23397
+ default: undefined,
23398
+ min: 0,
23399
+ step: 1,
23400
+ description: "Border width",
23401
+ hiddenFromList: false
23402
+ },
23403
+ "style.borderStyle": {
23404
+ type: "enum",
23405
+ default: "none",
23406
+ description: "Border style",
23407
+ variants: {
23408
+ none: {},
23409
+ hidden: {},
23410
+ solid: {},
23411
+ dashed: {},
23412
+ dotted: {},
23413
+ double: {},
23414
+ groove: {},
23415
+ ridge: {},
23416
+ inset: {},
23417
+ outset: {}
23418
+ }
23419
+ },
23420
+ "style.borderColor": {
23421
+ type: "color",
23422
+ default: undefined,
23423
+ description: "Border color"
23424
+ }
23425
+ };
23426
+ var backgroundSchema = {
23427
+ "style.backgroundColor": {
23428
+ type: "color",
23429
+ default: "transparent",
23430
+ description: "Color"
23431
+ }
23432
+ };
23394
23433
  var textContentSchema = {
23395
23434
  children: {
23396
23435
  type: "text-content",
@@ -23418,20 +23457,13 @@ var premountSchema = {
23418
23457
  keyframable: false
23419
23458
  }
23420
23459
  };
23421
- var premountStyleSchema = {
23422
- styleWhilePremounted: {
23423
- type: "hidden"
23424
- },
23425
- styleWhilePostmounted: {
23426
- type: "hidden"
23427
- }
23428
- };
23429
23460
  var sequencePremountSchema = {
23430
- ...premountSchema,
23431
- ...premountStyleSchema
23461
+ ...premountSchema
23432
23462
  };
23433
23463
  var sequenceStyleSchema = {
23434
23464
  ...transformSchema,
23465
+ ...backgroundSchema,
23466
+ ...borderSchema,
23435
23467
  ...sequencePremountSchema
23436
23468
  };
23437
23469
  var hiddenField = {
@@ -23719,6 +23751,9 @@ var PremountContext = createContext15({
23719
23751
  premountFramesRemaining: 0
23720
23752
  });
23721
23753
  var ENABLE_V5_BREAKING_CHANGES = false;
23754
+ var resolveV5Default = (value) => {
23755
+ return value ?? ENABLE_V5_BREAKING_CHANGES;
23756
+ };
23722
23757
  var usePremounting = ({
23723
23758
  from,
23724
23759
  durationInFrames,
@@ -26767,38 +26802,53 @@ var CanvasRefForwardingFunction = ({ width, height, fit, className, style, effec
26767
26802
  });
26768
26803
  };
26769
26804
  var Canvas = React16.forwardRef(CanvasRefForwardingFunction);
26770
- var CACHE_SIZE = 5;
26771
- var getActualTime = ({
26772
- loopBehavior,
26773
- durationFound,
26774
- timeInSec
26775
- }) => {
26776
- return loopBehavior === "loop" ? durationFound ? timeInSec % durationFound : timeInSec : Math.min(timeInSec, durationFound || Infinity);
26777
- };
26778
- var decodeImage = async ({
26805
+ var createImageDecoder = async ({
26779
26806
  resolvedSrc,
26780
26807
  signal,
26781
26808
  requestInit,
26782
- currentTime,
26783
- initialLoopBehavior
26809
+ contentType
26784
26810
  }) => {
26785
26811
  if (typeof ImageDecoder === "undefined") {
26786
26812
  throw new Error("Your browser does not support the WebCodecs ImageDecoder API.");
26787
26813
  }
26788
- const res = await fetch(resolvedSrc, { ...requestInit, signal });
26789
- const { body } = res;
26814
+ const response = await fetch(resolvedSrc, { ...requestInit, signal });
26815
+ const { body } = response;
26790
26816
  if (!body) {
26791
26817
  throw new Error("Got no body");
26792
26818
  }
26793
26819
  const decoder = new ImageDecoder({
26794
26820
  data: body,
26795
- type: res.headers.get("Content-Type") || "image/gif"
26821
+ type: contentType ?? response.headers.get("Content-Type") ?? "image/gif"
26796
26822
  });
26797
- await decoder.completed;
26823
+ await Promise.all([decoder.completed, decoder.tracks.ready]);
26798
26824
  const { selectedTrack } = decoder.tracks;
26799
26825
  if (!selectedTrack) {
26826
+ decoder.close();
26800
26827
  throw new Error("No selected track");
26801
26828
  }
26829
+ return { decoder, selectedTrack };
26830
+ };
26831
+ var CACHE_SIZE = 5;
26832
+ var getActualTime = ({
26833
+ loopBehavior,
26834
+ durationFound,
26835
+ timeInSec
26836
+ }) => {
26837
+ return loopBehavior === "loop" ? durationFound ? timeInSec % durationFound : timeInSec : Math.min(timeInSec, durationFound || Infinity);
26838
+ };
26839
+ var decodeImage = async ({
26840
+ resolvedSrc,
26841
+ signal,
26842
+ requestInit,
26843
+ currentTime,
26844
+ initialLoopBehavior
26845
+ }) => {
26846
+ const { decoder, selectedTrack } = await createImageDecoder({
26847
+ resolvedSrc,
26848
+ signal,
26849
+ requestInit,
26850
+ contentType: null
26851
+ });
26802
26852
  const cache2 = [];
26803
26853
  let durationFound = null;
26804
26854
  const getFrameByIndex = async (frameIndex) => {
@@ -26904,6 +26954,13 @@ var decodeImage = async ({
26904
26954
  return closest;
26905
26955
  };
26906
26956
  return {
26957
+ close: () => {
26958
+ for (const item of cache2) {
26959
+ item.frame?.close();
26960
+ item.frame = null;
26961
+ }
26962
+ decoder.close();
26963
+ },
26907
26964
  getFrame,
26908
26965
  frameCount: selectedTrack.frameCount
26909
26966
  };
@@ -26941,6 +26998,7 @@ var animatedImageSchema = {
26941
26998
  keyframable: false
26942
26999
  },
26943
27000
  ...baseSchema,
27001
+ ...premountSchema,
26944
27002
  playbackRate: {
26945
27003
  type: "number",
26946
27004
  min: 0,
@@ -26951,7 +27009,9 @@ var animatedImageSchema = {
26951
27009
  hiddenFromList: false,
26952
27010
  keyframable: false
26953
27011
  },
26954
- ...transformSchema
27012
+ ...transformSchema,
27013
+ ...backgroundSchema,
27014
+ ...borderSchema
26955
27015
  };
26956
27016
  var getCanvasPropsFromSequenceProps = (props) => {
26957
27017
  const canvasProps = {};
@@ -27003,6 +27063,15 @@ var AnimatedImageContent = forwardRef4(({
27003
27063
  const [initialLoopBehavior] = useState6(() => loopBehavior);
27004
27064
  useEffect5(() => {
27005
27065
  const controller = new AbortController;
27066
+ let cancelled = false;
27067
+ let continued = false;
27068
+ const continueRenderOnce = () => {
27069
+ if (continued) {
27070
+ return;
27071
+ }
27072
+ continued = true;
27073
+ continueRender2(decodeHandle);
27074
+ };
27006
27075
  decodeImage({
27007
27076
  resolvedSrc,
27008
27077
  signal: controller.signal,
@@ -27010,22 +27079,31 @@ var AnimatedImageContent = forwardRef4(({
27010
27079
  currentTime: currentTimeRef.current,
27011
27080
  initialLoopBehavior
27012
27081
  }).then((d) => {
27082
+ if (cancelled) {
27083
+ d.close();
27084
+ return;
27085
+ }
27013
27086
  setImageDecoder(d);
27014
- continueRender2(decodeHandle);
27087
+ continueRenderOnce();
27015
27088
  }).catch((err) => {
27089
+ if (cancelled) {
27090
+ return;
27091
+ }
27016
27092
  if (err.name === "AbortError") {
27017
- continueRender2(decodeHandle);
27093
+ continueRenderOnce();
27018
27094
  return;
27019
27095
  }
27020
27096
  if (onError) {
27021
27097
  onError?.(err);
27022
- continueRender2(decodeHandle);
27098
+ continueRenderOnce();
27023
27099
  } else {
27024
27100
  cancelRender(err);
27025
27101
  }
27026
27102
  });
27027
27103
  return () => {
27104
+ cancelled = true;
27028
27105
  controller.abort();
27106
+ continueRenderOnce();
27029
27107
  };
27030
27108
  }, [
27031
27109
  resolvedSrc,
@@ -27035,6 +27113,11 @@ var AnimatedImageContent = forwardRef4(({
27035
27113
  initialLoopBehavior,
27036
27114
  continueRender2
27037
27115
  ]);
27116
+ useEffect5(() => {
27117
+ return () => {
27118
+ imageDecoder?.close();
27119
+ };
27120
+ }, [imageDecoder]);
27038
27121
  useLayoutEffect2(() => {
27039
27122
  if (!imageDecoder) {
27040
27123
  return;
@@ -27104,6 +27187,11 @@ var AnimatedImageInner = ({
27104
27187
  className,
27105
27188
  style,
27106
27189
  durationInFrames,
27190
+ from,
27191
+ premountFor,
27192
+ postmountFor,
27193
+ styleWhilePremounted,
27194
+ styleWhilePostmounted,
27107
27195
  requestInit,
27108
27196
  effects = [],
27109
27197
  controls,
@@ -27115,6 +27203,24 @@ var AnimatedImageInner = ({
27115
27203
  useImperativeHandle2(ref, () => {
27116
27204
  return actualRef.current;
27117
27205
  }, []);
27206
+ const {
27207
+ effectivePostmountFor,
27208
+ effectivePremountFor,
27209
+ freezeFrame,
27210
+ isPremountingOrPostmounting,
27211
+ postmountingActive,
27212
+ premountingActive,
27213
+ premountingStyle
27214
+ } = usePremounting({
27215
+ from: from ?? 0,
27216
+ durationInFrames: durationInFrames ?? Infinity,
27217
+ premountFor: premountFor ?? null,
27218
+ postmountFor: postmountFor ?? null,
27219
+ style: style ?? null,
27220
+ styleWhilePremounted: styleWhilePremounted ?? null,
27221
+ styleWhilePostmounted: styleWhilePostmounted ?? null,
27222
+ hideWhilePremounted: "display-none"
27223
+ });
27118
27224
  const canvasProps = getCanvasPropsFromSequenceProps(sequenceProps);
27119
27225
  const animatedImageProps = {
27120
27226
  src,
@@ -27126,24 +27232,33 @@ var AnimatedImageInner = ({
27126
27232
  loopBehavior,
27127
27233
  id,
27128
27234
  className,
27129
- style,
27235
+ style: premountingStyle ?? undefined,
27130
27236
  requestInit,
27131
27237
  ...canvasProps
27132
27238
  };
27133
- return /* @__PURE__ */ jsx14(Sequence, {
27134
- layout: "none",
27135
- durationInFrames,
27136
- name: "<AnimatedImage>",
27137
- _remotionInternalDocumentationLink: "https://www.remotion.dev/docs/animatedimage",
27138
- controls,
27139
- _remotionInternalEffects: memoizedEffectDefinitions,
27140
- ...sequenceProps,
27141
- outlineRef: actualRef,
27142
- children: /* @__PURE__ */ jsx14(AnimatedImageContent, {
27143
- ...animatedImageProps,
27144
- ref: actualRef,
27145
- effects,
27146
- controls
27239
+ return /* @__PURE__ */ jsx14(Freeze, {
27240
+ frame: freezeFrame,
27241
+ active: isPremountingOrPostmounting,
27242
+ children: /* @__PURE__ */ jsx14(Sequence, {
27243
+ layout: "none",
27244
+ from: from ?? 0,
27245
+ durationInFrames: durationInFrames ?? Infinity,
27246
+ name: "<AnimatedImage>",
27247
+ _remotionInternalDocumentationLink: "https://www.remotion.dev/docs/animatedimage",
27248
+ controls,
27249
+ _remotionInternalEffects: memoizedEffectDefinitions,
27250
+ _remotionInternalPremountDisplay: effectivePremountFor || null,
27251
+ _remotionInternalPostmountDisplay: effectivePostmountFor || null,
27252
+ _remotionInternalIsPremounting: premountingActive,
27253
+ _remotionInternalIsPostmounting: postmountingActive,
27254
+ ...sequenceProps,
27255
+ outlineRef: actualRef,
27256
+ children: /* @__PURE__ */ jsx14(AnimatedImageContent, {
27257
+ ...animatedImageProps,
27258
+ ref: actualRef,
27259
+ effects,
27260
+ controls
27261
+ })
27147
27262
  })
27148
27263
  });
27149
27264
  };
@@ -27859,13 +27974,17 @@ var makeSharedElementSourceNode = ({
27859
27974
  }) => {
27860
27975
  let connected = null;
27861
27976
  let disposed = false;
27977
+ let currentAudioContext = audioContext;
27862
27978
  return {
27979
+ setAudioContext: (newAudioContext) => {
27980
+ currentAudioContext = newAudioContext;
27981
+ },
27863
27982
  attemptToConnect: () => {
27864
27983
  if (disposed) {
27865
27984
  throw new Error("SharedElementSourceNode has been disposed");
27866
27985
  }
27867
- if (!connected && ref.current) {
27868
- const mediaElementSourceNode = audioContext.createMediaElementSource(ref.current);
27986
+ if (!connected && ref.current && currentAudioContext) {
27987
+ const mediaElementSourceNode = currentAudioContext.createMediaElementSource(ref.current);
27869
27988
  connected = mediaElementSourceNode;
27870
27989
  }
27871
27990
  },
@@ -28193,19 +28312,22 @@ var SharedAudioTagsContextProvider = ({ children, numberOfAudioTags }) => {
28193
28312
  const audioCtx = useContext21(SharedAudioContext);
28194
28313
  const audioContext = audioCtx?.audioContext ?? null;
28195
28314
  const resume = audioCtx?.resume;
28196
- const refs = useMemo22(() => {
28315
+ const [refs] = useState10(() => {
28197
28316
  return new Array(numberOfAudioTags).fill(true).map(() => {
28198
28317
  const ref = createRef2();
28199
28318
  return {
28200
28319
  id: Math.random(),
28201
28320
  ref,
28202
- mediaElementSourceNode: audioContext ? makeSharedElementSourceNode({
28321
+ mediaElementSourceNode: makeSharedElementSourceNode({
28203
28322
  audioContext,
28204
28323
  ref
28205
- }) : null
28324
+ })
28206
28325
  };
28207
28326
  });
28208
- }, [audioContext, numberOfAudioTags]);
28327
+ });
28328
+ for (const { mediaElementSourceNode } of refs) {
28329
+ mediaElementSourceNode?.setAudioContext(audioContext);
28330
+ }
28209
28331
  const effectToUse = React20.useInsertionEffect ?? React20.useLayoutEffect;
28210
28332
  effectToUse(() => {
28211
28333
  return () => {
@@ -28273,7 +28395,7 @@ var SharedAudioTagsContextProvider = ({ children, numberOfAudioTags }) => {
28273
28395
  const cloned = [...takenAudios.current];
28274
28396
  const index = refs.findIndex((r2) => r2.id === id);
28275
28397
  if (index === -1) {
28276
- throw new TypeError("Error occured in ");
28398
+ throw new TypeError(`Unknown audio ref ${id}; refs: ${refs.map((r2) => r2.id).join(", ")}`);
28277
28399
  }
28278
28400
  cloned[index] = false;
28279
28401
  takenAudios.current = cloned;
@@ -28377,10 +28499,10 @@ var useSharedAudio = ({
28377
28499
  return tagsCtx.registerAudio({ aud, audioId, premounting, postmounting });
28378
28500
  }
28379
28501
  const el = React20.createRef();
28380
- const mediaElementSourceNode = audioCtx?.audioContext ? makeSharedElementSourceNode({
28381
- audioContext: audioCtx.audioContext,
28502
+ const mediaElementSourceNode = makeSharedElementSourceNode({
28503
+ audioContext: audioCtx?.audioContext ?? null,
28382
28504
  ref: el
28383
- }) : null;
28505
+ });
28384
28506
  return {
28385
28507
  el,
28386
28508
  id: Math.random(),
@@ -28395,6 +28517,7 @@ var useSharedAudio = ({
28395
28517
  }
28396
28518
  };
28397
28519
  });
28520
+ elem.mediaElementSourceNode?.setAudioContext(audioCtx?.audioContext ?? null);
28398
28521
  const effectToUse = React20.useInsertionEffect ?? React20.useLayoutEffect;
28399
28522
  if (typeof document !== "undefined") {
28400
28523
  effectToUse(() => {
@@ -30106,6 +30229,7 @@ var AudioRefForwardingFunction = (props, ref) => {
30106
30229
  const { loop, freeze: _freeze, ...propsOtherThanLoop } = propsWithFreeze;
30107
30230
  const { fps } = useVideoConfig();
30108
30231
  const environment = useRemotionEnvironment();
30232
+ const shouldPauseWhenBuffering = resolveV5Default(pauseWhenBuffering);
30109
30233
  if (environment.isClientSideRendering) {
30110
30234
  throw new Error("<Html5Audio> is not supported in @remotion/web-renderer. Use <Audio> from @remotion/media instead. See https://remotion.dev/docs/client-side-rendering/limitations");
30111
30235
  }
@@ -30175,7 +30299,7 @@ var AudioRefForwardingFunction = (props, ref) => {
30175
30299
  name,
30176
30300
  children: /* @__PURE__ */ jsx23(Html5Audio, {
30177
30301
  _remotionInternalNeedsDurationCalculation: Boolean(loop),
30178
- pauseWhenBuffering: pauseWhenBuffering ?? false,
30302
+ pauseWhenBuffering: shouldPauseWhenBuffering,
30179
30303
  ...otherProps,
30180
30304
  ref
30181
30305
  })
@@ -30203,7 +30327,7 @@ var AudioRefForwardingFunction = (props, ref) => {
30203
30327
  ref,
30204
30328
  onNativeError: onError,
30205
30329
  onDuration,
30206
- pauseWhenBuffering: pauseWhenBuffering ?? false,
30330
+ pauseWhenBuffering: shouldPauseWhenBuffering,
30207
30331
  _remotionInternalNeedsDurationCalculation: Boolean(loop),
30208
30332
  showInTimeline: showInTimeline ?? true
30209
30333
  });
@@ -30252,7 +30376,9 @@ var solidSchema = {
30252
30376
  description: "Pixel density",
30253
30377
  hiddenFromList: false
30254
30378
  },
30255
- ...transformSchema
30379
+ ...transformSchema,
30380
+ ...backgroundSchema,
30381
+ ...borderSchema
30256
30382
  };
30257
30383
  var SolidInner = ({
30258
30384
  color,
@@ -30806,7 +30932,9 @@ var htmlInCanvasSchema = {
30806
30932
  description: "Pixel density",
30807
30933
  hiddenFromList: false
30808
30934
  },
30809
- ...transformSchema
30935
+ ...transformSchema,
30936
+ ...backgroundSchema,
30937
+ ...borderSchema
30810
30938
  };
30811
30939
  var HtmlInCanvasWrapped = withInteractivitySchema({
30812
30940
  Component: HtmlInCanvasInner,
@@ -30828,6 +30956,7 @@ function truncateSrcForLabel(src) {
30828
30956
  }
30829
30957
  var canvasImageSchema = {
30830
30958
  ...baseSchema,
30959
+ ...premountSchema,
30831
30960
  fit: {
30832
30961
  type: "enum",
30833
30962
  default: "fill",
@@ -30838,7 +30967,9 @@ var canvasImageSchema = {
30838
30967
  cover: {}
30839
30968
  }
30840
30969
  },
30841
- ...transformSchema
30970
+ ...transformSchema,
30971
+ ...backgroundSchema,
30972
+ ...borderSchema
30842
30973
  };
30843
30974
  var makeAbortError = () => {
30844
30975
  if (typeof DOMException !== "undefined") {
@@ -31162,6 +31293,10 @@ var CanvasImageInner = forwardRef10(({
31162
31293
  from,
31163
31294
  trimBefore,
31164
31295
  freeze,
31296
+ premountFor,
31297
+ postmountFor,
31298
+ styleWhilePremounted,
31299
+ styleWhilePostmounted,
31165
31300
  hidden,
31166
31301
  name,
31167
31302
  showInTimeline,
@@ -31179,39 +31314,65 @@ var CanvasImageInner = forwardRef10(({
31179
31314
  useImperativeHandle7(ref, () => {
31180
31315
  return actualRef.current;
31181
31316
  }, []);
31182
- return /* @__PURE__ */ jsx26(Sequence, {
31183
- layout: "none",
31317
+ const {
31318
+ effectivePostmountFor,
31319
+ effectivePremountFor,
31320
+ freezeFrame,
31321
+ isPremountingOrPostmounting,
31322
+ postmountingActive,
31323
+ premountingActive,
31324
+ premountingStyle
31325
+ } = usePremounting({
31184
31326
  from: from ?? 0,
31185
- trimBefore,
31186
31327
  durationInFrames: durationInFrames ?? Infinity,
31187
- freeze,
31188
- hidden,
31189
- showInTimeline: showInTimeline ?? true,
31190
- name: name ?? "<CanvasImage>",
31191
- _remotionInternalDocumentationLink: _remotionInternalDocumentationLink ?? "https://www.remotion.dev/docs/canvasimage",
31192
- controls,
31193
- _remotionInternalEffects: memoizedEffectDefinitions,
31194
- _remotionInternalIsMedia: { type: "image", src },
31195
- _remotionInternalStack: stack,
31196
- outlineRef: outlineRef ?? actualRef,
31197
- children: /* @__PURE__ */ jsx26(CanvasImageContent, {
31198
- ref: actualRef,
31199
- src,
31200
- width,
31201
- height,
31202
- fit,
31203
- effects,
31328
+ premountFor: premountFor ?? null,
31329
+ postmountFor: postmountFor ?? null,
31330
+ style: style ?? null,
31331
+ styleWhilePremounted: styleWhilePremounted ?? null,
31332
+ styleWhilePostmounted: styleWhilePostmounted ?? null,
31333
+ hideWhilePremounted: "display-none"
31334
+ });
31335
+ return /* @__PURE__ */ jsx26(Freeze, {
31336
+ frame: freezeFrame,
31337
+ active: isPremountingOrPostmounting,
31338
+ children: /* @__PURE__ */ jsx26(Sequence, {
31339
+ layout: "none",
31340
+ from: from ?? 0,
31341
+ trimBefore,
31342
+ durationInFrames: durationInFrames ?? Infinity,
31343
+ freeze,
31344
+ hidden,
31345
+ showInTimeline: showInTimeline ?? true,
31346
+ name: name ?? "<CanvasImage>",
31347
+ _remotionInternalDocumentationLink: _remotionInternalDocumentationLink ?? "https://www.remotion.dev/docs/canvasimage",
31204
31348
  controls,
31205
- className,
31206
- style,
31207
- id,
31208
- onError,
31209
- pauseWhenLoading,
31210
- maxRetries,
31211
- delayRenderRetries,
31212
- delayRenderTimeoutInMilliseconds,
31213
- refForOutline: outlineRef ?? null,
31214
- ...canvasProps
31349
+ _remotionInternalEffects: memoizedEffectDefinitions,
31350
+ _remotionInternalIsMedia: { type: "image", src },
31351
+ _remotionInternalStack: stack,
31352
+ _remotionInternalPremountDisplay: effectivePremountFor || null,
31353
+ _remotionInternalPostmountDisplay: effectivePostmountFor || null,
31354
+ _remotionInternalIsPremounting: premountingActive,
31355
+ _remotionInternalIsPostmounting: postmountingActive,
31356
+ outlineRef: outlineRef ?? actualRef,
31357
+ children: /* @__PURE__ */ jsx26(CanvasImageContent, {
31358
+ ref: actualRef,
31359
+ src,
31360
+ width,
31361
+ height,
31362
+ fit,
31363
+ effects,
31364
+ controls,
31365
+ className,
31366
+ style: premountingStyle ?? undefined,
31367
+ id,
31368
+ onError,
31369
+ pauseWhenLoading,
31370
+ maxRetries,
31371
+ delayRenderRetries,
31372
+ delayRenderTimeoutInMilliseconds,
31373
+ refForOutline: outlineRef ?? null,
31374
+ ...canvasProps
31375
+ })
31215
31376
  })
31216
31377
  });
31217
31378
  });
@@ -31428,6 +31589,11 @@ var NativeImgInner = ({
31428
31589
  trimBefore,
31429
31590
  durationInFrames,
31430
31591
  freeze,
31592
+ premountFor,
31593
+ postmountFor,
31594
+ style,
31595
+ styleWhilePremounted,
31596
+ styleWhilePostmounted,
31431
31597
  controls,
31432
31598
  outlineRef: refForOutline,
31433
31599
  ...props2
@@ -31435,24 +31601,51 @@ var NativeImgInner = ({
31435
31601
  if (!src) {
31436
31602
  throw new Error('No "src" prop was passed to <Img>.');
31437
31603
  }
31438
- return /* @__PURE__ */ jsx28(Sequence, {
31439
- layout: "none",
31604
+ const {
31605
+ effectivePostmountFor,
31606
+ effectivePremountFor,
31607
+ freezeFrame,
31608
+ isPremountingOrPostmounting,
31609
+ postmountingActive,
31610
+ premountingActive,
31611
+ premountingStyle
31612
+ } = usePremounting({
31440
31613
  from: from ?? 0,
31441
- trimBefore,
31442
31614
  durationInFrames: durationInFrames ?? Infinity,
31443
- freeze,
31444
- _remotionInternalStack: stack,
31445
- _remotionInternalDocumentationLink: "https://www.remotion.dev/docs/img",
31446
- _remotionInternalIsMedia: { type: "image", src },
31447
- name: name ?? "<Img>",
31448
- controls,
31449
- showInTimeline: showInTimeline ?? true,
31450
- hidden,
31451
- outlineRef: refForOutline,
31452
- children: /* @__PURE__ */ jsx28(ImgContent, {
31453
- src,
31454
- refForOutline,
31455
- ...props2
31615
+ premountFor: premountFor ?? null,
31616
+ postmountFor: postmountFor ?? null,
31617
+ style: style ?? null,
31618
+ styleWhilePremounted: styleWhilePremounted ?? null,
31619
+ styleWhilePostmounted: styleWhilePostmounted ?? null,
31620
+ hideWhilePremounted: "display-none"
31621
+ });
31622
+ return /* @__PURE__ */ jsx28(Freeze, {
31623
+ frame: freezeFrame,
31624
+ active: isPremountingOrPostmounting,
31625
+ children: /* @__PURE__ */ jsx28(Sequence, {
31626
+ layout: "none",
31627
+ from: from ?? 0,
31628
+ trimBefore,
31629
+ durationInFrames: durationInFrames ?? Infinity,
31630
+ freeze,
31631
+ _remotionInternalStack: stack,
31632
+ _remotionInternalDocumentationLink: "https://www.remotion.dev/docs/img",
31633
+ _remotionInternalIsMedia: { type: "image", src },
31634
+ _remotionInternalPremountDisplay: effectivePremountFor || null,
31635
+ _remotionInternalPostmountDisplay: effectivePostmountFor || null,
31636
+ _remotionInternalIsPremounting: premountingActive,
31637
+ _remotionInternalIsPostmounting: postmountingActive,
31638
+ name: name ?? "<Img>",
31639
+ controls,
31640
+ showInTimeline: showInTimeline ?? true,
31641
+ hidden,
31642
+ outlineRef: refForOutline,
31643
+ children: /* @__PURE__ */ jsx28(ImgContent, {
31644
+ src,
31645
+ refForOutline,
31646
+ style: premountingStyle ?? undefined,
31647
+ ...props2
31648
+ })
31456
31649
  })
31457
31650
  });
31458
31651
  };
@@ -31465,7 +31658,10 @@ var imgSchema = {
31465
31658
  keyframable: false
31466
31659
  },
31467
31660
  ...baseSchema,
31468
- ...transformSchema
31661
+ ...premountSchema,
31662
+ ...transformSchema,
31663
+ ...backgroundSchema,
31664
+ ...borderSchema
31469
31665
  };
31470
31666
  var imgCanvasFallbackIncompatibleProps = new Set([
31471
31667
  "alt",
@@ -31521,6 +31717,10 @@ var ImgInner = ({
31521
31717
  trimBefore,
31522
31718
  durationInFrames,
31523
31719
  freeze,
31720
+ premountFor,
31721
+ postmountFor,
31722
+ styleWhilePremounted,
31723
+ styleWhilePostmounted,
31524
31724
  controls,
31525
31725
  width,
31526
31726
  height,
@@ -31534,6 +31734,7 @@ var ImgInner = ({
31534
31734
  ...props2
31535
31735
  }) => {
31536
31736
  const refForOutline = useRef24(null);
31737
+ const shouldPauseWhenLoading = resolveV5Default(pauseWhenLoading);
31537
31738
  if (effects.length === 0) {
31538
31739
  return /* @__PURE__ */ jsx28(NativeImgInner, {
31539
31740
  ...props2,
@@ -31547,13 +31748,17 @@ var ImgInner = ({
31547
31748
  trimBefore,
31548
31749
  durationInFrames,
31549
31750
  freeze,
31751
+ premountFor,
31752
+ postmountFor,
31753
+ styleWhilePremounted,
31754
+ styleWhilePostmounted,
31550
31755
  controls,
31551
31756
  width,
31552
31757
  height,
31553
31758
  className,
31554
31759
  style,
31555
31760
  id,
31556
- pauseWhenLoading,
31761
+ pauseWhenLoading: shouldPauseWhenLoading,
31557
31762
  maxRetries,
31558
31763
  delayRenderRetries,
31559
31764
  delayRenderTimeoutInMilliseconds,
@@ -31582,7 +31787,7 @@ var ImgInner = ({
31582
31787
  className,
31583
31788
  style,
31584
31789
  id,
31585
- pauseWhenLoading,
31790
+ pauseWhenLoading: shouldPauseWhenLoading,
31586
31791
  maxRetries,
31587
31792
  delayRenderRetries,
31588
31793
  delayRenderTimeoutInMilliseconds,
@@ -31590,6 +31795,10 @@ var ImgInner = ({
31590
31795
  trimBefore,
31591
31796
  durationInFrames,
31592
31797
  freeze,
31798
+ premountFor,
31799
+ postmountFor,
31800
+ styleWhilePremounted,
31801
+ styleWhilePostmounted,
31593
31802
  hidden,
31594
31803
  name: name ?? "<Img>",
31595
31804
  showInTimeline,
@@ -31628,7 +31837,20 @@ var interactiveElementSchema = {
31628
31837
  ...baseSchema,
31629
31838
  ...transformSchema
31630
31839
  };
31840
+ var interactiveBackgroundElementSchema = {
31841
+ ...interactiveElementSchema,
31842
+ ...backgroundSchema
31843
+ };
31844
+ var interactiveBorderElementSchema = {
31845
+ ...interactiveBackgroundElementSchema,
31846
+ ...borderSchema
31847
+ };
31631
31848
  var interactiveTextElementSchema = {
31849
+ ...interactiveBorderElementSchema,
31850
+ ...textSchema,
31851
+ ...textContentSchema
31852
+ };
31853
+ var interactiveSvgTextElementSchema = {
31632
31854
  ...interactiveElementSchema,
31633
31855
  ...textSchema,
31634
31856
  ...textContentSchema
@@ -31707,6 +31929,8 @@ var Interactive = {
31707
31929
  baseSchema,
31708
31930
  transformSchema,
31709
31931
  textSchema,
31932
+ backgroundSchema,
31933
+ borderSchema,
31710
31934
  premountSchema,
31711
31935
  sequenceSchema,
31712
31936
  withSchema,
@@ -31743,10 +31967,39 @@ var Interactive = {
31743
31967
  Small: makeInteractiveTextElement("small", "<Interactive.Small>"),
31744
31968
  Span: makeInteractiveTextElement("span", "<Interactive.Span>"),
31745
31969
  Strong: makeInteractiveTextElement("strong", "<Interactive.Strong>"),
31746
- Svg: makeInteractiveNonTextElement("svg", "<Interactive.Svg>"),
31747
- Text: makeInteractiveTextElement("text", "<Interactive.Text>"),
31970
+ Svg: makeInteractiveElement("svg", "<Interactive.Svg>", interactiveBorderElementSchema),
31971
+ Text: makeInteractiveElement("text", "<Interactive.Text>", interactiveSvgTextElementSchema),
31748
31972
  Ul: makeInteractiveTextElement("ul", "<Interactive.Ul>")
31749
31973
  };
31974
+ var getAnimatedImageDurationInSeconds = async ({
31975
+ resolvedSrc,
31976
+ signal,
31977
+ requestInit,
31978
+ contentType
31979
+ }) => {
31980
+ const { decoder, selectedTrack } = await createImageDecoder({
31981
+ resolvedSrc,
31982
+ signal,
31983
+ requestInit,
31984
+ contentType
31985
+ });
31986
+ try {
31987
+ const { image } = await decoder.decode({
31988
+ frameIndex: selectedTrack.frameCount - 1,
31989
+ completeFramesOnly: true
31990
+ });
31991
+ try {
31992
+ if (image.duration === null) {
31993
+ throw new Error("Could not determine animated image duration");
31994
+ }
31995
+ return (image.timestamp + image.duration) / 1e6;
31996
+ } finally {
31997
+ image.close();
31998
+ }
31999
+ } finally {
32000
+ decoder.close();
32001
+ }
32002
+ };
31750
32003
  var compositionsRef = React31.createRef();
31751
32004
  var CompositionManagerProvider = ({
31752
32005
  children,
@@ -32728,6 +32981,7 @@ var InnerOffthreadVideo = (props2) => {
32728
32981
  ...otherProps
32729
32982
  } = props2;
32730
32983
  const environment = useRemotionEnvironment();
32984
+ const shouldPauseWhenBuffering = resolveV5Default(pauseWhenBuffering);
32731
32985
  if (environment.isClientSideRendering) {
32732
32986
  throw new Error("<OffthreadVideo> is not supported in @remotion/web-renderer. Use <Video> from @remotion/media instead. See https://remotion.dev/docs/client-side-rendering/limitations");
32733
32987
  }
@@ -32752,7 +33006,7 @@ var InnerOffthreadVideo = (props2) => {
32752
33006
  durationInFrames: trimAfterValue,
32753
33007
  name,
32754
33008
  children: /* @__PURE__ */ jsx35(InnerOffthreadVideo, {
32755
- pauseWhenBuffering: pauseWhenBuffering ?? false,
33009
+ pauseWhenBuffering: shouldPauseWhenBuffering,
32756
33010
  ...otherProps,
32757
33011
  trimAfter: undefined,
32758
33012
  name: undefined,
@@ -32767,7 +33021,7 @@ var InnerOffthreadVideo = (props2) => {
32767
33021
  validateMediaProps(props2, "Video");
32768
33022
  if (environment.isRendering) {
32769
33023
  return /* @__PURE__ */ jsx35(OffthreadVideoForRendering, {
32770
- pauseWhenBuffering: pauseWhenBuffering ?? false,
33024
+ pauseWhenBuffering: shouldPauseWhenBuffering,
32771
33025
  ...otherProps,
32772
33026
  trimAfter: undefined,
32773
33027
  name: undefined,
@@ -32792,7 +33046,7 @@ var InnerOffthreadVideo = (props2) => {
32792
33046
  _remotionInternalStack: stack ?? null,
32793
33047
  onDuration,
32794
33048
  onlyWarnForMediaSeekingError: true,
32795
- pauseWhenBuffering: pauseWhenBuffering ?? false,
33049
+ pauseWhenBuffering: shouldPauseWhenBuffering,
32796
33050
  showInTimeline: showInTimeline ?? true,
32797
33051
  onAutoPlayError: onAutoPlayError ?? undefined,
32798
33052
  onVideoFrame: onVideoFrame ?? null,
@@ -32850,7 +33104,7 @@ var OffthreadVideo = ({
32850
33104
  onAutoPlayError: onAutoPlayError ?? null,
32851
33105
  onError,
32852
33106
  onVideoFrame,
32853
- pauseWhenBuffering: pauseWhenBuffering ?? true,
33107
+ pauseWhenBuffering: resolveV5Default(pauseWhenBuffering),
32854
33108
  playbackRate: playbackRate ?? 1,
32855
33109
  preservePitch,
32856
33110
  toneFrequency: toneFrequency ?? 1,
@@ -32974,6 +33228,7 @@ var Internals = {
32974
33228
  useAbsoluteTimelinePosition,
32975
33229
  evaluateVolume,
32976
33230
  getAbsoluteSrc,
33231
+ getAnimatedImageDurationInSeconds,
32977
33232
  getAssetDisplayName,
32978
33233
  Timeline: exports_timeline_position_state,
32979
33234
  validateMediaTrimProps,
@@ -32998,7 +33253,6 @@ var Internals = {
32998
33253
  textSchema,
32999
33254
  transformSchema,
33000
33255
  premountSchema,
33001
- premountStyleSchema,
33002
33256
  flattenActiveSchema,
33003
33257
  getFlatSchemaWithAllKeys,
33004
33258
  RemotionRootContexts,
@@ -33137,6 +33391,7 @@ var seriesSequenceSchema = {
33137
33391
  hidden: Interactive.sequenceSchema.hidden,
33138
33392
  showInTimeline: Interactive.sequenceSchema.showInTimeline,
33139
33393
  freeze: Interactive.baseSchema.freeze,
33394
+ trimBefore: Interactive.sequenceSchema.trimBefore,
33140
33395
  layout: Interactive.sequenceSchema.layout
33141
33396
  };
33142
33397
  var SeriesSequenceInner = forwardRef14(({
@@ -33732,6 +33987,7 @@ var VideoForwardingFunction = (props2, ref) => {
33732
33987
  const { loop, ...propsOtherThanLoop } = props2;
33733
33988
  const { fps } = useVideoConfig();
33734
33989
  const environment = useRemotionEnvironment();
33990
+ const shouldPauseWhenBuffering = resolveV5Default(pauseWhenBuffering);
33735
33991
  if (environment.isClientSideRendering) {
33736
33992
  throw new Error("<Html5Video> is not supported in @remotion/web-renderer. Use <Video> from @remotion/media instead. See https://remotion.dev/docs/client-side-rendering/limitations");
33737
33993
  }
@@ -33790,7 +34046,7 @@ var VideoForwardingFunction = (props2, ref) => {
33790
34046
  durationInFrames: trimAfterValue === undefined ? undefined : trimAfterValue / (props2.playbackRate ?? 1),
33791
34047
  name,
33792
34048
  children: /* @__PURE__ */ jsx39(Html5Video, {
33793
- pauseWhenBuffering: pauseWhenBuffering ?? false,
34049
+ pauseWhenBuffering: shouldPauseWhenBuffering,
33794
34050
  onVideoFrame,
33795
34051
  ...otherProps,
33796
34052
  ref,
@@ -33816,7 +34072,7 @@ var VideoForwardingFunction = (props2, ref) => {
33816
34072
  ...otherProps,
33817
34073
  ref,
33818
34074
  onVideoFrame: onVideoFrame ?? null,
33819
- pauseWhenBuffering: pauseWhenBuffering ?? false,
34075
+ pauseWhenBuffering: shouldPauseWhenBuffering,
33820
34076
  onDuration,
33821
34077
  _remotionInternalStack: stack ?? null,
33822
34078
  _remotionInternalNativeLoopPassed: _remotionInternalNativeLoopPassed ?? false,
@@ -34209,7 +34465,9 @@ var makeShapeSchema = (shapeFields) => {
34209
34465
  defaultValue: "#0b84ff",
34210
34466
  description: "Fill"
34211
34467
  }),
34212
- ...Internals.transformSchema
34468
+ ...Internals.transformSchema,
34469
+ ...Interactive.backgroundSchema,
34470
+ ...Interactive.borderSchema
34213
34471
  };
34214
34472
  };
34215
34473
  var arrowSchema = makeShapeSchema({