Closed akaleeroy closed 10 years ago
I've noticed this becoming an issue in big presentations as well. Ideally there is some way on improving this in the core of reveal.js.
Idea: On load, reveal.js could move the "src" attribute of media elements to "data-src". Then as you navigate the source attribute is changed back only for the nearest few slides.
[edited the issue title]
That would be most elegant.
Lazy loading support has been added and works with image, video and audio elements. This feature requires changes to presentation markup, more info in the readme: https://github.com/hakimel/reveal.js/blob/dev/README.md#lazy-loading
Sadly, I don't expect to ever take advantage of this as the requirement to change the markup seems onerous. Why not just enable it globally?
Unfortunately that's the only way to do it. If the presentation markup hits the browser with normal src attributes it's too late, the browser will already have started loading them. Otherwise they could have been replaced entirely via JS.
I love you man! iframe
support too, plz!
LOL nevermind... , iframe[data-src],
@akaleeroy Thanks, forgot about iframes but that's been added now.
Does this still exist? It doesn't seem to be working and the docs are gone
@contra It's only available in the dev branch so far. There's still some work getting that branch to 3.0 before it will be merged into master, hopefully I can get back on that soon.
@hakimel Is this available in 3.1 release or Still in dev branch ?
Is there ever a reason not to use lazy-loading?
Wondering whether pandoc should output <img data-src
instead of <img src
when generating reveal.js slides from markdown, see https://github.com/jgm/pandoc/issues/2283 Some feedback would be great before we make the change...
@mb21 see @hakimel above:
Unfortunately that's the only way to do it. If the presentation markup hits the browser with normal src attributes it's too late, the browser will already have started loading them. Otherwise they could have been replaced entirely via JS.
Or are you asking if reveal.js has run into bugs/problems with lazy loading? I've been using it since it became available without problem.
Yes, I'm asking whether there are any use-cases where it's preferable to not use lazy-loading when making a reveal.js slideshows...
Hi There, the lazy loading is cool, but what about following problem. Let's say we have 10.000-20.000 pages in the presentation, which we need to optimize. The lazy loading only will not help. We need to on moving right or left add the actual HTML of the upcoming 4-5 sections and sections before to the dom and remove tem as user move back and forth. Any implementation or plugin for this sofar?
I'm using videos with lazy loading, but at the beginning all then are loaded in memory, is it OK? I supposed that lazy loading means to have only play asset in the memory.
is lazy loading also working with regular html code? lets assume having some very heavy animation, or heavy script tags that need to be executed when the slides shows, is it possible to use lazy loading without iframe in such case ?
and if iframes are required, can regular HTML code be embedded within them ?
I'd like to suggest this enhancement. For presentations heavily laden with images and videos, integrate a lazy load plugin. Maybe lazy-load-xt?