fromFrontendmasters
3 weeks agoPerformance-Optimized Video Embeds with Zero JavaScript
Every embedded video comes with a real cost to page load performance. Each player loads extra resources, whether the user ever hits play or not, as Chris Coyier noted in his blog post on "YouTube Embeds are Bananas Heavy and it's Fixable". The approach of using in that article works well when the video appears further down on the page and loads outside of the initial viewport. If the video is directly in the initial viewport, it can still cause a cumulative layout shift (CLS).
Web development

