Support » Plugin: Video Thumbnails » [Plugin: Video Thumbnails] Youtube Thumbnail Has Black Bars

Viewing 8 replies - 1 through 8 (of 8 total)
  • …..And it looks like the plugin is grabbing the 4:3 thumbnail rather than the 16:9 thumbnail.

    If I change this line of code in the plugin:
    $youtube_thumbnail = 'http://img.youtube.com/vi/' . $matches[1] . '/0.jpg';

    to:

    $youtube_thumbnail = 'http://img.youtube.com/vi/' . $matches[1] . '/maxresdefault.jpg';

    it fixes the problem but uses a HUGE image file. Is there any other way to maintain 16×9?

    Just discovered that this only kind of works….. some of the videos don’t have this maxresdefault.jpg image….. what to do, what to do?

    One final thought…. would it be possible to alter the plugin so that if the maxresdefault.jpg does not exist then downgrade to the 0.jpg image file? I’m not sure how to write that php though….

    Plugin Author Sutherland Boswell

    (@sutherlandboswell)

    Yeah, this is something mentioned in the FAQ because YouTube has seemed to slack on changing their thumbnail format. The maxresdefault.jpg must be a new addition, but I think there could be a check for it like you suggested, thanks for the discovery!

    As a side note, even if you look at YouTube.com’s source you can see that they’re just clipping the 4:3 images to 16:9. This is basically what I do to all thumbnails on my sites.

    Dumb youtube…. those lazies…

    Thanks for getting back to me…. and if you feel so inclined to writ a little check code for the maxredefault.jpg that’d be nifty!

    Plugin Author Sutherland Boswell

    (@sutherlandboswell)

    Haven’t tested it yet, but the code for this is now waiting in version 2.0.

    I tried to fix that by using on wp_get_image_editor(); and resizing and cropping the image, but to be honest I’m just botching around and try alot of stuff but just getting errors.
    Nice to hear you already added code for this to the beta of 2.0 is there any way I could be beta-tester?

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘[Plugin: Video Thumbnails] Youtube Thumbnail Has Black Bars’ is closed to new replies.