@zync/zync-screnplay-player 0.1.245 → 0.1.247
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/bundle.js +1 -1
- package/dist/screenplay/RemotionRenderer/components/LottieAnimationGlobal.js +21 -21
- package/dist/screenplay/RemotionRenderer/components/layouts/BrollGreenScreen.js +46 -44
- package/dist/screenplay/RemotionRenderer/components/layouts/CreatorCollabColdOpenVisual.js +3 -6
- package/dist/screenplay/RemotionRenderer/components/layouts/CreatorCollabConversationSpine.js +3 -6
- package/dist/screenplay/RemotionRenderer/components/layouts/CreatorCollabDocumentaryInset.js +3 -6
- package/dist/screenplay/RemotionRenderer/components/layouts/CreatorCollabRackFocus.js +3 -6
- package/dist/screenplay/RemotionRenderer/components/layouts/CreatorCollabSplit.js +2 -3
- package/dist/screenplay/RemotionRenderer/components/layouts/CreatorCollabStudioSet.js +3 -6
- package/dist/screenplay/RemotionRenderer/components/layouts/DynamicTriangle.js +2 -3
- package/dist/screenplay/RemotionRenderer/components/layouts/HookVideo.js +2 -3
- package/dist/screenplay/RemotionRenderer/components/layouts/IntroVideo.js +2 -3
- package/dist/screenplay/RemotionRenderer/components/layouts/KeyPointOverlayDepth.js +2 -3
- package/dist/screenplay/RemotionRenderer/components/layouts/Keyword.js +2 -3
- package/dist/screenplay/RemotionRenderer/components/layouts/KeywordStudioBackdrop.js +2 -3
- package/dist/screenplay/RemotionRenderer/components/layouts/MotionStill.js +2 -3
- package/dist/screenplay/RemotionRenderer/components/layouts/TextWithVideo.js +2 -3
- package/dist/screenplay/RemotionRenderer/components/utils/FaceCenteredVideo.js +66 -57
- package/dist/screenplay/RemotionRenderer/components/utils/PausableImg.js +4 -4
- package/dist/screenplay/RemotionRenderer/components/utils/README.md +80 -80
- package/dist/screenplay/RemotionRenderer/components/utils/StretchTextDemo.js +3 -3
- package/dist/screenplay/RemotionRenderer/development.js +1627 -924
- package/dist/screenplay/RemotionRenderer/fontRegistry.js +422 -0
- package/dist/screenplay/RemotionRenderer/helpers/convertToSeconds.js +8 -8
- package/dist/screenplay/RemotionRenderer/helpers/faceBasedVideoStyles.js +4 -4
- package/dist/screenplay/RemotionRenderer/helpers/faceCenteredVideoTransforms.js +46 -46
- package/dist/screenplay/RemotionRenderer/main/screenplaySchema.js +51 -51
- package/dist/screenplay/RemotionRenderer/registeredComponents.js +2 -2
- package/dist/screenplay/RemotionRenderer/theme/themes/bigbold/BigBoldNameTag.js +2 -3
- package/dist/screenplay/RemotionRenderer/theme/themes/bigbold/BigBoldSentence.js +2 -3
- package/dist/screenplay/RemotionRenderer/theme/themes/bigbold/BigBoldTitle.js +2 -3
- package/dist/screenplay/RemotionRenderer/theme/themes/boxwipe/Nametag.js +2 -6
- package/dist/screenplay/RemotionRenderer/theme/themes/centerline/Nametag.js +2 -6
- package/dist/screenplay/RemotionRenderer/theme/themes/default/CaptionColor.js +2 -3
- package/dist/screenplay/RemotionRenderer/theme/themes/default/CaptionColorInverse.js +2 -3
- package/dist/screenplay/RemotionRenderer/theme/themes/default/CaptionColorShadow.js +2 -3
- package/dist/screenplay/RemotionRenderer/theme/themes/default/CaptionElegant.js +3 -6
- package/dist/screenplay/RemotionRenderer/theme/themes/default/CaptionEmphasis.js +2 -3
- package/dist/screenplay/RemotionRenderer/theme/themes/default/CaptionPunctuated.js +2 -3
- package/dist/screenplay/RemotionRenderer/theme/themes/default/CaptionWordBoom.js +2 -3
- package/dist/screenplay/RemotionRenderer/theme/themes/default/CaptionWordBubble.js +2 -3
- package/dist/screenplay/RemotionRenderer/theme/themes/default/CaptionWordPopup.js +3 -6
- package/dist/screenplay/RemotionRenderer/theme/themes/default/DefaultCaption.js +2 -3
- package/dist/screenplay/RemotionRenderer/theme/themes/default/HandoffNametag.js +2 -3
- package/dist/screenplay/RemotionRenderer/theme/themes/default/Nametag.js +2 -3
- package/dist/screenplay/RemotionRenderer/theme/themes/default/Sentence.js +2 -3
- package/dist/screenplay/RemotionRenderer/theme/themes/default/Title.js +2 -3
- package/dist/screenplay/RemotionRenderer/theme/themes/fullcover/TextFullCover.js +2 -6
- package/dist/screenplay/RemotionRenderer/theme/themes/glassmorphism/Nametag.js +2 -3
- package/dist/screenplay/RemotionRenderer/theme/themes/glassmorphism/Sentence.js +2 -3
- package/dist/screenplay/RemotionRenderer/theme/themes/glassmorphism/Title.js +2 -3
- package/dist/screenplay/RemotionRenderer/theme/themes/glitch/GlitchNametag.js +2 -3
- package/dist/screenplay/RemotionRenderer/theme/themes/glitch/GlitchSentence.js +2 -3
- package/dist/screenplay/RemotionRenderer/theme/themes/glitch/GlitchTitle.js +2 -3
- package/dist/screenplay/RemotionRenderer/theme/themes/pushpull/PushPullNametag.js +2 -3
- package/dist/screenplay/RemotionRenderer/theme/themes/pushpull/PushPullSentence.js +2 -3
- package/dist/screenplay/RemotionRenderer/theme/themes/pushpull/PushPullTitle.js +2 -3
- package/dist/screenplay/RemotionRenderer/theme/themes/rightslide/Nametag.js +2 -6
- package/dist/screenplay/RemotionRenderer/theme/themes/sports/Nametag.js +2 -3
- package/dist/screenplay/RemotionRenderer/theme/themes/sports/SportsCaption.js +2 -3
- package/dist/screenplay/RemotionRenderer/theme/themes/sports/SportsSentence.js +2 -3
- package/dist/screenplay/RemotionRenderer/theme/themes/sports/Title.js +2 -3
- package/dist/screenplay/RemotionRenderer/theme/themes/sportsbounce/Nametag.js +2 -3
- package/dist/screenplay/RemotionRenderer/theme/themes/sportsbounce/SportsBounceSentence.js +2 -3
- package/dist/screenplay/RemotionRenderer/theme/themes/sportsbounce/Title.js +2 -3
- package/dist/screenplay/RemotionRenderer/theme/themes/stackfill/Nametag.js +2 -6
- package/dist/screenplay/RemotionRenderer/tracks/DynamicVideoComposition.js +2 -0
- package/dist/screenplay/RemotionRenderer/tracks/LayoutVideoTrack.js +20 -20
- package/package.json +49 -49
|
@@ -0,0 +1,422 @@
|
|
|
1
|
+
function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
|
|
2
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
|
+
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
|
|
4
|
+
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
|
|
5
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
6
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
7
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
8
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
9
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
10
|
+
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
11
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
12
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
13
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
14
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
15
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
16
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
17
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
18
|
+
import { getInfo as getCherryBombOneInfo, loadFont as loadCherryBombOneFont } from "@remotion/google-fonts/CherryBombOne";
|
|
19
|
+
import { getInfo as getKanitInfo, loadFont as loadKanitFont } from "@remotion/google-fonts/Kanit";
|
|
20
|
+
import { getInfo as getMontserratInfo, loadFont as loadMontserratFont } from "@remotion/google-fonts/Montserrat";
|
|
21
|
+
import { getInfo as getOswaldInfo, loadFont as loadOswaldFont } from "@remotion/google-fonts/Oswald";
|
|
22
|
+
import { getInfo as getPoppinsInfo, loadFont as loadPoppinsFont } from "@remotion/google-fonts/Poppins";
|
|
23
|
+
import { getInfo as getRobotoInfo, loadFont as loadRobotoFont } from "@remotion/google-fonts/Roboto";
|
|
24
|
+
import { getInfo as getRochesterInfo, loadFont as loadRochesterFont } from "@remotion/google-fonts/Rochester";
|
|
25
|
+
import { getInfo as getTitanOneInfo, loadFont as loadTitanOneFont } from "@remotion/google-fonts/TitanOne";
|
|
26
|
+
var LATIN_SUBSETS = ["latin", "latin-ext"];
|
|
27
|
+
var LATIN_ONLY_SUBSETS = ["latin"];
|
|
28
|
+
var GENERIC_SUBSETS = new Set(["math", "symbols"]);
|
|
29
|
+
export var FONT_FAMILIES = Object.freeze({
|
|
30
|
+
CHERRY_BOMB_ONE: "Cherry Bomb One",
|
|
31
|
+
KANIT: "Kanit",
|
|
32
|
+
MONTSERRAT: "Montserrat",
|
|
33
|
+
OSWALD: "Oswald",
|
|
34
|
+
POPPINS: "Poppins",
|
|
35
|
+
ROBOTO: "Roboto",
|
|
36
|
+
ROCHESTER: "Rochester",
|
|
37
|
+
TITAN_ONE: "Titan One"
|
|
38
|
+
});
|
|
39
|
+
var FONT_METADATA = Object.freeze(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, FONT_FAMILIES.CHERRY_BOMB_ONE, getCherryBombOneInfo()), FONT_FAMILIES.KANIT, getKanitInfo()), FONT_FAMILIES.MONTSERRAT, getMontserratInfo()), FONT_FAMILIES.OSWALD, getOswaldInfo()), FONT_FAMILIES.POPPINS, getPoppinsInfo()), FONT_FAMILIES.ROBOTO, getRobotoInfo()), FONT_FAMILIES.ROCHESTER, getRochesterInfo()), FONT_FAMILIES.TITAN_ONE, getTitanOneInfo()));
|
|
40
|
+
var createProfile = function createProfile(style, weights) {
|
|
41
|
+
var subsets = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : LATIN_SUBSETS;
|
|
42
|
+
return Object.freeze({
|
|
43
|
+
style: style,
|
|
44
|
+
weights: Object.freeze(weights),
|
|
45
|
+
subsets: Object.freeze(subsets)
|
|
46
|
+
});
|
|
47
|
+
};
|
|
48
|
+
export var FONT_PROFILES = Object.freeze(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, FONT_FAMILIES.POPPINS, Object.freeze([createProfile("normal", ["300", "400", "500", "600", "700", "800", "900"]), createProfile("italic", ["800"])])), FONT_FAMILIES.KANIT, Object.freeze([createProfile("normal", ["400", "500", "600", "700", "800", "900"]), createProfile("italic", ["600", "800", "900"])])), FONT_FAMILIES.MONTSERRAT, Object.freeze([createProfile("normal", ["400", "500", "600", "700", "800", "900"])])), FONT_FAMILIES.ROBOTO, Object.freeze([createProfile("normal", ["300", "400", "700", "900"])])), FONT_FAMILIES.OSWALD, Object.freeze([createProfile("normal", ["400", "500", "600", "700"])])), FONT_FAMILIES.ROCHESTER, Object.freeze([createProfile("normal", ["400"], LATIN_ONLY_SUBSETS)])), FONT_FAMILIES.TITAN_ONE, Object.freeze([createProfile("normal", ["400"])])), FONT_FAMILIES.CHERRY_BOMB_ONE, Object.freeze([createProfile("normal", ["400"])])));
|
|
49
|
+
var FONT_LOADERS = Object.freeze(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, FONT_FAMILIES.CHERRY_BOMB_ONE, loadCherryBombOneFont), FONT_FAMILIES.KANIT, loadKanitFont), FONT_FAMILIES.MONTSERRAT, loadMontserratFont), FONT_FAMILIES.OSWALD, loadOswaldFont), FONT_FAMILIES.POPPINS, loadPoppinsFont), FONT_FAMILIES.ROBOTO, loadRobotoFont), FONT_FAMILIES.ROCHESTER, loadRochesterFont), FONT_FAMILIES.TITAN_ONE, loadTitanOneFont));
|
|
50
|
+
var DEFAULT_COMPONENT_DEPENDENCIES = Object.freeze({
|
|
51
|
+
Caption: [FONT_FAMILIES.POPPINS],
|
|
52
|
+
CaptionSimple: [FONT_FAMILIES.POPPINS],
|
|
53
|
+
HandoffNametag: [FONT_FAMILIES.ROBOTO],
|
|
54
|
+
Nametag: [FONT_FAMILIES.POPPINS],
|
|
55
|
+
Sentence: [FONT_FAMILIES.KANIT],
|
|
56
|
+
Title: [FONT_FAMILIES.POPPINS]
|
|
57
|
+
});
|
|
58
|
+
var THEME_COMPONENT_DEPENDENCIES = Object.freeze({
|
|
59
|
+
"default": DEFAULT_COMPONENT_DEPENDENCIES,
|
|
60
|
+
glitch: _objectSpread(_objectSpread({}, DEFAULT_COMPONENT_DEPENDENCIES), {}, {
|
|
61
|
+
Nametag: [FONT_FAMILIES.KANIT],
|
|
62
|
+
Sentence: [FONT_FAMILIES.KANIT],
|
|
63
|
+
Title: [FONT_FAMILIES.KANIT]
|
|
64
|
+
}),
|
|
65
|
+
glassmorphism: _objectSpread(_objectSpread({}, DEFAULT_COMPONENT_DEPENDENCIES), {}, {
|
|
66
|
+
Nametag: [FONT_FAMILIES.POPPINS],
|
|
67
|
+
Sentence: [FONT_FAMILIES.POPPINS],
|
|
68
|
+
Title: [FONT_FAMILIES.POPPINS]
|
|
69
|
+
}),
|
|
70
|
+
sports: _objectSpread(_objectSpread({}, DEFAULT_COMPONENT_DEPENDENCIES), {}, {
|
|
71
|
+
Nametag: [FONT_FAMILIES.KANIT],
|
|
72
|
+
Sentence: [FONT_FAMILIES.KANIT],
|
|
73
|
+
Title: [FONT_FAMILIES.KANIT]
|
|
74
|
+
}),
|
|
75
|
+
sportsbounce: _objectSpread(_objectSpread({}, DEFAULT_COMPONENT_DEPENDENCIES), {}, {
|
|
76
|
+
Nametag: [FONT_FAMILIES.MONTSERRAT],
|
|
77
|
+
Sentence: [FONT_FAMILIES.MONTSERRAT],
|
|
78
|
+
Title: [FONT_FAMILIES.KANIT]
|
|
79
|
+
}),
|
|
80
|
+
bigbold: _objectSpread(_objectSpread({}, DEFAULT_COMPONENT_DEPENDENCIES), {}, {
|
|
81
|
+
Nametag: [FONT_FAMILIES.MONTSERRAT],
|
|
82
|
+
Sentence: [FONT_FAMILIES.MONTSERRAT],
|
|
83
|
+
Title: [FONT_FAMILIES.MONTSERRAT]
|
|
84
|
+
}),
|
|
85
|
+
pushpull: _objectSpread(_objectSpread({}, DEFAULT_COMPONENT_DEPENDENCIES), {}, {
|
|
86
|
+
Nametag: [FONT_FAMILIES.KANIT],
|
|
87
|
+
Sentence: [FONT_FAMILIES.KANIT],
|
|
88
|
+
Title: [FONT_FAMILIES.KANIT]
|
|
89
|
+
}),
|
|
90
|
+
none: _objectSpread(_objectSpread({}, DEFAULT_COMPONENT_DEPENDENCIES), {}, {
|
|
91
|
+
Nametag: [],
|
|
92
|
+
Title: []
|
|
93
|
+
}),
|
|
94
|
+
collabintro: _objectSpread(_objectSpread({}, DEFAULT_COMPONENT_DEPENDENCIES), {}, {
|
|
95
|
+
Nametag: [FONT_FAMILIES.OSWALD, FONT_FAMILIES.POPPINS],
|
|
96
|
+
Title: [FONT_FAMILIES.OSWALD, FONT_FAMILIES.POPPINS]
|
|
97
|
+
}),
|
|
98
|
+
centerline: _objectSpread(_objectSpread({}, DEFAULT_COMPONENT_DEPENDENCIES), {}, {
|
|
99
|
+
Nametag: [FONT_FAMILIES.KANIT]
|
|
100
|
+
}),
|
|
101
|
+
boxwipe: _objectSpread(_objectSpread({}, DEFAULT_COMPONENT_DEPENDENCIES), {}, {
|
|
102
|
+
Nametag: [FONT_FAMILIES.KANIT]
|
|
103
|
+
}),
|
|
104
|
+
stackfill: _objectSpread(_objectSpread({}, DEFAULT_COMPONENT_DEPENDENCIES), {}, {
|
|
105
|
+
Nametag: [FONT_FAMILIES.KANIT]
|
|
106
|
+
}),
|
|
107
|
+
rightslide: _objectSpread(_objectSpread({}, DEFAULT_COMPONENT_DEPENDENCIES), {}, {
|
|
108
|
+
Nametag: [FONT_FAMILIES.KANIT]
|
|
109
|
+
}),
|
|
110
|
+
depth: _objectSpread(_objectSpread({}, DEFAULT_COMPONENT_DEPENDENCIES), {}, {
|
|
111
|
+
Sentence: [FONT_FAMILIES.POPPINS]
|
|
112
|
+
}),
|
|
113
|
+
fullcover: _objectSpread(_objectSpread({}, DEFAULT_COMPONENT_DEPENDENCIES), {}, {
|
|
114
|
+
Sentence: [FONT_FAMILIES.POPPINS]
|
|
115
|
+
})
|
|
116
|
+
});
|
|
117
|
+
var DIRECT_COMPONENT_DEPENDENCIES = Object.freeze({
|
|
118
|
+
CaptionColor: [FONT_FAMILIES.POPPINS],
|
|
119
|
+
CaptionColorInverse: [FONT_FAMILIES.POPPINS],
|
|
120
|
+
CaptionColorShadow: [FONT_FAMILIES.MONTSERRAT],
|
|
121
|
+
CaptionElegant: [FONT_FAMILIES.MONTSERRAT, FONT_FAMILIES.ROCHESTER],
|
|
122
|
+
CaptionEmphasis: [FONT_FAMILIES.MONTSERRAT],
|
|
123
|
+
CaptionPunctuated: [FONT_FAMILIES.POPPINS],
|
|
124
|
+
CaptionWordBoom: [FONT_FAMILIES.TITAN_ONE],
|
|
125
|
+
CaptionWordBubble: [FONT_FAMILIES.MONTSERRAT],
|
|
126
|
+
CaptionWordPopup: [FONT_FAMILIES.MONTSERRAT, FONT_FAMILIES.CHERRY_BOMB_ONE],
|
|
127
|
+
DefaultCaption: [FONT_FAMILIES.POPPINS],
|
|
128
|
+
GlitchNametag: [FONT_FAMILIES.KANIT],
|
|
129
|
+
GlitchSentence: [FONT_FAMILIES.KANIT],
|
|
130
|
+
GlitchTitle: [FONT_FAMILIES.KANIT],
|
|
131
|
+
PhraseRainbowEffect: [FONT_FAMILIES.ROBOTO],
|
|
132
|
+
SportsCaption: [FONT_FAMILIES.KANIT]
|
|
133
|
+
});
|
|
134
|
+
var COMPONENT_ALIASES = Object.freeze({
|
|
135
|
+
CaptionSimple: "Caption",
|
|
136
|
+
NametagFold: "Nametag",
|
|
137
|
+
SentenceSimple: "Sentence",
|
|
138
|
+
SimpleFrameSentence: "Sentence"
|
|
139
|
+
});
|
|
140
|
+
var LAYOUT_COMPONENT_DEPENDENCIES = Object.freeze({
|
|
141
|
+
CreatorCollabColdOpen: [FONT_FAMILIES.OSWALD, FONT_FAMILIES.POPPINS],
|
|
142
|
+
CreatorCollabConversationSpine: [FONT_FAMILIES.OSWALD, FONT_FAMILIES.POPPINS],
|
|
143
|
+
CreatorCollabDocumentaryInset: [FONT_FAMILIES.OSWALD, FONT_FAMILIES.POPPINS],
|
|
144
|
+
CreatorCollabRackFocus: [FONT_FAMILIES.OSWALD, FONT_FAMILIES.POPPINS],
|
|
145
|
+
CreatorCollabSplit: [FONT_FAMILIES.POPPINS],
|
|
146
|
+
CreatorCollabStudioSet: [FONT_FAMILIES.OSWALD, FONT_FAMILIES.POPPINS],
|
|
147
|
+
DynamicTriangle: [FONT_FAMILIES.KANIT],
|
|
148
|
+
HookVideo: [FONT_FAMILIES.OSWALD],
|
|
149
|
+
IntroVideo: [FONT_FAMILIES.OSWALD],
|
|
150
|
+
KeyPointOverlayDepth: [FONT_FAMILIES.POPPINS],
|
|
151
|
+
Keyword: [FONT_FAMILIES.POPPINS],
|
|
152
|
+
KeywordStudioBackdrop: [FONT_FAMILIES.POPPINS],
|
|
153
|
+
MotionStill: [FONT_FAMILIES.POPPINS],
|
|
154
|
+
TextWithVideo: [FONT_FAMILIES.POPPINS],
|
|
155
|
+
TextFullCover: [FONT_FAMILIES.POPPINS]
|
|
156
|
+
});
|
|
157
|
+
var getComponentDependencies = function getComponentDependencies(component, theme) {
|
|
158
|
+
if (!component) {
|
|
159
|
+
return [];
|
|
160
|
+
}
|
|
161
|
+
var normalizedComponent = COMPONENT_ALIASES[component] || component;
|
|
162
|
+
if (DIRECT_COMPONENT_DEPENDENCIES[normalizedComponent]) {
|
|
163
|
+
return DIRECT_COMPONENT_DEPENDENCIES[normalizedComponent];
|
|
164
|
+
}
|
|
165
|
+
if (LAYOUT_COMPONENT_DEPENDENCIES[normalizedComponent]) {
|
|
166
|
+
return LAYOUT_COMPONENT_DEPENDENCIES[normalizedComponent];
|
|
167
|
+
}
|
|
168
|
+
var themeDependencies = THEME_COMPONENT_DEPENDENCIES[theme] || THEME_COMPONENT_DEPENDENCIES["default"];
|
|
169
|
+
return themeDependencies[normalizedComponent] || DEFAULT_COMPONENT_DEPENDENCIES[normalizedComponent] || [];
|
|
170
|
+
};
|
|
171
|
+
var addEntryDependencies = function addEntryDependencies(families, entry, theme) {
|
|
172
|
+
if (!entry) {
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
175
|
+
var entryTheme = entry.theme || theme;
|
|
176
|
+
var _iterator = _createForOfIteratorHelper(getComponentDependencies(entry.component, entryTheme)),
|
|
177
|
+
_step;
|
|
178
|
+
try {
|
|
179
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
180
|
+
var family = _step.value;
|
|
181
|
+
families.add(family);
|
|
182
|
+
}
|
|
183
|
+
} catch (err) {
|
|
184
|
+
_iterator.e(err);
|
|
185
|
+
} finally {
|
|
186
|
+
_iterator.f();
|
|
187
|
+
}
|
|
188
|
+
};
|
|
189
|
+
var parseUnicodeRange = function parseUnicodeRange(unicodeRange) {
|
|
190
|
+
return unicodeRange.split(",").map(function (range) {
|
|
191
|
+
var _range$trim$replace$s = range.trim().replace(/^U\+/i, "").split("-"),
|
|
192
|
+
_range$trim$replace$s2 = _slicedToArray(_range$trim$replace$s, 2),
|
|
193
|
+
start = _range$trim$replace$s2[0],
|
|
194
|
+
end = _range$trim$replace$s2[1];
|
|
195
|
+
return [Number.parseInt(start, 16), Number.parseInt(end || start, 16)];
|
|
196
|
+
});
|
|
197
|
+
};
|
|
198
|
+
var getTimelineText = function getTimelineText(timeline) {
|
|
199
|
+
var text = [];
|
|
200
|
+
var visited = new WeakSet();
|
|
201
|
+
var _visit = function visit(value) {
|
|
202
|
+
if (typeof value === "string") {
|
|
203
|
+
text.push(value);
|
|
204
|
+
return;
|
|
205
|
+
}
|
|
206
|
+
if (!value || _typeof(value) !== "object" || visited.has(value)) {
|
|
207
|
+
return;
|
|
208
|
+
}
|
|
209
|
+
visited.add(value);
|
|
210
|
+
for (var _i = 0, _Object$values = Object.values(value); _i < _Object$values.length; _i++) {
|
|
211
|
+
var child = _Object$values[_i];
|
|
212
|
+
_visit(child);
|
|
213
|
+
}
|
|
214
|
+
};
|
|
215
|
+
_visit(timeline);
|
|
216
|
+
return text.join("\n");
|
|
217
|
+
};
|
|
218
|
+
var getSubsetsForProfile = function getSubsetsForProfile(family, profile, timelineText) {
|
|
219
|
+
var metadata = FONT_METADATA[family];
|
|
220
|
+
var subsets = _toConsumableArray(profile.subsets);
|
|
221
|
+
var codePoints = _toConsumableArray(timelineText).map(function (character) {
|
|
222
|
+
return character.codePointAt(0);
|
|
223
|
+
});
|
|
224
|
+
var subsetRanges = new Map();
|
|
225
|
+
var metadataSubsets = new Set([].concat(_toConsumableArray(metadata.subsets || []), _toConsumableArray(Object.keys(metadata.unicodeRanges || {}))));
|
|
226
|
+
var _iterator2 = _createForOfIteratorHelper(metadataSubsets),
|
|
227
|
+
_step2;
|
|
228
|
+
try {
|
|
229
|
+
var _loop = function _loop() {
|
|
230
|
+
var _metadata$unicodeRang;
|
|
231
|
+
var subset = _step2.value;
|
|
232
|
+
if (!profile.weights.every(function (weight) {
|
|
233
|
+
var _metadata$fonts, _metadata$fonts$profi, _metadata$fonts$profi2;
|
|
234
|
+
return (_metadata$fonts = metadata.fonts) === null || _metadata$fonts === void 0 ? void 0 : (_metadata$fonts$profi = _metadata$fonts[profile.style]) === null || _metadata$fonts$profi === void 0 ? void 0 : (_metadata$fonts$profi2 = _metadata$fonts$profi[weight]) === null || _metadata$fonts$profi2 === void 0 ? void 0 : _metadata$fonts$profi2[subset];
|
|
235
|
+
})) {
|
|
236
|
+
return 0; // continue
|
|
237
|
+
}
|
|
238
|
+
var unicodeRange = (_metadata$unicodeRang = metadata.unicodeRanges) === null || _metadata$unicodeRang === void 0 ? void 0 : _metadata$unicodeRang[subset];
|
|
239
|
+
if (!unicodeRange) {
|
|
240
|
+
return 0; // continue
|
|
241
|
+
}
|
|
242
|
+
subsetRanges.set(subset, parseUnicodeRange(unicodeRange));
|
|
243
|
+
},
|
|
244
|
+
_ret;
|
|
245
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
246
|
+
_ret = _loop();
|
|
247
|
+
if (_ret === 0) continue;
|
|
248
|
+
}
|
|
249
|
+
} catch (err) {
|
|
250
|
+
_iterator2.e(err);
|
|
251
|
+
} finally {
|
|
252
|
+
_iterator2.f();
|
|
253
|
+
}
|
|
254
|
+
var matchesSubset = function matchesSubset(subset, codePoint) {
|
|
255
|
+
var _subsetRanges$get;
|
|
256
|
+
return (_subsetRanges$get = subsetRanges.get(subset)) === null || _subsetRanges$get === void 0 ? void 0 : _subsetRanges$get.some(function (_ref) {
|
|
257
|
+
var _ref2 = _slicedToArray(_ref, 2),
|
|
258
|
+
start = _ref2[0],
|
|
259
|
+
end = _ref2[1];
|
|
260
|
+
return codePoint >= start && codePoint <= end;
|
|
261
|
+
});
|
|
262
|
+
};
|
|
263
|
+
var specificSubsets = _toConsumableArray(subsetRanges.keys()).filter(function (subset) {
|
|
264
|
+
return !GENERIC_SUBSETS.has(subset);
|
|
265
|
+
});
|
|
266
|
+
var _iterator3 = _createForOfIteratorHelper(specificSubsets),
|
|
267
|
+
_step3;
|
|
268
|
+
try {
|
|
269
|
+
var _loop2 = function _loop2() {
|
|
270
|
+
var subset = _step3.value;
|
|
271
|
+
if (!subsets.includes(subset) && codePoints.some(function (codePoint) {
|
|
272
|
+
return matchesSubset(subset, codePoint);
|
|
273
|
+
})) {
|
|
274
|
+
subsets.push(subset);
|
|
275
|
+
}
|
|
276
|
+
};
|
|
277
|
+
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
278
|
+
_loop2();
|
|
279
|
+
}
|
|
280
|
+
} catch (err) {
|
|
281
|
+
_iterator3.e(err);
|
|
282
|
+
} finally {
|
|
283
|
+
_iterator3.f();
|
|
284
|
+
}
|
|
285
|
+
var _iterator4 = _createForOfIteratorHelper(GENERIC_SUBSETS),
|
|
286
|
+
_step4;
|
|
287
|
+
try {
|
|
288
|
+
var _loop3 = function _loop3() {
|
|
289
|
+
var subset = _step4.value;
|
|
290
|
+
var isUsedByUnmatchedCodePoint = codePoints.some(function (codePoint) {
|
|
291
|
+
return matchesSubset(subset, codePoint) && !specificSubsets.some(function (specificSubset) {
|
|
292
|
+
return matchesSubset(specificSubset, codePoint);
|
|
293
|
+
});
|
|
294
|
+
});
|
|
295
|
+
if (isUsedByUnmatchedCodePoint && !subsets.includes(subset)) {
|
|
296
|
+
subsets.push(subset);
|
|
297
|
+
}
|
|
298
|
+
};
|
|
299
|
+
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
|
|
300
|
+
_loop3();
|
|
301
|
+
}
|
|
302
|
+
} catch (err) {
|
|
303
|
+
_iterator4.e(err);
|
|
304
|
+
} finally {
|
|
305
|
+
_iterator4.f();
|
|
306
|
+
}
|
|
307
|
+
return subsets;
|
|
308
|
+
};
|
|
309
|
+
export var getFontRequestsForTimeline = function getFontRequestsForTimeline() {
|
|
310
|
+
var _timeline$output;
|
|
311
|
+
var timeline = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
312
|
+
var families = new Set();
|
|
313
|
+
var theme = ((_timeline$output = timeline.output) === null || _timeline$output === void 0 ? void 0 : _timeline$output.theme) || "default";
|
|
314
|
+
var timelineText = getTimelineText(timeline);
|
|
315
|
+
var visitTrackEntry = function visitTrackEntry(entry) {
|
|
316
|
+
addEntryDependencies(families, entry === null || entry === void 0 ? void 0 : entry.layout, theme);
|
|
317
|
+
var _iterator5 = _createForOfIteratorHelper((entry === null || entry === void 0 ? void 0 : entry.effects) || []),
|
|
318
|
+
_step5;
|
|
319
|
+
try {
|
|
320
|
+
for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
|
|
321
|
+
var effect = _step5.value;
|
|
322
|
+
addEntryDependencies(families, effect, effect.theme || theme);
|
|
323
|
+
}
|
|
324
|
+
} catch (err) {
|
|
325
|
+
_iterator5.e(err);
|
|
326
|
+
} finally {
|
|
327
|
+
_iterator5.f();
|
|
328
|
+
}
|
|
329
|
+
addEntryDependencies(families, entry, theme);
|
|
330
|
+
};
|
|
331
|
+
visitTrackEntry(timeline.mainVideoTrack);
|
|
332
|
+
var _iterator6 = _createForOfIteratorHelper(timeline.layoutVideoTrack || []),
|
|
333
|
+
_step6;
|
|
334
|
+
try {
|
|
335
|
+
for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
|
|
336
|
+
var entry = _step6.value;
|
|
337
|
+
visitTrackEntry(entry);
|
|
338
|
+
}
|
|
339
|
+
} catch (err) {
|
|
340
|
+
_iterator6.e(err);
|
|
341
|
+
} finally {
|
|
342
|
+
_iterator6.f();
|
|
343
|
+
}
|
|
344
|
+
var _iterator7 = _createForOfIteratorHelper(timeline.effectsVideoTrack || []),
|
|
345
|
+
_step7;
|
|
346
|
+
try {
|
|
347
|
+
for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {
|
|
348
|
+
var _entry = _step7.value;
|
|
349
|
+
addEntryDependencies(families, _entry, _entry.theme || theme);
|
|
350
|
+
}
|
|
351
|
+
} catch (err) {
|
|
352
|
+
_iterator7.e(err);
|
|
353
|
+
} finally {
|
|
354
|
+
_iterator7.f();
|
|
355
|
+
}
|
|
356
|
+
var _iterator8 = _createForOfIteratorHelper(timeline.captionsVideoTrack || []),
|
|
357
|
+
_step8;
|
|
358
|
+
try {
|
|
359
|
+
for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {
|
|
360
|
+
var _entry2 = _step8.value;
|
|
361
|
+
addEntryDependencies(families, _entry2, _entry2.theme || theme);
|
|
362
|
+
}
|
|
363
|
+
} catch (err) {
|
|
364
|
+
_iterator8.e(err);
|
|
365
|
+
} finally {
|
|
366
|
+
_iterator8.f();
|
|
367
|
+
}
|
|
368
|
+
return _toConsumableArray(families).sort().map(function (family) {
|
|
369
|
+
return {
|
|
370
|
+
family: family,
|
|
371
|
+
profiles: FONT_PROFILES[family].map(function (profile) {
|
|
372
|
+
return createProfile(profile.style, profile.weights, getSubsetsForProfile(family, profile, timelineText));
|
|
373
|
+
})
|
|
374
|
+
};
|
|
375
|
+
});
|
|
376
|
+
};
|
|
377
|
+
var loadedProfilesByDocument = new WeakMap();
|
|
378
|
+
export var loadFontsForTimeline = function loadFontsForTimeline() {
|
|
379
|
+
var timeline = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
380
|
+
if (typeof document === "undefined" || typeof FontFace === "undefined") {
|
|
381
|
+
return;
|
|
382
|
+
}
|
|
383
|
+
var loadedProfiles = loadedProfilesByDocument.get(document);
|
|
384
|
+
if (!loadedProfiles) {
|
|
385
|
+
loadedProfiles = new Set();
|
|
386
|
+
loadedProfilesByDocument.set(document, loadedProfiles);
|
|
387
|
+
}
|
|
388
|
+
var _iterator9 = _createForOfIteratorHelper(getFontRequestsForTimeline(timeline)),
|
|
389
|
+
_step9;
|
|
390
|
+
try {
|
|
391
|
+
for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) {
|
|
392
|
+
var _step9$value = _step9.value,
|
|
393
|
+
family = _step9$value.family,
|
|
394
|
+
profiles = _step9$value.profiles;
|
|
395
|
+
var loadFont = FONT_LOADERS[family];
|
|
396
|
+
var _iterator10 = _createForOfIteratorHelper(profiles),
|
|
397
|
+
_step10;
|
|
398
|
+
try {
|
|
399
|
+
for (_iterator10.s(); !(_step10 = _iterator10.n()).done;) {
|
|
400
|
+
var profile = _step10.value;
|
|
401
|
+
var key = [family, profile.style, profile.weights.join(","), profile.subsets.join(",")].join(":");
|
|
402
|
+
if (loadedProfiles.has(key)) {
|
|
403
|
+
continue;
|
|
404
|
+
}
|
|
405
|
+
loadFont(profile.style, {
|
|
406
|
+
weights: profile.weights,
|
|
407
|
+
subsets: profile.subsets
|
|
408
|
+
});
|
|
409
|
+
loadedProfiles.add(key);
|
|
410
|
+
}
|
|
411
|
+
} catch (err) {
|
|
412
|
+
_iterator10.e(err);
|
|
413
|
+
} finally {
|
|
414
|
+
_iterator10.f();
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
} catch (err) {
|
|
418
|
+
_iterator9.e(err);
|
|
419
|
+
} finally {
|
|
420
|
+
_iterator9.f();
|
|
421
|
+
}
|
|
422
|
+
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Converts seconds and a portion of frames to a numeric value of seconds.
|
|
3
|
-
*
|
|
4
|
-
* @param {number} seconds - The number of full seconds.
|
|
5
|
-
* @param {number} nthFrame - The current frame within the second.
|
|
6
|
-
* @param {number} delayInSeconds - Optional delay that adds up to the calculation
|
|
7
|
-
* @param {number} frameRate - The frame rate (frames per second).
|
|
8
|
-
* @return {number} The total time in seconds (with decimals for frames).
|
|
1
|
+
/**
|
|
2
|
+
* Converts seconds and a portion of frames to a numeric value of seconds.
|
|
3
|
+
*
|
|
4
|
+
* @param {number} seconds - The number of full seconds.
|
|
5
|
+
* @param {number} nthFrame - The current frame within the second.
|
|
6
|
+
* @param {number} delayInSeconds - Optional delay that adds up to the calculation
|
|
7
|
+
* @param {number} frameRate - The frame rate (frames per second).
|
|
8
|
+
* @return {number} The total time in seconds (with decimals for frames).
|
|
9
9
|
*/
|
|
10
10
|
export var convertToSeconds = function convertToSeconds(seconds, nthFrame) {
|
|
11
11
|
var delayInSeconds = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
@@ -4,10 +4,10 @@ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r)
|
|
|
4
4
|
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
5
5
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
6
6
|
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
7
|
-
/**
|
|
8
|
-
* Calculate video styles based on face detection metadata
|
|
9
|
-
* This helper adjusts video positioning and transform origin to center faces in the viewport
|
|
10
|
-
* when zooming, accounting for objectFit: "cover" behavior
|
|
7
|
+
/**
|
|
8
|
+
* Calculate video styles based on face detection metadata
|
|
9
|
+
* This helper adjusts video positioning and transform origin to center faces in the viewport
|
|
10
|
+
* when zooming, accounting for objectFit: "cover" behavior
|
|
11
11
|
*/
|
|
12
12
|
export var getFaceBasedVideoStyles = function getFaceBasedVideoStyles(_ref) {
|
|
13
13
|
var faceMetadata = _ref.faceMetadata,
|
|
@@ -4,33 +4,33 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
4
4
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
5
5
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
6
6
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
-
/**
|
|
8
|
-
* Face-Centered Video Transform Calculator
|
|
9
|
-
*
|
|
10
|
-
* This helper calculates transform origin and positioning to ensure a video is ALWAYS
|
|
11
|
-
* centered on a person's face, regardless of aspect ratio (landscape, square, portrait).
|
|
12
|
-
*
|
|
13
|
-
* Key features:
|
|
14
|
-
* - Converts absolute face coordinates to relative values
|
|
15
|
-
* - Handles different target aspect ratios (1920x1080, 1080x1080, 1080x1920)
|
|
16
|
-
* - Provides smooth interpolation between frames
|
|
17
|
-
* - Calculates optimal scale and positioning for face centering
|
|
7
|
+
/**
|
|
8
|
+
* Face-Centered Video Transform Calculator
|
|
9
|
+
*
|
|
10
|
+
* This helper calculates transform origin and positioning to ensure a video is ALWAYS
|
|
11
|
+
* centered on a person's face, regardless of aspect ratio (landscape, square, portrait).
|
|
12
|
+
*
|
|
13
|
+
* Key features:
|
|
14
|
+
* - Converts absolute face coordinates to relative values
|
|
15
|
+
* - Handles different target aspect ratios (1920x1080, 1080x1080, 1080x1920)
|
|
16
|
+
* - Provides smooth interpolation between frames
|
|
17
|
+
* - Calculates optimal scale and positioning for face centering
|
|
18
18
|
*/
|
|
19
19
|
|
|
20
20
|
import { useCurrentFrame } from "remotion";
|
|
21
21
|
|
|
22
|
-
/**
|
|
23
|
-
* Calculate face-centered video transforms
|
|
24
|
-
* @param {Object} params - Configuration object
|
|
25
|
-
* @param {Object} params.faceMetadata - Face detection metadata
|
|
26
|
-
* @param {number} params.targetWidth - Target video width (1920 for landscape, 1080 for square/portrait)
|
|
27
|
-
* @param {number} params.targetHeight - Target video height (1080 for landscape/square, 1920 for portrait)
|
|
28
|
-
* @param {number} params.currentFrame - Current frame number (optional, will use useCurrentFrame if not provided)
|
|
29
|
-
* @param {boolean} params.enableInterpolation - Whether to interpolate between frames
|
|
30
|
-
* @param {number} params.faceScale - Scale factor for face area (1.0 = face fills frame, 0.5 = face takes half frame)
|
|
31
|
-
* @param {boolean} params.useAveragePosition - Whether to use average face position for entire video duration
|
|
32
|
-
* @param {boolean} params.centerHorizontally - Whether to only center horizontally (X axis), not vertically (Y axis)
|
|
33
|
-
* @returns {Object} Transform styles and debug info
|
|
22
|
+
/**
|
|
23
|
+
* Calculate face-centered video transforms
|
|
24
|
+
* @param {Object} params - Configuration object
|
|
25
|
+
* @param {Object} params.faceMetadata - Face detection metadata
|
|
26
|
+
* @param {number} params.targetWidth - Target video width (1920 for landscape, 1080 for square/portrait)
|
|
27
|
+
* @param {number} params.targetHeight - Target video height (1080 for landscape/square, 1920 for portrait)
|
|
28
|
+
* @param {number} params.currentFrame - Current frame number (optional, will use useCurrentFrame if not provided)
|
|
29
|
+
* @param {boolean} params.enableInterpolation - Whether to interpolate between frames
|
|
30
|
+
* @param {number} params.faceScale - Scale factor for face area (1.0 = face fills frame, 0.5 = face takes half frame)
|
|
31
|
+
* @param {boolean} params.useAveragePosition - Whether to use average face position for entire video duration
|
|
32
|
+
* @param {boolean} params.centerHorizontally - Whether to only center horizontally (X axis), not vertically (Y axis)
|
|
33
|
+
* @returns {Object} Transform styles and debug info
|
|
34
34
|
*/
|
|
35
35
|
export var calculateFaceCenteredTransforms = function calculateFaceCenteredTransforms(_ref) {
|
|
36
36
|
var _faceMetadata$metadat, _faceMetadata$metadat2;
|
|
@@ -173,10 +173,10 @@ export var calculateFaceCenteredTransforms = function calculateFaceCenteredTrans
|
|
|
173
173
|
};
|
|
174
174
|
};
|
|
175
175
|
|
|
176
|
-
/**
|
|
177
|
-
* Calculate average face position from all frames with face data
|
|
178
|
-
* @param {Array} frames - Array of frame data
|
|
179
|
-
* @returns {Object|null} Average face data or null if no face data available
|
|
176
|
+
/**
|
|
177
|
+
* Calculate average face position from all frames with face data
|
|
178
|
+
* @param {Array} frames - Array of frame data
|
|
179
|
+
* @returns {Object|null} Average face data or null if no face data available
|
|
180
180
|
*/
|
|
181
181
|
function getAverageFaceData(frames) {
|
|
182
182
|
if (!frames || frames.length === 0) return null;
|
|
@@ -225,8 +225,8 @@ function getAverageFaceData(frames) {
|
|
|
225
225
|
return averageFaceData;
|
|
226
226
|
}
|
|
227
227
|
|
|
228
|
-
/**
|
|
229
|
-
* Get face data for a specific frame with optional interpolation
|
|
228
|
+
/**
|
|
229
|
+
* Get face data for a specific frame with optional interpolation
|
|
230
230
|
*/
|
|
231
231
|
function getFaceDataForFrame(frames, targetFrame, enableInterpolation) {
|
|
232
232
|
if (!frames || frames.length === 0) return null;
|
|
@@ -285,8 +285,8 @@ function getFaceDataForFrame(frames, targetFrame, enableInterpolation) {
|
|
|
285
285
|
};
|
|
286
286
|
}
|
|
287
287
|
|
|
288
|
-
/**
|
|
289
|
-
* Preset configurations for common aspect ratios
|
|
288
|
+
/**
|
|
289
|
+
* Preset configurations for common aspect ratios
|
|
290
290
|
*/
|
|
291
291
|
export var ASPECT_RATIO_PRESETS = {
|
|
292
292
|
LANDSCAPE: {
|
|
@@ -303,17 +303,17 @@ export var ASPECT_RATIO_PRESETS = {
|
|
|
303
303
|
}
|
|
304
304
|
};
|
|
305
305
|
|
|
306
|
-
/**
|
|
307
|
-
* Calculate face-centered object-position values
|
|
308
|
-
* @param {Object} params - Configuration object
|
|
309
|
-
* @param {Object} params.faceMetadata - Face detection metadata
|
|
310
|
-
* @param {number} params.targetWidth - Target video width (1920 for landscape, 1080 for square/portrait)
|
|
311
|
-
* @param {number} params.targetHeight - Target video height (1080 for landscape/square, 1920 for portrait)
|
|
312
|
-
* @param {number} params.currentFrame - Current frame number (optional, will use useCurrentFrame if not provided)
|
|
313
|
-
* @param {boolean} params.enableInterpolation - Whether to interpolate between frames
|
|
314
|
-
* @param {boolean} params.useAveragePosition - Whether to use average face position for entire video duration
|
|
315
|
-
* @param {boolean} params.centerHorizontally - Whether to only center horizontally (X axis), not vertically (Y axis)
|
|
316
|
-
* @returns {Object} Object-position styles and debug info
|
|
306
|
+
/**
|
|
307
|
+
* Calculate face-centered object-position values
|
|
308
|
+
* @param {Object} params - Configuration object
|
|
309
|
+
* @param {Object} params.faceMetadata - Face detection metadata
|
|
310
|
+
* @param {number} params.targetWidth - Target video width (1920 for landscape, 1080 for square/portrait)
|
|
311
|
+
* @param {number} params.targetHeight - Target video height (1080 for landscape/square, 1920 for portrait)
|
|
312
|
+
* @param {number} params.currentFrame - Current frame number (optional, will use useCurrentFrame if not provided)
|
|
313
|
+
* @param {boolean} params.enableInterpolation - Whether to interpolate between frames
|
|
314
|
+
* @param {boolean} params.useAveragePosition - Whether to use average face position for entire video duration
|
|
315
|
+
* @param {boolean} params.centerHorizontally - Whether to only center horizontally (X axis), not vertically (Y axis)
|
|
316
|
+
* @returns {Object} Object-position styles and debug info
|
|
317
317
|
*/
|
|
318
318
|
export var calculateFaceCenteredObjectPosition = function calculateFaceCenteredObjectPosition(_ref2) {
|
|
319
319
|
var _faceMetadata$metadat4, _faceMetadata$metadat5;
|
|
@@ -435,8 +435,8 @@ export var calculateFaceCenteredObjectPosition = function calculateFaceCenteredO
|
|
|
435
435
|
};
|
|
436
436
|
};
|
|
437
437
|
|
|
438
|
-
/**
|
|
439
|
-
* Helper function to get transforms for specific aspect ratios
|
|
438
|
+
/**
|
|
439
|
+
* Helper function to get transforms for specific aspect ratios
|
|
440
440
|
*/
|
|
441
441
|
export var getFaceCenteredTransformsForAspectRatio = function getFaceCenteredTransformsForAspectRatio(aspectRatio, faceMetadata) {
|
|
442
442
|
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
@@ -451,8 +451,8 @@ export var getFaceCenteredTransformsForAspectRatio = function getFaceCenteredTra
|
|
|
451
451
|
}, options));
|
|
452
452
|
};
|
|
453
453
|
|
|
454
|
-
/**
|
|
455
|
-
* Helper function to get object-position for specific aspect ratios
|
|
454
|
+
/**
|
|
455
|
+
* Helper function to get object-position for specific aspect ratios
|
|
456
456
|
*/
|
|
457
457
|
export var getFaceCenteredObjectPositionForAspectRatio = function getFaceCenteredObjectPositionForAspectRatio(aspectRatio, faceMetadata) {
|
|
458
458
|
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|