tylerpearson / lazyYT

A jQuery plugin to lazy load those dang Youtube iframe videos.
Other
208 stars 86 forks source link

If videos are uploaded in 720p or higher, you can use maxresdefault.jpg #12

Closed themorgantown closed 9 years ago

themorgantown commented 9 years ago

Line 32 can changed to:

        'background': 'url(//img.youtube.com/vi/' + id + '/maxresdefault.jpg) center center no-repeat',

If all your youtube videos are uploaded at 720p or higher. This cleared up thumbnails up for me.

Thanks Tyler!

Daugilas commented 9 years ago

I have solved this issue with this commit: https://github.com/Daugilas/lazyYT/commit/0f086094246fa99031d0ca7a3c88172d8f6c03e9 And my pull-request is pending.

tylerpearson commented 9 years ago

updated with https://github.com/tylerpearson/lazyYT/pull/13!

tyrann0us commented 9 years ago

I get a 404 on the maxresdefault.jpg with a video I try to embed (YR3_Qmn5El8).

What about adding a test to see if the requested thumbnail returnes a 404? If that's is the case you would use a different thumbail size. Thanks!

jaskaran27 commented 9 years ago

I agree with @tyrann0us. I am getting 404s for a couple of video thumbnails as well. If the HD image is not available, it should fallback to the next available thumbnail image. That would be an ideal solution.

Thanks for the plugin regardless. The speed improvement is remarkable!