Home > Articles > Web Development > Content Management Systems

  • Print
  • + Share This
From the author of

From the author of

Embedding a Video on Your Web Page

Linking to YouTube videos from your web page is one thing; embedding an actual video into your web page is quite another. That’s right—YouTube lets you insert any of its public videos into your own web page, complete with video player window. And it’s easy to do.

That’s because YouTube automatically creates the embed code for every public video on its site (as well as your own private videos), and lists this code on the video page itself. The code is in the description box below the video, in the Embed box. You’ll need to copy this entire code (it’s longer than the Embed box itself) and then paste it into the HTML code on your website, wherever you want the video player window to display.

The result of inserting this code into your page’s HTML is that your web page now displays a special click-to-play YouTube video player window. The video itself remains stored on and served from YouTube’s servers; only the code resides on your website. When a site visitor clicks the video, it’s served from YouTube’s servers to your viewer’s web browser, just as if it were served from your own server. (This means you don’t waste any of your own storage space or bandwidth on the video.)

By the way, the code in the Embed box is squished together onto a single line, to make it easier to copy. If you were to properly format the code, it would look something like this:

<object width="425" height="350">
  <param name="movie" value="http://www.youtube.com/v/12345"></param>
  <param name="wmode" value="transparent"></param>
  <embed src="http://www.youtube.com/v/12345" 
  type="application/x-shockwave-flash" wmode="transparent" width="425"
  • + Share This
  • 🔖 Save To Your Account