Work in Progress

This library is still a work in progress and things will likely change.

Nova by Resknow

Youtube Video

Component Misc
Preview

Yotube Video

This is a component. Copy the code to components/YoutubeVideo.astro. This component doesn’t provide much styling, it’s just a simple wrapper for Lite Youtube Embed.

Usage

Import the component where you need, and you can use it like this:

---
import YoutubeVideo from '@components/YoutubeVideo.astro';
---
<YoutubeVideo id="dQw4w9WgXcQ" />

Youtube Options

This component also supports the parameters that you can pass to a Youtube embed:

  • autoplay: Automatically start playing the video (True by default, because of how Lite Youtube Embed works.)
  • controls: Show or hide the video controls
  • start: Start the video at a specific time (in ms)
  • end: End the video at a specific time (in ms)
  • modestBranding: Show or hide the Youtube logo
---
import YoutubeVideo from '@components/YoutubeVideo.astro';
---
<YoutubeVideo id="dQw4w9WgXcQ" controls start={10} end={30} modestBranding />