added MTV Video support
parent
b3b04187fb
commit
5d47c990b2
|
|
@ -140,7 +140,13 @@ if(!defined('entry') || !entry) die('Not a valid page');
|
||||||
else
|
else
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getYoutubeVideoUrl($videoUrl) {
|
||||||
|
$params = explode("?v=", $videoUrl);
|
||||||
|
$params2 = explode("&",$params[1]);
|
||||||
|
return $params2[0];
|
||||||
|
}
|
||||||
|
|
||||||
function isYahooVideo($videoUrl){
|
function isYahooVideo($videoUrl){
|
||||||
if (beginsWith($videoUrl, "http://video.yahoo.com/watch/") || beginsWith($videoUrl, "http://www.video.yahoo.com/watch/"))
|
if (beginsWith($videoUrl, "http://video.yahoo.com/watch/") || beginsWith($videoUrl, "http://www.video.yahoo.com/watch/"))
|
||||||
return true;
|
return true;
|
||||||
|
|
@ -155,11 +161,6 @@ if(!defined('entry') || !entry) die('Not a valid page');
|
||||||
$values[1] = $params2[1];
|
$values[1] = $params2[1];
|
||||||
return $values;
|
return $values;
|
||||||
}
|
}
|
||||||
function getYoutubeVideoUrl($videoUrl) {
|
|
||||||
$params = explode("?v=", $videoUrl);
|
|
||||||
$params2 = explode("&",$params[1]);
|
|
||||||
return $params2[0];
|
|
||||||
}
|
|
||||||
|
|
||||||
function isGoogleVideoUrl($videoUrl){
|
function isGoogleVideoUrl($videoUrl){
|
||||||
if (beginsWith($videoUrl, "http://video.google.com/videoplay?")){
|
if (beginsWith($videoUrl, "http://video.google.com/videoplay?")){
|
||||||
|
|
@ -174,6 +175,20 @@ if(!defined('entry') || !entry) die('Not a valid page');
|
||||||
$params2 = explode("&",$params[1]);
|
$params2 = explode("&",$params[1]);
|
||||||
return $params2[0];
|
return $params2[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function isMTVVideoUrl($videoUrl){
|
||||||
|
if (beginsWith($videoUrl, "http://www.mtvmusic.com/video/?id=") || beginsWith($videoUrl, "http://mtvmusic.com/video/?id=")){
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function getMTVVideoCode($videoUrl){
|
||||||
|
$params = explode("?id=", $videoUrl);
|
||||||
|
$params2 = explode("&",$params[1]);
|
||||||
|
return $params2[0];
|
||||||
|
}
|
||||||
|
|
||||||
function isDailymotionVideo($videoUrl) {
|
function isDailymotionVideo($videoUrl) {
|
||||||
if (beginsWith($videoUrl, "http://www.dailymotion.com/video/") || beginsWith($videoUrl, "http://dailymotion.com/video/"))
|
if (beginsWith($videoUrl, "http://www.dailymotion.com/video/") || beginsWith($videoUrl, "http://dailymotion.com/video/"))
|
||||||
|
|
@ -209,6 +224,7 @@ if(!defined('entry') || !entry) die('Not a valid page');
|
||||||
elseif (isYahooVideo($url)) { return true; }
|
elseif (isYahooVideo($url)) { return true; }
|
||||||
elseif (isSlideSharePresentation($url)) { return true; }
|
elseif (isSlideSharePresentation($url)) { return true; }
|
||||||
elseif (isGoogleVideoUrl($url)) { return true; }
|
elseif (isGoogleVideoUrl($url)) { return true; }
|
||||||
|
elseif (isMTVVideoUrl($url)) { return true; }
|
||||||
else { return false; }
|
else { return false; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -176,8 +176,11 @@ class gelato extends Conexion_Mysql {
|
||||||
} elseif (isGoogleVideoUrl($url)) {
|
} elseif (isGoogleVideoUrl($url)) {
|
||||||
$id_video = getGoogleVideoCode($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\" /><param name=\"wmode\" value=\"transparent\" /></object>\n";
|
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\" /><param name=\"wmode\" value=\"transparent\" /></object>\n";
|
||||||
|
} elseif (isMTVVideoUrl($url)) {
|
||||||
|
$id_video = getMTVVideoCode($url);
|
||||||
|
return "\t\t\t<object type=\"application/x-shockwave-flash\" style=\"width:500px;height:393px\" data=\"http://media.mtvnservices.com/mgid:uma:video:mtvmusic.com:".$id_video."\"><param name=\"movie\" value=\"http://media.mtvnservices.com/mgid:uma:video:mtvmusic.com:".$id_video."\" /><param name=\"allowFullScreen\" value=\"true\" /><param name=\"allowScriptAccess\" value=\"never\" /><param name=\"wmode\" value=\"transparent\" /></object>\n";
|
||||||
} else {
|
} else {
|
||||||
return "This URL is not a supported video (YouTube, Google Video, Vimeo, DailyMotion, Yahoo Video or SlideShare)";
|
return "This URL is not a supported video (YouTube, Google Video, Vimeo, DailyMotion, Yahoo Video, MTV or SlideShare)";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function getMp3Player($url) {
|
function getMp3Player($url) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue