Is <object> old fashioned? - html

Something like below,which is complicated to figure out what it exactly means:
9.<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="945" height="102">
10.
11. <param name="movie" value="66.swf" />
12.
13. <param name="wmode" value="transparent" />
14.
15. <EMBED height="60" pluginspage="http://www.macromedia.com/go/getflashplayer" src="66.swf" type="application/x-shockwave-flash" width="468" wmode="transparent" quality="high"></EMBED>
16.
17.</object>

Use swfobject and stop worrying about it. Let the library handle the flash embedding.
Various browsers require various embedding techniques for various reasons, and we as application developers shouldn't need to worry about the arbitrary details.

<object> isn't really old-fashoned, however using all-caps for tags like the <EMBED> you've got there is. It isn't valid XML, or valid XHTML for that matter. (Then again, doing object/embeds for flash causes validation errors with the W3C XHTML Strict validator anyway... :)

If you call things like youtube old fashioned, then yes.
Try here

Related

gofundme widget is not appearing on page

Gofundme gave me the following widget code to add to my webpage, however it doesn't appear on my page. I think that it might have something to do with the embed tag as my design software states that "In HTML 4.01 Transitional the tag is not permitted." Could that be the problem?
Here's the code they sent me:
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="258" height="338" title="Click Here to donate!" type="application/x-shockwave-flash"><param name="movie" value="/Widgetflex.swf"><param name="quality" value="high"><param name="flashvars" value="page=drum-lessons-for-indigent-students&template=6"><param name="wmode" value="transparent"><embed allowScriptAccess="always" src="/Widgetflex.swf" quality="high" flashVars="page=drum-lessons-for-indigent-students&template=6" type="application/x-shockwave-flash" wmode="transparent" width="258" height="338"></embed></object>
Kokesh is right, there are some issues with flash in some instances but the real issue with the gofundme widget has to do with how it's written for you to copy and paste. It's looking for a local file.
This tutorial should help with getting it to work using a workaround.
http://manicpixieropedoll.blogspot.com/p/gofundme-n.html
It is a Flash object. Flash is on it's way out and already blocked in Chrome. Do they provide some more civilized solution? I actually found your question as this happened just now to my wife.. I will look for solutions, but unless GoFundMe provides other widget, I'm not sure what to do.

<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?
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.

Embedded YouTube code does not validate

While validating my not be a big issue to some people, I personally want my page to validate whenever possible, as I feel it's a good habit to code properly whether the compiler/browser/person reading your code understands anyways.
Anyways, I'm building a website for a client that is requesting a YouTube video of theirs be embedded in the page. Easy, I grab the code from YouTube and throw it in the page. It works of course, but the page now doesn't validate under XHTML 1.0 Strict solely because of the YouTube-generated code.
The part that doesn't validate is the embed portion, and it works fine without this line in Chrome, but breaks in Firefox/IE. If it was just IE I'd just shrug it off as IE being terrible as per usual, but being as Firefox is doing it as well I'm wondering how to approach the situation. I could just dynamically input the content based on the browser, therefore validating, but that seems sloppy.
Am I fighting a losing battle and should just ignore the fact that this page doesn't validate because of this snippet?
Not actual video, just example code
<object width="480" height="385">
<param name="movie" value="http://www.youtube.com/v/oHg5SJYRHA0?fs=1&hl=en_US"></param><param name="allowFullScreen" value="true"></param>
<param name="allowscriptaccess" value="always"></param>
<embed src="http://www.youtube.com/v/oHg5SJYRHA0?fs=1&hl=en_US" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed>
</object>
<object type="application/x-shockwave-flash"
data="http://www.youtube.com/v/oHg5SJYRHA0?fs=1&hl=en_US"
width="480" height="385">
<param name="movie"
value="http://www.youtube.com/v/oHg5SJYRHA0?fs=1&hl=en_US"/>
<param name="allowFullScreen" value="true"/>
<param name="allowscriptaccess" value="always"/>
</object>
That should work on IE, Firefox, Opera, Safari and Chrome.
The data attribute of <object> and the movie parameter must both be present and must have the same value.
In IE this prevents the SWF from streaming and, for example, presenting a pre-loader, but that should be a non-issue for YouTube.
For more, and for a fix for that last problem, see Flash Satay: Embedding Flash While Supporting Standards.
I think if you use swfobject you could get it to validate.
http://code.google.com/p/swfobject/
The <embed> tag is new to HTML5 and it's quite possible that the validator you are using is not fully up-to-date. All of that code should be quite fine in XHTML 1.0 strict.
I'm afraid the above answers still cause validation to fail on W3C. Here's a solution which works for xhtml strict;
<object type="application/x-shockwave-flash" data="https://www.youtube.com/v/YourVideoID" width="100%" height="100%"></object>

