However, each method of adding video has its own advantages and disadvantages. While there are many different methods that can be used to add videos to your pages, leveraging YouTube seems to be the easiest to implement. Please note that some of the methods listed below are not supported in HTML 4.01. You either have to have a browser that supports HTML 5 or install require that Flash is installed on the user’s computer. Here are the most common ways to add a video to your web pages.

iFrame Element

I find this to be the easiest way to add a video to your page. YouTube already provides you with a link to an embedded player, just click on the Share button to access the code. All you need to do is add an iframe to your page and assign the correct URL to the src attribute of the iframe. This method requires a browser that supports HTML 5 or Flash. Here is an example.

Video Element

The

Embed & Object Elements

You can also use theand/or elements to try to play multimedia elements in HTML pages. Here is an example of how to display a Flash video using both elements. While the element is supported in HTML 4, theelement is not. If the browser does not support Flash, the video will not play. Using this method is not easy when supporting various types of browsers.

Use Multiple Solutions

Another method is to use various elements so that at least one method is likely to be supported by the user’s browser. Keep in mind that this option includes HTML 4 and HTML 5 elements. For your page to validate correctly, you will need to use the HTML 5 DOCTYPE, . In this example, the browser will attempt to play the video using one of the elements in this order: video, object, then embed. Here is an example. Again, my suggestion is to implement a video solution that is easy to maintain while still providing meeting the needs of your users. I find that using iframes works best for most scenarios, especially if your multimedia is being hosted by YouTube.