Skip to content

Instantly share code, notes, and snippets.

@aileron
Created November 10, 2022 08:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aileron/f11d71f7f9f8c673e7fb30a0e11ff3d0 to your computer and use it in GitHub Desktop.
Save aileron/f11d71f7f9f8c673e7fb30a0e11ff3d0 to your computer and use it in GitHub Desktop.
background youtube video autoplay
<script src="https://cdn.jsdelivr.net/gh/thelevicole/youtube-to-html5-loader@4.0.1/dist/YouTubeToHtml5.js"></script>
<video data-yt2html5="https://www.youtube.com/watch?v=ScMzIvxBSi4" playsinline autoplay muted loop ></video>
<script>
new YouTubeToHtml5();
</script>
<style>
html, body {
margin: 0;
padding: 0;
}
video { width: 100vw; height: 100vh }
</style>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment