@zync/zync-screnplay-player 0.1.202 → 0.1.204
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 +13 -12
- package/dist/screenplay/RemotionRenderer/components/LottieAnimationGlobal.js +21 -21
- package/dist/screenplay/RemotionRenderer/components/layouts/Handoff.js +26 -10
- package/dist/screenplay/RemotionRenderer/components/layouts/SimpleFrame.js +41 -21
- 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/development.js +786 -1737
- 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/lib/layouts/HandoffLayout.js +3 -2
- package/dist/screenplay/RemotionRenderer/main/lib/layouts/SimpleFrameLayout.js +4 -3
- package/dist/screenplay/RemotionRenderer/main/screenplaySchema.js +51 -51
- package/dist/screenplay/RemotionRenderer/registeredComponents.js +2 -2
- package/dist/screenplay/RemotionRenderer/theme/themes/default/HandoffNametag.js +20 -6
- package/dist/screenplay/RemotionRenderer/tracks/LayoutVideoTrack.js +20 -20
- package/package.json +47 -47
|
@@ -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] : {};
|
|
@@ -27,7 +27,7 @@ export var HandoffLayout = /*#__PURE__*/function (_Layout) {
|
|
|
27
27
|
return _createClass(HandoffLayout, [{
|
|
28
28
|
key: "getVideoProps",
|
|
29
29
|
value: function getVideoProps(props) {
|
|
30
|
-
var _props$data$sourceVid, _props$data, _props$data2, _props$data3, _props$data4, _props$data5, _props$data6, _props$data6$firstNoB, _props$data7, _props$data7$firstNoB, _props$data8, _props$data9, _props$data10, _props$data11, _props$data11$secondN, _props$data12, _props$data12$secondN, _props$data$sourceVid2, _props$data$sourceVid3, _props$data13;
|
|
30
|
+
var _props$data$sourceVid, _props$data, _props$data2, _props$data3, _props$data4, _props$data5, _props$data6, _props$data6$firstNoB, _props$data7, _props$data7$firstNoB, _props$data8, _props$data9, _props$data10, _props$data11, _props$data11$secondN, _props$data12, _props$data12$secondN, _props$data$sourceVid2, _props$data$sourceVid3, _props$data13, _props$data14;
|
|
31
31
|
var sourceVideoOrientation = getVideoOrientation((_props$data$sourceVid = props.data.sourceVideo) === null || _props$data$sourceVid === void 0 ? void 0 : _props$data$sourceVid.aspectRatio);
|
|
32
32
|
this.props = {
|
|
33
33
|
startFirstVideoFrom: toFrames(this.fps * (((_props$data = props.data) === null || _props$data === void 0 ? void 0 : _props$data.startFirstVideoFrom) + (((_props$data2 = props.data) === null || _props$data2 === void 0 ? void 0 : _props$data2.trimLeft) || 0)), true) || 0,
|
|
@@ -43,8 +43,9 @@ export var HandoffLayout = /*#__PURE__*/function (_Layout) {
|
|
|
43
43
|
videoUrl: (_props$data$sourceVid2 = props.data.sourceVideo) === null || _props$data$sourceVid2 === void 0 ? void 0 : _props$data$sourceVid2.videoUrl,
|
|
44
44
|
sourceVideoOrientation: sourceVideoOrientation,
|
|
45
45
|
videoZoom: ((_props$data$sourceVid3 = props.data.sourceVideo) === null || _props$data$sourceVid3 === void 0 ? void 0 : _props$data$sourceVid3.zoom) || 1,
|
|
46
|
+
useSquareInLandscapeFirstVideo: ((_props$data13 = props.data) === null || _props$data13 === void 0 ? void 0 : _props$data13.useSquareInLandscapeFirstVideo) || false,
|
|
46
47
|
text: props.data.text,
|
|
47
|
-
handoffOverlapSeconds: ((_props$
|
|
48
|
+
handoffOverlapSeconds: ((_props$data14 = props.data) === null || _props$data14 === void 0 ? void 0 : _props$data14.handoffOverlapSeconds) || 0
|
|
48
49
|
};
|
|
49
50
|
}
|
|
50
51
|
}]);
|
|
@@ -26,7 +26,7 @@ export var SimpleFrameLayout = /*#__PURE__*/function (_Layout) {
|
|
|
26
26
|
return _createClass(SimpleFrameLayout, [{
|
|
27
27
|
key: "getVideoProps",
|
|
28
28
|
value: function getVideoProps(props) {
|
|
29
|
-
var _props$data$noBackgro, _props$data$noBackgro2, _props$data$sourceVid, _props$data$sourceVid2, _props$data, _props$data2, _props$data3;
|
|
29
|
+
var _props$data$noBackgro, _props$data$noBackgro2, _props$data$sourceVid, _props$data$sourceVid2, _props$data, _props$data2, _props$data3, _props$data4;
|
|
30
30
|
this.props = {
|
|
31
31
|
noBackgroundVideoEffects: props.data.noBackgroundVideoEffects,
|
|
32
32
|
noBackgroundVideoUrl: (_props$data$noBackgro = props.data.noBackgroundVideo) === null || _props$data$noBackgro === void 0 ? void 0 : _props$data$noBackgro.videoUrl,
|
|
@@ -34,8 +34,9 @@ export var SimpleFrameLayout = /*#__PURE__*/function (_Layout) {
|
|
|
34
34
|
videoUrl: (_props$data$sourceVid = props.data.sourceVideo) === null || _props$data$sourceVid === void 0 ? void 0 : _props$data$sourceVid.videoUrl,
|
|
35
35
|
videoZoom: ((_props$data$sourceVid2 = props.data.sourceVideo) === null || _props$data$sourceVid2 === void 0 ? void 0 : _props$data$sourceVid2.zoom) || 1,
|
|
36
36
|
disableTransitionSounds: (_props$data = props.data) === null || _props$data === void 0 ? void 0 : _props$data.disableTransitionSounds,
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
useSquareInLandscape: (props === null || props === void 0 ? void 0 : (_props$data2 = props.data) === null || _props$data2 === void 0 ? void 0 : _props$data2.useSquareInLandscape) || false,
|
|
38
|
+
brollUrl: (_props$data3 = props.data) === null || _props$data3 === void 0 ? void 0 : _props$data3.brollUrl,
|
|
39
|
+
sentenceText: (_props$data4 = props.data) === null || _props$data4 === void 0 ? void 0 : _props$data4.sentenceText,
|
|
39
40
|
theme: props === null || props === void 0 ? void 0 : props.theme
|
|
40
41
|
};
|
|
41
42
|
}
|
|
@@ -29,58 +29,58 @@ export var screenplaySchema = z.object({
|
|
|
29
29
|
}), z.object({
|
|
30
30
|
type: "segmentx"
|
|
31
31
|
})])),
|
|
32
|
-
/* z.object({
|
|
33
|
-
type: "segment",
|
|
34
|
-
segments: z.array(
|
|
35
|
-
z.object({
|
|
36
|
-
layout: z.any(),
|
|
37
|
-
effects: z.array(effectSchema),
|
|
38
|
-
})
|
|
39
|
-
),
|
|
32
|
+
/* z.object({
|
|
33
|
+
type: "segment",
|
|
34
|
+
segments: z.array(
|
|
35
|
+
z.object({
|
|
36
|
+
layout: z.any(),
|
|
37
|
+
effects: z.array(effectSchema),
|
|
38
|
+
})
|
|
39
|
+
),
|
|
40
40
|
})*/
|
|
41
|
-
/*z.object({
|
|
42
|
-
type: "effect",
|
|
43
|
-
segments: z.array(effectSchema),
|
|
44
|
-
}),
|
|
45
|
-
z.object({
|
|
46
|
-
type: z.enum(segmentTypes),
|
|
47
|
-
segments: z.array([
|
|
48
|
-
{
|
|
49
|
-
type: "caption",
|
|
50
|
-
segments: z.array(
|
|
51
|
-
z.object({
|
|
52
|
-
type: "caption_simple",
|
|
53
|
-
data: {
|
|
54
|
-
transcript_text: z.array(
|
|
55
|
-
z.object({
|
|
56
|
-
text: z.string(),
|
|
57
|
-
offset: z.number(),
|
|
58
|
-
duration: z.number(),
|
|
59
|
-
})
|
|
60
|
-
),
|
|
61
|
-
duration: z.number().optional(),
|
|
62
|
-
offset: z.number().optional(),
|
|
63
|
-
},
|
|
64
|
-
})
|
|
65
|
-
),
|
|
66
|
-
},
|
|
67
|
-
]),
|
|
68
|
-
}),
|
|
69
|
-
z.object({
|
|
70
|
-
type: "audio",
|
|
71
|
-
segments: z.array([
|
|
72
|
-
z.object({
|
|
73
|
-
type: z.string(),
|
|
74
|
-
data: {
|
|
75
|
-
sourceAudio: {
|
|
76
|
-
url: z.string().url(),
|
|
77
|
-
volume: z.number().min(0).max(1),
|
|
78
|
-
start: z.number(),
|
|
79
|
-
},
|
|
80
|
-
offset: z.number(),
|
|
81
|
-
},
|
|
82
|
-
}),
|
|
83
|
-
]),
|
|
41
|
+
/*z.object({
|
|
42
|
+
type: "effect",
|
|
43
|
+
segments: z.array(effectSchema),
|
|
44
|
+
}),
|
|
45
|
+
z.object({
|
|
46
|
+
type: z.enum(segmentTypes),
|
|
47
|
+
segments: z.array([
|
|
48
|
+
{
|
|
49
|
+
type: "caption",
|
|
50
|
+
segments: z.array(
|
|
51
|
+
z.object({
|
|
52
|
+
type: "caption_simple",
|
|
53
|
+
data: {
|
|
54
|
+
transcript_text: z.array(
|
|
55
|
+
z.object({
|
|
56
|
+
text: z.string(),
|
|
57
|
+
offset: z.number(),
|
|
58
|
+
duration: z.number(),
|
|
59
|
+
})
|
|
60
|
+
),
|
|
61
|
+
duration: z.number().optional(),
|
|
62
|
+
offset: z.number().optional(),
|
|
63
|
+
},
|
|
64
|
+
})
|
|
65
|
+
),
|
|
66
|
+
},
|
|
67
|
+
]),
|
|
68
|
+
}),
|
|
69
|
+
z.object({
|
|
70
|
+
type: "audio",
|
|
71
|
+
segments: z.array([
|
|
72
|
+
z.object({
|
|
73
|
+
type: z.string(),
|
|
74
|
+
data: {
|
|
75
|
+
sourceAudio: {
|
|
76
|
+
url: z.string().url(),
|
|
77
|
+
volume: z.number().min(0).max(1),
|
|
78
|
+
start: z.number(),
|
|
79
|
+
},
|
|
80
|
+
offset: z.number(),
|
|
81
|
+
},
|
|
82
|
+
}),
|
|
83
|
+
]),
|
|
84
84
|
}),*/
|
|
85
85
|
output: z.object({
|
|
86
86
|
orientation: z["enum"](orientations),
|
|
@@ -39,8 +39,8 @@ import { DynamicTriangle } from "./components/layouts/DynamicTriangle";
|
|
|
39
39
|
import { KeywordStudioBackdrop } from "./components/layouts/KeywordStudioBackdrop";
|
|
40
40
|
import { MotionStillGreenScreenV2 } from "./components/layouts/MotionStillGreenScreenV2";
|
|
41
41
|
|
|
42
|
-
/** Update this so that Remotion knows which component to render when it is passed via screenplay. Ex. "title" will have rendered "Title" component
|
|
43
|
-
* Here we are mapping directly types and component names. Types are snake_case and components PascalCase.
|
|
42
|
+
/** Update this so that Remotion knows which component to render when it is passed via screenplay. Ex. "title" will have rendered "Title" component
|
|
43
|
+
* Here we are mapping directly types and component names. Types are snake_case and components PascalCase.
|
|
44
44
|
* */
|
|
45
45
|
export var RegisteredComponents = {
|
|
46
46
|
// Layouts
|
|
@@ -156,17 +156,23 @@ var HighlightLines = function HighlightLines(_ref3) {
|
|
|
156
156
|
}));
|
|
157
157
|
};
|
|
158
158
|
export var HandoffNametag = function HandoffNametag(_ref4) {
|
|
159
|
+
var _compositionProps$out, _window, _window$screenplayPro, _window$screenplayPro2;
|
|
159
160
|
var pictureUrl = _ref4.pictureUrl,
|
|
160
161
|
fullName = _ref4.fullName,
|
|
161
162
|
title = _ref4.title,
|
|
162
163
|
alignment = _ref4.alignment,
|
|
163
164
|
duration = _ref4.duration,
|
|
164
165
|
_ref4$handoffNametagV = _ref4.handoffNametagVariant,
|
|
165
|
-
handoffNametagVariant = _ref4$handoffNametagV === void 0 ? HANDOFF_NAMETAG_VARIANTS.BOXED : _ref4$handoffNametagV
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
166
|
+
handoffNametagVariant = _ref4$handoffNametagV === void 0 ? HANDOFF_NAMETAG_VARIANTS.BOXED : _ref4$handoffNametagV,
|
|
167
|
+
_ref4$useSquareInLand = _ref4.useSquareInLandscapeFirstVideo,
|
|
168
|
+
useSquareInLandscapeFirstVideo = _ref4$useSquareInLand === void 0 ? false : _ref4$useSquareInLand;
|
|
169
|
+
var videoConfig = useVideoConfig();
|
|
170
|
+
var fps = videoConfig.fps,
|
|
171
|
+
width = videoConfig.width,
|
|
172
|
+
height = videoConfig.height,
|
|
173
|
+
_videoConfig$props = videoConfig.props,
|
|
174
|
+
compositionProps = _videoConfig$props === void 0 ? {} : _videoConfig$props;
|
|
175
|
+
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);
|
|
170
176
|
var _useTheme = useTheme(),
|
|
171
177
|
primaryColor = _useTheme.primaryColor,
|
|
172
178
|
primaryContrast = _useTheme.primaryContrast,
|
|
@@ -257,6 +263,14 @@ export var HandoffNametag = function HandoffNametag(_ref4) {
|
|
|
257
263
|
var initialsFontSize = Math.max(Math.round(mediaBaseSize * 0.45), 22);
|
|
258
264
|
var contentAlignItems = lineJustifyContent[alignment] === "flex-end" ? "flex-end" : "flex-start";
|
|
259
265
|
var staticContainerTop = containerTop === null || containerTop === void 0 ? void 0 : containerTop[alignment];
|
|
266
|
+
var baseContainerLeft = containerLeft === null || containerLeft === void 0 ? void 0 : containerLeft[alignment];
|
|
267
|
+
var shouldShiftFirstLeftInLandscape = Boolean(useSquareInLandscapeFirstVideo) && outputOrientation === "landscape" && alignment === "first-left" && typeof baseContainerLeft === "number";
|
|
268
|
+
var centerAlignedLeft = (width - textContainerWidth) / 2;
|
|
269
|
+
var initialLeftOffset = 60;
|
|
270
|
+
var initialStartLeft = centerAlignedLeft - initialLeftOffset;
|
|
271
|
+
var holdCenteredFrames = 3.2 * fps;
|
|
272
|
+
var slideLeftFrames = 0.5 * fps;
|
|
273
|
+
var containerLeftPosition = shouldShiftFirstLeftInLandscape ? interpolate(frame, [0, holdCenteredFrames, holdCenteredFrames + slideLeftFrames], [initialStartLeft, initialStartLeft, baseContainerLeft], DEFAULT_TIME_INTERPOLATE_OPTIONS) : baseContainerLeft;
|
|
260
274
|
var _getTypewriterState = getTypewriterState({
|
|
261
275
|
frame: frame,
|
|
262
276
|
fps: fps,
|
|
@@ -292,7 +306,7 @@ export var HandoffNametag = function HandoffNametag(_ref4) {
|
|
|
292
306
|
style: {
|
|
293
307
|
position: "absolute",
|
|
294
308
|
top: staticContainerTop,
|
|
295
|
-
left:
|
|
309
|
+
left: containerLeftPosition,
|
|
296
310
|
right: containerRight[alignment],
|
|
297
311
|
bottom: typeof staticContainerTop === "number" ? undefined : containerBottom,
|
|
298
312
|
borderRadius: "10px",
|
|
@@ -23,26 +23,26 @@ var transitionThemes = {
|
|
|
23
23
|
}
|
|
24
24
|
};
|
|
25
25
|
|
|
26
|
-
/*
|
|
27
|
-
const UseMotionBlur = ({ children, componentName }) => {
|
|
28
|
-
const {
|
|
29
|
-
props: {
|
|
30
|
-
output: { theme = "default" } = {
|
|
31
|
-
theme: window.screenplayProps.output.theme,
|
|
32
|
-
},
|
|
33
|
-
},
|
|
34
|
-
} = useVideoConfig();
|
|
35
|
-
|
|
36
|
-
if (motionBlurComponents[componentName] && motionBlurThemes[theme]) {
|
|
37
|
-
return (
|
|
38
|
-
<CameraMotionBlur shutterAngle={180} samples={5}>
|
|
39
|
-
{children}
|
|
40
|
-
</CameraMotionBlur>
|
|
41
|
-
);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
return children;
|
|
45
|
-
};
|
|
26
|
+
/*
|
|
27
|
+
const UseMotionBlur = ({ children, componentName }) => {
|
|
28
|
+
const {
|
|
29
|
+
props: {
|
|
30
|
+
output: { theme = "default" } = {
|
|
31
|
+
theme: window.screenplayProps.output.theme,
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
} = useVideoConfig();
|
|
35
|
+
|
|
36
|
+
if (motionBlurComponents[componentName] && motionBlurThemes[theme]) {
|
|
37
|
+
return (
|
|
38
|
+
<CameraMotionBlur shutterAngle={180} samples={5}>
|
|
39
|
+
{children}
|
|
40
|
+
</CameraMotionBlur>
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
return children;
|
|
45
|
+
};
|
|
46
46
|
*/
|
|
47
47
|
|
|
48
48
|
var NestedEffects = function NestedEffects(_ref) {
|
package/package.json
CHANGED
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@zync/zync-screnplay-player",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"files": [
|
|
5
|
-
"dist"
|
|
6
|
-
],
|
|
7
|
-
"main": "dist/bundle.js",
|
|
8
|
-
"module": "dist/index.js",
|
|
9
|
-
"exports": {
|
|
10
|
-
"import": "./dist/index.js",
|
|
11
|
-
"require": "./dist/bundle.js"
|
|
12
|
-
},
|
|
13
|
-
"scripts": {
|
|
14
|
-
"clean": "rimraf dist",
|
|
15
|
-
"build": "npm run clean && babel src --out-dir dist --extensions \".ts,.tsx,.js,.jsx\" --copy-files && webpack",
|
|
16
|
-
"publish-lib": "npm run build && npm publish --access public"
|
|
17
|
-
},
|
|
18
|
-
"dependencies": {
|
|
19
|
-
"@remotion/google-fonts": "4.0.208",
|
|
20
|
-
"@remotion/lottie": "4.0.208",
|
|
21
|
-
"@remotion/motion-blur": "4.0.208",
|
|
22
|
-
"@remotion/player": "4.0.208",
|
|
23
|
-
"@remotion/transitions": "4.0.208",
|
|
24
|
-
"remotion": "4.0.208"
|
|
25
|
-
},
|
|
26
|
-
"peerDependencies": {
|
|
27
|
-
"react": "16.14.0",
|
|
28
|
-
"react-dom": "16.14.0"
|
|
29
|
-
},
|
|
30
|
-
"devDependencies": {
|
|
31
|
-
"@babel/cli": "7.21.5",
|
|
32
|
-
"@babel/core": "7.21.5",
|
|
33
|
-
"@babel/preset-env": "7.21.5",
|
|
34
|
-
"@babel/preset-react": "7.18.6",
|
|
35
|
-
"@babel/preset-typescript": "^7.26.0",
|
|
36
|
-
"babel-loader": "^9.2.1",
|
|
37
|
-
"terser-webpack-plugin": "^5.3.11",
|
|
38
|
-
"ts-loader": "^9.5.2",
|
|
39
|
-
"typescript": "^5.7.3",
|
|
40
|
-
"webpack": "^5.97.1",
|
|
41
|
-
"webpack-cli": "^6.0.1",
|
|
42
|
-
"rimraf": "^5.0.7"
|
|
43
|
-
},
|
|
44
|
-
"browser": {
|
|
45
|
-
"fs": false
|
|
46
|
-
}
|
|
47
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@zync/zync-screnplay-player",
|
|
3
|
+
"version": "0.1.204",
|
|
4
|
+
"files": [
|
|
5
|
+
"dist"
|
|
6
|
+
],
|
|
7
|
+
"main": "dist/bundle.js",
|
|
8
|
+
"module": "dist/index.js",
|
|
9
|
+
"exports": {
|
|
10
|
+
"import": "./dist/index.js",
|
|
11
|
+
"require": "./dist/bundle.js"
|
|
12
|
+
},
|
|
13
|
+
"scripts": {
|
|
14
|
+
"clean": "rimraf dist",
|
|
15
|
+
"build": "npm run clean && babel src --out-dir dist --extensions \".ts,.tsx,.js,.jsx\" --copy-files && webpack",
|
|
16
|
+
"publish-lib": "npm run build && npm publish --access public"
|
|
17
|
+
},
|
|
18
|
+
"dependencies": {
|
|
19
|
+
"@remotion/google-fonts": "4.0.208",
|
|
20
|
+
"@remotion/lottie": "4.0.208",
|
|
21
|
+
"@remotion/motion-blur": "4.0.208",
|
|
22
|
+
"@remotion/player": "4.0.208",
|
|
23
|
+
"@remotion/transitions": "4.0.208",
|
|
24
|
+
"remotion": "4.0.208"
|
|
25
|
+
},
|
|
26
|
+
"peerDependencies": {
|
|
27
|
+
"react": "16.14.0",
|
|
28
|
+
"react-dom": "16.14.0"
|
|
29
|
+
},
|
|
30
|
+
"devDependencies": {
|
|
31
|
+
"@babel/cli": "7.21.5",
|
|
32
|
+
"@babel/core": "7.21.5",
|
|
33
|
+
"@babel/preset-env": "7.21.5",
|
|
34
|
+
"@babel/preset-react": "7.18.6",
|
|
35
|
+
"@babel/preset-typescript": "^7.26.0",
|
|
36
|
+
"babel-loader": "^9.2.1",
|
|
37
|
+
"terser-webpack-plugin": "^5.3.11",
|
|
38
|
+
"ts-loader": "^9.5.2",
|
|
39
|
+
"typescript": "^5.7.3",
|
|
40
|
+
"webpack": "^5.97.1",
|
|
41
|
+
"webpack-cli": "^6.0.1",
|
|
42
|
+
"rimraf": "^5.0.7"
|
|
43
|
+
},
|
|
44
|
+
"browser": {
|
|
45
|
+
"fs": false
|
|
46
|
+
}
|
|
47
|
+
}
|