X-Git-Url: http://git.pippins.net/embedvideo/.git/static/%7Bg-%3Eurl%20arg1=?a=blobdiff_plain;f=ItemAddEmbedVideo.inc;h=6fd4281c91b406e317207b9b5c02480cb30b19d5;hb=f5edb7ed0c0dd0fd870950f838af0ed965c82238;hp=ac7b1cf05dde317810575fc2f0820a8e02d77503;hpb=bbe9d512174553b9b410742bb82c69ffa67911f5;p=embedvideo%2F.git
diff --git a/ItemAddEmbedVideo.inc b/ItemAddEmbedVideo.inc
index ac7b1cf..6fd4281 100644
--- a/ItemAddEmbedVideo.inc
+++ b/ItemAddEmbedVideo.inc
@@ -71,6 +71,7 @@ class ItemAddEmbedVideo extends ItemAddPlugin {
global $width, $height, $externalFlvPlayer, $externalFlvPlayerVars;
global $flvThumbnail, $useRemoteSize, $autoStart;
global $watermarkVideos, $watermarkImage, $watermarkAlignment;
+ global $unsupported_url;
/* Find out what value our parameters should have by looking to see if they
* are defined in our overrides section or default section. If they are not
@@ -161,7 +162,7 @@ class ItemAddEmbedVideo extends ItemAddPlugin {
$myspaceThumbnailUrl="http://mediaservices.myspace.com/services/rss.ashx?type=video&videoID=";
/* vimeo */
- $vimeoUrlPattern="www.vimeo.com";
+ $vimeoUrlPattern="vimeo.com";
/* Gallery2 specific paths and variables */
$urlGenerator =& $gallery->getUrlGenerator();
@@ -169,6 +170,9 @@ class ItemAddEmbedVideo extends ItemAddPlugin {
$gallery2_flv_thumbnail = "modules/embedvideo/images/G2video_thumbnail.jpg";
$gallery2_video_watermark = "modules/embedvideo/images/G2video_watermark1.png";
$gallery2_flv_player = "modules/flashvideo/lib/G2flv.swf";
+
+ /* Unsupported URLs */
+ $unsupported_url=0;
/* Store the passed URL in a shorter local variable */
$url = $form['webPage']['URL'];
@@ -187,6 +191,8 @@ class ItemAddEmbedVideo extends ItemAddPlugin {
$extra_params = $matches[2];
} else if (preg_match("/watch\?v=(.*)/",$url,$matches)) {
$video_id = $matches[1];
+ } else if (preg_match("/v\/(.*)/",$url,$matches)) {
+ $video_id = $matches[1];
} else {
return array(GalleryCoreApi::error(ERROR_BAD_PARAMETER,__FILE__,__LINE__,
"Unable to extract video id from url: $url"),null,null);
@@ -194,7 +200,7 @@ class ItemAddEmbedVideo extends ItemAddPlugin {
/* If extra params were given, handle them here */
if(strcmp($extra_params,"")) {
- /* Handle the HD format information */
+ /* Handle the high quality format information */
if(preg_match("/fmt=(\d+)/",$extra_params,$matches)) {
$extra_params="&ap=%2526fmt%3D".$matches[1];
}
@@ -325,10 +331,11 @@ class ItemAddEmbedVideo extends ItemAddPlugin {
}
/* Extract the thumbnail URL from the webpage contents */
- preg_match('/';
$description.= '';
}
-
+
+ /*
+ **********************************
+ * Embed a generic