@remotion/promo-pages 4.0.445 → 4.0.447

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/Homepage.js CHANGED
@@ -2042,7 +2042,7 @@ var getComponentsToAddStacksTo = () => componentsToAddStacksTo;
2042
2042
  var addSequenceStackTraces = (component) => {
2043
2043
  componentsToAddStacksTo.push(component);
2044
2044
  };
2045
- var VERSION = "4.0.445";
2045
+ var VERSION = "4.0.447";
2046
2046
  var checkMultipleRemotionVersions = () => {
2047
2047
  if (typeof globalThis === "undefined") {
2048
2048
  return;
@@ -29731,8 +29731,10 @@ var videoIteratorManager = ({
29731
29731
  let framesRendered = 0;
29732
29732
  let currentDelayHandle = null;
29733
29733
  if (canvas) {
29734
- canvas.width = videoTrack.displayWidth;
29735
- canvas.height = videoTrack.displayHeight;
29734
+ if (canvas.width !== videoTrack.displayWidth || canvas.height !== videoTrack.displayHeight) {
29735
+ canvas.width = videoTrack.displayWidth;
29736
+ canvas.height = videoTrack.displayHeight;
29737
+ }
29736
29738
  }
29737
29739
  const canvasSink = new CanvasSink(videoTrack, {
29738
29740
  poolSize: 2,
@@ -32993,26 +32995,58 @@ var audioSchema = {
32993
32995
  loop: { type: "boolean", default: false, description: "Loop" }
32994
32996
  };
32995
32997
  var AudioInner = (props) => {
32996
- const { name, stack, showInTimeline, controls, ...otherProps } = props;
32998
+ const {
32999
+ name,
33000
+ stack,
33001
+ showInTimeline,
33002
+ controls,
33003
+ from,
33004
+ durationInFrames,
33005
+ ...otherProps
33006
+ } = props;
32997
33007
  const environment = useRemotionEnvironment();
32998
33008
  if (typeof props.src !== "string") {
32999
33009
  throw new TypeError(`The \`<Audio>\` tag requires a string for \`src\`, but got ${JSON.stringify(props.src)} instead.`);
33000
33010
  }
33001
33011
  validateMediaProps2({ playbackRate: props.playbackRate, volume: props.volume }, "Audio");
33002
- if (environment.isRendering) {
33003
- return /* @__PURE__ */ jsx313(AudioForRendering2, {
33012
+ return /* @__PURE__ */ jsx313(Sequence, {
33013
+ layout: "none",
33014
+ from: from ?? 0,
33015
+ durationInFrames: durationInFrames ?? Infinity,
33016
+ showInTimeline: false,
33017
+ children: environment.isRendering ? /* @__PURE__ */ jsx313(AudioForRendering2, {
33004
33018
  ...otherProps
33005
- });
33006
- }
33007
- return /* @__PURE__ */ jsx313(AudioForPreview2, {
33008
- name,
33009
- ...otherProps,
33010
- stack: stack ?? null,
33011
- controls
33019
+ }) : /* @__PURE__ */ jsx313(AudioForPreview2, {
33020
+ name,
33021
+ ...otherProps,
33022
+ stack: stack ?? null,
33023
+ controls
33024
+ })
33012
33025
  });
33013
33026
  };
33014
33027
  var Audio2 = Internals.wrapInSchema(AudioInner, audioSchema);
33015
33028
  Internals.addSequenceStackTraces(Audio2);
33029
+ var cache2 = new Map;
33030
+ var cacheVideoFrame = (src, sourceCanvas) => {
33031
+ const { width, height } = sourceCanvas;
33032
+ if (width === 0 || height === 0) {
33033
+ return;
33034
+ }
33035
+ let cached = cache2.get(src);
33036
+ if (!cached || cached.width !== width || cached.height !== height) {
33037
+ cached = new OffscreenCanvas(width, height);
33038
+ cache2.set(src, cached);
33039
+ }
33040
+ const ctx = cached.getContext("2d");
33041
+ if (!ctx) {
33042
+ return;
33043
+ }
33044
+ ctx.clearRect(0, 0, width, height);
33045
+ ctx.drawImage(sourceCanvas, 0, 0);
33046
+ };
33047
+ var getCachedVideoFrame = (src) => {
33048
+ return cache2.get(src) ?? null;
33049
+ };
33016
33050
  var OBJECT_FIT_CLASS_PATTERN = /\bobject-(contain|cover|fill|none|scale-down)\b/;
33017
33051
  var warnedStyle = false;
33018
33052
  var warnedClassName = false;
@@ -33068,7 +33102,8 @@ var VideoForPreviewAssertedShowing = ({
33068
33102
  onError,
33069
33103
  credentials,
33070
33104
  controls,
33071
- objectFit: objectFitProp
33105
+ objectFit: objectFitProp,
33106
+ _experimentalInitiallyDrawCachedFrame
33072
33107
  }) => {
33073
33108
  const src = usePreload22(unpreloadedSrc);
33074
33109
  const canvasRef = useRef212(null);
@@ -33145,6 +33180,44 @@ var VideoForPreviewAssertedShowing = ({
33145
33180
  const initialMuted = useRef212(effectiveMuted);
33146
33181
  const initialDurationInFrames = useRef212(videoConfig.durationInFrames);
33147
33182
  const initialSequenceOffset = useRef212(sequenceOffset);
33183
+ const hasDrawnRealFrameRef = useRef212(false);
33184
+ const isPremountingRef = useRef212(isPremounting);
33185
+ isPremountingRef.current = isPremounting;
33186
+ useLayoutEffect34(() => {
33187
+ if (!_experimentalInitiallyDrawCachedFrame) {
33188
+ return;
33189
+ }
33190
+ const canvas = canvasRef.current;
33191
+ if (!canvas) {
33192
+ return;
33193
+ }
33194
+ const cached = getCachedVideoFrame(src);
33195
+ if (!cached) {
33196
+ return;
33197
+ }
33198
+ canvas.width = cached.width;
33199
+ canvas.height = cached.height;
33200
+ const ctx = canvas.getContext("2d", {
33201
+ alpha: true,
33202
+ desynchronized: true
33203
+ });
33204
+ if (!ctx) {
33205
+ return;
33206
+ }
33207
+ ctx.drawImage(cached, 0, 0);
33208
+ }, [_experimentalInitiallyDrawCachedFrame, src]);
33209
+ useLayoutEffect34(() => {
33210
+ if (!_experimentalInitiallyDrawCachedFrame) {
33211
+ return;
33212
+ }
33213
+ const canvas = canvasRef.current;
33214
+ return () => {
33215
+ if (!canvas || !hasDrawnRealFrameRef.current || isPremountingRef.current) {
33216
+ return;
33217
+ }
33218
+ cacheVideoFrame(src, canvas);
33219
+ };
33220
+ }, [_experimentalInitiallyDrawCachedFrame, src]);
33148
33221
  useEffect312(() => {
33149
33222
  if (!sharedAudioContext)
33150
33223
  return;
@@ -33213,6 +33286,7 @@ var VideoForPreviewAssertedShowing = ({
33213
33286
  if (result.type === "success") {
33214
33287
  setMediaPlayerReady(true);
33215
33288
  setMediaDurationInSeconds(result.durationInSeconds);
33289
+ hasDrawnRealFrameRef.current = true;
33216
33290
  }
33217
33291
  }).catch((error2) => {
33218
33292
  const [action, errorToUse] = callOnErrorAndResolve({
@@ -33250,6 +33324,7 @@ var VideoForPreviewAssertedShowing = ({
33250
33324
  }
33251
33325
  setMediaPlayerReady(false);
33252
33326
  setShouldFallbackToNativeVideo(false);
33327
+ hasDrawnRealFrameRef.current = false;
33253
33328
  };
33254
33329
  }, [
33255
33330
  audioStreamIndex,
@@ -33748,7 +33823,8 @@ var InnerVideo = ({
33748
33823
  onError,
33749
33824
  credentials,
33750
33825
  controls,
33751
- objectFit
33826
+ objectFit,
33827
+ _experimentalInitiallyDrawCachedFrame
33752
33828
  }) => {
33753
33829
  const environment = useRemotionEnvironment();
33754
33830
  if (typeof src !== "string") {
@@ -33820,7 +33896,8 @@ var InnerVideo = ({
33820
33896
  onError,
33821
33897
  credentials,
33822
33898
  controls,
33823
- objectFit
33899
+ objectFit,
33900
+ _experimentalInitiallyDrawCachedFrame
33824
33901
  });
33825
33902
  };
33826
33903
  var VideoInner = ({
@@ -33851,38 +33928,48 @@ var VideoInner = ({
33851
33928
  onError,
33852
33929
  credentials,
33853
33930
  controls,
33854
- objectFit
33931
+ objectFit,
33932
+ _experimentalInitiallyDrawCachedFrame,
33933
+ from,
33934
+ durationInFrames
33855
33935
  }) => {
33856
33936
  const fallbackLogLevel = Internals.useLogLevel();
33857
- return /* @__PURE__ */ jsx65(InnerVideo, {
33858
- audioStreamIndex: audioStreamIndex ?? 0,
33859
- className: className2,
33860
- delayRenderRetries: delayRenderRetries ?? null,
33861
- delayRenderTimeoutInMilliseconds: delayRenderTimeoutInMilliseconds ?? null,
33862
- disallowFallbackToOffthreadVideo: disallowFallbackToOffthreadVideo ?? false,
33863
- fallbackOffthreadVideoProps: fallbackOffthreadVideoProps ?? {},
33864
- logLevel: logLevel ?? fallbackLogLevel,
33865
- loop: loop ?? false,
33866
- loopVolumeCurveBehavior: loopVolumeCurveBehavior ?? "repeat",
33867
- muted: muted ?? false,
33868
- name,
33869
- onVideoFrame,
33870
- playbackRate: playbackRate ?? 1,
33871
- showInTimeline: showInTimeline ?? true,
33872
- src,
33873
- style: style2 ?? {},
33874
- trimAfter,
33875
- trimBefore,
33876
- volume: volume ?? 1,
33877
- toneFrequency: toneFrequency ?? 1,
33878
- stack,
33879
- debugOverlay: debugOverlay ?? false,
33880
- debugAudioScheduling: debugAudioScheduling ?? false,
33881
- headless: headless ?? false,
33882
- onError,
33883
- credentials,
33884
- controls,
33885
- objectFit: objectFit ?? "contain"
33937
+ return /* @__PURE__ */ jsx65(Sequence, {
33938
+ layout: "none",
33939
+ from: from ?? 0,
33940
+ durationInFrames: durationInFrames ?? Infinity,
33941
+ showInTimeline: false,
33942
+ children: /* @__PURE__ */ jsx65(InnerVideo, {
33943
+ audioStreamIndex: audioStreamIndex ?? 0,
33944
+ className: className2,
33945
+ delayRenderRetries: delayRenderRetries ?? null,
33946
+ delayRenderTimeoutInMilliseconds: delayRenderTimeoutInMilliseconds ?? null,
33947
+ disallowFallbackToOffthreadVideo: disallowFallbackToOffthreadVideo ?? false,
33948
+ fallbackOffthreadVideoProps: fallbackOffthreadVideoProps ?? {},
33949
+ logLevel: logLevel ?? fallbackLogLevel,
33950
+ loop: loop ?? false,
33951
+ loopVolumeCurveBehavior: loopVolumeCurveBehavior ?? "repeat",
33952
+ muted: muted ?? false,
33953
+ name,
33954
+ onVideoFrame,
33955
+ playbackRate: playbackRate ?? 1,
33956
+ showInTimeline: showInTimeline ?? true,
33957
+ src,
33958
+ style: style2 ?? {},
33959
+ trimAfter,
33960
+ trimBefore,
33961
+ volume: volume ?? 1,
33962
+ toneFrequency: toneFrequency ?? 1,
33963
+ stack,
33964
+ debugOverlay: debugOverlay ?? false,
33965
+ debugAudioScheduling: debugAudioScheduling ?? false,
33966
+ headless: headless ?? false,
33967
+ onError,
33968
+ credentials,
33969
+ controls,
33970
+ objectFit: objectFit ?? "contain",
33971
+ _experimentalInitiallyDrawCachedFrame: _experimentalInitiallyDrawCachedFrame ?? false
33972
+ })
33886
33973
  });
33887
33974
  };
33888
33975
  var Video = Internals.wrapInSchema(VideoInner, videoSchema);
@@ -35189,7 +35276,7 @@ import {
35189
35276
  import { BufferTarget, StreamTarget } from "mediabunny";
35190
35277
 
35191
35278
  // ../core/dist/esm/version.mjs
35192
- var VERSION2 = "4.0.445";
35279
+ var VERSION2 = "4.0.447";
35193
35280
 
35194
35281
  // ../web-renderer/dist/esm/index.mjs
35195
35282
  import { AudioSample, VideoSample } from "mediabunny";
@@ -35745,6 +35832,80 @@ var createAudioSampleSource = ({
35745
35832
  });
35746
35833
  return { audioSampleSource, [Symbol.dispose]: () => audioSampleSource.close() };
35747
35834
  };
35835
+ var supportsNativeHtmlInCanvas = () => {
35836
+ if (typeof document === "undefined") {
35837
+ return false;
35838
+ }
35839
+ const ctx = document.createElement("canvas").getContext("2d");
35840
+ return typeof ctx?.drawElementImage === "function";
35841
+ };
35842
+ var setupHtmlInCanvas = ({
35843
+ wrapper,
35844
+ div,
35845
+ width: width2,
35846
+ height: height2
35847
+ }) => {
35848
+ if (!supportsNativeHtmlInCanvas()) {
35849
+ return null;
35850
+ }
35851
+ const layoutCanvas = document.createElement("canvas");
35852
+ layoutCanvas.layoutSubtree = true;
35853
+ layoutCanvas.width = width2;
35854
+ layoutCanvas.height = height2;
35855
+ layoutCanvas.style.position = "absolute";
35856
+ layoutCanvas.style.top = "0";
35857
+ layoutCanvas.style.left = "0";
35858
+ layoutCanvas.style.width = `${width2}px`;
35859
+ layoutCanvas.style.height = `${height2}px`;
35860
+ layoutCanvas.style.visibility = "visible";
35861
+ const maybeCtx = layoutCanvas.getContext("2d");
35862
+ if (!maybeCtx || typeof maybeCtx.drawElementImage !== "function") {
35863
+ return null;
35864
+ }
35865
+ if (typeof layoutCanvas.requestPaint !== "function") {
35866
+ return null;
35867
+ }
35868
+ wrapper.removeChild(div);
35869
+ layoutCanvas.appendChild(div);
35870
+ wrapper.appendChild(layoutCanvas);
35871
+ return { layoutCanvas, ctx: maybeCtx };
35872
+ };
35873
+ var waitForPaint = (layoutCanvas) => {
35874
+ return new Promise((resolve) => {
35875
+ layoutCanvas.addEventListener("paint", () => resolve(), { once: true });
35876
+ layoutCanvas.requestPaint();
35877
+ });
35878
+ };
35879
+ var drawWithHtmlInCanvas = async ({
35880
+ htmlInCanvasContext,
35881
+ element,
35882
+ scaledWidth,
35883
+ scaledHeight
35884
+ }) => {
35885
+ const { ctx, layoutCanvas } = htmlInCanvasContext;
35886
+ await waitForPaint(layoutCanvas);
35887
+ layoutCanvas.width = scaledWidth;
35888
+ layoutCanvas.height = scaledHeight;
35889
+ ctx.reset();
35890
+ ctx.drawElementImage(element, 0, 0, scaledWidth, scaledHeight);
35891
+ const offscreen = new OffscreenCanvas(scaledWidth, scaledHeight);
35892
+ const offCtx = offscreen.getContext("2d");
35893
+ if (!offCtx) {
35894
+ throw new Error("Could not get offscreen context");
35895
+ }
35896
+ offCtx.drawImage(layoutCanvas, 0, 0);
35897
+ return offCtx;
35898
+ };
35899
+ var teardownHtmlInCanvas = ({
35900
+ htmlInCanvasContext,
35901
+ wrapper,
35902
+ div
35903
+ }) => {
35904
+ const { layoutCanvas } = htmlInCanvasContext;
35905
+ layoutCanvas.removeChild(div);
35906
+ wrapper.removeChild(layoutCanvas);
35907
+ wrapper.appendChild(div);
35908
+ };
35748
35909
  var UpdateTime = ({
35749
35910
  children,
35750
35911
  audioEnabled,
@@ -35857,7 +36018,8 @@ function createScaffold({
35857
36018
  audioEnabled,
35858
36019
  videoEnabled,
35859
36020
  defaultCodec,
35860
- defaultOutName
36021
+ defaultOutName,
36022
+ allowHtmlInCanvas
35861
36023
  }) {
35862
36024
  if (!ReactDOM6.createRoot) {
35863
36025
  throw new Error("@remotion/web-renderer requires React 18 or higher");
@@ -35883,6 +36045,7 @@ function createScaffold({
35883
36045
  const cleanupCSS = Internals.CSSUtils.injectCSS(Internals.CSSUtils.makeDefaultPreviewCSS(`.${scaffoldClassName}`, "white"));
35884
36046
  wrapper.appendChild(div);
35885
36047
  document.body.appendChild(wrapper);
36048
+ const htmlInCanvasContext = allowHtmlInCanvas ? setupHtmlInCanvas({ wrapper, div, width: width2, height: height2 }) : null;
35886
36049
  const errorHolder = { error: null };
35887
36050
  const root = ReactDOM6.createRoot(div, {
35888
36051
  onUncaughtError: (err, errorInfo) => {
@@ -35973,8 +36136,12 @@ function createScaffold({
35973
36136
  delayRenderScope,
35974
36137
  div,
35975
36138
  errorHolder,
36139
+ htmlInCanvasContext,
35976
36140
  [Symbol.dispose]: () => {
35977
36141
  root.unmount();
36142
+ if (htmlInCanvasContext) {
36143
+ teardownHtmlInCanvas({ htmlInCanvasContext, wrapper, div });
36144
+ }
35978
36145
  div.remove();
35979
36146
  wrapper.remove();
35980
36147
  cleanupCSS();
@@ -38718,10 +38885,32 @@ var createLayer = async ({
38718
38885
  logLevel,
38719
38886
  internalState,
38720
38887
  onlyBackgroundClipText,
38721
- cutout
38888
+ cutout,
38889
+ htmlInCanvasContext,
38890
+ onHtmlInCanvasLayerOutcome
38722
38891
  }) => {
38723
38892
  const scaledWidth = Math.ceil(cutout.width * scale);
38724
38893
  const scaledHeight = Math.ceil(cutout.height * scale);
38894
+ if (!onlyBackgroundClipText && element instanceof HTMLElement && htmlInCanvasContext && onHtmlInCanvasLayerOutcome) {
38895
+ try {
38896
+ const offCtx = await drawWithHtmlInCanvas({
38897
+ htmlInCanvasContext,
38898
+ element,
38899
+ scaledWidth,
38900
+ scaledHeight
38901
+ });
38902
+ onHtmlInCanvasLayerOutcome({ native: true });
38903
+ return offCtx;
38904
+ } catch (err) {
38905
+ const detail = err instanceof Error ? err.message : JSON.stringify(err);
38906
+ onHtmlInCanvasLayerOutcome({
38907
+ native: false,
38908
+ reason: `drawElementImage failed (${detail}); falling back to the built-in DOM composer.`,
38909
+ shouldWarn: true
38910
+ });
38911
+ Internals.Log.verbose({ logLevel, tag: "@remotion/web-renderer" }, "HTML-in-canvas capture failed, falling back to software compose", err);
38912
+ }
38913
+ }
38725
38914
  const canvas = new OffscreenCanvas(scaledWidth, scaledHeight);
38726
38915
  const context = canvas.getContext("2d");
38727
38916
  if (!context) {
@@ -38952,11 +39141,24 @@ var internalRenderMediaOnWeb = async ({
38952
39141
  licenseKey,
38953
39142
  muted,
38954
39143
  scale,
38955
- isProduction
39144
+ isProduction,
39145
+ allowHtmlInCanvas
38956
39146
  }) => {
38957
39147
  let __stack2 = [];
38958
39148
  try {
38959
39149
  validateScale(scale);
39150
+ let htmlInCanvasLayerOutcomeReported = false;
39151
+ const onHtmlInCanvasLayerOutcome = (outcome) => {
39152
+ if (htmlInCanvasLayerOutcomeReported) {
39153
+ return;
39154
+ }
39155
+ htmlInCanvasLayerOutcomeReported = true;
39156
+ if (outcome.native) {
39157
+ Internals.Log.warn({ logLevel, tag: "@remotion/web-renderer" }, "Using Chromium experimental HTML-in-canvas (drawElementImage) for video frames. See https://github.com/WICG/html-in-canvas");
39158
+ } else if (outcome.shouldWarn) {
39159
+ Internals.Log.warn({ logLevel, tag: "@remotion/web-renderer" }, `Not using HTML-in-canvas: ${outcome.reason}`);
39160
+ }
39161
+ };
38960
39162
  const outputTarget = userDesiredOutputTarget === null ? await canUseWebFsWriter() ? "web-fs" : "arraybuffer" : userDesiredOutputTarget;
38961
39163
  if (outputTarget === "web-fs") {
38962
39164
  await cleanupStaleOpfsFiles();
@@ -39022,9 +39224,38 @@ var internalRenderMediaOnWeb = async ({
39022
39224
  videoEnabled,
39023
39225
  initialFrame: 0,
39024
39226
  defaultCodec: resolved.defaultCodec,
39025
- defaultOutName: resolved.defaultOutName
39227
+ defaultOutName: resolved.defaultOutName,
39228
+ allowHtmlInCanvas
39026
39229
  }), 0);
39027
- const { delayRenderScope, div, timeUpdater, collectAssets, errorHolder } = scaffold;
39230
+ const {
39231
+ delayRenderScope,
39232
+ div,
39233
+ timeUpdater,
39234
+ collectAssets,
39235
+ errorHolder,
39236
+ htmlInCanvasContext
39237
+ } = scaffold;
39238
+ if (allowHtmlInCanvas && !htmlInCanvasContext) {
39239
+ if (!supportsNativeHtmlInCanvas()) {
39240
+ onHtmlInCanvasLayerOutcome({
39241
+ native: false,
39242
+ reason: "This browser does not expose CanvasRenderingContext2D.prototype.drawElementImage. In Chromium, enable chrome://flags/#canvas-draw-element and use a version that ships the API.",
39243
+ shouldWarn: false
39244
+ });
39245
+ } else {
39246
+ onHtmlInCanvasLayerOutcome({
39247
+ native: false,
39248
+ reason: "drawElementImage is available but canvas.requestPaint() is missing. Use a Chromium version that ships requestPaint.",
39249
+ shouldWarn: true
39250
+ });
39251
+ }
39252
+ } else if (!allowHtmlInCanvas) {
39253
+ onHtmlInCanvasLayerOutcome({
39254
+ native: false,
39255
+ reason: "allowHtmlInCanvas is false; using the built-in DOM composer.",
39256
+ shouldWarn: false
39257
+ });
39258
+ }
39028
39259
  const internalState = __using2(__stack2, makeInternalState(), 0);
39029
39260
  const keepalive = __using2(__stack2, createBackgroundKeepalive({
39030
39261
  fps: resolved.fps,
@@ -39137,7 +39368,9 @@ var internalRenderMediaOnWeb = async ({
39137
39368
  logLevel,
39138
39369
  internalState,
39139
39370
  onlyBackgroundClipText: false,
39140
- cutout: new DOMRect(0, 0, resolved.width, resolved.height)
39371
+ cutout: new DOMRect(0, 0, resolved.width, resolved.height),
39372
+ htmlInCanvasContext,
39373
+ onHtmlInCanvasLayerOutcome: htmlInCanvasContext ? onHtmlInCanvasLayerOutcome : undefined
39141
39374
  });
39142
39375
  internalState.addCreateFrameTime(performance.now() - createFrameStart);
39143
39376
  layerCanvas = layer.canvas;
@@ -39301,7 +39534,8 @@ var renderMediaOnWeb = (options2) => {
39301
39534
  licenseKey: options2.licenseKey ?? null,
39302
39535
  muted: options2.muted ?? false,
39303
39536
  scale: options2.scale ?? 1,
39304
- isProduction: options2.isProduction ?? true
39537
+ isProduction: options2.isProduction ?? true,
39538
+ allowHtmlInCanvas: options2.allowHtmlInCanvas ?? false
39305
39539
  }));
39306
39540
  return onlyOneRenderAtATimeQueue.ref;
39307
39541
  };
@@ -1003,7 +1003,7 @@ var useIsPlayer = () => {
1003
1003
  function truthy(value) {
1004
1004
  return Boolean(value);
1005
1005
  }
1006
- var VERSION = "4.0.434";
1006
+ var VERSION = "4.0.436";
1007
1007
  var checkMultipleRemotionVersions = () => {
1008
1008
  if (typeof globalThis === "undefined") {
1009
1009
  return;
@@ -4081,7 +4081,7 @@ var useBasicMediaInTimeline = ({
4081
4081
  const videoConfig = useVideoConfig();
4082
4082
  const [initialVolume] = useState10(() => volume);
4083
4083
  const mediaDuration = calculateMediaDuration({
4084
- mediaDurationInFrames: videoConfig.durationInFrames,
4084
+ mediaDurationInFrames: videoConfig.durationInFrames + (trimBefore ?? 0),
4085
4085
  playbackRate,
4086
4086
  trimBefore,
4087
4087
  trimAfter
@@ -23232,7 +23232,7 @@ var GitHubStars = () => {
23232
23232
  width: "45px"
23233
23233
  }),
23234
23234
  /* @__PURE__ */ jsx50(StatItemContent, {
23235
- content: "38k",
23235
+ content: "39k",
23236
23236
  width: "80px",
23237
23237
  fontSize: "2.5rem",
23238
23238
  fontWeight: "bold"
@@ -28459,7 +28459,12 @@ var setGlobalTimeAnchor = ({
28459
28459
  }
28460
28460
  audioSyncAnchor.value = newAnchor;
28461
28461
  };
28462
- var makeAudioIterator = (startFromSecond, maximumTimestamp, cache2, debugAudioScheduling) => {
28462
+ var makeAudioIterator = ({
28463
+ startFromSecond,
28464
+ maximumTimestamp,
28465
+ cache: cache2,
28466
+ debugAudioScheduling
28467
+ }) => {
28463
28468
  let destroyed = false;
28464
28469
  const iterator = cache2.makeIteratorOrUsePrewarmed(startFromSecond, maximumTimestamp);
28465
28470
  const queuedAudioNodes = [];
@@ -28469,15 +28474,15 @@ var makeAudioIterator = (startFromSecond, maximumTimestamp, cache2, debugAudioSc
28469
28474
  const cleanupAudioQueue = (audioContext) => {
28470
28475
  for (const node of queuedAudioNodes) {
28471
28476
  try {
28472
- const currentlyHearing = audioContext.getOutputTimestamp().contextTime;
28473
- const nodeEndTime = node.scheduledTime + node.buffer.duration / node.playbackRate;
28474
- const isAlreadyPlaying = node.scheduledTime - ALLOWED_GLOBAL_TIME_ANCHOR_SHIFT < audioContext.currentTime;
28475
- const shouldKeep = isAlreadyPlaying;
28476
- if (shouldKeep) {
28477
+ const isAlreadyPlaying = node.scheduledTime - ALLOWED_GLOBAL_TIME_ANCHOR_SHIFT < audioContext.audioContext.currentTime;
28478
+ const wasScheduledForThisAnchor = node.scheduledAtAnchor === audioContext.audioSyncAnchor.value;
28479
+ if (isAlreadyPlaying && wasScheduledForThisAnchor) {
28477
28480
  continue;
28478
28481
  }
28479
28482
  if (debugAudioScheduling) {
28480
- Internals.Log.info({ logLevel: "trace", tag: "audio-scheduling" }, `Stopping node ${node.timestamp.toFixed(3)}, currently hearing = ${currentlyHearing.toFixed(3)} currentTime = ${audioContext.currentTime.toFixed(3)} nodeEndTime = ${nodeEndTime.toFixed(3)} scheduledTime = ${node.scheduledTime.toFixed(3)}`);
28483
+ const currentlyHearing = audioContext.audioContext.getOutputTimestamp().contextTime;
28484
+ const nodeEndTime = node.scheduledTime + node.buffer.duration / node.playbackRate;
28485
+ Internals.Log.info({ logLevel: "trace", tag: "audio-scheduling" }, `Stopping node ${node.timestamp.toFixed(3)}, currently hearing = ${currentlyHearing.toFixed(3)} currentTime = ${audioContext.audioContext.currentTime.toFixed(3)} nodeEndTime = ${nodeEndTime.toFixed(3)} scheduledTime = ${node.scheduledTime.toFixed(3)}`);
28481
28486
  }
28482
28487
  node.node.stop();
28483
28488
  } catch {}
@@ -28638,14 +28643,16 @@ var makeAudioIterator = (startFromSecond, maximumTimestamp, cache2, debugAudioSc
28638
28643
  timestamp,
28639
28644
  buffer,
28640
28645
  scheduledTime,
28641
- playbackRate
28646
+ playbackRate,
28647
+ scheduledAtAnchor
28642
28648
  }) => {
28643
28649
  queuedAudioNodes.push({
28644
28650
  node,
28645
28651
  timestamp,
28646
28652
  buffer,
28647
28653
  scheduledTime,
28648
- playbackRate
28654
+ playbackRate,
28655
+ scheduledAtAnchor
28649
28656
  });
28650
28657
  },
28651
28658
  removeQueuedAudioNode: (node) => {
@@ -28884,8 +28891,8 @@ var audioIteratorManager = ({
28884
28891
  }) => {
28885
28892
  let muted = initialMuted;
28886
28893
  let currentVolume = 1;
28887
- const gainNode = sharedAudioContext.createGain();
28888
- gainNode.connect(sharedAudioContext.destination);
28894
+ const gainNode = sharedAudioContext.audioContext.createGain();
28895
+ gainNode.connect(sharedAudioContext.audioContext.destination);
28889
28896
  const audioSink = new AudioBufferSink(audioTrack);
28890
28897
  const prewarmedAudioIteratorCache = makePrewarmedAudioIteratorCache(audioSink);
28891
28898
  let audioBufferIterator = null;
@@ -28901,13 +28908,13 @@ var audioIteratorManager = ({
28901
28908
  if (!audioBufferIterator) {
28902
28909
  throw new Error("Audio buffer iterator not found");
28903
28910
  }
28904
- if (sharedAudioContext.state !== "running") {
28911
+ if (sharedAudioContext.audioContext.state !== "running") {
28905
28912
  throw new Error("Tried to schedule node while audio context is not running");
28906
28913
  }
28907
28914
  if (muted) {
28908
28915
  return;
28909
28916
  }
28910
- const node = sharedAudioContext.createBufferSource();
28917
+ const node = sharedAudioContext.audioContext.createBufferSource();
28911
28918
  node.buffer = buffer;
28912
28919
  node.playbackRate.value = playbackRate;
28913
28920
  node.connect(gainNode);
@@ -28925,7 +28932,8 @@ var audioIteratorManager = ({
28925
28932
  timestamp: mediaTimestamp,
28926
28933
  buffer,
28927
28934
  scheduledTime: started.scheduledTime,
28928
- playbackRate
28935
+ playbackRate,
28936
+ scheduledAtAnchor: sharedAudioContext.audioSyncAnchor.value
28929
28937
  });
28930
28938
  node.onended = () => {
28931
28939
  setTimeout(() => {
@@ -28972,7 +28980,7 @@ var audioIteratorManager = ({
28972
28980
  if (buffer.timestamp >= endTime) {
28973
28981
  return;
28974
28982
  }
28975
- if (getIsPlaying() && sharedAudioContext.state === "running" && (sharedAudioContext.getOutputTimestamp().contextTime ?? 0) > 0) {
28983
+ if (getIsPlaying() && sharedAudioContext.audioContext.state === "running" && (sharedAudioContext.audioContext.getOutputTimestamp().contextTime ?? 0) > 0) {
28976
28984
  resumeScheduledAudioChunks({
28977
28985
  playbackRate,
28978
28986
  scheduleAudioNode,
@@ -29012,7 +29020,12 @@ var audioIteratorManager = ({
29012
29020
  audioBufferIterator?.destroy(sharedAudioContext);
29013
29021
  const delayHandle = __using(__stack, delayPlaybackHandleIfNotPremounting(), 0);
29014
29022
  currentDelayHandle = delayHandle;
29015
- const iterator = makeAudioIterator(startFromSecond, getEndTime(), prewarmedAudioIteratorCache, debugAudioScheduling);
29023
+ const iterator = makeAudioIterator({
29024
+ startFromSecond,
29025
+ maximumTimestamp: getEndTime(),
29026
+ cache: prewarmedAudioIteratorCache,
29027
+ debugAudioScheduling
29028
+ });
29016
29029
  audioIteratorsCreated++;
29017
29030
  audioBufferIterator = iterator;
29018
29031
  try {
@@ -29096,7 +29109,7 @@ var audioIteratorManager = ({
29096
29109
  }
29097
29110
  const queuedPeriod = audioBufferIterator.getQueuedPeriod();
29098
29111
  const queuedPeriodMinusLatency = queuedPeriod ? {
29099
- from: queuedPeriod.from - ALLOWED_GLOBAL_TIME_ANCHOR_SHIFT - sharedAudioContext.baseLatency - sharedAudioContext.outputLatency,
29112
+ from: queuedPeriod.from - ALLOWED_GLOBAL_TIME_ANCHOR_SHIFT - sharedAudioContext.audioContext.baseLatency - sharedAudioContext.audioContext.outputLatency,
29100
29113
  until: queuedPeriod.until
29101
29114
  } : null;
29102
29115
  const currentTimeIsAlreadyQueued = isAlreadyQueued(newTime, queuedPeriodMinusLatency);
@@ -29521,7 +29534,8 @@ class MediaPlayer {
29521
29534
  durationInFrames,
29522
29535
  onVideoFrameCallback,
29523
29536
  playing,
29524
- sequenceOffset
29537
+ sequenceOffset,
29538
+ credentials
29525
29539
  }) {
29526
29540
  this.canvas = canvas ?? null;
29527
29541
  this.src = src;
@@ -29545,7 +29559,9 @@ class MediaPlayer {
29545
29559
  this.playing = playing;
29546
29560
  this.sequenceOffset = sequenceOffset;
29547
29561
  this.input = new Input2({
29548
- source: new UrlSource(this.src),
29562
+ source: new UrlSource(this.src, credentials ? {
29563
+ requestInit: { credentials }
29564
+ } : undefined),
29549
29565
  formats: ALL_FORMATS
29550
29566
  });
29551
29567
  if (canvas) {
@@ -29659,7 +29675,7 @@ class MediaPlayer {
29659
29675
  this.audioIteratorManager = audioIteratorManager({
29660
29676
  audioTrack,
29661
29677
  delayPlaybackHandleIfNotPremounting: this.delayPlaybackHandleIfNotPremounting,
29662
- sharedAudioContext: this.sharedAudioContext.audioContext,
29678
+ sharedAudioContext: this.sharedAudioContext,
29663
29679
  getIsLooping: () => this.loop,
29664
29680
  getEndTime: () => this.getEndTime(),
29665
29681
  getStartTime: () => this.getStartTime(),
@@ -30328,6 +30344,7 @@ var AudioForPreviewAssertedShowing = ({
30328
30344
  fallbackHtml5AudioProps,
30329
30345
  debugAudioScheduling,
30330
30346
  onError,
30347
+ credentials,
30331
30348
  controls
30332
30349
  }) => {
30333
30350
  const videoConfig = useUnsafeVideoConfig2();
@@ -30454,7 +30471,8 @@ var AudioForPreviewAssertedShowing = ({
30454
30471
  durationInFrames: videoConfig.durationInFrames,
30455
30472
  onVideoFrameCallback: null,
30456
30473
  playing: initialPlaying.current,
30457
- sequenceOffset: initialSequenceOffset.current
30474
+ sequenceOffset: initialSequenceOffset.current,
30475
+ credentials
30458
30476
  });
30459
30477
  mediaPlayerRef.current = player;
30460
30478
  player.initialize(currentTimeRef.current, initialMuted.current).then((result) => {
@@ -30546,7 +30564,8 @@ var AudioForPreviewAssertedShowing = ({
30546
30564
  debugAudioScheduling,
30547
30565
  buffer,
30548
30566
  onError,
30549
- videoConfig.durationInFrames
30567
+ videoConfig.durationInFrames,
30568
+ credentials
30550
30569
  ]);
30551
30570
  if (shouldFallbackToNativeAudio && !disallowFallbackToHtml5Audio) {
30552
30571
  return /* @__PURE__ */ jsx58(Audio, {
@@ -30589,6 +30608,7 @@ var AudioForPreview2 = ({
30589
30608
  fallbackHtml5AudioProps,
30590
30609
  debugAudioScheduling,
30591
30610
  onError,
30611
+ credentials,
30592
30612
  controls
30593
30613
  }) => {
30594
30614
  const preloadedSrc = usePreload2(src);
@@ -30638,6 +30658,7 @@ var AudioForPreview2 = ({
30638
30658
  toneFrequency,
30639
30659
  debugAudioScheduling: debugAudioScheduling ?? false,
30640
30660
  onError,
30661
+ credentials,
30641
30662
  fallbackHtml5AudioProps,
30642
30663
  controls
30643
30664
  });
@@ -31732,11 +31753,12 @@ var getFormatOrNullOrNetworkError = async (input) => {
31732
31753
  return null;
31733
31754
  }
31734
31755
  };
31735
- var getSinks = async (src) => {
31756
+ var getSinks = async (src, credentials) => {
31736
31757
  const input = new Input22({
31737
31758
  formats: ALL_FORMATS2,
31738
31759
  source: new UrlSource2(src, {
31739
- getRetryDelay
31760
+ getRetryDelay,
31761
+ ...credentials ? { requestInit: { credentials } } : undefined
31740
31762
  })
31741
31763
  });
31742
31764
  const format = await getFormatOrNullOrNetworkError(input);
@@ -31816,15 +31838,16 @@ var getSinks = async (src) => {
31816
31838
  };
31817
31839
  };
31818
31840
  var sinkPromises = {};
31819
- var getSink = (src, logLevel) => {
31820
- let promise = sinkPromises[src];
31841
+ var getSink = (src, logLevel, credentials) => {
31842
+ const cacheKey = credentials ? `${src}::${credentials}` : src;
31843
+ let promise = sinkPromises[cacheKey];
31821
31844
  if (!promise) {
31822
31845
  Internals.Log.verbose({
31823
31846
  logLevel,
31824
31847
  tag: "@remotion/media"
31825
31848
  }, `Sink for ${src} was not found, creating new sink`);
31826
- promise = getSinks(src);
31827
- sinkPromises[src] = promise;
31849
+ promise = getSinks(src, credentials);
31850
+ sinkPromises[cacheKey] = promise;
31828
31851
  }
31829
31852
  return promise;
31830
31853
  };
@@ -31839,9 +31862,10 @@ var extractAudioInternal = async ({
31839
31862
  trimBefore,
31840
31863
  trimAfter,
31841
31864
  fps,
31842
- maxCacheSize
31865
+ maxCacheSize,
31866
+ credentials
31843
31867
  }) => {
31844
- const { getAudio, actualMatroskaTimestamps, isMatroska, getDuration } = await getSink(src, logLevel);
31868
+ const { getAudio, actualMatroskaTimestamps, isMatroska, getDuration } = await getSink(src, logLevel, credentials);
31845
31869
  let mediaDurationInSeconds = null;
31846
31870
  if (loop) {
31847
31871
  mediaDurationInSeconds = await getDuration();
@@ -31964,9 +31988,10 @@ var extractFrameInternal = async ({
31964
31988
  trimBefore,
31965
31989
  playbackRate,
31966
31990
  fps,
31967
- maxCacheSize
31991
+ maxCacheSize,
31992
+ credentials
31968
31993
  }) => {
31969
- const sink = await getSink(src, logLevel);
31994
+ const sink = await getSink(src, logLevel, credentials);
31970
31995
  const [video, mediaDurationInSecondsRaw] = await Promise.all([
31971
31996
  sink.getVideo(),
31972
31997
  loop ? sink.getDuration() : Promise.resolve(null)
@@ -32088,7 +32113,8 @@ var extractFrameAndAudio = async ({
32088
32113
  trimAfter,
32089
32114
  trimBefore,
32090
32115
  fps,
32091
- maxCacheSize
32116
+ maxCacheSize,
32117
+ credentials
32092
32118
  }) => {
32093
32119
  try {
32094
32120
  const [video, audio] = await Promise.all([
@@ -32101,7 +32127,8 @@ var extractFrameAndAudio = async ({
32101
32127
  playbackRate,
32102
32128
  trimBefore,
32103
32129
  fps,
32104
- maxCacheSize
32130
+ maxCacheSize,
32131
+ credentials
32105
32132
  }) : null,
32106
32133
  includeAudio ? extractAudio({
32107
32134
  src,
@@ -32114,7 +32141,8 @@ var extractFrameAndAudio = async ({
32114
32141
  trimAfter,
32115
32142
  fps,
32116
32143
  trimBefore,
32117
- maxCacheSize
32144
+ maxCacheSize,
32145
+ credentials
32118
32146
  }) : null
32119
32147
  ]);
32120
32148
  if (video?.type === "cannot-decode") {
@@ -32195,7 +32223,8 @@ var addBroadcastChannelListener = () => {
32195
32223
  trimAfter: data.trimAfter,
32196
32224
  trimBefore: data.trimBefore,
32197
32225
  fps: data.fps,
32198
- maxCacheSize: data.maxCacheSize
32226
+ maxCacheSize: data.maxCacheSize,
32227
+ credentials: data.credentials
32199
32228
  });
32200
32229
  if (result.type === "cannot-decode") {
32201
32230
  const cannotDecodeResponse = {
@@ -32290,7 +32319,8 @@ var extractFrameViaBroadcastChannel = async ({
32290
32319
  trimAfter,
32291
32320
  trimBefore,
32292
32321
  fps,
32293
- maxCacheSize
32322
+ maxCacheSize,
32323
+ credentials
32294
32324
  }) => {
32295
32325
  if (isClientSideRendering || window.remotion_isMainTab) {
32296
32326
  return extractFrameAndAudio({
@@ -32306,7 +32336,8 @@ var extractFrameViaBroadcastChannel = async ({
32306
32336
  trimAfter,
32307
32337
  trimBefore,
32308
32338
  fps,
32309
- maxCacheSize
32339
+ maxCacheSize,
32340
+ credentials
32310
32341
  });
32311
32342
  }
32312
32343
  await waitForMainTabToBeReady(window.remotion_broadcastChannel);
@@ -32383,7 +32414,8 @@ var extractFrameViaBroadcastChannel = async ({
32383
32414
  trimAfter,
32384
32415
  trimBefore,
32385
32416
  fps,
32386
- maxCacheSize
32417
+ maxCacheSize,
32418
+ credentials
32387
32419
  };
32388
32420
  window.remotion_broadcastChannel.postMessage(request);
32389
32421
  let timeoutId;
@@ -32418,7 +32450,8 @@ var AudioForRendering2 = ({
32418
32450
  toneFrequency,
32419
32451
  trimAfter,
32420
32452
  trimBefore,
32421
- onError
32453
+ onError,
32454
+ credentials
32422
32455
  }) => {
32423
32456
  const defaultLogLevel = Internals.useLogLevel();
32424
32457
  const logLevel = overriddenLogLevel ?? defaultLogLevel;
@@ -32482,7 +32515,8 @@ var AudioForRendering2 = ({
32482
32515
  trimAfter,
32483
32516
  trimBefore,
32484
32517
  fps,
32485
- maxCacheSize
32518
+ maxCacheSize,
32519
+ credentials
32486
32520
  }).then((result) => {
32487
32521
  const handleError = (error2, clientSideError, fallbackMessage) => {
32488
32522
  const [action, errorToUse] = callOnErrorAndResolve({
@@ -32576,7 +32610,8 @@ var AudioForRendering2 = ({
32576
32610
  replaceWithHtml5Audio,
32577
32611
  maxCacheSize,
32578
32612
  audioEnabled,
32579
- onError
32613
+ onError,
32614
+ credentials
32580
32615
  ]);
32581
32616
  if (replaceWithHtml5Audio) {
32582
32617
  return /* @__PURE__ */ jsx216(Html5Audio, {
@@ -32676,6 +32711,7 @@ var VideoForPreviewAssertedShowing = ({
32676
32711
  debugAudioScheduling,
32677
32712
  headless,
32678
32713
  onError,
32714
+ credentials,
32679
32715
  controls
32680
32716
  }) => {
32681
32717
  const src = usePreload22(unpreloadedSrc);
@@ -32779,7 +32815,8 @@ var VideoForPreviewAssertedShowing = ({
32779
32815
  durationInFrames: videoConfig.durationInFrames,
32780
32816
  onVideoFrameCallback: initialOnVideoFrameRef.current ?? null,
32781
32817
  playing: initialPlaying.current,
32782
- sequenceOffset: initialSequenceOffset.current
32818
+ sequenceOffset: initialSequenceOffset.current,
32819
+ credentials
32783
32820
  });
32784
32821
  mediaPlayerRef.current = player;
32785
32822
  player.initialize(currentTimeRef.current, initialMuted.current).then((result) => {
@@ -32869,7 +32906,8 @@ var VideoForPreviewAssertedShowing = ({
32869
32906
  sharedAudioContext,
32870
32907
  videoConfig.fps,
32871
32908
  onError,
32872
- videoConfig.durationInFrames
32909
+ videoConfig.durationInFrames,
32910
+ credentials
32873
32911
  ]);
32874
32912
  const classNameValue = useMemo412(() => {
32875
32913
  return [Internals.OBJECTFIT_CONTAIN_CLASS_NAME, className2].filter(Internals.truthy).join(" ");
@@ -33001,7 +33039,8 @@ var VideoForRendering2 = ({
33001
33039
  trimAfterValue,
33002
33040
  trimBeforeValue,
33003
33041
  headless,
33004
- onError
33042
+ onError,
33043
+ credentials
33005
33044
  }) => {
33006
33045
  if (!src) {
33007
33046
  throw new TypeError("No `src` was passed to <Video>.");
@@ -33068,7 +33107,8 @@ var VideoForRendering2 = ({
33068
33107
  trimAfter: trimAfterValue,
33069
33108
  trimBefore: trimBeforeValue,
33070
33109
  fps,
33071
- maxCacheSize
33110
+ maxCacheSize,
33111
+ credentials
33072
33112
  }).then((result) => {
33073
33113
  const handleError = (err, clientSideError, fallbackMessage, mediaDurationInSeconds) => {
33074
33114
  if (environment.isClientSideRendering) {
@@ -33200,7 +33240,8 @@ var VideoForRendering2 = ({
33200
33240
  maxCacheSize,
33201
33241
  cancelRender3,
33202
33242
  headless,
33203
- onError
33243
+ onError,
33244
+ credentials
33204
33245
  ]);
33205
33246
  const classNameValue = useMemo53(() => {
33206
33247
  return [Internals.OBJECTFIT_CONTAIN_CLASS_NAME, className2].filter(Internals.truthy).join(" ");
@@ -33339,6 +33380,7 @@ var InnerVideo = ({
33339
33380
  debugAudioScheduling,
33340
33381
  headless,
33341
33382
  onError,
33383
+ credentials,
33342
33384
  controls
33343
33385
  }) => {
33344
33386
  const environment = useRemotionEnvironment();
@@ -33381,7 +33423,8 @@ var InnerVideo = ({
33381
33423
  trimAfterValue,
33382
33424
  trimBeforeValue,
33383
33425
  headless,
33384
- onError
33426
+ onError,
33427
+ credentials
33385
33428
  });
33386
33429
  }
33387
33430
  return /* @__PURE__ */ jsx65(VideoForPreview2, {
@@ -33407,6 +33450,7 @@ var InnerVideo = ({
33407
33450
  debugAudioScheduling: debugAudioScheduling ?? false,
33408
33451
  headless: headless ?? false,
33409
33452
  onError,
33453
+ credentials,
33410
33454
  controls
33411
33455
  });
33412
33456
  };
@@ -33436,6 +33480,7 @@ var VideoInner = ({
33436
33480
  debugAudioScheduling,
33437
33481
  headless,
33438
33482
  onError,
33483
+ credentials,
33439
33484
  controls
33440
33485
  }) => {
33441
33486
  const fallbackLogLevel = Internals.useLogLevel();
@@ -33465,6 +33510,7 @@ var VideoInner = ({
33465
33510
  debugAudioScheduling: debugAudioScheduling ?? false,
33466
33511
  headless: headless ?? false,
33467
33512
  onError,
33513
+ credentials,
33468
33514
  controls
33469
33515
  });
33470
33516
  };
@@ -34772,7 +34818,7 @@ import {
34772
34818
  import { BufferTarget, StreamTarget } from "mediabunny";
34773
34819
 
34774
34820
  // ../core/dist/esm/version.mjs
34775
- var VERSION2 = "4.0.434";
34821
+ var VERSION2 = "4.0.436";
34776
34822
 
34777
34823
  // ../web-renderer/dist/esm/index.mjs
34778
34824
  import { AudioSample, VideoSample } from "mediabunny";
@@ -41123,6 +41169,7 @@ var listOfRemotionPackages = [
41123
41169
  "@remotion/astro-example",
41124
41170
  "@remotion/babel-loader",
41125
41171
  "@remotion/bugs",
41172
+ "@remotion/brand",
41126
41173
  "@remotion/bundler",
41127
41174
  "@remotion/cli",
41128
41175
  "@remotion/cloudrun",
@@ -41375,7 +41422,7 @@ var FEATURED_TEMPLATES = [
41375
41422
  shortName: "Prompt to Motion Graphics SaaS Starter Kit",
41376
41423
  org: "remotion-dev",
41377
41424
  repoName: "template-prompt-to-motion-graphics-saas",
41378
- description: "SaaS template for AI-powered code generation with Remotion",
41425
+ description: "SaaS template for AI-powered animation generation",
41379
41426
  longerDescription: 'A SaaS template for "Prompt to Motion Graphics" products. Generates Remotion code, streams it to the frontend, and compiles and previews it in the browser. See the <a href="/docs/ai/ai-saas-template">documentation page</a> for more details.',
41380
41427
  promoBanner: {
41381
41428
  width: 2880,
@@ -42416,7 +42463,7 @@ var GithubButton = () => {
42416
42463
  " ",
42417
42464
  /* @__PURE__ */ jsx161("div", {
42418
42465
  className: "text-xs inline-block ml-2 leading-none mt-[3px] self-center",
42419
- children: "38k"
42466
+ children: "39k"
42420
42467
  })
42421
42468
  ]
42422
42469
  });
@@ -5977,7 +5977,7 @@ var useIsPlayer = () => {
5977
5977
  function truthy2(value) {
5978
5978
  return Boolean(value);
5979
5979
  }
5980
- var VERSION = "4.0.434";
5980
+ var VERSION = "4.0.436";
5981
5981
  var checkMultipleRemotionVersions = () => {
5982
5982
  if (typeof globalThis === "undefined") {
5983
5983
  return;
@@ -9055,7 +9055,7 @@ var useBasicMediaInTimeline = ({
9055
9055
  const videoConfig = useVideoConfig();
9056
9056
  const [initialVolume] = useState10(() => volume);
9057
9057
  const mediaDuration = calculateMediaDuration({
9058
- mediaDurationInFrames: videoConfig.durationInFrames,
9058
+ mediaDurationInFrames: videoConfig.durationInFrames + (trimBefore ?? 0),
9059
9059
  playbackRate,
9060
9060
  trimBefore,
9061
9061
  trimAfter
@@ -1003,7 +1003,7 @@ var useIsPlayer = () => {
1003
1003
  function truthy(value) {
1004
1004
  return Boolean(value);
1005
1005
  }
1006
- var VERSION = "4.0.434";
1006
+ var VERSION = "4.0.436";
1007
1007
  var checkMultipleRemotionVersions = () => {
1008
1008
  if (typeof globalThis === "undefined") {
1009
1009
  return;
@@ -4081,7 +4081,7 @@ var useBasicMediaInTimeline = ({
4081
4081
  const videoConfig = useVideoConfig();
4082
4082
  const [initialVolume] = useState10(() => volume);
4083
4083
  const mediaDuration = calculateMediaDuration({
4084
- mediaDurationInFrames: videoConfig.durationInFrames,
4084
+ mediaDurationInFrames: videoConfig.durationInFrames + (trimBefore ?? 0),
4085
4085
  playbackRate,
4086
4086
  trimBefore,
4087
4087
  trimAfter
@@ -5977,7 +5977,7 @@ var useIsPlayer = () => {
5977
5977
  function truthy2(value) {
5978
5978
  return Boolean(value);
5979
5979
  }
5980
- var VERSION = "4.0.434";
5980
+ var VERSION = "4.0.436";
5981
5981
  var checkMultipleRemotionVersions = () => {
5982
5982
  if (typeof globalThis === "undefined") {
5983
5983
  return;
@@ -9055,7 +9055,7 @@ var useBasicMediaInTimeline = ({
9055
9055
  const videoConfig = useVideoConfig();
9056
9056
  const [initialVolume] = useState10(() => volume);
9057
9057
  const mediaDuration = calculateMediaDuration({
9058
- mediaDurationInFrames: videoConfig.durationInFrames,
9058
+ mediaDurationInFrames: videoConfig.durationInFrames + (trimBefore ?? 0),
9059
9059
  playbackRate,
9060
9060
  trimBefore,
9061
9061
  trimAfter
@@ -5977,7 +5977,7 @@ var useIsPlayer = () => {
5977
5977
  function truthy2(value) {
5978
5978
  return Boolean(value);
5979
5979
  }
5980
- var VERSION = "4.0.434";
5980
+ var VERSION = "4.0.436";
5981
5981
  var checkMultipleRemotionVersions = () => {
5982
5982
  if (typeof globalThis === "undefined") {
5983
5983
  return;
@@ -9055,7 +9055,7 @@ var useBasicMediaInTimeline = ({
9055
9055
  const videoConfig = useVideoConfig();
9056
9056
  const [initialVolume] = useState10(() => volume);
9057
9057
  const mediaDuration = calculateMediaDuration({
9058
- mediaDurationInFrames: videoConfig.durationInFrames,
9058
+ mediaDurationInFrames: videoConfig.durationInFrames + (trimBefore ?? 0),
9059
9059
  playbackRate,
9060
9060
  trimBefore,
9061
9061
  trimAfter
@@ -23311,7 +23311,7 @@ var useIsPlayer = () => {
23311
23311
  function truthy2(value) {
23312
23312
  return Boolean(value);
23313
23313
  }
23314
- var VERSION = "4.0.434";
23314
+ var VERSION = "4.0.436";
23315
23315
  var checkMultipleRemotionVersions = () => {
23316
23316
  if (typeof globalThis === "undefined") {
23317
23317
  return;
@@ -26389,7 +26389,7 @@ var useBasicMediaInTimeline = ({
26389
26389
  const videoConfig = useVideoConfig();
26390
26390
  const [initialVolume] = useState10(() => volume);
26391
26391
  const mediaDuration = calculateMediaDuration({
26392
- mediaDurationInFrames: videoConfig.durationInFrames,
26392
+ mediaDurationInFrames: videoConfig.durationInFrames + (trimBefore ?? 0),
26393
26393
  playbackRate,
26394
26394
  trimBefore,
26395
26395
  trimAfter
@@ -23311,7 +23311,7 @@ var useIsPlayer = () => {
23311
23311
  function truthy2(value) {
23312
23312
  return Boolean(value);
23313
23313
  }
23314
- var VERSION = "4.0.434";
23314
+ var VERSION = "4.0.436";
23315
23315
  var checkMultipleRemotionVersions = () => {
23316
23316
  if (typeof globalThis === "undefined") {
23317
23317
  return;
@@ -26389,7 +26389,7 @@ var useBasicMediaInTimeline = ({
26389
26389
  const videoConfig = useVideoConfig();
26390
26390
  const [initialVolume] = useState10(() => volume);
26391
26391
  const mediaDuration = calculateMediaDuration({
26392
- mediaDurationInFrames: videoConfig.durationInFrames,
26392
+ mediaDurationInFrames: videoConfig.durationInFrames + (trimBefore ?? 0),
26393
26393
  playbackRate,
26394
26394
  trimBefore,
26395
26395
  trimAfter
@@ -5977,7 +5977,7 @@ var useIsPlayer = () => {
5977
5977
  function truthy2(value) {
5978
5978
  return Boolean(value);
5979
5979
  }
5980
- var VERSION = "4.0.434";
5980
+ var VERSION = "4.0.436";
5981
5981
  var checkMultipleRemotionVersions = () => {
5982
5982
  if (typeof globalThis === "undefined") {
5983
5983
  return;
@@ -9055,7 +9055,7 @@ var useBasicMediaInTimeline = ({
9055
9055
  const videoConfig = useVideoConfig();
9056
9056
  const [initialVolume] = useState10(() => volume);
9057
9057
  const mediaDuration = calculateMediaDuration({
9058
- mediaDurationInFrames: videoConfig.durationInFrames,
9058
+ mediaDurationInFrames: videoConfig.durationInFrames + (trimBefore ?? 0),
9059
9059
  playbackRate,
9060
9060
  trimBefore,
9061
9061
  trimAfter
@@ -5977,7 +5977,7 @@ var useIsPlayer = () => {
5977
5977
  function truthy2(value) {
5978
5978
  return Boolean(value);
5979
5979
  }
5980
- var VERSION = "4.0.434";
5980
+ var VERSION = "4.0.436";
5981
5981
  var checkMultipleRemotionVersions = () => {
5982
5982
  if (typeof globalThis === "undefined") {
5983
5983
  return;
@@ -9055,7 +9055,7 @@ var useBasicMediaInTimeline = ({
9055
9055
  const videoConfig = useVideoConfig();
9056
9056
  const [initialVolume] = useState10(() => volume);
9057
9057
  const mediaDuration = calculateMediaDuration({
9058
- mediaDurationInFrames: videoConfig.durationInFrames,
9058
+ mediaDurationInFrames: videoConfig.durationInFrames + (trimBefore ?? 0),
9059
9059
  playbackRate,
9060
9060
  trimBefore,
9061
9061
  trimAfter
@@ -19911,6 +19911,7 @@ var listOfRemotionPackages = [
19911
19911
  "@remotion/astro-example",
19912
19912
  "@remotion/babel-loader",
19913
19913
  "@remotion/bugs",
19914
+ "@remotion/brand",
19914
19915
  "@remotion/bundler",
19915
19916
  "@remotion/cli",
19916
19917
  "@remotion/cloudrun",
@@ -20163,7 +20164,7 @@ var FEATURED_TEMPLATES = [
20163
20164
  shortName: "Prompt to Motion Graphics SaaS Starter Kit",
20164
20165
  org: "remotion-dev",
20165
20166
  repoName: "template-prompt-to-motion-graphics-saas",
20166
- description: "SaaS template for AI-powered code generation with Remotion",
20167
+ description: "SaaS template for AI-powered animation generation",
20167
20168
  longerDescription: 'A SaaS template for "Prompt to Motion Graphics" products. Generates Remotion code, streams it to the frontend, and compiles and previews it in the browser. See the <a href="/docs/ai/ai-saas-template">documentation page</a> for more details.',
20168
20169
  promoBanner: {
20169
20170
  width: 2880,
package/dist/design.js CHANGED
@@ -6989,7 +6989,7 @@ var getComponentsToAddStacksTo = () => componentsToAddStacksTo;
6989
6989
  var addSequenceStackTraces = (component) => {
6990
6990
  componentsToAddStacksTo.push(component);
6991
6991
  };
6992
- var VERSION = "4.0.445";
6992
+ var VERSION = "4.0.447";
6993
6993
  var checkMultipleRemotionVersions = () => {
6994
6994
  if (typeof globalThis === "undefined") {
6995
6995
  return;
package/dist/experts.js CHANGED
@@ -2042,7 +2042,7 @@ var getComponentsToAddStacksTo = () => componentsToAddStacksTo;
2042
2042
  var addSequenceStackTraces = (component) => {
2043
2043
  componentsToAddStacksTo.push(component);
2044
2044
  };
2045
- var VERSION = "4.0.445";
2045
+ var VERSION = "4.0.447";
2046
2046
  var checkMultipleRemotionVersions = () => {
2047
2047
  if (typeof globalThis === "undefined") {
2048
2048
  return;
@@ -6989,7 +6989,7 @@ var getComponentsToAddStacksTo = () => componentsToAddStacksTo;
6989
6989
  var addSequenceStackTraces = (component) => {
6990
6990
  componentsToAddStacksTo.push(component);
6991
6991
  };
6992
- var VERSION = "4.0.445";
6992
+ var VERSION = "4.0.447";
6993
6993
  var checkMultipleRemotionVersions = () => {
6994
6994
  if (typeof globalThis === "undefined") {
6995
6995
  return;
@@ -6989,7 +6989,7 @@ var getComponentsToAddStacksTo = () => componentsToAddStacksTo;
6989
6989
  var addSequenceStackTraces = (component) => {
6990
6990
  componentsToAddStacksTo.push(component);
6991
6991
  };
6992
- var VERSION = "4.0.445";
6992
+ var VERSION = "4.0.447";
6993
6993
  var checkMultipleRemotionVersions = () => {
6994
6994
  if (typeof globalThis === "undefined") {
6995
6995
  return;
@@ -24323,7 +24323,7 @@ var getComponentsToAddStacksTo = () => componentsToAddStacksTo;
24323
24323
  var addSequenceStackTraces = (component) => {
24324
24324
  componentsToAddStacksTo.push(component);
24325
24325
  };
24326
- var VERSION = "4.0.445";
24326
+ var VERSION = "4.0.447";
24327
24327
  var checkMultipleRemotionVersions = () => {
24328
24328
  if (typeof globalThis === "undefined") {
24329
24329
  return;
@@ -24323,7 +24323,7 @@ var getComponentsToAddStacksTo = () => componentsToAddStacksTo;
24323
24323
  var addSequenceStackTraces = (component) => {
24324
24324
  componentsToAddStacksTo.push(component);
24325
24325
  };
24326
- var VERSION = "4.0.445";
24326
+ var VERSION = "4.0.447";
24327
24327
  var checkMultipleRemotionVersions = () => {
24328
24328
  if (typeof globalThis === "undefined") {
24329
24329
  return;
package/dist/team.js CHANGED
@@ -7170,7 +7170,7 @@ var getComponentsToAddStacksTo = () => componentsToAddStacksTo;
7170
7170
  var addSequenceStackTraces = (component) => {
7171
7171
  componentsToAddStacksTo.push(component);
7172
7172
  };
7173
- var VERSION = "4.0.445";
7173
+ var VERSION = "4.0.447";
7174
7174
  var checkMultipleRemotionVersions = () => {
7175
7175
  if (typeof globalThis === "undefined") {
7176
7176
  return;
@@ -6989,7 +6989,7 @@ var getComponentsToAddStacksTo = () => componentsToAddStacksTo;
6989
6989
  var addSequenceStackTraces = (component) => {
6990
6990
  componentsToAddStacksTo.push(component);
6991
6991
  };
6992
- var VERSION = "4.0.445";
6992
+ var VERSION = "4.0.447";
6993
6993
  var checkMultipleRemotionVersions = () => {
6994
6994
  if (typeof globalThis === "undefined") {
6995
6995
  return;
package/dist/templates.js CHANGED
@@ -6989,7 +6989,7 @@ var getComponentsToAddStacksTo = () => componentsToAddStacksTo;
6989
6989
  var addSequenceStackTraces = (component) => {
6990
6990
  componentsToAddStacksTo.push(component);
6991
6991
  };
6992
- var VERSION = "4.0.445";
6992
+ var VERSION = "4.0.447";
6993
6993
  var checkMultipleRemotionVersions = () => {
6994
6994
  if (typeof globalThis === "undefined") {
6995
6995
  return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remotion/promo-pages",
3
- "version": "4.0.445",
3
+ "version": "4.0.447",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -11,19 +11,19 @@
11
11
  },
12
12
  "type": "module",
13
13
  "dependencies": {
14
- "@remotion/animated-emoji": "4.0.445",
15
- "@remotion/design": "4.0.445",
16
- "@remotion/web-renderer": "4.0.445",
17
- "@remotion/lottie": "4.0.445",
18
- "@remotion/paths": "4.0.445",
19
- "@remotion/player": "4.0.445",
20
- "@remotion/shapes": "4.0.445",
21
- "@remotion/media": "4.0.445",
22
- "@remotion/svg-3d-engine": "4.0.445",
23
- "create-video": "4.0.445",
14
+ "@remotion/animated-emoji": "4.0.447",
15
+ "@remotion/design": "4.0.447",
16
+ "@remotion/web-renderer": "4.0.447",
17
+ "@remotion/lottie": "4.0.447",
18
+ "@remotion/paths": "4.0.447",
19
+ "@remotion/player": "4.0.447",
20
+ "@remotion/shapes": "4.0.447",
21
+ "@remotion/media": "4.0.447",
22
+ "@remotion/svg-3d-engine": "4.0.447",
23
+ "create-video": "4.0.447",
24
24
  "hls.js": "1.5.19",
25
25
  "polished": "4.3.1",
26
- "remotion": "4.0.445",
26
+ "remotion": "4.0.447",
27
27
  "zod": "4.3.6",
28
28
  "@mux/upchunk": "^3.5.0",
29
29
  "@vidstack/react": "1.12.13",
@@ -34,7 +34,7 @@
34
34
  "@mediabunny/mp3-encoder": "1.39.2"
35
35
  },
36
36
  "devDependencies": {
37
- "@remotion/eslint-config-internal": "4.0.445",
37
+ "@remotion/eslint-config-internal": "4.0.447",
38
38
  "@eslint/eslintrc": "3.1.0",
39
39
  "@types/react": "19.2.7",
40
40
  "@types/react-dom": "19.2.3",