From 92b30759e82633d65d3049fe0d5e3f36a524dea5 Mon Sep 17 00:00:00 2001 From: Kevin Smith Date: Mon, 29 Feb 2016 07:22:11 -0600 Subject: [PATCH] Add condition so YouTube correction only applies to YouTube videos. --- third_party/antenna/pi.antenna.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/third_party/antenna/pi.antenna.php b/third_party/antenna/pi.antenna.php index e8d595c..4778520 100755 --- a/third_party/antenna/pi.antenna.php +++ b/third_party/antenna/pi.antenna.php @@ -71,8 +71,9 @@ public function Antenna() $wmode_param = (ee()->TMPL->fetch_param('wmode')) ? "&wmode=" . ee()->TMPL->fetch_param('wmode') : ""; // Correct for a bug in YouTube response if only maxheight is set and the video is over 612px wide - if (empty($max_height)) $max_height = "&maxheight=" . ee()->TMPL->fetch_param('max_width'); - + if (((strpos($video_url, "youtube.com/") !== FALSE OR strpos($video_url, "youtu.be/") !== FALSE)) AND (empty($max_height))) { + $max_height = "&maxheight=" . ee()->TMPL->fetch_param('max_width'); + } // Cache can be disabled by setting 0 as the cache_minutes param if (ee()->TMPL->fetch_param('cache_minutes') !== FALSE && is_numeric(ee()->TMPL->fetch_param('cache_minutes'))) { $this->refresh_cache = ee()->TMPL->fetch_param('cache_minutes');