Why does my embedded YouTube video work in Firefox, but not Internet Explorer?

I'm using the following code to display a YouTube video.
<object width="425" height="344">
<param name="movie"
value="**URL**">
</param>
<param name="allowFullScreen"
value="true">
</param>
<embed src="**URL**"
type="application/xshockwave-flash"
allowfullscreen="true"
width="425"
height="344">
</embed>
</object>
It works in Firefox, but why doesn't it in Internet Explorer?
I'm a totally new to web development, so I'm running into all these wonderful inconsistencies that you veterans are used to ;)
To elucidate, it doesn't work because the object tag is incomplete. Firefox gives up on the object element and uses the fallback old-school embed element instead. IE doesn't support embed so you get nothing.
An object element must at least have a type attribute telling it what plugin to use and a data attribute telling it what to send the plugin. In IE you also need to mirror the data attribute in a <param name="movie"> value inside the object because it runs plugins differently.
IE won't ‘stream’ partially-loaded Flash files this way though. To get that, you have to use an ActiveX classid instead of the type to tell it which plugin to use. If you care about this (and you might not: for small files, stub loaders, and files that are useless until complete, it makes no difference) then you have to start serving combinations of nested objects or embeds, which quickly becomes confusing.
Try this:
<object type="application/x-shockwave-flash" data="VID_URL" width="425" height="344">
<param name="movie" value="VID_URL" />
</object>
Previously wasted a few hours working through the same issue. Different cause though...
For IE9, YouTube embeds (at least iframes) were not working because I had previously added Tracking Protection to IE for Google ad servers. In this case, I had to disable the tracking protection (Safety > Tracking Protection) or click the button immediately to the right of the address bar ('Some content is filtered on this site') that alerts end users to filtered content.

Meaning of attributes and parameters in HTML Flash tag?

In the below code, what are all the parameters and attributes used, why are all these used and what's their meaning here?
What parameters and attributes are recommended and what are not to use with a Flash tag in a HTML page?
<object id="vf_flash" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="630" height="400">
<param name="movie" value="/videos/swf/3fun.swf" />
<param name="FlashVars" value="id=72" />
<param name="allowScriptAccess" value="always" />
<param name="loop" value="false" />
<param name="menu" value="false" />
<param name="quality" value="high" />
<param name="wmode" value="window" />
<embed name="vf_flash" src="/videos/swf/3fun.swf" FlashVars="id=72" width="630" height="400" allowScriptAccess="always" loop="false" menu="false" quality="high" wmode="window" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>
The Adobe website has clear and concise explanations of all of these tags, including which are optional and which are required.
http://kb2.adobe.com/cps/127/tn_12701.html
Out of order, and based on memory. Verify these all before use, but it should help you wrap your head around the concepts:
In the fight for monopoly over the web, Microsoft has committed to differ from the W3C whenever possible. Therefore, the actual tag used to embed Flash in Internet Explorer is 'object', in all real browsers it's 'embed'.
It must be noted that using '1' and '0' will give you better overall consistency than 'true' and 'false', due to this fight.
loop - tells whether or not the Flash player should attempt to restart the movie when it finishes playing it.
FlashVars - parameters can be passed into Flash, and are referred to through the flashvars unit. For example, if you create a media player that plays song1 you may pass in Flashvars="song1=song1"
movie - the URL of the Flash file. Keep it in the same folder as the HTML file calling it, or use an absolute URL or you will hit a cross-browser issue.
quality - the higher the quality the more resources Flash requires to run. While the default is good, if you are worried that the player will be used on older computers, sometimes sacrifice image quality for the sake of a less jumpy experience
wmode - the background opacity of the movie. Sometimes you want the movie to blend in with the background, and it gets set to "transparent", sometimes it should clearly be its own little box, "opaque". Note here that there are some easter eggs with this value, if you need it, there are some undocumented options for this value.
allowScriptAccess - I actually thought this was deprecated. It changed a lot in different versions. Leave this on default.
Libraries like Mootools have classes designed for working with Flash and JavaScript together.
Take a look here and here for the articles on A List Apart (ALA) on the embed vs object tags, there is a lot to be learned from it.
The one's that I can answer off the top of my head:
"movie" - the name of the flash file to load/view
"loop" - whether the animation plays once (false) or repeats (true)
"menu" - whether to show the full context menu (true) or not (false). Setting this to false shows the context menu, but it only has the "settings" and "about" options.
See Kane Wallmann's link for the full documentation.