Added Support to SlideShare presentations

master
vbracco 2008-02-19 02:37:49 +00:00
parent b71af30441
commit 8a07840394
2 changed files with 18 additions and 1 deletions

View File

@ -170,11 +170,26 @@ if(!defined('entry') || !entry) die('Not a valid page');
return $params2[0]; return $params2[0];
} }
function isSlideSharePresentation($videoUrl) {
if (beginsWith($videoUrl, "[slideshare id="))
return true;
else
return false;
}
function getSlideSharePresentationCode($videoUrl) {
$videoUrl = str_replace("[slideshare id=", "", $videoUrl);
$videoUrl = str_replace("&doc=", " ", $videoUrl);
$videoUrl = str_replace("&w=", " ", $videoUrl);
return explode(" ",$videoUrl);
}
function isVideo($url) { function isVideo($url) {
if (isYoutubeVideo($url)) { return true; } if (isYoutubeVideo($url)) { return true; }
elseif (isVimeoVideo($url)) { return true; } elseif (isVimeoVideo($url)) { return true; }
elseif (isDailymotionVideo($url)) { return true; } elseif (isDailymotionVideo($url)) { return true; }
elseif (isYahooVideo($url)) { return true; } elseif (isYahooVideo($url)) { return true; }
elseif (isSlideSharePresentation($url)) { return true; }
else { return false; } else { return false; }
} }

View File

@ -172,11 +172,13 @@ class gelato extends Conexion_Mysql {
} elseif (isYahooVideo($url)) { } elseif (isYahooVideo($url)) {
$id_video = getYahooVideoCode($url); $id_video = getYahooVideoCode($url);
return "\t\t\t<object type=\"application/x-shockwave-flash\" style=\"width:500px;height:393px\" data=\"http://d.yimg.com/static.video.yahoo.com/yep/YV_YEP.swf\"><param name=\"quality\" value=\"high\" /><param name=\"FlashVars\" value=\"event_function=YAHOO.yv.Player.SWFInterface&amp;id=".$id_video[1]."&amp;vid=".$id_video[0]."&amp;onsite=1&amp;site=video.yahoo.com&amp;page=792730258&amp;lang=en-US&amp;intl=us\" /></object>\n"; return "\t\t\t<object type=\"application/x-shockwave-flash\" style=\"width:500px;height:393px\" data=\"http://d.yimg.com/static.video.yahoo.com/yep/YV_YEP.swf\"><param name=\"quality\" value=\"high\" /><param name=\"FlashVars\" value=\"event_function=YAHOO.yv.Player.SWFInterface&amp;id=".$id_video[1]."&amp;vid=".$id_video[0]."&amp;onsite=1&amp;site=video.yahoo.com&amp;page=792730258&amp;lang=en-US&amp;intl=us\" /></object>\n";
} elseif (isSlideSharePresentation($url)) {
$id_video = getSlideSharePresentationCode($url);
return "\t\t\t<object type=\"application/x-shockwave-flash\" style=\"width:500px;height:393px\" data=\"http://www.slideshare.net/swf/player.swf?presentationId=".$id_video[0]."&amp;doc=".$id_video[1]."&amp;inContest=0&amp;startSlide=1\"><param name=\"quality\" value=\"high\" /></object>\n";
} else { } else {
return "This URL is not a supported video (YouTube, Vimeo, DailyMotion or Yahoo Video)"; return "This URL is not a supported video (YouTube, Vimeo, DailyMotion or Yahoo Video)";
} }
} }
function getMp3Player($url) { function getMp3Player($url) {
if (isMP3($url)) { if (isMP3($url)) {
$playerUrl = $this->conf->urlGelato."/admin/scripts/player.swf?soundFile=".$url; $playerUrl = $this->conf->urlGelato."/admin/scripts/player.swf?soundFile=".$url;