@zync/zync-screnplay-player 0.1.205 → 0.1.206
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/RemotionRenderer.js +17 -14
- package/dist/screenplay/RemotionRenderer/components/LottieAnimationGlobal.js +21 -21
- package/dist/screenplay/RemotionRenderer/components/layouts/DynamicTriangle.js +36 -6
- package/dist/screenplay/RemotionRenderer/components/layouts/Handoff.js +17 -6
- package/dist/screenplay/RemotionRenderer/components/layouts/IntroVideo.js +45 -8
- package/dist/screenplay/RemotionRenderer/components/layouts/Keyword.js +42 -9
- package/dist/screenplay/RemotionRenderer/components/layouts/KeywordStudioBackdrop.js +47 -10
- package/dist/screenplay/RemotionRenderer/components/layouts/MotionStill.js +42 -9
- package/dist/screenplay/RemotionRenderer/components/layouts/MotionStillStudioBackdrop.js +46 -9
- package/dist/screenplay/RemotionRenderer/components/layouts/SimpleFrame.js +21 -12
- package/dist/screenplay/RemotionRenderer/components/layouts/TextWithVideo.js +41 -8
- package/dist/screenplay/RemotionRenderer/components/utils/FaceCenteredVideo.js +50 -50
- 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/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/hooks/useOrientationBased.js +7 -3
- package/dist/screenplay/RemotionRenderer/main/lib/layouts/DefaultLayout.js +2 -1
- package/dist/screenplay/RemotionRenderer/main/lib/layouts/DynamicTriangleLayout.js +3 -2
- package/dist/screenplay/RemotionRenderer/main/lib/layouts/HandoffLayout.js +3 -2
- package/dist/screenplay/RemotionRenderer/main/lib/layouts/IntroVideoLayout.js +3 -1
- package/dist/screenplay/RemotionRenderer/main/lib/layouts/KeywordLayout.js +3 -2
- package/dist/screenplay/RemotionRenderer/main/lib/layouts/MotionStillLayout.js +3 -2
- package/dist/screenplay/RemotionRenderer/main/lib/layouts/TextWithVideoLayout.js +3 -2
- package/dist/screenplay/RemotionRenderer/main/screenplaySchema.js +51 -51
- package/dist/screenplay/RemotionRenderer/registeredComponents.js +2 -2
- package/dist/screenplay/RemotionRenderer/tracks/LayoutVideoTrack.js +20 -20
- package/package.json +47 -47
|
@@ -90,27 +90,30 @@ export var RemotionRenderer = /*#__PURE__*/function () {
|
|
|
90
90
|
}, {
|
|
91
91
|
key: "toRemotionFragment",
|
|
92
92
|
value: function toRemotionFragment(screenPlaySegment, layout) {
|
|
93
|
-
var _screenPlaySegment$da, _screenPlaySegment$da2, _layout$data, _screenPlaySegment$da3, _screenPlaySegment$da4, _layout$data2, _screenPlaySegment$da5, _toFrames, _screenPlaySegment$
|
|
93
|
+
var _screenPlaySegment$da, _screenPlaySegment$da2, _layout$data, _screenPlaySegment$da3, _screenPlaySegment$da4, _layout$data2, _screenPlaySegment$da5, _screenPlaySegment$da6, _layout$data3, _screenPlaySegment$da7, _screenPlaySegment$da8, _layout$data4, _screenPlaySegment$da9, _toFrames, _screenPlaySegment$da10, _screenPlaySegment$da11;
|
|
94
94
|
var trimLeft = 0;
|
|
95
95
|
if (layout) {
|
|
96
96
|
trimLeft = layout.data.trimLeft || 0;
|
|
97
97
|
}
|
|
98
98
|
var component = toPascalCase(screenPlaySegment.type);
|
|
99
99
|
var inheritedProps = component === "HandoffNametag" ? {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
100
|
+
useSquareInLandscape: (_screenPlaySegment$da = (_screenPlaySegment$da2 = screenPlaySegment.data) === null || _screenPlaySegment$da2 === void 0 ? void 0 : _screenPlaySegment$da2.useSquareInLandscape) !== null && _screenPlaySegment$da !== void 0 ? _screenPlaySegment$da : layout === null || layout === void 0 ? void 0 : (_layout$data = layout.data) === null || _layout$data === void 0 ? void 0 : _layout$data.useSquareInLandscape,
|
|
101
|
+
handoffNametagVariant: (_screenPlaySegment$da3 = (_screenPlaySegment$da4 = screenPlaySegment.data) === null || _screenPlaySegment$da4 === void 0 ? void 0 : _screenPlaySegment$da4.handoffNametagVariant) !== null && _screenPlaySegment$da3 !== void 0 ? _screenPlaySegment$da3 : layout === null || layout === void 0 ? void 0 : (_layout$data2 = layout.data) === null || _layout$data2 === void 0 ? void 0 : _layout$data2.handoffNametagVariant,
|
|
102
|
+
useSquareInLandscapeFirstVideo: (_screenPlaySegment$da5 = (_screenPlaySegment$da6 = screenPlaySegment.data) === null || _screenPlaySegment$da6 === void 0 ? void 0 : _screenPlaySegment$da6.useSquareInLandscapeFirstVideo) !== null && _screenPlaySegment$da5 !== void 0 ? _screenPlaySegment$da5 : layout === null || layout === void 0 ? void 0 : (_layout$data3 = layout.data) === null || _layout$data3 === void 0 ? void 0 : _layout$data3.useSquareInLandscapeFirstVideo
|
|
103
|
+
} : {
|
|
104
|
+
useSquareInLandscape: (_screenPlaySegment$da7 = (_screenPlaySegment$da8 = screenPlaySegment.data) === null || _screenPlaySegment$da8 === void 0 ? void 0 : _screenPlaySegment$da8.useSquareInLandscape) !== null && _screenPlaySegment$da7 !== void 0 ? _screenPlaySegment$da7 : layout === null || layout === void 0 ? void 0 : (_layout$data4 = layout.data) === null || _layout$data4 === void 0 ? void 0 : _layout$data4.useSquareInLandscape
|
|
105
|
+
};
|
|
103
106
|
var from = this.fps * (screenPlaySegment.data.offset - trimLeft) || 0;
|
|
104
107
|
var durationInFrames = toFrames(this.fps * screenPlaySegment.data.duration);
|
|
105
108
|
var to = from + durationInFrames;
|
|
106
109
|
return _objectSpread(_objectSpread(_objectSpread({}, screenPlaySegment.data), inheritedProps), {}, {
|
|
107
110
|
component: component,
|
|
108
|
-
videoUrl: (_screenPlaySegment$
|
|
109
|
-
startVideoFrom: (_toFrames = toFrames(this.fps * ((_screenPlaySegment$
|
|
111
|
+
videoUrl: (_screenPlaySegment$da9 = screenPlaySegment.data.sourceVideo) === null || _screenPlaySegment$da9 === void 0 ? void 0 : _screenPlaySegment$da9.videoUrl,
|
|
112
|
+
startVideoFrom: (_toFrames = toFrames(this.fps * ((_screenPlaySegment$da10 = screenPlaySegment.data.sourceVideo) === null || _screenPlaySegment$da10 === void 0 ? void 0 : _screenPlaySegment$da10.start), false, true)) !== null && _toFrames !== void 0 ? _toFrames : 0,
|
|
110
113
|
durationInFrames: durationInFrames,
|
|
111
114
|
from: from,
|
|
112
115
|
to: to,
|
|
113
|
-
videoZoom: (_screenPlaySegment$
|
|
116
|
+
videoZoom: (_screenPlaySegment$da11 = screenPlaySegment.data.sourceVideo) === null || _screenPlaySegment$da11 === void 0 ? void 0 : _screenPlaySegment$da11.zoom,
|
|
114
117
|
offset: toFrames(this.fps * (screenPlaySegment.data.offset - trimLeft)) || 0,
|
|
115
118
|
theme: screenPlaySegment.theme,
|
|
116
119
|
themeSettings: screenPlaySegment === null || screenPlaySegment === void 0 ? void 0 : screenPlaySegment.themeSettings
|
|
@@ -119,20 +122,20 @@ export var RemotionRenderer = /*#__PURE__*/function () {
|
|
|
119
122
|
}, {
|
|
120
123
|
key: "toRemotionAudioFragment",
|
|
121
124
|
value: function toRemotionAudioFragment(screenPlaySegment) {
|
|
122
|
-
var _screenPlaySegment$
|
|
125
|
+
var _screenPlaySegment$da12, _toFrames2, _screenPlaySegment$da13, _screenPlaySegment$da14, _screenPlaySegment$da15, _screenPlaySegment$da16, _screenPlaySegment$da17, _screenPlaySegment$da18;
|
|
123
126
|
var from = this.fps * screenPlaySegment.data.offset || 0;
|
|
124
127
|
var durationInFrames = toFrames(this.fps * screenPlaySegment.data.duration) || undefined;
|
|
125
128
|
var to = from + durationInFrames;
|
|
126
129
|
return _objectSpread(_objectSpread({}, screenPlaySegment.data), {}, {
|
|
127
130
|
component: toPascalCase(screenPlaySegment.type),
|
|
128
|
-
src: (_screenPlaySegment$
|
|
129
|
-
startAudioFrom: (_toFrames2 = toFrames(this.fps * ((_screenPlaySegment$
|
|
131
|
+
src: (_screenPlaySegment$da12 = screenPlaySegment.data.sourceAudio) === null || _screenPlaySegment$da12 === void 0 ? void 0 : _screenPlaySegment$da12.url,
|
|
132
|
+
startAudioFrom: (_toFrames2 = toFrames(this.fps * ((_screenPlaySegment$da13 = screenPlaySegment.data.sourceAudio) === null || _screenPlaySegment$da13 === void 0 ? void 0 : _screenPlaySegment$da13.start), false, true)) !== null && _toFrames2 !== void 0 ? _toFrames2 : 0,
|
|
130
133
|
durationInFrames: durationInFrames,
|
|
131
134
|
from: from,
|
|
132
135
|
to: to,
|
|
133
136
|
offset: this.fps * screenPlaySegment.data.offset || 0,
|
|
134
|
-
volume: (_screenPlaySegment$
|
|
135
|
-
loop: ((_screenPlaySegment$
|
|
137
|
+
volume: (_screenPlaySegment$da14 = (_screenPlaySegment$da15 = screenPlaySegment.data) === null || _screenPlaySegment$da15 === void 0 ? void 0 : (_screenPlaySegment$da16 = _screenPlaySegment$da15.sourceAudio) === null || _screenPlaySegment$da16 === void 0 ? void 0 : _screenPlaySegment$da16.volume) !== null && _screenPlaySegment$da14 !== void 0 ? _screenPlaySegment$da14 : 1,
|
|
138
|
+
loop: ((_screenPlaySegment$da17 = screenPlaySegment.data) === null || _screenPlaySegment$da17 === void 0 ? void 0 : (_screenPlaySegment$da18 = _screenPlaySegment$da17.sourceAudio) === null || _screenPlaySegment$da18 === void 0 ? void 0 : _screenPlaySegment$da18.loop) || false
|
|
136
139
|
});
|
|
137
140
|
}
|
|
138
141
|
}, {
|
|
@@ -164,10 +167,10 @@ export var RemotionRenderer = /*#__PURE__*/function () {
|
|
|
164
167
|
key: "toRemotionCaptionSegment",
|
|
165
168
|
value: function toRemotionCaptionSegment(screenPlaySegment, screenplayLayout) {
|
|
166
169
|
var _screenplayLayout$dat,
|
|
167
|
-
_screenPlaySegment$
|
|
170
|
+
_screenPlaySegment$da19,
|
|
168
171
|
_this3 = this;
|
|
169
172
|
var trimLeft = (screenplayLayout === null || screenplayLayout === void 0 ? void 0 : (_screenplayLayout$dat = screenplayLayout.data) === null || _screenplayLayout$dat === void 0 ? void 0 : _screenplayLayout$dat.trimLeft) || 0;
|
|
170
|
-
var segmentOffset = Number(screenPlaySegment === null || screenPlaySegment === void 0 ? void 0 : (_screenPlaySegment$
|
|
173
|
+
var segmentOffset = Number(screenPlaySegment === null || screenPlaySegment === void 0 ? void 0 : (_screenPlaySegment$da19 = screenPlaySegment.data) === null || _screenPlaySegment$da19 === void 0 ? void 0 : _screenPlaySegment$da19.offset);
|
|
171
174
|
var from = Number.isFinite(segmentOffset) ? this.fps * (segmentOffset + trimLeft) : 0;
|
|
172
175
|
var transcripts = screenPlaySegment.data.transcript_text;
|
|
173
176
|
if (!transcripts) {
|
|
@@ -8,9 +8,9 @@ import React, { useEffect, useState } from 'react';
|
|
|
8
8
|
import { delayRender, continueRender, cancelRender } from 'remotion';
|
|
9
9
|
import { Lottie } from '@remotion/lottie';
|
|
10
10
|
|
|
11
|
-
/**
|
|
12
|
-
* Convert a HEX color string (e.g. "#ff8800") to the RGBA float array that
|
|
13
|
-
* Lottie expects: [r, g, b, a] where each component is 0‑1.
|
|
11
|
+
/**
|
|
12
|
+
* Convert a HEX color string (e.g. "#ff8800") to the RGBA float array that
|
|
13
|
+
* Lottie expects: [r, g, b, a] where each component is 0‑1.
|
|
14
14
|
*/
|
|
15
15
|
var hexToRGBA = function hexToRGBA(hex) {
|
|
16
16
|
var clean = hex.replace('#', '');
|
|
@@ -25,9 +25,9 @@ var hexToRGBA = function hexToRGBA(hex) {
|
|
|
25
25
|
];
|
|
26
26
|
};
|
|
27
27
|
|
|
28
|
-
/**
|
|
29
|
-
* Recursively walks through shape objects and overrides any fill (fl) or
|
|
30
|
-
* stroke (st) color with the provided RGBA array.
|
|
28
|
+
/**
|
|
29
|
+
* Recursively walks through shape objects and overrides any fill (fl) or
|
|
30
|
+
* stroke (st) color with the provided RGBA array.
|
|
31
31
|
*/
|
|
32
32
|
var _applyColor = function applyColor(shapes, rgba) {
|
|
33
33
|
shapes === null || shapes === void 0 ? void 0 : shapes.forEach(function (shape) {
|
|
@@ -40,11 +40,11 @@ var _applyColor = function applyColor(shapes, rgba) {
|
|
|
40
40
|
});
|
|
41
41
|
};
|
|
42
42
|
|
|
43
|
-
/**
|
|
44
|
-
* Traverses all layers (top‑level + asset layers) and applies the primary
|
|
45
|
-
* color to every fill / stroke it encounters. This is useful for Lottie files
|
|
46
|
-
* that were exported with a single static color (e.g. white) and do not use
|
|
47
|
-
* layer naming conventions like "PrimaryColor".
|
|
43
|
+
/**
|
|
44
|
+
* Traverses all layers (top‑level + asset layers) and applies the primary
|
|
45
|
+
* color to every fill / stroke it encounters. This is useful for Lottie files
|
|
46
|
+
* that were exported with a single static color (e.g. white) and do not use
|
|
47
|
+
* layer naming conventions like "PrimaryColor".
|
|
48
48
|
*/
|
|
49
49
|
var replaceGlobalColor = function replaceGlobalColor(data, hex) {
|
|
50
50
|
var _data$assets;
|
|
@@ -60,16 +60,16 @@ var replaceGlobalColor = function replaceGlobalColor(data, hex) {
|
|
|
60
60
|
});
|
|
61
61
|
};
|
|
62
62
|
|
|
63
|
-
/**
|
|
64
|
-
* LottieAnimationGlobal – specialised wrapper to render the provided Lottie
|
|
65
|
-
* (e.g. text‑bubble‑animation.json) while dynamically replacing **all** stroke
|
|
66
|
-
* and fill colors with the supplied `primaryColor`.
|
|
67
|
-
*
|
|
68
|
-
* Props:
|
|
69
|
-
* • animationPath – URL or local path to the json file.
|
|
70
|
-
* • primaryColor – HEX string, defaults to "#ffffff".
|
|
71
|
-
* • autoplay – boolean, whether to start playing immediately.
|
|
72
|
-
* • loop – boolean, whether to loop the animation.
|
|
63
|
+
/**
|
|
64
|
+
* LottieAnimationGlobal – specialised wrapper to render the provided Lottie
|
|
65
|
+
* (e.g. text‑bubble‑animation.json) while dynamically replacing **all** stroke
|
|
66
|
+
* and fill colors with the supplied `primaryColor`.
|
|
67
|
+
*
|
|
68
|
+
* Props:
|
|
69
|
+
* • animationPath – URL or local path to the json file.
|
|
70
|
+
* • primaryColor – HEX string, defaults to "#ffffff".
|
|
71
|
+
* • autoplay – boolean, whether to start playing immediately.
|
|
72
|
+
* • loop – boolean, whether to loop the animation.
|
|
73
73
|
*/
|
|
74
74
|
export var LottieAnimationGlobal = function LottieAnimationGlobal(_ref) {
|
|
75
75
|
var animationPath = _ref.animationPath,
|
|
@@ -12,6 +12,7 @@ import FaceCenteredVideo from "../utils/FaceCenteredVideo";
|
|
|
12
12
|
var _loadFont = loadFont(),
|
|
13
13
|
fontFamily = _loadFont.fontFamily;
|
|
14
14
|
export var DynamicTriangle = function DynamicTriangle(_ref) {
|
|
15
|
+
var _compositionProps$out, _window, _window$screenplayPro, _window$screenplayPro2;
|
|
15
16
|
var children = _ref.children,
|
|
16
17
|
videoUrl = _ref.videoUrl,
|
|
17
18
|
startVideoFrom = _ref.startVideoFrom,
|
|
@@ -31,11 +32,22 @@ export var DynamicTriangle = function DynamicTriangle(_ref) {
|
|
|
31
32
|
sentenceText = _ref.sentenceText,
|
|
32
33
|
noBackgroundVideoUrl = _ref.noBackgroundVideoUrl,
|
|
33
34
|
noBackgroundVideoEffects = _ref.noBackgroundVideoEffects,
|
|
34
|
-
faceMetadata = _ref.faceMetadata
|
|
35
|
+
faceMetadata = _ref.faceMetadata,
|
|
36
|
+
_ref$useSquareInLands = _ref.useSquareInLandscape,
|
|
37
|
+
useSquareInLandscape = _ref$useSquareInLands === void 0 ? false : _ref$useSquareInLands;
|
|
35
38
|
var _useVideoConfig = useVideoConfig(),
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
fps = _useVideoConfig.fps
|
|
39
|
+
outputWidth = _useVideoConfig.width,
|
|
40
|
+
outputHeight = _useVideoConfig.height,
|
|
41
|
+
fps = _useVideoConfig.fps,
|
|
42
|
+
_useVideoConfig$props = _useVideoConfig.props,
|
|
43
|
+
compositionProps = _useVideoConfig$props === void 0 ? {} : _useVideoConfig$props;
|
|
44
|
+
var outputOrientation = (compositionProps === null || compositionProps === void 0 ? void 0 : (_compositionProps$out = compositionProps.output) === null || _compositionProps$out === void 0 ? void 0 : _compositionProps$out.orientation) || (typeof window !== "undefined" ? (_window = window) === null || _window === void 0 ? void 0 : (_window$screenplayPro = _window.screenplayProps) === null || _window$screenplayPro === void 0 ? void 0 : (_window$screenplayPro2 = _window$screenplayPro.output) === null || _window$screenplayPro2 === void 0 ? void 0 : _window$screenplayPro2.orientation : undefined);
|
|
45
|
+
var shouldUseSquareInLandscape = Boolean(useSquareInLandscape) && outputOrientation === "landscape";
|
|
46
|
+
var squareSize = 1080;
|
|
47
|
+
var width = shouldUseSquareInLandscape ? squareSize : outputWidth;
|
|
48
|
+
var height = shouldUseSquareInLandscape ? squareSize : outputHeight;
|
|
49
|
+
var renderOffsetX = shouldUseSquareInLandscape ? (outputWidth - squareSize) / 2 : 0;
|
|
50
|
+
var orientationOverride = shouldUseSquareInLandscape ? "square" : undefined;
|
|
39
51
|
var frame = useCurrentFrame();
|
|
40
52
|
var _useVirtualBackground = useVirtualBackground(),
|
|
41
53
|
isVirtual = _useVirtualBackground.isVirtual,
|
|
@@ -180,7 +192,7 @@ export var DynamicTriangle = function DynamicTriangle(_ref) {
|
|
|
180
192
|
textContainerWidth: width - 200,
|
|
181
193
|
textContainerHeight: height * 0.4
|
|
182
194
|
}
|
|
183
|
-
});
|
|
195
|
+
}, orientationOverride);
|
|
184
196
|
|
|
185
197
|
// Extract values from orientation config
|
|
186
198
|
var triangleSize = orientationConfig.triangleSize,
|
|
@@ -375,7 +387,7 @@ export var DynamicTriangle = function DynamicTriangle(_ref) {
|
|
|
375
387
|
var _distributeTextToFit = distributeTextToFit(sentenceText, textContainerWidth, textContainerHeight, 120),
|
|
376
388
|
lines = _distributeTextToFit.lines,
|
|
377
389
|
fontSize = _distributeTextToFit.fontSize;
|
|
378
|
-
|
|
390
|
+
var content = /*#__PURE__*/React.createElement(React.Fragment, null, !disableTransitionSounds && /*#__PURE__*/React.createElement(Audio, {
|
|
379
391
|
src: "https://cdn.zync.ai/assets/static/swoosh.mp3",
|
|
380
392
|
volume: 0.25
|
|
381
393
|
}), /*#__PURE__*/React.createElement(AbsoluteFill, {
|
|
@@ -615,4 +627,22 @@ export var DynamicTriangle = function DynamicTriangle(_ref) {
|
|
|
615
627
|
zIndex: 14
|
|
616
628
|
}
|
|
617
629
|
}, children)));
|
|
630
|
+
if (!shouldUseSquareInLandscape) {
|
|
631
|
+
return content;
|
|
632
|
+
}
|
|
633
|
+
return /*#__PURE__*/React.createElement(AbsoluteFill, {
|
|
634
|
+
style: {
|
|
635
|
+
width: outputWidth,
|
|
636
|
+
height: outputHeight,
|
|
637
|
+
backgroundColor: "black"
|
|
638
|
+
}
|
|
639
|
+
}, /*#__PURE__*/React.createElement(AbsoluteFill, {
|
|
640
|
+
style: {
|
|
641
|
+
width: width,
|
|
642
|
+
height: height,
|
|
643
|
+
left: renderOffsetX,
|
|
644
|
+
top: 0,
|
|
645
|
+
overflow: "hidden"
|
|
646
|
+
}
|
|
647
|
+
}, content));
|
|
618
648
|
};
|
|
@@ -25,7 +25,9 @@ export var Handoff = function Handoff(_ref) {
|
|
|
25
25
|
noBackgroundVideoEffects = _ref.noBackgroundVideoEffects,
|
|
26
26
|
handoffOverlapSeconds = _ref.handoffOverlapSeconds,
|
|
27
27
|
_ref$useSquareInLands = _ref.useSquareInLandscapeFirstVideo,
|
|
28
|
-
useSquareInLandscapeFirstVideo = _ref$useSquareInLands === void 0 ? false : _ref$useSquareInLands
|
|
28
|
+
useSquareInLandscapeFirstVideo = _ref$useSquareInLands === void 0 ? false : _ref$useSquareInLands,
|
|
29
|
+
_ref$useSquareInLands2 = _ref.useSquareInLandscapeSecondVideo,
|
|
30
|
+
useSquareInLandscapeSecondVideo = _ref$useSquareInLands2 === void 0 ? false : _ref$useSquareInLands2;
|
|
29
31
|
var videoConfig = useVideoConfig();
|
|
30
32
|
var width = videoConfig.width,
|
|
31
33
|
height = videoConfig.height,
|
|
@@ -34,6 +36,7 @@ export var Handoff = function Handoff(_ref) {
|
|
|
34
36
|
compositionProps = _videoConfig$props === void 0 ? {} : _videoConfig$props;
|
|
35
37
|
var outputOrientation = (compositionProps === null || compositionProps === void 0 ? void 0 : (_compositionProps$out = compositionProps.output) === null || _compositionProps$out === void 0 ? void 0 : _compositionProps$out.orientation) || (typeof window !== "undefined" ? (_window = window) === null || _window === void 0 ? void 0 : (_window$screenplayPro = _window.screenplayProps) === null || _window$screenplayPro === void 0 ? void 0 : (_window$screenplayPro2 = _window$screenplayPro.output) === null || _window$screenplayPro2 === void 0 ? void 0 : _window$screenplayPro2.orientation : undefined);
|
|
36
38
|
var shouldUseSquareInLandscapeFirstVideo = Boolean(useSquareInLandscapeFirstVideo) && outputOrientation === "landscape";
|
|
39
|
+
var shouldUseSquareInLandscapeSecondVideo = Boolean(useSquareInLandscapeSecondVideo) && outputOrientation === "landscape";
|
|
37
40
|
var squareSize = 1080;
|
|
38
41
|
var frame = useCurrentFrame();
|
|
39
42
|
var _useTheme = useTheme(),
|
|
@@ -80,6 +83,10 @@ export var Handoff = function Handoff(_ref) {
|
|
|
80
83
|
var firstRenderVideoHeight = shouldUseSquareInLandscapeFirstVideo ? Math.min(firstVideoHeight, squareSize) : firstVideoHeight;
|
|
81
84
|
var firstVideoCenteredOffsetX = shouldUseSquareInLandscapeFirstVideo ? Math.max(0, (width - TOTAL_X_PADDING - firstRenderVideoWidth) / 2) : 0;
|
|
82
85
|
var firstVideoTranslateX = useTimeInterpolate(inputRangeInSeconds, [firstVideoCenteredOffsetX, 0, 0, 0], DEFAULT_TIME_INTERPOLATE_OPTIONS);
|
|
86
|
+
var secondRenderVideoWidth = shouldUseSquareInLandscapeSecondVideo ? Math.min(secondVideoWidth, squareSize) : secondVideoWidth;
|
|
87
|
+
var secondRenderVideoHeight = shouldUseSquareInLandscapeSecondVideo ? Math.min(secondVideoHeight, squareSize) : secondVideoHeight;
|
|
88
|
+
var secondVideoCenteredOffsetX = shouldUseSquareInLandscapeSecondVideo ? Math.max(0, (width - TOTAL_X_PADDING - secondRenderVideoWidth) / 2) : 0;
|
|
89
|
+
var secondVideoTranslateX = useTimeInterpolate(inputRangeInSeconds, [secondVideoCenteredOffsetX, 0, 0, 0], DEFAULT_TIME_INTERPOLATE_OPTIONS);
|
|
83
90
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(AbsoluteFill, {
|
|
84
91
|
style: {
|
|
85
92
|
width: width,
|
|
@@ -126,24 +133,28 @@ export var Handoff = function Handoff(_ref) {
|
|
|
126
133
|
}))), /*#__PURE__*/React.createElement(Sequence, {
|
|
127
134
|
from: delayInFrames,
|
|
128
135
|
layout: "none"
|
|
136
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
137
|
+
style: {
|
|
138
|
+
transform: "translateX(".concat(secondVideoTranslateX, "px)")
|
|
139
|
+
}
|
|
129
140
|
}, secondNoBackgroundFaceMetadata ? /*#__PURE__*/React.createElement(FaceCenteredVideo, {
|
|
130
141
|
startFrom: startSecondVideoFrom,
|
|
131
142
|
src: secondVideoFile,
|
|
132
143
|
faceMetadata: secondNoBackgroundFaceMetadata,
|
|
133
144
|
aspectRatio: orientation,
|
|
134
|
-
containerWidth:
|
|
135
|
-
containerHeight:
|
|
145
|
+
containerWidth: secondRenderVideoWidth,
|
|
146
|
+
containerHeight: secondRenderVideoHeight,
|
|
136
147
|
useAveragePosition: true
|
|
137
148
|
}) : /*#__PURE__*/React.createElement(OffthreadVideo, {
|
|
138
149
|
startFrom: startSecondVideoFrom,
|
|
139
150
|
src: secondVideoFile,
|
|
140
151
|
style: {
|
|
141
|
-
height:
|
|
152
|
+
height: secondRenderVideoHeight,
|
|
142
153
|
objectFit: "cover",
|
|
143
|
-
width:
|
|
154
|
+
width: secondRenderVideoWidth,
|
|
144
155
|
borderRadius: "40px"
|
|
145
156
|
}
|
|
146
|
-
}))), /*#__PURE__*/React.createElement(BlurOverlay, {
|
|
157
|
+
})))), /*#__PURE__*/React.createElement(BlurOverlay, {
|
|
147
158
|
show: (noBackgroundVideoEffects === null || noBackgroundVideoEffects === void 0 ? void 0 : noBackgroundVideoEffects.backgroundBlur) && (firstNoBackgroundVideoUrl || secondNoBackgroundVideoUrl),
|
|
148
159
|
width: width,
|
|
149
160
|
height: height,
|
|
@@ -30,6 +30,8 @@ var Landscape = function Landscape(_ref) {
|
|
|
30
30
|
logoLeft = _ref.logoLeft,
|
|
31
31
|
logoTop = _ref.logoTop,
|
|
32
32
|
logoRight = _ref.logoRight,
|
|
33
|
+
_ref$logoPosition = _ref.logoPosition,
|
|
34
|
+
logoPosition = _ref$logoPosition === void 0 ? "fixed" : _ref$logoPosition,
|
|
33
35
|
videoWidth = _ref.videoWidth,
|
|
34
36
|
videoHeight = _ref.videoHeight,
|
|
35
37
|
videoTop = _ref.videoTop,
|
|
@@ -409,7 +411,7 @@ var Landscape = function Landscape(_ref) {
|
|
|
409
411
|
}
|
|
410
412
|
}, children), logoUrl ? /*#__PURE__*/React.createElement("div", {
|
|
411
413
|
style: _objectSpread({
|
|
412
|
-
position:
|
|
414
|
+
position: logoPosition,
|
|
413
415
|
top: logoTop,
|
|
414
416
|
padding: 20,
|
|
415
417
|
zIndex: 10
|
|
@@ -436,6 +438,8 @@ var Portrait = function Portrait(_ref2) {
|
|
|
436
438
|
logoLeft = _ref2.logoLeft,
|
|
437
439
|
logoTop = _ref2.logoTop,
|
|
438
440
|
logoRight = _ref2.logoRight,
|
|
441
|
+
_ref2$logoPosition = _ref2.logoPosition,
|
|
442
|
+
logoPosition = _ref2$logoPosition === void 0 ? "fixed" : _ref2$logoPosition,
|
|
439
443
|
videoWidth = _ref2.videoWidth,
|
|
440
444
|
videoHeight = _ref2.videoHeight,
|
|
441
445
|
videoTop = _ref2.videoTop,
|
|
@@ -816,7 +820,7 @@ var Portrait = function Portrait(_ref2) {
|
|
|
816
820
|
}
|
|
817
821
|
}, children), logoUrl ? /*#__PURE__*/React.createElement("div", {
|
|
818
822
|
style: _objectSpread({
|
|
819
|
-
position:
|
|
823
|
+
position: logoPosition,
|
|
820
824
|
top: logoTop,
|
|
821
825
|
padding: 20,
|
|
822
826
|
zIndex: 10
|
|
@@ -846,6 +850,8 @@ var Square = function Square(_ref3) {
|
|
|
846
850
|
logoUrl = _ref3.logoUrl,
|
|
847
851
|
logoLeft = _ref3.logoLeft,
|
|
848
852
|
logoTop = _ref3.logoTop,
|
|
853
|
+
_ref3$logoPosition = _ref3.logoPosition,
|
|
854
|
+
logoPosition = _ref3$logoPosition === void 0 ? "fixed" : _ref3$logoPosition,
|
|
849
855
|
logoRight = _ref3.logoRight,
|
|
850
856
|
virtualBgUrl = _ref3.virtualBgUrl,
|
|
851
857
|
showVirtual = _ref3.showVirtual;
|
|
@@ -1214,7 +1220,7 @@ var Square = function Square(_ref3) {
|
|
|
1214
1220
|
}
|
|
1215
1221
|
}, children), logoUrl ? /*#__PURE__*/React.createElement("div", {
|
|
1216
1222
|
style: _objectSpread({
|
|
1217
|
-
position:
|
|
1223
|
+
position: logoPosition,
|
|
1218
1224
|
top: logoTop,
|
|
1219
1225
|
padding: 20,
|
|
1220
1226
|
zIndex: 20
|
|
@@ -1230,6 +1236,7 @@ var Square = function Square(_ref3) {
|
|
|
1230
1236
|
})) : null);
|
|
1231
1237
|
};
|
|
1232
1238
|
var IntroVideo = function IntroVideo(_ref4) {
|
|
1239
|
+
var _compositionProps$out, _window, _window$screenplayPro, _window$screenplayPro2;
|
|
1233
1240
|
var videoUrl = _ref4.videoUrl,
|
|
1234
1241
|
startVideoFrom = _ref4.startVideoFrom,
|
|
1235
1242
|
_ref4$sentenceText = _ref4.sentenceText,
|
|
@@ -1245,10 +1252,21 @@ var IntroVideo = function IntroVideo(_ref4) {
|
|
|
1245
1252
|
muted = _ref4.muted,
|
|
1246
1253
|
faceMetadata = _ref4.faceMetadata,
|
|
1247
1254
|
noBackgroundVideoEffects = _ref4.noBackgroundVideoEffects,
|
|
1248
|
-
noBackgroundVideoUrl = _ref4.noBackgroundVideoUrl
|
|
1255
|
+
noBackgroundVideoUrl = _ref4.noBackgroundVideoUrl,
|
|
1256
|
+
_ref4$useSquareInLand = _ref4.useSquareInLandscape,
|
|
1257
|
+
useSquareInLandscape = _ref4$useSquareInLand === void 0 ? false : _ref4$useSquareInLand;
|
|
1249
1258
|
var _useVideoConfig5 = useVideoConfig(),
|
|
1250
|
-
|
|
1251
|
-
|
|
1259
|
+
outputWidth = _useVideoConfig5.width,
|
|
1260
|
+
outputHeight = _useVideoConfig5.height,
|
|
1261
|
+
_useVideoConfig5$prop = _useVideoConfig5.props,
|
|
1262
|
+
compositionProps = _useVideoConfig5$prop === void 0 ? {} : _useVideoConfig5$prop;
|
|
1263
|
+
var outputOrientation = (compositionProps === null || compositionProps === void 0 ? void 0 : (_compositionProps$out = compositionProps.output) === null || _compositionProps$out === void 0 ? void 0 : _compositionProps$out.orientation) || (typeof window !== "undefined" ? (_window = window) === null || _window === void 0 ? void 0 : (_window$screenplayPro = _window.screenplayProps) === null || _window$screenplayPro === void 0 ? void 0 : (_window$screenplayPro2 = _window$screenplayPro.output) === null || _window$screenplayPro2 === void 0 ? void 0 : _window$screenplayPro2.orientation : undefined);
|
|
1264
|
+
var shouldUseSquareInLandscape = Boolean(useSquareInLandscape) && outputOrientation === "landscape";
|
|
1265
|
+
var squareSize = 1080;
|
|
1266
|
+
var width = shouldUseSquareInLandscape ? squareSize : outputWidth;
|
|
1267
|
+
var height = shouldUseSquareInLandscape ? squareSize : outputHeight;
|
|
1268
|
+
var renderOffsetX = shouldUseSquareInLandscape ? (outputWidth - squareSize) / 2 : 0;
|
|
1269
|
+
var orientationOverride = shouldUseSquareInLandscape ? "square" : undefined;
|
|
1252
1270
|
var _useVirtualBackground = useVirtualBackground(),
|
|
1253
1271
|
isVirtual = _useVirtualBackground.isVirtual,
|
|
1254
1272
|
virtualBgUrl = _useVirtualBackground.url;
|
|
@@ -1289,7 +1307,7 @@ var IntroVideo = function IntroVideo(_ref4) {
|
|
|
1289
1307
|
logoRight: CHROME_PADDING,
|
|
1290
1308
|
IntroVideoComponent: Square
|
|
1291
1309
|
}
|
|
1292
|
-
}),
|
|
1310
|
+
}, orientationOverride),
|
|
1293
1311
|
IntroVideoComponent = _useOrientationBased.IntroVideoComponent,
|
|
1294
1312
|
videoWidth = _useOrientationBased.videoWidth,
|
|
1295
1313
|
videoHeight = _useOrientationBased.videoHeight,
|
|
@@ -1301,7 +1319,7 @@ var IntroVideo = function IntroVideo(_ref4) {
|
|
|
1301
1319
|
logoLeft = _useOrientationBased.logoLeft,
|
|
1302
1320
|
logoRight = _useOrientationBased.logoRight,
|
|
1303
1321
|
orientation = _useOrientationBased.orientation;
|
|
1304
|
-
|
|
1322
|
+
var content = /*#__PURE__*/React.createElement(React.Fragment, null, !disableTransitionSounds && /*#__PURE__*/React.createElement(Audio, {
|
|
1305
1323
|
src: "https://cdn.zync.ai/assets/static/swoosh.mp3",
|
|
1306
1324
|
volume: 0.25
|
|
1307
1325
|
}), /*#__PURE__*/React.createElement(IntroVideoComponent, {
|
|
@@ -1314,6 +1332,7 @@ var IntroVideo = function IntroVideo(_ref4) {
|
|
|
1314
1332
|
logoLeft: logoLeft,
|
|
1315
1333
|
logoTop: logoTop,
|
|
1316
1334
|
logoRight: logoRight,
|
|
1335
|
+
logoPosition: shouldUseSquareInLandscape ? "absolute" : "fixed",
|
|
1317
1336
|
videoWidth: videoWidth,
|
|
1318
1337
|
videoHeight: videoHeight,
|
|
1319
1338
|
videoTop: videoTop,
|
|
@@ -1329,5 +1348,23 @@ var IntroVideo = function IntroVideo(_ref4) {
|
|
|
1329
1348
|
showVirtual: showVirtual,
|
|
1330
1349
|
virtualBgUrl: virtualBgUrl
|
|
1331
1350
|
}, children));
|
|
1351
|
+
if (!shouldUseSquareInLandscape) {
|
|
1352
|
+
return content;
|
|
1353
|
+
}
|
|
1354
|
+
return /*#__PURE__*/React.createElement(AbsoluteFill, {
|
|
1355
|
+
style: {
|
|
1356
|
+
width: outputWidth,
|
|
1357
|
+
height: outputHeight,
|
|
1358
|
+
backgroundColor: "black"
|
|
1359
|
+
}
|
|
1360
|
+
}, /*#__PURE__*/React.createElement(AbsoluteFill, {
|
|
1361
|
+
style: {
|
|
1362
|
+
width: width,
|
|
1363
|
+
height: height,
|
|
1364
|
+
left: renderOffsetX,
|
|
1365
|
+
top: 0,
|
|
1366
|
+
overflow: "hidden"
|
|
1367
|
+
}
|
|
1368
|
+
}, content));
|
|
1332
1369
|
};
|
|
1333
1370
|
export { IntroVideo };
|
|
@@ -27,10 +27,12 @@ var Logo = function Logo(_ref) {
|
|
|
27
27
|
var logoUrl = _ref.logoUrl,
|
|
28
28
|
top = _ref.top,
|
|
29
29
|
left = _ref.left,
|
|
30
|
-
right = _ref.right
|
|
30
|
+
right = _ref.right,
|
|
31
|
+
_ref$position = _ref.position,
|
|
32
|
+
position = _ref$position === void 0 ? "fixed" : _ref$position;
|
|
31
33
|
return logoUrl ? /*#__PURE__*/React.createElement("div", {
|
|
32
34
|
style: {
|
|
33
|
-
position:
|
|
35
|
+
position: position,
|
|
34
36
|
zIndex: 11,
|
|
35
37
|
top: top,
|
|
36
38
|
left: left,
|
|
@@ -166,6 +168,7 @@ var RotatingWordsContainer = /*#__PURE__*/React.memo(function (_ref3) {
|
|
|
166
168
|
})));
|
|
167
169
|
});
|
|
168
170
|
var KeywordComponent = function KeywordComponent(_ref4) {
|
|
171
|
+
var _compositionProps$out, _window, _window$screenplayPro, _window$screenplayPro2;
|
|
169
172
|
var startVideoFrom = _ref4.startVideoFrom,
|
|
170
173
|
videoUrl = _ref4.videoUrl,
|
|
171
174
|
logoUrl = _ref4.logoUrl,
|
|
@@ -181,11 +184,22 @@ var KeywordComponent = function KeywordComponent(_ref4) {
|
|
|
181
184
|
faceMetadata = _ref4.faceMetadata,
|
|
182
185
|
muted = _ref4.muted,
|
|
183
186
|
noBackgroundVideoEffects = _ref4.noBackgroundVideoEffects,
|
|
184
|
-
noBackgroundVideoUrl = _ref4.noBackgroundVideoUrl
|
|
187
|
+
noBackgroundVideoUrl = _ref4.noBackgroundVideoUrl,
|
|
188
|
+
_ref4$useSquareInLand = _ref4.useSquareInLandscape,
|
|
189
|
+
useSquareInLandscape = _ref4$useSquareInLand === void 0 ? false : _ref4$useSquareInLand;
|
|
185
190
|
var _useVideoConfig = useVideoConfig(),
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
fps = _useVideoConfig.fps
|
|
191
|
+
outputWidth = _useVideoConfig.width,
|
|
192
|
+
outputHeight = _useVideoConfig.height,
|
|
193
|
+
fps = _useVideoConfig.fps,
|
|
194
|
+
_useVideoConfig$props = _useVideoConfig.props,
|
|
195
|
+
compositionProps = _useVideoConfig$props === void 0 ? {} : _useVideoConfig$props;
|
|
196
|
+
var outputOrientation = (compositionProps === null || compositionProps === void 0 ? void 0 : (_compositionProps$out = compositionProps.output) === null || _compositionProps$out === void 0 ? void 0 : _compositionProps$out.orientation) || (typeof window !== "undefined" ? (_window = window) === null || _window === void 0 ? void 0 : (_window$screenplayPro = _window.screenplayProps) === null || _window$screenplayPro === void 0 ? void 0 : (_window$screenplayPro2 = _window$screenplayPro.output) === null || _window$screenplayPro2 === void 0 ? void 0 : _window$screenplayPro2.orientation : undefined);
|
|
197
|
+
var shouldUseSquareInLandscape = Boolean(useSquareInLandscape) && outputOrientation === "landscape";
|
|
198
|
+
var squareSize = 1080;
|
|
199
|
+
var width = shouldUseSquareInLandscape ? squareSize : outputWidth;
|
|
200
|
+
var height = shouldUseSquareInLandscape ? squareSize : outputHeight;
|
|
201
|
+
var renderOffsetX = shouldUseSquareInLandscape ? (outputWidth - squareSize) / 2 : 0;
|
|
202
|
+
var orientationOverride = shouldUseSquareInLandscape ? "square" : undefined;
|
|
189
203
|
var frame = useCurrentFrame();
|
|
190
204
|
var _useVirtualBackground = useVirtualBackground(),
|
|
191
205
|
isVirtual = _useVirtualBackground.isVirtual,
|
|
@@ -234,7 +248,7 @@ var KeywordComponent = function KeywordComponent(_ref4) {
|
|
|
234
248
|
logoRight: stylesByVariant[variant].logoRight,
|
|
235
249
|
flowDirection: "row-reverse"
|
|
236
250
|
}
|
|
237
|
-
}),
|
|
251
|
+
}, orientationOverride),
|
|
238
252
|
imageContainerOutputRange = _useOrientationBased.imageContainerOutputRange,
|
|
239
253
|
containerWidth = _useOrientationBased.containerWidth,
|
|
240
254
|
targetVideoWidth = _useOrientationBased.targetVideoWidth,
|
|
@@ -271,7 +285,7 @@ var KeywordComponent = function KeywordComponent(_ref4) {
|
|
|
271
285
|
var imageContainerTranslate = imageContainerOutputRange[0] + (imageContainerOutputRange[1] - imageContainerOutputRange[0]) * easedProgress;
|
|
272
286
|
var videoWidth = width + (targetVideoWidth - width) * easedProgress;
|
|
273
287
|
var videoHeight = height + (targetVideoHeight - height) * easedProgress;
|
|
274
|
-
|
|
288
|
+
var content = /*#__PURE__*/React.createElement(AbsoluteFill, {
|
|
275
289
|
style: {
|
|
276
290
|
isolation: "isolate",
|
|
277
291
|
width: width,
|
|
@@ -310,7 +324,8 @@ var KeywordComponent = function KeywordComponent(_ref4) {
|
|
|
310
324
|
logoUrl: logoUrl,
|
|
311
325
|
top: logoTop,
|
|
312
326
|
left: logoLeft,
|
|
313
|
-
right: logoRight
|
|
327
|
+
right: logoRight,
|
|
328
|
+
position: shouldUseSquareInLandscape ? "absolute" : "fixed"
|
|
314
329
|
}), /*#__PURE__*/React.createElement("div", {
|
|
315
330
|
style: {
|
|
316
331
|
display: "flex",
|
|
@@ -507,6 +522,24 @@ var KeywordComponent = function KeywordComponent(_ref4) {
|
|
|
507
522
|
zIndex: 10
|
|
508
523
|
}
|
|
509
524
|
}, children));
|
|
525
|
+
if (!shouldUseSquareInLandscape) {
|
|
526
|
+
return content;
|
|
527
|
+
}
|
|
528
|
+
return /*#__PURE__*/React.createElement(AbsoluteFill, {
|
|
529
|
+
style: {
|
|
530
|
+
width: outputWidth,
|
|
531
|
+
height: outputHeight,
|
|
532
|
+
backgroundColor: "black"
|
|
533
|
+
}
|
|
534
|
+
}, /*#__PURE__*/React.createElement(AbsoluteFill, {
|
|
535
|
+
style: {
|
|
536
|
+
width: width,
|
|
537
|
+
height: height,
|
|
538
|
+
left: renderOffsetX,
|
|
539
|
+
top: 0,
|
|
540
|
+
overflow: "hidden"
|
|
541
|
+
}
|
|
542
|
+
}, content));
|
|
510
543
|
};
|
|
511
544
|
export var Keyword = function Keyword(props) {
|
|
512
545
|
var _useTheme = useTheme(),
|