Monday, October 02, 2006

HTML Validation and Flash EMBED tag

EMBED, Google video and html validation......a trail littered with one-way streets and dead-ends...

I decided to give Google Video a go on my site. All pretty easy - just view a video in Google Video and click on the "embed html" button and there's your code. Just insert that into your webpage and you're all done....or so I thought!

First problem - I ran the W3C HTML validator and, of course, it bombed out on the EMBED statement. Ok, off to Google and run a search on embed and html validation - up pops a couple of likely looking sites - the first by J.J.SOLARI details a way to include the EMBED into the HTML 4.01 Transitional DTD - must have been having a bad hair day, but I couldn't get the damn thing to work for me - gave up, rationalised my decision by saying I didn't want to butcher the standard anyway.

Ok, back to Google again....

This time I find a forum which basically says "don't use EMBED, use OBJECT instead and your page will validate nicely". Yup, I did, and yup, it did. Firefox downloads the goddam video whether the user wants to run it or not - and I couldn't find any way to stop that happening. So, I don't want to annoy the 11% of my visitors who use Firefox by artificially loading (unwanted) videos and bumping up their transfer back to the drawing board yet again.

I gave up trying to Validate via W3C - I use CSE HTML Validator across my site before running the W3C validator anyway, so any page with video on it will be validated with that. A small concession to "purity" but I can sleep at night knowing my pages are valid but I'm also not ticking people off! I also had to include the following metatag to keep the validator happy with the generated EMBED code:

meta content="text/css" equiv="Content-Style-Type"

Oh well, what's a few more lost hours lost spent gnashing and cursing at the keyboard!

Happy EMBEDding!

No comments: