Lazy load embedded YouTube videos

1 · CSS-Tricks · Aug. 20, 2019, 4:15 p.m.
This is a very clever idea via Arthur Corenzan. Rather than use the default YouTube embed, which adds a crapload of resources to a page whether the user plays the video or not, use the little tiny placeholder webpage that is just an image you can click that is linked to the YouTube embed. It still behaves essentially exactly the same: click, play video in place. The trick is rooted in srcdoc, a feature of <iframe> where you can … Read article The post Lazy load embedded YouTube videos appeare...