@remotion/promo-pages 4.0.355 → 4.0.357

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
@@ -87,7 +87,7 @@ import {
87
87
  useState as useState7
88
88
  } from "react";
89
89
  import { jsx as jsx11 } from "react/jsx-runtime";
90
- import { forwardRef as forwardRef6, useCallback as useCallback11, useContext as useContext25 } from "react";
90
+ import { forwardRef as forwardRef6, useCallback as useCallback11, useContext as useContext26 } from "react";
91
91
  import React10, { createContext as createContext11, useMemo as useMemo11 } from "react";
92
92
  import { jsx as jsx12 } from "react/jsx-runtime";
93
93
  import { useContext as useContext13 } from "react";
@@ -97,8 +97,8 @@ import { createContext as createContext13, useMemo as useMemo12, useReducer } fr
97
97
  import { jsx as jsx14 } from "react/jsx-runtime";
98
98
  import {
99
99
  forwardRef as forwardRef4,
100
- useContext as useContext23,
101
- useEffect as useEffect13,
100
+ useContext as useContext24,
101
+ useEffect as useEffect14,
102
102
  useImperativeHandle as useImperativeHandle5,
103
103
  useMemo as useMemo20,
104
104
  useRef as useRef11,
@@ -144,12 +144,13 @@ import { jsx as jsx16 } from "react/jsx-runtime";
144
144
  import React16 from "react";
145
145
  import { useEffect as useEffect10, useState as useState13 } from "react";
146
146
  import { useEffect as useEffect11, useRef as useRef9 } from "react";
147
- import { createContext as createContext16, useContext as useContext22, useMemo as useMemo19 } from "react";
147
+ import { useContext as useContext22, useEffect as useEffect13 } from "react";
148
+ import { createContext as createContext16, useContext as useContext23, useMemo as useMemo19 } from "react";
148
149
  import { jsx as jsx17 } from "react/jsx-runtime";
149
150
  import {
150
151
  forwardRef as forwardRef5,
151
- useContext as useContext24,
152
- useEffect as useEffect14,
152
+ useContext as useContext25,
153
+ useEffect as useEffect15,
153
154
  useImperativeHandle as useImperativeHandle6,
154
155
  useLayoutEffect as useLayoutEffect6,
155
156
  useMemo as useMemo21,
@@ -157,9 +158,9 @@ import {
157
158
  } from "react";
158
159
  import { jsx as jsx18 } from "react/jsx-runtime";
159
160
  import { jsx as jsx19 } from "react/jsx-runtime";
160
- import { Suspense, useContext as useContext27, useEffect as useEffect16 } from "react";
161
+ import { Suspense, useContext as useContext28, useEffect as useEffect17 } from "react";
161
162
  import { createPortal } from "react-dom";
162
- import { createContext as createContext17, useContext as useContext26, useEffect as useEffect15, useMemo as useMemo222 } from "react";
163
+ import { createContext as createContext17, useContext as useContext27, useEffect as useEffect16, useMemo as useMemo222 } from "react";
163
164
  import { jsx as jsx20 } from "react/jsx-runtime";
164
165
  import { jsx as jsx21, jsxs as jsxs22 } from "react/jsx-runtime";
165
166
  import React20, { useMemo as useMemo23 } from "react";
@@ -169,7 +170,7 @@ import { jsx as jsx23 } from "react/jsx-runtime";
169
170
  import {
170
171
  forwardRef as forwardRef8,
171
172
  useCallback as useCallback13,
172
- useContext as useContext28,
173
+ useContext as useContext29,
173
174
  useImperativeHandle as useImperativeHandle7,
174
175
  useLayoutEffect as useLayoutEffect7,
175
176
  useRef as useRef13
@@ -185,7 +186,7 @@ import React24, {
185
186
  } from "react";
186
187
  import { jsx as jsx25 } from "react/jsx-runtime";
187
188
  import {
188
- useEffect as useEffect17,
189
+ useEffect as useEffect18,
189
190
  useLayoutEffect as useLayoutEffect8,
190
191
  useMemo as useMemo25,
191
192
  useRef as useRef15,
@@ -193,41 +194,41 @@ import {
193
194
  } from "react";
194
195
  import { jsx as jsx26 } from "react/jsx-runtime";
195
196
  import React26, { createContext as createContext18 } from "react";
197
+ import { useCallback as useCallback16 } from "react";
196
198
  import {
197
- forwardRef as forwardRef9,
198
- useContext as useContext29,
199
+ useCallback as useCallback15,
200
+ useContext as useContext30,
199
201
  useEffect as useEffect19,
200
- useImperativeHandle as useImperativeHandle9,
202
+ useLayoutEffect as useLayoutEffect9,
201
203
  useMemo as useMemo26,
202
- useRef as useRef16,
203
204
  useState as useState18
204
205
  } from "react";
205
- import { useEffect as useEffect18 } from "react";
206
206
  import { jsx as jsx27 } from "react/jsx-runtime";
207
- import React28, { useMemo as useMemo27 } from "react";
208
- import { jsx as jsx28 } from "react/jsx-runtime";
209
- import { Children, forwardRef as forwardRef10, useMemo as useMemo28 } from "react";
210
- import React29 from "react";
211
- import React30, { createContext as createContext19 } from "react";
212
- import { jsx as jsx29 } from "react/jsx-runtime";
213
- import { jsx as jsx30 } from "react/jsx-runtime";
214
- import React322 from "react";
215
- import { useCallback as useCallback16 } from "react";
216
207
  import {
217
- useCallback as useCallback15,
218
- useContext as useContext30,
219
- useEffect as useEffect20,
220
- useLayoutEffect as useLayoutEffect9,
221
- useMemo as useMemo29,
208
+ forwardRef as forwardRef9,
209
+ useContext as useContext31,
210
+ useEffect as useEffect21,
211
+ useImperativeHandle as useImperativeHandle9,
212
+ useMemo as useMemo27,
213
+ useRef as useRef16,
222
214
  useState as useState19
223
215
  } from "react";
216
+ import { useEffect as useEffect20 } from "react";
217
+ import { jsx as jsx28 } from "react/jsx-runtime";
218
+ import { jsx as jsx29 } from "react/jsx-runtime";
219
+ import React30, { useMemo as useMemo28 } from "react";
220
+ import { jsx as jsx30 } from "react/jsx-runtime";
221
+ import { Children, forwardRef as forwardRef10, useMemo as useMemo29 } from "react";
222
+ import React31 from "react";
223
+ import React322, { createContext as createContext19 } from "react";
224
224
  import { jsx as jsx31 } from "react/jsx-runtime";
225
225
  import { jsx as jsx322 } from "react/jsx-runtime";
226
- import { forwardRef as forwardRef12, useCallback as useCallback17, useContext as useContext32 } from "react";
226
+ import React34 from "react";
227
+ import { forwardRef as forwardRef12, useCallback as useCallback17, useContext as useContext33 } from "react";
227
228
  import {
228
229
  forwardRef as forwardRef11,
229
- useContext as useContext31,
230
- useEffect as useEffect21,
230
+ useContext as useContext32,
231
+ useEffect as useEffect222,
231
232
  useImperativeHandle as useImperativeHandle10,
232
233
  useLayoutEffect as useLayoutEffect10,
233
234
  useMemo as useMemo30,
@@ -439,19 +440,19 @@ function exponentialBackoff(errorCount) {
439
440
  return 1000 * 2 ** (errorCount - 1);
440
441
  }
441
442
  function useRemotionContexts() {
442
- const compositionManagerCtx = React28.useContext(CompositionManager);
443
- const timelineContext = React28.useContext(TimelineContext);
444
- const setTimelineContext = React28.useContext(SetTimelineContext);
445
- const sequenceContext = React28.useContext(SequenceContext);
446
- const nonceContext = React28.useContext(NonceContext);
447
- const canUseRemotionHooksContext = React28.useContext(CanUseRemotionHooks);
448
- const preloadContext = React28.useContext(PreloadContext);
449
- const resolveCompositionContext = React28.useContext(ResolveCompositionContext);
450
- const renderAssetManagerContext = React28.useContext(RenderAssetManager);
451
- const sequenceManagerContext = React28.useContext(SequenceManager);
452
- const bufferManagerContext = React28.useContext(BufferingContextReact);
453
- const logLevelContext = React28.useContext(LogLevelContext);
454
- return useMemo27(() => ({
443
+ const compositionManagerCtx = React30.useContext(CompositionManager);
444
+ const timelineContext = React30.useContext(TimelineContext);
445
+ const setTimelineContext = React30.useContext(SetTimelineContext);
446
+ const sequenceContext = React30.useContext(SequenceContext);
447
+ const nonceContext = React30.useContext(NonceContext);
448
+ const canUseRemotionHooksContext = React30.useContext(CanUseRemotionHooks);
449
+ const preloadContext = React30.useContext(PreloadContext);
450
+ const resolveCompositionContext = React30.useContext(ResolveCompositionContext);
451
+ const renderAssetManagerContext = React30.useContext(RenderAssetManager);
452
+ const sequenceManagerContext = React30.useContext(SequenceManager);
453
+ const bufferManagerContext = React30.useContext(BufferingContextReact);
454
+ const logLevelContext = React30.useContext(LogLevelContext);
455
+ return useMemo28(() => ({
455
456
  compositionManagerCtx,
456
457
  timelineContext,
457
458
  setTimelineContext,
@@ -739,7 +740,7 @@ var __defProp2, __export2 = (target, all) => {
739
740
  });
740
741
  }, useIsPlayer = () => {
741
742
  return useContext(IsPlayerContext);
742
- }, VERSION = "4.0.355", checkMultipleRemotionVersions = () => {
743
+ }, VERSION = "4.0.357", checkMultipleRemotionVersions = () => {
743
744
  if (typeof globalThis === "undefined") {
744
745
  return;
745
746
  }
@@ -1720,7 +1721,9 @@ Check that all your Remotion packages are on the same version. If your dependenc
1720
1721
  height: height ?? parentSequence?.height ?? null,
1721
1722
  width: width ?? parentSequence?.width ?? null,
1722
1723
  premounting,
1723
- postmounting
1724
+ postmounting,
1725
+ premountDisplay: premountDisplay ?? null,
1726
+ postmountDisplay: postmountDisplay ?? null
1724
1727
  };
1725
1728
  }, [
1726
1729
  cumulatedFrom,
@@ -1731,7 +1734,9 @@ Check that all your Remotion packages are on the same version. If your dependenc
1731
1734
  height,
1732
1735
  width,
1733
1736
  premounting,
1734
- postmounting
1737
+ postmounting,
1738
+ premountDisplay,
1739
+ postmountDisplay
1735
1740
  ]);
1736
1741
  const timelineClipName = useMemo9(() => {
1737
1742
  return name ?? "";
@@ -2356,17 +2361,17 @@ Check that all your Remotion packages are on the same version. If your dependenc
2356
2361
  }
2357
2362
  return new URL(relativeSrc, window.origin).href;
2358
2363
  }, calculateLoopDuration = ({
2359
- endAt,
2360
- mediaDuration,
2364
+ trimAfter,
2365
+ mediaDurationInFrames,
2361
2366
  playbackRate,
2362
- startFrom
2367
+ trimBefore
2363
2368
  }) => {
2364
- let duration = mediaDuration;
2365
- if (typeof endAt !== "undefined") {
2366
- duration = endAt;
2369
+ let duration = mediaDurationInFrames;
2370
+ if (typeof trimAfter !== "undefined") {
2371
+ duration = trimAfter;
2367
2372
  }
2368
- if (typeof startFrom !== "undefined") {
2369
- duration -= startFrom;
2373
+ if (typeof trimBefore !== "undefined") {
2374
+ duration -= trimBefore;
2370
2375
  }
2371
2376
  const actualDuration = duration / playbackRate;
2372
2377
  return Math.floor(actualDuration);
@@ -3329,7 +3334,6 @@ Check that all your Remotion packages are on the same version. If your dependenc
3329
3334
  }, useMediaInTimeline = ({
3330
3335
  volume,
3331
3336
  mediaVolume,
3332
- mediaRef,
3333
3337
  src,
3334
3338
  mediaType,
3335
3339
  playbackRate,
@@ -3338,22 +3342,16 @@ Check that all your Remotion packages are on the same version. If your dependenc
3338
3342
  stack,
3339
3343
  showInTimeline,
3340
3344
  premountDisplay,
3341
- postmountDisplay,
3342
- onAutoPlayError,
3343
- isPremounting,
3344
- isPostmounting
3345
+ postmountDisplay
3345
3346
  }) => {
3346
3347
  const videoConfig = useVideoConfig();
3347
- const { rootId, audioAndVideoTags } = useContext18(TimelineContext);
3348
3348
  const parentSequence = useContext18(SequenceContext);
3349
3349
  const actualFrom = parentSequence ? parentSequence.relativeFrom + parentSequence.cumulatedFrom : 0;
3350
- const { imperativePlaying } = useContext18(TimelineContext);
3351
3350
  const startsAt = useMediaStartsAt();
3352
3351
  const { registerSequence, unregisterSequence } = useContext18(SequenceManager);
3353
3352
  const [initialVolume] = useState11(() => volume);
3354
- const logLevel = useLogLevel();
3355
- const mountTime = useMountTime();
3356
3353
  const nonce = useNonce();
3354
+ const { rootId } = useContext18(TimelineContext);
3357
3355
  const duration = parentSequence ? Math.min(parentSequence.durationInFrames, videoConfig.durationInFrames) : videoConfig.durationInFrames;
3358
3356
  const doesVolumeChange = typeof volume === "function";
3359
3357
  const volumes = useMemo15(() => {
@@ -3375,9 +3373,6 @@ Check that all your Remotion packages are on the same version. If your dependenc
3375
3373
  }, [initialVolume, mediaType, src, volume]);
3376
3374
  const env = useRemotionEnvironment();
3377
3375
  useEffect8(() => {
3378
- if (!mediaRef.current) {
3379
- return;
3380
- }
3381
3376
  if (!src) {
3382
3377
  throw new Error("No src passed");
3383
3378
  }
@@ -3423,7 +3418,6 @@ Check that all your Remotion packages are on the same version. If your dependenc
3423
3418
  volumes,
3424
3419
  doesVolumeChange,
3425
3420
  nonce,
3426
- mediaRef,
3427
3421
  mediaType,
3428
3422
  startsAt,
3429
3423
  playbackRate,
@@ -3434,44 +3428,6 @@ Check that all your Remotion packages are on the same version. If your dependenc
3434
3428
  postmountDisplay,
3435
3429
  env.isStudio
3436
3430
  ]);
3437
- useEffect8(() => {
3438
- const tag = {
3439
- id,
3440
- play: (reason) => {
3441
- if (!imperativePlaying.current) {
3442
- return;
3443
- }
3444
- if (isPremounting || isPostmounting) {
3445
- return;
3446
- }
3447
- return playAndHandleNotAllowedError({
3448
- mediaRef,
3449
- mediaType,
3450
- onAutoPlayError,
3451
- logLevel,
3452
- mountTime,
3453
- reason,
3454
- isPlayer: env.isPlayer
3455
- });
3456
- }
3457
- };
3458
- audioAndVideoTags.current.push(tag);
3459
- return () => {
3460
- audioAndVideoTags.current = audioAndVideoTags.current.filter((a) => a.id !== id);
3461
- };
3462
- }, [
3463
- audioAndVideoTags,
3464
- id,
3465
- mediaRef,
3466
- mediaType,
3467
- onAutoPlayError,
3468
- imperativePlaying,
3469
- isPremounting,
3470
- isPostmounting,
3471
- logLevel,
3472
- mountTime,
3473
- env.isPlayer
3474
- ]);
3475
3431
  }, useBufferManager = (logLevel, mountTime) => {
3476
3432
  const [blocks, setBlocks] = useState12([]);
3477
3433
  const [onBufferingCallbacks, setOnBufferingCallbacks] = useState12([]);
@@ -4181,15 +4137,65 @@ Check that all your Remotion packages are on the same version. If your dependenc
4181
4137
  mediaTagCurrentTime,
4182
4138
  env.isPlayer
4183
4139
  ]);
4140
+ }, useMediaTag = ({
4141
+ mediaRef,
4142
+ id,
4143
+ mediaType,
4144
+ onAutoPlayError,
4145
+ isPremounting,
4146
+ isPostmounting
4147
+ }) => {
4148
+ const { audioAndVideoTags, imperativePlaying } = useContext22(TimelineContext);
4149
+ const logLevel = useLogLevel();
4150
+ const mountTime = useMountTime();
4151
+ const env = useRemotionEnvironment();
4152
+ useEffect13(() => {
4153
+ const tag = {
4154
+ id,
4155
+ play: (reason) => {
4156
+ if (!imperativePlaying.current) {
4157
+ return;
4158
+ }
4159
+ if (isPremounting || isPostmounting) {
4160
+ return;
4161
+ }
4162
+ return playAndHandleNotAllowedError({
4163
+ mediaRef,
4164
+ mediaType,
4165
+ onAutoPlayError,
4166
+ logLevel,
4167
+ mountTime,
4168
+ reason,
4169
+ isPlayer: env.isPlayer
4170
+ });
4171
+ }
4172
+ };
4173
+ audioAndVideoTags.current.push(tag);
4174
+ return () => {
4175
+ audioAndVideoTags.current = audioAndVideoTags.current.filter((a) => a.id !== id);
4176
+ };
4177
+ }, [
4178
+ audioAndVideoTags,
4179
+ id,
4180
+ mediaRef,
4181
+ mediaType,
4182
+ onAutoPlayError,
4183
+ imperativePlaying,
4184
+ isPremounting,
4185
+ isPostmounting,
4186
+ logLevel,
4187
+ mountTime,
4188
+ env.isPlayer
4189
+ ]);
4184
4190
  }, MediaVolumeContext, SetMediaVolumeContext, useMediaVolumeState = () => {
4185
- const { mediaVolume } = useContext22(MediaVolumeContext);
4186
- const { setMediaVolume } = useContext22(SetMediaVolumeContext);
4191
+ const { mediaVolume } = useContext23(MediaVolumeContext);
4192
+ const { setMediaVolume } = useContext23(SetMediaVolumeContext);
4187
4193
  return useMemo19(() => {
4188
4194
  return [mediaVolume, setMediaVolume];
4189
4195
  }, [mediaVolume, setMediaVolume]);
4190
4196
  }, useMediaMutedState = () => {
4191
- const { mediaMuted } = useContext22(MediaVolumeContext);
4192
- const { setMediaMuted } = useContext22(SetMediaVolumeContext);
4197
+ const { mediaMuted } = useContext23(MediaVolumeContext);
4198
+ const { setMediaMuted } = useContext23(SetMediaVolumeContext);
4193
4199
  return useMemo19(() => {
4194
4200
  return [mediaMuted, setMediaMuted];
4195
4201
  }, [mediaMuted, setMediaMuted]);
@@ -4237,12 +4243,12 @@ Check that all your Remotion packages are on the same version. If your dependenc
4237
4243
  const [mediaVolume] = useMediaVolumeState();
4238
4244
  const [mediaMuted] = useMediaMutedState();
4239
4245
  const volumePropFrame = useFrameForVolumeProp(loopVolumeCurveBehavior ?? "repeat");
4240
- const { hidden } = useContext23(SequenceVisibilityToggleContext);
4246
+ const { hidden } = useContext24(SequenceVisibilityToggleContext);
4241
4247
  if (!src) {
4242
4248
  throw new TypeError("No 'src' was passed to <Audio>.");
4243
4249
  }
4244
4250
  const preloadedSrc = usePreload(src);
4245
- const sequenceContext = useContext23(SequenceContext);
4251
+ const sequenceContext = useContext24(SequenceContext);
4246
4252
  const [timelineId] = useState14(() => String(Math.random()));
4247
4253
  const isSequenceHidden = hidden[timelineId] ?? false;
4248
4254
  const userPreferredVolume = evaluateVolume({
@@ -4281,7 +4287,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
4281
4287
  props.muted,
4282
4288
  props.loop
4283
4289
  ]);
4284
- const context = useContext23(SharedAudioContext);
4290
+ const context = useContext24(SharedAudioContext);
4285
4291
  if (!context) {
4286
4292
  throw new Error("SharedAudioContext not found");
4287
4293
  }
@@ -4293,7 +4299,6 @@ Check that all your Remotion packages are on the same version. If your dependenc
4293
4299
  useMediaInTimeline({
4294
4300
  volume,
4295
4301
  mediaVolume,
4296
- mediaRef: audioRef,
4297
4302
  src,
4298
4303
  mediaType: "audio",
4299
4304
  playbackRate: playbackRate ?? 1,
@@ -4301,11 +4306,8 @@ Check that all your Remotion packages are on the same version. If your dependenc
4301
4306
  id: timelineId,
4302
4307
  stack: _remotionInternalStack,
4303
4308
  showInTimeline,
4304
- premountDisplay: null,
4305
- postmountDisplay: null,
4306
- onAutoPlayError: null,
4307
- isPremounting: Boolean(sequenceContext?.premounting),
4308
- isPostmounting: Boolean(sequenceContext?.postmounting)
4309
+ premountDisplay: sequenceContext?.premountDisplay ?? null,
4310
+ postmountDisplay: sequenceContext?.postmountDisplay ?? null
4309
4311
  });
4310
4312
  useMediaPlayback({
4311
4313
  mediaRef: audioRef,
@@ -4319,6 +4321,14 @@ Check that all your Remotion packages are on the same version. If your dependenc
4319
4321
  pauseWhenBuffering,
4320
4322
  onAutoPlayError: null
4321
4323
  });
4324
+ useMediaTag({
4325
+ id: timelineId,
4326
+ isPostmounting: Boolean(sequenceContext?.postmounting),
4327
+ isPremounting: Boolean(sequenceContext?.premounting),
4328
+ mediaRef: audioRef,
4329
+ mediaType: "audio",
4330
+ onAutoPlayError: null
4331
+ });
4322
4332
  useVolume({
4323
4333
  logLevel,
4324
4334
  mediaRef: audioRef,
@@ -4331,7 +4341,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
4331
4341
  }, [audioRef]);
4332
4342
  const currentOnDurationCallback = useRef11(onDuration);
4333
4343
  currentOnDurationCallback.current = onDuration;
4334
- useEffect13(() => {
4344
+ useEffect14(() => {
4335
4345
  const { current } = audioRef;
4336
4346
  if (!current) {
4337
4347
  return;
@@ -4380,8 +4390,8 @@ Check that all your Remotion packages are on the same version. If your dependenc
4380
4390
  const absoluteFrame = useTimelinePosition();
4381
4391
  const volumePropFrame = useFrameForVolumeProp(loopVolumeCurveBehavior ?? "repeat");
4382
4392
  const frame = useCurrentFrame();
4383
- const sequenceContext = useContext24(SequenceContext);
4384
- const { registerRenderAsset, unregisterRenderAsset } = useContext24(RenderAssetManager);
4393
+ const sequenceContext = useContext25(SequenceContext);
4394
+ const { registerRenderAsset, unregisterRenderAsset } = useContext25(RenderAssetManager);
4385
4395
  const { delayRender: delayRender2, continueRender: continueRender2 } = useDelayRender();
4386
4396
  const id = useMemo21(() => `audio-${random(props.src ?? "")}-${sequenceContext?.relativeFrom}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.durationInFrames}`, [
4387
4397
  props.src,
@@ -4398,7 +4408,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
4398
4408
  useImperativeHandle6(ref, () => {
4399
4409
  return audioRef.current;
4400
4410
  }, []);
4401
- useEffect14(() => {
4411
+ useEffect15(() => {
4402
4412
  if (!props.src) {
4403
4413
  throw new Error("No src passed");
4404
4414
  }
@@ -4419,7 +4429,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
4419
4429
  volume,
4420
4430
  mediaFrame: frame,
4421
4431
  playbackRate: props.playbackRate ?? 1,
4422
- toneFrequency: toneFrequency ?? null,
4432
+ toneFrequency: toneFrequency ?? 1,
4423
4433
  audioStartFrame: Math.max(0, -(sequenceContext?.relativeFrom ?? 0)),
4424
4434
  audioStreamIndex: audioStreamIndex ?? 0
4425
4435
  });
@@ -4488,7 +4498,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
4488
4498
  onError: onNativeError
4489
4499
  });
4490
4500
  }, AudioForRendering, AudioRefForwardingFunction = (props, ref) => {
4491
- const audioContext = useContext25(SharedAudioContext);
4501
+ const audioContext = useContext26(SharedAudioContext);
4492
4502
  const {
4493
4503
  startFrom,
4494
4504
  endAt,
@@ -4504,7 +4514,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
4504
4514
  const { loop, ...propsOtherThanLoop } = props;
4505
4515
  const { fps } = useVideoConfig();
4506
4516
  const environment = useRemotionEnvironment();
4507
- const { durations, setDurations } = useContext25(DurationsContext);
4517
+ const { durations, setDurations } = useContext26(DurationsContext);
4508
4518
  if (typeof props.src !== "string") {
4509
4519
  throw new TypeError(`The \`<Audio>\` tag requires a string for \`src\`, but got ${JSON.stringify(props.src)} instead.`);
4510
4520
  }
@@ -4546,10 +4556,10 @@ Check that all your Remotion packages are on the same version. If your dependenc
4546
4556
  return /* @__PURE__ */ jsx19(Loop, {
4547
4557
  layout: "none",
4548
4558
  durationInFrames: calculateLoopDuration({
4549
- endAt: trimAfterValue ?? endAt,
4550
- mediaDuration: duration,
4559
+ trimAfter: trimAfterValue,
4560
+ mediaDurationInFrames: duration,
4551
4561
  playbackRate: props.playbackRate ?? 1,
4552
- startFrom: trimBeforeValue ?? startFrom
4562
+ trimBefore: trimBeforeValue
4553
4563
  }),
4554
4564
  children: /* @__PURE__ */ jsx19(Audio, {
4555
4565
  ...propsOtherThanLoop,
@@ -4573,7 +4583,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
4573
4583
  })
4574
4584
  });
4575
4585
  }
4576
- validateMediaProps(props, "Audio");
4586
+ validateMediaProps({ playbackRate: props.playbackRate, volume: props.volume }, "Audio");
4577
4587
  if (environment.isRendering) {
4578
4588
  return /* @__PURE__ */ jsx19(AudioForRendering, {
4579
4589
  onDuration,
@@ -4702,7 +4712,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
4702
4712
  }
4703
4713
  }, Fallback = () => {
4704
4714
  const { continueRender: continueRender2, delayRender: delayRender2 } = useDelayRender();
4705
- useEffect16(() => {
4715
+ useEffect17(() => {
4706
4716
  const fallback = delayRender2("Waiting for Root component to unsuspend");
4707
4717
  return () => continueRender2(fallback);
4708
4718
  }, [continueRender2, delayRender2]);
@@ -4717,7 +4727,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
4717
4727
  schema,
4718
4728
  ...compProps
4719
4729
  }) => {
4720
- const compManager = useContext27(CompositionSetters);
4730
+ const compManager = useContext28(CompositionSetters);
4721
4731
  const { registerComposition, unregisterComposition } = compManager;
4722
4732
  const video = useVideo();
4723
4733
  const lazy = useLazyComponent({
@@ -4728,15 +4738,18 @@ Check that all your Remotion packages are on the same version. If your dependenc
4728
4738
  const nonce = useNonce();
4729
4739
  const isPlayer = useIsPlayer();
4730
4740
  const environment = useRemotionEnvironment();
4731
- const canUseComposition = useContext27(CanUseRemotionHooks);
4741
+ const canUseComposition = useContext28(CanUseRemotionHooks);
4742
+ if (typeof window !== "undefined") {
4743
+ window.remotion_seenCompositionIds = Array.from(new Set([...window.remotion_seenCompositionIds ?? [], id]));
4744
+ }
4732
4745
  if (canUseComposition) {
4733
4746
  if (isPlayer) {
4734
4747
  throw new Error("<Composition> was mounted inside the `component` that was passed to the <Player>. See https://remotion.dev/docs/wrong-composition-mount for help.");
4735
4748
  }
4736
4749
  throw new Error("<Composition> mounted inside another composition. See https://remotion.dev/docs/wrong-composition-mount for help.");
4737
4750
  }
4738
- const { folderName, parentName } = useContext27(FolderContext);
4739
- useEffect16(() => {
4751
+ const { folderName, parentName } = useContext28(FolderContext);
4752
+ useEffect17(() => {
4740
4753
  if (!id) {
4741
4754
  throw new Error("No id for composition passed.");
4742
4755
  }
@@ -4775,7 +4788,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
4775
4788
  registerComposition,
4776
4789
  unregisterComposition
4777
4790
  ]);
4778
- useEffect16(() => {
4791
+ useEffect17(() => {
4779
4792
  window.dispatchEvent(new CustomEvent(PROPS_UPDATED_EXTERNALLY, {
4780
4793
  detail: {
4781
4794
  resetUnsaved: id
@@ -4813,7 +4826,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
4813
4826
  }
4814
4827
  return null;
4815
4828
  }, Composition = (props2) => {
4816
- const { onlyRenderComposition } = useContext27(CompositionSetters);
4829
+ const { onlyRenderComposition } = useContext28(CompositionSetters);
4817
4830
  if (onlyRenderComposition && onlyRenderComposition !== props2.id) {
4818
4831
  return null;
4819
4832
  }
@@ -4864,7 +4877,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
4864
4877
  const imageRef = useRef13(null);
4865
4878
  const errors = useRef13({});
4866
4879
  const { delayPlayback } = useBufferState();
4867
- const sequenceContext = useContext28(SequenceContext);
4880
+ const sequenceContext = useContext29(SequenceContext);
4868
4881
  if (!src) {
4869
4882
  throw new Error('No "src" prop was passed to <Img>.');
4870
4883
  }
@@ -5235,7 +5248,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
5235
5248
  }
5236
5249
  };
5237
5250
  }, []);
5238
- useEffect17(() => {
5251
+ useEffect18(() => {
5239
5252
  if (typeof __webpack_module__ !== "undefined") {
5240
5253
  if (__webpack_module__.hot) {
5241
5254
  __webpack_module__.hot.addStatusHandler((status) => {
@@ -5318,11 +5331,218 @@ Check that all your Remotion packages are on the same version. If your dependenc
5318
5331
  return ratio;
5319
5332
  }
5320
5333
  return Number(previewSize);
5334
+ }, getOffthreadVideoSource = ({
5335
+ src,
5336
+ transparent,
5337
+ currentTime,
5338
+ toneMapped
5339
+ }) => {
5340
+ return `http://localhost:${window.remotion_proxyPort}/proxy?src=${encodeURIComponent(getAbsoluteSrc(src))}&time=${encodeURIComponent(Math.max(0, currentTime))}&transparent=${String(transparent)}&toneMapped=${String(toneMapped)}`;
5341
+ }, OffthreadVideoForRendering = ({
5342
+ onError,
5343
+ volume: volumeProp,
5344
+ playbackRate,
5345
+ src,
5346
+ muted,
5347
+ allowAmplificationDuringRender,
5348
+ transparent,
5349
+ toneMapped,
5350
+ toneFrequency,
5351
+ name,
5352
+ loopVolumeCurveBehavior,
5353
+ delayRenderRetries,
5354
+ delayRenderTimeoutInMilliseconds,
5355
+ onVideoFrame,
5356
+ crossOrigin,
5357
+ audioStreamIndex,
5358
+ ...props2
5359
+ }) => {
5360
+ const absoluteFrame = useTimelinePosition();
5361
+ const frame = useCurrentFrame();
5362
+ const volumePropsFrame = useFrameForVolumeProp(loopVolumeCurveBehavior);
5363
+ const videoConfig = useUnsafeVideoConfig();
5364
+ const sequenceContext = useContext30(SequenceContext);
5365
+ const mediaStartsAt = useMediaStartsAt();
5366
+ const { registerRenderAsset, unregisterRenderAsset } = useContext30(RenderAssetManager);
5367
+ if (!src) {
5368
+ throw new TypeError("No `src` was passed to <OffthreadVideo>.");
5369
+ }
5370
+ const id = useMemo26(() => `offthreadvideo-${random(src)}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.relativeFrom}-${sequenceContext?.durationInFrames}`, [
5371
+ src,
5372
+ sequenceContext?.cumulatedFrom,
5373
+ sequenceContext?.relativeFrom,
5374
+ sequenceContext?.durationInFrames
5375
+ ]);
5376
+ if (!videoConfig) {
5377
+ throw new Error("No video config found");
5378
+ }
5379
+ const volume = evaluateVolume({
5380
+ volume: volumeProp,
5381
+ frame: volumePropsFrame,
5382
+ mediaVolume: 1
5383
+ });
5384
+ warnAboutTooHighVolume(volume);
5385
+ useEffect19(() => {
5386
+ if (!src) {
5387
+ throw new Error("No src passed");
5388
+ }
5389
+ if (!window.remotion_audioEnabled) {
5390
+ return;
5391
+ }
5392
+ if (muted) {
5393
+ return;
5394
+ }
5395
+ if (volume <= 0) {
5396
+ return;
5397
+ }
5398
+ registerRenderAsset({
5399
+ type: "video",
5400
+ src: getAbsoluteSrc(src),
5401
+ id,
5402
+ frame: absoluteFrame,
5403
+ volume,
5404
+ mediaFrame: frame,
5405
+ playbackRate,
5406
+ toneFrequency,
5407
+ audioStartFrame: Math.max(0, -(sequenceContext?.relativeFrom ?? 0)),
5408
+ audioStreamIndex
5409
+ });
5410
+ return () => unregisterRenderAsset(id);
5411
+ }, [
5412
+ muted,
5413
+ src,
5414
+ registerRenderAsset,
5415
+ id,
5416
+ unregisterRenderAsset,
5417
+ volume,
5418
+ frame,
5419
+ absoluteFrame,
5420
+ playbackRate,
5421
+ toneFrequency,
5422
+ sequenceContext?.relativeFrom,
5423
+ audioStreamIndex
5424
+ ]);
5425
+ const currentTime = useMemo26(() => {
5426
+ return getExpectedMediaFrameUncorrected({
5427
+ frame,
5428
+ playbackRate: playbackRate || 1,
5429
+ startFrom: -mediaStartsAt
5430
+ }) / videoConfig.fps;
5431
+ }, [frame, mediaStartsAt, playbackRate, videoConfig.fps]);
5432
+ const actualSrc = useMemo26(() => {
5433
+ return getOffthreadVideoSource({
5434
+ src,
5435
+ currentTime,
5436
+ transparent,
5437
+ toneMapped
5438
+ });
5439
+ }, [toneMapped, currentTime, src, transparent]);
5440
+ const [imageSrc, setImageSrc] = useState18(null);
5441
+ const { delayRender: delayRender2, continueRender: continueRender2 } = useDelayRender();
5442
+ useLayoutEffect9(() => {
5443
+ if (!window.remotion_videoEnabled) {
5444
+ return;
5445
+ }
5446
+ const cleanup = [];
5447
+ setImageSrc(null);
5448
+ const controller = new AbortController;
5449
+ const newHandle = delayRender2(`Fetching ${actualSrc} from server`, {
5450
+ retries: delayRenderRetries ?? undefined,
5451
+ timeoutInMilliseconds: delayRenderTimeoutInMilliseconds ?? undefined
5452
+ });
5453
+ const execute = async () => {
5454
+ try {
5455
+ const res = await fetch(actualSrc, {
5456
+ signal: controller.signal,
5457
+ cache: "no-store"
5458
+ });
5459
+ if (res.status !== 200) {
5460
+ if (res.status === 500) {
5461
+ const json = await res.json();
5462
+ if (json.error) {
5463
+ const cleanedUpErrorMessage = json.error.replace(/^Error: /, "");
5464
+ throw new Error(cleanedUpErrorMessage);
5465
+ }
5466
+ }
5467
+ throw new Error(`Server returned status ${res.status} while fetching ${actualSrc}`);
5468
+ }
5469
+ const blob = await res.blob();
5470
+ const url = URL.createObjectURL(blob);
5471
+ cleanup.push(() => URL.revokeObjectURL(url));
5472
+ setImageSrc({
5473
+ src: url,
5474
+ handle: newHandle
5475
+ });
5476
+ } catch (err) {
5477
+ if (err.message.includes("aborted")) {
5478
+ continueRender2(newHandle);
5479
+ return;
5480
+ }
5481
+ if (controller.signal.aborted) {
5482
+ continueRender2(newHandle);
5483
+ return;
5484
+ }
5485
+ if (err.message.includes("Failed to fetch")) {
5486
+ err = new Error(`Failed to fetch ${actualSrc}. This could be caused by Chrome rejecting the request because the disk space is low. Consider increasing the disk size of your environment.`, { cause: err });
5487
+ }
5488
+ if (onError) {
5489
+ onError(err);
5490
+ } else {
5491
+ cancelRender(err);
5492
+ }
5493
+ }
5494
+ };
5495
+ execute();
5496
+ cleanup.push(() => {
5497
+ if (controller.signal.aborted) {
5498
+ return;
5499
+ }
5500
+ controller.abort();
5501
+ });
5502
+ return () => {
5503
+ cleanup.forEach((c2) => c2());
5504
+ };
5505
+ }, [
5506
+ actualSrc,
5507
+ delayRenderRetries,
5508
+ delayRenderTimeoutInMilliseconds,
5509
+ onError,
5510
+ continueRender2,
5511
+ delayRender2
5512
+ ]);
5513
+ const onErr = useCallback15(() => {
5514
+ if (onError) {
5515
+ onError?.(new Error("Failed to load image with src " + imageSrc));
5516
+ } else {
5517
+ cancelRender("Failed to load image with src " + imageSrc);
5518
+ }
5519
+ }, [imageSrc, onError]);
5520
+ const className = useMemo26(() => {
5521
+ return [OBJECTFIT_CONTAIN_CLASS_NAME, props2.className].filter(truthy).join(" ");
5522
+ }, [props2.className]);
5523
+ const onImageFrame = useCallback15((img) => {
5524
+ if (onVideoFrame) {
5525
+ onVideoFrame(img);
5526
+ }
5527
+ }, [onVideoFrame]);
5528
+ if (!imageSrc || !window.remotion_videoEnabled) {
5529
+ return null;
5530
+ }
5531
+ continueRender2(imageSrc.handle);
5532
+ return /* @__PURE__ */ jsx27(Img, {
5533
+ src: imageSrc.src,
5534
+ delayRenderRetries,
5535
+ delayRenderTimeoutInMilliseconds,
5536
+ onImageFrame,
5537
+ ...props2,
5538
+ onError: onErr,
5539
+ className
5540
+ });
5321
5541
  }, useEmitVideoFrame = ({
5322
5542
  ref,
5323
5543
  onVideoFrame
5324
5544
  }) => {
5325
- useEffect18(() => {
5545
+ useEffect20(() => {
5326
5546
  const { current } = ref;
5327
5547
  if (!current) {
5328
5548
  return;
@@ -5344,12 +5564,12 @@ Check that all your Remotion packages are on the same version. If your dependenc
5344
5564
  };
5345
5565
  }, [onVideoFrame, ref]);
5346
5566
  }, VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
5347
- const context = useContext29(SharedAudioContext);
5567
+ const context = useContext31(SharedAudioContext);
5348
5568
  if (!context) {
5349
5569
  throw new Error("SharedAudioContext not found");
5350
5570
  }
5351
5571
  const videoRef = useRef16(null);
5352
- const sharedSource = useMemo26(() => {
5572
+ const sharedSource = useMemo27(() => {
5353
5573
  if (!context.audioContext) {
5354
5574
  return null;
5355
5575
  }
@@ -5392,11 +5612,11 @@ Check that all your Remotion packages are on the same version. If your dependenc
5392
5612
  }
5393
5613
  const volumePropFrame = useFrameForVolumeProp(loopVolumeCurveBehavior ?? "repeat");
5394
5614
  const { fps, durationInFrames } = useVideoConfig();
5395
- const parentSequence = useContext29(SequenceContext);
5396
- const { hidden } = useContext29(SequenceVisibilityToggleContext);
5615
+ const parentSequence = useContext31(SequenceContext);
5616
+ const { hidden } = useContext31(SequenceVisibilityToggleContext);
5397
5617
  const logLevel = useLogLevel();
5398
5618
  const mountTime = useMountTime();
5399
- const [timelineId] = useState18(() => String(Math.random()));
5619
+ const [timelineId] = useState19(() => String(Math.random()));
5400
5620
  const isSequenceHidden = hidden[timelineId] ?? false;
5401
5621
  if (typeof acceptableTimeShift !== "undefined") {
5402
5622
  throw new Error("acceptableTimeShift has been removed. Use acceptableTimeShiftInSeconds instead.");
@@ -5410,7 +5630,6 @@ Check that all your Remotion packages are on the same version. If your dependenc
5410
5630
  });
5411
5631
  warnAboutTooHighVolume(userPreferredVolume);
5412
5632
  useMediaInTimeline({
5413
- mediaRef: videoRef,
5414
5633
  volume,
5415
5634
  mediaVolume,
5416
5635
  mediaType: "video",
@@ -5420,11 +5639,8 @@ Check that all your Remotion packages are on the same version. If your dependenc
5420
5639
  id: timelineId,
5421
5640
  stack: _remotionInternalStack,
5422
5641
  showInTimeline,
5423
- premountDisplay: null,
5424
- postmountDisplay: null,
5425
- onAutoPlayError: onAutoPlayError ?? null,
5426
- isPremounting: Boolean(parentSequence?.premounting),
5427
- isPostmounting: Boolean(parentSequence?.postmounting)
5642
+ premountDisplay: parentSequence?.premountDisplay ?? null,
5643
+ postmountDisplay: parentSequence?.postmountDisplay ?? null
5428
5644
  });
5429
5645
  useMediaPlayback({
5430
5646
  mediaRef: videoRef,
@@ -5438,6 +5654,14 @@ Check that all your Remotion packages are on the same version. If your dependenc
5438
5654
  pauseWhenBuffering,
5439
5655
  onAutoPlayError: onAutoPlayError ?? null
5440
5656
  });
5657
+ useMediaTag({
5658
+ id: timelineId,
5659
+ isPostmounting: Boolean(parentSequence?.postmounting),
5660
+ isPremounting: Boolean(parentSequence?.premounting),
5661
+ mediaRef: videoRef,
5662
+ mediaType: "video",
5663
+ onAutoPlayError: onAutoPlayError ?? null
5664
+ });
5441
5665
  useVolume({
5442
5666
  logLevel,
5443
5667
  mediaRef: videoRef,
@@ -5457,13 +5681,13 @@ Check that all your Remotion packages are on the same version. If your dependenc
5457
5681
  useImperativeHandle9(ref, () => {
5458
5682
  return videoRef.current;
5459
5683
  }, []);
5460
- useState18(() => playbackLogging({
5684
+ useState19(() => playbackLogging({
5461
5685
  logLevel,
5462
5686
  message: `Mounting video with source = ${actualSrc}, v=${VERSION}, user agent=${typeof navigator === "undefined" ? "server" : navigator.userAgent}`,
5463
5687
  tag: "video",
5464
5688
  mountTime
5465
5689
  }));
5466
- useEffect19(() => {
5690
+ useEffect21(() => {
5467
5691
  const { current } = videoRef;
5468
5692
  if (!current) {
5469
5693
  return;
@@ -5494,7 +5718,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
5494
5718
  const currentOnDurationCallback = useRef16(onDuration);
5495
5719
  currentOnDurationCallback.current = onDuration;
5496
5720
  useEmitVideoFrame({ ref: videoRef, onVideoFrame });
5497
- useEffect19(() => {
5721
+ useEffect21(() => {
5498
5722
  const { current } = videoRef;
5499
5723
  if (!current) {
5500
5724
  return;
@@ -5511,7 +5735,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
5511
5735
  current.removeEventListener("loadedmetadata", onLoadedMetadata);
5512
5736
  };
5513
5737
  }, [src]);
5514
- useEffect19(() => {
5738
+ useEffect21(() => {
5515
5739
  const { current } = videoRef;
5516
5740
  if (!current) {
5517
5741
  return;
@@ -5522,7 +5746,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
5522
5746
  current.preload = "auto";
5523
5747
  }
5524
5748
  }, []);
5525
- const actualStyle = useMemo26(() => {
5749
+ const actualStyle = useMemo27(() => {
5526
5750
  return {
5527
5751
  ...style,
5528
5752
  opacity: isSequenceHidden ? 0 : style?.opacity ?? 1
@@ -5532,7 +5756,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
5532
5756
  crossOrigin,
5533
5757
  requestsVideoFrame: Boolean(onVideoFrame)
5534
5758
  });
5535
- return /* @__PURE__ */ jsx27("video", {
5759
+ return /* @__PURE__ */ jsx28("video", {
5536
5760
  ref: videoRef,
5537
5761
  muted: muted || mediaMuted || isSequenceHidden || userPreferredVolume <= 0,
5538
5762
  playsInline: true,
@@ -5543,31 +5767,181 @@ Check that all your Remotion packages are on the same version. If your dependenc
5543
5767
  crossOrigin: crossOriginValue,
5544
5768
  ...nativeProps
5545
5769
  });
5546
- }, VideoForPreview, WATCH_REMOTION_STATIC_FILES = "remotion_staticFilesChanged", RemotionContextProvider = (props2) => {
5770
+ }, VideoForPreview, InnerOffthreadVideo = (props2) => {
5771
+ const {
5772
+ startFrom,
5773
+ endAt,
5774
+ trimBefore,
5775
+ trimAfter,
5776
+ name,
5777
+ pauseWhenBuffering,
5778
+ stack,
5779
+ showInTimeline,
5780
+ ...otherProps
5781
+ } = props2;
5782
+ const environment = useRemotionEnvironment();
5783
+ const onDuration = useCallback16(() => {
5784
+ return;
5785
+ }, []);
5786
+ if (typeof props2.src !== "string") {
5787
+ throw new TypeError(`The \`<OffthreadVideo>\` tag requires a string for \`src\`, but got ${JSON.stringify(props2.src)} instead.`);
5788
+ }
5789
+ validateMediaTrimProps({ startFrom, endAt, trimBefore, trimAfter });
5790
+ const { trimBeforeValue, trimAfterValue } = resolveTrimProps({
5791
+ startFrom,
5792
+ endAt,
5793
+ trimBefore,
5794
+ trimAfter
5795
+ });
5796
+ if (typeof trimBeforeValue !== "undefined" || typeof trimAfterValue !== "undefined") {
5797
+ return /* @__PURE__ */ jsx29(Sequence, {
5798
+ layout: "none",
5799
+ from: 0 - (trimBeforeValue ?? 0),
5800
+ showInTimeline: false,
5801
+ durationInFrames: trimAfterValue,
5802
+ name,
5803
+ children: /* @__PURE__ */ jsx29(InnerOffthreadVideo, {
5804
+ pauseWhenBuffering: pauseWhenBuffering ?? false,
5805
+ ...otherProps,
5806
+ trimAfter: undefined,
5807
+ name: undefined,
5808
+ showInTimeline,
5809
+ trimBefore: undefined,
5810
+ stack: undefined,
5811
+ startFrom: undefined,
5812
+ endAt: undefined
5813
+ })
5814
+ });
5815
+ }
5816
+ validateMediaProps(props2, "Video");
5817
+ if (environment.isRendering) {
5818
+ return /* @__PURE__ */ jsx29(OffthreadVideoForRendering, {
5819
+ pauseWhenBuffering: pauseWhenBuffering ?? false,
5820
+ ...otherProps,
5821
+ trimAfter: undefined,
5822
+ name: undefined,
5823
+ showInTimeline,
5824
+ trimBefore: undefined,
5825
+ stack: undefined,
5826
+ startFrom: undefined,
5827
+ endAt: undefined
5828
+ });
5829
+ }
5830
+ const {
5831
+ transparent,
5832
+ toneMapped,
5833
+ onAutoPlayError,
5834
+ onVideoFrame,
5835
+ crossOrigin,
5836
+ delayRenderRetries,
5837
+ delayRenderTimeoutInMilliseconds,
5838
+ ...propsForPreview
5839
+ } = otherProps;
5840
+ return /* @__PURE__ */ jsx29(VideoForPreview, {
5841
+ _remotionInternalStack: stack ?? null,
5842
+ onDuration,
5843
+ onlyWarnForMediaSeekingError: true,
5844
+ pauseWhenBuffering: pauseWhenBuffering ?? false,
5845
+ showInTimeline: showInTimeline ?? true,
5846
+ onAutoPlayError: onAutoPlayError ?? undefined,
5847
+ onVideoFrame: onVideoFrame ?? null,
5848
+ crossOrigin,
5849
+ ...propsForPreview,
5850
+ _remotionInternalNativeLoopPassed: false
5851
+ });
5852
+ }, OffthreadVideo = ({
5853
+ src,
5854
+ acceptableTimeShiftInSeconds,
5855
+ allowAmplificationDuringRender,
5856
+ audioStreamIndex,
5857
+ className,
5858
+ crossOrigin,
5859
+ delayRenderRetries,
5860
+ delayRenderTimeoutInMilliseconds,
5861
+ id,
5862
+ loopVolumeCurveBehavior,
5863
+ muted,
5864
+ name,
5865
+ onAutoPlayError,
5866
+ onError,
5867
+ onVideoFrame,
5868
+ pauseWhenBuffering,
5869
+ playbackRate,
5870
+ showInTimeline,
5871
+ style,
5872
+ toneFrequency,
5873
+ toneMapped,
5874
+ transparent,
5875
+ trimAfter,
5876
+ trimBefore,
5877
+ useWebAudioApi,
5878
+ volume,
5879
+ _remotionInternalNativeLoopPassed,
5880
+ endAt,
5881
+ stack,
5882
+ startFrom,
5883
+ imageFormat
5884
+ }) => {
5885
+ if (imageFormat) {
5886
+ throw new TypeError(`The \`<OffthreadVideo>\` tag does no longer accept \`imageFormat\`. Use the \`transparent\` prop if you want to render a transparent video.`);
5887
+ }
5888
+ return /* @__PURE__ */ jsx29(InnerOffthreadVideo, {
5889
+ acceptableTimeShiftInSeconds,
5890
+ allowAmplificationDuringRender: allowAmplificationDuringRender ?? true,
5891
+ audioStreamIndex: audioStreamIndex ?? 0,
5892
+ className,
5893
+ crossOrigin,
5894
+ delayRenderRetries,
5895
+ delayRenderTimeoutInMilliseconds,
5896
+ id,
5897
+ loopVolumeCurveBehavior: loopVolumeCurveBehavior ?? "repeat",
5898
+ muted: muted ?? false,
5899
+ name,
5900
+ onAutoPlayError: onAutoPlayError ?? null,
5901
+ onError,
5902
+ onVideoFrame,
5903
+ pauseWhenBuffering: pauseWhenBuffering ?? true,
5904
+ playbackRate: playbackRate ?? 1,
5905
+ toneFrequency: toneFrequency ?? 1,
5906
+ showInTimeline: showInTimeline ?? true,
5907
+ src,
5908
+ stack,
5909
+ startFrom,
5910
+ _remotionInternalNativeLoopPassed: _remotionInternalNativeLoopPassed ?? false,
5911
+ endAt,
5912
+ style,
5913
+ toneMapped: toneMapped ?? true,
5914
+ transparent: transparent ?? false,
5915
+ trimAfter,
5916
+ trimBefore,
5917
+ useWebAudioApi: useWebAudioApi ?? false,
5918
+ volume
5919
+ });
5920
+ }, WATCH_REMOTION_STATIC_FILES = "remotion_staticFilesChanged", RemotionContextProvider = (props2) => {
5547
5921
  const { children, contexts } = props2;
5548
- return /* @__PURE__ */ jsx28(LogLevelContext.Provider, {
5922
+ return /* @__PURE__ */ jsx30(LogLevelContext.Provider, {
5549
5923
  value: contexts.logLevelContext,
5550
- children: /* @__PURE__ */ jsx28(CanUseRemotionHooks.Provider, {
5924
+ children: /* @__PURE__ */ jsx30(CanUseRemotionHooks.Provider, {
5551
5925
  value: contexts.canUseRemotionHooksContext,
5552
- children: /* @__PURE__ */ jsx28(NonceContext.Provider, {
5926
+ children: /* @__PURE__ */ jsx30(NonceContext.Provider, {
5553
5927
  value: contexts.nonceContext,
5554
- children: /* @__PURE__ */ jsx28(PreloadContext.Provider, {
5928
+ children: /* @__PURE__ */ jsx30(PreloadContext.Provider, {
5555
5929
  value: contexts.preloadContext,
5556
- children: /* @__PURE__ */ jsx28(CompositionManager.Provider, {
5930
+ children: /* @__PURE__ */ jsx30(CompositionManager.Provider, {
5557
5931
  value: contexts.compositionManagerCtx,
5558
- children: /* @__PURE__ */ jsx28(SequenceManager.Provider, {
5932
+ children: /* @__PURE__ */ jsx30(SequenceManager.Provider, {
5559
5933
  value: contexts.sequenceManagerContext,
5560
- children: /* @__PURE__ */ jsx28(RenderAssetManager.Provider, {
5934
+ children: /* @__PURE__ */ jsx30(RenderAssetManager.Provider, {
5561
5935
  value: contexts.renderAssetManagerContext,
5562
- children: /* @__PURE__ */ jsx28(ResolveCompositionContext.Provider, {
5936
+ children: /* @__PURE__ */ jsx30(ResolveCompositionContext.Provider, {
5563
5937
  value: contexts.resolveCompositionContext,
5564
- children: /* @__PURE__ */ jsx28(TimelineContext.Provider, {
5938
+ children: /* @__PURE__ */ jsx30(TimelineContext.Provider, {
5565
5939
  value: contexts.timelineContext,
5566
- children: /* @__PURE__ */ jsx28(SetTimelineContext.Provider, {
5940
+ children: /* @__PURE__ */ jsx30(SetTimelineContext.Provider, {
5567
5941
  value: contexts.setTimelineContext,
5568
- children: /* @__PURE__ */ jsx28(SequenceContext.Provider, {
5942
+ children: /* @__PURE__ */ jsx30(SequenceContext.Provider, {
5569
5943
  value: contexts.sequenceContext,
5570
- children: /* @__PURE__ */ jsx28(BufferingContextReact.Provider, {
5944
+ children: /* @__PURE__ */ jsx30(BufferingContextReact.Provider, {
5571
5945
  value: contexts.bufferManagerContext,
5572
5946
  children
5573
5947
  })
@@ -5606,36 +5980,36 @@ Check that all your Remotion packages are on the same version. If your dependenc
5606
5980
  throw new RangeError(`Cannot use frame ${frame}: Duration of composition is ${durationInFrames}, therefore the highest frame that can be rendered is ${durationInFrames - 1}`);
5607
5981
  }
5608
5982
  }, flattenChildren = (children) => {
5609
- const childrenArray = React29.Children.toArray(children);
5983
+ const childrenArray = React31.Children.toArray(children);
5610
5984
  return childrenArray.reduce((flatChildren, child) => {
5611
- if (child.type === React29.Fragment) {
5985
+ if (child.type === React31.Fragment) {
5612
5986
  return flatChildren.concat(flattenChildren(child.props.children));
5613
5987
  }
5614
5988
  flatChildren.push(child);
5615
5989
  return flatChildren;
5616
5990
  }, []);
5617
5991
  }, IsInsideSeriesContext, IsInsideSeriesContainer = ({ children }) => {
5618
- return /* @__PURE__ */ jsx29(IsInsideSeriesContext.Provider, {
5992
+ return /* @__PURE__ */ jsx31(IsInsideSeriesContext.Provider, {
5619
5993
  value: true,
5620
5994
  children
5621
5995
  });
5622
5996
  }, IsNotInsideSeriesProvider = ({ children }) => {
5623
- return /* @__PURE__ */ jsx29(IsInsideSeriesContext.Provider, {
5997
+ return /* @__PURE__ */ jsx31(IsInsideSeriesContext.Provider, {
5624
5998
  value: false,
5625
5999
  children
5626
6000
  });
5627
6001
  }, useRequireToBeInsideSeries = () => {
5628
- const isInsideSeries = React30.useContext(IsInsideSeriesContext);
6002
+ const isInsideSeries = React322.useContext(IsInsideSeriesContext);
5629
6003
  if (!isInsideSeries) {
5630
6004
  throw new Error("This component must be inside a <Series /> component.");
5631
6005
  }
5632
6006
  }, SeriesSequenceRefForwardingFunction = ({ children }, _ref) => {
5633
6007
  useRequireToBeInsideSeries();
5634
- return /* @__PURE__ */ jsx30(IsNotInsideSeriesProvider, {
6008
+ return /* @__PURE__ */ jsx322(IsNotInsideSeriesProvider, {
5635
6009
  children
5636
6010
  });
5637
6011
  }, SeriesSequence, Series = (props2) => {
5638
- const childrenValue = useMemo28(() => {
6012
+ const childrenValue = useMemo29(() => {
5639
6013
  let startFrame = 0;
5640
6014
  const flattenedChildren = flattenChildren(props2.children);
5641
6015
  return Children.map(flattenedChildren, (child, i) => {
@@ -5679,7 +6053,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
5679
6053
  }
5680
6054
  const currentStartFrame = startFrame + offset;
5681
6055
  startFrame += durationInFramesProp + offset;
5682
- return /* @__PURE__ */ jsx30(Sequence, {
6056
+ return /* @__PURE__ */ jsx322(Sequence, {
5683
6057
  name: name || "<Series.Sequence>",
5684
6058
  from: currentStartFrame,
5685
6059
  durationInFrames: durationInFramesProp,
@@ -5690,14 +6064,14 @@ Check that all your Remotion packages are on the same version. If your dependenc
5690
6064
  });
5691
6065
  }, [props2.children]);
5692
6066
  if (ENABLE_V5_BREAKING_CHANGES) {
5693
- return /* @__PURE__ */ jsx30(IsInsideSeriesContainer, {
5694
- children: /* @__PURE__ */ jsx30(Sequence, {
6067
+ return /* @__PURE__ */ jsx322(IsInsideSeriesContainer, {
6068
+ children: /* @__PURE__ */ jsx322(Sequence, {
5695
6069
  ...props2,
5696
6070
  children: childrenValue
5697
6071
  })
5698
6072
  });
5699
6073
  }
5700
- return /* @__PURE__ */ jsx30(IsInsideSeriesContainer, {
6074
+ return /* @__PURE__ */ jsx322(IsInsideSeriesContainer, {
5701
6075
  children: childrenValue
5702
6076
  });
5703
6077
  }, validateSpringDuration = (dur) => {
@@ -5917,13 +6291,13 @@ Check that all your Remotion packages are on the same version. If your dependenc
5917
6291
  const volumePropsFrame = useFrameForVolumeProp(loopVolumeCurveBehavior ?? "repeat");
5918
6292
  const videoConfig = useUnsafeVideoConfig();
5919
6293
  const videoRef = useRef17(null);
5920
- const sequenceContext = useContext31(SequenceContext);
6294
+ const sequenceContext = useContext32(SequenceContext);
5921
6295
  const mediaStartsAt = useMediaStartsAt();
5922
6296
  const environment = useRemotionEnvironment();
5923
6297
  const logLevel = useLogLevel();
5924
6298
  const mountTime = useMountTime();
5925
6299
  const { delayRender: delayRender2, continueRender: continueRender2 } = useDelayRender();
5926
- const { registerRenderAsset, unregisterRenderAsset } = useContext31(RenderAssetManager);
6300
+ const { registerRenderAsset, unregisterRenderAsset } = useContext32(RenderAssetManager);
5927
6301
  const id = useMemo30(() => `video-${random(props2.src ?? "")}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.relativeFrom}-${sequenceContext?.durationInFrames}`, [
5928
6302
  props2.src,
5929
6303
  sequenceContext?.cumulatedFrom,
@@ -5939,7 +6313,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
5939
6313
  mediaVolume: 1
5940
6314
  });
5941
6315
  warnAboutTooHighVolume(volume);
5942
- useEffect21(() => {
6316
+ useEffect222(() => {
5943
6317
  if (!props2.src) {
5944
6318
  throw new Error("No src passed");
5945
6319
  }
@@ -5960,7 +6334,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
5960
6334
  volume,
5961
6335
  mediaFrame: frame,
5962
6336
  playbackRate: playbackRate ?? 1,
5963
- toneFrequency: toneFrequency ?? null,
6337
+ toneFrequency: toneFrequency ?? 1,
5964
6338
  audioStartFrame: Math.max(0, -(sequenceContext?.relativeFrom ?? 0)),
5965
6339
  audioStreamIndex: audioStreamIndex ?? 0
5966
6340
  });
@@ -5982,7 +6356,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
5982
6356
  useImperativeHandle10(ref, () => {
5983
6357
  return videoRef.current;
5984
6358
  }, []);
5985
- useEffect21(() => {
6359
+ useEffect222(() => {
5986
6360
  if (!window.remotion_videoEnabled) {
5987
6361
  return;
5988
6362
  }
@@ -6122,7 +6496,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
6122
6496
  const { loop, ...propsOtherThanLoop } = props2;
6123
6497
  const { fps } = useVideoConfig();
6124
6498
  const environment = useRemotionEnvironment();
6125
- const { durations, setDurations } = useContext32(DurationsContext);
6499
+ const { durations, setDurations } = useContext33(DurationsContext);
6126
6500
  if (typeof ref === "string") {
6127
6501
  throw new Error("string refs are not supported");
6128
6502
  }
@@ -6153,10 +6527,10 @@ Check that all your Remotion packages are on the same version. If your dependenc
6153
6527
  const mediaDuration = durationFetched * fps;
6154
6528
  return /* @__PURE__ */ jsx34(Loop, {
6155
6529
  durationInFrames: calculateLoopDuration({
6156
- endAt: trimAfterValue ?? undefined,
6157
- mediaDuration,
6530
+ trimAfter: trimAfterValue,
6531
+ mediaDurationInFrames: mediaDuration,
6158
6532
  playbackRate: props2.playbackRate ?? 1,
6159
- startFrom: trimBeforeValue ?? undefined
6533
+ trimBefore: trimBeforeValue
6160
6534
  }),
6161
6535
  layout: "none",
6162
6536
  name,
@@ -6181,7 +6555,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
6181
6555
  })
6182
6556
  });
6183
6557
  }
6184
- validateMediaProps(props2, "Video");
6558
+ validateMediaProps({ playbackRate: props2.playbackRate, volume: props2.volume }, "Video");
6185
6559
  if (environment.isRendering) {
6186
6560
  return /* @__PURE__ */ jsx34(VideoForRendering, {
6187
6561
  onDuration,
@@ -6545,6 +6919,7 @@ var init_esm = __esm(() => {
6545
6919
  size: { size: "auto", translation: { x: 0, y: 0 } }
6546
6920
  });
6547
6921
  VideoForPreview = forwardRef9(VideoForDevelopmentRefForwardingFunction);
6922
+ addSequenceStackTraces(OffthreadVideo);
6548
6923
  compositionSelectorRef = createRef3();
6549
6924
  Internals = {
6550
6925
  useUnsafeVideoConfig,
@@ -6566,6 +6941,7 @@ var init_esm = __esm(() => {
6566
6941
  getRoot,
6567
6942
  useMediaVolumeState,
6568
6943
  useMediaMutedState,
6944
+ useMediaInTimeline,
6569
6945
  useLazyComponent,
6570
6946
  truthy,
6571
6947
  SequenceContext,
@@ -6579,6 +6955,7 @@ var init_esm = __esm(() => {
6579
6955
  SharedAudioContext,
6580
6956
  SharedAudioContextProvider,
6581
6957
  invalidCompositionErrorMessage,
6958
+ calculateLoopDuration,
6582
6959
  isCompositionIdValid,
6583
6960
  getPreviewDomElement,
6584
6961
  compositionsRef,
@@ -6625,7 +7002,8 @@ var init_esm = __esm(() => {
6625
7002
  RemotionEnvironmentContext,
6626
7003
  warnAboutTooHighVolume,
6627
7004
  AudioForPreview,
6628
- OBJECTFIT_CONTAIN_CLASS_NAME
7005
+ OBJECTFIT_CONTAIN_CLASS_NAME,
7006
+ InnerOffthreadVideo
6629
7007
  };
6630
7008
  PERCENTAGE = NUMBER + "%";
6631
7009
  IsInsideSeriesContext = createContext19(false);
@@ -8379,7 +8757,7 @@ var PricingBulletPoint = ({ text, checked, children }) => {
8379
8757
  style: greyCircle
8380
8758
  }),
8381
8759
  /* @__PURE__ */ jsxs3("div", {
8382
- className: "fontbrand text-lg ",
8760
+ className: "fontbrand text-lg\t",
8383
8761
  children: [
8384
8762
  text,
8385
8763
  children
@@ -11823,13 +12201,13 @@ import { jsx as jsx35, jsxs as jsxs10 } from "react/jsx-runtime";
11823
12201
  import { jsx as jsx210, jsxs as jsxs23, Fragment } from "react/jsx-runtime";
11824
12202
  import React6 from "react";
11825
12203
  import { useContext as useContext210, useEffect as useEffect23, useState as useState20 } from "react";
11826
- import { useContext as useContext33, useEffect as useEffect24 } from "react";
12204
+ import { useContext as useContext34, useEffect as useEffect24 } from "react";
11827
12205
  import { jsx as jsx36 } from "react/jsx-runtime";
11828
12206
  import { useCallback as useCallback18, useRef as useRef18 } from "react";
11829
12207
  import { useEffect as useEffect32, useState as useState23 } from "react";
11830
12208
  import { useContext as useContext42, useEffect as useEffect62, useRef as useRef42 } from "react";
11831
12209
  import { useEffect as useEffect42 } from "react";
11832
- import { useCallback as useCallback23, useContext as useContext34, useMemo as useMemo31, useRef as useRef22, useState as useState32 } from "react";
12210
+ import { useCallback as useCallback23, useContext as useContext35, useMemo as useMemo31, useRef as useRef22, useState as useState32 } from "react";
11833
12211
  import { useEffect as useEffect52, useRef as useRef32 } from "react";
11834
12212
  import { useCallback as useCallback32, useEffect as useEffect72, useMemo as useMemo210, useState as useState42 } from "react";
11835
12213
  import {
@@ -12465,7 +12843,7 @@ var getAbsoluteSrc2 = (relativeSrc) => {
12465
12843
  }
12466
12844
  return new URL(relativeSrc, window.origin).href;
12467
12845
  };
12468
- var getOffthreadVideoSource = ({
12846
+ var getOffthreadVideoSource2 = ({
12469
12847
  src,
12470
12848
  transparent,
12471
12849
  currentTime,
@@ -12489,7 +12867,7 @@ var NoReactInternals = {
12489
12867
  DELAY_RENDER_RETRY_TOKEN: DELAY_RENDER_RETRY_TOKEN2,
12490
12868
  DELAY_RENDER_CLEAR_TOKEN: DELAY_RENDER_CLEAR_TOKEN2,
12491
12869
  DELAY_RENDER_ATTEMPT_TOKEN: DELAY_RENDER_RETRIES_LEFT2,
12492
- getOffthreadVideoSource,
12870
+ getOffthreadVideoSource: getOffthreadVideoSource2,
12493
12871
  getExpectedMediaFrameUncorrected: getExpectedMediaFrameUncorrected2,
12494
12872
  ENABLE_V5_BREAKING_CHANGES: ENABLE_V5_BREAKING_CHANGES2,
12495
12873
  MIN_NODE_VERSION: ENABLE_V5_BREAKING_CHANGES2 ? 18 : 16,
@@ -12956,7 +13334,7 @@ class ThumbnailEmitter {
12956
13334
  };
12957
13335
  }
12958
13336
  var useBufferStateEmitter = (emitter) => {
12959
- const bufferManager = useContext33(Internals.BufferingContextReact);
13337
+ const bufferManager = useContext34(Internals.BufferingContextReact);
12960
13338
  if (!bufferManager) {
12961
13339
  throw new Error("BufferingContextReact not found");
12962
13340
  }
@@ -13039,20 +13417,20 @@ var usePlayer = () => {
13039
13417
  const playStart = useRef22(frame);
13040
13418
  const setFrame = Internals.Timeline.useTimelineSetFrame();
13041
13419
  const setTimelinePosition = Internals.Timeline.useTimelineSetFrame();
13042
- const audioContext = useContext34(Internals.SharedAudioContext);
13043
- const { audioAndVideoTags } = useContext34(Internals.Timeline.TimelineContext);
13420
+ const audioContext = useContext35(Internals.SharedAudioContext);
13421
+ const { audioAndVideoTags } = useContext35(Internals.Timeline.TimelineContext);
13044
13422
  const frameRef = useRef22(frame);
13045
13423
  frameRef.current = frame;
13046
13424
  const video = Internals.useVideo();
13047
13425
  const config = Internals.useUnsafeVideoConfig();
13048
- const emitter = useContext34(PlayerEventEmitterContext);
13426
+ const emitter = useContext35(PlayerEventEmitterContext);
13049
13427
  const lastFrame = (config?.durationInFrames ?? 1) - 1;
13050
13428
  const isLastFrame = frame === lastFrame;
13051
13429
  const isFirstFrame = frame === 0;
13052
13430
  if (!emitter) {
13053
13431
  throw new TypeError("Expected Player event emitter context");
13054
13432
  }
13055
- const bufferingContext = useContext34(Internals.BufferingContextReact);
13433
+ const bufferingContext = useContext35(Internals.BufferingContextReact);
13056
13434
  if (!bufferingContext) {
13057
13435
  throw new Error("Missing the buffering context. Most likely you have a Remotion version mismatch.");
13058
13436
  }
@@ -16628,7 +17006,7 @@ var UNDERLAY_RED = curriedTransparentize$1(0.9, RED);
16628
17006
  var BLUE_TEXT = curriedDarken$1(0.3, "#42e9f5");
16629
17007
 
16630
17008
  // src/components/homepage/layout/use-color-mode.tsx
16631
- import React11, { useContext as useContext35, useMemo as useMemo33 } from "react";
17009
+ import React11, { useContext as useContext36, useMemo as useMemo33 } from "react";
16632
17010
  import { jsx as jsx37 } from "react/jsx-runtime";
16633
17011
  var Context = React11.createContext(undefined);
16634
17012
  var ColorModeProvider = ({
@@ -16645,7 +17023,7 @@ var ColorModeProvider = ({
16645
17023
  });
16646
17024
  };
16647
17025
  function useColorMode() {
16648
- const context = useContext35(Context);
17026
+ const context = useContext36(Context);
16649
17027
  if (context === null || context === undefined) {
16650
17028
  throw new Error("ColorModeProvider");
16651
17029
  }
@@ -17847,7 +18225,7 @@ var DoneCheckmark = () => {
17847
18225
  };
17848
18226
 
17849
18227
  // ../shapes/dist/esm/index.mjs
17850
- import React34, { useMemo as useMemo37 } from "react";
18228
+ import React29, { useMemo as useMemo37 } from "react";
17851
18229
  import { version } from "react-dom";
17852
18230
  import { jsx as jsx60, jsxs as jsxs21 } from "react/jsx-runtime";
17853
18231
  import { jsx as jsx212 } from "react/jsx-runtime";