DailyMotion support(patch by Michel Benard)
parent
080503eaf6
commit
5f2003dc36
|
|
@ -126,11 +126,25 @@ if(!defined('entry') || !entry) die('Not a valid page');
|
||||||
$params = explode("?v=", $videoUrl);
|
$params = explode("?v=", $videoUrl);
|
||||||
$params2 = explode("&",$params[1]);
|
$params2 = explode("&",$params[1]);
|
||||||
return $params2[0];
|
return $params2[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function isDailymotionVideo($videoUrl) {
|
||||||
|
if (beginsWith($videoUrl, "http://www.dailymotion.com/video/") || beginsWith($videoUrl, "http://dailymotion.com/video/"))
|
||||||
|
return true;
|
||||||
|
else
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
function getDailymotionVideoUrl($videoUrl) {
|
||||||
|
$params = explode("video/", $videoUrl);
|
||||||
|
$params2 = explode("_",$params[1]);
|
||||||
|
return $params2[0];
|
||||||
|
}
|
||||||
|
|
||||||
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; }
|
||||||
else { return false; }
|
else { return false; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -165,9 +165,13 @@ class gelato extends Conexion_Mysql {
|
||||||
return "\t\t\t<object type=\"application/x-shockwave-flash\" style=\"width:500px;height:393px\" data=\"http://www.youtube.com/v/".$id_video."\"><param name=\"movie\" value=\"http://www.youtube.com/v/".$id_video."\" /></object>\n";
|
return "\t\t\t<object type=\"application/x-shockwave-flash\" style=\"width:500px;height:393px\" data=\"http://www.youtube.com/v/".$id_video."\"><param name=\"movie\" value=\"http://www.youtube.com/v/".$id_video."\" /></object>\n";
|
||||||
} elseif (isVimeoVideo($url)) {
|
} elseif (isVimeoVideo($url)) {
|
||||||
$id_video = getVimeoVideoUrl($url);
|
$id_video = getVimeoVideoUrl($url);
|
||||||
return "\t\t\t<object type=\"application/x-shockwave-flash\" style=\"width:500px;height:393px\" data=\"http://www.vimeo.com/moogaloop.swf?clip_id=".$id_video."\"><param name=\"movie\" value=\"http://www.vimeo.com/moogaloop.swf?clip_id=".$id_video."\" /></object>\n";
|
return "\t\t\t<object type=\"application/x-shockwave-flash\" style=\"width:500px;height:393px\" data=\"http://www.vimeo.com/moogaloop.swf?clip_id=".$id_video."\"><param name=\"movie\" value=\"http://www.vimeo.com/moogaloop.swf?clip_id=".$id_video."\" /></object>\n";}
|
||||||
|
elseif (isDailymotionVideo($url)) {
|
||||||
|
$id_video = getDailymotionVideoUrl($url);
|
||||||
|
return "\t\t\t<object type=\"application/x-shockwave-flash\" style=\"width:500px;height:393px\" data=\"http://www.dailymotion.com/swf/".$id_video."\"><param name=\"movie\" value=\"http://www.dailymotion.com/swf/".$id_video."\" /></object>\n";
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
return "This URL is not a supported video (YouTube or Vimeo)";
|
return "This URL is not a supported video (YouTube, Vimeo or DailyMotion)";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue