• Home / iframe / paulirish/lite-youtube-embed: A faster…

paulirish/lite-youtube-embed: A faster youtube embed.

Renders faster than a sneeze.

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

Comparison

Basic usage

To use the custom embed you will need to:

  1. Include the stylesheet within your application
  2. Include the script as well
  3. Use the element lite-youtube markup and scripting
  4. Be happy that you’re providing a better user experience to your visitors

<link rel="stylesheet" href="node_modules/lite-youtube-embed/src/lite-yt-embed.css" />


<script src="node_modules/lite-youtube-embed/src/lite-yt-embed.js">script>


<lite-youtube videoid="ogfYd705cRs">lite-youtube>

Pro-usage

Use this as your HTML, load the script asynchronously, and let the JS progressively enhance it.

<lite-youtube videoid="ogfYd705cRs" style="background-image: url('https://i.ytimg.com/vi/ogfYd705cRs/hqdefault.jpg');">
	<div class="lty-playbtn">div>
lite-youtube>

More coming soon.

Source link

Write a Comment

Your email address will not be published. Required fields are marked *