YouTube - Version 14.1.4

Version Description

Download this release

Release Info

Developer embedplus
Plugin Icon 128x128 YouTube
Version 14.1.4
Comparing to
See all releases

Code changes from version 14.1.3 to 14.1.4

readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: embedplus
3
  Plugin Name: Embed Plus Plugin for YouTube, with YouTube Gallery, Channel, Playlist, Live Stream, Facade
4
  Tags: youtube gallery, youtube wordpress plugin, channel gallery, playlist gallery, defer css javascript, youtube channel, youtube live, lazy load, facade
5
  Requires at least: 4.5
6
- Tested up to: 6.0
7
- Stable tag: 14.1.3
8
  License: GPLv3 or later
9
 
10
  YouTube Embed WordPress Plugin. Embed a responsive video, YouTube channel gallery, playlist gallery, YouTube livestream. Defer JavaScript
@@ -189,6 +189,12 @@ Assuming you already have the EmbedPlus plugin active, you can embed a YouTube s
189
 
190
  == Changelog ==
191
 
 
 
 
 
 
 
192
  = Embed Plus for YouTube WordPress Plugin 14.1.3 =
193
  * Better compatibility with Jetpack images
194
  * Avoids unused javascript when not using responsive sizing
3
  Plugin Name: Embed Plus Plugin for YouTube, with YouTube Gallery, Channel, Playlist, Live Stream, Facade
4
  Tags: youtube gallery, youtube wordpress plugin, channel gallery, playlist gallery, defer css javascript, youtube channel, youtube live, lazy load, facade
5
  Requires at least: 4.5
6
+ Tested up to: 6.1
7
+ Stable tag: 14.1.4
8
  License: GPLv3 or later
9
 
10
  YouTube Embed WordPress Plugin. Embed a responsive video, YouTube channel gallery, playlist gallery, YouTube livestream. Defer JavaScript
189
 
190
  == Changelog ==
191
 
192
+ = Embed Plus for YouTube WordPress Plugin 14.1.4 =
193
+ * Fixes issues from 14.1.3
194
+ * Higher quality facade images
195
+ * Better compatibility with Jetpack and Short Pixel lazy loaded images
196
+ * Fixes an issue with the Classic/TinyMCE editor
197
+
198
  = Embed Plus for YouTube WordPress Plugin 14.1.3 =
199
  * Better compatibility with Jetpack images
200
  * Avoids unused javascript when not using responsive sizing
scripts/ytprefs-admin.js CHANGED
@@ -234,7 +234,10 @@
234
  window._EPADashboard_.apiInit();
235
  window._EPADashboard_.log("YT API GB");
236
  window._EPADashboard_.pageReady();
237
- $.fn.fitVidsEP && $('body').fitVidsEP();
 
 
 
238
  };
239
 
240
  window._EPYTA_.iabAdd = function (iabVal, iabText, iabTextParent)
@@ -359,7 +362,7 @@
359
 
360
  $(document).on('wp-before-tinymce-init.ytprefs-media_button', function (event, init)
361
  {
362
- $media_buttons = $(init.selector).closest('.wp-editor-wrap').find('.wp-media-buttons');
363
  if (!$media_buttons.find('.ytprefs_media_link').length)
364
  {
365
  $media_buttons.append('<a href="' + encodeURI(window._EPYTA_.wizhref) + '" class="thickbox button ytprefs_media_link ytprefs_wiz_button_widget_text" title="Visual YouTube Search Tool and Wizard - For easier embedding"><span></span> YouTube</a>');
@@ -1150,4 +1153,4 @@
1150
  $('.ytprefs-onboarding-launch').trigger('click');
1151
  }
1152
  }); // end onload
1153
- })(window, jQuery);
234
  window._EPADashboard_.apiInit();
235
  window._EPADashboard_.log("YT API GB");
236
  window._EPADashboard_.pageReady();
237
+ if (typeof $.fn.fitVidsEP !== 'undefined')
238
+ {
239
+ $('body').fitVidsEP();
240
+ }
241
  };
242
 
243
  window._EPYTA_.iabAdd = function (iabVal, iabText, iabTextParent)
362
 
363
  $(document).on('wp-before-tinymce-init.ytprefs-media_button', function (event, init)
364
  {
365
+ var $media_buttons = $(init.selector).closest('.wp-editor-wrap').find('.wp-media-buttons');
366
  if (!$media_buttons.find('.ytprefs_media_link').length)
367
  {
368
  $media_buttons.append('<a href="' + encodeURI(window._EPYTA_.wizhref) + '" class="thickbox button ytprefs_media_link ytprefs_wiz_button_widget_text" title="Visual YouTube Search Tool and Wizard - For easier embedding"><span></span> YouTube</a>');
1153
  $('.ytprefs-onboarding-launch').trigger('click');
1154
  }
1155
  }); // end onload
