Skip to content
This repository was archived by the owner on Jul 19, 2024. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion third_party/antenna/pi.antenna.php
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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}
Expand Down Expand Up @@ -412,4 +429,4 @@ public function usage()
return $buffer;
}
// END
}
}