Adding Odeo Mp3 format

master
vbracco 2008-02-16 19:35:58 +00:00
parent 5443919c6f
commit efa1b44dca
3 changed files with 18 additions and 1 deletions

View File

@ -3,7 +3,7 @@
<label for="url">MP3 URL</label>
<input class="txt" type="text" name="url" id="url" value="{editUrl}" size="80" />
<div style="color: rgb(136, 136, 136); margin-bottom: 5px; font-size: 11px; font-weight: bold;">
This is the MP3 file URL or a GoEar URL.<br>
This is the MP3 file URL or a GoEar URL or Odeo URL.<br>
<span style="font-size: 10px; font-weight: normal;">(ie. http://www.goear.com/listen.php?v=c0a2c85)</span>
</div>
</div>

View File

@ -50,6 +50,8 @@ if(!defined('entry') || !entry) die('Not a valid page');
}
} elseif (isGoEar($remoteFileName)) {
return true;
} elseif (isOdeo($remoteFileName)) {
return true;
} else {
return false;
}
@ -69,6 +71,19 @@ if(!defined('entry') || !entry) die('Not a valid page');
return false;
}
function isOdeo($songUrl){
if (beginsWith($songUrl, "http://odeo.com/audio/") || beginsWith($songUrl, "http://www.odeo.com/audio/"))
return true;
else
return false;
}
function getOdeoCode($songUrl) {
$params = explode("audio/", $songUrl);
$params2 = explode("/",$params[1]);
return $params2[0];
}
function isImageFile($photoUrl) {
if (endsWith($photoUrl, ".jpg")) { return true; }
elseif (endsWith($photoUrl, ".gif")) { return true; }

View File

@ -181,6 +181,8 @@ class gelato extends Conexion_Mysql {
return "\t\t\t<object type=\"application/x-shockwave-flash\" data=\"" . $playerUrl . "\" width=\"290\" height=\"24\"><param name=\"movie\" value=\"" . $playerUrl . "\" /><param name=\"quality\" value=\"high\" /><param name=\"menu\" value=\"false\" /><param name=\"wmode\" value=\"transparent\" /></object>\n";
} elseif (isGoEar($url)) {
return "\t\t\t<object type=\"application/x-shockwave-flash\" data=\"http://www.goear.com/files/localplayer.swf\" width=\"366\" height=\"75\"><param name=\"movie\" value=\"http://www.goear.com/files/localautoplayer.swf\" /><param name=\"quality\" value=\"high\" /><param name=\"FlashVars\" value=\"file=".getGoEarCode($url)."\" /></object>\n";
} elseif (isOdeo($url)) {
return "\t\t\t<object type=\"application/x-shockwave-flash\" data=\"http://media.odeo.com/flash/odeo_player.swf?v=3\" width=\"366\" height=\"75\"><param name=\"quality\" value=\"high\" /><param name=\"FlashVars\" value=\"type=audio&id=".getOdeoCode($url)."\" /><param name=\"wmode\" value=\"transparent\" /></object></object>\n";
} else {
return "This URL is not an MP3 file.";
}