@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,11 +4,16 @@ var _excluded = ["component", "index"],
4
4
  function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
5
5
  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; }
6
6
  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; }
7
- import { Easing, Sequence, Series, useVideoConfig } from "remotion";
7
+ import { AbsoluteFill, Audio, Easing, Sequence, Series, interpolate, staticFile, useCurrentFrame, useVideoConfig } from "remotion";
8
8
  import React from "react";
9
9
  import { RegisteredComponents } from "../registeredComponents";
10
10
  import { linearTiming, TransitionSeries } from "@remotion/transitions";
11
11
  import { glitchOnePresentation } from "./transitions/GlitchOne";
12
+ import { HookThreeGlitchOverlay } from "../components/layouts/HookThreeGlitchOverlay";
13
+ var HOOK_EXIT_PRE_FRAMES = 8;
14
+ var HOOK_EXIT_POST_FRAMES = 7;
15
+ var GLITCH_VERDICT_STYLE = "glitch_verdict";
16
+ var GLITCH_VERDICT_FILTER_ID = "hook-glitch-verdict-rgb-split";
12
17
  var motionBlurComponents = {
13
18
  SentenceSimple: true,
14
19
  Sentence: true
@@ -23,32 +28,331 @@ var transitionThemes = {
23
28
  }
24
29
  };
25
30
 
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
- };
31
+ /*
32
+ const UseMotionBlur = ({ children, componentName }) => {
33
+ const {
34
+ props: {
35
+ output: { theme = "default" } = {
36
+ theme: window.screenplayProps.output.theme,
37
+ },
38
+ },
39
+ } = useVideoConfig();
40
+
41
+ if (motionBlurComponents[componentName] && motionBlurThemes[theme]) {
42
+ return (
43
+ <CameraMotionBlur shutterAngle={180} samples={5}>
44
+ {children}
45
+ </CameraMotionBlur>
46
+ );
47
+ }
48
+
49
+ return children;
50
+ };
46
51
  */
47
52
 
