@remotion/promo-pages 4.0.463 → 4.0.464
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Homepage.js +901 -777
- package/dist/design.js +745 -661
- package/dist/experts/experts-data.js +16 -5
- package/dist/experts.js +646 -562
- package/dist/homepage/Pricing.js +734 -650
- package/dist/prompts/PromptsGallery.js +743 -659
- package/dist/prompts/PromptsShow.css +2578 -0
- package/dist/prompts/PromptsShow.js +724 -640
- package/dist/prompts/PromptsSubmit.js +731 -647
- package/dist/tailwind.css +6 -4
- package/dist/team.js +730 -646
- package/dist/template-modal-content.css +35 -0
- package/dist/template-modal-content.js +744 -660
- package/dist/templates.js +731 -646
- package/package.json +13 -13
package/dist/experts.js
CHANGED
|
@@ -1,15 +1,26 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
1
3
|
var __defProp = Object.defineProperty;
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __toESM = (mod, isNodeMode, target) => {
|
|
7
|
+
target = mod != null ? __create(__getProtoOf(mod)) : {};
|
|
8
|
+
const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
|
|
9
|
+
for (let key of __getOwnPropNames(mod))
|
|
10
|
+
if (!__hasOwnProp.call(to, key))
|
|
11
|
+
__defProp(to, key, {
|
|
12
|
+
get: () => mod[key],
|
|
13
|
+
enumerable: true
|
|
14
|
+
});
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
6
17
|
var __export = (target, all) => {
|
|
7
18
|
for (var name in all)
|
|
8
19
|
__defProp(target, name, {
|
|
9
20
|
get: all[name],
|
|
10
21
|
enumerable: true,
|
|
11
22
|
configurable: true,
|
|
12
|
-
set:
|
|
23
|
+
set: (newValue) => all[name] = () => newValue
|
|
13
24
|
});
|
|
14
25
|
};
|
|
15
26
|
var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
|
|
@@ -900,7 +911,7 @@ var experts = [
|
|
|
900
911
|
}
|
|
901
912
|
];
|
|
902
913
|
// src/components/experts/ExpertsPage.tsx
|
|
903
|
-
import { useMemo as
|
|
914
|
+
import { useMemo as useMemo39 } from "react";
|
|
904
915
|
|
|
905
916
|
// ../core/dist/esm/index.mjs
|
|
906
917
|
import { createContext } from "react";
|
|
@@ -930,13 +941,6 @@ import * as React6 from "react";
|
|
|
930
941
|
import React7, { useMemo as useMemo6, useRef as useRef2 } from "react";
|
|
931
942
|
import { useContext as useContext8, useMemo as useMemo7 } from "react";
|
|
932
943
|
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
933
|
-
import {
|
|
934
|
-
forwardRef as forwardRef4,
|
|
935
|
-
useCallback as useCallback6,
|
|
936
|
-
useEffect as useEffect5,
|
|
937
|
-
useMemo as useMemo16,
|
|
938
|
-
useState as useState6
|
|
939
|
-
} from "react";
|
|
940
944
|
import {
|
|
941
945
|
forwardRef as forwardRef3,
|
|
942
946
|
useContext as useContext17,
|
|
@@ -944,6 +948,7 @@ import {
|
|
|
944
948
|
useMemo as useMemo14,
|
|
945
949
|
useState as useState5
|
|
946
950
|
} from "react";
|
|
951
|
+
import { useRef as useRef6 } from "react";
|
|
947
952
|
import { useContext as useContext14, useMemo as useMemo11 } from "react";
|
|
948
953
|
import { createContext as createContext12 } from "react";
|
|
949
954
|
import { useContext as useContext10, useMemo as useMemo9 } from "react";
|
|
@@ -966,18 +971,25 @@ import React12, { forwardRef as forwardRef2, useState as useState4, useContext a
|
|
|
966
971
|
import { useContext as useContext15, useRef as useRef5 } from "react";
|
|
967
972
|
import { createContext as createContext15 } from "react";
|
|
968
973
|
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
969
|
-
import {
|
|
974
|
+
import {
|
|
975
|
+
forwardRef as forwardRef4,
|
|
976
|
+
useEffect as useEffect5,
|
|
977
|
+
useImperativeHandle as useImperativeHandle2,
|
|
978
|
+
useLayoutEffect as useLayoutEffect2,
|
|
979
|
+
useRef as useRef9,
|
|
980
|
+
useState as useState6
|
|
981
|
+
} from "react";
|
|
982
|
+
import React14, { useCallback as useCallback6, useImperativeHandle, useMemo as useMemo16, useRef as useRef8 } from "react";
|
|
983
|
+
import { useEffect as useEffect4, useMemo as useMemo15, useRef as useRef7 } from "react";
|
|
970
984
|
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
985
|
+
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
971
986
|
import {
|
|
972
987
|
forwardRef as forwardRef5,
|
|
988
|
+
useCallback as useCallback7,
|
|
973
989
|
useEffect as useEffect6,
|
|
974
|
-
|
|
975
|
-
useLayoutEffect as useLayoutEffect2,
|
|
976
|
-
useRef as useRef8,
|
|
990
|
+
useMemo as useMemo17,
|
|
977
991
|
useState as useState7
|
|
978
992
|
} from "react";
|
|
979
|
-
import React15, { useCallback as useCallback7, useImperativeHandle, useRef as useRef7 } from "react";
|
|
980
|
-
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
981
993
|
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
982
994
|
import {
|
|
983
995
|
createContext as createContext16,
|
|
@@ -985,78 +997,78 @@ import {
|
|
|
985
997
|
useCallback as useCallback8,
|
|
986
998
|
useContext as useContext18,
|
|
987
999
|
useLayoutEffect as useLayoutEffect3,
|
|
988
|
-
useMemo as
|
|
989
|
-
useRef as
|
|
990
|
-
useState as useState8
|
|
1000
|
+
useMemo as useMemo18,
|
|
1001
|
+
useRef as useRef10
|
|
991
1002
|
} from "react";
|
|
992
1003
|
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
993
|
-
import { useContext as useContext19, useLayoutEffect as useLayoutEffect5, useState as
|
|
1004
|
+
import { useContext as useContext19, useLayoutEffect as useLayoutEffect5, useState as useState9 } from "react";
|
|
994
1005
|
import {
|
|
995
1006
|
createContext as createContext17,
|
|
996
1007
|
useCallback as useCallback9,
|
|
997
1008
|
useImperativeHandle as useImperativeHandle3,
|
|
998
1009
|
useLayoutEffect as useLayoutEffect4,
|
|
999
|
-
useMemo as
|
|
1000
|
-
useRef as
|
|
1001
|
-
useState as
|
|
1010
|
+
useMemo as useMemo19,
|
|
1011
|
+
useRef as useRef11,
|
|
1012
|
+
useState as useState8
|
|
1002
1013
|
} from "react";
|
|
1003
1014
|
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
1004
|
-
import { forwardRef as forwardRef9, useCallback as
|
|
1005
|
-
import React17, { createContext as createContext18, useMemo as
|
|
1015
|
+
import { forwardRef as forwardRef9, useCallback as useCallback15, useContext as useContext31 } from "react";
|
|
1016
|
+
import React17, { createContext as createContext18, useMemo as useMemo20 } from "react";
|
|
1006
1017
|
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
1007
1018
|
import { useContext as useContext20 } from "react";
|
|
1008
|
-
import { createContext as createContext19, useEffect as useEffect7, useState as
|
|
1019
|
+
import { createContext as createContext19, useEffect as useEffect7, useState as useState10 } from "react";
|
|
1009
1020
|
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
1010
|
-
import { createContext as createContext20, useMemo as
|
|
1021
|
+
import { createContext as createContext20, useMemo as useMemo21, useReducer } from "react";
|
|
1011
1022
|
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
1023
|
+
import { useCallback as useCallback14 } from "react";
|
|
1012
1024
|
import React23, {
|
|
1013
1025
|
forwardRef as forwardRef7,
|
|
1014
1026
|
useContext as useContext29,
|
|
1015
1027
|
useEffect as useEffect14,
|
|
1016
1028
|
useImperativeHandle as useImperativeHandle4,
|
|
1017
|
-
useMemo as
|
|
1018
|
-
useRef as
|
|
1019
|
-
useState as
|
|
1029
|
+
useMemo as useMemo29,
|
|
1030
|
+
useRef as useRef19,
|
|
1031
|
+
useState as useState15
|
|
1020
1032
|
} from "react";
|
|
1021
|
-
import { useContext as useContext22, useLayoutEffect as useLayoutEffect6, useRef as
|
|
1033
|
+
import { useContext as useContext22, useLayoutEffect as useLayoutEffect6, useRef as useRef14 } from "react";
|
|
1022
1034
|
import React20, {
|
|
1023
1035
|
createContext as createContext21,
|
|
1024
1036
|
createRef as createRef2,
|
|
1025
1037
|
useCallback as useCallback10,
|
|
1026
1038
|
useContext as useContext21,
|
|
1027
|
-
useMemo as
|
|
1028
|
-
useRef as
|
|
1029
|
-
useState as
|
|
1039
|
+
useMemo as useMemo23,
|
|
1040
|
+
useRef as useRef12,
|
|
1041
|
+
useState as useState11
|
|
1030
1042
|
} from "react";
|
|
1031
|
-
import { useMemo as
|
|
1043
|
+
import { useMemo as useMemo22 } from "react";
|
|
1032
1044
|
import { jsx as jsx20, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
1033
|
-
import { useRef as
|
|
1034
|
-
import { useContext as useContext24, useEffect as useEffect8, useMemo as
|
|
1045
|
+
import { useRef as useRef13 } from "react";
|
|
1046
|
+
import { useContext as useContext24, useEffect as useEffect8, useMemo as useMemo24, useState as useState12 } from "react";
|
|
1035
1047
|
import { useContext as useContext23 } from "react";
|
|
1036
1048
|
import {
|
|
1037
1049
|
useCallback as useCallback13,
|
|
1038
1050
|
useContext as useContext27,
|
|
1039
1051
|
useEffect as useEffect12,
|
|
1040
1052
|
useLayoutEffect as useLayoutEffect8,
|
|
1041
|
-
useRef as
|
|
1053
|
+
useRef as useRef18
|
|
1042
1054
|
} from "react";
|
|
1043
|
-
import { useCallback as useCallback12, useMemo as
|
|
1044
|
-
import { useContext as useContext26, useMemo as
|
|
1055
|
+
import { useCallback as useCallback12, useMemo as useMemo27, useRef as useRef16 } from "react";
|
|
1056
|
+
import { useContext as useContext26, useMemo as useMemo26 } from "react";
|
|
1045
1057
|
import React21, {
|
|
1046
1058
|
useCallback as useCallback11,
|
|
1047
1059
|
useContext as useContext25,
|
|
1048
1060
|
useEffect as useEffect9,
|
|
1049
1061
|
useLayoutEffect as useLayoutEffect7,
|
|
1050
|
-
useMemo as
|
|
1051
|
-
useRef as
|
|
1052
|
-
useState as
|
|
1062
|
+
useMemo as useMemo25,
|
|
1063
|
+
useRef as useRef15,
|
|
1064
|
+
useState as useState13
|
|
1053
1065
|
} from "react";
|
|
1054
1066
|
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
1055
1067
|
import React22 from "react";
|
|
1056
|
-
import { useEffect as useEffect10, useState as
|
|
1057
|
-
import { useEffect as useEffect11, useRef as
|
|
1068
|
+
import { useEffect as useEffect10, useState as useState14 } from "react";
|
|
1069
|
+
import { useEffect as useEffect11, useRef as useRef17 } from "react";
|
|
1058
1070
|
import { useEffect as useEffect13 } from "react";
|
|
1059
|
-
import { createContext as createContext22, useContext as useContext28, useMemo as
|
|
1071
|
+
import { createContext as createContext22, useContext as useContext28, useMemo as useMemo28 } from "react";
|
|
1060
1072
|
import { jsx as jsx222 } from "react/jsx-runtime";
|
|
1061
1073
|
import {
|
|
1062
1074
|
forwardRef as forwardRef8,
|
|
@@ -1064,47 +1076,47 @@ import {
|
|
|
1064
1076
|
useEffect as useEffect15,
|
|
1065
1077
|
useImperativeHandle as useImperativeHandle5,
|
|
1066
1078
|
useLayoutEffect as useLayoutEffect9,
|
|
1067
|
-
useMemo as
|
|
1068
|
-
useRef as
|
|
1079
|
+
useMemo as useMemo30,
|
|
1080
|
+
useRef as useRef20
|
|
1069
1081
|
} from "react";
|
|
1070
1082
|
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
1071
1083
|
import { jsx as jsx24 } from "react/jsx-runtime";
|
|
1072
|
-
import { forwardRef as forwardRef10, useCallback as
|
|
1084
|
+
import { forwardRef as forwardRef10, useCallback as useCallback16, useState as useState16 } from "react";
|
|
1073
1085
|
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
1074
1086
|
import {
|
|
1075
|
-
useCallback as
|
|
1087
|
+
useCallback as useCallback17,
|
|
1076
1088
|
useContext as useContext32,
|
|
1077
1089
|
useImperativeHandle as useImperativeHandle6,
|
|
1078
1090
|
useLayoutEffect as useLayoutEffect10,
|
|
1079
|
-
useRef as
|
|
1080
|
-
useState as
|
|
1091
|
+
useRef as useRef21,
|
|
1092
|
+
useState as useState17
|
|
1081
1093
|
} from "react";
|
|
1082
1094
|
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
1083
1095
|
import { createRef as createRef3 } from "react";
|
|
1084
1096
|
import React28 from "react";
|
|
1085
1097
|
import {
|
|
1086
|
-
useCallback as
|
|
1098
|
+
useCallback as useCallback18,
|
|
1087
1099
|
useImperativeHandle as useImperativeHandle7,
|
|
1088
|
-
useMemo as
|
|
1089
|
-
useRef as
|
|
1090
|
-
useState as
|
|
1100
|
+
useMemo as useMemo31,
|
|
1101
|
+
useRef as useRef22,
|
|
1102
|
+
useState as useState18
|
|
1091
1103
|
} from "react";
|
|
1092
1104
|
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
1093
1105
|
import React29 from "react";
|
|
1094
|
-
import { useMemo as
|
|
1095
|
-
import { createContext as createContext23, useContext as useContext33, useMemo as
|
|
1106
|
+
import { useMemo as useMemo33 } from "react";
|
|
1107
|
+
import { createContext as createContext23, useContext as useContext33, useMemo as useMemo32 } from "react";
|
|
1096
1108
|
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
1097
1109
|
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
1098
1110
|
import React31 from "react";
|
|
1099
1111
|
import React32, { createContext as createContext24 } from "react";
|
|
1100
|
-
import { useCallback as
|
|
1112
|
+
import { useCallback as useCallback21 } from "react";
|
|
1101
1113
|
import {
|
|
1102
|
-
useCallback as
|
|
1114
|
+
useCallback as useCallback19,
|
|
1103
1115
|
useContext as useContext34,
|
|
1104
1116
|
useEffect as useEffect16,
|
|
1105
1117
|
useLayoutEffect as useLayoutEffect11,
|
|
1106
|
-
useMemo as
|
|
1107
|
-
useState as
|
|
1118
|
+
useMemo as useMemo34,
|
|
1119
|
+
useState as useState19
|
|
1108
1120
|
} from "react";
|
|
1109
1121
|
import { jsx as jsx30 } from "react/jsx-runtime";
|
|
1110
1122
|
import React34, {
|
|
@@ -1112,45 +1124,42 @@ import React34, {
|
|
|
1112
1124
|
useContext as useContext35,
|
|
1113
1125
|
useEffect as useEffect18,
|
|
1114
1126
|
useImperativeHandle as useImperativeHandle8,
|
|
1115
|
-
useMemo as
|
|
1116
|
-
useRef as
|
|
1117
|
-
useState as
|
|
1127
|
+
useMemo as useMemo35,
|
|
1128
|
+
useRef as useRef23,
|
|
1129
|
+
useState as useState20,
|
|
1130
|
+
useCallback as useCallback20
|
|
1118
1131
|
} from "react";
|
|
1119
1132
|
import { useEffect as useEffect17 } from "react";
|
|
1120
1133
|
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
1121
1134
|
import { jsx as jsx32 } from "react/jsx-runtime";
|
|
1122
|
-
import React36, { useMemo as
|
|
1135
|
+
import React36, { useMemo as useMemo36 } from "react";
|
|
1123
1136
|
import { jsx as jsx33 } from "react/jsx-runtime";
|
|
1124
|
-
import { Children, forwardRef as forwardRef12, useMemo as
|
|
1137
|
+
import { Children, forwardRef as forwardRef12, useMemo as useMemo37 } from "react";
|
|
1125
1138
|
import React37 from "react";
|
|
1126
1139
|
import React38, { createContext as createContext25 } from "react";
|
|
1127
1140
|
import { jsx as jsx34 } from "react/jsx-runtime";
|
|
1128
1141
|
import { jsx as jsx35 } from "react/jsx-runtime";
|
|
1129
1142
|
import React40 from "react";
|
|
1130
|
-
import { forwardRef as forwardRef14, useCallback as
|
|
1143
|
+
import { forwardRef as forwardRef14, useCallback as useCallback22, useContext as useContext37 } from "react";
|
|
1131
1144
|
import {
|
|
1132
1145
|
forwardRef as forwardRef13,
|
|
1133
1146
|
useContext as useContext36,
|
|
1134
1147
|
useEffect as useEffect19,
|
|
1135
1148
|
useImperativeHandle as useImperativeHandle9,
|
|
1136
1149
|
useLayoutEffect as useLayoutEffect12,
|
|
1137
|
-
useMemo as
|
|
1138
|
-
useRef as
|
|
1150
|
+
useMemo as useMemo38,
|
|
1151
|
+
useRef as useRef24
|
|
1139
1152
|
} from "react";
|
|
1140
1153
|
import { jsx as jsx36 } from "react/jsx-runtime";
|
|
1141
1154
|
import { jsx as jsx37 } from "react/jsx-runtime";
|
|
1142
1155
|
var __defProp2 = Object.defineProperty;
|
|
1143
|
-
var __returnValue2 = (v) => v;
|
|
1144
|
-
function __exportSetter2(name, newValue) {
|
|
1145
|
-
this[name] = __returnValue2.bind(null, newValue);
|
|
1146
|
-
}
|
|
1147
1156
|
var __export2 = (target, all) => {
|
|
1148
1157
|
for (var name in all)
|
|
1149
1158
|
__defProp2(target, name, {
|
|
1150
1159
|
get: all[name],
|
|
1151
1160
|
enumerable: true,
|
|
1152
1161
|
configurable: true,
|
|
1153
|
-
set:
|
|
1162
|
+
set: (newValue) => all[name] = () => newValue
|
|
1154
1163
|
});
|
|
1155
1164
|
};
|
|
1156
1165
|
if (typeof createContext !== "function") {
|
|
@@ -2215,75 +2224,33 @@ var getComponentsToAddStacksTo = () => componentsToAddStacksTo;
|
|
|
2215
2224
|
var addSequenceStackTraces = (component) => {
|
|
2216
2225
|
componentsToAddStacksTo.push(component);
|
|
2217
2226
|
};
|
|
2218
|
-
var
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
default: "0px 0px",
|
|
2223
|
-
description: "Offset"
|
|
2224
|
-
},
|
|
2225
|
-
"style.scale": {
|
|
2226
|
-
type: "number",
|
|
2227
|
-
min: 0.05,
|
|
2228
|
-
max: 100,
|
|
2229
|
-
step: 0.01,
|
|
2230
|
-
default: 1,
|
|
2231
|
-
description: "Scale"
|
|
2232
|
-
},
|
|
2233
|
-
"style.rotate": {
|
|
2234
|
-
type: "rotation",
|
|
2235
|
-
step: 1,
|
|
2236
|
-
default: "0deg",
|
|
2237
|
-
description: "Rotation"
|
|
2238
|
-
},
|
|
2239
|
-
"style.opacity": {
|
|
2240
|
-
type: "number",
|
|
2241
|
-
min: 0,
|
|
2242
|
-
max: 1,
|
|
2243
|
-
step: 0.01,
|
|
2244
|
-
default: 1,
|
|
2245
|
-
description: "Opacity"
|
|
2246
|
-
},
|
|
2247
|
-
premountFor: {
|
|
2248
|
-
type: "number",
|
|
2249
|
-
default: 0,
|
|
2250
|
-
description: "Premount For",
|
|
2251
|
-
min: 0,
|
|
2252
|
-
step: 1
|
|
2253
|
-
},
|
|
2254
|
-
postmountFor: {
|
|
2255
|
-
type: "hidden"
|
|
2256
|
-
},
|
|
2257
|
-
styleWhilePremounted: {
|
|
2258
|
-
type: "hidden"
|
|
2259
|
-
},
|
|
2260
|
-
styleWhilePostmounted: {
|
|
2261
|
-
type: "hidden"
|
|
2227
|
+
var VERSION = "4.0.464";
|
|
2228
|
+
var checkMultipleRemotionVersions = () => {
|
|
2229
|
+
if (typeof globalThis === "undefined") {
|
|
2230
|
+
return;
|
|
2262
2231
|
}
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
description: "Hidden"
|
|
2268
|
-
};
|
|
2269
|
-
var sequenceSchema = {
|
|
2270
|
-
hidden: hiddenField,
|
|
2271
|
-
layout: {
|
|
2272
|
-
type: "enum",
|
|
2273
|
-
default: "absolute-fill",
|
|
2274
|
-
description: "Layout",
|
|
2275
|
-
variants: {
|
|
2276
|
-
"absolute-fill": sequenceStyleSchema,
|
|
2277
|
-
none: {}
|
|
2232
|
+
const set = () => {
|
|
2233
|
+
globalThis.remotion_imported = VERSION;
|
|
2234
|
+
if (typeof window !== "undefined") {
|
|
2235
|
+
window.remotion_imported = VERSION;
|
|
2278
2236
|
}
|
|
2237
|
+
};
|
|
2238
|
+
const alreadyImported = globalThis.remotion_imported || typeof window !== "undefined" && window.remotion_imported;
|
|
2239
|
+
if (alreadyImported) {
|
|
2240
|
+
if (alreadyImported === VERSION) {
|
|
2241
|
+
return;
|
|
2242
|
+
}
|
|
2243
|
+
if (typeof alreadyImported === "string" && alreadyImported.includes("webcodecs")) {
|
|
2244
|
+
set();
|
|
2245
|
+
return;
|
|
2246
|
+
}
|
|
2247
|
+
throw new TypeError(`\uD83D\uDEA8 Multiple versions of Remotion detected: ${[
|
|
2248
|
+
VERSION,
|
|
2249
|
+
typeof alreadyImported === "string" ? alreadyImported : "an older version"
|
|
2250
|
+
].filter(truthy).join(" and ")}. This will cause things to break in an unexpected way.
|
|
2251
|
+
Check that all your Remotion packages are on the same version. If your dependencies depend on Remotion, make them peer dependencies. You can also run \`npx remotion versions\` from your terminal to see which versions are mismatching.`);
|
|
2279
2252
|
}
|
|
2280
|
-
|
|
2281
|
-
var sequenceSchemaDefaultLayoutNone = {
|
|
2282
|
-
...sequenceSchema,
|
|
2283
|
-
layout: {
|
|
2284
|
-
...sequenceSchema.layout,
|
|
2285
|
-
default: "none"
|
|
2286
|
-
}
|
|
2253
|
+
set();
|
|
2287
2254
|
};
|
|
2288
2255
|
var SequenceContext = createContext12(null);
|
|
2289
2256
|
var exports_timeline_position_state = {};
|
|
@@ -2619,6 +2586,82 @@ var Freeze = ({
|
|
|
2619
2586
|
var PremountContext = createContext14({
|
|
2620
2587
|
premountFramesRemaining: 0
|
|
2621
2588
|
});
|
|
2589
|
+
var sequenceVisualStyleSchema = {
|
|
2590
|
+
"style.translate": {
|
|
2591
|
+
type: "translate",
|
|
2592
|
+
step: 1,
|
|
2593
|
+
default: "0px 0px",
|
|
2594
|
+
description: "Offset"
|
|
2595
|
+
},
|
|
2596
|
+
"style.scale": {
|
|
2597
|
+
type: "number",
|
|
2598
|
+
min: 0.05,
|
|
2599
|
+
max: 100,
|
|
2600
|
+
step: 0.01,
|
|
2601
|
+
default: 1,
|
|
2602
|
+
description: "Scale"
|
|
2603
|
+
},
|
|
2604
|
+
"style.rotate": {
|
|
2605
|
+
type: "rotation",
|
|
2606
|
+
step: 1,
|
|
2607
|
+
default: "0deg",
|
|
2608
|
+
description: "Rotation"
|
|
2609
|
+
},
|
|
2610
|
+
"style.opacity": {
|
|
2611
|
+
type: "number",
|
|
2612
|
+
min: 0,
|
|
2613
|
+
max: 1,
|
|
2614
|
+
step: 0.01,
|
|
2615
|
+
default: 1,
|
|
2616
|
+
description: "Opacity"
|
|
2617
|
+
}
|
|
2618
|
+
};
|
|
2619
|
+
var sequencePremountSchema = {
|
|
2620
|
+
premountFor: {
|
|
2621
|
+
type: "number",
|
|
2622
|
+
default: 0,
|
|
2623
|
+
description: "Premount For",
|
|
2624
|
+
min: 0,
|
|
2625
|
+
step: 1
|
|
2626
|
+
},
|
|
2627
|
+
postmountFor: {
|
|
2628
|
+
type: "hidden"
|
|
2629
|
+
},
|
|
2630
|
+
styleWhilePremounted: {
|
|
2631
|
+
type: "hidden"
|
|
2632
|
+
},
|
|
2633
|
+
styleWhilePostmounted: {
|
|
2634
|
+
type: "hidden"
|
|
2635
|
+
}
|
|
2636
|
+
};
|
|
2637
|
+
var sequenceStyleSchema = {
|
|
2638
|
+
...sequenceVisualStyleSchema,
|
|
2639
|
+
...sequencePremountSchema
|
|
2640
|
+
};
|
|
2641
|
+
var hiddenField = {
|
|
2642
|
+
type: "boolean",
|
|
2643
|
+
default: false,
|
|
2644
|
+
description: "Hidden"
|
|
2645
|
+
};
|
|
2646
|
+
var sequenceSchema = {
|
|
2647
|
+
hidden: hiddenField,
|
|
2648
|
+
layout: {
|
|
2649
|
+
type: "enum",
|
|
2650
|
+
default: "absolute-fill",
|
|
2651
|
+
description: "Layout",
|
|
2652
|
+
variants: {
|
|
2653
|
+
"absolute-fill": sequenceStyleSchema,
|
|
2654
|
+
none: {}
|
|
2655
|
+
}
|
|
2656
|
+
}
|
|
2657
|
+
};
|
|
2658
|
+
var sequenceSchemaDefaultLayoutNone = {
|
|
2659
|
+
...sequenceSchema,
|
|
2660
|
+
layout: {
|
|
2661
|
+
...sequenceSchema.layout,
|
|
2662
|
+
default: "none"
|
|
2663
|
+
}
|
|
2664
|
+
};
|
|
2622
2665
|
var SequenceManager = React11.createContext({
|
|
2623
2666
|
registerSequence: () => {
|
|
2624
2667
|
throw new Error("SequenceManagerContext not initialized");
|
|
@@ -3301,7 +3344,8 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
3301
3344
|
}, [name]);
|
|
3302
3345
|
const env = useRemotionEnvironment();
|
|
3303
3346
|
const inheritedStack = other?.stack ?? null;
|
|
3304
|
-
const
|
|
3347
|
+
const stackRef = useRef6(null);
|
|
3348
|
+
stackRef.current = stack ?? inheritedStack;
|
|
3305
3349
|
useEffect3(() => {
|
|
3306
3350
|
if (!env.isStudio) {
|
|
3307
3351
|
return;
|
|
@@ -3325,7 +3369,7 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
3325
3369
|
rootId,
|
|
3326
3370
|
showInTimeline,
|
|
3327
3371
|
src: isMedia.data.src,
|
|
3328
|
-
|
|
3372
|
+
getStack: () => stackRef.current,
|
|
3329
3373
|
startMediaFrom: isMedia.data.startMediaFrom,
|
|
3330
3374
|
volume: isMedia.data.volumes
|
|
3331
3375
|
});
|
|
@@ -3344,7 +3388,7 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
3344
3388
|
showInTimeline,
|
|
3345
3389
|
nonce: nonce.get(),
|
|
3346
3390
|
loopDisplay,
|
|
3347
|
-
|
|
3391
|
+
getStack: () => stackRef.current,
|
|
3348
3392
|
premountDisplay: premountDisplay ?? null,
|
|
3349
3393
|
postmountDisplay: postmountDisplay ?? null,
|
|
3350
3394
|
controls: controls ?? null,
|
|
@@ -3367,7 +3411,6 @@ var RegularSequenceRefForwardingFunction = ({
|
|
|
3367
3411
|
showInTimeline,
|
|
3368
3412
|
nonce,
|
|
3369
3413
|
loopDisplay,
|
|
3370
|
-
stackDoesntChange,
|
|
3371
3414
|
premountDisplay,
|
|
3372
3415
|
postmountDisplay,
|
|
3373
3416
|
env.isStudio,
|
|
@@ -3476,6 +3519,10 @@ var SequenceRefForwardingFunction = (props, ref) => {
|
|
|
3476
3519
|
};
|
|
3477
3520
|
var SequenceInner = forwardRef3(SequenceRefForwardingFunction);
|
|
3478
3521
|
var Sequence = wrapInSchema(SequenceInner, sequenceSchema);
|
|
3522
|
+
var WEBGL_CONTEXT_DOCS_URL = "https://remotion.dev/docs/troubleshooting/webgl2-context";
|
|
3523
|
+
var webGlContextErrorMessage = (versionLabel, effectName) => `Failed to acquire ${versionLabel} context for ${effectName}. ` + 'Pass --gl=angle when using the CLI, set chromiumOptions: { gl: "angle" } when using SSR APIs, ' + 'or set "OpenGL render backend" to "angle" in the Advanced section when rendering in the Studio. ' + `See ${WEBGL_CONTEXT_DOCS_URL}`;
|
|
3524
|
+
var createWebGLContextError = (effectName) => new Error(webGlContextErrorMessage("WebGL", effectName));
|
|
3525
|
+
var createWebGL2ContextError = (effectName) => new Error(webGlContextErrorMessage("WebGL2", effectName));
|
|
3479
3526
|
|
|
3480
3527
|
class CanvasPool {
|
|
3481
3528
|
width;
|
|
@@ -3524,7 +3571,7 @@ class CanvasPool {
|
|
|
3524
3571
|
preserveDrawingBuffer: true
|
|
3525
3572
|
});
|
|
3526
3573
|
if (!ctx) {
|
|
3527
|
-
throw
|
|
3574
|
+
throw createWebGL2ContextError("canvas effect");
|
|
3528
3575
|
}
|
|
3529
3576
|
canvas.addEventListener("webglcontextlost", (e) => {
|
|
3530
3577
|
e.preventDefault();
|
|
@@ -3679,219 +3726,39 @@ var runEffectChain = async ({
|
|
|
3679
3726
|
currentImage = bitmap;
|
|
3680
3727
|
}
|
|
3681
3728
|
}
|
|
3682
|
-
if (!lastTarget) {
|
|
3683
|
-
return true;
|
|
3684
|
-
}
|
|
3685
|
-
const outCtx = output.getContext("2d");
|
|
3686
|
-
if (!outCtx) {
|
|
3687
|
-
throw new Error("Failed to acquire 2D context for output canvas");
|
|
3688
|
-
}
|
|
3689
|
-
outCtx.clearRect(0, 0, width, height);
|
|
3690
|
-
outCtx.drawImage(lastTarget, 0, 0, width, height);
|
|
3691
|
-
return true;
|
|
3692
|
-
};
|
|
3693
|
-
var useEffectChainState = () => {
|
|
3694
|
-
const chainStateRef =
|
|
3695
|
-
const sizeRef =
|
|
3696
|
-
useEffect4(() => {
|
|
3697
|
-
return () => {
|
|
3698
|
-
if (chainStateRef.current) {
|
|
3699
|
-
cleanupEffectChainState(chainStateRef.current);
|
|
3700
|
-
}
|
|
3701
|
-
};
|
|
3702
|
-
}, []);
|
|
3703
|
-
return useMemo15(() => ({
|
|
3704
|
-
get: (width, height) => {
|
|
3705
|
-
if (!sizeRef.current || sizeRef.current.width !== width || sizeRef.current.height !== height) {
|
|
3706
|
-
if (chainStateRef.current) {
|
|
3707
|
-
cleanupEffectChainState(chainStateRef.current);
|
|
3708
|
-
}
|
|
3709
|
-
chainStateRef.current = createEffectChainState(width, height);
|
|
3710
|
-
sizeRef.current = { width, height };
|
|
3711
|
-
}
|
|
3712
|
-
return chainStateRef.current;
|
|
3713
|
-
}
|
|
3714
|
-
}), []);
|
|
3715
|
-
};
|
|
3716
|
-
var solidSchema = {
|
|
3717
|
-
color: {
|
|
3718
|
-
type: "color",
|
|
3719
|
-
default: "#ffffff",
|
|
3720
|
-
description: "Color"
|
|
3721
|
-
},
|
|
3722
|
-
width: {
|
|
3723
|
-
type: "number",
|
|
3724
|
-
min: 1,
|
|
3725
|
-
step: 1,
|
|
3726
|
-
default: 1920,
|
|
3727
|
-
description: "Width"
|
|
3728
|
-
},
|
|
3729
|
-
height: {
|
|
3730
|
-
type: "number",
|
|
3731
|
-
min: 1,
|
|
3732
|
-
step: 1,
|
|
3733
|
-
default: 1080,
|
|
3734
|
-
description: "Height"
|
|
3735
|
-
},
|
|
3736
|
-
...sequenceStyleSchema
|
|
3737
|
-
};
|
|
3738
|
-
var SolidInner = ({
|
|
3739
|
-
color,
|
|
3740
|
-
width,
|
|
3741
|
-
height,
|
|
3742
|
-
_experimentalEffects: experimentalEffects = [],
|
|
3743
|
-
className,
|
|
3744
|
-
style,
|
|
3745
|
-
overrideId,
|
|
3746
|
-
ref
|
|
3747
|
-
}) => {
|
|
3748
|
-
const { delayRender: delayRender2, continueRender: continueRender2, cancelRender: cancelRender2 } = useDelayRender();
|
|
3749
|
-
const [outputCanvas, setOutputCanvas] = useState6(null);
|
|
3750
|
-
const memoizedEffects = useMemoizedEffects({
|
|
3751
|
-
effects: experimentalEffects,
|
|
3752
|
-
overrideId: overrideId ?? null
|
|
3753
|
-
});
|
|
3754
|
-
const sourceCanvas = useMemo16(() => {
|
|
3755
|
-
if (typeof document === "undefined") {
|
|
3756
|
-
return null;
|
|
3757
|
-
}
|
|
3758
|
-
const canvas = document.createElement("canvas");
|
|
3759
|
-
canvas.width = 1;
|
|
3760
|
-
canvas.height = 1;
|
|
3761
|
-
return canvas;
|
|
3762
|
-
}, []);
|
|
3763
|
-
const chainState = useEffectChainState();
|
|
3764
|
-
const canvasRef = useCallback6((canvas) => {
|
|
3765
|
-
setOutputCanvas(canvas);
|
|
3766
|
-
if (typeof ref === "function") {
|
|
3767
|
-
ref(canvas);
|
|
3768
|
-
} else if (ref) {
|
|
3769
|
-
ref.current = canvas;
|
|
3770
|
-
}
|
|
3771
|
-
}, [ref]);
|
|
3772
|
-
useEffect5(() => {
|
|
3773
|
-
if (!outputCanvas || !sourceCanvas) {
|
|
3774
|
-
return;
|
|
3775
|
-
}
|
|
3776
|
-
const handle = delayRender2("Solid effect chain");
|
|
3777
|
-
if (!chainState) {
|
|
3778
|
-
continueRender2(handle);
|
|
3779
|
-
return () => {
|
|
3780
|
-
continueRender2(handle);
|
|
3781
|
-
};
|
|
3782
|
-
}
|
|
3783
|
-
const ctx = sourceCanvas.getContext("2d", { colorSpace: "srgb" });
|
|
3784
|
-
if (!ctx) {
|
|
3785
|
-
cancelRender2(new Error("Failed to acquire 2D context for <Solid> source"));
|
|
3786
|
-
return;
|
|
3787
|
-
}
|
|
3788
|
-
ctx.fillStyle = color;
|
|
3789
|
-
ctx.fillRect(0, 0, 1, 1);
|
|
3790
|
-
runEffectChain({
|
|
3791
|
-
state: chainState.get(width, height),
|
|
3792
|
-
source: sourceCanvas,
|
|
3793
|
-
effects: memoizedEffects,
|
|
3794
|
-
output: outputCanvas,
|
|
3795
|
-
width,
|
|
3796
|
-
height
|
|
3797
|
-
}).then((completed) => {
|
|
3798
|
-
if (completed) {
|
|
3799
|
-
continueRender2(handle);
|
|
3800
|
-
}
|
|
3801
|
-
}).catch((err) => {
|
|
3802
|
-
cancelRender2(err);
|
|
3803
|
-
});
|
|
3804
|
-
return () => {
|
|
3805
|
-
continueRender2(handle);
|
|
3806
|
-
};
|
|
3807
|
-
}, [
|
|
3808
|
-
color,
|
|
3809
|
-
outputCanvas,
|
|
3810
|
-
sourceCanvas,
|
|
3811
|
-
chainState,
|
|
3812
|
-
width,
|
|
3813
|
-
height,
|
|
3814
|
-
delayRender2,
|
|
3815
|
-
continueRender2,
|
|
3816
|
-
cancelRender2,
|
|
3817
|
-
memoizedEffects
|
|
3818
|
-
]);
|
|
3819
|
-
return /* @__PURE__ */ jsx12("canvas", {
|
|
3820
|
-
ref: canvasRef,
|
|
3821
|
-
width,
|
|
3822
|
-
height,
|
|
3823
|
-
className,
|
|
3824
|
-
style
|
|
3825
|
-
});
|
|
3826
|
-
};
|
|
3827
|
-
var SolidOuter = forwardRef4(({
|
|
3828
|
-
_experimentalEffects = [],
|
|
3829
|
-
_experimentalControls: controls,
|
|
3830
|
-
color,
|
|
3831
|
-
height,
|
|
3832
|
-
width,
|
|
3833
|
-
className,
|
|
3834
|
-
durationInFrames,
|
|
3835
|
-
style,
|
|
3836
|
-
name,
|
|
3837
|
-
from,
|
|
3838
|
-
hidden,
|
|
3839
|
-
showInTimeline,
|
|
3840
|
-
...props
|
|
3841
|
-
}, ref) => {
|
|
3842
|
-
const memoizedEffectDefinitions = useMemoizedEffectDefinitions(_experimentalEffects);
|
|
3843
|
-
return /* @__PURE__ */ jsx12(Sequence, {
|
|
3844
|
-
layout: "none",
|
|
3845
|
-
from,
|
|
3846
|
-
hidden,
|
|
3847
|
-
showInTimeline,
|
|
3848
|
-
_experimentalControls: controls,
|
|
3849
|
-
_experimentalEffects: memoizedEffectDefinitions,
|
|
3850
|
-
durationInFrames,
|
|
3851
|
-
name: name ?? "<Solid>",
|
|
3852
|
-
...props,
|
|
3853
|
-
children: /* @__PURE__ */ jsx12(SolidInner, {
|
|
3854
|
-
ref,
|
|
3855
|
-
overrideId: controls?.overrideId ?? null,
|
|
3856
|
-
color,
|
|
3857
|
-
height,
|
|
3858
|
-
width,
|
|
3859
|
-
className,
|
|
3860
|
-
style,
|
|
3861
|
-
_experimentalEffects
|
|
3862
|
-
})
|
|
3863
|
-
});
|
|
3864
|
-
});
|
|
3865
|
-
var Solid = wrapInSchema(SolidOuter, solidSchema);
|
|
3866
|
-
Solid.displayName = "Solid";
|
|
3867
|
-
addSequenceStackTraces(Solid);
|
|
3868
|
-
var VERSION = "4.0.463";
|
|
3869
|
-
var checkMultipleRemotionVersions = () => {
|
|
3870
|
-
if (typeof globalThis === "undefined") {
|
|
3871
|
-
return;
|
|
3872
|
-
}
|
|
3873
|
-
const set = () => {
|
|
3874
|
-
globalThis.remotion_imported = VERSION;
|
|
3875
|
-
if (typeof window !== "undefined") {
|
|
3876
|
-
window.remotion_imported = VERSION;
|
|
3877
|
-
}
|
|
3878
|
-
};
|
|
3879
|
-
const alreadyImported = globalThis.remotion_imported || typeof window !== "undefined" && window.remotion_imported;
|
|
3880
|
-
if (alreadyImported) {
|
|
3881
|
-
if (alreadyImported === VERSION) {
|
|
3882
|
-
return;
|
|
3883
|
-
}
|
|
3884
|
-
if (typeof alreadyImported === "string" && alreadyImported.includes("webcodecs")) {
|
|
3885
|
-
set();
|
|
3886
|
-
return;
|
|
3887
|
-
}
|
|
3888
|
-
throw new TypeError(`\uD83D\uDEA8 Multiple versions of Remotion detected: ${[
|
|
3889
|
-
VERSION,
|
|
3890
|
-
typeof alreadyImported === "string" ? alreadyImported : "an older version"
|
|
3891
|
-
].filter(truthy).join(" and ")}. This will cause things to break in an unexpected way.
|
|
3892
|
-
Check that all your Remotion packages are on the same version. If your dependencies depend on Remotion, make them peer dependencies. You can also run \`npx remotion versions\` from your terminal to see which versions are mismatching.`);
|
|
3893
|
-
}
|
|
3894
|
-
set();
|
|
3729
|
+
if (!lastTarget) {
|
|
3730
|
+
return true;
|
|
3731
|
+
}
|
|
3732
|
+
const outCtx = output.getContext("2d");
|
|
3733
|
+
if (!outCtx) {
|
|
3734
|
+
throw new Error("Failed to acquire 2D context for output canvas");
|
|
3735
|
+
}
|
|
3736
|
+
outCtx.clearRect(0, 0, width, height);
|
|
3737
|
+
outCtx.drawImage(lastTarget, 0, 0, width, height);
|
|
3738
|
+
return true;
|
|
3739
|
+
};
|
|
3740
|
+
var useEffectChainState = () => {
|
|
3741
|
+
const chainStateRef = useRef7(null);
|
|
3742
|
+
const sizeRef = useRef7(null);
|
|
3743
|
+
useEffect4(() => {
|
|
3744
|
+
return () => {
|
|
3745
|
+
if (chainStateRef.current) {
|
|
3746
|
+
cleanupEffectChainState(chainStateRef.current);
|
|
3747
|
+
}
|
|
3748
|
+
};
|
|
3749
|
+
}, []);
|
|
3750
|
+
return useMemo15(() => ({
|
|
3751
|
+
get: (width, height) => {
|
|
3752
|
+
if (!sizeRef.current || sizeRef.current.width !== width || sizeRef.current.height !== height) {
|
|
3753
|
+
if (chainStateRef.current) {
|
|
3754
|
+
cleanupEffectChainState(chainStateRef.current);
|
|
3755
|
+
}
|
|
3756
|
+
chainStateRef.current = createEffectChainState(width, height);
|
|
3757
|
+
sizeRef.current = { width, height };
|
|
3758
|
+
}
|
|
3759
|
+
return chainStateRef.current;
|
|
3760
|
+
}
|
|
3761
|
+
}), []);
|
|
3895
3762
|
};
|
|
3896
3763
|
var calcArgs = (fit, frameSize, canvasSize) => {
|
|
3897
3764
|
switch (fit) {
|
|
@@ -3941,29 +3808,49 @@ var calcArgs = (fit, frameSize, canvasSize) => {
|
|
|
3941
3808
|
throw new Error("Unknown fit: " + fit);
|
|
3942
3809
|
}
|
|
3943
3810
|
};
|
|
3944
|
-
var CanvasRefForwardingFunction = ({ width, height, fit, className, style }, ref) => {
|
|
3945
|
-
const canvasRef =
|
|
3946
|
-
const
|
|
3811
|
+
var CanvasRefForwardingFunction = ({ width, height, fit, className, style, effects }, ref) => {
|
|
3812
|
+
const canvasRef = useRef8(null);
|
|
3813
|
+
const chainState = useEffectChainState();
|
|
3814
|
+
const sourceCanvas = useMemo16(() => {
|
|
3815
|
+
if (typeof document === "undefined") {
|
|
3816
|
+
return null;
|
|
3817
|
+
}
|
|
3818
|
+
return document.createElement("canvas");
|
|
3819
|
+
}, []);
|
|
3820
|
+
const draw = useCallback6(async (imageData) => {
|
|
3947
3821
|
const canvas = canvasRef.current;
|
|
3948
3822
|
const canvasWidth = width ?? imageData.displayWidth;
|
|
3949
3823
|
const canvasHeight = height ?? imageData.displayHeight;
|
|
3950
3824
|
if (!canvas) {
|
|
3951
3825
|
throw new Error("Canvas ref is not set");
|
|
3952
3826
|
}
|
|
3953
|
-
|
|
3954
|
-
|
|
3955
|
-
throw new Error("Could not get 2d context");
|
|
3827
|
+
if (!sourceCanvas) {
|
|
3828
|
+
throw new Error("Source canvas is not available");
|
|
3956
3829
|
}
|
|
3957
|
-
|
|
3958
|
-
|
|
3959
|
-
|
|
3830
|
+
sourceCanvas.width = canvasWidth;
|
|
3831
|
+
sourceCanvas.height = canvasHeight;
|
|
3832
|
+
const sourceCtx = sourceCanvas.getContext("2d");
|
|
3833
|
+
if (!sourceCtx) {
|
|
3834
|
+
throw new Error("Could not get 2d context for source canvas");
|
|
3835
|
+
}
|
|
3836
|
+
sourceCtx.drawImage(imageData, ...calcArgs(fit, {
|
|
3960
3837
|
height: imageData.displayHeight,
|
|
3961
3838
|
width: imageData.displayWidth
|
|
3962
3839
|
}, {
|
|
3963
3840
|
width: canvasWidth,
|
|
3964
3841
|
height: canvasHeight
|
|
3965
3842
|
}));
|
|
3966
|
-
|
|
3843
|
+
canvas.width = canvasWidth;
|
|
3844
|
+
canvas.height = canvasHeight;
|
|
3845
|
+
return runEffectChain({
|
|
3846
|
+
state: chainState.get(canvasWidth, canvasHeight),
|
|
3847
|
+
source: sourceCanvas,
|
|
3848
|
+
effects,
|
|
3849
|
+
output: canvas,
|
|
3850
|
+
width: canvasWidth,
|
|
3851
|
+
height: canvasHeight
|
|
3852
|
+
});
|
|
3853
|
+
}, [chainState, effects, fit, height, sourceCanvas, width]);
|
|
3967
3854
|
useImperativeHandle(ref, () => {
|
|
3968
3855
|
return {
|
|
3969
3856
|
draw,
|
|
@@ -3982,13 +3869,13 @@ var CanvasRefForwardingFunction = ({ width, height, fit, className, style }, ref
|
|
|
3982
3869
|
}
|
|
3983
3870
|
};
|
|
3984
3871
|
}, [draw]);
|
|
3985
|
-
return /* @__PURE__ */
|
|
3872
|
+
return /* @__PURE__ */ jsx12("canvas", {
|
|
3986
3873
|
ref: canvasRef,
|
|
3987
3874
|
className,
|
|
3988
3875
|
style
|
|
3989
3876
|
});
|
|
3990
3877
|
};
|
|
3991
|
-
var Canvas =
|
|
3878
|
+
var Canvas = React14.forwardRef(CanvasRefForwardingFunction);
|
|
3992
3879
|
var CACHE_SIZE = 5;
|
|
3993
3880
|
var getActualTime = ({
|
|
3994
3881
|
loopBehavior,
|
|
@@ -4144,10 +4031,10 @@ var animatedImageSchema = {
|
|
|
4144
4031
|
default: 1,
|
|
4145
4032
|
description: "Playback Rate"
|
|
4146
4033
|
},
|
|
4147
|
-
...
|
|
4034
|
+
...sequenceVisualStyleSchema,
|
|
4148
4035
|
hidden: hiddenField
|
|
4149
4036
|
};
|
|
4150
|
-
var AnimatedImageContent =
|
|
4037
|
+
var AnimatedImageContent = forwardRef4(({
|
|
4151
4038
|
src,
|
|
4152
4039
|
width,
|
|
4153
4040
|
height,
|
|
@@ -4155,26 +4042,24 @@ var AnimatedImageContent = forwardRef5(({
|
|
|
4155
4042
|
loopBehavior = "loop",
|
|
4156
4043
|
playbackRate = 1,
|
|
4157
4044
|
fit = "fill",
|
|
4045
|
+
effects,
|
|
4046
|
+
controls,
|
|
4158
4047
|
...props
|
|
4159
4048
|
}, canvasRef) => {
|
|
4160
|
-
const mountState = useRef8({ isMounted: true });
|
|
4161
|
-
useEffect6(() => {
|
|
4162
|
-
const { current } = mountState;
|
|
4163
|
-
current.isMounted = true;
|
|
4164
|
-
return () => {
|
|
4165
|
-
current.isMounted = false;
|
|
4166
|
-
};
|
|
4167
|
-
}, []);
|
|
4168
4049
|
const resolvedSrc = resolveAnimatedImageSource(src);
|
|
4169
|
-
const [imageDecoder, setImageDecoder] =
|
|
4050
|
+
const [imageDecoder, setImageDecoder] = useState6(null);
|
|
4170
4051
|
const { delayRender: delayRender2, continueRender: continueRender2 } = useDelayRender();
|
|
4171
|
-
const [decodeHandle] =
|
|
4052
|
+
const [decodeHandle] = useState6(() => delayRender2(`Rendering <AnimatedImage/> with src="${resolvedSrc}"`));
|
|
4172
4053
|
const frame = useCurrentFrame();
|
|
4173
4054
|
const { fps } = useVideoConfig();
|
|
4174
4055
|
const currentTime = frame / playbackRate / fps;
|
|
4175
|
-
const currentTimeRef =
|
|
4056
|
+
const currentTimeRef = useRef9(currentTime);
|
|
4176
4057
|
currentTimeRef.current = currentTime;
|
|
4177
|
-
const ref =
|
|
4058
|
+
const ref = useRef9(null);
|
|
4059
|
+
const memoizedEffects = useMemoizedEffects({
|
|
4060
|
+
effects,
|
|
4061
|
+
overrideId: controls?.overrideId ?? null
|
|
4062
|
+
});
|
|
4178
4063
|
useImperativeHandle2(canvasRef, () => {
|
|
4179
4064
|
const c = ref.current?.getCanvas();
|
|
4180
4065
|
if (!c) {
|
|
@@ -4182,8 +4067,8 @@ var AnimatedImageContent = forwardRef5(({
|
|
|
4182
4067
|
}
|
|
4183
4068
|
return c;
|
|
4184
4069
|
}, []);
|
|
4185
|
-
const [initialLoopBehavior] =
|
|
4186
|
-
|
|
4070
|
+
const [initialLoopBehavior] = useState6(() => loopBehavior);
|
|
4071
|
+
useEffect5(() => {
|
|
4187
4072
|
const controller = new AbortController;
|
|
4188
4073
|
decodeImage({
|
|
4189
4074
|
resolvedSrc,
|
|
@@ -4220,16 +4105,24 @@ var AnimatedImageContent = forwardRef5(({
|
|
|
4220
4105
|
return;
|
|
4221
4106
|
}
|
|
4222
4107
|
const delay = delayRender2(`Rendering frame at ${currentTime} of <AnimatedImage src="${src}"/>`);
|
|
4223
|
-
|
|
4224
|
-
|
|
4225
|
-
|
|
4226
|
-
|
|
4227
|
-
|
|
4228
|
-
|
|
4229
|
-
|
|
4108
|
+
let cancelled = false;
|
|
4109
|
+
imageDecoder.getFrame(currentTime, loopBehavior).then(async (videoFrame) => {
|
|
4110
|
+
if (cancelled) {
|
|
4111
|
+
return;
|
|
4112
|
+
}
|
|
4113
|
+
if (videoFrame === null) {
|
|
4114
|
+
ref.current?.clear();
|
|
4115
|
+
continueRender2(delay);
|
|
4116
|
+
return;
|
|
4117
|
+
}
|
|
4118
|
+
const completed = await ref.current?.draw(videoFrame.frame);
|
|
4119
|
+
if (completed && !cancelled) {
|
|
4120
|
+
continueRender2(delay);
|
|
4230
4121
|
}
|
|
4231
|
-
continueRender2(delay);
|
|
4232
4122
|
}).catch((err) => {
|
|
4123
|
+
if (cancelled) {
|
|
4124
|
+
return;
|
|
4125
|
+
}
|
|
4233
4126
|
if (onError) {
|
|
4234
4127
|
onError(err);
|
|
4235
4128
|
continueRender2(delay);
|
|
@@ -4237,6 +4130,10 @@ var AnimatedImageContent = forwardRef5(({
|
|
|
4237
4130
|
cancelRender(err);
|
|
4238
4131
|
}
|
|
4239
4132
|
});
|
|
4133
|
+
return () => {
|
|
4134
|
+
cancelled = true;
|
|
4135
|
+
continueRender2(delay);
|
|
4136
|
+
};
|
|
4240
4137
|
}, [
|
|
4241
4138
|
currentTime,
|
|
4242
4139
|
imageDecoder,
|
|
@@ -4244,13 +4141,18 @@ var AnimatedImageContent = forwardRef5(({
|
|
|
4244
4141
|
onError,
|
|
4245
4142
|
src,
|
|
4246
4143
|
continueRender2,
|
|
4247
|
-
delayRender2
|
|
4144
|
+
delayRender2,
|
|
4145
|
+
memoizedEffects,
|
|
4146
|
+
fit,
|
|
4147
|
+
width,
|
|
4148
|
+
height
|
|
4248
4149
|
]);
|
|
4249
|
-
return /* @__PURE__ */
|
|
4150
|
+
return /* @__PURE__ */ jsx13(Canvas, {
|
|
4250
4151
|
ref,
|
|
4251
4152
|
width,
|
|
4252
4153
|
height,
|
|
4253
4154
|
fit,
|
|
4155
|
+
effects: memoizedEffects,
|
|
4254
4156
|
...props
|
|
4255
4157
|
});
|
|
4256
4158
|
});
|
|
@@ -4267,12 +4169,14 @@ var AnimatedImageInner = ({
|
|
|
4267
4169
|
className,
|
|
4268
4170
|
style,
|
|
4269
4171
|
durationInFrames,
|
|
4172
|
+
_experimentalEffects: effects = [],
|
|
4270
4173
|
_experimentalControls: controls,
|
|
4271
4174
|
ref,
|
|
4272
4175
|
...sequenceProps
|
|
4273
4176
|
}) => {
|
|
4274
4177
|
const { durationInFrames: videoDuration } = useVideoConfig();
|
|
4275
4178
|
const resolvedDuration = durationInFrames ?? videoDuration;
|
|
4179
|
+
const memoizedEffectDefinitions = useMemoizedEffectDefinitions(effects);
|
|
4276
4180
|
const animatedImageProps = {
|
|
4277
4181
|
src,
|
|
4278
4182
|
width,
|
|
@@ -4285,21 +4189,179 @@ var AnimatedImageInner = ({
|
|
|
4285
4189
|
className,
|
|
4286
4190
|
style
|
|
4287
4191
|
};
|
|
4288
|
-
return /* @__PURE__ */
|
|
4192
|
+
return /* @__PURE__ */ jsx13(Sequence, {
|
|
4289
4193
|
layout: "none",
|
|
4290
4194
|
durationInFrames: resolvedDuration,
|
|
4291
4195
|
name: "<AnimatedImage>",
|
|
4292
4196
|
_experimentalControls: controls,
|
|
4197
|
+
_experimentalEffects: memoizedEffectDefinitions,
|
|
4293
4198
|
...sequenceProps,
|
|
4294
|
-
children: /* @__PURE__ */
|
|
4199
|
+
children: /* @__PURE__ */ jsx13(AnimatedImageContent, {
|
|
4295
4200
|
...animatedImageProps,
|
|
4296
|
-
ref
|
|
4201
|
+
ref,
|
|
4202
|
+
effects,
|
|
4203
|
+
controls
|
|
4297
4204
|
})
|
|
4298
4205
|
});
|
|
4299
4206
|
};
|
|
4300
4207
|
var AnimatedImage = wrapInSchema(AnimatedImageInner, animatedImageSchema);
|
|
4301
4208
|
AnimatedImage.displayName = "AnimatedImage";
|
|
4302
4209
|
addSequenceStackTraces(AnimatedImage);
|
|
4210
|
+
var solidSchema = {
|
|
4211
|
+
color: {
|
|
4212
|
+
type: "color",
|
|
4213
|
+
default: "transparent",
|
|
4214
|
+
description: "Color"
|
|
4215
|
+
},
|
|
4216
|
+
width: {
|
|
4217
|
+
type: "number",
|
|
4218
|
+
min: 1,
|
|
4219
|
+
step: 1,
|
|
4220
|
+
default: 1920,
|
|
4221
|
+
description: "Width"
|
|
4222
|
+
},
|
|
4223
|
+
height: {
|
|
4224
|
+
type: "number",
|
|
4225
|
+
min: 1,
|
|
4226
|
+
step: 1,
|
|
4227
|
+
default: 1080,
|
|
4228
|
+
description: "Height"
|
|
4229
|
+
},
|
|
4230
|
+
...sequenceVisualStyleSchema
|
|
4231
|
+
};
|
|
4232
|
+
var SolidInner = ({
|
|
4233
|
+
color,
|
|
4234
|
+
width,
|
|
4235
|
+
height,
|
|
4236
|
+
_experimentalEffects: experimentalEffects = [],
|
|
4237
|
+
className,
|
|
4238
|
+
style,
|
|
4239
|
+
overrideId,
|
|
4240
|
+
ref
|
|
4241
|
+
}) => {
|
|
4242
|
+
const { delayRender: delayRender2, continueRender: continueRender2, cancelRender: cancelRender2 } = useDelayRender();
|
|
4243
|
+
const [outputCanvas, setOutputCanvas] = useState7(null);
|
|
4244
|
+
const memoizedEffects = useMemoizedEffects({
|
|
4245
|
+
effects: experimentalEffects,
|
|
4246
|
+
overrideId: overrideId ?? null
|
|
4247
|
+
});
|
|
4248
|
+
const sourceCanvas = useMemo17(() => {
|
|
4249
|
+
if (typeof document === "undefined") {
|
|
4250
|
+
return null;
|
|
4251
|
+
}
|
|
4252
|
+
const canvas = document.createElement("canvas");
|
|
4253
|
+
canvas.width = 1;
|
|
4254
|
+
canvas.height = 1;
|
|
4255
|
+
return canvas;
|
|
4256
|
+
}, []);
|
|
4257
|
+
const chainState = useEffectChainState();
|
|
4258
|
+
const canvasRef = useCallback7((canvas) => {
|
|
4259
|
+
setOutputCanvas(canvas);
|
|
4260
|
+
if (typeof ref === "function") {
|
|
4261
|
+
ref(canvas);
|
|
4262
|
+
} else if (ref) {
|
|
4263
|
+
ref.current = canvas;
|
|
4264
|
+
}
|
|
4265
|
+
}, [ref]);
|
|
4266
|
+
useEffect6(() => {
|
|
4267
|
+
if (!outputCanvas || !sourceCanvas) {
|
|
4268
|
+
return;
|
|
4269
|
+
}
|
|
4270
|
+
const handle = delayRender2("Solid effect chain");
|
|
4271
|
+
if (!chainState) {
|
|
4272
|
+
continueRender2(handle);
|
|
4273
|
+
return () => {
|
|
4274
|
+
continueRender2(handle);
|
|
4275
|
+
};
|
|
4276
|
+
}
|
|
4277
|
+
const ctx = sourceCanvas.getContext("2d", { colorSpace: "srgb" });
|
|
4278
|
+
if (!ctx) {
|
|
4279
|
+
cancelRender2(new Error("Failed to acquire 2D context for <Solid> source"));
|
|
4280
|
+
return;
|
|
4281
|
+
}
|
|
4282
|
+
ctx.clearRect(0, 0, 1, 1);
|
|
4283
|
+
if (color !== undefined) {
|
|
4284
|
+
ctx.fillStyle = color;
|
|
4285
|
+
ctx.fillRect(0, 0, 1, 1);
|
|
4286
|
+
}
|
|
4287
|
+
runEffectChain({
|
|
4288
|
+
state: chainState.get(width, height),
|
|
4289
|
+
source: sourceCanvas,
|
|
4290
|
+
effects: memoizedEffects,
|
|
4291
|
+
output: outputCanvas,
|
|
4292
|
+
width,
|
|
4293
|
+
height
|
|
4294
|
+
}).then((completed) => {
|
|
4295
|
+
if (completed) {
|
|
4296
|
+
continueRender2(handle);
|
|
4297
|
+
}
|
|
4298
|
+
}).catch((err) => {
|
|
4299
|
+
cancelRender2(err);
|
|
4300
|
+
});
|
|
4301
|
+
return () => {
|
|
4302
|
+
continueRender2(handle);
|
|
4303
|
+
};
|
|
4304
|
+
}, [
|
|
4305
|
+
color,
|
|
4306
|
+
outputCanvas,
|
|
4307
|
+
sourceCanvas,
|
|
4308
|
+
chainState,
|
|
4309
|
+
width,
|
|
4310
|
+
height,
|
|
4311
|
+
delayRender2,
|
|
4312
|
+
continueRender2,
|
|
4313
|
+
cancelRender2,
|
|
4314
|
+
memoizedEffects
|
|
4315
|
+
]);
|
|
4316
|
+
return /* @__PURE__ */ jsx14("canvas", {
|
|
4317
|
+
ref: canvasRef,
|
|
4318
|
+
width,
|
|
4319
|
+
height,
|
|
4320
|
+
className,
|
|
4321
|
+
style
|
|
4322
|
+
});
|
|
4323
|
+
};
|
|
4324
|
+
var SolidOuter = forwardRef5(({
|
|
4325
|
+
_experimentalEffects = [],
|
|
4326
|
+
_experimentalControls: controls,
|
|
4327
|
+
color,
|
|
4328
|
+
height,
|
|
4329
|
+
width,
|
|
4330
|
+
className,
|
|
4331
|
+
durationInFrames,
|
|
4332
|
+
style,
|
|
4333
|
+
name,
|
|
4334
|
+
from,
|
|
4335
|
+
hidden,
|
|
4336
|
+
showInTimeline,
|
|
4337
|
+
...props
|
|
4338
|
+
}, ref) => {
|
|
4339
|
+
const memoizedEffectDefinitions = useMemoizedEffectDefinitions(_experimentalEffects);
|
|
4340
|
+
return /* @__PURE__ */ jsx14(Sequence, {
|
|
4341
|
+
layout: "none",
|
|
4342
|
+
from,
|
|
4343
|
+
hidden,
|
|
4344
|
+
showInTimeline,
|
|
4345
|
+
_experimentalControls: controls,
|
|
4346
|
+
_experimentalEffects: memoizedEffectDefinitions,
|
|
4347
|
+
durationInFrames,
|
|
4348
|
+
name: name ?? "<Solid>",
|
|
4349
|
+
...props,
|
|
4350
|
+
children: /* @__PURE__ */ jsx14(SolidInner, {
|
|
4351
|
+
ref,
|
|
4352
|
+
overrideId: controls?.overrideId ?? null,
|
|
4353
|
+
color,
|
|
4354
|
+
height,
|
|
4355
|
+
width,
|
|
4356
|
+
className,
|
|
4357
|
+
style,
|
|
4358
|
+
_experimentalEffects
|
|
4359
|
+
})
|
|
4360
|
+
});
|
|
4361
|
+
});
|
|
4362
|
+
var Solid = wrapInSchema(SolidOuter, solidSchema);
|
|
4363
|
+
Solid.displayName = "Solid";
|
|
4364
|
+
addSequenceStackTraces(Solid);
|
|
4303
4365
|
var cachedSupport = null;
|
|
4304
4366
|
var isHtmlInCanvasSupported = () => {
|
|
4305
4367
|
if (cachedSupport !== null) {
|
|
@@ -4310,7 +4372,7 @@ var isHtmlInCanvasSupported = () => {
|
|
|
4310
4372
|
}
|
|
4311
4373
|
const canvas = document.createElement("canvas");
|
|
4312
4374
|
const ctx = canvas.getContext("2d");
|
|
4313
|
-
cachedSupport = typeof ctx?.drawElementImage === "function" && typeof canvas.requestPaint === "function" && typeof canvas.captureElementImage === "function";
|
|
4375
|
+
cachedSupport = typeof ctx?.drawElementImage === "function" && typeof canvas.requestPaint === "function" && typeof canvas.captureElementImage === "function" && "transferControlToOffscreen" in HTMLCanvasElement.prototype;
|
|
4314
4376
|
return cachedSupport;
|
|
4315
4377
|
};
|
|
4316
4378
|
var HTML_IN_CANVAS_UNSUPPORTED_MESSAGE = "HTML in Canvas is not supported. Two common causes: Chrome is older than version 148 (update Chrome), or the HTML-in-Canvas flag is disabled at chrome://flags/#canvas-draw-element (enable it and restart Chrome).";
|
|
@@ -4346,8 +4408,10 @@ var HtmlInCanvasContent = forwardRef6(({ width, height, effects, children, onPai
|
|
|
4346
4408
|
if (!isHtmlInCanvasSupported()) {
|
|
4347
4409
|
cancelRender2(new Error(HTML_IN_CANVAS_UNSUPPORTED_MESSAGE));
|
|
4348
4410
|
}
|
|
4349
|
-
const canvas2dRef =
|
|
4350
|
-
const
|
|
4411
|
+
const canvas2dRef = useRef10(null);
|
|
4412
|
+
const offscreenRef = useRef10(null);
|
|
4413
|
+
const divRef = useRef10(null);
|
|
4414
|
+
const canvasSizeKey = `${width}x${height}`;
|
|
4351
4415
|
const setLayoutCanvasRef = useCallback8((node) => {
|
|
4352
4416
|
canvas2dRef.current = node;
|
|
4353
4417
|
if (typeof ref === "function") {
|
|
@@ -4356,45 +4420,48 @@ var HtmlInCanvasContent = forwardRef6(({ width, height, effects, children, onPai
|
|
|
4356
4420
|
ref.current = node;
|
|
4357
4421
|
}
|
|
4358
4422
|
}, [ref]);
|
|
4359
|
-
const [offscreenCanvas] = useState8(() => new OffscreenCanvas(1, 1));
|
|
4360
4423
|
const chainState = useEffectChainState();
|
|
4361
4424
|
const memoizedEffects = useMemoizedEffects({
|
|
4362
4425
|
effects,
|
|
4363
4426
|
overrideId: controls?.overrideId ?? null
|
|
4364
4427
|
});
|
|
4365
|
-
const effectsRef =
|
|
4428
|
+
const effectsRef = useRef10(memoizedEffects);
|
|
4366
4429
|
effectsRef.current = memoizedEffects;
|
|
4367
|
-
const onPaintRef =
|
|
4430
|
+
const onPaintRef = useRef10(onPaint);
|
|
4368
4431
|
onPaintRef.current = onPaint;
|
|
4369
|
-
const onInitRef =
|
|
4432
|
+
const onInitRef = useRef10(onInit);
|
|
4370
4433
|
onInitRef.current = onInit;
|
|
4371
|
-
const initializedRef =
|
|
4372
|
-
const onInitCleanupRef =
|
|
4373
|
-
const unmountedRef =
|
|
4434
|
+
const initializedRef = useRef10(false);
|
|
4435
|
+
const onInitCleanupRef = useRef10(null);
|
|
4436
|
+
const unmountedRef = useRef10(false);
|
|
4374
4437
|
const onPaintCb = useCallback8(async () => {
|
|
4375
4438
|
const element = divRef.current;
|
|
4376
4439
|
if (!element) {
|
|
4377
4440
|
throw new Error("Canvas or scene element not found");
|
|
4378
4441
|
}
|
|
4379
|
-
|
|
4380
|
-
|
|
4442
|
+
const offscreen = offscreenRef.current;
|
|
4443
|
+
if (!offscreen) {
|
|
4444
|
+
throw new Error("HtmlInCanvas: offscreen canvas not ready (transferControlToOffscreen failed or canvas is remounting)");
|
|
4445
|
+
}
|
|
4446
|
+
offscreen.width = width;
|
|
4447
|
+
offscreen.height = height;
|
|
4381
4448
|
try {
|
|
4382
|
-
const
|
|
4383
|
-
if (!
|
|
4449
|
+
const placeholderCanvas = canvas2dRef.current;
|
|
4450
|
+
if (!placeholderCanvas) {
|
|
4384
4451
|
throw new Error("Canvas not found");
|
|
4385
4452
|
}
|
|
4386
|
-
const
|
|
4387
|
-
if (!
|
|
4388
|
-
throw new Error("Failed to acquire 2D context for <HtmlInCanvas>
|
|
4453
|
+
const offscreen2d = offscreen.getContext("2d");
|
|
4454
|
+
if (!offscreen2d) {
|
|
4455
|
+
throw new Error("Failed to acquire 2D context for <HtmlInCanvas> offscreen canvas");
|
|
4389
4456
|
}
|
|
4390
4457
|
const handle = delayRender("onPaint");
|
|
4391
4458
|
if (!initializedRef.current) {
|
|
4392
4459
|
initializedRef.current = true;
|
|
4393
|
-
const initImage =
|
|
4460
|
+
const initImage = placeholderCanvas.captureElementImage(element);
|
|
4394
4461
|
const currentOnInit = onInitRef.current;
|
|
4395
4462
|
if (currentOnInit) {
|
|
4396
4463
|
const cleanup = await currentOnInit({
|
|
4397
|
-
canvas:
|
|
4464
|
+
canvas: offscreen,
|
|
4398
4465
|
element,
|
|
4399
4466
|
elementImage: initImage
|
|
4400
4467
|
});
|
|
@@ -4409,17 +4476,17 @@ var HtmlInCanvasContent = forwardRef6(({ width, height, effects, children, onPai
|
|
|
4409
4476
|
}
|
|
4410
4477
|
}
|
|
4411
4478
|
const handler = onPaintRef.current ?? defaultOnPaint;
|
|
4412
|
-
const elImage =
|
|
4479
|
+
const elImage = placeholderCanvas.captureElementImage(element);
|
|
4413
4480
|
await handler({
|
|
4414
|
-
canvas:
|
|
4481
|
+
canvas: offscreen,
|
|
4415
4482
|
element,
|
|
4416
4483
|
elementImage: elImage
|
|
4417
4484
|
});
|
|
4418
4485
|
await runEffectChain({
|
|
4419
4486
|
state: chainState.get(width, height),
|
|
4420
|
-
source:
|
|
4487
|
+
source: offscreen,
|
|
4421
4488
|
effects: effectsRef.current,
|
|
4422
|
-
output:
|
|
4489
|
+
output: offscreen,
|
|
4423
4490
|
width,
|
|
4424
4491
|
height
|
|
4425
4492
|
});
|
|
@@ -4427,29 +4494,30 @@ var HtmlInCanvasContent = forwardRef6(({ width, height, effects, children, onPai
|
|
|
4427
4494
|
} catch (error2) {
|
|
4428
4495
|
cancelRender2(error2);
|
|
4429
4496
|
}
|
|
4430
|
-
}, [
|
|
4431
|
-
chainState,
|
|
4432
|
-
continueRender2,
|
|
4433
|
-
cancelRender2,
|
|
4434
|
-
width,
|
|
4435
|
-
height,
|
|
4436
|
-
offscreenCanvas
|
|
4437
|
-
]);
|
|
4497
|
+
}, [chainState, continueRender2, cancelRender2, width, height]);
|
|
4438
4498
|
useLayoutEffect3(() => {
|
|
4439
|
-
const
|
|
4440
|
-
if (!
|
|
4499
|
+
const placeholder = canvas2dRef.current;
|
|
4500
|
+
if (!placeholder) {
|
|
4441
4501
|
throw new Error("Canvas not found");
|
|
4442
4502
|
}
|
|
4443
|
-
|
|
4444
|
-
|
|
4503
|
+
placeholder.layoutSubtree = true;
|
|
4504
|
+
const offscreen = placeholder.transferControlToOffscreen();
|
|
4505
|
+
offscreenRef.current = offscreen;
|
|
4506
|
+
offscreen.width = width;
|
|
4507
|
+
offscreen.height = height;
|
|
4508
|
+
initializedRef.current = false;
|
|
4509
|
+
unmountedRef.current = false;
|
|
4510
|
+
placeholder.addEventListener("paint", onPaintCb);
|
|
4445
4511
|
return () => {
|
|
4446
|
-
|
|
4512
|
+
placeholder.removeEventListener("paint", onPaintCb);
|
|
4513
|
+
offscreenRef.current = null;
|
|
4514
|
+
initializedRef.current = false;
|
|
4447
4515
|
unmountedRef.current = true;
|
|
4448
4516
|
onInitCleanupRef.current?.();
|
|
4449
4517
|
onInitCleanupRef.current = null;
|
|
4450
4518
|
};
|
|
4451
|
-
}, [onPaintCb, cancelRender2]);
|
|
4452
|
-
const onPaintChangedRef =
|
|
4519
|
+
}, [onPaintCb, cancelRender2, width, height]);
|
|
4520
|
+
const onPaintChangedRef = useRef10(false);
|
|
4453
4521
|
useLayoutEffect3(() => {
|
|
4454
4522
|
if (!onPaintChangedRef.current) {
|
|
4455
4523
|
onPaintChangedRef.current = true;
|
|
@@ -4473,8 +4541,8 @@ var HtmlInCanvasContent = forwardRef6(({ width, height, effects, children, onPai
|
|
|
4473
4541
|
return () => {
|
|
4474
4542
|
continueRender2(handle);
|
|
4475
4543
|
};
|
|
4476
|
-
}, [width, height, continueRender2]);
|
|
4477
|
-
const innerStyle =
|
|
4544
|
+
}, [width, height, continueRender2, canvasSizeKey]);
|
|
4545
|
+
const innerStyle = useMemo18(() => {
|
|
4478
4546
|
return {
|
|
4479
4547
|
width,
|
|
4480
4548
|
height
|
|
@@ -4495,7 +4563,7 @@ var HtmlInCanvasContent = forwardRef6(({ width, height, effects, children, onPai
|
|
|
4495
4563
|
style: innerStyle,
|
|
4496
4564
|
children
|
|
4497
4565
|
})
|
|
4498
|
-
})
|
|
4566
|
+
}, canvasSizeKey)
|
|
4499
4567
|
});
|
|
4500
4568
|
});
|
|
4501
4569
|
HtmlInCanvasContent.displayName = "HtmlInCanvasContent";
|
|
@@ -4537,7 +4605,7 @@ var HtmlInCanvasInner = forwardRef6(({
|
|
|
4537
4605
|
});
|
|
4538
4606
|
HtmlInCanvasInner.displayName = "HtmlInCanvas";
|
|
4539
4607
|
var htmlInCanvasSchema = {
|
|
4540
|
-
...
|
|
4608
|
+
...sequenceVisualStyleSchema,
|
|
4541
4609
|
hidden: hiddenField
|
|
4542
4610
|
};
|
|
4543
4611
|
var HtmlInCanvasWrapped = wrapInSchema(HtmlInCanvasInner, htmlInCanvasSchema);
|
|
@@ -4585,8 +4653,8 @@ var RenderAssetManager = createContext17({
|
|
|
4585
4653
|
renderAssets: []
|
|
4586
4654
|
});
|
|
4587
4655
|
var RenderAssetManagerProvider = ({ children, collectAssets }) => {
|
|
4588
|
-
const [renderAssets, setRenderAssets] =
|
|
4589
|
-
const renderAssetsRef =
|
|
4656
|
+
const [renderAssets, setRenderAssets] = useState8([]);
|
|
4657
|
+
const renderAssetsRef = useRef11([]);
|
|
4590
4658
|
const registerRenderAsset = useCallback9((renderAsset) => {
|
|
4591
4659
|
validateRenderAsset(renderAsset);
|
|
4592
4660
|
renderAssetsRef.current = [...renderAssetsRef.current, renderAsset];
|
|
@@ -4618,7 +4686,7 @@ var RenderAssetManagerProvider = ({ children, collectAssets }) => {
|
|
|
4618
4686
|
};
|
|
4619
4687
|
}
|
|
4620
4688
|
}, []);
|
|
4621
|
-
const contextValue =
|
|
4689
|
+
const contextValue = useMemo19(() => {
|
|
4622
4690
|
return {
|
|
4623
4691
|
registerRenderAsset,
|
|
4624
4692
|
unregisterRenderAsset,
|
|
@@ -4635,7 +4703,7 @@ var Artifact = ({ filename, content, downloadBehavior }) => {
|
|
|
4635
4703
|
const { registerRenderAsset, unregisterRenderAsset } = useContext19(RenderAssetManager);
|
|
4636
4704
|
const env = useRemotionEnvironment();
|
|
4637
4705
|
const frame = useCurrentFrame();
|
|
4638
|
-
const [id] =
|
|
4706
|
+
const [id] = useState9(() => {
|
|
4639
4707
|
return String(Math.random());
|
|
4640
4708
|
});
|
|
4641
4709
|
useLayoutEffect5(() => {
|
|
@@ -4747,14 +4815,14 @@ var Loop = ({
|
|
|
4747
4815
|
const iteration = Math.floor(currentFrame / durationInFrames);
|
|
4748
4816
|
const start = iteration * durationInFrames;
|
|
4749
4817
|
const from = Math.min(start, maxFrame);
|
|
4750
|
-
const loopDisplay =
|
|
4818
|
+
const loopDisplay = useMemo20(() => {
|
|
4751
4819
|
return {
|
|
4752
4820
|
numberOfTimes: Math.min(compDuration / durationInFrames, times),
|
|
4753
4821
|
startOffset: -from,
|
|
4754
4822
|
durationInFrames
|
|
4755
4823
|
};
|
|
4756
4824
|
}, [compDuration, durationInFrames, from, times]);
|
|
4757
|
-
const loopContext =
|
|
4825
|
+
const loopContext = useMemo20(() => {
|
|
4758
4826
|
return {
|
|
4759
4827
|
iteration: Math.floor(currentFrame / durationInFrames),
|
|
4760
4828
|
durationInFrames
|
|
@@ -4792,7 +4860,7 @@ var setPreloads = (updater) => {
|
|
|
4792
4860
|
updaters.forEach((u) => u());
|
|
4793
4861
|
};
|
|
4794
4862
|
var PrefetchProvider = ({ children }) => {
|
|
4795
|
-
const [_preloads, _setPreloads] =
|
|
4863
|
+
const [_preloads, _setPreloads] = useState10(() => preloads);
|
|
4796
4864
|
useEffect7(() => {
|
|
4797
4865
|
const updaterFunction = () => {
|
|
4798
4866
|
_setPreloads(preloads);
|
|
@@ -5116,7 +5184,7 @@ var DurationsContext = createContext20({
|
|
|
5116
5184
|
});
|
|
5117
5185
|
var DurationsContextProvider = ({ children }) => {
|
|
5118
5186
|
const [durations, setDurations] = useReducer(durationReducer, {});
|
|
5119
|
-
const value =
|
|
5187
|
+
const value = useMemo21(() => {
|
|
5120
5188
|
return {
|
|
5121
5189
|
durations,
|
|
5122
5190
|
setDurations
|
|
@@ -5250,7 +5318,7 @@ var useSingletonAudioContext = ({
|
|
|
5250
5318
|
audioEnabled
|
|
5251
5319
|
}) => {
|
|
5252
5320
|
const env = useRemotionEnvironment();
|
|
5253
|
-
const context =
|
|
5321
|
+
const context = useMemo22(() => {
|
|
5254
5322
|
if (env.isRendering) {
|
|
5255
5323
|
return null;
|
|
5256
5324
|
}
|
|
@@ -5331,11 +5399,11 @@ var SharedAudioContextProvider = ({ children, audioLatencyHint, audioEnabled })
|
|
|
5331
5399
|
latencyHint: audioLatencyHint,
|
|
5332
5400
|
audioEnabled
|
|
5333
5401
|
});
|
|
5334
|
-
const audioContextIsPlayingEventually =
|
|
5335
|
-
const isResuming =
|
|
5336
|
-
const audioSyncAnchor =
|
|
5337
|
-
const audioSyncAnchorListeners =
|
|
5338
|
-
const audioSyncAnchorEmitter =
|
|
5402
|
+
const audioContextIsPlayingEventually = useRef12(false);
|
|
5403
|
+
const isResuming = useRef12(null);
|
|
5404
|
+
const audioSyncAnchor = useMemo23(() => ({ value: 0 }), []);
|
|
5405
|
+
const audioSyncAnchorListeners = useRef12([]);
|
|
5406
|
+
const audioSyncAnchorEmitter = useMemo23(() => {
|
|
5339
5407
|
return {
|
|
5340
5408
|
dispatch: (event) => {
|
|
5341
5409
|
audioSyncAnchorListeners.current.forEach((l) => l(event));
|
|
@@ -5350,12 +5418,12 @@ var SharedAudioContextProvider = ({ children, audioLatencyHint, audioEnabled })
|
|
|
5350
5418
|
}
|
|
5351
5419
|
};
|
|
5352
5420
|
}, []);
|
|
5353
|
-
const prevEndTimes =
|
|
5354
|
-
const nodesToResume =
|
|
5421
|
+
const prevEndTimes = useRef12({ scheduledEndTime: null, mediaEndTime: null });
|
|
5422
|
+
const nodesToResume = useRef12(new Map);
|
|
5355
5423
|
const unscheduleAudioNode = useCallback10((node) => {
|
|
5356
5424
|
nodesToResume.current.delete(node);
|
|
5357
5425
|
}, []);
|
|
5358
|
-
const scheduleAudioNode =
|
|
5426
|
+
const scheduleAudioNode = useMemo23(() => {
|
|
5359
5427
|
return ({
|
|
5360
5428
|
node,
|
|
5361
5429
|
mediaTimestamp,
|
|
@@ -5440,7 +5508,7 @@ var SharedAudioContextProvider = ({ children, audioLatencyHint, audioEnabled })
|
|
|
5440
5508
|
audioContextIsPlayingEventually.current = false;
|
|
5441
5509
|
ctxAndGain.audioContext.suspend();
|
|
5442
5510
|
}, [ctxAndGain]);
|
|
5443
|
-
const audioContextValue =
|
|
5511
|
+
const audioContextValue = useMemo23(() => {
|
|
5444
5512
|
return {
|
|
5445
5513
|
audioContext: ctxAndGain?.audioContext ?? null,
|
|
5446
5514
|
gainNode: ctxAndGain?.gainNode ?? null,
|
|
@@ -5468,8 +5536,8 @@ var SharedAudioContextProvider = ({ children, audioLatencyHint, audioEnabled })
|
|
|
5468
5536
|
});
|
|
5469
5537
|
};
|
|
5470
5538
|
var SharedAudioTagsContextProvider = ({ children, numberOfAudioTags }) => {
|
|
5471
|
-
const audios =
|
|
5472
|
-
const [initialNumberOfAudioTags] =
|
|
5539
|
+
const audios = useRef12([]);
|
|
5540
|
+
const [initialNumberOfAudioTags] = useState11(numberOfAudioTags);
|
|
5473
5541
|
if (numberOfAudioTags !== initialNumberOfAudioTags) {
|
|
5474
5542
|
throw new Error("The number of shared audio tags has changed dynamically. Once you have set this property, you cannot change it afterwards.");
|
|
5475
5543
|
}
|
|
@@ -5479,7 +5547,7 @@ var SharedAudioTagsContextProvider = ({ children, numberOfAudioTags }) => {
|
|
|
5479
5547
|
const audioCtx = useContext21(SharedAudioContext);
|
|
5480
5548
|
const audioContext = audioCtx?.audioContext ?? null;
|
|
5481
5549
|
const resume = audioCtx?.resume;
|
|
5482
|
-
const refs =
|
|
5550
|
+
const refs = useMemo23(() => {
|
|
5483
5551
|
return new Array(numberOfAudioTags).fill(true).map(() => {
|
|
5484
5552
|
const ref = createRef2();
|
|
5485
5553
|
return {
|
|
@@ -5502,7 +5570,7 @@ var SharedAudioTagsContextProvider = ({ children, numberOfAudioTags }) => {
|
|
|
5502
5570
|
});
|
|
5503
5571
|
};
|
|
5504
5572
|
}, [refs]);
|
|
5505
|
-
const takenAudios =
|
|
5573
|
+
const takenAudios = useRef12(new Array(numberOfAudioTags).fill(false));
|
|
5506
5574
|
const rerenderAudios = useCallback10(() => {
|
|
5507
5575
|
refs.forEach(({ ref, id }) => {
|
|
5508
5576
|
const data = audios.current?.find((a) => a.id === id);
|
|
@@ -5616,7 +5684,7 @@ var SharedAudioTagsContextProvider = ({ children, numberOfAudioTags }) => {
|
|
|
5616
5684
|
});
|
|
5617
5685
|
resume?.();
|
|
5618
5686
|
}, [logLevel, mountTime, refs, env.isPlayer, resume]);
|
|
5619
|
-
const audioTagsValue =
|
|
5687
|
+
const audioTagsValue = useMemo23(() => {
|
|
5620
5688
|
return {
|
|
5621
5689
|
registerAudio,
|
|
5622
5690
|
unregisterAudio,
|
|
@@ -5653,7 +5721,7 @@ var useSharedAudio = ({
|
|
|
5653
5721
|
}) => {
|
|
5654
5722
|
const audioCtx = useContext21(SharedAudioContext);
|
|
5655
5723
|
const tagsCtx = useContext21(SharedAudioTagsContext);
|
|
5656
|
-
const [elem] =
|
|
5724
|
+
const [elem] = useState11(() => {
|
|
5657
5725
|
if (tagsCtx && tagsCtx.numberOfAudioTags > 0) {
|
|
5658
5726
|
return tagsCtx.registerAudio({ aud, audioId, premounting, postmounting });
|
|
5659
5727
|
}
|
|
@@ -5789,9 +5857,9 @@ var useAppendVideoFragment = ({
|
|
|
5789
5857
|
duration: initialDuration,
|
|
5790
5858
|
fps
|
|
5791
5859
|
}) => {
|
|
5792
|
-
const actualFromRef =
|
|
5793
|
-
const actualDuration =
|
|
5794
|
-
const actualSrc =
|
|
5860
|
+
const actualFromRef = useRef13(initialActualFrom);
|
|
5861
|
+
const actualDuration = useRef13(initialDuration);
|
|
5862
|
+
const actualSrc = useRef13(initialActualSrc);
|
|
5795
5863
|
if (!isSubsetOfDuration({
|
|
5796
5864
|
prevStartFrom: actualFromRef.current,
|
|
5797
5865
|
newStartFrom: initialActualFrom,
|
|
@@ -5828,8 +5896,8 @@ var useVolume = ({
|
|
|
5828
5896
|
source,
|
|
5829
5897
|
shouldUseWebAudioApi
|
|
5830
5898
|
}) => {
|
|
5831
|
-
const audioStuffRef =
|
|
5832
|
-
const currentVolumeRef =
|
|
5899
|
+
const audioStuffRef = useRef14(null);
|
|
5900
|
+
const currentVolumeRef = useRef14(volume);
|
|
5833
5901
|
currentVolumeRef.current = volume;
|
|
5834
5902
|
const sharedAudioContext = useContext22(SharedAudioContext);
|
|
5835
5903
|
if (!sharedAudioContext) {
|
|
@@ -5986,7 +6054,7 @@ var useBasicMediaInTimeline = ({
|
|
|
5986
6054
|
throw new Error("No src passed");
|
|
5987
6055
|
}
|
|
5988
6056
|
const parentSequence = useContext24(SequenceContext);
|
|
5989
|
-
const [initialVolume] =
|
|
6057
|
+
const [initialVolume] = useState12(() => volume);
|
|
5990
6058
|
const duration = getTimelineDuration({
|
|
5991
6059
|
compositionDurationInFrames: sequenceDurationInFrames,
|
|
5992
6060
|
playbackRate,
|
|
@@ -5995,7 +6063,7 @@ var useBasicMediaInTimeline = ({
|
|
|
5995
6063
|
parentSequenceDurationInFrames: parentSequence?.durationInFrames ?? null,
|
|
5996
6064
|
loop
|
|
5997
6065
|
});
|
|
5998
|
-
const volumes =
|
|
6066
|
+
const volumes = useMemo24(() => {
|
|
5999
6067
|
if (typeof volume === "number") {
|
|
6000
6068
|
return volume;
|
|
6001
6069
|
}
|
|
@@ -6016,7 +6084,7 @@ var useBasicMediaInTimeline = ({
|
|
|
6016
6084
|
const nonce = useNonce();
|
|
6017
6085
|
const { rootId } = useTimelineContext();
|
|
6018
6086
|
const startMediaFrom = 0 - mediaStartsAt + (trimBefore ?? 0);
|
|
6019
|
-
const memoizedResult =
|
|
6087
|
+
const memoizedResult = useMemo24(() => {
|
|
6020
6088
|
return {
|
|
6021
6089
|
volumes,
|
|
6022
6090
|
duration,
|
|
@@ -6045,7 +6113,7 @@ var useImageInTimeline = ({
|
|
|
6045
6113
|
src,
|
|
6046
6114
|
displayName,
|
|
6047
6115
|
id,
|
|
6048
|
-
|
|
6116
|
+
getStack,
|
|
6049
6117
|
showInTimeline,
|
|
6050
6118
|
premountDisplay,
|
|
6051
6119
|
postmountDisplay,
|
|
@@ -6092,7 +6160,7 @@ var useImageInTimeline = ({
|
|
|
6092
6160
|
showInTimeline: true,
|
|
6093
6161
|
nonce: nonce.get(),
|
|
6094
6162
|
loopDisplay,
|
|
6095
|
-
|
|
6163
|
+
getStack,
|
|
6096
6164
|
premountDisplay,
|
|
6097
6165
|
postmountDisplay,
|
|
6098
6166
|
controls,
|
|
@@ -6109,7 +6177,7 @@ var useImageInTimeline = ({
|
|
|
6109
6177
|
registerSequence,
|
|
6110
6178
|
unregisterSequence,
|
|
6111
6179
|
nonce,
|
|
6112
|
-
|
|
6180
|
+
getStack,
|
|
6113
6181
|
showInTimeline,
|
|
6114
6182
|
premountDisplay,
|
|
6115
6183
|
postmountDisplay,
|
|
@@ -6128,7 +6196,7 @@ var useMediaInTimeline = ({
|
|
|
6128
6196
|
playbackRate,
|
|
6129
6197
|
displayName,
|
|
6130
6198
|
id,
|
|
6131
|
-
|
|
6199
|
+
getStack,
|
|
6132
6200
|
showInTimeline,
|
|
6133
6201
|
premountDisplay,
|
|
6134
6202
|
postmountDisplay,
|
|
@@ -6179,7 +6247,7 @@ var useMediaInTimeline = ({
|
|
|
6179
6247
|
doesVolumeChange,
|
|
6180
6248
|
loopDisplay,
|
|
6181
6249
|
playbackRate,
|
|
6182
|
-
|
|
6250
|
+
getStack,
|
|
6183
6251
|
premountDisplay,
|
|
6184
6252
|
postmountDisplay,
|
|
6185
6253
|
controls: null,
|
|
@@ -6201,7 +6269,7 @@ var useMediaInTimeline = ({
|
|
|
6201
6269
|
mediaType,
|
|
6202
6270
|
startsAt,
|
|
6203
6271
|
playbackRate,
|
|
6204
|
-
|
|
6272
|
+
getStack,
|
|
6205
6273
|
showInTimeline,
|
|
6206
6274
|
premountDisplay,
|
|
6207
6275
|
postmountDisplay,
|
|
@@ -6212,12 +6280,12 @@ var useMediaInTimeline = ({
|
|
|
6212
6280
|
]);
|
|
6213
6281
|
};
|
|
6214
6282
|
var useBufferManager = (logLevel, mountTime) => {
|
|
6215
|
-
const [blocks, setBlocks] =
|
|
6216
|
-
const [onBufferingCallbacks, setOnBufferingCallbacks] =
|
|
6217
|
-
const [onResumeCallbacks, setOnResumeCallbacks] =
|
|
6283
|
+
const [blocks, setBlocks] = useState13([]);
|
|
6284
|
+
const [onBufferingCallbacks, setOnBufferingCallbacks] = useState13([]);
|
|
6285
|
+
const [onResumeCallbacks, setOnResumeCallbacks] = useState13([]);
|
|
6218
6286
|
const env = useRemotionEnvironment();
|
|
6219
6287
|
const rendering = env.isRendering;
|
|
6220
|
-
const buffering =
|
|
6288
|
+
const buffering = useRef15(false);
|
|
6221
6289
|
const addBlock = useCallback11((block) => {
|
|
6222
6290
|
if (rendering) {
|
|
6223
6291
|
return {
|
|
@@ -6290,7 +6358,7 @@ var useBufferManager = (logLevel, mountTime) => {
|
|
|
6290
6358
|
}
|
|
6291
6359
|
}, [blocks]);
|
|
6292
6360
|
}
|
|
6293
|
-
return
|
|
6361
|
+
return useMemo25(() => {
|
|
6294
6362
|
return { addBlock, listenForBuffering, listenForResume, buffering };
|
|
6295
6363
|
}, [addBlock, buffering, listenForBuffering, listenForResume]);
|
|
6296
6364
|
};
|
|
@@ -6304,7 +6372,7 @@ var BufferingProvider = ({ children }) => {
|
|
|
6304
6372
|
});
|
|
6305
6373
|
};
|
|
6306
6374
|
var useIsPlayerBuffering = (bufferManager) => {
|
|
6307
|
-
const [isBuffering, setIsBuffering] =
|
|
6375
|
+
const [isBuffering, setIsBuffering] = useState13(bufferManager.buffering.current);
|
|
6308
6376
|
useEffect9(() => {
|
|
6309
6377
|
const onBuffer = () => {
|
|
6310
6378
|
setIsBuffering(true);
|
|
@@ -6329,7 +6397,7 @@ var useBufferState = () => {
|
|
|
6329
6397
|
const buffer = useContext26(BufferingContextReact);
|
|
6330
6398
|
const logLevel = useLogLevel();
|
|
6331
6399
|
const addBlock = buffer ? buffer.addBlock : null;
|
|
6332
|
-
return
|
|
6400
|
+
return useMemo26(() => ({
|
|
6333
6401
|
delayPlayback: () => {
|
|
6334
6402
|
if (!addBlock) {
|
|
6335
6403
|
throw new Error("Tried to enable the buffering state, but a Remotion context was not found. This API can only be called in a component that was passed to the Remotion Player or a <Composition>. Or you might have experienced a version mismatch - run `npx remotion versions` and ensure all packages have the same version. This error is thrown by the buffer state https://remotion.dev/docs/player/buffer-state");
|
|
@@ -6364,7 +6432,7 @@ var useBufferUntilFirstFrame = ({
|
|
|
6364
6432
|
logLevel,
|
|
6365
6433
|
mountTime
|
|
6366
6434
|
}) => {
|
|
6367
|
-
const bufferingRef =
|
|
6435
|
+
const bufferingRef = useRef16(false);
|
|
6368
6436
|
const { delayPlayback } = useBufferState();
|
|
6369
6437
|
const bufferUntilFirstFrame = useCallback12((requestedTime) => {
|
|
6370
6438
|
if (mediaType !== "video") {
|
|
@@ -6437,7 +6505,7 @@ var useBufferUntilFirstFrame = ({
|
|
|
6437
6505
|
onVariableFpsVideoDetected,
|
|
6438
6506
|
pauseWhenBuffering
|
|
6439
6507
|
]);
|
|
6440
|
-
return
|
|
6508
|
+
return useMemo27(() => {
|
|
6441
6509
|
return {
|
|
6442
6510
|
isBuffering: () => bufferingRef.current,
|
|
6443
6511
|
bufferUntilFirstFrame
|
|
@@ -6485,7 +6553,7 @@ var useMediaBuffering = ({
|
|
|
6485
6553
|
src
|
|
6486
6554
|
}) => {
|
|
6487
6555
|
const buffer = useBufferState();
|
|
6488
|
-
const [isBuffering, setIsBuffering] =
|
|
6556
|
+
const [isBuffering, setIsBuffering] = useState14(false);
|
|
6489
6557
|
useEffect10(() => {
|
|
6490
6558
|
let cleanupFns = [];
|
|
6491
6559
|
const { current } = element;
|
|
@@ -6618,7 +6686,7 @@ var useRequestVideoCallbackTime = ({
|
|
|
6618
6686
|
lastSeek,
|
|
6619
6687
|
onVariableFpsVideoDetected
|
|
6620
6688
|
}) => {
|
|
6621
|
-
const currentTime =
|
|
6689
|
+
const currentTime = useRef17(null);
|
|
6622
6690
|
useEffect11(() => {
|
|
6623
6691
|
const { current } = mediaRef;
|
|
6624
6692
|
if (current) {
|
|
@@ -6875,14 +6943,14 @@ var useMediaPlayback = ({
|
|
|
6875
6943
|
const buffering = useContext27(BufferingContextReact);
|
|
6876
6944
|
const { fps } = useVideoConfig();
|
|
6877
6945
|
const mediaStartsAt = useMediaStartsAt();
|
|
6878
|
-
const lastSeekDueToShift =
|
|
6879
|
-
const lastSeek =
|
|
6946
|
+
const lastSeekDueToShift = useRef18(null);
|
|
6947
|
+
const lastSeek = useRef18(null);
|
|
6880
6948
|
const logLevel = useLogLevel();
|
|
6881
6949
|
const mountTime = useMountTime();
|
|
6882
6950
|
if (!buffering) {
|
|
6883
6951
|
throw new Error("useMediaPlayback must be used inside a <BufferingContext>");
|
|
6884
6952
|
}
|
|
6885
|
-
const isVariableFpsVideoMap =
|
|
6953
|
+
const isVariableFpsVideoMap = useRef18({});
|
|
6886
6954
|
const onVariableFpsVideoDetected = useCallback13(() => {
|
|
6887
6955
|
if (!src) {
|
|
6888
6956
|
return;
|
|
@@ -7165,14 +7233,14 @@ var SetMediaVolumeContext = createContext22({
|
|
|
7165
7233
|
var useMediaVolumeState = () => {
|
|
7166
7234
|
const { mediaVolume } = useContext28(MediaVolumeContext);
|
|
7167
7235
|
const { setMediaVolume } = useContext28(SetMediaVolumeContext);
|
|
7168
|
-
return
|
|
7236
|
+
return useMemo28(() => {
|
|
7169
7237
|
return [mediaVolume, setMediaVolume];
|
|
7170
7238
|
}, [mediaVolume, setMediaVolume]);
|
|
7171
7239
|
};
|
|
7172
7240
|
var useMediaMutedState = () => {
|
|
7173
7241
|
const { mediaMuted } = useContext28(MediaVolumeContext);
|
|
7174
7242
|
const { setMediaMuted } = useContext28(SetMediaVolumeContext);
|
|
7175
|
-
return
|
|
7243
|
+
return useMemo28(() => {
|
|
7176
7244
|
return [mediaMuted, setMediaMuted];
|
|
7177
7245
|
}, [mediaMuted, setMediaMuted]);
|
|
7178
7246
|
};
|
|
@@ -7182,7 +7250,7 @@ var warnAboutTooHighVolume = (volume) => {
|
|
|
7182
7250
|
}
|
|
7183
7251
|
};
|
|
7184
7252
|
var AudioForDevelopmentForwardRefFunction = (props, ref) => {
|
|
7185
|
-
const [initialShouldPreMountAudioElements] =
|
|
7253
|
+
const [initialShouldPreMountAudioElements] = useState15(props.shouldPreMountAudioTags);
|
|
7186
7254
|
if (props.shouldPreMountAudioTags !== initialShouldPreMountAudioElements) {
|
|
7187
7255
|
throw new Error("Cannot change the behavior for pre-mounting audio tags dynamically.");
|
|
7188
7256
|
}
|
|
@@ -7227,7 +7295,7 @@ var AudioForDevelopmentForwardRefFunction = (props, ref) => {
|
|
|
7227
7295
|
}
|
|
7228
7296
|
const preloadedSrc = usePreload(src);
|
|
7229
7297
|
const sequenceContext = useContext29(SequenceContext);
|
|
7230
|
-
const [timelineId] =
|
|
7298
|
+
const [timelineId] = useState15(() => String(Math.random()));
|
|
7231
7299
|
const userPreferredVolume = evaluateVolume({
|
|
7232
7300
|
frame: volumePropFrame,
|
|
7233
7301
|
volume,
|
|
@@ -7239,7 +7307,7 @@ var AudioForDevelopmentForwardRefFunction = (props, ref) => {
|
|
|
7239
7307
|
requestsVideoFrame: false,
|
|
7240
7308
|
isClientSideRendering: false
|
|
7241
7309
|
});
|
|
7242
|
-
const propsToPass =
|
|
7310
|
+
const propsToPass = useMemo29(() => {
|
|
7243
7311
|
return {
|
|
7244
7312
|
muted: muted || mediaMuted || userPreferredVolume <= 0,
|
|
7245
7313
|
src: preloadedSrc,
|
|
@@ -7256,7 +7324,7 @@ var AudioForDevelopmentForwardRefFunction = (props, ref) => {
|
|
|
7256
7324
|
userPreferredVolume,
|
|
7257
7325
|
crossOriginValue
|
|
7258
7326
|
]);
|
|
7259
|
-
const id =
|
|
7327
|
+
const id = useMemo29(() => `audio-${random(src ?? "")}-${sequenceContext?.relativeFrom}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.durationInFrames}-muted:${props.muted}-loop:${props.loop}`, [
|
|
7260
7328
|
src,
|
|
7261
7329
|
sequenceContext?.relativeFrom,
|
|
7262
7330
|
sequenceContext?.cumulatedFrom,
|
|
@@ -7274,6 +7342,9 @@ var AudioForDevelopmentForwardRefFunction = (props, ref) => {
|
|
|
7274
7342
|
premounting: Boolean(sequenceContext?.premounting),
|
|
7275
7343
|
postmounting: Boolean(sequenceContext?.postmounting)
|
|
7276
7344
|
});
|
|
7345
|
+
const getStack = useCallback14(() => {
|
|
7346
|
+
return _remotionInternalStack ?? null;
|
|
7347
|
+
}, [_remotionInternalStack]);
|
|
7277
7348
|
useMediaInTimeline({
|
|
7278
7349
|
volume,
|
|
7279
7350
|
mediaVolume,
|
|
@@ -7282,7 +7353,7 @@ var AudioForDevelopmentForwardRefFunction = (props, ref) => {
|
|
|
7282
7353
|
playbackRate: playbackRate ?? 1,
|
|
7283
7354
|
displayName: name ?? null,
|
|
7284
7355
|
id: timelineId,
|
|
7285
|
-
|
|
7356
|
+
getStack,
|
|
7286
7357
|
showInTimeline,
|
|
7287
7358
|
premountDisplay: sequenceContext?.premountDisplay ?? null,
|
|
7288
7359
|
postmountDisplay: sequenceContext?.postmountDisplay ?? null,
|
|
@@ -7327,7 +7398,7 @@ var AudioForDevelopmentForwardRefFunction = (props, ref) => {
|
|
|
7327
7398
|
useImperativeHandle4(ref, () => {
|
|
7328
7399
|
return audioRef.current;
|
|
7329
7400
|
}, [audioRef]);
|
|
7330
|
-
const currentOnDurationCallback =
|
|
7401
|
+
const currentOnDurationCallback = useRef19(onDuration);
|
|
7331
7402
|
currentOnDurationCallback.current = onDuration;
|
|
7332
7403
|
useEffect14(() => {
|
|
7333
7404
|
const { current } = audioRef;
|
|
@@ -7358,7 +7429,7 @@ var AudioForDevelopmentForwardRefFunction = (props, ref) => {
|
|
|
7358
7429
|
};
|
|
7359
7430
|
var AudioForPreview = forwardRef7(AudioForDevelopmentForwardRefFunction);
|
|
7360
7431
|
var AudioForRenderingRefForwardingFunction = (props, ref) => {
|
|
7361
|
-
const audioRef =
|
|
7432
|
+
const audioRef = useRef20(null);
|
|
7362
7433
|
const {
|
|
7363
7434
|
volume: volumeProp,
|
|
7364
7435
|
playbackRate,
|
|
@@ -7384,7 +7455,7 @@ var AudioForRenderingRefForwardingFunction = (props, ref) => {
|
|
|
7384
7455
|
const sequenceContext = useContext30(SequenceContext);
|
|
7385
7456
|
const { registerRenderAsset, unregisterRenderAsset } = useContext30(RenderAssetManager);
|
|
7386
7457
|
const { delayRender: delayRender2, continueRender: continueRender2 } = useDelayRender();
|
|
7387
|
-
const id =
|
|
7458
|
+
const id = useMemo30(() => `audio-${random(props.src ?? "")}-${sequenceContext?.relativeFrom}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.durationInFrames}`, [
|
|
7388
7459
|
props.src,
|
|
7389
7460
|
sequenceContext?.relativeFrom,
|
|
7390
7461
|
sequenceContext?.cumulatedFrom,
|
|
@@ -7515,7 +7586,7 @@ var AudioRefForwardingFunction = (props, ref) => {
|
|
|
7515
7586
|
throw new TypeError(`The \`<Html5Audio>\` tag requires a string for \`src\`, but got ${JSON.stringify(props.src)} instead.`);
|
|
7516
7587
|
}
|
|
7517
7588
|
const preloadedSrc = usePreload(props.src);
|
|
7518
|
-
const onError =
|
|
7589
|
+
const onError = useCallback15((e) => {
|
|
7519
7590
|
console.log(e.currentTarget.error);
|
|
7520
7591
|
const errMessage = `Could not play audio with src ${preloadedSrc}: ${e.currentTarget.error}. See https://remotion.dev/docs/media-playback-error for help.`;
|
|
7521
7592
|
if (loop) {
|
|
@@ -7529,7 +7600,7 @@ var AudioRefForwardingFunction = (props, ref) => {
|
|
|
7529
7600
|
console.warn(errMessage);
|
|
7530
7601
|
}
|
|
7531
7602
|
}, [loop, onRemotionError, preloadedSrc]);
|
|
7532
|
-
const onDuration =
|
|
7603
|
+
const onDuration = useCallback15((src, durationInSeconds) => {
|
|
7533
7604
|
setDurations({ type: "got-duration", durationInSeconds, src });
|
|
7534
7605
|
}, [setDurations]);
|
|
7535
7606
|
const durationFetched = durations[getAbsoluteSrc(preloadedSrc)] ?? durations[getAbsoluteSrc(props.src)];
|
|
@@ -7619,15 +7690,15 @@ var IFrameRefForwarding = ({
|
|
|
7619
7690
|
...props2
|
|
7620
7691
|
}, ref) => {
|
|
7621
7692
|
const { delayRender: delayRender2, continueRender: continueRender2 } = useDelayRender();
|
|
7622
|
-
const [handle] =
|
|
7693
|
+
const [handle] = useState16(() => delayRender2(`Loading <IFrame> with source ${props2.src}`, {
|
|
7623
7694
|
retries: delayRenderRetries ?? undefined,
|
|
7624
7695
|
timeoutInMilliseconds: delayRenderTimeoutInMilliseconds ?? undefined
|
|
7625
7696
|
}));
|
|
7626
|
-
const didLoad =
|
|
7697
|
+
const didLoad = useCallback16((e) => {
|
|
7627
7698
|
continueRender2(handle);
|
|
7628
7699
|
onLoad?.(e);
|
|
7629
7700
|
}, [handle, onLoad, continueRender2]);
|
|
7630
|
-
const didGetError =
|
|
7701
|
+
const didGetError = useCallback16((e) => {
|
|
7631
7702
|
continueRender2(handle);
|
|
7632
7703
|
if (onError) {
|
|
7633
7704
|
onError(e);
|
|
@@ -7665,8 +7736,8 @@ var ImgContent = ({
|
|
|
7665
7736
|
ref,
|
|
7666
7737
|
...props2
|
|
7667
7738
|
}) => {
|
|
7668
|
-
const imageRef =
|
|
7669
|
-
const errors =
|
|
7739
|
+
const imageRef = useRef21(null);
|
|
7740
|
+
const errors = useRef21({});
|
|
7670
7741
|
const { delayPlayback } = useBufferState();
|
|
7671
7742
|
const sequenceContext = useContext32(SequenceContext);
|
|
7672
7743
|
const _propsValid = true;
|
|
@@ -7677,7 +7748,7 @@ var ImgContent = ({
|
|
|
7677
7748
|
return imageRef.current;
|
|
7678
7749
|
}, []);
|
|
7679
7750
|
const actualSrc = usePreload(src);
|
|
7680
|
-
const retryIn =
|
|
7751
|
+
const retryIn = useCallback17((timeout) => {
|
|
7681
7752
|
if (!imageRef.current) {
|
|
7682
7753
|
return;
|
|
7683
7754
|
}
|
|
@@ -7695,7 +7766,7 @@ var ImgContent = ({
|
|
|
7695
7766
|
}, timeout);
|
|
7696
7767
|
}, []);
|
|
7697
7768
|
const { delayRender: delayRender2, continueRender: continueRender2, cancelRender: cancelRender2 } = useDelayRender();
|
|
7698
|
-
const didGetError =
|
|
7769
|
+
const didGetError = useCallback17((e) => {
|
|
7699
7770
|
if (!errors.current) {
|
|
7700
7771
|
return;
|
|
7701
7772
|
}
|
|
@@ -7807,15 +7878,18 @@ var ImgInner = ({
|
|
|
7807
7878
|
...props2
|
|
7808
7879
|
}) => {
|
|
7809
7880
|
const sequenceContext = useContext32(SequenceContext);
|
|
7810
|
-
const [timelineId] =
|
|
7881
|
+
const [timelineId] = useState17(() => String(Math.random()));
|
|
7811
7882
|
if (!src) {
|
|
7812
7883
|
throw new Error('No "src" prop was passed to <Img>.');
|
|
7813
7884
|
}
|
|
7885
|
+
const stackRef = useRef21(null);
|
|
7886
|
+
stackRef.current = stack ?? null;
|
|
7887
|
+
const getStack = useCallback17(() => stackRef.current, []);
|
|
7814
7888
|
useImageInTimeline({
|
|
7815
7889
|
src,
|
|
7816
7890
|
displayName: name ?? null,
|
|
7817
7891
|
id: timelineId,
|
|
7818
|
-
|
|
7892
|
+
getStack,
|
|
7819
7893
|
showInTimeline: showInTimeline ?? true,
|
|
7820
7894
|
premountDisplay: sequenceContext?.premountDisplay ?? null,
|
|
7821
7895
|
postmountDisplay: sequenceContext?.postmountDisplay ?? null,
|
|
@@ -7831,7 +7905,7 @@ var ImgInner = ({
|
|
|
7831
7905
|
});
|
|
7832
7906
|
};
|
|
7833
7907
|
var imgSchema = {
|
|
7834
|
-
...
|
|
7908
|
+
...sequenceVisualStyleSchema,
|
|
7835
7909
|
hidden: hiddenField
|
|
7836
7910
|
};
|
|
7837
7911
|
var Img = wrapInSchema(ImgInner, imgSchema);
|
|
@@ -7844,18 +7918,18 @@ var CompositionManagerProvider = ({
|
|
|
7844
7918
|
initialCompositions,
|
|
7845
7919
|
initialCanvasContent
|
|
7846
7920
|
}) => {
|
|
7847
|
-
const [folders, setFolders] =
|
|
7848
|
-
const [canvasContent, setCanvasContent] =
|
|
7849
|
-
const [compositions, setCompositions] =
|
|
7850
|
-
const currentcompositionsRef =
|
|
7851
|
-
const updateCompositions =
|
|
7921
|
+
const [folders, setFolders] = useState18([]);
|
|
7922
|
+
const [canvasContent, setCanvasContent] = useState18(initialCanvasContent);
|
|
7923
|
+
const [compositions, setCompositions] = useState18(initialCompositions);
|
|
7924
|
+
const currentcompositionsRef = useRef22(compositions);
|
|
7925
|
+
const updateCompositions = useCallback18((updateComps) => {
|
|
7852
7926
|
setCompositions((comps) => {
|
|
7853
7927
|
const updated = updateComps(comps);
|
|
7854
7928
|
currentcompositionsRef.current = updated;
|
|
7855
7929
|
return updated;
|
|
7856
7930
|
});
|
|
7857
7931
|
}, []);
|
|
7858
|
-
const registerComposition =
|
|
7932
|
+
const registerComposition = useCallback18((comp) => {
|
|
7859
7933
|
updateCompositions((comps) => {
|
|
7860
7934
|
if (comps.find((c2) => c2.id === comp.id)) {
|
|
7861
7935
|
throw new Error(`Multiple composition with id ${comp.id} are registered.`);
|
|
@@ -7863,12 +7937,12 @@ var CompositionManagerProvider = ({
|
|
|
7863
7937
|
return [...comps, comp];
|
|
7864
7938
|
});
|
|
7865
7939
|
}, [updateCompositions]);
|
|
7866
|
-
const unregisterComposition =
|
|
7940
|
+
const unregisterComposition = useCallback18((id) => {
|
|
7867
7941
|
setCompositions((comps) => {
|
|
7868
7942
|
return comps.filter((c2) => c2.id !== id);
|
|
7869
7943
|
});
|
|
7870
7944
|
}, []);
|
|
7871
|
-
const registerFolder =
|
|
7945
|
+
const registerFolder = useCallback18((name, parent, nonce) => {
|
|
7872
7946
|
setFolders((prevFolders) => {
|
|
7873
7947
|
return [
|
|
7874
7948
|
...prevFolders,
|
|
@@ -7880,7 +7954,7 @@ var CompositionManagerProvider = ({
|
|
|
7880
7954
|
];
|
|
7881
7955
|
});
|
|
7882
7956
|
}, []);
|
|
7883
|
-
const unregisterFolder =
|
|
7957
|
+
const unregisterFolder = useCallback18((name, parent) => {
|
|
7884
7958
|
setFolders((prevFolders) => {
|
|
7885
7959
|
return prevFolders.filter((p) => !(p.name === name && p.parent === parent));
|
|
7886
7960
|
});
|
|
@@ -7890,7 +7964,7 @@ var CompositionManagerProvider = ({
|
|
|
7890
7964
|
getCompositions: () => currentcompositionsRef.current
|
|
7891
7965
|
};
|
|
7892
7966
|
}, []);
|
|
7893
|
-
const compositionManagerSetters =
|
|
7967
|
+
const compositionManagerSetters = useMemo31(() => {
|
|
7894
7968
|
return {
|
|
7895
7969
|
registerComposition,
|
|
7896
7970
|
unregisterComposition,
|
|
@@ -7906,7 +7980,7 @@ var CompositionManagerProvider = ({
|
|
|
7906
7980
|
unregisterFolder,
|
|
7907
7981
|
onlyRenderComposition
|
|
7908
7982
|
]);
|
|
7909
|
-
const compositionManagerContextValue =
|
|
7983
|
+
const compositionManagerContextValue = useMemo31(() => {
|
|
7910
7984
|
return {
|
|
7911
7985
|
compositions,
|
|
7912
7986
|
folders,
|
|
@@ -7986,7 +8060,7 @@ var disabledEffectField = {
|
|
|
7986
8060
|
description: "Disabled"
|
|
7987
8061
|
};
|
|
7988
8062
|
var createEffect = (definition) => {
|
|
7989
|
-
const userCalculateKey = definition
|
|
8063
|
+
const { calculateKey: userCalculateKey, validateParams } = definition;
|
|
7990
8064
|
const widened = {
|
|
7991
8065
|
...definition,
|
|
7992
8066
|
calculateKey: (params) => {
|
|
@@ -7998,12 +8072,15 @@ var createEffect = (definition) => {
|
|
|
7998
8072
|
...definition.schema
|
|
7999
8073
|
}
|
|
8000
8074
|
};
|
|
8001
|
-
const factory = (params = {}) =>
|
|
8002
|
-
|
|
8003
|
-
|
|
8004
|
-
|
|
8005
|
-
|
|
8006
|
-
|
|
8075
|
+
const factory = (params = {}) => {
|
|
8076
|
+
validateParams(params);
|
|
8077
|
+
return {
|
|
8078
|
+
definition: widened,
|
|
8079
|
+
params,
|
|
8080
|
+
effectKey: widened.calculateKey(params),
|
|
8081
|
+
memoized: false
|
|
8082
|
+
};
|
|
8083
|
+
};
|
|
8007
8084
|
return factory;
|
|
8008
8085
|
};
|
|
8009
8086
|
var REMOTION_STUDIO_CONTAINER_ELEMENT = "__remotion-studio-container";
|
|
@@ -8054,7 +8131,7 @@ var MediaEnabledProvider = ({
|
|
|
8054
8131
|
videoEnabled,
|
|
8055
8132
|
audioEnabled
|
|
8056
8133
|
}) => {
|
|
8057
|
-
const value =
|
|
8134
|
+
const value = useMemo32(() => ({ videoEnabled, audioEnabled }), [videoEnabled, audioEnabled]);
|
|
8058
8135
|
return /* @__PURE__ */ jsx28(MediaEnabledContext.Provider, {
|
|
8059
8136
|
value,
|
|
8060
8137
|
children
|
|
@@ -8069,13 +8146,13 @@ var RemotionRootContexts = ({
|
|
|
8069
8146
|
audioEnabled,
|
|
8070
8147
|
frameState
|
|
8071
8148
|
}) => {
|
|
8072
|
-
const nonceContext =
|
|
8149
|
+
const nonceContext = useMemo33(() => {
|
|
8073
8150
|
let counter = 0;
|
|
8074
8151
|
return {
|
|
8075
8152
|
getNonce: () => counter++
|
|
8076
8153
|
};
|
|
8077
8154
|
}, []);
|
|
8078
|
-
const logging =
|
|
8155
|
+
const logging = useMemo33(() => {
|
|
8079
8156
|
return { logLevel, mountTime: Date.now() };
|
|
8080
8157
|
}, [logLevel]);
|
|
8081
8158
|
return /* @__PURE__ */ jsx29(LogLevelContext.Provider, {
|
|
@@ -8369,7 +8446,7 @@ var OffthreadVideoForRendering = ({
|
|
|
8369
8446
|
if (!src) {
|
|
8370
8447
|
throw new TypeError("No `src` was passed to <OffthreadVideo>.");
|
|
8371
8448
|
}
|
|
8372
|
-
const id =
|
|
8449
|
+
const id = useMemo34(() => `offthreadvideo-${random(src)}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.relativeFrom}-${sequenceContext?.durationInFrames}`, [
|
|
8373
8450
|
src,
|
|
8374
8451
|
sequenceContext?.cumulatedFrom,
|
|
8375
8452
|
sequenceContext?.relativeFrom,
|
|
@@ -8424,14 +8501,14 @@ var OffthreadVideoForRendering = ({
|
|
|
8424
8501
|
sequenceContext?.relativeFrom,
|
|
8425
8502
|
audioStreamIndex
|
|
8426
8503
|
]);
|
|
8427
|
-
const currentTime =
|
|
8504
|
+
const currentTime = useMemo34(() => {
|
|
8428
8505
|
return getExpectedMediaFrameUncorrected({
|
|
8429
8506
|
frame,
|
|
8430
8507
|
playbackRate: playbackRate || 1,
|
|
8431
8508
|
startFrom: -mediaStartsAt
|
|
8432
8509
|
}) / videoConfig.fps;
|
|
8433
8510
|
}, [frame, mediaStartsAt, playbackRate, videoConfig.fps]);
|
|
8434
|
-
const actualSrc =
|
|
8511
|
+
const actualSrc = useMemo34(() => {
|
|
8435
8512
|
return getOffthreadVideoSource({
|
|
8436
8513
|
src,
|
|
8437
8514
|
currentTime,
|
|
@@ -8439,7 +8516,7 @@ var OffthreadVideoForRendering = ({
|
|
|
8439
8516
|
toneMapped
|
|
8440
8517
|
});
|
|
8441
8518
|
}, [toneMapped, currentTime, src, transparent]);
|
|
8442
|
-
const [imageSrc, setImageSrc] =
|
|
8519
|
+
const [imageSrc, setImageSrc] = useState19(null);
|
|
8443
8520
|
const { delayRender: delayRender2, continueRender: continueRender2 } = useDelayRender();
|
|
8444
8521
|
useLayoutEffect11(() => {
|
|
8445
8522
|
if (!window.remotion_videoEnabled) {
|
|
@@ -8512,17 +8589,17 @@ var OffthreadVideoForRendering = ({
|
|
|
8512
8589
|
continueRender2,
|
|
8513
8590
|
delayRender2
|
|
8514
8591
|
]);
|
|
8515
|
-
const onErr =
|
|
8592
|
+
const onErr = useCallback19(() => {
|
|
8516
8593
|
if (onError) {
|
|
8517
8594
|
onError?.(new Error("Failed to load image with src " + imageSrc));
|
|
8518
8595
|
} else {
|
|
8519
8596
|
cancelRender("Failed to load image with src " + imageSrc);
|
|
8520
8597
|
}
|
|
8521
8598
|
}, [imageSrc, onError]);
|
|
8522
|
-
const className =
|
|
8599
|
+
const className = useMemo34(() => {
|
|
8523
8600
|
return [OBJECTFIT_CONTAIN_CLASS_NAME, props2.className].filter(truthy).join(" ");
|
|
8524
8601
|
}, [props2.className]);
|
|
8525
|
-
const onImageFrame =
|
|
8602
|
+
const onImageFrame = useCallback19((img) => {
|
|
8526
8603
|
if (onVideoFrame) {
|
|
8527
8604
|
onVideoFrame(img);
|
|
8528
8605
|
}
|
|
@@ -8581,8 +8658,8 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
|
|
|
8581
8658
|
if (!context) {
|
|
8582
8659
|
throw new Error("SharedAudioContext not found");
|
|
8583
8660
|
}
|
|
8584
|
-
const videoRef =
|
|
8585
|
-
const sharedSource =
|
|
8661
|
+
const videoRef = useRef23(null);
|
|
8662
|
+
const sharedSource = useMemo35(() => {
|
|
8586
8663
|
if (!context.audioContext) {
|
|
8587
8664
|
return null;
|
|
8588
8665
|
}
|
|
@@ -8637,7 +8714,7 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
|
|
|
8637
8714
|
const parentSequence = useContext35(SequenceContext);
|
|
8638
8715
|
const logLevel = useLogLevel();
|
|
8639
8716
|
const mountTime = useMountTime();
|
|
8640
|
-
const [timelineId] =
|
|
8717
|
+
const [timelineId] = useState20(() => String(Math.random()));
|
|
8641
8718
|
if (typeof acceptableTimeShift !== "undefined") {
|
|
8642
8719
|
throw new Error("acceptableTimeShift has been removed. Use acceptableTimeShiftInSeconds instead.");
|
|
8643
8720
|
}
|
|
@@ -8649,6 +8726,9 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
|
|
|
8649
8726
|
mediaVolume
|
|
8650
8727
|
});
|
|
8651
8728
|
warnAboutTooHighVolume(userPreferredVolume);
|
|
8729
|
+
const getStack = useCallback20(() => {
|
|
8730
|
+
return _remotionInternalStack ?? null;
|
|
8731
|
+
}, [_remotionInternalStack]);
|
|
8652
8732
|
useMediaInTimeline({
|
|
8653
8733
|
volume,
|
|
8654
8734
|
mediaVolume,
|
|
@@ -8657,7 +8737,7 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
|
|
|
8657
8737
|
playbackRate: props2.playbackRate ?? 1,
|
|
8658
8738
|
displayName: name ?? null,
|
|
8659
8739
|
id: timelineId,
|
|
8660
|
-
|
|
8740
|
+
getStack,
|
|
8661
8741
|
showInTimeline,
|
|
8662
8742
|
premountDisplay: parentSequence?.premountDisplay ?? null,
|
|
8663
8743
|
postmountDisplay: parentSequence?.postmountDisplay ?? null,
|
|
@@ -8703,7 +8783,7 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
|
|
|
8703
8783
|
useImperativeHandle8(ref, () => {
|
|
8704
8784
|
return videoRef.current;
|
|
8705
8785
|
}, []);
|
|
8706
|
-
|
|
8786
|
+
useState20(() => playbackLogging({
|
|
8707
8787
|
logLevel,
|
|
8708
8788
|
message: `Mounting video with source = ${actualSrc}, v=${VERSION}, user agent=${typeof navigator === "undefined" ? "server" : navigator.userAgent}`,
|
|
8709
8789
|
tag: "video",
|
|
@@ -8749,7 +8829,7 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
|
|
|
8749
8829
|
current.removeEventListener("error", errorHandler);
|
|
8750
8830
|
};
|
|
8751
8831
|
}, [onError, src]);
|
|
8752
|
-
const currentOnDurationCallback =
|
|
8832
|
+
const currentOnDurationCallback = useRef23(onDuration);
|
|
8753
8833
|
currentOnDurationCallback.current = onDuration;
|
|
8754
8834
|
useEmitVideoFrame({ ref: videoRef, onVideoFrame });
|
|
8755
8835
|
useEffect18(() => {
|
|
@@ -8780,7 +8860,7 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
|
|
|
8780
8860
|
current.preload = "auto";
|
|
8781
8861
|
}
|
|
8782
8862
|
}, []);
|
|
8783
|
-
const actualStyle =
|
|
8863
|
+
const actualStyle = useMemo35(() => {
|
|
8784
8864
|
return {
|
|
8785
8865
|
...style
|
|
8786
8866
|
};
|
|
@@ -8819,7 +8899,7 @@ var InnerOffthreadVideo = (props2) => {
|
|
|
8819
8899
|
if (environment.isClientSideRendering) {
|
|
8820
8900
|
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");
|
|
8821
8901
|
}
|
|
8822
|
-
const onDuration =
|
|
8902
|
+
const onDuration = useCallback21(() => {
|
|
8823
8903
|
return;
|
|
8824
8904
|
}, []);
|
|
8825
8905
|
if (typeof props2.src !== "string") {
|
|
@@ -8975,7 +9055,7 @@ function useRemotionContexts() {
|
|
|
8975
9055
|
const sequenceManagerContext = React36.useContext(SequenceManager);
|
|
8976
9056
|
const bufferManagerContext = React36.useContext(BufferingContextReact);
|
|
8977
9057
|
const logLevelContext = React36.useContext(LogLevelContext);
|
|
8978
|
-
return
|
|
9058
|
+
return useMemo36(() => ({
|
|
8979
9059
|
compositionManagerCtx,
|
|
8980
9060
|
timelineContext,
|
|
8981
9061
|
setTimelineContext,
|
|
@@ -9067,6 +9147,8 @@ var Internals = {
|
|
|
9067
9147
|
wrapInSchema,
|
|
9068
9148
|
sequenceSchema,
|
|
9069
9149
|
sequenceStyleSchema,
|
|
9150
|
+
sequenceVisualStyleSchema,
|
|
9151
|
+
sequencePremountSchema,
|
|
9070
9152
|
flattenActiveSchema,
|
|
9071
9153
|
getFlatSchemaWithAllKeys,
|
|
9072
9154
|
RemotionRootContexts,
|
|
@@ -9161,6 +9243,8 @@ var Internals = {
|
|
|
9161
9243
|
useMemoizedEffects,
|
|
9162
9244
|
useMemoizedEffectDefinitions,
|
|
9163
9245
|
createEffect,
|
|
9246
|
+
createWebGLContextError,
|
|
9247
|
+
createWebGL2ContextError,
|
|
9164
9248
|
computeEffectiveSchemaValuesDotNotation,
|
|
9165
9249
|
OverrideIdsToNodePathsGettersContext,
|
|
9166
9250
|
OverrideIdsToNodePathsSettersContext,
|
|
@@ -9233,7 +9317,7 @@ var SeriesSequenceRefForwardingFunction = ({ children }, _ref) => {
|
|
|
9233
9317
|
};
|
|
9234
9318
|
var SeriesSequence = forwardRef12(SeriesSequenceRefForwardingFunction);
|
|
9235
9319
|
var SeriesInner = (props2) => {
|
|
9236
|
-
const childrenValue =
|
|
9320
|
+
const childrenValue = useMemo37(() => {
|
|
9237
9321
|
let startFrame = 0;
|
|
9238
9322
|
const flattenedChildren = flattenChildren(props2.children);
|
|
9239
9323
|
return Children.map(flattenedChildren, (child, i) => {
|
|
@@ -9763,7 +9847,7 @@ var VideoForRenderingForwardFunction = ({
|
|
|
9763
9847
|
const frame = useCurrentFrame();
|
|
9764
9848
|
const volumePropsFrame = useFrameForVolumeProp(loopVolumeCurveBehavior ?? "repeat");
|
|
9765
9849
|
const videoConfig = useUnsafeVideoConfig();
|
|
9766
|
-
const videoRef =
|
|
9850
|
+
const videoRef = useRef24(null);
|
|
9767
9851
|
const sequenceContext = useContext36(SequenceContext);
|
|
9768
9852
|
const mediaStartsAt = useMediaStartsAt();
|
|
9769
9853
|
const environment = useRemotionEnvironment();
|
|
@@ -9771,7 +9855,7 @@ var VideoForRenderingForwardFunction = ({
|
|
|
9771
9855
|
const mountTime = useMountTime();
|
|
9772
9856
|
const { delayRender: delayRender2, continueRender: continueRender2 } = useDelayRender();
|
|
9773
9857
|
const { registerRenderAsset, unregisterRenderAsset } = useContext36(RenderAssetManager);
|
|
9774
|
-
const id =
|
|
9858
|
+
const id = useMemo38(() => `video-${random(props2.src ?? "")}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.relativeFrom}-${sequenceContext?.durationInFrames}`, [
|
|
9775
9859
|
props2.src,
|
|
9776
9860
|
sequenceContext?.cumulatedFrom,
|
|
9777
9861
|
sequenceContext?.relativeFrom,
|
|
@@ -9988,10 +10072,10 @@ var VideoForwardingFunction = (props2, ref) => {
|
|
|
9988
10072
|
throw new TypeError(`The \`<Html5Video>\` tag requires a string for \`src\`, but got ${JSON.stringify(props2.src)} instead.`);
|
|
9989
10073
|
}
|
|
9990
10074
|
const preloadedSrc = usePreload(props2.src);
|
|
9991
|
-
const onDuration =
|
|
10075
|
+
const onDuration = useCallback22((src, durationInSeconds) => {
|
|
9992
10076
|
setDurations({ type: "got-duration", durationInSeconds, src });
|
|
9993
10077
|
}, [setDurations]);
|
|
9994
|
-
const onVideoFrame =
|
|
10078
|
+
const onVideoFrame = useCallback22(() => {}, []);
|
|
9995
10079
|
const durationFetched = durations[getAbsoluteSrc(preloadedSrc)] ?? durations[getAbsoluteSrc(props2.src)];
|
|
9996
10080
|
validateMediaTrimProps({ startFrom, endAt, trimBefore, trimAfter });
|
|
9997
10081
|
const { trimBeforeValue, trimAfterValue } = resolveTrimProps({
|
|
@@ -10434,7 +10518,7 @@ var ExpertCard = ({ expert, Link }) => {
|
|
|
10434
10518
|
});
|
|
10435
10519
|
};
|
|
10436
10520
|
var ExpertsPageContent = ({ Link }) => {
|
|
10437
|
-
const expertsInRandomOrder =
|
|
10521
|
+
const expertsInRandomOrder = useMemo39(() => {
|
|
10438
10522
|
if (typeof window === "undefined") {
|
|
10439
10523
|
return [];
|
|
10440
10524
|
}
|