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

I was doing something like this before, and using jsonp which I understand is no longer supported $('#poster').html('<h2>Here is your poster </h2><img id="thePoster" src=' + json.results[0].posters[0].image.url+ '/> ')

8 پاسخ (در صفحه 1 از 1)

Jump to last post

Hi Tony007,

JSONP is still supported, what makes you think it's not?

I thought that's what I read in the API, at any rate my code doesn't work like it did in v2, any ideas on displaying poster images? I see it's call poster_path now and something called backdrop_path where as before there as a actual poster object to work with

Hi Tony007,

Take a look at the configuration method to understand how to build URLs. You'll also want to make sure to append the callback= param or make sure to set dataType to 'jsonp'in jQuery to use JSONP.

You can see a little jQuery test I have here of a working JSONP example: http://dev.travisbell.com/play/tmdb.html

Cheers.

Thanks Travis, I appreciate the help

I'm not seeing how to use the configuration object. I'm also following a tutorial I did a couple of years ago and it's using the $getJSON method.Does that make a difference?

$.getJSON('http://api.themoviedb.org/3/search/movie?api_key=apiKey&query=' + $('#input').val() + '&callback=?', function(json) { $('#poster').html('<h2>Here is your poster</h2>;<img src=' + json[0].posters[0].image_url + '/>') }

That was how I did it using the old API ( building the path ) how do I build the path with the new API, this is were it's failing for me

Hi Tony,

As described in the documentation:

To build an image URL, you will need 3 pieces of data. The base_url, size and file_path. Simply combine them all and you will have a fully qualified URL. Here’s an example URL: http://image.tmdb.org/t/p/w500/8uO0gUM8aNqYLs1OsTBQiXu0fEv.jpg

You'll see that the configuration method returns the base_url and valid sizes for each image type. You can see that information combined with a (for example) poster_path to build a vlid image URL.

I'll look into that, I got it to work though, check it out http://anthonybrown.github.io/movie-poster/?

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

Global

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

در صفحات مدیا

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

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

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

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

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

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

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

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

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

در صفحات بحث

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

تنظیمات

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

ورود