remotion 4.0.535 → 4.0.536
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/cjs/AbsoluteFill.d.ts +1 -1
- package/dist/cjs/HtmlInCanvas.d.ts +4 -2
- package/dist/cjs/HtmlInCanvas.js +4 -4
- package/dist/cjs/Img.d.ts +4 -2
- package/dist/cjs/Img.js +2 -2
- package/dist/cjs/Interactive.d.ts +21 -7
- package/dist/cjs/Interactive.js +22 -1
- package/dist/cjs/Sequence.js +47 -3
- package/dist/cjs/SequenceActivityBoundary.js +14 -1
- package/dist/cjs/SequenceActivityBudget.js +26 -11
- package/dist/cjs/SequenceActivitySuspensionProvider.d.ts +4 -0
- package/dist/cjs/SequenceActivitySuspensionProvider.js +45 -0
- package/dist/cjs/SequenceManager.d.ts +5 -0
- package/dist/cjs/SequenceManager.js +22 -4
- package/dist/cjs/Track.js +1 -2
- package/dist/cjs/animated-image/AnimatedImage.d.ts +3 -2
- package/dist/cjs/animated-image/AnimatedImage.js +6 -4
- package/dist/cjs/animated-image/canvas.d.ts +2 -1
- package/dist/cjs/animated-image/canvas.js +2 -2
- package/dist/cjs/animated-image/props.d.ts +2 -1
- package/dist/cjs/asset-types.d.ts +4 -0
- package/dist/cjs/audio/shared-audio-tags.d.ts +1 -1
- package/dist/cjs/audio/shared-audio-tags.js +1 -1
- package/dist/cjs/canvas-image/CanvasImage.d.ts +3 -2
- package/dist/cjs/canvas-image/CanvasImage.js +4 -4
- package/dist/cjs/canvas-image/props.d.ts +2 -1
- package/dist/cjs/effects/Solid.d.ts +3 -2
- package/dist/cjs/effects/Solid.js +4 -4
- package/dist/cjs/effects/effect-types.d.ts +4 -0
- package/dist/cjs/effects/index.d.ts +1 -1
- package/dist/cjs/effects/run-effect-chain.d.ts +3 -1
- package/dist/cjs/effects/run-effect-chain.js +94 -56
- package/dist/cjs/effects/use-effect-chain-state.d.ts +2 -1
- package/dist/cjs/effects/use-effect-chain-state.js +11 -2
- package/dist/cjs/index.d.ts +1 -1
- package/dist/cjs/interactivity-schema.d.ts +5 -5
- package/dist/cjs/interactivity-schema.js +2 -1
- package/dist/cjs/internals.d.ts +8 -10
- package/dist/cjs/internals.js +0 -1
- package/dist/cjs/interpolate.js +8 -1
- package/dist/cjs/no-react.d.ts +1 -1
- package/dist/cjs/sequence-activity-context.d.ts +1 -1
- package/dist/cjs/sequence-activity-context.js +4 -3
- package/dist/cjs/sequence-activity-defaults.d.ts +1 -1
- package/dist/cjs/sequence-activity-defaults.js +1 -1
- package/dist/cjs/timeline-track-context.d.ts +0 -1
- package/dist/cjs/timeline-track-context.js +1 -2
- package/dist/cjs/use-schema.js +3 -1
- package/dist/cjs/use-timeline-seek.d.ts +1 -0
- package/dist/cjs/use-timeline-seek.js +10 -0
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/video/seek-until-right.js +11 -7
- package/dist/cjs/wrap-remotion-context.d.ts +0 -1
- package/dist/cjs/wrap-remotion-context.js +1 -4
- package/dist/esm/index.mjs +704 -557
- package/dist/esm/no-react.mjs +4 -3
- package/dist/esm/version.mjs +1 -1
- package/package.json +2 -2
- package/dist/cjs/nonce.d.ts +0 -11
- package/dist/cjs/nonce.js +0 -42
- package/dist/cjs/sequence-order-marker.d.ts +0 -58
- package/dist/cjs/sequence-order-marker.js +0 -44
package/dist/esm/index.mjs
CHANGED
|
@@ -1741,7 +1741,7 @@ var getStackForControls = (controls) => {
|
|
|
1741
1741
|
};
|
|
1742
1742
|
|
|
1743
1743
|
// src/version.ts
|
|
1744
|
-
var VERSION = "4.0.
|
|
1744
|
+
var VERSION = "4.0.536";
|
|
1745
1745
|
|
|
1746
1746
|
// src/multiple-versions-warning.ts
|
|
1747
1747
|
var checkMultipleRemotionVersions = () => {
|
|
@@ -1778,15 +1778,15 @@ var Null = () => {
|
|
|
1778
1778
|
};
|
|
1779
1779
|
|
|
1780
1780
|
// src/Sequence.tsx
|
|
1781
|
-
import {
|
|
1781
|
+
import React26, {
|
|
1782
1782
|
createContext as createContext27,
|
|
1783
1783
|
forwardRef as forwardRef3,
|
|
1784
1784
|
useCallback as useCallback7,
|
|
1785
|
-
useContext as
|
|
1785
|
+
useContext as useContext28,
|
|
1786
1786
|
useLayoutEffect as useLayoutEffect8,
|
|
1787
1787
|
useMemo as useMemo19,
|
|
1788
1788
|
useRef as useRef8,
|
|
1789
|
-
useState as
|
|
1789
|
+
useState as useState9
|
|
1790
1790
|
} from "react";
|
|
1791
1791
|
|
|
1792
1792
|
// src/DefaultPremountContext.ts
|
|
@@ -1811,11 +1811,12 @@ import { createContext as createContext20, useContext as useContext17, useMemo a
|
|
|
1811
1811
|
import { createContext as createContext18, useContext as useContext11 } from "react";
|
|
1812
1812
|
|
|
1813
1813
|
// src/sequence-activity-defaults.ts
|
|
1814
|
-
var DEFAULT_SEQUENCE_ACTIVITY_LIMIT =
|
|
1814
|
+
var DEFAULT_SEQUENCE_ACTIVITY_LIMIT = Infinity;
|
|
1815
1815
|
|
|
1816
1816
|
// src/sequence-activity-context.ts
|
|
1817
1817
|
var SequenceActivityContext = createContext18(false);
|
|
1818
1818
|
var SequenceActivityDormantContext = createContext18(false);
|
|
1819
|
+
var SequenceActivitySuspensionContext = createContext18(false);
|
|
1819
1820
|
var SequenceActivitySettingsContext = createContext18(null);
|
|
1820
1821
|
var SequenceActivityTimelineContext = createContext18(null);
|
|
1821
1822
|
var SequenceActivityAbsoluteTimeContext = createContext18(null);
|
|
@@ -1867,11 +1868,21 @@ var createRuntimeValueStore = (initialSnapshot) => {
|
|
|
1867
1868
|
import { useMemo as useMemo9, useRef as useRef2 } from "react";
|
|
1868
1869
|
var useTimelineSeek = (setFrame) => {
|
|
1869
1870
|
const revision = useRef2(0);
|
|
1871
|
+
const listeners = useRef2(new Set);
|
|
1870
1872
|
return useMemo9(() => ({
|
|
1871
1873
|
revision,
|
|
1872
1874
|
seekFrame: (frame) => {
|
|
1873
1875
|
revision.current++;
|
|
1876
|
+
for (const listener of listeners.current) {
|
|
1877
|
+
listener();
|
|
1878
|
+
}
|
|
1874
1879
|
setFrame(frame);
|
|
1880
|
+
},
|
|
1881
|
+
subscribe: (listener) => {
|
|
1882
|
+
listeners.current.add(listener);
|
|
1883
|
+
return () => {
|
|
1884
|
+
listeners.current.delete(listener);
|
|
1885
|
+
};
|
|
1875
1886
|
}
|
|
1876
1887
|
}), [setFrame]);
|
|
1877
1888
|
};
|
|
@@ -2451,7 +2462,7 @@ var childrenSchema = {
|
|
|
2451
2462
|
var premountSchema = {
|
|
2452
2463
|
premountFor: {
|
|
2453
2464
|
type: "number",
|
|
2454
|
-
default:
|
|
2465
|
+
default: undefined,
|
|
2455
2466
|
description: "Premount For",
|
|
2456
2467
|
min: 0,
|
|
2457
2468
|
step: 1,
|
|
@@ -2765,6 +2776,16 @@ var SequenceOutlineInternals = {
|
|
|
2765
2776
|
// src/SequenceActivityBoundary.tsx
|
|
2766
2777
|
import React18, { useContext as useContext18, useMemo as useMemo12 } from "react";
|
|
2767
2778
|
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
2779
|
+
var suspendedActivity = { then: () => {
|
|
2780
|
+
return;
|
|
2781
|
+
} };
|
|
2782
|
+
var SuspendSequenceActivity = ({ children, dormant }) => {
|
|
2783
|
+
const suspended = useContext18(SequenceActivitySuspensionContext);
|
|
2784
|
+
if (dormant && suspended) {
|
|
2785
|
+
throw suspendedActivity;
|
|
2786
|
+
}
|
|
2787
|
+
return children;
|
|
2788
|
+
};
|
|
2768
2789
|
var areActivityChildrenEqual = (previous, next) => {
|
|
2769
2790
|
if (Object.is(previous, next)) {
|
|
2770
2791
|
return true;
|
|
@@ -2806,7 +2827,10 @@ var SequenceActivityBoundary = ({ children, dormant, frame }) => {
|
|
|
2806
2827
|
value: dormant ? dormantTimeline : absoluteTime,
|
|
2807
2828
|
children: /* @__PURE__ */ jsx12(React18.Activity, {
|
|
2808
2829
|
mode: dormant && !parentDormant ? "hidden" : "visible",
|
|
2809
|
-
children
|
|
2830
|
+
children: /* @__PURE__ */ jsx12(SuspendSequenceActivity, {
|
|
2831
|
+
dormant,
|
|
2832
|
+
children
|
|
2833
|
+
})
|
|
2810
2834
|
})
|
|
2811
2835
|
})
|
|
2812
2836
|
})
|
|
@@ -2825,13 +2849,17 @@ var createActivityBudget = () => {
|
|
|
2825
2849
|
let frame = {};
|
|
2826
2850
|
let limit = DEFAULT_SEQUENCE_ACTIVITY_LIMIT;
|
|
2827
2851
|
let scheduled = false;
|
|
2852
|
+
let suspended = false;
|
|
2828
2853
|
const schedule = () => {
|
|
2829
|
-
if (scheduled) {
|
|
2854
|
+
if (scheduled || suspended) {
|
|
2830
2855
|
return;
|
|
2831
2856
|
}
|
|
2832
2857
|
scheduled = true;
|
|
2833
2858
|
queueMicrotask(() => {
|
|
2834
2859
|
scheduled = false;
|
|
2860
|
+
if (suspended) {
|
|
2861
|
+
return;
|
|
2862
|
+
}
|
|
2835
2863
|
const ranked = [...candidates.values()].filter((candidate) => candidate.end > candidate.from).map((candidate) => {
|
|
2836
2864
|
const currentFrame = frame[candidate.compositionId] ?? 0;
|
|
2837
2865
|
return {
|
|
@@ -2865,6 +2893,12 @@ var createActivityBudget = () => {
|
|
|
2865
2893
|
};
|
|
2866
2894
|
return {
|
|
2867
2895
|
...registry,
|
|
2896
|
+
setSuspended: (next) => {
|
|
2897
|
+
if (suspended !== next) {
|
|
2898
|
+
suspended = next;
|
|
2899
|
+
schedule();
|
|
2900
|
+
}
|
|
2901
|
+
},
|
|
2868
2902
|
setLimit: (next) => {
|
|
2869
2903
|
if (limit !== next) {
|
|
2870
2904
|
limit = next;
|
|
@@ -2892,18 +2926,20 @@ var ActivitySelectionContext = createContext22(emptySelection);
|
|
|
2892
2926
|
var SequenceActivityBudgetProvider = ({ children }) => {
|
|
2893
2927
|
const enabled = useContext19(SequenceActivityContext);
|
|
2894
2928
|
const settings = useContext19(SequenceActivitySettingsContext);
|
|
2929
|
+
const suspended = useContext19(SequenceActivitySuspensionContext);
|
|
2895
2930
|
const limit = settings?.limit ?? DEFAULT_SEQUENCE_ACTIVITY_LIMIT;
|
|
2896
|
-
const admitting = enabled && limit > 0;
|
|
2931
|
+
const admitting = enabled && limit > 0 && limit !== Infinity;
|
|
2897
2932
|
const [budget] = useState4(createActivityBudget);
|
|
2898
|
-
const timeline = useContext19(admitting ? TimelineContext : InactiveTimelineContext);
|
|
2933
|
+
const timeline = useContext19(admitting && !suspended ? TimelineContext : InactiveTimelineContext);
|
|
2899
2934
|
const selected = useSyncExternalStore2(budget.subscribe, budget.getSnapshot, budget.getSnapshot);
|
|
2900
2935
|
const admitted = useMemo13(() => !admitting ? emptySelection : selected.size > limit ? new Set([...selected].slice(0, limit)) : selected, [admitting, limit, selected]);
|
|
2901
2936
|
useCommitEffect(() => {
|
|
2937
|
+
budget.setSuspended(suspended);
|
|
2902
2938
|
budget.setLimit(admitting ? limit : 0);
|
|
2903
2939
|
if (admitting && timeline !== null) {
|
|
2904
2940
|
budget.setFrame(timeline.frame);
|
|
2905
2941
|
}
|
|
2906
|
-
}, [admitting, budget, limit, timeline]);
|
|
2942
|
+
}, [admitting, budget, limit, suspended, timeline]);
|
|
2907
2943
|
return /* @__PURE__ */ jsx13(ActivityBudgetContext.Provider, {
|
|
2908
2944
|
value: admitting ? budget : null,
|
|
2909
2945
|
children: /* @__PURE__ */ jsx13(ActivitySelectionContext.Provider, {
|
|
@@ -2916,7 +2952,7 @@ var useSequenceActivityAdmission = (candidate) => {
|
|
|
2916
2952
|
const budget = useContext19(ActivityBudgetContext);
|
|
2917
2953
|
const enabled = useContext19(SequenceActivityContext);
|
|
2918
2954
|
const settings = useContext19(SequenceActivitySettingsContext);
|
|
2919
|
-
const unlimited = enabled && settings?.limit ===
|
|
2955
|
+
const unlimited = enabled && (settings?.limit ?? DEFAULT_SEQUENCE_ACTIVITY_LIMIT) === Infinity;
|
|
2920
2956
|
const selected = useContext19(ActivitySelectionContext);
|
|
2921
2957
|
const id = candidate?.id ?? null;
|
|
2922
2958
|
const parent = candidate?.parent ?? null;
|
|
@@ -2933,7 +2969,7 @@ var useSequenceActivityAdmission = (candidate) => {
|
|
|
2933
2969
|
};
|
|
2934
2970
|
|
|
2935
2971
|
// src/SequenceManager.tsx
|
|
2936
|
-
import
|
|
2972
|
+
import React23, { useCallback as useCallback6, useContext as useContext23, useMemo as useMemo15, useRef as useRef5, useState as useState7 } from "react";
|
|
2937
2973
|
|
|
2938
2974
|
// src/sequence-registry-context.tsx
|
|
2939
2975
|
import React20, { useContext as useContext20 } from "react";
|
|
@@ -2969,17 +3005,59 @@ var DisableSequenceRegistrationContext = React20.createContext(false);
|
|
|
2969
3005
|
var DisableSequenceRegistrationProvider = ({ children }) => {
|
|
2970
3006
|
return React20.createElement(DisableSequenceRegistrationContext.Provider, { value: true }, children);
|
|
2971
3007
|
};
|
|
2972
|
-
// src/
|
|
2973
|
-
import
|
|
3008
|
+
// src/SequenceActivitySuspensionProvider.tsx
|
|
3009
|
+
import { useContext as useContext21, useEffect as useEffect5, useState as useState5 } from "react";
|
|
2974
3010
|
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
2975
|
-
var
|
|
3011
|
+
var SequenceActivitySuspensionProvider = ({ children }) => {
|
|
3012
|
+
const enabled = useContext21(SequenceActivityContext);
|
|
3013
|
+
const { isPlaying, subscribePlaying, seek } = useContext21(SetTimelineContext);
|
|
3014
|
+
const [suspended, setSuspended] = useState5(false);
|
|
3015
|
+
useEffect5(() => {
|
|
3016
|
+
if (!enabled) {
|
|
3017
|
+
setSuspended(false);
|
|
3018
|
+
return;
|
|
3019
|
+
}
|
|
3020
|
+
let timeout = null;
|
|
3021
|
+
const update = () => {
|
|
3022
|
+
setSuspended(isPlaying() || timeout !== null);
|
|
3023
|
+
};
|
|
3024
|
+
const unsubscribePlaying = subscribePlaying(update);
|
|
3025
|
+
const unsubscribeSeek = seek?.subscribe(() => {
|
|
3026
|
+
setSuspended(true);
|
|
3027
|
+
if (timeout !== null) {
|
|
3028
|
+
clearTimeout(timeout);
|
|
3029
|
+
}
|
|
3030
|
+
timeout = setTimeout(() => {
|
|
3031
|
+
timeout = null;
|
|
3032
|
+
update();
|
|
3033
|
+
}, 150);
|
|
3034
|
+
});
|
|
3035
|
+
update();
|
|
3036
|
+
return () => {
|
|
3037
|
+
unsubscribePlaying();
|
|
3038
|
+
unsubscribeSeek?.();
|
|
3039
|
+
if (timeout !== null) {
|
|
3040
|
+
clearTimeout(timeout);
|
|
3041
|
+
}
|
|
3042
|
+
};
|
|
3043
|
+
}, [enabled, isPlaying, seek, subscribePlaying]);
|
|
3044
|
+
return /* @__PURE__ */ jsx14(SequenceActivitySuspensionContext.Provider, {
|
|
3045
|
+
value: suspended,
|
|
3046
|
+
children
|
|
3047
|
+
});
|
|
3048
|
+
};
|
|
3049
|
+
|
|
3050
|
+
// src/SequenceRegistryProvider.tsx
|
|
3051
|
+
import React22, { useCallback as useCallback5, useContext as useContext22, useMemo as useMemo14, useRef as useRef4, useState as useState6 } from "react";
|
|
3052
|
+
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
3053
|
+
var useIsomorphicLayoutEffect3 = typeof window === "undefined" ? React22.useEffect : React22.useLayoutEffect;
|
|
2976
3054
|
var SequenceManagerRefProvider = withCommittedMetadata(SequenceManagerRefContext.Provider);
|
|
2977
3055
|
var SequenceRegistryProvider = ({ children }) => {
|
|
2978
3056
|
const { isStudio } = useRemotionEnvironment();
|
|
2979
|
-
const sequenceRegistrationEnabled =
|
|
3057
|
+
const sequenceRegistrationEnabled = useContext22(SequenceRegistrationContext);
|
|
2980
3058
|
const shouldObserveCommits = isStudio || sequenceRegistrationEnabled;
|
|
2981
|
-
const [sequenceManagerId] =
|
|
2982
|
-
const [commitRegistrationEnabled, setCommitRegistrationEnabled] =
|
|
3059
|
+
const [sequenceManagerId] = useState6(() => String(Math.random()));
|
|
3060
|
+
const [commitRegistrationEnabled, setCommitRegistrationEnabled] = useState6(() => shouldObserveCommits && isCommitRegistrationObserverInstalled());
|
|
2983
3061
|
const observedCommitRef = useRef4(false);
|
|
2984
3062
|
const rootObservationFailedRef = useRef4(false);
|
|
2985
3063
|
const committedRegistrationIdsRef = useRef4(new Set);
|
|
@@ -2992,7 +3070,7 @@ var SequenceRegistryProvider = ({ children }) => {
|
|
|
2992
3070
|
const registrationUnmountedRef = useRef4(false);
|
|
2993
3071
|
const committedOrderRef = useRef4(null);
|
|
2994
3072
|
const committedOrderIdsRef = useRef4(null);
|
|
2995
|
-
const [registry] =
|
|
3073
|
+
const [registry] = useState6(() => createRegistryStore([]));
|
|
2996
3074
|
const setSequences = registry.setSnapshot;
|
|
2997
3075
|
const sequencesRef = useMemo14(() => ({
|
|
2998
3076
|
get current() {
|
|
@@ -3195,16 +3273,16 @@ var SequenceRegistryProvider = ({ children }) => {
|
|
|
3195
3273
|
sequenceManagerId,
|
|
3196
3274
|
shouldObserveCommits
|
|
3197
3275
|
]);
|
|
3198
|
-
return /* @__PURE__ */
|
|
3276
|
+
return /* @__PURE__ */ jsx15(SequenceManagerRefProvider, {
|
|
3199
3277
|
value: sequencesRef,
|
|
3200
3278
|
_remotionCommitMetadata: metadata,
|
|
3201
|
-
children: /* @__PURE__ */
|
|
3279
|
+
children: /* @__PURE__ */ jsx15(SequenceRegistryScopeContext.Provider, {
|
|
3202
3280
|
value: registryScope,
|
|
3203
|
-
children: /* @__PURE__ */
|
|
3281
|
+
children: /* @__PURE__ */ jsx15(SequenceManagerActionsContext.Provider, {
|
|
3204
3282
|
value: actions,
|
|
3205
|
-
children: /* @__PURE__ */
|
|
3283
|
+
children: /* @__PURE__ */ jsx15(SequenceRegistryContext.Provider, {
|
|
3206
3284
|
value: registry,
|
|
3207
|
-
children: /* @__PURE__ */
|
|
3285
|
+
children: /* @__PURE__ */ jsx15(SequenceCommitRegistrationContext.Provider, {
|
|
3208
3286
|
value: commitRegistrationEnabled,
|
|
3209
3287
|
children
|
|
3210
3288
|
})
|
|
@@ -3215,25 +3293,28 @@ var SequenceRegistryProvider = ({ children }) => {
|
|
|
3215
3293
|
};
|
|
3216
3294
|
|
|
3217
3295
|
// src/SequenceManager.tsx
|
|
3218
|
-
import { jsx as
|
|
3219
|
-
var useIsomorphicLayoutEffect4 = typeof window === "undefined" ?
|
|
3220
|
-
var
|
|
3221
|
-
var
|
|
3296
|
+
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
3297
|
+
var useIsomorphicLayoutEffect4 = typeof window === "undefined" ? React23.useEffect : React23.useLayoutEffect;
|
|
3298
|
+
var useCommitEffect2 = React23.useInsertionEffect ?? useIsomorphicLayoutEffect4;
|
|
3299
|
+
var VisualModeDragOverridesSubscriptionContext = React23.createContext(null);
|
|
3300
|
+
var ActiveFromDragOverrideKeysContext = React23.createContext(null);
|
|
3222
3301
|
var SequenceManagerScopeProviders = ({ children, dragOverridesSubscription, fromKeys }) => {
|
|
3223
3302
|
const { isStudio } = useRemotionEnvironment();
|
|
3224
|
-
const activitySettings =
|
|
3225
|
-
const commitRegistrationEnabled =
|
|
3226
|
-
const manager =
|
|
3303
|
+
const activitySettings = useContext23(SequenceActivitySettingsContext);
|
|
3304
|
+
const commitRegistrationEnabled = useContext23(SequenceCommitRegistrationContext);
|
|
3305
|
+
const manager = useContext23(SequenceManagerActionsContext);
|
|
3227
3306
|
const scopedDragOverridesSubscription = useMemo15(() => ({ ...dragOverridesSubscription, manager }), [dragOverridesSubscription, manager]);
|
|
3228
3307
|
const activeFromDragOverrideKeys = useMemo15(() => ({ manager, keys: fromKeys }), [fromKeys, manager]);
|
|
3229
|
-
return /* @__PURE__ */
|
|
3308
|
+
return /* @__PURE__ */ jsx16(ActiveFromDragOverrideKeysContext.Provider, {
|
|
3230
3309
|
value: activeFromDragOverrideKeys,
|
|
3231
|
-
children: /* @__PURE__ */
|
|
3310
|
+
children: /* @__PURE__ */ jsx16(VisualModeDragOverridesSubscriptionContext.Provider, {
|
|
3232
3311
|
value: scopedDragOverridesSubscription,
|
|
3233
|
-
children: /* @__PURE__ */
|
|
3234
|
-
value: activitySettings?.
|
|
3235
|
-
children: /* @__PURE__ */
|
|
3236
|
-
children
|
|
3312
|
+
children: /* @__PURE__ */ jsx16(SequenceActivityContext.Provider, {
|
|
3313
|
+
value: (activitySettings?.limit ?? DEFAULT_SEQUENCE_ACTIVITY_LIMIT) > 0 && isStudio && commitRegistrationEnabled && typeof React23.Activity !== "undefined",
|
|
3314
|
+
children: /* @__PURE__ */ jsx16(SequenceActivitySuspensionProvider, {
|
|
3315
|
+
children: /* @__PURE__ */ jsx16(SequenceActivityBudgetProvider, {
|
|
3316
|
+
children
|
|
3317
|
+
})
|
|
3237
3318
|
})
|
|
3238
3319
|
})
|
|
3239
3320
|
})
|
|
@@ -3245,10 +3326,10 @@ var emptyEffectDragOverrides = {};
|
|
|
3245
3326
|
var makeSequencePropsSubscriptionKey = (key) => {
|
|
3246
3327
|
return `${key.absolutePath}\x00${key.nodePath.join(".")}\x00${key.sequenceKeys.join(".")}\x00${key.effectKeys.map((keys) => keys.join(".")).join(".")}`;
|
|
3247
3328
|
};
|
|
3248
|
-
var VisualModePropStatusesContext =
|
|
3329
|
+
var VisualModePropStatusesContext = React23.createContext({
|
|
3249
3330
|
propStatuses: {}
|
|
3250
3331
|
});
|
|
3251
|
-
var VisualModePropStatusesRefContext =
|
|
3332
|
+
var VisualModePropStatusesRefContext = React23.createContext({
|
|
3252
3333
|
current: {}
|
|
3253
3334
|
});
|
|
3254
3335
|
var defaultVisualModeDragOverrides = {
|
|
@@ -3259,36 +3340,48 @@ var defaultVisualModeDragOverrides = {
|
|
|
3259
3340
|
throw new Error("VisualModeDragOverridesContext not initialized");
|
|
3260
3341
|
}
|
|
3261
3342
|
};
|
|
3262
|
-
var VisualModeDragOverridesContext =
|
|
3263
|
-
var VisualModeDragOverridesRefContext =
|
|
3343
|
+
var VisualModeDragOverridesContext = React23.createContext(defaultVisualModeDragOverrides);
|
|
3344
|
+
var VisualModeDragOverridesRefContext = React23.createContext({ current: defaultVisualModeDragOverrides });
|
|
3345
|
+
var useDragOverrideSnapshot = (subscribe, getSnapshot) => {
|
|
3346
|
+
const dormant = useContext23(SequenceActivityDormantContext);
|
|
3347
|
+
const [, forceUpdate] = useState7(0);
|
|
3348
|
+
const snapshot = useSyncExternalStore2(subscribe, getSnapshot, getSnapshot);
|
|
3349
|
+
useCommitEffect2(() => {
|
|
3350
|
+
if (!dormant) {
|
|
3351
|
+
return;
|
|
3352
|
+
}
|
|
3353
|
+
return subscribe(() => forceUpdate((current) => current + 1));
|
|
3354
|
+
}, [dormant, subscribe]);
|
|
3355
|
+
return snapshot;
|
|
3356
|
+
};
|
|
3264
3357
|
var useDragOverridesForNodePath = (nodePath) => {
|
|
3265
|
-
const subscription =
|
|
3266
|
-
const manager =
|
|
3358
|
+
const subscription = useContext23(VisualModeDragOverridesSubscriptionContext);
|
|
3359
|
+
const manager = useContext23(SequenceManagerActionsContext);
|
|
3267
3360
|
const scopedSubscription = subscription?.manager === manager ? subscription : null;
|
|
3268
3361
|
const key = nodePath === null ? null : makeSequencePropsSubscriptionKey(nodePath);
|
|
3269
3362
|
const subscribe = useCallback6((listener) => scopedSubscription?.subscribe(key, listener) ?? (() => {
|
|
3270
3363
|
return;
|
|
3271
3364
|
}), [key, scopedSubscription]);
|
|
3272
3365
|
const getSnapshot = useCallback6(() => scopedSubscription?.getSnapshot(key) ?? emptyDragOverrides, [key, scopedSubscription]);
|
|
3273
|
-
return
|
|
3366
|
+
return useDragOverrideSnapshot(subscribe, getSnapshot);
|
|
3274
3367
|
};
|
|
3275
3368
|
var useActiveFromDragOverrideKeys = () => {
|
|
3276
|
-
const snapshot =
|
|
3277
|
-
const manager =
|
|
3369
|
+
const snapshot = useContext23(ActiveFromDragOverrideKeysContext);
|
|
3370
|
+
const manager = useContext23(SequenceManagerActionsContext);
|
|
3278
3371
|
return snapshot?.manager === manager ? snapshot.keys : emptyFromOverrideKeys;
|
|
3279
3372
|
};
|
|
3280
3373
|
var useEffectDragOverridesForNodePath = (nodePath) => {
|
|
3281
|
-
const subscription =
|
|
3282
|
-
const manager =
|
|
3374
|
+
const subscription = useContext23(VisualModeDragOverridesSubscriptionContext);
|
|
3375
|
+
const manager = useContext23(SequenceManagerActionsContext);
|
|
3283
3376
|
const scopedSubscription = subscription?.manager === manager ? subscription : null;
|
|
3284
3377
|
const key = nodePath === null ? null : makeSequencePropsSubscriptionKey(nodePath);
|
|
3285
3378
|
const subscribe = useCallback6((listener) => scopedSubscription?.subscribeEffects(key, listener) ?? (() => {
|
|
3286
3379
|
return;
|
|
3287
3380
|
}), [key, scopedSubscription]);
|
|
3288
3381
|
const getSnapshot = useCallback6(() => scopedSubscription?.getEffectSnapshot(key) ?? emptyEffectDragOverrides, [key, scopedSubscription]);
|
|
3289
|
-
return
|
|
3382
|
+
return useDragOverrideSnapshot(subscribe, getSnapshot);
|
|
3290
3383
|
};
|
|
3291
|
-
var VisualModeSettersContext =
|
|
3384
|
+
var VisualModeSettersContext = React23.createContext({
|
|
3292
3385
|
setDragOverrides: () => {
|
|
3293
3386
|
throw new Error("VisualModeSettersContext not initialized");
|
|
3294
3387
|
},
|
|
@@ -3308,10 +3401,10 @@ var VisualModeSettersContext = React22.createContext({
|
|
|
3308
3401
|
throw new Error("VisualModeSettersContext not initialized");
|
|
3309
3402
|
}
|
|
3310
3403
|
});
|
|
3311
|
-
var VisualModeBatchSettersContext =
|
|
3404
|
+
var VisualModeBatchSettersContext = React23.createContext(null);
|
|
3312
3405
|
var effectDragOverridesKey = (nodePath, effectIndex) => `${makeSequencePropsSubscriptionKey(nodePath)}.effects.${effectIndex}`;
|
|
3313
3406
|
var SequenceManagerProvider = ({ children }) => {
|
|
3314
|
-
const [dragOverrideState, setDragOverrideState] =
|
|
3407
|
+
const [dragOverrideState, setDragOverrideState] = useState7(() => ({
|
|
3315
3408
|
overrides: {},
|
|
3316
3409
|
fromKeys: new Set
|
|
3317
3410
|
}));
|
|
@@ -3320,13 +3413,13 @@ var SequenceManagerProvider = ({ children }) => {
|
|
|
3320
3413
|
snapshot: dragOverrides,
|
|
3321
3414
|
listeners: new Map
|
|
3322
3415
|
});
|
|
3323
|
-
const [effectDragOverridesState, setEffectDragOverridesState] =
|
|
3416
|
+
const [effectDragOverridesState, setEffectDragOverridesState] = useState7({});
|
|
3324
3417
|
const effectDragOverridesStore = useRef5({
|
|
3325
3418
|
snapshot: effectDragOverridesState,
|
|
3326
3419
|
byNode: new Map,
|
|
3327
3420
|
listeners: new Map
|
|
3328
3421
|
});
|
|
3329
|
-
const [propStatuses, setPropStatusesMapState] =
|
|
3422
|
+
const [propStatuses, setPropStatusesMapState] = useState7({});
|
|
3330
3423
|
const propStatusesRef = useRef5(propStatuses);
|
|
3331
3424
|
useIsomorphicLayoutEffect4(() => {
|
|
3332
3425
|
propStatusesRef.current = propStatuses;
|
|
@@ -3578,21 +3671,21 @@ var SequenceManagerProvider = ({ children }) => {
|
|
|
3578
3671
|
remapPropStatuses
|
|
3579
3672
|
]);
|
|
3580
3673
|
const batchSettersContext = useMemo15(() => ({ setDragOverridesBatch, setEffectDragOverridesBatch }), [setDragOverridesBatch, setEffectDragOverridesBatch]);
|
|
3581
|
-
return /* @__PURE__ */
|
|
3582
|
-
children: /* @__PURE__ */
|
|
3674
|
+
return /* @__PURE__ */ jsx16(SequenceRegistryProvider, {
|
|
3675
|
+
children: /* @__PURE__ */ jsx16(VisualModePropStatusesRefContext.Provider, {
|
|
3583
3676
|
value: propStatusesRef,
|
|
3584
|
-
children: /* @__PURE__ */
|
|
3677
|
+
children: /* @__PURE__ */ jsx16(VisualModePropStatusesContext.Provider, {
|
|
3585
3678
|
value: propStatusesContext,
|
|
3586
|
-
children: /* @__PURE__ */
|
|
3679
|
+
children: /* @__PURE__ */ jsx16(SequenceManagerScopeProviders, {
|
|
3587
3680
|
dragOverridesSubscription,
|
|
3588
3681
|
fromKeys: dragOverrideState.fromKeys,
|
|
3589
|
-
children: /* @__PURE__ */
|
|
3682
|
+
children: /* @__PURE__ */ jsx16(VisualModeDragOverridesContext.Provider, {
|
|
3590
3683
|
value: dragOverridesContext,
|
|
3591
|
-
children: /* @__PURE__ */
|
|
3684
|
+
children: /* @__PURE__ */ jsx16(VisualModeDragOverridesRefContext.Provider, {
|
|
3592
3685
|
value: dragOverridesRef,
|
|
3593
|
-
children: /* @__PURE__ */
|
|
3686
|
+
children: /* @__PURE__ */ jsx16(VisualModeSettersContext.Provider, {
|
|
3594
3687
|
value: settersContext,
|
|
3595
|
-
children: /* @__PURE__ */
|
|
3688
|
+
children: /* @__PURE__ */ jsx16(VisualModeBatchSettersContext.Provider, {
|
|
3596
3689
|
value: batchSettersContext,
|
|
3597
3690
|
children
|
|
3598
3691
|
})
|
|
@@ -3608,10 +3701,9 @@ var SequenceManagerProvider = ({ children }) => {
|
|
|
3608
3701
|
// src/timeline-track-context.ts
|
|
3609
3702
|
import { createContext as createContext23 } from "react";
|
|
3610
3703
|
var TimelineTrackContext = createContext23(null);
|
|
3611
|
-
var ExperimentalTracksEnabledContext = createContext23(false);
|
|
3612
3704
|
|
|
3613
3705
|
// src/use-premounting.ts
|
|
3614
|
-
import { useContext as
|
|
3706
|
+
import { useContext as useContext24, useMemo as useMemo16 } from "react";
|
|
3615
3707
|
|
|
3616
3708
|
// src/PremountContext.tsx
|
|
3617
3709
|
import { createContext as createContext24 } from "react";
|
|
@@ -3630,15 +3722,15 @@ var usePremounting = ({
|
|
|
3630
3722
|
styleWhilePostmounted,
|
|
3631
3723
|
hideWhilePremounted
|
|
3632
3724
|
}) => {
|
|
3633
|
-
const parentPremountContext =
|
|
3725
|
+
const parentPremountContext = useContext24(PremountContext);
|
|
3634
3726
|
const frame = useCurrentFrame() - parentPremountContext.premountFramesRemaining;
|
|
3635
3727
|
const environment = useRemotionEnvironment();
|
|
3636
3728
|
const { fps } = useVideoConfig();
|
|
3637
|
-
const defaultPremountInSeconds =
|
|
3729
|
+
const defaultPremountInSeconds = useContext24(DefaultPremountContext);
|
|
3638
3730
|
const effectivePremountFor = premountFor ?? Math.round(defaultPremountInSeconds * fps);
|
|
3639
3731
|
const effectivePostmountFor = postmountFor ?? 0;
|
|
3640
3732
|
const endExclusive = from + durationInFrames;
|
|
3641
|
-
const sequenceContext =
|
|
3733
|
+
const sequenceContext = useContext24(SequenceContext);
|
|
3642
3734
|
const boundaryTolerance = getSequenceBoundaryTolerance({
|
|
3643
3735
|
absoluteFrame: useTimelinePosition(),
|
|
3644
3736
|
cumulatedFrom: sequenceContext ? sequenceContext.cumulatedFrom + sequenceContext.relativeFrom : 0,
|
|
@@ -3682,15 +3774,15 @@ var usePremounting = ({
|
|
|
3682
3774
|
};
|
|
3683
3775
|
|
|
3684
3776
|
// src/use-sequence-registration.ts
|
|
3685
|
-
import { useContext as
|
|
3686
|
-
var useIsomorphicLayoutEffect5 = typeof window === "undefined" ?
|
|
3777
|
+
import { useContext as useContext25, useEffect as useEffect6, useLayoutEffect as useLayoutEffect5, useMemo as useMemo17, useRef as useRef6 } from "react";
|
|
3778
|
+
var useIsomorphicLayoutEffect5 = typeof window === "undefined" ? useEffect6 : useLayoutEffect5;
|
|
3687
3779
|
var useSequenceRegistration = ({
|
|
3688
3780
|
getSequence,
|
|
3689
3781
|
id
|
|
3690
3782
|
}) => {
|
|
3691
|
-
const { registerSequence, unregisterSequence, updateSequence } =
|
|
3692
|
-
const registrationDisabled =
|
|
3693
|
-
const commitRegistrationEnabled =
|
|
3783
|
+
const { registerSequence, unregisterSequence, updateSequence } = useContext25(SequenceManagerActionsContext);
|
|
3784
|
+
const registrationDisabled = useContext25(DisableSequenceRegistrationContext);
|
|
3785
|
+
const commitRegistrationEnabled = useContext25(SequenceCommitRegistrationContext);
|
|
3694
3786
|
const getSequenceRef = useRef6(getSequence);
|
|
3695
3787
|
useIsomorphicLayoutEffect5(() => {
|
|
3696
3788
|
getSequenceRef.current = getSequence;
|
|
@@ -3698,7 +3790,7 @@ var useSequenceRegistration = ({
|
|
|
3698
3790
|
const lastRegisteredGetterRef = useRef6(null);
|
|
3699
3791
|
const registrationEnabled = getSequence !== null && !registrationDisabled && !commitRegistrationEnabled;
|
|
3700
3792
|
const registration = useMemo17(() => commitRegistrationEnabled && !registrationDisabled && getSequence !== null ? getSequence() : null, [commitRegistrationEnabled, getSequence, registrationDisabled]);
|
|
3701
|
-
|
|
3793
|
+
useEffect6(() => {
|
|
3702
3794
|
if (!registrationEnabled) {
|
|
3703
3795
|
return;
|
|
3704
3796
|
}
|
|
@@ -3729,13 +3821,13 @@ var useSequenceRegistration = ({
|
|
|
3729
3821
|
};
|
|
3730
3822
|
|
|
3731
3823
|
// src/with-interactivity-schema.ts
|
|
3732
|
-
import
|
|
3824
|
+
import React25, {
|
|
3733
3825
|
createContext as createContext26,
|
|
3734
3826
|
forwardRef as forwardRef2,
|
|
3735
|
-
useContext as
|
|
3827
|
+
useContext as useContext27,
|
|
3736
3828
|
useLayoutEffect as useLayoutEffect7,
|
|
3737
3829
|
useMemo as useMemo18,
|
|
3738
|
-
useState as
|
|
3830
|
+
useState as useState8
|
|
3739
3831
|
} from "react";
|
|
3740
3832
|
|
|
3741
3833
|
// src/delete-nested-key.ts
|
|
@@ -3772,7 +3864,7 @@ var deleteNestedKey = (obj, keysToRemove) => {
|
|
|
3772
3864
|
};
|
|
3773
3865
|
|
|
3774
3866
|
// src/effects/use-memoized-effects.ts
|
|
3775
|
-
import
|
|
3867
|
+
import React24, { useContext as useContext26, useLayoutEffect as useLayoutEffect6, useRef as useRef7 } from "react";
|
|
3776
3868
|
|
|
3777
3869
|
// src/evaluate-source-expressions.ts
|
|
3778
3870
|
var evaluateSourceNumericValue = (expression, config) => {
|
|
@@ -4224,7 +4316,8 @@ var parseStringInterpolationValue = (output, outputType) => {
|
|
|
4224
4316
|
}
|
|
4225
4317
|
const parts = output.trim().split(/\s+/);
|
|
4226
4318
|
if (parts.length < 1 || parts.length > 3 || parts[0] === "") {
|
|
4227
|
-
|
|
4319
|
+
const ErrorType = outputType === undefined && parts.some((part) => !cssNumberRegex.test(part) && !transformOriginKeywords.has(part.toLowerCase())) ? UnsupportedStringInterpolationValueError : TypeError;
|
|
4320
|
+
throw new ErrorType(`String outputRange values must contain 1 to 3 components, but got "${output}"`);
|
|
4228
4321
|
}
|
|
4229
4322
|
if (parts.some((part) => transformOriginKeywords.has(part.toLowerCase()))) {
|
|
4230
4323
|
if (outputType !== undefined) {
|
|
@@ -5889,7 +5982,7 @@ var OverrideIdsToNodePathsSettersContext = createContext25({
|
|
|
5889
5982
|
|
|
5890
5983
|
// src/effects/use-memoized-effects.ts
|
|
5891
5984
|
var emptyDragOverrides2 = {};
|
|
5892
|
-
var useCacheCommitEffect =
|
|
5985
|
+
var useCacheCommitEffect = React24.useInsertionEffect ?? useLayoutEffect6;
|
|
5893
5986
|
var mergeOverrides = ({
|
|
5894
5987
|
descriptor,
|
|
5895
5988
|
propStatusOverrides,
|
|
@@ -5952,7 +6045,7 @@ var resolvePropStatusOverrides = (propStatus, frame) => {
|
|
|
5952
6045
|
return hasAny ? out : null;
|
|
5953
6046
|
};
|
|
5954
6047
|
var useMemoizedEffectDefinitions = (effects) => {
|
|
5955
|
-
const activityDormant =
|
|
6048
|
+
const activityDormant = useContext26(SequenceActivityDormantContext);
|
|
5956
6049
|
const previousRef = useRef7(null);
|
|
5957
6050
|
const definitions = effects.map((descriptor) => descriptor.definition);
|
|
5958
6051
|
const previous = previousRef.current;
|
|
@@ -6038,9 +6131,9 @@ var useMemoizedEffects = ({
|
|
|
6038
6131
|
videoConfigValues
|
|
6039
6132
|
}) => {
|
|
6040
6133
|
const previousRef = useRef7(null);
|
|
6041
|
-
const { propStatuses } =
|
|
6134
|
+
const { propStatuses } = useContext26(VisualModePropStatusesContext);
|
|
6042
6135
|
const frame = useCurrentFrame();
|
|
6043
|
-
const { overrideIdToNodePathMappings } =
|
|
6136
|
+
const { overrideIdToNodePathMappings } = useContext26(OverrideIdsToNodePathsGettersContext);
|
|
6044
6137
|
const previous = previousRef.current;
|
|
6045
6138
|
const nodePath = overrideId ? overrideIdToNodePathMappings[overrideId] ?? null : null;
|
|
6046
6139
|
const effectDragOverrides = useEffectDragOverridesForNodePath(nodePath);
|
|
@@ -6358,7 +6451,7 @@ var computeEffectiveSchemaValuesDotNotation = ({
|
|
|
6358
6451
|
});
|
|
6359
6452
|
value = dragOverride.type === "resolved" ? dragOverride.value : currentValue[key];
|
|
6360
6453
|
} else if (isKeyframedStatus(status)) {
|
|
6361
|
-
if (field?.type === "array"
|
|
6454
|
+
if (field?.type === "array") {
|
|
6362
6455
|
value = currentValue[key];
|
|
6363
6456
|
} else {
|
|
6364
6457
|
const dragOverride = resolveDragOverrideValue({
|
|
@@ -6480,11 +6573,11 @@ var mergeValues = ({
|
|
|
6480
6573
|
};
|
|
6481
6574
|
var DisableInteractivityContext = createContext26(false);
|
|
6482
6575
|
var DisableInteractivityProvider = ({ children }) => {
|
|
6483
|
-
return
|
|
6576
|
+
return React25.createElement(DisableInteractivityContext.Provider, { value: true }, children);
|
|
6484
6577
|
};
|
|
6485
6578
|
var EnableInteractivityContext = createContext26(false);
|
|
6486
6579
|
var EnableInteractivityProvider = ({ children }) => {
|
|
6487
|
-
return
|
|
6580
|
+
return React25.createElement(EnableInteractivityContext.Provider, { value: true }, children);
|
|
6488
6581
|
};
|
|
6489
6582
|
var withInteractivitySchema = ({
|
|
6490
6583
|
Component,
|
|
@@ -6505,18 +6598,18 @@ var withInteractivitySchema = ({
|
|
|
6505
6598
|
const cleanProps = propsWithoutInternalStack;
|
|
6506
6599
|
const env = useRemotionEnvironment();
|
|
6507
6600
|
const pendingDeletions = usePendingSequenceDeletions();
|
|
6508
|
-
const canUseRemotionHooks =
|
|
6509
|
-
const disableInteractivity =
|
|
6510
|
-
const enableInteractivity =
|
|
6601
|
+
const canUseRemotionHooks = useContext27(CanUseRemotionHooks);
|
|
6602
|
+
const disableInteractivity = useContext27(DisableInteractivityContext);
|
|
6603
|
+
const enableInteractivity = useContext27(EnableInteractivityContext);
|
|
6511
6604
|
if (!env.isStudio && !enableInteractivity || env.isRendering || !canUseRemotionHooks || disableInteractivity) {
|
|
6512
|
-
return
|
|
6605
|
+
return React25.createElement(Component, {
|
|
6513
6606
|
...cleanProps,
|
|
6514
6607
|
controls: null,
|
|
6515
6608
|
ref
|
|
6516
6609
|
});
|
|
6517
6610
|
}
|
|
6518
|
-
const { propStatuses } =
|
|
6519
|
-
const nodePathMapping =
|
|
6611
|
+
const { propStatuses } = useContext27(VisualModePropStatusesContext);
|
|
6612
|
+
const nodePathMapping = useContext27(OverrideIdsToNodePathsGettersContext);
|
|
6520
6613
|
const frame = useCurrentFrame();
|
|
6521
6614
|
const videoConfig = useUnsafeVideoConfig();
|
|
6522
6615
|
const durationInFrames = videoConfig?.durationInFrames;
|
|
@@ -6539,13 +6632,13 @@ var withInteractivitySchema = ({
|
|
|
6539
6632
|
return controlsWithStack;
|
|
6540
6633
|
}, [internalStack, passedControls]);
|
|
6541
6634
|
if (resolvedPassedControls) {
|
|
6542
|
-
return
|
|
6635
|
+
return React25.createElement(Component, {
|
|
6543
6636
|
...cleanProps,
|
|
6544
6637
|
controls: resolvedPassedControls,
|
|
6545
6638
|
ref
|
|
6546
6639
|
});
|
|
6547
6640
|
}
|
|
6548
|
-
const [overrideId] =
|
|
6641
|
+
const [overrideId] = useState8(() => {
|
|
6549
6642
|
if (!internalStack) {
|
|
6550
6643
|
return String(Math.random());
|
|
6551
6644
|
}
|
|
@@ -6565,7 +6658,7 @@ var withInteractivitySchema = ({
|
|
|
6565
6658
|
props: cleanProps
|
|
6566
6659
|
}));
|
|
6567
6660
|
const currentRuntimeValueDotNotation = useMemo18(() => readValuesFromProps(cleanProps, flatKeys, flatSchema), runtimeValues);
|
|
6568
|
-
const [runtimeValueStore] =
|
|
6661
|
+
const [runtimeValueStore] = useState8(() => createRuntimeValueStore(currentRuntimeValueDotNotation));
|
|
6569
6662
|
useLayoutEffect7(() => {
|
|
6570
6663
|
runtimeValueStore.setSnapshot(currentRuntimeValueDotNotation);
|
|
6571
6664
|
}, [currentRuntimeValueDotNotation, runtimeValueStore]);
|
|
@@ -6622,7 +6715,7 @@ var withInteractivitySchema = ({
|
|
|
6622
6715
|
if (OptimisticSequenceDeletion.isDeleted(nodePath, pendingDeletions)) {
|
|
6623
6716
|
return null;
|
|
6624
6717
|
}
|
|
6625
|
-
return
|
|
6718
|
+
return React25.createElement(Component, {
|
|
6626
6719
|
...mergedProps,
|
|
6627
6720
|
controls,
|
|
6628
6721
|
ref
|
|
@@ -6633,7 +6726,7 @@ var withInteractivitySchema = ({
|
|
|
6633
6726
|
};
|
|
6634
6727
|
|
|
6635
6728
|
// src/Sequence.tsx
|
|
6636
|
-
import { jsx as
|
|
6729
|
+
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
6637
6730
|
var SeriesContentVisibilityContext = createContext27(true);
|
|
6638
6731
|
var SequenceContextProvider = withCommittedMetadata(SequenceContext.Provider);
|
|
6639
6732
|
var EMPTY_EFFECTS = [];
|
|
@@ -6667,13 +6760,15 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
6667
6760
|
...other
|
|
6668
6761
|
}, ref) => {
|
|
6669
6762
|
const { layout = "absolute-fill" } = other;
|
|
6670
|
-
const [id] =
|
|
6671
|
-
const parentSequence =
|
|
6672
|
-
const activityRequested =
|
|
6673
|
-
const parentDormant =
|
|
6763
|
+
const [id] = useState9(() => String(Math.random()));
|
|
6764
|
+
const parentSequence = useContext28(SequenceContext);
|
|
6765
|
+
const activityRequested = useContext28(SequenceActivityContext);
|
|
6766
|
+
const parentDormant = useContext28(SequenceActivityDormantContext);
|
|
6767
|
+
const activitySuspended = useContext28(SequenceActivitySuspensionContext);
|
|
6768
|
+
const hadActivity = useRef8(false);
|
|
6674
6769
|
const env = useRemotionEnvironment();
|
|
6675
6770
|
const activityEnabled = activityRequested && env.isStudio && !env.isRendering;
|
|
6676
|
-
const timelineTrack =
|
|
6771
|
+
const timelineTrack = useContext28(TimelineTrackContext);
|
|
6677
6772
|
const timelineTrackRole = timelineTrackItem?.role ?? "clip";
|
|
6678
6773
|
const seriesOffset = timelineTrackItem?.seriesOffset ?? null;
|
|
6679
6774
|
const parentPlaybackRate = parentSequence?.playbackRate ?? 1;
|
|
@@ -6777,8 +6872,8 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
6777
6872
|
const relativeFrom = effectiveRelativeFrom / parentPlaybackRate;
|
|
6778
6873
|
const absoluteFrom = (parentSequence?.absoluteFrom ?? 0) + relativeFrom;
|
|
6779
6874
|
const localClockEnd = loopPeriod === null ? actualDurationInFrames * playbackRate + trimBefore : Math.min(loopPeriod, actualDurationInFrames - loopOffset) * playbackRate + trimBefore;
|
|
6780
|
-
const sequenceRegistrationEnabled =
|
|
6781
|
-
const canvasOutlinesEnabled =
|
|
6875
|
+
const sequenceRegistrationEnabled = useContext28(SequenceRegistrationContext);
|
|
6876
|
+
const canvasOutlinesEnabled = useContext28(SequenceOutlineContext);
|
|
6782
6877
|
const shouldDiscoverOutline = env.isStudio || canvasOutlinesEnabled;
|
|
6783
6878
|
const automaticOutlineRef = useMemo19(() => shouldDiscoverOutline && layout === "none" ? SequenceOutlineInternals.createRef() : null, [shouldDiscoverOutline, layout]);
|
|
6784
6879
|
const wrapperRefForOutline = useRef8(null);
|
|
@@ -6850,7 +6945,7 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
6850
6945
|
return name ?? "";
|
|
6851
6946
|
}, [name]);
|
|
6852
6947
|
const resolvedDocumentationLink = documentationLink ?? "https://www.remotion.dev/docs/sequence";
|
|
6853
|
-
const isInsideSeries =
|
|
6948
|
+
const isInsideSeries = useContext28(IsInsideSeriesContext);
|
|
6854
6949
|
const singleChildComponent = useMemo19(() => childComponentOverride === undefined ? getSingleChildComponent(children) : childComponentOverride, [children, childComponentOverride]);
|
|
6855
6950
|
const registrationStack = controls ? getStackForControls(controls) ?? stack ?? null : stack ?? null;
|
|
6856
6951
|
const getStack = useCallback7(() => registrationStack, [registrationStack]);
|
|
@@ -6877,7 +6972,7 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
6877
6972
|
const canInferDuration = (controlsComponentIdentity === "dev.remotion.remotion.Series" || controlsComponentIdentity === "dev.remotion.transitions.TransitionSeries") && !loop && registeredFrozenFrame === null && !isInsideNonPremountFreeze && !hidden;
|
|
6878
6973
|
const autoDuration = canInferDuration && durationInFrames === undefined;
|
|
6879
6974
|
const isSeriesChild = controlsComponentIdentity === "dev.remotion.remotion.Series.Sequence" || controlsComponentIdentity === "dev.remotion.transitions.TransitionSeries.Sequence" || controlsComponentIdentity === "dev.remotion.transitions.TransitionSeries.Transition" || controlsComponentIdentity === "dev.remotion.transitions.TransitionSeries.Overlay";
|
|
6880
|
-
const seriesContentVisible =
|
|
6975
|
+
const seriesContentVisible = useContext28(SeriesContentVisibilityContext);
|
|
6881
6976
|
const effectRuntimeValues = useMemo19(() => _remotionInternalEffects?.runtimeValues ?? null, [_remotionInternalEffects]);
|
|
6882
6977
|
const registrationControls = useMemo19(() => {
|
|
6883
6978
|
if (controlsSchema === undefined || controlsRuntimeValues === undefined || controlsOverrideId === undefined || controlsSupportsEffects === undefined || controlsComponentIdentity === undefined || controlsComponentName === undefined || controlsVideoConfigValues === undefined) {
|
|
@@ -7056,13 +7151,17 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
7056
7151
|
from: firstFrame,
|
|
7057
7152
|
end: cumulatedFrom + (from + actualDurationInFrames) / parentPlaybackRate
|
|
7058
7153
|
} : null);
|
|
7059
|
-
const renderActivity = activityEnabled && (!activityDormant || admitted);
|
|
7154
|
+
const renderActivity = activityEnabled && (!activityDormant || admitted || activitySuspended && hadActivity.current);
|
|
7155
|
+
const useCommitEffect = React26.useInsertionEffect ?? useLayoutEffect8;
|
|
7156
|
+
useCommitEffect(() => {
|
|
7157
|
+
hadActivity.current = renderActivity;
|
|
7158
|
+
}, [renderActivity]);
|
|
7060
7159
|
const content = (activityEnabled ? renderActivity : contentVisible) ? children : null;
|
|
7061
|
-
const frozenContent = content === null || typeof freeze === "undefined" || freeze === null ? content : /* @__PURE__ */
|
|
7160
|
+
const frozenContent = content === null || typeof freeze === "undefined" || freeze === null ? content : /* @__PURE__ */ jsx17(Freeze, {
|
|
7062
7161
|
frame: freeze,
|
|
7063
7162
|
children: content
|
|
7064
7163
|
});
|
|
7065
|
-
const loopedContent = frozenContent === null || loopContextValue === null ? frozenContent : /* @__PURE__ */
|
|
7164
|
+
const loopedContent = frozenContent === null || loopContextValue === null ? frozenContent : /* @__PURE__ */ jsx17(LoopContext.Provider, {
|
|
7066
7165
|
value: loopContextValue,
|
|
7067
7166
|
children: frozenContent
|
|
7068
7167
|
});
|
|
@@ -7103,37 +7202,37 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
7103
7202
|
outlineChildrenRef: automaticOutlineRef
|
|
7104
7203
|
} : null, [automaticOutlineRef, id, registration, shouldDiscoverOutline]);
|
|
7105
7204
|
if (hidden) {
|
|
7106
|
-
return shouldDiscoverOutline || registration !== null ? /* @__PURE__ */
|
|
7205
|
+
return shouldDiscoverOutline || registration !== null ? /* @__PURE__ */ jsx17(SequenceContextProvider, {
|
|
7107
7206
|
value: contextValue,
|
|
7108
7207
|
_remotionCommitMetadata: metadata,
|
|
7109
7208
|
children: null
|
|
7110
7209
|
}) : null;
|
|
7111
7210
|
}
|
|
7112
7211
|
const retainSeriesRegistration = env.isStudio && canInferDuration;
|
|
7113
|
-
const contentForLayout = renderActivity ? /* @__PURE__ */
|
|
7212
|
+
const contentForLayout = renderActivity ? /* @__PURE__ */ jsx17(SequenceActivityContent, {
|
|
7114
7213
|
dormant: activityDormant,
|
|
7115
7214
|
children: loopedContent
|
|
7116
7215
|
}) : loopedContent;
|
|
7117
|
-
const renderedContent = loopedContent === null ? retainSeriesRegistration ? children : null : other.layout === "none" ? contentForLayout : /* @__PURE__ */
|
|
7216
|
+
const renderedContent = loopedContent === null ? retainSeriesRegistration ? children : null : other.layout === "none" ? contentForLayout : /* @__PURE__ */ jsx17(AbsoluteFillElement, {
|
|
7118
7217
|
ref: sequenceRef,
|
|
7119
7218
|
style: defaultStyle,
|
|
7120
7219
|
className: other.className,
|
|
7121
7220
|
children: contentForLayout
|
|
7122
7221
|
});
|
|
7123
|
-
const activityContent = renderActivity ? /* @__PURE__ */
|
|
7222
|
+
const activityContent = renderActivity ? /* @__PURE__ */ jsx17(SequenceActivityBoundary, {
|
|
7124
7223
|
dormant: activityDormant,
|
|
7125
7224
|
frame: firstFrame,
|
|
7126
7225
|
children: renderedContent
|
|
7127
7226
|
}) : renderedContent;
|
|
7128
|
-
const sequenceContent = /* @__PURE__ */
|
|
7227
|
+
const sequenceContent = /* @__PURE__ */ jsx17(SequenceContextProvider, {
|
|
7129
7228
|
value: contextValue,
|
|
7130
7229
|
_remotionCommitMetadata: metadata,
|
|
7131
|
-
children: retainSeriesRegistration ? /* @__PURE__ */
|
|
7230
|
+
children: retainSeriesRegistration ? /* @__PURE__ */ jsx17(SeriesContentVisibilityContext.Provider, {
|
|
7132
7231
|
value: renderActivity || contentVisible,
|
|
7133
7232
|
children: activityContent
|
|
7134
7233
|
}) : activityContent
|
|
7135
7234
|
});
|
|
7136
|
-
const sequence = /* @__PURE__ */
|
|
7235
|
+
const sequence = /* @__PURE__ */ jsx17(TimelineTrackContext.Provider, {
|
|
7137
7236
|
value: timelineTrackRole === "track" || timelineTrackRole === "clip" && !showInTimeline ? timelineTrack : null,
|
|
7138
7237
|
children: sequenceContent
|
|
7139
7238
|
});
|
|
@@ -7174,11 +7273,11 @@ var PremountedPostmountedSequenceRefForwardingFunction = (props, ref) => {
|
|
|
7174
7273
|
styleWhilePostmounted: styleWhilePostmounted ?? null,
|
|
7175
7274
|
hideWhilePremounted: "opacity"
|
|
7176
7275
|
});
|
|
7177
|
-
return /* @__PURE__ */
|
|
7276
|
+
return /* @__PURE__ */ jsx17(Freeze, {
|
|
7178
7277
|
frame: freezeFrame,
|
|
7179
7278
|
active: isPremountingOrPostmounting,
|
|
7180
7279
|
_remotionInternalIsPremounting: premountingActive,
|
|
7181
|
-
children: /* @__PURE__ */
|
|
7280
|
+
children: /* @__PURE__ */ jsx17(RegularSequence, {
|
|
7182
7281
|
ref,
|
|
7183
7282
|
from,
|
|
7184
7283
|
durationInFrames,
|
|
@@ -7195,18 +7294,18 @@ var PremountedPostmountedSequence = forwardRef3(PremountedPostmountedSequenceRef
|
|
|
7195
7294
|
var SequenceRefForwardingFunction = (props, ref) => {
|
|
7196
7295
|
const env = useRemotionEnvironment();
|
|
7197
7296
|
const { fps } = useVideoConfig();
|
|
7198
|
-
const defaultPremountInSeconds =
|
|
7297
|
+
const defaultPremountInSeconds = useContext28(DefaultPremountContext);
|
|
7199
7298
|
if (props.layout !== "none" && !env.isRendering) {
|
|
7200
7299
|
const effectivePremountFor = props.premountFor ?? Math.round(defaultPremountInSeconds * fps);
|
|
7201
7300
|
if (effectivePremountFor || props.postmountFor) {
|
|
7202
|
-
return /* @__PURE__ */
|
|
7301
|
+
return /* @__PURE__ */ jsx17(PremountedPostmountedSequence, {
|
|
7203
7302
|
ref,
|
|
7204
7303
|
...props,
|
|
7205
7304
|
premountFor: effectivePremountFor
|
|
7206
7305
|
});
|
|
7207
7306
|
}
|
|
7208
7307
|
}
|
|
7209
|
-
return /* @__PURE__ */
|
|
7308
|
+
return /* @__PURE__ */ jsx17(RegularSequence, {
|
|
7210
7309
|
...props,
|
|
7211
7310
|
ref
|
|
7212
7311
|
});
|
|
@@ -7230,7 +7329,7 @@ var SequenceWithoutFrom = withInteractivitySchema({
|
|
|
7230
7329
|
|
|
7231
7330
|
// src/AbsoluteFill.tsx
|
|
7232
7331
|
import { useCallback as useCallback8 } from "react";
|
|
7233
|
-
import { jsx as
|
|
7332
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
7234
7333
|
var absoluteFillSchema = {
|
|
7235
7334
|
...baseSchema,
|
|
7236
7335
|
...premountSchema,
|
|
@@ -7290,11 +7389,11 @@ var AbsoluteFillWithTiming = ({
|
|
|
7290
7389
|
styleWhilePostmounted: styleWhilePostmounted ?? null,
|
|
7291
7390
|
hideWhilePremounted: "opacity"
|
|
7292
7391
|
});
|
|
7293
|
-
return /* @__PURE__ */
|
|
7392
|
+
return /* @__PURE__ */ jsx18(Freeze, {
|
|
7294
7393
|
frame: freezeFrame,
|
|
7295
7394
|
active: isPremountingOrPostmounting,
|
|
7296
7395
|
_remotionInternalIsPremounting: premountingActive,
|
|
7297
|
-
children: /* @__PURE__ */
|
|
7396
|
+
children: /* @__PURE__ */ jsx18(Sequence, {
|
|
7298
7397
|
layout: "none",
|
|
7299
7398
|
from: from ?? 0,
|
|
7300
7399
|
trimBefore,
|
|
@@ -7312,7 +7411,7 @@ var AbsoluteFillWithTiming = ({
|
|
|
7312
7411
|
_remotionInternalPostmountDisplay: effectivePostmountFor || null,
|
|
7313
7412
|
_remotionInternalIsPremounting: premountingActive,
|
|
7314
7413
|
_remotionInternalIsPostmounting: postmountingActive,
|
|
7315
|
-
children: /* @__PURE__ */
|
|
7414
|
+
children: /* @__PURE__ */ jsx18(AbsoluteFillElement, {
|
|
7316
7415
|
ref: callbackRef,
|
|
7317
7416
|
...divProps,
|
|
7318
7417
|
style: premountingStyle ?? undefined,
|
|
@@ -7346,13 +7445,13 @@ var AbsoluteFillInner = ({
|
|
|
7346
7445
|
setRef(ref, element);
|
|
7347
7446
|
}, [ref]);
|
|
7348
7447
|
if (videoConfig === null) {
|
|
7349
|
-
return hidden ? null : /* @__PURE__ */
|
|
7448
|
+
return hidden ? null : /* @__PURE__ */ jsx18(AbsoluteFillElement, {
|
|
7350
7449
|
ref: callbackRef,
|
|
7351
7450
|
...divProps,
|
|
7352
7451
|
children
|
|
7353
7452
|
});
|
|
7354
7453
|
}
|
|
7355
|
-
return /* @__PURE__ */
|
|
7454
|
+
return /* @__PURE__ */ jsx18(AbsoluteFillWithTiming, {
|
|
7356
7455
|
...divProps,
|
|
7357
7456
|
ref: callbackRef,
|
|
7358
7457
|
from,
|
|
@@ -7384,11 +7483,11 @@ addSequenceStackTraces(AbsoluteFill);
|
|
|
7384
7483
|
// src/animated-image/AnimatedImage.tsx
|
|
7385
7484
|
import {
|
|
7386
7485
|
forwardRef as forwardRef4,
|
|
7387
|
-
useEffect as
|
|
7486
|
+
useEffect as useEffect8,
|
|
7388
7487
|
useImperativeHandle as useImperativeHandle2,
|
|
7389
7488
|
useLayoutEffect as useLayoutEffect9,
|
|
7390
7489
|
useRef as useRef11,
|
|
7391
|
-
useState as
|
|
7490
|
+
useState as useState10
|
|
7392
7491
|
} from "react";
|
|
7393
7492
|
|
|
7394
7493
|
// src/use-crop-style.ts
|
|
@@ -7415,7 +7514,7 @@ var useCropStyle = ({
|
|
|
7415
7514
|
};
|
|
7416
7515
|
|
|
7417
7516
|
// src/animated-image/canvas.tsx
|
|
7418
|
-
import
|
|
7517
|
+
import React28, { useCallback as useCallback9, useImperativeHandle, useMemo as useMemo22, useRef as useRef10 } from "react";
|
|
7419
7518
|
|
|
7420
7519
|
// src/calculate-image-fit.ts
|
|
7421
7520
|
var calculateImageFit = (fit, imageSize, canvasSize) => {
|
|
@@ -7626,6 +7725,8 @@ var getGpuDevice = () => {
|
|
|
7626
7725
|
// src/effects/run-effect-chain.ts
|
|
7627
7726
|
var createEffectChainState = (width, height) => {
|
|
7628
7727
|
const state = {
|
|
7728
|
+
width,
|
|
7729
|
+
height,
|
|
7629
7730
|
pool: new CanvasPool(width, height, (canvas) => {
|
|
7630
7731
|
const dead = state.cleanupRegistry.filter((entry) => entry.target === canvas);
|
|
7631
7732
|
state.cleanupRegistry = state.cleanupRegistry.filter((entry) => entry.target !== canvas);
|
|
@@ -7668,15 +7769,7 @@ var ensureSetup = (state, def, target) => {
|
|
|
7668
7769
|
state.cleanupRegistry.push({ definition: widened, state: setupState, target });
|
|
7669
7770
|
return setupState;
|
|
7670
7771
|
};
|
|
7671
|
-
var
|
|
7672
|
-
state,
|
|
7673
|
-
source,
|
|
7674
|
-
effects,
|
|
7675
|
-
output,
|
|
7676
|
-
width,
|
|
7677
|
-
height
|
|
7678
|
-
}) => {
|
|
7679
|
-
const runId = ++state.currentRunId;
|
|
7772
|
+
var runEffectChainWithoutResize = async ({ state, source, effects, output, width, height }, initialFlipSourceY, runId) => {
|
|
7680
7773
|
const isCancelled = () => state.currentRunId !== runId;
|
|
7681
7774
|
const enabledEffects = effects.filter((e) => !e.params.disabled);
|
|
7682
7775
|
const runs = groupByBackend(enabledEffects);
|
|
@@ -7705,51 +7798,57 @@ var runEffectChain = async ({
|
|
|
7705
7798
|
if (isCancelled()) {
|
|
7706
7799
|
return false;
|
|
7707
7800
|
}
|
|
7708
|
-
let flipWebGLSourceY =
|
|
7709
|
-
|
|
7710
|
-
|
|
7711
|
-
let
|
|
7712
|
-
|
|
7713
|
-
|
|
7714
|
-
const
|
|
7715
|
-
|
|
7716
|
-
|
|
7717
|
-
|
|
7718
|
-
|
|
7719
|
-
def.apply({
|
|
7720
|
-
source: currentImage,
|
|
7721
|
-
target: dst,
|
|
7722
|
-
state: setupState,
|
|
7723
|
-
params: eff.params,
|
|
7724
|
-
width,
|
|
7725
|
-
height,
|
|
7726
|
-
gpuDevice,
|
|
7727
|
-
flipSourceY: run.backend === "webgl2" ? flipWebGLSourceY : false
|
|
7728
|
-
});
|
|
7729
|
-
if (run.backend === "webgl2") {
|
|
7730
|
-
flipWebGLSourceY = true;
|
|
7731
|
-
}
|
|
7732
|
-
currentImage = dst;
|
|
7733
|
-
canvasIndex = canvasIndex === 0 ? 1 : 0;
|
|
7734
|
-
}
|
|
7735
|
-
lastTarget = currentImage ?? lastTarget;
|
|
7736
|
-
const nextRun = runs[runIndex + 1];
|
|
7737
|
-
if (nextRun && nextRun.backend !== run.backend && lastTarget) {
|
|
7738
|
-
if (run.backend === "2d" && nextRun.backend === "webgl2") {
|
|
7739
|
-
currentImage = lastTarget;
|
|
7740
|
-
flipWebGLSourceY = true;
|
|
7741
|
-
} else {
|
|
7742
|
-
const bitmap = await createImageBitmap(lastTarget);
|
|
7743
|
-
if (isCancelled()) {
|
|
7744
|
-
bitmap.close();
|
|
7745
|
-
return false;
|
|
7801
|
+
let flipWebGLSourceY = initialFlipSourceY;
|
|
7802
|
+
let bridgeBitmap = null;
|
|
7803
|
+
try {
|
|
7804
|
+
for (let runIndex = 0;runIndex < runs.length; runIndex++) {
|
|
7805
|
+
const run = runs[runIndex];
|
|
7806
|
+
let canvasIndex = 0;
|
|
7807
|
+
for (const eff of run.effects) {
|
|
7808
|
+
const dst = state.pool.getCanvas(run.backend, canvasIndex);
|
|
7809
|
+
const def = eff.definition;
|
|
7810
|
+
if (run.backend === "webgl2") {
|
|
7811
|
+
state.pool.assertContextNotLost(dst);
|
|
7746
7812
|
}
|
|
7747
|
-
|
|
7748
|
-
|
|
7749
|
-
|
|
7813
|
+
const setupState = ensureSetup(state, def, dst);
|
|
7814
|
+
def.apply({
|
|
7815
|
+
source: currentImage,
|
|
7816
|
+
target: dst,
|
|
7817
|
+
state: setupState,
|
|
7818
|
+
params: eff.params,
|
|
7819
|
+
width: state.width,
|
|
7820
|
+
height: state.height,
|
|
7821
|
+
gpuDevice,
|
|
7822
|
+
flipSourceY: run.backend === "webgl2" ? flipWebGLSourceY : false
|
|
7823
|
+
});
|
|
7824
|
+
bridgeBitmap?.close();
|
|
7825
|
+
bridgeBitmap = null;
|
|
7826
|
+
if (run.backend === "webgl2") {
|
|
7827
|
+
flipWebGLSourceY = true;
|
|
7828
|
+
}
|
|
7829
|
+
currentImage = dst;
|
|
7830
|
+
canvasIndex = canvasIndex === 0 ? 1 : 0;
|
|
7831
|
+
}
|
|
7832
|
+
lastTarget = currentImage ?? lastTarget;
|
|
7833
|
+
const nextRun = runs[runIndex + 1];
|
|
7834
|
+
if (nextRun && nextRun.backend !== run.backend && lastTarget) {
|
|
7835
|
+
if (run.backend === "2d" && nextRun.backend === "webgl2") {
|
|
7836
|
+
currentImage = lastTarget;
|
|
7837
|
+
flipWebGLSourceY = true;
|
|
7838
|
+
} else {
|
|
7839
|
+
bridgeBitmap = await createImageBitmap(lastTarget);
|
|
7840
|
+
if (isCancelled()) {
|
|
7841
|
+
return false;
|
|
7842
|
+
}
|
|
7843
|
+
currentImage = bridgeBitmap;
|
|
7844
|
+
if (nextRun.backend === "webgl2") {
|
|
7845
|
+
flipWebGLSourceY = false;
|
|
7846
|
+
}
|
|
7750
7847
|
}
|
|
7751
7848
|
}
|
|
7752
7849
|
}
|
|
7850
|
+
} finally {
|
|
7851
|
+
bridgeBitmap?.close();
|
|
7753
7852
|
}
|
|
7754
7853
|
if (!lastTarget) {
|
|
7755
7854
|
return true;
|
|
@@ -7762,14 +7861,41 @@ var runEffectChain = async ({
|
|
|
7762
7861
|
outCtx.drawImage(lastTarget, 0, 0, width, height);
|
|
7763
7862
|
return true;
|
|
7764
7863
|
};
|
|
7864
|
+
var runEffectChain = async (options) => {
|
|
7865
|
+
const { state, source, width, height, effects } = options;
|
|
7866
|
+
const runId = ++state.currentRunId;
|
|
7867
|
+
if (state.width === width && state.height === height || !effects.some((effect) => !effect.params.disabled)) {
|
|
7868
|
+
return runEffectChainWithoutResize(options, true, runId);
|
|
7869
|
+
}
|
|
7870
|
+
const firstEnabledEffect = effects.find((effect) => !effect.params.disabled);
|
|
7871
|
+
const resized = await createImageBitmap(source, {
|
|
7872
|
+
resizeWidth: state.width,
|
|
7873
|
+
resizeHeight: state.height,
|
|
7874
|
+
imageOrientation: firstEnabledEffect.definition.backend === "webgl2" ? "flipY" : "none"
|
|
7875
|
+
});
|
|
7876
|
+
try {
|
|
7877
|
+
if (state.currentRunId !== runId) {
|
|
7878
|
+
return false;
|
|
7879
|
+
}
|
|
7880
|
+
return await runEffectChainWithoutResize({ ...options, source: resized }, false, runId);
|
|
7881
|
+
} finally {
|
|
7882
|
+
resized.close();
|
|
7883
|
+
}
|
|
7884
|
+
};
|
|
7765
7885
|
|
|
7766
7886
|
// src/effects/use-effect-chain-state.ts
|
|
7767
|
-
import { useEffect as
|
|
7768
|
-
var useEffectChainState = () => {
|
|
7887
|
+
import { useEffect as useEffect7, useMemo as useMemo21, useRef as useRef9 } from "react";
|
|
7888
|
+
var useEffectChainState = (effectsOutputSize = null) => {
|
|
7889
|
+
const effectWidth = effectsOutputSize?.width;
|
|
7890
|
+
const effectHeight = effectsOutputSize?.height;
|
|
7891
|
+
if (effectsOutputSize) {
|
|
7892
|
+
validateDimension(effectWidth, "effectsOutputSize.width", "on an effect-capable component");
|
|
7893
|
+
validateDimension(effectHeight, "effectsOutputSize.height", "on an effect-capable component");
|
|
7894
|
+
}
|
|
7769
7895
|
const chainStateRef = useRef9(null);
|
|
7770
7896
|
const sizeRef = useRef9(null);
|
|
7771
7897
|
const unmountedRef = useRef9(false);
|
|
7772
|
-
|
|
7898
|
+
useEffect7(() => {
|
|
7773
7899
|
unmountedRef.current = false;
|
|
7774
7900
|
return () => {
|
|
7775
7901
|
unmountedRef.current = true;
|
|
@@ -7782,6 +7908,8 @@ var useEffectChainState = () => {
|
|
|
7782
7908
|
}, []);
|
|
7783
7909
|
return useMemo21(() => ({
|
|
7784
7910
|
get: (width, height) => {
|
|
7911
|
+
width = effectWidth ?? width;
|
|
7912
|
+
height = effectHeight ?? height;
|
|
7785
7913
|
if (unmountedRef.current) {
|
|
7786
7914
|
return null;
|
|
7787
7915
|
}
|
|
@@ -7794,14 +7922,14 @@ var useEffectChainState = () => {
|
|
|
7794
7922
|
}
|
|
7795
7923
|
return chainStateRef.current;
|
|
7796
7924
|
}
|
|
7797
|
-
}), []);
|
|
7925
|
+
}), [effectWidth, effectHeight]);
|
|
7798
7926
|
};
|
|
7799
7927
|
|
|
7800
7928
|
// src/animated-image/canvas.tsx
|
|
7801
|
-
import { jsx as
|
|
7802
|
-
var CanvasRefForwardingFunction = ({ width, height, fit, className, style, effects, ...props }, ref) => {
|
|
7929
|
+
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
7930
|
+
var CanvasRefForwardingFunction = ({ width, height, fit, className, style, effects, effectsOutputSize, ...props }, ref) => {
|
|
7803
7931
|
const canvasRef = useRef10(null);
|
|
7804
|
-
const chainState = useEffectChainState();
|
|
7932
|
+
const chainState = useEffectChainState(effectsOutputSize);
|
|
7805
7933
|
const sourceCanvas = useMemo22(() => {
|
|
7806
7934
|
if (typeof document === "undefined") {
|
|
7807
7935
|
return null;
|
|
@@ -7860,14 +7988,14 @@ var CanvasRefForwardingFunction = ({ width, height, fit, className, style, effec
|
|
|
7860
7988
|
}
|
|
7861
7989
|
};
|
|
7862
7990
|
}, [draw]);
|
|
7863
|
-
return /* @__PURE__ */
|
|
7991
|
+
return /* @__PURE__ */ jsx19("canvas", {
|
|
7864
7992
|
ref: canvasRef,
|
|
7865
7993
|
className,
|
|
7866
7994
|
style,
|
|
7867
7995
|
...props
|
|
7868
7996
|
});
|
|
7869
7997
|
};
|
|
7870
|
-
var Canvas =
|
|
7998
|
+
var Canvas = React28.forwardRef(CanvasRefForwardingFunction);
|
|
7871
7999
|
|
|
7872
8000
|
// src/animated-image/create-image-decoder.ts
|
|
7873
8001
|
var createImageDecoder = async ({
|
|
@@ -8099,7 +8227,7 @@ var resolveAnimatedImageSource = (src) => {
|
|
|
8099
8227
|
};
|
|
8100
8228
|
|
|
8101
8229
|
// src/animated-image/AnimatedImage.tsx
|
|
8102
|
-
import { jsx as
|
|
8230
|
+
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
8103
8231
|
import { createElement } from "react";
|
|
8104
8232
|
var animatedImageSchema = {
|
|
8105
8233
|
src: {
|
|
@@ -8138,11 +8266,12 @@ var AnimatedImageContent = forwardRef4(({
|
|
|
8138
8266
|
fit = "fill",
|
|
8139
8267
|
requestInit,
|
|
8140
8268
|
effects,
|
|
8269
|
+
effectsOutputSize,
|
|
8141
8270
|
controls,
|
|
8142
8271
|
...props
|
|
8143
8272
|
}, canvasRef) => {
|
|
8144
8273
|
const resolvedSrc = resolveAnimatedImageSource(src);
|
|
8145
|
-
const [decodedImage, setDecodedImage] =
|
|
8274
|
+
const [decodedImage, setDecodedImage] = useState10(null);
|
|
8146
8275
|
const imageDecoder = decodedImage?.decoder ?? null;
|
|
8147
8276
|
const { delayRender, continueRender, cancelRender } = useDelayRender();
|
|
8148
8277
|
const frame = useCurrentFrame();
|
|
@@ -8166,7 +8295,7 @@ var AnimatedImageContent = forwardRef4(({
|
|
|
8166
8295
|
}
|
|
8167
8296
|
return c;
|
|
8168
8297
|
}, []);
|
|
8169
|
-
const [initialLoopBehavior] =
|
|
8298
|
+
const [initialLoopBehavior] = useState10(() => loopBehavior);
|
|
8170
8299
|
useLayoutEffect9(() => {
|
|
8171
8300
|
const decodeHandle = delayRender(`Rendering <AnimatedImage/> with src="${resolvedSrc}"`);
|
|
8172
8301
|
const controller = new AbortController;
|
|
@@ -8220,7 +8349,7 @@ var AnimatedImageContent = forwardRef4(({
|
|
|
8220
8349
|
delayRender,
|
|
8221
8350
|
cancelRender
|
|
8222
8351
|
]);
|
|
8223
|
-
|
|
8352
|
+
useEffect8(() => {
|
|
8224
8353
|
return () => {
|
|
8225
8354
|
imageDecoder?.close();
|
|
8226
8355
|
};
|
|
@@ -8273,14 +8402,17 @@ var AnimatedImageContent = forwardRef4(({
|
|
|
8273
8402
|
fit,
|
|
8274
8403
|
width,
|
|
8275
8404
|
height,
|
|
8276
|
-
cancelRender
|
|
8405
|
+
cancelRender,
|
|
8406
|
+
effectsOutputSize?.width,
|
|
8407
|
+
effectsOutputSize?.height
|
|
8277
8408
|
]);
|
|
8278
|
-
return /* @__PURE__ */
|
|
8409
|
+
return /* @__PURE__ */ jsx20(Canvas, {
|
|
8279
8410
|
ref,
|
|
8280
8411
|
width,
|
|
8281
8412
|
height,
|
|
8282
8413
|
fit,
|
|
8283
8414
|
effects: memoizedEffects,
|
|
8415
|
+
effectsOutputSize: effectsOutputSize ?? null,
|
|
8284
8416
|
...props
|
|
8285
8417
|
});
|
|
8286
8418
|
});
|
|
@@ -8308,6 +8440,7 @@ var AnimatedImageInner = ({
|
|
|
8308
8440
|
cropBottom,
|
|
8309
8441
|
requestInit,
|
|
8310
8442
|
effects = [],
|
|
8443
|
+
effectsOutputSize,
|
|
8311
8444
|
controls,
|
|
8312
8445
|
ref,
|
|
8313
8446
|
...sequenceProps
|
|
@@ -8361,11 +8494,11 @@ var AnimatedImageInner = ({
|
|
|
8361
8494
|
requestInit,
|
|
8362
8495
|
...canvasProps
|
|
8363
8496
|
};
|
|
8364
|
-
return /* @__PURE__ */
|
|
8497
|
+
return /* @__PURE__ */ jsx20(Freeze, {
|
|
8365
8498
|
frame: freezeFrame,
|
|
8366
8499
|
active: isPremountingOrPostmounting,
|
|
8367
8500
|
_remotionInternalIsPremounting: premountingActive,
|
|
8368
|
-
children: /* @__PURE__ */
|
|
8501
|
+
children: /* @__PURE__ */ jsx20(Sequence, {
|
|
8369
8502
|
layout: "none",
|
|
8370
8503
|
from: from ?? 0,
|
|
8371
8504
|
playbackRate,
|
|
@@ -8379,11 +8512,12 @@ var AnimatedImageInner = ({
|
|
|
8379
8512
|
_remotionInternalIsPremounting: premountingActive,
|
|
8380
8513
|
_remotionInternalIsPostmounting: postmountingActive,
|
|
8381
8514
|
...sequenceProps,
|
|
8382
|
-
children: /* @__PURE__ */
|
|
8383
|
-
children: /* @__PURE__ */
|
|
8515
|
+
children: /* @__PURE__ */ jsx20(SequenceContent, {
|
|
8516
|
+
children: /* @__PURE__ */ jsx20(AnimatedImageContent, {
|
|
8384
8517
|
...animatedImageProps,
|
|
8385
8518
|
ref: actualRef,
|
|
8386
8519
|
effects,
|
|
8520
|
+
effectsOutputSize: effectsOutputSize ?? null,
|
|
8387
8521
|
controls
|
|
8388
8522
|
})
|
|
8389
8523
|
})
|
|
@@ -8398,8 +8532,8 @@ var AnimatedImageWithIntrinsicDuration = (props) => {
|
|
|
8398
8532
|
requestInitRef.current = requestInit;
|
|
8399
8533
|
const onErrorRef = useRef11(props.onError);
|
|
8400
8534
|
onErrorRef.current = props.onError;
|
|
8401
|
-
const [duration, setDuration] =
|
|
8402
|
-
const [failedHandle, setFailedHandle] =
|
|
8535
|
+
const [duration, setDuration] = useState10(null);
|
|
8536
|
+
const [failedHandle, setFailedHandle] = useState10(null);
|
|
8403
8537
|
useLayoutEffect9(() => {
|
|
8404
8538
|
const handle = delayRender(`Finding duration of <AnimatedImage src="${src}" />`);
|
|
8405
8539
|
const controller = new AbortController;
|
|
@@ -8444,7 +8578,7 @@ var AnimatedImageWithIntrinsicDuration = (props) => {
|
|
|
8444
8578
|
if (duration === null || failedHandle !== null) {
|
|
8445
8579
|
return null;
|
|
8446
8580
|
}
|
|
8447
|
-
return /* @__PURE__ */
|
|
8581
|
+
return /* @__PURE__ */ jsx20(AnimatedImageInner, {
|
|
8448
8582
|
...props,
|
|
8449
8583
|
durationInFrames: duration.durationInFrames
|
|
8450
8584
|
});
|
|
@@ -8458,7 +8592,7 @@ var AnimatedImageComponent = (props) => {
|
|
|
8458
8592
|
key: `${resolvedSrc}-${requestInitKey}-${props.trimBefore ?? 0}`
|
|
8459
8593
|
});
|
|
8460
8594
|
}
|
|
8461
|
-
return /* @__PURE__ */
|
|
8595
|
+
return /* @__PURE__ */ jsx20(AnimatedImageInner, {
|
|
8462
8596
|
...props
|
|
8463
8597
|
});
|
|
8464
8598
|
};
|
|
@@ -8503,7 +8637,7 @@ var createEffect = (definition) => {
|
|
|
8503
8637
|
return factory;
|
|
8504
8638
|
};
|
|
8505
8639
|
// src/Artifact.tsx
|
|
8506
|
-
import { useContext as
|
|
8640
|
+
import { useContext as useContext29, useLayoutEffect as useLayoutEffect11, useState as useState12 } from "react";
|
|
8507
8641
|
|
|
8508
8642
|
// src/RenderAssetManager.tsx
|
|
8509
8643
|
import {
|
|
@@ -8513,7 +8647,7 @@ import {
|
|
|
8513
8647
|
useLayoutEffect as useLayoutEffect10,
|
|
8514
8648
|
useMemo as useMemo23,
|
|
8515
8649
|
useRef as useRef12,
|
|
8516
|
-
useState as
|
|
8650
|
+
useState as useState11
|
|
8517
8651
|
} from "react";
|
|
8518
8652
|
|
|
8519
8653
|
// src/validation/validate-artifact.ts
|
|
@@ -8548,7 +8682,7 @@ var validateRenderAsset = (artifact) => {
|
|
|
8548
8682
|
};
|
|
8549
8683
|
|
|
8550
8684
|
// src/RenderAssetManager.tsx
|
|
8551
|
-
import { jsx as
|
|
8685
|
+
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
8552
8686
|
var RenderAssetManager = createContext28({
|
|
8553
8687
|
registerRenderAsset: () => {
|
|
8554
8688
|
return;
|
|
@@ -8559,7 +8693,7 @@ var RenderAssetManager = createContext28({
|
|
|
8559
8693
|
renderAssets: []
|
|
8560
8694
|
});
|
|
8561
8695
|
var RenderAssetManagerProvider = ({ children, collectAssets }) => {
|
|
8562
|
-
const [renderAssets, setRenderAssets] =
|
|
8696
|
+
const [renderAssets, setRenderAssets] = useState11([]);
|
|
8563
8697
|
const renderAssetsRef = useRef12([]);
|
|
8564
8698
|
const registerRenderAsset = useCallback10((renderAsset) => {
|
|
8565
8699
|
validateRenderAsset(renderAsset);
|
|
@@ -8599,7 +8733,7 @@ var RenderAssetManagerProvider = ({ children, collectAssets }) => {
|
|
|
8599
8733
|
renderAssets
|
|
8600
8734
|
};
|
|
8601
8735
|
}, [renderAssets, registerRenderAsset, unregisterRenderAsset]);
|
|
8602
|
-
return /* @__PURE__ */
|
|
8736
|
+
return /* @__PURE__ */ jsx21(RenderAssetManager.Provider, {
|
|
8603
8737
|
value: contextValue,
|
|
8604
8738
|
children
|
|
8605
8739
|
});
|
|
@@ -8608,10 +8742,10 @@ var RenderAssetManagerProvider = ({ children, collectAssets }) => {
|
|
|
8608
8742
|
// src/Artifact.tsx
|
|
8609
8743
|
var ArtifactThumbnail = Symbol("Thumbnail");
|
|
8610
8744
|
var Artifact = ({ filename, content, downloadBehavior }) => {
|
|
8611
|
-
const { registerRenderAsset, unregisterRenderAsset } =
|
|
8745
|
+
const { registerRenderAsset, unregisterRenderAsset } = useContext29(RenderAssetManager);
|
|
8612
8746
|
const env = useRemotionEnvironment();
|
|
8613
8747
|
const frame = useCurrentFrame();
|
|
8614
|
-
const [id] =
|
|
8748
|
+
const [id] = useState12(() => {
|
|
8615
8749
|
return String(Math.random());
|
|
8616
8750
|
});
|
|
8617
8751
|
useLayoutEffect11(() => {
|
|
@@ -8665,7 +8799,7 @@ var Artifact = ({ filename, content, downloadBehavior }) => {
|
|
|
8665
8799
|
};
|
|
8666
8800
|
Artifact.Thumbnail = ArtifactThumbnail;
|
|
8667
8801
|
// src/audio/html5-audio.tsx
|
|
8668
|
-
import { forwardRef as forwardRef7, useCallback as useCallback17, useContext as
|
|
8802
|
+
import { forwardRef as forwardRef7, useCallback as useCallback17, useContext as useContext44 } from "react";
|
|
8669
8803
|
|
|
8670
8804
|
// src/absolute-src.ts
|
|
8671
8805
|
var getAbsoluteSrc = (relativeSrc) => {
|
|
@@ -8707,11 +8841,11 @@ var getMediaTrimAfter = ({
|
|
|
8707
8841
|
};
|
|
8708
8842
|
|
|
8709
8843
|
// src/loop/index.tsx
|
|
8710
|
-
import
|
|
8711
|
-
import { jsx as
|
|
8844
|
+
import React29, { createContext as createContext29, useContext as useContext30, useMemo as useMemo24 } from "react";
|
|
8845
|
+
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
8712
8846
|
var LoopTimelineContext = createContext29(null);
|
|
8713
8847
|
var useLoop = () => {
|
|
8714
|
-
return
|
|
8848
|
+
return React29.useContext(LoopContext);
|
|
8715
8849
|
};
|
|
8716
8850
|
var Loop = ({
|
|
8717
8851
|
durationInFrames,
|
|
@@ -8724,7 +8858,7 @@ var Loop = ({
|
|
|
8724
8858
|
}) => {
|
|
8725
8859
|
const currentFrame = useCurrentFrame();
|
|
8726
8860
|
const { durationInFrames: compDuration } = useVideoConfig();
|
|
8727
|
-
const parentSequence =
|
|
8861
|
+
const parentSequence = useContext30(SequenceContext);
|
|
8728
8862
|
const parentPlaybackRate = parentSequence?.playbackRate ?? 1;
|
|
8729
8863
|
const playbackRateValue = playbackRate ?? 1;
|
|
8730
8864
|
const iterationDurationInFrames = durationInFrames / playbackRateValue;
|
|
@@ -8775,11 +8909,11 @@ var Loop = ({
|
|
|
8775
8909
|
if (actualTimes === 0) {
|
|
8776
8910
|
return null;
|
|
8777
8911
|
}
|
|
8778
|
-
return /* @__PURE__ */
|
|
8912
|
+
return /* @__PURE__ */ jsx22(LoopTimelineContext.Provider, {
|
|
8779
8913
|
value: timelineContext,
|
|
8780
|
-
children: /* @__PURE__ */
|
|
8914
|
+
children: /* @__PURE__ */ jsx22(LoopContext.Provider, {
|
|
8781
8915
|
value: loopContext,
|
|
8782
|
-
children: /* @__PURE__ */
|
|
8916
|
+
children: /* @__PURE__ */ jsx22(Sequence, {
|
|
8783
8917
|
durationInFrames,
|
|
8784
8918
|
from,
|
|
8785
8919
|
name: name ?? "<Loop>",
|
|
@@ -8796,7 +8930,7 @@ var Loop = ({
|
|
|
8796
8930
|
Loop.useLoop = useLoop;
|
|
8797
8931
|
|
|
8798
8932
|
// src/prefetch.ts
|
|
8799
|
-
import { useContext as
|
|
8933
|
+
import { useContext as useContext31 } from "react";
|
|
8800
8934
|
|
|
8801
8935
|
// src/playback-logging.ts
|
|
8802
8936
|
var playbackLogging = ({
|
|
@@ -8810,8 +8944,8 @@ var playbackLogging = ({
|
|
|
8810
8944
|
};
|
|
8811
8945
|
|
|
8812
8946
|
// src/prefetch-state.tsx
|
|
8813
|
-
import { createContext as createContext30, useEffect as
|
|
8814
|
-
import { jsx as
|
|
8947
|
+
import { createContext as createContext30, useEffect as useEffect9, useState as useState13 } from "react";
|
|
8948
|
+
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
8815
8949
|
var PreloadContext = createContext30({});
|
|
8816
8950
|
var preloads = {};
|
|
8817
8951
|
var updaters = [];
|
|
@@ -8820,8 +8954,8 @@ var setPreloads = (updater) => {
|
|
|
8820
8954
|
updaters.forEach((u) => u());
|
|
8821
8955
|
};
|
|
8822
8956
|
var PrefetchProvider = ({ children }) => {
|
|
8823
|
-
const [_preloads, _setPreloads] =
|
|
8824
|
-
|
|
8957
|
+
const [_preloads, _setPreloads] = useState13(() => preloads);
|
|
8958
|
+
useEffect9(() => {
|
|
8825
8959
|
const updaterFunction = () => {
|
|
8826
8960
|
_setPreloads(preloads);
|
|
8827
8961
|
};
|
|
@@ -8830,7 +8964,7 @@ var PrefetchProvider = ({ children }) => {
|
|
|
8830
8964
|
updaters = updaters.filter((u) => u !== updaterFunction);
|
|
8831
8965
|
};
|
|
8832
8966
|
}, []);
|
|
8833
|
-
return /* @__PURE__ */
|
|
8967
|
+
return /* @__PURE__ */ jsx23(PreloadContext.Provider, {
|
|
8834
8968
|
value: _preloads,
|
|
8835
8969
|
children
|
|
8836
8970
|
});
|
|
@@ -8852,7 +8986,7 @@ var getSrcWithoutHash = (src) => {
|
|
|
8852
8986
|
return src.slice(0, hashIndex);
|
|
8853
8987
|
};
|
|
8854
8988
|
var usePreload = (src) => {
|
|
8855
|
-
const preloads =
|
|
8989
|
+
const preloads = useContext31(PreloadContext);
|
|
8856
8990
|
const hashFragmentIndex = removeAndGetHashFragment(src);
|
|
8857
8991
|
const withoutHashFragment = getSrcWithoutHash(src);
|
|
8858
8992
|
if (!preloads[withoutHashFragment]) {
|
|
@@ -9138,7 +9272,7 @@ var resolveTrimProps = ({
|
|
|
9138
9272
|
|
|
9139
9273
|
// src/video/duration-state.tsx
|
|
9140
9274
|
import { createContext as createContext31, useMemo as useMemo25, useReducer } from "react";
|
|
9141
|
-
import { jsx as
|
|
9275
|
+
import { jsx as jsx24 } from "react/jsx-runtime";
|
|
9142
9276
|
var durationReducer = (state, action) => {
|
|
9143
9277
|
switch (action.type) {
|
|
9144
9278
|
case "got-duration": {
|
|
@@ -9169,7 +9303,7 @@ var DurationsContextProvider = ({ children }) => {
|
|
|
9169
9303
|
setDurations
|
|
9170
9304
|
};
|
|
9171
9305
|
}, [durations]);
|
|
9172
|
-
return /* @__PURE__ */
|
|
9306
|
+
return /* @__PURE__ */ jsx24(DurationsContext.Provider, {
|
|
9173
9307
|
value,
|
|
9174
9308
|
children
|
|
9175
9309
|
});
|
|
@@ -9177,14 +9311,14 @@ var DurationsContextProvider = ({ children }) => {
|
|
|
9177
9311
|
|
|
9178
9312
|
// src/audio/AudioForPreview.tsx
|
|
9179
9313
|
import { useCallback as useCallback16 } from "react";
|
|
9180
|
-
import
|
|
9314
|
+
import React35, {
|
|
9181
9315
|
forwardRef as forwardRef5,
|
|
9182
|
-
useContext as
|
|
9183
|
-
useEffect as
|
|
9316
|
+
useContext as useContext41,
|
|
9317
|
+
useEffect as useEffect16,
|
|
9184
9318
|
useImperativeHandle as useImperativeHandle4,
|
|
9185
9319
|
useMemo as useMemo33,
|
|
9186
9320
|
useRef as useRef21,
|
|
9187
|
-
useState as
|
|
9321
|
+
useState as useState17
|
|
9188
9322
|
} from "react";
|
|
9189
9323
|
|
|
9190
9324
|
// src/get-cross-origin-value.ts
|
|
@@ -9240,18 +9374,18 @@ var random = (seed, dummy) => {
|
|
|
9240
9374
|
};
|
|
9241
9375
|
|
|
9242
9376
|
// src/use-amplification.ts
|
|
9243
|
-
import { useContext as
|
|
9377
|
+
import { useContext as useContext33, useLayoutEffect as useLayoutEffect12, useRef as useRef16 } from "react";
|
|
9244
9378
|
|
|
9245
9379
|
// src/audio/shared-audio-tags.tsx
|
|
9246
|
-
import
|
|
9380
|
+
import React32, {
|
|
9247
9381
|
createContext as createContext32,
|
|
9248
9382
|
createRef as createRef2,
|
|
9249
9383
|
useCallback as useCallback11,
|
|
9250
|
-
useContext as
|
|
9251
|
-
useEffect as
|
|
9384
|
+
useContext as useContext32,
|
|
9385
|
+
useEffect as useEffect10,
|
|
9252
9386
|
useMemo as useMemo27,
|
|
9253
9387
|
useRef as useRef14,
|
|
9254
|
-
useState as
|
|
9388
|
+
useState as useState14
|
|
9255
9389
|
} from "react";
|
|
9256
9390
|
|
|
9257
9391
|
// src/play-and-handle-not-allowed-error.ts
|
|
@@ -9513,7 +9647,7 @@ var waitUntilActuallyResumed = (audioContext, logLevel, signal, isAutoPlayAttemp
|
|
|
9513
9647
|
};
|
|
9514
9648
|
|
|
9515
9649
|
// src/audio/shared-audio-tags.tsx
|
|
9516
|
-
import { jsx as
|
|
9650
|
+
import { jsx as jsx25, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
9517
9651
|
var EMPTY_AUDIO = "data:audio/mp3;base64,/+MYxAAJcAV8AAgAABn//////+/gQ5BAMA+D4Pg+BAQBAEAwD4Pg+D4EBAEAQDAPg++hYBH///hUFQVBUFREDQNHmf///////+MYxBUGkAGIMAAAAP/29Xt6lUxBTUUzLjEwMFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV/+MYxDUAAANIAAAAAFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV";
|
|
9518
9652
|
var compareProps = (obj1, obj2) => {
|
|
9519
9653
|
const keysA = Object.keys(obj1).sort();
|
|
@@ -9594,7 +9728,7 @@ var SharedAudioContextProvider = ({
|
|
|
9594
9728
|
const prevEndTimes = useRef14({ scheduledEndTime: null, mediaEndTime: null });
|
|
9595
9729
|
const nodesToResume = useRef14(new Map);
|
|
9596
9730
|
const unscheduleAudioNode = useCallback11((node) => {
|
|
9597
|
-
nodesToResume.current.delete(node);
|
|
9731
|
+
return nodesToResume.current.delete(node);
|
|
9598
9732
|
}, []);
|
|
9599
9733
|
const scheduleAudioNode = useMemo27(() => {
|
|
9600
9734
|
return ({
|
|
@@ -9713,7 +9847,7 @@ var SharedAudioContextProvider = ({
|
|
|
9713
9847
|
}
|
|
9714
9848
|
return ctxAndGain.suspend();
|
|
9715
9849
|
}, [ctxAndGain, _experimentalKeepAudioContextAlive]);
|
|
9716
|
-
|
|
9850
|
+
useEffect10(() => {
|
|
9717
9851
|
if (!_experimentalKeepAudioContextAlive) {
|
|
9718
9852
|
return;
|
|
9719
9853
|
}
|
|
@@ -9770,24 +9904,24 @@ var SharedAudioContextProvider = ({
|
|
|
9770
9904
|
unscheduleAudioNode,
|
|
9771
9905
|
_experimentalKeepAudioContextAlive
|
|
9772
9906
|
]);
|
|
9773
|
-
return /* @__PURE__ */
|
|
9907
|
+
return /* @__PURE__ */ jsx25(SharedAudioContext.Provider, {
|
|
9774
9908
|
value: audioContextValue,
|
|
9775
9909
|
children
|
|
9776
9910
|
});
|
|
9777
9911
|
};
|
|
9778
9912
|
var SharedAudioTagsContextProvider = ({ children, numberOfAudioTags }) => {
|
|
9779
9913
|
const audios = useRef14([]);
|
|
9780
|
-
const [initialNumberOfAudioTags] =
|
|
9914
|
+
const [initialNumberOfAudioTags] = useState14(numberOfAudioTags);
|
|
9781
9915
|
if (numberOfAudioTags !== initialNumberOfAudioTags) {
|
|
9782
9916
|
throw new Error("The number of shared audio tags has changed dynamically. Once you have set this property, you cannot change it afterwards.");
|
|
9783
9917
|
}
|
|
9784
9918
|
const logLevel = useLogLevel();
|
|
9785
9919
|
const mountTime = useMountTime();
|
|
9786
9920
|
const env = useRemotionEnvironment();
|
|
9787
|
-
const audioCtx =
|
|
9921
|
+
const audioCtx = useContext32(SharedAudioContext);
|
|
9788
9922
|
const audioContext = audioCtx?.audioContext ?? null;
|
|
9789
9923
|
const resume = audioCtx?.resume;
|
|
9790
|
-
const [refs] =
|
|
9924
|
+
const [refs] = useState14(() => {
|
|
9791
9925
|
return new Array(numberOfAudioTags).fill(true).map(() => {
|
|
9792
9926
|
const ref = createRef2();
|
|
9793
9927
|
return {
|
|
@@ -9803,7 +9937,7 @@ var SharedAudioTagsContextProvider = ({ children, numberOfAudioTags }) => {
|
|
|
9803
9937
|
for (const { mediaElementSourceNode } of refs) {
|
|
9804
9938
|
mediaElementSourceNode?.setAudioContext(audioContext);
|
|
9805
9939
|
}
|
|
9806
|
-
const effectToUse =
|
|
9940
|
+
const effectToUse = React32.useInsertionEffect ?? React32.useLayoutEffect;
|
|
9807
9941
|
effectToUse(() => {
|
|
9808
9942
|
return () => {
|
|
9809
9943
|
requestAnimationFrame(() => {
|
|
@@ -9946,7 +10080,7 @@ var SharedAudioTagsContextProvider = ({ children, numberOfAudioTags }) => {
|
|
|
9946
10080
|
]);
|
|
9947
10081
|
const sharedAudioTagElements = useMemo27(() => {
|
|
9948
10082
|
return refs.map(({ id, ref }) => {
|
|
9949
|
-
return /* @__PURE__ */
|
|
10083
|
+
return /* @__PURE__ */ jsx25("audio", {
|
|
9950
10084
|
ref,
|
|
9951
10085
|
preload: "metadata",
|
|
9952
10086
|
src: EMPTY_AUDIO
|
|
@@ -9967,13 +10101,13 @@ var useSharedAudio = ({
|
|
|
9967
10101
|
premounting,
|
|
9968
10102
|
postmounting
|
|
9969
10103
|
}) => {
|
|
9970
|
-
const audioCtx =
|
|
9971
|
-
const tagsCtx =
|
|
9972
|
-
const [elem] =
|
|
10104
|
+
const audioCtx = useContext32(SharedAudioContext);
|
|
10105
|
+
const tagsCtx = useContext32(SharedAudioTagsContext);
|
|
10106
|
+
const [elem] = useState14(() => {
|
|
9973
10107
|
if (tagsCtx && tagsCtx.numberOfAudioTags > 0) {
|
|
9974
10108
|
return tagsCtx.registerAudio({ aud, audioId, premounting, postmounting });
|
|
9975
10109
|
}
|
|
9976
|
-
const el =
|
|
10110
|
+
const el = React32.createRef();
|
|
9977
10111
|
const mediaElementSourceNode = makeSharedElementSourceNode({
|
|
9978
10112
|
audioContext: audioCtx?.audioContext ?? null,
|
|
9979
10113
|
ref: el
|
|
@@ -9993,7 +10127,7 @@ var useSharedAudio = ({
|
|
|
9993
10127
|
};
|
|
9994
10128
|
});
|
|
9995
10129
|
elem.mediaElementSourceNode?.setAudioContext(audioCtx?.audioContext ?? null);
|
|
9996
|
-
const effectToUse =
|
|
10130
|
+
const effectToUse = React32.useInsertionEffect ?? React32.useLayoutEffect;
|
|
9997
10131
|
if (typeof document !== "undefined") {
|
|
9998
10132
|
effectToUse(() => {
|
|
9999
10133
|
if (tagsCtx && tagsCtx.numberOfAudioTags > 0) {
|
|
@@ -10157,7 +10291,7 @@ var useVolume = ({
|
|
|
10157
10291
|
const audioStuffRef = useRef16(null);
|
|
10158
10292
|
const currentVolumeRef = useRef16(volume);
|
|
10159
10293
|
currentVolumeRef.current = volume;
|
|
10160
|
-
const sharedAudioContext =
|
|
10294
|
+
const sharedAudioContext = useContext33(SharedAudioContext);
|
|
10161
10295
|
if (!sharedAudioContext) {
|
|
10162
10296
|
throw new Error("useAmplification must be used within a SharedAudioContext");
|
|
10163
10297
|
}
|
|
@@ -10223,19 +10357,19 @@ var useVolume = ({
|
|
|
10223
10357
|
};
|
|
10224
10358
|
|
|
10225
10359
|
// src/use-media-in-timeline.ts
|
|
10226
|
-
import { useCallback as useCallback12, useContext as
|
|
10360
|
+
import { useCallback as useCallback12, useContext as useContext35, useMemo as useMemo28 } from "react";
|
|
10227
10361
|
|
|
10228
10362
|
// src/audio/use-audio-frame.ts
|
|
10229
|
-
import { createContext as createContext33, useContext as
|
|
10363
|
+
import { createContext as createContext33, useContext as useContext34 } from "react";
|
|
10230
10364
|
var Html5MediaTrimContext = createContext33(0);
|
|
10231
10365
|
var useMediaStartsAt = () => {
|
|
10232
|
-
const parentSequence =
|
|
10366
|
+
const parentSequence = useContext34(SequenceContext);
|
|
10233
10367
|
return parentSequence?.cumulatedNegativeFrom ?? 0;
|
|
10234
10368
|
};
|
|
10235
10369
|
var useFrameForVolumeProp = (behavior) => {
|
|
10236
10370
|
const loop = Loop.useLoop();
|
|
10237
|
-
const loopTimeline =
|
|
10238
|
-
const sequenceContext =
|
|
10371
|
+
const loopTimeline = useContext34(LoopTimelineContext);
|
|
10372
|
+
const sequenceContext = useContext34(SequenceContext);
|
|
10239
10373
|
const frame = useCurrentFrame();
|
|
10240
10374
|
const startsAt = useMediaStartsAt();
|
|
10241
10375
|
if (behavior === "repeat" || loop === null) {
|
|
@@ -10303,7 +10437,7 @@ var useBasicMediaInTimeline = ({
|
|
|
10303
10437
|
if (!src) {
|
|
10304
10438
|
throw new Error("No src passed");
|
|
10305
10439
|
}
|
|
10306
|
-
const parentSequence =
|
|
10440
|
+
const parentSequence = useContext35(SequenceContext);
|
|
10307
10441
|
const duration = getTimelineDuration({
|
|
10308
10442
|
compositionDurationInFrames: sequenceDurationInFrames,
|
|
10309
10443
|
playbackRate,
|
|
@@ -10339,13 +10473,13 @@ var useMediaInTimelineRegistration = ({
|
|
|
10339
10473
|
documentationLink,
|
|
10340
10474
|
muted
|
|
10341
10475
|
}) => {
|
|
10342
|
-
const parentSequence =
|
|
10343
|
-
const timelineTrack =
|
|
10344
|
-
const mediaTrimBefore =
|
|
10345
|
-
const sequenceRegistrationEnabled =
|
|
10476
|
+
const parentSequence = useContext35(SequenceContext);
|
|
10477
|
+
const timelineTrack = useContext35(TimelineTrackContext);
|
|
10478
|
+
const mediaTrimBefore = useContext35(Html5MediaTrimContext);
|
|
10479
|
+
const sequenceRegistrationEnabled = useContext35(SequenceRegistrationContext);
|
|
10346
10480
|
const { durationInFrames } = useVideoConfig();
|
|
10347
10481
|
const mediaStartsAt = useMediaStartsAt();
|
|
10348
|
-
const canvasOutlinesEnabled =
|
|
10482
|
+
const canvasOutlinesEnabled = useContext35(SequenceOutlineContext);
|
|
10349
10483
|
const { isStudio } = useRemotionEnvironment();
|
|
10350
10484
|
const stack = getStack();
|
|
10351
10485
|
const getStackForRegistration = useCallback12(() => stack, [stack]);
|
|
@@ -10430,8 +10564,8 @@ var useMediaInTimelineRegistration = ({
|
|
|
10430
10564
|
// src/use-media-playback.ts
|
|
10431
10565
|
import {
|
|
10432
10566
|
useCallback as useCallback15,
|
|
10433
|
-
useContext as
|
|
10434
|
-
useEffect as
|
|
10567
|
+
useContext as useContext38,
|
|
10568
|
+
useEffect as useEffect14,
|
|
10435
10569
|
useLayoutEffect as useLayoutEffect14,
|
|
10436
10570
|
useRef as useRef19
|
|
10437
10571
|
} from "react";
|
|
@@ -10440,20 +10574,20 @@ import {
|
|
|
10440
10574
|
import { useCallback as useCallback14, useMemo as useMemo31, useRef as useRef17 } from "react";
|
|
10441
10575
|
|
|
10442
10576
|
// src/use-buffer-state.ts
|
|
10443
|
-
import { useContext as
|
|
10577
|
+
import { useContext as useContext37, useMemo as useMemo30 } from "react";
|
|
10444
10578
|
|
|
10445
10579
|
// src/buffering.tsx
|
|
10446
|
-
import
|
|
10580
|
+
import React33, {
|
|
10447
10581
|
useCallback as useCallback13,
|
|
10448
|
-
useContext as
|
|
10449
|
-
useEffect as
|
|
10582
|
+
useContext as useContext36,
|
|
10583
|
+
useEffect as useEffect11,
|
|
10450
10584
|
useLayoutEffect as useLayoutEffect13,
|
|
10451
10585
|
useMemo as useMemo29,
|
|
10452
|
-
useState as
|
|
10586
|
+
useState as useState15
|
|
10453
10587
|
} from "react";
|
|
10454
|
-
import { jsx as
|
|
10588
|
+
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
10455
10589
|
var useBufferManager = (logLevel, mountTime, setBuffering, isBuffering) => {
|
|
10456
|
-
const [blockCount, setBlockCount] =
|
|
10590
|
+
const [blockCount, setBlockCount] = useState15(0);
|
|
10457
10591
|
const env = useRemotionEnvironment();
|
|
10458
10592
|
const rendering = env.isRendering;
|
|
10459
10593
|
const addBlock = useCallback13(() => {
|
|
@@ -10476,7 +10610,7 @@ var useBufferManager = (logLevel, mountTime, setBuffering, isBuffering) => {
|
|
|
10476
10610
|
}
|
|
10477
10611
|
};
|
|
10478
10612
|
}, [rendering]);
|
|
10479
|
-
|
|
10613
|
+
useEffect11(() => {
|
|
10480
10614
|
if (rendering) {
|
|
10481
10615
|
return;
|
|
10482
10616
|
}
|
|
@@ -10508,12 +10642,12 @@ var useBufferManager = (logLevel, mountTime, setBuffering, isBuffering) => {
|
|
|
10508
10642
|
}
|
|
10509
10643
|
return useMemo29(() => ({ addBlock }), [addBlock]);
|
|
10510
10644
|
};
|
|
10511
|
-
var BufferingContextReact =
|
|
10645
|
+
var BufferingContextReact = React33.createContext(null);
|
|
10512
10646
|
var BufferingProvider = ({ children }) => {
|
|
10513
|
-
const { logLevel, mountTime } =
|
|
10514
|
-
const { isBuffering, setBuffering } =
|
|
10647
|
+
const { logLevel, mountTime } = useContext36(LogLevelContext);
|
|
10648
|
+
const { isBuffering, setBuffering } = useContext36(SetTimelineContext);
|
|
10515
10649
|
const bufferManager = useBufferManager(logLevel ?? "info", mountTime, setBuffering, isBuffering);
|
|
10516
|
-
return /* @__PURE__ */
|
|
10650
|
+
return /* @__PURE__ */ jsx26(BufferingContextReact.Provider, {
|
|
10517
10651
|
value: bufferManager,
|
|
10518
10652
|
children
|
|
10519
10653
|
});
|
|
@@ -10521,7 +10655,7 @@ var BufferingProvider = ({ children }) => {
|
|
|
10521
10655
|
|
|
10522
10656
|
// src/use-buffer-state.ts
|
|
10523
10657
|
var useBufferState = () => {
|
|
10524
|
-
const buffer =
|
|
10658
|
+
const buffer = useContext37(BufferingContextReact);
|
|
10525
10659
|
const logLevel = useLogLevel();
|
|
10526
10660
|
const addBlock = buffer ? buffer.addBlock : null;
|
|
10527
10661
|
return useMemo30(() => ({
|
|
@@ -10709,9 +10843,9 @@ var getMediaSyncAction = (input) => {
|
|
|
10709
10843
|
};
|
|
10710
10844
|
|
|
10711
10845
|
// src/media-tag-current-time-timestamp.ts
|
|
10712
|
-
import
|
|
10846
|
+
import React34 from "react";
|
|
10713
10847
|
var useCurrentTimeOfMediaTagWithUpdateTimeStamp = (mediaRef) => {
|
|
10714
|
-
const lastUpdate =
|
|
10848
|
+
const lastUpdate = React34.useRef({
|
|
10715
10849
|
time: mediaRef.current?.currentTime ?? 0,
|
|
10716
10850
|
lastUpdate: performance.now()
|
|
10717
10851
|
});
|
|
@@ -10745,7 +10879,7 @@ var seek = ({
|
|
|
10745
10879
|
};
|
|
10746
10880
|
|
|
10747
10881
|
// src/use-media-buffering.ts
|
|
10748
|
-
import { useEffect as
|
|
10882
|
+
import { useEffect as useEffect12, useState as useState16 } from "react";
|
|
10749
10883
|
var useMediaBuffering = ({
|
|
10750
10884
|
element,
|
|
10751
10885
|
shouldBuffer,
|
|
@@ -10756,8 +10890,8 @@ var useMediaBuffering = ({
|
|
|
10756
10890
|
src
|
|
10757
10891
|
}) => {
|
|
10758
10892
|
const buffer = useBufferState();
|
|
10759
|
-
const [isBuffering, setIsBuffering] =
|
|
10760
|
-
|
|
10893
|
+
const [isBuffering, setIsBuffering] = useState16(false);
|
|
10894
|
+
useEffect12(() => {
|
|
10761
10895
|
let cleanupFns = [];
|
|
10762
10896
|
const { current } = element;
|
|
10763
10897
|
if (!current) {
|
|
@@ -10885,7 +11019,7 @@ var useMediaBuffering = ({
|
|
|
10885
11019
|
};
|
|
10886
11020
|
|
|
10887
11021
|
// src/use-request-video-callback-time.ts
|
|
10888
|
-
import { useEffect as
|
|
11022
|
+
import { useEffect as useEffect13, useRef as useRef18 } from "react";
|
|
10889
11023
|
var useRequestVideoCallbackTime = ({
|
|
10890
11024
|
mediaRef,
|
|
10891
11025
|
mediaType,
|
|
@@ -10893,7 +11027,7 @@ var useRequestVideoCallbackTime = ({
|
|
|
10893
11027
|
onVariableFpsVideoDetected
|
|
10894
11028
|
}) => {
|
|
10895
11029
|
const currentTime = useRef18(null);
|
|
10896
|
-
|
|
11030
|
+
useEffect13(() => {
|
|
10897
11031
|
const { current } = mediaRef;
|
|
10898
11032
|
if (current) {
|
|
10899
11033
|
currentTime.current = {
|
|
@@ -11044,7 +11178,7 @@ var useMediaPlayback = ({
|
|
|
11044
11178
|
const playing = usePlaying();
|
|
11045
11179
|
const playerBuffering = useBuffering();
|
|
11046
11180
|
const { fps } = useVideoConfig();
|
|
11047
|
-
const mediaTrimBefore =
|
|
11181
|
+
const mediaTrimBefore = useContext38(Html5MediaTrimContext);
|
|
11048
11182
|
const lastSeekDueToShift = useRef19(null);
|
|
11049
11183
|
const lastSeek = useRef19(null);
|
|
11050
11184
|
const logLevel = useLogLevel();
|
|
@@ -11090,7 +11224,7 @@ var useMediaPlayback = ({
|
|
|
11090
11224
|
logLevel,
|
|
11091
11225
|
mountTime
|
|
11092
11226
|
});
|
|
11093
|
-
const sequenceContext =
|
|
11227
|
+
const sequenceContext = useContext38(SequenceContext);
|
|
11094
11228
|
const playbackRate = localPlaybackRate * globalPlaybackRate * (sequenceContext?.playbackRate ?? 1);
|
|
11095
11229
|
const acceptableTimeShiftButLessThanDuration = (() => {
|
|
11096
11230
|
if (mediaRef.current?.duration) {
|
|
@@ -11111,7 +11245,7 @@ var useMediaPlayback = ({
|
|
|
11111
11245
|
mediaRef.current.preservesPitch = preservePitch;
|
|
11112
11246
|
}
|
|
11113
11247
|
}, [mediaRef, playbackRate, preservePitch]);
|
|
11114
|
-
|
|
11248
|
+
useEffect14(() => {
|
|
11115
11249
|
const tagName = mediaType === "audio" ? "<Html5Audio>" : "<Html5Video>";
|
|
11116
11250
|
if (!mediaRef.current) {
|
|
11117
11251
|
throw new Error(`No ${mediaType} ref found`);
|
|
@@ -11254,7 +11388,7 @@ var useMediaPlayback = ({
|
|
|
11254
11388
|
};
|
|
11255
11389
|
|
|
11256
11390
|
// src/use-media-tag.ts
|
|
11257
|
-
import { useContext as
|
|
11391
|
+
import { useContext as useContext39, useEffect as useEffect15, useRef as useRef20 } from "react";
|
|
11258
11392
|
var useMediaTag = ({
|
|
11259
11393
|
mediaRef,
|
|
11260
11394
|
id,
|
|
@@ -11264,13 +11398,13 @@ var useMediaTag = ({
|
|
|
11264
11398
|
isPostmounting
|
|
11265
11399
|
}) => {
|
|
11266
11400
|
const { audioAndVideoTags, isPlaying } = useTimelineContext();
|
|
11267
|
-
const { subscribePlaying } =
|
|
11401
|
+
const { subscribePlaying } = useContext39(SetTimelineContext);
|
|
11268
11402
|
const isPlayingRef = useRef20(isPlaying);
|
|
11269
11403
|
isPlayingRef.current = isPlaying;
|
|
11270
11404
|
const logLevel = useLogLevel();
|
|
11271
11405
|
const mountTime = useMountTime();
|
|
11272
11406
|
const env = useRemotionEnvironment();
|
|
11273
|
-
|
|
11407
|
+
useEffect15(() => {
|
|
11274
11408
|
const tag = {
|
|
11275
11409
|
id,
|
|
11276
11410
|
play: (reason) => {
|
|
@@ -11328,7 +11462,7 @@ var useMediaTag = ({
|
|
|
11328
11462
|
};
|
|
11329
11463
|
|
|
11330
11464
|
// src/volume-position-state.ts
|
|
11331
|
-
import { createContext as createContext34, useContext as
|
|
11465
|
+
import { createContext as createContext34, useContext as useContext40, useMemo as useMemo32 } from "react";
|
|
11332
11466
|
var MediaVolumeContext = createContext34({
|
|
11333
11467
|
playerMuted: false,
|
|
11334
11468
|
mediaVolume: 1
|
|
@@ -11342,15 +11476,15 @@ var SetMediaVolumeContext = createContext34({
|
|
|
11342
11476
|
}
|
|
11343
11477
|
});
|
|
11344
11478
|
var useMediaVolumeState = () => {
|
|
11345
|
-
const { mediaVolume } =
|
|
11346
|
-
const { setMediaVolume } =
|
|
11479
|
+
const { mediaVolume } = useContext40(MediaVolumeContext);
|
|
11480
|
+
const { setMediaVolume } = useContext40(SetMediaVolumeContext);
|
|
11347
11481
|
return useMemo32(() => {
|
|
11348
11482
|
return [mediaVolume, setMediaVolume];
|
|
11349
11483
|
}, [mediaVolume, setMediaVolume]);
|
|
11350
11484
|
};
|
|
11351
11485
|
var usePlayerMutedState = () => {
|
|
11352
|
-
const { playerMuted } =
|
|
11353
|
-
const { setPlayerMuted } =
|
|
11486
|
+
const { playerMuted } = useContext40(MediaVolumeContext);
|
|
11487
|
+
const { setPlayerMuted } = useContext40(SetMediaVolumeContext);
|
|
11354
11488
|
return useMemo32(() => {
|
|
11355
11489
|
return [playerMuted, setPlayerMuted];
|
|
11356
11490
|
}, [playerMuted, setPlayerMuted]);
|
|
@@ -11421,9 +11555,9 @@ var useMediaAudioState = ({
|
|
|
11421
11555
|
};
|
|
11422
11556
|
|
|
11423
11557
|
// src/audio/AudioForPreview.tsx
|
|
11424
|
-
import { jsx as
|
|
11558
|
+
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
11425
11559
|
var AudioForDevelopmentForwardRefFunction = (props, ref) => {
|
|
11426
|
-
const [initialShouldPreMountAudioElements] =
|
|
11560
|
+
const [initialShouldPreMountAudioElements] = useState17(props.shouldPreMountAudioTags);
|
|
11427
11561
|
if (props.shouldPreMountAudioTags !== initialShouldPreMountAudioElements) {
|
|
11428
11562
|
throw new Error("Cannot change the behavior for pre-mounting audio tags dynamically.");
|
|
11429
11563
|
}
|
|
@@ -11466,7 +11600,7 @@ var AudioForDevelopmentForwardRefFunction = (props, ref) => {
|
|
|
11466
11600
|
throw new TypeError("No 'src' was passed to <Html5Audio>.");
|
|
11467
11601
|
}
|
|
11468
11602
|
const preloadedSrc = usePreload(src);
|
|
11469
|
-
const sequenceContext =
|
|
11603
|
+
const sequenceContext = useContext41(SequenceContext);
|
|
11470
11604
|
warnAboutTooHighVolume(userPreferredVolume);
|
|
11471
11605
|
const crossOriginValue = getCrossOriginValue({
|
|
11472
11606
|
crossOrigin,
|
|
@@ -11534,7 +11668,7 @@ var AudioForDevelopmentForwardRefFunction = (props, ref) => {
|
|
|
11534
11668
|
volume: userPreferredVolume,
|
|
11535
11669
|
shouldUseWebAudioApi: useWebAudioApi ?? false
|
|
11536
11670
|
});
|
|
11537
|
-
const effectToUse =
|
|
11671
|
+
const effectToUse = React35.useInsertionEffect ?? React35.useLayoutEffect;
|
|
11538
11672
|
effectToUse(() => {
|
|
11539
11673
|
return () => {
|
|
11540
11674
|
requestAnimationFrame(() => {
|
|
@@ -11547,7 +11681,7 @@ var AudioForDevelopmentForwardRefFunction = (props, ref) => {
|
|
|
11547
11681
|
}, [audioRef]);
|
|
11548
11682
|
const currentOnDurationCallback = useRef21(onDuration);
|
|
11549
11683
|
currentOnDurationCallback.current = onDuration;
|
|
11550
|
-
|
|
11684
|
+
useEffect16(() => {
|
|
11551
11685
|
const { current } = audioRef;
|
|
11552
11686
|
if (!current) {
|
|
11553
11687
|
return;
|
|
@@ -11567,7 +11701,7 @@ var AudioForDevelopmentForwardRefFunction = (props, ref) => {
|
|
|
11567
11701
|
if (initialShouldPreMountAudioElements) {
|
|
11568
11702
|
return null;
|
|
11569
11703
|
}
|
|
11570
|
-
const audio = /* @__PURE__ */
|
|
11704
|
+
const audio = /* @__PURE__ */ jsx27("audio", {
|
|
11571
11705
|
ref: audioRef,
|
|
11572
11706
|
preload: "metadata",
|
|
11573
11707
|
crossOrigin: crossOriginValue,
|
|
@@ -11587,8 +11721,8 @@ var AudioForPreviewRefForwardingFunction = (props, ref) => {
|
|
|
11587
11721
|
showInTimeline,
|
|
11588
11722
|
loopVolumeCurveBehavior
|
|
11589
11723
|
} = props;
|
|
11590
|
-
const [timelineId] =
|
|
11591
|
-
const sequenceContext =
|
|
11724
|
+
const [timelineId] = useState17(() => String(Math.random()));
|
|
11725
|
+
const sequenceContext = useContext41(SequenceContext);
|
|
11592
11726
|
const { isStudio } = useRemotionEnvironment();
|
|
11593
11727
|
const [mediaVolume] = useMediaVolumeState();
|
|
11594
11728
|
const volumePropFrame = useFrameForVolumeProp(loopVolumeCurveBehavior ?? "repeat");
|
|
@@ -11625,11 +11759,11 @@ var AudioForPreviewRefForwardingFunction = (props, ref) => {
|
|
|
11625
11759
|
value: registration,
|
|
11626
11760
|
outlineChildrenRef: null
|
|
11627
11761
|
} : null, [isStudio, registration, timelineId]);
|
|
11628
|
-
return /* @__PURE__ */
|
|
11762
|
+
return /* @__PURE__ */ jsx27(CommittedMetadataProvider, {
|
|
11629
11763
|
value: null,
|
|
11630
11764
|
_remotionCommitMetadata: metadata,
|
|
11631
|
-
children: /* @__PURE__ */
|
|
11632
|
-
children: /* @__PURE__ */
|
|
11765
|
+
children: /* @__PURE__ */ jsx27(SequenceContent, {
|
|
11766
|
+
children: /* @__PURE__ */ jsx27(AudioForPreviewContent, {
|
|
11633
11767
|
...props,
|
|
11634
11768
|
ref,
|
|
11635
11769
|
timelineId,
|
|
@@ -11644,8 +11778,8 @@ var AudioForPreview = forwardRef5(AudioForPreviewRefForwardingFunction);
|
|
|
11644
11778
|
// src/audio/AudioForRendering.tsx
|
|
11645
11779
|
import {
|
|
11646
11780
|
forwardRef as forwardRef6,
|
|
11647
|
-
useContext as
|
|
11648
|
-
useEffect as
|
|
11781
|
+
useContext as useContext43,
|
|
11782
|
+
useEffect as useEffect17,
|
|
11649
11783
|
useImperativeHandle as useImperativeHandle5,
|
|
11650
11784
|
useLayoutEffect as useLayoutEffect15,
|
|
11651
11785
|
useMemo as useMemo35,
|
|
@@ -11653,11 +11787,11 @@ import {
|
|
|
11653
11787
|
} from "react";
|
|
11654
11788
|
|
|
11655
11789
|
// src/use-media-enabled.tsx
|
|
11656
|
-
import { createContext as createContext35, useContext as
|
|
11657
|
-
import { jsx as
|
|
11790
|
+
import { createContext as createContext35, useContext as useContext42, useMemo as useMemo34 } from "react";
|
|
11791
|
+
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
11658
11792
|
var MediaEnabledContext = createContext35(null);
|
|
11659
11793
|
var useVideoEnabled = () => {
|
|
11660
|
-
const context =
|
|
11794
|
+
const context = useContext42(MediaEnabledContext);
|
|
11661
11795
|
if (!context) {
|
|
11662
11796
|
return window.remotion_videoEnabled;
|
|
11663
11797
|
}
|
|
@@ -11667,7 +11801,7 @@ var useVideoEnabled = () => {
|
|
|
11667
11801
|
return context.videoEnabled;
|
|
11668
11802
|
};
|
|
11669
11803
|
var useAudioEnabled = () => {
|
|
11670
|
-
const context =
|
|
11804
|
+
const context = useContext42(MediaEnabledContext);
|
|
11671
11805
|
if (!context) {
|
|
11672
11806
|
return window.remotion_audioEnabled;
|
|
11673
11807
|
}
|
|
@@ -11682,14 +11816,14 @@ var MediaEnabledProvider = ({
|
|
|
11682
11816
|
audioEnabled
|
|
11683
11817
|
}) => {
|
|
11684
11818
|
const value = useMemo34(() => ({ videoEnabled, audioEnabled }), [videoEnabled, audioEnabled]);
|
|
11685
|
-
return /* @__PURE__ */
|
|
11819
|
+
return /* @__PURE__ */ jsx28(MediaEnabledContext.Provider, {
|
|
11686
11820
|
value,
|
|
11687
11821
|
children
|
|
11688
11822
|
});
|
|
11689
11823
|
};
|
|
11690
11824
|
|
|
11691
11825
|
// src/audio/AudioForRendering.tsx
|
|
11692
|
-
import { jsx as
|
|
11826
|
+
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
11693
11827
|
var AudioForRenderingRefForwardingFunction = (props, ref) => {
|
|
11694
11828
|
const audioRef = useRef22(null);
|
|
11695
11829
|
const {
|
|
@@ -11714,10 +11848,10 @@ var AudioForRenderingRefForwardingFunction = (props, ref) => {
|
|
|
11714
11848
|
const absoluteFrame = useTimelinePosition();
|
|
11715
11849
|
const volumePropFrame = useFrameForVolumeProp(loopVolumeCurveBehavior ?? "repeat");
|
|
11716
11850
|
const frame = useCurrentFrame();
|
|
11717
|
-
const sequenceContext =
|
|
11851
|
+
const sequenceContext = useContext43(SequenceContext);
|
|
11718
11852
|
const sequencePlaybackRate = sequenceContext?.playbackRate ?? 1;
|
|
11719
|
-
const audioStartFrame =
|
|
11720
|
-
const { registerRenderAsset, unregisterRenderAsset } =
|
|
11853
|
+
const audioStartFrame = useContext43(Html5MediaTrimContext);
|
|
11854
|
+
const { registerRenderAsset, unregisterRenderAsset } = useContext43(RenderAssetManager);
|
|
11721
11855
|
const { delayRender, continueRender } = useDelayRender();
|
|
11722
11856
|
const id = useMemo35(() => `audio-${random(props.src ?? "")}-${sequenceContext?.relativeFrom}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.durationInFrames}`, [
|
|
11723
11857
|
props.src,
|
|
@@ -11740,7 +11874,7 @@ var AudioForRenderingRefForwardingFunction = (props, ref) => {
|
|
|
11740
11874
|
useImperativeHandle5(ref, () => {
|
|
11741
11875
|
return audioRef.current;
|
|
11742
11876
|
}, []);
|
|
11743
|
-
|
|
11877
|
+
useEffect17(() => {
|
|
11744
11878
|
if (!props.src) {
|
|
11745
11879
|
throw new Error("No src passed");
|
|
11746
11880
|
}
|
|
@@ -11819,7 +11953,7 @@ var AudioForRenderingRefForwardingFunction = (props, ref) => {
|
|
|
11819
11953
|
if (!needsToRenderAudioTag) {
|
|
11820
11954
|
return null;
|
|
11821
11955
|
}
|
|
11822
|
-
return /* @__PURE__ */
|
|
11956
|
+
return /* @__PURE__ */ jsx29("audio", {
|
|
11823
11957
|
ref: audioRef,
|
|
11824
11958
|
...nativeProps,
|
|
11825
11959
|
onError: onNativeError
|
|
@@ -11828,9 +11962,9 @@ var AudioForRenderingRefForwardingFunction = (props, ref) => {
|
|
|
11828
11962
|
var AudioForRendering = forwardRef6(AudioForRenderingRefForwardingFunction);
|
|
11829
11963
|
|
|
11830
11964
|
// src/audio/html5-audio.tsx
|
|
11831
|
-
import { jsx as
|
|
11965
|
+
import { jsx as jsx30 } from "react/jsx-runtime";
|
|
11832
11966
|
var AudioRefForwardingFunction = (props, ref) => {
|
|
11833
|
-
const audioTagsContext =
|
|
11967
|
+
const audioTagsContext = useContext44(SharedAudioTagsContext);
|
|
11834
11968
|
const propsWithFreeze = props;
|
|
11835
11969
|
const {
|
|
11836
11970
|
startFrom,
|
|
@@ -11856,7 +11990,7 @@ var AudioRefForwardingFunction = (props, ref) => {
|
|
|
11856
11990
|
if (typeof freeze !== "undefined") {
|
|
11857
11991
|
throw new TypeError('The "freeze" prop is not supported on <Html5Audio />. Use <Sequence freeze={...}> to freeze media playback.');
|
|
11858
11992
|
}
|
|
11859
|
-
const { durations, setDurations } =
|
|
11993
|
+
const { durations, setDurations } = useContext44(DurationsContext);
|
|
11860
11994
|
if (typeof props.src !== "string") {
|
|
11861
11995
|
throw new TypeError(`The \`<Html5Audio>\` tag requires a string for \`src\`, but got ${JSON.stringify(props.src)} instead.`);
|
|
11862
11996
|
}
|
|
@@ -11900,13 +12034,13 @@ var AudioRefForwardingFunction = (props, ref) => {
|
|
|
11900
12034
|
const loopDuration = effectiveTrimAfter ?? (durationFetched === undefined ? undefined : durationFetched * fps);
|
|
11901
12035
|
if (loop && loopDuration !== undefined) {
|
|
11902
12036
|
if (!Number.isFinite(loopDuration)) {
|
|
11903
|
-
return /* @__PURE__ */
|
|
12037
|
+
return /* @__PURE__ */ jsx30(Html5Audio, {
|
|
11904
12038
|
...propsOtherThanLoop,
|
|
11905
12039
|
ref,
|
|
11906
12040
|
_remotionInternalNativeLoopPassed: true
|
|
11907
12041
|
});
|
|
11908
12042
|
}
|
|
11909
|
-
return /* @__PURE__ */
|
|
12043
|
+
return /* @__PURE__ */ jsx30(Loop, {
|
|
11910
12044
|
layout: "none",
|
|
11911
12045
|
durationInFrames: calculateMediaDuration({
|
|
11912
12046
|
trimAfter: effectiveTrimAfter,
|
|
@@ -11914,7 +12048,7 @@ var AudioRefForwardingFunction = (props, ref) => {
|
|
|
11914
12048
|
playbackRate: props.playbackRate ?? 1,
|
|
11915
12049
|
trimBefore: trimBeforeValue
|
|
11916
12050
|
}),
|
|
11917
|
-
children: /* @__PURE__ */
|
|
12051
|
+
children: /* @__PURE__ */ jsx30(Html5Audio, {
|
|
11918
12052
|
...propsOtherThanLoop,
|
|
11919
12053
|
ref,
|
|
11920
12054
|
_remotionInternalNativeLoopPassed: true
|
|
@@ -11922,15 +12056,15 @@ var AudioRefForwardingFunction = (props, ref) => {
|
|
|
11922
12056
|
});
|
|
11923
12057
|
}
|
|
11924
12058
|
if (typeof trimBeforeValue !== "undefined" || typeof effectiveTrimAfter !== "undefined") {
|
|
11925
|
-
return /* @__PURE__ */
|
|
12059
|
+
return /* @__PURE__ */ jsx30(Html5MediaTrimContext.Provider, {
|
|
11926
12060
|
value: trimBeforeValue ?? 0,
|
|
11927
|
-
children: /* @__PURE__ */
|
|
12061
|
+
children: /* @__PURE__ */ jsx30(Sequence, {
|
|
11928
12062
|
layout: "none",
|
|
11929
12063
|
from: 0 - (trimBeforeValue ?? 0),
|
|
11930
12064
|
showInTimeline: false,
|
|
11931
12065
|
durationInFrames: effectiveTrimAfter === undefined ? undefined : (trimBeforeValue ?? 0) + (effectiveTrimAfter - (trimBeforeValue ?? 0)) / (props.playbackRate ?? 1),
|
|
11932
12066
|
name,
|
|
11933
|
-
children: /* @__PURE__ */
|
|
12067
|
+
children: /* @__PURE__ */ jsx30(Html5Audio, {
|
|
11934
12068
|
_remotionInternalNeedsDurationCalculation: Boolean(loop),
|
|
11935
12069
|
pauseWhenBuffering: shouldPauseWhenBuffering,
|
|
11936
12070
|
...otherProps,
|
|
@@ -11945,7 +12079,7 @@ var AudioRefForwardingFunction = (props, ref) => {
|
|
|
11945
12079
|
volume: props.volume
|
|
11946
12080
|
}, "Html5Audio");
|
|
11947
12081
|
if (environment.isRendering) {
|
|
11948
|
-
return /* @__PURE__ */
|
|
12082
|
+
return /* @__PURE__ */ jsx30(AudioForRendering, {
|
|
11949
12083
|
onDuration,
|
|
11950
12084
|
...props,
|
|
11951
12085
|
ref,
|
|
@@ -11953,7 +12087,7 @@ var AudioRefForwardingFunction = (props, ref) => {
|
|
|
11953
12087
|
_remotionInternalNeedsDurationCalculation: Boolean(loop)
|
|
11954
12088
|
});
|
|
11955
12089
|
}
|
|
11956
|
-
return /* @__PURE__ */
|
|
12090
|
+
return /* @__PURE__ */ jsx30(AudioForPreview, {
|
|
11957
12091
|
_remotionInternalNativeLoopPassed: props._remotionInternalNativeLoopPassed ?? false,
|
|
11958
12092
|
_remotionInternalStack: _remotionInternalStack ?? null,
|
|
11959
12093
|
shouldPreMountAudioTags: audioTagsContext !== null && audioTagsContext.numberOfAudioTags > 0,
|
|
@@ -11973,13 +12107,13 @@ var Audio = Html5Audio;
|
|
|
11973
12107
|
import {
|
|
11974
12108
|
forwardRef as forwardRef8,
|
|
11975
12109
|
useCallback as useCallback18,
|
|
11976
|
-
useEffect as
|
|
12110
|
+
useEffect as useEffect18,
|
|
11977
12111
|
useImperativeHandle as useImperativeHandle6,
|
|
11978
12112
|
useMemo as useMemo36,
|
|
11979
12113
|
useRef as useRef23,
|
|
11980
|
-
useState as
|
|
12114
|
+
useState as useState18
|
|
11981
12115
|
} from "react";
|
|
11982
|
-
import { jsx as
|
|
12116
|
+
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
11983
12117
|
var resolveSolidPixelDensity = (pixelDensity) => {
|
|
11984
12118
|
if (pixelDensity === undefined) {
|
|
11985
12119
|
return 1;
|
|
@@ -12033,6 +12167,7 @@ var SolidInner = ({
|
|
|
12033
12167
|
width,
|
|
12034
12168
|
height,
|
|
12035
12169
|
effects = [],
|
|
12170
|
+
effectsOutputSize = null,
|
|
12036
12171
|
className,
|
|
12037
12172
|
style,
|
|
12038
12173
|
pixelDensity,
|
|
@@ -12044,7 +12179,7 @@ var SolidInner = ({
|
|
|
12044
12179
|
const resolvedPixelDensity = resolveSolidPixelDensity(pixelDensity);
|
|
12045
12180
|
const canvasWidth = Math.ceil(width * resolvedPixelDensity);
|
|
12046
12181
|
const canvasHeight = Math.ceil(height * resolvedPixelDensity);
|
|
12047
|
-
const [outputCanvas, setOutputCanvas] =
|
|
12182
|
+
const [outputCanvas, setOutputCanvas] = useState18(null);
|
|
12048
12183
|
const memoizedEffects = useMemoizedEffects({
|
|
12049
12184
|
effects,
|
|
12050
12185
|
overrideId: overrideId ?? null,
|
|
@@ -12059,7 +12194,7 @@ var SolidInner = ({
|
|
|
12059
12194
|
canvas.height = 1;
|
|
12060
12195
|
return canvas;
|
|
12061
12196
|
}, []);
|
|
12062
|
-
const chainState = useEffectChainState();
|
|
12197
|
+
const chainState = useEffectChainState(effectsOutputSize);
|
|
12063
12198
|
const canvasRef = useCallback18((canvas) => {
|
|
12064
12199
|
setOutputCanvas(canvas);
|
|
12065
12200
|
if (typeof reference === "function") {
|
|
@@ -12068,7 +12203,7 @@ var SolidInner = ({
|
|
|
12068
12203
|
reference.current = canvas;
|
|
12069
12204
|
}
|
|
12070
12205
|
}, [reference]);
|
|
12071
|
-
|
|
12206
|
+
useEffect18(() => {
|
|
12072
12207
|
if (!outputCanvas || !sourceCanvas) {
|
|
12073
12208
|
return;
|
|
12074
12209
|
}
|
|
@@ -12125,7 +12260,7 @@ var SolidInner = ({
|
|
|
12125
12260
|
...style ?? {}
|
|
12126
12261
|
};
|
|
12127
12262
|
}, [height, style, width]);
|
|
12128
|
-
return /* @__PURE__ */
|
|
12263
|
+
return /* @__PURE__ */ jsx31("canvas", {
|
|
12129
12264
|
ref: canvasRef,
|
|
12130
12265
|
width: canvasWidth,
|
|
12131
12266
|
height: canvasHeight,
|
|
@@ -12135,6 +12270,7 @@ var SolidInner = ({
|
|
|
12135
12270
|
};
|
|
12136
12271
|
var SolidOuter = forwardRef8(({
|
|
12137
12272
|
effects = [],
|
|
12273
|
+
effectsOutputSize = null,
|
|
12138
12274
|
controls,
|
|
12139
12275
|
color,
|
|
12140
12276
|
height,
|
|
@@ -12196,11 +12332,11 @@ var SolidOuter = forwardRef8(({
|
|
|
12196
12332
|
style: premountingStyle,
|
|
12197
12333
|
componentName: "<Solid />"
|
|
12198
12334
|
});
|
|
12199
|
-
return /* @__PURE__ */
|
|
12335
|
+
return /* @__PURE__ */ jsx31(Freeze, {
|
|
12200
12336
|
frame: freezeFrame,
|
|
12201
12337
|
active: isPremountingOrPostmounting,
|
|
12202
12338
|
_remotionInternalIsPremounting: premountingActive,
|
|
12203
|
-
children: /* @__PURE__ */
|
|
12339
|
+
children: /* @__PURE__ */ jsx31(Sequence, {
|
|
12204
12340
|
layout: "none",
|
|
12205
12341
|
from,
|
|
12206
12342
|
trimBefore,
|
|
@@ -12219,8 +12355,8 @@ var SolidOuter = forwardRef8(({
|
|
|
12219
12355
|
_remotionInternalPostmountDisplay: effectivePostmountFor || null,
|
|
12220
12356
|
_remotionInternalIsPremounting: premountingActive,
|
|
12221
12357
|
_remotionInternalIsPostmounting: postmountingActive,
|
|
12222
|
-
children: /* @__PURE__ */
|
|
12223
|
-
children: /* @__PURE__ */
|
|
12358
|
+
children: /* @__PURE__ */ jsx31(SequenceContent, {
|
|
12359
|
+
children: /* @__PURE__ */ jsx31(SolidInner, {
|
|
12224
12360
|
reference: actualRef,
|
|
12225
12361
|
videoConfigValues: controls?.videoConfigValues ?? null,
|
|
12226
12362
|
overrideId: controls?.overrideId ?? null,
|
|
@@ -12230,6 +12366,7 @@ var SolidOuter = forwardRef8(({
|
|
|
12230
12366
|
className,
|
|
12231
12367
|
style: croppedStyle ?? undefined,
|
|
12232
12368
|
effects,
|
|
12369
|
+
effectsOutputSize,
|
|
12233
12370
|
pixelDensity
|
|
12234
12371
|
})
|
|
12235
12372
|
})
|
|
@@ -12250,12 +12387,12 @@ import {
|
|
|
12250
12387
|
createContext as createContext36,
|
|
12251
12388
|
forwardRef as forwardRef9,
|
|
12252
12389
|
useCallback as useCallback19,
|
|
12253
|
-
useContext as
|
|
12390
|
+
useContext as useContext45,
|
|
12254
12391
|
useLayoutEffect as useLayoutEffect16,
|
|
12255
12392
|
useMemo as useMemo37,
|
|
12256
12393
|
useRef as useRef24
|
|
12257
12394
|
} from "react";
|
|
12258
|
-
import { jsx as
|
|
12395
|
+
import { jsx as jsx32, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
12259
12396
|
var transferredOffscreenCanvases = new WeakMap;
|
|
12260
12397
|
var getTransferredOffscreenCanvas = (canvas) => {
|
|
12261
12398
|
const existing = transferredOffscreenCanvases.get(canvas);
|
|
@@ -12367,6 +12504,7 @@ var HtmlInCanvasContent = forwardRef9(({
|
|
|
12367
12504
|
width,
|
|
12368
12505
|
height,
|
|
12369
12506
|
effects,
|
|
12507
|
+
effectsOutputSize,
|
|
12370
12508
|
children,
|
|
12371
12509
|
canvasSiblings,
|
|
12372
12510
|
onPaint,
|
|
@@ -12376,7 +12514,7 @@ var HtmlInCanvasContent = forwardRef9(({
|
|
|
12376
12514
|
style,
|
|
12377
12515
|
renderFrame
|
|
12378
12516
|
}, ref) => {
|
|
12379
|
-
const ancestorPaintState =
|
|
12517
|
+
const ancestorPaintState = useContext45(HtmlInCanvasAncestorContext);
|
|
12380
12518
|
assertHtmlInCanvasDimensions(width, height);
|
|
12381
12519
|
if (ancestorPaintState && !isHtmlInCanvasNestingSupported()) {
|
|
12382
12520
|
throw new Error(`Nested <HtmlInCanvas> components require Chrome ${MINIMUM_CHROME_VERSION_FOR_NESTED_HTML_IN_CANVAS} or newer with HTML-in-canvas enabled.`);
|
|
@@ -12440,7 +12578,7 @@ var HtmlInCanvasContent = forwardRef9(({
|
|
|
12440
12578
|
ref.current = node;
|
|
12441
12579
|
}
|
|
12442
12580
|
}, [ref, paintTargetMode]);
|
|
12443
|
-
const chainState = useEffectChainState();
|
|
12581
|
+
const chainState = useEffectChainState(effectsOutputSize);
|
|
12444
12582
|
const memoizedEffects = useMemoizedEffects({
|
|
12445
12583
|
effects,
|
|
12446
12584
|
overrideId: controls?.overrideId ?? null,
|
|
@@ -12724,7 +12862,7 @@ var HtmlInCanvasContent = forwardRef9(({
|
|
|
12724
12862
|
pointerEvents: "none"
|
|
12725
12863
|
} : canvasStyle,
|
|
12726
12864
|
children: [
|
|
12727
|
-
/* @__PURE__ */
|
|
12865
|
+
/* @__PURE__ */ jsx32("div", {
|
|
12728
12866
|
ref: divRef,
|
|
12729
12867
|
style: paintTargetMode === "copied" ? { ...innerStyle, visibility: "visible" } : innerStyle,
|
|
12730
12868
|
children
|
|
@@ -12732,7 +12870,7 @@ var HtmlInCanvasContent = forwardRef9(({
|
|
|
12732
12870
|
canvasSiblings
|
|
12733
12871
|
]
|
|
12734
12872
|
}, canvasSizeKey),
|
|
12735
|
-
paintTargetMode === "copied" ? /* @__PURE__ */
|
|
12873
|
+
paintTargetMode === "copied" ? /* @__PURE__ */ jsx32("canvas", {
|
|
12736
12874
|
ref: setVisibleCanvasRef,
|
|
12737
12875
|
width: canvasWidth,
|
|
12738
12876
|
height: canvasHeight,
|
|
@@ -12744,7 +12882,7 @@ var HtmlInCanvasContent = forwardRef9(({
|
|
|
12744
12882
|
HtmlInCanvasContent.displayName = "HtmlInCanvasContent";
|
|
12745
12883
|
var HtmlInCanvasContentForRendering = forwardRef9((props, ref) => {
|
|
12746
12884
|
const frame = useCurrentFrame();
|
|
12747
|
-
return /* @__PURE__ */
|
|
12885
|
+
return /* @__PURE__ */ jsx32(HtmlInCanvasContent, {
|
|
12748
12886
|
...props,
|
|
12749
12887
|
ref,
|
|
12750
12888
|
renderFrame: frame
|
|
@@ -12755,6 +12893,7 @@ var HtmlInCanvasInner = forwardRef9(({
|
|
|
12755
12893
|
width,
|
|
12756
12894
|
height,
|
|
12757
12895
|
effects = [],
|
|
12896
|
+
effectsOutputSize,
|
|
12758
12897
|
children,
|
|
12759
12898
|
onPaint,
|
|
12760
12899
|
onInit,
|
|
@@ -12816,11 +12955,11 @@ var HtmlInCanvasInner = forwardRef9(({
|
|
|
12816
12955
|
style: premountingStyle,
|
|
12817
12956
|
componentName: "<HtmlInCanvas />"
|
|
12818
12957
|
});
|
|
12819
|
-
return /* @__PURE__ */
|
|
12958
|
+
return /* @__PURE__ */ jsx32(Freeze, {
|
|
12820
12959
|
frame: freezeFrame,
|
|
12821
12960
|
active: isPremountingOrPostmounting,
|
|
12822
12961
|
_remotionInternalIsPremounting: premountingActive,
|
|
12823
|
-
children: /* @__PURE__ */
|
|
12962
|
+
children: /* @__PURE__ */ jsx32(Sequence, {
|
|
12824
12963
|
layout: "none",
|
|
12825
12964
|
durationInFrames,
|
|
12826
12965
|
name: name ?? "<HtmlInCanvas>",
|
|
@@ -12832,12 +12971,13 @@ var HtmlInCanvasInner = forwardRef9(({
|
|
|
12832
12971
|
_remotionInternalPostmountDisplay: effectivePostmountFor || null,
|
|
12833
12972
|
_remotionInternalIsPremounting: premountingActive,
|
|
12834
12973
|
_remotionInternalIsPostmounting: postmountingActive,
|
|
12835
|
-
children: /* @__PURE__ */
|
|
12974
|
+
children: /* @__PURE__ */ jsx32(Content, {
|
|
12836
12975
|
ref: setCanvasRef,
|
|
12837
12976
|
renderFrame: null,
|
|
12838
12977
|
width,
|
|
12839
12978
|
height,
|
|
12840
12979
|
effects,
|
|
12980
|
+
effectsOutputSize: effectsOutputSize ?? null,
|
|
12841
12981
|
onPaint,
|
|
12842
12982
|
onInit,
|
|
12843
12983
|
pixelDensity,
|
|
@@ -12885,12 +13025,12 @@ addSequenceStackTraces(HtmlInCanvas);
|
|
|
12885
13025
|
import {
|
|
12886
13026
|
forwardRef as forwardRef10,
|
|
12887
13027
|
useCallback as useCallback20,
|
|
12888
|
-
useContext as
|
|
13028
|
+
useContext as useContext46,
|
|
12889
13029
|
useImperativeHandle as useImperativeHandle7,
|
|
12890
13030
|
useLayoutEffect as useLayoutEffect17,
|
|
12891
13031
|
useMemo as useMemo38,
|
|
12892
13032
|
useRef as useRef25,
|
|
12893
|
-
useState as
|
|
13033
|
+
useState as useState19
|
|
12894
13034
|
} from "react";
|
|
12895
13035
|
|
|
12896
13036
|
// src/truncate-src-for-label.ts
|
|
@@ -12905,7 +13045,7 @@ function truncateSrcForLabel(src) {
|
|
|
12905
13045
|
}
|
|
12906
13046
|
|
|
12907
13047
|
// src/canvas-image/CanvasImage.tsx
|
|
12908
|
-
import { jsx as
|
|
13048
|
+
import { jsx as jsx33 } from "react/jsx-runtime";
|
|
12909
13049
|
var canvasImageSchema = {
|
|
12910
13050
|
src: {
|
|
12911
13051
|
type: "asset",
|
|
@@ -13010,6 +13150,7 @@ var CanvasImageContent = forwardRef10(({
|
|
|
13010
13150
|
height,
|
|
13011
13151
|
fit = "fill",
|
|
13012
13152
|
effects,
|
|
13153
|
+
effectsOutputSize,
|
|
13013
13154
|
controls,
|
|
13014
13155
|
onError,
|
|
13015
13156
|
className,
|
|
@@ -13023,18 +13164,18 @@ var CanvasImageContent = forwardRef10(({
|
|
|
13023
13164
|
}, ref) => {
|
|
13024
13165
|
const { delayRender, continueRender, cancelRender } = useDelayRender();
|
|
13025
13166
|
const { delayPlayback } = useBufferState();
|
|
13026
|
-
const [outputCanvas, setOutputCanvas] =
|
|
13027
|
-
const [loadedImage, setLoadedImage] =
|
|
13167
|
+
const [outputCanvas, setOutputCanvas] = useState19(null);
|
|
13168
|
+
const [loadedImage, setLoadedImage] = useState19(null);
|
|
13028
13169
|
const actualSrc = usePreload(src);
|
|
13029
|
-
const chainState = useEffectChainState();
|
|
13170
|
+
const chainState = useEffectChainState(effectsOutputSize);
|
|
13030
13171
|
const memoizedEffects = useMemoizedEffects({
|
|
13031
13172
|
effects,
|
|
13032
13173
|
overrideId: controls?.overrideId ?? null,
|
|
13033
13174
|
videoConfigValues: controls?.videoConfigValues ?? null
|
|
13034
13175
|
});
|
|
13035
|
-
const sequenceContext =
|
|
13176
|
+
const sequenceContext = useContext46(SequenceContext);
|
|
13036
13177
|
const pendingLoadDelayRef = useRef25(null);
|
|
13037
|
-
const [isLoadPending, setIsLoadPending] =
|
|
13178
|
+
const [isLoadPending, setIsLoadPending] = useState19(false);
|
|
13038
13179
|
const isPremounting = Boolean(sequenceContext?.premounting);
|
|
13039
13180
|
const isPostmounting = Boolean(sequenceContext?.postmounting);
|
|
13040
13181
|
const continuePendingLoadDelay = useCallback20(({ markAsReady }) => {
|
|
@@ -13225,7 +13366,7 @@ var CanvasImageContent = forwardRef10(({
|
|
|
13225
13366
|
sourceCanvas,
|
|
13226
13367
|
width
|
|
13227
13368
|
]);
|
|
13228
|
-
return /* @__PURE__ */
|
|
13369
|
+
return /* @__PURE__ */ jsx33("canvas", {
|
|
13229
13370
|
...canvasProps,
|
|
13230
13371
|
ref: canvasRef,
|
|
13231
13372
|
width,
|
|
@@ -13243,6 +13384,7 @@ var CanvasImageInner = forwardRef10(({
|
|
|
13243
13384
|
height,
|
|
13244
13385
|
fit,
|
|
13245
13386
|
effects = [],
|
|
13387
|
+
effectsOutputSize,
|
|
13246
13388
|
className,
|
|
13247
13389
|
style,
|
|
13248
13390
|
id,
|
|
@@ -13314,11 +13456,11 @@ var CanvasImageInner = forwardRef10(({
|
|
|
13314
13456
|
style: premountingStyle,
|
|
13315
13457
|
componentName: _remotionInternalCropComponentName ?? "<CanvasImage />"
|
|
13316
13458
|
});
|
|
13317
|
-
return /* @__PURE__ */
|
|
13459
|
+
return /* @__PURE__ */ jsx33(Freeze, {
|
|
13318
13460
|
frame: freezeFrame,
|
|
13319
13461
|
active: isPremountingOrPostmounting,
|
|
13320
13462
|
_remotionInternalIsPremounting: premountingActive,
|
|
13321
|
-
children: /* @__PURE__ */
|
|
13463
|
+
children: /* @__PURE__ */ jsx33(Sequence, {
|
|
13322
13464
|
layout: "none",
|
|
13323
13465
|
from: from ?? 0,
|
|
13324
13466
|
trimBefore,
|
|
@@ -13336,8 +13478,8 @@ var CanvasImageInner = forwardRef10(({
|
|
|
13336
13478
|
_remotionInternalPostmountDisplay: effectivePostmountFor || null,
|
|
13337
13479
|
_remotionInternalIsPremounting: premountingActive,
|
|
13338
13480
|
_remotionInternalIsPostmounting: postmountingActive,
|
|
13339
|
-
children: /* @__PURE__ */
|
|
13340
|
-
children: /* @__PURE__ */
|
|
13481
|
+
children: /* @__PURE__ */ jsx33(SequenceContent, {
|
|
13482
|
+
children: /* @__PURE__ */ jsx33(CanvasImageContent, {
|
|
13341
13483
|
ref: actualRef,
|
|
13342
13484
|
src,
|
|
13343
13485
|
crossOrigin,
|
|
@@ -13345,6 +13487,7 @@ var CanvasImageInner = forwardRef10(({
|
|
|
13345
13487
|
height,
|
|
13346
13488
|
fit,
|
|
13347
13489
|
effects,
|
|
13490
|
+
effectsOutputSize: effectsOutputSize ?? null,
|
|
13348
13491
|
controls,
|
|
13349
13492
|
className,
|
|
13350
13493
|
style: croppedStyle ?? undefined,
|
|
@@ -13402,7 +13545,7 @@ var getStaticFiles = () => {
|
|
|
13402
13545
|
};
|
|
13403
13546
|
// src/IFrame.tsx
|
|
13404
13547
|
import { forwardRef as forwardRef11, useCallback as useCallback21, useLayoutEffect as useLayoutEffect18, useRef as useRef26 } from "react";
|
|
13405
|
-
import { jsx as
|
|
13548
|
+
import { jsx as jsx34 } from "react/jsx-runtime";
|
|
13406
13549
|
var IFrameRefForwarding = ({
|
|
13407
13550
|
onLoad,
|
|
13408
13551
|
onError,
|
|
@@ -13456,7 +13599,7 @@ var IFrameRefForwarding = ({
|
|
|
13456
13599
|
console.error("Error loading iframe:", e, "Handle the event using the onError() prop to make this message disappear.");
|
|
13457
13600
|
}
|
|
13458
13601
|
}, [onError, continueRender, src, srcDoc]);
|
|
13459
|
-
return /* @__PURE__ */
|
|
13602
|
+
return /* @__PURE__ */ jsx34("iframe", {
|
|
13460
13603
|
referrerPolicy: "strict-origin-when-cross-origin",
|
|
13461
13604
|
...props,
|
|
13462
13605
|
ref,
|
|
@@ -13468,13 +13611,13 @@ var IFrame = forwardRef11(IFrameRefForwarding);
|
|
|
13468
13611
|
// src/Img.tsx
|
|
13469
13612
|
import {
|
|
13470
13613
|
useCallback as useCallback22,
|
|
13471
|
-
useContext as
|
|
13614
|
+
useContext as useContext47,
|
|
13472
13615
|
useLayoutEffect as useLayoutEffect19,
|
|
13473
13616
|
useMemo as useMemo39,
|
|
13474
13617
|
useRef as useRef27,
|
|
13475
|
-
useState as
|
|
13618
|
+
useState as useState20
|
|
13476
13619
|
} from "react";
|
|
13477
|
-
import { jsx as
|
|
13620
|
+
import { jsx as jsx35 } from "react/jsx-runtime";
|
|
13478
13621
|
function exponentialBackoff2(errorCount) {
|
|
13479
13622
|
return 1000 * 2 ** (errorCount - 1);
|
|
13480
13623
|
}
|
|
@@ -13495,8 +13638,8 @@ var ImgContent = ({
|
|
|
13495
13638
|
const imageRef = useRef27(null);
|
|
13496
13639
|
const errors = useRef27({});
|
|
13497
13640
|
const { delayPlayback } = useBufferState();
|
|
13498
|
-
const sequenceContext =
|
|
13499
|
-
const [isLoading, setIsLoading] =
|
|
13641
|
+
const sequenceContext = useContext47(SequenceContext);
|
|
13642
|
+
const [isLoading, setIsLoading] = useState20(false);
|
|
13500
13643
|
const _propsValid = true;
|
|
13501
13644
|
if (!_propsValid) {
|
|
13502
13645
|
throw new Error("typecheck error");
|
|
@@ -13628,7 +13771,7 @@ var ImgContent = ({
|
|
|
13628
13771
|
requestsVideoFrame: false,
|
|
13629
13772
|
isClientSideRendering
|
|
13630
13773
|
});
|
|
13631
|
-
return /* @__PURE__ */
|
|
13774
|
+
return /* @__PURE__ */ jsx35("img", {
|
|
13632
13775
|
...props,
|
|
13633
13776
|
ref: imageCallbackRef,
|
|
13634
13777
|
crossOrigin: crossOriginValue,
|
|
@@ -13695,11 +13838,11 @@ var NativeImgInner = ({
|
|
|
13695
13838
|
style: premountingStyle,
|
|
13696
13839
|
componentName: "<Img />"
|
|
13697
13840
|
});
|
|
13698
|
-
return /* @__PURE__ */
|
|
13841
|
+
return /* @__PURE__ */ jsx35(Freeze, {
|
|
13699
13842
|
frame: freezeFrame,
|
|
13700
13843
|
active: isPremountingOrPostmounting,
|
|
13701
13844
|
_remotionInternalIsPremounting: premountingActive,
|
|
13702
|
-
children: /* @__PURE__ */
|
|
13845
|
+
children: /* @__PURE__ */ jsx35(Sequence, {
|
|
13703
13846
|
layout: "none",
|
|
13704
13847
|
from: from ?? 0,
|
|
13705
13848
|
trimBefore,
|
|
@@ -13716,8 +13859,8 @@ var NativeImgInner = ({
|
|
|
13716
13859
|
controls,
|
|
13717
13860
|
showInTimeline: showInTimeline ?? true,
|
|
13718
13861
|
hidden,
|
|
13719
|
-
children: /* @__PURE__ */
|
|
13720
|
-
children: /* @__PURE__ */
|
|
13862
|
+
children: /* @__PURE__ */ jsx35(SequenceContent, {
|
|
13863
|
+
children: /* @__PURE__ */ jsx35(ImgContent, {
|
|
13721
13864
|
src,
|
|
13722
13865
|
style: croppedStyle ?? undefined,
|
|
13723
13866
|
...props
|
|
@@ -13786,6 +13929,7 @@ var getFitFromObjectFit = (style) => {
|
|
|
13786
13929
|
};
|
|
13787
13930
|
var ImgInner = ({
|
|
13788
13931
|
effects = [],
|
|
13932
|
+
effectsOutputSize,
|
|
13789
13933
|
ref,
|
|
13790
13934
|
hidden,
|
|
13791
13935
|
name,
|
|
@@ -13818,7 +13962,7 @@ var ImgInner = ({
|
|
|
13818
13962
|
}) => {
|
|
13819
13963
|
const shouldPauseWhenLoading = resolveV5Default(pauseWhenLoading);
|
|
13820
13964
|
if (effects.length === 0) {
|
|
13821
|
-
return /* @__PURE__ */
|
|
13965
|
+
return /* @__PURE__ */ jsx35(NativeImgInner, {
|
|
13822
13966
|
...props,
|
|
13823
13967
|
ref,
|
|
13824
13968
|
hidden,
|
|
@@ -13863,12 +14007,13 @@ var ImgInner = ({
|
|
|
13863
14007
|
const canvasHeight = typeof height === "number" ? height : undefined;
|
|
13864
14008
|
const canvasProps = props;
|
|
13865
14009
|
const canvasFit = getFitFromObjectFit(style) ?? "fill";
|
|
13866
|
-
return /* @__PURE__ */
|
|
14010
|
+
return /* @__PURE__ */ jsx35(CanvasImageWithPrivateProps, {
|
|
13867
14011
|
src,
|
|
13868
14012
|
width: canvasWidth,
|
|
13869
14013
|
height: canvasHeight,
|
|
13870
14014
|
fit: canvasFit,
|
|
13871
14015
|
effects,
|
|
14016
|
+
effectsOutputSize,
|
|
13872
14017
|
className,
|
|
13873
14018
|
style,
|
|
13874
14019
|
cropLeft,
|
|
@@ -13907,8 +14052,8 @@ var Img = withInteractivitySchema({
|
|
|
13907
14052
|
});
|
|
13908
14053
|
addSequenceStackTraces(Img);
|
|
13909
14054
|
// src/Interactive.tsx
|
|
13910
|
-
import
|
|
13911
|
-
import { jsx as
|
|
14055
|
+
import React42, { forwardRef as forwardRef12, useCallback as useCallback23, useContext as useContext48 } from "react";
|
|
14056
|
+
import { jsx as jsx36 } from "react/jsx-runtime";
|
|
13912
14057
|
var sourcePathToIdentityPrefix = (packageName) => {
|
|
13913
14058
|
if (packageName === "remotion") {
|
|
13914
14059
|
return "dev.remotion.remotion";
|
|
@@ -13995,7 +14140,7 @@ var withSchema = (untypedOptions) => {
|
|
|
13995
14140
|
...rest
|
|
13996
14141
|
} = options;
|
|
13997
14142
|
const ComponentWrappedInSequence = forwardRef12((props, ref) => {
|
|
13998
|
-
const { canvasContent, compositions } =
|
|
14143
|
+
const { canvasContent, compositions } = useContext48(CompositionManager);
|
|
13999
14144
|
const componentIdentity = resolveComponentIdentity(Wrapped);
|
|
14000
14145
|
const isCurrentComposition = compositions.some((composition) => canvasContent?.type === "composition" && composition.id === canvasContent.compositionId && composition.componentFromProps === componentIdentity);
|
|
14001
14146
|
const { width, height, ...propsWithoutDimensions } = props;
|
|
@@ -14054,10 +14199,10 @@ var withSchema = (untypedOptions) => {
|
|
|
14054
14199
|
style: premountingStyle,
|
|
14055
14200
|
componentName
|
|
14056
14201
|
});
|
|
14057
|
-
return /* @__PURE__ */
|
|
14202
|
+
return /* @__PURE__ */ jsx36(Freeze, {
|
|
14058
14203
|
frame: freezeFrame,
|
|
14059
14204
|
active: isPremountingOrPostmounting,
|
|
14060
|
-
children: /* @__PURE__ */
|
|
14205
|
+
children: /* @__PURE__ */ jsx36(SequenceWithoutSchema, {
|
|
14061
14206
|
_remotionInternalSingleChildComponent: isCurrentComposition ? null : componentIdentity,
|
|
14062
14207
|
layout,
|
|
14063
14208
|
...layout === "absolute-fill" ? {
|
|
@@ -14074,14 +14219,14 @@ var withSchema = (untypedOptions) => {
|
|
|
14074
14219
|
freeze,
|
|
14075
14220
|
hidden,
|
|
14076
14221
|
name: name ?? componentName,
|
|
14077
|
-
_remotionInternalDocumentationLink: "https://www.remotion.dev/docs/interactive-
|
|
14222
|
+
_remotionInternalDocumentationLink: "https://www.remotion.dev/docs/interactive-create",
|
|
14078
14223
|
showInTimeline: isCurrentComposition ? false : showInTimeline,
|
|
14079
14224
|
controls,
|
|
14080
14225
|
_remotionInternalPremountDisplay: effectivePremountFor || null,
|
|
14081
14226
|
_remotionInternalPostmountDisplay: effectivePostmountFor || null,
|
|
14082
14227
|
_remotionInternalIsPremounting: premountingActive,
|
|
14083
14228
|
_remotionInternalIsPostmounting: postmountingActive,
|
|
14084
|
-
children:
|
|
14229
|
+
children: React42.createElement(Component, {
|
|
14085
14230
|
...componentPropsWithoutCropping,
|
|
14086
14231
|
...layout === "none" ? { style: croppedStyle ?? undefined, ref } : {}
|
|
14087
14232
|
})
|
|
@@ -14104,6 +14249,15 @@ var withSchema = (untypedOptions) => {
|
|
|
14104
14249
|
addSequenceStackTraces(Wrapped);
|
|
14105
14250
|
return Wrapped;
|
|
14106
14251
|
};
|
|
14252
|
+
var create = (untypedOptions) => {
|
|
14253
|
+
const options = untypedOptions;
|
|
14254
|
+
return withSchema({
|
|
14255
|
+
...options,
|
|
14256
|
+
wrapInSequence: true,
|
|
14257
|
+
schema: options.schema ?? {},
|
|
14258
|
+
componentName: options.componentName ?? (options.Component.displayName || options.Component.name?.replace(/(.+)Inner$/, "$1") || "Component")
|
|
14259
|
+
});
|
|
14260
|
+
};
|
|
14107
14261
|
var makeInteractiveElement = (tag, displayName, schema) => {
|
|
14108
14262
|
const Inner = forwardRef12((propsWithControls, ref) => {
|
|
14109
14263
|
const {
|
|
@@ -14161,11 +14315,11 @@ var makeInteractiveElement = (tag, displayName, schema) => {
|
|
|
14161
14315
|
const callbackRef = useCallback23((element) => {
|
|
14162
14316
|
setRef2(ref, element);
|
|
14163
14317
|
}, [ref]);
|
|
14164
|
-
return /* @__PURE__ */
|
|
14318
|
+
return /* @__PURE__ */ jsx36(Freeze, {
|
|
14165
14319
|
frame: freezeFrame,
|
|
14166
14320
|
active: isPremountingOrPostmounting,
|
|
14167
14321
|
_remotionInternalIsPremounting: premountingActive,
|
|
14168
|
-
children: /* @__PURE__ */
|
|
14322
|
+
children: /* @__PURE__ */ jsx36(Sequence, {
|
|
14169
14323
|
layout: "none",
|
|
14170
14324
|
from: from ?? 0,
|
|
14171
14325
|
trimBefore,
|
|
@@ -14182,7 +14336,7 @@ var makeInteractiveElement = (tag, displayName, schema) => {
|
|
|
14182
14336
|
_remotionInternalPostmountDisplay: effectivePostmountFor || null,
|
|
14183
14337
|
_remotionInternalIsPremounting: premountingActive,
|
|
14184
14338
|
_remotionInternalIsPostmounting: postmountingActive,
|
|
14185
|
-
children:
|
|
14339
|
+
children: React42.createElement(tag, {
|
|
14186
14340
|
...props,
|
|
14187
14341
|
style: croppedStyle ?? undefined,
|
|
14188
14342
|
ref: callbackRef
|
|
@@ -14228,6 +14382,7 @@ var Interactive = {
|
|
|
14228
14382
|
premountSchema,
|
|
14229
14383
|
sequenceSchema,
|
|
14230
14384
|
withSchema,
|
|
14385
|
+
create,
|
|
14231
14386
|
_internalMakeRemotionComponentIdentity: makeRemotionComponentIdentity,
|
|
14232
14387
|
A: makeInteractiveTextElement("a", "<Interactive.A>"),
|
|
14233
14388
|
Article: makeInteractiveTextElement("article", "<Interactive.Article>"),
|
|
@@ -14277,8 +14432,8 @@ var getAudioSyncAnchorTolerance = (audioContext) => {
|
|
|
14277
14432
|
};
|
|
14278
14433
|
|
|
14279
14434
|
// src/CompositionManager.tsx
|
|
14280
|
-
import
|
|
14281
|
-
var compositionsRef =
|
|
14435
|
+
import React43 from "react";
|
|
14436
|
+
var compositionsRef = React43.createRef();
|
|
14282
14437
|
|
|
14283
14438
|
// src/CompositionManagerProvider.tsx
|
|
14284
14439
|
import {
|
|
@@ -14286,27 +14441,27 @@ import {
|
|
|
14286
14441
|
useImperativeHandle as useImperativeHandle9,
|
|
14287
14442
|
useMemo as useMemo41,
|
|
14288
14443
|
useRef as useRef29,
|
|
14289
|
-
useState as
|
|
14444
|
+
useState as useState22
|
|
14290
14445
|
} from "react";
|
|
14291
14446
|
|
|
14292
14447
|
// src/CompositionRegistryProvider.tsx
|
|
14293
14448
|
import {
|
|
14294
14449
|
forwardRef as forwardRef13,
|
|
14295
14450
|
useCallback as useCallback24,
|
|
14296
|
-
useEffect as
|
|
14451
|
+
useEffect as useEffect19,
|
|
14297
14452
|
useImperativeHandle as useImperativeHandle8,
|
|
14298
14453
|
useLayoutEffect as useLayoutEffect20,
|
|
14299
14454
|
useMemo as useMemo40,
|
|
14300
14455
|
useRef as useRef28,
|
|
14301
|
-
useState as
|
|
14456
|
+
useState as useState21
|
|
14302
14457
|
} from "react";
|
|
14303
|
-
import { jsx as
|
|
14304
|
-
var useIsomorphicLayoutEffect6 = typeof window === "undefined" ?
|
|
14458
|
+
import { jsx as jsx37 } from "react/jsx-runtime";
|
|
14459
|
+
var useIsomorphicLayoutEffect6 = typeof window === "undefined" ? useEffect19 : useLayoutEffect20;
|
|
14305
14460
|
var CompositionRegistryFallbackProvider = withCommittedMetadata(CompositionRegistryFallbackContext.Provider);
|
|
14306
14461
|
var CompositionRegistryProvider = forwardRef13(({ children, onSnapshot }, flushSnapshotRef) => {
|
|
14307
14462
|
const { isStudio } = useRemotionEnvironment();
|
|
14308
|
-
const [managerId] =
|
|
14309
|
-
const [useCommitObserver, setUseCommitObserver] =
|
|
14463
|
+
const [managerId] = useState21(() => String(Math.random()));
|
|
14464
|
+
const [useCommitObserver, setUseCommitObserver] = useState21(() => isStudio && isCommitRegistrationObserverInstalled());
|
|
14310
14465
|
const observedCommitRef = useRef28(false);
|
|
14311
14466
|
const observerFailedRef = useRef28(false);
|
|
14312
14467
|
const unmountedRef = useRef28(false);
|
|
@@ -14419,7 +14574,7 @@ var CompositionRegistryProvider = forwardRef13(({ children, onSnapshot }, flushS
|
|
|
14419
14574
|
id: managerId,
|
|
14420
14575
|
onCommit: useCommitObserver ? onObservedSnapshot : null
|
|
14421
14576
|
} : null, [isStudio, managerId, onObservedSnapshot, useCommitObserver]);
|
|
14422
|
-
return /* @__PURE__ */
|
|
14577
|
+
return /* @__PURE__ */ jsx37(CompositionRegistryFallbackProvider, {
|
|
14423
14578
|
value: useCommitObserver ? null : fallbackRegistry,
|
|
14424
14579
|
_remotionCommitMetadata: metadata,
|
|
14425
14580
|
children
|
|
@@ -14427,7 +14582,7 @@ var CompositionRegistryProvider = forwardRef13(({ children, onSnapshot }, flushS
|
|
|
14427
14582
|
});
|
|
14428
14583
|
|
|
14429
14584
|
// src/CompositionManagerProvider.tsx
|
|
14430
|
-
import { jsx as
|
|
14585
|
+
import { jsx as jsx38 } from "react/jsx-runtime";
|
|
14431
14586
|
var CompositionManagerProvider = ({
|
|
14432
14587
|
children,
|
|
14433
14588
|
onlyRenderComposition,
|
|
@@ -14438,8 +14593,8 @@ var CompositionManagerProvider = ({
|
|
|
14438
14593
|
const committedKeysRef = useRef29(new Set);
|
|
14439
14594
|
const flushSnapshotRef = useRef29(null);
|
|
14440
14595
|
const committedDescriptorsRef = useRef29(new Map);
|
|
14441
|
-
const [registrationError, setRegistrationError] =
|
|
14442
|
-
const [registry] =
|
|
14596
|
+
const [registrationError, setRegistrationError] = useState22(null);
|
|
14597
|
+
const [registry] = useState22(() => createRegistryStore({
|
|
14443
14598
|
compositions: initialCompositions.map((composition, order) => ({
|
|
14444
14599
|
...composition,
|
|
14445
14600
|
order
|
|
@@ -14447,8 +14602,8 @@ var CompositionManagerProvider = ({
|
|
|
14447
14602
|
folders: []
|
|
14448
14603
|
}));
|
|
14449
14604
|
const { compositions, folders } = useSyncExternalStore2(registry.subscribe, registry.getSnapshot, registry.getSnapshot);
|
|
14450
|
-
const [canvasContent, setCanvasContent] =
|
|
14451
|
-
const [currentAssetMetadata, setCurrentAssetMetadata] =
|
|
14605
|
+
const [canvasContent, setCanvasContent] = useState22(initialCanvasContent);
|
|
14606
|
+
const [currentAssetMetadata, setCurrentAssetMetadata] = useState22(null);
|
|
14452
14607
|
const onCommitRegistrations = useCallback25((pending) => {
|
|
14453
14608
|
const previousKeys = committedKeysRef.current;
|
|
14454
14609
|
const previousDescriptors = committedDescriptorsRef.current;
|
|
@@ -14524,12 +14679,12 @@ var CompositionManagerProvider = ({
|
|
|
14524
14679
|
if (registrationError !== null) {
|
|
14525
14680
|
throw registrationError;
|
|
14526
14681
|
}
|
|
14527
|
-
return /* @__PURE__ */
|
|
14682
|
+
return /* @__PURE__ */ jsx38(CompositionRegistryProvider, {
|
|
14528
14683
|
ref: flushSnapshotRef,
|
|
14529
14684
|
onSnapshot: onCommitRegistrations,
|
|
14530
|
-
children: /* @__PURE__ */
|
|
14685
|
+
children: /* @__PURE__ */ jsx38(CompositionManager.Provider, {
|
|
14531
14686
|
value: compositionManagerContextValue,
|
|
14532
|
-
children: /* @__PURE__ */
|
|
14687
|
+
children: /* @__PURE__ */ jsx38(CompositionSetters.Provider, {
|
|
14533
14688
|
value: compositionManagerSetters,
|
|
14534
14689
|
children
|
|
14535
14690
|
})
|
|
@@ -14626,8 +14781,8 @@ var getPreviewDomElement = () => {
|
|
|
14626
14781
|
};
|
|
14627
14782
|
|
|
14628
14783
|
// src/max-video-cache-size.ts
|
|
14629
|
-
import
|
|
14630
|
-
var MaxMediaCacheSizeContext =
|
|
14784
|
+
import React44 from "react";
|
|
14785
|
+
var MaxMediaCacheSizeContext = React44.createContext(null);
|
|
14631
14786
|
|
|
14632
14787
|
// src/media-resource-manager.ts
|
|
14633
14788
|
var disposeResource = (resource) => {
|
|
@@ -14781,7 +14936,7 @@ var waitForRoot = (fn) => {
|
|
|
14781
14936
|
|
|
14782
14937
|
// src/RemotionRoot.tsx
|
|
14783
14938
|
import { useMemo as useMemo42 } from "react";
|
|
14784
|
-
import { jsx as
|
|
14939
|
+
import { jsx as jsx39 } from "react/jsx-runtime";
|
|
14785
14940
|
var RemotionRootContexts = ({
|
|
14786
14941
|
children,
|
|
14787
14942
|
numberOfAudioTags,
|
|
@@ -14796,26 +14951,26 @@ var RemotionRootContexts = ({
|
|
|
14796
14951
|
const logging = useMemo42(() => {
|
|
14797
14952
|
return { logLevel, mountTime: Date.now() };
|
|
14798
14953
|
}, [logLevel]);
|
|
14799
|
-
return /* @__PURE__ */
|
|
14954
|
+
return /* @__PURE__ */ jsx39(LogLevelContext.Provider, {
|
|
14800
14955
|
value: logging,
|
|
14801
|
-
children: /* @__PURE__ */
|
|
14956
|
+
children: /* @__PURE__ */ jsx39(TimelineContextProvider, {
|
|
14802
14957
|
frameState,
|
|
14803
|
-
children: /* @__PURE__ */
|
|
14958
|
+
children: /* @__PURE__ */ jsx39(MediaEnabledProvider, {
|
|
14804
14959
|
videoEnabled,
|
|
14805
14960
|
audioEnabled,
|
|
14806
|
-
children: /* @__PURE__ */
|
|
14807
|
-
children: /* @__PURE__ */
|
|
14808
|
-
children: /* @__PURE__ */
|
|
14809
|
-
children: /* @__PURE__ */
|
|
14810
|
-
children: /* @__PURE__ */
|
|
14811
|
-
children: /* @__PURE__ */
|
|
14961
|
+
children: /* @__PURE__ */ jsx39(EditorPropsProvider, {
|
|
14962
|
+
children: /* @__PURE__ */ jsx39(PrefetchProvider, {
|
|
14963
|
+
children: /* @__PURE__ */ jsx39(SequenceManagerProvider, {
|
|
14964
|
+
children: /* @__PURE__ */ jsx39(DurationsContextProvider, {
|
|
14965
|
+
children: /* @__PURE__ */ jsx39(BufferingProvider, {
|
|
14966
|
+
children: /* @__PURE__ */ jsx39(SharedAudioContextProvider, {
|
|
14812
14967
|
audioLatencyHint,
|
|
14813
14968
|
audioEnabled,
|
|
14814
14969
|
previewSampleRate,
|
|
14815
14970
|
_experimentalKeepAudioContextAlive,
|
|
14816
|
-
children: /* @__PURE__ */
|
|
14971
|
+
children: /* @__PURE__ */ jsx39(SharedAudioTagsContextProvider, {
|
|
14817
14972
|
numberOfAudioTags,
|
|
14818
|
-
children: /* @__PURE__ */
|
|
14973
|
+
children: /* @__PURE__ */ jsx39(VideoProvider, {
|
|
14819
14974
|
children
|
|
14820
14975
|
})
|
|
14821
14976
|
})
|
|
@@ -14831,7 +14986,7 @@ var RemotionRootContexts = ({
|
|
|
14831
14986
|
};
|
|
14832
14987
|
|
|
14833
14988
|
// src/render-resource-manager.ts
|
|
14834
|
-
import
|
|
14989
|
+
import React46 from "react";
|
|
14835
14990
|
var makeRenderResourceManager = () => {
|
|
14836
14991
|
const resources = new Map;
|
|
14837
14992
|
let disposed = false;
|
|
@@ -14872,7 +15027,7 @@ var makeRenderResourceManager = () => {
|
|
|
14872
15027
|
}
|
|
14873
15028
|
};
|
|
14874
15029
|
};
|
|
14875
|
-
var RenderResourceManagerContext =
|
|
15030
|
+
var RenderResourceManagerContext = React46.createContext(null);
|
|
14876
15031
|
|
|
14877
15032
|
// src/codec.ts
|
|
14878
15033
|
var validCodecs = [
|
|
@@ -15063,8 +15218,8 @@ var resolveVideoConfigOrCatch = (params) => {
|
|
|
15063
15218
|
};
|
|
15064
15219
|
|
|
15065
15220
|
// src/sequence-stack-traces.ts
|
|
15066
|
-
import
|
|
15067
|
-
var SequenceStackTracesUpdateContext =
|
|
15221
|
+
import React47 from "react";
|
|
15222
|
+
var SequenceStackTracesUpdateContext = React47.createContext(() => {});
|
|
15068
15223
|
|
|
15069
15224
|
// src/setup-env-variables.ts
|
|
15070
15225
|
var getEnvVariables = () => {
|
|
@@ -15094,8 +15249,8 @@ var setupEnvVariables = () => {
|
|
|
15094
15249
|
};
|
|
15095
15250
|
|
|
15096
15251
|
// src/Track.tsx
|
|
15097
|
-
import {
|
|
15098
|
-
import { jsx as
|
|
15252
|
+
import { useMemo as useMemo43, useState as useState23 } from "react";
|
|
15253
|
+
import { jsx as jsx40 } from "react/jsx-runtime";
|
|
15099
15254
|
var {
|
|
15100
15255
|
freeze: _freeze,
|
|
15101
15256
|
layout: _layout,
|
|
@@ -15111,12 +15266,11 @@ var TrackWithoutSchema = ({
|
|
|
15111
15266
|
layout = "none",
|
|
15112
15267
|
...props
|
|
15113
15268
|
}) => {
|
|
15114
|
-
const [id] =
|
|
15115
|
-
const
|
|
15116
|
-
|
|
15117
|
-
return /* @__PURE__ */ jsx39(TimelineTrackContext.Provider, {
|
|
15269
|
+
const [id] = useState23(() => String(Math.random()));
|
|
15270
|
+
const value = useMemo43(() => ({ id, name }), [id, name]);
|
|
15271
|
+
return /* @__PURE__ */ jsx40(TimelineTrackContext.Provider, {
|
|
15118
15272
|
value,
|
|
15119
|
-
children: /* @__PURE__ */
|
|
15273
|
+
children: /* @__PURE__ */ jsx40(SequenceWithoutSchema, {
|
|
15120
15274
|
_remotionInternalDocumentationLink: "https://www.remotion.dev/docs/track",
|
|
15121
15275
|
...props,
|
|
15122
15276
|
name,
|
|
@@ -15127,7 +15281,7 @@ var TrackWithoutSchema = ({
|
|
|
15127
15281
|
});
|
|
15128
15282
|
};
|
|
15129
15283
|
var Track = withInteractivitySchema({
|
|
15130
|
-
Component: (props) => /* @__PURE__ */
|
|
15284
|
+
Component: (props) => /* @__PURE__ */ jsx40(TrackWithoutSchema, {
|
|
15131
15285
|
...props,
|
|
15132
15286
|
layout: "none"
|
|
15133
15287
|
}),
|
|
@@ -15139,8 +15293,8 @@ var Track = withInteractivitySchema({
|
|
|
15139
15293
|
addSequenceStackTraces(Track);
|
|
15140
15294
|
|
|
15141
15295
|
// src/use-pixel-density.ts
|
|
15142
|
-
import
|
|
15143
|
-
var PixelDensityContext =
|
|
15296
|
+
import React49, { useContext as useContext49 } from "react";
|
|
15297
|
+
var PixelDensityContext = React49.createContext(null);
|
|
15144
15298
|
var getBrowserPixelDensity = () => {
|
|
15145
15299
|
if (typeof window === "undefined") {
|
|
15146
15300
|
return 1;
|
|
@@ -15172,10 +15326,10 @@ import { useCallback as useCallback28 } from "react";
|
|
|
15172
15326
|
import {
|
|
15173
15327
|
useCallback as useCallback26,
|
|
15174
15328
|
useContext as useContext50,
|
|
15175
|
-
useEffect as
|
|
15329
|
+
useEffect as useEffect20,
|
|
15176
15330
|
useLayoutEffect as useLayoutEffect21,
|
|
15177
15331
|
useMemo as useMemo44,
|
|
15178
|
-
useState as
|
|
15332
|
+
useState as useState24
|
|
15179
15333
|
} from "react";
|
|
15180
15334
|
|
|
15181
15335
|
// src/video/offthread-video-source.ts
|
|
@@ -15189,7 +15343,7 @@ var getOffthreadVideoSource = ({
|
|
|
15189
15343
|
};
|
|
15190
15344
|
|
|
15191
15345
|
// src/video/OffthreadVideoForRendering.tsx
|
|
15192
|
-
import { jsx as
|
|
15346
|
+
import { jsx as jsx41 } from "react/jsx-runtime";
|
|
15193
15347
|
var OffthreadVideoForRendering = ({
|
|
15194
15348
|
onError,
|
|
15195
15349
|
volume: volumeProp,
|
|
@@ -15242,7 +15396,7 @@ var OffthreadVideoForRendering = ({
|
|
|
15242
15396
|
if (!videoConfig) {
|
|
15243
15397
|
throw new Error("No video config found");
|
|
15244
15398
|
}
|
|
15245
|
-
|
|
15399
|
+
useEffect20(() => {
|
|
15246
15400
|
if (!src) {
|
|
15247
15401
|
throw new Error("No src passed");
|
|
15248
15402
|
}
|
|
@@ -15292,7 +15446,7 @@ var OffthreadVideoForRendering = ({
|
|
|
15292
15446
|
toneMapped
|
|
15293
15447
|
});
|
|
15294
15448
|
}, [toneMapped, currentTime, src, transparent]);
|
|
15295
|
-
const [imageSrc, setImageSrc] =
|
|
15449
|
+
const [imageSrc, setImageSrc] = useState24(null);
|
|
15296
15450
|
const { delayRender, continueRender } = useDelayRender();
|
|
15297
15451
|
useLayoutEffect21(() => {
|
|
15298
15452
|
if (!window.remotion_videoEnabled) {
|
|
@@ -15384,7 +15538,7 @@ var OffthreadVideoForRendering = ({
|
|
|
15384
15538
|
return null;
|
|
15385
15539
|
}
|
|
15386
15540
|
continueRender(imageSrc.handle);
|
|
15387
|
-
return /* @__PURE__ */
|
|
15541
|
+
return /* @__PURE__ */ jsx41(Img, {
|
|
15388
15542
|
src: imageSrc.src,
|
|
15389
15543
|
delayRenderRetries,
|
|
15390
15544
|
delayRenderTimeoutInMilliseconds,
|
|
@@ -15396,24 +15550,24 @@ var OffthreadVideoForRendering = ({
|
|
|
15396
15550
|
};
|
|
15397
15551
|
|
|
15398
15552
|
// src/video/VideoForPreview.tsx
|
|
15399
|
-
import
|
|
15553
|
+
import React51, {
|
|
15400
15554
|
forwardRef as forwardRef14,
|
|
15401
15555
|
useCallback as useCallback27,
|
|
15402
15556
|
useContext as useContext51,
|
|
15403
|
-
useEffect as
|
|
15557
|
+
useEffect as useEffect22,
|
|
15404
15558
|
useImperativeHandle as useImperativeHandle10,
|
|
15405
15559
|
useMemo as useMemo45,
|
|
15406
15560
|
useRef as useRef30,
|
|
15407
|
-
useState as
|
|
15561
|
+
useState as useState25
|
|
15408
15562
|
} from "react";
|
|
15409
15563
|
|
|
15410
15564
|
// src/video/emit-video-frame.ts
|
|
15411
|
-
import { useEffect as
|
|
15565
|
+
import { useEffect as useEffect21 } from "react";
|
|
15412
15566
|
var useEmitVideoFrame = ({
|
|
15413
15567
|
ref,
|
|
15414
15568
|
onVideoFrame
|
|
15415
15569
|
}) => {
|
|
15416
|
-
|
|
15570
|
+
useEffect21(() => {
|
|
15417
15571
|
const { current } = ref;
|
|
15418
15572
|
if (!current) {
|
|
15419
15573
|
return;
|
|
@@ -15453,7 +15607,7 @@ class MediaPlaybackError extends Error {
|
|
|
15453
15607
|
}
|
|
15454
15608
|
|
|
15455
15609
|
// src/video/VideoForPreview.tsx
|
|
15456
|
-
import { jsx as
|
|
15610
|
+
import { jsx as jsx42 } from "react/jsx-runtime";
|
|
15457
15611
|
var VideoForDevelopmentRefForwardingFunction = (props, ref) => {
|
|
15458
15612
|
const context = useContext51(SharedAudioContext);
|
|
15459
15613
|
if (!context) {
|
|
@@ -15469,7 +15623,7 @@ var VideoForDevelopmentRefForwardingFunction = (props, ref) => {
|
|
|
15469
15623
|
ref: videoRef
|
|
15470
15624
|
});
|
|
15471
15625
|
}, [context.audioContext]);
|
|
15472
|
-
const effectToUse =
|
|
15626
|
+
const effectToUse = React51.useInsertionEffect ?? React51.useLayoutEffect;
|
|
15473
15627
|
effectToUse(() => {
|
|
15474
15628
|
return () => {
|
|
15475
15629
|
requestAnimationFrame(() => {
|
|
@@ -15561,13 +15715,13 @@ var VideoForDevelopmentRefForwardingFunction = (props, ref) => {
|
|
|
15561
15715
|
useImperativeHandle10(ref, () => {
|
|
15562
15716
|
return videoRef.current;
|
|
15563
15717
|
}, []);
|
|
15564
|
-
|
|
15718
|
+
useState25(() => playbackLogging({
|
|
15565
15719
|
logLevel,
|
|
15566
15720
|
message: `Mounting video with source = ${actualSrc}, v=${VERSION}, user agent=${typeof navigator === "undefined" ? "server" : navigator.userAgent}`,
|
|
15567
15721
|
tag: "video",
|
|
15568
15722
|
mountTime
|
|
15569
15723
|
}));
|
|
15570
|
-
|
|
15724
|
+
useEffect22(() => {
|
|
15571
15725
|
const { current } = videoRef;
|
|
15572
15726
|
if (!current) {
|
|
15573
15727
|
return;
|
|
@@ -15610,7 +15764,7 @@ var VideoForDevelopmentRefForwardingFunction = (props, ref) => {
|
|
|
15610
15764
|
const currentOnDurationCallback = useRef30(onDuration);
|
|
15611
15765
|
currentOnDurationCallback.current = onDuration;
|
|
15612
15766
|
useEmitVideoFrame({ ref: videoRef, onVideoFrame });
|
|
15613
|
-
|
|
15767
|
+
useEffect22(() => {
|
|
15614
15768
|
const { current } = videoRef;
|
|
15615
15769
|
if (!current) {
|
|
15616
15770
|
return;
|
|
@@ -15627,7 +15781,7 @@ var VideoForDevelopmentRefForwardingFunction = (props, ref) => {
|
|
|
15627
15781
|
current.removeEventListener("loadedmetadata", onLoadedMetadata);
|
|
15628
15782
|
};
|
|
15629
15783
|
}, [src]);
|
|
15630
|
-
|
|
15784
|
+
useEffect22(() => {
|
|
15631
15785
|
const { current } = videoRef;
|
|
15632
15786
|
if (!current) {
|
|
15633
15787
|
return;
|
|
@@ -15648,7 +15802,7 @@ var VideoForDevelopmentRefForwardingFunction = (props, ref) => {
|
|
|
15648
15802
|
requestsVideoFrame: Boolean(onVideoFrame),
|
|
15649
15803
|
isClientSideRendering: false
|
|
15650
15804
|
});
|
|
15651
|
-
const video = /* @__PURE__ */
|
|
15805
|
+
const video = /* @__PURE__ */ jsx42("video", {
|
|
15652
15806
|
...nativeProps,
|
|
15653
15807
|
ref: videoRef,
|
|
15654
15808
|
muted: isMutedForPlayback,
|
|
@@ -15675,7 +15829,7 @@ var VideoForPreviewRefForwardingFunction = (props, ref) => {
|
|
|
15675
15829
|
loopVolumeCurveBehavior,
|
|
15676
15830
|
onlyWarnForMediaSeekingError
|
|
15677
15831
|
} = props;
|
|
15678
|
-
const [timelineId] =
|
|
15832
|
+
const [timelineId] = useState25(() => String(Math.random()));
|
|
15679
15833
|
const parentSequence = useContext51(SequenceContext);
|
|
15680
15834
|
const { isStudio } = useRemotionEnvironment();
|
|
15681
15835
|
const [mediaVolume] = useMediaVolumeState();
|
|
@@ -15713,11 +15867,11 @@ var VideoForPreviewRefForwardingFunction = (props, ref) => {
|
|
|
15713
15867
|
value: registration,
|
|
15714
15868
|
outlineChildrenRef: automaticOutlineRef
|
|
15715
15869
|
} : null, [automaticOutlineRef, isStudio, registration, timelineId]);
|
|
15716
|
-
return /* @__PURE__ */
|
|
15870
|
+
return /* @__PURE__ */ jsx42(CommittedMetadataProvider, {
|
|
15717
15871
|
value: null,
|
|
15718
15872
|
_remotionCommitMetadata: metadata,
|
|
15719
|
-
children: /* @__PURE__ */
|
|
15720
|
-
children: /* @__PURE__ */
|
|
15873
|
+
children: /* @__PURE__ */ jsx42(SequenceContent, {
|
|
15874
|
+
children: /* @__PURE__ */ jsx42(VideoForPreviewContent, {
|
|
15721
15875
|
...props,
|
|
15722
15876
|
ref,
|
|
15723
15877
|
timelineId,
|
|
@@ -15730,7 +15884,7 @@ var VideoForPreviewRefForwardingFunction = (props, ref) => {
|
|
|
15730
15884
|
var VideoForPreview = forwardRef14(VideoForPreviewRefForwardingFunction);
|
|
15731
15885
|
|
|
15732
15886
|
// src/video/OffthreadVideo.tsx
|
|
15733
|
-
import { jsx as
|
|
15887
|
+
import { jsx as jsx43 } from "react/jsx-runtime";
|
|
15734
15888
|
var InnerOffthreadVideo = (props) => {
|
|
15735
15889
|
const {
|
|
15736
15890
|
startFrom,
|
|
@@ -15774,15 +15928,15 @@ var InnerOffthreadVideo = (props) => {
|
|
|
15774
15928
|
trimBefore: trimBeforeValue
|
|
15775
15929
|
});
|
|
15776
15930
|
if (typeof trimBeforeValue !== "undefined" || typeof effectiveTrimAfter !== "undefined") {
|
|
15777
|
-
return /* @__PURE__ */
|
|
15931
|
+
return /* @__PURE__ */ jsx43(Html5MediaTrimContext.Provider, {
|
|
15778
15932
|
value: trimBeforeValue ?? 0,
|
|
15779
|
-
children: /* @__PURE__ */
|
|
15933
|
+
children: /* @__PURE__ */ jsx43(Sequence, {
|
|
15780
15934
|
layout: "none",
|
|
15781
15935
|
from: 0 - (trimBeforeValue ?? 0),
|
|
15782
15936
|
showInTimeline: false,
|
|
15783
15937
|
durationInFrames: effectiveTrimAfter === undefined ? undefined : (trimBeforeValue ?? 0) + (effectiveTrimAfter - (trimBeforeValue ?? 0)) / (props.playbackRate ?? 1),
|
|
15784
15938
|
name,
|
|
15785
|
-
children: /* @__PURE__ */
|
|
15939
|
+
children: /* @__PURE__ */ jsx43(InnerOffthreadVideo, {
|
|
15786
15940
|
pauseWhenBuffering: shouldPauseWhenBuffering,
|
|
15787
15941
|
...otherProps,
|
|
15788
15942
|
trimAfter: undefined,
|
|
@@ -15799,7 +15953,7 @@ var InnerOffthreadVideo = (props) => {
|
|
|
15799
15953
|
}
|
|
15800
15954
|
validateMediaProps(props, "Video");
|
|
15801
15955
|
if (environment.isRendering) {
|
|
15802
|
-
return /* @__PURE__ */
|
|
15956
|
+
return /* @__PURE__ */ jsx43(OffthreadVideoForRendering, {
|
|
15803
15957
|
pauseWhenBuffering: shouldPauseWhenBuffering,
|
|
15804
15958
|
...otherProps,
|
|
15805
15959
|
trimAfter: undefined,
|
|
@@ -15822,7 +15976,7 @@ var InnerOffthreadVideo = (props) => {
|
|
|
15822
15976
|
delayRenderTimeoutInMilliseconds,
|
|
15823
15977
|
...propsForPreview
|
|
15824
15978
|
} = otherProps;
|
|
15825
|
-
return /* @__PURE__ */
|
|
15979
|
+
return /* @__PURE__ */ jsx43(VideoForPreview, {
|
|
15826
15980
|
_remotionInternalStack: _remotionInternalStack ?? null,
|
|
15827
15981
|
onDuration,
|
|
15828
15982
|
onlyWarnForMediaSeekingError: true,
|
|
@@ -15872,7 +16026,7 @@ var OffthreadVideo = ({
|
|
|
15872
16026
|
if (imageFormat) {
|
|
15873
16027
|
throw new TypeError(`The \`<OffthreadVideo>\` tag does no longer accept \`imageFormat\`. Use the \`transparent\` prop if you want to render a transparent video.`);
|
|
15874
16028
|
}
|
|
15875
|
-
return /* @__PURE__ */
|
|
16029
|
+
return /* @__PURE__ */ jsx43(InnerOffthreadVideo, {
|
|
15876
16030
|
acceptableTimeShiftInSeconds,
|
|
15877
16031
|
allowAmplificationDuringRender: allowAmplificationDuringRender ?? true,
|
|
15878
16032
|
audioStreamIndex: audioStreamIndex ?? 0,
|
|
@@ -15946,31 +16100,30 @@ var watchStaticFile = (fileName, callback) => {
|
|
|
15946
16100
|
};
|
|
15947
16101
|
|
|
15948
16102
|
// src/wrap-remotion-context.tsx
|
|
15949
|
-
import
|
|
15950
|
-
import { jsx as
|
|
16103
|
+
import React53, { useCallback as useCallback29, useMemo as useMemo46, useRef as useRef31, useState as useState26 } from "react";
|
|
16104
|
+
import { jsx as jsx44 } from "react/jsx-runtime";
|
|
15951
16105
|
function useRemotionContexts() {
|
|
15952
|
-
const compositionManagerCtx =
|
|
15953
|
-
const videoContext =
|
|
15954
|
-
const timelineContext =
|
|
15955
|
-
const setTimelineContext =
|
|
15956
|
-
const sequenceContext =
|
|
15957
|
-
const defaultPremountInSeconds =
|
|
15958
|
-
const
|
|
15959
|
-
const
|
|
15960
|
-
const
|
|
15961
|
-
const
|
|
15962
|
-
const
|
|
15963
|
-
const
|
|
15964
|
-
const
|
|
15965
|
-
const
|
|
15966
|
-
const
|
|
15967
|
-
const
|
|
15968
|
-
const
|
|
15969
|
-
const
|
|
15970
|
-
const
|
|
15971
|
-
const
|
|
15972
|
-
const
|
|
15973
|
-
const logLevelContext = React52.useContext(LogLevelContext);
|
|
16106
|
+
const compositionManagerCtx = React53.useContext(CompositionManager);
|
|
16107
|
+
const videoContext = React53.useContext(VideoContext);
|
|
16108
|
+
const timelineContext = React53.useContext(TimelineContext);
|
|
16109
|
+
const setTimelineContext = React53.useContext(SetTimelineContext);
|
|
16110
|
+
const sequenceContext = React53.useContext(SequenceContext);
|
|
16111
|
+
const defaultPremountInSeconds = React53.useContext(DefaultPremountContext);
|
|
16112
|
+
const timelineTrackContext = React53.useContext(TimelineTrackContext);
|
|
16113
|
+
const canUseRemotionHooksContext = React53.useContext(CanUseRemotionHooks);
|
|
16114
|
+
const preloadContext = React53.useContext(PreloadContext);
|
|
16115
|
+
const resolveCompositionContext = React53.useContext(ResolveCompositionContext);
|
|
16116
|
+
const renderAssetManagerContext = React53.useContext(RenderAssetManager);
|
|
16117
|
+
const sequenceManagerActionsContext = React53.useContext(SequenceManagerActionsContext);
|
|
16118
|
+
const sequenceManagerRefContext = React53.useContext(SequenceManagerRefContext);
|
|
16119
|
+
const sequenceRegistryContext = React53.useContext(SequenceRegistryContext);
|
|
16120
|
+
const sequenceRegistryScopeContext = React53.useContext(SequenceRegistryScopeContext);
|
|
16121
|
+
const sequenceRegistrationContext = React53.useContext(SequenceRegistrationContext);
|
|
16122
|
+
const disableSequenceRegistrationContext = React53.useContext(DisableSequenceRegistrationContext);
|
|
16123
|
+
const remotionEnvironmentContext = React53.useContext(RemotionEnvironmentContext);
|
|
16124
|
+
const visualModePropStatusesRefContext = React53.useContext(VisualModePropStatusesRefContext);
|
|
16125
|
+
const bufferManagerContext = React53.useContext(BufferingContextReact);
|
|
16126
|
+
const logLevelContext = React53.useContext(LogLevelContext);
|
|
15974
16127
|
return useMemo46(() => ({
|
|
15975
16128
|
compositionManagerCtx,
|
|
15976
16129
|
videoContext,
|
|
@@ -15978,7 +16131,6 @@ function useRemotionContexts() {
|
|
|
15978
16131
|
setTimelineContext,
|
|
15979
16132
|
sequenceContext,
|
|
15980
16133
|
defaultPremountInSeconds,
|
|
15981
|
-
experimentalTracksEnabled,
|
|
15982
16134
|
timelineTrackContext,
|
|
15983
16135
|
canUseRemotionHooksContext,
|
|
15984
16136
|
preloadContext,
|
|
@@ -15999,7 +16151,6 @@ function useRemotionContexts() {
|
|
|
15999
16151
|
videoContext,
|
|
16000
16152
|
sequenceContext,
|
|
16001
16153
|
defaultPremountInSeconds,
|
|
16002
|
-
experimentalTracksEnabled,
|
|
16003
16154
|
timelineTrackContext,
|
|
16004
16155
|
setTimelineContext,
|
|
16005
16156
|
timelineContext,
|
|
@@ -16024,8 +16175,8 @@ var ForwardedSequenceRegistry = ({
|
|
|
16024
16175
|
contexts,
|
|
16025
16176
|
children
|
|
16026
16177
|
}) => {
|
|
16027
|
-
const [scopeId] =
|
|
16028
|
-
const [observerAvailable, setObserverAvailable] =
|
|
16178
|
+
const [scopeId] = useState26(() => String(Math.random()));
|
|
16179
|
+
const [observerAvailable, setObserverAvailable] = useState26(isCommitRegistrationObserverInstalled);
|
|
16029
16180
|
const observedCommitRef = useRef31(false);
|
|
16030
16181
|
const observerFailedRef = useRef31(false);
|
|
16031
16182
|
const unmountedRef = useRef31(false);
|
|
@@ -16041,7 +16192,7 @@ var ForwardedSequenceRegistry = ({
|
|
|
16041
16192
|
observedCommitRef.current = true;
|
|
16042
16193
|
scope?.onCommitSequences(scopeId, sequences, sequenceIds);
|
|
16043
16194
|
}, [scope, scopeId]);
|
|
16044
|
-
const useIsomorphicLayoutEffect = typeof window === "undefined" ?
|
|
16195
|
+
const useIsomorphicLayoutEffect = typeof window === "undefined" ? React53.useEffect : React53.useLayoutEffect;
|
|
16045
16196
|
useIsomorphicLayoutEffect(() => {
|
|
16046
16197
|
if (scope === null || typeof window === "undefined") {
|
|
16047
16198
|
return;
|
|
@@ -16085,14 +16236,14 @@ var ForwardedSequenceRegistry = ({
|
|
|
16085
16236
|
id: scopeId,
|
|
16086
16237
|
onCommit: commitRegistrationEnabled ? onCommitSequences : null
|
|
16087
16238
|
}), [commitRegistrationEnabled, onCommitSequences, scopeId]);
|
|
16088
|
-
return /* @__PURE__ */
|
|
16239
|
+
return /* @__PURE__ */ jsx44(SequenceRegistryScopeProvider, {
|
|
16089
16240
|
value: scope,
|
|
16090
16241
|
_remotionCommitMetadata: metadata,
|
|
16091
|
-
children: /* @__PURE__ */
|
|
16242
|
+
children: /* @__PURE__ */ jsx44(SequenceManagerActionsContext.Provider, {
|
|
16092
16243
|
value: contexts.sequenceManagerActionsContext,
|
|
16093
|
-
children: /* @__PURE__ */
|
|
16244
|
+
children: /* @__PURE__ */ jsx44(SequenceRegistryContext.Provider, {
|
|
16094
16245
|
value: registry,
|
|
16095
|
-
children: /* @__PURE__ */
|
|
16246
|
+
children: /* @__PURE__ */ jsx44(SequenceCommitRegistrationContext.Provider, {
|
|
16096
16247
|
value: commitRegistrationEnabled,
|
|
16097
16248
|
children
|
|
16098
16249
|
})
|
|
@@ -16102,48 +16253,45 @@ var ForwardedSequenceRegistry = ({
|
|
|
16102
16253
|
};
|
|
16103
16254
|
var RemotionContextProvider = (props) => {
|
|
16104
16255
|
const { children, contexts } = props;
|
|
16105
|
-
return /* @__PURE__ */
|
|
16256
|
+
return /* @__PURE__ */ jsx44(LogLevelContext.Provider, {
|
|
16106
16257
|
value: contexts.logLevelContext,
|
|
16107
|
-
children: /* @__PURE__ */
|
|
16258
|
+
children: /* @__PURE__ */ jsx44(CanUseRemotionHooks.Provider, {
|
|
16108
16259
|
value: contexts.canUseRemotionHooksContext,
|
|
16109
|
-
children: /* @__PURE__ */
|
|
16260
|
+
children: /* @__PURE__ */ jsx44(PreloadContext.Provider, {
|
|
16110
16261
|
value: contexts.preloadContext,
|
|
16111
|
-
children: /* @__PURE__ */
|
|
16262
|
+
children: /* @__PURE__ */ jsx44(CompositionManager.Provider, {
|
|
16112
16263
|
value: contexts.compositionManagerCtx,
|
|
16113
|
-
children: /* @__PURE__ */
|
|
16264
|
+
children: /* @__PURE__ */ jsx44(SequenceManagerRefContext.Provider, {
|
|
16114
16265
|
value: contexts.sequenceManagerRefContext,
|
|
16115
|
-
children: /* @__PURE__ */
|
|
16266
|
+
children: /* @__PURE__ */ jsx44(RemotionEnvironmentContext.Provider, {
|
|
16116
16267
|
value: contexts.remotionEnvironmentContext,
|
|
16117
|
-
children: /* @__PURE__ */
|
|
16268
|
+
children: /* @__PURE__ */ jsx44(SequenceRegistrationContext.Provider, {
|
|
16118
16269
|
value: contexts.sequenceRegistrationContext,
|
|
16119
|
-
children: /* @__PURE__ */
|
|
16270
|
+
children: /* @__PURE__ */ jsx44(DisableSequenceRegistrationContext.Provider, {
|
|
16120
16271
|
value: contexts.disableSequenceRegistrationContext,
|
|
16121
|
-
children: /* @__PURE__ */
|
|
16272
|
+
children: /* @__PURE__ */ jsx44(ForwardedSequenceRegistry, {
|
|
16122
16273
|
contexts,
|
|
16123
|
-
children: /* @__PURE__ */
|
|
16274
|
+
children: /* @__PURE__ */ jsx44(VisualModePropStatusesRefContext.Provider, {
|
|
16124
16275
|
value: contexts.visualModePropStatusesRefContext,
|
|
16125
|
-
children: /* @__PURE__ */
|
|
16276
|
+
children: /* @__PURE__ */ jsx44(RenderAssetManager.Provider, {
|
|
16126
16277
|
value: contexts.renderAssetManagerContext,
|
|
16127
|
-
children: /* @__PURE__ */
|
|
16278
|
+
children: /* @__PURE__ */ jsx44(ResolveCompositionContext.Provider, {
|
|
16128
16279
|
value: contexts.resolveCompositionContext,
|
|
16129
|
-
children: /* @__PURE__ */
|
|
16280
|
+
children: /* @__PURE__ */ jsx44(TimelineContext.Provider, {
|
|
16130
16281
|
value: contexts.timelineContext,
|
|
16131
|
-
children: /* @__PURE__ */
|
|
16282
|
+
children: /* @__PURE__ */ jsx44(SetTimelineContext.Provider, {
|
|
16132
16283
|
value: contexts.setTimelineContext,
|
|
16133
|
-
children: /* @__PURE__ */
|
|
16284
|
+
children: /* @__PURE__ */ jsx44(SequenceContext.Provider, {
|
|
16134
16285
|
value: contexts.sequenceContext,
|
|
16135
|
-
children: /* @__PURE__ */
|
|
16286
|
+
children: /* @__PURE__ */ jsx44(BufferingContextReact.Provider, {
|
|
16136
16287
|
value: contexts.bufferManagerContext,
|
|
16137
|
-
children: /* @__PURE__ */
|
|
16138
|
-
value: contexts.
|
|
16139
|
-
children: /* @__PURE__ */
|
|
16140
|
-
value: contexts.
|
|
16141
|
-
children: /* @__PURE__ */
|
|
16142
|
-
value: contexts.
|
|
16143
|
-
children
|
|
16144
|
-
value: contexts.videoContext,
|
|
16145
|
-
children
|
|
16146
|
-
})
|
|
16288
|
+
children: /* @__PURE__ */ jsx44(TimelineTrackContext.Provider, {
|
|
16289
|
+
value: contexts.timelineTrackContext,
|
|
16290
|
+
children: /* @__PURE__ */ jsx44(DefaultPremountContext.Provider, {
|
|
16291
|
+
value: contexts.defaultPremountInSeconds,
|
|
16292
|
+
children: /* @__PURE__ */ jsx44(VideoContext.Provider, {
|
|
16293
|
+
value: contexts.videoContext,
|
|
16294
|
+
children
|
|
16147
16295
|
})
|
|
16148
16296
|
})
|
|
16149
16297
|
})
|
|
@@ -16250,7 +16398,6 @@ var Internals = {
|
|
|
16250
16398
|
truthy,
|
|
16251
16399
|
SequenceContext,
|
|
16252
16400
|
TimelineTrackContext,
|
|
16253
|
-
ExperimentalTracksEnabledContext,
|
|
16254
16401
|
TrackWithoutSchema,
|
|
16255
16402
|
PremountContext,
|
|
16256
16403
|
usePremounting,
|
|
@@ -16383,17 +16530,17 @@ Object.assign(Internals, { useSyncExternalStore: useSyncExternalStore2 });
|
|
|
16383
16530
|
// src/font-face-registry.ts
|
|
16384
16531
|
var fontDataByUrl = new Map;
|
|
16385
16532
|
// src/series/index.tsx
|
|
16386
|
-
import
|
|
16533
|
+
import React55, {
|
|
16387
16534
|
forwardRef as forwardRef15,
|
|
16388
16535
|
useMemo as useMemo47
|
|
16389
16536
|
} from "react";
|
|
16390
16537
|
|
|
16391
16538
|
// src/series/flatten-children.tsx
|
|
16392
|
-
import
|
|
16539
|
+
import React54 from "react";
|
|
16393
16540
|
var flattenChildren = (children) => {
|
|
16394
|
-
const childrenArray =
|
|
16541
|
+
const childrenArray = React54.Children.toArray(children);
|
|
16395
16542
|
return childrenArray.reduce((flatChildren, child) => {
|
|
16396
|
-
if (child.type ===
|
|
16543
|
+
if (child.type === React54.Fragment) {
|
|
16397
16544
|
return flatChildren.concat(flattenChildren(child.props.children));
|
|
16398
16545
|
}
|
|
16399
16546
|
flatChildren.push(child);
|
|
@@ -16402,7 +16549,7 @@ var flattenChildren = (children) => {
|
|
|
16402
16549
|
};
|
|
16403
16550
|
|
|
16404
16551
|
// src/series/index.tsx
|
|
16405
|
-
import { jsx as
|
|
16552
|
+
import { jsx as jsx45, jsxs as jsxs4, Fragment } from "react/jsx-runtime";
|
|
16406
16553
|
var seriesSequenceSchema = {
|
|
16407
16554
|
durationInFrames: Interactive.baseSchema.durationInFrames,
|
|
16408
16555
|
name: Interactive.sequenceSchema.name,
|
|
@@ -16418,7 +16565,7 @@ var SeriesSequenceInner = forwardRef15(({ offset = 0, className = "", _remotionI
|
|
|
16418
16565
|
if (_remotionInternalRender) {
|
|
16419
16566
|
return _remotionInternalRender({ ...props, offset, className: className || undefined }, ref);
|
|
16420
16567
|
}
|
|
16421
|
-
return /* @__PURE__ */
|
|
16568
|
+
return /* @__PURE__ */ jsx45(IsNotInsideSeriesProvider, {
|
|
16422
16569
|
children: props.children
|
|
16423
16570
|
});
|
|
16424
16571
|
});
|
|
@@ -16481,7 +16628,7 @@ var SeriesInner = (props) => {
|
|
|
16481
16628
|
index: i,
|
|
16482
16629
|
childrenLength: flattenedChildren.length
|
|
16483
16630
|
});
|
|
16484
|
-
return
|
|
16631
|
+
return React55.cloneElement(castedElement, {
|
|
16485
16632
|
_remotionInternalRender: (resolvedProps, ref) => {
|
|
16486
16633
|
const durationInFramesProp = resolvedProps.durationInFrames;
|
|
16487
16634
|
const timelineDurationInFrames = durationInFramesProp / (resolvedProps.playbackRate ?? 1);
|
|
@@ -16507,7 +16654,7 @@ var SeriesInner = (props) => {
|
|
|
16507
16654
|
const nextStartFrame = startFrame + timelineDurationInFrames + offset;
|
|
16508
16655
|
return /* @__PURE__ */ jsxs4(Fragment, {
|
|
16509
16656
|
children: [
|
|
16510
|
-
/* @__PURE__ */
|
|
16657
|
+
/* @__PURE__ */ jsx45(SequenceWithoutSchemaWithRef, {
|
|
16511
16658
|
ref,
|
|
16512
16659
|
name: name || "<Series.Sequence>",
|
|
16513
16660
|
_remotionInternalDocumentationLink: "https://www.remotion.dev/docs/series",
|
|
@@ -16519,7 +16666,7 @@ var SeriesInner = (props) => {
|
|
|
16519
16666
|
role: "clip",
|
|
16520
16667
|
seriesOffset: offset
|
|
16521
16668
|
},
|
|
16522
|
-
children: /* @__PURE__ */
|
|
16669
|
+
children: /* @__PURE__ */ jsx45(IsNotInsideSeriesProvider, {
|
|
16523
16670
|
children: sequenceChildren
|
|
16524
16671
|
})
|
|
16525
16672
|
}),
|
|
@@ -16531,12 +16678,12 @@ var SeriesInner = (props) => {
|
|
|
16531
16678
|
};
|
|
16532
16679
|
return renderChildren(0, 0);
|
|
16533
16680
|
}, [props.children, pendingDeletions]);
|
|
16534
|
-
return /* @__PURE__ */
|
|
16681
|
+
return /* @__PURE__ */ jsx45(TrackWithoutSchema, {
|
|
16535
16682
|
layout: "none",
|
|
16536
16683
|
_remotionInternalDocumentationLink: "https://www.remotion.dev/docs/series",
|
|
16537
16684
|
...props,
|
|
16538
16685
|
name: props.name ?? "<Series>",
|
|
16539
|
-
children: /* @__PURE__ */
|
|
16686
|
+
children: /* @__PURE__ */ jsx45(IsInsideSeriesContainer, {
|
|
16540
16687
|
children: childrenValue
|
|
16541
16688
|
})
|
|
16542
16689
|
});
|
|
@@ -16650,14 +16797,14 @@ var staticFile = (path) => {
|
|
|
16650
16797
|
return preparsed;
|
|
16651
16798
|
};
|
|
16652
16799
|
// src/Still.tsx
|
|
16653
|
-
import
|
|
16800
|
+
import React56 from "react";
|
|
16654
16801
|
var Still = (props) => {
|
|
16655
16802
|
const newProps = {
|
|
16656
16803
|
...props,
|
|
16657
16804
|
durationInFrames: 1,
|
|
16658
16805
|
fps: 1
|
|
16659
16806
|
};
|
|
16660
|
-
return
|
|
16807
|
+
return React56.createElement(Composition, newProps);
|
|
16661
16808
|
};
|
|
16662
16809
|
addSequenceStackTraces(Still);
|
|
16663
16810
|
// src/video/html5-video.tsx
|
|
@@ -16667,7 +16814,7 @@ import { forwardRef as forwardRef17, useCallback as useCallback30, useContext as
|
|
|
16667
16814
|
import {
|
|
16668
16815
|
forwardRef as forwardRef16,
|
|
16669
16816
|
useContext as useContext52,
|
|
16670
|
-
useEffect as
|
|
16817
|
+
useEffect as useEffect23,
|
|
16671
16818
|
useImperativeHandle as useImperativeHandle11,
|
|
16672
16819
|
useLayoutEffect as useLayoutEffect22,
|
|
16673
16820
|
useMemo as useMemo48,
|
|
@@ -16690,13 +16837,6 @@ var seekToTime = ({
|
|
|
16690
16837
|
cancel: () => {}
|
|
16691
16838
|
};
|
|
16692
16839
|
}
|
|
16693
|
-
seek({
|
|
16694
|
-
logLevel,
|
|
16695
|
-
mediaRef: element,
|
|
16696
|
-
time: desiredTime,
|
|
16697
|
-
why: "Seeking during rendering",
|
|
16698
|
-
mountTime
|
|
16699
|
-
});
|
|
16700
16840
|
let cancel;
|
|
16701
16841
|
let cancelSeeked = null;
|
|
16702
16842
|
const prom = new Promise((resolve) => {
|
|
@@ -16722,6 +16862,13 @@ var seekToTime = ({
|
|
|
16722
16862
|
element.removeEventListener("seeked", onDone);
|
|
16723
16863
|
};
|
|
16724
16864
|
});
|
|
16865
|
+
seek({
|
|
16866
|
+
logLevel,
|
|
16867
|
+
mediaRef: element,
|
|
16868
|
+
time: desiredTime,
|
|
16869
|
+
why: "Seeking during rendering",
|
|
16870
|
+
mountTime
|
|
16871
|
+
});
|
|
16725
16872
|
return {
|
|
16726
16873
|
wait: Promise.all([prom, waitForSeekedEvent]).then(([time]) => time),
|
|
16727
16874
|
cancel: () => {
|
|
@@ -16799,7 +16946,7 @@ var seekToTimeMultipleUntilRight = ({
|
|
|
16799
16946
|
};
|
|
16800
16947
|
|
|
16801
16948
|
// src/video/VideoForRendering.tsx
|
|
16802
|
-
import { jsx as
|
|
16949
|
+
import { jsx as jsx46 } from "react/jsx-runtime";
|
|
16803
16950
|
var VideoForRenderingForwardFunction = ({
|
|
16804
16951
|
onError,
|
|
16805
16952
|
volume: volumeProp,
|
|
@@ -16851,7 +16998,7 @@ var VideoForRenderingForwardFunction = ({
|
|
|
16851
16998
|
if (!videoConfig) {
|
|
16852
16999
|
throw new Error("No video config found");
|
|
16853
17000
|
}
|
|
16854
|
-
|
|
17001
|
+
useEffect23(() => {
|
|
16855
17002
|
if (!props.src) {
|
|
16856
17003
|
throw new Error("No src passed");
|
|
16857
17004
|
}
|
|
@@ -16890,7 +17037,7 @@ var VideoForRenderingForwardFunction = ({
|
|
|
16890
17037
|
return videoRef.current;
|
|
16891
17038
|
}, []);
|
|
16892
17039
|
useEmitVideoFrame({ ref: videoRef, onVideoFrame });
|
|
16893
|
-
|
|
17040
|
+
useEffect23(() => {
|
|
16894
17041
|
if (!window.remotion_videoEnabled) {
|
|
16895
17042
|
return;
|
|
16896
17043
|
}
|
|
@@ -17014,7 +17161,7 @@ var VideoForRenderingForwardFunction = ({
|
|
|
17014
17161
|
delayRender
|
|
17015
17162
|
]);
|
|
17016
17163
|
}
|
|
17017
|
-
return /* @__PURE__ */
|
|
17164
|
+
return /* @__PURE__ */ jsx46("video", {
|
|
17018
17165
|
ref: videoRef,
|
|
17019
17166
|
disableRemotePlayback: true,
|
|
17020
17167
|
...props
|
|
@@ -17023,7 +17170,7 @@ var VideoForRenderingForwardFunction = ({
|
|
|
17023
17170
|
var VideoForRendering = forwardRef16(VideoForRenderingForwardFunction);
|
|
17024
17171
|
|
|
17025
17172
|
// src/video/html5-video.tsx
|
|
17026
|
-
import { jsx as
|
|
17173
|
+
import { jsx as jsx47 } from "react/jsx-runtime";
|
|
17027
17174
|
var VideoForwardingFunction = (props, ref) => {
|
|
17028
17175
|
const {
|
|
17029
17176
|
startFrom,
|
|
@@ -17080,14 +17227,14 @@ var VideoForwardingFunction = (props, ref) => {
|
|
|
17080
17227
|
const loopDuration = effectiveTrimAfter ?? (durationFetched === undefined ? undefined : durationFetched * fps);
|
|
17081
17228
|
if (loop && loopDuration !== undefined) {
|
|
17082
17229
|
if (!Number.isFinite(loopDuration)) {
|
|
17083
|
-
return /* @__PURE__ */
|
|
17230
|
+
return /* @__PURE__ */ jsx47(Html5Video, {
|
|
17084
17231
|
...propsOtherThanLoop,
|
|
17085
17232
|
ref,
|
|
17086
17233
|
_remotionInternalStack,
|
|
17087
17234
|
_remotionInternalNativeLoopPassed: true
|
|
17088
17235
|
});
|
|
17089
17236
|
}
|
|
17090
|
-
return /* @__PURE__ */
|
|
17237
|
+
return /* @__PURE__ */ jsx47(Loop, {
|
|
17091
17238
|
durationInFrames: calculateMediaDuration({
|
|
17092
17239
|
trimAfter: effectiveTrimAfter,
|
|
17093
17240
|
mediaDurationInFrames: loopDuration,
|
|
@@ -17097,7 +17244,7 @@ var VideoForwardingFunction = (props, ref) => {
|
|
|
17097
17244
|
layout: "none",
|
|
17098
17245
|
name,
|
|
17099
17246
|
showInTimeline: false,
|
|
17100
|
-
children: /* @__PURE__ */
|
|
17247
|
+
children: /* @__PURE__ */ jsx47(Html5Video, {
|
|
17101
17248
|
...propsOtherThanLoop,
|
|
17102
17249
|
ref,
|
|
17103
17250
|
_remotionInternalStack,
|
|
@@ -17106,15 +17253,15 @@ var VideoForwardingFunction = (props, ref) => {
|
|
|
17106
17253
|
});
|
|
17107
17254
|
}
|
|
17108
17255
|
if (typeof trimBeforeValue !== "undefined" || typeof effectiveTrimAfter !== "undefined") {
|
|
17109
|
-
return /* @__PURE__ */
|
|
17256
|
+
return /* @__PURE__ */ jsx47(Html5MediaTrimContext.Provider, {
|
|
17110
17257
|
value: trimBeforeValue ?? 0,
|
|
17111
|
-
children: /* @__PURE__ */
|
|
17258
|
+
children: /* @__PURE__ */ jsx47(Sequence, {
|
|
17112
17259
|
layout: "none",
|
|
17113
17260
|
from: 0 - (trimBeforeValue ?? 0),
|
|
17114
17261
|
showInTimeline: false,
|
|
17115
17262
|
durationInFrames: effectiveTrimAfter === undefined ? undefined : (trimBeforeValue ?? 0) + (effectiveTrimAfter - (trimBeforeValue ?? 0)) / (props.playbackRate ?? 1),
|
|
17116
17263
|
name,
|
|
17117
|
-
children: /* @__PURE__ */
|
|
17264
|
+
children: /* @__PURE__ */ jsx47(Html5Video, {
|
|
17118
17265
|
pauseWhenBuffering: shouldPauseWhenBuffering,
|
|
17119
17266
|
onVideoFrame,
|
|
17120
17267
|
...otherProps,
|
|
@@ -17131,14 +17278,14 @@ var VideoForwardingFunction = (props, ref) => {
|
|
|
17131
17278
|
volume: props.volume
|
|
17132
17279
|
}, "Html5Video");
|
|
17133
17280
|
if (environment.isRendering) {
|
|
17134
|
-
return /* @__PURE__ */
|
|
17281
|
+
return /* @__PURE__ */ jsx47(VideoForRendering, {
|
|
17135
17282
|
onDuration,
|
|
17136
17283
|
onVideoFrame: onVideoFrame ?? null,
|
|
17137
17284
|
...otherProps,
|
|
17138
17285
|
ref
|
|
17139
17286
|
});
|
|
17140
17287
|
}
|
|
17141
|
-
return /* @__PURE__ */
|
|
17288
|
+
return /* @__PURE__ */ jsx47(VideoForPreview, {
|
|
17142
17289
|
onlyWarnForMediaSeekingError: false,
|
|
17143
17290
|
...otherProps,
|
|
17144
17291
|
ref,
|