Browse Source

Added Support to SlideShare presentations

vbracco 18 years ago
parent
commit
8a07840394
2 changed files with 18 additions and 1 deletions
  1. 15 0
      classes/functions.php
  2. 3 1
      classes/gelato.class.php

+ 15 - 0
classes/functions.php View File

170
 		return $params2[0];
170
 		return $params2[0];
171
 	}
171
 	}
172
 	
172
 	
173
+	function isSlideSharePresentation($videoUrl) {
174
+		if (beginsWith($videoUrl, "[slideshare id="))
175
+			return true;
176
+		else
177
+			return false;
178
+	}
179
+	
180
+	function getSlideSharePresentationCode($videoUrl) {
181
+		$videoUrl = str_replace("[slideshare id=", "", $videoUrl);
182
+		$videoUrl = str_replace("&doc=", " ", $videoUrl);
183
+		$videoUrl = str_replace("&w=", " ", $videoUrl);
184
+		return explode(" ",$videoUrl);
185
+	}
186
+	
173
 	function isVideo($url) {
187
 	function isVideo($url) {
174
 		if (isYoutubeVideo($url)) { return true; }
188
 		if (isYoutubeVideo($url)) { return true; }
175
 		elseif (isVimeoVideo($url)) { return true; }
189
 		elseif (isVimeoVideo($url)) { return true; }
176
 		elseif (isDailymotionVideo($url)) { return true; }
190
 		elseif (isDailymotionVideo($url)) { return true; }
177
 		elseif (isYahooVideo($url)) { return true; }
191
 		elseif (isYahooVideo($url)) { return true; }
192
+		elseif (isSlideSharePresentation($url)) { return true; }
178
 		else { return false; }
193
 		else { return false; }
179
 	}
194
 	}
180
 	
195
 	

+ 3 - 1
classes/gelato.class.php View File

172
 		} elseif (isYahooVideo($url)) {
172
 		} elseif (isYahooVideo($url)) {
173
 			$id_video = getYahooVideoCode($url);
173
 			$id_video = getYahooVideoCode($url);
174
 			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&amp;id=".$id_video[1]."&amp;vid=".$id_video[0]."&amp;onsite=1&amp;site=video.yahoo.com&amp;page=792730258&amp;lang=en-US&amp;intl=us\" /></object>\n";
174
 			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&amp;id=".$id_video[1]."&amp;vid=".$id_video[0]."&amp;onsite=1&amp;site=video.yahoo.com&amp;page=792730258&amp;lang=en-US&amp;intl=us\" /></object>\n";
175
+		} elseif (isSlideSharePresentation($url)) {
176
+			$id_video = getSlideSharePresentationCode($url);
177
+			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";
175
 		} else {
178
 		} else {
176
 			return "This URL is not a supported video (YouTube, Vimeo, DailyMotion or Yahoo Video)";
179
 			return "This URL is not a supported video (YouTube, Vimeo, DailyMotion or Yahoo Video)";
177
 		}		
180
 		}		
178
 	}
181
 	}
179
-	
180
 	function getMp3Player($url) {
182
 	function getMp3Player($url) {
181
 		if (isMP3($url)) {
183
 		if (isMP3($url)) {
182
 			$playerUrl = $this->conf->urlGelato."/admin/scripts/player.swf?soundFile=".$url;
184
 			$playerUrl = $this->conf->urlGelato."/admin/scripts/player.swf?soundFile=".$url;