@zync/zync-screnplay-player 0.1.205 → 0.1.207

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.
Files changed (32) hide show
  1. package/dist/bundle.js +1 -1
  2. package/dist/screenplay/RemotionRenderer/RemotionRenderer.js +18 -14
  3. package/dist/screenplay/RemotionRenderer/components/LottieAnimationGlobal.js +21 -21
  4. package/dist/screenplay/RemotionRenderer/components/layouts/DynamicTriangle.js +36 -6
  5. package/dist/screenplay/RemotionRenderer/components/layouts/Handoff.js +20 -7
  6. package/dist/screenplay/RemotionRenderer/components/layouts/IntroVideo.js +45 -8
  7. package/dist/screenplay/RemotionRenderer/components/layouts/Keyword.js +42 -9
  8. package/dist/screenplay/RemotionRenderer/components/layouts/KeywordStudioBackdrop.js +47 -10
  9. package/dist/screenplay/RemotionRenderer/components/layouts/MotionStill.js +42 -9
  10. package/dist/screenplay/RemotionRenderer/components/layouts/MotionStillStudioBackdrop.js +46 -9
  11. package/dist/screenplay/RemotionRenderer/components/layouts/SimpleFrame.js +21 -12
  12. package/dist/screenplay/RemotionRenderer/components/layouts/TextWithVideo.js +41 -8
  13. package/dist/screenplay/RemotionRenderer/components/utils/FaceCenteredVideo.js +50 -50
  14. package/dist/screenplay/RemotionRenderer/components/utils/PausableImg.js +4 -4
  15. package/dist/screenplay/RemotionRenderer/components/utils/README.md +80 -80
  16. package/dist/screenplay/RemotionRenderer/components/utils/StretchTextDemo.js +3 -3
  17. package/dist/screenplay/RemotionRenderer/helpers/convertToSeconds.js +8 -8
  18. package/dist/screenplay/RemotionRenderer/helpers/faceBasedVideoStyles.js +4 -4
  19. package/dist/screenplay/RemotionRenderer/helpers/faceCenteredVideoTransforms.js +46 -46
  20. package/dist/screenplay/RemotionRenderer/hooks/useOrientationBased.js +7 -3
  21. package/dist/screenplay/RemotionRenderer/main/lib/layouts/DefaultLayout.js +2 -1
  22. package/dist/screenplay/RemotionRenderer/main/lib/layouts/DynamicTriangleLayout.js +3 -2
  23. package/dist/screenplay/RemotionRenderer/main/lib/layouts/HandoffLayout.js +3 -2
  24. package/dist/screenplay/RemotionRenderer/main/lib/layouts/IntroVideoLayout.js +3 -1
  25. package/dist/screenplay/RemotionRenderer/main/lib/layouts/KeywordLayout.js +3 -2
  26. package/dist/screenplay/RemotionRenderer/main/lib/layouts/MotionStillLayout.js +3 -2
  27. package/dist/screenplay/RemotionRenderer/main/lib/layouts/TextWithVideoLayout.js +3 -2
  28. package/dist/screenplay/RemotionRenderer/main/screenplaySchema.js +51 -51
  29. package/dist/screenplay/RemotionRenderer/registeredComponents.js +2 -2
  30. package/dist/screenplay/RemotionRenderer/theme/themes/default/HandoffNametag.js +9 -2
  31. package/dist/screenplay/RemotionRenderer/tracks/LayoutVideoTrack.js +20 -20
  32. package/package.json +47 -47
@@ -149,7 +149,8 @@ var RotatingWordsContainer = /*#__PURE__*/React.memo(function (_ref4) {
149
149
  words = _ref4$words === void 0 ? [] : _ref4$words,
150
150
  cloudMargins = _ref4.cloudMargins,
151
151
  cloudMinDistancePct = _ref4.cloudMinDistancePct,
152
- cloudSpreadDurationSeconds = _ref4.cloudSpreadDurationSeconds;
152
+ cloudSpreadDurationSeconds = _ref4.cloudSpreadDurationSeconds,
153
+ orientationOverride = _ref4.orientationOverride;
153
154
  var frame = useCurrentFrame();
154
155
  var _useVideoConfig2 = useVideoConfig(),
155
156
  fps = _useVideoConfig2.fps,
@@ -159,7 +160,7 @@ var RotatingWordsContainer = /*#__PURE__*/React.memo(function (_ref4) {
159
160
  portrait: {},
160
161
  landscape: {},
161
162
  square: {}
162
- }),
163
+ }, orientationOverride),
163
164
  orientation = _useOrientationBased.orientation;
164
165
  var isWide = orientation === "landscape";
165
166
 
