@zync/zync-screnplay-player 0.1.236 → 0.1.238
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/layouts/BrollInset.js +68 -44
- package/dist/screenplay/RemotionRenderer/components/layouts/MotionStillInset.js +67 -46
- package/dist/screenplay/RemotionRenderer/components/layouts/TextFullCover.js +249 -0
- package/dist/screenplay/RemotionRenderer/development.js +2 -2
- package/dist/screenplay/RemotionRenderer/main/lib/layouts/LayoutFactory.js +6 -0
- package/dist/screenplay/RemotionRenderer/main/lib/layouts/TextFullCoverLayout.js +22 -0
- package/dist/screenplay/RemotionRenderer/registeredComponents.js +4 -2
- package/package.json +1 -1
|
@@ -5,10 +5,32 @@ import { useTheme } from "../../theme/hooks/useTheme.js";
|
|
|
5
5
|
import FaceCenteredVideo from "../utils/FaceCenteredVideo";
|
|
6
6
|
var ANIMATION_SECONDS = 1.2;
|
|
7
7
|
var INSET_ASPECT_RATIO = 9 / 16;
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
var getInsetProgress = function getInsetProgress(_ref) {
|
|
9
|
+
var durationInFrames = _ref.durationInFrames,
|
|
10
|
+
frame = _ref.frame,
|
|
11
|
+
fps = _ref.fps;
|
|
12
|
+
var animationFrames = fps * ANIMATION_SECONDS;
|
|
13
|
+
var hasDuration = Number.isFinite(durationInFrames) && durationInFrames > 1;
|
|
14
|
+
var transitionFrames = hasDuration ? Math.min(animationFrames, Math.max(1, durationInFrames / 2)) : animationFrames;
|
|
15
|
+
var introProgress = interpolate(frame, [0, transitionFrames], [0, 1], {
|
|
16
|
+
easing: Easing.out(Easing.cubic),
|
|
17
|
+
extrapolateLeft: "clamp",
|
|
18
|
+
extrapolateRight: "clamp"
|
|
19
|
+
});
|
|
20
|
+
if (!hasDuration) {
|
|
21
|
+
return introProgress;
|
|
22
|
+
}
|
|
23
|
+
var outroProgress = interpolate(frame, [Math.max(0, durationInFrames - transitionFrames), durationInFrames - 1], [1, 0], {
|
|
24
|
+
easing: Easing.inOut(Easing.cubic),
|
|
25
|
+
extrapolateLeft: "clamp",
|
|
26
|
+
extrapolateRight: "clamp"
|
|
27
|
+
});
|
|
28
|
+
return Math.min(introProgress, outroProgress);
|
|
29
|
+
};
|
|
30
|
+
var getInsetMetrics = function getInsetMetrics(_ref2) {
|
|
31
|
+
var width = _ref2.width,
|
|
32
|
+
height = _ref2.height,
|
|
33
|
+
outputOrientation = _ref2.outputOrientation;
|
|
12
34
|
var padding = Math.max(32, Math.min(width, height) * 0.045);
|
|
13
35
|
var rawWidth = width * 0.24;
|
|
14
36
|
var maxWidthByHeight = (height - padding * 2) * INSET_ASPECT_RATIO;
|
|
@@ -23,15 +45,15 @@ var getInsetMetrics = function getInsetMetrics(_ref) {
|
|
|
23
45
|
width: finalWidth
|
|
24
46
|
};
|
|
25
47
|
};
|
|
26
|
-
var SourceVideo = function SourceVideo(
|
|
27
|
-
var faceMetadata =
|
|
28
|
-
height =
|
|
29
|
-
noBackgroundVideoEffects =
|
|
30
|
-
sourceVideoOrientation =
|
|
31
|
-
src =
|
|
32
|
-
startVideoFrom =
|
|
33
|
-
transparent =
|
|
34
|
-
width =
|
|
48
|
+
var SourceVideo = function SourceVideo(_ref3) {
|
|
49
|
+
var faceMetadata = _ref3.faceMetadata,
|
|
50
|
+
height = _ref3.height,
|
|
51
|
+
noBackgroundVideoEffects = _ref3.noBackgroundVideoEffects,
|
|
52
|
+
sourceVideoOrientation = _ref3.sourceVideoOrientation,
|
|
53
|
+
src = _ref3.src,
|
|
54
|
+
startVideoFrom = _ref3.startVideoFrom,
|
|
55
|
+
transparent = _ref3.transparent,
|
|
56
|
+
width = _ref3.width;
|
|
35
57
|
if (!src) {
|
|
36
58
|
return null;
|
|
37
59
|
}
|
|
@@ -67,27 +89,27 @@ var SourceVideo = function SourceVideo(_ref2) {
|
|
|
67
89
|
}
|
|
68
90
|
});
|
|
69
91
|
};
|
|
70
|
-
var BrollInsetContent = function BrollInsetContent(
|
|
71
|
-
var brollUrl =
|
|
72
|
-
children =
|
|
73
|
-
disableTransitionSounds =
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
92
|
+
var BrollInsetContent = function BrollInsetContent(_ref4) {
|
|
93
|
+
var brollUrl = _ref4.brollUrl,
|
|
94
|
+
children = _ref4.children,
|
|
95
|
+
disableTransitionSounds = _ref4.disableTransitionSounds,
|
|
96
|
+
durationInFrames = _ref4.durationInFrames,
|
|
97
|
+
faceMetadata = _ref4.faceMetadata,
|
|
98
|
+
frameColor = _ref4.frameColor,
|
|
99
|
+
height = _ref4.height,
|
|
100
|
+
noBackgroundVideoEffects = _ref4.noBackgroundVideoEffects,
|
|
101
|
+
outputOrientation = _ref4.outputOrientation,
|
|
102
|
+
sourceVideoOrientation = _ref4.sourceVideoOrientation,
|
|
103
|
+
startVideoFrom = _ref4.startVideoFrom,
|
|
104
|
+
videoUrl = _ref4.videoUrl,
|
|
105
|
+
width = _ref4.width;
|
|
83
106
|
var frame = useCurrentFrame();
|
|
84
107
|
var _useVideoConfig = useVideoConfig(),
|
|
85
108
|
fps = _useVideoConfig.fps;
|
|
86
|
-
var
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
extrapolateRight: "clamp"
|
|
109
|
+
var progress = getInsetProgress({
|
|
110
|
+
durationInFrames: durationInFrames,
|
|
111
|
+
frame: frame,
|
|
112
|
+
fps: fps
|
|
91
113
|
});
|
|
92
114
|
var _useTheme = useTheme(),
|
|
93
115
|
accentColor = _useTheme.accentColor;
|
|
@@ -149,20 +171,21 @@ var BrollInsetContent = function BrollInsetContent(_ref3) {
|
|
|
149
171
|
}
|
|
150
172
|
}, children)));
|
|
151
173
|
};
|
|
152
|
-
export var BrollInset = function BrollInset(
|
|
174
|
+
export var BrollInset = function BrollInset(_ref5) {
|
|
153
175
|
var _compositionProps$out, _window, _window$screenplayPro, _window$screenplayPro2;
|
|
154
|
-
var brollUrl =
|
|
155
|
-
children =
|
|
156
|
-
|
|
157
|
-
disableTransitionSounds =
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
176
|
+
var brollUrl = _ref5.brollUrl,
|
|
177
|
+
children = _ref5.children,
|
|
178
|
+
_ref5$disableTransiti = _ref5.disableTransitionSounds,
|
|
179
|
+
disableTransitionSounds = _ref5$disableTransiti === void 0 ? false : _ref5$disableTransiti,
|
|
180
|
+
durationInFrames = _ref5.durationInFrames,
|
|
181
|
+
faceMetadata = _ref5.faceMetadata,
|
|
182
|
+
frameColor = _ref5.frameColor,
|
|
183
|
+
noBackgroundVideoEffects = _ref5.noBackgroundVideoEffects,
|
|
184
|
+
sourceVideoOrientation = _ref5.sourceVideoOrientation,
|
|
185
|
+
startVideoFrom = _ref5.startVideoFrom,
|
|
186
|
+
_ref5$useSquareInLand = _ref5.useSquareInLandscape,
|
|
187
|
+
useSquareInLandscape = _ref5$useSquareInLand === void 0 ? false : _ref5$useSquareInLand,
|
|
188
|
+
videoUrl = _ref5.videoUrl;
|
|
166
189
|
var _useVideoConfig2 = useVideoConfig(),
|
|
167
190
|
outputWidth = _useVideoConfig2.width,
|
|
168
191
|
outputHeight = _useVideoConfig2.height,
|
|
@@ -190,6 +213,7 @@ export var BrollInset = function BrollInset(_ref4) {
|
|
|
190
213
|
var content = /*#__PURE__*/React.createElement(BrollInsetContent, {
|
|
191
214
|
brollUrl: brollUrl,
|
|
192
215
|
disableTransitionSounds: disableTransitionSounds,
|
|
216
|
+
durationInFrames: durationInFrames,
|
|
193
217
|
faceMetadata: faceMetadata,
|
|
194
218
|
frameColor: frameColor,
|
|
195
219
|
height: height,
|
|
@@ -5,10 +5,32 @@ import { useTheme } from "../../theme/hooks/useTheme.js";
|
|
|
5
5
|
import FaceCenteredVideo from "../utils/FaceCenteredVideo";
|
|
6
6
|
var ANIMATION_SECONDS = 1.2;
|
|
7
7
|
var INSET_ASPECT_RATIO = 9 / 16;
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
var getInsetProgress = function getInsetProgress(_ref) {
|
|
9
|
+
var durationInFrames = _ref.durationInFrames,
|
|
10
|
+
frame = _ref.frame,
|
|
11
|
+
fps = _ref.fps;
|
|
12
|
+
var animationFrames = fps * ANIMATION_SECONDS;
|
|
13
|
+
var hasDuration = Number.isFinite(durationInFrames) && durationInFrames > 1;
|
|
14
|
+
var transitionFrames = hasDuration ? Math.min(animationFrames, Math.max(1, durationInFrames / 2)) : animationFrames;
|
|
15
|
+
var introProgress = interpolate(frame, [0, transitionFrames], [0, 1], {
|
|
16
|
+
easing: Easing.out(Easing.cubic),
|
|
17
|
+
extrapolateLeft: "clamp",
|
|
18
|
+
extrapolateRight: "clamp"
|
|
19
|
+
});
|
|
20
|
+
if (!hasDuration) {
|
|
21
|
+
return introProgress;
|
|
22
|
+
}
|
|
23
|
+
var outroProgress = interpolate(frame, [Math.max(0, durationInFrames - transitionFrames), durationInFrames - 1], [1, 0], {
|
|
24
|
+
easing: Easing.inOut(Easing.cubic),
|
|
25
|
+
extrapolateLeft: "clamp",
|
|
26
|
+
extrapolateRight: "clamp"
|
|
27
|
+
});
|
|
28
|
+
return Math.min(introProgress, outroProgress);
|
|
29
|
+
};
|
|
30
|
+
var getInsetMetrics = function getInsetMetrics(_ref2) {
|
|
31
|
+
var width = _ref2.width,
|
|
32
|
+
height = _ref2.height,
|
|
33
|
+
outputOrientation = _ref2.outputOrientation;
|
|
12
34
|
var padding = Math.max(32, Math.min(width, height) * 0.045);
|
|
13
35
|
var rawWidth = width * 0.24;
|
|
14
36
|
var maxWidthByHeight = (height - padding * 2) * INSET_ASPECT_RATIO;
|
|
@@ -23,15 +45,15 @@ var getInsetMetrics = function getInsetMetrics(_ref) {
|
|
|
23
45
|
width: finalWidth
|
|
24
46
|
};
|
|
25
47
|
};
|
|
26
|
-
var SourceVideo = function SourceVideo(
|
|
27
|
-
var faceMetadata =
|
|
28
|
-
height =
|
|
29
|
-
noBackgroundVideoEffects =
|
|
30
|
-
sourceVideoOrientation =
|
|
31
|
-
src =
|
|
32
|
-
startVideoFrom =
|
|
33
|
-
transparent =
|
|
34
|
-
width =
|
|
48
|
+
var SourceVideo = function SourceVideo(_ref3) {
|
|
49
|
+
var faceMetadata = _ref3.faceMetadata,
|
|
50
|
+
height = _ref3.height,
|
|
51
|
+
noBackgroundVideoEffects = _ref3.noBackgroundVideoEffects,
|
|
52
|
+
sourceVideoOrientation = _ref3.sourceVideoOrientation,
|
|
53
|
+
src = _ref3.src,
|
|
54
|
+
startVideoFrom = _ref3.startVideoFrom,
|
|
55
|
+
transparent = _ref3.transparent,
|
|
56
|
+
width = _ref3.width;
|
|
35
57
|
if (!src) {
|
|
36
58
|
return null;
|
|
37
59
|
}
|
|
@@ -67,28 +89,27 @@ var SourceVideo = function SourceVideo(_ref2) {
|
|
|
67
89
|
}
|
|
68
90
|
});
|
|
69
91
|
};
|
|
70
|
-
var MotionStillInsetContent = function MotionStillInsetContent(
|
|
71
|
-
var children =
|
|
72
|
-
disableTransitionSounds =
|
|
73
|
-
durationInFrames =
|
|
74
|
-
faceMetadata =
|
|
75
|
-
frameColor =
|
|
76
|
-
height =
|
|
77
|
-
imageUrl =
|
|
78
|
-
noBackgroundVideoEffects =
|
|
79
|
-
outputOrientation =
|
|
80
|
-
sourceVideoOrientation =
|
|
81
|
-
startVideoFrom =
|
|
82
|
-
videoUrl =
|
|
83
|
-
width =
|
|
92
|
+
var MotionStillInsetContent = function MotionStillInsetContent(_ref4) {
|
|
93
|
+
var children = _ref4.children,
|
|
94
|
+
disableTransitionSounds = _ref4.disableTransitionSounds,
|
|
95
|
+
durationInFrames = _ref4.durationInFrames,
|
|
96
|
+
faceMetadata = _ref4.faceMetadata,
|
|
97
|
+
frameColor = _ref4.frameColor,
|
|
98
|
+
height = _ref4.height,
|
|
99
|
+
imageUrl = _ref4.imageUrl,
|
|
100
|
+
noBackgroundVideoEffects = _ref4.noBackgroundVideoEffects,
|
|
101
|
+
outputOrientation = _ref4.outputOrientation,
|
|
102
|
+
sourceVideoOrientation = _ref4.sourceVideoOrientation,
|
|
103
|
+
startVideoFrom = _ref4.startVideoFrom,
|
|
104
|
+
videoUrl = _ref4.videoUrl,
|
|
105
|
+
width = _ref4.width;
|
|
84
106
|
var frame = useCurrentFrame();
|
|
85
107
|
var _useVideoConfig = useVideoConfig(),
|
|
86
108
|
fps = _useVideoConfig.fps;
|
|
87
|
-
var
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
extrapolateRight: "clamp"
|
|
109
|
+
var progress = getInsetProgress({
|
|
110
|
+
durationInFrames: durationInFrames,
|
|
111
|
+
frame: frame,
|
|
112
|
+
fps: fps
|
|
92
113
|
});
|
|
93
114
|
var _useTheme = useTheme(),
|
|
94
115
|
accentColor = _useTheme.accentColor;
|
|
@@ -158,21 +179,21 @@ var MotionStillInsetContent = function MotionStillInsetContent(_ref3) {
|
|
|
158
179
|
}
|
|
159
180
|
}, children)));
|
|
160
181
|
};
|
|
161
|
-
export var MotionStillInset = function MotionStillInset(
|
|
182
|
+
export var MotionStillInset = function MotionStillInset(_ref5) {
|
|
162
183
|
var _compositionProps$out, _window, _window$screenplayPro, _window$screenplayPro2;
|
|
163
|
-
var children =
|
|
164
|
-
|
|
165
|
-
disableTransitionSounds =
|
|
166
|
-
durationInFrames =
|
|
167
|
-
faceMetadata =
|
|
168
|
-
frameColor =
|
|
169
|
-
imageUrl =
|
|
170
|
-
noBackgroundVideoEffects =
|
|
171
|
-
sourceVideoOrientation =
|
|
172
|
-
startVideoFrom =
|
|
173
|
-
|
|
174
|
-
useSquareInLandscape =
|
|
175
|
-
videoUrl =
|
|
184
|
+
var children = _ref5.children,
|
|
185
|
+
_ref5$disableTransiti = _ref5.disableTransitionSounds,
|
|
186
|
+
disableTransitionSounds = _ref5$disableTransiti === void 0 ? false : _ref5$disableTransiti,
|
|
187
|
+
durationInFrames = _ref5.durationInFrames,
|
|
188
|
+
faceMetadata = _ref5.faceMetadata,
|
|
189
|
+
frameColor = _ref5.frameColor,
|
|
190
|
+
imageUrl = _ref5.imageUrl,
|
|
191
|
+
noBackgroundVideoEffects = _ref5.noBackgroundVideoEffects,
|
|
192
|
+
sourceVideoOrientation = _ref5.sourceVideoOrientation,
|
|
193
|
+
startVideoFrom = _ref5.startVideoFrom,
|
|
194
|
+
_ref5$useSquareInLand = _ref5.useSquareInLandscape,
|
|
195
|
+
useSquareInLandscape = _ref5$useSquareInLand === void 0 ? false : _ref5$useSquareInLand,
|
|
196
|
+
videoUrl = _ref5.videoUrl;
|
|
176
197
|
var _useVideoConfig2 = useVideoConfig(),
|
|
177
198
|
outputWidth = _useVideoConfig2.width,
|
|
178
199
|
outputHeight = _useVideoConfig2.height,
|
|
@@ -0,0 +1,249 @@
|
|
|
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 _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; } }
|
|
4
|
+
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
|
|
5
|
+
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
|
|
6
|
+
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; }
|
|
7
|
+
import React from "react";
|
|
8
|
+
import { AbsoluteFill, Audio, Easing, interpolate, OffthreadVideo, useCurrentFrame, useVideoConfig } from "remotion";
|
|
9
|
+
import { loadFont } from "@remotion/google-fonts/Poppins";
|
|
10
|
+
var _loadFont = loadFont("normal", {
|
|
11
|
+
subsets: ["latin"],
|
|
12
|
+
weights: ["900"]
|
|
13
|
+
}),
|
|
14
|
+
fontFamily = _loadFont.fontFamily;
|
|
15
|
+
var TEXT_COLOR = "#0a3567";
|
|
16
|
+
var BACKGROUND_COLORS = ["#fff200", "#22f3d0", "#ff8a00", "#ff78a8", "#b9ff4a", "#f7f7f2"];
|
|
17
|
+
var HORIZONTAL_SAFE_AREA = 0.86;
|
|
18
|
+
var VERTICAL_SAFE_AREA = 0.5;
|
|
19
|
+
var BACKGROUND_WIPE_FRAMES = 7;
|
|
20
|
+
var WORD_STEP_FRAMES = 18;
|
|
21
|
+
var splitWords = function splitWords() {
|
|
22
|
+
var text = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
|
|
23
|
+
return String(text).trim().split(/\s+/).filter(Boolean);
|
|
24
|
+
};
|
|
25
|
+
var estimateWordWidth = function estimateWordWidth(word, fontSize) {
|
|
26
|
+
var wideCharacters = (word.match(/[mw@#%&]/gi) || []).length;
|
|
27
|
+
var narrowCharacters = (word.match(/[ijl1!.,'\u2019]/gi) || []).length;
|
|
28
|
+
var normalCharacters = Math.max(0, word.length - wideCharacters - narrowCharacters);
|
|
29
|
+
return fontSize * (wideCharacters * 0.9 + normalCharacters * 0.68 + narrowCharacters * 0.32);
|
|
30
|
+
};
|
|
31
|
+
var estimateWrappedTextSize = function estimateWrappedTextSize(_ref) {
|
|
32
|
+
var text = _ref.text,
|
|
33
|
+
fontSize = _ref.fontSize,
|
|
34
|
+
maxWidth = _ref.maxWidth;
|
|
35
|
+
var words = splitWords(text);
|
|
36
|
+
var spaceWidth = fontSize * 0.32;
|
|
37
|
+
var lines = words.reduce(function (acc, word) {
|
|
38
|
+
var wordWidth = estimateWordWidth(word, fontSize);
|
|
39
|
+
var currentLine = acc[acc.length - 1];
|
|
40
|
+
var nextWidth = currentLine.width === 0 ? wordWidth : currentLine.width + spaceWidth + wordWidth;
|
|
41
|
+
if (currentLine.width > 0 && nextWidth > maxWidth) {
|
|
42
|
+
acc.push({
|
|
43
|
+
width: wordWidth
|
|
44
|
+
});
|
|
45
|
+
return acc;
|
|
46
|
+
}
|
|
47
|
+
currentLine.width = nextWidth;
|
|
48
|
+
return acc;
|
|
49
|
+
}, [{
|
|
50
|
+
width: 0
|
|
51
|
+
}]);
|
|
52
|
+
return {
|
|
53
|
+
height: lines.length * fontSize * 0.95,
|
|
54
|
+
width: Math.max.apply(Math, _toConsumableArray(lines.map(function (line) {
|
|
55
|
+
return line.width;
|
|
56
|
+
})))
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
var getFontSizeForFullText = function getFontSizeForFullText(_ref2) {
|
|
60
|
+
var text = _ref2.text,
|
|
61
|
+
baseFontSize = _ref2.baseFontSize,
|
|
62
|
+
width = _ref2.width,
|
|
63
|
+
height = _ref2.height;
|
|
64
|
+
var maxWidth = width * HORIZONTAL_SAFE_AREA;
|
|
65
|
+
var maxHeight = height * VERTICAL_SAFE_AREA;
|
|
66
|
+
var min = 12;
|
|
67
|
+
var max = baseFontSize;
|
|
68
|
+
for (var i = 0; i < 12; i++) {
|
|
69
|
+
var candidate = (min + max) / 2;
|
|
70
|
+
var size = estimateWrappedTextSize({
|
|
71
|
+
text: text,
|
|
72
|
+
fontSize: candidate,
|
|
73
|
+
maxWidth: maxWidth
|
|
74
|
+
});
|
|
75
|
+
if (size.width <= maxWidth && size.height <= maxHeight) {
|
|
76
|
+
min = candidate;
|
|
77
|
+
} else {
|
|
78
|
+
max = candidate;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
return Math.floor(min);
|
|
82
|
+
};
|
|
83
|
+
var getBackgroundColor = function getBackgroundColor(index) {
|
|
84
|
+
return BACKGROUND_COLORS[index % BACKGROUND_COLORS.length];
|
|
85
|
+
};
|
|
86
|
+
var PositionedWords = function PositionedWords(_ref3) {
|
|
87
|
+
var fontSize = _ref3.fontSize,
|
|
88
|
+
frame = _ref3.frame,
|
|
89
|
+
staticUntilIndex = _ref3.staticUntilIndex,
|
|
90
|
+
visibleUntilIndex = _ref3.visibleUntilIndex,
|
|
91
|
+
width = _ref3.width,
|
|
92
|
+
words = _ref3.words;
|
|
93
|
+
return /*#__PURE__*/React.createElement(AbsoluteFill, {
|
|
94
|
+
style: {
|
|
95
|
+
alignItems: "center",
|
|
96
|
+
display: "flex",
|
|
97
|
+
justifyContent: "center"
|
|
98
|
+
}
|
|
99
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
100
|
+
style: {
|
|
101
|
+
columnGap: fontSize * 0.32,
|
|
102
|
+
display: "flex",
|
|
103
|
+
flexWrap: "wrap",
|
|
104
|
+
justifyContent: "center",
|
|
105
|
+
lineHeight: 0.95,
|
|
106
|
+
maxWidth: "".concat(HORIZONTAL_SAFE_AREA * 100, "%"),
|
|
107
|
+
rowGap: fontSize * 0.06
|
|
108
|
+
}
|
|
109
|
+
}, words.map(function (word, index) {
|
|
110
|
+
if (index > visibleUntilIndex) {
|
|
111
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
112
|
+
key: "".concat(word, "-").concat(index),
|
|
113
|
+
style: {
|
|
114
|
+
fontFamily: fontFamily,
|
|
115
|
+
fontSize: fontSize,
|
|
116
|
+
fontWeight: 900,
|
|
117
|
+
visibility: "hidden",
|
|
118
|
+
whiteSpace: "nowrap"
|
|
119
|
+
}
|
|
120
|
+
}, word);
|
|
121
|
+
}
|
|
122
|
+
var shouldAnimate = index > staticUntilIndex;
|
|
123
|
+
var wordFrame = frame - index * WORD_STEP_FRAMES;
|
|
124
|
+
var progress = shouldAnimate ? interpolate(wordFrame, [0, BACKGROUND_WIPE_FRAMES + 5], [0, 1], {
|
|
125
|
+
easing: Easing.out(Easing.cubic),
|
|
126
|
+
extrapolateLeft: "clamp",
|
|
127
|
+
extrapolateRight: "clamp"
|
|
128
|
+
}) : 1;
|
|
129
|
+
var startTranslateX = width;
|
|
130
|
+
var translateX = shouldAnimate ? interpolate(progress, [0, 1], [startTranslateX, 0], {
|
|
131
|
+
extrapolateLeft: "clamp",
|
|
132
|
+
extrapolateRight: "clamp"
|
|
133
|
+
}) : 0;
|
|
134
|
+
var opacity = shouldAnimate ? interpolate(progress, [0, 0.2, 1], [0, 1, 1], {
|
|
135
|
+
extrapolateLeft: "clamp",
|
|
136
|
+
extrapolateRight: "clamp"
|
|
137
|
+
}) : 1;
|
|
138
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
139
|
+
key: "".concat(word, "-").concat(index),
|
|
140
|
+
style: {
|
|
141
|
+
color: TEXT_COLOR,
|
|
142
|
+
fontFamily: fontFamily,
|
|
143
|
+
fontSize: fontSize,
|
|
144
|
+
fontWeight: 900,
|
|
145
|
+
lineHeight: 0.95,
|
|
146
|
+
opacity: opacity,
|
|
147
|
+
transform: "translateX(".concat(translateX, "px)"),
|
|
148
|
+
whiteSpace: "nowrap",
|
|
149
|
+
willChange: "opacity, transform"
|
|
150
|
+
}
|
|
151
|
+
}, word);
|
|
152
|
+
})));
|
|
153
|
+
};
|
|
154
|
+
export var TextFullCover = function TextFullCover(_ref4) {
|
|
155
|
+
var text = _ref4.text,
|
|
156
|
+
children = _ref4.children,
|
|
157
|
+
muted = _ref4.muted,
|
|
158
|
+
_ref4$startVideoFrom = _ref4.startVideoFrom,
|
|
159
|
+
startVideoFrom = _ref4$startVideoFrom === void 0 ? 0 : _ref4$startVideoFrom,
|
|
160
|
+
videoUrl = _ref4.videoUrl,
|
|
161
|
+
_ref4$videoZoom = _ref4.videoZoom,
|
|
162
|
+
videoZoom = _ref4$videoZoom === void 0 ? 1 : _ref4$videoZoom,
|
|
163
|
+
_ref4$disableTransiti = _ref4.disableTransitionSounds,
|
|
164
|
+
disableTransitionSounds = _ref4$disableTransiti === void 0 ? false : _ref4$disableTransiti;
|
|
165
|
+
var frame = useCurrentFrame();
|
|
166
|
+
var _useVideoConfig = useVideoConfig(),
|
|
167
|
+
width = _useVideoConfig.width,
|
|
168
|
+
height = _useVideoConfig.height;
|
|
169
|
+
var words = splitWords(text);
|
|
170
|
+
var fallbackWords = words.length ? words : [""];
|
|
171
|
+
var uppercaseWords = fallbackWords.map(function (word) {
|
|
172
|
+
return word.toLocaleUpperCase();
|
|
173
|
+
});
|
|
174
|
+
var lastStepIndex = fallbackWords.length - 1;
|
|
175
|
+
var stepIndex = Math.min(lastStepIndex, Math.floor(frame / WORD_STEP_FRAMES));
|
|
176
|
+
var previousStepIndex = Math.max(0, stepIndex - 1);
|
|
177
|
+
var frameInWord = frame - stepIndex * WORD_STEP_FRAMES;
|
|
178
|
+
var currentBackgroundColor = getBackgroundColor(stepIndex);
|
|
179
|
+
var previousBackgroundColor = getBackgroundColor(Math.max(0, stepIndex - 1));
|
|
180
|
+
var shouldWipe = stepIndex > 0 && frameInWord < BACKGROUND_WIPE_FRAMES;
|
|
181
|
+
var wipeProgress = shouldWipe ? interpolate(frameInWord, [0, BACKGROUND_WIPE_FRAMES], [0, 1], {
|
|
182
|
+
easing: Easing.out(Easing.cubic),
|
|
183
|
+
extrapolateLeft: "clamp",
|
|
184
|
+
extrapolateRight: "clamp"
|
|
185
|
+
}) : 1;
|
|
186
|
+
var currentClipPath = "inset(0 0 0 ".concat((1 - wipeProgress) * 100, "%)");
|
|
187
|
+
var baseFontSize = Math.floor(Math.min(width * 0.2, height * 0.32));
|
|
188
|
+
var fontSize = getFontSizeForFullText({
|
|
189
|
+
text: uppercaseWords.join(" "),
|
|
190
|
+
baseFontSize: baseFontSize,
|
|
191
|
+
width: width,
|
|
192
|
+
height: height
|
|
193
|
+
});
|
|
194
|
+
return /*#__PURE__*/React.createElement(AbsoluteFill, {
|
|
195
|
+
style: {
|
|
196
|
+
alignItems: "center",
|
|
197
|
+
backgroundColor: shouldWipe ? previousBackgroundColor : currentBackgroundColor,
|
|
198
|
+
display: "flex",
|
|
199
|
+
justifyContent: "center",
|
|
200
|
+
overflow: "hidden"
|
|
201
|
+
}
|
|
202
|
+
}, videoUrl ? /*#__PURE__*/React.createElement(AbsoluteFill, {
|
|
203
|
+
style: {
|
|
204
|
+
zIndex: 0
|
|
205
|
+
}
|
|
206
|
+
}, /*#__PURE__*/React.createElement(OffthreadVideo, {
|
|
207
|
+
src: videoUrl,
|
|
208
|
+
startFrom: startVideoFrom,
|
|
209
|
+
muted: muted,
|
|
210
|
+
style: {
|
|
211
|
+
height: "100%",
|
|
212
|
+
objectFit: "cover",
|
|
213
|
+
opacity: 0,
|
|
214
|
+
transform: "scale(".concat(videoZoom, ")"),
|
|
215
|
+
width: "100%"
|
|
216
|
+
}
|
|
217
|
+
})) : null, shouldWipe ? /*#__PURE__*/React.createElement(PositionedWords, {
|
|
218
|
+
fontSize: fontSize,
|
|
219
|
+
frame: frame,
|
|
220
|
+
staticUntilIndex: previousStepIndex,
|
|
221
|
+
visibleUntilIndex: previousStepIndex,
|
|
222
|
+
width: width,
|
|
223
|
+
words: uppercaseWords
|
|
224
|
+
}) : null, /*#__PURE__*/React.createElement(AbsoluteFill, {
|
|
225
|
+
style: {
|
|
226
|
+
alignItems: "center",
|
|
227
|
+
backgroundColor: currentBackgroundColor,
|
|
228
|
+
clipPath: currentClipPath,
|
|
229
|
+
display: "flex",
|
|
230
|
+
justifyContent: "center",
|
|
231
|
+
overflow: "hidden",
|
|
232
|
+
zIndex: 1
|
|
233
|
+
}
|
|
234
|
+
}, /*#__PURE__*/React.createElement(PositionedWords, {
|
|
235
|
+
fontSize: fontSize,
|
|
236
|
+
frame: frame,
|
|
237
|
+
staticUntilIndex: previousStepIndex,
|
|
238
|
+
visibleUntilIndex: stepIndex,
|
|
239
|
+
width: width,
|
|
240
|
+
words: uppercaseWords
|
|
241
|
+
})), !disableTransitionSounds && /*#__PURE__*/React.createElement(Audio, {
|
|
242
|
+
src: "https://cdn.zync.ai/assets/static/swoosh.mp3",
|
|
243
|
+
volume: 0.18
|
|
244
|
+
}), /*#__PURE__*/React.createElement(AbsoluteFill, {
|
|
245
|
+
style: {
|
|
246
|
+
zIndex: 10
|
|
247
|
+
}
|
|
248
|
+
}, children));
|
|
249
|
+
};
|
|
@@ -1078,7 +1078,7 @@ var renderer = new RemotionRenderer({
|
|
|
1078
1078
|
}, {
|
|
1079
1079
|
recordingIndex: 2,
|
|
1080
1080
|
layout: {
|
|
1081
|
-
type: "
|
|
1081
|
+
type: "text_full_cover",
|
|
1082
1082
|
data: {
|
|
1083
1083
|
noBackgroundVideoEffects: {
|
|
1084
1084
|
facePop: false,
|
|
@@ -1723,7 +1723,7 @@ var renderer = new RemotionRenderer({
|
|
|
1723
1723
|
}]
|
|
1724
1724
|
}],
|
|
1725
1725
|
output: {
|
|
1726
|
-
orientation: "
|
|
1726
|
+
orientation: "landscape",
|
|
1727
1727
|
fps: 60,
|
|
1728
1728
|
callbackUrl: "https://contentkit.zync.ai/api/processor/callback",
|
|
1729
1729
|
callbackMetadata: {
|
|
@@ -7,6 +7,7 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
|
7
7
|
import { SimpleFrameLayout } from "./SimpleFrameLayout.js";
|
|
8
8
|
import { Layout } from "./DefaultLayout.js";
|
|
9
9
|
import { TextWithVideoLayout } from "./TextWithVideoLayout.js";
|
|
10
|
+
import { TextFullCoverLayout } from "./TextFullCoverLayout.js";
|
|
10
11
|
import { HandoffLayout } from "./HandoffLayout.js";
|
|
11
12
|
import { CreatorCollabSplitLayout } from "./CreatorCollabSplitLayout.js";
|
|
12
13
|
import { CreatorCollabColdOpenLayout } from "./CreatorCollabColdOpenLayout.js";
|
|
@@ -35,6 +36,11 @@ export var LayoutFactory = /*#__PURE__*/function () {
|
|
|
35
36
|
layout = new TextWithVideoLayout(props).flatten();
|
|
36
37
|
break;
|
|
37
38
|
}
|
|
39
|
+
case "text_full_cover":
|
|
40
|
+
{
|
|
41
|
+
layout = new TextFullCoverLayout(props).flatten();
|
|
42
|
+
break;
|
|
43
|
+
}
|
|
38
44
|
case "broll_background":
|
|
39
45
|
case "simple_frame_broll":
|
|
40
46
|
case "simple_frame_sentence":
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
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); }
|
|
2
|
+
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
3
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
4
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
5
|
+
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); }
|
|
6
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
7
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
8
|
+
function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
|
|
9
|
+
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
10
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
11
|
+
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
12
|
+
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
13
|
+
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
14
|
+
import { TextWithVideoLayout } from "./TextWithVideoLayout.js";
|
|
15
|
+
export var TextFullCoverLayout = /*#__PURE__*/function (_TextWithVideoLayout) {
|
|
16
|
+
function TextFullCoverLayout() {
|
|
17
|
+
_classCallCheck(this, TextFullCoverLayout);
|
|
18
|
+
return _callSuper(this, TextFullCoverLayout, arguments);
|
|
19
|
+
}
|
|
20
|
+
_inherits(TextFullCoverLayout, _TextWithVideoLayout);
|
|
21
|
+
return _createClass(TextFullCoverLayout);
|
|
22
|
+
}(TextWithVideoLayout);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { SimpleFrame } from "./components/layouts/SimpleFrame";
|
|
2
2
|
import { TextWithVideo } from "./components/layouts/TextWithVideo";
|
|
3
|
+
import { TextFullCover } from "./components/layouts/TextFullCover";
|
|
3
4
|
import { BrollFullscreen } from "./components/effects/BrollFullscreen";
|
|
4
5
|
import { PhraseRainbowEffect } from "./components/effects/PhraseRainbowEffect";
|
|
5
6
|
import { Sentence } from "./components/effects/Sentence";
|
|
@@ -48,8 +49,8 @@ import { HookVideo } from "./components/layouts/HookVideo";
|
|
|
48
49
|
import { BrollInset } from "./components/layouts/BrollInset";
|
|
49
50
|
import { MotionStillInset } from "./components/layouts/MotionStillInset";
|
|
50
51
|
|
|
51
|
-
/** Update this so that Remotion knows which component to render when it is passed via screenplay. Ex. "title" will have rendered "Title" component
|
|
52
|
-
* Here we are mapping directly types and component names. Types are snake_case and components PascalCase.
|
|
52
|
+
/** Update this so that Remotion knows which component to render when it is passed via screenplay. Ex. "title" will have rendered "Title" component
|
|
53
|
+
* Here we are mapping directly types and component names. Types are snake_case and components PascalCase.
|
|
53
54
|
* */
|
|
54
55
|
export var RegisteredComponents = {
|
|
55
56
|
// Layouts
|
|
@@ -58,6 +59,7 @@ export var RegisteredComponents = {
|
|
|
58
59
|
SimpleFrameSentence: SimpleFrameSentence,
|
|
59
60
|
SimpleFrameZoomCut: SimpleFrameZoomCut,
|
|
60
61
|
TextWithVideo: TextWithVideo,
|
|
62
|
+
TextFullCover: TextFullCover,
|
|
61
63
|
Handoff: Handoff,
|
|
62
64
|
MultiHandoff: MultiHandoff,
|
|
63
65
|
CreatorCollabSplit: CreatorCollabSplit,
|