More performant YouTube embeds with

Written by / Original link on Dec. 28, 2019


By Paul Irish:

Provide videos with a supercharged focus on visual performance. This custom element renders just like the real thing but approximately 224X faster.

Installation per NPM:

npm install lite-youtube-embed


<!-- Include the stylesheet, this could be direct from the package or bundled -->
<link rel="stylesheet" href="node_modules/lite-youtube-embed/src/lite-yt-embed.css" />

<!-- Include the custom element script -->
<script src="node_modules/lite-youtube-embed/src/lite-yt-embed.js"></script>

<!-- Use the element. You may define uses before the scripts are parsed and executed. -->
<lite-youtube videoid="ogfYd705cRs"></lite-youtube>

Lite YouTube Embed →

elsewhere link calevans web-components bram

« Smoother & sharper shadows with layered box-shadows - Use Netlify as a URL Shortener »