@zync/zync-screnplay-player 0.1.227 → 0.1.229

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.
@@ -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] : {};
@@ -12,6 +12,9 @@ function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? O
12
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
13
  function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
14
14
  import { Layout } from "./DefaultLayout.js";
15
+ var coerceBool = function coerceBool(value) {
16
+ return value === true || value === "true" || value === 1 || value === "1";
17
+ };
15
18
  export var HookVideoLayout = /*#__PURE__*/function (_Layout) {
16
19
  function HookVideoLayout(props) {
17
20
  var _this;
@@ -24,7 +27,7 @@ export var HookVideoLayout = /*#__PURE__*/function (_Layout) {
24
27
  return _createClass(HookVideoLayout, [{
25
28
  key: "getVideoProps",
26
29
  value: function getVideoProps(props) {
27
- var _props$data$sourceVid, _props$data$sourceVid2, _props$data, _props$data2, _props$data3, _props$data4, _props$data$hookDurat, _props$data5, _props$data6, _props$data7, _props$data8;
30
+ var _props$data$sourceVid, _props$data$sourceVid2, _props$data, _props$data2, _props$data3, _props$data4, _props$data$hookDurat, _props$data5, _props$data6, _props$data7, _props$data8, _props$data9, _props$data10, _props$data11;
28
31
  this.props = {
29
32
  videoUrl: (_props$data$sourceVid = props.data.sourceVideo) === null || _props$data$sourceVid === void 0 ? void 0 : _props$data$sourceVid.videoUrl,
30
33
  videoZoom: ((_props$data$sourceVid2 = props.data.sourceVideo) === null || _props$data$sourceVid2 === void 0 ? void 0 : _props$data$sourceVid2.zoom) || 1,
@@ -35,7 +38,10 @@ export var HookVideoLayout = /*#__PURE__*/function (_Layout) {
35
38
  hookDurationSeconds: (_props$data$hookDurat = (_props$data5 = props.data) === null || _props$data5 === void 0 ? void 0 : _props$data5.hookDurationSeconds) !== null && _props$data$hookDurat !== void 0 ? _props$data$hookDurat : 1.6,
36
39
  hookAccentText: (_props$data6 = props.data) === null || _props$data6 === void 0 ? void 0 : _props$data6.hookAccentText,
37
40
  hookSubtext: (_props$data7 = props.data) === null || _props$data7 === void 0 ? void 0 : _props$data7.hookSubtext,
38
- disableHookSounds: ((_props$data8 = props.data) === null || _props$data8 === void 0 ? void 0 : _props$data8.disableHookSounds) || false
41
+ disableHookSounds: ((_props$data8 = props.data) === null || _props$data8 === void 0 ? void 0 : _props$data8.disableHookSounds) || false,
42
+ disableHookExitEffect: coerceBool((_props$data9 = props.data) === null || _props$data9 === void 0 ? void 0 : _props$data9.disableHookExitEffect),
43
+ hookThreeGlitchEffectEnabled: coerceBool((_props$data10 = props.data) === null || _props$data10 === void 0 ? void 0 : _props$data10.hookThreeGlitchEffectEnabled),
44
+ disableHookThreeGlitchEffect: coerceBool((_props$data11 = props.data) === null || _props$data11 === void 0 ? void 0 : _props$data11.disableHookThreeGlitchEffect)
39
45
  };
40
46
  }
41
47
  }]);
@@ -13,7 +13,6 @@ function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new T
13
13
  function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
14
14
  import { Layout } from "./DefaultLayout.js";
15
15
  import { cleanFacemetadata } from "../../../helpers/cleanFacemetadata";
16
- import { SimpleFrameSentence } from "../../../components/layouts/SimpleFrameSentence";
17
16
  export var SimpleFrameLayout = /*#__PURE__*/function (_Layout) {
18
17
  function SimpleFrameLayout(props) {
19
18
  var _this;
@@ -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),
@@ -46,8 +46,8 @@ import { KeywordStudioBackdrop } from "./components/layouts/KeywordStudioBackdro
46
46
  import { MotionStillGreenScreenV2 } from "./components/layouts/MotionStillGreenScreenV2";
47
47
  import { HookVideo } from "./components/layouts/HookVideo";
48
48
 
49
- /** Update this so that Remotion knows which component to render when it is passed via screenplay. Ex. "title" will have rendered "Title" component
50
- * Here we are mapping directly types and component names. Types are snake_case and components PascalCase.
49
+ /** Update this so that Remotion knows which component to render when it is passed via screenplay. Ex. "title" will have rendered "Title" component
50
+ * Here we are mapping directly types and component names. Types are snake_case and components PascalCase.
51
51
  * */
52
52
  export var RegisteredComponents = {
53
53
  // Layouts