/** * @param \Google_Service_YouTube_Video $source * * @return \C2iS\SocialWall\YouTube\Model\SocialItem */ protected function createSocialItem($source) { $item = new SocialItem(); /** @var \Google_Service_YouTube_VideoSnippet $snippet */ $snippet = $source->getSnippet(); $item->setId($source->getId()); $item->setTitle($snippet->getTitle()); $item->setVideoId($source->getId()); $item->setPublishedAt(new \DateTime($snippet->getPublishedAt())); $item->setContent($snippet->getDescription()); $item->setUrl($this->createUrl($source->getId())); /** @var \Google_Service_YouTube_VideoStatistics $statistics */ $statistics = $source->getStatistics(); $item->setViews($statistics->getViewCount()); $item->setLikes($statistics->getLikeCount()); $item->setDislikes($statistics->getDislikeCount()); $item->setComments($statistics->getCommentCount()); $item->setFavorites($statistics->getFavoriteCount()); $item->setThumbnails($this->createThumbnailCollection($snippet->getThumbnails())); return $item; }
protected function _getFlashPlayerUrl(Google_Service_YouTube_Video $entry) { return 'https://www.youtube.com/embed/' . $entry->getId(); }