aFarkas / lazysizes

High performance and SEO friendly lazy loader for images (responsive and normal), iframes and more, that detects any visibility changes triggered through user interaction, CSS or JavaScript without configuration.
MIT License
17.56k stars 1.73k forks source link

Lazyloading videos with muted attribute is not working #999

Open alexchakmakov opened 5 months ago

alexchakmakov commented 5 months ago

Hello everyone. I'm having the following markup

<video class="lazyload"
       preload="none"
       data-autoplay=""
       loop=""
       playsinline=""
>
    <source src="VIDEO_URL" type="video/mp4">
</video>

This setup works perfectly, as evidenced by the network tab showing that only 22 out of 60 videos load initially, with more videos loading incrementally as I scroll down (24, 26, 28, 30, etc.).

However, the problem arises when I add the muted attribute to the videos. When the videos have the muted attribute, it seems that lazysizes fails, and all 60 videos load immediately on page load. What could be causing this issue?

Please note the following:

Thanks in advance for you help!