X-Git-Url: http://git.pippins.net/embedvideo/.git/?a=blobdiff_plain;f=ItemAddEmbedVideo.inc;h=544c5225cd970821b8ff23a6379f983313e97ced;hb=refs%2Ftags%2F1_1_5;hp=d598ee2c1d09dd501eff2dd03430aa8a0eaa4f07;hpb=46e1538c4e6375a1cc5b5a84c339777df1dc69a0;p=embedvideo%2F.git diff --git a/ItemAddEmbedVideo.inc b/ItemAddEmbedVideo.inc index d598ee2..544c522 100644 --- a/ItemAddEmbedVideo.inc +++ b/ItemAddEmbedVideo.inc @@ -92,7 +92,9 @@ class ItemAddEmbedVideo extends ItemAddPlugin { $watermarkAlignment = $this->getParameter($ItemAddEmbedVideo, 'watermarkAlignment', "left"); $wordwrapSummary = $this->getParameter($ItemAddEmbedVideo, 'wordwrapSummary', "0"); $wordwrapDescription = $this->getParameter($ItemAddEmbedVideo, 'wordwrapDescription', "0"); - + $allowFullScreen = $this->getParameter($ItemAddEmbedVideo, 'allowFullScreen', "false"); + $centerVideo = $this->getParameter($ItemAddEmbedVideo, 'centerVideo', "false"); + /* Print our stored/set Parameters */ if(!strcmp($debugOutput,"true")) { print "\n
"; @@ -112,6 +114,8 @@ class ItemAddEmbedVideo extends ItemAddPlugin { print "watermarkAlignment=$watermarkAlignment
\n"; print "wordwrapSummary=$wordwrapSummary
\n"; print "wordwrapDescription=$wordwrapDescription
\n"; + print "allowFullScreen=$allowFullScreen
\n"; + print "centerVideo=$centerVideo\n"; print "
\n"; } @@ -163,6 +167,9 @@ class ItemAddEmbedVideo extends ItemAddPlugin { /* vimeo */ $vimeoUrlPattern="vimeo.com"; + + /* animoto */ + $animotoUrlPattern="animoto.com"; /* Gallery2 specific paths and variables */ $urlGenerator =& $gallery->getUrlGenerator(); @@ -175,8 +182,12 @@ class ItemAddEmbedVideo extends ItemAddPlugin { $unsupported_url=0; /* Store the passed URL in a shorter local variable */ + /* Strip trailing whitespace in the url, this will cause problems later */ $url = $form['webPage']['URL']; - + if(preg_match("/(.*?)\s+/",$url,$matches)) { + $url = $matches[1]; + } + /* ***************************** * Embed a Youtube Video @@ -283,15 +294,26 @@ class ItemAddEmbedVideo extends ItemAddPlugin { $youtubeShowRelatedStr="&rel=0"; } + /* Determine if the video should show related videos or not based on the youtubeShowRelated parameter */ + $fullScreenStr=""; + $fullScreenParamStr1=""; + $fullScreenParamStr2=""; + if(!strcmp($allowFullScreen,"true")) { + $fullScreenStr="&fs=1"; + $fullScreenParamStr1=""; + $fullScreenParamStr2=" allowfullscreen=\"true\""; + } + /* Format the description to hold a reference to the embedded video */ $description = ''; $description.= ''; $description.= ''; + $description.= $fullScreenParamStr1; $description.= ''; + $description.= 'width="'.$width.'" height="'.$height.'"'.$fullScreenParamStr2.'>'; /* ********************************** @@ -331,12 +353,13 @@ class ItemAddEmbedVideo extends ItemAddPlugin { } /* Extract the thumbnail URL from the webpage contents */ - preg_match('/thumbnail: \'(http:\/\/.*?\/ThumbnailServer2.+?)\'/i', + preg_match('/\'.+?thumbnail.+?(http:\/\/.*?\/ThumbnailServer2.+?)\'/i', $contents, $matches); $thumbnail=$matches[1]; $thumbnail=preg_replace("/\\\\x26/","&",$thumbnail); $thumbnail=preg_replace("/\\\\x3d/","=",$thumbnail); - + $thumbnail=urldecode($thumbnail); + /* Determine what our width and height should be based on our useRemoteSize parameter */ if(!strcmp($useRemoteSize,"true")) { $width = $googleWidth; @@ -462,7 +485,6 @@ class ItemAddEmbedVideo extends ItemAddPlugin { ********************************** * Embed a Revver Video ********************************** - * TODO: The autoStart parameter doesn't work with the yahoo video player */ } else if(preg_match("/$revverUrlPattern/",$url)) { @@ -520,7 +542,6 @@ class ItemAddEmbedVideo extends ItemAddPlugin { ********************************** * Embed a DailyMotion Video ********************************** - * TODO: The autoStart parameter doesn't work with the yahoo video player */ } else if(preg_match("/$dailymotionUrlPattern/",$url)) { @@ -553,7 +574,7 @@ class ItemAddEmbedVideo extends ItemAddPlugin { $thumbnail=$dailymotionThumbnailUrl.$item_id; /* Format the description to hold a reference to the embedded video */ - if(preg_match('/