Abram
Abram

Reputation: 413

<embed> tag seems to be only way to include certain flash content?

Various sites, such as flickr.com for video, or soundcloud.com, use an object tag with a nested embed tag. Based on quite a bit of testing, I've concluded that these sites only work with the nested or stand-alone embed tag, but not with the equivalent object tag syntax. Here's an example:

This works

<embed 
    type="application/x-shockwave-flash"
    src="http://www.flickr.com/apps/video/stewart.swf?v=71377"
    bgcolor="#000000" allowfullscreen="true"
    flashvars="intl_lang=en-us&photo_secret=564da38fcc&photo_id=2454294841"
    height="300" width="400"
>
</embed>

This does not

<object 
    type="application/x-shockwave-flash" 
    width="400"
    height="300" 
    data="http://www.flickr.com/apps/video/stewart.swf?v=71377"
    classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
> 
    <param name="flashvars" value="intl_lang=en-us&photo_secret=564da38fcc&photo_id=2454294841"></param>
    <param name="movie" value="http://www.flickr.com/apps/video/stewart.swf?v=71377"></param>
    <param name="bgcolor" value="#000000"></param> 
    <param name="allowFullScreen" value="true"></param>
</object>

What's going on?

Upvotes: 0

Views: 684

Answers (1)

shanethehat
shanethehat

Reputation: 15570

In this form, your plain object tag will be ignored by all browsers except for IE, which is capable of reading a badly formed object tag. The embed tag is read by all other browsers.

To make all browsers read the object tag, and so make the embed tag redundant, you need to mess around with the object tag properties a bit to make it correctly validate. A better (but slightly old) write up of this is available on A List Apart.

Really though, I still recommend not writing the object tags yourself, and instead let SWFObject do the hard work for you.

Upvotes: 1

Related Questions