Embed YouTube Videos
You can add YouTube videos to your web site by using either the iframe or object HTML tags.
Based on the information from http://www.youtube.com/youtubeonyoursite:
- Use the youtube site to find the video you want
- Click the 'Share' button below the video
- Click the 'Embed' button next to the link they show you
- Copy the
iframecode given and paste it into the html of your web page.
Although YouTube gives you html code using the iframe tag, you can also include your video using the object tag, as seen in the example below.
Example:
Show a funny cat video (not mine, and probably not funny if you like cats)
<html>
<body>
<iframe src="http://www.youtube.com/embed/uIbkLjjlMV8"
width="560" height="315" frameborder="0" allowfullscreen></iframe>
</body>
</html>
See live demo of this example or open in a new window. (Note: close window or tab to return to the guide)
Example:
Use the object tag to show the same video
<html>
<body>
<object data="http://www.youtube.com/embed/uIbkLjjlMV8"
width="560" height="315"></object>
</body>
</html>
See live demo of this example or open in a new window. (Note: close window or tab to return to the guide)
Feedback

