Skip to content
This repository was archived by the owner on Jul 19, 2024. It is now read-only.
Open
Show file tree
Hide file tree
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
17 changes: 17 additions & 0 deletions ee1/pi.antenna.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,24 @@ public function __construct()

// If it's not YouTube or Vimeo, bail
if (strpos($video_url, "youtube.com/") !== FALSE) {

$url = "http://www.youtube.com/oembed?format=json&url=";

// If it's youtube and from a gdata feed, let's put it in the
// format that oembed likes. - Change by Jesse Bunch
if (strpos($video_url, "gdata.youtube.com") !== FALSE) {

$arrMatches = array();
preg_match('/videos\/([A-Za-z0-9\-\_]+)\/?$/', $video_url, $arrMatches);

if (!empty($arrMatches[1])) {
$video_url = sprintf('http://youtube.com/watch?v=%s', $arrMatches[1]);
}

unset($arrMatches);

}

} else if (strpos($video_url, "vimeo.com/") !== FALSE) {
$url = "http://vimeo.com/api/oembed.json?url=";
} else if (strpos($video_url, "wistia.com/") !== FALSE) {
Expand Down
17 changes: 17 additions & 0 deletions ee2/antenna/pi.antenna.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,24 @@ public function Antenna()

// If it's not YouTube or Vimeo, bail
if (strpos($video_url, "youtube.com/") !== FALSE) {

$url = "http://www.youtube.com/oembed?format=json&url=";

// If it's youtube and from a gdata feed, let's put it in the
// format that oembed likes. - Change by Jesse Bunch
if (strpos($video_url, "gdata.youtube.com") !== FALSE) {

$arrMatches = array();
preg_match('/videos\/([A-Za-z0-9\-\_]+)\/?$/', $video_url, $arrMatches);

if (!empty($arrMatches[1])) {
$video_url = sprintf('http://youtube.com/watch?v=%s', $arrMatches[1]);
}

unset($arrMatches);

}

} else if (strpos($video_url, "vimeo.com/") !== FALSE) {
$url = "http://vimeo.com/api/oembed.json?url=";
} else if (strpos($video_url, "wistia.com/") !== FALSE) {
Expand Down