ressio / lazy-load-xt

Lazy load XT is a jQuery plugin for images, videos and other media
http://ress.io/lazy-load-xt-jquery/
MIT License
1.36k stars 245 forks source link

Video plugin doesn't support/trigger `lazyload` event #75

Open llamerr opened 8 years ago

llamerr commented 8 years ago

I have some container with position: absolute for which I need to recalc height when video is loaded, but I don't see any code to fire load event in video plugin. I added those lines to it

...
$el.attr('poster', $el.attr(options.videoPoster));
$el.on('canplay', function(){
    $el.trigger('lazyload', $el);
});
$el.children('source,track')
...

and it works like I want now, but it doesn't use triggerEvent defined in main module so I think my code not ready for pull-request