@remotion/promo-pages 4.0.325 → 4.0.329
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/.turbo/turbo-make.log +2 -2
- package/dist/Homepage.js +341 -292
- package/dist/cn.d.ts +2 -0
- package/dist/cn.js +5 -0
- package/dist/components/Homepage.d.ts +6 -0
- package/dist/components/Homepage.js +20 -0
- package/dist/components/homepage/BackgroundAnimation.d.ts +2 -0
- package/dist/components/homepage/BackgroundAnimation.js +66 -0
- package/dist/components/homepage/ChooseTemplate.d.ts +2 -0
- package/dist/components/homepage/ChooseTemplate.js +27 -0
- package/dist/components/homepage/CommunityStats.d.ts +3 -0
- package/dist/components/homepage/CommunityStats.js +6 -0
- package/dist/components/homepage/CommunityStatsItems.d.ts +7 -0
- package/dist/components/homepage/CommunityStatsItems.js +58 -0
- package/dist/components/homepage/Counter.d.ts +9 -0
- package/dist/components/homepage/Counter.js +55 -0
- package/dist/components/homepage/Demo/Card.d.ts +15 -0
- package/dist/components/homepage/Demo/Card.js +174 -0
- package/dist/components/homepage/Demo/Cards.d.ts +15 -0
- package/dist/components/homepage/Demo/Cards.js +57 -0
- package/dist/components/homepage/Demo/Comp.d.ts +38 -0
- package/dist/components/homepage/Demo/Comp.js +71 -0
- package/dist/components/homepage/Demo/CurrentCountry.d.ts +9 -0
- package/dist/components/homepage/Demo/CurrentCountry.js +48 -0
- package/dist/components/homepage/Demo/DemoError.d.ts +2 -0
- package/dist/components/homepage/Demo/DemoError.js +10 -0
- package/dist/components/homepage/Demo/DemoErrorIcon.d.ts +2 -0
- package/dist/components/homepage/Demo/DemoErrorIcon.js +16 -0
- package/dist/components/homepage/Demo/DemoRender.d.ts +102 -0
- package/dist/components/homepage/Demo/DemoRender.js +95 -0
- package/dist/components/homepage/Demo/DigitWheel.d.ts +9 -0
- package/dist/components/homepage/Demo/DigitWheel.js +94 -0
- package/dist/components/homepage/Demo/DisplayedEmoji.d.ts +5 -0
- package/dist/components/homepage/Demo/DisplayedEmoji.js +63 -0
- package/dist/components/homepage/Demo/DoneCheckmark.d.ts +2 -0
- package/dist/components/homepage/Demo/DoneCheckmark.js +20 -0
- package/dist/components/homepage/Demo/DownloadNudge.d.ts +2 -0
- package/dist/components/homepage/Demo/DownloadNudge.js +27 -0
- package/dist/components/homepage/Demo/DragAndDropNudge.d.ts +3 -0
- package/dist/components/homepage/Demo/DragAndDropNudge.js +26 -0
- package/dist/components/homepage/Demo/EmojiCard.d.ts +10 -0
- package/dist/components/homepage/Demo/EmojiCard.js +119 -0
- package/dist/components/homepage/Demo/Minus.d.ts +5 -0
- package/dist/components/homepage/Demo/Minus.js +11 -0
- package/dist/components/homepage/Demo/PlayPauseButton.d.ts +5 -0
- package/dist/components/homepage/Demo/PlayPauseButton.js +47 -0
- package/dist/components/homepage/Demo/PlayerControls.d.ts +8 -0
- package/dist/components/homepage/Demo/PlayerControls.js +15 -0
- package/dist/components/homepage/Demo/PlayerSeekBar.d.ts +11 -0
- package/dist/components/homepage/Demo/PlayerSeekBar.js +216 -0
- package/dist/components/homepage/Demo/PlayerVolume.d.ts +5 -0
- package/dist/components/homepage/Demo/PlayerVolume.js +53 -0
- package/dist/components/homepage/Demo/Progress.d.ts +4 -0
- package/dist/components/homepage/Demo/Progress.js +14 -0
- package/dist/components/homepage/Demo/Spinner.d.ts +5 -0
- package/dist/components/homepage/Demo/Spinner.js +37 -0
- package/dist/components/homepage/Demo/Switcher.d.ts +6 -0
- package/dist/components/homepage/Demo/Switcher.js +25 -0
- package/dist/components/homepage/Demo/Temperature.d.ts +6 -0
- package/dist/components/homepage/Demo/Temperature.js +21 -0
- package/dist/components/homepage/Demo/TemperatureNumber.d.ts +5 -0
- package/dist/components/homepage/Demo/TemperatureNumber.js +36 -0
- package/dist/components/homepage/Demo/ThemeNudge.d.ts +3 -0
- package/dist/components/homepage/Demo/ThemeNudge.js +35 -0
- package/dist/components/homepage/Demo/TimeDisplay.d.ts +6 -0
- package/dist/components/homepage/Demo/TimeDisplay.js +27 -0
- package/dist/components/homepage/Demo/TrendingRepos.d.ts +6 -0
- package/dist/components/homepage/Demo/TrendingRepos.js +65 -0
- package/dist/components/homepage/Demo/icons.d.ts +10 -0
- package/dist/components/homepage/Demo/icons.js +22 -0
- package/dist/components/homepage/Demo/index.d.ts +2 -0
- package/dist/components/homepage/Demo/index.js +95 -0
- package/dist/components/homepage/Demo/math.d.ts +10 -0
- package/dist/components/homepage/Demo/math.js +29 -0
- package/dist/components/homepage/Demo/types.d.ts +6 -0
- package/dist/components/homepage/Demo/types.js +0 -0
- package/dist/components/homepage/EvaluateRemotion.d.ts +3 -0
- package/dist/components/homepage/EvaluateRemotion.js +39 -0
- package/dist/components/homepage/FreePricing.d.ts +4 -0
- package/dist/components/homepage/FreePricing.js +75 -0
- package/dist/components/homepage/GetStartedStrip.d.ts +2 -0
- package/dist/components/homepage/GetStartedStrip.js +14 -0
- package/dist/components/homepage/GitHubButton.d.ts +2 -0
- package/dist/components/homepage/GitHubButton.js +7 -0
- package/dist/components/homepage/IconForTemplate.d.ts +6 -0
- package/dist/components/homepage/IconForTemplate.js +98 -0
- package/dist/components/homepage/IfYouKnowReact.d.ts +3 -0
- package/dist/components/homepage/IfYouKnowReact.js +23 -0
- package/dist/components/homepage/InfoTooltip.d.ts +6 -0
- package/dist/components/homepage/InfoTooltip.js +6 -0
- package/dist/components/homepage/MoreTemplatesButton.d.ts +2 -0
- package/dist/components/homepage/MoreTemplatesButton.js +10 -0
- package/dist/components/homepage/MoreVideoPowerSection.d.ts +2 -0
- package/dist/components/homepage/MoreVideoPowerSection.js +16 -0
- package/dist/components/homepage/MuxVideo.d.ts +7 -0
- package/dist/components/homepage/MuxVideo.js +45 -0
- package/dist/components/homepage/NewsletterButton.d.ts +2 -0
- package/dist/components/homepage/NewsletterButton.js +39 -0
- package/dist/components/homepage/ParameterizeAndEdit.d.ts +2 -0
- package/dist/components/homepage/ParameterizeAndEdit.js +22 -0
- package/dist/components/homepage/Pricing.d.ts +2 -0
- package/dist/components/homepage/Pricing.js +15 -0
- package/dist/components/homepage/PricingBulletPoint.d.ts +6 -0
- package/dist/components/homepage/PricingBulletPoint.js +19 -0
- package/dist/components/homepage/RealMp4Videos.d.ts +2 -0
- package/dist/components/homepage/RealMp4Videos.js +41 -0
- package/dist/components/homepage/Spacer.d.ts +2 -0
- package/dist/components/homepage/Spacer.js +4 -0
- package/dist/components/homepage/TemplateIcon.d.ts +5 -0
- package/dist/components/homepage/TemplateIcon.js +24 -0
- package/dist/components/homepage/TextInput.d.ts +7 -0
- package/dist/components/homepage/TextInput.js +34 -0
- package/dist/components/homepage/TrustedByBanner.d.ts +2 -0
- package/dist/components/homepage/TrustedByBanner.js +32 -0
- package/dist/components/homepage/VideoApps.d.ts +4 -0
- package/dist/components/homepage/VideoApps.js +72 -0
- package/dist/components/homepage/VideoAppsShowcase.d.ts +3 -0
- package/dist/components/homepage/VideoAppsShowcase.js +163 -0
- package/dist/components/homepage/VideoAppsTitle.d.ts +4 -0
- package/dist/components/homepage/VideoAppsTitle.js +4 -0
- package/dist/components/homepage/VideoPlayerWithControls.d.ts +20 -0
- package/dist/components/homepage/VideoPlayerWithControls.js +104 -0
- package/dist/components/homepage/WriteInReact.d.ts +2 -0
- package/dist/components/homepage/WriteInReact.js +10 -0
- package/dist/components/homepage/YouAreHere.d.ts +2 -0
- package/dist/components/homepage/YouAreHere.js +23 -0
- package/dist/components/homepage/layout/Button.d.ts +19 -0
- package/dist/components/homepage/layout/Button.js +29 -0
- package/dist/components/homepage/layout/colors.d.ts +13 -0
- package/dist/components/homepage/layout/colors.js +14 -0
- package/dist/components/homepage/layout/use-color-mode.d.ts +21 -0
- package/dist/components/homepage/layout/use-color-mode.js +22 -0
- package/dist/components/homepage/layout/use-el-size.d.ts +5 -0
- package/dist/components/homepage/layout/use-el-size.js +40 -0
- package/dist/components/homepage/layout/use-mobile-layout.d.ts +1 -0
- package/dist/components/homepage/layout/use-mobile-layout.js +6 -0
- package/dist/components/icons/blank.d.ts +3 -0
- package/dist/components/icons/blank.js +4 -0
- package/dist/components/icons/clone.d.ts +2 -0
- package/dist/components/icons/clone.js +2 -0
- package/dist/components/icons/code-hike.d.ts +3 -0
- package/dist/components/icons/code-hike.js +4 -0
- package/dist/components/icons/cubes.d.ts +3 -0
- package/dist/components/icons/cubes.js +4 -0
- package/dist/components/icons/js.d.ts +3 -0
- package/dist/components/icons/js.js +4 -0
- package/dist/components/icons/music.d.ts +2 -0
- package/dist/components/icons/music.js +4 -0
- package/dist/components/icons/next.d.ts +4 -0
- package/dist/components/icons/next.js +4 -0
- package/dist/components/icons/overlay.d.ts +3 -0
- package/dist/components/icons/overlay.js +4 -0
- package/dist/components/icons/recorder.d.ts +3 -0
- package/dist/components/icons/recorder.js +4 -0
- package/dist/components/icons/remix.d.ts +3 -0
- package/dist/components/icons/remix.js +4 -0
- package/dist/components/icons/skia.d.ts +3 -0
- package/dist/components/icons/skia.js +4 -0
- package/dist/components/icons/stargazer.d.ts +3 -0
- package/dist/components/icons/stargazer.js +4 -0
- package/dist/components/icons/still.d.ts +3 -0
- package/dist/components/icons/still.js +4 -0
- package/dist/components/icons/tailwind.d.ts +3 -0
- package/dist/components/icons/tailwind.js +4 -0
- package/dist/components/icons/tiktok.d.ts +3 -0
- package/dist/components/icons/tiktok.js +4 -0
- package/dist/components/icons/ts.d.ts +3 -0
- package/dist/components/icons/ts.js +4 -0
- package/dist/components/icons/tts.d.ts +3 -0
- package/dist/components/icons/tts.js +4 -0
- package/dist/components/icons/undo.d.ts +3 -0
- package/dist/components/icons/undo.js +2 -0
- package/dist/components/icons/waveform.d.ts +3 -0
- package/dist/components/icons/waveform.js +4 -0
- package/dist/main.d.ts +1 -0
- package/dist/main.js +6 -0
- package/package.json +10 -10
package/dist/Homepage.js
CHANGED
|
@@ -190,34 +190,34 @@ import {
|
|
|
190
190
|
} from "react";
|
|
191
191
|
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
192
192
|
import React25, { createContext as createContext18 } from "react";
|
|
193
|
-
import React26, { useMemo as useMemo26 } from "react";
|
|
194
|
-
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
195
|
-
import { Children, forwardRef as forwardRef9, useMemo as useMemo27 } from "react";
|
|
196
|
-
import React27 from "react";
|
|
197
|
-
import React28, { createContext as createContext19 } from "react";
|
|
198
|
-
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
199
|
-
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
200
|
-
import React30 from "react";
|
|
201
|
-
import { useCallback as useCallback15 } from "react";
|
|
202
193
|
import {
|
|
203
|
-
|
|
194
|
+
forwardRef as forwardRef9,
|
|
204
195
|
useContext as useContext28,
|
|
205
|
-
useEffect as
|
|
206
|
-
|
|
207
|
-
useMemo as
|
|
196
|
+
useEffect as useEffect19,
|
|
197
|
+
useImperativeHandle as useImperativeHandle9,
|
|
198
|
+
useMemo as useMemo26,
|
|
199
|
+
useRef as useRef16,
|
|
208
200
|
useState as useState17
|
|
209
201
|
} from "react";
|
|
202
|
+
import { useEffect as useEffect18 } from "react";
|
|
203
|
+
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
204
|
+
import React27, { useMemo as useMemo27 } from "react";
|
|
205
|
+
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
206
|
+
import { Children, forwardRef as forwardRef10, useMemo as useMemo28 } from "react";
|
|
207
|
+
import React28 from "react";
|
|
208
|
+
import React29, { createContext as createContext19 } from "react";
|
|
209
|
+
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
210
210
|
import { jsx as jsx30 } from "react/jsx-runtime";
|
|
211
|
+
import React31 from "react";
|
|
212
|
+
import { useCallback as useCallback15 } from "react";
|
|
211
213
|
import {
|
|
212
|
-
|
|
214
|
+
useCallback as useCallback14,
|
|
213
215
|
useContext as useContext29,
|
|
214
216
|
useEffect as useEffect20,
|
|
215
|
-
|
|
217
|
+
useLayoutEffect as useLayoutEffect9,
|
|
216
218
|
useMemo as useMemo29,
|
|
217
|
-
useRef as useRef16,
|
|
218
219
|
useState as useState18
|
|
219
220
|
} from "react";
|
|
220
|
-
import { useEffect as useEffect19 } from "react";
|
|
221
221
|
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
222
222
|
import { jsx as jsx322 } from "react/jsx-runtime";
|
|
223
223
|
import { forwardRef as forwardRef12, useCallback as useCallback16, useContext as useContext31 } from "react";
|
|
@@ -238,15 +238,15 @@ function getNodeEnvString() {
|
|
|
238
238
|
function truthy(value) {
|
|
239
239
|
return Boolean(value);
|
|
240
240
|
}
|
|
241
|
-
function
|
|
241
|
+
function validateCodec(defaultCodec, location, name) {
|
|
242
242
|
if (typeof defaultCodec === "undefined") {
|
|
243
243
|
return;
|
|
244
244
|
}
|
|
245
245
|
if (typeof defaultCodec !== "string") {
|
|
246
|
-
throw new TypeError(`The "
|
|
246
|
+
throw new TypeError(`The "${name}" prop ${location} must be a string, but you passed a value of type ${typeof defaultCodec}.`);
|
|
247
247
|
}
|
|
248
248
|
if (!validCodecs.includes(defaultCodec)) {
|
|
249
|
-
throw new Error(`The "
|
|
249
|
+
throw new Error(`The "${name}" prop ${location} must be one of ${validCodecs.join(", ")}, but you passed ${defaultCodec}.`);
|
|
250
250
|
}
|
|
251
251
|
}
|
|
252
252
|
function validateDimension(amount, nameOfProp, location) {
|
|
@@ -436,19 +436,19 @@ function exponentialBackoff(errorCount) {
|
|
|
436
436
|
return 1000 * 2 ** (errorCount - 1);
|
|
437
437
|
}
|
|
438
438
|
function useRemotionContexts() {
|
|
439
|
-
const compositionManagerCtx =
|
|
440
|
-
const timelineContext =
|
|
441
|
-
const setTimelineContext =
|
|
442
|
-
const sequenceContext =
|
|
443
|
-
const nonceContext =
|
|
444
|
-
const canUseRemotionHooksContext =
|
|
445
|
-
const preloadContext =
|
|
446
|
-
const resolveCompositionContext =
|
|
447
|
-
const renderAssetManagerContext =
|
|
448
|
-
const sequenceManagerContext =
|
|
449
|
-
const bufferManagerContext =
|
|
450
|
-
const logLevelContext =
|
|
451
|
-
return
|
|
439
|
+
const compositionManagerCtx = React27.useContext(CompositionManager);
|
|
440
|
+
const timelineContext = React27.useContext(TimelineContext);
|
|
441
|
+
const setTimelineContext = React27.useContext(SetTimelineContext);
|
|
442
|
+
const sequenceContext = React27.useContext(SequenceContext);
|
|
443
|
+
const nonceContext = React27.useContext(NonceContext);
|
|
444
|
+
const canUseRemotionHooksContext = React27.useContext(CanUseRemotionHooks);
|
|
445
|
+
const preloadContext = React27.useContext(PreloadContext);
|
|
446
|
+
const resolveCompositionContext = React27.useContext(ResolveCompositionContext);
|
|
447
|
+
const renderAssetManagerContext = React27.useContext(RenderAssetManager);
|
|
448
|
+
const sequenceManagerContext = React27.useContext(SequenceManager);
|
|
449
|
+
const bufferManagerContext = React27.useContext(BufferingContextReact);
|
|
450
|
+
const logLevelContext = React27.useContext(LogLevelContext);
|
|
451
|
+
return useMemo27(() => ({
|
|
452
452
|
compositionManagerCtx,
|
|
453
453
|
timelineContext,
|
|
454
454
|
setTimelineContext,
|
|
@@ -735,7 +735,7 @@ var __defProp2, __export2 = (target, all) => {
|
|
|
735
735
|
});
|
|
736
736
|
}, useIsPlayer = () => {
|
|
737
737
|
return useContext(IsPlayerContext);
|
|
738
|
-
}, VERSION = "4.0.
|
|
738
|
+
}, VERSION = "4.0.329", checkMultipleRemotionVersions = () => {
|
|
739
739
|
if (typeof globalThis === "undefined") {
|
|
740
740
|
return;
|
|
741
741
|
}
|
|
@@ -1029,7 +1029,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
1029
1029
|
component: `of the "<Composition />" component with the id "${compositionId}"`
|
|
1030
1030
|
});
|
|
1031
1031
|
const defaultCodec = calculated?.defaultCodec;
|
|
1032
|
-
|
|
1032
|
+
validateCodec(defaultCodec, calculateMetadataErrorLocation, "defaultCodec");
|
|
1033
1033
|
const defaultOutName = calculated?.defaultOutName;
|
|
1034
1034
|
const defaultVideoImageFormat = calculated?.defaultVideoImageFormat;
|
|
1035
1035
|
const defaultPixelFormat = calculated?.defaultPixelFormat;
|
|
@@ -4089,6 +4089,8 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
4089
4089
|
delayRenderTimeoutInMilliseconds,
|
|
4090
4090
|
toneFrequency,
|
|
4091
4091
|
useWebAudioApi,
|
|
4092
|
+
onError,
|
|
4093
|
+
onNativeError,
|
|
4092
4094
|
...nativeProps
|
|
4093
4095
|
} = props;
|
|
4094
4096
|
const _propsValid = true;
|
|
@@ -4226,7 +4228,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
4226
4228
|
_remotionInternalNativeLoopPassed,
|
|
4227
4229
|
acceptableTimeShiftInSeconds,
|
|
4228
4230
|
name,
|
|
4229
|
-
|
|
4231
|
+
onNativeError,
|
|
4230
4232
|
delayRenderRetries,
|
|
4231
4233
|
delayRenderTimeoutInMilliseconds,
|
|
4232
4234
|
loopVolumeCurveBehavior,
|
|
@@ -4334,7 +4336,8 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
4334
4336
|
}
|
|
4335
4337
|
return /* @__PURE__ */ jsx18("audio", {
|
|
4336
4338
|
ref: audioRef,
|
|
4337
|
-
...nativeProps
|
|
4339
|
+
...nativeProps,
|
|
4340
|
+
onError: onNativeError
|
|
4338
4341
|
});
|
|
4339
4342
|
}, AudioForRendering, AudioRefForwardingFunction = (props, ref) => {
|
|
4340
4343
|
const audioContext = useContext24(SharedAudioContext);
|
|
@@ -4347,6 +4350,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
4347
4350
|
stack,
|
|
4348
4351
|
pauseWhenBuffering,
|
|
4349
4352
|
showInTimeline,
|
|
4353
|
+
onError: onRemotionError,
|
|
4350
4354
|
...otherProps
|
|
4351
4355
|
} = props;
|
|
4352
4356
|
const { loop, ...propsOtherThanLoop } = props;
|
|
@@ -4361,11 +4365,16 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
4361
4365
|
console.log(e.currentTarget.error);
|
|
4362
4366
|
const errMessage = `Could not play audio with src ${preloadedSrc}: ${e.currentTarget.error}. See https://remotion.dev/docs/media-playback-error for help.`;
|
|
4363
4367
|
if (loop) {
|
|
4368
|
+
if (onRemotionError) {
|
|
4369
|
+
onRemotionError(new Error(errMessage));
|
|
4370
|
+
return;
|
|
4371
|
+
}
|
|
4364
4372
|
cancelRender(new Error(errMessage));
|
|
4365
4373
|
} else {
|
|
4374
|
+
onRemotionError?.(new Error(errMessage));
|
|
4366
4375
|
console.warn(errMessage);
|
|
4367
4376
|
}
|
|
4368
|
-
}, [loop, preloadedSrc]);
|
|
4377
|
+
}, [loop, onRemotionError, preloadedSrc]);
|
|
4369
4378
|
const onDuration = useCallback10((src, durationInSeconds) => {
|
|
4370
4379
|
setDurations({ type: "got-duration", durationInSeconds, src });
|
|
4371
4380
|
}, [setDurations]);
|
|
@@ -4422,7 +4431,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
4422
4431
|
onDuration,
|
|
4423
4432
|
...props,
|
|
4424
4433
|
ref,
|
|
4425
|
-
onError,
|
|
4434
|
+
onNativeError: onError,
|
|
4426
4435
|
_remotionInternalNeedsDurationCalculation: Boolean(loop)
|
|
4427
4436
|
});
|
|
4428
4437
|
}
|
|
@@ -4432,7 +4441,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
4432
4441
|
shouldPreMountAudioTags: audioContext !== null && audioContext.numberOfAudioTags > 0,
|
|
4433
4442
|
...props,
|
|
4434
4443
|
ref,
|
|
4435
|
-
onError,
|
|
4444
|
+
onNativeError: onError,
|
|
4436
4445
|
onDuration,
|
|
4437
4446
|
pauseWhenBuffering: pauseWhenBuffering ?? false,
|
|
4438
4447
|
_remotionInternalNeedsDurationCalculation: Boolean(loop),
|
|
@@ -5146,32 +5155,258 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
5146
5155
|
const heightRatio = canvasSize.height / compositionHeight;
|
|
5147
5156
|
const widthRatio = canvasSize.width / compositionWidth;
|
|
5148
5157
|
const ratio = Math.min(heightRatio, widthRatio);
|
|
5149
|
-
|
|
5150
|
-
|
|
5158
|
+
if (previewSize === "auto") {
|
|
5159
|
+
if (ratio === 0) {
|
|
5160
|
+
return 1;
|
|
5161
|
+
}
|
|
5162
|
+
return ratio;
|
|
5163
|
+
}
|
|
5164
|
+
return Number(previewSize);
|
|
5165
|
+
}, useEmitVideoFrame = ({
|
|
5166
|
+
ref,
|
|
5167
|
+
onVideoFrame
|
|
5168
|
+
}) => {
|
|
5169
|
+
useEffect18(() => {
|
|
5170
|
+
const { current } = ref;
|
|
5171
|
+
if (!current) {
|
|
5172
|
+
return;
|
|
5173
|
+
}
|
|
5174
|
+
if (!onVideoFrame) {
|
|
5175
|
+
return;
|
|
5176
|
+
}
|
|
5177
|
+
let handle = 0;
|
|
5178
|
+
const callback = () => {
|
|
5179
|
+
if (!ref.current) {
|
|
5180
|
+
return;
|
|
5181
|
+
}
|
|
5182
|
+
onVideoFrame(ref.current);
|
|
5183
|
+
handle = ref.current.requestVideoFrameCallback(callback);
|
|
5184
|
+
};
|
|
5185
|
+
callback();
|
|
5186
|
+
return () => {
|
|
5187
|
+
current.cancelVideoFrameCallback(handle);
|
|
5188
|
+
};
|
|
5189
|
+
}, [onVideoFrame, ref]);
|
|
5190
|
+
}, VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
|
|
5191
|
+
const context = useContext28(SharedAudioContext);
|
|
5192
|
+
if (!context) {
|
|
5193
|
+
throw new Error("SharedAudioContext not found");
|
|
5194
|
+
}
|
|
5195
|
+
const videoRef = useRef16(null);
|
|
5196
|
+
const sharedSource = useMemo26(() => {
|
|
5197
|
+
if (!context.audioContext) {
|
|
5198
|
+
return null;
|
|
5199
|
+
}
|
|
5200
|
+
return makeSharedElementSourceNode({
|
|
5201
|
+
audioContext: context.audioContext,
|
|
5202
|
+
ref: videoRef
|
|
5203
|
+
});
|
|
5204
|
+
}, [context.audioContext]);
|
|
5205
|
+
const {
|
|
5206
|
+
volume,
|
|
5207
|
+
muted,
|
|
5208
|
+
playbackRate,
|
|
5209
|
+
onlyWarnForMediaSeekingError,
|
|
5210
|
+
src,
|
|
5211
|
+
onDuration,
|
|
5212
|
+
acceptableTimeShift,
|
|
5213
|
+
acceptableTimeShiftInSeconds,
|
|
5214
|
+
toneFrequency,
|
|
5215
|
+
name,
|
|
5216
|
+
_remotionInternalNativeLoopPassed,
|
|
5217
|
+
_remotionInternalStack,
|
|
5218
|
+
style,
|
|
5219
|
+
pauseWhenBuffering,
|
|
5220
|
+
showInTimeline,
|
|
5221
|
+
loopVolumeCurveBehavior,
|
|
5222
|
+
onError,
|
|
5223
|
+
onAutoPlayError,
|
|
5224
|
+
onVideoFrame,
|
|
5225
|
+
crossOrigin,
|
|
5226
|
+
delayRenderRetries,
|
|
5227
|
+
delayRenderTimeoutInMilliseconds,
|
|
5228
|
+
allowAmplificationDuringRender,
|
|
5229
|
+
useWebAudioApi,
|
|
5230
|
+
...nativeProps
|
|
5231
|
+
} = props2;
|
|
5232
|
+
const _propsValid = true;
|
|
5233
|
+
if (!_propsValid) {
|
|
5234
|
+
throw new Error("typecheck error");
|
|
5235
|
+
}
|
|
5236
|
+
const volumePropFrame = useFrameForVolumeProp(loopVolumeCurveBehavior ?? "repeat");
|
|
5237
|
+
const { fps, durationInFrames } = useVideoConfig();
|
|
5238
|
+
const parentSequence = useContext28(SequenceContext);
|
|
5239
|
+
const { hidden } = useContext28(SequenceVisibilityToggleContext);
|
|
5240
|
+
const logLevel = useLogLevel();
|
|
5241
|
+
const mountTime = useMountTime();
|
|
5242
|
+
const [timelineId] = useState17(() => String(Math.random()));
|
|
5243
|
+
const isSequenceHidden = hidden[timelineId] ?? false;
|
|
5244
|
+
if (typeof acceptableTimeShift !== "undefined") {
|
|
5245
|
+
throw new Error("acceptableTimeShift has been removed. Use acceptableTimeShiftInSeconds instead.");
|
|
5246
|
+
}
|
|
5247
|
+
const [mediaVolume] = useMediaVolumeState();
|
|
5248
|
+
const [mediaMuted] = useMediaMutedState();
|
|
5249
|
+
const userPreferredVolume = evaluateVolume({
|
|
5250
|
+
frame: volumePropFrame,
|
|
5251
|
+
volume,
|
|
5252
|
+
mediaVolume
|
|
5253
|
+
});
|
|
5254
|
+
useMediaInTimeline({
|
|
5255
|
+
mediaRef: videoRef,
|
|
5256
|
+
volume,
|
|
5257
|
+
mediaVolume,
|
|
5258
|
+
mediaType: "video",
|
|
5259
|
+
src,
|
|
5260
|
+
playbackRate: props2.playbackRate ?? 1,
|
|
5261
|
+
displayName: name ?? null,
|
|
5262
|
+
id: timelineId,
|
|
5263
|
+
stack: _remotionInternalStack,
|
|
5264
|
+
showInTimeline,
|
|
5265
|
+
premountDisplay: null,
|
|
5266
|
+
onAutoPlayError: onAutoPlayError ?? null,
|
|
5267
|
+
isPremounting: Boolean(parentSequence?.premounting)
|
|
5268
|
+
});
|
|
5269
|
+
useMediaPlayback({
|
|
5270
|
+
mediaRef: videoRef,
|
|
5271
|
+
src,
|
|
5272
|
+
mediaType: "video",
|
|
5273
|
+
playbackRate: props2.playbackRate ?? 1,
|
|
5274
|
+
onlyWarnForMediaSeekingError,
|
|
5275
|
+
acceptableTimeshift: acceptableTimeShiftInSeconds ?? null,
|
|
5276
|
+
isPremounting: Boolean(parentSequence?.premounting),
|
|
5277
|
+
pauseWhenBuffering,
|
|
5278
|
+
onAutoPlayError: onAutoPlayError ?? null
|
|
5279
|
+
});
|
|
5280
|
+
useVolume({
|
|
5281
|
+
logLevel,
|
|
5282
|
+
mediaRef: videoRef,
|
|
5283
|
+
volume: userPreferredVolume,
|
|
5284
|
+
source: sharedSource,
|
|
5285
|
+
shouldUseWebAudioApi: useWebAudioApi ?? false
|
|
5286
|
+
});
|
|
5287
|
+
const actualFrom = parentSequence ? parentSequence.relativeFrom : 0;
|
|
5288
|
+
const duration = parentSequence ? Math.min(parentSequence.durationInFrames, durationInFrames) : durationInFrames;
|
|
5289
|
+
const preloadedSrc = usePreload(src);
|
|
5290
|
+
const actualSrc = useAppendVideoFragment({
|
|
5291
|
+
actualSrc: preloadedSrc,
|
|
5292
|
+
actualFrom,
|
|
5293
|
+
duration,
|
|
5294
|
+
fps
|
|
5295
|
+
});
|
|
5296
|
+
useImperativeHandle9(ref, () => {
|
|
5297
|
+
return videoRef.current;
|
|
5298
|
+
}, []);
|
|
5299
|
+
useState17(() => playbackLogging({
|
|
5300
|
+
logLevel,
|
|
5301
|
+
message: `Mounting video with source = ${actualSrc}, v=${VERSION}, user agent=${typeof navigator === "undefined" ? "server" : navigator.userAgent}`,
|
|
5302
|
+
tag: "video",
|
|
5303
|
+
mountTime
|
|
5304
|
+
}));
|
|
5305
|
+
useEffect19(() => {
|
|
5306
|
+
const { current } = videoRef;
|
|
5307
|
+
if (!current) {
|
|
5308
|
+
return;
|
|
5309
|
+
}
|
|
5310
|
+
const errorHandler = () => {
|
|
5311
|
+
if (current.error) {
|
|
5312
|
+
console.error("Error occurred in video", current?.error);
|
|
5313
|
+
if (onError) {
|
|
5314
|
+
const err = new Error(`Code ${current.error.code}: ${current.error.message}`);
|
|
5315
|
+
onError(err);
|
|
5316
|
+
return;
|
|
5317
|
+
}
|
|
5318
|
+
throw new Error(`The browser threw an error while playing the video ${src}: Code ${current.error.code} - ${current?.error?.message}. See https://remotion.dev/docs/media-playback-error for help. Pass an onError() prop to handle the error.`);
|
|
5319
|
+
} else {
|
|
5320
|
+
if (onError) {
|
|
5321
|
+
const err = new Error(`The browser threw an error while playing the video ${src}`);
|
|
5322
|
+
onError(err);
|
|
5323
|
+
return;
|
|
5324
|
+
}
|
|
5325
|
+
throw new Error("The browser threw an error while playing the video");
|
|
5326
|
+
}
|
|
5327
|
+
};
|
|
5328
|
+
current.addEventListener("error", errorHandler, { once: true });
|
|
5329
|
+
return () => {
|
|
5330
|
+
current.removeEventListener("error", errorHandler);
|
|
5331
|
+
};
|
|
5332
|
+
}, [onError, src]);
|
|
5333
|
+
const currentOnDurationCallback = useRef16(onDuration);
|
|
5334
|
+
currentOnDurationCallback.current = onDuration;
|
|
5335
|
+
useEmitVideoFrame({ ref: videoRef, onVideoFrame });
|
|
5336
|
+
useEffect19(() => {
|
|
5337
|
+
const { current } = videoRef;
|
|
5338
|
+
if (!current) {
|
|
5339
|
+
return;
|
|
5340
|
+
}
|
|
5341
|
+
if (current.duration) {
|
|
5342
|
+
currentOnDurationCallback.current?.(src, current.duration);
|
|
5343
|
+
return;
|
|
5344
|
+
}
|
|
5345
|
+
const onLoadedMetadata = () => {
|
|
5346
|
+
currentOnDurationCallback.current?.(src, current.duration);
|
|
5347
|
+
};
|
|
5348
|
+
current.addEventListener("loadedmetadata", onLoadedMetadata);
|
|
5349
|
+
return () => {
|
|
5350
|
+
current.removeEventListener("loadedmetadata", onLoadedMetadata);
|
|
5351
|
+
};
|
|
5352
|
+
}, [src]);
|
|
5353
|
+
useEffect19(() => {
|
|
5354
|
+
const { current } = videoRef;
|
|
5355
|
+
if (!current) {
|
|
5356
|
+
return;
|
|
5357
|
+
}
|
|
5358
|
+
if (isIosSafari()) {
|
|
5359
|
+
current.preload = "metadata";
|
|
5360
|
+
} else {
|
|
5361
|
+
current.preload = "auto";
|
|
5362
|
+
}
|
|
5363
|
+
}, []);
|
|
5364
|
+
const actualStyle = useMemo26(() => {
|
|
5365
|
+
return {
|
|
5366
|
+
...style,
|
|
5367
|
+
opacity: isSequenceHidden ? 0 : style?.opacity ?? 1
|
|
5368
|
+
};
|
|
5369
|
+
}, [isSequenceHidden, style]);
|
|
5370
|
+
const crossOriginValue = getCrossOriginValue({
|
|
5371
|
+
crossOrigin,
|
|
5372
|
+
requestsVideoFrame: Boolean(onVideoFrame)
|
|
5373
|
+
});
|
|
5374
|
+
return /* @__PURE__ */ jsx27("video", {
|
|
5375
|
+
ref: videoRef,
|
|
5376
|
+
muted: muted || mediaMuted || isSequenceHidden || userPreferredVolume <= 0,
|
|
5377
|
+
playsInline: true,
|
|
5378
|
+
src: actualSrc,
|
|
5379
|
+
loop: _remotionInternalNativeLoopPassed,
|
|
5380
|
+
style: actualStyle,
|
|
5381
|
+
disableRemotePlayback: true,
|
|
5382
|
+
crossOrigin: crossOriginValue,
|
|
5383
|
+
...nativeProps
|
|
5384
|
+
});
|
|
5385
|
+
}, VideoForPreview, WATCH_REMOTION_STATIC_FILES = "remotion_staticFilesChanged", RemotionContextProvider = (props2) => {
|
|
5151
5386
|
const { children, contexts } = props2;
|
|
5152
|
-
return /* @__PURE__ */
|
|
5387
|
+
return /* @__PURE__ */ jsx28(LogLevelContext.Provider, {
|
|
5153
5388
|
value: contexts.logLevelContext,
|
|
5154
|
-
children: /* @__PURE__ */
|
|
5389
|
+
children: /* @__PURE__ */ jsx28(CanUseRemotionHooks.Provider, {
|
|
5155
5390
|
value: contexts.canUseRemotionHooksContext,
|
|
5156
|
-
children: /* @__PURE__ */
|
|
5391
|
+
children: /* @__PURE__ */ jsx28(NonceContext.Provider, {
|
|
5157
5392
|
value: contexts.nonceContext,
|
|
5158
|
-
children: /* @__PURE__ */
|
|
5393
|
+
children: /* @__PURE__ */ jsx28(PreloadContext.Provider, {
|
|
5159
5394
|
value: contexts.preloadContext,
|
|
5160
|
-
children: /* @__PURE__ */
|
|
5395
|
+
children: /* @__PURE__ */ jsx28(CompositionManager.Provider, {
|
|
5161
5396
|
value: contexts.compositionManagerCtx,
|
|
5162
|
-
children: /* @__PURE__ */
|
|
5397
|
+
children: /* @__PURE__ */ jsx28(SequenceManager.Provider, {
|
|
5163
5398
|
value: contexts.sequenceManagerContext,
|
|
5164
|
-
children: /* @__PURE__ */
|
|
5399
|
+
children: /* @__PURE__ */ jsx28(RenderAssetManager.Provider, {
|
|
5165
5400
|
value: contexts.renderAssetManagerContext,
|
|
5166
|
-
children: /* @__PURE__ */
|
|
5401
|
+
children: /* @__PURE__ */ jsx28(ResolveCompositionContext.Provider, {
|
|
5167
5402
|
value: contexts.resolveCompositionContext,
|
|
5168
|
-
children: /* @__PURE__ */
|
|
5403
|
+
children: /* @__PURE__ */ jsx28(TimelineContext.Provider, {
|
|
5169
5404
|
value: contexts.timelineContext,
|
|
5170
|
-
children: /* @__PURE__ */
|
|
5405
|
+
children: /* @__PURE__ */ jsx28(SetTimelineContext.Provider, {
|
|
5171
5406
|
value: contexts.setTimelineContext,
|
|
5172
|
-
children: /* @__PURE__ */
|
|
5407
|
+
children: /* @__PURE__ */ jsx28(SequenceContext.Provider, {
|
|
5173
5408
|
value: contexts.sequenceContext,
|
|
5174
|
-
children: /* @__PURE__ */
|
|
5409
|
+
children: /* @__PURE__ */ jsx28(BufferingContextReact.Provider, {
|
|
5175
5410
|
value: contexts.bufferManagerContext,
|
|
5176
5411
|
children
|
|
5177
5412
|
})
|
|
@@ -5210,36 +5445,36 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
5210
5445
|
throw new RangeError(`Cannot use frame ${frame}: Duration of composition is ${durationInFrames}, therefore the highest frame that can be rendered is ${durationInFrames - 1}`);
|
|
5211
5446
|
}
|
|
5212
5447
|
}, flattenChildren = (children) => {
|
|
5213
|
-
const childrenArray =
|
|
5448
|
+
const childrenArray = React28.Children.toArray(children);
|
|
5214
5449
|
return childrenArray.reduce((flatChildren, child) => {
|
|
5215
|
-
if (child.type ===
|
|
5450
|
+
if (child.type === React28.Fragment) {
|
|
5216
5451
|
return flatChildren.concat(flattenChildren(child.props.children));
|
|
5217
5452
|
}
|
|
5218
5453
|
flatChildren.push(child);
|
|
5219
5454
|
return flatChildren;
|
|
5220
5455
|
}, []);
|
|
5221
5456
|
}, IsInsideSeriesContext, IsInsideSeriesContainer = ({ children }) => {
|
|
5222
|
-
return /* @__PURE__ */
|
|
5457
|
+
return /* @__PURE__ */ jsx29(IsInsideSeriesContext.Provider, {
|
|
5223
5458
|
value: true,
|
|
5224
5459
|
children
|
|
5225
5460
|
});
|
|
5226
5461
|
}, IsNotInsideSeriesProvider = ({ children }) => {
|
|
5227
|
-
return /* @__PURE__ */
|
|
5462
|
+
return /* @__PURE__ */ jsx29(IsInsideSeriesContext.Provider, {
|
|
5228
5463
|
value: false,
|
|
5229
5464
|
children
|
|
5230
5465
|
});
|
|
5231
5466
|
}, useRequireToBeInsideSeries = () => {
|
|
5232
|
-
const isInsideSeries =
|
|
5467
|
+
const isInsideSeries = React29.useContext(IsInsideSeriesContext);
|
|
5233
5468
|
if (!isInsideSeries) {
|
|
5234
5469
|
throw new Error("This component must be inside a <Series /> component.");
|
|
5235
5470
|
}
|
|
5236
5471
|
}, SeriesSequenceRefForwardingFunction = ({ children }, _ref) => {
|
|
5237
5472
|
useRequireToBeInsideSeries();
|
|
5238
|
-
return /* @__PURE__ */
|
|
5473
|
+
return /* @__PURE__ */ jsx30(IsNotInsideSeriesProvider, {
|
|
5239
5474
|
children
|
|
5240
5475
|
});
|
|
5241
5476
|
}, SeriesSequence, Series = (props2) => {
|
|
5242
|
-
const childrenValue =
|
|
5477
|
+
const childrenValue = useMemo28(() => {
|
|
5243
5478
|
let startFrame = 0;
|
|
5244
5479
|
const flattenedChildren = flattenChildren(props2.children);
|
|
5245
5480
|
return Children.map(flattenedChildren, (child, i) => {
|
|
@@ -5283,7 +5518,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
5283
5518
|
}
|
|
5284
5519
|
const currentStartFrame = startFrame + offset;
|
|
5285
5520
|
startFrame += durationInFramesProp + offset;
|
|
5286
|
-
return /* @__PURE__ */
|
|
5521
|
+
return /* @__PURE__ */ jsx30(Sequence, {
|
|
5287
5522
|
name: name || "<Series.Sequence>",
|
|
5288
5523
|
from: currentStartFrame,
|
|
5289
5524
|
durationInFrames: durationInFramesProp,
|
|
@@ -5294,14 +5529,14 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
5294
5529
|
});
|
|
5295
5530
|
}, [props2.children]);
|
|
5296
5531
|
if (ENABLE_V5_BREAKING_CHANGES) {
|
|
5297
|
-
return /* @__PURE__ */
|
|
5298
|
-
children: /* @__PURE__ */
|
|
5532
|
+
return /* @__PURE__ */ jsx30(IsInsideSeriesContainer, {
|
|
5533
|
+
children: /* @__PURE__ */ jsx30(Sequence, {
|
|
5299
5534
|
...props2,
|
|
5300
5535
|
children: childrenValue
|
|
5301
5536
|
})
|
|
5302
5537
|
});
|
|
5303
5538
|
}
|
|
5304
|
-
return /* @__PURE__ */
|
|
5539
|
+
return /* @__PURE__ */ jsx30(IsInsideSeriesContainer, {
|
|
5305
5540
|
children: childrenValue
|
|
5306
5541
|
});
|
|
5307
5542
|
}, validateSpringDuration = (dur) => {
|
|
@@ -5382,227 +5617,7 @@ Check that all your Remotion packages are on the same version. If your dependenc
|
|
|
5382
5617
|
return `/${preparsed}`;
|
|
5383
5618
|
}
|
|
5384
5619
|
return preparsed;
|
|
5385
|
-
},
|
|
5386
|
-
ref,
|
|
5387
|
-
onVideoFrame
|
|
5388
|
-
}) => {
|
|
5389
|
-
useEffect19(() => {
|
|
5390
|
-
const { current } = ref;
|
|
5391
|
-
if (!current) {
|
|
5392
|
-
return;
|
|
5393
|
-
}
|
|
5394
|
-
if (!onVideoFrame) {
|
|
5395
|
-
return;
|
|
5396
|
-
}
|
|
5397
|
-
let handle = 0;
|
|
5398
|
-
const callback = () => {
|
|
5399
|
-
if (!ref.current) {
|
|
5400
|
-
return;
|
|
5401
|
-
}
|
|
5402
|
-
onVideoFrame(ref.current);
|
|
5403
|
-
handle = ref.current.requestVideoFrameCallback(callback);
|
|
5404
|
-
};
|
|
5405
|
-
callback();
|
|
5406
|
-
return () => {
|
|
5407
|
-
current.cancelVideoFrameCallback(handle);
|
|
5408
|
-
};
|
|
5409
|
-
}, [onVideoFrame, ref]);
|
|
5410
|
-
}, VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
|
|
5411
|
-
const context = useContext29(SharedAudioContext);
|
|
5412
|
-
if (!context) {
|
|
5413
|
-
throw new Error("SharedAudioContext not found");
|
|
5414
|
-
}
|
|
5415
|
-
const videoRef = useRef16(null);
|
|
5416
|
-
const sharedSource = useMemo29(() => {
|
|
5417
|
-
if (!context.audioContext) {
|
|
5418
|
-
return null;
|
|
5419
|
-
}
|
|
5420
|
-
return makeSharedElementSourceNode({
|
|
5421
|
-
audioContext: context.audioContext,
|
|
5422
|
-
ref: videoRef
|
|
5423
|
-
});
|
|
5424
|
-
}, [context.audioContext]);
|
|
5425
|
-
const {
|
|
5426
|
-
volume,
|
|
5427
|
-
muted,
|
|
5428
|
-
playbackRate,
|
|
5429
|
-
onlyWarnForMediaSeekingError,
|
|
5430
|
-
src,
|
|
5431
|
-
onDuration,
|
|
5432
|
-
acceptableTimeShift,
|
|
5433
|
-
acceptableTimeShiftInSeconds,
|
|
5434
|
-
toneFrequency,
|
|
5435
|
-
name,
|
|
5436
|
-
_remotionInternalNativeLoopPassed,
|
|
5437
|
-
_remotionInternalStack,
|
|
5438
|
-
style,
|
|
5439
|
-
pauseWhenBuffering,
|
|
5440
|
-
showInTimeline,
|
|
5441
|
-
loopVolumeCurveBehavior,
|
|
5442
|
-
onError,
|
|
5443
|
-
onAutoPlayError,
|
|
5444
|
-
onVideoFrame,
|
|
5445
|
-
crossOrigin,
|
|
5446
|
-
delayRenderRetries,
|
|
5447
|
-
delayRenderTimeoutInMilliseconds,
|
|
5448
|
-
allowAmplificationDuringRender,
|
|
5449
|
-
useWebAudioApi,
|
|
5450
|
-
...nativeProps
|
|
5451
|
-
} = props2;
|
|
5452
|
-
const _propsValid = true;
|
|
5453
|
-
if (!_propsValid) {
|
|
5454
|
-
throw new Error("typecheck error");
|
|
5455
|
-
}
|
|
5456
|
-
const volumePropFrame = useFrameForVolumeProp(loopVolumeCurveBehavior ?? "repeat");
|
|
5457
|
-
const { fps, durationInFrames } = useVideoConfig();
|
|
5458
|
-
const parentSequence = useContext29(SequenceContext);
|
|
5459
|
-
const { hidden } = useContext29(SequenceVisibilityToggleContext);
|
|
5460
|
-
const logLevel = useLogLevel();
|
|
5461
|
-
const mountTime = useMountTime();
|
|
5462
|
-
const [timelineId] = useState18(() => String(Math.random()));
|
|
5463
|
-
const isSequenceHidden = hidden[timelineId] ?? false;
|
|
5464
|
-
if (typeof acceptableTimeShift !== "undefined") {
|
|
5465
|
-
throw new Error("acceptableTimeShift has been removed. Use acceptableTimeShiftInSeconds instead.");
|
|
5466
|
-
}
|
|
5467
|
-
const [mediaVolume] = useMediaVolumeState();
|
|
5468
|
-
const [mediaMuted] = useMediaMutedState();
|
|
5469
|
-
const userPreferredVolume = evaluateVolume({
|
|
5470
|
-
frame: volumePropFrame,
|
|
5471
|
-
volume,
|
|
5472
|
-
mediaVolume
|
|
5473
|
-
});
|
|
5474
|
-
useMediaInTimeline({
|
|
5475
|
-
mediaRef: videoRef,
|
|
5476
|
-
volume,
|
|
5477
|
-
mediaVolume,
|
|
5478
|
-
mediaType: "video",
|
|
5479
|
-
src,
|
|
5480
|
-
playbackRate: props2.playbackRate ?? 1,
|
|
5481
|
-
displayName: name ?? null,
|
|
5482
|
-
id: timelineId,
|
|
5483
|
-
stack: _remotionInternalStack,
|
|
5484
|
-
showInTimeline,
|
|
5485
|
-
premountDisplay: null,
|
|
5486
|
-
onAutoPlayError: onAutoPlayError ?? null,
|
|
5487
|
-
isPremounting: Boolean(parentSequence?.premounting)
|
|
5488
|
-
});
|
|
5489
|
-
useMediaPlayback({
|
|
5490
|
-
mediaRef: videoRef,
|
|
5491
|
-
src,
|
|
5492
|
-
mediaType: "video",
|
|
5493
|
-
playbackRate: props2.playbackRate ?? 1,
|
|
5494
|
-
onlyWarnForMediaSeekingError,
|
|
5495
|
-
acceptableTimeshift: acceptableTimeShiftInSeconds ?? null,
|
|
5496
|
-
isPremounting: Boolean(parentSequence?.premounting),
|
|
5497
|
-
pauseWhenBuffering,
|
|
5498
|
-
onAutoPlayError: onAutoPlayError ?? null
|
|
5499
|
-
});
|
|
5500
|
-
useVolume({
|
|
5501
|
-
logLevel,
|
|
5502
|
-
mediaRef: videoRef,
|
|
5503
|
-
volume: userPreferredVolume,
|
|
5504
|
-
source: sharedSource,
|
|
5505
|
-
shouldUseWebAudioApi: useWebAudioApi ?? false
|
|
5506
|
-
});
|
|
5507
|
-
const actualFrom = parentSequence ? parentSequence.relativeFrom : 0;
|
|
5508
|
-
const duration = parentSequence ? Math.min(parentSequence.durationInFrames, durationInFrames) : durationInFrames;
|
|
5509
|
-
const preloadedSrc = usePreload(src);
|
|
5510
|
-
const actualSrc = useAppendVideoFragment({
|
|
5511
|
-
actualSrc: preloadedSrc,
|
|
5512
|
-
actualFrom,
|
|
5513
|
-
duration,
|
|
5514
|
-
fps
|
|
5515
|
-
});
|
|
5516
|
-
useImperativeHandle9(ref, () => {
|
|
5517
|
-
return videoRef.current;
|
|
5518
|
-
}, []);
|
|
5519
|
-
useState18(() => playbackLogging({
|
|
5520
|
-
logLevel,
|
|
5521
|
-
message: `Mounting video with source = ${actualSrc}, v=${VERSION}, user agent=${typeof navigator === "undefined" ? "server" : navigator.userAgent}`,
|
|
5522
|
-
tag: "video",
|
|
5523
|
-
mountTime
|
|
5524
|
-
}));
|
|
5525
|
-
useEffect20(() => {
|
|
5526
|
-
const { current } = videoRef;
|
|
5527
|
-
if (!current) {
|
|
5528
|
-
return;
|
|
5529
|
-
}
|
|
5530
|
-
const errorHandler = () => {
|
|
5531
|
-
if (current.error) {
|
|
5532
|
-
console.error("Error occurred in video", current?.error);
|
|
5533
|
-
if (onError) {
|
|
5534
|
-
const err = new Error(`Code ${current.error.code}: ${current.error.message}`);
|
|
5535
|
-
onError(err);
|
|
5536
|
-
return;
|
|
5537
|
-
}
|
|
5538
|
-
throw new Error(`The browser threw an error while playing the video ${src}: Code ${current.error.code} - ${current?.error?.message}. See https://remotion.dev/docs/media-playback-error for help. Pass an onError() prop to handle the error.`);
|
|
5539
|
-
} else {
|
|
5540
|
-
if (onError) {
|
|
5541
|
-
const err = new Error(`The browser threw an error while playing the video ${src}`);
|
|
5542
|
-
onError(err);
|
|
5543
|
-
return;
|
|
5544
|
-
}
|
|
5545
|
-
throw new Error("The browser threw an error while playing the video");
|
|
5546
|
-
}
|
|
5547
|
-
};
|
|
5548
|
-
current.addEventListener("error", errorHandler, { once: true });
|
|
5549
|
-
return () => {
|
|
5550
|
-
current.removeEventListener("error", errorHandler);
|
|
5551
|
-
};
|
|
5552
|
-
}, [onError, src]);
|
|
5553
|
-
const currentOnDurationCallback = useRef16(onDuration);
|
|
5554
|
-
currentOnDurationCallback.current = onDuration;
|
|
5555
|
-
useEmitVideoFrame({ ref: videoRef, onVideoFrame });
|
|
5556
|
-
useEffect20(() => {
|
|
5557
|
-
const { current } = videoRef;
|
|
5558
|
-
if (!current) {
|
|
5559
|
-
return;
|
|
5560
|
-
}
|
|
5561
|
-
if (current.duration) {
|
|
5562
|
-
currentOnDurationCallback.current?.(src, current.duration);
|
|
5563
|
-
return;
|
|
5564
|
-
}
|
|
5565
|
-
const onLoadedMetadata = () => {
|
|
5566
|
-
currentOnDurationCallback.current?.(src, current.duration);
|
|
5567
|
-
};
|
|
5568
|
-
current.addEventListener("loadedmetadata", onLoadedMetadata);
|
|
5569
|
-
return () => {
|
|
5570
|
-
current.removeEventListener("loadedmetadata", onLoadedMetadata);
|
|
5571
|
-
};
|
|
5572
|
-
}, [src]);
|
|
5573
|
-
useEffect20(() => {
|
|
5574
|
-
const { current } = videoRef;
|
|
5575
|
-
if (!current) {
|
|
5576
|
-
return;
|
|
5577
|
-
}
|
|
5578
|
-
if (isIosSafari()) {
|
|
5579
|
-
current.preload = "metadata";
|
|
5580
|
-
} else {
|
|
5581
|
-
current.preload = "auto";
|
|
5582
|
-
}
|
|
5583
|
-
}, []);
|
|
5584
|
-
const actualStyle = useMemo29(() => {
|
|
5585
|
-
return {
|
|
5586
|
-
...style,
|
|
5587
|
-
opacity: isSequenceHidden ? 0 : style?.opacity ?? 1
|
|
5588
|
-
};
|
|
5589
|
-
}, [isSequenceHidden, style]);
|
|
5590
|
-
const crossOriginValue = getCrossOriginValue({
|
|
5591
|
-
crossOrigin,
|
|
5592
|
-
requestsVideoFrame: Boolean(onVideoFrame)
|
|
5593
|
-
});
|
|
5594
|
-
return /* @__PURE__ */ jsx31("video", {
|
|
5595
|
-
ref: videoRef,
|
|
5596
|
-
muted: muted || mediaMuted || isSequenceHidden || userPreferredVolume <= 0,
|
|
5597
|
-
playsInline: true,
|
|
5598
|
-
src: actualSrc,
|
|
5599
|
-
loop: _remotionInternalNativeLoopPassed,
|
|
5600
|
-
style: actualStyle,
|
|
5601
|
-
disableRemotePlayback: true,
|
|
5602
|
-
crossOrigin: crossOriginValue,
|
|
5603
|
-
...nativeProps
|
|
5604
|
-
});
|
|
5605
|
-
}, VideoForPreview, roundTo6Commas = (num) => {
|
|
5620
|
+
}, roundTo6Commas = (num) => {
|
|
5606
5621
|
return Math.round(num * 1e5) / 1e5;
|
|
5607
5622
|
}, seekToTime = ({
|
|
5608
5623
|
element,
|
|
@@ -6356,10 +6371,19 @@ var init_esm = __esm(() => {
|
|
|
6356
6371
|
},
|
|
6357
6372
|
size: { size: "auto", translation: { x: 0, y: 0 } }
|
|
6358
6373
|
});
|
|
6374
|
+
VideoForPreview = forwardRef9(VideoForDevelopmentRefForwardingFunction);
|
|
6359
6375
|
compositionSelectorRef = createRef3();
|
|
6360
6376
|
Internals = {
|
|
6361
6377
|
useUnsafeVideoConfig,
|
|
6378
|
+
useFrameForVolumeProp,
|
|
6379
|
+
useTimelinePosition,
|
|
6380
|
+
evaluateVolume,
|
|
6381
|
+
getAbsoluteSrc,
|
|
6362
6382
|
Timeline: exports_timeline_position_state,
|
|
6383
|
+
validateMediaTrimProps,
|
|
6384
|
+
validateMediaProps,
|
|
6385
|
+
resolveTrimProps,
|
|
6386
|
+
VideoForPreview,
|
|
6363
6387
|
CompositionManager,
|
|
6364
6388
|
CompositionSetters,
|
|
6365
6389
|
SequenceManager,
|
|
@@ -6428,7 +6452,7 @@ var init_esm = __esm(() => {
|
|
|
6428
6452
|
};
|
|
6429
6453
|
PERCENTAGE = NUMBER + "%";
|
|
6430
6454
|
IsInsideSeriesContext = createContext19(false);
|
|
6431
|
-
SeriesSequence =
|
|
6455
|
+
SeriesSequence = forwardRef10(SeriesSequenceRefForwardingFunction);
|
|
6432
6456
|
Series.Sequence = SeriesSequence;
|
|
6433
6457
|
addSequenceStackTraces(SeriesSequence);
|
|
6434
6458
|
defaultSpringConfig = {
|
|
@@ -6460,7 +6484,6 @@ var init_esm = __esm(() => {
|
|
|
6460
6484
|
"%3B": ";"
|
|
6461
6485
|
};
|
|
6462
6486
|
didWarn2 = {};
|
|
6463
|
-
VideoForPreview = forwardRef10(VideoForDevelopmentRefForwardingFunction);
|
|
6464
6487
|
VideoForRendering = forwardRef11(VideoForRenderingForwardFunction);
|
|
6465
6488
|
Video = forwardRef12(VideoForwardingFunction);
|
|
6466
6489
|
addSequenceStackTraces(Video);
|
|
@@ -12146,6 +12169,30 @@ var validateFrame2 = ({
|
|
|
12146
12169
|
throw new RangeError(`Cannot use frame ${frame}: Duration of composition is ${durationInFrames}, therefore the highest frame that can be rendered is ${durationInFrames - 1}`);
|
|
12147
12170
|
}
|
|
12148
12171
|
};
|
|
12172
|
+
var validCodecs2 = [
|
|
12173
|
+
"h264",
|
|
12174
|
+
"h265",
|
|
12175
|
+
"vp8",
|
|
12176
|
+
"vp9",
|
|
12177
|
+
"mp3",
|
|
12178
|
+
"aac",
|
|
12179
|
+
"wav",
|
|
12180
|
+
"prores",
|
|
12181
|
+
"h264-mkv",
|
|
12182
|
+
"h264-ts",
|
|
12183
|
+
"gif"
|
|
12184
|
+
];
|
|
12185
|
+
function validateCodec2(defaultCodec, location, name) {
|
|
12186
|
+
if (typeof defaultCodec === "undefined") {
|
|
12187
|
+
return;
|
|
12188
|
+
}
|
|
12189
|
+
if (typeof defaultCodec !== "string") {
|
|
12190
|
+
throw new TypeError(`The "${name}" prop ${location} must be a string, but you passed a value of type ${typeof defaultCodec}.`);
|
|
12191
|
+
}
|
|
12192
|
+
if (!validCodecs2.includes(defaultCodec)) {
|
|
12193
|
+
throw new Error(`The "${name}" prop ${location} must be one of ${validCodecs2.join(", ")}, but you passed ${defaultCodec}.`);
|
|
12194
|
+
}
|
|
12195
|
+
}
|
|
12149
12196
|
var validateDefaultAndInputProps2 = (defaultProps, name, compositionId) => {
|
|
12150
12197
|
if (!defaultProps) {
|
|
12151
12198
|
return;
|
|
@@ -12231,7 +12278,7 @@ var getOffthreadVideoSource = ({
|
|
|
12231
12278
|
currentTime,
|
|
12232
12279
|
toneMapped
|
|
12233
12280
|
}) => {
|
|
12234
|
-
return `http://localhost:${window.remotion_proxyPort}/proxy?src=${encodeURIComponent(getAbsoluteSrc2(src))}&time=${encodeURIComponent(currentTime)}&transparent=${String(transparent)}&toneMapped=${String(toneMapped)}`;
|
|
12281
|
+
return `http://localhost:${window.remotion_proxyPort}/proxy?src=${encodeURIComponent(getAbsoluteSrc2(src))}&time=${encodeURIComponent(Math.max(0, currentTime))}&transparent=${String(transparent)}&toneMapped=${String(toneMapped)}`;
|
|
12235
12282
|
};
|
|
12236
12283
|
var NoReactInternals = {
|
|
12237
12284
|
processColor,
|
|
@@ -12256,7 +12303,8 @@ var NoReactInternals = {
|
|
|
12256
12303
|
MIN_BUN_VERSION: ENABLE_V5_BREAKING_CHANGES2 ? "1.1.3" : "1.0.3",
|
|
12257
12304
|
colorNames,
|
|
12258
12305
|
DATE_TOKEN: DATE_TOKEN2,
|
|
12259
|
-
FILE_TOKEN: FILE_TOKEN2
|
|
12306
|
+
FILE_TOKEN: FILE_TOKEN2,
|
|
12307
|
+
validateCodec: validateCodec2
|
|
12260
12308
|
};
|
|
12261
12309
|
|
|
12262
12310
|
// ../player/dist/esm/index.mjs
|
|
@@ -17590,7 +17638,7 @@ var DoneCheckmark = () => {
|
|
|
17590
17638
|
};
|
|
17591
17639
|
|
|
17592
17640
|
// ../shapes/dist/esm/index.mjs
|
|
17593
|
-
import
|
|
17641
|
+
import React26, { useMemo as useMemo37 } from "react";
|
|
17594
17642
|
import { version } from "react-dom";
|
|
17595
17643
|
import { jsx as jsx60, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
17596
17644
|
import { jsx as jsx212 } from "react/jsx-runtime";
|
|
@@ -20077,7 +20125,8 @@ var listOfRemotionPackages = [
|
|
|
20077
20125
|
"@remotion/openai-whisper",
|
|
20078
20126
|
"@remotion/compositor",
|
|
20079
20127
|
"@remotion/example-videos",
|
|
20080
|
-
"@remotion/whisper-web"
|
|
20128
|
+
"@remotion/whisper-web",
|
|
20129
|
+
"@remotion/video"
|
|
20081
20130
|
];
|
|
20082
20131
|
function truthy3(value) {
|
|
20083
20132
|
return Boolean(value);
|