kevinweber / lazy-load-for-videos

Speed up your site by replacing embedded Youtube and Vimeo videos with a clickable preview image. Free WordPress plugin.
http://wordpress.org/plugins/lazy-load-for-videos/
GNU General Public License v3.0
41 stars 23 forks source link

Skip replacing the embed markup on AMP pages #54

Closed mjaschen closed 3 years ago

mjaschen commented 3 years ago

When using the “AMP for WordPress” plugin, the <noscript> message is shown („Video can't be loaded because JavaScript is disabled“).

This pull request checks if the current request is for an AMP page and skips replacing the embed markup in this case.

mjaschen commented 3 years ago

Hi @kevinweber

you're absolutely right. I've updated the checks and added early returns.