پشتیبانی پایگاه داده‌ فیلم

Hi how to display trailer from particular movie say for eg: from upcoming movies if selected one movie, where I need to display video trailer. How to get that link.

Thanks.

69 پاسخ (در صفحه 2 از 5)

Jump to last post

صفحه قبلیصفحه بعدیصفحه آخر

@travisbell said:

@Flixmag Do you have a question?

I am trying to show a trailer from your api response. Could you kindly expound your point...with some code. What I want is to click on a link and show that trailer...I have picked and displayed all data... now I want for someone to view a trailer if available.

I can't provide you with any code examples, all I can say is how you can call the data, which was explained in my other post. If you're having trouble with your local code (how to parse JSON, use the YouTube API or SDK, etc...), I would suggest posting on something like Stack Overflow.

Okay thanks will figure it out once i mess around.

Thanks man! did it big time!

Hi Travis, Is there a way to get the link for each movie that is in the json? (full video movie) such as www.example.com/movie.mp4. Or the only way is to get just the trailer from youtube? Thank you for your great support.

Hi @ArtanE,

We only have links to the YouTube IDs, nothing more.

Expanding on @lanre point, is there a way to get the splash/preview image that is used for videos (the image that is displayed with a play button over it)? I would like to display a picture that has the play button on it, to let people know that click on the image will take them to the actual video

r = requests.get('https://api.themoviedb.org/3/movie/' + tmdb_id, params={ 'api_key': TMDB_API_KEY, 'append_to_response': 'videos' })

@travisbell is this the format that is required?

@arung The format to get a list of video IDs for a given media object using append to response is as follows, yes:

https://api.themoviedb.org/3/movie/550?api_key=###&append_to_response=videos

@travisbell so what is the format for most popular movies videos or top rated movies videos when i used append to response the given result videos is false

Hi, All I use this link, but its does`t contain any video url or video id that use to play video...

https://api.themoviedb.org/3/movie/284053?api_key=###&apprend_to_response=videos

@travisbell said:

Since we link to YouTube, it's as simple as taking the key value and appending it to a youtube.com address like so:

http://api.themoviedb.org/3/movie/550/videos?api_key=###

Has the YouTube key of SUXWAEX2jlg, so:

https://www.youtube.com/watch?v=SUXWAEX2jlg

Cheers.

This doesn't seem to work for all movies. For example, the movie with ID=11111 returns this:

{"results"=>[{"id"=>"533ec66dc3a3685448001df8", "iso_639_1"=>"en", "iso_3166_1"=>"US", "key"=>"593", "name"=>"Trailer 1", "site"=>"YouTube", "size"=>360, "type"=>"Trailer"}]}

But there is no such video on YouTube as:

https://youtube.com/watch?v=593

What gives?

That's not a valid YouTube id, so whatever movie you got that from has a bad id. I believe YouTube keys are 11 characters.

@travisbell said:

That's not a valid YouTube id, so whatever movie you got that from has a bad id. I believe YouTube keys are 11 characters.

Indeed, I did notice that it was not a valid YouTube ID.

My question was more along the lines of - when do I know I can trust the data I'm getting from the API?

In this case, you can check for keys to be 11 characters client side and show/hide data that way. I have an open ticket to do some validation when the data gets added.

At a bigger scale, the short answer is you can't. TMDb is 100% crowd sourced. Users add all sorts of strange data. Our moderators do their best to lock, validate and clean up data but they're all volunteer and have lives and jobs of their own. We are simply thankful for any time they can afford to help.

فیلم و نمایش تلویزیونی را نمی‌توانید پیدا کنید؟ به سیستم وارد شوید تا آن را ایجاد کنید.

Global

s تمرکز بر منوی جستجو
p منوی پروفایل باز شود
esc بستن پنجره باز
? پنجره میانبرهای صفحه‌کلید باز شود

در صفحات مدیا

b بازگشت به عقب (یا در صورت لزوم به منشا)
e برو به صفحه ویرایش

در صفحات فصل تلویزیونی

(فلش سمت راست) برو به فصل بعد
(پیکان سمت چپ) برو به نشست قبلی

در صفحات قسمت تلویزیونی

(فلش سمت راست) برو به قسمت بعد
(پیکان سمت چپ) برو به قسمت قبلی

در تمام صفحات تصویر

a پنجره افزودن تصویر باز شود

در تمام صفحات ویرایش

t انتخابگر ترجمه باز شود
ctrl+ s ثبت از

در صفحات بحث

n ایجاد بحث جدید
w تغییر وضعیت وضعیت تماشا
p تغییر وضعیت عمومی/خصوصی
c تغییر وضعیت بسته/باز
a گشایش صفحه فعالیت
r پاسخ به بحث
l برو به آخرین پاسخ
ctrl+ enter پیام خود را ثبت کنید
(فلش سمت راست) صفحه بعد
(پیکان سمت چپ) صفحه قبلی

تنظیمات

آیا می‌خواهید به این مورد امتیاز دهید یا به فهرست اضافه کنید؟

ورود