Exemplo n.º 1
0
 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;
 }