public static function getVideoData($videoid, $customimage, $customtitle, $customdescription, $thumbnailcssstyle) { //blank array $blankArray = array('videosource' => 'youtube', 'videoid' => $videoid, 'imageurl' => '', 'title' => '', 'description' => '', 'publisheddate' => '', 'duration' => 0, 'rating_average' => 0, 'rating_max' => 0, 'rating_min' => 0, 'rating_numRaters' => 0, 'statistics_favoriteCount' => 0, 'statistics_viewCount' => 0, 'keywords' => '', 'likes' => 0, 'dislikes' => '', 'commentcount' => '', 'channel_username' => '', 'channel_title' => '', 'channel_subscribers' => 0, 'channel_subscribed' => 0, 'channel_location' => '', 'channel_commentcount' => 0, 'channel_viewcount' => 0, 'channel_videocount' => 0, 'channel_description' => ''); $answer = VideoSource_YouTube::getYouTubeVideoData($videoid, $blankArray); if ($answer != '') { $blankArray['title'] = '***Video not found***'; $blankArray['description'] = $answer; return $blankArray; } if ($customtitle != '') { $blankArray['title'] = $customtitle; } if ($customdescription != '') { $blankArray['description'] = $customdescription; } if ($customimage != '' and strpos($customimage, '#') === false) { $blankArray['imageurl'] = $customimage; } else { if ($blankArray['imageurl'] == '') { $blankArray['imageurl'] = VideoSource_YouTube::getYouTubeImageURL($videoid, $thumbnailcssstyle); } } return $blankArray; }
public static function getVideoData($videoid, $customimage, $customtitle, $customdescription, $thumbnailcssstyle, $getinfomethod) { //onBehalfOfContentOwner //blank array $blankArray = array('videosource' => 'youtube', 'videoid' => $videoid, 'imageurl' => '', 'title' => '', 'description' => '', 'publisheddate' => '', 'duration' => 0, 'rating_average' => 0, 'rating_max' => 0, 'rating_min' => 0, 'rating_numRaters' => 0, 'statistics_favoriteCount' => 0, 'statistics_viewCount' => 0, 'keywords' => '', 'likes' => 0, 'dislikes' => '', 'commentcount' => '', 'channel_username' => '', 'channel_title' => '', 'channel_subscribers' => 0, 'channel_subscribed' => 0, 'channel_location' => '', 'channel_commentcount' => 0, 'channel_viewcount' => 0, 'channel_videocount' => 0, 'channel_description' => ''); $api_key = YouTubeGalleryMisc::getSettingValue('youtube_api_key'); if ($api_key != '') { $answer = VideoSource_YouTube::getYouTubeVideoData_API_v3($videoid, $blankArray, $getinfomethod, $api_key); } else { $answer = VideoSource_YouTube::getYouTubeVideoData_API_v2($videoid, $blankArray, $getinfomethod); } if ($answer != '') { $blankArray['title'] = '***Video not found*** (' . YouTubeGalleryMisc::html2txt($answer) . ')'; $blankArray['description'] = YouTubeGalleryMisc::html2txt($answer); return $blankArray; } if ($customtitle != '') { $blankArray['title'] = $customtitle; } if ($customdescription != '') { $blankArray['description'] = $customdescription; } if ($customimage != '' and strpos($customimage, '#') === false) { $blankArray['imageurl'] = $customimage; } else { if ($blankArray['imageurl'] == '') { $blankArray['imageurl'] = VideoSource_YouTube::getYouTubeImageURL($videoid, $thumbnailcssstyle); } } return $blankArray; }