UNPKG

youtube-lite-iframe

Version:

Simple web componet that renders the youtube iframe only when you click on the video thumbnail. This way it avoids the immediate loading of youtube resources, helping the performance of your website.

34 lines (30 loc) 640 B
## Basic usage Astro ```html <head> <script> import { liteYoutubeIframe } from 'youtube-lite-iframe/component';</script> </head> ``` Use Id video or Src ```html --- import { YoutubeEmbed } from "youtube-lite-iframe"; --- <YoutubeEmbed id="Jvd-d4" title="Example" ></YoutubeEmbed> ``` ## Basic usage typescript Import component and liteYoutube function ```html <head> <script> import { liteYoutubeIframe } from 'youtube-lite-iframe/component';</script> </head> ``` ```javascript import { liteYoutube } from "youtube-lite-iframe"; liteYoutube({ id: "vs-5674" title: "Example" }) ```