lazysizes icon indicating copy to clipboard operation
lazysizes copied to clipboard

iframe data-src to src not replace

Open onderakbulut opened this issue 3 years ago • 3 comments

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?

onderakbulut avatar Feb 06 '22 10:02 onderakbulut

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 ...

t-franz avatar Dec 15 '22 11:12 t-franz

Did you try iframeLoadMode: 1?

https://github.com/aFarkas/lazysizes/blob/1523a4ff4579e170355c7607f445689b43229caf/src/lazysizes-core.js#L479-L488

glen-84 avatar Mar 23 '23 13:03 glen-84

The iframeLoadMode: 1 is necessary for the fullscreen mode to work in Vimeo video player. How about making this the new default?

Without fullscreen: grafik

With fullscreen: grafik

<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>

rr-it avatar Apr 07 '23 17:04 rr-it