- Issue created by @Grevil
- 🇩🇪Germany Anybody Porta Westfalica
FYI: If someone needs this, please provide a MR to review or sponsor someone to do so. We're not planning to implement this unless we need it. Thanks.
- 🇩🇪Germany Anybody Porta Westfalica
Perhaps the HTML5
lazy
attribute is enough. Its not possible to use HTML5 native lazy loading, because the module just passes a list of images through 'data-image-list-x'.
The library supports lazy loading with third party libraries:
Lazy loading is not included into js-cloudimage-360-view by default. There are well thought libraries to achieve that. If you enable lazy loading in the configuration, you need to add an additional library like lazysizes, yall.js (Yet Another Lazy Loader), lozad.js to handle it.
See: https://github.com/scaleflex/js-cloudimage-360-view?tab=readme-ov-file#-...
So I think this needs another boolean option in the field formatter. If true we need to attach one of the libraries and set data-lazyload="true" as further attribute (+ data-lazyload-selector according to the lazy load library we choose).
- 🇩🇪Germany Anybody Porta Westfalica
Thanks for the details @thomas.frobieter so I think in the near future we won't implement this. And if anyone does it, it should probably happen in submodule(s) per additional library.
Double-checked that images are actually loaded (even when autoplay is off). This is the case, so we need to fix this.
- 🇩🇪Germany Anybody Porta Westfalica
Agreed, otherwise this will have too heavy loading impact. My hope was, that only the main picture is loaded immediately. -.-
So please let' create a submodule for the lazy loading lib of our choice.
Because "lozad.js" works out of the box, we should use this: https://codesandbox.io/p/sandbox/js-cloudimage-360-view-examples-8iukcn
- 🇩🇪Germany Anybody Porta Westfalica
@Grevil could you please prepare a submodule for lozad lazyload support?
It should just require the library and add the two attributes using an alter hook on the output.No UI needed, if the submodule is enabled, lazyloading should work. If anyone needs it to be controllable, he can implement a switch later. YAGNI in 99% of the cases, as this just makes sense globally.
- Merge request !7Issue #3458498 by anybody, thomas.frobieter, grevil: Add lazy loading support → (Merged) created by Grevil
Automatically closed - issue fixed for 2 weeks with no activity.