Lazy Load YouTube Videos on page - not working on mobile

Hi there,

I’m working with a client to improve their site speed. The biggest culprit right now is the YouTube embed code.

I implemented Lazy Load for the YouTube videos using the method documented at

The issue is, this code isn’t responsive, therefore it doesn’t work on mobile devices.

Any hints or ideas? This change alone saves 1mb and about 3-4 seconds loading the client’s homepage.

Here’s the preview link.

I’m going to try the Codepen solution mentioned by @cyberdave at Embedding Several YouTube Videos Slows Pageload? Here is the solution

I’ll let you know how it goes.


The codepen solution works, but doesn’t consistently load the thumbnail. If this is as close as we can get, I’d say the 1mb and 3-4 second savings is worth it.

1 Like