PDA

View Full Version : YouTube uses both <OBJECT> and <EMBED> for their embeddable snippet. Why?



Kristopher
January 28th, 2008, 11:23 AM
Hey all,

Check out this page, then the upper-right box with the embeddable snippet: YouTube - Justice - D.A.N.C.E (Version Finale) (http://www.youtube.com/watch?v=fo_QVq2lGMs&feature=related)

Notice how YouTube has the <EMBED> placed inside the <OBJECT>? Why did they do that? Is it more beneficial?

Code:


<object width="425" height="355">
<param name="movie" value="http://www.youtube.com/v/fo_QVq2lGMs&rel=1"></param>
<param name="wmode" value="transparent"></param>
<embed src="http://www.youtube.com/v/fo_QVq2lGMs&rel=1" type="application/x-shockwave-flash" wmode="transparent" width="425" height="355"></embed>
</object>


Right now on my site, I just have the <EMBED> for the snippet. Example can be seen here: Joke example (http://www.comicwonder.com/joke/b6681360b)


Any guidance or advice is greatly appreciated! :Party:

thats all folks
January 28th, 2008, 11:41 AM
I think the Obeject tag is used by Internet Explorer on Windows and the Embed is used by Netscape Navigator and Param is used by FF. I could be wrong

Voetsjoeba
January 28th, 2008, 12:10 PM
I think the Obeject tag is used by Internet Explorer on Windows and the Embed is used by Netscape Navigator and Param is used by FF. I could be wrong

That's exactly right. IE-based browsers will ignore the embed tag and use the object tag instead, and basically every other browser will ignore the object tag and use the embed tag. And so, by nesting the embed tag inside the object tag it works in both types of browsers.