Example #1
0
 /**
  * Exctract single trailer from tmdb response.
  * 
  * @return string
  */
 private function trailers()
 {
     if (isset($this->raw['videos']['results']) && is_array($this->raw['videos']['results'])) {
         foreach ($this->raw['videos']['results'] as $video) {
             if (strtolower($video['type']) === 'trailer' && strtolower($video['site']) === 'youtube') {
                 return $this->youtube . $video['key'];
             }
         }
     }
     return $this->scraper->getTrailer($this->getTitle(), $this->getReleaseDate());
 }
Example #2
0
 /**
  * Exctract single trailer from tmdb response.
  * 
  * @return string
  */
 private function trailers()
 {
     if (isset($this->raw['trailers']['youtube'][0]['source'])) {
         return $this->youtube . $this->raw['trailers']['youtube'][0]['source'];
     } else {
         return $this->scraper->getTrailer($this->getTitle(), $this->getReleaseDate());
     }
 }