We found an issue when lazyloading iframes (i.e. youtube video embeds) with the popular lazysizes script.
Apparently, fitVids needs the src attribute to be set in order to init itself on the target.
Without it, fitVids refuses to function.
Since lazySizes needs a data-src attribute and doesn't replace it with a src attribute once it is lazyloaded, we need to do it by hand.
This has actually nothing to do with fitVids but we thought we'd share it here, in case someone else might run into this.
We solved it this way:
https://gist.github.com/zitrusblau/47e9dbc58806b32bc6f1e7d869de638e
We found an issue when lazyloading iframes (i.e. youtube video embeds) with the popular lazysizes script.
Apparently, fitVids needs the src attribute to be set in order to init itself on the target.
Without it, fitVids refuses to function.
Since lazySizes needs a
data-srcattribute and doesn't replace it with asrcattribute once it is lazyloaded, we need to do it by hand.This has actually nothing to do with fitVids but we thought we'd share it here, in case someone else might run into this.
We solved it this way:
https://gist.github.com/zitrusblau/47e9dbc58806b32bc6f1e7d869de638e