protected function parseEntry($entry) {
     $video = new YouTubeVideoObject();
     $video->setURL($entry['player']['default']);
     $video->setMobileURL($entry['content']['1']);
     $video->setTitle($entry['title']);
     $video->setDescription($entry['description']);
     $video->setDuration($entry['duration']);
     $video->setID($entry['id']);
     $video->setImage($entry['thumbnail']['sqDefault']);
     $video->setStillFrameImage($entry['thumbnail']['hqDefault']);
     
     if (isset($entry['tags'])) {
         $video->setTags($entry['tags']);
     }
     $video->setAuthor($entry['uploader']);
     $published = new DateTime($entry['uploaded']);
     $video->setPublished($published);
     return $video;
 }
Exemplo n.º 2
0
 protected function parseEntry($entry)
 {
     if (isset($entry['video']['id'])) {
         $entry = array_merge($entry, $entry['video']);
     }
     $video = new YouTubeVideoObject();
     $video->setURL($entry['player']['default']);
     if (isset($entry['content'][6])) {
         $video->setStreamingURL($entry['content'][6]);
     }
     if ($aspectRatio = Kurogo::arrayVal($entry, 'aspectRatio')) {
         if ($aspectRatio == 'widescreen') {
             $video->setAspectRatio(16 / 9);
         }
     }
     $video->setMobileURL($entry['content']['1']);
     $video->setTitle($entry['title']);
     $video->setDescription(strip_tags($entry['description']));
     $video->setDuration($entry['duration']);
     $video->setID($entry['id']);
     if (IS_SECURE) {
         $video->setImage(str_replace('http://', 'https://', $entry['thumbnail']['sqDefault']));
         $video->setStillFrameImage(str_replace('http://', 'https://', $entry['thumbnail']['hqDefault']));
     } else {
         $video->setImage($entry['thumbnail']['sqDefault']);
         $video->setStillFrameImage($entry['thumbnail']['hqDefault']);
     }
     if (isset($entry['tags'])) {
         $video->setTags($entry['tags']);
     }
     $video->setAuthor($entry['uploader']);
     $published = new DateTime($entry['uploaded']);
     $video->setPublished($published);
     return $video;
 }