48
- var NestedEffects = function NestedEffects(_ref) {
53
+ var isTruthy = function isTruthy(value) {
54
+ return value === true || value === "true" || value === 1 || value === "1";
55
+ };
56
+ var isHookExitEffectEnabled = function isHookExitEffectEnabled(_ref) {
49
57
  var component = _ref.component,
50
- index = _ref.index,
51
- otherProps = _objectWithoutProperties(_ref, _excluded);
58
+ hasNextSegment = _ref.hasNextSegment,
59
+ props = _ref.props;
60
+ return component === "HookVideo" && hasNextSegment && !isTruthy(props.disableHookExitEffect);
61
+ };
62
+ var isGlitchVerdictHook = function isGlitchVerdictHook(props) {
63
+ return (props === null || props === void 0 ? void 0 : props.hookStyle) === GLITCH_VERDICT_STYLE;
64
+ };
65
+ var withAlpha = function withAlpha(color, alpha) {
66
+ return /^#[0-9a-fA-F]{6}$/.test(color || "") ? "".concat(color).concat(alpha) : color;
67
+ };
68
+ var getHookExitPulse = function getHookExitPulse(overlay, frame) {
69
+ if (!overlay) {
70
+ return {
71
+ localFrame: 0,
72
+ relativeFrame: 0,
73
+ impact: 0,
74
+ cutPulse: 0,
75
+ postDecay: 0,
76
+ tearWindow: 0
77
+ };
78
+ }
79
+ var localFrame = frame - overlay.from;
80
+ var fadeOutEnd = Math.max(overlay.durationInFrames - 1, overlay.peakFrame + 1);
81
+ var relativeFrame = localFrame - overlay.peakFrame;
82
+ var preImpact = interpolate(localFrame, [0, overlay.peakFrame], [0, 1], {
83
+ easing: Easing["in"](Easing.cubic),
84
+ extrapolateLeft: "clamp",
85
+ extrapolateRight: "clamp"
86
+ });
87
+ var postDecay = localFrame <= overlay.peakFrame ? 1 : interpolate(localFrame, [overlay.peakFrame, fadeOutEnd], [1, 0], {
88
+ easing: Easing.out(Easing.cubic),
89
+ extrapolateLeft: "clamp",
90
+ extrapolateRight: "clamp"
91
+ });
92
+ var impact = localFrame <= overlay.peakFrame ? preImpact : postDecay;
93
+ var cutPulse = interpolate(Math.abs(relativeFrame), [0, 2, 7], [1, 0.52, 0], {
94
+ extrapolateLeft: "clamp",
95
+ extrapolateRight: "clamp"
96
+ });
97
+ var tearWindow = interpolate(Math.abs(relativeFrame), [0, 5, 9], [1, 0.72, 0], {
98
+ extrapolateLeft: "clamp",
99
+ extrapolateRight: "clamp"
100
+ });
101
+ return {
102
+ localFrame: localFrame,
103
+ relativeFrame: relativeFrame,
104
+ impact: impact,
105
+ cutPulse: cutPulse,
106
+ postDecay: postDecay,
107
+ tearWindow: tearWindow
108
+ };
109
+ };
110
+ var getGlitchVerdictFrameFilter = function getGlitchVerdictFrameFilter(overlay, frame) {
111
+ if (!(overlay !== null && overlay !== void 0 && overlay.useRgbSplit)) {
112
+ return undefined;
113
+ }
114
+ var _getHookExitPulse = getHookExitPulse(overlay, frame),
115
+ impact = _getHookExitPulse.impact,
116
+ cutPulse = _getHookExitPulse.cutPulse,
117
+ tearWindow = _getHookExitPulse.tearWindow;
118
+ var colorCrush = Math.max(impact, cutPulse, tearWindow);
119
+ var saturate = 1 + colorCrush * 1.85;
120
+ var contrast = 1 + colorCrush * 0.82;
121
+ var brightness = 1 - colorCrush * 0.28;
122
+ return "url(#".concat(GLITCH_VERDICT_FILTER_ID, ") saturate(").concat(saturate, ") contrast(").concat(contrast, ") brightness(").concat(brightness, ")");
123
+ };
124
+ var channelMatrix = function channelMatrix(_ref2) {
125
+ var _ref2$r = _ref2.r,
126
+ r = _ref2$r === void 0 ? 0 : _ref2$r,
127
+ _ref2$g = _ref2.g,
128
+ g = _ref2$g === void 0 ? 0 : _ref2$g,
129
+ _ref2$b = _ref2.b,
130
+ b = _ref2$b === void 0 ? 0 : _ref2$b,
131
+ _ref2$alpha = _ref2.alpha,
132
+ alpha = _ref2$alpha === void 0 ? 1 : _ref2$alpha;
133
+ return ["".concat(r, " 0 0 0 0"), "0 ".concat(g, " 0 0 0"), "0 0 ".concat(b, " 0 0"), "0 0 0 ".concat(alpha, " 0")].join(" ");
134
+ };
135
+ var getHookGlitchSlamShake = function getHookGlitchSlamShake(overlay, frame, width) {
136
+ if (!overlay) {
137
+ return {
138
+ x: 0,
139
+ scale: 1
140
+ };
141
+ }
142
+ var _getHookExitPulse2 = getHookExitPulse(overlay, frame),
143
+ localFrame = _getHookExitPulse2.localFrame,
144
+ impact = _getHookExitPulse2.impact,
145
+ cutPulse = _getHookExitPulse2.cutPulse;
146
+ var jitter = (localFrame % 2 === 0 ? 0.86 : -0.86) + Math.sin((localFrame + 1) * 2.37) * 0.24;
147
+ var styleMultiplier = overlay.hookStyle === GLITCH_VERDICT_STYLE ? 1.45 : 1;
148
+ var baseAmplitude = Math.max(6, width * 0.008) * impact * styleMultiplier;
149
+ var slamAmplitude = Math.max(14, width * 0.018) * cutPulse * styleMultiplier;
150
+ var x = Math.round((baseAmplitude + slamAmplitude) * jitter * 10) / 10;
151
+ var scale = 1 + impact * 0.004 * styleMultiplier + cutPulse * 0.012 * styleMultiplier;
152
+ return {
153
+ x: x,
154
+ scale: scale
155
+ };
156
+ };
157
+ var GlitchVerdictRgbSplitFilter = function GlitchVerdictRgbSplitFilter(_ref3) {
158
+ var overlay = _ref3.overlay;
159
+ var frame = useCurrentFrame();
160
+ var _useVideoConfig = useVideoConfig(),
161
+ width = _useVideoConfig.width;
162
+ var _getHookExitPulse3 = getHookExitPulse(overlay, frame),
163
+ localFrame = _getHookExitPulse3.localFrame,
164
+ impact = _getHookExitPulse3.impact,
165
+ cutPulse = _getHookExitPulse3.cutPulse,
166
+ tearWindow = _getHookExitPulse3.tearWindow;
167
+ var pulse = Math.max(impact, cutPulse, tearWindow);
168
+ var strobe = localFrame % 3 === 0 ? 1 : localFrame % 3 === 1 ? 0.72 : 0.86;
169
+ var channelOpacity = Math.min(0.92, 0.28 + pulse * 0.58) * strobe;
170
+ var offset = Math.max(10, width * 0.014) * (0.2 + pulse + cutPulse * 1.35);
171
+ var redDx = (localFrame % 2 === 0 ? -1 : 0.72) * offset;
172
+ var greenDx = Math.sin((localFrame + 2) * 1.97) * offset * 0.24;
173
+ var blueDx = (localFrame % 2 === 0 ? 0.86 : -1) * offset;
174
+ var redDy = Math.sin(localFrame * 0.9) * offset * 0.1;
175
+ var blueDy = Math.cos(localFrame * 0.72) * offset * 0.08;
176
+ var displacement = Math.max(0, width * 0.018 * (pulse + cutPulse * 1.5));
177
+ var turbulenceY = 0.18 + localFrame % 5 * 0.035;
178
+ if (!(overlay !== null && overlay !== void 0 && overlay.useRgbSplit) || pulse <= 0.001) {
179
+ return null;
180
+ }
181
+ return /*#__PURE__*/React.createElement("svg", {
182
+ "aria-hidden": "true",
183
+ focusable: "false",
184
+ style: {
185
+ position: "absolute",
186
+ width: 0,
187
+ height: 0,
188
+ pointerEvents: "none"
189
+ }
190
+ }, /*#__PURE__*/React.createElement("filter", {
191
+ id: GLITCH_VERDICT_FILTER_ID,
192
+ x: "-18%",
193
+ y: "-18%",
194
+ width: "136%",
195
+ height: "136%",
196
+ colorInterpolationFilters: "sRGB"
197
+ }, /*#__PURE__*/React.createElement("feTurbulence", {
198
+ type: "fractalNoise",
199
+ baseFrequency: "0.006 ".concat(turbulenceY),
200
+ numOctaves: "1",
201
+ seed: localFrame % 11 + 1,
202
+ result: "noise"
203
+ }), /*#__PURE__*/React.createElement("feDisplacementMap", {
204
+ "in": "SourceGraphic",
205
+ in2: "noise",
206
+ scale: displacement,
207
+ xChannelSelector: "R",
208
+ yChannelSelector: "G",
209
+ result: "displaced"
210
+ }), /*#__PURE__*/React.createElement("feColorMatrix", {
211
+ "in": "displaced",
212
+ type: "matrix",
213
+ values: channelMatrix({
214
+ r: 1,
215
+ alpha: channelOpacity
216
+ }),
217
+ result: "red"
218
+ }), /*#__PURE__*/React.createElement("feColorMatrix", {
219
+ "in": "displaced",
220
+ type: "matrix",
221
+ values: channelMatrix({
222
+ g: 1,
223
+ alpha: channelOpacity * 0.72
224
+ }),
225
+ result: "green"
226
+ }), /*#__PURE__*/React.createElement("feColorMatrix", {
227
+ "in": "displaced",
228
+ type: "matrix",
229
+ values: channelMatrix({
230
+ b: 1,
231
+ alpha: channelOpacity
232
+ }),
233
+ result: "blue"
234
+ }), /*#__PURE__*/React.createElement("feOffset", {
235
+ "in": "red",
236
+ dx: redDx,
237
+ dy: redDy,
238
+ result: "redOffset"
239
+ }), /*#__PURE__*/React.createElement("feOffset", {
240
+ "in": "green",
241
+ dx: greenDx,
242
+ dy: "0",
243
+ result: "greenOffset"
244
+ }), /*#__PURE__*/React.createElement("feOffset", {
245
+ "in": "blue",
246
+ dx: blueDx,
247
+ dy: blueDy,
248
+ result: "blueOffset"
249
+ }), /*#__PURE__*/React.createElement("feBlend", {
250
+ "in": "SourceGraphic",
251
+ in2: "redOffset",
252
+ mode: "screen",
253
+ result: "sourceRed"
254
+ }), /*#__PURE__*/React.createElement("feBlend", {
255
+ "in": "sourceRed",
256
+ in2: "greenOffset",
257
+ mode: "screen",
258
+ result: "sourceGreen"
259
+ }), /*#__PURE__*/React.createElement("feBlend", {
260
+ "in": "sourceGreen",
261
+ in2: "blueOffset",
262
+ mode: "screen"
263
+ })));
264
+ };
265
+ var HookGlitchSlamOverlay = function HookGlitchSlamOverlay(_ref4) {
266
+ var _window, _window$screenplayPro;
267
+ var durationInFrames = _ref4.durationInFrames,
268
+ peakFrame = _ref4.peakFrame;
269
+ var frame = useCurrentFrame();
270
+ var _useVideoConfig2 = useVideoConfig(),
271
+ _useVideoConfig2$prop = _useVideoConfig2.props,
272
+ compositionProps = _useVideoConfig2$prop === void 0 ? {} : _useVideoConfig2$prop;
273
+ var inputProps = (compositionProps === null || compositionProps === void 0 ? void 0 : compositionProps.input) || (typeof window !== "undefined" ? (_window = window) === null || _window === void 0 ? void 0 : (_window$screenplayPro = _window.screenplayProps) === null || _window$screenplayPro === void 0 ? void 0 : _window$screenplayPro.input : {}) || {};
274
+ var accentColor = inputProps.accentColor || "#ffffff";
275
+ var accentWash = withAlpha(accentColor, "40") || "rgba(255,255,255,0.24)";
276
+ var fadeOutEnd = Math.max(durationInFrames - 1, peakFrame + 1);
277
+ var relativeFrame = frame - peakFrame;
278
+ var preImpact = interpolate(frame, [0, peakFrame], [0, 1], {
279
+ easing: Easing["in"](Easing.cubic),
280
+ extrapolateLeft: "clamp",
281
+ extrapolateRight: "clamp"
282
+ });
283
+ var postDecay = frame <= peakFrame ? 1 : interpolate(frame, [peakFrame, fadeOutEnd], [1, 0], {
284
+ easing: Easing.out(Easing.cubic),
285
+ extrapolateLeft: "clamp",
286
+ extrapolateRight: "clamp"
287
+ });
288
+ var impact = frame <= peakFrame ? preImpact : postDecay;
289
+ var cutPulse = interpolate(Math.abs(relativeFrame), [0, 2, 6], [1, 0.46, 0], {
290
+ extrapolateLeft: "clamp",
291
+ extrapolateRight: "clamp"
292
+ });
293
+ var flashOpacity = cutPulse * 0.46 + impact * 0.05;
294
+ var accentOpacity = cutPulse * 0.16 * postDecay;
295
+ return /*#__PURE__*/React.createElement(AbsoluteFill, {
296
+ style: {
297
+ zIndex: 9999,
298
+ overflow: "hidden",
299
+ pointerEvents: "none"
300
+ }
301
+ }, /*#__PURE__*/React.createElement(AbsoluteFill, {
302
+ style: {
303
+ opacity: accentOpacity,
304
+ backgroundColor: accentWash,
305
+ mixBlendMode: "screen"
306
+ }
307
+ }), /*#__PURE__*/React.createElement(AbsoluteFill, {
308
+ style: {
309
+ opacity: flashOpacity,
310
+ backgroundColor: "rgba(255,255,255,0.86)",
311
+ mixBlendMode: "screen"
312
+ }
313
+ }));
314
+ };
315
+ var buildHookExitOverlays = function buildHookExitOverlays(track) {
316
+ var overlays = [];
317
+ var timelineCursor = 0;
318
+ track.forEach(function (_ref5, index) {
319
+ var layout = _ref5.layout;
320
+ var durationInFrames = layout.durationInFrames;
321
+ var hasNextSegment = index < track.length - 1;
322
+ var hookExitEffectEnabled = isHookExitEffectEnabled({
323
+ component: layout.component,
324
+ hasNextSegment: hasNextSegment,
325
+ props: layout
326
+ });
327
+ var segmentEnd = timelineCursor + durationInFrames;
328
+ if (hookExitEffectEnabled) {
329
+ var _track, _track$layout;
330
+ var nextDuration = ((_track = track[index + 1]) === null || _track === void 0 ? void 0 : (_track$layout = _track.layout) === null || _track$layout === void 0 ? void 0 : _track$layout.durationInFrames) || 0;
331
+ var preFrames = Math.min(HOOK_EXIT_PRE_FRAMES, durationInFrames);
332
+ var postFrames = Math.min(HOOK_EXIT_POST_FRAMES, nextDuration);
333
+ var from = Math.max(0, segmentEnd - preFrames);
334
+ var overlayDuration = preFrames + postFrames;
335
+ if (overlayDuration > 0) {
336
+ overlays.push({
337
+ from: from,
338
+ durationInFrames: overlayDuration,
339
+ peakFrame: segmentEnd - from,
340
+ playSound: !isTruthy(layout.disableHookSounds) && !isTruthy(layout.disableTransitionSounds),
341
+ soundFrom: segmentEnd,
342
+ hookStyle: layout.hookStyle,
343
+ useRgbSplit: isGlitchVerdictHook(layout),
344
+ useThreeGlitch: !isTruthy(layout.disableHookThreeGlitchEffect) && (isGlitchVerdictHook(layout) || isTruthy(layout.hookThreeGlitchEffectEnabled))
345
+ });
346
+ }
347
+ }
348
+ timelineCursor += durationInFrames;
349
+ });
350
+ return overlays;
351
+ };
352
+ var NestedEffects = function NestedEffects(_ref6) {
353
+ var component = _ref6.component,
354
+ index = _ref6.index,
355
+ otherProps = _objectWithoutProperties(_ref6, _excluded);
52
356
  var ComponentToRender = RegisteredComponents[component];
53
357
  if (!ComponentToRender) {
54
358
  return null;
@@ -59,15 +363,54 @@ var NestedEffects = function NestedEffects(_ref) {
59
363
  name: "NestedEffect-".concat(component)
60
364
  }, /*#__PURE__*/React.createElement(ComponentToRender, otherProps));
61
365
  };
62
- var StandardVideoTrack = function StandardVideoTrack(_ref2) {
63
- var track = _ref2.track;
64
- return /*#__PURE__*/React.createElement(Series, null, track.map(function (_ref3, index) {
65
- var _ref3$layout = _ref3.layout,
66
- component = _ref3$layout.component,
67
- otherProps = _objectWithoutProperties(_ref3$layout, _excluded2),
68
- _ref3$effects = _ref3.effects,
69
- effects = _ref3$effects === void 0 ? [] : _ref3$effects;
366
+ var StandardVideoTrack = function StandardVideoTrack(_ref7) {
367
+ var _window2, _window2$screenplayPr;
368
+ var track = _ref7.track;
369
+ var frame = useCurrentFrame();
370
+ var _useVideoConfig3 = useVideoConfig(),
371
+ width = _useVideoConfig3.width,
372
+ height = _useVideoConfig3.height,
373
+ _useVideoConfig3$prop = _useVideoConfig3.props,
374
+ compositionProps = _useVideoConfig3$prop === void 0 ? {} : _useVideoConfig3$prop;
375
+ var inputProps = (compositionProps === null || compositionProps === void 0 ? void 0 : compositionProps.input) || (typeof window !== "undefined" ? (_window2 = window) === null || _window2 === void 0 ? void 0 : (_window2$screenplayPr = _window2.screenplayProps) === null || _window2$screenplayPr === void 0 ? void 0 : _window2$screenplayPr.input : {}) || {};
376
+ var accentColor = inputProps.accentColor || "#ff2f6d";
377
+ var hookExitOverlays = buildHookExitOverlays(track);
378
+ var activeHookExitOverlay = hookExitOverlays.find(function (_ref8) {
379
+ var from = _ref8.from,
380
+ durationInFrames = _ref8.durationInFrames;
381
+ return frame >= from && frame < from + durationInFrames;
382
+ });
383
+ var _getHookGlitchSlamSha = getHookGlitchSlamShake(activeHookExitOverlay, frame, width),
384
+ shakeX = _getHookGlitchSlamSha.x,
385
+ shakeScale = _getHookGlitchSlamSha.scale;
386
+ var glitchVerdictFrameFilter = getGlitchVerdictFrameFilter(activeHookExitOverlay, frame);
387
+ return /*#__PURE__*/React.createElement(AbsoluteFill, {
388
+ style: {
389
+ overflow: "hidden"
390
+ }
391
+ }, activeHookExitOverlay !== null && activeHookExitOverlay !== void 0 && activeHookExitOverlay.useRgbSplit ? /*#__PURE__*/React.createElement(GlitchVerdictRgbSplitFilter, {
392
+ overlay: activeHookExitOverlay
393
+ }) : null, /*#__PURE__*/React.createElement(AbsoluteFill, {
394
+ style: {
395
+ transform: "translate3d(".concat(shakeX, "px, 0, 0) scale(").concat(shakeScale, ")"),
396
+ transformOrigin: "center center",
397
+ filter: glitchVerdictFrameFilter
398
+ }
399
+ }, /*#__PURE__*/React.createElement(Series, null, track.map(function (_ref9, index, array) {
400
+ var _ref9$layout = _ref9.layout,
401
+ component = _ref9$layout.component,
402
+ otherProps = _objectWithoutProperties(_ref9$layout, _excluded2),
403
+ _ref9$effects = _ref9.effects,
404
+ effects = _ref9$effects === void 0 ? [] : _ref9$effects;
70
405
  var ComponentToRender = RegisteredComponents[component];
406
+ var hookExitEffectEnabled = isHookExitEffectEnabled({
407
+ component: component,
408
+ hasNextSegment: index < array.length - 1,
409
+ props: otherProps
410
+ });
411
+ var hookExitProps = component === "HookVideo" ? {
412
+ hookExitEffectEnabled: hookExitEffectEnabled
413
+ } : {};
71
414
  if (!ComponentToRender) {
72
415
  return null;
73
416
  }
@@ -76,26 +419,66 @@ var StandardVideoTrack = function StandardVideoTrack(_ref2) {
76
419
  name: "Layout - " + component,
77
420
  durationInFrames: otherProps.durationInFrames,
78
421
  premountFor: 100
79
- }, /*#__PURE__*/React.createElement(ComponentToRender, otherProps, effects.map(function (effect, i) {
422
+ }, /*#__PURE__*/React.createElement(ComponentToRender, _extends({}, otherProps, hookExitProps), effects.map(function (effect, i) {
80
423
  return /*#__PURE__*/React.createElement(NestedEffects, _extends({
81
424
  key: i
82
425
  }, effect, {
83
426
  index: index
84
427
  }));
85
428
  })));
429
+ }))), hookExitOverlays.map(function (_ref10, index) {
430
+ var from = _ref10.from,
431
+ durationInFrames = _ref10.durationInFrames,
432
+ peakFrame = _ref10.peakFrame,
433
+ playSound = _ref10.playSound,
434
+ soundFrom = _ref10.soundFrom,
435
+ useThreeGlitch = _ref10.useThreeGlitch;
436
+ return /*#__PURE__*/React.createElement(React.Fragment, {
437
+ key: "hook-glitch-slam-".concat(from, "-").concat(index)
438
+ }, /*#__PURE__*/React.createElement(Sequence, {
439
+ from: from,
440
+ durationInFrames: durationInFrames,
441
+ name: "HookGlitchSlamOverlay"
442
+ }, /*#__PURE__*/React.createElement(HookGlitchSlamOverlay, {
443
+ durationInFrames: durationInFrames,
444
+ peakFrame: peakFrame
445
+ })), useThreeGlitch ? /*#__PURE__*/React.createElement(Sequence, {
446
+ from: from,
447
+ durationInFrames: durationInFrames,
448
+ name: "HookThreeGlitchExitOverlay"
449
+ }, /*#__PURE__*/React.createElement(HookThreeGlitchOverlay, {
450
+ width: width,
451
+ height: height,
452
+ startFrame: 0,
453
+ durationInFrames: durationInFrames,
454
+ accentColor: accentColor,
455
+ intensity: 1.2,
456
+ zIndex: 10000
457
+ })) : null, playSound ? /*#__PURE__*/React.createElement(Sequence, {
458
+ from: soundFrom,
459
+ name: "HookGlitchSlamSound"
460
+ }, /*#__PURE__*/React.createElement(Audio, {
461
+ src: staticFile("blip.mp3"),
462
+ volume: function volume(localFrame) {
463
+ return interpolate(localFrame, [0, 2, 10], [0, 0.32, 0], {
464
+ extrapolateLeft: "clamp",
465
+ extrapolateRight: "clamp"
466
+ });
467
+ }
468
+ })) : null);
86
469
  }));
87
470
  };
88
- var TransitionVideoTrack = function TransitionVideoTrack(_ref4) {
89
- var track = _ref4.track,
90
- transition = _ref4.transition;
91
- return /*#__PURE__*/React.createElement(TransitionSeries, null, track.map(function (_ref5, index, array) {
92
- var _ref5$layout = _ref5.layout,
93
- component = _ref5$layout.component,
94
- otherProps = _objectWithoutProperties(_ref5$layout, _excluded3),
95
- _ref5$effects = _ref5.effects,
96
- effects = _ref5$effects === void 0 ? [] : _ref5$effects,
97
- _ref5$transitionAfter = _ref5.transitionAfter,
98
- transitionAfter = _ref5$transitionAfter === void 0 ? true : _ref5$transitionAfter;
471
+ var TransitionVideoTrack = function TransitionVideoTrack(_ref11) {
472
+ var track = _ref11.track,
473
+ transition = _ref11.transition;
474
+ return /*#__PURE__*/React.createElement(TransitionSeries, null, track.map(function (_ref12, index, array) {
475
+ var _ref12$layout = _ref12.layout,
476
+ component = _ref12$layout.component,
477
+ otherProps = _objectWithoutProperties(_ref12$layout, _excluded3),
478
+ _ref12$effects = _ref12.effects,
479
+ effects = _ref12$effects === void 0 ? [] : _ref12$effects,
480
+ _ref12$transitionAfte = _ref12.transitionAfter,
481
+ transitionAfter = _ref12$transitionAfte === void 0 ? true : _ref12$transitionAfte;
99
482
  var ComponentToRender = RegisteredComponents[component];
100
483
  var hasNextSegment = index < array.length - 1;
101
484
  var shouldTransition = hasNextSegment && transitionAfter !== false;
@@ -120,18 +503,18 @@ var TransitionVideoTrack = function TransitionVideoTrack(_ref4) {
120
503
  }) : null];
121
504
  }));
122
505
  };
123
- export var LayoutVideoTrack = function LayoutVideoTrack(_ref6) {
124
- var track = _ref6.track;
506
+ export var LayoutVideoTrack = function LayoutVideoTrack(_ref13) {
507
+ var track = _ref13.track;
125
508
  if (!track) {
126
509
  return null;
127
510
  }
128
- var _useVideoConfig = useVideoConfig(),
129
- _useVideoConfig$props = _useVideoConfig.props.output,
130
- _useVideoConfig$props2 = _useVideoConfig$props === void 0 ? {
511
+ var _useVideoConfig4 = useVideoConfig(),
512
+ _useVideoConfig4$prop = _useVideoConfig4.props.output,
513
+ _useVideoConfig4$prop2 = _useVideoConfig4$prop === void 0 ? {
131
514
  theme: window.screenplayProps.output.theme
132
- } : _useVideoConfig$props,
133
- _useVideoConfig$props3 = _useVideoConfig$props2.theme,
134
- theme = _useVideoConfig$props3 === void 0 ? "default" : _useVideoConfig$props3;
515
+ } : _useVideoConfig4$prop,
516
+ _useVideoConfig4$prop3 = _useVideoConfig4$prop2.theme,
517
+ theme = _useVideoConfig4$prop3 === void 0 ? "default" : _useVideoConfig4$prop3;
135
518
  var transition = transitionThemes[theme];
136
519
  if (transition) {
137
520
  return /*#__PURE__*/React.createElement(TransitionVideoTrack, {
package/package.json CHANGED
@@ -1,47 +1,52 @@
1
- {
2
- "name": "@zync/zync-screnplay-player",
3
- "version": "0.1.227",
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.441",
20
- "@remotion/lottie": "4.0.441",
21
- "@remotion/motion-blur": "4.0.441",
22
- "@remotion/player": "4.0.441",
23
- "@remotion/transitions": "4.0.441",
24
- "remotion": "4.0.441"
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.229",
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
+ "@react-three/fiber": "8.17.10",
20
+ "@remotion/google-fonts": "4.0.441",
21
+ "@remotion/lottie": "4.0.441",
22
+ "@remotion/motion-blur": "4.0.441",
23
+ "@remotion/player": "4.0.441",
24
+ "@remotion/three": "4.0.441",
25
+ "@remotion/transitions": "4.0.441",
26
+ "remotion": "4.0.441",
27
+ "three": "0.178.0"
28
+ },
29
+ "peerDependencies": {
30
+ "react": ">=18.0.0",
31
+ "react-dom": ">=18.0.0"
32
+ },
33
+ "devDependencies": {
34
+ "@babel/cli": "7.21.5",
35
+ "@babel/core": "7.21.5",
36
+ "@babel/preset-env": "7.21.5",
37
+ "@babel/preset-react": "7.18.6",
38
+ "@babel/preset-typescript": "^7.26.0",
39
+ "babel-loader": "^9.2.1",
40
+ "react": "18.3.1",
41
+ "react-dom": "18.3.1",
42
+ "rimraf": "^5.0.7",
43
+ "terser-webpack-plugin": "^5.3.11",
44
+ "ts-loader": "^9.5.2",
45
+ "typescript": "^5.7.3",
46
+ "webpack": "^5.97.1",
47
+ "webpack-cli": "^6.0.1"
48
+ },
49
+ "browser": {
50
+ "fs": false
51
+ }
52
+ }