From 57c6c9a04e5d17c63e58195f2ce99ca2d1f03b42 Mon Sep 17 00:00:00 2001 From: Derek Hogue Date: Tue, 13 Sep 2011 17:20:29 -0500 Subject: [PATCH 1/6] Added 'vimeo_color' param, 'iframe_class' param, 'iframe_id' param to EE2 version --- ee2/antenna/pi.antenna.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/ee2/antenna/pi.antenna.php b/ee2/antenna/pi.antenna.php index 390f53f..b0d6a63 100644 --- a/ee2/antenna/pi.antenna.php +++ b/ee2/antenna/pi.antenna.php @@ -73,6 +73,7 @@ public function Antenna() $vimeo_title = ($this->EE->TMPL->fetch_param('vimeo_title') == "false") ? "&title=false" : ""; $vimeo_autoplay = ($this->EE->TMPL->fetch_param('vimeo_autoplay') == "true") ? "&autoplay=true" : ""; $vimeo_portrait = ($this->EE->TMPL->fetch_param('vimeo_portrait') == "false") ? "&portrait=0" : ""; + $vimeo_color = ($this->EE->TMPL->fetch_param('vimeo_color')) ? "&color=".$this->EE->TMPL->fetch_param('vimeo_color') : ""; // If it's not YouTube, Vimeo, or Wistia, bail if (strpos($video_url, "youtube.com/") !== FALSE) { @@ -133,6 +134,21 @@ public function Antenna() $video_info->html = substr($video_info->html, 0, $param_pos) . $embed_str . substr($video_info->html, $param_pos); } } + + + if(($this->EE->TMPL->fetch_param('iframe_class') || + $this->EE->TMPL->fetch_param('iframe_id')) && + strpos($video_info->html, "EE->TMPL->fetch_param('iframe_class')) + { + $video_info->html = str_replace('html); + } + if($this->EE->TMPL->fetch_param('iframe_id')) + { + $video_info->html = str_replace('html); + } + } //Handle a single tag From 086164fe84004e8abbf2e4295a774f27016c7c90 Mon Sep 17 00:00:00 2001 From: Derek Hogue Date: Wed, 14 Sep 2011 08:49:04 -0500 Subject: [PATCH 2/6] Added 'vimeo_color' param, 'iframe_class' param, 'iframe_id' param to EE1 version --- ee1/pi.antenna.php | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/ee1/pi.antenna.php b/ee1/pi.antenna.php index e346884..9608dea 100644 --- a/ee1/pi.antenna.php +++ b/ee1/pi.antenna.php @@ -85,7 +85,8 @@ public function __construct() $vimeo_title = ($TMPL->fetch_param('vimeo_title') == "false") ? "&title=false" : ""; $vimeo_autoplay = ($TMPL->fetch_param('vimeo_autoplay') == "true") ? "&autoplay=true" : ""; $vimeo_portrait = ($TMPL->fetch_param('vimeo_portrait') == "false") ? "&portrait=0" : ""; - + $vimeo_color = ($TMPL->fetch_param('vimeo_color') != FALSE) ? "&color=".$TMPL->fetch_param('vimeo_color') : ""; + // If it's not YouTube, Vimeo, or Wistia, bail if (strpos($video_url, "youtube.com/") !== FALSE) { $url = "http://www.youtube.com/oembed?format=json&iframe=1&url="; @@ -99,7 +100,7 @@ public function __construct() return; } - $url .= urlencode($video_url) . $max_width . $max_height . $wmode_param . $vimeo_byline . $vimeo_title . $vimeo_autoplay . $vimeo_portrait; + $url .= urlencode($video_url) . $max_width . $max_height . $wmode_param . $vimeo_byline . $vimeo_title . $vimeo_autoplay . $vimeo_portrait . $vimeo_color; // checking if url has been cached $cached_url = $this->_check_cache($url); @@ -146,6 +147,21 @@ public function __construct() } + if(($TMPL->fetch_param('iframe_class') != FALSE || + $TMPL->fetch_param('iframe_id') != FALSE) && + strpos($video_info->html, "fetch_param('iframe_class') != FALSE) + { + $video_info->html = str_replace('html); + } + if($TMPL->fetch_param('iframe_id') != FALSE) + { + $video_info->html = str_replace('html); + } + } + + //Handle a single tag if ($mode == "single") { From b7ed13fcacf57e6db9e040ed70bc95d8391f11b0 Mon Sep 17 00:00:00 2001 From: Derek Hogue Date: Wed, 14 Sep 2011 08:53:47 -0500 Subject: [PATCH 3/6] Updated REDME with new parameter info. --- README.md | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 7a954b5..6b9f7a3 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ For ExpressionEngine 2 installation, the directory /antenna should be placed in Usage ------- - {exp:antenna url='{the_youtube_or_vimeo_url}' max_width="232" max_height="323" wmode="transparent|opaque|window"} + {exp:antenna url='{the_youtube_or_vimeo_url}' max_width="232" max_height="323" wmode="transparent|opaque|window" iframe_class="class_name" iframe_id="id_name"} {embed_code} {video_title} {video_author} @@ -28,17 +28,20 @@ Usage {/exp:antenna} -Set the max\_width and/or max\_height for whatever size your website requires. The video will be resized to be within those dimensions, and will stay at the correct proportions. +Set the `max_width` and/or `max_height` for whatever size your website requires. The video will be resized to be within those dimensions, and will stay at the correct proportions. -The optional wmode parameter can be used if you're experiencing issues positioning HTML content in front of the embedded media. It accepts values of transparent, opaque and window. +The optional `wmode` parameter can be used if you're experiencing issues positioning HTML content in front of the embedded media. It accepts values of transparent, opaque and window. + +The `iframe_class` and `iframe_id` parameters will apply a class and/or id to your embed container if an iframe is returned. If used as a single tag, it returns the HTML embed/object code for the video. If used as a pair, you get access to the 5 variables above and can use them in conditionals. -If you're using Vimeo, you get access to three more parameters: +If you're using Vimeo, you get access to four more parameters: - vimeo_byline='true/false' -- Shows the byline on the video. Defaults to true. - vimeo_title='true/false' -- Shows the title on the video. Defaults to true. - vimeo_autoplay='true/false' -- Automatically start playback of the video. Defaults to false. +- vimeo_color="888888" -- A hexadecimal color code to be used as the Vimeo control accent color **NOTE** For this to work with all urls please ensure that in Weblog/Channel -> Preferences, you have 'Automatically turn URLs and email addresses into links?' set to 'No'. From 5791b9e76d9c2a14dd513eae44c7a5f6585681cc Mon Sep 17 00:00:00 2001 From: Derek Hogue Date: Wed, 14 Sep 2011 08:57:25 -0500 Subject: [PATCH 4/6] Updated README. --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 6b9f7a3..a1e8ba3 100644 --- a/README.md +++ b/README.md @@ -41,6 +41,7 @@ If you're using Vimeo, you get access to four more parameters: - vimeo_byline='true/false' -- Shows the byline on the video. Defaults to true. - vimeo_title='true/false' -- Shows the title on the video. Defaults to true. - vimeo_autoplay='true/false' -- Automatically start playback of the video. Defaults to false. +- vimeo_portrait='true/false' -- Whether or not to display the video creator's avatar in the video poster frame. Defaults to false. - vimeo_color="888888" -- A hexadecimal color code to be used as the Vimeo control accent color **NOTE** For this to work with all urls please ensure that in Weblog/Channel -> Preferences, you have 'Automatically turn URLs and email addresses into links?' set to 'No'. From 96776fc66d42d635477d48f1233e8110fba2eafe Mon Sep 17 00:00:00 2001 From: Derek Hogue Date: Wed, 14 Sep 2011 08:58:38 -0500 Subject: [PATCH 5/6] Updated README --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a1e8ba3..030ad66 100644 --- a/README.md +++ b/README.md @@ -41,8 +41,8 @@ If you're using Vimeo, you get access to four more parameters: - vimeo_byline='true/false' -- Shows the byline on the video. Defaults to true. - vimeo_title='true/false' -- Shows the title on the video. Defaults to true. - vimeo_autoplay='true/false' -- Automatically start playback of the video. Defaults to false. -- vimeo_portrait='true/false' -- Whether or not to display the video creator's avatar in the video poster frame. Defaults to false. -- vimeo_color="888888" -- A hexadecimal color code to be used as the Vimeo control accent color +- vimeo_portrait='true/false' -- Whether or not to display the video creator's avatar in the video poster frame. Defaults to true. +- vimeo_color="888888" -- A hexadecimal color code to be used as the Vimeo control accent color. **NOTE** For this to work with all urls please ensure that in Weblog/Channel -> Preferences, you have 'Automatically turn URLs and email addresses into links?' set to 'No'. From f993c3d5d94f98926985d60adb72ae70decefe46 Mon Sep 17 00:00:00 2001 From: Derek Hogue Date: Wed, 14 Sep 2011 09:01:18 -0500 Subject: [PATCH 6/6] Aaaand another README update --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 030ad66..46741aa 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ The `iframe_class` and `iframe_id` parameters will apply a class and/or id to yo If used as a single tag, it returns the HTML embed/object code for the video. If used as a pair, you get access to the 5 variables above and can use them in conditionals. -If you're using Vimeo, you get access to four more parameters: +If you're using Vimeo, you get access to five more parameters: - vimeo_byline='true/false' -- Shows the byline on the video. Defaults to true. - vimeo_title='true/false' -- Shows the title on the video. Defaults to true.