@@ -448,11 +449,14 @@ var BackdropFrame = function BackdropFrame(_ref5) {
448
449
  logoUrl = _ref5.logoUrl,
449
450
  logoLeft = _ref5.logoLeft,
450
451
  logoTop = _ref5.logoTop,
452
+ _ref5$logoPosition = _ref5.logoPosition,
453
+ logoPosition = _ref5$logoPosition === void 0 ? "fixed" : _ref5$logoPosition,
451
454
  frameColor = _ref5.frameColor,
452
455
  words = _ref5.words,
453
456
  cloudMargins = _ref5.cloudMargins,
454
457
  cloudMinDistancePct = _ref5.cloudMinDistancePct,
455
458
  cloudSpreadDurationSeconds = _ref5.cloudSpreadDurationSeconds,
459
+ orientationOverride = _ref5.orientationOverride,
456
460
  _ref5$containerInset = _ref5.containerInset,
457
461
  containerInset = _ref5$containerInset === void 0 ? {
458
462
  top: 0.1,
@@ -547,7 +551,8 @@ var BackdropFrame = function BackdropFrame(_ref5) {
547
551
  words: words,
548
552
  cloudMargins: cloudMargins,
549
553
  cloudMinDistancePct: cloudMinDistancePct,
550
- cloudSpreadDurationSeconds: cloudSpreadDurationSeconds
554
+ cloudSpreadDurationSeconds: cloudSpreadDurationSeconds,
555
+ orientationOverride: orientationOverride
551
556
  }), /*#__PURE__*/React.createElement("div", {
552
557
  style: {
553
558
  position: "absolute",
@@ -595,7 +600,7 @@ var BackdropFrame = function BackdropFrame(_ref5) {
595
600
  }
596
601
  }, children), logoUrl ? /*#__PURE__*/React.createElement("div", {
597
602
  style: {
598
- position: "fixed",
603
+ position: logoPosition,
599
604
  left: logoLeft,
600
605
  top: logoTop,
601
606
  padding: 20,
@@ -612,6 +617,7 @@ var BackdropFrame = function BackdropFrame(_ref5) {
612
617
  })) : null);
613
618
  };
614
619
  var KeywordStudioBackdrop = function KeywordStudioBackdrop(_ref6) {
620
+ var _compositionProps$out, _window, _window$screenplayPro, _window$screenplayPro2;
615
621
  var videoUrl = _ref6.videoUrl,
616
622
  startVideoFrom = _ref6.startVideoFrom,
617
623
  _ref6$words = _ref6.words,
@@ -629,11 +635,22 @@ var KeywordStudioBackdrop = function KeywordStudioBackdrop(_ref6) {
629
635
  noBackgroundVideoEffects = _ref6.noBackgroundVideoEffects,
630
636
  cloudMargins = _ref6.cloudMargins,
631
637
  cloudMinDistancePct = _ref6.cloudMinDistancePct,
632
- cloudSpreadDurationSeconds = _ref6.cloudSpreadDurationSeconds;
638
+ cloudSpreadDurationSeconds = _ref6.cloudSpreadDurationSeconds,
639
+ _ref6$useSquareInLand = _ref6.useSquareInLandscape,
640
+ useSquareInLandscape = _ref6$useSquareInLand === void 0 ? false : _ref6$useSquareInLand;
633
641
  var _useVideoConfig3 = useVideoConfig(),
634
- width = _useVideoConfig3.width,
635
- height = _useVideoConfig3.height,
636
- fps = _useVideoConfig3.fps;
642
+ outputWidth = _useVideoConfig3.width,
643
+ outputHeight = _useVideoConfig3.height,
644
+ fps = _useVideoConfig3.fps,
645
+ _useVideoConfig3$prop = _useVideoConfig3.props,
646
+ compositionProps = _useVideoConfig3$prop === void 0 ? {} : _useVideoConfig3$prop;
647
+ 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);
648
+ var shouldUseSquareInLandscape = Boolean(useSquareInLandscape) && outputOrientation === "landscape";
649
+ var squareSize = 1080;
650
+ var width = shouldUseSquareInLandscape ? squareSize : outputWidth;
651
+ var height = shouldUseSquareInLandscape ? squareSize : outputHeight;
652
+ var renderOffsetX = shouldUseSquareInLandscape ? (outputWidth - squareSize) / 2 : 0;
653
+ var orientationOverride = shouldUseSquareInLandscape ? "square" : undefined;
637
654
  var frame = useCurrentFrame();
638
655
  var _useVirtualBackground = useVirtualBackground(),
639
656
  isVirtual = _useVirtualBackground.isVirtual,
@@ -652,7 +669,7 @@ var KeywordStudioBackdrop = function KeywordStudioBackdrop(_ref6) {
652
669
  logoTop: CHROME_PADDING * 2,
653
670
  logoLeft: CHROME_PADDING * 2
654
671
  }
655
- }),
672
+ }, orientationOverride),
656
673
  logoTop = _useOrientationBased2.logoTop,
657
674
  logoLeft = _useOrientationBased2.logoLeft;
658
675
 
@@ -686,7 +703,7 @@ var KeywordStudioBackdrop = function KeywordStudioBackdrop(_ref6) {
686
703
  } else {
687
704
  backdropProgress = 1;
688
705
  }
