The Ultimate Video Player For WordPress – by Presto Player - Version 1.6.1

Version Description

  • August 26, 2021 =
  • Fix issue with search term not being sent to server in Divi module.
Download this release

Release Info

Developer 2winfactor
Plugin Icon 128x128 The Ultimate Video Player For WordPress – by Presto Player
Version 1.6.1
Comparing to
See all releases

Code changes from version 1.6.0 to 1.6.1

dist/divi/{admin-d97471fa.js → admin-1a1a82cb.js} RENAMED
@@ -15,5 +15,5 @@
15
  * Compiled with the help of https://wpack.io
16
  * A zero setup Webpack Bundler Script for WordPress
17
  */
18
- (window.wpackioprestoPlayerdiviJsonp=window.wpackioprestoPlayerdiviJsonp||[]).push([[0],{0:function(e,t){e.exports=React},26:function(e,t){e.exports=ReactDOM},37:function(e,t){e.exports=jQuery},43:function(e,t,n){n(44),e.exports=n(61)},61:function(e,t,n){"use strict";n.r(t);var r=n(37),a=n.n(r),o=n(23),c=n(27),i=n(24),s=n(28),u=n(18),l=n(5),p=n(0),d=n.n(p),f=n(29),b=n(17),h=n(19),v=n.n(h),m=n(42);var O=function(e){var t=e.id,n=e.src,r=Object(p.useState)({}),a=Object(b.a)(r,2),o=a[0],c=a[1],i=Object(p.useState)(!1),s=Object(b.a)(i,2),u=s[0],l=s[1],h=Object(p.useState)("self-hosted"),O=Object(b.a)(h,2),y=O[0],j=O[1],w=Object(p.useState)(1),_=Object(b.a)(w,2),g=_[0],E=_[1];Object(p.useEffect)((function(){E(g+1)}),[t,n,o]),Object(p.useEffect)((function(){C(t)}),[t]),Object(p.useEffect)((function(){j(function(e){if(e){if(e.match(/^(?:https?:\/\/)?(?:www\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))((\w|-){11})(?:\S+)?$/))return"youtube";if(e.match(/(https?:\/\/)?(www\.)?(player\.)?vimeo\.com\/([a-z]*\/)*([‌​0-9]{6,11})[?]?.*/))return"vimeo";if(e.indexOf("https://vz-")>-1&&e.indexOf("b-cdn.net")>-1)return"bunny"}return"self-hosted"}(n))}),[n]);var C=function(){var e=Object(f.a)(v.a.mark((function e(t){var n;return v.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t){e.next=2;break}return e.abrupt("return");case 2:return l(!0),e.prev=3,e.next=6,fetch("/wp-admin/admin-ajax.php",{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/x-www-form-urlencoded","Cache-Control":"no-cache"},body:new URLSearchParams({action:"presto_get_media_attributes",_wpnonce:window.et_fb_options.et_admin_load_nonce,id:t})}).then((function(e){return e.json()}));case 6:n=e.sent,c(n.data);case 8:return e.prev=8,l(!1),e.finish(8);case 11:case"end":return e.stop()}}),e,null,[[3,,8,11]])})));return function(t){return e.apply(this,arguments)}}();return u?d.a.createElement("div",{className:"et-fb-preloader et-fb-preloader__loading"},d.a.createElement("div",{className:"et-fb-loader"})):o.id?(n=n||o.src,"bunny"!==(null==o?void 0:o.provider)||"self-hosted"!==y&&"bunny"!==y?d.a.createElement(m.a,{key:g,video_id:o.id,preset:o.preset,src:n,chapters:o.chapters,tracks:o.tracks,branding:o.branding,blockAttributes:o.blockAttributes,config:o.config,skin:o.skin,analytics:o.analytics,automations:o.automations,provider:y,provider_video_id:o.provider_video_id,youtube:o.youtube}):d.a.createElement("presto-video-curtain-ui",null,d.a.createElement("span",null,"Bunny.net videos cannot be previewed in the DIVI editor due to DIVI iframe having no referrer."),d.a.createElement("presto-player-button",{full:!0,type:"primary",target:"_blank",href:"https://prestoplayer.com/docs/bunny-net-videos-not-showing-in-divi-editor"},"Learn More"))):"Choose A Video"};function y(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Object(u.a)(e);if(t){var a=Object(u.a)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Object(s.a)(this,n)}}var j=wp.i18n.__,w=function(e){Object(i.a)(n,e);var t=y(n);function n(e){var r;return Object(o.a)(this,n),(r=t.call(this,e)).state={videos:[]},r}return Object(c.a)(n,[{key:"render",value:function(){var e=this.props.dynamic.url_override;return this.props.video_id?d.a.createElement(O,{id:this.props.video_id,src:e&&e.value&&e.value}):d.a.createElement("presto-video-curtain-ui",null,d.a.createElement("span",null,j("Please select a video.","presto-player")))}}]),n}(p.Component);Object(l.a)(w,"slug","prpl_presto_player");var _=[w],g=n(6),E=n(14),C=n(13),k=n(41),V=n(39),P=n(40),x=n.n(P);function R(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function S(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?R(Object(n),!0).forEach((function(t){Object(l.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):R(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function D(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Object(u.a)(e);if(t){var a=Object(u.a)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Object(s.a)(this,n)}}var I=wp.i18n.__,L=function(e){Object(i.a)(n,e);var t=D(n);function n(){var e;Object(o.a)(this,n);for(var r=arguments.length,a=new Array(r),c=0;c<r;c++)a[c]=arguments[c];return e=t.call.apply(t,[this].concat(a)),Object(l.a)(Object(g.a)(e),"createEmotionCacheCustom",(function(e){return Object(E.a)({nonce:e,key:"custom-select-style",container:this.props.container})})),Object(l.a)(Object(g.a)(e),"createEmotionCache",Object(C.a)(e.createEmotionCacheCustom)),e}return n}(k.a),T=function(e){Object(i.a)(n,e);var t=D(n);function n(e){var r;Object(o.a)(this,n),r=t.call(this,e),Object(l.a)(Object(g.a)(r),"fetchVideos",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch("/wp-admin/admin-ajax.php",{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/x-www-form-urlencoded","Cache-Control":"no-cache"},body:new URLSearchParams({action:"presto_fetch_videos",search:e})}).then((function(e){return e.json()})).then((function(e){return e.data||[]}))})),Object(l.a)(Object(g.a)(r),"fetchVideo",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e?fetch("/wp-admin/admin-ajax.php",{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/x-www-form-urlencoded","Cache-Control":"no-cache"},body:new URLSearchParams({action:"presto_fetch_videos",post_id:e})}).then((function(e){return e.json()})).then((function(e){return e.data||[]})):[]})),Object(l.a)(Object(g.a)(r),"loadVideos",function(){var e=Object(f.a)(v.a.mark((function e(t){var n,a,o,c;return v.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=S({searchTerm:"",postId:""},t),e.next=3,Promise.all([r.fetchVideo(t.postId),r.fetchVideos(t.searchTerm)]);case 3:return n=e.sent,a=Object(b.a)(n,2),o=a[0],c=a[1],o[0]&&!c.find((function(e){return e.ID===o[0].ID}))&&c.push(o[0]),c=c.map((function(e){return{label:e.post_title||I("Untitled","presto-player"),value:e.ID}})),r.setState({videos:c}),e.abrupt("return",c);case 11:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),Object(l.a)(Object(g.a)(r),"_onChange",(function(e){r.props._onChange(r.props.name,e.value)})),Object(l.a)(Object(g.a)(r),"_onEditVideoClick",(function(){var e=r.props.value;e&&window.open("/wp-admin/post.php?post=".concat(e,"&action=edit"),"_blank").focus()})),Object(l.a)(Object(g.a)(r),"_onCreateVideoClick",(function(){window.open("/wp-admin/post-new.php?post_type=pp_video_block","_blank").focus()})),Object(l.a)(Object(g.a)(r),"currentVideoLabel",(function(){if(!r.state.videos)return"";var e=(r.state.videos||[]).find((function(e){return e.value===parseInt(r.props.value)}));return e?e.label:""})),r.state={videos:[]};return r.debouncedLoadVideos=x()((function(e){return r.loadVideos(e)}),500,{leading:!0}),r}return Object(c.a)(n,[{key:"render",value:function(){var e=this;return d.a.createElement("div",{className:"presto-player-divi-editor"},d.a.createElement("ul",{className:"presto-player-divi-editor__inputs"},d.a.createElement("li",null,d.a.createElement(L,{container:window.parent.document.body},d.a.createElement(V.a,{id:"prpd_video_selector-".concat(this.props.name),className:"prpd_video_selector",cacheOptions:!0,defaultOptions:!0,name:this.props.name,value:{value:this.props.value,label:this.currentVideoLabel()},onChange:this._onChange,loadOptions:function(t){return e.debouncedLoadVideos(t)}}))),d.a.createElement("li",null,d.a.createElement("label",null,I("Video Options","presto-player")),d.a.createElement("button",{type:"button",onClick:this._onEditVideoClick},I("Edit Video","presto-player"))),d.a.createElement("li",null,d.a.createElement("label",null,I("New Video","presto-player")),d.a.createElement("button",{type:"button",onClick:this._onCreateVideoClick},I("Create Video","presto-player")))))}}]),n}(p.Component);Object(l.a)(T,"slug","prpl_video_selector");var N=[T];a()(window).on("et_builder_api_ready",(function(e,t){t.registerModules(_),t.registerModalFields(N)}))}},[[43,1,2]]]);
19
- //# sourceMappingURL=admin-d97471fa.js.map
15
  * Compiled with the help of https://wpack.io
16
  * A zero setup Webpack Bundler Script for WordPress
17
  */
18
+ (window.wpackioprestoPlayerdiviJsonp=window.wpackioprestoPlayerdiviJsonp||[]).push([[0],{0:function(e,t){e.exports=React},26:function(e,t){e.exports=ReactDOM},37:function(e,t){e.exports=jQuery},43:function(e,t,n){n(44),e.exports=n(61)},61:function(e,t,n){"use strict";n.r(t);var r=n(37),a=n.n(r),o=n(23),c=n(27),i=n(24),s=n(28),u=n(18),l=n(5),p=n(0),d=n.n(p),f=n(29),b=n(17),h=n(19),v=n.n(h),m=n(42);var O=function(e){var t=e.id,n=e.src,r=Object(p.useState)({}),a=Object(b.a)(r,2),o=a[0],c=a[1],i=Object(p.useState)(!1),s=Object(b.a)(i,2),u=s[0],l=s[1],h=Object(p.useState)("self-hosted"),O=Object(b.a)(h,2),y=O[0],j=O[1],w=Object(p.useState)(1),_=Object(b.a)(w,2),g=_[0],E=_[1];Object(p.useEffect)((function(){E(g+1)}),[t,n,o]),Object(p.useEffect)((function(){C(t)}),[t]),Object(p.useEffect)((function(){j(function(e){if(e){if(e.match(/^(?:https?:\/\/)?(?:www\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))((\w|-){11})(?:\S+)?$/))return"youtube";if(e.match(/(https?:\/\/)?(www\.)?(player\.)?vimeo\.com\/([a-z]*\/)*([‌​0-9]{6,11})[?]?.*/))return"vimeo";if(e.indexOf("https://vz-")>-1&&e.indexOf("b-cdn.net")>-1)return"bunny"}return"self-hosted"}(n))}),[n]);var C=function(){var e=Object(f.a)(v.a.mark((function e(t){var n;return v.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t){e.next=2;break}return e.abrupt("return");case 2:return l(!0),e.prev=3,e.next=6,fetch("/wp-admin/admin-ajax.php",{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/x-www-form-urlencoded","Cache-Control":"no-cache"},body:new URLSearchParams({action:"presto_get_media_attributes",_wpnonce:window.et_fb_options.et_admin_load_nonce,id:t})}).then((function(e){return e.json()}));case 6:n=e.sent,c(n.data);case 8:return e.prev=8,l(!1),e.finish(8);case 11:case"end":return e.stop()}}),e,null,[[3,,8,11]])})));return function(t){return e.apply(this,arguments)}}();return u?d.a.createElement("div",{className:"et-fb-preloader et-fb-preloader__loading"},d.a.createElement("div",{className:"et-fb-loader"})):o.id?(n=n||o.src,"bunny"!==(null==o?void 0:o.provider)||"self-hosted"!==y&&"bunny"!==y?d.a.createElement(m.a,{key:g,video_id:o.id,preset:o.preset,src:n,chapters:o.chapters,tracks:o.tracks,branding:o.branding,blockAttributes:o.blockAttributes,config:o.config,skin:o.skin,analytics:o.analytics,automations:o.automations,provider:y,provider_video_id:o.provider_video_id,youtube:o.youtube}):d.a.createElement("presto-video-curtain-ui",null,d.a.createElement("span",null,"Bunny.net videos cannot be previewed in the DIVI editor due to DIVI iframe having no referrer."),d.a.createElement("presto-player-button",{full:!0,type:"primary",target:"_blank",href:"https://prestoplayer.com/docs/bunny-net-videos-not-showing-in-divi-editor"},"Learn More"))):"Choose A Video"};function y(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Object(u.a)(e);if(t){var a=Object(u.a)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Object(s.a)(this,n)}}var j=wp.i18n.__,w=function(e){Object(i.a)(n,e);var t=y(n);function n(e){var r;return Object(o.a)(this,n),(r=t.call(this,e)).state={videos:[]},r}return Object(c.a)(n,[{key:"render",value:function(){var e=this.props.dynamic.url_override;return this.props.video_id?d.a.createElement(O,{id:this.props.video_id,src:e&&e.value&&e.value}):d.a.createElement("presto-video-curtain-ui",null,d.a.createElement("span",null,j("Please select a video.","presto-player")))}}]),n}(p.Component);Object(l.a)(w,"slug","prpl_presto_player");var _=[w],g=n(6),E=n(14),C=n(13),k=n(41),V=n(39),P=n(40),x=n.n(P);function R(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function S(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?R(Object(n),!0).forEach((function(t){Object(l.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):R(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function D(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Object(u.a)(e);if(t){var a=Object(u.a)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Object(s.a)(this,n)}}var I=wp.i18n.__,T=function(e){Object(i.a)(n,e);var t=D(n);function n(){var e;Object(o.a)(this,n);for(var r=arguments.length,a=new Array(r),c=0;c<r;c++)a[c]=arguments[c];return e=t.call.apply(t,[this].concat(a)),Object(l.a)(Object(g.a)(e),"createEmotionCacheCustom",(function(e){return Object(E.a)({nonce:e,key:"custom-select-style",container:this.props.container})})),Object(l.a)(Object(g.a)(e),"createEmotionCache",Object(C.a)(e.createEmotionCacheCustom)),e}return n}(k.a),L=function(e){Object(i.a)(n,e);var t=D(n);function n(e){var r;Object(o.a)(this,n),r=t.call(this,e),Object(l.a)(Object(g.a)(r),"fetchVideos",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return fetch("/wp-admin/admin-ajax.php",{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/x-www-form-urlencoded","Cache-Control":"no-cache"},body:new URLSearchParams({action:"presto_fetch_videos",search:e})}).then((function(e){return e.json()})).then((function(e){return e.data||[]}))})),Object(l.a)(Object(g.a)(r),"fetchVideo",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e?fetch("/wp-admin/admin-ajax.php",{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/x-www-form-urlencoded","Cache-Control":"no-cache"},body:new URLSearchParams({action:"presto_fetch_videos",post_id:e})}).then((function(e){return e.json()})).then((function(e){return e.data||[]})):[]})),Object(l.a)(Object(g.a)(r),"loadVideos",function(){var e=Object(f.a)(v.a.mark((function e(t){var n,a,o,c;return v.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=S({searchTerm:"",postId:""},t),e.next=3,Promise.all([r.fetchVideo(t.postId),r.fetchVideos(t.searchTerm)]);case 3:return n=e.sent,a=Object(b.a)(n,2),o=a[0],c=a[1],o[0]&&!c.find((function(e){return e.ID===o[0].ID}))&&c.push(o[0]),c=c.map((function(e){return{label:e.post_title||I("Untitled","presto-player"),value:e.ID}})),r.setState({videos:c}),e.abrupt("return",c);case 11:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),Object(l.a)(Object(g.a)(r),"_onChange",(function(e){r.props._onChange(r.props.name,e.value)})),Object(l.a)(Object(g.a)(r),"_onEditVideoClick",(function(){var e=r.props.value;e&&window.open("/wp-admin/post.php?post=".concat(e,"&action=edit"),"_blank").focus()})),Object(l.a)(Object(g.a)(r),"_onCreateVideoClick",(function(){window.open("/wp-admin/post-new.php?post_type=pp_video_block","_blank").focus()})),Object(l.a)(Object(g.a)(r),"currentVideoLabel",(function(){if(!r.state.videos)return"";var e=(r.state.videos||[]).find((function(e){return e.value===parseInt(r.props.value)}));return e?e.label:""})),r.state={videos:[]};return r.debouncedLoadVideos=x()((function(e){return r.loadVideos({searchTerm:e})}),500,{leading:!0}),r}return Object(c.a)(n,[{key:"render",value:function(){var e=this;return d.a.createElement("div",{className:"presto-player-divi-editor"},d.a.createElement("ul",{className:"presto-player-divi-editor__inputs"},d.a.createElement("li",null,d.a.createElement(T,{container:window.parent.document.body},d.a.createElement(V.a,{id:"prpd_video_selector-".concat(this.props.name),className:"prpd_video_selector",cacheOptions:!0,defaultOptions:!0,name:this.props.name,value:{value:this.props.value,label:this.currentVideoLabel()},onChange:this._onChange,loadOptions:function(t){return e.debouncedLoadVideos(t)}}))),d.a.createElement("li",null,d.a.createElement("label",null,I("Video Options","presto-player")),d.a.createElement("button",{type:"button",onClick:this._onEditVideoClick},I("Edit Video","presto-player"))),d.a.createElement("li",null,d.a.createElement("label",null,I("New Video","presto-player")),d.a.createElement("button",{type:"button",onClick:this._onCreateVideoClick},I("Create Video","presto-player")))))}}]),n}(p.Component);Object(l.a)(L,"slug","prpl_video_selector");var N=[L];a()(window).on("et_builder_api_ready",(function(e,t){t.registerModules(_),t.registerModalFields(N)}))}},[[43,1,2]]]);
19
+ //# sourceMappingURL=admin-1a1a82cb.js.map
dist/divi/admin-1a1a82cb.js.map ADDED
@@ -0,0 +1 @@
 
1
+ {"version":3,"sources":["webpack:///external \"React\"","webpack:///external \"ReactDOM\"","webpack:///external \"jQuery\"","webpack:///./src/admin/integrations/divi/modules/PrestoPlayer/RenderPlayer.jsx","webpack:///./src/admin/integrations/divi/modules/util.js","webpack:///./src/admin/integrations/divi/modules/PrestoPlayer/PrestoPlayer.jsx","webpack:///./src/admin/integrations/divi/modules/index.js","webpack:///./src/admin/integrations/divi/fields/VideoSelector/VideoSelector.jsx","webpack:///./src/admin/integrations/divi/fields/index.js","webpack:///./src/admin/integrations/divi/index.js"],"names":["module","exports","React","ReactDOM","jQuery","id","src","useState","data","setData","loading","setLoading","provider","setProvider","renderKey","setRenderKey","useEffect","getHtml","match","indexOf","getProvider","a","fetch","method","credentials","headers","body","URLSearchParams","action","_wpnonce","window","et_fb_options","et_admin_load_nonce","then","response","json","res","className","key","video_id","preset","chapters","tracks","branding","blockAttributes","config","skin","analytics","automations","provider_video_id","youtube","full","type","target","href","__","wp","i18n","PrestoPlayer","props","state","videos","url_override","this","dynamic","RenderPlayer","value","Component","PrestoNonceProvider","nonce","createCache","container","memoizeOne","createEmotionCacheCustom","NonceProvider","VideoSelector","input","search","post_id","searchTerm","postId","Promise","all","fetchVideo","fetchVideos","video","find","item","ID","push","map","label","post_title","setState","event","_onChange","name","open","focus","parseInt","debouncedLoadVideos","debounce","inputValue","loadVideos","leading","parent","document","cacheOptions","defaultOptions","currentVideoLabel","onChange","loadOptions","onClick","_onEditVideoClick","_onCreateVideoClick","$","on","API","registerModules","modules","registerModalFields","fields"],"mappings":";;;;;;;;;;;;;;;;;yG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WAClB,IAAK,EAAKtC,MAAMC,OACd,MAAO,GAGT,IAAMwB,GAAS,EAAKzB,MAAMC,QAAU,IAAIyB,MAAK,SAACD,GAC5C,OAAOA,EAAMnB,QAAUiC,SAAS,EAAKxC,MAAMO,UAG7C,OAAKmB,EAIEA,EAAMM,MAHJ,MA7IT,EAAK/B,MAAQ,CAAEC,OAAQ,IAFN,OAOjB,EAAKuC,oBAAsBC,KAFR,SAACC,GAAD,OACjB,EAAKC,WAAW,CAAExB,WAAYuB,MAFnB,IAGyC,CACpDE,SAAS,IARM,E,0CAyJnB,WAAU,IAAD,OACP,OACE,yBAAKnE,UAAU,6BACb,wBAAIA,UAAU,qCACZ,4BACE,kBAAC,EAAD,CAAqBkC,UAAWzC,OAAO2E,OAAOC,SAAShF,MACrD,kBAAC,IAAD,CACErB,GAAE,8BAAyB0D,KAAKJ,MAAMqC,MACtC3D,UAAU,sBACVsE,cAAY,EACZC,gBAAc,EACdZ,KAAMjC,KAAKJ,MAAMqC,KACjB9B,MAAO,CACLA,MAAOH,KAAKJ,MAAMO,MAClByB,MAAO5B,KAAK8C,qBAEdC,SAAU/C,KAAKgC,UACfgB,YAAa,SAACT,GAAD,OACX,EAAKF,oBAAoBE,QAKjC,4BACE,+BAAQ/C,EAAG,gBAAiB,kBAC5B,4BAAQH,KAAK,SAAS4D,QAASjD,KAAKkD,mBACjC1D,EAAG,aAAc,mBAGtB,4BACE,+BAAQA,EAAG,YAAa,kBACxB,4BAAQH,KAAK,SAAS4D,QAASjD,KAAKmD,qBACjC3D,EAAG,eAAgB,yB,GA5LNY,a,YAAtBQ,E,OACU,uBAoMDA,IC3NA,GD2NAA,GEtNfwC,IAAErF,QAAQsF,GAAG,wBAAwB,SAACtB,EAAOuB,GAC3CA,EAAIC,gBAAgBC,GACpBF,EAAIG,oBAAoBC,Q","file":"divi/admin-1a1a82cb.js","sourcesContent":["module.exports = React;","module.exports = ReactDOM;","module.exports = jQuery;","import { PrestoPlayer } from \"@presto-player/react\";\nimport React, { useEffect, useState } from \"react\";\nimport { getProvider } from \"../util\";\n\nexport default ({ id, src }) => {\n const [data, setData] = useState({});\n const [loading, setLoading] = useState(false);\n const [provider, setProvider] = useState(\"self-hosted\");\n const [renderKey, setRenderKey] = useState(1);\n\n useEffect(() => {\n setRenderKey(renderKey + 1);\n }, [id, src, data]);\n\n useEffect(() => {\n getHtml(id);\n }, [id]);\n\n useEffect(() => {\n setProvider(getProvider(src));\n }, [src]);\n\n const getHtml = async (id) => {\n if (!id) {\n return;\n }\n setLoading(true);\n try {\n const res = await fetch(`/wp-admin/admin-ajax.php`, {\n method: \"POST\",\n credentials: \"same-origin\",\n headers: {\n \"Content-Type\": \"application/x-www-form-urlencoded\",\n \"Cache-Control\": \"no-cache\",\n },\n body: new URLSearchParams({\n action: \"presto_get_media_attributes\",\n _wpnonce: window.et_fb_options.et_admin_load_nonce,\n id,\n }),\n }).then((response) => response.json());\n setData(res.data);\n } finally {\n setLoading(false);\n }\n };\n\n if (loading) {\n return (\n <div className=\"et-fb-preloader et-fb-preloader__loading\">\n <div className=\"et-fb-loader\" />\n </div>\n );\n }\n\n if (data.id) {\n src = src ? src : data.src;\n\n if (\n data?.provider === \"bunny\" &&\n (provider === \"self-hosted\" || provider === \"bunny\")\n ) {\n return (\n <presto-video-curtain-ui>\n <span>\n Bunny.net videos cannot be previewed in the DIVI editor due to DIVI\n iframe having no referrer.\n </span>\n <presto-player-button\n full\n type=\"primary\"\n target=\"_blank\"\n href=\"https://prestoplayer.com/docs/bunny-net-videos-not-showing-in-divi-editor\"\n >\n Learn More\n </presto-player-button>\n </presto-video-curtain-ui>\n );\n }\n\n return (\n <PrestoPlayer\n key={renderKey}\n video_id={data.id}\n preset={data.preset}\n src={src}\n chapters={data.chapters}\n tracks={data.tracks}\n branding={data.branding}\n blockAttributes={data.blockAttributes}\n config={data.config}\n skin={data.skin}\n analytics={data.analytics}\n automations={data.automations}\n provider={provider}\n provider_video_id={data.provider_video_id}\n youtube={data.youtube}\n ></PrestoPlayer>\n );\n } else {\n return \"Choose A Video\";\n }\n};\n","export function getProvider(src) {\n const provider = \"self-hosted\";\n\n if (src) {\n const yt_rx =\n /^(?:https?:\\/\\/)?(?:www\\.)?(?:youtu\\.be\\/|youtube\\.com\\/(?:embed\\/|v\\/|watch\\?v=|watch\\?.+&v=))((\\w|-){11})(?:\\S+)?$/;\n const has_match_youtube = src.match(yt_rx);\n\n if (has_match_youtube) {\n return \"youtube\";\n }\n\n const vm_rx =\n /(https?:\\/\\/)?(www\\.)?(player\\.)?vimeo\\.com\\/([a-z]*\\/)*([‌​0-9]{6,11})[?]?.*/;\n const has_match_vimeo = src.match(vm_rx);\n\n if (has_match_vimeo) {\n return \"vimeo\";\n }\n\n if (src.indexOf(\"https://vz-\") > -1 && src.indexOf(\"b-cdn.net\") > -1) {\n return \"bunny\";\n }\n }\n return provider;\n}\n","// External Dependencies\nimport React, { Component } from \"react\";\nimport RenderPlayer from \"./RenderPlayer\";\n// Internal Dependencies\nimport \"./style.css\";\n\nconst { __ } = wp.i18n;\n\nclass PrestoPlayer extends Component {\n static slug = \"prpl_presto_player\";\n\n constructor(props) {\n super(props);\n this.state = {\n videos: [],\n };\n }\n\n render() {\n const url_override = this.props.dynamic.url_override; // https://gist.github.com/lots0logs/9b6bb0b3d494f4d0bdf957955d97cb26\n\n if (this.props.video_id) {\n return (\n <RenderPlayer\n id={this.props.video_id}\n src={url_override && url_override.value && url_override.value}\n />\n );\n } else {\n return (\n <presto-video-curtain-ui>\n <span>{__(\"Please select a video.\", \"presto-player\")}</span>\n </presto-video-curtain-ui>\n );\n }\n }\n}\n\nexport default PrestoPlayer;\n","import PrestoPlayer from './PrestoPlayer/PrestoPlayer';\n\nexport default [PrestoPlayer];\n","// External Dependencies\nimport createCache from \"@emotion/cache\";\nimport memoizeOne from \"memoize-one\";\nimport React, { Component } from \"react\";\nimport { NonceProvider } from \"react-select\";\nimport AsyncSelect from \"react-select/async\";\nimport debounce from \"debounce-promise\";\nconst { __ } = wp.i18n;\n\n// Internal Dependencies\nimport \"./style.css\";\n\nclass PrestoNonceProvider extends NonceProvider {\n createEmotionCacheCustom = function (nonce) {\n return createCache({\n nonce,\n key: \"custom-select-style\",\n container: this.props.container,\n });\n };\n\n createEmotionCache = memoizeOne(this.createEmotionCacheCustom);\n}\n\nclass VideoSelector extends Component {\n static slug = \"prpl_video_selector\";\n\n constructor(props) {\n super(props);\n this.state = { videos: [] };\n\n const wait = 500; // milliseconds\n const loadVideos = (inputValue) =>\n this.loadVideos({ searchTerm: inputValue });\n this.debouncedLoadVideos = debounce(loadVideos, wait, {\n leading: true,\n });\n }\n\n /**\n * Search for videos\n *\n * @param {string} input\n * @returns {array}\n */\n fetchVideos = (input = \"\") => {\n return fetch(`/wp-admin/admin-ajax.php`, {\n method: \"POST\",\n credentials: \"same-origin\",\n headers: {\n \"Content-Type\": \"application/x-www-form-urlencoded\",\n \"Cache-Control\": \"no-cache\",\n },\n body: new URLSearchParams({\n action: \"presto_fetch_videos\",\n search: input,\n }),\n })\n .then((response) => response.json())\n .then((response) => response.data || []);\n };\n\n /**\n * Fetch a specific video\n * @param {array} input\n * @returns {array}\n */\n fetchVideo = (input = \"\") => {\n if (!input) {\n return [];\n }\n\n return fetch(`/wp-admin/admin-ajax.php`, {\n method: \"POST\",\n credentials: \"same-origin\",\n headers: {\n \"Content-Type\": \"application/x-www-form-urlencoded\",\n \"Cache-Control\": \"no-cache\",\n },\n body: new URLSearchParams({\n action: \"presto_fetch_videos\",\n post_id: input,\n }),\n })\n .then((response) => response.json())\n .then((response) => response.data || []);\n };\n\n /**\n * Load the videos from the db\n * @param {string} input\n * @returns\n */\n loadVideos = async (input) => {\n input = {\n searchTerm: \"\",\n postId: \"\",\n ...input,\n };\n\n let [video, videos] = await Promise.all([\n this.fetchVideo(input.postId),\n this.fetchVideos(input.searchTerm),\n ]);\n\n if (video[0] && !videos.find((item) => item.ID === video[0].ID)) {\n videos.push(video[0]);\n }\n videos = videos.map((item) => {\n return {\n label: item.post_title || __(\"Untitled\", \"presto-player\"),\n value: item.ID,\n };\n });\n\n this.setState({ videos });\n\n return videos;\n };\n\n /**\n * Handle input value change.\n *\n * @param {object} event\n */\n _onChange = (event) => {\n this.props._onChange(this.props.name, event.value);\n };\n\n /**\n * Handle edit video click.\n * @returns null\n */\n _onEditVideoClick = () => {\n var video_id = this.props.value;\n if (!video_id) {\n return;\n }\n var win = window.open(\n `/wp-admin/post.php?post=${video_id}&action=edit`,\n \"_blank\"\n );\n win.focus();\n };\n\n /**\n * Handle create video click.\n */\n _onCreateVideoClick = () => {\n var win = window.open(\n `/wp-admin/post-new.php?post_type=pp_video_block`,\n \"_blank\"\n );\n win.focus();\n };\n\n /**\n * Determine the video label\n * @returns {string}\n */\n currentVideoLabel = () => {\n if (!this.state.videos) {\n return \"\";\n }\n\n const video = (this.state.videos || []).find((video) => {\n return video.value === parseInt(this.props.value);\n });\n\n if (!video) {\n return \"\";\n }\n\n return video.label;\n };\n\n /**\n * Render the component\n * @returns {JSX}\n */\n render() {\n return (\n <div className=\"presto-player-divi-editor\">\n <ul className=\"presto-player-divi-editor__inputs\">\n <li>\n <PrestoNonceProvider container={window.parent.document.body}>\n <AsyncSelect\n id={`prpd_video_selector-${this.props.name}`}\n className=\"prpd_video_selector\"\n cacheOptions\n defaultOptions\n name={this.props.name}\n value={{\n value: this.props.value,\n label: this.currentVideoLabel(),\n }}\n onChange={this._onChange}\n loadOptions={(inputValue) =>\n this.debouncedLoadVideos(inputValue)\n }\n />\n </PrestoNonceProvider>\n </li>\n <li>\n <label>{__(\"Video Options\", \"presto-player\")}</label>\n <button type=\"button\" onClick={this._onEditVideoClick}>\n {__(\"Edit Video\", \"presto-player\")}\n </button>\n </li>\n <li>\n <label>{__(\"New Video\", \"presto-player\")}</label>\n <button type=\"button\" onClick={this._onCreateVideoClick}>\n {__(\"Create Video\", \"presto-player\")}\n </button>\n </li>\n </ul>\n </div>\n );\n }\n}\n\nexport default VideoSelector;\n","import VideoSelector from './VideoSelector/VideoSelector';\n\nexport default [VideoSelector];\n","// External Dependencies\nimport $ from \"jquery\";\n\n// Internal Dependencies\nimport modules from \"./modules\";\nimport fields from \"./fields\";\n\n$(window).on(\"et_builder_api_ready\", (event, API) => {\n API.registerModules(modules);\n API.registerModalFields(fields);\n});\n"],"sourceRoot":""}
dist/divi/admin-d97471fa.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"sources":["webpack:///external \"React\"","webpack:///external \"ReactDOM\"","webpack:///external \"jQuery\"","webpack:///./src/admin/integrations/divi/modules/PrestoPlayer/RenderPlayer.jsx","webpack:///./src/admin/integrations/divi/modules/util.js","webpack:///./src/admin/integrations/divi/modules/PrestoPlayer/PrestoPlayer.jsx","webpack:///./src/admin/integrations/divi/modules/index.js","webpack:///./src/admin/integrations/divi/fields/VideoSelector/VideoSelector.jsx","webpack:///./src/admin/integrations/divi/fields/index.js","webpack:///./src/admin/integrations/divi/index.js"],"names":["module","exports","React","ReactDOM","jQuery","id","src","useState","data","setData","loading","setLoading","provider","setProvider","renderKey","setRenderKey","useEffect","getHtml","match","indexOf","getProvider","a","fetch","method","credentials","headers","body","URLSearchParams","action","_wpnonce","window","et_fb_options","et_admin_load_nonce","then","response","json","res","className","key","video_id","preset","chapters","tracks","branding","blockAttributes","config","skin","analytics","automations","provider_video_id","youtube","full","type","target","href","__","wp","i18n","PrestoPlayer","props","state","videos","url_override","this","dynamic","RenderPlayer","value","Component","PrestoNonceProvider","nonce","createCache","container","memoizeOne","createEmotionCacheCustom","NonceProvider","VideoSelector","input","search","post_id","searchTerm","postId","Promise","all","fetchVideo","fetchVideos","video","find","item","ID","push","map","label","post_title","setState","event","_onChange","name","open","focus","parseInt","debouncedLoadVideos","debounce","inputValue","loadVideos","leading","parent","document","cacheOptions","defaultOptions","currentVideoLabel","onChange","loadOptions","onClick","_onEditVideoClick","_onCreateVideoClick","$","on","API","registerModules","modules","registerModalFields","fields"],"mappings":";;;;;;;;;;;;;;;;;yGAAAA,EAAOC,QAA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tC,MAAMC,OACd,MAAO,GAGT,IAAMwB,GAAS,EAAKzB,MAAMC,QAAU,IAAIyB,MAAK,SAACD,GAC5C,OAAOA,EAAMnB,QAAUiC,SAAS,EAAKxC,MAAMO,UAG7C,OAAKmB,EAIEA,EAAMM,MAHJ,MA5IT,EAAK/B,MAAQ,CAAEC,OAAQ,IAFN,OAMjB,EAAKuC,oBAAsBC,KADR,SAACC,GAAD,OAAgB,EAAKC,WAAWD,KADtC,IAEyC,CACpDE,SAAS,IAPM,E,0CAwJnB,WAAU,IAAD,OACP,OACE,yBAAKnE,UAAU,6BACb,wBAAIA,UAAU,qCACZ,4BACE,kBAAC,EAAD,CAAqBkC,UAAWzC,OAAO2E,OAAOC,SAAShF,MACrD,kBAAC,IAAD,CACErB,GAAE,8BAAyB0D,KAAKJ,MAAMqC,MACtC3D,UAAU,sBACVsE,cAAY,EACZC,gBAAc,EACdZ,KAAMjC,KAAKJ,MAAMqC,KACjB9B,MAAO,CACLA,MAAOH,KAAKJ,MAAMO,MAClByB,MAAO5B,KAAK8C,qBAEdC,SAAU/C,KAAKgC,UACfgB,YAAa,SAACT,GAAD,OACX,EAAKF,oBAAoBE,QAKjC,4BACE,+BAAQ/C,EAAG,gBAAiB,kBAC5B,4BAAQH,KAAK,SAAS4D,QAASjD,KAAKkD,mBACjC1D,EAAG,aAAc,mBAGtB,4BACE,+BAAQA,EAAG,YAAa,kBACxB,4BAAQH,KAAK,SAAS4D,QAASjD,KAAKmD,qBACjC3D,EAAG,eAAgB,yB,GA3LNY,a,YAAtBQ,E,OACU,uBAmMDA,IC1NA,GD0NAA,GErNfwC,IAAErF,QAAQsF,GAAG,wBAAwB,SAACtB,EAAOuB,GAC3CA,EAAIC,gBAAgBC,GACpBF,EAAIG,oBAAoBC,Q","file":"divi/admin-d97471fa.js","sourcesContent":["module.exports = React;","module.exports = ReactDOM;","module.exports = jQuery;","import { PrestoPlayer } from \"@presto-player/react\";\nimport React, { useEffect, useState } from \"react\";\nimport { getProvider } from \"../util\";\n\nexport default ({ id, src }) => {\n const [data, setData] = useState({});\n const [loading, setLoading] = useState(false);\n const [provider, setProvider] = useState(\"self-hosted\");\n const [renderKey, setRenderKey] = useState(1);\n\n useEffect(() => {\n setRenderKey(renderKey + 1);\n }, [id, src, data]);\n\n useEffect(() => {\n getHtml(id);\n }, [id]);\n\n useEffect(() => {\n setProvider(getProvider(src));\n }, [src]);\n\n const getHtml = async (id) => {\n if (!id) {\n return;\n }\n setLoading(true);\n try {\n const res = await fetch(`/wp-admin/admin-ajax.php`, {\n method: \"POST\",\n credentials: \"same-origin\",\n headers: {\n \"Content-Type\": \"application/x-www-form-urlencoded\",\n \"Cache-Control\": \"no-cache\",\n },\n body: new URLSearchParams({\n action: \"presto_get_media_attributes\",\n _wpnonce: window.et_fb_options.et_admin_load_nonce,\n id,\n }),\n }).then((response) => response.json());\n setData(res.data);\n } finally {\n setLoading(false);\n }\n };\n\n if (loading) {\n return (\n <div className=\"et-fb-preloader et-fb-preloader__loading\">\n <div className=\"et-fb-loader\" />\n </div>\n );\n }\n\n if (data.id) {\n src = src ? src : data.src;\n\n if (\n data?.provider === \"bunny\" &&\n (provider === \"self-hosted\" || provider === \"bunny\")\n ) {\n return (\n <presto-video-curtain-ui>\n <span>\n Bunny.net videos cannot be previewed in the DIVI editor due to DIVI\n iframe having no referrer.\n </span>\n <presto-player-button\n full\n type=\"primary\"\n target=\"_blank\"\n href=\"https://prestoplayer.com/docs/bunny-net-videos-not-showing-in-divi-editor\"\n >\n Learn More\n </presto-player-button>\n </presto-video-curtain-ui>\n );\n }\n\n return (\n <PrestoPlayer\n key={renderKey}\n video_id={data.id}\n preset={data.preset}\n src={src}\n chapters={data.chapters}\n tracks={data.tracks}\n branding={data.branding}\n blockAttributes={data.blockAttributes}\n config={data.config}\n skin={data.skin}\n analytics={data.analytics}\n automations={data.automations}\n provider={provider}\n provider_video_id={data.provider_video_id}\n youtube={data.youtube}\n ></PrestoPlayer>\n );\n } else {\n return \"Choose A Video\";\n }\n};\n","export function getProvider(src) {\n const provider = \"self-hosted\";\n\n if (src) {\n const yt_rx =\n /^(?:https?:\\/\\/)?(?:www\\.)?(?:youtu\\.be\\/|youtube\\.com\\/(?:embed\\/|v\\/|watch\\?v=|watch\\?.+&v=))((\\w|-){11})(?:\\S+)?$/;\n const has_match_youtube = src.match(yt_rx);\n\n if (has_match_youtube) {\n return \"youtube\";\n }\n\n const vm_rx =\n /(https?:\\/\\/)?(www\\.)?(player\\.)?vimeo\\.com\\/([a-z]*\\/)*([‌​0-9]{6,11})[?]?.*/;\n const has_match_vimeo = src.match(vm_rx);\n\n if (has_match_vimeo) {\n return \"vimeo\";\n }\n\n if (src.indexOf(\"https://vz-\") > -1 && src.indexOf(\"b-cdn.net\") > -1) {\n return \"bunny\";\n }\n }\n return provider;\n}\n","// External Dependencies\nimport React, { Component } from \"react\";\nimport RenderPlayer from \"./RenderPlayer\";\n// Internal Dependencies\nimport \"./style.css\";\n\nconst { __ } = wp.i18n;\n\nclass PrestoPlayer extends Component {\n static slug = \"prpl_presto_player\";\n\n constructor(props) {\n super(props);\n this.state = {\n videos: [],\n };\n }\n\n render() {\n const url_override = this.props.dynamic.url_override; // https://gist.github.com/lots0logs/9b6bb0b3d494f4d0bdf957955d97cb26\n\n if (this.props.video_id) {\n return (\n <RenderPlayer\n id={this.props.video_id}\n src={url_override && url_override.value && url_override.value}\n />\n );\n } else {\n return (\n <presto-video-curtain-ui>\n <span>{__(\"Please select a video.\", \"presto-player\")}</span>\n </presto-video-curtain-ui>\n );\n }\n }\n}\n\nexport default PrestoPlayer;\n","import PrestoPlayer from './PrestoPlayer/PrestoPlayer';\n\nexport default [PrestoPlayer];\n","// External Dependencies\nimport createCache from \"@emotion/cache\";\nimport memoizeOne from \"memoize-one\";\nimport React, { Component } from \"react\";\nimport { NonceProvider } from \"react-select\";\nimport AsyncSelect from \"react-select/async\";\nimport debounce from \"debounce-promise\";\nconst { __ } = wp.i18n;\n\n// Internal Dependencies\nimport \"./style.css\";\n\nclass PrestoNonceProvider extends NonceProvider {\n createEmotionCacheCustom = function (nonce) {\n return createCache({\n nonce,\n key: \"custom-select-style\",\n container: this.props.container,\n });\n };\n\n createEmotionCache = memoizeOne(this.createEmotionCacheCustom);\n}\n\nclass VideoSelector extends Component {\n static slug = \"prpl_video_selector\";\n\n constructor(props) {\n super(props);\n this.state = { videos: [] };\n\n const wait = 500; // milliseconds\n const loadVideos = (inputValue) => this.loadVideos(inputValue);\n this.debouncedLoadVideos = debounce(loadVideos, wait, {\n leading: true,\n });\n }\n\n /**\n * Search for videos\n *\n * @param {string} input\n * @returns {array}\n */\n fetchVideos = (input = \"\") => {\n return fetch(`/wp-admin/admin-ajax.php`, {\n method: \"POST\",\n credentials: \"same-origin\",\n headers: {\n \"Content-Type\": \"application/x-www-form-urlencoded\",\n \"Cache-Control\": \"no-cache\",\n },\n body: new URLSearchParams({\n action: \"presto_fetch_videos\",\n search: input,\n }),\n })\n .then((response) => response.json())\n .then((response) => response.data || []);\n };\n\n /**\n * Fetch a specific video\n * @param {array} input\n * @returns {array}\n */\n fetchVideo = (input = \"\") => {\n if (!input) {\n return [];\n }\n\n return fetch(`/wp-admin/admin-ajax.php`, {\n method: \"POST\",\n credentials: \"same-origin\",\n headers: {\n \"Content-Type\": \"application/x-www-form-urlencoded\",\n \"Cache-Control\": \"no-cache\",\n },\n body: new URLSearchParams({\n action: \"presto_fetch_videos\",\n post_id: input,\n }),\n })\n .then((response) => response.json())\n .then((response) => response.data || []);\n };\n\n /**\n * Load the videos from the db\n * @param {string} input\n * @returns\n */\n loadVideos = async (input) => {\n input = {\n searchTerm: \"\",\n postId: \"\",\n ...input,\n };\n\n let [video, videos] = await Promise.all([\n this.fetchVideo(input.postId),\n this.fetchVideos(input.searchTerm),\n ]);\n\n if (video[0] && !videos.find((item) => item.ID === video[0].ID)) {\n videos.push(video[0]);\n }\n videos = videos.map((item) => {\n return {\n label: item.post_title || __(\"Untitled\", \"presto-player\"),\n value: item.ID,\n };\n });\n\n this.setState({ videos });\n\n return videos;\n };\n\n /**\n * Handle input value change.\n *\n * @param {object} event\n */\n _onChange = (event) => {\n this.props._onChange(this.props.name, event.value);\n };\n\n /**\n * Handle edit video click.\n * @returns null\n */\n _onEditVideoClick = () => {\n var video_id = this.props.value;\n if (!video_id) {\n return;\n }\n var win = window.open(\n `/wp-admin/post.php?post=${video_id}&action=edit`,\n \"_blank\"\n );\n win.focus();\n };\n\n /**\n * Handle create video click.\n */\n _onCreateVideoClick = () => {\n var win = window.open(\n `/wp-admin/post-new.php?post_type=pp_video_block`,\n \"_blank\"\n );\n win.focus();\n };\n\n /**\n * Determine the video label\n * @returns {string}\n */\n currentVideoLabel = () => {\n if (!this.state.videos) {\n return \"\";\n }\n\n const video = (this.state.videos || []).find((video) => {\n return video.value === parseInt(this.props.value);\n });\n\n if (!video) {\n return \"\";\n }\n\n return video.label;\n };\n\n /**\n * Render the component\n * @returns {JSX}\n */\n render() {\n return (\n <div className=\"presto-player-divi-editor\">\n <ul className=\"presto-player-divi-editor__inputs\">\n <li>\n <PrestoNonceProvider container={window.parent.document.body}>\n <AsyncSelect\n id={`prpd_video_selector-${this.props.name}`}\n className=\"prpd_video_selector\"\n cacheOptions\n defaultOptions\n name={this.props.name}\n value={{\n value: this.props.value,\n label: this.currentVideoLabel(),\n }}\n onChange={this._onChange}\n loadOptions={(inputValue) =>\n this.debouncedLoadVideos(inputValue)\n }\n />\n </PrestoNonceProvider>\n </li>\n <li>\n <label>{__(\"Video Options\", \"presto-player\")}</label>\n <button type=\"button\" onClick={this._onEditVideoClick}>\n {__(\"Edit Video\", \"presto-player\")}\n </button>\n </li>\n <li>\n <label>{__(\"New Video\", \"presto-player\")}</label>\n <button type=\"button\" onClick={this._onCreateVideoClick}>\n {__(\"Create Video\", \"presto-player\")}\n </button>\n </li>\n </ul>\n </div>\n );\n }\n}\n\nexport default VideoSelector;\n","import VideoSelector from './VideoSelector/VideoSelector';\n\nexport default [VideoSelector];\n","// External Dependencies\nimport $ from \"jquery\";\n\n// Internal Dependencies\nimport modules from \"./modules\";\nimport fields from \"./fields\";\n\n$(window).on(\"et_builder_api_ready\", (event, API) => {\n API.registerModules(modules);\n API.registerModalFields(fields);\n});\n"],"sourceRoot":""}
 
dist/divi/manifest.json CHANGED
@@ -1,8 +1,8 @@
1
  {
2
  "admin.css": "divi/admin-cfc95acf.css",
3
  "admin.css.map": "divi/admin-cfc95acf.css.map",
4
- "admin.js": "divi/admin-d97471fa.js",
5
- "admin.js.map": "divi/admin-d97471fa.js.map",
6
  "runtime.js": "divi/runtime-ff93ff9a.js",
7
  "runtime.js.map": "divi/runtime-ff93ff9a.js.map",
8
  "vendors--presto-player--admin.js": "divi/vendors--presto-player--admin-a1a04ca0.js",
@@ -13,12 +13,12 @@
13
  "js": [
14
  "divi/runtime-ff93ff9a.js",
15
  "divi/vendors--presto-player--admin-a1a04ca0.js",
16
- "divi/admin-d97471fa.js"
17
  ],
18
  "js.map": [
19
  "divi/runtime-ff93ff9a.js.map",
20
  "divi/vendors--presto-player--admin-a1a04ca0.js.map",
21
- "divi/admin-d97471fa.js.map"
22
  ],
23
  "css": [
24
  "divi/admin-cfc95acf.css"
1
  {
2
  "admin.css": "divi/admin-cfc95acf.css",
3
  "admin.css.map": "divi/admin-cfc95acf.css.map",
4
+ "admin.js": "divi/admin-1a1a82cb.js",
5
+ "admin.js.map": "divi/admin-1a1a82cb.js.map",
6
  "runtime.js": "divi/runtime-ff93ff9a.js",
7
  "runtime.js.map": "divi/runtime-ff93ff9a.js.map",
8
  "vendors--presto-player--admin.js": "divi/vendors--presto-player--admin-a1a04ca0.js",
13
  "js": [
14
  "divi/runtime-ff93ff9a.js",
15
  "divi/vendors--presto-player--admin-a1a04ca0.js",
16
+ "divi/admin-1a1a82cb.js"
17
  ],
18
  "js.map": [
19
  "divi/runtime-ff93ff9a.js.map",
20
  "divi/vendors--presto-player--admin-a1a04ca0.js.map",
21
+ "divi/admin-1a1a82cb.js.map"
22
  ],
23
  "css": [
24
  "divi/admin-cfc95acf.css"
dist/elementor/{editor-6c966761.js → editor-a0868fb3.js} RENAMED
@@ -16,4 +16,4 @@
16
  * A zero setup Webpack Bundler Script for WordPress
17
  */
18
  (window.wpackioprestoPlayerelementorJsonp=window.wpackioprestoPlayerelementorJsonp||[]).push([[0],[function(e,o,t){t(1),e.exports=t(2)},function(e,o,t){var n="prestoPlayerdist".replace(/[^a-zA-Z0-9_-]/g,"");t.p=window["__wpackIo".concat(n)]},function(e,o,t){"use strict";var n,i;t.r(o);var r="".concat(null===(n=prestoEditorData)||void 0===n?void 0:n.root).concat(null===(i=prestoEditorData)||void 0===i?void 0:i.wpVersionString,"presto-videos");jQuery(window).on("elementor/frontend/init",(function(){"undefined"!=typeof elementor&&(elementor.channels.editor.on("presto:video:edit",(function(e){var o=e.elementSettingsModel.get("video_block");o&&window.open("/wp-admin/post.php?post=".concat(o,"&action=edit"),"_blank").focus()})),elementor.channels.editor.on("editor:widget:presto_video:section_video:activated",(function(e){e.$el.find(".elementor-select2").select2({ajax:{url:r,dataType:"json",headers:{"X-WP-Nonce":prestoEditorData.nonce},data:function(e){return{search:e.term}},processResults:function(e){return{results:jQuery.map(e,(function(e){var o;return{id:e.id,text:(null==e||null===(o=e.title)||void 0===o?void 0:o.raw)||"Untitled Video"}}))}}}}),e.model.get("settings").on("change",(function(e){}))})),elementor.channels.editor.on("presto:video:create",(function(){window.open("/wp-admin/post-new.php?post_type=pp_video_block","_blank").focus()})))}))}],[[0,1]]]);
19
- //# sourceMappingURL=editor-6c966761.js.map
16
  * A zero setup Webpack Bundler Script for WordPress
17
  */
18
  (window.wpackioprestoPlayerelementorJsonp=window.wpackioprestoPlayerelementorJsonp||[]).push([[0],[function(e,o,t){t(1),e.exports=t(2)},function(e,o,t){var n="prestoPlayerdist".replace(/[^a-zA-Z0-9_-]/g,"");t.p=window["__wpackIo".concat(n)]},function(e,o,t){"use strict";var n,i;t.r(o);var r="".concat(null===(n=prestoEditorData)||void 0===n?void 0:n.root).concat(null===(i=prestoEditorData)||void 0===i?void 0:i.wpVersionString,"presto-videos");jQuery(window).on("elementor/frontend/init",(function(){"undefined"!=typeof elementor&&(elementor.channels.editor.on("presto:video:edit",(function(e){var o=e.elementSettingsModel.get("video_block");o&&window.open("/wp-admin/post.php?post=".concat(o,"&action=edit"),"_blank").focus()})),elementor.channels.editor.on("editor:widget:presto_video:section_video:activated",(function(e){e.$el.find(".elementor-select2").select2({ajax:{url:r,dataType:"json",headers:{"X-WP-Nonce":prestoEditorData.nonce},data:function(e){return{search:e.term}},processResults:function(e){return{results:jQuery.map(e,(function(e){var o;return{id:e.id,text:(null==e||null===(o=e.title)||void 0===o?void 0:o.raw)||"Untitled Video"}}))}}}}),e.model.get("settings").on("change",(function(e){}))})),elementor.channels.editor.on("presto:video:create",(function(){window.open("/wp-admin/post-new.php?post_type=pp_video_block","_blank").focus()})))}))}],[[0,1]]]);
19
+ //# sourceMappingURL=editor-a0868fb3.js.map
dist/elementor/{editor-6c966761.js.map → editor-a0868fb3.js.map} RENAMED
@@ -1 +1 @@
1
- {"version":3,"sources":["webpack:///./node_modules/@wpackio/entrypoint/lib/index.js","webpack:///./src/elementor/selector.js","webpack:///./src/elementor/editor.js"],"names":["path","replace","window","concat","url","prestoEditorData","root","wpVersionString","jQuery","on","elementor","channels","editor","view","block_id","elementSettingsModel","get","open","focus","$el","find","select2","ajax","dataType","headers","nonce","data","params","search","term","processResults","results","map","obj","id","text","title","raw","model"],"mappings":";;;;;;;;;;;;;;;;;wJASgB,IAAIA,EAAK,mBAA6CC,QAAQ,kBAAkB,IAChG,IAAwBC,OAAO,YAAYC,OAAOH,K,4CCV3C,IAAMI,EAAG,oBAAMC,wBAAN,aAAM,EAAkBC,MAAxB,iBAA+BD,wBAA/B,aAA+B,EAAkBE,gBAAjD,iBCGhBC,OAAON,QAAQO,GAAG,2BAA2B,WAClB,oBAAdC,YAIXA,UAAUC,SAASC,OAAOH,GAAG,qBAAqB,SAAUI,GAC1D,IAAIC,EAAWD,EAAKE,qBAAqBC,IAAI,eACxCF,GAGKZ,OAAOe,KAAP,kCACmBH,EADnB,gBAER,UAEEI,WAINR,UAAUC,SAASC,OAAOH,GACxB,sDACA,SAAUI,GACCA,EAAKM,IAAIC,KAAK,sBDrBlBC,QAAQ,CACfC,KAAM,CACJlB,MACAmB,SAAU,OACVC,QAAS,CACP,aAAcnB,iBAAiBoB,OAEjCC,KAAM,SAAUC,GACd,MAAO,CACLC,OAAQD,EAAOE,OAGnBC,eAAgB,SAAUJ,GACxB,MAAO,CACLK,QAASvB,OAAOwB,IAAIN,GAAM,SAAUO,GAAM,IAAD,EACvC,MAAO,CAAEC,GAAID,EAAIC,GAAIC,MAAMF,SAAA,UAAAA,EAAKG,aAAL,eAAYC,MAAO,0BCOpDxB,EAAKyB,MAAMtB,IAAI,YAAYP,GAAG,UAAU,SAAC6B,UAG7C5B,UAAUC,SAASC,OAAOH,GAAG,uBAAuB,WACxCP,OAAOe,KAAP,kDAER,UAEEC,iB","file":"elementor/editor-6c966761.js","sourcesContent":["/* eslint-disable camelcase */ /* eslint-disable babel/camelcase */ /* eslint-disable no-underscore-dangle */ // eslint-disable-next-line no-unused-vars\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\n/* global __webpack_public_path__ */ // eslint-disable-next-line spaced-comment\n///<reference types=\"webpack-env\" />\n// We expect __webpack_public_path__ to be present, thanks to webpack\n// We are not using DOM in the typescript library, so let's just hack our way\n// through window\n// tslint:disable-next-line:no-any\n// We would override __webpack_public_path__ only if __WPACKIO__ webpack plugin is set\nif(__WPACKIO__){var path=(__WPACKIO__.appName+__WPACKIO__.outputPath).replace(/[^a-zA-Z0-9_-]/g,'');// eslint-disable-next-line no-global-assign\n__webpack_public_path__=window[\"__wpackIo\".concat(path)];}","export const url = `${prestoEditorData?.root}${prestoEditorData?.wpVersionString}presto-videos`;\n\nexport default function ($element) {\n $element.select2({\n ajax: {\n url,\n dataType: \"json\",\n headers: {\n \"X-WP-Nonce\": prestoEditorData.nonce,\n },\n data: function (params) {\n return {\n search: params.term,\n };\n },\n processResults: function (data) {\n return {\n results: jQuery.map(data, function (obj) {\n return { id: obj.id, text: obj?.title?.raw || \"Untitled Video\" };\n }),\n };\n },\n },\n });\n}\n","import selector from \"./selector\";\n// import { createPlayer } from \"@/front/video\";\n\njQuery(window).on(\"elementor/frontend/init\", () => {\n if (typeof elementor === \"undefined\") {\n return;\n }\n\n elementor.channels.editor.on(\"presto:video:edit\", function (view) {\n var block_id = view.elementSettingsModel.get(\"video_block\");\n if (!block_id) {\n return;\n }\n var win = window.open(\n `/wp-admin/post.php?post=${block_id}&action=edit`,\n \"_blank\"\n );\n win.focus();\n });\n\n // dynamic links\n elementor.channels.editor.on(\n \"editor:widget:presto_video:section_video:activated\",\n function (view) {\n selector(view.$el.find(\".elementor-select2\"));\n view.model.get(\"settings\").on(\"change\", (model) => {});\n }\n );\n elementor.channels.editor.on(\"presto:video:create\", function () {\n var win = window.open(\n `/wp-admin/post-new.php?post_type=pp_video_block`,\n \"_blank\"\n );\n win.focus();\n });\n});\n"],"sourceRoot":""}
1
+ {"version":3,"sources":["webpack:///./node_modules/@wpackio/entrypoint/lib/index.js","webpack:///./src/elementor/selector.js","webpack:///./src/elementor/editor.js"],"names":["path","replace","window","concat","url","prestoEditorData","root","wpVersionString","jQuery","on","elementor","channels","editor","view","block_id","elementSettingsModel","get","open","focus","$el","find","select2","ajax","dataType","headers","nonce","data","params","search","term","processResults","results","map","obj","id","text","title","raw","model"],"mappings":";;;;;;;;;;;;;;;;;wJASgB,IAAIA,EAAK,mBAA6CC,QAAQ,kBAAkB,IAChG,IAAwBC,OAAO,YAAYC,OAAOH,K,4CCV3C,IAAMI,EAAG,oBAAMC,wBAAN,aAAM,EAAkBC,MAAxB,iBAA+BD,wBAA/B,aAA+B,EAAkBE,gBAAjD,iBCEhBC,OAAON,QAAQO,GAAG,2BAA2B,WAClB,oBAAdC,YAIXA,UAAUC,SAASC,OAAOH,GAAG,qBAAqB,SAAUI,GAC1D,IAAIC,EAAWD,EAAKE,qBAAqBC,IAAI,eACxCF,GAGKZ,OAAOe,KAAP,kCACmBH,EADnB,gBAER,UAEEI,WAINR,UAAUC,SAASC,OAAOH,GACxB,sDACA,SAAUI,GACCA,EAAKM,IAAIC,KAAK,sBDpBlBC,QAAQ,CACfC,KAAM,CACJlB,MACAmB,SAAU,OACVC,QAAS,CACP,aAAcnB,iBAAiBoB,OAEjCC,KAAM,SAAUC,GACd,MAAO,CACLC,OAAQD,EAAOE,OAGnBC,eAAgB,SAAUJ,GACxB,MAAO,CACLK,QAASvB,OAAOwB,IAAIN,GAAM,SAAUO,GAAM,IAAD,EACvC,MAAO,CAAEC,GAAID,EAAIC,GAAIC,MAAMF,SAAA,UAAAA,EAAKG,aAAL,eAAYC,MAAO,0BCMpDxB,EAAKyB,MAAMtB,IAAI,YAAYP,GAAG,UAAU,SAAC6B,UAG7C5B,UAAUC,SAASC,OAAOH,GAAG,uBAAuB,WACxCP,OAAOe,KAAP,kDAER,UAEEC,iB","file":"elementor/editor-a0868fb3.js","sourcesContent":["/* eslint-disable camelcase */ /* eslint-disable babel/camelcase */ /* eslint-disable no-underscore-dangle */ // eslint-disable-next-line no-unused-vars\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\n/* global __webpack_public_path__ */ // eslint-disable-next-line spaced-comment\n///<reference types=\"webpack-env\" />\n// We expect __webpack_public_path__ to be present, thanks to webpack\n// We are not using DOM in the typescript library, so let's just hack our way\n// through window\n// tslint:disable-next-line:no-any\n// We would override __webpack_public_path__ only if __WPACKIO__ webpack plugin is set\nif(__WPACKIO__){var path=(__WPACKIO__.appName+__WPACKIO__.outputPath).replace(/[^a-zA-Z0-9_-]/g,'');// eslint-disable-next-line no-global-assign\n__webpack_public_path__=window[\"__wpackIo\".concat(path)];}","export const url = `${prestoEditorData?.root}${prestoEditorData?.wpVersionString}presto-videos`;\n\nexport default function ($element) {\n $element.select2({\n ajax: {\n url,\n dataType: \"json\",\n headers: {\n \"X-WP-Nonce\": prestoEditorData.nonce,\n },\n data: function (params) {\n return {\n search: params.term,\n };\n },\n processResults: function (data) {\n return {\n results: jQuery.map(data, function (obj) {\n return { id: obj.id, text: obj?.title?.raw || \"Untitled Video\" };\n }),\n };\n },\n },\n });\n}\n","import selector from \"./selector\";\n\njQuery(window).on(\"elementor/frontend/init\", () => {\n if (typeof elementor === \"undefined\") {\n return;\n }\n\n elementor.channels.editor.on(\"presto:video:edit\", function (view) {\n var block_id = view.elementSettingsModel.get(\"video_block\");\n if (!block_id) {\n return;\n }\n var win = window.open(\n `/wp-admin/post.php?post=${block_id}&action=edit`,\n \"_blank\"\n );\n win.focus();\n });\n\n // dynamic links\n elementor.channels.editor.on(\n \"editor:widget:presto_video:section_video:activated\",\n function (view) {\n selector(view.$el.find(\".elementor-select2\"));\n view.model.get(\"settings\").on(\"change\", (model) => {});\n }\n );\n elementor.channels.editor.on(\"presto:video:create\", function () {\n var win = window.open(\n `/wp-admin/post-new.php?post_type=pp_video_block`,\n \"_blank\"\n );\n win.focus();\n });\n});\n"],"sourceRoot":""}
dist/elementor/manifest.json CHANGED
@@ -1,6 +1,6 @@
1
  {
2
- "editor.js": "elementor/editor-6c966761.js",
3
- "editor.js.map": "elementor/editor-6c966761.js.map",
4
  "runtime.js": "elementor/runtime-5c0725d1.js",
5
  "runtime.js.map": "elementor/runtime-5c0725d1.js.map",
6
  "wpackioEp": {
@@ -8,11 +8,11 @@
8
  "assets": {
9
  "js": [
10
  "elementor/runtime-5c0725d1.js",
11
- "elementor/editor-6c966761.js"
12
  ],
13
  "js.map": [
14
  "elementor/runtime-5c0725d1.js.map",
15
- "elementor/editor-6c966761.js.map"
16
  ]
17
  }
18
  }
1
  {
2
+ "editor.js": "elementor/editor-a0868fb3.js",
3
+ "editor.js.map": "elementor/editor-a0868fb3.js.map",
4
  "runtime.js": "elementor/runtime-5c0725d1.js",
5
  "runtime.js.map": "elementor/runtime-5c0725d1.js.map",
6
  "wpackioEp": {
8
  "assets": {
9
  "js": [
10
  "elementor/runtime-5c0725d1.js",
11
+ "elementor/editor-a0868fb3.js"
12
  ],
13
  "js.map": [
14
  "elementor/runtime-5c0725d1.js.map",
15
+ "elementor/editor-a0868fb3.js.map"
16
  ]
17
  }
18
  }
inc/Support/DynamicData.php CHANGED
@@ -13,7 +13,7 @@ class DynamicData
13
  {
14
  $current_user = wp_get_current_user();
15
 
16
- return [
17
  '{user.user_login}' => $current_user->user_login ?? '',
18
  '{user.user_nicename}' => $current_user->user_nicename ?? '',
19
  '{user.user_email}' => $current_user->user_email ?? '',
@@ -23,7 +23,7 @@ class DynamicData
23
  '{site.url}' => get_home_url(),
24
  '{site.name}' => get_bloginfo(),
25
  '{ip_address}' => self::getIP()
26
- ];
27
  }
28
 
29
  /**
13
  {
14
  $current_user = wp_get_current_user();
15
 
16
+ return apply_filters('presto-player/dynamic-data', [
17
  '{user.user_login}' => $current_user->user_login ?? '',
18
  '{user.user_nicename}' => $current_user->user_nicename ?? '',
19
  '{user.user_email}' => $current_user->user_email ?? '',
23
  '{site.url}' => get_home_url(),
24
  '{site.name}' => get_bloginfo(),
25
  '{ip_address}' => self::getIP()
26
+ ]);
27
  }
28
 
29
  /**
languages/presto-player.pot CHANGED
@@ -7,7 +7,7 @@ msgstr ""
7
  "MIME-Version: 1.0\n"
8
  "Content-Type: text/plain; charset=UTF-8\n"
9
  "Content-Transfer-Encoding: 8bit\n"
10
- "POT-Creation-Date: 2021-08-24T18:03:35+00:00\n"
11
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
12
  "X-Generator: WP-CLI 2.5.0\n"
13
 
@@ -68,7 +68,7 @@ msgid "Top Users"
68
  msgstr ""
69
 
70
  #: admin/analytics/components/TopVideos.js:55
71
- #: admin/integrations/divi/fields/VideoSelector/VideoSelector.jsx:110
72
  msgid "Untitled"
73
  msgstr ""
74
 
@@ -1655,26 +1655,26 @@ msgstr ""
1655
  msgid "Must be logged in"
1656
  msgstr ""
1657
 
1658
- #: admin/integrations/divi/fields/VideoSelector/VideoSelector.jsx:204
1659
  #: Integrations/Elementor/ReusableVideoWidget.php:133
1660
  #: Integrations/Elementor/VideoWidget.php:254
1661
  msgid "Video Options"
1662
  msgstr ""
1663
 
1664
- #: admin/integrations/divi/fields/VideoSelector/VideoSelector.jsx:206
1665
  #: Integrations/BeaverBuilder/ReusableVideoModule/Module.php:109
1666
  #: Integrations/Elementor/ReusableVideoWidget.php:135
1667
  #: Services/VideoPostType.php:194
1668
  msgid "Edit Video"
1669
  msgstr ""
1670
 
1671
- #: admin/integrations/divi/fields/VideoSelector/VideoSelector.jsx:210
1672
  #: Integrations/Elementor/ReusableVideoWidget.php:146
1673
  #: Services/VideoPostType.php:193
1674
  msgid "New Video"
1675
  msgstr ""
1676
 
1677
- #: admin/integrations/divi/fields/VideoSelector/VideoSelector.jsx:212
1678
  #: Integrations/BeaverBuilder/ReusableVideoModule/Module.php:105
1679
  #: Integrations/Elementor/ReusableVideoWidget.php:150
1680
  msgid "Create Video"
7
  "MIME-Version: 1.0\n"
8
  "Content-Type: text/plain; charset=UTF-8\n"
9
  "Content-Transfer-Encoding: 8bit\n"
10
+ "POT-Creation-Date: 2021-08-26T16:13:02+00:00\n"
11
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
12
  "X-Generator: WP-CLI 2.5.0\n"
13
 
68
  msgstr ""
69
 
70
  #: admin/analytics/components/TopVideos.js:55
71
+ #: admin/integrations/divi/fields/VideoSelector/VideoSelector.jsx:111
72
  msgid "Untitled"
73
  msgstr ""
74
 
1655
  msgid "Must be logged in"
1656
  msgstr ""
1657
 
1658
+ #: admin/integrations/divi/fields/VideoSelector/VideoSelector.jsx:205
1659
  #: Integrations/Elementor/ReusableVideoWidget.php:133
1660
  #: Integrations/Elementor/VideoWidget.php:254
1661
  msgid "Video Options"
1662
  msgstr ""
1663
 
1664
+ #: admin/integrations/divi/fields/VideoSelector/VideoSelector.jsx:207
1665
  #: Integrations/BeaverBuilder/ReusableVideoModule/Module.php:109
1666
  #: Integrations/Elementor/ReusableVideoWidget.php:135
1667
  #: Services/VideoPostType.php:194
1668
  msgid "Edit Video"
1669
  msgstr ""
1670
 
1671
+ #: admin/integrations/divi/fields/VideoSelector/VideoSelector.jsx:211
1672
  #: Integrations/Elementor/ReusableVideoWidget.php:146
1673
  #: Services/VideoPostType.php:193
1674
  msgid "New Video"
1675
  msgstr ""
1676
 
1677
+ #: admin/integrations/divi/fields/VideoSelector/VideoSelector.jsx:213
1678
  #: Integrations/BeaverBuilder/ReusableVideoModule/Module.php:105
1679
  #: Integrations/Elementor/ReusableVideoWidget.php:150
1680
  msgid "Create Video"
presto-player.php CHANGED
@@ -4,7 +4,7 @@
4
  * Plugin Name: Presto Player
5
  * Plugin URI: http://prestoplayer.com
6
  * Description: A beautiful, fast media player for WordPress.
7
- * Version: 1.6.0
8
  * Author: Presto Made, Inc
9
  * Text Domain: presto-player
10
  * Tags: private, video, lms, hls
4
  * Plugin Name: Presto Player
5
  * Plugin URI: http://prestoplayer.com
6
  * Description: A beautiful, fast media player for WordPress.
7
+ * Version: 1.6.1
8
  * Author: Presto Made, Inc
9
  * Text Domain: presto-player
10
  * Tags: private, video, lms, hls
readme.txt CHANGED
@@ -153,7 +153,10 @@ It is also important to point out that BunnyNet has a $1 per month minimum.
153
 
154
  == Changelog ==
155
 
156
- = 1.6.0 - July 20, 2021 =
 
 
 
157
  * New Feature: Divi Integration.
158
  * New Feature: [Dyamic Overlays](https://prestoplayer.com/overlays).
159
  * New Feature: [Dyanmic Text Watermark](https://prestoplayer.com/dynamic-watermarks).
153
 
154
  == Changelog ==
155
 
156
+ = 1.6.1 - August 26, 2021 =
157
+ * Fix issue with search term not being sent to server in Divi module.
158
+
159
+ = 1.6.0 - August 23, 2021 =
160
  * New Feature: Divi Integration.
161
  * New Feature: [Dyamic Overlays](https://prestoplayer.com/overlays).
162
  * New Feature: [Dyanmic Text Watermark](https://prestoplayer.com/dynamic-watermarks).
src/admin/integrations/divi/fields/VideoSelector/VideoSelector.jsx CHANGED
@@ -30,7 +30,8 @@ class VideoSelector extends Component {
30
  this.state = { videos: [] };
31
 
32
  const wait = 500; // milliseconds
33
- const loadVideos = (inputValue) => this.loadVideos(inputValue);
 
34
  this.debouncedLoadVideos = debounce(loadVideos, wait, {
35
  leading: true,
36
  });
30
  this.state = { videos: [] };
31
 
32
  const wait = 500; // milliseconds
33
+ const loadVideos = (inputValue) =>
34
+ this.loadVideos({ searchTerm: inputValue });
35
  this.debouncedLoadVideos = debounce(loadVideos, wait, {
36
  leading: true,
37
  });
src/elementor/editor.js CHANGED
@@ -1,5 +1,4 @@
1
  import selector from "./selector";
2
- // import { createPlayer } from "@/front/video";
3
 
4
  jQuery(window).on("elementor/frontend/init", () => {
5
  if (typeof elementor === "undefined") {
1
  import selector from "./selector";
 
2
 
3
  jQuery(window).on("elementor/frontend/init", () => {
4
  if (typeof elementor === "undefined") {
vendor/composer/installed.php CHANGED
@@ -1,22 +1,22 @@
1
  <?php return array(
2
  'root' => array(
3
- 'pretty_version' => 'dev-next',
4
- 'version' => 'dev-next',
5
  'type' => 'project',
6
  'install_path' => __DIR__ . '/../../',
7
  'aliases' => array(),
8
- 'reference' => '576f4e7305c2b5023f6e9ab30b1ecca181d3e3e2',
9
  'name' => 'course/player',
10
  'dev' => false,
11
  ),
12
  'versions' => array(
13
  'course/player' => array(
14
- 'pretty_version' => 'dev-next',
15
- 'version' => 'dev-next',
16
  'type' => 'project',
17
  'install_path' => __DIR__ . '/../../',
18
  'aliases' => array(),
19
- 'reference' => '576f4e7305c2b5023f6e9ab30b1ecca181d3e3e2',
20
  'dev_requirement' => false,
21
  ),
22
  'level-2/dice' => array(
1
  <?php return array(
2
  'root' => array(
3
+ 'pretty_version' => 'dev-master',
4
+ 'version' => 'dev-master',
5
  'type' => 'project',
6
  'install_path' => __DIR__ . '/../../',
7
  'aliases' => array(),
8
+ 'reference' => '9f864c1342477064640173782f0d1b9e7533591a',
9
  'name' => 'course/player',
10
  'dev' => false,
11
  ),
12
  'versions' => array(
13
  'course/player' => array(
14
+ 'pretty_version' => 'dev-master',
15
+ 'version' => 'dev-master',
16
  'type' => 'project',
17
  'install_path' => __DIR__ . '/../../',
18
  'aliases' => array(),
19
+ 'reference' => '9f864c1342477064640173782f0d1b9e7533591a',
20
  'dev_requirement' => false,
21
  ),
22
  'level-2/dice' => array(