Back in May I posted about how to embed YouTube videos as valid XHTML 1.0. Well, let's pretend for a moment that you've been using YouTube for a while, but recently received notice that your videos have been infringing too many copyrights. What do you do?
First off, you do some research and eventually decide to switch to YouTube's competitor overseas, Dailymotion.
Once you've done that, however, you quickly have to relearn what YouTube already taught you. When Dailymotion offers you a link to embed your video somewhere else, of course it isn't gonna be XHTML 1.0 compliant. That would be too easy. So you take the unnecessary mess they give you:
<div><object width="425" height="306"><param name="movie" value="http://www.dailymotion.com/swf/4wnX4yO5ANFCJ4RUx"></param><param name="allowfullscreen" value="true"></param><embed src="http://www.dailymotion.com/swf/4wnX4yO5ANFCJ4RUx" type="application/x-shockwave-flash" width="425" height="334" allowfullscreen="true"></embed></object><br /><b><a href="http://www.dailymotion.com/video/xovhh_jenny-mccarthy-on-my-name-is-earl">Jenny McCarthy on My Name is Earl</a></b><br /><i>Uploaded by <a href="http://www.dailymotion.com/bjms">bjms</a></i></div>
And you turn it into beautiful XHTML 1.0 goodness, like so:
<object type="application/x-shockwave-flash" width="425" height="306" data="http://www.dailymotion.com/swf/700Fkfr7ShJWH4RUx"><param name="movie" value="http://www.dailymotion.com/swf/700Fkfr7ShJWH4RUx" /></object>
I should note that I found several alleged solutions to this problem elsewhere on the web (DailyMotion's poor HTML code probably being the best of the bunch), but none of them seemed as clean, simple and browser-compliant as the solution I already came up with for YouTube videos. So if you're familiar with that previous example, this new one will look very familiar.
If it ain't broke, don't try to fix it.
Comments
Hi !
Thank's, you have THE solution !
I have a problem with the valid W3C when i put
Have you got a solution ?
http://www.inicolas.fr/life-cast/lifecast-4-365
Bye, Nicolas.
i build my website.i put in my website video from "dailymotion" with dailymotion provided embed code.during playing video,when i click on video player screen,then open a new browser window of dailymotion whrere the video is.
what can i do that dailymotion window did not open ?
and my website visiter watch video just in my webpage.
thank u very much
Khan
I don't think that would be possible...
You can't change the flash-file hosted on Dailymotion.
The only possibility is probably to host the video on your own site and use your own video.
Post Comments
If you feel like commenting on the above item, use the form below. Your email address will be used for personal contact reasons only, and will not be shown on this website.
Hey Bernie,
Amazing...
I didn't thought it would be possible to make something of the code provided by Dailymotion...
Thank you very much!
Permalink