Open nickpish opened 9 years ago
same problem .. problem with videos http://v40.zavrus.pro/ .. after first play dont works ( the best solution that I have found is to disable preloading videos and enable the launch of the video when you hover over it .. You can also link the video from the launch event of the carousel Check my site to see
@nickpish what about setting the src
of those videos to data-src
and then once slick is initialized, you set those data-src
as src
so they can then be loaded once slick is initialized... or set data-src
to src
when the item is active?
@nguyenj -- thanks for your response; would you be able to provide some direction as to how I might set the data-src to src when the video item is active via jquery? That sounds like a fantastic approach.
This approach works. You can leverage the beforeChange or afterChange Events to do something like this. Sorry I'm in a hurry, so can't write more. But this is the way to go.
@nickpish this is a very crude start, jsbin.com/kenace.
@nguyenj this is great, however the video auto play when the sites load in Firefox.. any idea?
@tonhaoln No idea, it's probably a FF bug; but to workaround that, just trigger the play method on the video and remove the autoplay attribute of the video. http://jsbin.com/kejolafeve
@nguyenj thanks for your script, almost working for me, only the first video is not auto-playing (I have only video in my carousel). But as soon as I 'slide' to the second video, it woks. Any idea how to fix that?
Here a plugin to lazyload almost everythigh. (Video Exemple) http://ressio.github.io/lazy-load-xt/demo/video-html5.htm
@onigetoc thanks, I will give it a try!
@sinyayadynya sorry for the delayed response; but this is just building upon the previous jsbin–http://jsbin.com/wukaku/1.
Note - this is a rough sketch of how it could work
I'm just curious if it's possible to lazy-load html5 video into the slider in a way similar to images, either natively or via another library perhaps? Thanks for any insight here.