Work in Progress
This library is still a work in progress and things will likely change.
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.
Import the component where you need, and you can use it like this:
---
import YoutubeVideo from '@components/YoutubeVideo.astro';
---
<YoutubeVideo id="dQw4w9WgXcQ" />
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 controlsstart: 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 />
We use cookies to provide the best experience.