YouTube - Version 13.2.1

Version Description

Download this release

Release Info

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

Code changes from version 13.2.0.2 to 13.2.1

readme.txt CHANGED
@@ -4,7 +4,7 @@ Plugin Name: Embed Plus for YouTube - Gallery, Channel, Playlist, Live Stream
4
  Tags: youtube gallery, video gallery, youtube channel, youtube live, live stream
5
  Requires at least: 4.0
6
  Tested up to: 5.3
7
- Stable tag: 13.2.0.2
8
  License: GPLv3 or later
9
 
10
  YouTube Embed WordPress Plugin. Embed a responsive video, YouTube channel gallery, playlist gallery, or YouTube.com live stream (with GDPR options)
@@ -13,7 +13,7 @@ YouTube Embed WordPress Plugin. Embed a responsive video, YouTube channel galler
13
 
14
  **Your WordPress YouTube embed, YouTube gallery (channel and playlist), and even YouTube live stream can be customized in a wide variety of ways with this plugin. Here are a few recently added features:**
15
 
16
- * Compatible with the WordPress 5.0+ Gutenberg block editor (it also stays backwards-compatible with the classic editor). Both the Gutenberg block selector and the Gutenberg classic block will show the YouTube wizard button. For the Gutenberg block selector, click on the (+) sign for the block editor list. The YouTube Wizard block is located under the "Embeds" category (make sure you choose "YouTube **Wizard**"). See more on [how to embed a YouTube video, gallery, or livestream with the WordPress Gutenberg block editor here >>](https://www.embedplus.com/embed-youtube-video-gallery-livestream-wordpress-gutenberg-block-editor.aspx)
17
  * Privacy and Consent - Improved privacy and GDPR compliance options like YouTube no cookie, YouTube API restrictions, and a customizable GDPR consent message
18
  * YouTube gallery capability (channel and playlist) – The ability to make playlist and channel embeds have a gallery layout. By default, the plugin can generate a grid-based [responsive playlist or channel gallery >>](https://www.embedplus.com/responsive-youtube-playlist-channel-gallery-for-wordpress.aspx). Your visitors can browse through pages of video thumbnails and choose from videos that are pulled from an entire YouTube channel or playlist.
19
  * YouTube gallery auto continuous play - embed a playlist or channel gallery and allow it to play one video after the next without requiring viewers to click a thumbnail
@@ -147,6 +147,9 @@ You can also start and end each individual video at particular times. Like the a
147
 
148
  == Changelog ==
149
 
 
 
 
150
  = Embed Plus for YouTube WordPress Plugin 13.2.0.2 =
151
  * Fixes the "Hide related videos at the end of playback" feature (fixes issue with galleries)
152
 
4
  Tags: youtube gallery, video gallery, youtube channel, youtube live, live stream
5
  Requires at least: 4.0
6
  Tested up to: 5.3
7
+ Stable tag: 13.2.1
8
  License: GPLv3 or later
9
 
10
  YouTube Embed WordPress Plugin. Embed a responsive video, YouTube channel gallery, playlist gallery, or YouTube.com live stream (with GDPR options)
13
 
14
  **Your WordPress YouTube embed, YouTube gallery (channel and playlist), and even YouTube live stream can be customized in a wide variety of ways with this plugin. Here are a few recently added features:**
15
 
16
+ * Compatible with the WordPress Gutenberg block editor (it also stays backwards-compatible with the classic editor). Both the Gutenberg block selector and the Gutenberg classic block will show the YouTube wizard button. For the Gutenberg block selector, click on the (+) sign for the block editor list. The YouTube Wizard block is located under the "Embeds" category (make sure you choose "YouTube **Wizard**"). See more on [how to embed a YouTube video, gallery, or livestream with the WordPress Gutenberg block editor here >>](https://www.embedplus.com/embed-youtube-video-gallery-livestream-wordpress-gutenberg-block-editor.aspx)
17
  * Privacy and Consent - Improved privacy and GDPR compliance options like YouTube no cookie, YouTube API restrictions, and a customizable GDPR consent message
18
  * YouTube gallery capability (channel and playlist) – The ability to make playlist and channel embeds have a gallery layout. By default, the plugin can generate a grid-based [responsive playlist or channel gallery >>](https://www.embedplus.com/responsive-youtube-playlist-channel-gallery-for-wordpress.aspx). Your visitors can browse through pages of video thumbnails and choose from videos that are pulled from an entire YouTube channel or playlist.
19
  * YouTube gallery auto continuous play - embed a playlist or channel gallery and allow it to play one video after the next without requiring viewers to click a thumbnail
147
 
148
  == Changelog ==
149
 
150
+ = Embed Plus for YouTube WordPress Plugin 13.2.1 =
151
+ * Provides more compatibility with other lazyload plugins and responsive themes
152
+
153
  = Embed Plus for YouTube WordPress Plugin 13.2.0.2 =
154
  * Fixes the "Hide related videos at the end of playback" feature (fixes issue with galleries)
155
 
scripts/fitvids.js CHANGED
@@ -1,7 +1,8 @@
1
  var epdofitvids = epdofitvids || function ($)
2
  {
3
 
4
- $.fn.fitVidsEP = function (options) {
 
5
  if (_EPYT_.epresponsiveselector.constructor !== Array)
6
  {
7
  _EPYT_.epresponsiveselector = JSON.parse(_EPYT_.epresponsiveselector);
@@ -10,7 +11,8 @@ var epdofitvids = epdofitvids || function ($)
10
  customSelector: null
11
  };
12
 
13
- if (!document.getElementById('fit-vids-style')) {
 
14
 
15
  var div = document.createElement('div'),
16
  ref = document.getElementsByTagName('base')[0] || document.getElementsByTagName('script')[0],
@@ -25,27 +27,35 @@ var epdofitvids = epdofitvids || function ($)
25
 
26
  }
27
 
28
- if (options) {
 
29
  $.extend(settings, options);
30
  }
31
 
32
- return this.each(function () {
 
33
  // var selectors = [
34
  // "iframe[src*='youtube.com']",
35
  // "iframe[src*='youtube-nocookie.com']"
36
  // ];
37
  var selectors = _EPYT_.epresponsiveselector;
38
 
39
- if (settings.customSelector) {
 
40
  selectors.push(settings.customSelector);
41
  }
42
 
43
  var $allVideos = $(this).find(selectors.join(','));
44
  $allVideos = $allVideos.not("object object"); // SwfObj conflict patch
45
 
46
- $allVideos.each(function () {
 
47
  var $this = $(this);
48
- if (this.tagName.toLowerCase() === 'embed' && $this.parent('object').length || $this.parent('.fluid-width-video-wrapper').length) {
 
 
 
 
49
  return;
50
  }
51
  if ($this.is('[data-origwidth]:not([width])'))
@@ -55,30 +65,50 @@ var epdofitvids = epdofitvids || function ($)
55
  if ($this.is('[data-origheight]:not([height])'))
56
  {
57
  $this.attr('height', $this.data('origheight'));
58
- }
59
  var height = (this.tagName.toLowerCase() === 'object' || ($this.attr('height') && !isNaN(parseInt($this.attr('height'), 10)))) ? parseInt($this.attr('height'), 10) : $this.height(),
60
  width = !isNaN(parseInt($this.attr('width'), 10)) ? parseInt($this.attr('width'), 10) : $this.width(),
61
  aspectRatio = height / width;
62
- if (!$this.attr('id')) {
 
63
  var videoID = 'fitvid' + Math.floor(Math.random() * 999999);
64
  $this.attr('id', videoID);
65
  }
66
- var fwvwrap = document.createElement('div');
67
- fwvwrap.className = 'fluid-width-video-wrapper';
68
- try {
69
- $this.wrap(fwvwrap).parent('.fluid-width-video-wrapper').attr('style', 'padding-top: ' + (aspectRatio * 100) + "% !important;");
70
- $this.removeAttr('height').removeAttr('width');
 
 
 
 
 
 
71
  }
72
- catch (wraperr) {
 
 
 
 
 
 
 
 
 
 
 
73
  }
74
  });
75
  });
76
  };
77
 
78
- $(document).ready(function () {
 
79
  $("body").fitVidsEP();
80
 
81
- $(document).ajaxSuccess(function (e, xhr, settings) {
 
82
  if (xhr && xhr.responseText && xhr.responseText.indexOf('<iframe ') !== -1)
83
  {
84
  $("body").fitVidsEP();
@@ -88,9 +118,12 @@ var epdofitvids = epdofitvids || function ($)
88
  return true;
89
  };
90
 
91
- try {
 
92
  epdofitvids(window.jQuery);
93
- } catch (err) {
 
 
94
  }
95
 
96
 
1
  var epdofitvids = epdofitvids || function ($)
2
  {
3
 
4
+ $.fn.fitVidsEP = function (options)
5
+ {
6
  if (_EPYT_.epresponsiveselector.constructor !== Array)
7
  {
8
  _EPYT_.epresponsiveselector = JSON.parse(_EPYT_.epresponsiveselector);
11
  customSelector: null
12
  };
13
 
14
+ if (!document.getElementById('fit-vids-style'))
15
+ {
16
 
17
  var div = document.createElement('div'),
18
  ref = document.getElementsByTagName('base')[0] || document.getElementsByTagName('script')[0],
27
 
28
  }
29
 
30
+ if (options)
31
+ {
32
  $.extend(settings, options);
33
  }
34
 
35
+ return this.each(function ()
36
+ {
37
  // var selectors = [
38
  // "iframe[src*='youtube.com']",
39
  // "iframe[src*='youtube-nocookie.com']"
40
  // ];
41
  var selectors = _EPYT_.epresponsiveselector;
42
 
43
+ if (settings.customSelector)
44
+ {
45
  selectors.push(settings.customSelector);
46
  }
47
 
48
  var $allVideos = $(this).find(selectors.join(','));
49
  $allVideos = $allVideos.not("object object"); // SwfObj conflict patch
50
 
51
+ $allVideos.each(function ()
52
+ {
53
  var $this = $(this);
54
+ if (this.tagName.toLowerCase() === 'embed' && $this.parent('object').length
55
+ || $this.parent('.fluid-width-video-wrapper').length
56
+ || $this.css('position') === 'absolute'
57
+ )
58
+ {
59
  return;
60
  }
61
  if ($this.is('[data-origwidth]:not([width])'))
65
  if ($this.is('[data-origheight]:not([height])'))
66
  {
67
  $this.attr('height', $this.data('origheight'));
68
+ }
69
  var height = (this.tagName.toLowerCase() === 'object' || ($this.attr('height') && !isNaN(parseInt($this.attr('height'), 10)))) ? parseInt($this.attr('height'), 10) : $this.height(),
70
  width = !isNaN(parseInt($this.attr('width'), 10)) ? parseInt($this.attr('width'), 10) : $this.width(),
71
  aspectRatio = height / width;
72
+ if (!$this.attr('id'))
73
+ {
74
  var videoID = 'fitvid' + Math.floor(Math.random() * 999999);
75
  $this.attr('id', videoID);
76
  }
77
+
78
+ if ($this.parent().hasClass('epyt-video-wrapper'))
79
+ {
80
+ try
81
+ {
82
+ $this.parent().addClass('fluid-width-video-wrapper').attr('style', 'padding-top: ' + (aspectRatio * 100) + "% !important;");
83
+ $this.removeAttr('height').removeAttr('width');
84
+ }
85
+ catch (wraperr)
86
+ {
87
+ }
88
  }
89
+ else
90
+ {
91
+ var fwvwrap = document.createElement('div');
92
+ fwvwrap.className = 'fluid-width-video-wrapper';
93
+ try
94
+ {
95
+ $this.wrap(fwvwrap).parent('.fluid-width-video-wrapper').attr('style', 'padding-top: ' + (aspectRatio * 100) + "% !important;");
96
+ $this.removeAttr('height').removeAttr('width');
97
+ }
98
+ catch (wraperr)
99
+ {
100
+ }
101
  }
102
  });
103
  });
104
  };
105
 
106
+ $(document).ready(function ()
107
+ {
108
  $("body").fitVidsEP();
109
 
110
+ $(document).ajaxSuccess(function (e, xhr, settings)
111
+ {
112
  if (xhr && xhr.responseText && xhr.responseText.indexOf('<iframe ') !== -1)
113
  {
114
  $("body").fitVidsEP();
118
  return true;
119
  };
120
 
121
+ try
122
+ {
123
  epdofitvids(window.jQuery);
124
+ }
125
+ catch (err)
126
+ {
127
  }
128
 
129
 
scripts/fitvids.min.js CHANGED
@@ -1,2 +1,2 @@
1
 
2
- var epdofitvids=epdofitvids||function(a){a.fn.fitVidsEP=function(b){if(_EPYT_.epresponsiveselector.constructor!==Array){_EPYT_.epresponsiveselector=JSON.parse(_EPYT_.epresponsiveselector)}var c={customSelector:null};if(!document.getElementById("fit-vids-style")){var f=document.createElement("div"),d=document.getElementsByTagName("base")[0]||document.getElementsByTagName("script")[0],e="&shy;<style>.fluid-width-video-wrapper{width:100%;position:relative;padding:0;}.fluid-width-video-wrapper iframe,.fluid-width-video-wrapper object,.fluid-width-video-wrapper embed {position:absolute;top:0;left:0;width:100%;height:100%;}</style>";f.className="fit-vids-style";f.id="fit-vids-style";f.style.display="none";f.innerHTML=e;d.parentNode.insertBefore(f,d)}if(b){a.extend(c,b)}return this.each(function(){var g=_EPYT_.epresponsiveselector;if(c.customSelector){g.push(c.customSelector)}var h=a(this).find(g.join(","));h=h.not("object object");h.each(function(){var o=a(this);if(this.tagName.toLowerCase()==="embed"&&o.parent("object").length||o.parent(".fluid-width-video-wrapper").length){return}if(o.is("[data-origwidth]:not([width])")){o.attr("width",o.data("origwidth"))}if(o.is("[data-origheight]:not([height])")){o.attr("height",o.data("origheight"))}var i=(this.tagName.toLowerCase()==="object"||(o.attr("height")&&!isNaN(parseInt(o.attr("height"),10))))?parseInt(o.attr("height"),10):o.height(),l=!isNaN(parseInt(o.attr("width"),10))?parseInt(o.attr("width"),10):o.width(),m=i/l;if(!o.attr("id")){var n="fitvid"+Math.floor(Math.random()*999999);o.attr("id",n)}var k=document.createElement("div");k.className="fluid-width-video-wrapper";try{o.wrap(k).parent(".fluid-width-video-wrapper").attr("style","padding-top: "+(m*100)+"% !important;");o.removeAttr("height").removeAttr("width")}catch(j){}})})};a(document).ready(function(){a("body").fitVidsEP();a(document).ajaxSuccess(function(c,d,b){if(d&&d.responseText&&d.responseText.indexOf("<iframe ")!==-1){a("body").fitVidsEP()}})});return true};try{epdofitvids(window.jQuery)}catch(err){};
1
 
2
+ var epdofitvids=epdofitvids||function(a){a.fn.fitVidsEP=function(b){if(_EPYT_.epresponsiveselector.constructor!==Array){_EPYT_.epresponsiveselector=JSON.parse(_EPYT_.epresponsiveselector)}var c={customSelector:null};if(!document.getElementById("fit-vids-style")){var f=document.createElement("div"),d=document.getElementsByTagName("base")[0]||document.getElementsByTagName("script")[0],e="&shy;<style>.fluid-width-video-wrapper{width:100%;position:relative;padding:0;}.fluid-width-video-wrapper iframe,.fluid-width-video-wrapper object,.fluid-width-video-wrapper embed {position:absolute;top:0;left:0;width:100%;height:100%;}</style>";f.className="fit-vids-style";f.id="fit-vids-style";f.style.display="none";f.innerHTML=e;d.parentNode.insertBefore(f,d)}if(b){a.extend(c,b)}return this.each(function(){var g=_EPYT_.epresponsiveselector;if(c.customSelector){g.push(c.customSelector)}var h=a(this).find(g.join(","));h=h.not("object object");h.each(function(){var o=a(this);if(this.tagName.toLowerCase()==="embed"&&o.parent("object").length||o.parent(".fluid-width-video-wrapper").length||o.css("position")==="absolute"){return}if(o.is("[data-origwidth]:not([width])")){o.attr("width",o.data("origwidth"))}if(o.is("[data-origheight]:not([height])")){o.attr("height",o.data("origheight"))}var i=(this.tagName.toLowerCase()==="object"||(o.attr("height")&&!isNaN(parseInt(o.attr("height"),10))))?parseInt(o.attr("height"),10):o.height(),l=!isNaN(parseInt(o.attr("width"),10))?parseInt(o.attr("width"),10):o.width(),m=i/l;if(!o.attr("id")){var n="fitvid"+Math.floor(Math.random()*999999);o.attr("id",n)}if(o.parent().hasClass("epyt-video-wrapper")){try{o.parent().addClass("fluid-width-video-wrapper").attr("style","padding-top: "+(m*100)+"% !important;");o.removeAttr("height").removeAttr("width")}catch(j){}}else{var k=document.createElement("div");k.className="fluid-width-video-wrapper";try{o.wrap(k).parent(".fluid-width-video-wrapper").attr("style","padding-top: "+(m*100)+"% !important;");o.removeAttr("height").removeAttr("width")}catch(j){}}})})};a(document).ready(function(){a("body").fitVidsEP();a(document).ajaxSuccess(function(c,d,b){if(d&&d.responseText&&d.responseText.indexOf("<iframe ")!==-1){a("body").fitVidsEP()}})});return true};try{epdofitvids(window.jQuery)}catch(err){};
scripts/ytprefs.js CHANGED
@@ -174,6 +174,11 @@
174
  {
175
  __allytifr[i].id = "_dytid_" + Math.round(Math.random() * 8999 + 1000);
176
  }
 
 
 
 
 
177
  window._EPADashboard_.setupevents(__allytifr[i].id);
178
  }
179
  }
@@ -232,7 +237,7 @@
232
  {
233
  if (typeof window.YT === 'undefined')
234
  {
235
- if (window._EPYT_.ytapi_load !== 'never' && (window._EPYT_.ytapi_load === 'always' || $('iframe[src*="youtube.com/embed/"]').length))
236
  {
237
  var iapi = document.createElement('script');
238
  iapi.src = "https://www.youtube.com/iframe_api";
174
  {
175
  __allytifr[i].id = "_dytid_" + Math.round(Math.random() * 8999 + 1000);
176
  }
177
+ // $(__allytifr[i]).on('lazyloaded', function(){
178
+ // window._EPADashboard_.log('lazyloaded: ' + this.src + '\n' + $(this).attr('src') + '\n' + $(this).attr('data-src'));
179
+ // this.src = $(this).data('src');
180
+ // window._EPADashboard_.setVidSrc($(this), $(this).data('src'));
181
+ // });
182
  window._EPADashboard_.setupevents(__allytifr[i].id);
183
  }
184
  }
237
  {
238
  if (typeof window.YT === 'undefined')
239
  {
240
+ if (window._EPYT_.ytapi_load !== 'never' && (window._EPYT_.ytapi_load === 'always' || $('iframe[src*="youtube.com/embed/"], iframe[data-src*="youtube.com/embed/"]').length))
241
  {
242
  var iapi = document.createElement('script');
243
  iapi.src = "https://www.youtube.com/iframe_api";
scripts/ytprefs.min.js CHANGED
@@ -1,2 +1,2 @@
1
 
2
- (function(a,b){a._EPYT_=a._EPYT_||{ajaxurl:"/wp-admin/admin-ajax.php",security:"",gallery_scrolloffset:100,eppathtoscripts:"/wp-content/plugins/youtube-embed-plus/scripts/",eppath:"/wp-content/plugins/youtube-embed-plus/",epresponsiveselector:["iframe.__youtube_prefs_widget__"],epdovol:true,evselector:'iframe.__youtube_prefs__[src], iframe[src*="youtube.com/embed/"], iframe[src*="youtube-nocookie.com/embed/"]',stopMobileBuffer:true,ajax_compat:false,usingdefault:true,ytapi_load:"light"};a._EPYT_.touchmoved=false;if(a.location.toString().indexOf("https://")===0){a._EPYT_.ajaxurl=a._EPYT_.ajaxurl.replace("http://","https://")}a._EPYT_.pageLoaded=false;b(a).on("load._EPYT_",function(){a._EPYT_.pageLoaded=true});if(!document.querySelectorAll){document.querySelectorAll=function(d){var f=document,e=f.documentElement.firstChild,c=f.createElement("STYLE");e.appendChild(c);f.__qsaels=[];c.styleSheet.cssText=d+"{x:expression(document.__qsaels.push(this))}";a.scrollBy(0,0);return f.__qsaels}}if(typeof a._EPADashboard_==="undefined"){a._EPADashboard_={initStarted:false,checkCount:0,onPlayerReady:function(f){try{if(typeof _EPYT_.epdovol!=="undefined"&&_EPYT_.epdovol){var d=parseInt(f.target.getIframe().getAttribute("data-vol"));if(!isNaN(d)){if(d===0){f.target.mute()}else{if(f.target.isMuted()){f.target.unMute()}f.target.setVolume(d)}}}var c=parseInt(f.target.getIframe().getAttribute("data-epautoplay"));if(!isNaN(c)&&c===1){f.target.playVideo()}}catch(e){}},onPlayerStateChange:function(f){var e=f.target.getIframe();if(f.data===a.YT.PlayerState.PLAYING&&f.target.ponce!==true&&e.src.indexOf("autoplay=1")===-1){f.target.ponce=true}if(f.data===a.YT.PlayerState.ENDED&&b(e).data("relstop")=="1"){if(typeof f.target.stopVideo==="function"){f.target.stopVideo()}else{var g=b(e).clone(true).off();g.attr("src",g.attr("src").replace("autoplay=1","autoplay=0"));b(e).replaceWith(g);a._EPADashboard_.setupevents(g.attr("id"));e=g.get(0)}}var c=b(e).closest(".epyt-gallery");if(!c.length){c=b("#"+b(e).data("epytgalleryid"))}if(c.length){var d=c.find(".epyt-pagebutton").first().data("autonext")=="1";if(d&&f.data===a.YT.PlayerState.ENDED){var h=c.find(".epyt-current-video");if(!h.length){h=c.find(".epyt-gallery-thumb").first()}var i=h.find(" ~ .epyt-gallery-thumb").first();if(i.length){i.click()}else{c.find('.epyt-pagebutton.epyt-next[data-pagetoken!=""][data-pagetoken]').first().click()}}}},justid:function(c){return new RegExp("[\\?&]v=([^&#]*)").exec(c)[1]},setupevents:function(d){if(typeof(a.YT)!=="undefined"&&a.YT!==null&&a.YT.loaded){var c=document.getElementById(d);if(!c.epytsetupdone){a._EPADashboard_.log("Setting up YT API events: "+d);c.epytsetupdone=true;return new a.YT.Player(d,{events:{onReady:a._EPADashboard_.onPlayerReady,onStateChange:a._EPADashboard_.onPlayerStateChange}})}}},apiInit:function(){if(typeof(a.YT)!=="undefined"){a._EPADashboard_.initStarted=true;var c=document.querySelectorAll(_EPYT_.evselector);for(var d=0;d<c.length;d++){if(!c[d].hasAttribute("id")){c[d].id="_dytid_"+Math.round(Math.random()*8999+1000)}a._EPADashboard_.setupevents(c[d].id)}}},log:function(d){try{console.log(d)}catch(c){}},doubleCheck:function(){a._EPADashboard_.checkInterval=setInterval(function(){a._EPADashboard_.checkCount++;if(a._EPADashboard_.checkCount>=5||a._EPADashboard_.initStarted){clearInterval(a._EPADashboard_.checkInterval)}else{a._EPADashboard_.apiInit();a._EPADashboard_.log("YT API init check")}},1000)},selectText:function(e){if(document.selection){var c=document.body.createTextRange();c.moveToElementText(e);c.select()}else{if(a.getSelection){var d=a.getSelection();var c=document.createRange();c.selectNode(e);d.removeAllRanges();d.addRange(c)}}},setVidSrc:function(c,d){c.attr("src",d);c.get(0).epytsetupdone=false;a._EPADashboard_.setupevents(c.attr("id"))},loadYTAPI:function(){if(typeof a.YT==="undefined"){if(a._EPYT_.ytapi_load!=="never"&&(a._EPYT_.ytapi_load==="always"||b('iframe[src*="youtube.com/embed/"]').length)){var c=document.createElement("script");c.src="https://www.youtube.com/iframe_api";c.type="text/javascript";document.getElementsByTagName("head")[0].appendChild(c)}}else{if(a.YT.loaded){if(a._EPYT_.pageLoaded){a._EPADashboard_.apiInit();a._EPADashboard_.log("YT API available")}else{b(a).on("load._EPYT_",function(){a._EPADashboard_.apiInit();a._EPADashboard_.log("YT API available 2")})}}}},pageReady:function(){b(".epyt-gallery").each(function(){var f=b(this);if(!f.data("epytevents")||!b("body").hasClass("block-editor-page")){f.data("epytevents","1");var e=b(this).find("iframe, div.__youtube_prefs_gdpr__").first();var c=e.data("src")||e.attr("src");if(!c){c=e.data("ep-src")}var d=b(this).find(".epyt-gallery-list .epyt-gallery-thumb").first().data("videoid");if(typeof(c)!=="undefined"){c=c.replace(d,"GALLERYVIDEOID");f.data("ep-gallerysrc",c)}else{if(e.hasClass("__youtube_prefs_gdpr__")){f.data("ep-gallerysrc","")}}f.on("click touchend",".epyt-gallery-list .epyt-gallery-thumb",function(k){e=f.find("iframe, div.__youtube_prefs_gdpr__").first();if(a._EPYT_.touchmoved){return}if(!b(this).hasClass("epyt-current-video")){f.find(".epyt-gallery-list .epyt-gallery-thumb").removeClass("epyt-current-video");b(this).addClass("epyt-current-video");var g=b(this).data("videoid");f.data("currvid",g);var l=f.data("ep-gallerysrc").replace("GALLERYVIDEOID",g);var j=f.find(".epyt-pagebutton").first().data("thumbplay");if(j!=="0"&&j!==0){if(l.indexOf("autoplay")>0){l=l.replace("autoplay=0","autoplay=1")}else{l+="&autoplay=1"}e.addClass("epyt-thumbplay")}var h=Math.max(b("body").scrollTop(),b("html").scrollTop());var i=e.offset().top-parseInt(_EPYT_.gallery_scrolloffset);if(h>i){b("html, body").animate({scrollTop:i},500,function(){a._EPADashboard_.setVidSrc(e,l)})}else{a._EPADashboard_.setVidSrc(e,l)}}}).on("touchmove",function(g){a._EPYT_.touchmoved=true}).on("touchstart",function(){a._EPYT_.touchmoved=false}).on("keydown",".epyt-gallery-list .epyt-gallery-thumb, .epyt-pagebutton",function(h){var g=h.which;if((g===13)||(g===32)){h.preventDefault();b(this).click()}});f.on("mouseenter",".epyt-gallery-list .epyt-gallery-thumb",function(){b(this).addClass("hover")});f.on("mouseleave",".epyt-gallery-list .epyt-gallery-thumb",function(){b(this).removeClass("hover")});f.on("click touchend",".epyt-pagebutton",function(k){if(a._EPYT_.touchmoved){return}if(!f.find(".epyt-gallery-list").hasClass("epyt-loading")){f.find(".epyt-gallery-list").addClass("epyt-loading");var g=typeof(k.originalEvent)!=="undefined";var j={action:"my_embedplus_gallery_page",security:_EPYT_.security,options:{playlistId:b(this).data("playlistid"),pageToken:b(this).data("pagetoken"),pageSize:b(this).data("pagesize"),columns:b(this).data("epcolumns"),showTitle:b(this).data("showtitle"),showPaging:b(this).data("showpaging"),autonext:b(this).data("autonext"),thumbplay:b(this).data("thumbplay")}};var h=b(this).hasClass("epyt-next");var i=parseInt(f.data("currpage")+"");i+=h?1:-1;f.data("currpage",i);b.post(_EPYT_.ajaxurl,j,function(l){f.find(".epyt-gallery-list").html(l);f.find(".epyt-current").each(function(){b(this).text(f.data("currpage"))});f.find('.epyt-gallery-thumb[data-videoid="'+f.data("currvid")+'"]').addClass("epyt-current-video");if(f.find(".epyt-pagebutton").first().data("autonext")=="1"&&!g){f.find(".epyt-gallery-thumb").first().click()}}).fail(function(){alert("Sorry, there was an error loading the next page.")}).always(function(){f.find(".epyt-gallery-list").removeClass("epyt-loading");if(f.find(".epyt-pagebutton").first().data("autonext")!="1"){var l=Math.max(b("body").scrollTop(),b("html").scrollTop());var m=f.find(".epyt-gallery-list").offset().top-parseInt(_EPYT_.gallery_scrolloffset);if(l>m){b("html, body").animate({scrollTop:m},500)}}})}}).on("touchmove",function(g){a._EPYT_.touchmoved=true}).on("touchstart",function(){a._EPYT_.touchmoved=false})}});b("button.__youtube_prefs_gdpr__").on("click",function(c){c.preventDefault();if(b.cookie){b.cookie("ytprefs_gdpr_consent","1",{expires:30,path:"/"});a.top.location.reload()}})}}}a.onYouTubeIframeAPIReady=typeof a.onYouTubeIframeAPIReady!=="undefined"?a.onYouTubeIframeAPIReady:function(){if(a._EPYT_.pageLoaded){a._EPADashboard_.apiInit();a._EPADashboard_.log("YT API ready")}else{b(a).on("load._EPYT_",function(){a._EPADashboard_.apiInit();a._EPADashboard_.log("YT API ready 2")})}};a._EPADashboard_.loadYTAPI();if(a._EPYT_.pageLoaded){a._EPADashboard_.doubleCheck()}else{b(a).on("load._EPYT_",function(){a._EPADashboard_.doubleCheck()})}b(document).ready(function(){a._EPADashboard_.pageReady();a._EPADashboard_.loadYTAPI();if(a._EPYT_.ajax_compat){b(a).on("load._EPYT_",function(){b(document).ajaxSuccess(function(d,f,c){if(f&&f.responseText&&f.responseText.indexOf("<iframe ")!==-1){a._EPADashboard_.loadYTAPI();a._EPADashboard_.apiInit();a._EPADashboard_.log("YT API AJAX");a._EPADashboard_.pageReady()}})})}})})(window,jQuery);
1
 
2
+ (function(a,b){a._EPYT_=a._EPYT_||{ajaxurl:"/wp-admin/admin-ajax.php",security:"",gallery_scrolloffset:100,eppathtoscripts:"/wp-content/plugins/youtube-embed-plus/scripts/",eppath:"/wp-content/plugins/youtube-embed-plus/",epresponsiveselector:["iframe.__youtube_prefs_widget__"],epdovol:true,evselector:'iframe.__youtube_prefs__[src], iframe[src*="youtube.com/embed/"], iframe[src*="youtube-nocookie.com/embed/"]',stopMobileBuffer:true,ajax_compat:false,usingdefault:true,ytapi_load:"light"};a._EPYT_.touchmoved=false;if(a.location.toString().indexOf("https://")===0){a._EPYT_.ajaxurl=a._EPYT_.ajaxurl.replace("http://","https://")}a._EPYT_.pageLoaded=false;b(a).on("load._EPYT_",function(){a._EPYT_.pageLoaded=true});if(!document.querySelectorAll){document.querySelectorAll=function(d){var f=document,e=f.documentElement.firstChild,c=f.createElement("STYLE");e.appendChild(c);f.__qsaels=[];c.styleSheet.cssText=d+"{x:expression(document.__qsaels.push(this))}";a.scrollBy(0,0);return f.__qsaels}}if(typeof a._EPADashboard_==="undefined"){a._EPADashboard_={initStarted:false,checkCount:0,onPlayerReady:function(f){try{if(typeof _EPYT_.epdovol!=="undefined"&&_EPYT_.epdovol){var d=parseInt(f.target.getIframe().getAttribute("data-vol"));if(!isNaN(d)){if(d===0){f.target.mute()}else{if(f.target.isMuted()){f.target.unMute()}f.target.setVolume(d)}}}var c=parseInt(f.target.getIframe().getAttribute("data-epautoplay"));if(!isNaN(c)&&c===1){f.target.playVideo()}}catch(e){}},onPlayerStateChange:function(f){var e=f.target.getIframe();if(f.data===a.YT.PlayerState.PLAYING&&f.target.ponce!==true&&e.src.indexOf("autoplay=1")===-1){f.target.ponce=true}if(f.data===a.YT.PlayerState.ENDED&&b(e).data("relstop")=="1"){if(typeof f.target.stopVideo==="function"){f.target.stopVideo()}else{var g=b(e).clone(true).off();g.attr("src",g.attr("src").replace("autoplay=1","autoplay=0"));b(e).replaceWith(g);a._EPADashboard_.setupevents(g.attr("id"));e=g.get(0)}}var c=b(e).closest(".epyt-gallery");if(!c.length){c=b("#"+b(e).data("epytgalleryid"))}if(c.length){var d=c.find(".epyt-pagebutton").first().data("autonext")=="1";if(d&&f.data===a.YT.PlayerState.ENDED){var h=c.find(".epyt-current-video");if(!h.length){h=c.find(".epyt-gallery-thumb").first()}var i=h.find(" ~ .epyt-gallery-thumb").first();if(i.length){i.click()}else{c.find('.epyt-pagebutton.epyt-next[data-pagetoken!=""][data-pagetoken]').first().click()}}}},justid:function(c){return new RegExp("[\\?&]v=([^&#]*)").exec(c)[1]},setupevents:function(d){if(typeof(a.YT)!=="undefined"&&a.YT!==null&&a.YT.loaded){var c=document.getElementById(d);if(!c.epytsetupdone){a._EPADashboard_.log("Setting up YT API events: "+d);c.epytsetupdone=true;return new a.YT.Player(d,{events:{onReady:a._EPADashboard_.onPlayerReady,onStateChange:a._EPADashboard_.onPlayerStateChange}})}}},apiInit:function(){if(typeof(a.YT)!=="undefined"){a._EPADashboard_.initStarted=true;var c=document.querySelectorAll(_EPYT_.evselector);for(var d=0;d<c.length;d++){if(!c[d].hasAttribute("id")){c[d].id="_dytid_"+Math.round(Math.random()*8999+1000)}a._EPADashboard_.setupevents(c[d].id)}}},log:function(d){try{console.log(d)}catch(c){}},doubleCheck:function(){a._EPADashboard_.checkInterval=setInterval(function(){a._EPADashboard_.checkCount++;if(a._EPADashboard_.checkCount>=5||a._EPADashboard_.initStarted){clearInterval(a._EPADashboard_.checkInterval)}else{a._EPADashboard_.apiInit();a._EPADashboard_.log("YT API init check")}},1000)},selectText:function(e){if(document.selection){var c=document.body.createTextRange();c.moveToElementText(e);c.select()}else{if(a.getSelection){var d=a.getSelection();var c=document.createRange();c.selectNode(e);d.removeAllRanges();d.addRange(c)}}},setVidSrc:function(c,d){c.attr("src",d);c.get(0).epytsetupdone=false;a._EPADashboard_.setupevents(c.attr("id"))},loadYTAPI:function(){if(typeof a.YT==="undefined"){if(a._EPYT_.ytapi_load!=="never"&&(a._EPYT_.ytapi_load==="always"||b('iframe[src*="youtube.com/embed/"], iframe[data-src*="youtube.com/embed/"]').length)){var c=document.createElement("script");c.src="https://www.youtube.com/iframe_api";c.type="text/javascript";document.getElementsByTagName("head")[0].appendChild(c)}}else{if(a.YT.loaded){if(a._EPYT_.pageLoaded){a._EPADashboard_.apiInit();a._EPADashboard_.log("YT API available")}else{b(a).on("load._EPYT_",function(){a._EPADashboard_.apiInit();a._EPADashboard_.log("YT API available 2")})}}}},pageReady:function(){b(".epyt-gallery").each(function(){var f=b(this);if(!f.data("epytevents")||!b("body").hasClass("block-editor-page")){f.data("epytevents","1");var e=b(this).find("iframe, div.__youtube_prefs_gdpr__").first();var c=e.data("src")||e.attr("src");if(!c){c=e.data("ep-src")}var d=b(this).find(".epyt-gallery-list .epyt-gallery-thumb").first().data("videoid");if(typeof(c)!=="undefined"){c=c.replace(d,"GALLERYVIDEOID");f.data("ep-gallerysrc",c)}else{if(e.hasClass("__youtube_prefs_gdpr__")){f.data("ep-gallerysrc","")}}f.on("click touchend",".epyt-gallery-list .epyt-gallery-thumb",function(k){e=f.find("iframe, div.__youtube_prefs_gdpr__").first();if(a._EPYT_.touchmoved){return}if(!b(this).hasClass("epyt-current-video")){f.find(".epyt-gallery-list .epyt-gallery-thumb").removeClass("epyt-current-video");b(this).addClass("epyt-current-video");var g=b(this).data("videoid");f.data("currvid",g);var l=f.data("ep-gallerysrc").replace("GALLERYVIDEOID",g);var j=f.find(".epyt-pagebutton").first().data("thumbplay");if(j!=="0"&&j!==0){if(l.indexOf("autoplay")>0){l=l.replace("autoplay=0","autoplay=1")}else{l+="&autoplay=1"}e.addClass("epyt-thumbplay")}var h=Math.max(b("body").scrollTop(),b("html").scrollTop());var i=e.offset().top-parseInt(_EPYT_.gallery_scrolloffset);if(h>i){b("html, body").animate({scrollTop:i},500,function(){a._EPADashboard_.setVidSrc(e,l)})}else{a._EPADashboard_.setVidSrc(e,l)}}}).on("touchmove",function(g){a._EPYT_.touchmoved=true}).on("touchstart",function(){a._EPYT_.touchmoved=false}).on("keydown",".epyt-gallery-list .epyt-gallery-thumb, .epyt-pagebutton",function(h){var g=h.which;if((g===13)||(g===32)){h.preventDefault();b(this).click()}});f.on("mouseenter",".epyt-gallery-list .epyt-gallery-thumb",function(){b(this).addClass("hover")});f.on("mouseleave",".epyt-gallery-list .epyt-gallery-thumb",function(){b(this).removeClass("hover")});f.on("click touchend",".epyt-pagebutton",function(k){if(a._EPYT_.touchmoved){return}if(!f.find(".epyt-gallery-list").hasClass("epyt-loading")){f.find(".epyt-gallery-list").addClass("epyt-loading");var g=typeof(k.originalEvent)!=="undefined";var j={action:"my_embedplus_gallery_page",security:_EPYT_.security,options:{playlistId:b(this).data("playlistid"),pageToken:b(this).data("pagetoken"),pageSize:b(this).data("pagesize"),columns:b(this).data("epcolumns"),showTitle:b(this).data("showtitle"),showPaging:b(this).data("showpaging"),autonext:b(this).data("autonext"),thumbplay:b(this).data("thumbplay")}};var h=b(this).hasClass("epyt-next");var i=parseInt(f.data("currpage")+"");i+=h?1:-1;f.data("currpage",i);b.post(_EPYT_.ajaxurl,j,function(l){f.find(".epyt-gallery-list").html(l);f.find(".epyt-current").each(function(){b(this).text(f.data("currpage"))});f.find('.epyt-gallery-thumb[data-videoid="'+f.data("currvid")+'"]').addClass("epyt-current-video");if(f.find(".epyt-pagebutton").first().data("autonext")=="1"&&!g){f.find(".epyt-gallery-thumb").first().click()}}).fail(function(){alert("Sorry, there was an error loading the next page.")}).always(function(){f.find(".epyt-gallery-list").removeClass("epyt-loading");if(f.find(".epyt-pagebutton").first().data("autonext")!="1"){var l=Math.max(b("body").scrollTop(),b("html").scrollTop());var m=f.find(".epyt-gallery-list").offset().top-parseInt(_EPYT_.gallery_scrolloffset);if(l>m){b("html, body").animate({scrollTop:m},500)}}})}}).on("touchmove",function(g){a._EPYT_.touchmoved=true}).on("touchstart",function(){a._EPYT_.touchmoved=false})}});b("button.__youtube_prefs_gdpr__").on("click",function(c){c.preventDefault();if(b.cookie){b.cookie("ytprefs_gdpr_consent","1",{expires:30,path:"/"});a.top.location.reload()}})}}}a.onYouTubeIframeAPIReady=typeof a.onYouTubeIframeAPIReady!=="undefined"?a.onYouTubeIframeAPIReady:function(){if(a._EPYT_.pageLoaded){a._EPADashboard_.apiInit();a._EPADashboard_.log("YT API ready")}else{b(a).on("load._EPYT_",function(){a._EPADashboard_.apiInit();a._EPADashboard_.log("YT API ready 2")})}};a._EPADashboard_.loadYTAPI();if(a._EPYT_.pageLoaded){a._EPADashboard_.doubleCheck()}else{b(a).on("load._EPYT_",function(){a._EPADashboard_.doubleCheck()})}b(document).ready(function(){a._EPADashboard_.pageReady();a._EPADashboard_.loadYTAPI();if(a._EPYT_.ajax_compat){b(a).on("load._EPYT_",function(){b(document).ajaxSuccess(function(d,f,c){if(f&&f.responseText&&f.responseText.indexOf("<iframe ")!==-1){a._EPADashboard_.loadYTAPI();a._EPADashboard_.apiInit();a._EPADashboard_.log("YT API AJAX");a._EPADashboard_.pageReady()}})})}})})(window,jQuery);
youtube.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Embed Plus for YouTube - Gallery, Channel, Playlist, Live Stream
4
  Plugin URI: https://www.embedplus.com/dashboard/pro-easy-video-analytics.aspx?ref=plugin
5
  Description: YouTube Embed and YouTube Gallery WordPress Plugin. Embed a responsive video, YouTube channel, playlist gallery, or live stream
6
- Version: 13.2.0.2
7
  Author: Embed Plus for YouTube Team
8
  Author URI: https://www.embedplus.com
9
  */
@@ -34,7 +34,7 @@ class YouTubePrefs
34
 
35
  public static $folder_name = 'youtube-embed-plus';
36
  public static $curltimeout = 30;
37
- public static $version = '13.2.0.2';
38
  public static $opt_version = 'version';
39
  public static $optembedwidth = null;
40
  public static $optembedheight = null;
@@ -135,8 +135,8 @@ class YouTubePrefs
135
  'do_shortcode',
136
  'convert_smilies'
137
  );
138
- public static $get_api_key_msg = 'The ### feature now requires a (free) YouTube API key from Google. Please follow the easy steps <a href="https://www.youtube.com/watch?v=6gD0X76-v_g" target="_blank">in this video</a> to create and save your API key.';
139
- public static $boilerplate_api_error_message = ' Please make sure you performed the <a href="https://www.youtube.com/watch?v=6gD0X76-v_g" target="_blank">steps in this video</a> to create and save a proper server API key.';
140
  public static $dft_gdpr_consent_message = '<p><strong>Please accept YouTube cookies to play this video.</strong> By accepting you will be accessing content from YouTube, a service provided by an external third party.</p><p><a href="https://policies.google.com/privacy" target="_blank">YouTube privacy policy</a></p><p>If you accept this notice, your choice will be saved and the page will refresh.</p>';
141
  ///////////////////////////////////////////////////////////////////////////////////////////////////
142
  public static $vi_default_date = ''; // date('Y-m-d H:i:s', strtotime('2000-01-01'));
@@ -2462,7 +2462,7 @@ class YouTubePrefs
2462
 
2463
  if (isset($linkparams['live']) && $linkparams['live'] == '1')
2464
  {
2465
- $live_error_msg = ' To embed live videos, please make sure you performed the <a href="https://www.youtube.com/watch?v=6gD0X76-v_g" target="_blank">steps in this video</a> to create and save a proper server API key.';
2466
  if (isset(self::$alloptions[self::$opt_apikey]))
2467
  {
2468
  if (isset($linkparams['channel']))
@@ -2714,16 +2714,25 @@ class YouTubePrefs
2714
  $videoidoutput = 'live_stream';
2715
  }
2716
 
 
 
 
2717
  if ($finalparams[self::$opt_responsive] == 1)
2718
  {
2719
  // wrap with fluid wrapper on server side code
 
 
 
 
2720
  }
2721
 
2722
- $code1 = '<iframe ' . $centercode . ' id="_ytid_' . rand(10000, 99999) . '" width="' . self::$defaultwidth . '" height="' . self::$defaultheight . '" ' .
 
 
2723
  ' data-origwidth="' . self::$defaultwidth . '" data-origheight="' . self::$defaultheight . '" ' . $relstop .
2724
  ' src="https://www.' . $youtubebaseurl . '.com/embed/' . $videoidoutput . '?';
2725
  $code2 = '" class="__youtube_prefs__' . ($iscontent ? '' : ' __youtube_prefs_widget__') .
2726
- '"' . $voloutput . $acctitle . $galleryid_ifm_data . ' allow="autoplay; encrypted-media" allowfullscreen data-no-lazy="1" data-skipgform_ajax_framebjll=""></iframe>';
2727
 
2728
  $origin = '';
2729
 
@@ -3081,7 +3090,7 @@ class YouTubePrefs
3081
  $new_pointer_content = '<h3>' . __('New Update') . '</h3>'; // ooopointer
3082
 
3083
  $new_pointer_content .= '<p>'; // ooopointer
3084
- $new_pointer_content .= "This update fixes the &quot;Hide related videos at the end of playback&quot; feature for both Free and <a target=_blank href=" . self::$epbase . '/dashboard/pro-easy-video-analytics.aspx?ref=frompointer' . ">Pro versions</a>.";
3085
  if (self::vi_logged_in())
3086
  {
3087
  $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.";
@@ -3380,7 +3389,7 @@ class YouTubePrefs
3380
  </h2>
3381
  <p>
3382
  Some features (such as galleries, and some wizard features) now require you to create a free YouTube API <strong>Server</strong> key from Google.
3383
- Make sure it's a YouTube Data API v3 "Web Server" key as shown in the screenshot (i.e. not web browser or anything else). <a href="https://www.youtube.com/watch?v=6gD0X76-v_g" target="_blank">Click this link &raquo;</a> and follow the video to get your API key. Don't worry, it's an easy process.
3384
  </p>
3385
  <p>
3386
  <b class="chktitle">YouTube API Key:</b>
@@ -3413,7 +3422,7 @@ class YouTubePrefs
3413
  <a href="https://support.google.com/youtube/answer/132596?hl=en" target="_blank">https://support.google.com/youtube/answer/132596?hl=en</a>
3414
  You'll see that videos that you want to monetize "should be embedded using the standard click-to-play embed and NOT a scripted play."
3415
  Unchecking this option guarantees standard click-to-play gallery embedding.
3416
- (Another Note: Desktop browsers like Chrome and Safari are moving towards preventing autoplay for any video. So this general feature may be deprecated by most browsers in the near future)
3417
  </label>
3418
  </p>
3419
  <p>
@@ -3422,7 +3431,7 @@ class YouTubePrefs
3422
  </p>
3423
  <p>
3424
  <input name="<?php echo self::$opt_loop; ?>" id="<?php echo self::$opt_loop; ?>" <?php checked($all[self::$opt_loop], 1); ?> type="checkbox" class="checkbox">
3425
- <label for="<?php echo self::$opt_loop; ?>"><?php _e('<b class="chktitle">Looping:</b> Loop all your videos.') ?></label>
3426
  </p>
3427
  <p>
3428
  <input name="<?php echo self::$opt_modestbranding; ?>" id="<?php echo self::$opt_modestbranding; ?>" <?php checked($all[self::$opt_modestbranding], 1); ?> type="checkbox" class="checkbox">
@@ -3537,10 +3546,10 @@ class YouTubePrefs
3537
  <div id="not_live_content_scroll" class="p">
3538
  <input name="<?php echo self::$opt_not_live_on; ?>" id="<?php echo self::$opt_not_live_on; ?>" <?php checked($all[self::$opt_not_live_on], 1); ?> type="checkbox" class="checkbox">
3539
  <label for="<?php echo self::$opt_not_live_on; ?>">
3540
- <b class="chktitle">Default "Not Live" Content:</b>
3541
- When your channel is not streaming live, the YouTube live player will simply display a countdown.
3542
- Instead of showing that player, you can display some "coming soon" content in that space for your visitors to see until your channel begins to live stream.
3543
- The plugin will automatically switch to your channel's live stream once it's active.
3544
  Below, enter what you would like to appear until then.
3545
  If you just want to show the standard countdown player that YouTube provides, uncheck this option.
3546
  <strong class="check-note"><span class="orange">NOTE:</span> This feature uses a significant amount of your YouTube API quota. We suggest unchecking it if your site has high traffic. If you chose to use this feature, do not put another live stream embed below.</strong>
@@ -3706,7 +3715,7 @@ class YouTubePrefs
3706
  <img class="ssgallery" src="<?php echo plugins_url('images/ssgallery.png', __FILE__) ?>">
3707
  <p>
3708
  <a target="_blank" href="<?php echo self::$epbase ?>/responsive-youtube-playlist-channel-gallery-for-wordpress.aspx">You can now make playlist embeds (and channel-playlist embeds) have a gallery layout &raquo;</a>. <strong>First, you must obtain your YouTube API key</strong>.
3709
- Don't worry, it's an easy process. Just <a href="https://www.youtube.com/watch?v=6gD0X76-v_g" target="_blank">click this link &raquo;</a> and follow the video on that page to get your server API key. Since Google updates their API Key generation directions frequently, follow the general steps shown in the video.
3710
  Then paste your API key in the "API Key" tab, and click the "Save Changes" button.
3711
  </p>
3712
 
@@ -3924,7 +3933,7 @@ class YouTubePrefs
3924
  <label for="<?php echo self::$opt_stop_mobile_buffer; ?>">
3925
  <b class="chktitle">Mobile Autoplay Problems: </b>
3926
  Autoplay works for desktop, but mobile devices don't allow autoplay due to network carrier data charges. For mobile devices, this option may help the player to properly display the video for the visitor to click on.
3927
- (<strong>Note:</strong> Desktop browsers like Chrome and Safari are moving towards preventing autoplay for any video. So this general feature may be deprecated by most browsers in the near future)
3928
  </label>
3929
  </p>
3930
  <p>
@@ -5066,10 +5075,10 @@ class YouTubePrefs
5066
  <div class="ytprefs-ob-setting yob-live">
5067
  <input name="<?php echo self::$opt_not_live_on; ?>" id="<?php echo self::$opt_not_live_on; ?>" <?php checked($all[self::$opt_not_live_on], 1); ?> type="checkbox" class="checkbox">
5068
  <label for="<?php echo self::$opt_not_live_on; ?>">
5069
- <b class="chktitle">Default "Not Live" Content:</b>
5070
- When your channel is not streaming live, the YouTube live player will simply display a countdown.
5071
- Instead of showing that player, you can display some "coming soon" content in that space for your visitors to see until your channel begins to live stream.
5072
- The plugin will automatically switch to your channel's live stream once it's active.
5073
  Below, enter what you would like to appear until then.
5074
  If you just want to show the standard countdown player that YouTube provides, uncheck this option.
5075
  <strong class="check-note"><span class="orange">NOTE:</span> This feature uses a significant amount of your YouTube API quota. We suggest unchecking it if your site has high traffic. If you chose to use this feature, do not put another live stream embed below.</strong>
@@ -5174,7 +5183,7 @@ class YouTubePrefs
5174
  {
5175
  ?>
5176
  <p>
5177
- <a href="https://www.youtube.com/watch?v=6gD0X76-v_g" target="_blank">Click this link &raquo;</a> and follow the video to get your API key. Don't worry, it's an easy process.
5178
  </p>
5179
  <?php
5180
  }
3
  Plugin Name: Embed Plus for YouTube - Gallery, Channel, Playlist, Live Stream
4
  Plugin URI: https://www.embedplus.com/dashboard/pro-easy-video-analytics.aspx?ref=plugin
5
  Description: YouTube Embed and YouTube Gallery WordPress Plugin. Embed a responsive video, YouTube channel, playlist gallery, or live stream
6
+ Version: 13.2.1
7
  Author: Embed Plus for YouTube Team
8
  Author URI: https://www.embedplus.com
9
  */
34
 
35
  public static $folder_name = 'youtube-embed-plus';
36
  public static $curltimeout = 30;
37
+ public static $version = '13.2.1';
38
  public static $opt_version = 'version';
39
  public static $optembedwidth = null;
40
  public static $optembedheight = null;
135
  'do_shortcode',
136
  'convert_smilies'
137
  );
138
+ public static $get_api_key_msg = 'The ### feature now requires a (free) YouTube API key from Google. Please follow the easy steps <a href="https://www.youtube.com/watch?v=VqML5F8hcRQ" target="_blank">in this video</a> to create and save your API key.';
139
+ public static $boilerplate_api_error_message = ' Please make sure you performed the <a href="https://www.youtube.com/watch?v=VqML5F8hcRQ" target="_blank">steps in this video</a> to create and save a proper server API key.';
140
  public static $dft_gdpr_consent_message = '<p><strong>Please accept YouTube cookies to play this video.</strong> By accepting you will be accessing content from YouTube, a service provided by an external third party.</p><p><a href="https://policies.google.com/privacy" target="_blank">YouTube privacy policy</a></p><p>If you accept this notice, your choice will be saved and the page will refresh.</p>';
141
  ///////////////////////////////////////////////////////////////////////////////////////////////////
142
  public static $vi_default_date = ''; // date('Y-m-d H:i:s', strtotime('2000-01-01'));
2462
 
2463
  if (isset($linkparams['live']) && $linkparams['live'] == '1')
2464
  {
2465
+ $live_error_msg = ' To embed live videos, please make sure you performed the <a href="https://www.youtube.com/watch?v=VqML5F8hcRQ" target="_blank">steps in this video</a> to create and save a proper server API key.';
2466
  if (isset(self::$alloptions[self::$opt_apikey]))
2467
  {
2468
  if (isset($linkparams['channel']))
2714
  $videoidoutput = 'live_stream';
2715
  }
2716
 
2717
+ $begin_responsive = '';
2718
+ $end_responsive = '';
2719
+ $dim_attrs = ' width="' . self::$defaultwidth . '" height="' . self::$defaultheight . '" ';
2720
  if ($finalparams[self::$opt_responsive] == 1)
2721
  {
2722
  // wrap with fluid wrapper on server side code
2723
+ //$dim_attrs = ' ';
2724
+ //$begin_responsive = '<div class="fluid-width-video-wrapper" style="padding-top: ' . (100.0 * self::$defaultheight / self::$defaultwidth) . '% !important;">';
2725
+ $begin_responsive = '<div class="epyt-video-wrapper">';
2726
+ $end_responsive = '</div>';
2727
  }
2728
 
2729
+ $iframe_id = rand(10000, 99999);
2730
+
2731
+ $code1 = $begin_responsive . '<iframe ' . $centercode . ' id="_ytid_' . $iframe_id . '" '. $dim_attrs .
2732
  ' data-origwidth="' . self::$defaultwidth . '" data-origheight="' . self::$defaultheight . '" ' . $relstop .
2733
  ' src="https://www.' . $youtubebaseurl . '.com/embed/' . $videoidoutput . '?';
2734
  $code2 = '" class="__youtube_prefs__' . ($iscontent ? '' : ' __youtube_prefs_widget__') .
2735
+ ' no-lazyload"' . $voloutput . $acctitle . $galleryid_ifm_data . ' allow="autoplay; encrypted-media" allowfullscreen data-no-lazy="1" data-skipgform_ajax_framebjll=""></iframe>' . $end_responsive;
2736
 
2737
  $origin = '';
2738
 
3090
  $new_pointer_content = '<h3>' . __('New Update') . '</h3>'; // ooopointer
3091
 
3092
  $new_pointer_content .= '<p>'; // ooopointer
3093
+ $new_pointer_content .= "This update provides more compatibility with other lazyload plugins and responsive themes, for both Free and <a target=_blank href=" . self::$epbase . '/dashboard/pro-easy-video-analytics.aspx?ref=frompointer' . ">Pro versions</a>.";
3094
  if (self::vi_logged_in())
3095
  {
3096
  $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.";
3389
  </h2>
3390
  <p>
3391
  Some features (such as galleries, and some wizard features) now require you to create a free YouTube API <strong>Server</strong> key from Google.
3392
+ Make sure it's a YouTube Data API v3 "Web Server" key as shown in the screenshot (i.e. not web browser or anything else). <a href="https://www.youtube.com/watch?v=VqML5F8hcRQ" target="_blank">Click this link &raquo;</a> and follow the video to get your API key. Don't worry, it's an easy process.
3393
  </p>
3394
  <p>
3395
  <b class="chktitle">YouTube API Key:</b>
3422
  <a href="https://support.google.com/youtube/answer/132596?hl=en" target="_blank">https://support.google.com/youtube/answer/132596?hl=en</a>
3423
  You'll see that videos that you want to monetize "should be embedded using the standard click-to-play embed and NOT a scripted play."
3424
  Unchecking this option guarantees standard click-to-play gallery embedding.
3425
+ (Another Note: Desktop browsers like <a href="https://developers.google.com/youtube/iframe_api_reference#Mobile_considerations" target="_blank">Chrome and Safari are moving towards preventing autoplay for any video</a>. So this general feature may be deprecated by most browsers in the near future)
3426
  </label>
3427
  </p>
3428
  <p>
3431
  </p>
3432
  <p>
3433
  <input name="<?php echo self::$opt_loop; ?>" id="<?php echo self::$opt_loop; ?>" <?php checked($all[self::$opt_loop], 1); ?> type="checkbox" class="checkbox">
3434
+ <label for="<?php echo self::$opt_loop; ?>"><?php _e('<b class="chktitle">Looping:</b> Loop all your videos. Note: this feature is incompatible with the "hide related videos" feature.') ?></label>
3435
  </p>
3436
  <p>
3437
  <input name="<?php echo self::$opt_modestbranding; ?>" id="<?php echo self::$opt_modestbranding; ?>" <?php checked($all[self::$opt_modestbranding], 1); ?> type="checkbox" class="checkbox">
3546
  <div id="not_live_content_scroll" class="p">
3547
  <input name="<?php echo self::$opt_not_live_on; ?>" id="<?php echo self::$opt_not_live_on; ?>" <?php checked($all[self::$opt_not_live_on], 1); ?> type="checkbox" class="checkbox">
3548
  <label for="<?php echo self::$opt_not_live_on; ?>">
3549
+ <b class="chktitle">Default "Not Live" Content:</b> (For direct-link video streams, <em>not</em> channel streams. <a href="<?php echo self::$epbase ?>/how-to-embed-a-youtube-livestream-in-wordpress.aspx" target="_blank">More info here</a>)
3550
+ When your video is not streaming live, the YouTube live player will simply display a countdown.
3551
+ Instead of showing that player, you can display some "coming soon" content in that space for your visitors to see until your video begins to live stream.
3552
+ The plugin will automatically switch to your video's live stream once it's active.
3553
  Below, enter what you would like to appear until then.
3554
  If you just want to show the standard countdown player that YouTube provides, uncheck this option.
3555
  <strong class="check-note"><span class="orange">NOTE:</span> This feature uses a significant amount of your YouTube API quota. We suggest unchecking it if your site has high traffic. If you chose to use this feature, do not put another live stream embed below.</strong>
3715
  <img class="ssgallery" src="<?php echo plugins_url('images/ssgallery.png', __FILE__) ?>">
3716
  <p>
3717
  <a target="_blank" href="<?php echo self::$epbase ?>/responsive-youtube-playlist-channel-gallery-for-wordpress.aspx">You can now make playlist embeds (and channel-playlist embeds) have a gallery layout &raquo;</a>. <strong>First, you must obtain your YouTube API key</strong>.
3718
+ Don't worry, it's an easy process. Just <a href="https://www.youtube.com/watch?v=VqML5F8hcRQ" target="_blank">click this link &raquo;</a> and follow the video on that page to get your server API key. Since Google updates their API Key generation directions frequently, follow the general steps shown in the video.
3719
  Then paste your API key in the "API Key" tab, and click the "Save Changes" button.
3720
  </p>
3721
 
3933
  <label for="<?php echo self::$opt_stop_mobile_buffer; ?>">
3934
  <b class="chktitle">Mobile Autoplay Problems: </b>
3935
  Autoplay works for desktop, but mobile devices don't allow autoplay due to network carrier data charges. For mobile devices, this option may help the player to properly display the video for the visitor to click on.
3936
+ (<strong>Note:</strong> Desktop browsers like <a href="https://developers.google.com/youtube/iframe_api_reference#Mobile_considerations" target="_blank">Chrome and Safari are moving towards preventing autoplay for any video</a>. So this general feature may be deprecated by most browsers in the near future)
3937
  </label>
3938
  </p>
3939
  <p>
5075
  <div class="ytprefs-ob-setting yob-live">
5076
  <input name="<?php echo self::$opt_not_live_on; ?>" id="<?php echo self::$opt_not_live_on; ?>" <?php checked($all[self::$opt_not_live_on], 1); ?> type="checkbox" class="checkbox">
5077
  <label for="<?php echo self::$opt_not_live_on; ?>">
5078
+ <b class="chktitle">Default "Not Live" Content:</b> (For direct-link video streams, <em>not</em> channel streams. <a href="<?php echo self::$epbase ?>/how-to-embed-a-youtube-livestream-in-wordpress.aspx" target="_blank">More info here</a>)
5079
+ When your video is not streaming live, the YouTube live player will simply display a countdown.
5080
+ Instead of showing that player, you can display some "coming soon" content in that space for your visitors to see until your video begins to live stream.
5081
+ The plugin will automatically switch to your video's live stream once it's active.
5082
  Below, enter what you would like to appear until then.
5083
  If you just want to show the standard countdown player that YouTube provides, uncheck this option.
5084
  <strong class="check-note"><span class="orange">NOTE:</span> This feature uses a significant amount of your YouTube API quota. We suggest unchecking it if your site has high traffic. If you chose to use this feature, do not put another live stream embed below.</strong>
5183
  {
5184
  ?>
5185
  <p>
5186
+ <a href="https://www.youtube.com/watch?v=VqML5F8hcRQ" target="_blank">Click this link &raquo;</a> and follow the video to get your API key. Don't worry, it's an easy process.
5187
  </p>
5188
  <?php
5189
  }