Skip to content

beck24/youtube-video-component

Repository files navigation

Built With Stencil

youtube-video

A web component for displaying youtube videos in a lazy-loaded manner. Displays and loads only the video thumbnail until the user clicks, then it loads the player and auto-plays.

By default it takes the size of its container, but an explicity width/height can be passed as props.

See the demo: https://beck24.github.io/youtube-video-component/

See the component properties/css variables: https://github.com/beck24/youtube-video-component/blob/master/src/components/youtube-video/readme.md

Installation

Via script

Include the script in the document head

<script src="https://unpkg.com/@beck24/youtube-video/dist/youtube-video.js"></script>

Use the component in the body

<youtube-video src="http://youtu.be/C0DPdy98e4c" width="400px" height="300px" />

Via NPM

Install the module

npm install @beck24/youtube-video

About

A web component for embedding lazy-loaded youtube videos

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published