@zync/zync-screnplay-player 0.1.218 → 0.1.220

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.
@@ -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),
@@ -43,9 +43,10 @@ import { MotionStillGreenScreen } from "./components/layouts/MotionStillGreenScr
43
43
  import { DynamicTriangle } from "./components/layouts/DynamicTriangle";
44
44
  import { KeywordStudioBackdrop } from "./components/layouts/KeywordStudioBackdrop";
45
45
  import { MotionStillGreenScreenV2 } from "./components/layouts/MotionStillGreenScreenV2";
46
+ import { HookVideo } from "./components/layouts/HookVideo";
46
47
 
47
- /** Update this so that Remotion knows which component to render when it is passed via screenplay. Ex. "title" will have rendered "Title" component
48
- * Here we are mapping directly types and component names. Types are snake_case and components PascalCase.
48
+ /** Update this so that Remotion knows which component to render when it is passed via screenplay. Ex. "title" will have rendered "Title" component
49
+ * Here we are mapping directly types and component names. Types are snake_case and components PascalCase.
49
50
  * */
50
51
  export var RegisteredComponents = {
51
52
  // Layouts
@@ -74,6 +75,7 @@ export var RegisteredComponents = {
74
75
  StretchTextDemo: StretchTextDemo,
75
76
  KeyPointOverlayDepth: KeyPointOverlayDepth,
76
77
  DynamicTriangle: DynamicTriangle,
78
+ HookVideo: HookVideo,
77
79
  //effects
78
80
  BrollFullscreen: BrollFullscreen,
79
81
  PhraseRainbowEffect: PhraseRainbowEffect,
@@ -1,81 +1,67 @@
1
- function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
2
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
3
- function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
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
- 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
- function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
1
+ var _excluded = ["playerOptions"];
2
+ 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; }
3
+ 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
4
  import React from "react";
8
- import { AbsoluteFill, Internals } from "remotion";
5
+ import { AbsoluteFill, Internals, useRemotionEnvironment } from "remotion";
9
6
  import { LayoutVideoTrack } from "./LayoutVideoTrack";
10
7
  import { EffectsVideoTrack } from "./EffectsVideoTrack";
11
8
  import { CaptionsVideoTrack } from "./CaptionsVideoTrack";
12
9
  import { AudioTrack } from "./AudioTrack";
13
10
  import { SafeZones } from "../components/utils/SafeZones";
14
11
  var isSafeZoneDisplayed = false;
15
- var BufferingOverlay = function BufferingOverlay() {
16
- var _bufferingContext$buf;
17
- var bufferingContext = React.useContext(Internals.BufferingContextReact);
18
- var _React$useState = React.useState((_bufferingContext$buf = bufferingContext === null || bufferingContext === void 0 ? void 0 : bufferingContext.buffering.current) !== null && _bufferingContext$buf !== void 0 ? _bufferingContext$buf : false),
19
- _React$useState2 = _slicedToArray(_React$useState, 2),
20
- isBuffering = _React$useState2[0],
21
- setIsBuffering = _React$useState2[1];
22
- React.useEffect(function () {
23
- if (!bufferingContext) {
24
- return;
25
- }
26
- setIsBuffering(bufferingContext.buffering.current);
27
- var onBuffer = bufferingContext.listenForBuffering(function () {
28
- setIsBuffering(true);
29
- });
30
- var onResume = bufferingContext.listenForResume(function () {
31
- setIsBuffering(false);
32
- });
33
- return function () {
34
- onBuffer.remove();
35
- onResume.remove();
12
+ var DISABLED_BUFFER_MANAGER = {
13
+ addBlock: function addBlock() {
14
+ return {
15
+ unblock: function unblock() {
16
+ return undefined;
17
+ }
18
+ };
19
+ },
20
+ buffering: {
21
+ current: false
22
+ },
23
+ listenForBuffering: function listenForBuffering() {
24
+ return {
25
+ remove: function remove() {
26
+ return undefined;
27
+ }
28
+ };
29
+ },
30
+ listenForResume: function listenForResume() {
31
+ return {
32
+ remove: function remove() {
33
+ return undefined;
34
+ }
36
35
  };
37
- }, [bufferingContext]);
38
- if (!isBuffering) {
39
- return null;
40
36
  }
41
- return /*#__PURE__*/React.createElement(AbsoluteFill, {
42
- style: {
43
- alignItems: "center",
44
- justifyContent: "center",
45
- pointerEvents: "none"
46
- }
47
- }, /*#__PURE__*/React.createElement("svg", {
48
- width: 100,
49
- height: 100,
50
- viewBox: "0 0 30 30",
51
- "aria-label": "Buffering"
52
- }, /*#__PURE__*/React.createElement("g", null, /*#__PURE__*/React.createElement("animateTransform", {
53
- attributeName: "transform",
54
- type: "rotate",
55
- from: "0 15 15",
56
- to: "360 15 15",
57
- dur: "0.9s",
58
- repeatCount: "indefinite"
59
- }), /*#__PURE__*/React.createElement("circle", {
60
- cx: "15",
61
- cy: "15",
62
- r: "11",
63
- fill: "none",
64
- stroke: "#FF1253",
65
- strokeWidth: "3",
66
- strokeLinecap: "round",
67
- strokeDasharray: "50 18"
68
- }))));
69
37
  };
70
- var DynamicVideoCompositionComponent = function DynamicVideoCompositionComponent(props) {
38
+ var PreviewBufferingProvider = function PreviewBufferingProvider(_ref) {
39
+ var children = _ref.children,
40
+ pauseWhenBufferingInPlayer = _ref.pauseWhenBufferingInPlayer;
41
+ var env = useRemotionEnvironment();
42
+ if (!env.isPlayer || pauseWhenBufferingInPlayer) {
43
+ return children;
44
+ }
45
+ return /*#__PURE__*/React.createElement(Internals.BufferingContextReact.Provider, {
46
+ value: DISABLED_BUFFER_MANAGER
47
+ }, children);
48
+ };
49
+ var DynamicVideoCompositionComponent = function DynamicVideoCompositionComponent(_ref2) {
50
+ var _ref2$playerOptions = _ref2.playerOptions,
51
+ playerOptions = _ref2$playerOptions === void 0 ? {} : _ref2$playerOptions,
52
+ props = _objectWithoutProperties(_ref2, _excluded);
71
53
  var layoutVideoTrack = (props === null || props === void 0 ? void 0 : props.layoutVideoTrack) || [];
72
54
  var effectsVideoTrack = (props === null || props === void 0 ? void 0 : props.effectsVideoTrack) || [];
73
55
  var captionsVideoTrack = (props === null || props === void 0 ? void 0 : props.captionsVideoTrack) || [];
74
56
  var audioTrack = (props === null || props === void 0 ? void 0 : props.audioTrack) || [];
57
+ var _playerOptions$pauseW = playerOptions.pauseWhenBufferingInPlayer,
58
+ pauseWhenBufferingInPlayer = _playerOptions$pauseW === void 0 ? false : _playerOptions$pauseW;
75
59
  return /*#__PURE__*/React.createElement(AbsoluteFill, {
76
60
  style: {
77
61
  backgroundColor: props.output.backgroundColor
78
62
  }
63
+ }, /*#__PURE__*/React.createElement(PreviewBufferingProvider, {
64
+ pauseWhenBufferingInPlayer: pauseWhenBufferingInPlayer
79
65
  }, isSafeZoneDisplayed && /*#__PURE__*/React.createElement(SafeZones, null), /*#__PURE__*/React.createElement(LayoutVideoTrack, {
80
66
  track: layoutVideoTrack
81
67
  }), /*#__PURE__*/React.createElement(EffectsVideoTrack, {
@@ -84,7 +70,7 @@ var DynamicVideoCompositionComponent = function DynamicVideoCompositionComponent
84
70
  track: captionsVideoTrack
85
71
  }), /*#__PURE__*/React.createElement(AudioTrack, {
86
72
  track: audioTrack
87
- }), /*#__PURE__*/React.createElement(BufferingOverlay, null));
73
+ })));
88
74
  };
89
75
  export var DynamicVideoComposition = function DynamicVideoComposition(props) {
90
76
  if (props) {
@@ -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.218",
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.220",
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
+ }