airesvsg / acf-youtubepicker

Search and select videos on YouTube without leaving the page.
https://wordpress.org/plugins/acf-youtube-picker
50 stars 7 forks source link

Incorrect thumbnails information is provided by plugin #13

Open FlyingDR opened 8 years ago

FlyingDR commented 8 years ago

At this moment list of thumbnails provided by plugin is hardcoded in a terms of both list of images and their sizes. It is absolutely unacceptable since it leads to incorrect information in a case if actually available list of thumbnails is either different or have different sizes. Here are example of YouTube API output for two videos:

v1 It can be seen that there is no "maximum" thumbnail is available at all, but plugin tells application that it is available - it leads to broken image on site.

v2 It can be seen that "maximum" (actually "maxres") thumbnail have different image size and, moreover, different aspect ratio (16:9 instead of 4:3). It leads to incorrect appearance of video thumbnail on site.

It is even more strange that information about thumbnails is hardcoded in plugin while plugin itself is able to work with YouTube API to retrieve information about video.