Playing a YouTube Video in HTML


« Previous Next »

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!