From bed12ecfcbf99be1fd3e463b57de3727afa1826c Mon Sep 17 00:00:00 2001 From: Mike Stecker Date: Thu, 31 Oct 2013 14:42:56 -0700 Subject: [PATCH] added new variable to find out video source --- third_party/antenna/pi.antenna.php | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/third_party/antenna/pi.antenna.php b/third_party/antenna/pi.antenna.php index 72e8dff..f929b72 100644 --- a/third_party/antenna/pi.antenna.php +++ b/third_party/antenna/pi.antenna.php @@ -43,6 +43,7 @@ public function Antenna() $plugin_vars = array( "title" => "video_title", + "source" => "video_source", // added by Mike Stecker: get the name of the website "html" => "embed_code", "author_name" => "video_author", "author_url" => "video_author_url", @@ -168,6 +169,21 @@ public function Antenna() if (!empty($matches[1])) $video_info->html = str_replace($matches[1], $matches[1] . '&rel=' . $youtube_rel, $video_info->html); } + // added by Mike Stecker: get the name of the website + if(strpos($video_url, "youtube.com/") !== FALSE OR strpos($video_url, "youtu.be/") !== FALSE) { + $video_info->source = "youtube"; + } + else if (strpos($video_url, "vimeo.com/") !== FALSE) { + $video_info->source = "vimeo"; + } + else if (strpos($video_url, "wistia.com/") !== FALSE) + { + $video_info->source = "wistia"; + } + else if (strpos($video_url, "viddler.com/") !== FALSE) + { + $video_info->source = "viddler"; + } // actually setting thumbnails at a reasonably consistent size, as well as getting higher-res images if(strpos($video_url, "youtube.com/") !== FALSE OR strpos($video_url, "youtu.be/") !== FALSE) { @@ -379,6 +395,7 @@ public function usage() {exp:antenna url='{the_youtube_or_vimeo_url}' max_width="232" max_height="323" cache_minutes="120" wmode="transparent|opaque|window"} {embed_code} {video_title} + {video_source} {!-- returns: vimeo, youtube, wistia or viddler --} {video_author} {video_author_url} {video_thumbnail} @@ -412,4 +429,4 @@ public function usage() return $buffer; } // END -} +} \ No newline at end of file