How to embed a Youtube video into your website (+autoplay/loop)πŸŽ₯

Nicolas Carmont
2 min readNov 25, 2019

--

Having a video within your site today has become massively more demanded by users. So here’s how:

1.) Embed a youtube video in your website. 🎦

Just paste this tag within your HTML, replacing the youtube video URL with your own (and also adjust your own width and height):

<iframe width="420" height="315"src="https://www.youtube.com/embed/tgbNymZ7vqY"></iframe>

2.) Have the video AutoPlay(start the video on load). ▢️

Add β€œ?autoplay=1” to the end of your youtube URL:

<iframe width="420" height="315"src="https://www.youtube.com/embed/tgbNymZ7vqY?autoplay=1"></iframe>

3.) Have the video continuously Loop (for ex. as a background vid) πŸ”

Add β€œ&loop=1” to the end of your youtube URL:

<iframe width=”420" height=”315"
src=”https://www.youtube.com/embed/tgbNymZ7vqY?playlist=tgbNymZ7vqY&loop=1">
</iframe>

And Wala, you have successfully embedded a video onto your website! 😊

Thanks for reading! πŸ‘ Please leave a clap if this helped. Also…

⚠️ πŸ’» IMPORTANT: If you’re building a website, it’s important you also think about:

1. πŸ‘₯ Adding a thumbnail for sharing on social media:

2. 🎡 Play Audio on your HTML website

3. βœ… Free resources for images, icons, and more on your website

4. πŸ–Ό Adding an icon to your website tab (HTML, favicon)

--

--

Nicolas Carmont
Nicolas Carmont

Written by Nicolas Carmont

26K+ Reads ✍🏼 Passionate about tech, AI and impact πŸ‘Œ Views are all my own.

Responses (3)