DEV Community

Cover image for Replacing your website background with live videos. : 3 LINES OF CODE
Raghav Khanna
Raghav Khanna

Posted on

Replacing your website background with live videos. : 3 LINES OF CODE

Look at this

If you find this pretty amazing then go ahead!
This article is for you🥳

Alt Text

Playing a YouTube Video in HTML

To play your video on a web page, do the following:

1) Upload the video to YouTube
Take a note of the video id
2) Define an element in your web page
3) Let the src attribute point to the video URL
4) Use the width and height attributes to specify the dimension of the player
5) Add any other parameters to the URL (see below)

Define the HTML TAG AS-

Tag open (iframe width="420" height="315"
src="https://www.youtube.com/embed/Your_URL">
/iframe) Tag Close

For AUTOPLAY JUST ADD

autoplay=1 IN THE URL.

At last if you find this interesting give it a like!

😍

Top comments (0)