@editframe/react 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,66 @@
1
+ # Editframe React Player
2
+
3
+
4
+ This is react component to preview a video using [Editframe SDK](https://www.editframe.com/docs/sdks) video config JSON object.
5
+
6
+
7
+ ## Installation
8
+ You can install the Editframe React Player using npm or yarn:
9
+
10
+ Npm
11
+ ```sh
12
+ npm install @editframe/react
13
+ ```
14
+ Yarn
15
+ ```sh
16
+ yarn add @editframe/react
17
+ ```
18
+
19
+
20
+ ## Getting Started
21
+
22
+ To get started with the Editframe React, you will need to obtain an Application ID from the Editframe dashboard.
23
+
24
+ Once you have your Application ID, you can use the React Player
25
+
26
+
27
+ ```App.tsx
28
+ import "./App.css";
29
+ import { Player } from "@editframe/react";
30
+ import { useState } from "react";
31
+
32
+ function App() {
33
+ const [playerState, setPlayerState] = useState<"stopped" | "playing" | "paused">("playing"); // you can use this to control the player
34
+ const [seek, setSeek] = useState(0); // you can use this to seek the player
35
+ const config = {
36
+ backgroundColor: "#000000FF",
37
+ dimensions: {
38
+ height: 1080,
39
+ width: 1920,
40
+ },
41
+ duration: 10,
42
+ metadata: {},
43
+ layers: [],
44
+ }; // this is the config for the player to render the video
45
+ return (
46
+ <div className="App">
47
+ <div style={{ height: "100vh", width: "100vw" }}>
48
+ <Player
49
+ config={config}
50
+ style={{
51
+ height: "100%",
52
+ width: "100%",
53
+ }}
54
+ applicationId="demo"
55
+ loop={false}
56
+ playerState={playerState}
57
+ seek={seek}
58
+ />
59
+ </div>
60
+ </div>
61
+ );
62
+ }
63
+ export default App;
64
+ ```
65
+ You can check our [React Player Demo App](https://github.com/editframe/react-player-demo-app)
66
+
package/dist/Player.d.ts CHANGED
@@ -12,6 +12,8 @@ export interface IPlayerProps extends DetailedHTMLProps<HTMLAttributes<HTMLDivEl
12
12
  loop: boolean;
13
13
  playerState?: 'playing' | 'paused' | 'stopped';
14
14
  seek?: number;
15
+ loading?: boolean;
16
+ mode?: string;
15
17
  }
16
18
  declare const Player: FunctionComponent<IPlayerProps>;
17
19
  export default Player;
@@ -1 +1 @@
1
- {"version":3,"file":"Player.d.ts","sourceRoot":"","sources":["../src/Player.tsx"],"names":[],"mappings":"AACA,OAAc,EACZ,iBAAiB,EACjB,iBAAiB,EACjB,cAAc,EAGf,MAAM,OAAO,CAAA;AAGd,OAAO,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAA;AAElD,MAAM,WAAW,YACf,SAAQ,iBAAiB,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,cAAc,CAAC;IACzE,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,MAAM,EAAE,uBAAuB,CAAA;IAC/B,UAAU,CAAC,EAAE;QACX,MAAM,EAAE,MAAM,CAAA;QACd,KAAK,EAAE,MAAM,CAAA;KACd,CAAA;IACD,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,OAAO,CAAA;IACb,WAAW,CAAC,EAAE,SAAS,GAAG,QAAQ,GAAG,SAAS,CAAA;IAC9C,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAED,QAAA,MAAM,MAAM,EAAE,iBAAiB,CAAC,YAAY,CA2D3C,CAAA;AACD,eAAe,MAAM,CAAA"}
1
+ {"version":3,"file":"Player.d.ts","sourceRoot":"","sources":["../src/Player.tsx"],"names":[],"mappings":"AACA,OAAc,EACZ,iBAAiB,EACjB,iBAAiB,EACjB,cAAc,EAGf,MAAM,OAAO,CAAA;AAGd,OAAO,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAA;AAElD,MAAM,WAAW,YACf,SAAQ,iBAAiB,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,cAAc,CAAC;IACzE,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,MAAM,EAAE,uBAAuB,CAAA;IAC/B,UAAU,CAAC,EAAE;QACX,MAAM,EAAE,MAAM,CAAA;QACd,KAAK,EAAE,MAAM,CAAA;KACd,CAAA;IACD,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,OAAO,CAAA;IACb,WAAW,CAAC,EAAE,SAAS,GAAG,QAAQ,GAAG,SAAS,CAAA;IAC9C,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAED,QAAA,MAAM,MAAM,EAAE,iBAAiB,CAAC,YAAY,CA4E3C,CAAA;AAGD,eAAe,MAAM,CAAA"}
package/dist/index.esm.js CHANGED
@@ -65,11 +65,12 @@ function v4(options, buf, offset) {
65
65
  return unsafeStringify(rnds);
66
66
  }
67
67
 
68
- var g=Object.defineProperty;var y=(r,t,e)=>t in r?g(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e;var i=(r,t,e)=>(y(r,typeof t!="symbol"?t+"":t,e),e);var o=(r,t,e)=>new Promise((a,s)=>{var d=n=>{try{p(e.next(n));}catch(h){s(h);}},l=n=>{try{p(e.throw(n));}catch(h){s(h);}},p=n=>n.done?a(n.value):Promise.resolve(n.value).then(d,l);p((e=e.apply(r,t)).next());});var m=class{constructor({applicationId:t,config:e,containerId:a,dimensions:s,host:d="https://embed.editframe.com",playerControls:l=!0,playerLoop:p=!1}){i(this,"applicationId");i(this,"config");i(this,"container");i(this,"dimensions");i(this,"host");i(this,"iFrameId");i(this,"mode");i(this,"playerLoop");i(this,"playerState");i(this,"playerControls");i(this,"editframeLogo");i(this,"iFrame");i(this,"readyMediaIds",[]);i(this,"updateConfig",t=>o(this,null,function*(){this.config=t,yield this.sendCallWithValue("setConfig",{config:this.config,iFrameId:this.iFrameId});}));i(this,"setupContainer",t=>{t.style.alignItems="center",t.style.display="flex",t.style.justifyContent="center",t.style.height="100%",t.style.width="100%";});i(this,"setupEditframeLogo",()=>{var e;let t=document.createElement("img");return t.src="https://cdn.editframe.com/web/logo_white.png",t.style.position="absolute",t.style.transition="opacity 0.5s",(e=this.container)==null||e.appendChild(t),this.editframeLogo=t,t});i(this,"setupIFrame",()=>{var s,d,l;let t=document.createElement("iframe"),a=`${this.host}/${this.applicationId}?mode=${this.mode}`;return this.playerControls||(a=`${a}&hideControls`),this.playerLoop&&(a=`${a}&loop`),t.setAttribute("loading","lazy"),t.setAttribute("src",a),t.style.width=((s=this.dimensions)==null?void 0:s.width)||"100%",t.style.height=((d=this.dimensions)==null?void 0:d.height)||"100%",t.style.opacity="0",t.style.border="none",t.style.outline="none",t.style.transition="opacity 0.5s",(l=this.container)==null||l.appendChild(t),this.iFrame=t,t});i(this,"setupEventListeners",()=>{window.addEventListener("message",t=>o(this,null,function*(){if(t.data&&t.data.config&&t.data.iFrameId===this.iFrameId){let{data:{config:e}}=t;this.config=e;}if(t.data&&t.data.pageLoaded&&(yield this.handlePageLoaded()),!(t.data&&t.data.iFrameId&&t.data.iFrameId!==this.iFrameId)){if(t.data&&t.data.iFrameReady&&(yield this.handleIframeReady()),t.data&&t.data.editorReady&&(yield this.handleEditorReady()),t.data&&t.data.playerState&&(this.playerState=t.data.playerState),t.data&&t.data.layerId){let{data:{layerId:e}}=t;this.readyMediaIds.includes(e)||this.readyMediaIds.push(e);}if(this.config){let a=this.config.layers.filter(s=>"source"in s).map(s=>s.id).every(s=>this.readyMediaIds.includes(s));(this.config.layers.length===0||a)&&this.handleEditorReady();}}}));});i(this,"handlePageLoaded",()=>o(this,null,function*(){yield this.sendCallWithValue("setIframeId",{iFrameId:this.iFrameId});}));i(this,"handleIframeReady",()=>o(this,null,function*(){this.config&&(yield this.sendCallWithValue("setConfig",{config:this.config,iFrameId:this.iFrameId}));}));i(this,"handleEditorReady",()=>o(this,null,function*(){this.iFrame.style.opacity="1",this.editframeLogo.style.opacity="0",setTimeout(()=>{this.editframeLogo.remove();},500);}));if(this.applicationId=t,this.config=e,this.container=document.getElementById(a),this.dimensions=s,this.host=d,this.iFrameId=v4().slice(0,6),this.mode="preview",this.playerControls=l,this.playerLoop=p,this.playerState="stopped",!this.container)throw new Error(`Container #${a} not found`);this.setupContainer(this.container),this.setupEditframeLogo(),this.setupIFrame(),this.setupEventListeners();}sendCallWithValue(t,e){return o(this,null,function*(){return this.iFrame.contentWindow?(this.iFrame.contentWindow.postMessage({call:t,value:e},"*"),!0):!1})}},c=m;var f=class{constructor({applicationId:t,config:e,containerId:a,dimensions:s,hideControls:d=!1,host:l,loop:p=!1}){i(this,"state");i(this,"v");i(this,"updateConfig",t=>o(this,null,function*(){yield this.v.sendCallWithValue("setConfig",{config:t,iFrameId:this.v.iFrameId});}));i(this,"play",()=>o(this,null,function*(){yield this.setState("playing");}));i(this,"pause",()=>o(this,null,function*(){yield this.setState("paused");}));i(this,"stop",()=>o(this,null,function*(){yield this.setState("stopped");}));i(this,"seek",t=>o(this,null,function*(){yield this.v.sendCallWithValue("setPlayerSeek",{seconds:t,iFrameId:this.v.iFrameId});}));i(this,"setState",t=>o(this,null,function*(){yield this.v.sendCallWithValue("setPlayerState",{state:t,iFrameId:this.v.iFrameId}),this.state=t;}));let n=document.getElementById(a);if(this.state="stopped",!n)throw new Error(`Container #${a} not found`);this.v=new c({applicationId:t,config:e,containerId:a,dimensions:s,host:l||"https://embed.editframe.com",playerControls:!d,playerLoop:p});}},I=f;
68
+ var f=Object.defineProperty;var u=(n,t,e)=>t in n?f(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var i=(n,t,e)=>(u(n,typeof t!="symbol"?t+"":t,e),e);var o=(n,t,e)=>new Promise((a,s)=>{var d=r=>{try{p(e.next(r));}catch(h){s(h);}},l=r=>{try{p(e.throw(r));}catch(h){s(h);}},p=r=>r.done?a(r.value):Promise.resolve(r.value).then(d,l);p((e=e.apply(n,t)).next());});var m=class{constructor({applicationId:t,config:e,containerId:a,dimensions:s,host:d="https://embed.editframe.com",mode:l,playerControls:p=!0,playerLoop:r=!1}){i(this,"applicationId");i(this,"config");i(this,"container");i(this,"dimensions");i(this,"host");i(this,"iFrameId");i(this,"mode");i(this,"playerLoop");i(this,"playerState");i(this,"playerControls");i(this,"editframeLogo");i(this,"iFrame");i(this,"readyMediaIds",[]);i(this,"updateConfig",t=>o(this,null,function*(){this.config=t,yield this.sendCallWithValue("setConfig",{config:this.config,iFrameId:this.iFrameId});}));i(this,"setupContainer",t=>{t.style.alignItems="center",t.style.display="flex",t.style.justifyContent="center",t.style.height="100%",t.style.width="100%";});i(this,"setupEditframeLogo",()=>{var e;let t=document.createElement("img");return t.src="https://cdn.editframe.com/web/logo_white.png",t.style.position="absolute",t.style.transition="opacity 0.5s",(e=this.container)==null||e.appendChild(t),this.editframeLogo=t,t});i(this,"setupIFrame",()=>{var s,d,l;let t=document.createElement("iframe"),a=`${this.host}/${this.applicationId}?mode=${this.mode}`;return this.playerControls||(a=`${a}&hideControls`),this.playerLoop&&(a=`${a}&loop`),t.setAttribute("loading","lazy"),t.setAttribute("src",a),t.style.width=((s=this.dimensions)==null?void 0:s.width)||"100%",t.style.height=((d=this.dimensions)==null?void 0:d.height)||"100%",t.style.border="none",t.style.outline="none",t.style.transition="opacity 0.5s",t.scrolling="no",t.frameBorder="0",(l=this.container)==null||l.appendChild(t),this.iFrame=t,t});i(this,"setupEventListeners",()=>{window.addEventListener("message",t=>o(this,null,function*(){if(t.data&&t.data.config&&t.data.iFrameId===this.iFrameId){let{data:{config:e}}=t;this.config=e;}if(t.data&&t.data.pageLoaded&&(yield this.handlePageLoaded()),!(t.data&&t.data.iFrameId&&t.data.iFrameId!==this.iFrameId)){if(t.data&&t.data.iFrameReady&&(yield this.handleIframeReady()),t.data&&t.data.editorReady&&(yield this.handleEditorReady()),t.data&&t.data.playerState&&(this.playerState=t.data.playerState),t.data&&t.data.layerId){let{data:{layerId:e}}=t;this.readyMediaIds.includes(e)||this.readyMediaIds.push(e);}if(this.config){let a=this.config.layers.filter(s=>"source"in s).map(s=>s.id).every(s=>this.readyMediaIds.includes(s));(this.config.layers.length===0||a)&&this.handleEditorReady();}}}));});i(this,"handlePageLoaded",()=>o(this,null,function*(){yield this.sendCallWithValue("setIframeId",{iFrameId:this.iFrameId});}));i(this,"handleIframeReady",()=>o(this,null,function*(){this.config&&(yield this.sendCallWithValue("setConfig",{config:this.config,iFrameId:this.iFrameId}));}));i(this,"handleEditorReady",()=>o(this,null,function*(){setTimeout(()=>{this.editframeLogo.remove();},500);}));if(this.applicationId=t,this.config=e,this.container=document.getElementById(a),this.dimensions=s,this.host=d,this.iFrameId=v4().slice(0,6),this.mode=l||"preview",this.playerControls=p,this.playerLoop=r,this.playerState="stopped",!this.container)throw new Error(`Container #${a} not found`);this.setupContainer(this.container),this.setupEditframeLogo(),this.setupIFrame(),this.setupEventListeners();}sendCallWithValue(t,e){return o(this,null,function*(){return this.iFrame.contentWindow?(this.iFrame.contentWindow.postMessage({call:t,value:e},"*"),!0):!1})}},c=m;var g=class{constructor({applicationId:t,config:e,containerId:a,dimensions:s,hideControls:d=!1,host:l,loop:p=!1,mode:r}){i(this,"state");i(this,"v");i(this,"updateConfig",t=>o(this,null,function*(){yield this.v.sendCallWithValue("setConfig",{config:t,iFrameId:this.v.iFrameId});}));i(this,"play",()=>o(this,null,function*(){yield this.setState("playing");}));i(this,"pause",()=>o(this,null,function*(){yield this.setState("paused");}));i(this,"stop",()=>o(this,null,function*(){yield this.setState("stopped");}));i(this,"seek",t=>o(this,null,function*(){yield this.v.sendCallWithValue("setPlayerSeek",{seconds:t,iFrameId:this.v.iFrameId});}));i(this,"setLoadingState",t=>o(this,null,function*(){yield this.v.sendCallWithValue("setLoadingState",{state:t,iFrameId:this.v.iFrameId});}));i(this,"setState",t=>o(this,null,function*(){yield this.v.sendCallWithValue("setPlayerState",{state:t,iFrameId:this.v.iFrameId}),this.state=t;}));let h=document.getElementById(a);if(this.state="stopped",!h)throw new Error(`Container #${a} not found`);this.v=new c({applicationId:t,config:e,containerId:a,dimensions:s,host:l||"https://embed.editframe.com",playerControls:!d,playerLoop:p,mode:r});}},I=g;
69
69
 
70
70
  var Player = function (_a) {
71
- var applicationId = _a.applicationId, children = _a.children, config = _a.config, dimensions = _a.dimensions, hideControls = _a.hideControls, host = _a.host, loop = _a.loop, playerState = _a.playerState, seek = _a.seek;
72
- var player = useRef(true);
71
+ var applicationId = _a.applicationId, children = _a.children, config = _a.config, dimensions = _a.dimensions, hideControls = _a.hideControls, host = _a.host, loading = _a.loading, loop = _a.loop, mode = _a.mode, playerState = _a.playerState, seek = _a.seek;
72
+ var player = useRef(false);
73
+ var ref = useRef(null);
73
74
  var embed = useRef({});
74
75
  var containerId = "ef-player-".concat(v4().slice(0, 6));
75
76
  useEffect(function () {
@@ -82,6 +83,7 @@ var Player = function (_a) {
82
83
  host: host || 'https://embed.editframe.com',
83
84
  hideControls: hideControls,
84
85
  loop: loop,
86
+ mode: mode
85
87
  });
86
88
  player.current = true;
87
89
  }
@@ -111,11 +113,23 @@ var Player = function (_a) {
111
113
  }, [seek]);
112
114
  useEffect(function () {
113
115
  if (embed.current && embed.current.setState) {
116
+ embed.current.setLoadingState(loading);
117
+ }
118
+ return function () {
119
+ if (embed.current && embed.current.setState) {
120
+ embed.current.setLoadingState(false);
121
+ }
122
+ };
123
+ }, [loading]);
124
+ useEffect(function () {
125
+ if (embed.current && embed.current.setState) {
126
+ embed.current.setLoadingState(true);
114
127
  embed.current.updateConfig(config);
128
+ embed.current.setLoadingState(false);
115
129
  }
116
130
  return function () { };
117
131
  }, [config]);
118
- return React.createElement("div", { id: containerId }, children);
132
+ return React.createElement("div", { style: { backgroundColor: "black" }, id: containerId, ref: ref }, children);
119
133
  };
120
134
 
121
135
  export { Player };
@@ -1 +1 @@
1
- {"version":3,"file":"index.esm.js","sources":["../../../node_modules/.pnpm/uuid@9.0.0/node_modules/uuid/dist/esm-browser/rng.js","../../../node_modules/.pnpm/uuid@9.0.0/node_modules/uuid/dist/esm-browser/stringify.js","../../../node_modules/.pnpm/uuid@9.0.0/node_modules/uuid/dist/esm-browser/native.js","../../../node_modules/.pnpm/uuid@9.0.0/node_modules/uuid/dist/esm-browser/v4.js","../../embed/dist/index.mjs","../src/Player.tsx"],"sourcesContent":["// Unique ID creation requires a high quality random # generator. In the browser we therefore\n// require the crypto API and do not support built-in fallback to lower quality random number\n// generators (like Math.random()).\nlet getRandomValues;\nconst rnds8 = new Uint8Array(16);\nexport default function rng() {\n // lazy load so that environments that need to polyfill have a chance to do so\n if (!getRandomValues) {\n // getRandomValues needs to be invoked in a context where \"this\" is a Crypto implementation.\n getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);\n\n if (!getRandomValues) {\n throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');\n }\n }\n\n return getRandomValues(rnds8);\n}","import validate from './validate.js';\n/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\n\nconst byteToHex = [];\n\nfor (let i = 0; i < 256; ++i) {\n byteToHex.push((i + 0x100).toString(16).slice(1));\n}\n\nexport function unsafeStringify(arr, offset = 0) {\n // Note: Be careful editing this code! It's been tuned for performance\n // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434\n return (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase();\n}\n\nfunction stringify(arr, offset = 0) {\n const uuid = unsafeStringify(arr, offset); // Consistency check for valid UUID. If this throws, it's likely due to one\n // of the following:\n // - One or more input array values don't map to a hex octet (leading to\n // \"undefined\" in the uuid)\n // - Invalid input values for the RFC `version` or `variant` fields\n\n if (!validate(uuid)) {\n throw TypeError('Stringified UUID is invalid');\n }\n\n return uuid;\n}\n\nexport default stringify;","const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);\nexport default {\n randomUUID\n};","import native from './native.js';\nimport rng from './rng.js';\nimport { unsafeStringify } from './stringify.js';\n\nfunction v4(options, buf, offset) {\n if (native.randomUUID && !buf && !options) {\n return native.randomUUID();\n }\n\n options = options || {};\n const rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n\n rnds[6] = rnds[6] & 0x0f | 0x40;\n rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided\n\n if (buf) {\n offset = offset || 0;\n\n for (let i = 0; i < 16; ++i) {\n buf[offset + i] = rnds[i];\n }\n\n return buf;\n }\n\n return unsafeStringify(rnds);\n}\n\nexport default v4;","var g=Object.defineProperty;var y=(r,t,e)=>t in r?g(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e;var i=(r,t,e)=>(y(r,typeof t!=\"symbol\"?t+\"\":t,e),e);var o=(r,t,e)=>new Promise((a,s)=>{var d=n=>{try{p(e.next(n))}catch(h){s(h)}},l=n=>{try{p(e.throw(n))}catch(h){s(h)}},p=n=>n.done?a(n.value):Promise.resolve(n.value).then(d,l);p((e=e.apply(r,t)).next())});import{v4 as u}from\"uuid\";var m=class{constructor({applicationId:t,config:e,containerId:a,dimensions:s,host:d=\"https://embed.editframe.com\",playerControls:l=!0,playerLoop:p=!1}){i(this,\"applicationId\");i(this,\"config\");i(this,\"container\");i(this,\"dimensions\");i(this,\"host\");i(this,\"iFrameId\");i(this,\"mode\");i(this,\"playerLoop\");i(this,\"playerState\");i(this,\"playerControls\");i(this,\"editframeLogo\");i(this,\"iFrame\");i(this,\"readyMediaIds\",[]);i(this,\"updateConfig\",t=>o(this,null,function*(){this.config=t,yield this.sendCallWithValue(\"setConfig\",{config:this.config,iFrameId:this.iFrameId})}));i(this,\"setupContainer\",t=>{t.style.alignItems=\"center\",t.style.display=\"flex\",t.style.justifyContent=\"center\",t.style.height=\"100%\",t.style.width=\"100%\"});i(this,\"setupEditframeLogo\",()=>{var e;let t=document.createElement(\"img\");return t.src=\"https://cdn.editframe.com/web/logo_white.png\",t.style.position=\"absolute\",t.style.transition=\"opacity 0.5s\",(e=this.container)==null||e.appendChild(t),this.editframeLogo=t,t});i(this,\"setupIFrame\",()=>{var s,d,l;let t=document.createElement(\"iframe\"),a=`${this.host}/${this.applicationId}?mode=${this.mode}`;return this.playerControls||(a=`${a}&hideControls`),this.playerLoop&&(a=`${a}&loop`),t.setAttribute(\"loading\",\"lazy\"),t.setAttribute(\"src\",a),t.style.width=((s=this.dimensions)==null?void 0:s.width)||\"100%\",t.style.height=((d=this.dimensions)==null?void 0:d.height)||\"100%\",t.style.opacity=\"0\",t.style.border=\"none\",t.style.outline=\"none\",t.style.transition=\"opacity 0.5s\",(l=this.container)==null||l.appendChild(t),this.iFrame=t,t});i(this,\"setupEventListeners\",()=>{window.addEventListener(\"message\",t=>o(this,null,function*(){if(t.data&&t.data.config&&t.data.iFrameId===this.iFrameId){let{data:{config:e}}=t;this.config=e}if(t.data&&t.data.pageLoaded&&(yield this.handlePageLoaded()),!(t.data&&t.data.iFrameId&&t.data.iFrameId!==this.iFrameId)){if(t.data&&t.data.iFrameReady&&(yield this.handleIframeReady()),t.data&&t.data.editorReady&&(yield this.handleEditorReady()),t.data&&t.data.playerState&&(this.playerState=t.data.playerState),t.data&&t.data.layerId){let{data:{layerId:e}}=t;this.readyMediaIds.includes(e)||this.readyMediaIds.push(e)}if(this.config){let a=this.config.layers.filter(s=>\"source\"in s).map(s=>s.id).every(s=>this.readyMediaIds.includes(s));(this.config.layers.length===0||a)&&this.handleEditorReady()}}}))});i(this,\"handlePageLoaded\",()=>o(this,null,function*(){yield this.sendCallWithValue(\"setIframeId\",{iFrameId:this.iFrameId})}));i(this,\"handleIframeReady\",()=>o(this,null,function*(){this.config&&(yield this.sendCallWithValue(\"setConfig\",{config:this.config,iFrameId:this.iFrameId}))}));i(this,\"handleEditorReady\",()=>o(this,null,function*(){this.iFrame.style.opacity=\"1\",this.editframeLogo.style.opacity=\"0\",setTimeout(()=>{this.editframeLogo.remove()},500)}));if(this.applicationId=t,this.config=e,this.container=document.getElementById(a),this.dimensions=s,this.host=d,this.iFrameId=u().slice(0,6),this.mode=\"preview\",this.playerControls=l,this.playerLoop=p,this.playerState=\"stopped\",!this.container)throw new Error(`Container #${a} not found`);this.setupContainer(this.container),this.setupEditframeLogo(),this.setupIFrame(),this.setupEventListeners()}sendCallWithValue(t,e){return o(this,null,function*(){return this.iFrame.contentWindow?(this.iFrame.contentWindow.postMessage({call:t,value:e},\"*\"),!0):!1})}},c=m;var f=class{constructor({applicationId:t,config:e,containerId:a,dimensions:s,hideControls:d=!1,host:l,loop:p=!1}){i(this,\"state\");i(this,\"v\");i(this,\"updateConfig\",t=>o(this,null,function*(){yield this.v.sendCallWithValue(\"setConfig\",{config:t,iFrameId:this.v.iFrameId})}));i(this,\"play\",()=>o(this,null,function*(){yield this.setState(\"playing\")}));i(this,\"pause\",()=>o(this,null,function*(){yield this.setState(\"paused\")}));i(this,\"stop\",()=>o(this,null,function*(){yield this.setState(\"stopped\")}));i(this,\"seek\",t=>o(this,null,function*(){yield this.v.sendCallWithValue(\"setPlayerSeek\",{seconds:t,iFrameId:this.v.iFrameId})}));i(this,\"setState\",t=>o(this,null,function*(){yield this.v.sendCallWithValue(\"setPlayerState\",{state:t,iFrameId:this.v.iFrameId}),this.state=t}));let n=document.getElementById(a);if(this.state=\"stopped\",!n)throw new Error(`Container #${a} not found`);this.v=new c({applicationId:t,config:e,containerId:a,dimensions:s,host:l||\"https://embed.editframe.com\",playerControls:!d,playerLoop:p})}},I=f;export{c as Embed,I as Player};\n","import { Player as PlayerClass } from '@editframe/embed'\nimport React, {\n DetailedHTMLProps,\n FunctionComponent,\n HTMLAttributes,\n useEffect,\n useRef,\n} from 'react'\nimport { v4 as uuid } from 'uuid'\n\nimport { CompositionConfigEditor } from './shared'\n\nexport interface IPlayerProps\n extends DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement> {\n applicationId?: string\n config: CompositionConfigEditor\n dimensions?: {\n height: string\n width: string\n }\n hideControls?: boolean\n host?: string\n loop: boolean\n playerState?: 'playing' | 'paused' | 'stopped'\n seek?: number\n}\n\nconst Player: FunctionComponent<IPlayerProps> = ({\n applicationId,\n children,\n config,\n dimensions,\n hideControls,\n host,\n loop,\n playerState,\n seek,\n}) => {\n const player = useRef(true)\n const embed = useRef({} as any)\n const containerId = `ef-player-${uuid().slice(0, 6)}`\n useEffect(() => {\n if (!player.current && !embed.current.setState) {\n embed.current = new PlayerClass({\n applicationId,\n config,\n containerId,\n dimensions,\n host: host || 'https://embed.editframe.com',\n hideControls,\n loop,\n })\n player.current = true\n }\n return () => {\n player.current = false\n }\n }, [])\n useEffect(() => {\n if (embed.current && embed.current.setState) {\n embed.current.setState(playerState)\n }\n return () => {\n if (embed.current && embed.current.setState) {\n embed.current.setState('stopped')\n }\n }\n }, [playerState])\n useEffect(() => {\n if (embed.current && embed.current.setState) {\n embed.current.seek(seek)\n }\n return () => {\n if (embed.current && embed.current.setState) {\n embed.current.seek(0)\n }\n }\n }, [seek])\n useEffect(() => {\n if (embed.current && embed.current.setState) {\n embed.current.updateConfig(config)\n }\n return () => {}\n }, [config])\n\n return <div id={containerId}>{children}</div>\n}\nexport default Player\n"],"names":["u","uuid","PlayerClass"],"mappings":";;AAAA;AACA;AACA;AACA,IAAI,eAAe,CAAC;AACpB,MAAM,KAAK,GAAG,IAAI,UAAU,CAAC,EAAE,CAAC,CAAC;AAClB,SAAS,GAAG,GAAG;AAC9B;AACA,EAAE,IAAI,CAAC,eAAe,EAAE;AACxB;AAC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Q,EAAE;AAC3C,gBAAA,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;AACtB,aAAA;AACH,SAAC,CAAA;AACH,KAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAA;AACV,IAAA,SAAS,CAAC,YAAA;QACR,IAAI,KAAK,CAAC,OAAO,IAAI,KAAK,CAAC,OAAO,CAAC,QAAQ,EAAE;AAC3C,YAAA,KAAK,CAAC,OAAO,CAAC,YAAY,CAAC,MAAM,CAAC,CAAA;AACnC,SAAA;QACD,OAAO,YAAA,GAAQ,CAAA;AACjB,KAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAA;AAEZ,IAAA,OAAO,6BAAK,EAAE,EAAE,WAAW,EAAG,EAAA,QAAQ,CAAO,CAAA;AAC/C;;;;"}
1
+ {"version":3,"file":"index.esm.js","sources":["../../../node_modules/.pnpm/uuid@9.0.0/node_modules/uuid/dist/esm-browser/rng.js","../../../node_modules/.pnpm/uuid@9.0.0/node_modules/uuid/dist/esm-browser/stringify.js","../../../node_modules/.pnpm/uuid@9.0.0/node_modules/uuid/dist/esm-browser/native.js","../../../node_modules/.pnpm/uuid@9.0.0/node_modules/uuid/dist/esm-browser/v4.js","../../embed/dist/index.mjs","../src/Player.tsx"],"sourcesContent":["// Unique ID creation requires a high quality random # generator. In the browser we therefore\n// require the crypto API and do not support built-in fallback to lower quality random number\n// generators (like Math.random()).\nlet getRandomValues;\nconst rnds8 = new Uint8Array(16);\nexport default function rng() {\n // lazy load so that environments that need to polyfill have a chance to do so\n if (!getRandomValues) {\n // getRandomValues needs to be invoked in a context where \"this\" is a Crypto implementation.\n getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);\n\n if (!getRandomValues) {\n throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');\n }\n }\n\n return getRandomValues(rnds8);\n}","import validate from './validate.js';\n/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\n\nconst byteToHex = [];\n\nfor (let i = 0; i < 256; ++i) {\n byteToHex.push((i + 0x100).toString(16).slice(1));\n}\n\nexport function unsafeStringify(arr, offset = 0) {\n // Note: Be careful editing this code! It's been tuned for performance\n // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434\n return (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase();\n}\n\nfunction stringify(arr, offset = 0) {\n const uuid = unsafeStringify(arr, offset); // Consistency check for valid UUID. If this throws, it's likely due to one\n // of the following:\n // - One or more input array values don't map to a hex octet (leading to\n // \"undefined\" in the uuid)\n // - Invalid input values for the RFC `version` or `variant` fields\n\n if (!validate(uuid)) {\n throw TypeError('Stringified UUID is invalid');\n }\n\n return uuid;\n}\n\nexport default stringify;","const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);\nexport default {\n randomUUID\n};","import native from './native.js';\nimport rng from './rng.js';\nimport { unsafeStringify } from './stringify.js';\n\nfunction v4(options, buf, offset) {\n if (native.randomUUID && !buf && !options) {\n return native.randomUUID();\n }\n\n options = options || {};\n const rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n\n rnds[6] = rnds[6] & 0x0f | 0x40;\n rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided\n\n if (buf) {\n offset = offset || 0;\n\n for (let i = 0; i < 16; ++i) {\n buf[offset + i] = rnds[i];\n }\n\n return buf;\n }\n\n return unsafeStringify(rnds);\n}\n\nexport default v4;","var f=Object.defineProperty;var u=(n,t,e)=>t in n?f(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var i=(n,t,e)=>(u(n,typeof t!=\"symbol\"?t+\"\":t,e),e);var o=(n,t,e)=>new Promise((a,s)=>{var d=r=>{try{p(e.next(r))}catch(h){s(h)}},l=r=>{try{p(e.throw(r))}catch(h){s(h)}},p=r=>r.done?a(r.value):Promise.resolve(r.value).then(d,l);p((e=e.apply(n,t)).next())});import{v4 as y}from\"uuid\";var m=class{constructor({applicationId:t,config:e,containerId:a,dimensions:s,host:d=\"https://embed.editframe.com\",mode:l,playerControls:p=!0,playerLoop:r=!1}){i(this,\"applicationId\");i(this,\"config\");i(this,\"container\");i(this,\"dimensions\");i(this,\"host\");i(this,\"iFrameId\");i(this,\"mode\");i(this,\"playerLoop\");i(this,\"playerState\");i(this,\"playerControls\");i(this,\"editframeLogo\");i(this,\"iFrame\");i(this,\"readyMediaIds\",[]);i(this,\"updateConfig\",t=>o(this,null,function*(){this.config=t,yield this.sendCallWithValue(\"setConfig\",{config:this.config,iFrameId:this.iFrameId})}));i(this,\"setupContainer\",t=>{t.style.alignItems=\"center\",t.style.display=\"flex\",t.style.justifyContent=\"center\",t.style.height=\"100%\",t.style.width=\"100%\"});i(this,\"setupEditframeLogo\",()=>{var e;let t=document.createElement(\"img\");return t.src=\"https://cdn.editframe.com/web/logo_white.png\",t.style.position=\"absolute\",t.style.transition=\"opacity 0.5s\",(e=this.container)==null||e.appendChild(t),this.editframeLogo=t,t});i(this,\"setupIFrame\",()=>{var s,d,l;let t=document.createElement(\"iframe\"),a=`${this.host}/${this.applicationId}?mode=${this.mode}`;return this.playerControls||(a=`${a}&hideControls`),this.playerLoop&&(a=`${a}&loop`),t.setAttribute(\"loading\",\"lazy\"),t.setAttribute(\"src\",a),t.style.width=((s=this.dimensions)==null?void 0:s.width)||\"100%\",t.style.height=((d=this.dimensions)==null?void 0:d.height)||\"100%\",t.style.border=\"none\",t.style.outline=\"none\",t.style.transition=\"opacity 0.5s\",t.scrolling=\"no\",t.frameBorder=\"0\",(l=this.container)==null||l.appendChild(t),this.iFrame=t,t});i(this,\"setupEventListeners\",()=>{window.addEventListener(\"message\",t=>o(this,null,function*(){if(t.data&&t.data.config&&t.data.iFrameId===this.iFrameId){let{data:{config:e}}=t;this.config=e}if(t.data&&t.data.pageLoaded&&(yield this.handlePageLoaded()),!(t.data&&t.data.iFrameId&&t.data.iFrameId!==this.iFrameId)){if(t.data&&t.data.iFrameReady&&(yield this.handleIframeReady()),t.data&&t.data.editorReady&&(yield this.handleEditorReady()),t.data&&t.data.playerState&&(this.playerState=t.data.playerState),t.data&&t.data.layerId){let{data:{layerId:e}}=t;this.readyMediaIds.includes(e)||this.readyMediaIds.push(e)}if(this.config){let a=this.config.layers.filter(s=>\"source\"in s).map(s=>s.id).every(s=>this.readyMediaIds.includes(s));(this.config.layers.length===0||a)&&this.handleEditorReady()}}}))});i(this,\"handlePageLoaded\",()=>o(this,null,function*(){yield this.sendCallWithValue(\"setIframeId\",{iFrameId:this.iFrameId})}));i(this,\"handleIframeReady\",()=>o(this,null,function*(){this.config&&(yield this.sendCallWithValue(\"setConfig\",{config:this.config,iFrameId:this.iFrameId}))}));i(this,\"handleEditorReady\",()=>o(this,null,function*(){setTimeout(()=>{this.editframeLogo.remove()},500)}));if(this.applicationId=t,this.config=e,this.container=document.getElementById(a),this.dimensions=s,this.host=d,this.iFrameId=y().slice(0,6),this.mode=l||\"preview\",this.playerControls=p,this.playerLoop=r,this.playerState=\"stopped\",!this.container)throw new Error(`Container #${a} not found`);this.setupContainer(this.container),this.setupEditframeLogo(),this.setupIFrame(),this.setupEventListeners()}sendCallWithValue(t,e){return o(this,null,function*(){return this.iFrame.contentWindow?(this.iFrame.contentWindow.postMessage({call:t,value:e},\"*\"),!0):!1})}},c=m;var g=class{constructor({applicationId:t,config:e,containerId:a,dimensions:s,hideControls:d=!1,host:l,loop:p=!1,mode:r}){i(this,\"state\");i(this,\"v\");i(this,\"updateConfig\",t=>o(this,null,function*(){yield this.v.sendCallWithValue(\"setConfig\",{config:t,iFrameId:this.v.iFrameId})}));i(this,\"play\",()=>o(this,null,function*(){yield this.setState(\"playing\")}));i(this,\"pause\",()=>o(this,null,function*(){yield this.setState(\"paused\")}));i(this,\"stop\",()=>o(this,null,function*(){yield this.setState(\"stopped\")}));i(this,\"seek\",t=>o(this,null,function*(){yield this.v.sendCallWithValue(\"setPlayerSeek\",{seconds:t,iFrameId:this.v.iFrameId})}));i(this,\"setLoadingState\",t=>o(this,null,function*(){yield this.v.sendCallWithValue(\"setLoadingState\",{state:t,iFrameId:this.v.iFrameId})}));i(this,\"setState\",t=>o(this,null,function*(){yield this.v.sendCallWithValue(\"setPlayerState\",{state:t,iFrameId:this.v.iFrameId}),this.state=t}));let h=document.getElementById(a);if(this.state=\"stopped\",!h)throw new Error(`Container #${a} not found`);this.v=new c({applicationId:t,config:e,containerId:a,dimensions:s,host:l||\"https://embed.editframe.com\",playerControls:!d,playerLoop:p,mode:r})}},I=g;export{c as Embed,I as Player};\n","import { Player as PlayerClass } from '@editframe/embed'\nimport React, {\n DetailedHTMLProps,\n FunctionComponent,\n HTMLAttributes,\n useEffect,\n useRef,\n} from 'react'\nimport { v4 as uuid } from 'uuid'\n\nimport { CompositionConfigEditor } from './shared'\n\nexport interface IPlayerProps\n extends DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement> {\n applicationId?: string\n config: CompositionConfigEditor\n dimensions?: {\n height: string\n width: string\n }\n hideControls?: boolean\n host?: string\n loop: boolean\n playerState?: 'playing' | 'paused' | 'stopped'\n seek?: number\n loading?: boolean\n mode?: string\n}\n\nconst Player: FunctionComponent<IPlayerProps> = ({\n applicationId,\n children,\n config,\n dimensions,\n hideControls,\n host,\n loading,\n loop,\n mode,\n playerState,\n seek\n}) => {\n const player = useRef(false)\n const ref = useRef(null)\n const embed = useRef({} as any)\n const containerId = `ef-player-${uuid().slice(0, 6)}`\n useEffect(() => {\n if (!player.current && !embed.current.setState) {\n embed.current = new PlayerClass({\n applicationId,\n config,\n containerId,\n dimensions,\n host: host || 'https://embed.editframe.com',\n hideControls,\n loop,\n mode\n })\n player.current = true\n }\n return () => {\n player.current = false\n }\n }, [])\n useEffect(() => {\n if (embed.current && embed.current.setState) {\n embed.current.setState(playerState)\n }\n return () => {\n if (embed.current && embed.current.setState) {\n embed.current.setState('stopped')\n }\n }\n }, [playerState])\n useEffect(() => {\n if (embed.current && embed.current.setState) {\n embed.current.seek(seek)\n }\n return () => {\n if (embed.current && embed.current.setState) {\n embed.current.seek(0)\n }\n }\n }, [seek])\n useEffect(() => {\n if (embed.current && embed.current.setState) {\n embed.current.setLoadingState(loading)\n }\n return () => {\n if (embed.current && embed.current.setState) {\n embed.current.setLoadingState(false)\n }\n }\n }, [loading])\n useEffect(() => {\n if (embed.current && embed.current.setState) {\n embed.current.setLoadingState(true)\n embed.current.updateConfig(config)\n embed.current.setLoadingState(false)\n }\n return () => { }\n }, [config])\n\n\n return <div style={{ backgroundColor: \"black\" }} id={containerId} ref={ref}>{children}</div>\n}\n\n\nexport default Player\n"],"names":["y","uuid","PlayerClass"],"mappings":";;AAAA;AACA;AACA;AACA,IAAI,eAAe,CAAC;AACpB,MAAM,KAAK,GAAG,IAAI,UAAU,CAAC,EAAE,CAAC,CAAC;AAClB,SAAS,GAAG,GAAG;AAC9B;AACA,EAAE,IAAI,CAAC,eAAe,EAAE;AACxB;AACA,IAAI,eAAe,GAAG,OAAO,MAAM,KAAK,WAAW,IAAI,MAAM,CAAC,eAAe,IAAI,MAAM,CAAC,eAAe,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AACrH;AACA,IAAI,IAAI,CAAC,eAAe,EAAE;AAC1B,MAAM,MAAM,IAAI,KAAK,CAAC,0GAA0G,CAAC,CAAC;AAClI,KAAK;AACL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ACvC;QACD,OAAO;YACL,IAAI,KAAK,CAAC,OAAO,IAAI,KAAK,CAAC,OAAO,CAAC,QAAQ,EAAE;gBAC3C,KAAK,CAAC,OAAO,CAAC,eAAe,CAAC,KAAK,CAAC,CAAA;aACrC;SACF,CAAA;KACF,EAAE,CAAC,OAAO,CAAC,CAAC,CAAA;IACb,SAAS,CAAC;QACR,IAAI,KAAK,CAAC,OAAO,IAAI,KAAK,CAAC,OAAO,CAAC,QAAQ,EAAE;YAC3C,KAAK,CAAC,OAAO,CAAC,eAAe,CAAC,IAAI,CAAC,CAAA;YACnC,KAAK,CAAC,OAAO,CAAC,YAAY,CAAC,MAAM,CAAC,CAAA;YAClC,KAAK,CAAC,OAAO,CAAC,eAAe,CAAC,KAAK,CAAC,CAAA;SACrC;QACD,OAAO,eAAS,CAAA;KACjB,EAAE,CAAC,MAAM,CAAC,CAAC,CAAA;IAGZ,OAAO,6BAAK,KAAK,EAAE,EAAE,eAAe,EAAE,OAAO,EAAE,EAAE,EAAE,EAAE,WAAW,EAAE,GAAG,EAAE,GAAG,IAAG,QAAQ,CAAO,CAAA;AAC9F;;;;"}
package/dist/index.js CHANGED
@@ -73,11 +73,12 @@ function v4(options, buf, offset) {
73
73
  return unsafeStringify(rnds);
74
74
  }
75
75
 
76
- var g=Object.defineProperty;var y=(r,t,e)=>t in r?g(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e;var i=(r,t,e)=>(y(r,typeof t!="symbol"?t+"":t,e),e);var o=(r,t,e)=>new Promise((a,s)=>{var d=n=>{try{p(e.next(n));}catch(h){s(h);}},l=n=>{try{p(e.throw(n));}catch(h){s(h);}},p=n=>n.done?a(n.value):Promise.resolve(n.value).then(d,l);p((e=e.apply(r,t)).next());});var m=class{constructor({applicationId:t,config:e,containerId:a,dimensions:s,host:d="https://embed.editframe.com",playerControls:l=!0,playerLoop:p=!1}){i(this,"applicationId");i(this,"config");i(this,"container");i(this,"dimensions");i(this,"host");i(this,"iFrameId");i(this,"mode");i(this,"playerLoop");i(this,"playerState");i(this,"playerControls");i(this,"editframeLogo");i(this,"iFrame");i(this,"readyMediaIds",[]);i(this,"updateConfig",t=>o(this,null,function*(){this.config=t,yield this.sendCallWithValue("setConfig",{config:this.config,iFrameId:this.iFrameId});}));i(this,"setupContainer",t=>{t.style.alignItems="center",t.style.display="flex",t.style.justifyContent="center",t.style.height="100%",t.style.width="100%";});i(this,"setupEditframeLogo",()=>{var e;let t=document.createElement("img");return t.src="https://cdn.editframe.com/web/logo_white.png",t.style.position="absolute",t.style.transition="opacity 0.5s",(e=this.container)==null||e.appendChild(t),this.editframeLogo=t,t});i(this,"setupIFrame",()=>{var s,d,l;let t=document.createElement("iframe"),a=`${this.host}/${this.applicationId}?mode=${this.mode}`;return this.playerControls||(a=`${a}&hideControls`),this.playerLoop&&(a=`${a}&loop`),t.setAttribute("loading","lazy"),t.setAttribute("src",a),t.style.width=((s=this.dimensions)==null?void 0:s.width)||"100%",t.style.height=((d=this.dimensions)==null?void 0:d.height)||"100%",t.style.opacity="0",t.style.border="none",t.style.outline="none",t.style.transition="opacity 0.5s",(l=this.container)==null||l.appendChild(t),this.iFrame=t,t});i(this,"setupEventListeners",()=>{window.addEventListener("message",t=>o(this,null,function*(){if(t.data&&t.data.config&&t.data.iFrameId===this.iFrameId){let{data:{config:e}}=t;this.config=e;}if(t.data&&t.data.pageLoaded&&(yield this.handlePageLoaded()),!(t.data&&t.data.iFrameId&&t.data.iFrameId!==this.iFrameId)){if(t.data&&t.data.iFrameReady&&(yield this.handleIframeReady()),t.data&&t.data.editorReady&&(yield this.handleEditorReady()),t.data&&t.data.playerState&&(this.playerState=t.data.playerState),t.data&&t.data.layerId){let{data:{layerId:e}}=t;this.readyMediaIds.includes(e)||this.readyMediaIds.push(e);}if(this.config){let a=this.config.layers.filter(s=>"source"in s).map(s=>s.id).every(s=>this.readyMediaIds.includes(s));(this.config.layers.length===0||a)&&this.handleEditorReady();}}}));});i(this,"handlePageLoaded",()=>o(this,null,function*(){yield this.sendCallWithValue("setIframeId",{iFrameId:this.iFrameId});}));i(this,"handleIframeReady",()=>o(this,null,function*(){this.config&&(yield this.sendCallWithValue("setConfig",{config:this.config,iFrameId:this.iFrameId}));}));i(this,"handleEditorReady",()=>o(this,null,function*(){this.iFrame.style.opacity="1",this.editframeLogo.style.opacity="0",setTimeout(()=>{this.editframeLogo.remove();},500);}));if(this.applicationId=t,this.config=e,this.container=document.getElementById(a),this.dimensions=s,this.host=d,this.iFrameId=v4().slice(0,6),this.mode="preview",this.playerControls=l,this.playerLoop=p,this.playerState="stopped",!this.container)throw new Error(`Container #${a} not found`);this.setupContainer(this.container),this.setupEditframeLogo(),this.setupIFrame(),this.setupEventListeners();}sendCallWithValue(t,e){return o(this,null,function*(){return this.iFrame.contentWindow?(this.iFrame.contentWindow.postMessage({call:t,value:e},"*"),!0):!1})}},c=m;var f=class{constructor({applicationId:t,config:e,containerId:a,dimensions:s,hideControls:d=!1,host:l,loop:p=!1}){i(this,"state");i(this,"v");i(this,"updateConfig",t=>o(this,null,function*(){yield this.v.sendCallWithValue("setConfig",{config:t,iFrameId:this.v.iFrameId});}));i(this,"play",()=>o(this,null,function*(){yield this.setState("playing");}));i(this,"pause",()=>o(this,null,function*(){yield this.setState("paused");}));i(this,"stop",()=>o(this,null,function*(){yield this.setState("stopped");}));i(this,"seek",t=>o(this,null,function*(){yield this.v.sendCallWithValue("setPlayerSeek",{seconds:t,iFrameId:this.v.iFrameId});}));i(this,"setState",t=>o(this,null,function*(){yield this.v.sendCallWithValue("setPlayerState",{state:t,iFrameId:this.v.iFrameId}),this.state=t;}));let n=document.getElementById(a);if(this.state="stopped",!n)throw new Error(`Container #${a} not found`);this.v=new c({applicationId:t,config:e,containerId:a,dimensions:s,host:l||"https://embed.editframe.com",playerControls:!d,playerLoop:p});}},I=f;
76
+ var f=Object.defineProperty;var u=(n,t,e)=>t in n?f(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var i=(n,t,e)=>(u(n,typeof t!="symbol"?t+"":t,e),e);var o=(n,t,e)=>new Promise((a,s)=>{var d=r=>{try{p(e.next(r));}catch(h){s(h);}},l=r=>{try{p(e.throw(r));}catch(h){s(h);}},p=r=>r.done?a(r.value):Promise.resolve(r.value).then(d,l);p((e=e.apply(n,t)).next());});var m=class{constructor({applicationId:t,config:e,containerId:a,dimensions:s,host:d="https://embed.editframe.com",mode:l,playerControls:p=!0,playerLoop:r=!1}){i(this,"applicationId");i(this,"config");i(this,"container");i(this,"dimensions");i(this,"host");i(this,"iFrameId");i(this,"mode");i(this,"playerLoop");i(this,"playerState");i(this,"playerControls");i(this,"editframeLogo");i(this,"iFrame");i(this,"readyMediaIds",[]);i(this,"updateConfig",t=>o(this,null,function*(){this.config=t,yield this.sendCallWithValue("setConfig",{config:this.config,iFrameId:this.iFrameId});}));i(this,"setupContainer",t=>{t.style.alignItems="center",t.style.display="flex",t.style.justifyContent="center",t.style.height="100%",t.style.width="100%";});i(this,"setupEditframeLogo",()=>{var e;let t=document.createElement("img");return t.src="https://cdn.editframe.com/web/logo_white.png",t.style.position="absolute",t.style.transition="opacity 0.5s",(e=this.container)==null||e.appendChild(t),this.editframeLogo=t,t});i(this,"setupIFrame",()=>{var s,d,l;let t=document.createElement("iframe"),a=`${this.host}/${this.applicationId}?mode=${this.mode}`;return this.playerControls||(a=`${a}&hideControls`),this.playerLoop&&(a=`${a}&loop`),t.setAttribute("loading","lazy"),t.setAttribute("src",a),t.style.width=((s=this.dimensions)==null?void 0:s.width)||"100%",t.style.height=((d=this.dimensions)==null?void 0:d.height)||"100%",t.style.border="none",t.style.outline="none",t.style.transition="opacity 0.5s",t.scrolling="no",t.frameBorder="0",(l=this.container)==null||l.appendChild(t),this.iFrame=t,t});i(this,"setupEventListeners",()=>{window.addEventListener("message",t=>o(this,null,function*(){if(t.data&&t.data.config&&t.data.iFrameId===this.iFrameId){let{data:{config:e}}=t;this.config=e;}if(t.data&&t.data.pageLoaded&&(yield this.handlePageLoaded()),!(t.data&&t.data.iFrameId&&t.data.iFrameId!==this.iFrameId)){if(t.data&&t.data.iFrameReady&&(yield this.handleIframeReady()),t.data&&t.data.editorReady&&(yield this.handleEditorReady()),t.data&&t.data.playerState&&(this.playerState=t.data.playerState),t.data&&t.data.layerId){let{data:{layerId:e}}=t;this.readyMediaIds.includes(e)||this.readyMediaIds.push(e);}if(this.config){let a=this.config.layers.filter(s=>"source"in s).map(s=>s.id).every(s=>this.readyMediaIds.includes(s));(this.config.layers.length===0||a)&&this.handleEditorReady();}}}));});i(this,"handlePageLoaded",()=>o(this,null,function*(){yield this.sendCallWithValue("setIframeId",{iFrameId:this.iFrameId});}));i(this,"handleIframeReady",()=>o(this,null,function*(){this.config&&(yield this.sendCallWithValue("setConfig",{config:this.config,iFrameId:this.iFrameId}));}));i(this,"handleEditorReady",()=>o(this,null,function*(){setTimeout(()=>{this.editframeLogo.remove();},500);}));if(this.applicationId=t,this.config=e,this.container=document.getElementById(a),this.dimensions=s,this.host=d,this.iFrameId=v4().slice(0,6),this.mode=l||"preview",this.playerControls=p,this.playerLoop=r,this.playerState="stopped",!this.container)throw new Error(`Container #${a} not found`);this.setupContainer(this.container),this.setupEditframeLogo(),this.setupIFrame(),this.setupEventListeners();}sendCallWithValue(t,e){return o(this,null,function*(){return this.iFrame.contentWindow?(this.iFrame.contentWindow.postMessage({call:t,value:e},"*"),!0):!1})}},c=m;var g=class{constructor({applicationId:t,config:e,containerId:a,dimensions:s,hideControls:d=!1,host:l,loop:p=!1,mode:r}){i(this,"state");i(this,"v");i(this,"updateConfig",t=>o(this,null,function*(){yield this.v.sendCallWithValue("setConfig",{config:t,iFrameId:this.v.iFrameId});}));i(this,"play",()=>o(this,null,function*(){yield this.setState("playing");}));i(this,"pause",()=>o(this,null,function*(){yield this.setState("paused");}));i(this,"stop",()=>o(this,null,function*(){yield this.setState("stopped");}));i(this,"seek",t=>o(this,null,function*(){yield this.v.sendCallWithValue("setPlayerSeek",{seconds:t,iFrameId:this.v.iFrameId});}));i(this,"setLoadingState",t=>o(this,null,function*(){yield this.v.sendCallWithValue("setLoadingState",{state:t,iFrameId:this.v.iFrameId});}));i(this,"setState",t=>o(this,null,function*(){yield this.v.sendCallWithValue("setPlayerState",{state:t,iFrameId:this.v.iFrameId}),this.state=t;}));let h=document.getElementById(a);if(this.state="stopped",!h)throw new Error(`Container #${a} not found`);this.v=new c({applicationId:t,config:e,containerId:a,dimensions:s,host:l||"https://embed.editframe.com",playerControls:!d,playerLoop:p,mode:r});}},I=g;
77
77
 
78
78
  var Player = function (_a) {
79
- var applicationId = _a.applicationId, children = _a.children, config = _a.config, dimensions = _a.dimensions, hideControls = _a.hideControls, host = _a.host, loop = _a.loop, playerState = _a.playerState, seek = _a.seek;
80
- var player = React.useRef(true);
79
+ var applicationId = _a.applicationId, children = _a.children, config = _a.config, dimensions = _a.dimensions, hideControls = _a.hideControls, host = _a.host, loading = _a.loading, loop = _a.loop, mode = _a.mode, playerState = _a.playerState, seek = _a.seek;
80
+ var player = React.useRef(false);
81
+ var ref = React.useRef(null);
81
82
  var embed = React.useRef({});
82
83
  var containerId = "ef-player-".concat(v4().slice(0, 6));
83
84
  React.useEffect(function () {
@@ -90,6 +91,7 @@ var Player = function (_a) {
90
91
  host: host || 'https://embed.editframe.com',
91
92
  hideControls: hideControls,
92
93
  loop: loop,
94
+ mode: mode
93
95
  });
94
96
  player.current = true;
95
97
  }
@@ -119,11 +121,23 @@ var Player = function (_a) {
119
121
  }, [seek]);
120
122
  React.useEffect(function () {
121
123
  if (embed.current && embed.current.setState) {
124
+ embed.current.setLoadingState(loading);
125
+ }
126
+ return function () {
127
+ if (embed.current && embed.current.setState) {
128
+ embed.current.setLoadingState(false);
129
+ }
130
+ };
131
+ }, [loading]);
132
+ React.useEffect(function () {
133
+ if (embed.current && embed.current.setState) {
134
+ embed.current.setLoadingState(true);
122
135
  embed.current.updateConfig(config);
136
+ embed.current.setLoadingState(false);
123
137
  }
124
138
  return function () { };
125
139
  }, [config]);
126
- return React__default["default"].createElement("div", { id: containerId }, children);
140
+ return React__default['default'].createElement("div", { style: { backgroundColor: "black" }, id: containerId, ref: ref }, children);
127
141
  };
128
142
 
129
143
  exports.Player = Player;
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../node_modules/.pnpm/uuid@9.0.0/node_modules/uuid/dist/esm-browser/rng.js","../../../node_modules/.pnpm/uuid@9.0.0/node_modules/uuid/dist/esm-browser/stringify.js","../../../node_modules/.pnpm/uuid@9.0.0/node_modules/uuid/dist/esm-browser/native.js","../../../node_modules/.pnpm/uuid@9.0.0/node_modules/uuid/dist/esm-browser/v4.js","../../embed/dist/index.mjs","../src/Player.tsx"],"sourcesContent":["// Unique ID creation requires a high quality random # generator. In the browser we therefore\n// require the crypto API and do not support built-in fallback to lower quality random number\n// generators (like Math.random()).\nlet getRandomValues;\nconst rnds8 = new Uint8Array(16);\nexport default function rng() {\n // lazy load so that environments that need to polyfill have a chance to do so\n if (!getRandomValues) {\n // getRandomValues needs to be invoked in a context where \"this\" is a Crypto implementation.\n getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);\n\n if (!getRandomValues) {\n throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');\n }\n }\n\n return getRandomValues(rnds8);\n}","import validate from './validate.js';\n/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\n\nconst byteToHex = [];\n\nfor (let i = 0; i < 256; ++i) {\n byteToHex.push((i + 0x100).toString(16).slice(1));\n}\n\nexport function unsafeStringify(arr, offset = 0) {\n // Note: Be careful editing this code! It's been tuned for performance\n // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434\n return (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase();\n}\n\nfunction stringify(arr, offset = 0) {\n const uuid = unsafeStringify(arr, offset); // Consistency check for valid UUID. If this throws, it's likely due to one\n // of the following:\n // - One or more input array values don't map to a hex octet (leading to\n // \"undefined\" in the uuid)\n // - Invalid input values for the RFC `version` or `variant` fields\n\n if (!validate(uuid)) {\n throw TypeError('Stringified UUID is invalid');\n }\n\n return uuid;\n}\n\nexport default stringify;","const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);\nexport default {\n randomUUID\n};","import native from './native.js';\nimport rng from './rng.js';\nimport { unsafeStringify } from './stringify.js';\n\nfunction v4(options, buf, offset) {\n if (native.randomUUID && !buf && !options) {\n return native.randomUUID();\n }\n\n options = options || {};\n const rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n\n rnds[6] = rnds[6] & 0x0f | 0x40;\n rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided\n\n if (buf) {\n offset = offset || 0;\n\n for (let i = 0; i < 16; ++i) {\n buf[offset + i] = rnds[i];\n }\n\n return buf;\n }\n\n return unsafeStringify(rnds);\n}\n\nexport default v4;","var g=Object.defineProperty;var y=(r,t,e)=>t in r?g(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e;var i=(r,t,e)=>(y(r,typeof t!=\"symbol\"?t+\"\":t,e),e);var o=(r,t,e)=>new Promise((a,s)=>{var d=n=>{try{p(e.next(n))}catch(h){s(h)}},l=n=>{try{p(e.throw(n))}catch(h){s(h)}},p=n=>n.done?a(n.value):Promise.resolve(n.value).then(d,l);p((e=e.apply(r,t)).next())});import{v4 as u}from\"uuid\";var m=class{constructor({applicationId:t,config:e,containerId:a,dimensions:s,host:d=\"https://embed.editframe.com\",playerControls:l=!0,playerLoop:p=!1}){i(this,\"applicationId\");i(this,\"config\");i(this,\"container\");i(this,\"dimensions\");i(this,\"host\");i(this,\"iFrameId\");i(this,\"mode\");i(this,\"playerLoop\");i(this,\"playerState\");i(this,\"playerControls\");i(this,\"editframeLogo\");i(this,\"iFrame\");i(this,\"readyMediaIds\",[]);i(this,\"updateConfig\",t=>o(this,null,function*(){this.config=t,yield this.sendCallWithValue(\"setConfig\",{config:this.config,iFrameId:this.iFrameId})}));i(this,\"setupContainer\",t=>{t.style.alignItems=\"center\",t.style.display=\"flex\",t.style.justifyContent=\"center\",t.style.height=\"100%\",t.style.width=\"100%\"});i(this,\"setupEditframeLogo\",()=>{var e;let t=document.createElement(\"img\");return t.src=\"https://cdn.editframe.com/web/logo_white.png\",t.style.position=\"absolute\",t.style.transition=\"opacity 0.5s\",(e=this.container)==null||e.appendChild(t),this.editframeLogo=t,t});i(this,\"setupIFrame\",()=>{var s,d,l;let t=document.createElement(\"iframe\"),a=`${this.host}/${this.applicationId}?mode=${this.mode}`;return this.playerControls||(a=`${a}&hideControls`),this.playerLoop&&(a=`${a}&loop`),t.setAttribute(\"loading\",\"lazy\"),t.setAttribute(\"src\",a),t.style.width=((s=this.dimensions)==null?void 0:s.width)||\"100%\",t.style.height=((d=this.dimensions)==null?void 0:d.height)||\"100%\",t.style.opacity=\"0\",t.style.border=\"none\",t.style.outline=\"none\",t.style.transition=\"opacity 0.5s\",(l=this.container)==null||l.appendChild(t),this.iFrame=t,t});i(this,\"setupEventListeners\",()=>{window.addEventListener(\"message\",t=>o(this,null,function*(){if(t.data&&t.data.config&&t.data.iFrameId===this.iFrameId){let{data:{config:e}}=t;this.config=e}if(t.data&&t.data.pageLoaded&&(yield this.handlePageLoaded()),!(t.data&&t.data.iFrameId&&t.data.iFrameId!==this.iFrameId)){if(t.data&&t.data.iFrameReady&&(yield this.handleIframeReady()),t.data&&t.data.editorReady&&(yield this.handleEditorReady()),t.data&&t.data.playerState&&(this.playerState=t.data.playerState),t.data&&t.data.layerId){let{data:{layerId:e}}=t;this.readyMediaIds.includes(e)||this.readyMediaIds.push(e)}if(this.config){let a=this.config.layers.filter(s=>\"source\"in s).map(s=>s.id).every(s=>this.readyMediaIds.includes(s));(this.config.layers.length===0||a)&&this.handleEditorReady()}}}))});i(this,\"handlePageLoaded\",()=>o(this,null,function*(){yield this.sendCallWithValue(\"setIframeId\",{iFrameId:this.iFrameId})}));i(this,\"handleIframeReady\",()=>o(this,null,function*(){this.config&&(yield this.sendCallWithValue(\"setConfig\",{config:this.config,iFrameId:this.iFrameId}))}));i(this,\"handleEditorReady\",()=>o(this,null,function*(){this.iFrame.style.opacity=\"1\",this.editframeLogo.style.opacity=\"0\",setTimeout(()=>{this.editframeLogo.remove()},500)}));if(this.applicationId=t,this.config=e,this.container=document.getElementById(a),this.dimensions=s,this.host=d,this.iFrameId=u().slice(0,6),this.mode=\"preview\",this.playerControls=l,this.playerLoop=p,this.playerState=\"stopped\",!this.container)throw new Error(`Container #${a} not found`);this.setupContainer(this.container),this.setupEditframeLogo(),this.setupIFrame(),this.setupEventListeners()}sendCallWithValue(t,e){return o(this,null,function*(){return this.iFrame.contentWindow?(this.iFrame.contentWindow.postMessage({call:t,value:e},\"*\"),!0):!1})}},c=m;var f=class{constructor({applicationId:t,config:e,containerId:a,dimensions:s,hideControls:d=!1,host:l,loop:p=!1}){i(this,\"state\");i(this,\"v\");i(this,\"updateConfig\",t=>o(this,null,function*(){yield this.v.sendCallWithValue(\"setConfig\",{config:t,iFrameId:this.v.iFrameId})}));i(this,\"play\",()=>o(this,null,function*(){yield this.setState(\"playing\")}));i(this,\"pause\",()=>o(this,null,function*(){yield this.setState(\"paused\")}));i(this,\"stop\",()=>o(this,null,function*(){yield this.setState(\"stopped\")}));i(this,\"seek\",t=>o(this,null,function*(){yield this.v.sendCallWithValue(\"setPlayerSeek\",{seconds:t,iFrameId:this.v.iFrameId})}));i(this,\"setState\",t=>o(this,null,function*(){yield this.v.sendCallWithValue(\"setPlayerState\",{state:t,iFrameId:this.v.iFrameId}),this.state=t}));let n=document.getElementById(a);if(this.state=\"stopped\",!n)throw new Error(`Container #${a} not found`);this.v=new c({applicationId:t,config:e,containerId:a,dimensions:s,host:l||\"https://embed.editframe.com\",playerControls:!d,playerLoop:p})}},I=f;export{c as Embed,I as Player};\n","import { Player as PlayerClass } from '@editframe/embed'\nimport React, {\n DetailedHTMLProps,\n FunctionComponent,\n HTMLAttributes,\n useEffect,\n useRef,\n} from 'react'\nimport { v4 as uuid } from 'uuid'\n\nimport { CompositionConfigEditor } from './shared'\n\nexport interface IPlayerProps\n extends DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement> {\n applicationId?: string\n config: CompositionConfigEditor\n dimensions?: {\n height: string\n width: string\n }\n hideControls?: boolean\n host?: string\n loop: boolean\n playerState?: 'playing' | 'paused' | 'stopped'\n seek?: number\n}\n\nconst Player: FunctionComponent<IPlayerProps> = ({\n applicationId,\n children,\n config,\n dimensions,\n hideControls,\n host,\n loop,\n playerState,\n seek,\n}) => {\n const player = useRef(true)\n const embed = useRef({} as any)\n const containerId = `ef-player-${uuid().slice(0, 6)}`\n useEffect(() => {\n if (!player.current && !embed.current.setState) {\n embed.current = new PlayerClass({\n applicationId,\n config,\n containerId,\n dimensions,\n host: host || 'https://embed.editframe.com',\n hideControls,\n loop,\n })\n player.current = true\n }\n return () => {\n player.current = false\n }\n }, [])\n useEffect(() => {\n if (embed.current && embed.current.setState) {\n embed.current.setState(playerState)\n }\n return () => {\n if (embed.current && embed.current.setState) {\n embed.current.setState('stopped')\n }\n }\n }, [playerState])\n useEffect(() => {\n if (embed.current && embed.current.setState) {\n embed.current.seek(seek)\n }\n return () => {\n if (embed.current && embed.current.setState) {\n embed.current.seek(0)\n }\n }\n }, [seek])\n useEffect(() => {\n if (embed.current && embed.current.setState) {\n embed.current.updateConfig(config)\n }\n return () => {}\n }, [config])\n\n return <div id={containerId}>{children}</div>\n}\nexport default Player\n"],"names":["u","useRef","uuid","useEffect","PlayerClass","React"],"mappings":";;;;;;;;;;AAAA;AACA;AACA;AACA,IAAI,eAAe,CAAC;AACpB,MAAM,KAAK,GAAG,IAAI,UAAU,CAAC,EAAE,CAAC,CAAC;AAClB,SAAS,GAAG,GAAG;AAC9B;AACA,EAAE,IAAI,CAAC,eAAe,EAAE;AACxB;AACA,IAAI,eAAe,GAAG,OAAO,MAAM,KAAK,WAAW,IAAI,MAAM,CAAC,eAAe,IAAI,MAAM,CAAC,eAAe,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AACrH;AACA,IAAI,IAAI,CAAC,eAAe,EAAE;AAC1B,MAAM,MAAM,IAAI,KAAK,CAAC,0GAA0G,CAAC,CAAC;AAClI,KAAK;AACL,GAAG;AACH;AACA,EAAE,OAAO,eAAe,CAAC,KAAK,CAAC,CAAC;AAChC;;AChBA;AACA;AACA;AACA;AACA;AACA,MAAM,SAAS,GAAG,EAAE,CAAC;AACrB;AACA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,EAAE,EAAE,CAAC,EAAE;AAC9B,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,KAAK,EAAE,QAAQ,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;AACpD,CAAC;AACD;AACO,SAAS,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,CAAC,EAAE;AACjD;AACA;AACA,EAAE,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,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AAA;AAClC,aAAA;AACH,SAAC,CAAA;AACH,KAAC,EAAE,CAAC,WAAW,CAAC,CAAC,CAAA;AACjB,IAAAA,eAAS,CAAC,YAAA;QACR,IAAI,KAAK,CAAC,OAAO,IAAI,KAAK,CAAC,OAAO,CAAC,QAAQ,EAAE;AAC3C,YAAA,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AACzB,SAAA;QACD,OAAO,YAAA;YACL,IAAI,KAAK,CAAC,OAAO,IAAI,KAAK,CAAC,OAAO,CAAC,QAAQ,EAAE;AAC3C,gBAAA,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;AACtB,aAAA;AACH,SAAC,CAAA;AACH,KAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAA;AACV,IAAAA,eAAS,CAAC,YAAA;QACR,IAAI,KAAK,CAAC,OAAO,IAAI,KAAK,CAAC,OAAO,CAAC,QAAQ,EAAE;AAC3C,YAAA,KAAK,CAAC,OAAO,CAAC,YAAY,CAAC,MAAM,CAAC,CAAA;AACnC,SAAA;QACD,OAAO,YAAA,GAAQ,CAAA;AACjB,KAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAA;AAEZ,IAAA,OAAOE,iDAAK,EAAE,EAAE,WAAW,EAAG,EAAA,QAAQ,CAAO,CAAA;AAC/C;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../node_modules/.pnpm/uuid@9.0.0/node_modules/uuid/dist/esm-browser/rng.js","../../../node_modules/.pnpm/uuid@9.0.0/node_modules/uuid/dist/esm-browser/stringify.js","../../../node_modules/.pnpm/uuid@9.0.0/node_modules/uuid/dist/esm-browser/native.js","../../../node_modules/.pnpm/uuid@9.0.0/node_modules/uuid/dist/esm-browser/v4.js","../../embed/dist/index.mjs","../src/Player.tsx"],"sourcesContent":["// Unique ID creation requires a high quality random # generator. In the browser we therefore\n// require the crypto API and do not support built-in fallback to lower quality random number\n// generators (like Math.random()).\nlet getRandomValues;\nconst rnds8 = new Uint8Array(16);\nexport default function rng() {\n // lazy load so that environments that need to polyfill have a chance to do so\n if (!getRandomValues) {\n // getRandomValues needs to be invoked in a context where \"this\" is a Crypto implementation.\n getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);\n\n if (!getRandomValues) {\n throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');\n }\n }\n\n return getRandomValues(rnds8);\n}","import validate from './validate.js';\n/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\n\nconst byteToHex = [];\n\nfor (let i = 0; i < 256; ++i) {\n byteToHex.push((i + 0x100).toString(16).slice(1));\n}\n\nexport function unsafeStringify(arr, offset = 0) {\n // Note: Be careful editing this code! It's been tuned for performance\n // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434\n return (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase();\n}\n\nfunction stringify(arr, offset = 0) {\n const uuid = unsafeStringify(arr, offset); // Consistency check for valid UUID. If this throws, it's likely due to one\n // of the following:\n // - One or more input array values don't map to a hex octet (leading to\n // \"undefined\" in the uuid)\n // - Invalid input values for the RFC `version` or `variant` fields\n\n if (!validate(uuid)) {\n throw TypeError('Stringified UUID is invalid');\n }\n\n return uuid;\n}\n\nexport default stringify;","const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);\nexport default {\n randomUUID\n};","import native from './native.js';\nimport rng from './rng.js';\nimport { unsafeStringify } from './stringify.js';\n\nfunction v4(options, buf, offset) {\n if (native.randomUUID && !buf && !options) {\n return native.randomUUID();\n }\n\n options = options || {};\n const rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n\n rnds[6] = rnds[6] & 0x0f | 0x40;\n rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided\n\n if (buf) {\n offset = offset || 0;\n\n for (let i = 0; i < 16; ++i) {\n buf[offset + i] = rnds[i];\n }\n\n return buf;\n }\n\n return unsafeStringify(rnds);\n}\n\nexport default v4;","var f=Object.defineProperty;var u=(n,t,e)=>t in n?f(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var i=(n,t,e)=>(u(n,typeof t!=\"symbol\"?t+\"\":t,e),e);var o=(n,t,e)=>new Promise((a,s)=>{var d=r=>{try{p(e.next(r))}catch(h){s(h)}},l=r=>{try{p(e.throw(r))}catch(h){s(h)}},p=r=>r.done?a(r.value):Promise.resolve(r.value).then(d,l);p((e=e.apply(n,t)).next())});import{v4 as y}from\"uuid\";var m=class{constructor({applicationId:t,config:e,containerId:a,dimensions:s,host:d=\"https://embed.editframe.com\",mode:l,playerControls:p=!0,playerLoop:r=!1}){i(this,\"applicationId\");i(this,\"config\");i(this,\"container\");i(this,\"dimensions\");i(this,\"host\");i(this,\"iFrameId\");i(this,\"mode\");i(this,\"playerLoop\");i(this,\"playerState\");i(this,\"playerControls\");i(this,\"editframeLogo\");i(this,\"iFrame\");i(this,\"readyMediaIds\",[]);i(this,\"updateConfig\",t=>o(this,null,function*(){this.config=t,yield this.sendCallWithValue(\"setConfig\",{config:this.config,iFrameId:this.iFrameId})}));i(this,\"setupContainer\",t=>{t.style.alignItems=\"center\",t.style.display=\"flex\",t.style.justifyContent=\"center\",t.style.height=\"100%\",t.style.width=\"100%\"});i(this,\"setupEditframeLogo\",()=>{var e;let t=document.createElement(\"img\");return t.src=\"https://cdn.editframe.com/web/logo_white.png\",t.style.position=\"absolute\",t.style.transition=\"opacity 0.5s\",(e=this.container)==null||e.appendChild(t),this.editframeLogo=t,t});i(this,\"setupIFrame\",()=>{var s,d,l;let t=document.createElement(\"iframe\"),a=`${this.host}/${this.applicationId}?mode=${this.mode}`;return this.playerControls||(a=`${a}&hideControls`),this.playerLoop&&(a=`${a}&loop`),t.setAttribute(\"loading\",\"lazy\"),t.setAttribute(\"src\",a),t.style.width=((s=this.dimensions)==null?void 0:s.width)||\"100%\",t.style.height=((d=this.dimensions)==null?void 0:d.height)||\"100%\",t.style.border=\"none\",t.style.outline=\"none\",t.style.transition=\"opacity 0.5s\",t.scrolling=\"no\",t.frameBorder=\"0\",(l=this.container)==null||l.appendChild(t),this.iFrame=t,t});i(this,\"setupEventListeners\",()=>{window.addEventListener(\"message\",t=>o(this,null,function*(){if(t.data&&t.data.config&&t.data.iFrameId===this.iFrameId){let{data:{config:e}}=t;this.config=e}if(t.data&&t.data.pageLoaded&&(yield this.handlePageLoaded()),!(t.data&&t.data.iFrameId&&t.data.iFrameId!==this.iFrameId)){if(t.data&&t.data.iFrameReady&&(yield this.handleIframeReady()),t.data&&t.data.editorReady&&(yield this.handleEditorReady()),t.data&&t.data.playerState&&(this.playerState=t.data.playerState),t.data&&t.data.layerId){let{data:{layerId:e}}=t;this.readyMediaIds.includes(e)||this.readyMediaIds.push(e)}if(this.config){let a=this.config.layers.filter(s=>\"source\"in s).map(s=>s.id).every(s=>this.readyMediaIds.includes(s));(this.config.layers.length===0||a)&&this.handleEditorReady()}}}))});i(this,\"handlePageLoaded\",()=>o(this,null,function*(){yield this.sendCallWithValue(\"setIframeId\",{iFrameId:this.iFrameId})}));i(this,\"handleIframeReady\",()=>o(this,null,function*(){this.config&&(yield this.sendCallWithValue(\"setConfig\",{config:this.config,iFrameId:this.iFrameId}))}));i(this,\"handleEditorReady\",()=>o(this,null,function*(){setTimeout(()=>{this.editframeLogo.remove()},500)}));if(this.applicationId=t,this.config=e,this.container=document.getElementById(a),this.dimensions=s,this.host=d,this.iFrameId=y().slice(0,6),this.mode=l||\"preview\",this.playerControls=p,this.playerLoop=r,this.playerState=\"stopped\",!this.container)throw new Error(`Container #${a} not found`);this.setupContainer(this.container),this.setupEditframeLogo(),this.setupIFrame(),this.setupEventListeners()}sendCallWithValue(t,e){return o(this,null,function*(){return this.iFrame.contentWindow?(this.iFrame.contentWindow.postMessage({call:t,value:e},\"*\"),!0):!1})}},c=m;var g=class{constructor({applicationId:t,config:e,containerId:a,dimensions:s,hideControls:d=!1,host:l,loop:p=!1,mode:r}){i(this,\"state\");i(this,\"v\");i(this,\"updateConfig\",t=>o(this,null,function*(){yield this.v.sendCallWithValue(\"setConfig\",{config:t,iFrameId:this.v.iFrameId})}));i(this,\"play\",()=>o(this,null,function*(){yield this.setState(\"playing\")}));i(this,\"pause\",()=>o(this,null,function*(){yield this.setState(\"paused\")}));i(this,\"stop\",()=>o(this,null,function*(){yield this.setState(\"stopped\")}));i(this,\"seek\",t=>o(this,null,function*(){yield this.v.sendCallWithValue(\"setPlayerSeek\",{seconds:t,iFrameId:this.v.iFrameId})}));i(this,\"setLoadingState\",t=>o(this,null,function*(){yield this.v.sendCallWithValue(\"setLoadingState\",{state:t,iFrameId:this.v.iFrameId})}));i(this,\"setState\",t=>o(this,null,function*(){yield this.v.sendCallWithValue(\"setPlayerState\",{state:t,iFrameId:this.v.iFrameId}),this.state=t}));let h=document.getElementById(a);if(this.state=\"stopped\",!h)throw new Error(`Container #${a} not found`);this.v=new c({applicationId:t,config:e,containerId:a,dimensions:s,host:l||\"https://embed.editframe.com\",playerControls:!d,playerLoop:p,mode:r})}},I=g;export{c as Embed,I as Player};\n","import { Player as PlayerClass } from '@editframe/embed'\nimport React, {\n DetailedHTMLProps,\n FunctionComponent,\n HTMLAttributes,\n useEffect,\n useRef,\n} from 'react'\nimport { v4 as uuid } from 'uuid'\n\nimport { CompositionConfigEditor } from './shared'\n\nexport interface IPlayerProps\n extends DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement> {\n applicationId?: string\n config: CompositionConfigEditor\n dimensions?: {\n height: string\n width: string\n }\n hideControls?: boolean\n host?: string\n loop: boolean\n playerState?: 'playing' | 'paused' | 'stopped'\n seek?: number\n loading?: boolean\n mode?: string\n}\n\nconst Player: FunctionComponent<IPlayerProps> = ({\n applicationId,\n children,\n config,\n dimensions,\n hideControls,\n host,\n loading,\n loop,\n mode,\n playerState,\n seek\n}) => {\n const player = useRef(false)\n const ref = useRef(null)\n const embed = useRef({} as any)\n const containerId = `ef-player-${uuid().slice(0, 6)}`\n useEffect(() => {\n if (!player.current && !embed.current.setState) {\n embed.current = new PlayerClass({\n applicationId,\n config,\n containerId,\n dimensions,\n host: host || 'https://embed.editframe.com',\n hideControls,\n loop,\n mode\n })\n player.current = true\n }\n return () => {\n player.current = false\n }\n }, [])\n useEffect(() => {\n if (embed.current && embed.current.setState) {\n embed.current.setState(playerState)\n }\n return () => {\n if (embed.current && embed.current.setState) {\n embed.current.setState('stopped')\n }\n }\n }, [playerState])\n useEffect(() => {\n if (embed.current && embed.current.setState) {\n embed.current.seek(seek)\n }\n return () => {\n if (embed.current && embed.current.setState) {\n embed.current.seek(0)\n }\n }\n }, [seek])\n useEffect(() => {\n if (embed.current && embed.current.setState) {\n embed.current.setLoadingState(loading)\n }\n return () => {\n if (embed.current && embed.current.setState) {\n embed.current.setLoadingState(false)\n }\n }\n }, [loading])\n useEffect(() => {\n if (embed.current && embed.current.setState) {\n embed.current.setLoadingState(true)\n embed.current.updateConfig(config)\n embed.current.setLoadingState(false)\n }\n return () => { }\n }, [config])\n\n\n return <div style={{ backgroundColor: \"black\" }} id={containerId} ref={ref}>{children}</div>\n}\n\n\nexport default Player\n"],"names":["y","useRef","uuid","useEffect","PlayerClass","React"],"mappings":";;;;;;;;;;AAAA;AACA;AACA;AACA,IAAI,eAAe,CAAC;AACpB,MAAM,K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ist/**"
39
39
  ],
40
- "version": "0.2.0",
40
+ "version": "0.2.1",
41
+ "publishConfig": {
42
+ "access": "public"
43
+ },
41
44
  "scripts": {
42
45
  "build": "rollup -c",
43
46
  "dev": "npm run build -- --watch",