Monday, September 5, 2011

Fixing W3C Validation Errors/Warnings for YouTube Videos on your website




The tag implemented on YouTube videos is not W3C compliant which mean if you have a site with a YouTube video you will encounter a xhtml 1.0 error messages.  I uploaded a video recently and performing a W3C Validation for my website SEO PR Rocket Consulting, and my site didn't pass the W3C Validation because of the YouTube video tags.

This is what I did to fix the problem.

Steps to fixing this problem:

1. Install Flash Player from Adobe.com

2. Replace the YouTube video code with "Your ID Number" everywhere you see "Your ID Number" with your own YouTube video code

For instant:
                       

Where Your ID Number is the ID number of your YouTube video.

Please install flash or the video will not play

Get flash player to play to this file 

Copy the code below and replace the "Your ID Number" and  replace text with open and close < > brackets were applicable below

Put a open bracket infront of object - object data="http://www.youtube.com/v/Your ID Number" height="344" type="application/x-shockwave-flash" width="426">
Put a open bracket infront of a - a href="http://get.adobe.com/flashplayer/" target="blank"> Put a close bracket here after img - img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get flash player to play to this file" width="426" height="344" /> Put a close bracket here after a

You are all done enjoy your video!

After following the steps above your video will pass W3C Validation and get rid of all the error messages found on your site. To validation of your site go to http://www.validator.w3.org/ Please join our blog if you find this useful to your site.