Beispiel #1
0
 public static function getVideoData($videoid, $customimage, $customtitle, $customdescription)
 {
     $theTitle = '';
     $Description = '';
     $theImage = '';
     $HTML_SOURCE = YouTubeGalleryMisc::getURLData('http://www.ustream.tv/recorded/' . $videoid);
     if ($HTML_SOURCE != '' and $HTML_SOURCE[0] == '<') {
         if ($customimage != '') {
             $theImage = $customimage;
         } else {
             $theImage = VideoSource_Ustream::getValueByAlmostTag($HTML_SOURCE, '<meta property="og:image" content="');
             $theImage = str_replace(',', '%2C', $theImage);
         }
         if ($customtitle == '') {
             $theTitle = VideoSource_Ustream::getValueByAlmostTag($HTML_SOURCE, '<meta property="og:title" content="');
         } else {
             $theTitle = $customtitle;
         }
         if ($customdescription == '') {
             $Description = VideoSource_Ustream::getValueByAlmostTag($HTML_SOURCE, '<meta property="og:description" content="');
         } else {
             $Description = $customdescription;
         }
         $videodata = array('videosource' => 'ustream', 'videoid' => $videoid, 'imageurl' => $theImage, 'title' => $theTitle, 'description' => $Description, 'publisheddate' => VideoSource_Ustream::getValueByAlmostTag($HTML_SOURCE, '<span data-dateformat="%F %j at %g:%i%a" data-timestamp="'), 'duration' => 0, 'rating_average' => 0, 'rating_max' => 0, 'rating_min' => 0, 'rating_numRaters' => 0, 'statistics_favoriteCount' => 0, 'statistics_viewCount' => 0, 'keywords' => '');
         return $videodata;
     } else {
         return array('videosource' => 'collegehumor', 'videoid' => $videoid, 'imageurl' => $theImage, 'title' => '***Video not found***', 'description' => $Description);
     }
 }
 public static function ShowActiveVideo(&$gallery_list, $width, $height, $videoid, &$videolist_row, &$theme_row, $videosource = '')
 {
     jimport('joomla.version');
     $version = new JVersion();
     $JoomlaVersionRelease = $version->RELEASE;
     $VideoRow = YoutubeGalleryLayoutRenderer::getVideoRowByID($videoid, $gallery_list);
     if ($theme_row->changepagetitle != 3) {
         $mainframe = JFactory::getApplication();
         $sitename = $mainframe->getCfg('sitename');
         if ($VideoRow) {
             $title = $VideoRow['title'];
         } else {
             $title = '';
         }
         //$title=YoutubeGalleryLayoutRenderer::getTitleByVideoID($videoid,$gallery_list);
         $mydoc = JFactory::getDocument();
         if ($theme_row->changepagetitle == 0) {
             $mydoc->setTitle($title . ' - ' . $sitename);
         } elseif ($theme_row->changepagetitle == 1) {
             $mydoc->setTitle($sitename . ' - ' . $title);
         } elseif ($theme_row->changepagetitle == 2) {
             $mydoc->setTitle($title);
         }
     }
     $result = '';
     if ($videoid) {
         $vpoptions = array();
         $vpoptions['width'] = $width;
         $vpoptions['height'] = $height;
         $vpoptions['videoid'] = $videoid;
         $vpoptions['autoplay'] = $theme_row->autoplay;
         $vpoptions['showinfo'] = $theme_row->showinfo;
         $vpoptions['relatedvideos'] = $theme_row->related;
         $vpoptions['repeat'] = $theme_row->repeat;
         $vpoptions['allowplaylist'] = $theme_row->allowplaylist;
         $vpoptions['border'] = $theme_row->border;
         $vpoptions['color1'] = $theme_row->color1;
         $vpoptions['color2'] = $theme_row->color2;
         $vpoptions['controls'] = $theme_row->controls;
         $vpoptions['playertype'] = $theme_row->playertype;
         $vpoptions['youtubeparams'] = $theme_row->youtubeparams;
         $vpoptions['fullscreen'] = $theme_row->fullscreen;
         $list_index = YoutubeGalleryLayoutRenderer::getListIndexByVideoID($videoid, $gallery_list);
         //----------------------------------------------------------------------------
         if ($videoid == '****youtubegallery-video-id****') {
             //Hot Switch
             if ($videosource != '') {
                 $vs = $videosource;
             } else {
                 $vs = '';
             }
             $image_link = '';
             $startsecond = '****youtubegallery-video-startsecond****';
             $endsecond = '****youtubegallery-video-endsecond****';
         } elseif ($list_index == -1) {
             $row = YoutubeGalleryLayoutRenderer::getVideoRowByID($videoid, $gallery_list, false);
             if (!$row) {
                 return '';
             }
             if ($videosource != '') {
                 $vs = $videosource;
             } else {
                 $vs = $row['videosource'];
             }
             $image_link = $row['imageurl'];
             $startsecond = $row['startsecond'];
             $endsecond = $row['endsecond'];
         } else {
             if ($videosource != '') {
                 $vs = $videosource;
             } else {
                 $vs = $gallery_list[$list_index]['videosource'];
             }
             $image_link = $gallery_list[$list_index]['imageurl'];
             $startsecond = $gallery_list[$list_index]['startsecond'];
             $endsecond = $gallery_list[$list_index]['endsecond'];
         }
         if ($theme_row->prepareheadtags == 2 or $theme_row->prepareheadtags == 3) {
             if ($image_link != '' and strpos($image_link, '#') === false) {
                 // echo '$image_link='.$image_link.'<br/>';
                 $curPageUrl = YoutubeGalleryLayoutRenderer::curPageURL();
                 $document = JFactory::getDocument();
                 $image_link_array = explode(',', $image_link);
                 if (count($image_link_array) >= 3) {
                     $imagelink = $image_link_array[3];
                 } else {
                     $imagelink = $image_link_array[0];
                 }
                 $imagelink = (strpos($imagelink, 'http://') === false and strpos($image_link, 'https://') === false ? $curPageUrl . '/' : '') . $imagelink;
                 if (isset($_SERVER["HTTPS"]) and $_SERVER["HTTPS"] == "on") {
                     $imagelink = str_replace('http://', 'https://', $imagelink);
                 }
                 $document->addCustomTag('<link rel="image_src" href="' . $imagelink . '" /><!-- active -->');
             }
             //add meta keywords
             if ($vs == 'youtube') {
                 $doc =& JFactory::getDocument();
                 $doc->setMetaData('keywords', $VideoRow['keywords']);
                 //tags
                 $doc->setMetaData('description', $VideoRow['description']);
             }
         }
         if ((int) $vpoptions['width'] == 0) {
             $width = 400;
         } else {
             $width = (int) $vpoptions['width'];
         }
         if ((int) $vpoptions['height'] == 0) {
             $height = 200;
         } else {
             $height = (int) $vpoptions['height'];
         }
         switch ($vs) {
             case 'break':
                 require_once 'break.php';
                 $result .= VideoSource_Break::renderBreakPlayer($vpoptions, $width, $height, $videolist_row, $theme_row);
                 break;
             case 'vimeo':
                 require_once 'vimeo.php';
                 $result .= VideoSource_Vimeo::renderVimeoPlayer($vpoptions, $width, $height, $videolist_row, $theme_row);
                 break;
             case 'own3dtvlive':
                 require_once 'own3dtvlive.php';
                 $result .= VideoSource_Own3DTvLive::renderOwn3DTvLivePlayer($vpoptions, $width, $height, $videolist_row, $theme_row);
                 break;
             case 'own3dtvvideo':
                 require_once 'own3dtvvideo.php';
                 $result .= VideoSource_Own3DTvVideo::renderOwn3DTvVideoPlayer($vpoptions, $width, $height, $videolist_row, $theme_row);
                 break;
             case 'youtube':
                 //if($vpoptions['autoplay']==1 and $vpoptions['repeat']==1 )
                 //{
                 $pl = YoutubeGalleryLayoutRenderer::getPlaylistIdsOnly($gallery_list, $videoid, 'youtube');
                 $shorten_pl = array();
                 $i = 0;
                 foreach ($pl as $p) {
                     $i++;
                     if ($i > 20) {
                         break;
                     }
                     $shorten_pl[] = $p;
                 }
                 $YoutubeVideoList = implode(',', $shorten_pl);
                 $full_pl = YoutubeGalleryLayoutRenderer::getPlaylistIdsOnly($gallery_list, '', 'youtube', true);
                 $shorten_full_pl = array();
                 $i = 0;
                 foreach ($full_pl as $p) {
                     $i++;
                     if ($i > 20) {
                         break;
                     }
                     $shorten_full_pl[] = $p;
                 }
                 $full_YoutubeVideoList = implode(',', $shorten_full_pl);
                 if ($vpoptions['youtubeparams'] == '') {
                     $vpoptions['youtubeparams'] = 'playlist=' . $YoutubeVideoList;
                 } else {
                     $vpoptions['youtubeparams'] .= ';playlist=' . $YoutubeVideoList;
                 }
                 if ($vpoptions['youtubeparams'] == '') {
                     $vpoptions['youtubeparams'] = 'fullplaylist=' . $full_YoutubeVideoList;
                 } else {
                     $vpoptions['youtubeparams'] .= ';fullplaylist=' . $full_YoutubeVideoList;
                 }
                 //}
                 require_once 'youtube.php';
                 $temp = VideoSource_Youtube::renderYouTubePlayer($vpoptions, $width, $height, $videolist_row, $theme_row, $startsecond, $endsecond);
                 if ($temp != '') {
                     if ($theme_row->useglass or $theme_row->logocover) {
                         //$result.='<div class="YoutubeGalleryLogoCover'.$videolist_row->id.'" style="position: relative;width:'.$width.'px;height:'.$height.'px;padding:0;">';
                         $result .= '<div class="YoutubeGalleryLogoCover' . $videolist_row->id . '" style="position: relative;width:100%;height:100%;padding:0;border:none;">';
                     }
                     $result .= $temp;
                     if ($theme_row->logocover) {
                         if ($theme_row->controls and ($theme_row->playertype == 3 or $theme_row->playertype == 4)) {
                             $bottom_px = '25';
                         } else {
                             $bottom_px = '0';
                         }
                         $result .= '<div style="position: absolute;bottom:' . $bottom_px . 'px;right:0px;margin-top:0px;margin-left:0px;">' . '<img src="' . $theme_row->logocover . '" style="margin:0px;padding:0px;display:block;border: none;" /></div>';
                     }
                     if ($theme_row->useglass) {
                         //$result.='<div style="position: absolute;background-image: url(\'components/com_youtubegallery/images/dot.png\');'
                         //.'top:0px;left:0px;width:'.$width.'px;height:'.($height-25).'px;margin-top:0px;margin-left:0px;padding:0px;"></div>';
                         $result .= '<div class="YoutubeGalleryGlassCover"></div>';
                     }
                     if ($theme_row->useglass or $theme_row->logocover) {
                         $result .= '</div>';
                     }
                 }
                 break;
             case 'google':
                 require_once 'google.php';
                 $result .= VideoSource_Google::renderGooglePlayer($vpoptions, $width, $height, $videolist_row, $theme_row);
                 break;
             case 'yahoo':
                 require_once 'yahoo.php';
                 $vpoptions['thumbnail'] = YoutubeGalleryLayoutRenderer::getThumbnailByID($videoid, $gallery_list);
                 $result .= VideoSource_Yahoo::renderYahooPlayer($vpoptions, $width, $height, $videolist_row, $theme_row);
                 break;
             case 'collegehumor':
                 require_once 'collegehumor.php';
                 $vpoptions['thumbnail'] = YoutubeGalleryLayoutRenderer::getThumbnailByID($videoid, $gallery_list);
                 $result .= VideoSource_CollegeHumor::renderCollegeHumorPlayer($vpoptions, $width, $height, $videolist_row, $theme_row);
                 break;
             case 'dailymotion':
                 require_once 'dailymotion.php';
                 $vpoptions['thumbnail'] = YoutubeGalleryLayoutRenderer::getThumbnailByID($videoid, $gallery_list);
                 $result .= VideoSource_DailyMotion::renderDailyMotionPlayer($vpoptions, $width, $height, $videolist_row, $theme_row);
                 break;
             case 'presentme':
                 require_once 'presentme.php';
                 $vpoptions['thumbnail'] = YoutubeGalleryLayoutRenderer::getThumbnailByID($videoid, $gallery_list);
                 $result .= VideoSource_PresentMe::renderPresentMePlayer($vpoptions, $width, $height, $videolist_row, $theme_row);
                 break;
             case 'ustream':
                 require_once 'ustream.php';
                 $vpoptions['thumbnail'] = YoutubeGalleryLayoutRenderer::getThumbnailByID($videoid, $gallery_list);
                 $result .= VideoSource_Ustream::renderUstreamPlayer($vpoptions, $width, $height, $videolist_row, $theme_row);
                 break;
             case 'ustreamlive':
                 require_once 'ustreamlive.php';
                 $vpoptions['thumbnail'] = YoutubeGalleryLayoutRenderer::getThumbnailByID($videoid, $gallery_list);
                 $result .= VideoSource_UstreamLive::renderUstreamLivePlayer($vpoptions, $width, $height, $videolist_row, $theme_row);
                 break;
             case 'soundcloud':
                 require_once 'soundcloud.php';
                 $vpoptions['thumbnail'] = YoutubeGalleryLayoutRenderer::getThumbnailByID($videoid, $gallery_list);
                 $result .= VideoSource_SoundCloud::renderPlayer($vpoptions, $width, $height, $videolist_row, $theme_row);
                 break;
             case '.flv':
                 if ($list_index != -1) {
                     //Not Hot Switch
                     $vpoptions['thumbnail'] = $gallery_list[$list_index]['imageurl'];
                     //YoutubeGalleryLayoutRenderer::getThumbnailByID($videoid,$gallery_list);;
                     $videolink = $gallery_list[$list_index]['link'];
                 } else {
                     $videolink = '****youtubegallery-video-link****';
                 }
                 //For Hot Switch
                 require_once 'flv.php';
                 $result .= VideoSource_FLV::renderFLVPlayer($vpoptions, $width, $height, $videolist_row, $theme_row, $videolink);
                 break;
         }
     }
     $imageurl = '';
     $isHot = false;
     if ($videoid == '****youtubegallery-video-id****') {
         $isHot = true;
         $videoid_d = 'hot' . $videolist_row->id;
         $imageurl = '****youtubegallery-video-customimage****';
     } else {
         $videoid_d = $videoid;
         if ($VideoRow) {
             $imageurl = $VideoRow['custom_imageurl'];
         }
     }
     if ($imageurl != '' and $theme_row->rel == '' and strpos($imageurl, '#') === false and strpos($imageurl, '_small') === false) {
         //Specific preview image for your YouTube video
         //The idea of Jarrett Gucci (Modified: play button added)
         $result = ($isHot ? '***code_begin***' : '') . '<div onclick="ygimage' . $videoid_d . '=document.getElementById(\'ygvideoplayer' . $videoid_d . '\');ygimage' . $videoid_d . '.style.display=\'block\';this.style.display=\'none\'"' . ' style="position:relative;width:' . $width . 'px;height:' . $height . 'px;padding:0;">' . '<img src="' . $imageurl . '" style="cursor:pointer;width:' . $width . 'px;height:' . $height . 'px;padding:0;" />' . '<div style="position:absolute;width:100px;height:100px;left:' . floor($width / 2 - 50) . 'px;top:' . floor($height / 2 - 50) . 'px;">' . '<img src="components/com_youtubegallery/images/play.png" style="border:none!important;cursor:pointer;width:100px;height:100px;padding:0;" />' . '</div>' . '</div>' . '<div id="ygvideoplayer' . $videoid_d . '" style="display:none">' . ($isHot ? '***code_end***' : '') . $result . ($isHot ? '***code_begin***' : '') . '</div>' . ($isHot ? '***code_end***' : '');
     }
     if ($videoid != '****youtubegallery-video-id****') {
         $result = str_replace('****youtubegallery-video-id****', $videoid, $result);
     } else {
         $result = str_replace('\'', '*quote*', $result);
     }
     $result = '<div id="YoutubeGallerySecondaryContainer' . $videolist_row->id . '" style="width:' . $width . 'px;height:' . $height . 'px;">' . $result . '</div>';
     return $result;
 }
