mrwweb / enhanced-embed-block

Enhance the default YouTube Embed Block in WordPress to load faster.
GNU General Public License v3.0
4 stars 1 forks source link

Patch lite-youtube to support thumbnail fallback #4

Closed mrwweb closed 1 month ago

mrwweb commented 2 months ago

Tracking potential upstream fix in justinribeiro/lite-youtube/issues/79.

For now, I'm considering using the following to make this work by adding this starting on line 242:

this.domRefImg.fallback.onload = (e) => {
    if (e.target.naturalWidth === 120) {
        e.target.parentElement.firstElementChild.remove();
    }
};