Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trailer in TV Show #70

Open
ChrisTERiS opened this issue Oct 25, 2020 · 3 comments
Open

Trailer in TV Show #70

ChrisTERiS opened this issue Oct 25, 2020 · 3 comments

Comments

@ChrisTERiS
Copy link

Have copied the code below from Movie class to TVShow class and then I tried to display it on the page with $tvShow->getTrailer(); but nothing appear there. I know that this will (if) display only the filename, but is ok for me.

`
/**
* Get the TVShow's trailers
*
* @return array
*/

public function getTrailers() {
	return $this->_data['trailers'];
}

/** 
 * 	Get the TVShow's trailer
 *
 * 	@return string | null
 */
public function getTrailer() {
	$trailers = $this->getTrailers();

	if (!array_key_exists('youtube', $trailers)) {
		return null;
	}

	if (count($trailers['youtube']) === 0) {
		return null;
	}

	return $trailers['youtube'][0]['source'];
}

`

Maybe it needs to add somewhere append_to_response=video or something else? If yes, where is that declaration?

Thank you
Chris

bogdanfinn pushed a commit to bogdanfinn/tmdb_v3-PHP-API- that referenced this issue Oct 25, 2020
@bogdanfinn
Copy link
Collaborator

@ChrisTERiS
For TVShows you probably have more than one Trailer. Sometimes one for each season.

Added a getTrailers() to TVShows and extended the examples on my fork. Will create a merge request soon.

@ChrisTERiS
Copy link
Author

ChrisTERiS commented Oct 25, 2020

@ChrisTERiS
For TVShows you probably have more than one Trailer. Sometimes one for each season.

Added a getTrailers() to TVShows and extended the examples on my fork. Will create a merge request soon.

Yes, you're right. Don't remember if I read it at TMDb site but now except the "Trailer", have video types "Teaser" and "Behind the scene".

With my experience, I believe that the "Teaser" type is the good one if someone want to show just one video. Teaser is the global video for a TV Show while Trailers can be one per episode.

Thank you for your help. I'll wait the improved version.

@ChrisTERiS
Copy link
Author

@ChrisTERiS
For TVShows you probably have more than one Trailer. Sometimes one for each season.

Added a getTrailers() to TVShows and extended the examples on my fork. Will create a merge request soon.

Just seen in your link before that you had already post the changes. I did all the changes, except the one in configuration/all.php as video already exist as parameter at the end of the line.

Now the link to trailer works, but as I want to display it inline the page, I'll use $trailer['key'] for it.

Thank you so much for your help. Really appreciated !!

bogdanfinn pushed a commit to bogdanfinn/tmdb_v3-PHP-API- that referenced this issue Oct 29, 2020
pixelead0 added a commit that referenced this issue Nov 3, 2020
refs #70: implemented getTrailers() for TVShows and added example;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants