HTML - YouTube

HTML YouTube

You can easily play insert and play any YouTube video of your choice in HTML. This can be done by simply using the iframe tag.

YouTube Video

  • Copy the URL of the YouTube video you want to add to your HTML web page
  • Define your <iframe> element.
  • Set the width and height of the <iframe> to your desired choice
  • Add your src attribute, and paste the URL as the value
  • Done!

AUTOPLAY

To automatically let the video start playing as soon as your page loads up, add autoplay=1 to the YouTube URL as shown below.

tips
TIP:

Some browsers (like Chromium browsers) do not support autoplay alone, but they support muted and autoplay together.


MUTE

To turn OFF the volume of the video when it automatically starts playing, add mute=1 after the autoplay=1 in the YouTube URL as shown below.

note
NOTE:

Notice the ampersand symbol & after the autoplay=1

LOOP

To make the video play again each time it ends, add loop=1 to the YouTube URL as shown below.

CONTROLS

To hide the controls (play, pause and volume), add controls=0 to the YouTube URL as shown below.

ADVERTISEMENTS

LEARNING IS A CONTINOUS PROCESS - PRACTICE MAKES PERFECT