Browse Source

Adding support for Google Video

vbracco 16 years ago
parent
commit
75a278de6c
2 changed files with 19 additions and 1 deletions
  1. 15 0
      classes/functions.php
  2. 4 1
      classes/gelato.class.php

+ 15 - 0
classes/functions.php View File

161
 		return $params2[0];
161
 		return $params2[0];
162
 	}
162
 	}
163
 	
163
 	
164
+	function isGoogleVideoUrl($videoUrl){
165
+		if (beginsWith($videoUrl, "http://video.google.com/videoplay?")){
166
+			return true;
167
+		} else {
168
+			return false;
169
+		}
170
+	}
171
+	
172
+	function getGoogleVideoCode($videoUrl){
173
+		$params = explode("?docid=", $videoUrl);
174
+		$params2 = explode("&",$params[1]);
175
+		return $params2[0];
176
+	}
177
+	
164
 	function isDailymotionVideo($videoUrl) {
178
 	function isDailymotionVideo($videoUrl) {
165
 		if (beginsWith($videoUrl, "http://www.dailymotion.com/video/") || beginsWith($videoUrl, "http://dailymotion.com/video/"))
179
 		if (beginsWith($videoUrl, "http://www.dailymotion.com/video/") || beginsWith($videoUrl, "http://dailymotion.com/video/"))
166
 			return true;
180
 			return true;
194
 		elseif (isDailymotionVideo($url)) { return true; }
208
 		elseif (isDailymotionVideo($url)) { return true; }
195
 		elseif (isYahooVideo($url)) { return true; }
209
 		elseif (isYahooVideo($url)) { return true; }
196
 		elseif (isSlideSharePresentation($url)) { return true; }
210
 		elseif (isSlideSharePresentation($url)) { return true; }
211
+		elseif (isGoogleVideoUrl($url)) { return true; }
197
 		else { return false; }
212
 		else { return false; }
198
 	}
213
 	}
199
 	
214
 	

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

173
 		} elseif (isSlideSharePresentation($url)) {
173
 		} elseif (isSlideSharePresentation($url)) {
174
 			$id_video = getSlideSharePresentationCode($url);
174
 			$id_video = getSlideSharePresentationCode($url);
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]."&amp;doc=".$id_video[1]."&amp;inContest=0&amp;startSlide=1\"><param name=\"quality\" value=\"high\" /></object>\n";
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]."&amp;doc=".$id_video[1]."&amp;inContest=0&amp;startSlide=1\"><param name=\"quality\" value=\"high\" /></object>\n";
176
+		} elseif (isGoogleVideoUrl($url)) {
177
+			$id_video = getGoogleVideoCode($url);
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\" /></object>\n";
176
 		} else {
179
 		} else {
177
-			return "This URL is not a supported video (YouTube, Vimeo, DailyMotion, Yahoo Video or SlideShare)";
180
+			return "This URL is not a supported video (YouTube, Google Video, Vimeo, DailyMotion, Yahoo Video or SlideShare)";
178
 		}		
181
 		}		
179
 	}
182
 	}
180
 	function getMp3Player($url) {
183
 	function getMp3Player($url) {