689
- return /*#__PURE__*/React.createElement(React.Fragment, null, !disableTransitionSounds && /*#__PURE__*/React.createElement(Audio, {
706
+ var content = /*#__PURE__*/React.createElement(React.Fragment, null, !disableTransitionSounds && /*#__PURE__*/React.createElement(Audio, {
690
707
  src: "https://cdn.zync.ai/assets/static/swoosh.mp3",
691
708
  volume: 0.25
692
709
  }), /*#__PURE__*/React.createElement(BackdropFrame, {
@@ -701,14 +718,34 @@ var KeywordStudioBackdrop = function KeywordStudioBackdrop(_ref6) {
701
718
  logoUrl: logoUrl,
702
719
  logoLeft: logoLeft,
703
720
  logoTop: logoTop,
721
+ logoPosition: shouldUseSquareInLandscape ? "absolute" : "fixed",
704
722
  frameColor: frameColor,
705
723
  words: words,
706
724
  cloudMargins: cloudMargins,
707
725
  cloudMinDistancePct: cloudMinDistancePct,
708
726
  cloudSpreadDurationSeconds: cloudSpreadDurationSeconds,
727
+ orientationOverride: orientationOverride,
709
728
  backdropProgress: backdropProgress,
710
729
  showVirtual: showVirtual,
711
730
  virtualBgUrl: virtualBgUrl
712
731
  }, children));
732
+ if (!shouldUseSquareInLandscape) {
733
+ return content;
734
+ }
735
+ return /*#__PURE__*/React.createElement(AbsoluteFill, {
736
+ style: {
737
+ width: outputWidth,
738
+ height: outputHeight,
739
+ backgroundColor: "black"
740
+ }
741
+ }, /*#__PURE__*/React.createElement(AbsoluteFill, {
742
+ style: {
743
+ width: width,
744
+ height: height,
745
+ left: renderOffsetX,
746
+ top: 0,
747
+ overflow: "hidden"
748
+ }
749
+ }, content));
713
750
  };
714
751
  export { KeywordStudioBackdrop };
@@ -28,10 +28,12 @@ var Logo = function Logo(_ref) {
28
28
  var logoUrl = _ref.logoUrl,
29
29
  top = _ref.top,
30
30
  left = _ref.left,
31
- right = _ref.right;
31
+ right = _ref.right,
32
+ _ref$position = _ref.position,
33
+ position = _ref$position === void 0 ? "fixed" : _ref$position;
32
34
  return logoUrl ? /*#__PURE__*/React.createElement("div", {
33
35
  style: {
34
- position: "fixed",
36
+ position: position,
35
37
  zIndex: 1,
36
38
  top: top,
37
39
  left: left,
@@ -80,6 +82,7 @@ export var PanningImage = function PanningImage(_ref2) {
80
82
  }));
81
83
  };
82
84
  var MotionStillComponent = function MotionStillComponent(_ref3) {
85
+ var _compositionProps$out, _window, _window$screenplayPro, _window$screenplayPro2;
83
86
  var startVideoFrom = _ref3.startVideoFrom,
84
87
  videoUrl = _ref3.videoUrl,
85
88
  logoUrl = _ref3.logoUrl,
@@ -94,11 +97,22 @@ var MotionStillComponent = function MotionStillComponent(_ref3) {
94
97
  faceMetadata = _ref3.faceMetadata,
95
98
  muted = _ref3.muted,
96
99
  noBackgroundVideoEffects = _ref3.noBackgroundVideoEffects,
97
- noBackgroundVideoUrl = _ref3.noBackgroundVideoUrl;
100
+ noBackgroundVideoUrl = _ref3.noBackgroundVideoUrl,
101
+ _ref3$useSquareInLand = _ref3.useSquareInLandscape,
102
+ useSquareInLandscape = _ref3$useSquareInLand === void 0 ? false : _ref3$useSquareInLand;
98
103
  var _useVideoConfig = useVideoConfig(),
99
- width = _useVideoConfig.width,
100
- height = _useVideoConfig.height,
101
- fps = _useVideoConfig.fps;
104
+ outputWidth = _useVideoConfig.width,
105
+ outputHeight = _useVideoConfig.height,
106
+ fps = _useVideoConfig.fps,
107
+ _useVideoConfig$props = _useVideoConfig.props,
108
+ compositionProps = _useVideoConfig$props === void 0 ? {} : _useVideoConfig$props;
109
+ 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);
110
+ var shouldUseSquareInLandscape = Boolean(useSquareInLandscape) && outputOrientation === "landscape";
111
+ var squareSize = 1080;
112
+ var width = shouldUseSquareInLandscape ? squareSize : outputWidth;
113
+ var height = shouldUseSquareInLandscape ? squareSize : outputHeight;
114
+ var renderOffsetX = shouldUseSquareInLandscape ? (outputWidth - squareSize) / 2 : 0;
115
+ var orientationOverride = shouldUseSquareInLandscape ? "square" : undefined;
102
116
  var frame = useCurrentFrame();
103
117
  var _useVirtualBackground = useVirtualBackground(),
104
118
  isVirtual = _useVirtualBackground.isVirtual,
@@ -144,7 +158,7 @@ var MotionStillComponent = function MotionStillComponent(_ref3) {
144
158
  logoRight: stylesByVariant[variant].logoRight,
145
159
  flowDirection: "row-reverse"
146
160
  }
147
- }),
161
+ }, orientationOverride),
148
162
  imageContainerOutputRange = _useOrientationBased.imageContainerOutputRange,
149
163
  targetVideoWidth = _useOrientationBased.targetVideoWidth,
150
164
  targetVideoHeight = _useOrientationBased.targetVideoHeight,
@@ -180,7 +194,7 @@ var MotionStillComponent = function MotionStillComponent(_ref3) {
180
194
  var imageContainerTranslate = imageContainerOutputRange[0] + (imageContainerOutputRange[1] - imageContainerOutputRange[0]) * easedProgress;
181
195
  var videoWidth = width + (targetVideoWidth - width) * easedProgress;
182
196
  var videoHeight = height + (targetVideoHeight - height) * easedProgress;
183
- return /*#__PURE__*/React.createElement(AbsoluteFill, null, /*#__PURE__*/React.createElement(AbsoluteFill, {
197
+ var content = /*#__PURE__*/React.createElement(AbsoluteFill, null, /*#__PURE__*/React.createElement(AbsoluteFill, {
184
198
  style: {
185
199
  width: width,
186
200
  height: height,
@@ -220,7 +234,8 @@ var MotionStillComponent = function MotionStillComponent(_ref3) {
220
234
  logoUrl: logoUrl,
221
235
  top: logoTop,
222
236
  left: logoLeft,
223
- right: logoRight
237
+ right: logoRight,
238
+ position: shouldUseSquareInLandscape ? "absolute" : "fixed"
224
239
  }), /*#__PURE__*/React.createElement("div", {
225
240
  style: {
226
241
  display: "flex",
@@ -359,6 +374,24 @@ var MotionStillComponent = function MotionStillComponent(_ref3) {
359
374
  zIndex: 20
360
375
  }
361
376
  }, children));
377
+ if (!shouldUseSquareInLandscape) {
378
+ return content;
379
+ }
380
+ return /*#__PURE__*/React.createElement(AbsoluteFill, {
381
+ style: {
382
+ width: outputWidth,
383
+ height: outputHeight,
384
+ backgroundColor: "black"
385
+ }
386
+ }, /*#__PURE__*/React.createElement(AbsoluteFill, {
387
+ style: {
388
+ width: width,
389
+ height: height,
390
+ left: renderOffsetX,
391
+ top: 0,
392
+ overflow: "hidden"
393
+ }
394
+ }, content));
362
395
  };
363
396
  export var MotionStill = function MotionStill(props) {
364
397
  var _useTheme = useTheme(),
@@ -17,6 +17,8 @@ var Square = function Square(_ref) {
17
17
  logoUrl = _ref.logoUrl,
18
18
  logoLeft = _ref.logoLeft,
19
19
  logoTop = _ref.logoTop,
20
+ _ref$logoPosition = _ref.logoPosition,
21
+ logoPosition = _ref$logoPosition === void 0 ? "fixed" : _ref$logoPosition,
20
22
  frameColor = _ref.frameColor,
21
23
  startVideoFrom = _ref.startVideoFrom,
22
24
  noBackgroundVideoUrl = _ref.noBackgroundVideoUrl,
@@ -151,7 +153,7 @@ var Square = function Square(_ref) {
151
153
  }
152
154
  }, children), logoUrl ? /*#__PURE__*/React.createElement("div", {
153
155
  style: {
154
- position: "fixed",
156
+ position: logoPosition,
155
157
  left: logoLeft,
156
158
  top: logoTop,
157
159
  padding: 20,
@@ -176,6 +178,8 @@ var Portrait = function Portrait(_ref2) {
176
178
  logoUrl = _ref2.logoUrl,
177
179
  logoLeft = _ref2.logoLeft,
178
180
  logoTop = _ref2.logoTop,
181
+ _ref2$logoPosition = _ref2.logoPosition,
182
+ logoPosition = _ref2$logoPosition === void 0 ? "fixed" : _ref2$logoPosition,
179
183
  frameColor = _ref2.frameColor,
180
184
  startVideoFrom = _ref2.startVideoFrom,
181
185
  noBackgroundVideoUrl = _ref2.noBackgroundVideoUrl,
@@ -309,7 +313,7 @@ var Portrait = function Portrait(_ref2) {
309
313
  }
310
314
  }, children), logoUrl ? /*#__PURE__*/React.createElement("div", {
311
315
  style: {
312
- position: "fixed",
316
+ position: logoPosition,
313
317
  left: logoLeft,
314
318
  top: logoTop,
315
319
  padding: 20,
@@ -334,6 +338,8 @@ var Landscape = function Landscape(_ref3) {
334
338
  logoUrl = _ref3.logoUrl,
335
339
  logoLeft = _ref3.logoLeft,
336
340
  logoTop = _ref3.logoTop,
341
+ _ref3$logoPosition = _ref3.logoPosition,
342
+ logoPosition = _ref3$logoPosition === void 0 ? "fixed" : _ref3$logoPosition,
337
343
  frameColor = _ref3.frameColor,
338
344
  startVideoFrom = _ref3.startVideoFrom,
339
345
  noBackgroundVideoUrl = _ref3.noBackgroundVideoUrl,
@@ -468,7 +474,7 @@ var Landscape = function Landscape(_ref3) {
468
474
  }
469
475
  }, children), logoUrl ? /*#__PURE__*/React.createElement("div", {
470
476
  style: {
471
- position: "fixed",
477
+ position: logoPosition,
472
478
  left: logoLeft,
473
479
  top: logoTop,
474
480
  padding: 20,
@@ -485,6 +491,7 @@ var Landscape = function Landscape(_ref3) {
485
491
  })) : null);
486
492
  };
487
493
  var MotionStillStudioBackdrop = function MotionStillStudioBackdrop(_ref4) {
494
+ var _compositionProps$out, _window, _window$screenplayPro, _window$screenplayPro2;
488
495
  var videoUrl = _ref4.videoUrl,
489
496
  startVideoFrom = _ref4.startVideoFrom,
490
497
  imageUrl = _ref4.imageUrl,
@@ -498,11 +505,22 @@ var MotionStillStudioBackdrop = function MotionStillStudioBackdrop(_ref4) {
498
505
  durationInFrames = _ref4.durationInFrames,
499
506
  faceMetadata = _ref4.faceMetadata,
500
507
  muted = _ref4.muted,
501
- noBackgroundVideoEffects = _ref4.noBackgroundVideoEffects;
508
+ noBackgroundVideoEffects = _ref4.noBackgroundVideoEffects,
509
+ _ref4$useSquareInLand = _ref4.useSquareInLandscape,
510
+ useSquareInLandscape = _ref4$useSquareInLand === void 0 ? false : _ref4$useSquareInLand;
502
511
  var _useVideoConfig = useVideoConfig(),
503
- width = _useVideoConfig.width,
504
- height = _useVideoConfig.height,
505
- fps = _useVideoConfig.fps;
512
+ outputWidth = _useVideoConfig.width,
513
+ outputHeight = _useVideoConfig.height,
514
+ fps = _useVideoConfig.fps,
515
+ _useVideoConfig$props = _useVideoConfig.props,
516
+ compositionProps = _useVideoConfig$props === void 0 ? {} : _useVideoConfig$props;
517
+ 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);
518
+ var shouldUseSquareInLandscape = Boolean(useSquareInLandscape) && outputOrientation === "landscape";
519
+ var squareSize = 1080;
520
+ var width = shouldUseSquareInLandscape ? squareSize : outputWidth;
521
+ var height = shouldUseSquareInLandscape ? squareSize : outputHeight;
522
+ var renderOffsetX = shouldUseSquareInLandscape ? (outputWidth - squareSize) / 2 : 0;
523
+ var orientationOverride = shouldUseSquareInLandscape ? "square" : undefined;
506
524
  var frame = useCurrentFrame();
507
525
  var _useVirtualBackground = useVirtualBackground(),
508
526
  isVirtual = _useVirtualBackground.isVirtual,
@@ -524,7 +542,7 @@ var MotionStillStudioBackdrop = function MotionStillStudioBackdrop(_ref4) {
524
542
  logoLeft: CHROME_PADDING * 2,
525
543
  BrollStudioBackdropComponent: Square
526
544
  }
527
- }),
545
+ }, orientationOverride),
528
546
  BrollStudioBackdropComponent = _useOrientationBased.BrollStudioBackdropComponent,
529
547
  logoTop = _useOrientationBased.logoTop,
530
548
  logoLeft = _useOrientationBased.logoLeft;
@@ -562,7 +580,7 @@ var MotionStillStudioBackdrop = function MotionStillStudioBackdrop(_ref4) {
562
580
  // Middle section - fully visible
563
581
  brollSpringProgress = 1;
564
582
  }
565
- return /*#__PURE__*/React.createElement(React.Fragment, null, !disableTransitionSounds && /*#__PURE__*/React.createElement(Audio, {
583
+ var content = /*#__PURE__*/React.createElement(React.Fragment, null, !disableTransitionSounds && /*#__PURE__*/React.createElement(Audio, {
566
584
  src: "https://cdn.zync.ai/assets/static/swoosh.mp3",
567
585
  volume: 0.25
568
586
  }), /*#__PURE__*/React.createElement(BrollStudioBackdropComponent, {
@@ -577,6 +595,7 @@ var MotionStillStudioBackdrop = function MotionStillStudioBackdrop(_ref4) {
577
595
  sourceVideoOrientation: sourceVideoOrientation,
578
596
  logoLeft: logoLeft,
579
597
  logoTop: logoTop,
598
+ logoPosition: shouldUseSquareInLandscape ? "absolute" : "fixed",
580
599
  videoUrl: videoUrl,
581
600
  faceMetadata: faceMetadata,
582
601
  muted: muted,
@@ -584,5 +603,23 @@ var MotionStillStudioBackdrop = function MotionStillStudioBackdrop(_ref4) {
584
603
  showVirtual: showVirtual,
585
604
  virtualBgUrl: virtualBgUrl
586
605
  }, children));
606
+ if (!shouldUseSquareInLandscape) {
607
+ return content;
608
+ }
609
+ return /*#__PURE__*/React.createElement(AbsoluteFill, {
610
+ style: {
611
+ width: outputWidth,
612
+ height: outputHeight,
613
+ backgroundColor: "black"
614
+ }
615
+ }, /*#__PURE__*/React.createElement(AbsoluteFill, {
616
+ style: {
617
+ width: width,
618
+ height: height,
619
+ left: renderOffsetX,
620
+ top: 0,
621
+ overflow: "hidden"
622
+ }
623
+ }, content));
587
624
  };
588
625
  export { MotionStillStudioBackdrop };
@@ -45,23 +45,14 @@ export var SimpleFrame = function SimpleFrame(_ref) {
45
45
  extrapolateLeft: "clamp",
46
46
  easing: Easing["in"](Easing.quad)
47
47
  });
48
- return /*#__PURE__*/React.createElement(React.Fragment, null, !disableTransitionSounds && /*#__PURE__*/React.createElement(Audio, {
49
- src: "https://cdn.zync.ai/assets/static/swoosh.mp3",
50
- volume: 0.25
51
- }), /*#__PURE__*/React.createElement(AbsoluteFill, {
52
- style: {
53
- backgroundColor: shouldUseSquareInLandscape ? "black" : "transparent",
54
- width: width,
55
- height: height
56
- }
57
- }, /*#__PURE__*/React.createElement(AbsoluteFill, {
48
+ var content = /*#__PURE__*/React.createElement(AbsoluteFill, {
58
49
  style: {
59
50
  backgroundColor: frameColor || "transparent",
60
51
  padding: frameColor ? CHROME_PADDING : 0,
61
52
  isolation: "isolate",
62
53
  width: renderWidth,
63
54
  height: renderHeight,
64
- left: offsetX,
55
+ left: 0,
65
56
  top: 0
66
57
  }
67
58
  }, faceMetadata ? /*#__PURE__*/React.createElement("div", {
@@ -199,5 +190,23 @@ export var SimpleFrame = function SimpleFrame(_ref) {
199
190
  objectFit: "contain"
200
191
  },
201
192
  src: logoUrl
202
- })) : null)));
193
+ })) : null);
194
+ return /*#__PURE__*/React.createElement(React.Fragment, null, !disableTransitionSounds && /*#__PURE__*/React.createElement(Audio, {
195
+ src: "https://cdn.zync.ai/assets/static/swoosh.mp3",
196
+ volume: 0.25
197
+ }), shouldUseSquareInLandscape ? /*#__PURE__*/React.createElement(AbsoluteFill, {
198
+ style: {
199
+ backgroundColor: "black",
200
+ width: width,
201
+ height: height
202
+ }
203
+ }, /*#__PURE__*/React.createElement(AbsoluteFill, {
204
+ style: {
205
+ width: renderWidth,
206
+ height: renderHeight,
207
+ left: offsetX,
208
+ top: 0,
209
+ overflow: "hidden"
210
+ }
211
+ }, content)) : content);
203
212
  };
@@ -31,10 +31,12 @@ var Logo = function Logo(_ref) {
31
31
  var logoUrl = _ref.logoUrl,
32
32
  top = _ref.top,
33
33
  left = _ref.left,
34
- right = _ref.right;
34
+ right = _ref.right,
35
+ _ref$position = _ref.position,
36
+ position = _ref$position === void 0 ? "fixed" : _ref$position;
35
37
  return logoUrl ? /*#__PURE__*/React.createElement("div", {
36
38
  style: {
37
- position: "fixed",
39
+ position: position,
38
40
  zIndex: 1,
39
41
  top: top,
40
42
  left: left,
@@ -97,6 +99,7 @@ var RevealingLine = function RevealingLine(_ref2) {
97
99
  }));
98
100
  };
99
101
  var TextWithVideoLandscape = function TextWithVideoLandscape(_ref3) {
102
+ var _compositionProps$out, _window, _window$screenplayPro, _window$screenplayPro2;
100
103
  var startVideoFrom = _ref3.startVideoFrom,
101
104
  videoUrl = _ref3.videoUrl,
102
105
  logoUrl = _ref3.logoUrl,
@@ -110,10 +113,21 @@ var TextWithVideoLandscape = function TextWithVideoLandscape(_ref3) {
110
113
  faceMetadata = _ref3.faceMetadata,
111
114
  muted = _ref3.muted,
112
115
  noBackgroundVideoEffects = _ref3.noBackgroundVideoEffects,
113
- noBackgroundVideoUrl = _ref3.noBackgroundVideoUrl;
116
+ noBackgroundVideoUrl = _ref3.noBackgroundVideoUrl,
117
+ _ref3$useSquareInLand = _ref3.useSquareInLandscape,
118
+ useSquareInLandscape = _ref3$useSquareInLand === void 0 ? false : _ref3$useSquareInLand;
114
119
  var _useVideoConfig = useVideoConfig(),
115
- width = _useVideoConfig.width,
116
- height = _useVideoConfig.height;
120
+ outputWidth = _useVideoConfig.width,
121
+ outputHeight = _useVideoConfig.height,
122
+ _useVideoConfig$props = _useVideoConfig.props,
123
+ compositionProps = _useVideoConfig$props === void 0 ? {} : _useVideoConfig$props;
124
+ 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);
125
+ var shouldUseSquareInLandscape = Boolean(useSquareInLandscape) && outputOrientation === "landscape";
126
+ var squareSize = 1080;
127
+ var width = shouldUseSquareInLandscape ? squareSize : outputWidth;
128
+ var height = shouldUseSquareInLandscape ? squareSize : outputHeight;
129
+ var renderOffsetX = shouldUseSquareInLandscape ? (outputWidth - squareSize) / 2 : 0;
130
+ var orientationOverride = shouldUseSquareInLandscape ? "square" : undefined;
117
131
  var _useVirtualBackground = useVirtualBackground(),
118
132
  isVirtual = _useVirtualBackground.isVirtual,
119
133
  virtualBgUrl = _useVirtualBackground.url;
@@ -161,7 +175,7 @@ var TextWithVideoLandscape = function TextWithVideoLandscape(_ref3) {
161
175
  maxFontSize: 50,
162
176
  flowDirection: stylesByVariant[variant].flowDirection
163
177
  }
164
- }),
178
+ }, orientationOverride),
165
179
  targetTextWidth = _useOrientationBased.targetTextWidth,
166
180
  targetTextHeight = _useOrientationBased.targetTextHeight,
167
181
  targetVideoWidth = _useOrientationBased.targetVideoWidth,
@@ -191,7 +205,7 @@ var TextWithVideoLandscape = function TextWithVideoLandscape(_ref3) {
191
205
  var _distributeTextToFit = distributeTextToFit(text, targetTextWidth - 100, targetTextHeight - 100, maxFontSize),
192
206
  lines = _distributeTextToFit.lines,
193
207
  fontSize = _distributeTextToFit.fontSize;
194
- return /*#__PURE__*/React.createElement(AbsoluteFill, {
208
+ var content = /*#__PURE__*/React.createElement(AbsoluteFill, {
195
209
  style: {
196
210
  isolation: "isolate",
197
211
  width: width,
@@ -203,7 +217,8 @@ var TextWithVideoLandscape = function TextWithVideoLandscape(_ref3) {
203
217
  logoUrl: logoUrl,
204
218
  top: logoTop,
205
219
  left: logoLeft,
206
- right: logoRight
220
+ right: logoRight,
221
+ position: shouldUseSquareInLandscape ? "absolute" : "fixed"
207
222
  }), /*#__PURE__*/React.createElement("div", {
208
223
  style: {
209
224
  display: "flex",
@@ -352,6 +367,24 @@ var TextWithVideoLandscape = function TextWithVideoLandscape(_ref3) {
352
367
  zIndex: 10
353
368
  }
354
369
  }, children));
370
+ if (!shouldUseSquareInLandscape) {
371
+ return content;
372
+ }
373
+ return /*#__PURE__*/React.createElement(AbsoluteFill, {
374
+ style: {
375
+ width: outputWidth,
376
+ height: outputHeight,
377
+ backgroundColor: "black"
378
+ }
379
+ }, /*#__PURE__*/React.createElement(AbsoluteFill, {
380
+ style: {
381
+ width: width,
382
+ height: height,
383
+ left: renderOffsetX,
384
+ top: 0,
385
+ overflow: "hidden"
386
+ }
387
+ }, content));
355
388
  };
356
389
  export var TextWithVideo = function TextWithVideo(props) {
357
390
  var _useTheme = useTheme(),
@@ -8,34 +8,34 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
8
8
  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); }
9
9
  function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
10
10
  function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
11
- /**
12
- * Face-Centered Video Component
13
- *
14
- * A reusable component that wraps OffthreadVideo to ensure the video is always
15
- * centered on a person's face within a flexible container.
16
- *
17
- * The video maintains its source dimensions and is positioned using translateX/translateY
18
- * to center the face within the container, regardless of container size.
11
+ /**
12
+ * Face-Centered Video Component
13
+ *
14
+ * A reusable component that wraps OffthreadVideo to ensure the video is always
15
+ * centered on a person's face within a flexible container.
16
+ *
17
+ * The video maintains its source dimensions and is positioned using translateX/translateY
18
+ * to center the face within the container, regardless of container size.
19
19
  */
20
20
 
21
21
  import React from "react";
22
22
  import { OffthreadVideo, useCurrentFrame } from "remotion";
23
23
  import { useOrientationBased } from "../../hooks/useOrientationBased.js";
24
24
 
25
- /**
26
- * Calculate face-centered translation for flexible container
27
- * @param {Object} params - Configuration object
28
- * @param {Object} params.faceMetadata - Face detection metadata
29
- * @param {number} params.containerWidth - Container width in pixels
30
- * @param {number} params.containerHeight - Container height in pixels
31
- * @param {number} params.currentFrame - Current frame number (optional)
32
- * @param {boolean} params.enableInterpolation - Whether to interpolate between frames
33
- * @param {boolean} params.useAveragePosition - Whether to use average face position
34
- * @param {boolean} params.centerHorizontally - Whether to only center horizontally
35
- * @param {number} params.translateX - Additional translateX offset
36
- * @param {number} params.translateY - Additional translateY offset
37
- * @param {string} params.orientation - Viewport orientation (portrait, square, landscape)
38
- * @returns {Object} Transform styles and debug info
25
+ /**
26
+ * Calculate face-centered translation for flexible container
27
+ * @param {Object} params - Configuration object
28
+ * @param {Object} params.faceMetadata - Face detection metadata
29
+ * @param {number} params.containerWidth - Container width in pixels
30
+ * @param {number} params.containerHeight - Container height in pixels
31
+ * @param {number} params.currentFrame - Current frame number (optional)
32
+ * @param {boolean} params.enableInterpolation - Whether to interpolate between frames
33
+ * @param {boolean} params.useAveragePosition - Whether to use average face position
34
+ * @param {boolean} params.centerHorizontally - Whether to only center horizontally
35
+ * @param {number} params.translateX - Additional translateX offset
36
+ * @param {number} params.translateY - Additional translateY offset
37
+ * @param {string} params.orientation - Viewport orientation (portrait, square, landscape)
38
+ * @returns {Object} Transform styles and debug info
39
39
  */
40
40
  var calculateFaceCenteredTranslation = function calculateFaceCenteredTranslation(_ref) {
41
41
  var _faceMetadata$metadat, _faceMetadata$metadat2;
@@ -214,8 +214,8 @@ var calculateFaceCenteredTranslation = function calculateFaceCenteredTranslation
214
214
  };
215
215
  };
216
216
 
217
- /**
218
- * Get face data for a specific frame with optional interpolation
217
+ /**
218
+ * Get face data for a specific frame with optional interpolation
219
219
  */
220
220
  function getFaceDataForFrame(frames, frameIndex, enableInterpolation) {
221
221
  var _prevFrame, _nextFrame;
@@ -274,8 +274,8 @@ function getFaceDataForFrame(frames, frameIndex, enableInterpolation) {
274
274
  return ((_prevFrame = prevFrame) === null || _prevFrame === void 0 ? void 0 : _prevFrame.data) || ((_nextFrame = nextFrame) === null || _nextFrame === void 0 ? void 0 : _nextFrame.data) || null;
275
275
  }
276
276
 
277
- /**
278
- * Calculate average face position from all frames with face data
277
+ /**
278
+ * Calculate average face position from all frames with face data
279
279
  */
280
280
  function getAverageFaceData(frames) {
281
281
  if (!frames || frames.length === 0) return null;
@@ -310,14 +310,14 @@ function getAverageFaceData(frames) {
310
310
  };
311
311
  }
312
312
 
313
- /**
314
- * Calculate the negative space offset when face-centering a video
315
- *
316
- * @param {Object} faceMetadata - Face detection metadata object
317
- * @param {number} containerWidth - Container width in pixels
318
- * @param {number} containerHeight - Container height in pixels
319
- * @param {number} scale - Scale factor applied to the video
320
- * @returns {Object} Object containing horizontal and vertical offsets and which side has negative space
313
+ /**
314
+ * Calculate the negative space offset when face-centering a video
315
+ *
316
+ * @param {Object} faceMetadata - Face detection metadata object
317
+ * @param {number} containerWidth - Container width in pixels
318
+ * @param {number} containerHeight - Container height in pixels
319
+ * @param {number} scale - Scale factor applied to the video
320
+ * @returns {Object} Object containing horizontal and vertical offsets and which side has negative space
321
321
  */
322
322
  export var calculateNegativeSpaceOffset = function calculateNegativeSpaceOffset(faceMetadata, containerWidth, containerHeight) {
323
323
  var _faceMetadata$metadat4, _faceMetadata$metadat5;
@@ -415,22 +415,22 @@ export var calculateNegativeSpaceOffset = function calculateNegativeSpaceOffset(
415
415
  };
416
416
  };
417
417
 
418
- /**
419
- * FaceCenteredVideo Component
420
- * @param {Object} props - Component props
421
- * @param {string} props.src - Video source URL
422
- * @param {Object} props.faceMetadata - Face detection metadata
423
- * @param {number} props.containerWidth - Container width in pixels (required)
424
- * @param {number} props.containerHeight - Container height in pixels (required)
425
- * @param {boolean} props.enableInterpolation - Whether to interpolate between frames
426
- * @param {boolean} props.useAveragePosition - Whether to use average face position for entire video duration
427
- * @param {boolean} props.centerHorizontally - Whether to only center horizontally (X axis), not vertically (Y axis)
428
- * @param {number} props.translateX - Additional translateX offset (optional)
429
- * @param {number} props.translateY - Additional translateY offset (optional)
430
- * @param {boolean} props.showDebugInfo - Whether to show debug information
431
- * @param {Object} props.style - Additional styles to apply to video
432
- * @param {string} props.className - CSS class name
433
- * @param {...Object} props.otherProps - Other props to pass to OffthreadVideo
418
+ /**
419
+ * FaceCenteredVideo Component
420
+ * @param {Object} props - Component props
421
+ * @param {string} props.src - Video source URL
422
+ * @param {Object} props.faceMetadata - Face detection metadata
423
+ * @param {number} props.containerWidth - Container width in pixels (required)
424
+ * @param {number} props.containerHeight - Container height in pixels (required)
425
+ * @param {boolean} props.enableInterpolation - Whether to interpolate between frames
426
+ * @param {boolean} props.useAveragePosition - Whether to use average face position for entire video duration
427
+ * @param {boolean} props.centerHorizontally - Whether to only center horizontally (X axis), not vertically (Y axis)
428
+ * @param {number} props.translateX - Additional translateX offset (optional)
429
+ * @param {number} props.translateY - Additional translateY offset (optional)
430
+ * @param {boolean} props.showDebugInfo - Whether to show debug information
431
+ * @param {Object} props.style - Additional styles to apply to video
432
+ * @param {string} props.className - CSS class name
433
+ * @param {...Object} props.otherProps - Other props to pass to OffthreadVideo
434
434
  */
435
435
  export var FaceCenteredVideo = function FaceCenteredVideo(_ref2) {
436
436
  var _faceMetadata$metadat7, _faceMetadata$metadat8, _faceMetadata$metadat9, _faceMetadata$metadat10;