Adding support for Google Video

master
vbracco 2008-10-26 21:27:56 +00:00
parent 1af72e38d3
commit 75a278de6c
2 changed files with 19 additions and 1 deletions

View File

@ -161,6 +161,20 @@ if(!defined('entry') || !entry) die('Not a valid page');
return $params2[0];
}
function isGoogleVideoUrl($videoUrl){
if (beginsWith($videoUrl, "http://video.google.com/videoplay?")){
return true;
} else {
return false;
}
}
function getGoogleVideoCode($videoUrl){
$params = explode("?docid=", $videoUrl);
$params2 = explode("&",$params[1]);
return $params2[0];
}
function isDailymotionVideo($videoUrl) {
if (beginsWith($videoUrl, "http://www.dailymotion.com/video/") || beginsWith($videoUrl, "http://dailymotion.com/video/"))
return true;
@ -194,6 +208,7 @@ if(!defined('entry') || !entry) die('Not a valid page');
elseif (isDailymotionVideo($url)) { return true; }
elseif (isYahooVideo($url)) { return true; }
elseif (isSlideSharePresentation($url)) { return true; }
elseif (isGoogleVideoUrl($url)) { return true; }
else { return false; }
}

View File

@ -173,8 +173,11 @@ class gelato extends Conexion_Mysql {
} 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";
} elseif (isGoogleVideoUrl($url)) {
$id_video = getGoogleVideoCode($url);
return "\t\t\t<object type=\"application/x-shockwave-flash\" style=\"width:500px;height:393px\" data=\"http://video.google.com/googleplayer.swf?docid=".$id_video."&hl=es&fs=true\"><param name=\"movie\" value=\"http://video.google.com/googleplayer.swf?docid=".$id_video."&hl=es&fs=true\" /><param name=\"allowFullScreen\" value=\"true\" /><param name=\"allowScriptAccess\" value=\"always\" /></object>\n";
} else {
return "This URL is not a supported video (YouTube, Vimeo, DailyMotion, Yahoo Video or SlideShare)";
return "This URL is not a supported video (YouTube, Google Video, Vimeo, DailyMotion, Yahoo Video or SlideShare)";
}
}
function getMp3Player($url) {