lazysizes
lazysizes copied to clipboard
iframe data-src to src not replace
Thank you for the plugin. I used this on iframe but it is not replaced video link data-src to src could you help me?
I have the same problem. The script does not replace the data-src:
<iframe
data-src="https://www.loom.com/embed/123"
frameborder="0"
loading="lazy"
class="lazyload"
webkitallowfullscreen=""
mozallowfullscreen=""
allowfullscreen="">
</iframe>
Images are okay, but i can't get it to work with iframes ...
Did you try iframeLoadMode: 1
?
https://github.com/aFarkas/lazysizes/blob/1523a4ff4579e170355c7607f445689b43229caf/src/lazysizes-core.js#L479-L488
The iframeLoadMode: 1
is necessary for the fullscreen mode to work in Vimeo video player.
How about making this the new default?
Without fullscreen:
With fullscreen:
<script>
window.lazySizesConfig = {
iframeLoadMode: 1
};
</script>
<script src="lazysizes.min.js"></script>
OR
<iframe class="lazyload" data-load-mode="1" data-src="https://player.vimeo.com/video/1084537" width="640" height="360" allowfullscreen allow="fullscreen" ></iframe>