Beispiel #3
0
 function GrabVideoData($listitem, $vsn, $videoid_optional = '')
 {
     $query_video_host = true;
     //Return Video Data Array separated with commma
     //extract title if it's needed for navigation (thumbnail) or for active video.
     $videoitem = array();
     $customtitle = '';
     $customdescription = '';
     $customimage = '';
     $startsecond = 0;
     $endsecond = 0;
     if (is_array($listitem)) {
         $theLink = trim($listitem[0]);
         if (isset($listitem[1])) {
             $customtitle = $listitem[1];
         }
         if (isset($listitem[2])) {
             $customdescription = $listitem[2];
         }
         if (isset($listitem[3])) {
             $customimage = $listitem[3];
         }
         if (isset($listitem[5])) {
             $startsecond = $listitem[5];
         }
         if (isset($listitem[6])) {
             $endsecond = $listitem[6];
         }
     } else {
         $theLink = $listitem;
     }
     if ($vsn == 'youtube' and !(strpos($theLink, '/embed/') === false)) {
         //Convert Embed links to Address bar version
         $theLink = str_replace('www.youtube.com/embed/', 'youtu.be/', $theLink);
         $theLink = str_replace('youtube.com/embed/', 'youtu.be/', $theLink);
     }
     //echo '$vsn2='.$vsn.'<br/>';
     switch ($vsn) {
         case 'break':
             require_once 'break.php';
             $HTML_SOURCE = '';
             $videoid = VideoSource_Break::extractBreakID($theLink, $HTML_SOURCE);
             if ($videoid != '') {
                 if ($query_video_host) {
                     $videoitem = VideoSource_Break::getVideoData($videoid, $customimage, $customtitle, $customdescription, $HTML_SOURCE);
                     $videoitem['link'] = $theLink;
                 } else {
                     $videoitem = array('videosource' => 'break', 'videoid' => $videoid, 'imageurl' => $customimage, 'title' => $customtitle, 'description' => $customdescription, 'link' => $theLink);
                 }
             }
             break;
         case 'vimeo':
             require_once 'vimeo.php';
             if ($videoid_optional == '') {
                 $videoid = VideoSource_Vimeo::extractVimeoID($theLink);
             } else {
                 $videoid = $videoid_optional;
             }
             //echo '$videoid111='.$videoid;
             if ($videoid != '') {
                 if ($query_video_host) {
                     $videoitem = VideoSource_Vimeo::getVideoData($videoid, $customimage, $customtitle, $customdescription);
                     $videoitem['link'] = $theLink;
                 } else {
                     $videoitem = array('videosource' => 'vimeo', 'videoid' => $videoid, 'imageurl' => $customimage, 'title' => $customtitle, 'description' => $customdescription, 'link' => $theLink);
                 }
             }
             break;
         case 'own3dtvlive':
             require_once 'own3dtvlive.php';
             if ($videoid_optional == '') {
                 $videoid = VideoSource_Own3DTvLive::extractOwn3DTvLiveID($theLink);
             } else {
                 $videoid = $videoid_optional;
             }
             if ($videoid != '') {
                 if ($query_video_host) {
                     $videoitem = VideoSource_Own3DTvLive::getVideoData($videoid, $customimage, $customtitle, $customdescription);
                     $videoitem['link'] = $theLink;
                 } else {
                     $videoitem = array('videosource' => 'own3dtvlive', 'videoid' => $videoid, 'imageurl' => $customimage, 'title' => $customtitle, 'description' => $customdescription, 'link' => $theLink);
                 }
             }
             break;
         case 'own3dtvvideo':
             require_once 'own3dtvvideo.php';
             if ($videoid_optional == '') {
                 $videoid = VideoSource_Own3DTvVideo::extractOwn3DTvVideoID($theLink);
             } else {
                 $videoid = $videoid_optional;
             }
             if ($videoid != '') {
                 if ($query_video_host) {
                     $videoitem = VideoSource_Own3DTvVideo::getVideoData($videoid, $customimage, $customtitle, $customdescription);
                     $videoitem['link'] = $theLink;
                 } else {
                     $videoitem = array('videosource' => 'own3dtvvideo', 'videoid' => $videoid, 'imageurl' => $customimage, 'title' => $customtitle, 'description' => $customdescription, 'link' => $theLink);
                 }
             }
             break;
         case 'youtube':
             require_once 'youtube.php';
             if ($videoid_optional == '') {
                 $videoid = VideoSource_Youtube::extractYouTubeID($theLink);
             } else {
                 $videoid = $videoid_optional;
             }
             if ($videoid != '') {
                 if ($query_video_host) {
                     if (isset($this->theme_row->thumbnailstyle)) {
                         $theme_row_thumbnailstyle = $this->theme_row->thumbnailstyle;
                     } else {
                         $theme_row_thumbnailstyle = '';
                     }
                     $videoitem = VideoSource_Youtube::getVideoData($videoid, $customimage, $customtitle, $customdescription, $theme_row_thumbnailstyle);
                     $videoitem['link'] = $theLink;
                 } else {
                     if (strpos($customimage, '#') === false) {
                         $customimage_ = $customimage;
                     } else {
                         $customimage_ = '';
                     }
                     $videoitem = array('videosource' => 'youtube', 'videoid' => $videoid, 'imageurl' => $customimage_, 'title' => $customtitle, 'description' => $customdescription, 'link' => $theLink);
                 }
             }
             break;
         case 'google':
             require_once 'google.php';
             if ($videoid_optional == '') {
                 $videoid = VideoSource_Google::extractGoogleID($theLink);
             } else {
                 $videoid = $videoid_optional;
             }
             if ($videoid != '') {
                 if ($query_video_host) {
                     $videoitem = VideoSource_Google::getVideoData($videoid, $customimage, $customtitle, $customdescription);
                     $videoitem['link'] = $theLink;
                 } else {
                     $videoitem = array('videosource' => 'google', 'videoid' => $videoid, 'imageurl' => $customimage, 'title' => $customtitle, 'description' => $customdescription, 'link' => $theLink);
                 }
             }
             break;
         case 'yahoo':
             require_once 'yahoo.php';
             if ($videoid_optional == '') {
                 $videoid = VideoSource_Yahoo::extractYahooID($theLink);
             } else {
                 $videoid = $videoid_optional;
             }
             if ($videoid != '') {
                 if ($query_video_host) {
                     $videoitem = VideoSource_Yahoo::getVideoData($videoid, $customimage, $customtitle, $customdescription, $theLink);
                     $videoitem['link'] = $theLink;
                 } else {
                     $videoitem = array('videosource' => 'yahoo', 'videoid' => $videoid, 'imageurl' => $customimage, 'title' => $customtitle, 'description' => $customdescription, 'link' => $theLink);
                 }
             }
             break;
         case 'collegehumor':
             require_once 'collegehumor.php';
             if ($videoid_optional == '') {
                 $videoid = VideoSource_CollegeHumor::extractCollegeHumorID($theLink);
             } else {
                 $videoid = $videoid_optional;
             }
             if ($videoid != '') {
                 if ($query_video_host) {
                     $videoitem = VideoSource_CollegeHumor::getVideoData($videoid, $customimage, $customtitle, $customdescription);
                     $videoitem['link'] = $theLink;
                 } else {
                     $videoitem = array('videosource' => 'collegehumor', 'videoid' => $videoid, 'imageurl' => $customimage, 'title' => $customtitle, 'description' => $customdescription, 'link' => $theLink);
                 }
             }
             break;
         case 'dailymotion':
             require_once 'dailymotion.php';
             if ($videoid_optional == '') {
                 $videoid = VideoSource_DailyMotion::extractDailyMotionID($theLink);
             } else {
                 $videoid = $videoid_optional;
             }
             if ($videoid != '') {
                 if ($query_video_host) {
                     $videoitem = VideoSource_DailyMotion::getVideoData($videoid, $customimage, $customtitle, $customdescription);
                     $videoitem['link'] = $theLink;
                 } else {
                     $videoitem = array('videosource' => 'dailymotion', 'videoid' => $videoid, 'imageurl' => $customimage, 'title' => $customtitle, 'description' => $customdescription, 'link' => $theLink);
                 }
             }
             break;
         case 'presentme':
             require_once 'presentme.php';
             if ($videoid_optional == '') {
                 $videoid = VideoSource_PresentMe::extractPresentMeID($theLink);
             } else {
                 $videoid = $videoid_optional;
             }
             if ($videoid != '') {
                 if ($query_video_host) {
                     $videoitem = VideoSource_PresentMe::getVideoData($videoid, $customimage, $customtitle, $customdescription);
                     $videoitem['link'] = $theLink;
                 } else {
                     $videoitem = array('videosource' => 'presentme', 'videoid' => $videoid, 'imageurl' => $customimage, 'title' => $customtitle, 'description' => $customdescription, 'link' => $theLink);
                 }
             }
             break;
         case 'ustream':
             require_once 'ustream.php';
             if ($videoid_optional == '') {
                 $videoid = VideoSource_Ustream::extractUstreamID($theLink);
             } else {
                 $videoid = $videoid_optional;
             }
             if ($videoid != '') {
                 if ($query_video_host) {
                     $videoitem = VideoSource_Ustream::getVideoData($videoid, $customimage, $customtitle, $customdescription);
                     $videoitem['link'] = $theLink;
                 } else {
                     $videoitem = array('videosource' => 'ustream', 'videoid' => $videoid, 'imageurl' => $customimage, 'title' => $customtitle, 'description' => $customdescription, 'link' => $theLink);
                 }
             }
             break;
         case '.flv':
             require_once 'flv.php';
             if ($videoid_optional == '') {
                 $videoid = VideoSource_FLV::extractFLVID($theLink);
             } else {
                 $videoid = $videoid_optional;
             }
             if ($videoid != '') {
                 if ($query_video_host) {
                     $videoitem = VideoSource_FLV::getVideoData($videoid, $theLink, $customimage, $customtitle, $customdescription);
                     $videoitem['link'] = $theLink;
                 } else {
                     $videoitem = array('videosource' => '.flv', 'videoid' => $videoid, 'imageurl' => $customimage, 'title' => $customtitle, 'description' => $customdescription, 'link' => $theLink);
                 }
             }
             //print_r($videoitem);
             //die;
             break;
     }
     //switch($vsn)
     $videoitem['custom_title'] = $customtitle;
     $videoitem['custom_description'] = $customdescription;
     $videoitem['custom_imageurl'] = $customimage;
     $videoitem['startsecond'] = $startsecond;
     $videoitem['endsecond'] = $endsecond;
     return $videoitem;
 }