tylerpearson / lazyYT

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

lazyYT-video-loaded class prevents movie container from multiple usage #28

Open folmert opened 9 years ago

folmert commented 9 years ago

I see no reason for adding lazYT-video-loaded class. Consider if someone wants to change movie's URL and reload youtube's iframe container. In these case the iframe cannot be loaded again because of following statement around line 100:

if (!$el.hasClass('lazyYT-video-loaded') && jQuerythumb.hasClass('lazyYT-image-loaded')) {

Removing this condition enables reloading youtube iframes in the same container:

!$el.hasClass('lazyYT-video-loaded')
Daugilas commented 9 years ago

@folmert I have moved the added class to settings. So if you edit it - it won't prevent you from re-loading and re-using movie containers.

Check the commit: https://github.com/Daugilas/lazyYT/commit/ec8fda3f1ffb507a73032d0f1464bf37533c7f43