Playing a YouTube Video in HTML


Playing a YouTube Video in HTML

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

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

            https://www.youtube.com/watch?v=3lOjNDvVeZA

            here "3lOjNDvVeZA" is video id







Live Demo & Try it yourself!

YouTube Autoplay + Mute


YouTube Autoplay + Mute

You can let your video start playing automatically when a user visits the page, by adding autoplay=1 to the YouTube URL. However, automatically starting a video is annoying for your visitors!

Note: Chromium browsers do not allow autoplay in most cases. However, muted autoplay is always allowed.

Add mute=1 after autoplay=1 to let your video start playing automatically (but muted).







Live Demo & Try it yourself!

YouTube Controls


YouTube Controls

Add controls=0 to not display controls in the video player.

Value 0: Player controls does not display.

Value 1 (default): Player controls display.







Live Demo & Try it yourself!

Instagram Video


Instagram Video

if you're facing "Sorry, this page isn't available" then you need to login in instagram







Live Demo & Try it yourself!

Dailymotion Video and Image


Dailymotion Video and Image







Live Demo & Try it yourself!