remotion 4.0.443 → 4.0.445
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/Composition.js +10 -1
- package/dist/cjs/CompositionErrorBoundary.d.ts +17 -0
- package/dist/cjs/CompositionErrorBoundary.js +31 -0
- package/dist/cjs/composition-render-error-context.d.ts +5 -0
- package/dist/cjs/composition-render-error-context.js +8 -0
- package/dist/cjs/get-timeline-duration.d.ts +7 -0
- package/dist/cjs/get-timeline-duration.js +17 -0
- package/dist/cjs/index.d.ts +1 -0
- package/dist/cjs/index.js +3 -1
- package/dist/cjs/internals.d.ts +1 -0
- package/dist/cjs/internals.js +2 -0
- package/dist/cjs/sequence-timing-schema.d.ts +19 -0
- package/dist/cjs/sequence-timing-schema.js +22 -0
- package/dist/cjs/use-media-in-timeline.js +5 -6
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/video/MediaPlaybackError.d.ts +7 -0
- package/dist/cjs/video/MediaPlaybackError.js +11 -0
- package/dist/cjs/video/VideoForPreview.js +17 -4
- package/dist/cjs/video/VideoForRendering.js +9 -2
- package/dist/esm/index.mjs +259 -167
- package/dist/esm/version.mjs +1 -1
- package/package.json +2 -2
package/dist/esm/index.mjs
CHANGED
|
@@ -33,7 +33,7 @@ var Clipper = () => {
|
|
|
33
33
|
};
|
|
34
34
|
|
|
35
35
|
// src/Composition.tsx
|
|
36
|
-
import { Suspense, useContext as useContext9, useEffect as useEffect2 } from "react";
|
|
36
|
+
import { Suspense, useCallback as useCallback4, useContext as useContext9, useEffect as useEffect2 } from "react";
|
|
37
37
|
import { createPortal } from "react-dom";
|
|
38
38
|
|
|
39
39
|
// src/CanUseRemotionHooks.tsx
|
|
@@ -47,15 +47,46 @@ var CanUseRemotionHooksProvider = ({ children }) => {
|
|
|
47
47
|
});
|
|
48
48
|
};
|
|
49
49
|
|
|
50
|
-
// src/
|
|
50
|
+
// src/composition-render-error-context.ts
|
|
51
51
|
import { createContext as createContext3 } from "react";
|
|
52
|
-
var
|
|
52
|
+
var CompositionRenderErrorContext = createContext3({
|
|
53
|
+
setError: () => {},
|
|
54
|
+
clearError: () => {}
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
// src/CompositionErrorBoundary.tsx
|
|
58
|
+
import React2 from "react";
|
|
59
|
+
|
|
60
|
+
class CompositionErrorBoundary extends React2.Component {
|
|
61
|
+
state = { hasError: false };
|
|
62
|
+
static getDerivedStateFromError() {
|
|
63
|
+
return { hasError: true };
|
|
64
|
+
}
|
|
65
|
+
componentDidCatch(error) {
|
|
66
|
+
this.props.onError(error);
|
|
67
|
+
}
|
|
68
|
+
componentDidUpdate(_prevProps) {
|
|
69
|
+
if (!this.state.hasError) {
|
|
70
|
+
this.props.onClear();
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
render() {
|
|
74
|
+
if (this.state.hasError) {
|
|
75
|
+
return null;
|
|
76
|
+
}
|
|
77
|
+
return this.props.children;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// src/CompositionManagerContext.tsx
|
|
82
|
+
import { createContext as createContext4 } from "react";
|
|
83
|
+
var CompositionManager = createContext4({
|
|
53
84
|
compositions: [],
|
|
54
85
|
folders: [],
|
|
55
86
|
currentCompositionMetadata: null,
|
|
56
87
|
canvasContent: null
|
|
57
88
|
});
|
|
58
|
-
var CompositionSetters =
|
|
89
|
+
var CompositionSetters = createContext4({
|
|
59
90
|
registerComposition: () => {
|
|
60
91
|
return;
|
|
61
92
|
},
|
|
@@ -75,11 +106,11 @@ var CompositionSetters = createContext3({
|
|
|
75
106
|
});
|
|
76
107
|
|
|
77
108
|
// src/Folder.tsx
|
|
78
|
-
import { createContext as
|
|
109
|
+
import { createContext as createContext6, useContext as useContext2, useEffect, useMemo as useMemo2 } from "react";
|
|
79
110
|
|
|
80
111
|
// src/nonce.ts
|
|
81
|
-
import { createContext as
|
|
82
|
-
var NonceContext =
|
|
112
|
+
import { createContext as createContext5, useCallback, useContext, useMemo, useRef } from "react";
|
|
113
|
+
var NonceContext = createContext5({
|
|
83
114
|
getNonce: () => 0
|
|
84
115
|
});
|
|
85
116
|
var fastRefreshNonce = 0;
|
|
@@ -137,7 +168,7 @@ var invalidFolderNameErrorMessage = `Folder name must match ${String(getRegex())
|
|
|
137
168
|
|
|
138
169
|
// src/Folder.tsx
|
|
139
170
|
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
140
|
-
var FolderContext =
|
|
171
|
+
var FolderContext = createContext6({
|
|
141
172
|
folderName: null,
|
|
142
173
|
parentName: null
|
|
143
174
|
});
|
|
@@ -258,9 +289,9 @@ var serializeThenDeserializeInStudio = (props) => {
|
|
|
258
289
|
};
|
|
259
290
|
|
|
260
291
|
// src/is-player.tsx
|
|
261
|
-
import { createContext as
|
|
292
|
+
import { createContext as createContext7, useContext as useContext3 } from "react";
|
|
262
293
|
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
263
|
-
var IsPlayerContext =
|
|
294
|
+
var IsPlayerContext = createContext7(false);
|
|
264
295
|
var IsPlayerContextProvider = ({
|
|
265
296
|
children
|
|
266
297
|
}) => {
|
|
@@ -458,7 +489,7 @@ var portalNode = () => {
|
|
|
458
489
|
};
|
|
459
490
|
|
|
460
491
|
// src/ResolveCompositionConfig.tsx
|
|
461
|
-
import { createContext as
|
|
492
|
+
import { createContext as createContext9, createRef, useContext as useContext5, useMemo as useMemo5 } from "react";
|
|
462
493
|
|
|
463
494
|
// src/input-props-override.ts
|
|
464
495
|
var getKey = () => {
|
|
@@ -517,17 +548,17 @@ var getInputProps = () => {
|
|
|
517
548
|
};
|
|
518
549
|
|
|
519
550
|
// src/EditorProps.tsx
|
|
520
|
-
import
|
|
551
|
+
import React4, { createContext as createContext8, useCallback as useCallback2, useMemo as useMemo4 } from "react";
|
|
521
552
|
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
522
|
-
var EditorPropsContext =
|
|
553
|
+
var EditorPropsContext = createContext8({
|
|
523
554
|
props: {},
|
|
524
555
|
updateProps: () => {
|
|
525
556
|
throw new Error("Not implemented");
|
|
526
557
|
}
|
|
527
558
|
});
|
|
528
|
-
var timeValueRef =
|
|
559
|
+
var timeValueRef = React4.createRef();
|
|
529
560
|
var EditorPropsProvider = ({ children }) => {
|
|
530
|
-
const [props, setProps] =
|
|
561
|
+
const [props, setProps] = React4.useState({});
|
|
531
562
|
const updateProps = useCallback2(({
|
|
532
563
|
defaultProps,
|
|
533
564
|
id,
|
|
@@ -553,8 +584,8 @@ var EditorPropsProvider = ({ children }) => {
|
|
|
553
584
|
import { useContext as useContext4, useState } from "react";
|
|
554
585
|
|
|
555
586
|
// src/remotion-environment-context.ts
|
|
556
|
-
import
|
|
557
|
-
var RemotionEnvironmentContext =
|
|
587
|
+
import React5 from "react";
|
|
588
|
+
var RemotionEnvironmentContext = React5.createContext(null);
|
|
558
589
|
|
|
559
590
|
// src/use-remotion-environment.ts
|
|
560
591
|
var useRemotionEnvironment = () => {
|
|
@@ -622,7 +653,7 @@ function validateFps(fps, location, isGif) {
|
|
|
622
653
|
}
|
|
623
654
|
|
|
624
655
|
// src/ResolveCompositionConfig.tsx
|
|
625
|
-
var ResolveCompositionContext =
|
|
656
|
+
var ResolveCompositionContext = createContext9(null);
|
|
626
657
|
var resolveCompositionsRef = createRef();
|
|
627
658
|
var needsResolution = (composition) => {
|
|
628
659
|
return Boolean(composition.calculateMetadata);
|
|
@@ -699,7 +730,7 @@ var useResolvedVideoConfig = (preferredCompositionId) => {
|
|
|
699
730
|
};
|
|
700
731
|
|
|
701
732
|
// src/use-delay-render.tsx
|
|
702
|
-
import { createContext as
|
|
733
|
+
import { createContext as createContext11, useCallback as useCallback3, useContext as useContext7 } from "react";
|
|
703
734
|
|
|
704
735
|
// src/cancel-render.ts
|
|
705
736
|
var getErrorStackWithMessage = (error) => {
|
|
@@ -917,21 +948,21 @@ var continueRender = (handle) => {
|
|
|
917
948
|
};
|
|
918
949
|
|
|
919
950
|
// src/log-level-context.tsx
|
|
920
|
-
import { createContext as
|
|
921
|
-
import * as
|
|
922
|
-
var LogLevelContext =
|
|
951
|
+
import { createContext as createContext10 } from "react";
|
|
952
|
+
import * as React6 from "react";
|
|
953
|
+
var LogLevelContext = createContext10({
|
|
923
954
|
logLevel: "info",
|
|
924
955
|
mountTime: 0
|
|
925
956
|
});
|
|
926
957
|
var useLogLevel = () => {
|
|
927
|
-
const { logLevel } =
|
|
958
|
+
const { logLevel } = React6.useContext(LogLevelContext);
|
|
928
959
|
if (logLevel === null) {
|
|
929
960
|
throw new Error("useLogLevel must be used within a LogLevelProvider");
|
|
930
961
|
}
|
|
931
962
|
return logLevel;
|
|
932
963
|
};
|
|
933
964
|
var useMountTime = () => {
|
|
934
|
-
const { mountTime } =
|
|
965
|
+
const { mountTime } = React6.useContext(LogLevelContext);
|
|
935
966
|
if (mountTime === null) {
|
|
936
967
|
throw new Error("useMountTime must be used within a LogLevelProvider");
|
|
937
968
|
}
|
|
@@ -939,7 +970,7 @@ var useMountTime = () => {
|
|
|
939
970
|
};
|
|
940
971
|
|
|
941
972
|
// src/use-delay-render.tsx
|
|
942
|
-
var DelayRenderContextType =
|
|
973
|
+
var DelayRenderContextType = createContext11(null);
|
|
943
974
|
var useDelayRender = () => {
|
|
944
975
|
const environment = useRemotionEnvironment();
|
|
945
976
|
const scope = useContext7(DelayRenderContextType) ?? (typeof window !== "undefined" ? window : undefined);
|
|
@@ -973,7 +1004,7 @@ var useDelayRender = () => {
|
|
|
973
1004
|
};
|
|
974
1005
|
|
|
975
1006
|
// src/use-lazy-component.ts
|
|
976
|
-
import
|
|
1007
|
+
import React7, { useMemo as useMemo6, useRef as useRef2 } from "react";
|
|
977
1008
|
var useLazyComponent = ({
|
|
978
1009
|
compProps,
|
|
979
1010
|
componentName,
|
|
@@ -993,7 +1024,7 @@ var useLazyComponent = ({
|
|
|
993
1024
|
}
|
|
994
1025
|
const Wrapper = (props) => {
|
|
995
1026
|
const Comp = componentRef.current;
|
|
996
|
-
return
|
|
1027
|
+
return React7.createElement(Comp, props);
|
|
997
1028
|
};
|
|
998
1029
|
return Wrapper;
|
|
999
1030
|
}
|
|
@@ -1001,7 +1032,7 @@ var useLazyComponent = ({
|
|
|
1001
1032
|
if (typeof compProps.lazyComponent === "undefined") {
|
|
1002
1033
|
throw new Error(`A value of \`undefined\` was passed to the \`lazyComponent\` prop. Check the value you are passing to the <${componentName}/> component.`);
|
|
1003
1034
|
}
|
|
1004
|
-
return
|
|
1035
|
+
return React7.lazy(compProps.lazyComponent);
|
|
1005
1036
|
}
|
|
1006
1037
|
throw new Error("You must pass either 'component' or 'lazyComponent'");
|
|
1007
1038
|
}, [compProps.lazyComponent]);
|
|
@@ -1147,16 +1178,27 @@ var InnerComposition = ({
|
|
|
1147
1178
|
unregisterComposition
|
|
1148
1179
|
]);
|
|
1149
1180
|
const resolved = useResolvedVideoConfig(id);
|
|
1181
|
+
const { setError, clearError } = useContext9(CompositionRenderErrorContext);
|
|
1182
|
+
const onError = useCallback4((error2) => {
|
|
1183
|
+
setError(error2);
|
|
1184
|
+
}, [setError]);
|
|
1185
|
+
const onClear = useCallback4(() => {
|
|
1186
|
+
clearError();
|
|
1187
|
+
}, [clearError]);
|
|
1150
1188
|
if (environment.isStudio && video && video.component === lazy && video.id === id) {
|
|
1151
1189
|
const Comp = lazy;
|
|
1152
1190
|
if (resolved === null || resolved.type !== "success" && resolved.type !== "success-and-refreshing") {
|
|
1153
1191
|
return null;
|
|
1154
1192
|
}
|
|
1155
1193
|
return createPortal(/* @__PURE__ */ jsx7(CanUseRemotionHooksProvider, {
|
|
1156
|
-
children: /* @__PURE__ */ jsx7(
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1194
|
+
children: /* @__PURE__ */ jsx7(CompositionErrorBoundary, {
|
|
1195
|
+
onError,
|
|
1196
|
+
onClear,
|
|
1197
|
+
children: /* @__PURE__ */ jsx7(Suspense, {
|
|
1198
|
+
fallback: /* @__PURE__ */ jsx7(Loading, {}),
|
|
1199
|
+
children: /* @__PURE__ */ jsx7(Comp, {
|
|
1200
|
+
...resolved.result.props ?? {}
|
|
1201
|
+
})
|
|
1160
1202
|
})
|
|
1161
1203
|
})
|
|
1162
1204
|
}), portalNode());
|
|
@@ -1195,7 +1237,7 @@ var addSequenceStackTraces = (component) => {
|
|
|
1195
1237
|
};
|
|
1196
1238
|
|
|
1197
1239
|
// src/version.ts
|
|
1198
|
-
var VERSION = "4.0.
|
|
1240
|
+
var VERSION = "4.0.445";
|
|
1199
1241
|
|
|
1200
1242
|
// src/multiple-versions-warning.ts
|
|
1201
1243
|
var checkMultipleRemotionVersions = () => {
|
|
@@ -1244,8 +1286,8 @@ import {
|
|
|
1244
1286
|
import { useContext as useContext14, useMemo as useMemo11 } from "react";
|
|
1245
1287
|
|
|
1246
1288
|
// src/SequenceContext.tsx
|
|
1247
|
-
import { createContext as
|
|
1248
|
-
var SequenceContext =
|
|
1289
|
+
import { createContext as createContext12 } from "react";
|
|
1290
|
+
var SequenceContext = createContext12(null);
|
|
1249
1291
|
|
|
1250
1292
|
// src/timeline-position-state.ts
|
|
1251
1293
|
var exports_timeline_position_state = {};
|
|
@@ -1263,7 +1305,7 @@ import { useContext as useContext10, useMemo as useMemo9 } from "react";
|
|
|
1263
1305
|
|
|
1264
1306
|
// src/TimelineContext.tsx
|
|
1265
1307
|
import {
|
|
1266
|
-
createContext as
|
|
1308
|
+
createContext as createContext13,
|
|
1267
1309
|
useLayoutEffect,
|
|
1268
1310
|
useMemo as useMemo8,
|
|
1269
1311
|
useRef as useRef3,
|
|
@@ -1306,7 +1348,7 @@ var random = (seed, dummy) => {
|
|
|
1306
1348
|
|
|
1307
1349
|
// src/TimelineContext.tsx
|
|
1308
1350
|
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
1309
|
-
var SetTimelineContext =
|
|
1351
|
+
var SetTimelineContext = createContext13({
|
|
1310
1352
|
setFrame: () => {
|
|
1311
1353
|
throw new Error("default");
|
|
1312
1354
|
},
|
|
@@ -1314,8 +1356,8 @@ var SetTimelineContext = createContext12({
|
|
|
1314
1356
|
throw new Error("default");
|
|
1315
1357
|
}
|
|
1316
1358
|
});
|
|
1317
|
-
var TimelineContext =
|
|
1318
|
-
var AbsoluteTimeContext =
|
|
1359
|
+
var TimelineContext = createContext13(null);
|
|
1360
|
+
var AbsoluteTimeContext = createContext13(null);
|
|
1319
1361
|
var TimelineContextProvider = ({ children, frameState }) => {
|
|
1320
1362
|
const [playing, setPlaying] = useState2(false);
|
|
1321
1363
|
const imperativePlaying = useRef3(false);
|
|
@@ -1593,16 +1635,16 @@ var Freeze = ({
|
|
|
1593
1635
|
};
|
|
1594
1636
|
|
|
1595
1637
|
// src/PremountContext.tsx
|
|
1596
|
-
import { createContext as
|
|
1597
|
-
var PremountContext =
|
|
1638
|
+
import { createContext as createContext14 } from "react";
|
|
1639
|
+
var PremountContext = createContext14({
|
|
1598
1640
|
premountFramesRemaining: 0,
|
|
1599
1641
|
playing: false
|
|
1600
1642
|
});
|
|
1601
1643
|
|
|
1602
1644
|
// src/SequenceManager.tsx
|
|
1603
|
-
import
|
|
1645
|
+
import React11, { useCallback as useCallback5, useMemo as useMemo12, useRef as useRef4, useState as useState3 } from "react";
|
|
1604
1646
|
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
1605
|
-
var SequenceManager =
|
|
1647
|
+
var SequenceManager = React11.createContext({
|
|
1606
1648
|
registerSequence: () => {
|
|
1607
1649
|
throw new Error("SequenceManagerContext not initialized");
|
|
1608
1650
|
},
|
|
@@ -1611,13 +1653,13 @@ var SequenceManager = React10.createContext({
|
|
|
1611
1653
|
},
|
|
1612
1654
|
sequences: []
|
|
1613
1655
|
});
|
|
1614
|
-
var SequenceVisibilityToggleContext =
|
|
1656
|
+
var SequenceVisibilityToggleContext = React11.createContext({
|
|
1615
1657
|
hidden: {},
|
|
1616
1658
|
setHidden: () => {
|
|
1617
1659
|
throw new Error("SequenceVisibilityToggle not initialized");
|
|
1618
1660
|
}
|
|
1619
1661
|
});
|
|
1620
|
-
var VisualModeOverridesContext =
|
|
1662
|
+
var VisualModeOverridesContext = React11.createContext({
|
|
1621
1663
|
dragOverrides: {},
|
|
1622
1664
|
setDragOverrides: () => {
|
|
1623
1665
|
throw new Error("VisualModeOverridesContext not initialized");
|
|
@@ -1638,7 +1680,7 @@ var SequenceManagerProvider = ({ children, visualModeEnabled }) => {
|
|
|
1638
1680
|
const controlOverridesRef = useRef4(dragOverrides);
|
|
1639
1681
|
controlOverridesRef.current = dragOverrides;
|
|
1640
1682
|
const [codeValues, setCodeValuesMapState] = useState3({});
|
|
1641
|
-
const setDragOverrides =
|
|
1683
|
+
const setDragOverrides = useCallback5((sequenceId, key, value) => {
|
|
1642
1684
|
setControlOverrides((prev) => ({
|
|
1643
1685
|
...prev,
|
|
1644
1686
|
[sequenceId]: {
|
|
@@ -1647,7 +1689,7 @@ var SequenceManagerProvider = ({ children, visualModeEnabled }) => {
|
|
|
1647
1689
|
}
|
|
1648
1690
|
}));
|
|
1649
1691
|
}, []);
|
|
1650
|
-
const clearDragOverrides =
|
|
1692
|
+
const clearDragOverrides = useCallback5((sequenceId) => {
|
|
1651
1693
|
setControlOverrides((prev) => {
|
|
1652
1694
|
if (!prev[sequenceId]) {
|
|
1653
1695
|
return prev;
|
|
@@ -1657,7 +1699,7 @@ var SequenceManagerProvider = ({ children, visualModeEnabled }) => {
|
|
|
1657
1699
|
return next;
|
|
1658
1700
|
});
|
|
1659
1701
|
}, []);
|
|
1660
|
-
const setCodeValues =
|
|
1702
|
+
const setCodeValues = useCallback5((sequenceId, values) => {
|
|
1661
1703
|
setCodeValuesMapState((prev) => {
|
|
1662
1704
|
if (prev[sequenceId] === values) {
|
|
1663
1705
|
return prev;
|
|
@@ -1673,12 +1715,12 @@ var SequenceManagerProvider = ({ children, visualModeEnabled }) => {
|
|
|
1673
1715
|
return { ...prev, [sequenceId]: values };
|
|
1674
1716
|
});
|
|
1675
1717
|
}, []);
|
|
1676
|
-
const registerSequence =
|
|
1718
|
+
const registerSequence = useCallback5((seq) => {
|
|
1677
1719
|
setSequences((seqs) => {
|
|
1678
1720
|
return [...seqs, seq];
|
|
1679
1721
|
});
|
|
1680
1722
|
}, []);
|
|
1681
|
-
const unregisterSequence =
|
|
1723
|
+
const unregisterSequence = useCallback5((seq) => {
|
|
1682
1724
|
setSequences((seqs) => seqs.filter((s) => s.id !== seq));
|
|
1683
1725
|
}, []);
|
|
1684
1726
|
const sequenceContext = useMemo12(() => {
|
|
@@ -1978,7 +2020,7 @@ import {
|
|
|
1978
2020
|
} from "react";
|
|
1979
2021
|
|
|
1980
2022
|
// src/animated-image/canvas.tsx
|
|
1981
|
-
import
|
|
2023
|
+
import React13, { useCallback as useCallback6, useImperativeHandle, useRef as useRef5 } from "react";
|
|
1982
2024
|
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
1983
2025
|
var calcArgs = (fit, frameSize, canvasSize) => {
|
|
1984
2026
|
switch (fit) {
|
|
@@ -2030,7 +2072,7 @@ var calcArgs = (fit, frameSize, canvasSize) => {
|
|
|
2030
2072
|
};
|
|
2031
2073
|
var CanvasRefForwardingFunction = ({ width, height, fit, className, style }, ref) => {
|
|
2032
2074
|
const canvasRef = useRef5(null);
|
|
2033
|
-
const draw =
|
|
2075
|
+
const draw = useCallback6((imageData) => {
|
|
2034
2076
|
const canvas = canvasRef.current;
|
|
2035
2077
|
const canvasWidth = width ?? imageData.displayWidth;
|
|
2036
2078
|
const canvasHeight = height ?? imageData.displayHeight;
|
|
@@ -2075,7 +2117,7 @@ var CanvasRefForwardingFunction = ({ width, height, fit, className, style }, ref
|
|
|
2075
2117
|
style
|
|
2076
2118
|
});
|
|
2077
2119
|
};
|
|
2078
|
-
var Canvas =
|
|
2120
|
+
var Canvas = React13.forwardRef(CanvasRefForwardingFunction);
|
|
2079
2121
|
|
|
2080
2122
|
// src/animated-image/decode-image.ts
|
|
2081
2123
|
var CACHE_SIZE = 5;
|
|
@@ -2341,8 +2383,8 @@ import { useContext as useContext16, useLayoutEffect as useLayoutEffect4, useSta
|
|
|
2341
2383
|
|
|
2342
2384
|
// src/RenderAssetManager.tsx
|
|
2343
2385
|
import {
|
|
2344
|
-
createContext as
|
|
2345
|
-
useCallback as
|
|
2386
|
+
createContext as createContext15,
|
|
2387
|
+
useCallback as useCallback7,
|
|
2346
2388
|
useImperativeHandle as useImperativeHandle3,
|
|
2347
2389
|
useLayoutEffect as useLayoutEffect3,
|
|
2348
2390
|
useMemo as useMemo14,
|
|
@@ -2383,7 +2425,7 @@ var validateRenderAsset = (artifact) => {
|
|
|
2383
2425
|
|
|
2384
2426
|
// src/RenderAssetManager.tsx
|
|
2385
2427
|
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
2386
|
-
var RenderAssetManager =
|
|
2428
|
+
var RenderAssetManager = createContext15({
|
|
2387
2429
|
registerRenderAsset: () => {
|
|
2388
2430
|
return;
|
|
2389
2431
|
},
|
|
@@ -2395,7 +2437,7 @@ var RenderAssetManager = createContext14({
|
|
|
2395
2437
|
var RenderAssetManagerProvider = ({ children, collectAssets }) => {
|
|
2396
2438
|
const [renderAssets, setRenderAssets] = useState6([]);
|
|
2397
2439
|
const renderAssetsRef = useRef7([]);
|
|
2398
|
-
const registerRenderAsset =
|
|
2440
|
+
const registerRenderAsset = useCallback7((renderAsset) => {
|
|
2399
2441
|
validateRenderAsset(renderAsset);
|
|
2400
2442
|
renderAssetsRef.current = [...renderAssetsRef.current, renderAsset];
|
|
2401
2443
|
setRenderAssets(renderAssetsRef.current);
|
|
@@ -2412,7 +2454,7 @@ var RenderAssetManagerProvider = ({ children, collectAssets }) => {
|
|
|
2412
2454
|
};
|
|
2413
2455
|
}, []);
|
|
2414
2456
|
}
|
|
2415
|
-
const unregisterRenderAsset =
|
|
2457
|
+
const unregisterRenderAsset = useCallback7((id) => {
|
|
2416
2458
|
renderAssetsRef.current = renderAssetsRef.current.filter((a) => a.id !== id);
|
|
2417
2459
|
setRenderAssets(renderAssetsRef.current);
|
|
2418
2460
|
}, []);
|
|
@@ -2499,7 +2541,7 @@ var Artifact = ({ filename, content, downloadBehavior }) => {
|
|
|
2499
2541
|
};
|
|
2500
2542
|
Artifact.Thumbnail = ArtifactThumbnail;
|
|
2501
2543
|
// src/audio/Audio.tsx
|
|
2502
|
-
import { forwardRef as forwardRef6, useCallback as
|
|
2544
|
+
import { forwardRef as forwardRef6, useCallback as useCallback12, useContext as useContext28 } from "react";
|
|
2503
2545
|
|
|
2504
2546
|
// src/absolute-src.ts
|
|
2505
2547
|
var getAbsoluteSrc = (relativeSrc) => {
|
|
@@ -2531,11 +2573,11 @@ var calculateMediaDuration = ({
|
|
|
2531
2573
|
};
|
|
2532
2574
|
|
|
2533
2575
|
// src/loop/index.tsx
|
|
2534
|
-
import
|
|
2576
|
+
import React14, { createContext as createContext16, useMemo as useMemo15 } from "react";
|
|
2535
2577
|
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
2536
|
-
var LoopContext =
|
|
2578
|
+
var LoopContext = createContext16(null);
|
|
2537
2579
|
var useLoop = () => {
|
|
2538
|
-
return
|
|
2580
|
+
return React14.useContext(LoopContext);
|
|
2539
2581
|
};
|
|
2540
2582
|
var Loop = ({ durationInFrames, times = Infinity, children, name, ...props }) => {
|
|
2541
2583
|
const currentFrame = useCurrentFrame();
|
|
@@ -2603,9 +2645,9 @@ var playbackLogging = ({
|
|
|
2603
2645
|
};
|
|
2604
2646
|
|
|
2605
2647
|
// src/prefetch-state.tsx
|
|
2606
|
-
import { createContext as
|
|
2648
|
+
import { createContext as createContext17, useEffect as useEffect5, useState as useState8 } from "react";
|
|
2607
2649
|
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
2608
|
-
var PreloadContext =
|
|
2650
|
+
var PreloadContext = createContext17({});
|
|
2609
2651
|
var preloads = {};
|
|
2610
2652
|
var updaters = [];
|
|
2611
2653
|
var setPreloads = (updater) => {
|
|
@@ -2918,7 +2960,7 @@ var resolveTrimProps = ({
|
|
|
2918
2960
|
};
|
|
2919
2961
|
|
|
2920
2962
|
// src/video/duration-state.tsx
|
|
2921
|
-
import { createContext as
|
|
2963
|
+
import { createContext as createContext18, useMemo as useMemo16, useReducer } from "react";
|
|
2922
2964
|
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
2923
2965
|
var durationReducer = (state, action) => {
|
|
2924
2966
|
switch (action.type) {
|
|
@@ -2936,7 +2978,7 @@ var durationReducer = (state, action) => {
|
|
|
2936
2978
|
return state;
|
|
2937
2979
|
}
|
|
2938
2980
|
};
|
|
2939
|
-
var DurationsContext =
|
|
2981
|
+
var DurationsContext = createContext18({
|
|
2940
2982
|
durations: {},
|
|
2941
2983
|
setDurations: () => {
|
|
2942
2984
|
throw new Error("context missing");
|
|
@@ -2957,7 +2999,7 @@ var DurationsContextProvider = ({ children }) => {
|
|
|
2957
2999
|
};
|
|
2958
3000
|
|
|
2959
3001
|
// src/audio/AudioForPreview.tsx
|
|
2960
|
-
import
|
|
3002
|
+
import React20, {
|
|
2961
3003
|
forwardRef as forwardRef4,
|
|
2962
3004
|
useContext as useContext26,
|
|
2963
3005
|
useEffect as useEffect12,
|
|
@@ -2989,10 +3031,10 @@ var getCrossOriginValue = ({
|
|
|
2989
3031
|
import { useContext as useContext19, useLayoutEffect as useLayoutEffect5, useRef as useRef10 } from "react";
|
|
2990
3032
|
|
|
2991
3033
|
// src/audio/shared-audio-tags.tsx
|
|
2992
|
-
import
|
|
2993
|
-
createContext as
|
|
3034
|
+
import React17, {
|
|
3035
|
+
createContext as createContext19,
|
|
2994
3036
|
createRef as createRef2,
|
|
2995
|
-
useCallback as
|
|
3037
|
+
useCallback as useCallback8,
|
|
2996
3038
|
useContext as useContext18,
|
|
2997
3039
|
useMemo as useMemo18,
|
|
2998
3040
|
useRef as useRef8,
|
|
@@ -3159,7 +3201,7 @@ var didPropChange = (key, newProp, prevProp) => {
|
|
|
3159
3201
|
}
|
|
3160
3202
|
return true;
|
|
3161
3203
|
};
|
|
3162
|
-
var SharedAudioContext =
|
|
3204
|
+
var SharedAudioContext = createContext19(null);
|
|
3163
3205
|
var SharedAudioContextProvider = ({ children, numberOfAudioTags, audioLatencyHint, audioEnabled }) => {
|
|
3164
3206
|
const audios = useRef8([]);
|
|
3165
3207
|
const [initialNumberOfAudioTags] = useState9(numberOfAudioTags);
|
|
@@ -3242,7 +3284,7 @@ var SharedAudioContextProvider = ({ children, numberOfAudioTags, audioLatencyHin
|
|
|
3242
3284
|
};
|
|
3243
3285
|
});
|
|
3244
3286
|
}, [audioContext, numberOfAudioTags]);
|
|
3245
|
-
const effectToUse =
|
|
3287
|
+
const effectToUse = React17.useInsertionEffect ?? React17.useLayoutEffect;
|
|
3246
3288
|
effectToUse(() => {
|
|
3247
3289
|
return () => {
|
|
3248
3290
|
requestAnimationFrame(() => {
|
|
@@ -3253,7 +3295,7 @@ var SharedAudioContextProvider = ({ children, numberOfAudioTags, audioLatencyHin
|
|
|
3253
3295
|
};
|
|
3254
3296
|
}, [refs]);
|
|
3255
3297
|
const takenAudios = useRef8(new Array(numberOfAudioTags).fill(false));
|
|
3256
|
-
const rerenderAudios =
|
|
3298
|
+
const rerenderAudios = useCallback8(() => {
|
|
3257
3299
|
refs.forEach(({ ref, id }) => {
|
|
3258
3300
|
const data = audios.current?.find((a) => a.id === id);
|
|
3259
3301
|
const { current } = ref;
|
|
@@ -3274,7 +3316,7 @@ var SharedAudioContextProvider = ({ children, numberOfAudioTags, audioLatencyHin
|
|
|
3274
3316
|
});
|
|
3275
3317
|
});
|
|
3276
3318
|
}, [refs]);
|
|
3277
|
-
const registerAudio =
|
|
3319
|
+
const registerAudio = useCallback8((options) => {
|
|
3278
3320
|
const { aud, audioId, premounting, postmounting } = options;
|
|
3279
3321
|
const found = audios.current?.find((a) => a.audioId === audioId);
|
|
3280
3322
|
if (found) {
|
|
@@ -3303,7 +3345,7 @@ var SharedAudioContextProvider = ({ children, numberOfAudioTags, audioLatencyHin
|
|
|
3303
3345
|
rerenderAudios();
|
|
3304
3346
|
return newElem;
|
|
3305
3347
|
}, [numberOfAudioTags, refs, rerenderAudios]);
|
|
3306
|
-
const unregisterAudio =
|
|
3348
|
+
const unregisterAudio = useCallback8((id) => {
|
|
3307
3349
|
const cloned = [...takenAudios.current];
|
|
3308
3350
|
const index = refs.findIndex((r) => r.id === id);
|
|
3309
3351
|
if (index === -1) {
|
|
@@ -3314,7 +3356,7 @@ var SharedAudioContextProvider = ({ children, numberOfAudioTags, audioLatencyHin
|
|
|
3314
3356
|
audios.current = audios.current?.filter((a) => a.id !== id);
|
|
3315
3357
|
rerenderAudios();
|
|
3316
3358
|
}, [refs, rerenderAudios]);
|
|
3317
|
-
const updateAudio =
|
|
3359
|
+
const updateAudio = useCallback8(({
|
|
3318
3360
|
aud,
|
|
3319
3361
|
audioId,
|
|
3320
3362
|
id,
|
|
@@ -3350,7 +3392,7 @@ var SharedAudioContextProvider = ({ children, numberOfAudioTags, audioLatencyHin
|
|
|
3350
3392
|
}, [rerenderAudios]);
|
|
3351
3393
|
const mountTime = useMountTime();
|
|
3352
3394
|
const env = useRemotionEnvironment();
|
|
3353
|
-
const playAllAudios =
|
|
3395
|
+
const playAllAudios = useCallback8(() => {
|
|
3354
3396
|
refs.forEach((ref) => {
|
|
3355
3397
|
const audio = audios.current.find((a) => a.el === ref.ref);
|
|
3356
3398
|
if (audio?.premounting) {
|
|
@@ -3414,7 +3456,7 @@ var useSharedAudio = ({
|
|
|
3414
3456
|
if (ctx && ctx.numberOfAudioTags > 0) {
|
|
3415
3457
|
return ctx.registerAudio({ aud, audioId, premounting, postmounting });
|
|
3416
3458
|
}
|
|
3417
|
-
const el =
|
|
3459
|
+
const el = React17.createRef();
|
|
3418
3460
|
const mediaElementSourceNode = ctx?.audioContext ? makeSharedElementSourceNode({
|
|
3419
3461
|
audioContext: ctx.audioContext,
|
|
3420
3462
|
ref: el
|
|
@@ -3433,7 +3475,7 @@ var useSharedAudio = ({
|
|
|
3433
3475
|
}
|
|
3434
3476
|
};
|
|
3435
3477
|
});
|
|
3436
|
-
const effectToUse =
|
|
3478
|
+
const effectToUse = React17.useInsertionEffect ?? React17.useLayoutEffect;
|
|
3437
3479
|
if (typeof document !== "undefined") {
|
|
3438
3480
|
effectToUse(() => {
|
|
3439
3481
|
if (ctx && ctx.numberOfAudioTags > 0) {
|
|
@@ -3673,6 +3715,26 @@ var getAssetDisplayName = (filename) => {
|
|
|
3673
3715
|
return splitted[splitted.length - 1];
|
|
3674
3716
|
};
|
|
3675
3717
|
|
|
3718
|
+
// src/get-timeline-duration.ts
|
|
3719
|
+
var getTimelineDuration = ({
|
|
3720
|
+
compositionDurationInFrames,
|
|
3721
|
+
playbackRate,
|
|
3722
|
+
trimBefore,
|
|
3723
|
+
trimAfter,
|
|
3724
|
+
parentSequenceDurationInFrames
|
|
3725
|
+
}) => {
|
|
3726
|
+
const mediaDuration = calculateMediaDuration({
|
|
3727
|
+
mediaDurationInFrames: compositionDurationInFrames * playbackRate + (trimBefore ?? 0),
|
|
3728
|
+
playbackRate,
|
|
3729
|
+
trimBefore,
|
|
3730
|
+
trimAfter
|
|
3731
|
+
});
|
|
3732
|
+
if (parentSequenceDurationInFrames !== null) {
|
|
3733
|
+
return Math.floor(Math.min(parentSequenceDurationInFrames * playbackRate, mediaDuration));
|
|
3734
|
+
}
|
|
3735
|
+
return mediaDuration;
|
|
3736
|
+
};
|
|
3737
|
+
|
|
3676
3738
|
// src/volume-prop.ts
|
|
3677
3739
|
var evaluateVolume = ({
|
|
3678
3740
|
frame,
|
|
@@ -3724,13 +3786,13 @@ var useBasicMediaInTimeline = ({
|
|
|
3724
3786
|
const parentSequence = useContext21(SequenceContext);
|
|
3725
3787
|
const videoConfig = useVideoConfig();
|
|
3726
3788
|
const [initialVolume] = useState10(() => volume);
|
|
3727
|
-
const
|
|
3728
|
-
|
|
3789
|
+
const duration = getTimelineDuration({
|
|
3790
|
+
compositionDurationInFrames: videoConfig.durationInFrames,
|
|
3729
3791
|
playbackRate,
|
|
3730
3792
|
trimBefore,
|
|
3731
|
-
trimAfter
|
|
3793
|
+
trimAfter,
|
|
3794
|
+
parentSequenceDurationInFrames: parentSequence?.durationInFrames ?? null
|
|
3732
3795
|
});
|
|
3733
|
-
const duration = parentSequence ? Math.min(parentSequence.durationInFrames, mediaDuration) : mediaDuration;
|
|
3734
3796
|
const volumes = useMemo19(() => {
|
|
3735
3797
|
if (typeof volume === "number") {
|
|
3736
3798
|
return volume;
|
|
@@ -3929,7 +3991,7 @@ var useMediaInTimeline = ({
|
|
|
3929
3991
|
|
|
3930
3992
|
// src/use-media-playback.ts
|
|
3931
3993
|
import {
|
|
3932
|
-
useCallback as
|
|
3994
|
+
useCallback as useCallback11,
|
|
3933
3995
|
useContext as useContext24,
|
|
3934
3996
|
useEffect as useEffect10,
|
|
3935
3997
|
useLayoutEffect as useLayoutEffect7,
|
|
@@ -3937,14 +3999,14 @@ import {
|
|
|
3937
3999
|
} from "react";
|
|
3938
4000
|
|
|
3939
4001
|
// src/buffer-until-first-frame.ts
|
|
3940
|
-
import { useCallback as
|
|
4002
|
+
import { useCallback as useCallback10, useMemo as useMemo22, useRef as useRef12 } from "react";
|
|
3941
4003
|
|
|
3942
4004
|
// src/use-buffer-state.ts
|
|
3943
4005
|
import { useContext as useContext23, useMemo as useMemo21 } from "react";
|
|
3944
4006
|
|
|
3945
4007
|
// src/buffering.tsx
|
|
3946
|
-
import
|
|
3947
|
-
useCallback as
|
|
4008
|
+
import React18, {
|
|
4009
|
+
useCallback as useCallback9,
|
|
3948
4010
|
useContext as useContext22,
|
|
3949
4011
|
useEffect as useEffect7,
|
|
3950
4012
|
useLayoutEffect as useLayoutEffect6,
|
|
@@ -3960,7 +4022,7 @@ var useBufferManager = (logLevel, mountTime) => {
|
|
|
3960
4022
|
const env = useRemotionEnvironment();
|
|
3961
4023
|
const rendering = env.isRendering;
|
|
3962
4024
|
const buffering = useRef11(false);
|
|
3963
|
-
const addBlock =
|
|
4025
|
+
const addBlock = useCallback9((block) => {
|
|
3964
4026
|
if (rendering) {
|
|
3965
4027
|
return {
|
|
3966
4028
|
unblock: () => {
|
|
@@ -3981,7 +4043,7 @@ var useBufferManager = (logLevel, mountTime) => {
|
|
|
3981
4043
|
}
|
|
3982
4044
|
};
|
|
3983
4045
|
}, [rendering]);
|
|
3984
|
-
const listenForBuffering =
|
|
4046
|
+
const listenForBuffering = useCallback9((callback) => {
|
|
3985
4047
|
setOnBufferingCallbacks((c) => [...c, callback]);
|
|
3986
4048
|
return {
|
|
3987
4049
|
remove: () => {
|
|
@@ -3989,7 +4051,7 @@ var useBufferManager = (logLevel, mountTime) => {
|
|
|
3989
4051
|
}
|
|
3990
4052
|
};
|
|
3991
4053
|
}, []);
|
|
3992
|
-
const listenForResume =
|
|
4054
|
+
const listenForResume = useCallback9((callback) => {
|
|
3993
4055
|
setOnResumeCallbacks((c) => [...c, callback]);
|
|
3994
4056
|
return {
|
|
3995
4057
|
remove: () => {
|
|
@@ -4031,7 +4093,7 @@ var useBufferManager = (logLevel, mountTime) => {
|
|
|
4031
4093
|
return { addBlock, listenForBuffering, listenForResume, buffering };
|
|
4032
4094
|
}, [addBlock, buffering, listenForBuffering, listenForResume]);
|
|
4033
4095
|
};
|
|
4034
|
-
var BufferingContextReact =
|
|
4096
|
+
var BufferingContextReact = React18.createContext(null);
|
|
4035
4097
|
var BufferingProvider = ({ children }) => {
|
|
4036
4098
|
const { logLevel, mountTime } = useContext22(LogLevelContext);
|
|
4037
4099
|
const bufferManager = useBufferManager(logLevel ?? "info", mountTime);
|
|
@@ -4095,7 +4157,7 @@ var useBufferUntilFirstFrame = ({
|
|
|
4095
4157
|
}) => {
|
|
4096
4158
|
const bufferingRef = useRef12(false);
|
|
4097
4159
|
const { delayPlayback } = useBufferState();
|
|
4098
|
-
const bufferUntilFirstFrame =
|
|
4160
|
+
const bufferUntilFirstFrame = useCallback10((requestedTime) => {
|
|
4099
4161
|
if (mediaType !== "video") {
|
|
4100
4162
|
return;
|
|
4101
4163
|
}
|
|
@@ -4175,9 +4237,9 @@ var useBufferUntilFirstFrame = ({
|
|
|
4175
4237
|
};
|
|
4176
4238
|
|
|
4177
4239
|
// src/media-tag-current-time-timestamp.ts
|
|
4178
|
-
import
|
|
4240
|
+
import React19 from "react";
|
|
4179
4241
|
var useCurrentTimeOfMediaTagWithUpdateTimeStamp = (mediaRef) => {
|
|
4180
|
-
const lastUpdate =
|
|
4242
|
+
const lastUpdate = React19.useRef({
|
|
4181
4243
|
time: mediaRef.current?.currentTime ?? 0,
|
|
4182
4244
|
lastUpdate: performance.now()
|
|
4183
4245
|
});
|
|
@@ -4602,7 +4664,7 @@ var useMediaPlayback = ({
|
|
|
4602
4664
|
throw new Error("useMediaPlayback must be used inside a <BufferingContext>");
|
|
4603
4665
|
}
|
|
4604
4666
|
const isVariableFpsVideoMap = useRef14({});
|
|
4605
|
-
const onVariableFpsVideoDetected =
|
|
4667
|
+
const onVariableFpsVideoDetected = useCallback11(() => {
|
|
4606
4668
|
if (!src) {
|
|
4607
4669
|
return;
|
|
4608
4670
|
}
|
|
@@ -4871,12 +4933,12 @@ var useMediaTag = ({
|
|
|
4871
4933
|
};
|
|
4872
4934
|
|
|
4873
4935
|
// src/volume-position-state.ts
|
|
4874
|
-
import { createContext as
|
|
4875
|
-
var MediaVolumeContext =
|
|
4936
|
+
import { createContext as createContext20, useContext as useContext25, useMemo as useMemo23 } from "react";
|
|
4937
|
+
var MediaVolumeContext = createContext20({
|
|
4876
4938
|
mediaMuted: false,
|
|
4877
4939
|
mediaVolume: 1
|
|
4878
4940
|
});
|
|
4879
|
-
var SetMediaVolumeContext =
|
|
4941
|
+
var SetMediaVolumeContext = createContext20({
|
|
4880
4942
|
setMediaMuted: () => {
|
|
4881
4943
|
throw new Error("default");
|
|
4882
4944
|
},
|
|
@@ -5044,7 +5106,7 @@ var AudioForDevelopmentForwardRefFunction = (props, ref) => {
|
|
|
5044
5106
|
volume: userPreferredVolume,
|
|
5045
5107
|
shouldUseWebAudioApi: useWebAudioApi ?? false
|
|
5046
5108
|
});
|
|
5047
|
-
const effectToUse =
|
|
5109
|
+
const effectToUse = React20.useInsertionEffect ?? React20.useLayoutEffect;
|
|
5048
5110
|
effectToUse(() => {
|
|
5049
5111
|
return () => {
|
|
5050
5112
|
requestAnimationFrame(() => {
|
|
@@ -5257,7 +5319,7 @@ var AudioRefForwardingFunction = (props, ref) => {
|
|
|
5257
5319
|
throw new TypeError(`The \`<Html5Audio>\` tag requires a string for \`src\`, but got ${JSON.stringify(props.src)} instead.`);
|
|
5258
5320
|
}
|
|
5259
5321
|
const preloadedSrc = usePreload(props.src);
|
|
5260
|
-
const onError =
|
|
5322
|
+
const onError = useCallback12((e) => {
|
|
5261
5323
|
console.log(e.currentTarget.error);
|
|
5262
5324
|
const errMessage = `Could not play audio with src ${preloadedSrc}: ${e.currentTarget.error}. See https://remotion.dev/docs/media-playback-error for help.`;
|
|
5263
5325
|
if (loop) {
|
|
@@ -5271,7 +5333,7 @@ var AudioRefForwardingFunction = (props, ref) => {
|
|
|
5271
5333
|
console.warn(errMessage);
|
|
5272
5334
|
}
|
|
5273
5335
|
}, [loop, onRemotionError, preloadedSrc]);
|
|
5274
|
-
const onDuration =
|
|
5336
|
+
const onDuration = useCallback12((src, durationInSeconds) => {
|
|
5275
5337
|
setDurations({ type: "got-duration", durationInSeconds, src });
|
|
5276
5338
|
}, [setDurations]);
|
|
5277
5339
|
const durationFetched = durations[getAbsoluteSrc(preloadedSrc)] ?? durations[getAbsoluteSrc(props.src)];
|
|
@@ -5558,7 +5620,7 @@ var getStaticFiles = () => {
|
|
|
5558
5620
|
return window.remotion_staticFiles;
|
|
5559
5621
|
};
|
|
5560
5622
|
// src/IFrame.tsx
|
|
5561
|
-
import { forwardRef as forwardRef7, useCallback as
|
|
5623
|
+
import { forwardRef as forwardRef7, useCallback as useCallback13, useState as useState14 } from "react";
|
|
5562
5624
|
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
5563
5625
|
var IFrameRefForwarding = ({
|
|
5564
5626
|
onLoad,
|
|
@@ -5572,11 +5634,11 @@ var IFrameRefForwarding = ({
|
|
|
5572
5634
|
retries: delayRenderRetries ?? undefined,
|
|
5573
5635
|
timeoutInMilliseconds: delayRenderTimeoutInMilliseconds ?? undefined
|
|
5574
5636
|
}));
|
|
5575
|
-
const didLoad =
|
|
5637
|
+
const didLoad = useCallback13((e) => {
|
|
5576
5638
|
continueRender2(handle);
|
|
5577
5639
|
onLoad?.(e);
|
|
5578
5640
|
}, [handle, onLoad, continueRender2]);
|
|
5579
|
-
const didGetError =
|
|
5641
|
+
const didGetError = useCallback13((e) => {
|
|
5580
5642
|
continueRender2(handle);
|
|
5581
5643
|
if (onError) {
|
|
5582
5644
|
onError(e);
|
|
@@ -5595,7 +5657,7 @@ var IFrameRefForwarding = ({
|
|
|
5595
5657
|
var IFrame = forwardRef7(IFrameRefForwarding);
|
|
5596
5658
|
// src/Img.tsx
|
|
5597
5659
|
import {
|
|
5598
|
-
useCallback as
|
|
5660
|
+
useCallback as useCallback14,
|
|
5599
5661
|
useContext as useContext30,
|
|
5600
5662
|
useImperativeHandle as useImperativeHandle6,
|
|
5601
5663
|
useLayoutEffect as useLayoutEffect9,
|
|
@@ -5604,7 +5666,7 @@ import {
|
|
|
5604
5666
|
} from "react";
|
|
5605
5667
|
|
|
5606
5668
|
// src/wrap-in-schema.ts
|
|
5607
|
-
import
|
|
5669
|
+
import React24, { forwardRef as forwardRef8, useMemo as useMemo27 } from "react";
|
|
5608
5670
|
|
|
5609
5671
|
// src/use-schema.ts
|
|
5610
5672
|
import { useContext as useContext29, useMemo as useMemo26, useState as useState15 } from "react";
|
|
@@ -5742,7 +5804,7 @@ var wrapInSchema = (Component, schema) => {
|
|
|
5742
5804
|
const Wrapped = forwardRef8((props2, ref) => {
|
|
5743
5805
|
const env = useRemotionEnvironment();
|
|
5744
5806
|
if (!env.isStudio || env.isReadOnlyStudio || env.isRendering || !process.env.EXPERIMENTAL_VISUAL_MODE_ENABLED) {
|
|
5745
|
-
return
|
|
5807
|
+
return React24.createElement(Component, {
|
|
5746
5808
|
...props2,
|
|
5747
5809
|
controls: null,
|
|
5748
5810
|
ref
|
|
@@ -5757,7 +5819,7 @@ var wrapInSchema = (Component, schema) => {
|
|
|
5757
5819
|
}, schemaKeys.map((key) => getNestedValue(props2, key)));
|
|
5758
5820
|
const { controls, values } = useSchema(schema, schemaInput);
|
|
5759
5821
|
const mergedProps = mergeValues(props2, values, schemaKeys);
|
|
5760
|
-
return
|
|
5822
|
+
return React24.createElement(Component, {
|
|
5761
5823
|
...mergedProps,
|
|
5762
5824
|
controls,
|
|
5763
5825
|
ref
|
|
@@ -5845,7 +5907,7 @@ var ImgInner = ({
|
|
|
5845
5907
|
controls: controls ?? null
|
|
5846
5908
|
});
|
|
5847
5909
|
const actualSrc = usePreload(src);
|
|
5848
|
-
const retryIn =
|
|
5910
|
+
const retryIn = useCallback14((timeout) => {
|
|
5849
5911
|
if (!imageRef.current) {
|
|
5850
5912
|
return;
|
|
5851
5913
|
}
|
|
@@ -5863,7 +5925,7 @@ var ImgInner = ({
|
|
|
5863
5925
|
}, timeout);
|
|
5864
5926
|
}, []);
|
|
5865
5927
|
const { delayRender: delayRender2, continueRender: continueRender2, cancelRender: cancelRender2 } = useDelayRender();
|
|
5866
|
-
const didGetError =
|
|
5928
|
+
const didGetError = useCallback14((e) => {
|
|
5867
5929
|
if (!errors.current) {
|
|
5868
5930
|
return;
|
|
5869
5931
|
}
|
|
@@ -5971,12 +6033,12 @@ addSequenceStackTraces(Img);
|
|
|
5971
6033
|
import { createRef as createRef3 } from "react";
|
|
5972
6034
|
|
|
5973
6035
|
// src/CompositionManager.tsx
|
|
5974
|
-
import
|
|
5975
|
-
var compositionsRef =
|
|
6036
|
+
import React26 from "react";
|
|
6037
|
+
var compositionsRef = React26.createRef();
|
|
5976
6038
|
|
|
5977
6039
|
// src/CompositionManagerProvider.tsx
|
|
5978
6040
|
import {
|
|
5979
|
-
useCallback as
|
|
6041
|
+
useCallback as useCallback15,
|
|
5980
6042
|
useImperativeHandle as useImperativeHandle7,
|
|
5981
6043
|
useMemo as useMemo28,
|
|
5982
6044
|
useRef as useRef18,
|
|
@@ -5994,14 +6056,14 @@ var CompositionManagerProvider = ({
|
|
|
5994
6056
|
const [canvasContent, setCanvasContent] = useState17(initialCanvasContent);
|
|
5995
6057
|
const [compositions, setCompositions] = useState17(initialCompositions);
|
|
5996
6058
|
const currentcompositionsRef = useRef18(compositions);
|
|
5997
|
-
const updateCompositions =
|
|
6059
|
+
const updateCompositions = useCallback15((updateComps) => {
|
|
5998
6060
|
setCompositions((comps) => {
|
|
5999
6061
|
const updated = updateComps(comps);
|
|
6000
6062
|
currentcompositionsRef.current = updated;
|
|
6001
6063
|
return updated;
|
|
6002
6064
|
});
|
|
6003
6065
|
}, []);
|
|
6004
|
-
const registerComposition =
|
|
6066
|
+
const registerComposition = useCallback15((comp) => {
|
|
6005
6067
|
updateCompositions((comps) => {
|
|
6006
6068
|
if (comps.find((c2) => c2.id === comp.id)) {
|
|
6007
6069
|
throw new Error(`Multiple composition with id ${comp.id} are registered.`);
|
|
@@ -6009,12 +6071,12 @@ var CompositionManagerProvider = ({
|
|
|
6009
6071
|
return [...comps, comp];
|
|
6010
6072
|
});
|
|
6011
6073
|
}, [updateCompositions]);
|
|
6012
|
-
const unregisterComposition =
|
|
6074
|
+
const unregisterComposition = useCallback15((id) => {
|
|
6013
6075
|
setCompositions((comps) => {
|
|
6014
6076
|
return comps.filter((c2) => c2.id !== id);
|
|
6015
6077
|
});
|
|
6016
6078
|
}, []);
|
|
6017
|
-
const registerFolder =
|
|
6079
|
+
const registerFolder = useCallback15((name, parent, nonce) => {
|
|
6018
6080
|
setFolders((prevFolders) => {
|
|
6019
6081
|
return [
|
|
6020
6082
|
...prevFolders,
|
|
@@ -6026,7 +6088,7 @@ var CompositionManagerProvider = ({
|
|
|
6026
6088
|
];
|
|
6027
6089
|
});
|
|
6028
6090
|
}, []);
|
|
6029
|
-
const unregisterFolder =
|
|
6091
|
+
const unregisterFolder = useCallback15((name, parent) => {
|
|
6030
6092
|
setFolders((prevFolders) => {
|
|
6031
6093
|
return prevFolders.filter((p) => !(p.name === name && p.parent === parent));
|
|
6032
6094
|
});
|
|
@@ -6136,8 +6198,8 @@ var getPreviewDomElement = () => {
|
|
|
6136
6198
|
};
|
|
6137
6199
|
|
|
6138
6200
|
// src/max-video-cache-size.ts
|
|
6139
|
-
import
|
|
6140
|
-
var MaxMediaCacheSizeContext =
|
|
6201
|
+
import React27 from "react";
|
|
6202
|
+
var MaxMediaCacheSizeContext = React27.createContext(null);
|
|
6141
6203
|
|
|
6142
6204
|
// src/register-root.ts
|
|
6143
6205
|
var Root = null;
|
|
@@ -6174,9 +6236,9 @@ var waitForRoot = (fn) => {
|
|
|
6174
6236
|
import { useMemo as useMemo30 } from "react";
|
|
6175
6237
|
|
|
6176
6238
|
// src/use-media-enabled.tsx
|
|
6177
|
-
import { createContext as
|
|
6239
|
+
import { createContext as createContext21, useContext as useContext31, useMemo as useMemo29 } from "react";
|
|
6178
6240
|
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
6179
|
-
var MediaEnabledContext =
|
|
6241
|
+
var MediaEnabledContext = createContext21(null);
|
|
6180
6242
|
var useVideoEnabled = () => {
|
|
6181
6243
|
const context = useContext31(MediaEnabledContext);
|
|
6182
6244
|
if (!context) {
|
|
@@ -6434,8 +6496,8 @@ var resolveVideoConfigOrCatch = (params) => {
|
|
|
6434
6496
|
};
|
|
6435
6497
|
|
|
6436
6498
|
// src/sequence-stack-traces.ts
|
|
6437
|
-
import
|
|
6438
|
-
var SequenceStackTracesUpdateContext =
|
|
6499
|
+
import React29 from "react";
|
|
6500
|
+
var SequenceStackTracesUpdateContext = React29.createContext(() => {});
|
|
6439
6501
|
|
|
6440
6502
|
// src/setup-env-variables.ts
|
|
6441
6503
|
var getEnvVariables = () => {
|
|
@@ -6465,9 +6527,9 @@ var setupEnvVariables = () => {
|
|
|
6465
6527
|
};
|
|
6466
6528
|
|
|
6467
6529
|
// src/use-current-scale.ts
|
|
6468
|
-
import
|
|
6469
|
-
var CurrentScaleContext =
|
|
6470
|
-
var PreviewSizeContext =
|
|
6530
|
+
import React30, { createContext as createContext22 } from "react";
|
|
6531
|
+
var CurrentScaleContext = React30.createContext(null);
|
|
6532
|
+
var PreviewSizeContext = createContext22({
|
|
6471
6533
|
setSize: () => {
|
|
6472
6534
|
return;
|
|
6473
6535
|
},
|
|
@@ -6491,8 +6553,8 @@ var calculateScale = ({
|
|
|
6491
6553
|
return Number(previewSize);
|
|
6492
6554
|
};
|
|
6493
6555
|
var useCurrentScale = (options) => {
|
|
6494
|
-
const hasContext =
|
|
6495
|
-
const zoomContext =
|
|
6556
|
+
const hasContext = React30.useContext(CurrentScaleContext);
|
|
6557
|
+
const zoomContext = React30.useContext(PreviewSizeContext);
|
|
6496
6558
|
const config = useUnsafeVideoConfig();
|
|
6497
6559
|
const env = useRemotionEnvironment();
|
|
6498
6560
|
if (hasContext === null || config === null || zoomContext === null) {
|
|
@@ -6533,11 +6595,11 @@ var useSequenceControlOverride = (key) => {
|
|
|
6533
6595
|
};
|
|
6534
6596
|
|
|
6535
6597
|
// src/video/OffthreadVideo.tsx
|
|
6536
|
-
import { useCallback as
|
|
6598
|
+
import { useCallback as useCallback17 } from "react";
|
|
6537
6599
|
|
|
6538
6600
|
// src/video/OffthreadVideoForRendering.tsx
|
|
6539
6601
|
import {
|
|
6540
|
-
useCallback as
|
|
6602
|
+
useCallback as useCallback16,
|
|
6541
6603
|
useContext as useContext33,
|
|
6542
6604
|
useEffect as useEffect14,
|
|
6543
6605
|
useLayoutEffect as useLayoutEffect10,
|
|
@@ -6729,7 +6791,7 @@ var OffthreadVideoForRendering = ({
|
|
|
6729
6791
|
continueRender2,
|
|
6730
6792
|
delayRender2
|
|
6731
6793
|
]);
|
|
6732
|
-
const onErr =
|
|
6794
|
+
const onErr = useCallback16(() => {
|
|
6733
6795
|
if (onError) {
|
|
6734
6796
|
onError?.(new Error("Failed to load image with src " + imageSrc));
|
|
6735
6797
|
} else {
|
|
@@ -6739,7 +6801,7 @@ var OffthreadVideoForRendering = ({
|
|
|
6739
6801
|
const className = useMemo31(() => {
|
|
6740
6802
|
return [OBJECTFIT_CONTAIN_CLASS_NAME, props2.className].filter(truthy).join(" ");
|
|
6741
6803
|
}, [props2.className]);
|
|
6742
|
-
const onImageFrame =
|
|
6804
|
+
const onImageFrame = useCallback16((img) => {
|
|
6743
6805
|
if (onVideoFrame) {
|
|
6744
6806
|
onVideoFrame(img);
|
|
6745
6807
|
}
|
|
@@ -6760,7 +6822,7 @@ var OffthreadVideoForRendering = ({
|
|
|
6760
6822
|
};
|
|
6761
6823
|
|
|
6762
6824
|
// src/video/VideoForPreview.tsx
|
|
6763
|
-
import
|
|
6825
|
+
import React32, {
|
|
6764
6826
|
forwardRef as forwardRef9,
|
|
6765
6827
|
useContext as useContext34,
|
|
6766
6828
|
useEffect as useEffect16,
|
|
@@ -6799,6 +6861,16 @@ var useEmitVideoFrame = ({
|
|
|
6799
6861
|
}, [onVideoFrame, ref]);
|
|
6800
6862
|
};
|
|
6801
6863
|
|
|
6864
|
+
// src/video/MediaPlaybackError.ts
|
|
6865
|
+
class MediaPlaybackError extends Error {
|
|
6866
|
+
src;
|
|
6867
|
+
constructor({ message, src }) {
|
|
6868
|
+
super(message);
|
|
6869
|
+
this.name = "MediaPlaybackError";
|
|
6870
|
+
this.src = src;
|
|
6871
|
+
}
|
|
6872
|
+
}
|
|
6873
|
+
|
|
6802
6874
|
// src/video/VideoForPreview.tsx
|
|
6803
6875
|
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
6804
6876
|
var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
|
|
@@ -6816,7 +6888,7 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
|
|
|
6816
6888
|
ref: videoRef
|
|
6817
6889
|
});
|
|
6818
6890
|
}, [context.audioContext]);
|
|
6819
|
-
const effectToUse =
|
|
6891
|
+
const effectToUse = React32.useInsertionEffect ?? React32.useLayoutEffect;
|
|
6820
6892
|
effectToUse(() => {
|
|
6821
6893
|
return () => {
|
|
6822
6894
|
requestAnimationFrame(() => {
|
|
@@ -6943,18 +7015,30 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
|
|
|
6943
7015
|
if (current.error) {
|
|
6944
7016
|
console.error("Error occurred in video", current?.error);
|
|
6945
7017
|
if (onError) {
|
|
6946
|
-
const err = new
|
|
7018
|
+
const err = new MediaPlaybackError({
|
|
7019
|
+
message: `Code ${current.error.code}: ${current.error.message}`,
|
|
7020
|
+
src
|
|
7021
|
+
});
|
|
6947
7022
|
onError(err);
|
|
6948
7023
|
return;
|
|
6949
7024
|
}
|
|
6950
|
-
throw new
|
|
7025
|
+
throw new MediaPlaybackError({
|
|
7026
|
+
message: `The browser threw an error while playing the video ${src}: Code ${current.error.code} - ${current?.error?.message}. See https://remotion.dev/docs/media-playback-error for help. Pass an onError() prop to handle the error.`,
|
|
7027
|
+
src
|
|
7028
|
+
});
|
|
6951
7029
|
} else {
|
|
6952
7030
|
if (onError) {
|
|
6953
|
-
const err = new
|
|
7031
|
+
const err = new MediaPlaybackError({
|
|
7032
|
+
message: `The browser threw an error while playing the video ${src}`,
|
|
7033
|
+
src
|
|
7034
|
+
});
|
|
6954
7035
|
onError(err);
|
|
6955
7036
|
return;
|
|
6956
7037
|
}
|
|
6957
|
-
throw new
|
|
7038
|
+
throw new MediaPlaybackError({
|
|
7039
|
+
message: "The browser threw an error while playing the video",
|
|
7040
|
+
src
|
|
7041
|
+
});
|
|
6958
7042
|
}
|
|
6959
7043
|
};
|
|
6960
7044
|
current.addEventListener("error", errorHandler, { once: true });
|
|
@@ -7036,7 +7120,7 @@ var InnerOffthreadVideo = (props2) => {
|
|
|
7036
7120
|
if (environment.isClientSideRendering) {
|
|
7037
7121
|
throw new Error("<OffthreadVideo> is not supported in @remotion/web-renderer. Use <Video> from @remotion/media instead. See https://remotion.dev/docs/client-side-rendering/limitations");
|
|
7038
7122
|
}
|
|
7039
|
-
const onDuration =
|
|
7123
|
+
const onDuration = useCallback17(() => {
|
|
7040
7124
|
return;
|
|
7041
7125
|
}, []);
|
|
7042
7126
|
if (typeof props2.src !== "string") {
|
|
@@ -7215,21 +7299,21 @@ var watchStaticFile = (fileName, callback) => {
|
|
|
7215
7299
|
};
|
|
7216
7300
|
|
|
7217
7301
|
// src/wrap-remotion-context.tsx
|
|
7218
|
-
import
|
|
7302
|
+
import React34, { useMemo as useMemo33 } from "react";
|
|
7219
7303
|
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
7220
7304
|
function useRemotionContexts() {
|
|
7221
|
-
const compositionManagerCtx =
|
|
7222
|
-
const timelineContext =
|
|
7223
|
-
const setTimelineContext =
|
|
7224
|
-
const sequenceContext =
|
|
7225
|
-
const nonceContext =
|
|
7226
|
-
const canUseRemotionHooksContext =
|
|
7227
|
-
const preloadContext =
|
|
7228
|
-
const resolveCompositionContext =
|
|
7229
|
-
const renderAssetManagerContext =
|
|
7230
|
-
const sequenceManagerContext =
|
|
7231
|
-
const bufferManagerContext =
|
|
7232
|
-
const logLevelContext =
|
|
7305
|
+
const compositionManagerCtx = React34.useContext(CompositionManager);
|
|
7306
|
+
const timelineContext = React34.useContext(TimelineContext);
|
|
7307
|
+
const setTimelineContext = React34.useContext(SetTimelineContext);
|
|
7308
|
+
const sequenceContext = React34.useContext(SequenceContext);
|
|
7309
|
+
const nonceContext = React34.useContext(NonceContext);
|
|
7310
|
+
const canUseRemotionHooksContext = React34.useContext(CanUseRemotionHooks);
|
|
7311
|
+
const preloadContext = React34.useContext(PreloadContext);
|
|
7312
|
+
const resolveCompositionContext = React34.useContext(ResolveCompositionContext);
|
|
7313
|
+
const renderAssetManagerContext = React34.useContext(RenderAssetManager);
|
|
7314
|
+
const sequenceManagerContext = React34.useContext(SequenceManager);
|
|
7315
|
+
const bufferManagerContext = React34.useContext(BufferingContextReact);
|
|
7316
|
+
const logLevelContext = React34.useContext(LogLevelContext);
|
|
7233
7317
|
return useMemo33(() => ({
|
|
7234
7318
|
compositionManagerCtx,
|
|
7235
7319
|
timelineContext,
|
|
@@ -7404,7 +7488,8 @@ var Internals = {
|
|
|
7404
7488
|
TimelineContext,
|
|
7405
7489
|
AbsoluteTimeContext,
|
|
7406
7490
|
RenderAssetManagerProvider,
|
|
7407
|
-
getEffectiveVisualModeValue
|
|
7491
|
+
getEffectiveVisualModeValue,
|
|
7492
|
+
CompositionRenderErrorContext
|
|
7408
7493
|
};
|
|
7409
7494
|
// src/interpolate-colors.ts
|
|
7410
7495
|
var NUMBER = "[-+]?\\d*\\.?\\d+";
|
|
@@ -7929,11 +8014,11 @@ var validateFrame = ({
|
|
|
7929
8014
|
import { Children, forwardRef as forwardRef10, useMemo as useMemo34 } from "react";
|
|
7930
8015
|
|
|
7931
8016
|
// src/series/flatten-children.tsx
|
|
7932
|
-
import
|
|
8017
|
+
import React35 from "react";
|
|
7933
8018
|
var flattenChildren = (children) => {
|
|
7934
|
-
const childrenArray =
|
|
8019
|
+
const childrenArray = React35.Children.toArray(children);
|
|
7935
8020
|
return childrenArray.reduce((flatChildren, child) => {
|
|
7936
|
-
if (child.type ===
|
|
8021
|
+
if (child.type === React35.Fragment) {
|
|
7937
8022
|
return flatChildren.concat(flattenChildren(child.props.children));
|
|
7938
8023
|
}
|
|
7939
8024
|
flatChildren.push(child);
|
|
@@ -7942,9 +8027,9 @@ var flattenChildren = (children) => {
|
|
|
7942
8027
|
};
|
|
7943
8028
|
|
|
7944
8029
|
// src/series/is-inside-series.tsx
|
|
7945
|
-
import
|
|
8030
|
+
import React36, { createContext as createContext23 } from "react";
|
|
7946
8031
|
import { jsx as jsx32 } from "react/jsx-runtime";
|
|
7947
|
-
var IsInsideSeriesContext =
|
|
8032
|
+
var IsInsideSeriesContext = createContext23(false);
|
|
7948
8033
|
var IsInsideSeriesContainer = ({ children }) => {
|
|
7949
8034
|
return /* @__PURE__ */ jsx32(IsInsideSeriesContext.Provider, {
|
|
7950
8035
|
value: true,
|
|
@@ -7958,7 +8043,7 @@ var IsNotInsideSeriesProvider = ({ children }) => {
|
|
|
7958
8043
|
});
|
|
7959
8044
|
};
|
|
7960
8045
|
var useRequireToBeInsideSeries = () => {
|
|
7961
|
-
const isInsideSeries =
|
|
8046
|
+
const isInsideSeries = React36.useContext(IsInsideSeriesContext);
|
|
7962
8047
|
if (!isInsideSeries) {
|
|
7963
8048
|
throw new Error("This component must be inside a <Series /> component.");
|
|
7964
8049
|
}
|
|
@@ -8371,17 +8456,17 @@ var staticFile = (path) => {
|
|
|
8371
8456
|
return preparsed;
|
|
8372
8457
|
};
|
|
8373
8458
|
// src/Still.tsx
|
|
8374
|
-
import
|
|
8459
|
+
import React38 from "react";
|
|
8375
8460
|
var Still = (props2) => {
|
|
8376
8461
|
const newProps = {
|
|
8377
8462
|
...props2,
|
|
8378
8463
|
durationInFrames: 1,
|
|
8379
8464
|
fps: 1
|
|
8380
8465
|
};
|
|
8381
|
-
return
|
|
8466
|
+
return React38.createElement(Composition, newProps);
|
|
8382
8467
|
};
|
|
8383
8468
|
// src/video/Video.tsx
|
|
8384
|
-
import { forwardRef as forwardRef12, useCallback as
|
|
8469
|
+
import { forwardRef as forwardRef12, useCallback as useCallback18, useContext as useContext36 } from "react";
|
|
8385
8470
|
|
|
8386
8471
|
// src/video/VideoForRendering.tsx
|
|
8387
8472
|
import {
|
|
@@ -8661,9 +8746,15 @@ var VideoForRenderingForwardFunction = ({
|
|
|
8661
8746
|
if (onError) {
|
|
8662
8747
|
return;
|
|
8663
8748
|
}
|
|
8664
|
-
throw new
|
|
8749
|
+
throw new MediaPlaybackError({
|
|
8750
|
+
message: `The browser threw an error while playing the video ${props2.src}: Code ${current.error.code} - ${current?.error?.message}. See https://remotion.dev/docs/media-playback-error for help. Pass an onError() prop to handle the error.`,
|
|
8751
|
+
src: props2.src
|
|
8752
|
+
});
|
|
8665
8753
|
} else {
|
|
8666
|
-
throw new
|
|
8754
|
+
throw new MediaPlaybackError({
|
|
8755
|
+
message: "The browser threw an error",
|
|
8756
|
+
src: props2.src
|
|
8757
|
+
});
|
|
8667
8758
|
}
|
|
8668
8759
|
};
|
|
8669
8760
|
current.addEventListener("error", errorHandler, { once: true });
|
|
@@ -8762,10 +8853,10 @@ var VideoForwardingFunction = (props2, ref) => {
|
|
|
8762
8853
|
throw new TypeError(`The \`<Html5Video>\` tag requires a string for \`src\`, but got ${JSON.stringify(props2.src)} instead.`);
|
|
8763
8854
|
}
|
|
8764
8855
|
const preloadedSrc = usePreload(props2.src);
|
|
8765
|
-
const onDuration =
|
|
8856
|
+
const onDuration = useCallback18((src, durationInSeconds) => {
|
|
8766
8857
|
setDurations({ type: "got-duration", durationInSeconds, src });
|
|
8767
8858
|
}, [setDurations]);
|
|
8768
|
-
const onVideoFrame =
|
|
8859
|
+
const onVideoFrame = useCallback18(() => {}, []);
|
|
8769
8860
|
const durationFetched = durations[getAbsoluteSrc(preloadedSrc)] ?? durations[getAbsoluteSrc(props2.src)];
|
|
8770
8861
|
validateMediaTrimProps({ startFrom, endAt, trimBefore, trimAfter });
|
|
8771
8862
|
const { trimBeforeValue, trimAfterValue } = resolveTrimProps({
|
|
@@ -8899,6 +8990,7 @@ export {
|
|
|
8899
8990
|
Series,
|
|
8900
8991
|
Sequence,
|
|
8901
8992
|
OffthreadVideo,
|
|
8993
|
+
MediaPlaybackError,
|
|
8902
8994
|
Loop,
|
|
8903
8995
|
Internals,
|
|
8904
8996
|
Img,
|