Browse Source

Support the new url format for Vimeo. The old format still working too.

vbracco 18 years ago
parent
commit
a05e8a4336
2 changed files with 6 additions and 3 deletions
  1. 5 2
      classes/functions.php
  2. 1 1
      classes/gelato.class.php

+ 5 - 2
classes/functions.php View File

120
 	}
120
 	}
121
 	
121
 	
122
 	function isVimeoVideo($videoUrl) {
122
 	function isVimeoVideo($videoUrl) {
123
-		if (beginsWith($videoUrl, "http://vimeo.com/clip:") || beginsWith($videoUrl, "http://www.vimeo.com/clip:"))
123
+		if (beginsWith($videoUrl, "http://vimeo.com/") || beginsWith($videoUrl, "http://www.vimeo.com/"))
124
 			return true;
124
 			return true;
125
 		else
125
 		else
126
 			return false;
126
 			return false;
127
 	}
127
 	}
128
 	
128
 	
129
 	function getVimeoVideoUrl($videoUrl) {
129
 	function getVimeoVideoUrl($videoUrl) {
130
-		return array_pop(explode("clip:",$videoUrl));
130
+		if(substr_count($videoUrl,"clip:")==1)
131
+			return array_pop(explode("clip:",$videoUrl));
132
+		else
133
+			return array_pop(explode("/",$videoUrl));
131
 	}
134
 	}
132
 	
135
 	
133
 	function isYoutubeVideo($videoUrl) {
136
 	function isYoutubeVideo($videoUrl) {

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

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
 		} else {
176
 		} else {
177
-			return "This URL is not a supported video (YouTube, Vimeo, DailyMotion or Yahoo Video)";
177
+			return "This URL is not a supported video (YouTube, Vimeo, DailyMotion, Yahoo Video or SlideShare)";
178
 		}		
178
 		}		
179
 	}
179
 	}
180
 	function getMp3Player($url) {
180
 	function getMp3Player($url) {