|
@@ -142,7 +142,7 @@ class gelato {
|
142
|
142
|
}
|
143
|
143
|
|
144
|
144
|
function saveMP3($remoteFileName) {
|
145
|
|
- if (getMP3File($remoteFileName)) {
|
|
145
|
+ if (util::getMP3File($remoteFileName)) {
|
146
|
146
|
return true;
|
147
|
147
|
} else {
|
148
|
148
|
return false;
|
|
@@ -150,7 +150,7 @@ class gelato {
|
150
|
150
|
}
|
151
|
151
|
|
152
|
152
|
function savePhoto($remoteFileName) {
|
153
|
|
- if (getPhotoFile($remoteFileName)) {
|
|
153
|
+ if (util::getPhotoFile($remoteFileName)) {
|
154
|
154
|
return true;
|
155
|
155
|
} else {
|
156
|
156
|
return false;
|
|
@@ -158,38 +158,38 @@ class gelato {
|
158
|
158
|
}
|
159
|
159
|
|
160
|
160
|
function getVideoPlayer($url) {
|
161
|
|
- if (isYoutubeVideo($url)) {
|
162
|
|
- $id_video = getYoutubeVideoUrl($url);
|
|
161
|
+ if (util::isYoutubeVideo($url)) {
|
|
162
|
+ $id_video = util::getYoutubeVideoUrl($url);
|
163
|
163
|
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."\" /><param name=\"wmode\" value=\"transparent\" /></object>\n";
|
164
|
|
- } elseif (isVimeoVideo($url)) {
|
165
|
|
- $id_video = getVimeoVideoUrl($url);
|
|
164
|
+ } elseif (util::isVimeoVideo($url)) {
|
|
165
|
+ $id_video = util::getVimeoVideoUrl($url);
|
166
|
166
|
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."\" /><param name=\"wmode\" value=\"transparent\" /></object>\n";
|
167
|
|
- } elseif (isDailymotionVideo($url)) {
|
168
|
|
- $id_video = getDailymotionVideoUrl($url);
|
|
167
|
+ } elseif (util::isDailymotionVideo($url)) {
|
|
168
|
+ $id_video = util::getDailymotionVideoUrl($url);
|
169
|
169
|
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."\" /><param name=\"wmode\" value=\"transparent\" /></object>\n";
|
170
|
|
- } elseif (isYahooVideo($url)) {
|
171
|
|
- $id_video = getYahooVideoCode($url);
|
|
170
|
+ } elseif (util::isYahooVideo($url)) {
|
|
171
|
+ $id_video = util::getYahooVideoCode($url);
|
172
|
172
|
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&id=".$id_video[1]."&vid=".$id_video[0]."&onsite=1&site=video.yahoo.com&page=792730258&lang=en-US&intl=us\" /><param name=\"wmode\" value=\"transparent\" /></object>\n";
|
173
|
|
- } elseif (isSlideSharePresentation($url)) {
|
174
|
|
- $id_video = getSlideSharePresentationCode($url);
|
|
173
|
+ } elseif (util::isSlideSharePresentation($url)) {
|
|
174
|
+ $id_video = util::getSlideSharePresentationCode($url);
|
175
|
175
|
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]."&doc=".$id_video[1]."&inContest=0&startSlide=1\"><param name=\"quality\" value=\"high\" /><param name=\"wmode\" value=\"transparent\" /></object>\n";
|
176
|
|
- } elseif (isGoogleVideoUrl($url)) {
|
177
|
|
- $id_video = getGoogleVideoCode($url);
|
|
176
|
+ } elseif (util::isGoogleVideoUrl($url)) {
|
|
177
|
+ $id_video = util::getGoogleVideoCode($url);
|
178
|
178
|
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";
|
179
|
|
- } elseif (isMTVVideoUrl($url)) {
|
180
|
|
- $id_video = getMTVVideoCode($url);
|
|
179
|
+ } elseif (util::isMTVVideoUrl($url)) {
|
|
180
|
+ $id_video = util::getMTVVideoCode($url);
|
181
|
181
|
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";
|
182
|
182
|
} else {
|
183
|
183
|
return "This URL is not a supported video (YouTube, Google Video, Vimeo, DailyMotion, Yahoo Video, MTV or SlideShare)";
|
184
|
184
|
}
|
185
|
185
|
}
|
186
|
186
|
function getMp3Player($url) {
|
187
|
|
- if (isMP3($url)) {
|
|
187
|
+ if (util::isMP3($url)) {
|
188
|
188
|
$playerUrl = $conf->urlGelato."/admin/scripts/player.swf?soundFile=".$url;
|
189
|
189
|
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";
|
190
|
|
- } elseif (isGoEar($url)) {
|
|
190
|
+ } elseif (util::isGoEar($url)) {
|
191
|
191
|
return "\t\t\t<object type=\"application/x-shockwave-flash\" data=\"http://www.goear.com/files/external.swf\" width=\"366\" height=\"130\"><param name=\"movie\" value=\"http://www.goear.com/files/external.swf\" /><param name=\"quality\" value=\"high\" /><param name=\"FlashVars\" value=\"file=".getGoEarCode($url)."\" /><param name=\"wmode\" value=\"transparent\" /></object>\n";
|
192
|
|
- } elseif (isOdeo($url)) {
|
|
192
|
+ } elseif (util::isOdeo($url)) {
|
193
|
193
|
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>\n";
|
194
|
194
|
} else {
|
195
|
195
|
return "This URL is not an MP3 file.";
|