1156
+ })(window, jQuery);
scripts/ytprefs-admin.min.js CHANGED
@@ -4,13 +4,13 @@ a(b._EPYTA_.escId("vi_js_settings[textColor]")).val())},0)};b._EPYTA_.demoFontFa
4
  function(f){a(".ytprefs-ob-step").removeClass("active-step");setTimeout(function(){b.scrollTo(0,0);f.prev().addClass("active-step")},600)};b._EPYTA_.selectText=function(f){if(document.selection){var c=document.body.createTextRange();c.moveToElementText(f);c.select()}else if(b.getSelection){var d=b.getSelection();c=document.createRange();c.selectNode(f);d.removeAllRanges();d.addRange(c)}};b._EPYTA_.adstxtLookup=function(){b._EPYTA_.adstxtLoading(!0);a.ajax({url:location.protocol+"//"+location.hostname+
5
  "/ads.txt?c="+Date.now(),dataType:"text",type:"get",data:"",headers:{"Cache-Control":"no-cache"},async:!0}).always(function(f,c,d){if("success"===c)switch(d.status){case 200:case 301:case 302:case 304:case 307:b._EPYTA_.adstxtVerify(f);break;default:b._EPYTA_.adstxtVerify("")}else 404==f.status?a.ajax({url:location.protocol+"//"+location.hostname+"/ads.txt",dataType:"text",type:"get",data:"",headers:{"Cache-Control":"no-cache"},async:!0}).always(function(e,g,h){if("success"===g)switch(h.status){case 200:case 301:case 302:case 304:case 307:b._EPYTA_.adstxtVerify(e);
6
  break;default:b._EPYTA_.adstxtVerify("")}else b._EPYTA_.adstxtVerify("")}):b._EPYTA_.adstxtVerify("")})};b._EPYTA_.adstxtVerify=function(f){a.ajax({type:"post",dataType:"json",timeout:12E4,url:b._EPYTA_.wpajaxurl,data:{security:b._EPYTA_.security,action:"my_embedplus_vi_adstxt_status_soft_ajax",current_adstxt:f},success:function(c){2==c.code?a(".nav-tab-adstxt").addClass("nav-tab-valid"):0>=c.code&&a(".nav-tab-adstxt").addClass("nav-tab-invalid");a(".adstxt-verify-message").html(c.message)},error:function(c,
7
- d,e){a(".nav-tab-adstxt").addClass("nav-tab-invalid");a(".adstxt-verify-message").html("Could not validate ads.txt: "+e)},complete:function(){b._EPYTA_.adstxtLoading(!1)}})};b._EPYTA_.adstxtLoading=function(f){f?a(".nav-tab-adstxt").addClass("nav-tab-loading"):a(".nav-tab-adstxt").removeClass("nav-tab-loading")};b._EPYTA_.gbPreviewSetup=function(){b._EPADashboard_.loadYTAPI();b._EPADashboard_.apiInit();b._EPADashboard_.log("YT API GB");b._EPADashboard_.pageReady();a.fn.fitVidsEP&&a("body").fitVidsEP()};
8
- b._EPYTA_.iabAdd=function(f,c,d){f=a('<div class="iab-cat-tag-button" data-tag="'+f+'">'+d+" : "+c+" &times;</div>");a(".iab-cat-tags-display").append(f);a(".iab-cat-tags-display .iab-cat-tag-button").sort(function(e,g){return a(e).text()>a(g).text()?1:-1}).appendTo(".iab-cat-tags-display")};a.fn.ytprefsFormJSON=function(){var f={},c=this.serializeArray();a.each(c,function(){f[this.name]?(f[this.name].push||(f[this.name]=[f[this.name]]),f[this.name].push(this.value||"")):f[this.name]=this.value||
9
- ""});return f};a(document).ready(function(){0===b.location.toString().indexOf("https://")&&(b._EPYTA_.wpajaxurl=b._EPYTA_.wpajaxurl.replace("http://","https://"));var f=b.addEventListener?"addEventListener":"attachEvent";(0,b[f])("attachEvent"==f?"onmessage":"message",function(c){var d="";try{if(0===c.data.indexOf("youtubeembedplus")&&0>c.data.indexOf("clientId=")){d=c.data.split("|")[1];0!==d.indexOf("[")&&(d="<p>"+d+"</p>");if(null===b.tinyMCE||null===b.tinyMCE.activeEditor||b.tinyMCE.activeEditor.isHidden())d=
10
  d.replace("<p>","\n").replace("</p>","\n"),"function"===typeof QTags.insertContent?QTags.insertContent(d):send_to_editor(d);else{if(b._EPYTA_.mceBookmark)try{b.tinyMCE.activeEditor.selection.moveToBookmark(b._EPYTA_.mceBookmark)}catch(e){}"undefined"!==typeof b.tinyMCE.execInstanceCommand?b.tinyMCE.execInstanceCommand(b.tinyMCE.activeEditor.id,"mceInsertContent",!1,d):send_to_editor(d);setTimeout(function(){b._EPYTA_.mceBookmark=null},500)}tb_remove()}}catch(e){}},!1);a("body").on("click.tbyt","#ytprefs_wiz_button, .ytprefs_wiz_button_widget_text, .ytprefs-onboarding-launch",
11
- function(){b._EPYTA_.widen_ytprefs_wiz()});a("body").on("click.tbyt","#ytprefs_wiz_button_vi, .ytprefs_wiz_button_vi_widget_text",function(){send_to_editor("<p>[embed-vi-ad]</p>")});a(b).on("resize",b._EPYTA_.widen_ytprefs_wiz);a(document).on("wp-before-tinymce-init.ytprefs-media_button",function(c,d){$media_buttons=a(d.selector).closest(".wp-editor-wrap").find(".wp-media-buttons");$media_buttons.find(".ytprefs_media_link").length||($media_buttons.append('<a href="'+encodeURI(b._EPYTA_.wizhref)+'" class="thickbox button ytprefs_media_link ytprefs_wiz_button_widget_text" title="Visual YouTube Search Tool and Wizard - For easier embedding"><span></span> YouTube</a>'),
12
- b._EPYTA_.manage_options&&b._EPYTA_.vi_logged_in&&$media_buttons.append('<a class="button ytprefs_vi_embed_shortcode" id="ytprefs_wiz_button_vi" title="Embed vi video ad"><span></span> Video Ad</a>'))});a(".wrap-vi-settings").length&&b._EPYTA_.adstxtLookup();a('.wrap section a[href^="#jump"]').on("click",function(c){c.preventDefault();c=a(this).attr("href");a('.nav-tab-wrapper a[href="'+c+'"], .nav-tab-wrapper a[rel="'+c+'"]').trigger("click")});a(".ytprefs-ajax-form").on("keypress",function(c){13==
13
- c.which&&(c.preventDefault(),a(this).find(".ytprefs-ajax-form--submit:not([disabled])").trigger("click"))});a(".vi-cover-prompt-no").on("click",function(){a.ajax({type:"post",dataType:"json",timeout:12E4,url:b._EPYTA_.wpajaxurl,data:{security:b._EPYTA_.security,action:"my_embedplus_vi_hide_feature_ajax"},success:function(c){c&&"error"!==c.type?b!=b.top?b.location.reload():b.top.location.href=c.url:alertify.alert(c.message)},error:function(c,d,e){alertify.alert('Sorry, there was a network error. Please try again, or turn off this feature using the "Hide Monetize Feature" checkbox on the "Defaults" tab of the YouTube settings. If the issue persists, please contact ext@embedplus.com')},
14
  complete:function(){}})});a(".vi-cover-prompt-yes").on("click",function(){a(".vi-cover-prompt, .vi-cover-clear").fadeOut(500);var c=new Date;c.setTime(c.getTime()+31536E6);document.cookie="vi_cover_prompt_yes=1;expires="+c.toUTCString()+";path="+b._EPYTA_.admin_url});a(".vi-cover-prompt-maybe").on("click",function(){var c=new Date;c.setTime(c.getTime()+31536E6);document.cookie="vi_cover_prompt_yes=1;expires="+c.toUTCString()+";path="+b._EPYTA_.admin_url;b!=b.top?b.location.reload():b.top.location.href=
15
  b._EPYTA_.admin_url_ytprefs});1<a(".vi-demo-screen").length&&setInterval(function(){a(".vi-demo-screen-2").toggleClass("demo-hide");a(".vi-demo-mobile-caption").toggleClass("demo-hide")},2E4);a(".ytvi-step-1--submit-register").on("click",function(c){var d=a.trim(a(".ytvi-register-email").val());d.length?(a(".ytvi-step-1--submit-register").prop("disabled",!0),a(".ytvi-step-1").hide("fade",{},500,function(){a(".ytvi-step-2-loading").show("fade",{},500,function(){a.ajax({type:"post",dataType:"json",
16
  timeout:12E4,url:b._EPYTA_.wpajaxurl,data:{security:b._EPYTA_.security,action:"my_embedplus_vi_cache_endpoints_ajax",email:d,domain:b.location.href},success:function(e){if("success"==e.type){a(".ytvi-step-2 .ytvi-registration iframe").attr("src",e.signupURLParams);setTimeout(function(){a(".ytvi-step-2-loading").hide("fade",{},500,function(){a(".ytvi-step-2").show("fade",{},500)})},3E3);e=new Date;var g=new Date;g.setTime(g.getTime()+31536E6);document.cookie="vi_signup_attempt="+e.toUTCString()+";expires="+
4
  function(f){a(".ytprefs-ob-step").removeClass("active-step");setTimeout(function(){b.scrollTo(0,0);f.prev().addClass("active-step")},600)};b._EPYTA_.selectText=function(f){if(document.selection){var c=document.body.createTextRange();c.moveToElementText(f);c.select()}else if(b.getSelection){var d=b.getSelection();c=document.createRange();c.selectNode(f);d.removeAllRanges();d.addRange(c)}};b._EPYTA_.adstxtLookup=function(){b._EPYTA_.adstxtLoading(!0);a.ajax({url:location.protocol+"//"+location.hostname+
5
  "/ads.txt?c="+Date.now(),dataType:"text",type:"get",data:"",headers:{"Cache-Control":"no-cache"},async:!0}).always(function(f,c,d){if("success"===c)switch(d.status){case 200:case 301:case 302:case 304:case 307:b._EPYTA_.adstxtVerify(f);break;default:b._EPYTA_.adstxtVerify("")}else 404==f.status?a.ajax({url:location.protocol+"//"+location.hostname+"/ads.txt",dataType:"text",type:"get",data:"",headers:{"Cache-Control":"no-cache"},async:!0}).always(function(e,g,h){if("success"===g)switch(h.status){case 200:case 301:case 302:case 304:case 307:b._EPYTA_.adstxtVerify(e);
6
  break;default:b._EPYTA_.adstxtVerify("")}else b._EPYTA_.adstxtVerify("")}):b._EPYTA_.adstxtVerify("")})};b._EPYTA_.adstxtVerify=function(f){a.ajax({type:"post",dataType:"json",timeout:12E4,url:b._EPYTA_.wpajaxurl,data:{security:b._EPYTA_.security,action:"my_embedplus_vi_adstxt_status_soft_ajax",current_adstxt:f},success:function(c){2==c.code?a(".nav-tab-adstxt").addClass("nav-tab-valid"):0>=c.code&&a(".nav-tab-adstxt").addClass("nav-tab-invalid");a(".adstxt-verify-message").html(c.message)},error:function(c,
7
+ d,e){a(".nav-tab-adstxt").addClass("nav-tab-invalid");a(".adstxt-verify-message").html("Could not validate ads.txt: "+e)},complete:function(){b._EPYTA_.adstxtLoading(!1)}})};b._EPYTA_.adstxtLoading=function(f){f?a(".nav-tab-adstxt").addClass("nav-tab-loading"):a(".nav-tab-adstxt").removeClass("nav-tab-loading")};b._EPYTA_.gbPreviewSetup=function(){b._EPADashboard_.loadYTAPI();b._EPADashboard_.apiInit();b._EPADashboard_.log("YT API GB");b._EPADashboard_.pageReady();"undefined"!==typeof a.fn.fitVidsEP&&
8
+ a("body").fitVidsEP()};b._EPYTA_.iabAdd=function(f,c,d){f=a('<div class="iab-cat-tag-button" data-tag="'+f+'">'+d+" : "+c+" &times;</div>");a(".iab-cat-tags-display").append(f);a(".iab-cat-tags-display .iab-cat-tag-button").sort(function(e,g){return a(e).text()>a(g).text()?1:-1}).appendTo(".iab-cat-tags-display")};a.fn.ytprefsFormJSON=function(){var f={},c=this.serializeArray();a.each(c,function(){f[this.name]?(f[this.name].push||(f[this.name]=[f[this.name]]),f[this.name].push(this.value||"")):f[this.name]=
9
+ this.value||""});return f};a(document).ready(function(){0===b.location.toString().indexOf("https://")&&(b._EPYTA_.wpajaxurl=b._EPYTA_.wpajaxurl.replace("http://","https://"));var f=b.addEventListener?"addEventListener":"attachEvent";(0,b[f])("attachEvent"==f?"onmessage":"message",function(c){var d="";try{if(0===c.data.indexOf("youtubeembedplus")&&0>c.data.indexOf("clientId=")){d=c.data.split("|")[1];0!==d.indexOf("[")&&(d="<p>"+d+"</p>");if(null===b.tinyMCE||null===b.tinyMCE.activeEditor||b.tinyMCE.activeEditor.isHidden())d=
10
  d.replace("<p>","\n").replace("</p>","\n"),"function"===typeof QTags.insertContent?QTags.insertContent(d):send_to_editor(d);else{if(b._EPYTA_.mceBookmark)try{b.tinyMCE.activeEditor.selection.moveToBookmark(b._EPYTA_.mceBookmark)}catch(e){}"undefined"!==typeof b.tinyMCE.execInstanceCommand?b.tinyMCE.execInstanceCommand(b.tinyMCE.activeEditor.id,"mceInsertContent",!1,d):send_to_editor(d);setTimeout(function(){b._EPYTA_.mceBookmark=null},500)}tb_remove()}}catch(e){}},!1);a("body").on("click.tbyt","#ytprefs_wiz_button, .ytprefs_wiz_button_widget_text, .ytprefs-onboarding-launch",
11
+ function(){b._EPYTA_.widen_ytprefs_wiz()});a("body").on("click.tbyt","#ytprefs_wiz_button_vi, .ytprefs_wiz_button_vi_widget_text",function(){send_to_editor("<p>[embed-vi-ad]</p>")});a(b).on("resize",b._EPYTA_.widen_ytprefs_wiz);a(document).on("wp-before-tinymce-init.ytprefs-media_button",function(c,d){c=a(d.selector).closest(".wp-editor-wrap").find(".wp-media-buttons");c.find(".ytprefs_media_link").length||(c.append('<a href="'+encodeURI(b._EPYTA_.wizhref)+'" class="thickbox button ytprefs_media_link ytprefs_wiz_button_widget_text" title="Visual YouTube Search Tool and Wizard - For easier embedding"><span></span> YouTube</a>'),
12
+ b._EPYTA_.manage_options&&b._EPYTA_.vi_logged_in&&c.append('<a class="button ytprefs_vi_embed_shortcode" id="ytprefs_wiz_button_vi" title="Embed vi video ad"><span></span> Video Ad</a>'))});a(".wrap-vi-settings").length&&b._EPYTA_.adstxtLookup();a('.wrap section a[href^="#jump"]').on("click",function(c){c.preventDefault();c=a(this).attr("href");a('.nav-tab-wrapper a[href="'+c+'"], .nav-tab-wrapper a[rel="'+c+'"]').trigger("click")});a(".ytprefs-ajax-form").on("keypress",function(c){13==c.which&&(c.preventDefault(),
13
+ a(this).find(".ytprefs-ajax-form--submit:not([disabled])").trigger("click"))});a(".vi-cover-prompt-no").on("click",function(){a.ajax({type:"post",dataType:"json",timeout:12E4,url:b._EPYTA_.wpajaxurl,data:{security:b._EPYTA_.security,action:"my_embedplus_vi_hide_feature_ajax"},success:function(c){c&&"error"!==c.type?b!=b.top?b.location.reload():b.top.location.href=c.url:alertify.alert(c.message)},error:function(c,d,e){alertify.alert('Sorry, there was a network error. Please try again, or turn off this feature using the "Hide Monetize Feature" checkbox on the "Defaults" tab of the YouTube settings. If the issue persists, please contact ext@embedplus.com')},
14
  complete:function(){}})});a(".vi-cover-prompt-yes").on("click",function(){a(".vi-cover-prompt, .vi-cover-clear").fadeOut(500);var c=new Date;c.setTime(c.getTime()+31536E6);document.cookie="vi_cover_prompt_yes=1;expires="+c.toUTCString()+";path="+b._EPYTA_.admin_url});a(".vi-cover-prompt-maybe").on("click",function(){var c=new Date;c.setTime(c.getTime()+31536E6);document.cookie="vi_cover_prompt_yes=1;expires="+c.toUTCString()+";path="+b._EPYTA_.admin_url;b!=b.top?b.location.reload():b.top.location.href=
15
  b._EPYTA_.admin_url_ytprefs});1<a(".vi-demo-screen").length&&setInterval(function(){a(".vi-demo-screen-2").toggleClass("demo-hide");a(".vi-demo-mobile-caption").toggleClass("demo-hide")},2E4);a(".ytvi-step-1--submit-register").on("click",function(c){var d=a.trim(a(".ytvi-register-email").val());d.length?(a(".ytvi-step-1--submit-register").prop("disabled",!0),a(".ytvi-step-1").hide("fade",{},500,function(){a(".ytvi-step-2-loading").show("fade",{},500,function(){a.ajax({type:"post",dataType:"json",
16
  timeout:12E4,url:b._EPYTA_.wpajaxurl,data:{security:b._EPYTA_.security,action:"my_embedplus_vi_cache_endpoints_ajax",email:d,domain:b.location.href},success:function(e){if("success"==e.type){a(".ytvi-step-2 .ytvi-registration iframe").attr("src",e.signupURLParams);setTimeout(function(){a(".ytvi-step-2-loading").hide("fade",{},500,function(){a(".ytvi-step-2").show("fade",{},500)})},3E3);e=new Date;var g=new Date;g.setTime(g.getTime()+31536E6);document.cookie="vi_signup_attempt="+e.toUTCString()+";expires="+
scripts/ytprefs.js CHANGED
@@ -125,7 +125,6 @@
125
  if (typeof event.target.stopVideo === 'function')
126
  {
127
  event.target.stopVideo();
128
- //window._EPADashboard_.log('video stopped');
129
  }
130
  else
131
  {
@@ -134,7 +133,6 @@
134
  $(ifm).replaceWith($iframeTemp);
135
  window._EPADashboard_.setupevents($iframeTemp.attr('id'));
136
  ifm = $iframeTemp.get(0);
137
- //window._EPADashboard_.log('video reloaded');
138
  }
139
  }
140
 
@@ -214,7 +212,10 @@
214
  window._EPADashboard_.pageReady();
215
  setTimeout(function ()
216
  {
217
- $.fn.fitVidsEP && $($swapBlockParent).fitVidsEP();
 
 
 
218
  }, 1);
219
  }
220
  }
@@ -287,11 +288,6 @@
287
  {
288
  __allytifr[i].id = "_dytid_" + Math.round(Math.random() * 8999 + 1000);
289
  }
290
- // $(__allytifr[i]).on('lazyloaded', function(){
291
- // window._EPADashboard_.log('lazyloaded: ' + this.src + '\n' + $(this).attr('src') + '\n' + $(this).attr('data-src'));
292
- // this.src = $(this).data('src');
293
- // window._EPADashboard_.setVidSrc($(this), $(this).data('src'));
294
- // });
295
  window._EPADashboard_.setupevents(__allytifr[i].id);
296
  }
297
  }
@@ -388,19 +384,37 @@
388
  }
389
  }
390
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
391
  pageReady: function ()
392
  {
393
  if (window._EPYT_.not_live_on_channel && window._EPYT_.ytapi_load !== 'never')
394
  {
395
  $('.epyt-live-channel').each(function ()
396
  {
397
- if (!$(this).data('eypt-fallback'))
 
398
  {
399
- $(this).data('eypt-fallback', true);
400
- $(this).css('opacity', 0);
401
  setTimeout(function ()
402
  {
403
- $('.epyt-live-channel').css('opacity', 1);
404
  }, 4000);
405
  }
406
  });
@@ -598,26 +612,10 @@
598
 
599
  $('img.epyt-facade-poster').on("load.epyt", function ()
600
  {
601
- this.epytFacadeCount = this.epytFacadeCount ? this.epytFacadeCount + 1 : 1;
602
- if (this.naturalHeight < 200)
603
- {
604
- var facadeOldSrc = $(this).attr("src");
605
- if (facadeOldSrc)
606
- {
607
- $(this).attr("src", facadeOldSrc.replace('maxresdefault', 'hqdefault'));
608
- }
609
- }
610
- if (this.epytFacadeCount > 3)
611
- {
612
- $(this).off('load.epyt');
613
- }
614
  }).on('error', function ()
615
  {
616
- var facadeOldSrc = $(this).attr("src");
617
- if (facadeOldSrc)
618
- {
619
- $(this).attr("src", facadeOldSrc.replace('maxresdefault', 'hqdefault'));
620
- }
621
  }).each(function ()
622
  {
623
  if (this.complete)
@@ -637,18 +635,22 @@
637
  $('.epyt-facade-poster[data-facadeoembed]').each(function ()
638
  {
639
  var $facadePoster = $(this);
640
- var facadeOembedUrl = 'https://www.youtube.com/' + $facadePoster.data('facadeoembed');
641
- $.get('https://youtube.com/oembed', {url: facadeOembedUrl, format: 'json'},
642
- function (response)
643
- {
644
- $facadePoster.attr('src', response.thumbnail_url.replace('hqdefault', 'maxresdefault'));
645
- }, 'json')
646
- .fail(function ()
647
- {
648
- })
649
- .always(function ()
650
- {
651
- });
 
 
 
 
652
  });
653
 
654
  $(document).on('click', '.epyt-facade', function (e)
@@ -674,7 +676,10 @@
674
  window._EPADashboard_.setupevents($(iframe).attr('id'));
675
  setTimeout(function ()
676
  {
677
- $.fn.fitVidsEP && $($(iframe).parent()).fitVidsEP();
 
 
 
678
  }, 1);
679
  });
680
  }
125
  if (typeof event.target.stopVideo === 'function')
126
  {
127
  event.target.stopVideo();
 
128
  }
129
  else
130
  {
133
  $(ifm).replaceWith($iframeTemp);
134
  window._EPADashboard_.setupevents($iframeTemp.attr('id'));
135
  ifm = $iframeTemp.get(0);
 
136
  }
137
  }
138
 
212
  window._EPADashboard_.pageReady();
213
  setTimeout(function ()
214
  {
215
+ if (typeof $.fn.fitVidsEP !== 'undefined')
216
+ {
217
+ $swapBlockParent.fitVidsEP();
218
+ }
219
  }, 1);
220
  }
221
  }
288
  {
289
  __allytifr[i].id = "_dytid_" + Math.round(Math.random() * 8999 + 1000);
290
  }
 
 
 
 
 
291
  window._EPADashboard_.setupevents(__allytifr[i].id);
292
  }
293
  }
384
  }
385
  }
386
  },
387
+ resolveFacadeQuality: function (img, isError)
388
+ {
389
+ img.epytFacadeCount = typeof (img.epytFacadeCount) === 'undefined' ? 0 : img.epytFacadeCount + 1;
390
+ if (isError || img.naturalHeight < 200)
391
+ {
392
+ var facadeOldSrc = $(img).attr("src");
393
+ if (facadeOldSrc)
394
+ {
395
+ $(img).attr("src", facadeOldSrc.replace('maxresdefault', 'hqdefault'));
396
+ $(img).off('load.epyt');
397
+ }
398
+ }
399
+ if (img.epytFacadeCount > 2)
400
+ {
401
+ $(img).off('load.epyt');
402
+ }
403
+ },
404
  pageReady: function ()
405
  {
406
  if (window._EPYT_.not_live_on_channel && window._EPYT_.ytapi_load !== 'never')
407
  {
408
  $('.epyt-live-channel').each(function ()
409
  {
410
+ var $ch = $(this);
411
+ if (!$ch.data('eypt-fallback'))
412
  {
413
+ $ch.data('eypt-fallback', true);
414
+ $ch.css('opacity', 0);
415
  setTimeout(function ()
416
  {
417
+ $ch.css('opacity', 1);
418
  }, 4000);
419
  }
420
  });
612
 
613
  $('img.epyt-facade-poster').on("load.epyt", function ()
614
  {
615
+ window._EPADashboard_.resolveFacadeQuality(this, false);
 
 
 
 
 
 
 
 
 
 
 
 
616
  }).on('error', function ()
617
  {
618
+ window._EPADashboard_.resolveFacadeQuality(this, true);
 
 
 
 
619
  }).each(function ()
620
  {
621
  if (this.complete)
635
  $('.epyt-facade-poster[data-facadeoembed]').each(function ()
636
  {
637
  var $facadePoster = $(this);
638
+ if (!$facadePoster.data('facadeoembedcomplete'))
639
+ {
640
+ $facadePoster.data('facadeoembedcomplete', '1');
641
+ var facadeOembedUrl = 'https://www.youtube.com/' + $facadePoster.data('facadeoembed');
642
+ $.get('https://youtube.com/oembed', {url: facadeOembedUrl, format: 'json'},
643
+ function (response)
644
+ {
645
+ $facadePoster.attr('src', response.thumbnail_url.replace('hqdefault', 'maxresdefault'));
646
+ }, 'json')
647
+ .fail(function ()
648
+ {
649
+ })
650
+ .always(function ()
651
+ {
652
+ });
653
+ }
654
  });
655
 
656
  $(document).on('click', '.epyt-facade', function (e)
676
  window._EPADashboard_.setupevents($(iframe).attr('id'));
677
  setTimeout(function ()
678
  {
679
+ if (typeof $.fn.fitVidsEP !== 'undefined')
680
+ {
681
+ $($(iframe).parent()).fitVidsEP();
682
+ }
683
  }, 1);
684
  });
685
  }
scripts/ytprefs.min.js CHANGED
@@ -4,23 +4,23 @@ b.scrollBy(0,0);return d.__qsaels});"undefined"===typeof b._EPADashboard_&&(b._E
4
  f=g.getAttribute("id");b._EPYT_.apiVideos[f]=a.target;b._EPYT_.not_live_on_channel&&0<a.target.getVideoUrl().indexOf("live_stream")&&b._EPADashboard_.doLiveFallback(g)}catch(h){}finally{c(a.target.getIframe()).css("opacity",1)}},onPlayerStateChange:function(a){var d=a.target.getIframe();b._EPYT_.pause_others&&a.data===b.YT.PlayerState.PLAYING&&b._EPADashboard_.pauseOthers(a.target);a.data===b.YT.PlayerState.PLAYING&&!0!==a.target.ponce&&-1===d.src.indexOf("autoplay=1")&&(a.target.ponce=!0);if(a.data===
5
  b.YT.PlayerState.ENDED&&"1"==c(d).data("relstop"))if("function"===typeof a.target.stopVideo)a.target.stopVideo();else{var e=c(d).clone(!0).off();e.attr("src",b._EPADashboard_.cleanSrc(e.attr("src").replace("autoplay=1","autoplay=0")));c(d).replaceWith(e);b._EPADashboard_.setupevents(e.attr("id"));d=e.get(0)}e=c(d).closest(".epyt-gallery");e.length||(e=c("#"+c(d).data("epytgalleryid")));e.length&&"1"==e.find(".epyt-pagebutton").first().data("autonext")&&a.data===b.YT.PlayerState.ENDED&&(a=e.find(".epyt-current-video"),
6
  a.length||(a=e.find(".epyt-gallery-thumb").first()),a=a.find(" ~ .epyt-gallery-thumb").first(),a.length?a.trigger("click"):e.find('.epyt-pagebutton.epyt-next[data-pagetoken!=""][data-pagetoken]').first().trigger("click"))},isMobile:function(){return/Mobi|Android/i.test(navigator.userAgent)},base64DecodeUnicode:function(a){a=a.replace(/\s/g,"");return decodeURIComponent(Array.prototype.map.call(atob(a),function(d){return"%"+("00"+d.charCodeAt(0).toString(16)).slice(-2)}).join(""))},doLiveFallback:function(a){var d=
7
- c(a).closest(".wp-block-embed");d.length||(d=c(a).closest(".epyt-live-chat-wrapper"));d.length||(d=c(a).closest(".epyt-video-wrapper"));if(d.length&&(a=c("#epyt-live-fallback"),a.length)){var e="";try{e=b._EPADashboard_.base64DecodeUnicode(a.get(0).innerHTML)}catch(f){}if(e){var g=d.parent();b._EPADashboard_.loadYTAPI();d.replaceWith(e);b._EPADashboard_.apiInit();b._EPADashboard_.pageReady();setTimeout(function(){c.fn.fitVidsEP&&c(g).fitVidsEP()},1)}}},videoEqual:function(a,d){return a.getIframe&&
8
  d.getIframe&&a.getIframe().id===d.getIframe().id?!0:!1},pauseOthers:function(a){if(a)for(var d in b._EPYT_.apiVideos){var e=b._EPYT_.apiVideos[d];e&&"function"===typeof e.pauseVideo&&e!=a&&!_EPADashboard_.videoEqual(e,a)&&"function"===typeof e.getPlayerState&&0<=[YT.PlayerState.BUFFERING,b.YT.PlayerState.PLAYING].indexOf(e.getPlayerState())&&e.pauseVideo()}},justid:function(a){return/[\?&]v=([^&#]*)/.exec(a)[1]},setupevents:function(a){if("undefined"!==typeof b.YT&&null!==b.YT&&b.YT.loaded){var d=
9
  document.getElementById(a);if(!d.epytsetupdone)return b._EPADashboard_.log("Setting up YT API events: "+a),d.epytsetupdone=!0,d={events:{onReady:b._EPADashboard_.onPlayerReady,onStateChange:b._EPADashboard_.onPlayerStateChange},host:0<(d.src||"").indexOf("nocookie")?"https://www.youtube-nocookie.com":"https://www.youtube.com"},new b.YT.Player(a,d)}},apiInit:function(){if("undefined"!==typeof b.YT){b._EPADashboard_.initStarted=!0;for(var a=document.querySelectorAll(_EPYT_.evselector),d=0;d<a.length;d++)a[d].hasAttribute("id")||
10
  (a[d].id="_dytid_"+Math.round(8999*Math.random()+1E3)),b._EPADashboard_.setupevents(a[d].id)}},log:function(a){try{console.log(a)}catch(d){}},doubleCheck:function(){b._EPADashboard_.checkInterval=setInterval(function(){b._EPADashboard_.checkCount++;5<=b._EPADashboard_.checkCount||b._EPADashboard_.initStarted?clearInterval(b._EPADashboard_.checkInterval):(b._EPADashboard_.apiInit(),b._EPADashboard_.log("YT API init check"))},1E3)},selectText:function(a){if(document.selection){var d=document.body.createTextRange();
11
  d.moveToElementText(a);d.select()}else if(b.getSelection){var e=b.getSelection();d=document.createRange();d.selectNode(a);e.removeAllRanges();e.addRange(d)}},setVidSrc:function(a,d){a.is(".epyt-facade")?(a.attr("data-facadesrc",b._EPADashboard_.cleanSrc(d)),a.trigger("click")):(a.attr("src",b._EPADashboard_.cleanSrc(d)),a.get(0).epytsetupdone=!1,b._EPADashboard_.setupevents(a.attr("id")))},cleanSrc:function(a){return a.replace("enablejsapi=1?enablejsapi=1","enablejsapi=1")},loadYTAPI:function(){if("undefined"===
12
  typeof b.YT){if("never"!==b._EPYT_.ytapi_load&&("always"===b._EPYT_.ytapi_load||c('iframe[src*="youtube.com/embed/"], iframe[data-src*="youtube.com/embed/"], .__youtube_prefs__').length)){var a=document.createElement("script");a.src="https://www.youtube.com/iframe_api";a.type="text/javascript";document.getElementsByTagName("head")[0].appendChild(a)}}else if(b.YT.loaded)if(b._EPYT_.pageLoaded)b._EPADashboard_.apiInit(),b._EPADashboard_.log("YT API available");else c(b).on("load._EPYT_",function(){b._EPADashboard_.apiInit();
13
- b._EPADashboard_.log("YT API available 2")})},pageReady:function(){b._EPYT_.not_live_on_channel&&"never"!==b._EPYT_.ytapi_load&&c(".epyt-live-channel").each(function(){c(this).data("eypt-fallback")||(c(this).data("eypt-fallback",!0),c(this).css("opacity",0),setTimeout(function(){c(".epyt-live-channel").css("opacity",1)},4E3))});c(".epyt-gallery").each(function(){var a=c(this);if(!a.data("epytevents")||!c("body").hasClass("block-editor-page")){a.data("epytevents","1");var d=c(this).find("iframe, div.__youtube_prefs_gdpr__, div.epyt-facade").first(),
14
- e=d.data("src")||d.data("facadesrc")||d.attr("src");e||=d.data("ep-src");var g=c(this).find(".epyt-gallery-list .epyt-gallery-thumb").first().data("videoid");"undefined"!==typeof e?(e=e.replace(g,"GALLERYVIDEOID"),a.data("ep-gallerysrc",e)):d.hasClass("__youtube_prefs_gdpr__")&&a.data("ep-gallerysrc","");a.on("click touchend",".epyt-gallery-list .epyt-gallery-thumb",function(f){d=a.find("iframe, div.__youtube_prefs_gdpr__, div.epyt-facade").first();if(!b._EPYT_.touchmoved&&!c(this).hasClass("epyt-current-video")){a.find(".epyt-gallery-list .epyt-gallery-thumb").removeClass("epyt-current-video");
15
- c(this).addClass("epyt-current-video");f=c(this).data("videoid");a.data("currvid",f);var h=a.data("ep-gallerysrc").replace("GALLERYVIDEOID",f);f=a.find(".epyt-pagebutton").first().data("thumbplay");"0"!==f&&0!==f&&(h=0<h.indexOf("autoplay")?h.replace("autoplay=0","autoplay=1"):h+"&autoplay=1",d.addClass("epyt-thumbplay"));f=Math.max(c("body").scrollTop(),c("html").scrollTop());var k=d.offset().top-parseInt(_EPYT_.gallery_scrolloffset);f>k?c("html, body").animate({scrollTop:k},500,function(){b._EPADashboard_.setVidSrc(d,
16
- h)}):b._EPADashboard_.setVidSrc(d,h)}}).on("touchmove",function(f){b._EPYT_.touchmoved=!0}).on("touchstart",function(){b._EPYT_.touchmoved=!1}).on("keydown",".epyt-gallery-list .epyt-gallery-thumb, .epyt-pagebutton",function(f){var h=f.which;if(13===h||32===h)f.preventDefault(),c(this).trigger("click")});a.on("mouseenter",".epyt-gallery-list .epyt-gallery-thumb",function(){c(this).addClass("hover")});a.on("mouseleave",".epyt-gallery-list .epyt-gallery-thumb",function(){c(this).removeClass("hover")});
17
- a.on("click touchend",".epyt-pagebutton",function(f){if(!b._EPYT_.touchmoved&&!a.find(".epyt-gallery-list").hasClass("epyt-loading")){a.find(".epyt-gallery-list").addClass("epyt-loading");var h="undefined"!==typeof f.originalEvent;f={action:"my_embedplus_gallery_page",security:_EPYT_.security,options:{playlistId:c(this).data("playlistid"),pageToken:c(this).data("pagetoken"),pageSize:c(this).data("pagesize"),columns:c(this).data("epcolumns"),showTitle:c(this).data("showtitle"),showPaging:c(this).data("showpaging"),
18
- autonext:c(this).data("autonext"),thumbplay:c(this).data("thumbplay")}};var k=c(this).hasClass("epyt-next"),n=parseInt(a.data("currpage")+"");a.data("currpage",n+(k?1:-1));c.post(_EPYT_.ajaxurl,f,function(l){a.find(".epyt-gallery-list").html(l);a.find(".epyt-current").each(function(){c(this).text(a.data("currpage"))});a.find('.epyt-gallery-thumb[data-videoid="'+a.data("currvid")+'"]').addClass("epyt-current-video");"1"!=a.find(".epyt-pagebutton").first().data("autonext")||h||a.find(".epyt-gallery-thumb").first().trigger("click")}).fail(function(){alert("Sorry, there was an error loading the next page.")}).always(function(){a.find(".epyt-gallery-list").removeClass("epyt-loading");
 
19
  if("1"!=a.find(".epyt-pagebutton").first().data("autonext")){var l=Math.max(c("body").scrollTop(),c("html").scrollTop()),m=a.find(".epyt-gallery-list").offset().top-parseInt(_EPYT_.gallery_scrolloffset);l>m&&c("html, body").animate({scrollTop:m},500)}})}}).on("touchmove",function(f){b._EPYT_.touchmoved=!0}).on("touchstart",function(){b._EPYT_.touchmoved=!1})}});c(".__youtube_prefs_gdpr__.epyt-is-override").each(function(){c(this).parent(".wp-block-embed__wrapper").addClass("epyt-is-override__wrapper")});
20
- c("button.__youtube_prefs_gdpr__").on("click",function(a){a.preventDefault();c.cookie&&(c.cookie("ytprefs_gdpr_consent","1",{expires:30,path:"/"}),b.top.location.reload())});c("img.epyt-facade-poster").on("load.epyt",function(){this.epytFacadeCount=this.epytFacadeCount?this.epytFacadeCount+1:1;if(200>this.naturalHeight){var a=c(this).attr("src");a&&c(this).attr("src",a.replace("maxresdefault","hqdefault"))}3<this.epytFacadeCount&&c(this).off("load.epyt")}).on("error",function(){var a=c(this).attr("src");
21
- a&&c(this).attr("src",a.replace("maxresdefault","hqdefault"))}).each(function(){this.complete&&c(this).trigger("load")});c(".epyt-facade-play").each(function(){c(this).find("svg").length||c(this).append('<svg data-no-lazy="1" height="100%" version="1.1" viewBox="0 0 68 48" width="100%"><path class="ytp-large-play-button-bg" d="M66.52,7.74c-0.78-2.93-2.49-5.41-5.42-6.19C55.79,.13,34,0,34,0S12.21,.13,6.9,1.55 C3.97,2.33,2.27,4.81,1.48,7.74C0.06,13.05,0,24,0,24s0.06,10.95,1.48,16.26c0.78,2.93,2.49,5.41,5.42,6.19 C12.21,47.87,34,48,34,48s21.79-0.13,27.1-1.55c2.93-0.78,4.64-3.26,5.42-6.19C67.94,34.95,68,24,68,24S67.94,13.05,66.52,7.74z" fill="#f00"></path><path d="M 45,24 27,14 27,34" fill="#fff"></path></svg>')});
22
- c(".epyt-facade-poster[data-facadeoembed]").each(function(){var a=c(this),d="https://www.youtube.com/"+a.data("facadeoembed");c.get("https://youtube.com/oembed",{url:d,format:"json"},function(e){a.attr("src",e.thumbnail_url.replace("hqdefault","maxresdefault"))},"json").fail(function(){}).always(function(){})});c(document).on("click",".epyt-facade",function(a){a=c(this);var d=a.attr("data-facadesrc");d=b._EPADashboard_.cleanSrc(d);for(var e=document.createElement("iframe"),g=0;g<this.attributes.length;g++){var f=
23
- this.attributes[g];(0<=["allow","class","height","id","width"].indexOf(f.name.toLowerCase())||0==f.name.toLowerCase().indexOf("data-"))&&c(e).attr(f.name,f.value)}c(e).removeClass("epyt-facade");c(e).attr("allowfullscreen","").attr("title",a.find("img").attr("alt")).attr("allow","accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture");b._EPADashboard_.loadYTAPI();a.replaceWith(e);c(e).attr("src",d);b._EPADashboard_.setupevents(c(e).attr("id"));setTimeout(function(){c.fn.fitVidsEP&&
24
- c(c(e).parent()).fitVidsEP()},1)})}});b.onYouTubeIframeAPIReady="undefined"!==typeof b.onYouTubeIframeAPIReady?b.onYouTubeIframeAPIReady:function(){if(b._EPYT_.pageLoaded)b._EPADashboard_.apiInit(),b._EPADashboard_.log("YT API ready");else c(b).on("load._EPYT_",function(){b._EPADashboard_.apiInit();b._EPADashboard_.log("YT API ready 2")})};(!b._EPYT_.facade_mode||b._EPYT_.not_live_on_channel&&c('iframe[src*="youtube.com/embed/live_stream"], iframe[data-src*="youtube.com/embed/live_stream"]').length)&&
25
- b._EPADashboard_.loadYTAPI();if(b._EPYT_.pageLoaded)b._EPADashboard_.doubleCheck();else c(b).on("load._EPYT_",function(){b._EPADashboard_.doubleCheck()});c(document).ready(function(){b._EPADashboard_.pageReady();(!b._EPYT_.facade_mode||b._EPYT_.not_live_on_channel&&c('iframe[src*="youtube.com/embed/live_stream"], iframe[data-src*="youtube.com/embed/live_stream"]').length)&&b._EPADashboard_.loadYTAPI();if(b._EPYT_.ajax_compat)c(b).on("load._EPYT_",function(){c(document).ajaxSuccess(function(a,d,e){d&&
26
- d.responseText&&(-1!==d.responseText.indexOf("<iframe ")||-1!==d.responseText.indexOf("enablejsapi"))&&(b._EPADashboard_.loadYTAPI(),b._EPADashboard_.apiInit(),b._EPADashboard_.log("YT API AJAX"),b._EPADashboard_.pageReady())})})})})(window,jQuery);
4
  f=g.getAttribute("id");b._EPYT_.apiVideos[f]=a.target;b._EPYT_.not_live_on_channel&&0<a.target.getVideoUrl().indexOf("live_stream")&&b._EPADashboard_.doLiveFallback(g)}catch(h){}finally{c(a.target.getIframe()).css("opacity",1)}},onPlayerStateChange:function(a){var d=a.target.getIframe();b._EPYT_.pause_others&&a.data===b.YT.PlayerState.PLAYING&&b._EPADashboard_.pauseOthers(a.target);a.data===b.YT.PlayerState.PLAYING&&!0!==a.target.ponce&&-1===d.src.indexOf("autoplay=1")&&(a.target.ponce=!0);if(a.data===
5
  b.YT.PlayerState.ENDED&&"1"==c(d).data("relstop"))if("function"===typeof a.target.stopVideo)a.target.stopVideo();else{var e=c(d).clone(!0).off();e.attr("src",b._EPADashboard_.cleanSrc(e.attr("src").replace("autoplay=1","autoplay=0")));c(d).replaceWith(e);b._EPADashboard_.setupevents(e.attr("id"));d=e.get(0)}e=c(d).closest(".epyt-gallery");e.length||(e=c("#"+c(d).data("epytgalleryid")));e.length&&"1"==e.find(".epyt-pagebutton").first().data("autonext")&&a.data===b.YT.PlayerState.ENDED&&(a=e.find(".epyt-current-video"),
6
  a.length||(a=e.find(".epyt-gallery-thumb").first()),a=a.find(" ~ .epyt-gallery-thumb").first(),a.length?a.trigger("click"):e.find('.epyt-pagebutton.epyt-next[data-pagetoken!=""][data-pagetoken]').first().trigger("click"))},isMobile:function(){return/Mobi|Android/i.test(navigator.userAgent)},base64DecodeUnicode:function(a){a=a.replace(/\s/g,"");return decodeURIComponent(Array.prototype.map.call(atob(a),function(d){return"%"+("00"+d.charCodeAt(0).toString(16)).slice(-2)}).join(""))},doLiveFallback:function(a){var d=
7
+ c(a).closest(".wp-block-embed");d.length||(d=c(a).closest(".epyt-live-chat-wrapper"));d.length||(d=c(a).closest(".epyt-video-wrapper"));if(d.length&&(a=c("#epyt-live-fallback"),a.length)){var e="";try{e=b._EPADashboard_.base64DecodeUnicode(a.get(0).innerHTML)}catch(f){}if(e){var g=d.parent();b._EPADashboard_.loadYTAPI();d.replaceWith(e);b._EPADashboard_.apiInit();b._EPADashboard_.pageReady();setTimeout(function(){"undefined"!==typeof c.fn.fitVidsEP&&g.fitVidsEP()},1)}}},videoEqual:function(a,d){return a.getIframe&&
8
  d.getIframe&&a.getIframe().id===d.getIframe().id?!0:!1},pauseOthers:function(a){if(a)for(var d in b._EPYT_.apiVideos){var e=b._EPYT_.apiVideos[d];e&&"function"===typeof e.pauseVideo&&e!=a&&!_EPADashboard_.videoEqual(e,a)&&"function"===typeof e.getPlayerState&&0<=[YT.PlayerState.BUFFERING,b.YT.PlayerState.PLAYING].indexOf(e.getPlayerState())&&e.pauseVideo()}},justid:function(a){return/[\?&]v=([^&#]*)/.exec(a)[1]},setupevents:function(a){if("undefined"!==typeof b.YT&&null!==b.YT&&b.YT.loaded){var d=
9
  document.getElementById(a);if(!d.epytsetupdone)return b._EPADashboard_.log("Setting up YT API events: "+a),d.epytsetupdone=!0,d={events:{onReady:b._EPADashboard_.onPlayerReady,onStateChange:b._EPADashboard_.onPlayerStateChange},host:0<(d.src||"").indexOf("nocookie")?"https://www.youtube-nocookie.com":"https://www.youtube.com"},new b.YT.Player(a,d)}},apiInit:function(){if("undefined"!==typeof b.YT){b._EPADashboard_.initStarted=!0;for(var a=document.querySelectorAll(_EPYT_.evselector),d=0;d<a.length;d++)a[d].hasAttribute("id")||
10
  (a[d].id="_dytid_"+Math.round(8999*Math.random()+1E3)),b._EPADashboard_.setupevents(a[d].id)}},log:function(a){try{console.log(a)}catch(d){}},doubleCheck:function(){b._EPADashboard_.checkInterval=setInterval(function(){b._EPADashboard_.checkCount++;5<=b._EPADashboard_.checkCount||b._EPADashboard_.initStarted?clearInterval(b._EPADashboard_.checkInterval):(b._EPADashboard_.apiInit(),b._EPADashboard_.log("YT API init check"))},1E3)},selectText:function(a){if(document.selection){var d=document.body.createTextRange();
11
  d.moveToElementText(a);d.select()}else if(b.getSelection){var e=b.getSelection();d=document.createRange();d.selectNode(a);e.removeAllRanges();e.addRange(d)}},setVidSrc:function(a,d){a.is(".epyt-facade")?(a.attr("data-facadesrc",b._EPADashboard_.cleanSrc(d)),a.trigger("click")):(a.attr("src",b._EPADashboard_.cleanSrc(d)),a.get(0).epytsetupdone=!1,b._EPADashboard_.setupevents(a.attr("id")))},cleanSrc:function(a){return a.replace("enablejsapi=1?enablejsapi=1","enablejsapi=1")},loadYTAPI:function(){if("undefined"===
12
  typeof b.YT){if("never"!==b._EPYT_.ytapi_load&&("always"===b._EPYT_.ytapi_load||c('iframe[src*="youtube.com/embed/"], iframe[data-src*="youtube.com/embed/"], .__youtube_prefs__').length)){var a=document.createElement("script");a.src="https://www.youtube.com/iframe_api";a.type="text/javascript";document.getElementsByTagName("head")[0].appendChild(a)}}else if(b.YT.loaded)if(b._EPYT_.pageLoaded)b._EPADashboard_.apiInit(),b._EPADashboard_.log("YT API available");else c(b).on("load._EPYT_",function(){b._EPADashboard_.apiInit();
13
+ b._EPADashboard_.log("YT API available 2")})},resolveFacadeQuality:function(a,d){a.epytFacadeCount="undefined"===typeof a.epytFacadeCount?0:a.epytFacadeCount+1;if(d||200>a.naturalHeight)if(d=c(a).attr("src"))c(a).attr("src",d.replace("maxresdefault","hqdefault")),c(a).off("load.epyt");2<a.epytFacadeCount&&c(a).off("load.epyt")},pageReady:function(){b._EPYT_.not_live_on_channel&&"never"!==b._EPYT_.ytapi_load&&c(".epyt-live-channel").each(function(){var a=c(this);a.data("eypt-fallback")||(a.data("eypt-fallback",
14
+ !0),a.css("opacity",0),setTimeout(function(){a.css("opacity",1)},4E3))});c(".epyt-gallery").each(function(){var a=c(this);if(!a.data("epytevents")||!c("body").hasClass("block-editor-page")){a.data("epytevents","1");var d=c(this).find("iframe, div.__youtube_prefs_gdpr__, div.epyt-facade").first(),e=d.data("src")||d.data("facadesrc")||d.attr("src");e||=d.data("ep-src");var g=c(this).find(".epyt-gallery-list .epyt-gallery-thumb").first().data("videoid");"undefined"!==typeof e?(e=e.replace(g,"GALLERYVIDEOID"),
15
+ a.data("ep-gallerysrc",e)):d.hasClass("__youtube_prefs_gdpr__")&&a.data("ep-gallerysrc","");a.on("click touchend",".epyt-gallery-list .epyt-gallery-thumb",function(f){d=a.find("iframe, div.__youtube_prefs_gdpr__, div.epyt-facade").first();if(!b._EPYT_.touchmoved&&!c(this).hasClass("epyt-current-video")){a.find(".epyt-gallery-list .epyt-gallery-thumb").removeClass("epyt-current-video");c(this).addClass("epyt-current-video");f=c(this).data("videoid");a.data("currvid",f);var h=a.data("ep-gallerysrc").replace("GALLERYVIDEOID",
16
+ f);f=a.find(".epyt-pagebutton").first().data("thumbplay");"0"!==f&&0!==f&&(h=0<h.indexOf("autoplay")?h.replace("autoplay=0","autoplay=1"):h+"&autoplay=1",d.addClass("epyt-thumbplay"));f=Math.max(c("body").scrollTop(),c("html").scrollTop());var k=d.offset().top-parseInt(_EPYT_.gallery_scrolloffset);f>k?c("html, body").animate({scrollTop:k},500,function(){b._EPADashboard_.setVidSrc(d,h)}):b._EPADashboard_.setVidSrc(d,h)}}).on("touchmove",function(f){b._EPYT_.touchmoved=!0}).on("touchstart",function(){b._EPYT_.touchmoved=
17
+ !1}).on("keydown",".epyt-gallery-list .epyt-gallery-thumb, .epyt-pagebutton",function(f){var h=f.which;if(13===h||32===h)f.preventDefault(),c(this).trigger("click")});a.on("mouseenter",".epyt-gallery-list .epyt-gallery-thumb",function(){c(this).addClass("hover")});a.on("mouseleave",".epyt-gallery-list .epyt-gallery-thumb",function(){c(this).removeClass("hover")});a.on("click touchend",".epyt-pagebutton",function(f){if(!b._EPYT_.touchmoved&&!a.find(".epyt-gallery-list").hasClass("epyt-loading")){a.find(".epyt-gallery-list").addClass("epyt-loading");
18
+ var h="undefined"!==typeof f.originalEvent;f={action:"my_embedplus_gallery_page",security:_EPYT_.security,options:{playlistId:c(this).data("playlistid"),pageToken:c(this).data("pagetoken"),pageSize:c(this).data("pagesize"),columns:c(this).data("epcolumns"),showTitle:c(this).data("showtitle"),showPaging:c(this).data("showpaging"),autonext:c(this).data("autonext"),thumbplay:c(this).data("thumbplay")}};var k=c(this).hasClass("epyt-next"),n=parseInt(a.data("currpage")+"");a.data("currpage",n+(k?1:-1));
19
+ c.post(_EPYT_.ajaxurl,f,function(l){a.find(".epyt-gallery-list").html(l);a.find(".epyt-current").each(function(){c(this).text(a.data("currpage"))});a.find('.epyt-gallery-thumb[data-videoid="'+a.data("currvid")+'"]').addClass("epyt-current-video");"1"!=a.find(".epyt-pagebutton").first().data("autonext")||h||a.find(".epyt-gallery-thumb").first().trigger("click")}).fail(function(){alert("Sorry, there was an error loading the next page.")}).always(function(){a.find(".epyt-gallery-list").removeClass("epyt-loading");
20
  if("1"!=a.find(".epyt-pagebutton").first().data("autonext")){var l=Math.max(c("body").scrollTop(),c("html").scrollTop()),m=a.find(".epyt-gallery-list").offset().top-parseInt(_EPYT_.gallery_scrolloffset);l>m&&c("html, body").animate({scrollTop:m},500)}})}}).on("touchmove",function(f){b._EPYT_.touchmoved=!0}).on("touchstart",function(){b._EPYT_.touchmoved=!1})}});c(".__youtube_prefs_gdpr__.epyt-is-override").each(function(){c(this).parent(".wp-block-embed__wrapper").addClass("epyt-is-override__wrapper")});
21
+ c("button.__youtube_prefs_gdpr__").on("click",function(a){a.preventDefault();c.cookie&&(c.cookie("ytprefs_gdpr_consent","1",{expires:30,path:"/"}),b.top.location.reload())});c("img.epyt-facade-poster").on("load.epyt",function(){b._EPADashboard_.resolveFacadeQuality(this,!1)}).on("error",function(){b._EPADashboard_.resolveFacadeQuality(this,!0)}).each(function(){this.complete&&c(this).trigger("load")});c(".epyt-facade-play").each(function(){c(this).find("svg").length||c(this).append('<svg data-no-lazy="1" height="100%" version="1.1" viewBox="0 0 68 48" width="100%"><path class="ytp-large-play-button-bg" d="M66.52,7.74c-0.78-2.93-2.49-5.41-5.42-6.19C55.79,.13,34,0,34,0S12.21,.13,6.9,1.55 C3.97,2.33,2.27,4.81,1.48,7.74C0.06,13.05,0,24,0,24s0.06,10.95,1.48,16.26c0.78,2.93,2.49,5.41,5.42,6.19 C12.21,47.87,34,48,34,48s21.79-0.13,27.1-1.55c2.93-0.78,4.64-3.26,5.42-6.19C67.94,34.95,68,24,68,24S67.94,13.05,66.52,7.74z" fill="#f00"></path><path d="M 45,24 27,14 27,34" fill="#fff"></path></svg>')});
22
+ c(".epyt-facade-poster[data-facadeoembed]").each(function(){var a=c(this);if(!a.data("facadeoembedcomplete")){a.data("facadeoembedcomplete","1");var d="https://www.youtube.com/"+a.data("facadeoembed");c.get("https://youtube.com/oembed",{url:d,format:"json"},function(e){a.attr("src",e.thumbnail_url.replace("hqdefault","maxresdefault"))},"json").fail(function(){}).always(function(){})}});c(document).on("click",".epyt-facade",function(a){a=c(this);var d=a.attr("data-facadesrc");d=b._EPADashboard_.cleanSrc(d);
23
+ for(var e=document.createElement("iframe"),g=0;g<this.attributes.length;g++){var f=this.attributes[g];(0<=["allow","class","height","id","width"].indexOf(f.name.toLowerCase())||0==f.name.toLowerCase().indexOf("data-"))&&c(e).attr(f.name,f.value)}c(e).removeClass("epyt-facade");c(e).attr("allowfullscreen","").attr("title",a.find("img").attr("alt")).attr("allow","accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture");b._EPADashboard_.loadYTAPI();a.replaceWith(e);
24
+ c(e).attr("src",d);b._EPADashboard_.setupevents(c(e).attr("id"));setTimeout(function(){"undefined"!==typeof c.fn.fitVidsEP&&c(c(e).parent()).fitVidsEP()},1)})}});b.onYouTubeIframeAPIReady="undefined"!==typeof b.onYouTubeIframeAPIReady?b.onYouTubeIframeAPIReady:function(){if(b._EPYT_.pageLoaded)b._EPADashboard_.apiInit(),b._EPADashboard_.log("YT API ready");else c(b).on("load._EPYT_",function(){b._EPADashboard_.apiInit();b._EPADashboard_.log("YT API ready 2")})};(!b._EPYT_.facade_mode||b._EPYT_.not_live_on_channel&&
25
+ c('iframe[src*="youtube.com/embed/live_stream"], iframe[data-src*="youtube.com/embed/live_stream"]').length)&&b._EPADashboard_.loadYTAPI();if(b._EPYT_.pageLoaded)b._EPADashboard_.doubleCheck();else c(b).on("load._EPYT_",function(){b._EPADashboard_.doubleCheck()});c(document).ready(function(){b._EPADashboard_.pageReady();(!b._EPYT_.facade_mode||b._EPYT_.not_live_on_channel&&c('iframe[src*="youtube.com/embed/live_stream"], iframe[data-src*="youtube.com/embed/live_stream"]').length)&&b._EPADashboard_.loadYTAPI();
26
+ if(b._EPYT_.ajax_compat)c(b).on("load._EPYT_",function(){c(document).ajaxSuccess(function(a,d,e){d&&d.responseText&&(-1!==d.responseText.indexOf("<iframe ")||-1!==d.responseText.indexOf("enablejsapi"))&&(b._EPADashboard_.loadYTAPI(),b._EPADashboard_.apiInit(),b._EPADashboard_.log("YT API AJAX"),b._EPADashboard_.pageReady())})})})})(window,jQuery);
 
youtube.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Embed Plus Plugin for YouTube
4
  Plugin URI: https://www.embedplus.com/dashboard/pro-easy-video-analytics.aspx?ref=plugin
5
  Description: YouTube Embed Plugin. Embed a YouTube channel gallery, playlist gallery, YouTube live stream. Lite embeds with defer JavaScript and facade options
6
- Version: 14.1.3
7
  Author: Embed Plus for YouTube Team
8
  Author URI: https://www.embedplus.com
9
  Requires at least: 4.5
@@ -35,7 +35,7 @@ class YouTubePrefs
35
 
36
  public static $folder_name = 'youtube-embed-plus';
37
  public static $curltimeout = 30;
38
- public static $version = '14.1.3';
39
  public static $opt_version = 'version';
40
  public static $optembedwidth = null;
41
  public static $optembedheight = null;
@@ -2880,7 +2880,7 @@ class YouTubePrefs
2880
  $code_iframe1 = '<div ' . $centercode . ' id="_ytid_' . $iframe_id . '" ' . $dim_attrs . ' data-origwidth="' . self::$defaultwidth . '" data-origheight="' . self::$defaultheight . '" ' . $relstop .
2881
  'data-facadesrc="https://www.' . $youtubebaseurl . '.com/embed/' . $videoidoutput . '?';
2882
  $code_iframe2 = '" class="__youtube_prefs__ epyt-facade' . (!empty($finalparams['live_stream']) ? ' epyt-live-channel ' : '') . ($iscontent ? '' : ' __youtube_prefs_widget__ ') . ($isoverride ? ' epyt-is-override ' : '') . ' no-lazyload"' .
2883
- $voloutput . $galleryid_ifm_data . $facade_autoplay . '><img class="epyt-facade-poster skip-lazy" loading="lazy" ' . $acctitle . $facade_img_src . ' />' .
2884
  '<button class="epyt-facade-play" aria-label="Play"><svg data-no-lazy="1" height="100%" version="1.1" viewBox="0 0 68 48" width="100%"><path class="ytp-large-play-button-bg" d="M66.52,7.74c-0.78-2.93-2.49-5.41-5.42-6.19C55.79,.13,34,0,34,0S12.21,.13,6.9,1.55 C3.97,2.33,2.27,4.81,1.48,7.74C0.06,13.05,0,24,0,24s0.06,10.95,1.48,16.26c0.78,2.93,2.49,5.41,5.42,6.19 C12.21,47.87,34,48,34,48s21.79-0.13,27.1-1.55c2.93-0.78,4.64-3.26,5.42-6.19C67.94,34.95,68,24,68,24S67.94,13.05,66.52,7.74z" fill="#f00"></path><path d="M 45,24 27,14 27,34" fill="#fff"></path></svg></button>' .
2885
  '</div>';
2886
  }
@@ -3263,7 +3263,7 @@ class YouTubePrefs
3263
  $new_pointer_content = '<h3>' . __('New Update') . '</h3>'; // ooopointer
3264
 
3265
  $new_pointer_content .= '<p>'; // ooopointer
3266
- $new_pointer_content .= "This update provides better compatibility with Jetpack, and further avoids unused javascript for facade mode in free and <a target=_blank href=" . self::$epbase . '/dashboard/pro-easy-video-analytics.aspx?ref=frompointer' . ">Pro versions</a>.";
3267
  if (self::vi_logged_in())
3268
  {
3269
  $new_pointer_content .= "<br><br><strong>Note:</strong> You are currently logged into the vi intelligence feature. vi support is being deprecated in the next version, so we recommend taking the vi ads down from your site. Please contact ext@embedplus.com for questions.";
3
  Plugin Name: Embed Plus Plugin for YouTube
4
  Plugin URI: https://www.embedplus.com/dashboard/pro-easy-video-analytics.aspx?ref=plugin
5
  Description: YouTube Embed Plugin. Embed a YouTube channel gallery, playlist gallery, YouTube live stream. Lite embeds with defer JavaScript and facade options
6
+ Version: 14.1.4
7
  Author: Embed Plus for YouTube Team
8
  Author URI: https://www.embedplus.com
9
  Requires at least: 4.5
35
 
36
  public static $folder_name = 'youtube-embed-plus';
37
  public static $curltimeout = 30;
38
+ public static $version = '14.1.4';
39
  public static $opt_version = 'version';
40
  public static $optembedwidth = null;
41
  public static $optembedheight = null;
2880
  $code_iframe1 = '<div ' . $centercode . ' id="_ytid_' . $iframe_id . '" ' . $dim_attrs . ' data-origwidth="' . self::$defaultwidth . '" data-origheight="' . self::$defaultheight . '" ' . $relstop .
2881
  'data-facadesrc="https://www.' . $youtubebaseurl . '.com/embed/' . $videoidoutput . '?';
2882
  $code_iframe2 = '" class="__youtube_prefs__ epyt-facade' . (!empty($finalparams['live_stream']) ? ' epyt-live-channel ' : '') . ($iscontent ? '' : ' __youtube_prefs_widget__ ') . ($isoverride ? ' epyt-is-override ' : '') . ' no-lazyload"' .
2883
+ $voloutput . $galleryid_ifm_data . $facade_autoplay . '><img data-spai-excluded="true" class="epyt-facade-poster skip-lazy" loading="lazy" ' . $acctitle . $facade_img_src . ' />' .
2884
  '<button class="epyt-facade-play" aria-label="Play"><svg data-no-lazy="1" height="100%" version="1.1" viewBox="0 0 68 48" width="100%"><path class="ytp-large-play-button-bg" d="M66.52,7.74c-0.78-2.93-2.49-5.41-5.42-6.19C55.79,.13,34,0,34,0S12.21,.13,6.9,1.55 C3.97,2.33,2.27,4.81,1.48,7.74C0.06,13.05,0,24,0,24s0.06,10.95,1.48,16.26c0.78,2.93,2.49,5.41,5.42,6.19 C12.21,47.87,34,48,34,48s21.79-0.13,27.1-1.55c2.93-0.78,4.64-3.26,5.42-6.19C67.94,34.95,68,24,68,24S67.94,13.05,66.52,7.74z" fill="#f00"></path><path d="M 45,24 27,14 27,34" fill="#fff"></path></svg></button>' .
2885
  '</div>';
2886
  }
3263
  $new_pointer_content = '<h3>' . __('New Update') . '</h3>'; // ooopointer
3264
 
3265
  $new_pointer_content .= '<p>'; // ooopointer
3266
+ $new_pointer_content .= "This version adds higher quality facade images, better compatibility with Jetpack and Short Pixel lazy loaded images, and fixes an issue with the Classic/TinyMCE editor in both free and <a target=_blank href=" . self::$epbase . '/dashboard/pro-easy-video-analytics.aspx?ref=frompointer' . ">Pro versions</a>.";
3267
  if (self::vi_logged_in())
3268
  {
3269
  $new_pointer_content .= "<br><br><strong>Note:</strong> You are currently logged into the vi intelligence feature. vi support is being deprecated in the next version, so we recommend taking the vi ads down from your site. Please contact ext@embedplus.com for questions.";