@remotion/promo-pages 4.0.455 → 4.0.457
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 +419 -413
- package/dist/Users/jonathanburger/remotion/packages/promo-pages/dist/Homepage.css +32 -0
- package/dist/Users/jonathanburger/remotion/packages/promo-pages/dist/Homepage.js +42672 -0
- package/dist/Users/jonathanburger/remotion/packages/promo-pages/dist/design.js +20460 -0
- package/dist/Users/jonathanburger/remotion/packages/promo-pages/dist/experts/experts-data.js +740 -0
- package/dist/Users/jonathanburger/remotion/packages/promo-pages/dist/experts.js +8778 -0
- package/dist/Users/jonathanburger/remotion/packages/promo-pages/dist/homepage/Pricing.js +21875 -0
- package/dist/Users/jonathanburger/remotion/packages/promo-pages/dist/prompts/PromptsGallery.js +20301 -0
- package/dist/Users/jonathanburger/remotion/packages/promo-pages/dist/prompts/PromptsShow.css +2578 -0
- package/dist/Users/jonathanburger/remotion/packages/promo-pages/dist/prompts/PromptsShow.js +40128 -0
- package/dist/Users/jonathanburger/remotion/packages/promo-pages/dist/prompts/PromptsSubmit.css +2578 -0
- package/dist/Users/jonathanburger/remotion/packages/promo-pages/dist/prompts/PromptsSubmit.js +40219 -0
- package/dist/Users/jonathanburger/remotion/packages/promo-pages/dist/prompts/prompt-types.js +0 -0
- package/dist/Users/jonathanburger/remotion/packages/promo-pages/dist/team.js +292 -0
- package/dist/Users/jonathanburger/remotion/packages/promo-pages/dist/template-modal-content.css +32 -0
- package/dist/Users/jonathanburger/remotion/packages/promo-pages/dist/template-modal-content.js +22044 -0
- package/dist/Users/jonathanburger/remotion/packages/promo-pages/dist/templates.js +21306 -0
- package/dist/components/homepage/CommunityStatsItems.js +1 -1
- package/dist/components/homepage/FreePricing.js +11 -10
- package/dist/components/homepage/GitHubButton.js +1 -1
- package/dist/components/homepage/InfoTooltip.d.ts +6 -0
- package/dist/components/homepage/InfoTooltip.js +6 -0
- package/dist/components/team/TrustSection.js +1 -1
- package/dist/design.js +205 -125
- package/dist/experts.js +205 -125
- package/dist/homepage/Pricing.js +205 -125
- package/dist/prompts/PromptsGallery.js +206 -126
- package/dist/prompts/PromptsShow.js +239 -159
- package/dist/prompts/PromptsSubmit.js +241 -161
- package/dist/team.js +205 -125
- package/dist/template-modal-content.js +205 -125
- package/dist/templates.js +205 -125
- package/package.json +13 -13
package/dist/Homepage.js
CHANGED
|
@@ -861,8 +861,10 @@ import React14, { useCallback as useCallback6, useImperativeHandle, useRef as us
|
|
|
861
861
|
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
862
862
|
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
863
863
|
import {
|
|
864
|
+
createContext as createContext15,
|
|
864
865
|
forwardRef as forwardRef5,
|
|
865
866
|
useCallback as useCallback7,
|
|
867
|
+
useContext as useContext17,
|
|
866
868
|
useLayoutEffect as useLayoutEffect3,
|
|
867
869
|
useMemo as useMemo18,
|
|
868
870
|
useRef as useRef9,
|
|
@@ -871,9 +873,9 @@ import {
|
|
|
871
873
|
import React15, { forwardRef as forwardRef4, useMemo as useMemo17 } from "react";
|
|
872
874
|
import { useContext as useContext16, useMemo as useMemo16, useState as useState7 } from "react";
|
|
873
875
|
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
874
|
-
import { useContext as
|
|
876
|
+
import { useContext as useContext18, useLayoutEffect as useLayoutEffect5, useState as useState10 } from "react";
|
|
875
877
|
import {
|
|
876
|
-
createContext as
|
|
878
|
+
createContext as createContext16,
|
|
877
879
|
useCallback as useCallback8,
|
|
878
880
|
useImperativeHandle as useImperativeHandle3,
|
|
879
881
|
useLayoutEffect as useLayoutEffect4,
|
|
@@ -882,29 +884,29 @@ import {
|
|
|
882
884
|
useState as useState9
|
|
883
885
|
} from "react";
|
|
884
886
|
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
885
|
-
import { forwardRef as forwardRef8, useCallback as useCallback13, useContext as
|
|
886
|
-
import React17, { createContext as
|
|
887
|
+
import { forwardRef as forwardRef8, useCallback as useCallback13, useContext as useContext30 } from "react";
|
|
888
|
+
import React17, { createContext as createContext17, useMemo as useMemo20 } from "react";
|
|
887
889
|
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
888
|
-
import { useContext as
|
|
889
|
-
import { createContext as
|
|
890
|
+
import { useContext as useContext19 } from "react";
|
|
891
|
+
import { createContext as createContext18, useEffect as useEffect7, useState as useState11 } from "react";
|
|
890
892
|
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
891
|
-
import { createContext as
|
|
893
|
+
import { createContext as createContext19, useMemo as useMemo21, useReducer } from "react";
|
|
892
894
|
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
893
895
|
import React23, {
|
|
894
896
|
forwardRef as forwardRef6,
|
|
895
|
-
useContext as
|
|
897
|
+
useContext as useContext28,
|
|
896
898
|
useEffect as useEffect14,
|
|
897
899
|
useImperativeHandle as useImperativeHandle4,
|
|
898
900
|
useMemo as useMemo29,
|
|
899
901
|
useRef as useRef18,
|
|
900
902
|
useState as useState16
|
|
901
903
|
} from "react";
|
|
902
|
-
import { useContext as
|
|
904
|
+
import { useContext as useContext21, useLayoutEffect as useLayoutEffect6, useRef as useRef13 } from "react";
|
|
903
905
|
import React20, {
|
|
904
|
-
createContext as
|
|
906
|
+
createContext as createContext20,
|
|
905
907
|
createRef as createRef2,
|
|
906
908
|
useCallback as useCallback9,
|
|
907
|
-
useContext as
|
|
909
|
+
useContext as useContext20,
|
|
908
910
|
useMemo as useMemo23,
|
|
909
911
|
useRef as useRef11,
|
|
910
912
|
useState as useState12
|
|
@@ -912,20 +914,20 @@ import React20, {
|
|
|
912
914
|
import { useMemo as useMemo22 } from "react";
|
|
913
915
|
import { jsx as jsx20, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
914
916
|
import { useRef as useRef12 } from "react";
|
|
915
|
-
import { useContext as
|
|
916
|
-
import { useContext as
|
|
917
|
+
import { useContext as useContext23, useEffect as useEffect8, useMemo as useMemo24, useState as useState13 } from "react";
|
|
918
|
+
import { useContext as useContext22 } from "react";
|
|
917
919
|
import {
|
|
918
920
|
useCallback as useCallback12,
|
|
919
|
-
useContext as
|
|
921
|
+
useContext as useContext26,
|
|
920
922
|
useEffect as useEffect12,
|
|
921
923
|
useLayoutEffect as useLayoutEffect8,
|
|
922
924
|
useRef as useRef17
|
|
923
925
|
} from "react";
|
|
924
926
|
import { useCallback as useCallback11, useMemo as useMemo27, useRef as useRef15 } from "react";
|
|
925
|
-
import { useContext as
|
|
927
|
+
import { useContext as useContext25, useMemo as useMemo26 } from "react";
|
|
926
928
|
import React21, {
|
|
927
929
|
useCallback as useCallback10,
|
|
928
|
-
useContext as
|
|
930
|
+
useContext as useContext24,
|
|
929
931
|
useEffect as useEffect9,
|
|
930
932
|
useLayoutEffect as useLayoutEffect7,
|
|
931
933
|
useMemo as useMemo25,
|
|
@@ -937,11 +939,11 @@ import React22 from "react";
|
|
|
937
939
|
import { useEffect as useEffect10, useState as useState15 } from "react";
|
|
938
940
|
import { useEffect as useEffect11, useRef as useRef16 } from "react";
|
|
939
941
|
import { useEffect as useEffect13 } from "react";
|
|
940
|
-
import { createContext as
|
|
942
|
+
import { createContext as createContext21, useContext as useContext27, useMemo as useMemo28 } from "react";
|
|
941
943
|
import { jsx as jsx222 } from "react/jsx-runtime";
|
|
942
944
|
import {
|
|
943
945
|
forwardRef as forwardRef7,
|
|
944
|
-
useContext as
|
|
946
|
+
useContext as useContext29,
|
|
945
947
|
useEffect as useEffect15,
|
|
946
948
|
useImperativeHandle as useImperativeHandle5,
|
|
947
949
|
useLayoutEffect as useLayoutEffect9,
|
|
@@ -954,7 +956,7 @@ import { forwardRef as forwardRef9, useCallback as useCallback14, useState as us
|
|
|
954
956
|
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
955
957
|
import {
|
|
956
958
|
useCallback as useCallback15,
|
|
957
|
-
useContext as
|
|
959
|
+
useContext as useContext31,
|
|
958
960
|
useImperativeHandle as useImperativeHandle6,
|
|
959
961
|
useLayoutEffect as useLayoutEffect10,
|
|
960
962
|
useRef as useRef20,
|
|
@@ -973,16 +975,16 @@ import {
|
|
|
973
975
|
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
974
976
|
import React29 from "react";
|
|
975
977
|
import { useMemo as useMemo33 } from "react";
|
|
976
|
-
import { createContext as
|
|
978
|
+
import { createContext as createContext22, useContext as useContext32, useMemo as useMemo32 } from "react";
|
|
977
979
|
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
978
980
|
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
979
981
|
import React31 from "react";
|
|
980
|
-
import React32, { createContext as
|
|
981
|
-
import { useContext as
|
|
982
|
+
import React32, { createContext as createContext23 } from "react";
|
|
983
|
+
import { useContext as useContext33 } from "react";
|
|
982
984
|
import { useCallback as useCallback18 } from "react";
|
|
983
985
|
import {
|
|
984
986
|
useCallback as useCallback17,
|
|
985
|
-
useContext as
|
|
987
|
+
useContext as useContext34,
|
|
986
988
|
useEffect as useEffect16,
|
|
987
989
|
useLayoutEffect as useLayoutEffect11,
|
|
988
990
|
useMemo as useMemo34,
|
|
@@ -991,7 +993,7 @@ import {
|
|
|
991
993
|
import { jsx as jsx30 } from "react/jsx-runtime";
|
|
992
994
|
import React34, {
|
|
993
995
|
forwardRef as forwardRef10,
|
|
994
|
-
useContext as
|
|
996
|
+
useContext as useContext35,
|
|
995
997
|
useEffect as useEffect18,
|
|
996
998
|
useImperativeHandle as useImperativeHandle8,
|
|
997
999
|
useMemo as useMemo35,
|
|
@@ -1005,14 +1007,14 @@ import React36, { useMemo as useMemo36 } from "react";
|
|
|
1005
1007
|
import { jsx as jsx33 } from "react/jsx-runtime";
|
|
1006
1008
|
import { Children, forwardRef as forwardRef11, useMemo as useMemo37 } from "react";
|
|
1007
1009
|
import React37 from "react";
|
|
1008
|
-
import React38, { createContext as
|
|
1010
|
+
import React38, { createContext as createContext24 } from "react";
|
|
1009
1011
|
import { jsx as jsx34 } from "react/jsx-runtime";
|
|
1010
1012
|
import { jsx as jsx35 } from "react/jsx-runtime";
|
|
1011
1013
|
import React40 from "react";
|
|
1012
|
-
import { forwardRef as forwardRef13, useCallback as useCallback19, useContext as
|
|
1014
|
+
import { forwardRef as forwardRef13, useCallback as useCallback19, useContext as useContext37 } from "react";
|
|
1013
1015
|
import {
|
|
1014
1016
|
forwardRef as forwardRef12,
|
|
1015
|
-
useContext as
|
|
1017
|
+
useContext as useContext36,
|
|
1016
1018
|
useEffect as useEffect19,
|
|
1017
1019
|
useImperativeHandle as useImperativeHandle9,
|
|
1018
1020
|
useLayoutEffect as useLayoutEffect12,
|
|
@@ -2534,7 +2536,7 @@ var getComponentsToAddStacksTo = () => componentsToAddStacksTo;
|
|
|
2534
2536
|
var addSequenceStackTraces = (component) => {
|
|
2535
2537
|
componentsToAddStacksTo.push(component);
|
|
2536
2538
|
};
|
|
2537
|
-
var VERSION = "4.0.
|
|
2539
|
+
var VERSION = "4.0.457";
|
|
2538
2540
|
var checkMultipleRemotionVersions = () => {
|
|
2539
2541
|
if (typeof globalThis === "undefined") {
|
|
2540
2542
|
return;
|
|
@@ -2834,12 +2836,13 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
2834
2836
|
height,
|
|
2835
2837
|
width,
|
|
2836
2838
|
showInTimeline = true,
|
|
2837
|
-
controls,
|
|
2839
|
+
_experimentalControls: controls,
|
|
2838
2840
|
_experimentalEffects,
|
|
2839
2841
|
_remotionInternalLoopDisplay: loopDisplay,
|
|
2840
2842
|
_remotionInternalStack: stack,
|
|
2841
2843
|
_remotionInternalPremountDisplay: premountDisplay,
|
|
2842
2844
|
_remotionInternalPostmountDisplay: postmountDisplay,
|
|
2845
|
+
_remotionInternalIsMedia: isMedia,
|
|
2843
2846
|
...other
|
|
2844
2847
|
}, ref) => {
|
|
2845
2848
|
const { layout = "absolute-fill" } = other;
|
|
@@ -2915,6 +2918,33 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
2915
2918
|
if (!env.isStudio) {
|
|
2916
2919
|
return;
|
|
2917
2920
|
}
|
|
2921
|
+
if (isMedia) {
|
|
2922
|
+
registerSequence({
|
|
2923
|
+
type: isMedia.type,
|
|
2924
|
+
controls: controls ?? null,
|
|
2925
|
+
effects: memoizedEffects,
|
|
2926
|
+
displayName: timelineClipName,
|
|
2927
|
+
doesVolumeChange: isMedia.data.doesVolumeChange,
|
|
2928
|
+
duration: actualDurationInFrames,
|
|
2929
|
+
from,
|
|
2930
|
+
id,
|
|
2931
|
+
loopDisplay,
|
|
2932
|
+
nonce: nonce.get(),
|
|
2933
|
+
parent: parentSequence?.id ?? null,
|
|
2934
|
+
playbackRate: isMedia.data.playbackRate,
|
|
2935
|
+
postmountDisplay: postmountDisplay ?? null,
|
|
2936
|
+
premountDisplay: premountDisplay ?? null,
|
|
2937
|
+
rootId,
|
|
2938
|
+
showInTimeline,
|
|
2939
|
+
src: isMedia.data.src,
|
|
2940
|
+
stack: stack ?? inheritedStack,
|
|
2941
|
+
startMediaFrom: isMedia.data.startMediaFrom,
|
|
2942
|
+
volume: isMedia.data.volumes
|
|
2943
|
+
});
|
|
2944
|
+
return () => {
|
|
2945
|
+
unregisterSequence(id);
|
|
2946
|
+
};
|
|
2947
|
+
}
|
|
2918
2948
|
registerSequence({
|
|
2919
2949
|
from,
|
|
2920
2950
|
duration: actualDurationInFrames,
|
|
@@ -2955,7 +2985,8 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
2955
2985
|
env.isStudio,
|
|
2956
2986
|
inheritedStack,
|
|
2957
2987
|
controls,
|
|
2958
|
-
memoizedEffects
|
|
2988
|
+
memoizedEffects,
|
|
2989
|
+
isMedia
|
|
2959
2990
|
]);
|
|
2960
2991
|
const endThreshold = Math.ceil(cumulatedFrom + from + durationInFrames - 1);
|
|
2961
2992
|
const content = absoluteFrame < cumulatedFrom + from ? null : absoluteFrame > endThreshold ? null : children;
|
|
@@ -3537,7 +3568,7 @@ var wrapInSchema = (Component, schema) => {
|
|
|
3537
3568
|
if (!env.isStudio || env.isReadOnlyStudio || env.isRendering || !process.env.EXPERIMENTAL_VISUAL_MODE_ENABLED) {
|
|
3538
3569
|
return React15.createElement(Component, {
|
|
3539
3570
|
...props,
|
|
3540
|
-
|
|
3571
|
+
_experimentalControls: null,
|
|
3541
3572
|
ref
|
|
3542
3573
|
});
|
|
3543
3574
|
}
|
|
@@ -3552,7 +3583,7 @@ var wrapInSchema = (Component, schema) => {
|
|
|
3552
3583
|
const mergedProps = mergeValues(props, values, schemaKeys);
|
|
3553
3584
|
return React15.createElement(Component, {
|
|
3554
3585
|
...mergedProps,
|
|
3555
|
-
controls,
|
|
3586
|
+
_experimentalControls: controls,
|
|
3556
3587
|
ref
|
|
3557
3588
|
});
|
|
3558
3589
|
});
|
|
@@ -3596,6 +3627,7 @@ var defaultOnPaint = ({
|
|
|
3596
3627
|
const transform = ctx.drawElementImage(elementImage, 0, 0);
|
|
3597
3628
|
element.style.transform = transform.toString();
|
|
3598
3629
|
};
|
|
3630
|
+
var HtmlInCanvasAncestorContext = createContext15(false);
|
|
3599
3631
|
var htmlInCanvasSchema = {
|
|
3600
3632
|
"style.translate": {
|
|
3601
3633
|
type: "translate",
|
|
@@ -3633,11 +3665,12 @@ var HtmlInCanvasInner = forwardRef5(({
|
|
|
3633
3665
|
children,
|
|
3634
3666
|
onPaint,
|
|
3635
3667
|
onInit,
|
|
3636
|
-
controls,
|
|
3668
|
+
_experimentalControls: controls,
|
|
3637
3669
|
style,
|
|
3638
3670
|
durationInFrames,
|
|
3639
3671
|
...sequenceProps
|
|
3640
3672
|
}, ref) => {
|
|
3673
|
+
const isInsideAncestorHtmlInCanvas = useContext17(HtmlInCanvasAncestorContext);
|
|
3641
3674
|
assertHtmlInCanvasDimensions(width, height);
|
|
3642
3675
|
const { continueRender: continueRender2, cancelRender: cancelRender2 } = useDelayRender();
|
|
3643
3676
|
if (!isHtmlInCanvasSupported()) {
|
|
@@ -3780,20 +3813,26 @@ var HtmlInCanvasInner = forwardRef5(({
|
|
|
3780
3813
|
...style
|
|
3781
3814
|
};
|
|
3782
3815
|
}, [width, height, style]);
|
|
3816
|
+
if (isInsideAncestorHtmlInCanvas) {
|
|
3817
|
+
throw new Error("<HtmlInCanvas> effects cannot be nested together. Chrome will only display the outer effect. Consider merging the effects into one if you can.");
|
|
3818
|
+
}
|
|
3783
3819
|
return /* @__PURE__ */ jsx15(Sequence, {
|
|
3784
3820
|
durationInFrames: resolvedDuration,
|
|
3785
3821
|
name: "<HtmlInCanvas>",
|
|
3786
|
-
controls,
|
|
3822
|
+
_experimentalControls: controls,
|
|
3787
3823
|
layout: "none",
|
|
3788
3824
|
...sequenceProps,
|
|
3789
|
-
children: /* @__PURE__ */ jsx15(
|
|
3790
|
-
|
|
3791
|
-
|
|
3792
|
-
|
|
3793
|
-
|
|
3794
|
-
|
|
3795
|
-
|
|
3796
|
-
|
|
3825
|
+
children: /* @__PURE__ */ jsx15(HtmlInCanvasAncestorContext.Provider, {
|
|
3826
|
+
value: true,
|
|
3827
|
+
children: /* @__PURE__ */ jsx15("canvas", {
|
|
3828
|
+
ref: setLayoutCanvasRef,
|
|
3829
|
+
width,
|
|
3830
|
+
height,
|
|
3831
|
+
children: /* @__PURE__ */ jsx15("div", {
|
|
3832
|
+
ref: divRef,
|
|
3833
|
+
style: innerStyle,
|
|
3834
|
+
children
|
|
3835
|
+
})
|
|
3797
3836
|
})
|
|
3798
3837
|
})
|
|
3799
3838
|
});
|
|
@@ -3801,7 +3840,7 @@ var HtmlInCanvasInner = forwardRef5(({
|
|
|
3801
3840
|
HtmlInCanvasInner.displayName = "HtmlInCanvas";
|
|
3802
3841
|
var HtmlInCanvasWrapped = wrapInSchema(HtmlInCanvasInner, htmlInCanvasSchema);
|
|
3803
3842
|
var HtmlInCanvas = Object.assign(HtmlInCanvasWrapped, {
|
|
3804
|
-
isHtmlInCanvasSupported
|
|
3843
|
+
isSupported: isHtmlInCanvasSupported
|
|
3805
3844
|
});
|
|
3806
3845
|
HtmlInCanvas.displayName = "HtmlInCanvas";
|
|
3807
3846
|
addSequenceStackTraces(HtmlInCanvas);
|
|
@@ -3834,7 +3873,7 @@ var validateRenderAsset = (artifact) => {
|
|
|
3834
3873
|
}
|
|
3835
3874
|
validateContent(artifact.content);
|
|
3836
3875
|
};
|
|
3837
|
-
var RenderAssetManager =
|
|
3876
|
+
var RenderAssetManager = createContext16({
|
|
3838
3877
|
registerRenderAsset: () => {
|
|
3839
3878
|
return;
|
|
3840
3879
|
},
|
|
@@ -3891,7 +3930,7 @@ var RenderAssetManagerProvider = ({ children, collectAssets }) => {
|
|
|
3891
3930
|
};
|
|
3892
3931
|
var ArtifactThumbnail = Symbol("Thumbnail");
|
|
3893
3932
|
var Artifact = ({ filename, content, downloadBehavior }) => {
|
|
3894
|
-
const { registerRenderAsset, unregisterRenderAsset } =
|
|
3933
|
+
const { registerRenderAsset, unregisterRenderAsset } = useContext18(RenderAssetManager);
|
|
3895
3934
|
const env = useRemotionEnvironment();
|
|
3896
3935
|
const frame = useCurrentFrame();
|
|
3897
3936
|
const [id] = useState10(() => {
|
|
@@ -3972,11 +4011,18 @@ var calculateMediaDuration = ({
|
|
|
3972
4011
|
const actualDuration = duration / playbackRate;
|
|
3973
4012
|
return Math.floor(actualDuration);
|
|
3974
4013
|
};
|
|
3975
|
-
var LoopContext =
|
|
4014
|
+
var LoopContext = createContext17(null);
|
|
3976
4015
|
var useLoop = () => {
|
|
3977
4016
|
return React17.useContext(LoopContext);
|
|
3978
4017
|
};
|
|
3979
|
-
var Loop = ({
|
|
4018
|
+
var Loop = ({
|
|
4019
|
+
durationInFrames,
|
|
4020
|
+
times = Infinity,
|
|
4021
|
+
children,
|
|
4022
|
+
name,
|
|
4023
|
+
showInTimeline,
|
|
4024
|
+
...props
|
|
4025
|
+
}) => {
|
|
3980
4026
|
const currentFrame = useCurrentFrame();
|
|
3981
4027
|
const { durationInFrames: compDuration } = useVideoConfig();
|
|
3982
4028
|
validateDurationInFrames(durationInFrames, {
|
|
@@ -4021,6 +4067,7 @@ var Loop = ({ durationInFrames, times = Infinity, children, name, ...props }) =>
|
|
|
4021
4067
|
_remotionInternalLoopDisplay: loopDisplay,
|
|
4022
4068
|
layout: props.layout,
|
|
4023
4069
|
style,
|
|
4070
|
+
showInTimeline,
|
|
4024
4071
|
children
|
|
4025
4072
|
})
|
|
4026
4073
|
});
|
|
@@ -4035,7 +4082,7 @@ var playbackLogging = ({
|
|
|
4035
4082
|
const tags = [mountTime ? Date.now() - mountTime + "ms " : null, tag].filter(Boolean).join(" ");
|
|
4036
4083
|
Log.trace({ logLevel, tag: null }, `[${tags}]`, message);
|
|
4037
4084
|
};
|
|
4038
|
-
var PreloadContext =
|
|
4085
|
+
var PreloadContext = createContext18({});
|
|
4039
4086
|
var preloads = {};
|
|
4040
4087
|
var updaters = [];
|
|
4041
4088
|
var setPreloads = (updater) => {
|
|
@@ -4073,7 +4120,7 @@ var getSrcWithoutHash = (src) => {
|
|
|
4073
4120
|
return src.slice(0, hashIndex);
|
|
4074
4121
|
};
|
|
4075
4122
|
var usePreload = (src) => {
|
|
4076
|
-
const preloads2 =
|
|
4123
|
+
const preloads2 = useContext19(PreloadContext);
|
|
4077
4124
|
const hashFragmentIndex = removeAndGetHashFragment(src);
|
|
4078
4125
|
const withoutHashFragment = getSrcWithoutHash(src);
|
|
4079
4126
|
if (!preloads2[withoutHashFragment]) {
|
|
@@ -4356,7 +4403,7 @@ var durationReducer = (state, action) => {
|
|
|
4356
4403
|
return state;
|
|
4357
4404
|
}
|
|
4358
4405
|
};
|
|
4359
|
-
var DurationsContext =
|
|
4406
|
+
var DurationsContext = createContext19({
|
|
4360
4407
|
durations: {},
|
|
4361
4408
|
setDurations: () => {
|
|
4362
4409
|
throw new Error("context missing");
|
|
@@ -4567,8 +4614,8 @@ var didPropChange = (key, newProp, prevProp) => {
|
|
|
4567
4614
|
}
|
|
4568
4615
|
return true;
|
|
4569
4616
|
};
|
|
4570
|
-
var SharedAudioContext =
|
|
4571
|
-
var SharedAudioTagsContext =
|
|
4617
|
+
var SharedAudioContext = createContext20(null);
|
|
4618
|
+
var SharedAudioTagsContext = createContext20(null);
|
|
4572
4619
|
var SharedAudioContextProvider = ({ children, audioLatencyHint, audioEnabled }) => {
|
|
4573
4620
|
const logLevel = useLogLevel();
|
|
4574
4621
|
const ctxAndGain = useSingletonAudioContext({
|
|
@@ -4652,16 +4699,23 @@ var SharedAudioContextProvider = ({ children, audioLatencyHint, audioEnabled })
|
|
|
4652
4699
|
return Promise.resolve();
|
|
4653
4700
|
}
|
|
4654
4701
|
audioContextIsPlayingEventually.current = true;
|
|
4655
|
-
|
|
4702
|
+
const resumePromise = ctxAndGain.audioContext.resume();
|
|
4703
|
+
isResuming.current = new Promise((resolve) => {
|
|
4704
|
+
waitUntilActuallyResumed(ctxAndGain.audioContext, logLevel).then(resolve);
|
|
4705
|
+
resumePromise.catch((err) => {
|
|
4706
|
+
Log.warn({ logLevel, tag: "audio" }, "AudioContext resume rejected, continuing without audio sync", err);
|
|
4707
|
+
resolve();
|
|
4708
|
+
});
|
|
4709
|
+
}).finally(() => {
|
|
4656
4710
|
isResuming.current = null;
|
|
4657
4711
|
});
|
|
4658
4712
|
ctxAndGain.gainNode.gain.cancelScheduledValues(ctxAndGain.audioContext.currentTime);
|
|
4659
4713
|
ctxAndGain.gainNode?.gain.setValueAtTime(0, ctxAndGain.audioContext.currentTime);
|
|
4660
4714
|
ctxAndGain.gainNode?.gain.linearRampToValueAtTime(1, ctxAndGain.audioContext.currentTime + 0.03);
|
|
4661
|
-
return
|
|
4715
|
+
return resumePromise.then(() => {
|
|
4662
4716
|
nodesToResume.current.forEach((r, node) => node.start(r.scheduledTime, r.offset, r.duration));
|
|
4663
4717
|
nodesToResume.current.clear();
|
|
4664
|
-
});
|
|
4718
|
+
}).catch(() => {});
|
|
4665
4719
|
}, [ctxAndGain, logLevel]);
|
|
4666
4720
|
const getIsResumingAudioContext = useCallback9(() => {
|
|
4667
4721
|
return isResuming.current;
|
|
@@ -4712,7 +4766,7 @@ var SharedAudioTagsContextProvider = ({ children, numberOfAudioTags }) => {
|
|
|
4712
4766
|
const logLevel = useLogLevel();
|
|
4713
4767
|
const mountTime = useMountTime();
|
|
4714
4768
|
const env = useRemotionEnvironment();
|
|
4715
|
-
const audioCtx =
|
|
4769
|
+
const audioCtx = useContext20(SharedAudioContext);
|
|
4716
4770
|
const audioContext = audioCtx?.audioContext ?? null;
|
|
4717
4771
|
const resume = audioCtx?.resume;
|
|
4718
4772
|
const refs = useMemo23(() => {
|
|
@@ -4887,8 +4941,8 @@ var useSharedAudio = ({
|
|
|
4887
4941
|
premounting,
|
|
4888
4942
|
postmounting
|
|
4889
4943
|
}) => {
|
|
4890
|
-
const audioCtx =
|
|
4891
|
-
const tagsCtx =
|
|
4944
|
+
const audioCtx = useContext20(SharedAudioContext);
|
|
4945
|
+
const tagsCtx = useContext20(SharedAudioTagsContext);
|
|
4892
4946
|
const [elem] = useState12(() => {
|
|
4893
4947
|
if (tagsCtx && tagsCtx.numberOfAudioTags > 0) {
|
|
4894
4948
|
return tagsCtx.registerAudio({ aud, audioId, premounting, postmounting });
|
|
@@ -5067,7 +5121,7 @@ var useVolume = ({
|
|
|
5067
5121
|
const audioStuffRef = useRef13(null);
|
|
5068
5122
|
const currentVolumeRef = useRef13(volume);
|
|
5069
5123
|
currentVolumeRef.current = volume;
|
|
5070
|
-
const sharedAudioContext =
|
|
5124
|
+
const sharedAudioContext = useContext21(SharedAudioContext);
|
|
5071
5125
|
if (!sharedAudioContext) {
|
|
5072
5126
|
throw new Error("useAmplification must be used within a SharedAudioContext");
|
|
5073
5127
|
}
|
|
@@ -5132,7 +5186,7 @@ var useVolume = ({
|
|
|
5132
5186
|
return audioStuffRef;
|
|
5133
5187
|
};
|
|
5134
5188
|
var useMediaStartsAt = () => {
|
|
5135
|
-
const parentSequence =
|
|
5189
|
+
const parentSequence = useContext22(SequenceContext);
|
|
5136
5190
|
const startsAt = Math.min(0, parentSequence?.relativeFrom ?? 0);
|
|
5137
5191
|
return startsAt;
|
|
5138
5192
|
};
|
|
@@ -5157,8 +5211,12 @@ var getTimelineDuration = ({
|
|
|
5157
5211
|
playbackRate,
|
|
5158
5212
|
trimBefore,
|
|
5159
5213
|
trimAfter,
|
|
5160
|
-
parentSequenceDurationInFrames
|
|
5214
|
+
parentSequenceDurationInFrames,
|
|
5215
|
+
loop
|
|
5161
5216
|
}) => {
|
|
5217
|
+
if (loop) {
|
|
5218
|
+
return compositionDurationInFrames;
|
|
5219
|
+
}
|
|
5162
5220
|
const mediaDuration = calculateMediaDuration({
|
|
5163
5221
|
mediaDurationInFrames: compositionDurationInFrames * playbackRate + (trimBefore ?? 0),
|
|
5164
5222
|
playbackRate,
|
|
@@ -5209,34 +5267,36 @@ var useBasicMediaInTimeline = ({
|
|
|
5209
5267
|
displayName,
|
|
5210
5268
|
trimBefore,
|
|
5211
5269
|
trimAfter,
|
|
5212
|
-
playbackRate
|
|
5270
|
+
playbackRate,
|
|
5271
|
+
sequenceDurationInFrames,
|
|
5272
|
+
mediaStartsAt,
|
|
5273
|
+
loop
|
|
5213
5274
|
}) => {
|
|
5214
5275
|
if (!src) {
|
|
5215
5276
|
throw new Error("No src passed");
|
|
5216
5277
|
}
|
|
5217
|
-
const
|
|
5218
|
-
const parentSequence = useContext22(SequenceContext);
|
|
5219
|
-
const videoConfig = useVideoConfig();
|
|
5278
|
+
const parentSequence = useContext23(SequenceContext);
|
|
5220
5279
|
const [initialVolume] = useState13(() => volume);
|
|
5221
5280
|
const duration = getTimelineDuration({
|
|
5222
|
-
compositionDurationInFrames:
|
|
5281
|
+
compositionDurationInFrames: sequenceDurationInFrames,
|
|
5223
5282
|
playbackRate,
|
|
5224
5283
|
trimBefore,
|
|
5225
5284
|
trimAfter,
|
|
5226
|
-
parentSequenceDurationInFrames: parentSequence?.durationInFrames ?? null
|
|
5285
|
+
parentSequenceDurationInFrames: parentSequence?.durationInFrames ?? null,
|
|
5286
|
+
loop
|
|
5227
5287
|
});
|
|
5228
5288
|
const volumes = useMemo24(() => {
|
|
5229
5289
|
if (typeof volume === "number") {
|
|
5230
5290
|
return volume;
|
|
5231
5291
|
}
|
|
5232
|
-
return new Array(Math.floor(Math.max(0, duration +
|
|
5292
|
+
return new Array(Math.floor(Math.max(0, duration + mediaStartsAt))).fill(true).map((_, i) => {
|
|
5233
5293
|
return evaluateVolume({
|
|
5234
|
-
frame: i +
|
|
5294
|
+
frame: i + mediaStartsAt,
|
|
5235
5295
|
volume,
|
|
5236
5296
|
mediaVolume
|
|
5237
5297
|
});
|
|
5238
5298
|
}).join(",");
|
|
5239
|
-
}, [duration,
|
|
5299
|
+
}, [duration, mediaStartsAt, volume, mediaVolume]);
|
|
5240
5300
|
useEffect8(() => {
|
|
5241
5301
|
if (typeof volume === "number" && volume !== initialVolume) {
|
|
5242
5302
|
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 +5305,31 @@ var useBasicMediaInTimeline = ({
|
|
|
5245
5305
|
const doesVolumeChange = typeof volume === "function";
|
|
5246
5306
|
const nonce = useNonce();
|
|
5247
5307
|
const { rootId } = useTimelineContext();
|
|
5248
|
-
const
|
|
5249
|
-
|
|
5308
|
+
const startMediaFrom = 0 - mediaStartsAt + (trimBefore ?? 0);
|
|
5309
|
+
const memoizedResult = useMemo24(() => {
|
|
5310
|
+
return {
|
|
5311
|
+
volumes,
|
|
5312
|
+
duration,
|
|
5313
|
+
doesVolumeChange,
|
|
5314
|
+
nonce,
|
|
5315
|
+
rootId,
|
|
5316
|
+
finalDisplayName: displayName ?? getAssetDisplayName(src),
|
|
5317
|
+
startMediaFrom,
|
|
5318
|
+
src,
|
|
5319
|
+
playbackRate
|
|
5320
|
+
};
|
|
5321
|
+
}, [
|
|
5250
5322
|
volumes,
|
|
5251
5323
|
duration,
|
|
5252
5324
|
doesVolumeChange,
|
|
5253
5325
|
nonce,
|
|
5254
5326
|
rootId,
|
|
5255
|
-
|
|
5256
|
-
|
|
5257
|
-
|
|
5327
|
+
displayName,
|
|
5328
|
+
src,
|
|
5329
|
+
startMediaFrom,
|
|
5330
|
+
playbackRate
|
|
5331
|
+
]);
|
|
5332
|
+
return memoizedResult;
|
|
5258
5333
|
};
|
|
5259
5334
|
var useImageInTimeline = ({
|
|
5260
5335
|
src,
|
|
@@ -5267,9 +5342,11 @@ var useImageInTimeline = ({
|
|
|
5267
5342
|
loopDisplay,
|
|
5268
5343
|
controls
|
|
5269
5344
|
}) => {
|
|
5270
|
-
const parentSequence =
|
|
5271
|
-
const { registerSequence, unregisterSequence } =
|
|
5272
|
-
const {
|
|
5345
|
+
const parentSequence = useContext23(SequenceContext);
|
|
5346
|
+
const { registerSequence, unregisterSequence } = useContext23(SequenceManager);
|
|
5347
|
+
const { durationInFrames } = useVideoConfig();
|
|
5348
|
+
const mediaStartsAt = useMediaStartsAt();
|
|
5349
|
+
const { duration, nonce, rootId, finalDisplayName } = useBasicMediaInTimeline({
|
|
5273
5350
|
volume: undefined,
|
|
5274
5351
|
mediaVolume: 0,
|
|
5275
5352
|
mediaType: "image",
|
|
@@ -5277,8 +5354,12 @@ var useImageInTimeline = ({
|
|
|
5277
5354
|
displayName,
|
|
5278
5355
|
trimAfter: undefined,
|
|
5279
5356
|
trimBefore: undefined,
|
|
5280
|
-
playbackRate: 1
|
|
5357
|
+
playbackRate: 1,
|
|
5358
|
+
sequenceDurationInFrames: durationInFrames,
|
|
5359
|
+
mediaStartsAt,
|
|
5360
|
+
loop: false
|
|
5281
5361
|
});
|
|
5362
|
+
const { isStudio } = useRemotionEnvironment();
|
|
5282
5363
|
useEffect8(() => {
|
|
5283
5364
|
if (!src) {
|
|
5284
5365
|
throw new Error("No src passed");
|
|
@@ -5343,18 +5424,12 @@ var useMediaInTimeline = ({
|
|
|
5343
5424
|
postmountDisplay,
|
|
5344
5425
|
loopDisplay
|
|
5345
5426
|
}) => {
|
|
5346
|
-
const parentSequence =
|
|
5427
|
+
const parentSequence = useContext23(SequenceContext);
|
|
5347
5428
|
const startsAt = useMediaStartsAt();
|
|
5348
|
-
const { registerSequence, unregisterSequence } =
|
|
5349
|
-
const {
|
|
5350
|
-
|
|
5351
|
-
|
|
5352
|
-
doesVolumeChange,
|
|
5353
|
-
nonce,
|
|
5354
|
-
rootId,
|
|
5355
|
-
isStudio,
|
|
5356
|
-
finalDisplayName
|
|
5357
|
-
} = useBasicMediaInTimeline({
|
|
5429
|
+
const { registerSequence, unregisterSequence } = useContext23(SequenceManager);
|
|
5430
|
+
const { durationInFrames } = useVideoConfig();
|
|
5431
|
+
const mediaStartsAt = useMediaStartsAt();
|
|
5432
|
+
const { volumes, duration, doesVolumeChange, nonce, rootId, finalDisplayName } = useBasicMediaInTimeline({
|
|
5358
5433
|
volume,
|
|
5359
5434
|
mediaVolume,
|
|
5360
5435
|
mediaType,
|
|
@@ -5362,8 +5437,12 @@ var useMediaInTimeline = ({
|
|
|
5362
5437
|
displayName,
|
|
5363
5438
|
trimAfter: undefined,
|
|
5364
5439
|
trimBefore: undefined,
|
|
5365
|
-
playbackRate
|
|
5440
|
+
playbackRate,
|
|
5441
|
+
sequenceDurationInFrames: durationInFrames,
|
|
5442
|
+
mediaStartsAt,
|
|
5443
|
+
loop: false
|
|
5366
5444
|
});
|
|
5445
|
+
const { isStudio } = useRemotionEnvironment();
|
|
5367
5446
|
useEffect8(() => {
|
|
5368
5447
|
if (!src) {
|
|
5369
5448
|
throw new Error("No src passed");
|
|
@@ -5416,10 +5495,10 @@ var useMediaInTimeline = ({
|
|
|
5416
5495
|
showInTimeline,
|
|
5417
5496
|
premountDisplay,
|
|
5418
5497
|
postmountDisplay,
|
|
5419
|
-
isStudio,
|
|
5420
5498
|
loopDisplay,
|
|
5421
5499
|
rootId,
|
|
5422
|
-
finalDisplayName
|
|
5500
|
+
finalDisplayName,
|
|
5501
|
+
isStudio
|
|
5423
5502
|
]);
|
|
5424
5503
|
};
|
|
5425
5504
|
var useBufferManager = (logLevel, mountTime) => {
|
|
@@ -5502,7 +5581,7 @@ var useBufferManager = (logLevel, mountTime) => {
|
|
|
5502
5581
|
};
|
|
5503
5582
|
var BufferingContextReact = React21.createContext(null);
|
|
5504
5583
|
var BufferingProvider = ({ children }) => {
|
|
5505
|
-
const { logLevel, mountTime } =
|
|
5584
|
+
const { logLevel, mountTime } = useContext24(LogLevelContext);
|
|
5506
5585
|
const bufferManager = useBufferManager(logLevel ?? "info", mountTime);
|
|
5507
5586
|
return /* @__PURE__ */ jsx21(BufferingContextReact.Provider, {
|
|
5508
5587
|
value: bufferManager,
|
|
@@ -5532,7 +5611,7 @@ var useIsPlayerBuffering = (bufferManager) => {
|
|
|
5532
5611
|
return isBuffering;
|
|
5533
5612
|
};
|
|
5534
5613
|
var useBufferState = () => {
|
|
5535
|
-
const buffer =
|
|
5614
|
+
const buffer = useContext25(BufferingContextReact);
|
|
5536
5615
|
const addBlock = buffer ? buffer.addBlock : null;
|
|
5537
5616
|
return useMemo26(() => ({
|
|
5538
5617
|
delayPlayback: () => {
|
|
@@ -6037,7 +6116,7 @@ var useMediaPlayback = ({
|
|
|
6037
6116
|
const frame = useCurrentFrame();
|
|
6038
6117
|
const absoluteFrame = useTimelinePosition();
|
|
6039
6118
|
const [playing] = usePlayingState();
|
|
6040
|
-
const buffering =
|
|
6119
|
+
const buffering = useContext26(BufferingContextReact);
|
|
6041
6120
|
const { fps } = useVideoConfig();
|
|
6042
6121
|
const mediaStartsAt = useMediaStartsAt();
|
|
6043
6122
|
const lastSeekDueToShift = useRef17(null);
|
|
@@ -6312,11 +6391,11 @@ var useMediaTag = ({
|
|
|
6312
6391
|
env.isPlayer
|
|
6313
6392
|
]);
|
|
6314
6393
|
};
|
|
6315
|
-
var MediaVolumeContext =
|
|
6394
|
+
var MediaVolumeContext = createContext21({
|
|
6316
6395
|
mediaMuted: false,
|
|
6317
6396
|
mediaVolume: 1
|
|
6318
6397
|
});
|
|
6319
|
-
var SetMediaVolumeContext =
|
|
6398
|
+
var SetMediaVolumeContext = createContext21({
|
|
6320
6399
|
setMediaMuted: () => {
|
|
6321
6400
|
throw new Error("default");
|
|
6322
6401
|
},
|
|
@@ -6325,15 +6404,15 @@ var SetMediaVolumeContext = createContext20({
|
|
|
6325
6404
|
}
|
|
6326
6405
|
});
|
|
6327
6406
|
var useMediaVolumeState = () => {
|
|
6328
|
-
const { mediaVolume } =
|
|
6329
|
-
const { setMediaVolume } =
|
|
6407
|
+
const { mediaVolume } = useContext27(MediaVolumeContext);
|
|
6408
|
+
const { setMediaVolume } = useContext27(SetMediaVolumeContext);
|
|
6330
6409
|
return useMemo28(() => {
|
|
6331
6410
|
return [mediaVolume, setMediaVolume];
|
|
6332
6411
|
}, [mediaVolume, setMediaVolume]);
|
|
6333
6412
|
};
|
|
6334
6413
|
var useMediaMutedState = () => {
|
|
6335
|
-
const { mediaMuted } =
|
|
6336
|
-
const { setMediaMuted } =
|
|
6414
|
+
const { mediaMuted } = useContext27(MediaVolumeContext);
|
|
6415
|
+
const { setMediaMuted } = useContext27(SetMediaVolumeContext);
|
|
6337
6416
|
return useMemo28(() => {
|
|
6338
6417
|
return [mediaMuted, setMediaMuted];
|
|
6339
6418
|
}, [mediaMuted, setMediaMuted]);
|
|
@@ -6383,12 +6462,12 @@ var AudioForDevelopmentForwardRefFunction = (props, ref) => {
|
|
|
6383
6462
|
const [mediaVolume] = useMediaVolumeState();
|
|
6384
6463
|
const [mediaMuted] = useMediaMutedState();
|
|
6385
6464
|
const volumePropFrame = useFrameForVolumeProp(loopVolumeCurveBehavior ?? "repeat");
|
|
6386
|
-
const { hidden } =
|
|
6465
|
+
const { hidden } = useContext28(SequenceVisibilityToggleContext);
|
|
6387
6466
|
if (!src) {
|
|
6388
6467
|
throw new TypeError("No 'src' was passed to <Html5Audio>.");
|
|
6389
6468
|
}
|
|
6390
6469
|
const preloadedSrc = usePreload(src);
|
|
6391
|
-
const sequenceContext =
|
|
6470
|
+
const sequenceContext = useContext28(SequenceContext);
|
|
6392
6471
|
const [timelineId] = useState16(() => String(Math.random()));
|
|
6393
6472
|
const isSequenceHidden = hidden[timelineId] ?? false;
|
|
6394
6473
|
const userPreferredVolume = evaluateVolume({
|
|
@@ -6543,8 +6622,8 @@ var AudioForRenderingRefForwardingFunction = (props, ref) => {
|
|
|
6543
6622
|
const absoluteFrame = useTimelinePosition();
|
|
6544
6623
|
const volumePropFrame = useFrameForVolumeProp(loopVolumeCurveBehavior ?? "repeat");
|
|
6545
6624
|
const frame = useCurrentFrame();
|
|
6546
|
-
const sequenceContext =
|
|
6547
|
-
const { registerRenderAsset, unregisterRenderAsset } =
|
|
6625
|
+
const sequenceContext = useContext29(SequenceContext);
|
|
6626
|
+
const { registerRenderAsset, unregisterRenderAsset } = useContext29(RenderAssetManager);
|
|
6548
6627
|
const { delayRender: delayRender2, continueRender: continueRender2 } = useDelayRender();
|
|
6549
6628
|
const id = useMemo30(() => `audio-${random(props.src ?? "")}-${sequenceContext?.relativeFrom}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.durationInFrames}`, [
|
|
6550
6629
|
props.src,
|
|
@@ -6653,7 +6732,7 @@ var AudioForRenderingRefForwardingFunction = (props, ref) => {
|
|
|
6653
6732
|
};
|
|
6654
6733
|
var AudioForRendering = forwardRef7(AudioForRenderingRefForwardingFunction);
|
|
6655
6734
|
var AudioRefForwardingFunction = (props, ref) => {
|
|
6656
|
-
const audioTagsContext =
|
|
6735
|
+
const audioTagsContext = useContext30(SharedAudioTagsContext);
|
|
6657
6736
|
const {
|
|
6658
6737
|
startFrom,
|
|
6659
6738
|
endAt,
|
|
@@ -6672,7 +6751,7 @@ var AudioRefForwardingFunction = (props, ref) => {
|
|
|
6672
6751
|
if (environment.isClientSideRendering) {
|
|
6673
6752
|
throw new Error("<Html5Audio> is not supported in @remotion/web-renderer. Use <Audio> from @remotion/media instead. See https://remotion.dev/docs/client-side-rendering/limitations");
|
|
6674
6753
|
}
|
|
6675
|
-
const { durations, setDurations } =
|
|
6754
|
+
const { durations, setDurations } = useContext30(DurationsContext);
|
|
6676
6755
|
if (typeof props.src !== "string") {
|
|
6677
6756
|
throw new TypeError(`The \`<Html5Audio>\` tag requires a string for \`src\`, but got ${JSON.stringify(props.src)} instead.`);
|
|
6678
6757
|
}
|
|
@@ -6854,13 +6933,13 @@ var ImgInner = ({
|
|
|
6854
6933
|
name,
|
|
6855
6934
|
stack,
|
|
6856
6935
|
ref,
|
|
6857
|
-
controls,
|
|
6936
|
+
_experimentalControls: controls,
|
|
6858
6937
|
...props2
|
|
6859
6938
|
}) => {
|
|
6860
6939
|
const imageRef = useRef20(null);
|
|
6861
6940
|
const errors = useRef20({});
|
|
6862
6941
|
const { delayPlayback } = useBufferState();
|
|
6863
|
-
const sequenceContext =
|
|
6942
|
+
const sequenceContext = useContext31(SequenceContext);
|
|
6864
6943
|
const [timelineId] = useState18(() => String(Math.random()));
|
|
6865
6944
|
if (!src) {
|
|
6866
6945
|
throw new Error('No "src" prop was passed to <Img>.');
|
|
@@ -7180,9 +7259,9 @@ var waitForRoot = (fn) => {
|
|
|
7180
7259
|
listeners = listeners.filter((l) => l !== fn);
|
|
7181
7260
|
};
|
|
7182
7261
|
};
|
|
7183
|
-
var MediaEnabledContext =
|
|
7262
|
+
var MediaEnabledContext = createContext22(null);
|
|
7184
7263
|
var useVideoEnabled = () => {
|
|
7185
|
-
const context =
|
|
7264
|
+
const context = useContext32(MediaEnabledContext);
|
|
7186
7265
|
if (!context) {
|
|
7187
7266
|
return window.remotion_videoEnabled;
|
|
7188
7267
|
}
|
|
@@ -7192,7 +7271,7 @@ var useVideoEnabled = () => {
|
|
|
7192
7271
|
return context.videoEnabled;
|
|
7193
7272
|
};
|
|
7194
7273
|
var useAudioEnabled = () => {
|
|
7195
|
-
const context =
|
|
7274
|
+
const context = useContext32(MediaEnabledContext);
|
|
7196
7275
|
if (!context) {
|
|
7197
7276
|
return window.remotion_audioEnabled;
|
|
7198
7277
|
}
|
|
@@ -7462,7 +7541,7 @@ var setupEnvVariables = () => {
|
|
|
7462
7541
|
});
|
|
7463
7542
|
};
|
|
7464
7543
|
var CurrentScaleContext = React32.createContext(null);
|
|
7465
|
-
var PreviewSizeContext =
|
|
7544
|
+
var PreviewSizeContext = createContext23({
|
|
7466
7545
|
setSize: () => {
|
|
7467
7546
|
return;
|
|
7468
7547
|
},
|
|
@@ -7486,8 +7565,8 @@ var calculateScale = ({
|
|
|
7486
7565
|
return Number(previewSize);
|
|
7487
7566
|
};
|
|
7488
7567
|
var useSequenceControlOverride = (key) => {
|
|
7489
|
-
const seqContext =
|
|
7490
|
-
const { dragOverrides: overrides } =
|
|
7568
|
+
const seqContext = useContext33(SequenceContext);
|
|
7569
|
+
const { dragOverrides: overrides } = useContext33(VisualModeOverridesContext);
|
|
7491
7570
|
if (!seqContext) {
|
|
7492
7571
|
return;
|
|
7493
7572
|
}
|
|
@@ -7524,9 +7603,9 @@ var OffthreadVideoForRendering = ({
|
|
|
7524
7603
|
const frame = useCurrentFrame();
|
|
7525
7604
|
const volumePropsFrame = useFrameForVolumeProp(loopVolumeCurveBehavior);
|
|
7526
7605
|
const videoConfig = useUnsafeVideoConfig();
|
|
7527
|
-
const sequenceContext =
|
|
7606
|
+
const sequenceContext = useContext34(SequenceContext);
|
|
7528
7607
|
const mediaStartsAt = useMediaStartsAt();
|
|
7529
|
-
const { registerRenderAsset, unregisterRenderAsset } =
|
|
7608
|
+
const { registerRenderAsset, unregisterRenderAsset } = useContext34(RenderAssetManager);
|
|
7530
7609
|
if (!src) {
|
|
7531
7610
|
throw new TypeError("No `src` was passed to <OffthreadVideo>.");
|
|
7532
7611
|
}
|
|
@@ -7738,7 +7817,7 @@ class MediaPlaybackError extends Error {
|
|
|
7738
7817
|
}
|
|
7739
7818
|
}
|
|
7740
7819
|
var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
|
|
7741
|
-
const context =
|
|
7820
|
+
const context = useContext35(SharedAudioContext);
|
|
7742
7821
|
if (!context) {
|
|
7743
7822
|
throw new Error("SharedAudioContext not found");
|
|
7744
7823
|
}
|
|
@@ -7794,8 +7873,8 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
|
|
|
7794
7873
|
}
|
|
7795
7874
|
const volumePropFrame = useFrameForVolumeProp(loopVolumeCurveBehavior ?? "repeat");
|
|
7796
7875
|
const { fps, durationInFrames } = useVideoConfig();
|
|
7797
|
-
const parentSequence =
|
|
7798
|
-
const { hidden } =
|
|
7876
|
+
const parentSequence = useContext35(SequenceContext);
|
|
7877
|
+
const { hidden } = useContext35(SequenceVisibilityToggleContext);
|
|
7799
7878
|
const logLevel = useLogLevel();
|
|
7800
7879
|
const mountTime = useMountTime();
|
|
7801
7880
|
const [timelineId] = useState21(() => String(Math.random()));
|
|
@@ -8353,7 +8432,7 @@ var flattenChildren = (children) => {
|
|
|
8353
8432
|
return flatChildren;
|
|
8354
8433
|
}, []);
|
|
8355
8434
|
};
|
|
8356
|
-
var IsInsideSeriesContext =
|
|
8435
|
+
var IsInsideSeriesContext = createContext24(false);
|
|
8357
8436
|
var IsInsideSeriesContainer = ({ children }) => {
|
|
8358
8437
|
return /* @__PURE__ */ jsx34(IsInsideSeriesContext.Provider, {
|
|
8359
8438
|
value: true,
|
|
@@ -8911,13 +8990,13 @@ var VideoForRenderingForwardFunction = ({
|
|
|
8911
8990
|
const volumePropsFrame = useFrameForVolumeProp(loopVolumeCurveBehavior ?? "repeat");
|
|
8912
8991
|
const videoConfig = useUnsafeVideoConfig();
|
|
8913
8992
|
const videoRef = useRef23(null);
|
|
8914
|
-
const sequenceContext =
|
|
8993
|
+
const sequenceContext = useContext36(SequenceContext);
|
|
8915
8994
|
const mediaStartsAt = useMediaStartsAt();
|
|
8916
8995
|
const environment = useRemotionEnvironment();
|
|
8917
8996
|
const logLevel = useLogLevel();
|
|
8918
8997
|
const mountTime = useMountTime();
|
|
8919
8998
|
const { delayRender: delayRender2, continueRender: continueRender2 } = useDelayRender();
|
|
8920
|
-
const { registerRenderAsset, unregisterRenderAsset } =
|
|
8999
|
+
const { registerRenderAsset, unregisterRenderAsset } = useContext36(RenderAssetManager);
|
|
8921
9000
|
const id = useMemo38(() => `video-${random(props2.src ?? "")}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.relativeFrom}-${sequenceContext?.durationInFrames}`, [
|
|
8922
9001
|
props2.src,
|
|
8923
9002
|
sequenceContext?.cumulatedFrom,
|
|
@@ -9127,7 +9206,7 @@ var VideoForwardingFunction = (props2, ref) => {
|
|
|
9127
9206
|
if (environment.isClientSideRendering) {
|
|
9128
9207
|
throw new Error("<Html5Video> is not supported in @remotion/web-renderer. Use <Video> from @remotion/media instead. See https://remotion.dev/docs/client-side-rendering/limitations");
|
|
9129
9208
|
}
|
|
9130
|
-
const { durations, setDurations } =
|
|
9209
|
+
const { durations, setDurations } = useContext37(DurationsContext);
|
|
9131
9210
|
if (typeof ref === "string") {
|
|
9132
9211
|
throw new Error("string refs are not supported");
|
|
9133
9212
|
}
|
|
@@ -9166,6 +9245,7 @@ var VideoForwardingFunction = (props2, ref) => {
|
|
|
9166
9245
|
}),
|
|
9167
9246
|
layout: "none",
|
|
9168
9247
|
name,
|
|
9248
|
+
showInTimeline: false,
|
|
9169
9249
|
children: /* @__PURE__ */ jsx37(Html5Video, {
|
|
9170
9250
|
...propsOtherThanLoop,
|
|
9171
9251
|
ref,
|
|
@@ -24216,7 +24296,7 @@ var GitHubStars = () => {
|
|
|
24216
24296
|
width: "45px"
|
|
24217
24297
|
}),
|
|
24218
24298
|
/* @__PURE__ */ jsx50(StatItemContent, {
|
|
24219
|
-
content: "
|
|
24299
|
+
content: "45k",
|
|
24220
24300
|
width: "80px",
|
|
24221
24301
|
fontSize: "2.5rem",
|
|
24222
24302
|
fontWeight: "bold"
|
|
@@ -24409,14 +24489,14 @@ import { jsx as jsx56, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
|
24409
24489
|
import { jsx as jsx214, jsxs as jsxs24, Fragment as Fragment11 } from "react/jsx-runtime";
|
|
24410
24490
|
import React56 from "react";
|
|
24411
24491
|
import { useContext as useContext210, useEffect as useEffect42, useState as useState40 } from "react";
|
|
24412
|
-
import { useContext as
|
|
24492
|
+
import { useContext as useContext44, useLayoutEffect as useLayoutEffect17 } from "react";
|
|
24413
24493
|
import { jsx as jsx313 } from "react/jsx-runtime";
|
|
24414
24494
|
import { useCallback as useCallback34, useRef as useRef42 } from "react";
|
|
24415
24495
|
import { useEffect as useEffect24, useState as useState24 } from "react";
|
|
24416
24496
|
import { useLayoutEffect as useLayoutEffect23 } from "react";
|
|
24417
|
-
import { useContext as
|
|
24497
|
+
import { useContext as useContext45, useEffect as useEffect52, useRef as useRef52 } from "react";
|
|
24418
24498
|
import { useEffect as useEffect310, useRef as useRef310 } from "react";
|
|
24419
|
-
import { useCallback as useCallback24, useContext as
|
|
24499
|
+
import { useCallback as useCallback24, useContext as useContext39, useMemo as useMemo52, useRef as useRef26, useState as useState310 } from "react";
|
|
24420
24500
|
import { useEffect as useEffect43, useRef as useRef43 } from "react";
|
|
24421
24501
|
import { useCallback as useCallback35, useEffect as useEffect62, useMemo as useMemo212, useState as useState42 } from "react";
|
|
24422
24502
|
import {
|
|
@@ -25702,7 +25782,7 @@ class ThumbnailEmitter {
|
|
|
25702
25782
|
};
|
|
25703
25783
|
}
|
|
25704
25784
|
var useBufferStateEmitter = (emitter) => {
|
|
25705
|
-
const bufferManager =
|
|
25785
|
+
const bufferManager = useContext44(Internals.BufferingContextReact);
|
|
25706
25786
|
if (!bufferManager) {
|
|
25707
25787
|
throw new Error("BufferingContextReact not found");
|
|
25708
25788
|
}
|
|
@@ -25785,21 +25865,21 @@ var usePlayer = () => {
|
|
|
25785
25865
|
const playStart = useRef26(frame);
|
|
25786
25866
|
const setFrame = Internals.Timeline.useTimelineSetFrame();
|
|
25787
25867
|
const setTimelinePosition = Internals.Timeline.useTimelineSetFrame();
|
|
25788
|
-
const audioContext =
|
|
25789
|
-
const audioTagsContext =
|
|
25868
|
+
const audioContext = useContext39(Internals.SharedAudioContext);
|
|
25869
|
+
const audioTagsContext = useContext39(Internals.SharedAudioTagsContext);
|
|
25790
25870
|
const { audioAndVideoTags } = Internals.useTimelineContext();
|
|
25791
25871
|
const frameRef = useRef26(frame);
|
|
25792
25872
|
frameRef.current = frame;
|
|
25793
25873
|
const video = Internals.useVideo();
|
|
25794
25874
|
const config = Internals.useUnsafeVideoConfig();
|
|
25795
|
-
const emitter =
|
|
25875
|
+
const emitter = useContext39(PlayerEventEmitterContext);
|
|
25796
25876
|
const lastFrame = (config?.durationInFrames ?? 1) - 1;
|
|
25797
25877
|
const isLastFrame = frame === lastFrame;
|
|
25798
25878
|
const isFirstFrame = frame === 0;
|
|
25799
25879
|
if (!emitter) {
|
|
25800
25880
|
throw new TypeError("Expected Player event emitter context");
|
|
25801
25881
|
}
|
|
25802
|
-
const bufferingContext =
|
|
25882
|
+
const bufferingContext = useContext39(Internals.BufferingContextReact);
|
|
25803
25883
|
if (!bufferingContext) {
|
|
25804
25884
|
throw new Error("Missing the buffering context. Most likely you have a Remotion version mismatch.");
|
|
25805
25885
|
}
|
|
@@ -26146,12 +26226,12 @@ var usePlayback = ({
|
|
|
26146
26226
|
const frame = Internals.Timeline.useTimelinePosition();
|
|
26147
26227
|
const { playing, pause, emitter, isPlaying } = usePlayer();
|
|
26148
26228
|
const setFrame = Internals.Timeline.useTimelineSetFrame();
|
|
26149
|
-
const sharedAudioContext =
|
|
26229
|
+
const sharedAudioContext = useContext45(Internals.SharedAudioContext);
|
|
26150
26230
|
const logLevel = Internals.useLogLevel();
|
|
26151
26231
|
const timelineContext = Internals.useTimelineContext();
|
|
26152
26232
|
const isBackgroundedRef = useIsBackgrounded();
|
|
26153
26233
|
const lastTimeUpdateTimestamp = useRef52(0);
|
|
26154
|
-
const context =
|
|
26234
|
+
const context = useContext45(Internals.BufferingContextReact);
|
|
26155
26235
|
if (!context) {
|
|
26156
26236
|
throw new Error("Missing the buffering context. Most likely you have a Remotion version mismatch.");
|
|
26157
26237
|
}
|
|
@@ -26220,7 +26300,9 @@ var usePlayback = ({
|
|
|
26220
26300
|
sharedAudioContext?.suspend?.();
|
|
26221
26301
|
return;
|
|
26222
26302
|
}
|
|
26223
|
-
|
|
26303
|
+
if (!muted) {
|
|
26304
|
+
sharedAudioContext?.resume?.();
|
|
26305
|
+
}
|
|
26224
26306
|
const time = performance.now() - startedTime;
|
|
26225
26307
|
const actualLastFrame = outFrame ?? config.durationInFrames - 1;
|
|
26226
26308
|
const actualFirstFrame = inFrame ?? 0;
|
|
@@ -26249,7 +26331,7 @@ var usePlayback = ({
|
|
|
26249
26331
|
};
|
|
26250
26332
|
const queueNextFrame = () => {
|
|
26251
26333
|
const getIsResumingAudioContext = sharedAudioContext?.getIsResumingAudioContext?.() ?? null;
|
|
26252
|
-
if (getIsResumingAudioContext !== null) {
|
|
26334
|
+
if (getIsResumingAudioContext !== null && !muted) {
|
|
26253
26335
|
getIsResumingAudioContext.then(() => {
|
|
26254
26336
|
if (!sharedAudioContext?.audioContext) {
|
|
26255
26337
|
return;
|
|
@@ -28783,7 +28865,7 @@ var Thumbnail = forward2(ThumbnailFn);
|
|
|
28783
28865
|
import {
|
|
28784
28866
|
useCallback as useCallback49,
|
|
28785
28867
|
useEffect as useEffect58,
|
|
28786
|
-
useMemo as
|
|
28868
|
+
useMemo as useMemo66,
|
|
28787
28869
|
useRef as useRef53,
|
|
28788
28870
|
useState as useState56
|
|
28789
28871
|
} from "react";
|
|
@@ -29534,7 +29616,7 @@ var UNDERLAY_RED = curriedTransparentize$1(0.9, RED);
|
|
|
29534
29616
|
var BLUE_TEXT = curriedDarken$1(0.3, "#42e9f5");
|
|
29535
29617
|
|
|
29536
29618
|
// src/components/homepage/layout/use-color-mode.tsx
|
|
29537
|
-
import React57, { useContext as
|
|
29619
|
+
import React57, { useContext as useContext46, useMemo as useMemo54 } from "react";
|
|
29538
29620
|
import { jsx as jsx57 } from "react/jsx-runtime";
|
|
29539
29621
|
var Context = React57.createContext(undefined);
|
|
29540
29622
|
var ColorModeProvider = ({
|
|
@@ -29551,7 +29633,7 @@ var ColorModeProvider = ({
|
|
|
29551
29633
|
});
|
|
29552
29634
|
};
|
|
29553
29635
|
function useColorMode() {
|
|
29554
|
-
const context =
|
|
29636
|
+
const context = useContext46(Context);
|
|
29555
29637
|
if (context === null || context === undefined) {
|
|
29556
29638
|
throw new Error("ColorModeProvider");
|
|
29557
29639
|
}
|
|
@@ -29559,15 +29641,15 @@ function useColorMode() {
|
|
|
29559
29641
|
}
|
|
29560
29642
|
|
|
29561
29643
|
// ../media/dist/esm/index.mjs
|
|
29562
|
-
import {
|
|
29644
|
+
import { useState as useState312 } from "react";
|
|
29645
|
+
import { useMemo as useMemo312 } from "react";
|
|
29646
|
+
import { useContext as useContext212, useEffect as useEffect44, useMemo as useMemo56, useRef as useRef44, useState as useState41 } from "react";
|
|
29563
29647
|
import { ALL_FORMATS, Input as Input2, UrlSource } from "mediabunny";
|
|
29564
29648
|
import { AudioBufferSink, InputDisposedError } from "mediabunny";
|
|
29565
29649
|
import { CanvasSink } from "mediabunny";
|
|
29566
|
-
import {
|
|
29567
|
-
import { useContext as useContext47, useLayoutEffect as useLayoutEffect18 } from "react";
|
|
29568
|
-
import { useContext as useContext212, useEffect as useEffect44, useState as useState41 } from "react";
|
|
29650
|
+
import { useContext as useContext48, useLayoutEffect as useLayoutEffect18 } from "react";
|
|
29569
29651
|
import { jsx as jsx58 } from "react/jsx-runtime";
|
|
29570
|
-
import { useContext as
|
|
29652
|
+
import { useContext as useContext311, useLayoutEffect as useLayoutEffect24, useMemo as useMemo213, useState as useState210 } from "react";
|
|
29571
29653
|
import React211 from "react";
|
|
29572
29654
|
import {
|
|
29573
29655
|
ALL_FORMATS as ALL_FORMATS2,
|
|
@@ -29581,9 +29663,10 @@ import {
|
|
|
29581
29663
|
} from "mediabunny";
|
|
29582
29664
|
import { jsx as jsx216 } from "react/jsx-runtime";
|
|
29583
29665
|
import { jsx as jsx315 } from "react/jsx-runtime";
|
|
29666
|
+
import { useMemo as useMemo63, useState as useState63 } from "react";
|
|
29584
29667
|
import {
|
|
29585
|
-
useContext as
|
|
29586
|
-
useEffect as
|
|
29668
|
+
useContext as useContext47,
|
|
29669
|
+
useEffect as useEffect210,
|
|
29587
29670
|
useLayoutEffect as useLayoutEffect34,
|
|
29588
29671
|
useMemo as useMemo412,
|
|
29589
29672
|
useRef as useRef210,
|
|
@@ -29591,7 +29674,7 @@ import {
|
|
|
29591
29674
|
} from "react";
|
|
29592
29675
|
import { jsx as jsx412 } from "react/jsx-runtime";
|
|
29593
29676
|
import {
|
|
29594
|
-
useContext as
|
|
29677
|
+
useContext as useContext53,
|
|
29595
29678
|
useLayoutEffect as useLayoutEffect43,
|
|
29596
29679
|
useMemo as useMemo55,
|
|
29597
29680
|
useRef as useRef312,
|
|
@@ -29636,6 +29719,31 @@ var __callDispose = (stack, error2, hasError) => {
|
|
|
29636
29719
|
};
|
|
29637
29720
|
return next();
|
|
29638
29721
|
};
|
|
29722
|
+
var getLoopDisplay = ({
|
|
29723
|
+
loop,
|
|
29724
|
+
mediaDurationInSeconds,
|
|
29725
|
+
playbackRate,
|
|
29726
|
+
trimAfter,
|
|
29727
|
+
trimBefore,
|
|
29728
|
+
sequenceDurationInFrames,
|
|
29729
|
+
compFps
|
|
29730
|
+
}) => {
|
|
29731
|
+
if (!loop || !mediaDurationInSeconds) {
|
|
29732
|
+
return;
|
|
29733
|
+
}
|
|
29734
|
+
const durationInFrames = Internals.calculateMediaDuration({
|
|
29735
|
+
mediaDurationInFrames: mediaDurationInSeconds * compFps,
|
|
29736
|
+
playbackRate,
|
|
29737
|
+
trimAfter,
|
|
29738
|
+
trimBefore
|
|
29739
|
+
});
|
|
29740
|
+
const maxTimes = sequenceDurationInFrames / durationInFrames;
|
|
29741
|
+
return {
|
|
29742
|
+
numberOfTimes: maxTimes,
|
|
29743
|
+
startOffset: 0,
|
|
29744
|
+
durationInFrames
|
|
29745
|
+
};
|
|
29746
|
+
};
|
|
29639
29747
|
var getTimeInSeconds = ({
|
|
29640
29748
|
loop,
|
|
29641
29749
|
mediaDurationInSeconds,
|
|
@@ -31262,41 +31370,6 @@ var callOnErrorAndResolve = ({
|
|
|
31262
31370
|
}
|
|
31263
31371
|
return ["fallback", error2];
|
|
31264
31372
|
};
|
|
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
31373
|
var useCommonEffects = ({
|
|
31301
31374
|
mediaPlayerRef,
|
|
31302
31375
|
mediaPlayerReady,
|
|
@@ -31320,7 +31393,7 @@ var useCommonEffects = ({
|
|
|
31320
31393
|
logLevel,
|
|
31321
31394
|
label: label3
|
|
31322
31395
|
}) => {
|
|
31323
|
-
const sharedAudioContext =
|
|
31396
|
+
const sharedAudioContext = useContext48(Internals.SharedAudioContext);
|
|
31324
31397
|
useLayoutEffect18(() => {
|
|
31325
31398
|
const mediaPlayer = mediaPlayerRef.current;
|
|
31326
31399
|
if (!mediaPlayer)
|
|
@@ -31441,109 +31514,6 @@ var useCommonEffects = ({
|
|
|
31441
31514
|
Internals.Log.trace({ logLevel, tag: "@remotion/media" }, `[${label3}] Updating target time to ${currentTime.toFixed(3)}s`);
|
|
31442
31515
|
}, [currentTime, logLevel, mediaPlayerReady, label3, mediaPlayerRef]);
|
|
31443
31516
|
};
|
|
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
31517
|
var {
|
|
31548
31518
|
useUnsafeVideoConfig: useUnsafeVideoConfig2,
|
|
31549
31519
|
Timeline,
|
|
@@ -31575,23 +31545,22 @@ var AudioForPreviewAssertedShowing = ({
|
|
|
31575
31545
|
fallbackHtml5AudioProps,
|
|
31576
31546
|
onError,
|
|
31577
31547
|
credentials,
|
|
31578
|
-
|
|
31548
|
+
setMediaDurationInSeconds
|
|
31579
31549
|
}) => {
|
|
31580
31550
|
const videoConfig = useUnsafeVideoConfig2();
|
|
31581
31551
|
const frame = useCurrentFrame();
|
|
31582
31552
|
const mediaPlayerRef = useRef44(null);
|
|
31583
31553
|
const initialTrimBeforeRef = useRef44(trimBefore);
|
|
31584
31554
|
const initialTrimAfterRef = useRef44(trimAfter);
|
|
31585
|
-
const [mediaPlayerReady, setMediaPlayerReady] =
|
|
31586
|
-
const [shouldFallbackToNativeAudio, setShouldFallbackToNativeAudio] =
|
|
31555
|
+
const [mediaPlayerReady, setMediaPlayerReady] = useState41(false);
|
|
31556
|
+
const [shouldFallbackToNativeAudio, setShouldFallbackToNativeAudio] = useState41(false);
|
|
31587
31557
|
const [playing] = Timeline.usePlayingState();
|
|
31588
31558
|
const timelineContext = Internals.useTimelineContext();
|
|
31589
31559
|
const globalPlaybackRate = timelineContext.playbackRate;
|
|
31590
|
-
const sharedAudioContext =
|
|
31560
|
+
const sharedAudioContext = useContext212(SharedAudioContext2);
|
|
31591
31561
|
const buffer = useBufferState();
|
|
31592
31562
|
const [mediaMuted] = useMediaMutedState2();
|
|
31593
31563
|
const [mediaVolume] = useMediaVolumeState2();
|
|
31594
|
-
const [mediaDurationInSeconds, setMediaDurationInSeconds] = useState210(null);
|
|
31595
31564
|
const volumePropFrame = useFrameForVolumeProp2(loopVolumeCurveBehavior ?? "repeat");
|
|
31596
31565
|
const userPreferredVolume = evaluateVolume2({
|
|
31597
31566
|
frame: volumePropFrame,
|
|
@@ -31609,38 +31578,11 @@ var AudioForPreviewAssertedShowing = ({
|
|
|
31609
31578
|
const currentTimeRef = useRef44(currentTime);
|
|
31610
31579
|
currentTimeRef.current = currentTime;
|
|
31611
31580
|
const preloadedSrc = usePreload2(src);
|
|
31612
|
-
const parentSequence =
|
|
31581
|
+
const parentSequence = useContext212(SequenceContext2);
|
|
31613
31582
|
const isPremounting = Boolean(parentSequence?.premounting);
|
|
31614
31583
|
const isPostmounting = Boolean(parentSequence?.postmounting);
|
|
31615
31584
|
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);
|
|
31585
|
+
const bufferingContext = useContext212(Internals.BufferingContextReact);
|
|
31644
31586
|
if (!bufferingContext) {
|
|
31645
31587
|
throw new Error("useMediaPlayback must be used inside a <BufferingContext>");
|
|
31646
31588
|
}
|
|
@@ -31677,7 +31619,7 @@ var AudioForPreviewAssertedShowing = ({
|
|
|
31677
31619
|
logLevel,
|
|
31678
31620
|
label: "AudioForPreview"
|
|
31679
31621
|
});
|
|
31680
|
-
|
|
31622
|
+
useEffect44(() => {
|
|
31681
31623
|
if (!sharedAudioContext)
|
|
31682
31624
|
return;
|
|
31683
31625
|
if (!sharedAudioContext.audioContext)
|
|
@@ -31814,7 +31756,8 @@ var AudioForPreviewAssertedShowing = ({
|
|
|
31814
31756
|
disallowFallbackToHtml5Audio,
|
|
31815
31757
|
buffer,
|
|
31816
31758
|
onError,
|
|
31817
|
-
credentials
|
|
31759
|
+
credentials,
|
|
31760
|
+
setMediaDurationInSeconds
|
|
31818
31761
|
]);
|
|
31819
31762
|
if (shouldFallbackToNativeAudio && !disallowFallbackToHtml5Audio) {
|
|
31820
31763
|
return /* @__PURE__ */ jsx58(Audio, {
|
|
@@ -31857,14 +31800,14 @@ var AudioForPreview2 = ({
|
|
|
31857
31800
|
fallbackHtml5AudioProps,
|
|
31858
31801
|
onError,
|
|
31859
31802
|
credentials,
|
|
31860
|
-
|
|
31803
|
+
setMediaDurationInSeconds
|
|
31861
31804
|
}) => {
|
|
31862
31805
|
const preloadedSrc = usePreload2(src);
|
|
31863
31806
|
const defaultLogLevel = Internals.useLogLevel();
|
|
31864
31807
|
const frame = useCurrentFrame();
|
|
31865
31808
|
const videoConfig = useVideoConfig();
|
|
31866
31809
|
const currentTime = frame / videoConfig.fps;
|
|
31867
|
-
const showShow =
|
|
31810
|
+
const showShow = useMemo56(() => {
|
|
31868
31811
|
return getTimeInSeconds({
|
|
31869
31812
|
unloopedTimeInSeconds: currentTime,
|
|
31870
31813
|
playbackRate,
|
|
@@ -31888,6 +31831,9 @@ var AudioForPreview2 = ({
|
|
|
31888
31831
|
if (!showShow) {
|
|
31889
31832
|
return null;
|
|
31890
31833
|
}
|
|
31834
|
+
if (!setMediaDurationInSeconds) {
|
|
31835
|
+
throw new Error("setMediaDurationInSeconds is required");
|
|
31836
|
+
}
|
|
31891
31837
|
return /* @__PURE__ */ jsx58(AudioForPreviewAssertedShowing, {
|
|
31892
31838
|
audioStreamIndex,
|
|
31893
31839
|
src: preloadedSrc,
|
|
@@ -31907,7 +31853,7 @@ var AudioForPreview2 = ({
|
|
|
31907
31853
|
onError,
|
|
31908
31854
|
credentials,
|
|
31909
31855
|
fallbackHtml5AudioProps,
|
|
31910
|
-
|
|
31856
|
+
setMediaDurationInSeconds
|
|
31911
31857
|
});
|
|
31912
31858
|
};
|
|
31913
31859
|
var makeAudioCache = () => {
|
|
@@ -33724,7 +33670,7 @@ var AudioForRendering2 = ({
|
|
|
33724
33670
|
const frame = useCurrentFrame();
|
|
33725
33671
|
const absoluteFrame = Internals.useTimelinePosition();
|
|
33726
33672
|
const videoConfig = Internals.useUnsafeVideoConfig();
|
|
33727
|
-
const { registerRenderAsset, unregisterRenderAsset } =
|
|
33673
|
+
const { registerRenderAsset, unregisterRenderAsset } = useContext311(Internals.RenderAssetManager);
|
|
33728
33674
|
const startsAt = Internals.useMediaStartsAt();
|
|
33729
33675
|
const environment = useRemotionEnvironment();
|
|
33730
33676
|
if (!videoConfig) {
|
|
@@ -33735,9 +33681,9 @@ var AudioForRendering2 = ({
|
|
|
33735
33681
|
}
|
|
33736
33682
|
const { fps } = videoConfig;
|
|
33737
33683
|
const { delayRender: delayRender2, continueRender } = useDelayRender();
|
|
33738
|
-
const [replaceWithHtml5Audio, setReplaceWithHtml5Audio] =
|
|
33739
|
-
const sequenceContext =
|
|
33740
|
-
const id =
|
|
33684
|
+
const [replaceWithHtml5Audio, setReplaceWithHtml5Audio] = useState210(false);
|
|
33685
|
+
const sequenceContext = useContext311(Internals.SequenceContext);
|
|
33686
|
+
const id = useMemo213(() => `media-audio-${random(src)}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.relativeFrom}-${sequenceContext?.durationInFrames}`, [
|
|
33741
33687
|
src,
|
|
33742
33688
|
sequenceContext?.cumulatedFrom,
|
|
33743
33689
|
sequenceContext?.relativeFrom,
|
|
@@ -33925,28 +33871,75 @@ var AudioInner = (props) => {
|
|
|
33925
33871
|
name,
|
|
33926
33872
|
stack,
|
|
33927
33873
|
showInTimeline,
|
|
33928
|
-
controls,
|
|
33874
|
+
_experimentalControls: controls,
|
|
33929
33875
|
from,
|
|
33930
33876
|
durationInFrames,
|
|
33931
33877
|
...otherProps
|
|
33932
33878
|
} = props;
|
|
33933
33879
|
const environment = useRemotionEnvironment();
|
|
33880
|
+
const [mediaVolume] = Internals.useMediaVolumeState();
|
|
33881
|
+
const mediaStartsAt = Internals.useMediaStartsAt();
|
|
33882
|
+
const videoConfig = useVideoConfig();
|
|
33883
|
+
const sequenceDurationInFrames = Math.min(durationInFrames ?? Infinity, Math.max(0, videoConfig.durationInFrames - (from ?? 0)));
|
|
33884
|
+
const basicInfo = Internals.useBasicMediaInTimeline({
|
|
33885
|
+
src: props.src,
|
|
33886
|
+
volume: props.volume,
|
|
33887
|
+
playbackRate: props.playbackRate ?? 1,
|
|
33888
|
+
trimBefore: props.trimBefore,
|
|
33889
|
+
trimAfter: props.trimAfter,
|
|
33890
|
+
sequenceDurationInFrames,
|
|
33891
|
+
mediaType: "audio",
|
|
33892
|
+
displayName: name ?? "<Audio>",
|
|
33893
|
+
mediaVolume,
|
|
33894
|
+
mediaStartsAt,
|
|
33895
|
+
loop: props.loop ?? false
|
|
33896
|
+
});
|
|
33897
|
+
const [mediaDurationInSeconds, setMediaDurationInSeconds] = useState312(null);
|
|
33898
|
+
const loopDisplay = useMemo312(() => getLoopDisplay({
|
|
33899
|
+
loop: props.loop ?? false,
|
|
33900
|
+
mediaDurationInSeconds,
|
|
33901
|
+
playbackRate: props.playbackRate ?? 1,
|
|
33902
|
+
trimAfter: props.trimAfter,
|
|
33903
|
+
trimBefore: props.trimBefore,
|
|
33904
|
+
sequenceDurationInFrames,
|
|
33905
|
+
compFps: videoConfig.fps
|
|
33906
|
+
}), [
|
|
33907
|
+
props.loop,
|
|
33908
|
+
mediaDurationInSeconds,
|
|
33909
|
+
props.playbackRate,
|
|
33910
|
+
props.trimAfter,
|
|
33911
|
+
props.trimBefore,
|
|
33912
|
+
sequenceDurationInFrames,
|
|
33913
|
+
videoConfig.fps
|
|
33914
|
+
]);
|
|
33915
|
+
const isMedia = useMemo312(() => ({
|
|
33916
|
+
type: "audio",
|
|
33917
|
+
data: basicInfo
|
|
33918
|
+
}), [basicInfo]);
|
|
33934
33919
|
if (typeof props.src !== "string") {
|
|
33935
33920
|
throw new TypeError(`The \`<Audio>\` tag requires a string for \`src\`, but got ${JSON.stringify(props.src)} instead.`);
|
|
33936
33921
|
}
|
|
33937
33922
|
validateMediaProps2({ playbackRate: props.playbackRate, volume: props.volume }, "Audio");
|
|
33923
|
+
if (sequenceDurationInFrames === 0) {
|
|
33924
|
+
return null;
|
|
33925
|
+
}
|
|
33938
33926
|
return /* @__PURE__ */ jsx315(Sequence, {
|
|
33939
33927
|
layout: "none",
|
|
33940
33928
|
from: from ?? 0,
|
|
33941
|
-
durationInFrames:
|
|
33942
|
-
|
|
33929
|
+
durationInFrames: basicInfo.duration,
|
|
33930
|
+
_remotionInternalStack: stack,
|
|
33931
|
+
_remotionInternalIsMedia: isMedia,
|
|
33932
|
+
name: name ?? "<Audio>",
|
|
33933
|
+
_experimentalControls: controls,
|
|
33934
|
+
_remotionInternalLoopDisplay: loopDisplay,
|
|
33935
|
+
showInTimeline: showInTimeline ?? true,
|
|
33943
33936
|
children: environment.isRendering ? /* @__PURE__ */ jsx315(AudioForRendering2, {
|
|
33944
33937
|
...otherProps
|
|
33945
33938
|
}) : /* @__PURE__ */ jsx315(AudioForPreview2, {
|
|
33946
33939
|
name,
|
|
33947
33940
|
...otherProps,
|
|
33948
33941
|
stack: stack ?? null,
|
|
33949
|
-
|
|
33942
|
+
setMediaDurationInSeconds
|
|
33950
33943
|
})
|
|
33951
33944
|
});
|
|
33952
33945
|
};
|
|
@@ -34001,9 +33994,7 @@ var {
|
|
|
34001
33994
|
warnAboutTooHighVolume: warnAboutTooHighVolume22,
|
|
34002
33995
|
usePreload: usePreload22,
|
|
34003
33996
|
SequenceContext: SequenceContext22,
|
|
34004
|
-
|
|
34005
|
-
useEffectChainState: useEffectChainState2,
|
|
34006
|
-
useMemoizedEffects: useMemoizedEffects2
|
|
33997
|
+
useEffectChainState: useEffectChainState2
|
|
34007
33998
|
} = Internals;
|
|
34008
33999
|
var VideoForPreviewAssertedShowing = ({
|
|
34009
34000
|
src: unpreloadedSrc,
|
|
@@ -34017,7 +34008,6 @@ var VideoForPreviewAssertedShowing = ({
|
|
|
34017
34008
|
onVideoFrame,
|
|
34018
34009
|
showInTimeline,
|
|
34019
34010
|
loop,
|
|
34020
|
-
name,
|
|
34021
34011
|
trimAfter,
|
|
34022
34012
|
trimBefore,
|
|
34023
34013
|
stack,
|
|
@@ -34028,10 +34018,10 @@ var VideoForPreviewAssertedShowing = ({
|
|
|
34028
34018
|
headless,
|
|
34029
34019
|
onError,
|
|
34030
34020
|
credentials,
|
|
34031
|
-
controls,
|
|
34032
34021
|
objectFit: objectFitProp,
|
|
34033
34022
|
_experimentalInitiallyDrawCachedFrame,
|
|
34034
|
-
_experimentalEffects
|
|
34023
|
+
_experimentalEffects,
|
|
34024
|
+
setMediaDurationInSeconds
|
|
34035
34025
|
}) => {
|
|
34036
34026
|
const src = usePreload22(unpreloadedSrc);
|
|
34037
34027
|
const canvasRef = useRef210(null);
|
|
@@ -34046,12 +34036,10 @@ var VideoForPreviewAssertedShowing = ({
|
|
|
34046
34036
|
const [playing] = Timeline2.usePlayingState();
|
|
34047
34037
|
const timelineContext = Internals.useTimelineContext();
|
|
34048
34038
|
const globalPlaybackRate = timelineContext.playbackRate;
|
|
34049
|
-
const sharedAudioContext =
|
|
34039
|
+
const sharedAudioContext = useContext47(SharedAudioContext22);
|
|
34050
34040
|
const buffer = useBufferState();
|
|
34051
34041
|
const [mediaMuted] = useMediaMutedState22();
|
|
34052
34042
|
const [mediaVolume] = useMediaVolumeState22();
|
|
34053
|
-
const [mediaDurationInSeconds, setMediaDurationInSeconds] = useState43(null);
|
|
34054
|
-
const { hidden } = useContext53(SequenceVisibilityToggleContext2);
|
|
34055
34043
|
const volumePropFrame = useFrameForVolumeProp22(loopVolumeCurveBehavior);
|
|
34056
34044
|
const userPreferredVolume = evaluateVolume22({
|
|
34057
34045
|
frame: volumePropFrame,
|
|
@@ -34065,49 +34053,23 @@ var VideoForPreviewAssertedShowing = ({
|
|
|
34065
34053
|
const effectChainState = useEffectChainState2();
|
|
34066
34054
|
const experimentalEffectsRef = useRef210(_experimentalEffects);
|
|
34067
34055
|
experimentalEffectsRef.current = _experimentalEffects;
|
|
34068
|
-
const memoizedEffects = useMemoizedEffects2(_experimentalEffects.flat());
|
|
34069
34056
|
const effectChainStateRef = useRef210(effectChainState);
|
|
34070
34057
|
effectChainStateRef.current = effectChainState;
|
|
34071
34058
|
const frameRef = useRef210(frame);
|
|
34072
34059
|
frameRef.current = frame;
|
|
34073
|
-
const parentSequence =
|
|
34060
|
+
const parentSequence = useContext47(SequenceContext22);
|
|
34074
34061
|
const isPremounting = Boolean(parentSequence?.premounting);
|
|
34075
34062
|
const isPostmounting = Boolean(parentSequence?.postmounting);
|
|
34076
34063
|
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
34064
|
const currentTime = frame / videoConfig.fps;
|
|
34103
34065
|
const currentTimeRef = useRef210(currentTime);
|
|
34104
34066
|
currentTimeRef.current = currentTime;
|
|
34105
34067
|
const preloadedSrc = usePreload22(src);
|
|
34106
|
-
const buffering =
|
|
34068
|
+
const buffering = useContext47(Internals.BufferingContextReact);
|
|
34107
34069
|
if (!buffering) {
|
|
34108
34070
|
throw new Error("useMediaPlayback must be used inside a <BufferingContext>");
|
|
34109
34071
|
}
|
|
34110
|
-
const effectiveMuted =
|
|
34072
|
+
const effectiveMuted = muted || mediaMuted || userPreferredVolume <= 0;
|
|
34111
34073
|
const isPlayerBuffering = Internals.useIsPlayerBuffering(buffering);
|
|
34112
34074
|
const initialPlaying = useRef210(playing && !isPlayerBuffering);
|
|
34113
34075
|
const initialIsPremounting = useRef210(isPremounting);
|
|
@@ -34155,7 +34117,7 @@ var VideoForPreviewAssertedShowing = ({
|
|
|
34155
34117
|
cacheVideoFrame(src, canvas);
|
|
34156
34118
|
};
|
|
34157
34119
|
}, [_experimentalInitiallyDrawCachedFrame, src]);
|
|
34158
|
-
|
|
34120
|
+
useEffect210(() => {
|
|
34159
34121
|
if (!sharedAudioContext)
|
|
34160
34122
|
return;
|
|
34161
34123
|
if (!sharedAudioContext.audioContext)
|
|
@@ -34292,7 +34254,8 @@ var VideoForPreviewAssertedShowing = ({
|
|
|
34292
34254
|
sharedAudioContext,
|
|
34293
34255
|
videoConfig.fps,
|
|
34294
34256
|
onError,
|
|
34295
|
-
credentials
|
|
34257
|
+
credentials,
|
|
34258
|
+
setMediaDurationInSeconds
|
|
34296
34259
|
]);
|
|
34297
34260
|
warnAboutObjectFitInStyleOrClassName({ style: style2, className: className2, logLevel });
|
|
34298
34261
|
const classNameValue = useMemo412(() => {
|
|
@@ -34338,10 +34301,9 @@ var VideoForPreviewAssertedShowing = ({
|
|
|
34338
34301
|
const actualStyle = useMemo412(() => {
|
|
34339
34302
|
return {
|
|
34340
34303
|
...style2,
|
|
34341
|
-
opacity: isSequenceHidden ? 0 : style2?.opacity ?? 1,
|
|
34342
34304
|
objectFit: objectFitProp
|
|
34343
34305
|
};
|
|
34344
|
-
}, [
|
|
34306
|
+
}, [objectFitProp, style2]);
|
|
34345
34307
|
if (shouldFallbackToNativeVideo && !disallowFallbackToOffthreadVideo) {
|
|
34346
34308
|
return /* @__PURE__ */ jsx412(Html5Video, {
|
|
34347
34309
|
src,
|
|
@@ -34353,7 +34315,7 @@ var VideoForPreviewAssertedShowing = ({
|
|
|
34353
34315
|
trimBefore,
|
|
34354
34316
|
playbackRate,
|
|
34355
34317
|
loopVolumeCurveBehavior,
|
|
34356
|
-
name,
|
|
34318
|
+
name: "<Html5Video> (fallback)",
|
|
34357
34319
|
loop,
|
|
34358
34320
|
showInTimeline,
|
|
34359
34321
|
stack: stack ?? undefined,
|
|
@@ -34398,8 +34360,7 @@ var VideoForPreview2 = (props) => {
|
|
|
34398
34360
|
return null;
|
|
34399
34361
|
}
|
|
34400
34362
|
return /* @__PURE__ */ jsx412(VideoForPreviewAssertedShowing, {
|
|
34401
|
-
...props
|
|
34402
|
-
controls: props.controls
|
|
34363
|
+
...props
|
|
34403
34364
|
});
|
|
34404
34365
|
};
|
|
34405
34366
|
var VideoForRendering2 = ({
|
|
@@ -34417,7 +34378,6 @@ var VideoForRendering2 = ({
|
|
|
34417
34378
|
className: className2,
|
|
34418
34379
|
fallbackOffthreadVideoProps,
|
|
34419
34380
|
audioStreamIndex,
|
|
34420
|
-
name,
|
|
34421
34381
|
disallowFallbackToOffthreadVideo,
|
|
34422
34382
|
stack,
|
|
34423
34383
|
toneFrequency,
|
|
@@ -34434,9 +34394,9 @@ var VideoForRendering2 = ({
|
|
|
34434
34394
|
const frame = useCurrentFrame();
|
|
34435
34395
|
const absoluteFrame = Internals.useTimelinePosition();
|
|
34436
34396
|
const { fps } = useVideoConfig();
|
|
34437
|
-
const { registerRenderAsset, unregisterRenderAsset } =
|
|
34397
|
+
const { registerRenderAsset, unregisterRenderAsset } = useContext53(Internals.RenderAssetManager);
|
|
34438
34398
|
const startsAt = Internals.useMediaStartsAt();
|
|
34439
|
-
const sequenceContext =
|
|
34399
|
+
const sequenceContext = useContext53(Internals.SequenceContext);
|
|
34440
34400
|
const id = useMemo55(() => `media-video-${random(src)}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.relativeFrom}-${sequenceContext?.durationInFrames}`, [
|
|
34441
34401
|
src,
|
|
34442
34402
|
sequenceContext?.cumulatedFrom,
|
|
@@ -34648,12 +34608,12 @@ var VideoForRendering2 = ({
|
|
|
34648
34608
|
loopVolumeCurveBehavior: loopVolumeCurveBehavior ?? "repeat",
|
|
34649
34609
|
delayRenderRetries: delayRenderRetries ?? undefined,
|
|
34650
34610
|
delayRenderTimeoutInMilliseconds: delayRenderTimeoutInMilliseconds ?? undefined,
|
|
34611
|
+
name: "Fallback to <OffthreadVideo>",
|
|
34651
34612
|
style: styleWithObjectFit,
|
|
34652
34613
|
allowAmplificationDuringRender: true,
|
|
34653
34614
|
transparent: fallbackOffthreadVideoProps?.transparent ?? true,
|
|
34654
34615
|
toneMapped: fallbackOffthreadVideoProps?.toneMapped ?? true,
|
|
34655
34616
|
audioStreamIndex: audioStreamIndex ?? 0,
|
|
34656
|
-
name,
|
|
34657
34617
|
className: className2,
|
|
34658
34618
|
onVideoFrame,
|
|
34659
34619
|
volume: volumeProp,
|
|
@@ -34759,7 +34719,6 @@ var InnerVideo = ({
|
|
|
34759
34719
|
loop,
|
|
34760
34720
|
loopVolumeCurveBehavior,
|
|
34761
34721
|
muted,
|
|
34762
|
-
name,
|
|
34763
34722
|
onVideoFrame,
|
|
34764
34723
|
playbackRate,
|
|
34765
34724
|
style: style2,
|
|
@@ -34773,10 +34732,11 @@ var InnerVideo = ({
|
|
|
34773
34732
|
headless,
|
|
34774
34733
|
onError,
|
|
34775
34734
|
credentials,
|
|
34776
|
-
controls,
|
|
34735
|
+
_experimentalControls: controls,
|
|
34777
34736
|
objectFit,
|
|
34778
34737
|
_experimentalInitiallyDrawCachedFrame,
|
|
34779
|
-
_experimentalEffects
|
|
34738
|
+
_experimentalEffects,
|
|
34739
|
+
setMediaDurationInSeconds
|
|
34780
34740
|
}) => {
|
|
34781
34741
|
const environment = useRemotionEnvironment();
|
|
34782
34742
|
if (typeof src !== "string") {
|
|
@@ -34802,7 +34762,6 @@ var InnerVideo = ({
|
|
|
34802
34762
|
delayRenderRetries: delayRenderRetries ?? null,
|
|
34803
34763
|
delayRenderTimeoutInMilliseconds: delayRenderTimeoutInMilliseconds ?? null,
|
|
34804
34764
|
disallowFallbackToOffthreadVideo: disallowFallbackToOffthreadVideo ?? false,
|
|
34805
|
-
name,
|
|
34806
34765
|
fallbackOffthreadVideoProps,
|
|
34807
34766
|
logLevel,
|
|
34808
34767
|
loop,
|
|
@@ -34824,9 +34783,9 @@ var InnerVideo = ({
|
|
|
34824
34783
|
});
|
|
34825
34784
|
}
|
|
34826
34785
|
return /* @__PURE__ */ jsx65(VideoForPreview2, {
|
|
34786
|
+
setMediaDurationInSeconds,
|
|
34827
34787
|
audioStreamIndex: audioStreamIndex ?? 0,
|
|
34828
34788
|
className: className2,
|
|
34829
|
-
name,
|
|
34830
34789
|
logLevel,
|
|
34831
34790
|
loop,
|
|
34832
34791
|
loopVolumeCurveBehavior,
|
|
@@ -34878,19 +34837,66 @@ var VideoInner = ({
|
|
|
34878
34837
|
headless,
|
|
34879
34838
|
onError,
|
|
34880
34839
|
credentials,
|
|
34881
|
-
controls,
|
|
34840
|
+
_experimentalControls: controls,
|
|
34882
34841
|
objectFit,
|
|
34883
34842
|
_experimentalInitiallyDrawCachedFrame,
|
|
34884
34843
|
_experimentalEffects,
|
|
34885
|
-
|
|
34886
|
-
|
|
34844
|
+
durationInFrames,
|
|
34845
|
+
from
|
|
34887
34846
|
}) => {
|
|
34888
34847
|
const fallbackLogLevel = Internals.useLogLevel();
|
|
34848
|
+
const [mediaVolume] = Internals.useMediaVolumeState();
|
|
34849
|
+
const mediaStartsAt = Internals.useMediaStartsAt();
|
|
34850
|
+
const videoConfig = useVideoConfig();
|
|
34851
|
+
const sequenceDurationInFrames = Math.min(durationInFrames ?? Infinity, Math.max(0, videoConfig.durationInFrames - (from ?? 0)));
|
|
34852
|
+
const basicInfo = Internals.useBasicMediaInTimeline({
|
|
34853
|
+
src,
|
|
34854
|
+
volume,
|
|
34855
|
+
playbackRate: playbackRate ?? 1,
|
|
34856
|
+
trimBefore,
|
|
34857
|
+
trimAfter,
|
|
34858
|
+
sequenceDurationInFrames,
|
|
34859
|
+
mediaType: "video",
|
|
34860
|
+
displayName: name ?? "<Video>",
|
|
34861
|
+
mediaVolume,
|
|
34862
|
+
mediaStartsAt,
|
|
34863
|
+
loop: loop ?? false
|
|
34864
|
+
});
|
|
34865
|
+
const [mediaDurationInSeconds, setMediaDurationInSeconds] = useState63(null);
|
|
34866
|
+
const loopDisplay = useMemo63(() => getLoopDisplay({
|
|
34867
|
+
loop: loop ?? false,
|
|
34868
|
+
mediaDurationInSeconds,
|
|
34869
|
+
playbackRate: playbackRate ?? 1,
|
|
34870
|
+
trimAfter,
|
|
34871
|
+
trimBefore,
|
|
34872
|
+
sequenceDurationInFrames,
|
|
34873
|
+
compFps: videoConfig.fps
|
|
34874
|
+
}), [
|
|
34875
|
+
loop,
|
|
34876
|
+
mediaDurationInSeconds,
|
|
34877
|
+
playbackRate,
|
|
34878
|
+
trimAfter,
|
|
34879
|
+
trimBefore,
|
|
34880
|
+
sequenceDurationInFrames,
|
|
34881
|
+
videoConfig.fps
|
|
34882
|
+
]);
|
|
34883
|
+
const isMedia = useMemo63(() => ({
|
|
34884
|
+
type: "video",
|
|
34885
|
+
data: basicInfo
|
|
34886
|
+
}), [basicInfo]);
|
|
34887
|
+
if (sequenceDurationInFrames === 0) {
|
|
34888
|
+
return null;
|
|
34889
|
+
}
|
|
34889
34890
|
return /* @__PURE__ */ jsx65(Sequence, {
|
|
34890
34891
|
layout: "none",
|
|
34891
34892
|
from: from ?? 0,
|
|
34892
|
-
durationInFrames:
|
|
34893
|
-
|
|
34893
|
+
durationInFrames: basicInfo.duration,
|
|
34894
|
+
_remotionInternalStack: stack,
|
|
34895
|
+
_remotionInternalIsMedia: isMedia,
|
|
34896
|
+
name: name ?? "<Video>",
|
|
34897
|
+
_experimentalControls: controls,
|
|
34898
|
+
_remotionInternalLoopDisplay: loopDisplay,
|
|
34899
|
+
showInTimeline: showInTimeline ?? true,
|
|
34894
34900
|
children: /* @__PURE__ */ jsx65(InnerVideo, {
|
|
34895
34901
|
audioStreamIndex: audioStreamIndex ?? 0,
|
|
34896
34902
|
className: className2,
|
|
@@ -34902,7 +34908,6 @@ var VideoInner = ({
|
|
|
34902
34908
|
loop: loop ?? false,
|
|
34903
34909
|
loopVolumeCurveBehavior: loopVolumeCurveBehavior ?? "repeat",
|
|
34904
34910
|
muted: muted ?? false,
|
|
34905
|
-
name,
|
|
34906
34911
|
onVideoFrame,
|
|
34907
34912
|
playbackRate: playbackRate ?? 1,
|
|
34908
34913
|
showInTimeline: showInTimeline ?? true,
|
|
@@ -34917,10 +34922,11 @@ var VideoInner = ({
|
|
|
34917
34922
|
headless: headless ?? false,
|
|
34918
34923
|
onError,
|
|
34919
34924
|
credentials,
|
|
34920
|
-
controls,
|
|
34925
|
+
_experimentalControls: controls,
|
|
34921
34926
|
objectFit: objectFit ?? "contain",
|
|
34922
34927
|
_experimentalInitiallyDrawCachedFrame: _experimentalInitiallyDrawCachedFrame ?? false,
|
|
34923
|
-
_experimentalEffects: _experimentalEffects ?? []
|
|
34928
|
+
_experimentalEffects: _experimentalEffects ?? [],
|
|
34929
|
+
setMediaDurationInSeconds
|
|
34924
34930
|
})
|
|
34925
34931
|
});
|
|
34926
34932
|
};
|
|
@@ -36228,7 +36234,7 @@ import {
|
|
|
36228
36234
|
import { BufferTarget, StreamTarget } from "mediabunny";
|
|
36229
36235
|
|
|
36230
36236
|
// ../core/dist/esm/version.mjs
|
|
36231
|
-
var VERSION2 = "4.0.
|
|
36237
|
+
var VERSION2 = "4.0.457";
|
|
36232
36238
|
|
|
36233
36239
|
// ../web-renderer/dist/esm/index.mjs
|
|
36234
36240
|
import { AudioSample, VideoSample } from "mediabunny";
|
|
@@ -41234,7 +41240,7 @@ var DragAndDropNudge = () => {
|
|
|
41234
41240
|
};
|
|
41235
41241
|
|
|
41236
41242
|
// src/components/homepage/Demo/PlayerSeekBar.tsx
|
|
41237
|
-
import { useCallback as useCallback46, useEffect as useEffect53, useMemo as
|
|
41243
|
+
import { useCallback as useCallback46, useEffect as useEffect53, useMemo as useMemo64, useRef as useRef50, useState as useState51 } from "react";
|
|
41238
41244
|
|
|
41239
41245
|
// src/components/homepage/layout/use-el-size.ts
|
|
41240
41246
|
import { useCallback as useCallback45, useEffect as useEffect51, useMemo as useMemo61, useState as useState50 } from "react";
|
|
@@ -41454,7 +41460,7 @@ var PlayerSeekBar2 = ({
|
|
|
41454
41460
|
body.removeEventListener("pointerup", onPointerUp);
|
|
41455
41461
|
};
|
|
41456
41462
|
}, [dragging.dragging, onPointerMove, onPointerUp]);
|
|
41457
|
-
const knobStyle =
|
|
41463
|
+
const knobStyle = useMemo64(() => {
|
|
41458
41464
|
return {
|
|
41459
41465
|
height: KNOB_SIZE3,
|
|
41460
41466
|
width: KNOB_SIZE3,
|
|
@@ -41468,7 +41474,7 @@ var PlayerSeekBar2 = ({
|
|
|
41468
41474
|
transition: "opacity 0.s ease"
|
|
41469
41475
|
};
|
|
41470
41476
|
}, [barHovered, durationInFrames, frame, width2]);
|
|
41471
|
-
const fillStyle =
|
|
41477
|
+
const fillStyle = useMemo64(() => {
|
|
41472
41478
|
return {
|
|
41473
41479
|
height: BAR_HEIGHT3,
|
|
41474
41480
|
backgroundColor: "var(--ifm-font-color-base)",
|
|
@@ -41477,7 +41483,7 @@ var PlayerSeekBar2 = ({
|
|
|
41477
41483
|
borderRadius: BAR_HEIGHT3 / 2
|
|
41478
41484
|
};
|
|
41479
41485
|
}, [durationInFrames, frame, inFrame]);
|
|
41480
|
-
const active =
|
|
41486
|
+
const active = useMemo64(() => {
|
|
41481
41487
|
return {
|
|
41482
41488
|
height: BAR_HEIGHT3,
|
|
41483
41489
|
backgroundColor: "var(--ifm-font-color-base)",
|
|
@@ -41890,7 +41896,7 @@ var Demo = () => {
|
|
|
41890
41896
|
const updateCardOrder = useCallback49((newCardOrder) => {
|
|
41891
41897
|
setCardOrder(newCardOrder);
|
|
41892
41898
|
}, []);
|
|
41893
|
-
const props =
|
|
41899
|
+
const props = useMemo66(() => {
|
|
41894
41900
|
return {
|
|
41895
41901
|
theme: colorMode,
|
|
41896
41902
|
onToggle: () => {
|
|
@@ -42632,7 +42638,7 @@ var ParameterizeAndEdit = () => {
|
|
|
42632
42638
|
};
|
|
42633
42639
|
|
|
42634
42640
|
// src/components/homepage/RealMp4Videos.tsx
|
|
42635
|
-
import { useEffect as useEffect66, useRef as useRef58, useState as
|
|
42641
|
+
import { useEffect as useEffect66, useRef as useRef58, useState as useState64 } from "react";
|
|
42636
42642
|
import { jsx as jsx126, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
42637
42643
|
var icon4 = {
|
|
42638
42644
|
height: 16,
|
|
@@ -42641,7 +42647,7 @@ var icon4 = {
|
|
|
42641
42647
|
var RealMP4Videos = () => {
|
|
42642
42648
|
const ref = useRef58(null);
|
|
42643
42649
|
const videoRef = useRef58(null);
|
|
42644
|
-
const [vid, setVid] =
|
|
42650
|
+
const [vid, setVid] = useState64("/img/render-progress.webm");
|
|
42645
42651
|
useEffect66(() => {
|
|
42646
42652
|
if (isWebkit()) {
|
|
42647
42653
|
setVid("/img/render-progress.mp4");
|
|
@@ -42893,7 +42899,7 @@ var TrustedByBanner = () => {
|
|
|
42893
42899
|
var TrustedByBanner_default = TrustedByBanner;
|
|
42894
42900
|
|
|
42895
42901
|
// src/components/homepage/VideoAppsShowcase.tsx
|
|
42896
|
-
import { useRef as useRef59, useState as
|
|
42902
|
+
import { useRef as useRef59, useState as useState66 } from "react";
|
|
42897
42903
|
import { jsx as jsx128, jsxs as jsxs49 } from "react/jsx-runtime";
|
|
42898
42904
|
var tabs = [
|
|
42899
42905
|
"Music visualization",
|
|
@@ -42946,10 +42952,10 @@ var icon5 = {
|
|
|
42946
42952
|
marginLeft: 10
|
|
42947
42953
|
};
|
|
42948
42954
|
var VideoAppsShowcase = () => {
|
|
42949
|
-
const [activeTab, setActiveTab] =
|
|
42950
|
-
const [isMuted, setIsMuted] =
|
|
42951
|
-
const [isPlaying, setIsPlaying] =
|
|
42952
|
-
const [videoLoaded, setVideoLoaded] =
|
|
42955
|
+
const [activeTab, setActiveTab] = useState66(0);
|
|
42956
|
+
const [isMuted, setIsMuted] = useState66(true);
|
|
42957
|
+
const [isPlaying, setIsPlaying] = useState66(false);
|
|
42958
|
+
const [videoLoaded, setVideoLoaded] = useState66(false);
|
|
42953
42959
|
const videoRef = useRef59(null);
|
|
42954
42960
|
const containerRef = useRef59(null);
|
|
42955
42961
|
const handleTabChange = (index2) => {
|
|
@@ -44466,7 +44472,7 @@ var ChooseTemplate = () => {
|
|
|
44466
44472
|
};
|
|
44467
44473
|
|
|
44468
44474
|
// src/components/homepage/GetStartedStrip.tsx
|
|
44469
|
-
import { useState as
|
|
44475
|
+
import { useState as useState67 } from "react";
|
|
44470
44476
|
|
|
44471
44477
|
// src/components/homepage/GitHubButton.tsx
|
|
44472
44478
|
import { jsx as jsx164, jsxs as jsxs65 } from "react/jsx-runtime";
|
|
@@ -44492,7 +44498,7 @@ var GithubButton = () => {
|
|
|
44492
44498
|
" ",
|
|
44493
44499
|
/* @__PURE__ */ jsx164("div", {
|
|
44494
44500
|
className: "text-xs inline-block ml-2 leading-none mt-[3px] self-center",
|
|
44495
|
-
children: "
|
|
44501
|
+
children: "45k"
|
|
44496
44502
|
})
|
|
44497
44503
|
]
|
|
44498
44504
|
});
|
|
@@ -44501,7 +44507,7 @@ var GithubButton = () => {
|
|
|
44501
44507
|
// src/components/homepage/GetStartedStrip.tsx
|
|
44502
44508
|
import { jsx as jsx166, jsxs as jsxs66 } from "react/jsx-runtime";
|
|
44503
44509
|
var GetStarted = () => {
|
|
44504
|
-
const [clicked, setClicked] =
|
|
44510
|
+
const [clicked, setClicked] = useState67(null);
|
|
44505
44511
|
return /* @__PURE__ */ jsxs66("div", {
|
|
44506
44512
|
className: "flex flex-col lg:flex-row items-center justify-center text-center w-full",
|
|
44507
44513
|
children: [
|