The Movie Database Support

I need to display the trailers of a movie. how to get the quicktime or youtube videos path in Json response

2 replies (on page 1 of 1)

Jump to last post

I personally use the PHP wrapper(glamorous/TMDb-PHP-API) to help me with this:

$tmdb_V3 = new TMDb('APIKEY');
$movietrailer = $tmdb_V3->getMovieTrailers($movieId);    
// Get the YouTube ID  
$trailer = $movietrailer['youtube'][0]['source'];   
/* //If you want to view all the data from Json un-comment the below three lines.
echo "<pre>";
print_r($movietrailer);
echo "</pre>";
//*/

To then display the video you can use the below code:

echo"<object width=\"425\" height=\"350\" data=\"http://www.youtube.com/v/$trailer\" type=\"application/x-shockwave-flash\">
<param name=\"src\" value=\"http://www.youtube.com/v/$trailer\" /></object>";

If you read the document page your find example there for your choose of langue :

http://docs.themoviedb.apiary.io/#get-%2F3%2Fmovie%2F%7Bid%7D%2Ftrailers

Dale :D

Hi,

if you go onto youtube and search for embedded youtube player you will get everything you need

you need to remove specific things form the url, I use the flash player on my windows form app to do this

Can't find a movie or TV show? Login to create it.

Global

s focus the search bar
p open profile menu
esc close an open window
? open keyboard shortcut window

On media pages

b go back (or to parent when applicable)
e go to edit page

On TV season pages

(right arrow) go to next season
(left arrow) go to previous season

On TV episode pages

(right arrow) go to next episode
(left arrow) go to previous episode

On all image pages

a open add image window

On all edit pages

t open translation selector
ctrl+ s submit form

On discussion pages

n create new discussion
w toggle watching status
p toggle public/private
c toggle close/open
a open activity
r reply to discussion
l go to last reply
ctrl+ enter submit your message
(right arrow) next page
(left arrow) previous page

Settings

Want to rate or add this item to a list?

Login