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
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" />
Install the module
npm install @beck24/youtube-video