@remotion/promo-pages 4.0.455 → 4.0.456
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 +296 -309
- package/dist/design.js +100 -37
- package/dist/experts.js +100 -37
- package/dist/homepage/Pricing.js +100 -37
- package/dist/prompts/PromptsGallery.js +101 -38
- package/dist/prompts/PromptsShow.js +100 -37
- package/dist/prompts/PromptsSubmit.js +100 -37
- package/dist/team.js +100 -37
- package/dist/template-modal-content.js +100 -37
- package/dist/templates.js +100 -37
- package/package.json +13 -13
package/dist/Homepage.js
CHANGED
|
@@ -2534,7 +2534,7 @@ var getComponentsToAddStacksTo = () => componentsToAddStacksTo;
|
|
|
2534
2534
|
var addSequenceStackTraces = (component) => {
|
|
2535
2535
|
componentsToAddStacksTo.push(component);
|
|
2536
2536
|
};
|
|
2537
|
-
var VERSION = "4.0.
|
|
2537
|
+
var VERSION = "4.0.456";
|
|
2538
2538
|
var checkMultipleRemotionVersions = () => {
|
|
2539
2539
|
if (typeof globalThis === "undefined") {
|
|
2540
2540
|
return;
|
|
@@ -2834,12 +2834,13 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
2834
2834
|
height,
|
|
2835
2835
|
width,
|
|
2836
2836
|
showInTimeline = true,
|
|
2837
|
-
controls,
|
|
2837
|
+
_experimentalControls: controls,
|
|
2838
2838
|
_experimentalEffects,
|
|
2839
2839
|
_remotionInternalLoopDisplay: loopDisplay,
|
|
2840
2840
|
_remotionInternalStack: stack,
|
|
2841
2841
|
_remotionInternalPremountDisplay: premountDisplay,
|
|
2842
2842
|
_remotionInternalPostmountDisplay: postmountDisplay,
|
|
2843
|
+
_remotionInternalIsMedia: isMedia,
|
|
2843
2844
|
...other
|
|
2844
2845
|
}, ref) => {
|
|
2845
2846
|
const { layout = "absolute-fill" } = other;
|
|
@@ -2915,6 +2916,33 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
2915
2916
|
if (!env.isStudio) {
|
|
2916
2917
|
return;
|
|
2917
2918
|
}
|
|
2919
|
+
if (isMedia) {
|
|
2920
|
+
registerSequence({
|
|
2921
|
+
type: isMedia.type,
|
|
2922
|
+
controls: controls ?? null,
|
|
2923
|
+
effects: memoizedEffects,
|
|
2924
|
+
displayName: timelineClipName,
|
|
2925
|
+
doesVolumeChange: isMedia.data.doesVolumeChange,
|
|
2926
|
+
duration: actualDurationInFrames,
|
|
2927
|
+
from,
|
|
2928
|
+
id,
|
|
2929
|
+
loopDisplay,
|
|
2930
|
+
nonce: nonce.get(),
|
|
2931
|
+
parent: parentSequence?.id ?? null,
|
|
2932
|
+
playbackRate: isMedia.data.playbackRate,
|
|
2933
|
+
postmountDisplay: postmountDisplay ?? null,
|
|
2934
|
+
premountDisplay: premountDisplay ?? null,
|
|
2935
|
+
rootId,
|
|
2936
|
+
showInTimeline,
|
|
2937
|
+
src: isMedia.data.src,
|
|
2938
|
+
stack: stack ?? inheritedStack,
|
|
2939
|
+
startMediaFrom: isMedia.data.startMediaFrom,
|
|
2940
|
+
volume: isMedia.data.volumes
|
|
2941
|
+
});
|
|
2942
|
+
return () => {
|
|
2943
|
+
unregisterSequence(id);
|
|
2944
|
+
};
|
|
2945
|
+
}
|
|
2918
2946
|
registerSequence({
|
|
2919
2947
|
from,
|
|
2920
2948
|
duration: actualDurationInFrames,
|
|
@@ -2955,7 +2983,8 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
2955
2983
|
env.isStudio,
|
|
2956
2984
|
inheritedStack,
|
|
2957
2985
|
controls,
|
|
2958
|
-
memoizedEffects
|
|
2986
|
+
memoizedEffects,
|
|
2987
|
+
isMedia
|
|
2959
2988
|
]);
|
|
2960
2989
|
const endThreshold = Math.ceil(cumulatedFrom + from + durationInFrames - 1);
|
|
2961
2990
|
const content = absoluteFrame < cumulatedFrom + from ? null : absoluteFrame > endThreshold ? null : children;
|
|
@@ -3537,7 +3566,7 @@ var wrapInSchema = (Component, schema) => {
|
|
|
3537
3566
|
if (!env.isStudio || env.isReadOnlyStudio || env.isRendering || !process.env.EXPERIMENTAL_VISUAL_MODE_ENABLED) {
|
|
3538
3567
|
return React15.createElement(Component, {
|
|
3539
3568
|
...props,
|
|
3540
|
-
|
|
3569
|
+
_experimentalControls: null,
|
|
3541
3570
|
ref
|
|
3542
3571
|
});
|
|
3543
3572
|
}
|
|
@@ -3552,7 +3581,7 @@ var wrapInSchema = (Component, schema) => {
|
|
|
3552
3581
|
const mergedProps = mergeValues(props, values, schemaKeys);
|
|
3553
3582
|
return React15.createElement(Component, {
|
|
3554
3583
|
...mergedProps,
|
|
3555
|
-
controls,
|
|
3584
|
+
_experimentalControls: controls,
|
|
3556
3585
|
ref
|
|
3557
3586
|
});
|
|
3558
3587
|
});
|
|
@@ -3633,7 +3662,7 @@ var HtmlInCanvasInner = forwardRef5(({
|
|
|
3633
3662
|
children,
|
|
3634
3663
|
onPaint,
|
|
3635
3664
|
onInit,
|
|
3636
|
-
controls,
|
|
3665
|
+
_experimentalControls: controls,
|
|
3637
3666
|
style,
|
|
3638
3667
|
durationInFrames,
|
|
3639
3668
|
...sequenceProps
|
|
@@ -3783,7 +3812,7 @@ var HtmlInCanvasInner = forwardRef5(({
|
|
|
3783
3812
|
return /* @__PURE__ */ jsx15(Sequence, {
|
|
3784
3813
|
durationInFrames: resolvedDuration,
|
|
3785
3814
|
name: "<HtmlInCanvas>",
|
|
3786
|
-
controls,
|
|
3815
|
+
_experimentalControls: controls,
|
|
3787
3816
|
layout: "none",
|
|
3788
3817
|
...sequenceProps,
|
|
3789
3818
|
children: /* @__PURE__ */ jsx15("canvas", {
|
|
@@ -3976,7 +4005,14 @@ var LoopContext = createContext16(null);
|
|
|
3976
4005
|
var useLoop = () => {
|
|
3977
4006
|
return React17.useContext(LoopContext);
|
|
3978
4007
|
};
|
|
3979
|
-
var Loop = ({
|
|
4008
|
+
var Loop = ({
|
|
4009
|
+
durationInFrames,
|
|
4010
|
+
times = Infinity,
|
|
4011
|
+
children,
|
|
4012
|
+
name,
|
|
4013
|
+
showInTimeline,
|
|
4014
|
+
...props
|
|
4015
|
+
}) => {
|
|
3980
4016
|
const currentFrame = useCurrentFrame();
|
|
3981
4017
|
const { durationInFrames: compDuration } = useVideoConfig();
|
|
3982
4018
|
validateDurationInFrames(durationInFrames, {
|
|
@@ -4021,6 +4057,7 @@ var Loop = ({ durationInFrames, times = Infinity, children, name, ...props }) =>
|
|
|
4021
4057
|
_remotionInternalLoopDisplay: loopDisplay,
|
|
4022
4058
|
layout: props.layout,
|
|
4023
4059
|
style,
|
|
4060
|
+
showInTimeline,
|
|
4024
4061
|
children
|
|
4025
4062
|
})
|
|
4026
4063
|
});
|
|
@@ -5157,8 +5194,12 @@ var getTimelineDuration = ({
|
|
|
5157
5194
|
playbackRate,
|
|
5158
5195
|
trimBefore,
|
|
5159
5196
|
trimAfter,
|
|
5160
|
-
parentSequenceDurationInFrames
|
|
5197
|
+
parentSequenceDurationInFrames,
|
|
5198
|
+
loop
|
|
5161
5199
|
}) => {
|
|
5200
|
+
if (loop) {
|
|
5201
|
+
return compositionDurationInFrames;
|
|
5202
|
+
}
|
|
5162
5203
|
const mediaDuration = calculateMediaDuration({
|
|
5163
5204
|
mediaDurationInFrames: compositionDurationInFrames * playbackRate + (trimBefore ?? 0),
|
|
5164
5205
|
playbackRate,
|
|
@@ -5209,34 +5250,36 @@ var useBasicMediaInTimeline = ({
|
|
|
5209
5250
|
displayName,
|
|
5210
5251
|
trimBefore,
|
|
5211
5252
|
trimAfter,
|
|
5212
|
-
playbackRate
|
|
5253
|
+
playbackRate,
|
|
5254
|
+
sequenceDurationInFrames,
|
|
5255
|
+
mediaStartsAt,
|
|
5256
|
+
loop
|
|
5213
5257
|
}) => {
|
|
5214
5258
|
if (!src) {
|
|
5215
5259
|
throw new Error("No src passed");
|
|
5216
5260
|
}
|
|
5217
|
-
const startsAt = useMediaStartsAt();
|
|
5218
5261
|
const parentSequence = useContext22(SequenceContext);
|
|
5219
|
-
const videoConfig = useVideoConfig();
|
|
5220
5262
|
const [initialVolume] = useState13(() => volume);
|
|
5221
5263
|
const duration = getTimelineDuration({
|
|
5222
|
-
compositionDurationInFrames:
|
|
5264
|
+
compositionDurationInFrames: sequenceDurationInFrames,
|
|
5223
5265
|
playbackRate,
|
|
5224
5266
|
trimBefore,
|
|
5225
5267
|
trimAfter,
|
|
5226
|
-
parentSequenceDurationInFrames: parentSequence?.durationInFrames ?? null
|
|
5268
|
+
parentSequenceDurationInFrames: parentSequence?.durationInFrames ?? null,
|
|
5269
|
+
loop
|
|
5227
5270
|
});
|
|
5228
5271
|
const volumes = useMemo24(() => {
|
|
5229
5272
|
if (typeof volume === "number") {
|
|
5230
5273
|
return volume;
|
|
5231
5274
|
}
|
|
5232
|
-
return new Array(Math.floor(Math.max(0, duration +
|
|
5275
|
+
return new Array(Math.floor(Math.max(0, duration + mediaStartsAt))).fill(true).map((_, i) => {
|
|
5233
5276
|
return evaluateVolume({
|
|
5234
|
-
frame: i +
|
|
5277
|
+
frame: i + mediaStartsAt,
|
|
5235
5278
|
volume,
|
|
5236
5279
|
mediaVolume
|
|
5237
5280
|
});
|
|
5238
5281
|
}).join(",");
|
|
5239
|
-
}, [duration,
|
|
5282
|
+
}, [duration, mediaStartsAt, volume, mediaVolume]);
|
|
5240
5283
|
useEffect8(() => {
|
|
5241
5284
|
if (typeof volume === "number" && volume !== initialVolume) {
|
|
5242
5285
|
warnOnce2(`Remotion: The ${mediaType} with src ${src} has changed it's volume. Prefer the callback syntax for setting volume to get better timeline display: https://www.remotion.dev/docs/audio/volume`);
|
|
@@ -5245,16 +5288,31 @@ var useBasicMediaInTimeline = ({
|
|
|
5245
5288
|
const doesVolumeChange = typeof volume === "function";
|
|
5246
5289
|
const nonce = useNonce();
|
|
5247
5290
|
const { rootId } = useTimelineContext();
|
|
5248
|
-
const
|
|
5249
|
-
|
|
5291
|
+
const startMediaFrom = 0 - mediaStartsAt + (trimBefore ?? 0);
|
|
5292
|
+
const memoizedResult = useMemo24(() => {
|
|
5293
|
+
return {
|
|
5294
|
+
volumes,
|
|
5295
|
+
duration,
|
|
5296
|
+
doesVolumeChange,
|
|
5297
|
+
nonce,
|
|
5298
|
+
rootId,
|
|
5299
|
+
finalDisplayName: displayName ?? getAssetDisplayName(src),
|
|
5300
|
+
startMediaFrom,
|
|
5301
|
+
src,
|
|
5302
|
+
playbackRate
|
|
5303
|
+
};
|
|
5304
|
+
}, [
|
|
5250
5305
|
volumes,
|
|
5251
5306
|
duration,
|
|
5252
5307
|
doesVolumeChange,
|
|
5253
5308
|
nonce,
|
|
5254
5309
|
rootId,
|
|
5255
|
-
|
|
5256
|
-
|
|
5257
|
-
|
|
5310
|
+
displayName,
|
|
5311
|
+
src,
|
|
5312
|
+
startMediaFrom,
|
|
5313
|
+
playbackRate
|
|
5314
|
+
]);
|
|
5315
|
+
return memoizedResult;
|
|
5258
5316
|
};
|
|
5259
5317
|
var useImageInTimeline = ({
|
|
5260
5318
|
src,
|
|
@@ -5269,7 +5327,9 @@ var useImageInTimeline = ({
|
|
|
5269
5327
|
}) => {
|
|
5270
5328
|
const parentSequence = useContext22(SequenceContext);
|
|
5271
5329
|
const { registerSequence, unregisterSequence } = useContext22(SequenceManager);
|
|
5272
|
-
const {
|
|
5330
|
+
const { durationInFrames } = useVideoConfig();
|
|
5331
|
+
const mediaStartsAt = useMediaStartsAt();
|
|
5332
|
+
const { duration, nonce, rootId, finalDisplayName } = useBasicMediaInTimeline({
|
|
5273
5333
|
volume: undefined,
|
|
5274
5334
|
mediaVolume: 0,
|
|
5275
5335
|
mediaType: "image",
|
|
@@ -5277,8 +5337,12 @@ var useImageInTimeline = ({
|
|
|
5277
5337
|
displayName,
|
|
5278
5338
|
trimAfter: undefined,
|
|
5279
5339
|
trimBefore: undefined,
|
|
5280
|
-
playbackRate: 1
|
|
5340
|
+
playbackRate: 1,
|
|
5341
|
+
sequenceDurationInFrames: durationInFrames,
|
|
5342
|
+
mediaStartsAt,
|
|
5343
|
+
loop: false
|
|
5281
5344
|
});
|
|
5345
|
+
const { isStudio } = useRemotionEnvironment();
|
|
5282
5346
|
useEffect8(() => {
|
|
5283
5347
|
if (!src) {
|
|
5284
5348
|
throw new Error("No src passed");
|
|
@@ -5346,15 +5410,9 @@ var useMediaInTimeline = ({
|
|
|
5346
5410
|
const parentSequence = useContext22(SequenceContext);
|
|
5347
5411
|
const startsAt = useMediaStartsAt();
|
|
5348
5412
|
const { registerSequence, unregisterSequence } = useContext22(SequenceManager);
|
|
5349
|
-
const {
|
|
5350
|
-
|
|
5351
|
-
|
|
5352
|
-
doesVolumeChange,
|
|
5353
|
-
nonce,
|
|
5354
|
-
rootId,
|
|
5355
|
-
isStudio,
|
|
5356
|
-
finalDisplayName
|
|
5357
|
-
} = useBasicMediaInTimeline({
|
|
5413
|
+
const { durationInFrames } = useVideoConfig();
|
|
5414
|
+
const mediaStartsAt = useMediaStartsAt();
|
|
5415
|
+
const { volumes, duration, doesVolumeChange, nonce, rootId, finalDisplayName } = useBasicMediaInTimeline({
|
|
5358
5416
|
volume,
|
|
5359
5417
|
mediaVolume,
|
|
5360
5418
|
mediaType,
|
|
@@ -5362,8 +5420,12 @@ var useMediaInTimeline = ({
|
|
|
5362
5420
|
displayName,
|
|
5363
5421
|
trimAfter: undefined,
|
|
5364
5422
|
trimBefore: undefined,
|
|
5365
|
-
playbackRate
|
|
5423
|
+
playbackRate,
|
|
5424
|
+
sequenceDurationInFrames: durationInFrames,
|
|
5425
|
+
mediaStartsAt,
|
|
5426
|
+
loop: false
|
|
5366
5427
|
});
|
|
5428
|
+
const { isStudio } = useRemotionEnvironment();
|
|
5367
5429
|
useEffect8(() => {
|
|
5368
5430
|
if (!src) {
|
|
5369
5431
|
throw new Error("No src passed");
|
|
@@ -5416,10 +5478,10 @@ var useMediaInTimeline = ({
|
|
|
5416
5478
|
showInTimeline,
|
|
5417
5479
|
premountDisplay,
|
|
5418
5480
|
postmountDisplay,
|
|
5419
|
-
isStudio,
|
|
5420
5481
|
loopDisplay,
|
|
5421
5482
|
rootId,
|
|
5422
|
-
finalDisplayName
|
|
5483
|
+
finalDisplayName,
|
|
5484
|
+
isStudio
|
|
5423
5485
|
]);
|
|
5424
5486
|
};
|
|
5425
5487
|
var useBufferManager = (logLevel, mountTime) => {
|
|
@@ -6854,7 +6916,7 @@ var ImgInner = ({
|
|
|
6854
6916
|
name,
|
|
6855
6917
|
stack,
|
|
6856
6918
|
ref,
|
|
6857
|
-
controls,
|
|
6919
|
+
_experimentalControls: controls,
|
|
6858
6920
|
...props2
|
|
6859
6921
|
}) => {
|
|
6860
6922
|
const imageRef = useRef20(null);
|
|
@@ -9166,6 +9228,7 @@ var VideoForwardingFunction = (props2, ref) => {
|
|
|
9166
9228
|
}),
|
|
9167
9229
|
layout: "none",
|
|
9168
9230
|
name,
|
|
9231
|
+
showInTimeline: false,
|
|
9169
9232
|
children: /* @__PURE__ */ jsx37(Html5Video, {
|
|
9170
9233
|
...propsOtherThanLoop,
|
|
9171
9234
|
ref,
|
|
@@ -24216,7 +24279,7 @@ var GitHubStars = () => {
|
|
|
24216
24279
|
width: "45px"
|
|
24217
24280
|
}),
|
|
24218
24281
|
/* @__PURE__ */ jsx50(StatItemContent, {
|
|
24219
|
-
content: "
|
|
24282
|
+
content: "45k",
|
|
24220
24283
|
width: "80px",
|
|
24221
24284
|
fontSize: "2.5rem",
|
|
24222
24285
|
fontWeight: "bold"
|
|
@@ -28783,7 +28846,7 @@ var Thumbnail = forward2(ThumbnailFn);
|
|
|
28783
28846
|
import {
|
|
28784
28847
|
useCallback as useCallback49,
|
|
28785
28848
|
useEffect as useEffect58,
|
|
28786
|
-
useMemo as
|
|
28849
|
+
useMemo as useMemo66,
|
|
28787
28850
|
useRef as useRef53,
|
|
28788
28851
|
useState as useState56
|
|
28789
28852
|
} from "react";
|
|
@@ -29559,15 +29622,15 @@ function useColorMode() {
|
|
|
29559
29622
|
}
|
|
29560
29623
|
|
|
29561
29624
|
// ../media/dist/esm/index.mjs
|
|
29562
|
-
import {
|
|
29625
|
+
import { useState as useState312 } from "react";
|
|
29626
|
+
import { useMemo as useMemo312 } from "react";
|
|
29627
|
+
import { useContext as useContext212, useEffect as useEffect44, useMemo as useMemo56, useRef as useRef44, useState as useState41 } from "react";
|
|
29563
29628
|
import { ALL_FORMATS, Input as Input2, UrlSource } from "mediabunny";
|
|
29564
29629
|
import { AudioBufferSink, InputDisposedError } from "mediabunny";
|
|
29565
29630
|
import { CanvasSink } from "mediabunny";
|
|
29566
|
-
import { useMemo as useMemo56 } from "react";
|
|
29567
29631
|
import { useContext as useContext47, useLayoutEffect as useLayoutEffect18 } from "react";
|
|
29568
|
-
import { useContext as useContext212, useEffect as useEffect44, useState as useState41 } from "react";
|
|
29569
29632
|
import { jsx as jsx58 } from "react/jsx-runtime";
|
|
29570
|
-
import { useContext as
|
|
29633
|
+
import { useContext as useContext310, useLayoutEffect as useLayoutEffect24, useMemo as useMemo213, useState as useState210 } from "react";
|
|
29571
29634
|
import React211 from "react";
|
|
29572
29635
|
import {
|
|
29573
29636
|
ALL_FORMATS as ALL_FORMATS2,
|
|
@@ -29581,9 +29644,10 @@ import {
|
|
|
29581
29644
|
} from "mediabunny";
|
|
29582
29645
|
import { jsx as jsx216 } from "react/jsx-runtime";
|
|
29583
29646
|
import { jsx as jsx315 } from "react/jsx-runtime";
|
|
29647
|
+
import { useMemo as useMemo63, useState as useState63 } from "react";
|
|
29584
29648
|
import {
|
|
29585
|
-
useContext as
|
|
29586
|
-
useEffect as
|
|
29649
|
+
useContext as useContext46,
|
|
29650
|
+
useEffect as useEffect210,
|
|
29587
29651
|
useLayoutEffect as useLayoutEffect34,
|
|
29588
29652
|
useMemo as useMemo412,
|
|
29589
29653
|
useRef as useRef210,
|
|
@@ -29591,7 +29655,7 @@ import {
|
|
|
29591
29655
|
} from "react";
|
|
29592
29656
|
import { jsx as jsx412 } from "react/jsx-runtime";
|
|
29593
29657
|
import {
|
|
29594
|
-
useContext as
|
|
29658
|
+
useContext as useContext53,
|
|
29595
29659
|
useLayoutEffect as useLayoutEffect43,
|
|
29596
29660
|
useMemo as useMemo55,
|
|
29597
29661
|
useRef as useRef312,
|
|
@@ -29636,6 +29700,31 @@ var __callDispose = (stack, error2, hasError) => {
|
|
|
29636
29700
|
};
|
|
29637
29701
|
return next();
|
|
29638
29702
|
};
|
|
29703
|
+
var getLoopDisplay = ({
|
|
29704
|
+
loop,
|
|
29705
|
+
mediaDurationInSeconds,
|
|
29706
|
+
playbackRate,
|
|
29707
|
+
trimAfter,
|
|
29708
|
+
trimBefore,
|
|
29709
|
+
sequenceDurationInFrames,
|
|
29710
|
+
compFps
|
|
29711
|
+
}) => {
|
|
29712
|
+
if (!loop || !mediaDurationInSeconds) {
|
|
29713
|
+
return;
|
|
29714
|
+
}
|
|
29715
|
+
const durationInFrames = Internals.calculateMediaDuration({
|
|
29716
|
+
mediaDurationInFrames: mediaDurationInSeconds * compFps,
|
|
29717
|
+
playbackRate,
|
|
29718
|
+
trimAfter,
|
|
29719
|
+
trimBefore
|
|
29720
|
+
});
|
|
29721
|
+
const maxTimes = sequenceDurationInFrames / durationInFrames;
|
|
29722
|
+
return {
|
|
29723
|
+
numberOfTimes: maxTimes,
|
|
29724
|
+
startOffset: 0,
|
|
29725
|
+
durationInFrames
|
|
29726
|
+
};
|
|
29727
|
+
};
|
|
29639
29728
|
var getTimeInSeconds = ({
|
|
29640
29729
|
loop,
|
|
29641
29730
|
mediaDurationInSeconds,
|
|
@@ -31262,41 +31351,6 @@ var callOnErrorAndResolve = ({
|
|
|
31262
31351
|
}
|
|
31263
31352
|
return ["fallback", error2];
|
|
31264
31353
|
};
|
|
31265
|
-
var useLoopDisplay = ({
|
|
31266
|
-
loop,
|
|
31267
|
-
mediaDurationInSeconds,
|
|
31268
|
-
playbackRate,
|
|
31269
|
-
trimAfter,
|
|
31270
|
-
trimBefore
|
|
31271
|
-
}) => {
|
|
31272
|
-
const { durationInFrames: compDuration, fps } = useVideoConfig();
|
|
31273
|
-
const loopDisplay = useMemo56(() => {
|
|
31274
|
-
if (!loop || !mediaDurationInSeconds) {
|
|
31275
|
-
return;
|
|
31276
|
-
}
|
|
31277
|
-
const durationInFrames = Internals.calculateMediaDuration({
|
|
31278
|
-
mediaDurationInFrames: mediaDurationInSeconds * fps,
|
|
31279
|
-
playbackRate,
|
|
31280
|
-
trimAfter,
|
|
31281
|
-
trimBefore
|
|
31282
|
-
});
|
|
31283
|
-
const maxTimes = compDuration / durationInFrames;
|
|
31284
|
-
return {
|
|
31285
|
-
numberOfTimes: maxTimes,
|
|
31286
|
-
startOffset: 0,
|
|
31287
|
-
durationInFrames
|
|
31288
|
-
};
|
|
31289
|
-
}, [
|
|
31290
|
-
compDuration,
|
|
31291
|
-
fps,
|
|
31292
|
-
loop,
|
|
31293
|
-
mediaDurationInSeconds,
|
|
31294
|
-
playbackRate,
|
|
31295
|
-
trimAfter,
|
|
31296
|
-
trimBefore
|
|
31297
|
-
]);
|
|
31298
|
-
return loopDisplay;
|
|
31299
|
-
};
|
|
31300
31354
|
var useCommonEffects = ({
|
|
31301
31355
|
mediaPlayerRef,
|
|
31302
31356
|
mediaPlayerReady,
|
|
@@ -31441,109 +31495,6 @@ var useCommonEffects = ({
|
|
|
31441
31495
|
Internals.Log.trace({ logLevel, tag: "@remotion/media" }, `[${label3}] Updating target time to ${currentTime.toFixed(3)}s`);
|
|
31442
31496
|
}, [currentTime, logLevel, mediaPlayerReady, label3, mediaPlayerRef]);
|
|
31443
31497
|
};
|
|
31444
|
-
var useMediaInTimeline2 = ({
|
|
31445
|
-
volume,
|
|
31446
|
-
mediaVolume,
|
|
31447
|
-
src,
|
|
31448
|
-
mediaType,
|
|
31449
|
-
playbackRate,
|
|
31450
|
-
displayName,
|
|
31451
|
-
stack,
|
|
31452
|
-
showInTimeline,
|
|
31453
|
-
premountDisplay,
|
|
31454
|
-
postmountDisplay,
|
|
31455
|
-
loopDisplay,
|
|
31456
|
-
trimBefore,
|
|
31457
|
-
trimAfter,
|
|
31458
|
-
controls,
|
|
31459
|
-
_experimentalEffects
|
|
31460
|
-
}) => {
|
|
31461
|
-
const parentSequence = useContext212(Internals.SequenceContext);
|
|
31462
|
-
const startsAt = Internals.useMediaStartsAt();
|
|
31463
|
-
const { registerSequence, unregisterSequence } = useContext212(Internals.SequenceManager);
|
|
31464
|
-
const [mediaId] = useState41(() => String(Math.random()));
|
|
31465
|
-
const {
|
|
31466
|
-
volumes,
|
|
31467
|
-
duration,
|
|
31468
|
-
doesVolumeChange,
|
|
31469
|
-
nonce,
|
|
31470
|
-
rootId,
|
|
31471
|
-
isStudio,
|
|
31472
|
-
finalDisplayName
|
|
31473
|
-
} = Internals.useBasicMediaInTimeline({
|
|
31474
|
-
volume,
|
|
31475
|
-
mediaVolume,
|
|
31476
|
-
mediaType,
|
|
31477
|
-
src,
|
|
31478
|
-
displayName,
|
|
31479
|
-
trimBefore,
|
|
31480
|
-
trimAfter,
|
|
31481
|
-
playbackRate
|
|
31482
|
-
});
|
|
31483
|
-
useEffect44(() => {
|
|
31484
|
-
if (!src) {
|
|
31485
|
-
throw new Error("No src passed");
|
|
31486
|
-
}
|
|
31487
|
-
if (!isStudio && window.process?.env?.NODE_ENV !== "test") {
|
|
31488
|
-
return;
|
|
31489
|
-
}
|
|
31490
|
-
if (!showInTimeline) {
|
|
31491
|
-
return;
|
|
31492
|
-
}
|
|
31493
|
-
registerSequence({
|
|
31494
|
-
type: mediaType,
|
|
31495
|
-
src,
|
|
31496
|
-
id: mediaId,
|
|
31497
|
-
duration,
|
|
31498
|
-
from: 0,
|
|
31499
|
-
parent: parentSequence?.id ?? null,
|
|
31500
|
-
displayName: finalDisplayName,
|
|
31501
|
-
rootId,
|
|
31502
|
-
volume: volumes,
|
|
31503
|
-
showInTimeline: true,
|
|
31504
|
-
nonce: nonce.get(),
|
|
31505
|
-
startMediaFrom: 0 - startsAt + (trimBefore ?? 0),
|
|
31506
|
-
doesVolumeChange,
|
|
31507
|
-
loopDisplay,
|
|
31508
|
-
playbackRate,
|
|
31509
|
-
stack,
|
|
31510
|
-
premountDisplay,
|
|
31511
|
-
postmountDisplay,
|
|
31512
|
-
controls: controls ?? null,
|
|
31513
|
-
effects: _experimentalEffects
|
|
31514
|
-
});
|
|
31515
|
-
return () => {
|
|
31516
|
-
unregisterSequence(mediaId);
|
|
31517
|
-
};
|
|
31518
|
-
}, [
|
|
31519
|
-
controls,
|
|
31520
|
-
doesVolumeChange,
|
|
31521
|
-
duration,
|
|
31522
|
-
finalDisplayName,
|
|
31523
|
-
isStudio,
|
|
31524
|
-
loopDisplay,
|
|
31525
|
-
mediaId,
|
|
31526
|
-
mediaType,
|
|
31527
|
-
nonce,
|
|
31528
|
-
parentSequence?.id,
|
|
31529
|
-
playbackRate,
|
|
31530
|
-
postmountDisplay,
|
|
31531
|
-
premountDisplay,
|
|
31532
|
-
registerSequence,
|
|
31533
|
-
rootId,
|
|
31534
|
-
showInTimeline,
|
|
31535
|
-
src,
|
|
31536
|
-
stack,
|
|
31537
|
-
startsAt,
|
|
31538
|
-
unregisterSequence,
|
|
31539
|
-
volumes,
|
|
31540
|
-
trimBefore,
|
|
31541
|
-
_experimentalEffects
|
|
31542
|
-
]);
|
|
31543
|
-
return {
|
|
31544
|
-
id: mediaId
|
|
31545
|
-
};
|
|
31546
|
-
};
|
|
31547
31498
|
var {
|
|
31548
31499
|
useUnsafeVideoConfig: useUnsafeVideoConfig2,
|
|
31549
31500
|
Timeline,
|
|
@@ -31575,23 +31526,22 @@ var AudioForPreviewAssertedShowing = ({
|
|
|
31575
31526
|
fallbackHtml5AudioProps,
|
|
31576
31527
|
onError,
|
|
31577
31528
|
credentials,
|
|
31578
|
-
|
|
31529
|
+
setMediaDurationInSeconds
|
|
31579
31530
|
}) => {
|
|
31580
31531
|
const videoConfig = useUnsafeVideoConfig2();
|
|
31581
31532
|
const frame = useCurrentFrame();
|
|
31582
31533
|
const mediaPlayerRef = useRef44(null);
|
|
31583
31534
|
const initialTrimBeforeRef = useRef44(trimBefore);
|
|
31584
31535
|
const initialTrimAfterRef = useRef44(trimAfter);
|
|
31585
|
-
const [mediaPlayerReady, setMediaPlayerReady] =
|
|
31586
|
-
const [shouldFallbackToNativeAudio, setShouldFallbackToNativeAudio] =
|
|
31536
|
+
const [mediaPlayerReady, setMediaPlayerReady] = useState41(false);
|
|
31537
|
+
const [shouldFallbackToNativeAudio, setShouldFallbackToNativeAudio] = useState41(false);
|
|
31587
31538
|
const [playing] = Timeline.usePlayingState();
|
|
31588
31539
|
const timelineContext = Internals.useTimelineContext();
|
|
31589
31540
|
const globalPlaybackRate = timelineContext.playbackRate;
|
|
31590
|
-
const sharedAudioContext =
|
|
31541
|
+
const sharedAudioContext = useContext212(SharedAudioContext2);
|
|
31591
31542
|
const buffer = useBufferState();
|
|
31592
31543
|
const [mediaMuted] = useMediaMutedState2();
|
|
31593
31544
|
const [mediaVolume] = useMediaVolumeState2();
|
|
31594
|
-
const [mediaDurationInSeconds, setMediaDurationInSeconds] = useState210(null);
|
|
31595
31545
|
const volumePropFrame = useFrameForVolumeProp2(loopVolumeCurveBehavior ?? "repeat");
|
|
31596
31546
|
const userPreferredVolume = evaluateVolume2({
|
|
31597
31547
|
frame: volumePropFrame,
|
|
@@ -31609,38 +31559,11 @@ var AudioForPreviewAssertedShowing = ({
|
|
|
31609
31559
|
const currentTimeRef = useRef44(currentTime);
|
|
31610
31560
|
currentTimeRef.current = currentTime;
|
|
31611
31561
|
const preloadedSrc = usePreload2(src);
|
|
31612
|
-
const parentSequence =
|
|
31562
|
+
const parentSequence = useContext212(SequenceContext2);
|
|
31613
31563
|
const isPremounting = Boolean(parentSequence?.premounting);
|
|
31614
31564
|
const isPostmounting = Boolean(parentSequence?.postmounting);
|
|
31615
31565
|
const sequenceOffset = ((parentSequence?.cumulatedFrom ?? 0) + (parentSequence?.relativeFrom ?? 0)) / videoConfig.fps;
|
|
31616
|
-
const
|
|
31617
|
-
loop,
|
|
31618
|
-
mediaDurationInSeconds,
|
|
31619
|
-
playbackRate,
|
|
31620
|
-
trimAfter,
|
|
31621
|
-
trimBefore
|
|
31622
|
-
});
|
|
31623
|
-
const effects = useMemo213(() => {
|
|
31624
|
-
return [];
|
|
31625
|
-
}, []);
|
|
31626
|
-
useMediaInTimeline2({
|
|
31627
|
-
volume,
|
|
31628
|
-
mediaVolume,
|
|
31629
|
-
mediaType: "audio",
|
|
31630
|
-
src,
|
|
31631
|
-
playbackRate,
|
|
31632
|
-
displayName: name ?? null,
|
|
31633
|
-
stack,
|
|
31634
|
-
showInTimeline,
|
|
31635
|
-
premountDisplay: parentSequence?.premountDisplay ?? null,
|
|
31636
|
-
postmountDisplay: parentSequence?.postmountDisplay ?? null,
|
|
31637
|
-
loopDisplay,
|
|
31638
|
-
trimAfter,
|
|
31639
|
-
trimBefore,
|
|
31640
|
-
controls,
|
|
31641
|
-
_experimentalEffects: effects
|
|
31642
|
-
});
|
|
31643
|
-
const bufferingContext = useContext310(Internals.BufferingContextReact);
|
|
31566
|
+
const bufferingContext = useContext212(Internals.BufferingContextReact);
|
|
31644
31567
|
if (!bufferingContext) {
|
|
31645
31568
|
throw new Error("useMediaPlayback must be used inside a <BufferingContext>");
|
|
31646
31569
|
}
|
|
@@ -31677,7 +31600,7 @@ var AudioForPreviewAssertedShowing = ({
|
|
|
31677
31600
|
logLevel,
|
|
31678
31601
|
label: "AudioForPreview"
|
|
31679
31602
|
});
|
|
31680
|
-
|
|
31603
|
+
useEffect44(() => {
|
|
31681
31604
|
if (!sharedAudioContext)
|
|
31682
31605
|
return;
|
|
31683
31606
|
if (!sharedAudioContext.audioContext)
|
|
@@ -31814,7 +31737,8 @@ var AudioForPreviewAssertedShowing = ({
|
|
|
31814
31737
|
disallowFallbackToHtml5Audio,
|
|
31815
31738
|
buffer,
|
|
31816
31739
|
onError,
|
|
31817
|
-
credentials
|
|
31740
|
+
credentials,
|
|
31741
|
+
setMediaDurationInSeconds
|
|
31818
31742
|
]);
|
|
31819
31743
|
if (shouldFallbackToNativeAudio && !disallowFallbackToHtml5Audio) {
|
|
31820
31744
|
return /* @__PURE__ */ jsx58(Audio, {
|
|
@@ -31857,14 +31781,14 @@ var AudioForPreview2 = ({
|
|
|
31857
31781
|
fallbackHtml5AudioProps,
|
|
31858
31782
|
onError,
|
|
31859
31783
|
credentials,
|
|
31860
|
-
|
|
31784
|
+
setMediaDurationInSeconds
|
|
31861
31785
|
}) => {
|
|
31862
31786
|
const preloadedSrc = usePreload2(src);
|
|
31863
31787
|
const defaultLogLevel = Internals.useLogLevel();
|
|
31864
31788
|
const frame = useCurrentFrame();
|
|
31865
31789
|
const videoConfig = useVideoConfig();
|
|
31866
31790
|
const currentTime = frame / videoConfig.fps;
|
|
31867
|
-
const showShow =
|
|
31791
|
+
const showShow = useMemo56(() => {
|
|
31868
31792
|
return getTimeInSeconds({
|
|
31869
31793
|
unloopedTimeInSeconds: currentTime,
|
|
31870
31794
|
playbackRate,
|
|
@@ -31888,6 +31812,9 @@ var AudioForPreview2 = ({
|
|
|
31888
31812
|
if (!showShow) {
|
|
31889
31813
|
return null;
|
|
31890
31814
|
}
|
|
31815
|
+
if (!setMediaDurationInSeconds) {
|
|
31816
|
+
throw new Error("setMediaDurationInSeconds is required");
|
|
31817
|
+
}
|
|
31891
31818
|
return /* @__PURE__ */ jsx58(AudioForPreviewAssertedShowing, {
|
|
31892
31819
|
audioStreamIndex,
|
|
31893
31820
|
src: preloadedSrc,
|
|
@@ -31907,7 +31834,7 @@ var AudioForPreview2 = ({
|
|
|
31907
31834
|
onError,
|
|
31908
31835
|
credentials,
|
|
31909
31836
|
fallbackHtml5AudioProps,
|
|
31910
|
-
|
|
31837
|
+
setMediaDurationInSeconds
|
|
31911
31838
|
});
|
|
31912
31839
|
};
|
|
31913
31840
|
var makeAudioCache = () => {
|
|
@@ -33724,7 +33651,7 @@ var AudioForRendering2 = ({
|
|
|
33724
33651
|
const frame = useCurrentFrame();
|
|
33725
33652
|
const absoluteFrame = Internals.useTimelinePosition();
|
|
33726
33653
|
const videoConfig = Internals.useUnsafeVideoConfig();
|
|
33727
|
-
const { registerRenderAsset, unregisterRenderAsset } =
|
|
33654
|
+
const { registerRenderAsset, unregisterRenderAsset } = useContext310(Internals.RenderAssetManager);
|
|
33728
33655
|
const startsAt = Internals.useMediaStartsAt();
|
|
33729
33656
|
const environment = useRemotionEnvironment();
|
|
33730
33657
|
if (!videoConfig) {
|
|
@@ -33735,9 +33662,9 @@ var AudioForRendering2 = ({
|
|
|
33735
33662
|
}
|
|
33736
33663
|
const { fps } = videoConfig;
|
|
33737
33664
|
const { delayRender: delayRender2, continueRender } = useDelayRender();
|
|
33738
|
-
const [replaceWithHtml5Audio, setReplaceWithHtml5Audio] =
|
|
33739
|
-
const sequenceContext =
|
|
33740
|
-
const id =
|
|
33665
|
+
const [replaceWithHtml5Audio, setReplaceWithHtml5Audio] = useState210(false);
|
|
33666
|
+
const sequenceContext = useContext310(Internals.SequenceContext);
|
|
33667
|
+
const id = useMemo213(() => `media-audio-${random(src)}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.relativeFrom}-${sequenceContext?.durationInFrames}`, [
|
|
33741
33668
|
src,
|
|
33742
33669
|
sequenceContext?.cumulatedFrom,
|
|
33743
33670
|
sequenceContext?.relativeFrom,
|
|
@@ -33925,28 +33852,75 @@ var AudioInner = (props) => {
|
|
|
33925
33852
|
name,
|
|
33926
33853
|
stack,
|
|
33927
33854
|
showInTimeline,
|
|
33928
|
-
controls,
|
|
33855
|
+
_experimentalControls: controls,
|
|
33929
33856
|
from,
|
|
33930
33857
|
durationInFrames,
|
|
33931
33858
|
...otherProps
|
|
33932
33859
|
} = props;
|
|
33933
33860
|
const environment = useRemotionEnvironment();
|
|
33861
|
+
const [mediaVolume] = Internals.useMediaVolumeState();
|
|
33862
|
+
const mediaStartsAt = Internals.useMediaStartsAt();
|
|
33863
|
+
const videoConfig = useVideoConfig();
|
|
33864
|
+
const sequenceDurationInFrames = Math.min(durationInFrames ?? Infinity, Math.max(0, videoConfig.durationInFrames - (from ?? 0)));
|
|
33865
|
+
const basicInfo = Internals.useBasicMediaInTimeline({
|
|
33866
|
+
src: props.src,
|
|
33867
|
+
volume: props.volume,
|
|
33868
|
+
playbackRate: props.playbackRate ?? 1,
|
|
33869
|
+
trimBefore: props.trimBefore,
|
|
33870
|
+
trimAfter: props.trimAfter,
|
|
33871
|
+
sequenceDurationInFrames,
|
|
33872
|
+
mediaType: "audio",
|
|
33873
|
+
displayName: name ?? "<Audio>",
|
|
33874
|
+
mediaVolume,
|
|
33875
|
+
mediaStartsAt,
|
|
33876
|
+
loop: props.loop ?? false
|
|
33877
|
+
});
|
|
33878
|
+
const [mediaDurationInSeconds, setMediaDurationInSeconds] = useState312(null);
|
|
33879
|
+
const loopDisplay = useMemo312(() => getLoopDisplay({
|
|
33880
|
+
loop: props.loop ?? false,
|
|
33881
|
+
mediaDurationInSeconds,
|
|
33882
|
+
playbackRate: props.playbackRate ?? 1,
|
|
33883
|
+
trimAfter: props.trimAfter,
|
|
33884
|
+
trimBefore: props.trimBefore,
|
|
33885
|
+
sequenceDurationInFrames,
|
|
33886
|
+
compFps: videoConfig.fps
|
|
33887
|
+
}), [
|
|
33888
|
+
props.loop,
|
|
33889
|
+
mediaDurationInSeconds,
|
|
33890
|
+
props.playbackRate,
|
|
33891
|
+
props.trimAfter,
|
|
33892
|
+
props.trimBefore,
|
|
33893
|
+
sequenceDurationInFrames,
|
|
33894
|
+
videoConfig.fps
|
|
33895
|
+
]);
|
|
33896
|
+
const isMedia = useMemo312(() => ({
|
|
33897
|
+
type: "audio",
|
|
33898
|
+
data: basicInfo
|
|
33899
|
+
}), [basicInfo]);
|
|
33934
33900
|
if (typeof props.src !== "string") {
|
|
33935
33901
|
throw new TypeError(`The \`<Audio>\` tag requires a string for \`src\`, but got ${JSON.stringify(props.src)} instead.`);
|
|
33936
33902
|
}
|
|
33937
33903
|
validateMediaProps2({ playbackRate: props.playbackRate, volume: props.volume }, "Audio");
|
|
33904
|
+
if (sequenceDurationInFrames === 0) {
|
|
33905
|
+
return null;
|
|
33906
|
+
}
|
|
33938
33907
|
return /* @__PURE__ */ jsx315(Sequence, {
|
|
33939
33908
|
layout: "none",
|
|
33940
33909
|
from: from ?? 0,
|
|
33941
|
-
durationInFrames:
|
|
33942
|
-
|
|
33910
|
+
durationInFrames: basicInfo.duration,
|
|
33911
|
+
_remotionInternalStack: stack,
|
|
33912
|
+
_remotionInternalIsMedia: isMedia,
|
|
33913
|
+
name: name ?? "<Audio>",
|
|
33914
|
+
_experimentalControls: controls,
|
|
33915
|
+
_remotionInternalLoopDisplay: loopDisplay,
|
|
33916
|
+
showInTimeline: showInTimeline ?? true,
|
|
33943
33917
|
children: environment.isRendering ? /* @__PURE__ */ jsx315(AudioForRendering2, {
|
|
33944
33918
|
...otherProps
|
|
33945
33919
|
}) : /* @__PURE__ */ jsx315(AudioForPreview2, {
|
|
33946
33920
|
name,
|
|
33947
33921
|
...otherProps,
|
|
33948
33922
|
stack: stack ?? null,
|
|
33949
|
-
|
|
33923
|
+
setMediaDurationInSeconds
|
|
33950
33924
|
})
|
|
33951
33925
|
});
|
|
33952
33926
|
};
|
|
@@ -34001,9 +33975,7 @@ var {
|
|
|
34001
33975
|
warnAboutTooHighVolume: warnAboutTooHighVolume22,
|
|
34002
33976
|
usePreload: usePreload22,
|
|
34003
33977
|
SequenceContext: SequenceContext22,
|
|
34004
|
-
|
|
34005
|
-
useEffectChainState: useEffectChainState2,
|
|
34006
|
-
useMemoizedEffects: useMemoizedEffects2
|
|
33978
|
+
useEffectChainState: useEffectChainState2
|
|
34007
33979
|
} = Internals;
|
|
34008
33980
|
var VideoForPreviewAssertedShowing = ({
|
|
34009
33981
|
src: unpreloadedSrc,
|
|
@@ -34017,7 +33989,6 @@ var VideoForPreviewAssertedShowing = ({
|
|
|
34017
33989
|
onVideoFrame,
|
|
34018
33990
|
showInTimeline,
|
|
34019
33991
|
loop,
|
|
34020
|
-
name,
|
|
34021
33992
|
trimAfter,
|
|
34022
33993
|
trimBefore,
|
|
34023
33994
|
stack,
|
|
@@ -34028,10 +33999,10 @@ var VideoForPreviewAssertedShowing = ({
|
|
|
34028
33999
|
headless,
|
|
34029
34000
|
onError,
|
|
34030
34001
|
credentials,
|
|
34031
|
-
controls,
|
|
34032
34002
|
objectFit: objectFitProp,
|
|
34033
34003
|
_experimentalInitiallyDrawCachedFrame,
|
|
34034
|
-
_experimentalEffects
|
|
34004
|
+
_experimentalEffects,
|
|
34005
|
+
setMediaDurationInSeconds
|
|
34035
34006
|
}) => {
|
|
34036
34007
|
const src = usePreload22(unpreloadedSrc);
|
|
34037
34008
|
const canvasRef = useRef210(null);
|
|
@@ -34046,12 +34017,10 @@ var VideoForPreviewAssertedShowing = ({
|
|
|
34046
34017
|
const [playing] = Timeline2.usePlayingState();
|
|
34047
34018
|
const timelineContext = Internals.useTimelineContext();
|
|
34048
34019
|
const globalPlaybackRate = timelineContext.playbackRate;
|
|
34049
|
-
const sharedAudioContext =
|
|
34020
|
+
const sharedAudioContext = useContext46(SharedAudioContext22);
|
|
34050
34021
|
const buffer = useBufferState();
|
|
34051
34022
|
const [mediaMuted] = useMediaMutedState22();
|
|
34052
34023
|
const [mediaVolume] = useMediaVolumeState22();
|
|
34053
|
-
const [mediaDurationInSeconds, setMediaDurationInSeconds] = useState43(null);
|
|
34054
|
-
const { hidden } = useContext53(SequenceVisibilityToggleContext2);
|
|
34055
34024
|
const volumePropFrame = useFrameForVolumeProp22(loopVolumeCurveBehavior);
|
|
34056
34025
|
const userPreferredVolume = evaluateVolume22({
|
|
34057
34026
|
frame: volumePropFrame,
|
|
@@ -34065,49 +34034,23 @@ var VideoForPreviewAssertedShowing = ({
|
|
|
34065
34034
|
const effectChainState = useEffectChainState2();
|
|
34066
34035
|
const experimentalEffectsRef = useRef210(_experimentalEffects);
|
|
34067
34036
|
experimentalEffectsRef.current = _experimentalEffects;
|
|
34068
|
-
const memoizedEffects = useMemoizedEffects2(_experimentalEffects.flat());
|
|
34069
34037
|
const effectChainStateRef = useRef210(effectChainState);
|
|
34070
34038
|
effectChainStateRef.current = effectChainState;
|
|
34071
34039
|
const frameRef = useRef210(frame);
|
|
34072
34040
|
frameRef.current = frame;
|
|
34073
|
-
const parentSequence =
|
|
34041
|
+
const parentSequence = useContext46(SequenceContext22);
|
|
34074
34042
|
const isPremounting = Boolean(parentSequence?.premounting);
|
|
34075
34043
|
const isPostmounting = Boolean(parentSequence?.postmounting);
|
|
34076
34044
|
const sequenceOffset = ((parentSequence?.cumulatedFrom ?? 0) + (parentSequence?.relativeFrom ?? 0)) / videoConfig.fps;
|
|
34077
|
-
const loopDisplay = useLoopDisplay({
|
|
34078
|
-
loop,
|
|
34079
|
-
mediaDurationInSeconds,
|
|
34080
|
-
playbackRate,
|
|
34081
|
-
trimAfter,
|
|
34082
|
-
trimBefore
|
|
34083
|
-
});
|
|
34084
|
-
const { id: timelineId } = useMediaInTimeline2({
|
|
34085
|
-
volume,
|
|
34086
|
-
mediaType: "video",
|
|
34087
|
-
src,
|
|
34088
|
-
playbackRate,
|
|
34089
|
-
displayName: name ?? null,
|
|
34090
|
-
stack,
|
|
34091
|
-
showInTimeline,
|
|
34092
|
-
premountDisplay: parentSequence?.premountDisplay ?? null,
|
|
34093
|
-
postmountDisplay: parentSequence?.postmountDisplay ?? null,
|
|
34094
|
-
loopDisplay,
|
|
34095
|
-
mediaVolume,
|
|
34096
|
-
trimAfter,
|
|
34097
|
-
trimBefore,
|
|
34098
|
-
controls,
|
|
34099
|
-
_experimentalEffects: memoizedEffects
|
|
34100
|
-
});
|
|
34101
|
-
const isSequenceHidden = hidden[timelineId] ?? false;
|
|
34102
34045
|
const currentTime = frame / videoConfig.fps;
|
|
34103
34046
|
const currentTimeRef = useRef210(currentTime);
|
|
34104
34047
|
currentTimeRef.current = currentTime;
|
|
34105
34048
|
const preloadedSrc = usePreload22(src);
|
|
34106
|
-
const buffering =
|
|
34049
|
+
const buffering = useContext46(Internals.BufferingContextReact);
|
|
34107
34050
|
if (!buffering) {
|
|
34108
34051
|
throw new Error("useMediaPlayback must be used inside a <BufferingContext>");
|
|
34109
34052
|
}
|
|
34110
|
-
const effectiveMuted =
|
|
34053
|
+
const effectiveMuted = muted || mediaMuted || userPreferredVolume <= 0;
|
|
34111
34054
|
const isPlayerBuffering = Internals.useIsPlayerBuffering(buffering);
|
|
34112
34055
|
const initialPlaying = useRef210(playing && !isPlayerBuffering);
|
|
34113
34056
|
const initialIsPremounting = useRef210(isPremounting);
|
|
@@ -34155,7 +34098,7 @@ var VideoForPreviewAssertedShowing = ({
|
|
|
34155
34098
|
cacheVideoFrame(src, canvas);
|
|
34156
34099
|
};
|
|
34157
34100
|
}, [_experimentalInitiallyDrawCachedFrame, src]);
|
|
34158
|
-
|
|
34101
|
+
useEffect210(() => {
|
|
34159
34102
|
if (!sharedAudioContext)
|
|
34160
34103
|
return;
|
|
34161
34104
|
if (!sharedAudioContext.audioContext)
|
|
@@ -34292,7 +34235,8 @@ var VideoForPreviewAssertedShowing = ({
|
|
|
34292
34235
|
sharedAudioContext,
|
|
34293
34236
|
videoConfig.fps,
|
|
34294
34237
|
onError,
|
|
34295
|
-
credentials
|
|
34238
|
+
credentials,
|
|
34239
|
+
setMediaDurationInSeconds
|
|
34296
34240
|
]);
|
|
34297
34241
|
warnAboutObjectFitInStyleOrClassName({ style: style2, className: className2, logLevel });
|
|
34298
34242
|
const classNameValue = useMemo412(() => {
|
|
@@ -34338,10 +34282,9 @@ var VideoForPreviewAssertedShowing = ({
|
|
|
34338
34282
|
const actualStyle = useMemo412(() => {
|
|
34339
34283
|
return {
|
|
34340
34284
|
...style2,
|
|
34341
|
-
opacity: isSequenceHidden ? 0 : style2?.opacity ?? 1,
|
|
34342
34285
|
objectFit: objectFitProp
|
|
34343
34286
|
};
|
|
34344
|
-
}, [
|
|
34287
|
+
}, [objectFitProp, style2]);
|
|
34345
34288
|
if (shouldFallbackToNativeVideo && !disallowFallbackToOffthreadVideo) {
|
|
34346
34289
|
return /* @__PURE__ */ jsx412(Html5Video, {
|
|
34347
34290
|
src,
|
|
@@ -34353,7 +34296,7 @@ var VideoForPreviewAssertedShowing = ({
|
|
|
34353
34296
|
trimBefore,
|
|
34354
34297
|
playbackRate,
|
|
34355
34298
|
loopVolumeCurveBehavior,
|
|
34356
|
-
name,
|
|
34299
|
+
name: "<Html5Video> (fallback)",
|
|
34357
34300
|
loop,
|
|
34358
34301
|
showInTimeline,
|
|
34359
34302
|
stack: stack ?? undefined,
|
|
@@ -34398,8 +34341,7 @@ var VideoForPreview2 = (props) => {
|
|
|
34398
34341
|
return null;
|
|
34399
34342
|
}
|
|
34400
34343
|
return /* @__PURE__ */ jsx412(VideoForPreviewAssertedShowing, {
|
|
34401
|
-
...props
|
|
34402
|
-
controls: props.controls
|
|
34344
|
+
...props
|
|
34403
34345
|
});
|
|
34404
34346
|
};
|
|
34405
34347
|
var VideoForRendering2 = ({
|
|
@@ -34417,7 +34359,6 @@ var VideoForRendering2 = ({
|
|
|
34417
34359
|
className: className2,
|
|
34418
34360
|
fallbackOffthreadVideoProps,
|
|
34419
34361
|
audioStreamIndex,
|
|
34420
|
-
name,
|
|
34421
34362
|
disallowFallbackToOffthreadVideo,
|
|
34422
34363
|
stack,
|
|
34423
34364
|
toneFrequency,
|
|
@@ -34434,9 +34375,9 @@ var VideoForRendering2 = ({
|
|
|
34434
34375
|
const frame = useCurrentFrame();
|
|
34435
34376
|
const absoluteFrame = Internals.useTimelinePosition();
|
|
34436
34377
|
const { fps } = useVideoConfig();
|
|
34437
|
-
const { registerRenderAsset, unregisterRenderAsset } =
|
|
34378
|
+
const { registerRenderAsset, unregisterRenderAsset } = useContext53(Internals.RenderAssetManager);
|
|
34438
34379
|
const startsAt = Internals.useMediaStartsAt();
|
|
34439
|
-
const sequenceContext =
|
|
34380
|
+
const sequenceContext = useContext53(Internals.SequenceContext);
|
|
34440
34381
|
const id = useMemo55(() => `media-video-${random(src)}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.relativeFrom}-${sequenceContext?.durationInFrames}`, [
|
|
34441
34382
|
src,
|
|
34442
34383
|
sequenceContext?.cumulatedFrom,
|
|
@@ -34648,12 +34589,12 @@ var VideoForRendering2 = ({
|
|
|
34648
34589
|
loopVolumeCurveBehavior: loopVolumeCurveBehavior ?? "repeat",
|
|
34649
34590
|
delayRenderRetries: delayRenderRetries ?? undefined,
|
|
34650
34591
|
delayRenderTimeoutInMilliseconds: delayRenderTimeoutInMilliseconds ?? undefined,
|
|
34592
|
+
name: "Fallback to <OffthreadVideo>",
|
|
34651
34593
|
style: styleWithObjectFit,
|
|
34652
34594
|
allowAmplificationDuringRender: true,
|
|
34653
34595
|
transparent: fallbackOffthreadVideoProps?.transparent ?? true,
|
|
34654
34596
|
toneMapped: fallbackOffthreadVideoProps?.toneMapped ?? true,
|
|
34655
34597
|
audioStreamIndex: audioStreamIndex ?? 0,
|
|
34656
|
-
name,
|
|
34657
34598
|
className: className2,
|
|
34658
34599
|
onVideoFrame,
|
|
34659
34600
|
volume: volumeProp,
|
|
@@ -34759,7 +34700,6 @@ var InnerVideo = ({
|
|
|
34759
34700
|
loop,
|
|
34760
34701
|
loopVolumeCurveBehavior,
|
|
34761
34702
|
muted,
|
|
34762
|
-
name,
|
|
34763
34703
|
onVideoFrame,
|
|
34764
34704
|
playbackRate,
|
|
34765
34705
|
style: style2,
|
|
@@ -34773,10 +34713,11 @@ var InnerVideo = ({
|
|
|
34773
34713
|
headless,
|
|
34774
34714
|
onError,
|
|
34775
34715
|
credentials,
|
|
34776
|
-
controls,
|
|
34716
|
+
_experimentalControls: controls,
|
|
34777
34717
|
objectFit,
|
|
34778
34718
|
_experimentalInitiallyDrawCachedFrame,
|
|
34779
|
-
_experimentalEffects
|
|
34719
|
+
_experimentalEffects,
|
|
34720
|
+
setMediaDurationInSeconds
|
|
34780
34721
|
}) => {
|
|
34781
34722
|
const environment = useRemotionEnvironment();
|
|
34782
34723
|
if (typeof src !== "string") {
|
|
@@ -34802,7 +34743,6 @@ var InnerVideo = ({
|
|
|
34802
34743
|
delayRenderRetries: delayRenderRetries ?? null,
|
|
34803
34744
|
delayRenderTimeoutInMilliseconds: delayRenderTimeoutInMilliseconds ?? null,
|
|
34804
34745
|
disallowFallbackToOffthreadVideo: disallowFallbackToOffthreadVideo ?? false,
|
|
34805
|
-
name,
|
|
34806
34746
|
fallbackOffthreadVideoProps,
|
|
34807
34747
|
logLevel,
|
|
34808
34748
|
loop,
|
|
@@ -34824,9 +34764,9 @@ var InnerVideo = ({
|
|
|
34824
34764
|
});
|
|
34825
34765
|
}
|
|
34826
34766
|
return /* @__PURE__ */ jsx65(VideoForPreview2, {
|
|
34767
|
+
setMediaDurationInSeconds,
|
|
34827
34768
|
audioStreamIndex: audioStreamIndex ?? 0,
|
|
34828
34769
|
className: className2,
|
|
34829
|
-
name,
|
|
34830
34770
|
logLevel,
|
|
34831
34771
|
loop,
|
|
34832
34772
|
loopVolumeCurveBehavior,
|
|
@@ -34878,19 +34818,66 @@ var VideoInner = ({
|
|
|
34878
34818
|
headless,
|
|
34879
34819
|
onError,
|
|
34880
34820
|
credentials,
|
|
34881
|
-
controls,
|
|
34821
|
+
_experimentalControls: controls,
|
|
34882
34822
|
objectFit,
|
|
34883
34823
|
_experimentalInitiallyDrawCachedFrame,
|
|
34884
34824
|
_experimentalEffects,
|
|
34885
|
-
|
|
34886
|
-
|
|
34825
|
+
durationInFrames,
|
|
34826
|
+
from
|
|
34887
34827
|
}) => {
|
|
34888
34828
|
const fallbackLogLevel = Internals.useLogLevel();
|
|
34829
|
+
const [mediaVolume] = Internals.useMediaVolumeState();
|
|
34830
|
+
const mediaStartsAt = Internals.useMediaStartsAt();
|
|
34831
|
+
const videoConfig = useVideoConfig();
|
|
34832
|
+
const sequenceDurationInFrames = Math.min(durationInFrames ?? Infinity, Math.max(0, videoConfig.durationInFrames - (from ?? 0)));
|
|
34833
|
+
const basicInfo = Internals.useBasicMediaInTimeline({
|
|
34834
|
+
src,
|
|
34835
|
+
volume,
|
|
34836
|
+
playbackRate: playbackRate ?? 1,
|
|
34837
|
+
trimBefore,
|
|
34838
|
+
trimAfter,
|
|
34839
|
+
sequenceDurationInFrames,
|
|
34840
|
+
mediaType: "video",
|
|
34841
|
+
displayName: name ?? "<Video>",
|
|
34842
|
+
mediaVolume,
|
|
34843
|
+
mediaStartsAt,
|
|
34844
|
+
loop: loop ?? false
|
|
34845
|
+
});
|
|
34846
|
+
const [mediaDurationInSeconds, setMediaDurationInSeconds] = useState63(null);
|
|
34847
|
+
const loopDisplay = useMemo63(() => getLoopDisplay({
|
|
34848
|
+
loop: loop ?? false,
|
|
34849
|
+
mediaDurationInSeconds,
|
|
34850
|
+
playbackRate: playbackRate ?? 1,
|
|
34851
|
+
trimAfter,
|
|
34852
|
+
trimBefore,
|
|
34853
|
+
sequenceDurationInFrames,
|
|
34854
|
+
compFps: videoConfig.fps
|
|
34855
|
+
}), [
|
|
34856
|
+
loop,
|
|
34857
|
+
mediaDurationInSeconds,
|
|
34858
|
+
playbackRate,
|
|
34859
|
+
trimAfter,
|
|
34860
|
+
trimBefore,
|
|
34861
|
+
sequenceDurationInFrames,
|
|
34862
|
+
videoConfig.fps
|
|
34863
|
+
]);
|
|
34864
|
+
const isMedia = useMemo63(() => ({
|
|
34865
|
+
type: "video",
|
|
34866
|
+
data: basicInfo
|
|
34867
|
+
}), [basicInfo]);
|
|
34868
|
+
if (sequenceDurationInFrames === 0) {
|
|
34869
|
+
return null;
|
|
34870
|
+
}
|
|
34889
34871
|
return /* @__PURE__ */ jsx65(Sequence, {
|
|
34890
34872
|
layout: "none",
|
|
34891
34873
|
from: from ?? 0,
|
|
34892
|
-
durationInFrames:
|
|
34893
|
-
|
|
34874
|
+
durationInFrames: basicInfo.duration,
|
|
34875
|
+
_remotionInternalStack: stack,
|
|
34876
|
+
_remotionInternalIsMedia: isMedia,
|
|
34877
|
+
name: name ?? "<Video>",
|
|
34878
|
+
_experimentalControls: controls,
|
|
34879
|
+
_remotionInternalLoopDisplay: loopDisplay,
|
|
34880
|
+
showInTimeline: showInTimeline ?? true,
|
|
34894
34881
|
children: /* @__PURE__ */ jsx65(InnerVideo, {
|
|
34895
34882
|
audioStreamIndex: audioStreamIndex ?? 0,
|
|
34896
34883
|
className: className2,
|
|
@@ -34902,7 +34889,6 @@ var VideoInner = ({
|
|
|
34902
34889
|
loop: loop ?? false,
|
|
34903
34890
|
loopVolumeCurveBehavior: loopVolumeCurveBehavior ?? "repeat",
|
|
34904
34891
|
muted: muted ?? false,
|
|
34905
|
-
name,
|
|
34906
34892
|
onVideoFrame,
|
|
34907
34893
|
playbackRate: playbackRate ?? 1,
|
|
34908
34894
|
showInTimeline: showInTimeline ?? true,
|
|
@@ -34917,10 +34903,11 @@ var VideoInner = ({
|
|
|
34917
34903
|
headless: headless ?? false,
|
|
34918
34904
|
onError,
|
|
34919
34905
|
credentials,
|
|
34920
|
-
controls,
|
|
34906
|
+
_experimentalControls: controls,
|
|
34921
34907
|
objectFit: objectFit ?? "contain",
|
|
34922
34908
|
_experimentalInitiallyDrawCachedFrame: _experimentalInitiallyDrawCachedFrame ?? false,
|
|
34923
|
-
_experimentalEffects: _experimentalEffects ?? []
|
|
34909
|
+
_experimentalEffects: _experimentalEffects ?? [],
|
|
34910
|
+
setMediaDurationInSeconds
|
|
34924
34911
|
})
|
|
34925
34912
|
});
|
|
34926
34913
|
};
|
|
@@ -36228,7 +36215,7 @@ import {
|
|
|
36228
36215
|
import { BufferTarget, StreamTarget } from "mediabunny";
|
|
36229
36216
|
|
|
36230
36217
|
// ../core/dist/esm/version.mjs
|
|
36231
|
-
var VERSION2 = "4.0.
|
|
36218
|
+
var VERSION2 = "4.0.456";
|
|
36232
36219
|
|
|
36233
36220
|
// ../web-renderer/dist/esm/index.mjs
|
|
36234
36221
|
import { AudioSample, VideoSample } from "mediabunny";
|
|
@@ -41234,7 +41221,7 @@ var DragAndDropNudge = () => {
|
|
|
41234
41221
|
};
|
|
41235
41222
|
|
|
41236
41223
|
// src/components/homepage/Demo/PlayerSeekBar.tsx
|
|
41237
|
-
import { useCallback as useCallback46, useEffect as useEffect53, useMemo as
|
|
41224
|
+
import { useCallback as useCallback46, useEffect as useEffect53, useMemo as useMemo64, useRef as useRef50, useState as useState51 } from "react";
|
|
41238
41225
|
|
|
41239
41226
|
// src/components/homepage/layout/use-el-size.ts
|
|
41240
41227
|
import { useCallback as useCallback45, useEffect as useEffect51, useMemo as useMemo61, useState as useState50 } from "react";
|
|
@@ -41454,7 +41441,7 @@ var PlayerSeekBar2 = ({
|
|
|
41454
41441
|
body.removeEventListener("pointerup", onPointerUp);
|
|
41455
41442
|
};
|
|
41456
41443
|
}, [dragging.dragging, onPointerMove, onPointerUp]);
|
|
41457
|
-
const knobStyle =
|
|
41444
|
+
const knobStyle = useMemo64(() => {
|
|
41458
41445
|
return {
|
|
41459
41446
|
height: KNOB_SIZE3,
|
|
41460
41447
|
width: KNOB_SIZE3,
|
|
@@ -41468,7 +41455,7 @@ var PlayerSeekBar2 = ({
|
|
|
41468
41455
|
transition: "opacity 0.s ease"
|
|
41469
41456
|
};
|
|
41470
41457
|
}, [barHovered, durationInFrames, frame, width2]);
|
|
41471
|
-
const fillStyle =
|
|
41458
|
+
const fillStyle = useMemo64(() => {
|
|
41472
41459
|
return {
|
|
41473
41460
|
height: BAR_HEIGHT3,
|
|
41474
41461
|
backgroundColor: "var(--ifm-font-color-base)",
|
|
@@ -41477,7 +41464,7 @@ var PlayerSeekBar2 = ({
|
|
|
41477
41464
|
borderRadius: BAR_HEIGHT3 / 2
|
|
41478
41465
|
};
|
|
41479
41466
|
}, [durationInFrames, frame, inFrame]);
|
|
41480
|
-
const active =
|
|
41467
|
+
const active = useMemo64(() => {
|
|
41481
41468
|
return {
|
|
41482
41469
|
height: BAR_HEIGHT3,
|
|
41483
41470
|
backgroundColor: "var(--ifm-font-color-base)",
|
|
@@ -41890,7 +41877,7 @@ var Demo = () => {
|
|
|
41890
41877
|
const updateCardOrder = useCallback49((newCardOrder) => {
|
|
41891
41878
|
setCardOrder(newCardOrder);
|
|
41892
41879
|
}, []);
|
|
41893
|
-
const props =
|
|
41880
|
+
const props = useMemo66(() => {
|
|
41894
41881
|
return {
|
|
41895
41882
|
theme: colorMode,
|
|
41896
41883
|
onToggle: () => {
|
|
@@ -42632,7 +42619,7 @@ var ParameterizeAndEdit = () => {
|
|
|
42632
42619
|
};
|
|
42633
42620
|
|
|
42634
42621
|
// src/components/homepage/RealMp4Videos.tsx
|
|
42635
|
-
import { useEffect as useEffect66, useRef as useRef58, useState as
|
|
42622
|
+
import { useEffect as useEffect66, useRef as useRef58, useState as useState64 } from "react";
|
|
42636
42623
|
import { jsx as jsx126, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
42637
42624
|
var icon4 = {
|
|
42638
42625
|
height: 16,
|
|
@@ -42641,7 +42628,7 @@ var icon4 = {
|
|
|
42641
42628
|
var RealMP4Videos = () => {
|
|
42642
42629
|
const ref = useRef58(null);
|
|
42643
42630
|
const videoRef = useRef58(null);
|
|
42644
|
-
const [vid, setVid] =
|
|
42631
|
+
const [vid, setVid] = useState64("/img/render-progress.webm");
|
|
42645
42632
|
useEffect66(() => {
|
|
42646
42633
|
if (isWebkit()) {
|
|
42647
42634
|
setVid("/img/render-progress.mp4");
|
|
@@ -42893,7 +42880,7 @@ var TrustedByBanner = () => {
|
|
|
42893
42880
|
var TrustedByBanner_default = TrustedByBanner;
|
|
42894
42881
|
|
|
42895
42882
|
// src/components/homepage/VideoAppsShowcase.tsx
|
|
42896
|
-
import { useRef as useRef59, useState as
|
|
42883
|
+
import { useRef as useRef59, useState as useState66 } from "react";
|
|
42897
42884
|
import { jsx as jsx128, jsxs as jsxs49 } from "react/jsx-runtime";
|
|
42898
42885
|
var tabs = [
|
|
42899
42886
|
"Music visualization",
|
|
@@ -42946,10 +42933,10 @@ var icon5 = {
|
|
|
42946
42933
|
marginLeft: 10
|
|
42947
42934
|
};
|
|
42948
42935
|
var VideoAppsShowcase = () => {
|
|
42949
|
-
const [activeTab, setActiveTab] =
|
|
42950
|
-
const [isMuted, setIsMuted] =
|
|
42951
|
-
const [isPlaying, setIsPlaying] =
|
|
42952
|
-
const [videoLoaded, setVideoLoaded] =
|
|
42936
|
+
const [activeTab, setActiveTab] = useState66(0);
|
|
42937
|
+
const [isMuted, setIsMuted] = useState66(true);
|
|
42938
|
+
const [isPlaying, setIsPlaying] = useState66(false);
|
|
42939
|
+
const [videoLoaded, setVideoLoaded] = useState66(false);
|
|
42953
42940
|
const videoRef = useRef59(null);
|
|
42954
42941
|
const containerRef = useRef59(null);
|
|
42955
42942
|
const handleTabChange = (index2) => {
|
|
@@ -44466,7 +44453,7 @@ var ChooseTemplate = () => {
|
|
|
44466
44453
|
};
|
|
44467
44454
|
|
|
44468
44455
|
// src/components/homepage/GetStartedStrip.tsx
|
|
44469
|
-
import { useState as
|
|
44456
|
+
import { useState as useState67 } from "react";
|
|
44470
44457
|
|
|
44471
44458
|
// src/components/homepage/GitHubButton.tsx
|
|
44472
44459
|
import { jsx as jsx164, jsxs as jsxs65 } from "react/jsx-runtime";
|
|
@@ -44492,7 +44479,7 @@ var GithubButton = () => {
|
|
|
44492
44479
|
" ",
|
|
44493
44480
|
/* @__PURE__ */ jsx164("div", {
|
|
44494
44481
|
className: "text-xs inline-block ml-2 leading-none mt-[3px] self-center",
|
|
44495
|
-
children: "
|
|
44482
|
+
children: "45k"
|
|
44496
44483
|
})
|
|
44497
44484
|
]
|
|
44498
44485
|
});
|
|
@@ -44501,7 +44488,7 @@ var GithubButton = () => {
|
|
|
44501
44488
|
// src/components/homepage/GetStartedStrip.tsx
|
|
44502
44489
|
import { jsx as jsx166, jsxs as jsxs66 } from "react/jsx-runtime";
|
|
44503
44490
|
var GetStarted = () => {
|
|
44504
|
-
const [clicked, setClicked] =
|
|
44491
|
+
const [clicked, setClicked] = useState67(null);
|
|
44505
44492
|
return /* @__PURE__ */ jsxs66("div", {
|
|
44506
44493
|
className: "flex flex-col lg:flex-row items-center justify-center text-center w-full",
|
|
44507
44494
|
children: [
|