On embedding Flash content using Web Standards (yes, again)

Lately there’s been a bit of buzz around embedding plugins while adhering to Web Standardsâ„¢. First this ALA article came out and said “bye bye embed”, then yesterday one of the WaSP nerds posted something about “Valid Flash, video and audio embed (object) markup”.

It’s understandable to want to try and force browsers to display your plugin content in a way that adheres to “Web Standards”. It’s a very popular subject, and it’s been covered a few times before. These two recent articles don’t uncover anything new, other than bringing to light (via the comments on them) that Javascript is the only viable method of embedding Flash (and other plugin based) content on the web today.

Now I’m going to say something here that might seem a little controversial, but I really want to get the point across, so I’m going to use some ‘shock and awe’ tactics:

Using only the object tag to embed your plugin content (especially Flash content) is fucking stupid.

There. I said it.

You may say that I’m a bit biased because I wrote some fancy pants Javascript Flash embed script. Maybe I have a hidden agenda of world domination based on plugin detection. So while I no doubt would like to dominate the world, let me say that my reasons for advocating the use of Javascript are much more mundane.

This post was originally going to be titled “Flash Satay considered harmful,” and since the main topic are these “Web Standards” compliant ways of only using the object tag to embed plugin content, I’ll focus on the issues with doing so:

  • “Click to activate” in IE. The only way to get around this is to use Javacript.
  • No plugin detection. While Ben says ‘meh’ to this, it’s a very important aspect of the user experience. If I have Flash Player 6 installed, and I visit a site that uses Flash 9 content, my player will go ahead and try to play that swf anyway. I could end up seeing half of the content, or broken content, or who knows what. Do you really want to show your users broken content?
  • Issues in older Safari versions: Safari pre 1.2 will completely ignore param tags, which are often used to pass information to the plugin. This means broken content for your users.
  • Support for the object tag varies widely from browser to browser. Do you think that just because you work around all the quirks in the 3 main browsers today, it will still work when the next new browser is released?
  • A bug in Flash Player 9 can cause the browser to crash if you have more than one swf on the page and are using ExternalInterface to communicate with Javacsript. While this isn’t specifically related to how the swf is embedded, SWFObject does include a fix for this issue.
  • Using Flash Satay or other ‘object only’ methods will not stream your Flash movies to the user – this means extra work for you in creating a ‘loader’ swf
  • JAWS will ignore it.

It’s a pretty long list, right? Now if you compare that to the user experience when using SWFObject (or other Javascript based techniques), you can see a noticable difference:

  • The only time a user doesn’t see Flash is if they have Javascript turned off, or they don’t have the required version of the Flash Plugin. This one is a two parter: One, do you think that people really turn off Javascript but leave Flash on? Consider the type of person who turns Javascript off. They are probably the über nerd user who considers anything that isn’t text to be completely evil. They browse the web using Lynx. They probably stay a mile away from the Flash Plugin anyway. The beauty of the way SWFObject works is that even these people get content if you set it up right. Since you put alternate content ‘under’ your swf, they will just see the alternate content. As long as you set it up right (you do, don’t you?) they may never even know they are missing out on Flash content.
  • They don’t have to click your movie once to ‘activate’ it
  • Their browser doesn’t crash just because you had two swfs on the same page that use ExternalInterface
  • They only see Flash content if their browser and plugin support it.

Taking all of the above into account, the choice is very clear: Javascript wins hands down. Any questions?

Now that all of that is taken care of, I wanted to address a couple of things:

First, these types of posts are not good for the Web Standards community. Basically what’s happening is highly visible people (even if they aren’t that well known, they still carry the WaSP name, or have articles on well respected online publications like A List Apart) are posting information that is bad for your users. Even worse is that they are doing it in the name of “Web Standards” and not taking into consideration any of the other options outside of pure HTML. This is extremely bad for the Web Standards movement. It makes the standards advocates look like crazed zealots who don’t care about user experience, but only care about adhering to the written rules exactly how they are stated even if it hurts them.

Second, you may be saying “well, if I can’t use the object tag, then what good is it?” and that is a FANTASTIC question. What good is it? Beats me, because the object tag is completely and utterly broken in nearly every web browser out there. Want to do something about it? Maybe you could join WaSP and create a task force to fix how browsers handle plugins?

UPDATE: I added this as a comment below, but wanted to put it in the main post as well: I want to say that as for Flash Satay: It was fantasic for the people who use(d) it, and in it’s time it was great. But now that certain big issues with it have been discovered, and Flash has changed over time, it’s time for it to retire. This is something I’ve been meaning to mention for a while, and it was sort of implied on the SWFObject page. So, since we are on the subject, it’s time to give it up.

UPDATE (8-17-2006): Ben has posted a follow up.

161 thoughts on “On embedding Flash content using Web Standards (yes, again)

  1. A great post that makes all the pertinent points. Your shock and awe tactics made me laugh out loud. SWFObject is the only real way to get Flash working effectively on pages and it should be WaSP approved – that should give ’em a sting in the tail.

  2. Because you still lose out on all the plugin detection and the ‘click to activate’ issue in IE.

    Not to mention if they don’t have the plugin at all, embed tags don’t have fallback content. So they are stuck looking at the broken puzzle peice (or an ActiveX install dialog, which most people will say no to in fear of spyware).

  3. Gettem’ Geoff. :)
    Compared to the workarounds and ghetto approaches folks have gone through, it is fucking stupid. Using javascript to write page content is perfectly acceptable – and it works without breaking standards. I haven’t heard anyone moaning about using the dom to add click events or add target attributes to anchor tags so they can validate as ‘strict’. And I can’t imagine anyone surfing with JS turned off is gonna be missed anyway.

  4. “And I can’t imagine anyone surfing with JS turned off is gonna be missed anyway.”

    The best part here is that even if they *do* have Javascript off, you can provide alternate content anyway! Progressive enhancement is your friend.

    I don’t understand how people can preach about progressive enhancement with their Javascripts, but completely ignore their own advice when it comes to Flash.

  5. This news just in: turns out the web isn’t exactly the same place it was four years ago when I documented the Satay technique. Who knew?

    It’s right to re-evaluate the landscape and develop new techniques. I’ve voiced my frustration in the past that people have been treating Satay as the solution and not as a step at the start of a journey. We must keep re-evaluating all our techniques to make sure they’re still relevant and appropriate. But that should be a positive thing that doesn’t require FUDmongering and, frankly, we could all do without the snide personal put-downs. Thanks.

    Four years ago I found something that worked and shared it freely, hoping to kick the discussion off. If we can progress from there, that’s great, and it’s what I’d always hoped for. Present your arguments in a positive and helpful way, and if it’s a good solution (even for particular circumstances) we’ll all help you get the word out. There is no “them and us” here – we’re all trying to do this together.

  6. This news just in: turns out the web isn’t exactly the same place it was four years ago when I documented the Satay technique. Who knew?

    Looks like at least one web standards advocate doesn’t know.

    I’ve voiced my frustration in the past that people have been treating Satay as the solution and not as a step at the start of a journey. We must keep re-evaluating all our techniques to make sure they’re still relevant and appropriate.

    Really? That’s not what I got from that post at all – to me that was you reaffirming Flash Satay as a perfectly viable solution. Just look at the last line:

    “So, Ladies and Gentlemen, introducing the new old way to embed Flash movies in XHTML: Flash Satay.”

    My argument has been presented here for quite a while, and still is. This isn’t some random flame post on my part, it’s a response to the bad advice being given out lately on some highly visible and well regarded websites that needs some clarification. My goal in this is to educate people of the issues with each of these ‘standards compliant’ methods.

    I’ll reiterate what really needs to happen here: Fix how browsers handle the object tag. I shouldn’t have to use Javascript for my Flash content, but until something better comes along, I will. There are such strong communities around CSS and Javascript support, but it seems that plugins are being mostly ignored when they are possibly the most broken aspect of web development today.

  7. Great post Geoff, I admire your bluntness on this issue, I have to agree that I was a bit shocked to see A List Apart publish an article on doing away with the embed tag, and not mention the SWFObject method at all. It was as if your technique, which I use for any Flash work I do personally and professionally, didn’t exist. SWFObject, in my opinion, is the best way to serve Flash to users, both for enabling a consistent cross-browser experience and offering solutions for users without Flash or Javascript.

  8. I don’t know about everybody else but these methods dont exactly fix the “Click to Activate” problem for me. Just recently I was updated to the latest service pack for XP and then later I installed Flash Player 9, I was getting the “Click to Activate” for all sites that employed many different methods (including SWFObject) so I uninstalled 9 and reinstalled 8,0,24. Now I get the “Click to Activate” the first time I encounter any flash with an empty cache. I guess this could be because of various reasons but nonetheless it was a real world action that lead to these methods not working.

  9. I want to thank you for your bluntness as well Geoff. I have been talking to people about web standards for a while, wasp and w3c have inspired me to code better over the years, but when the EOLAS patch struck, I needed a solution I knew would work for people. When I first read the original Satay post I caught the part about it being a journey, so I waited, I wanted to see what other people could come up with since I am not pro-programmer myself. Nothing, for a while, until this recent post again about satay. Honestly, I saw it on my feed reader and didn’t even bother looking at it, I knew there was no way to get as many features as I can get through SWFobject. Thanks for for creating this, and although I must say your post is kinda cheeky, it’s understandable. Let’s not try to keep on forcing a method which cuts people out. The purpose of standards is so that we can try to capture as many people as possible, including those with accessability issues. The alternative text from SWFobject not only helps them, but also in the SEO-centric company I work for, we need that secondary text so as to describe the Flash as it will not be read by Google or any other search engine. Bottom line is thanks for SWFobject, and for the post. Standards were always telling me that we needed to reach as many people as we could on the web using the best practices, and imho, SWFobject is that way.

  10. In these kind of discussions I always like to recall that succesful embedding is not the whole experience. Also try to make your rich media(especially audio and video) as downloadable and offline usable as possible.

    VideoDownloader is currently the 5th popular Firefox extension. I guess it tells that embedding it’s not enough and that users want more options.

  11. What still gets me is that you can put an embed tag inside javascript, and then still claim the web page is standards compliant. From the point of view of the W3C validator it is…but only because the validator is not capable of looking inside javascript.

    Look at it from the perspective of the BROWSERS, not the validator. The whole purpose is to make sure that some kind of standards are being met, so that when a ‘standards-compliant’ browser renders a web page, you know how it will behave.

    I claim that from the perspective of the browser, it makes no difference whether an embed tag is in HTML or hidden inside a javascript. Either way, the browser sees it, then implements it.

    So here is the question. You have a Strict HTML doctype declared for your webpage, then you put that nice little W3C compliant logo on your webpage (to please your client), and then stuff all the non-compliant tags inside javascript.
    So, is your webpage REALLY complying to any standards?

    Sure, the non-javascript HTML is standards compliant. So what? The browser still renders the embed tag.

    Todays browsers are very forgiving, obviously. Despite the strict doctype, they still execute the embed tag.

    I wonder, in the future, if a browser should come along that strictly enforces the rules of a given doctype. If you declare a STRICT doctype, should it then refuse to render an embed/applet tag?

    This is how web-standards are not really standards. It is something we may aspire to, but it is not yet reality.

    The W3C folks apparently are not interested in this question. No one is.

  12. Eric,

    This is taken directly from the SWFObject page: “It is also very search engine friendly, degrades gracefully, can be used in valid HTML and XHTML 1.0 documents, and is forward compatible, so it should work for years to come.”

    As you can see, I don’t claim that it is “Standards Compliant” but merely that you can use it in your valid pages and it won’t break validation.

    As for your ponderings on the correctness of using Javascript to embed invalid elements: I personally don’t agree with the practice, but in this specific case, where you are dealing with browser plugins, it’s a neccesary evil. You see, when faced with a choice of using a method that is very much broken in many browsers (specifically with using purely an object tag, which is what started this whole discussion) or between using a non-official element that works fine everywhere, which would you pick? When your client calls you and asks why their site is broken on a certain platform/browser what will you tell them?

    I wonder, in the future, if a browser should come along that strictly enforces the rules of a given doctype. If you declare a STRICT doctype, should it then refuse to render an embed/applet tag?

    Opera already does this: If you use the DOM to create an object tag, you can *only* add attributes that are part of the HTML spec. You also can’t create an embed tag. This is one of the many reasons why SWFObject uses innerHTML (and an embed tag!) to write the swf content to the page.

  13. You write:

    "Even worse [than suggesting practices that have the potential to harm user experience] is that [he is] doing it in the name of ‘Web Standards’ and not taking into consideration any of the other options outside of pure HTML. This is extremely bad for the Web Standards movement. It makes the standards advocates look like crazed zealots who don’t care about user experience, but only care about adhering to the written rules exactly how they are stated even if it hurts them."

    The position I’m coming from is that structure gets markup, behavior gets scripting, and presentation gets styling. Content remains content. End of story.

    This strict attitude is the result of having my eye on the future, and from spending way too much time tweaking code and markup that never would’ve needed maintenance (much less rearrangement!) if it had just been done right in the first fucking place.

    We agree that when it comes to plug-ins, useragents &c. are broken. Therefore I ask this: is the better course to work around the breakage and accept the status quo indefinitely… or adopt practices that reveal to the end user the breakage in their software in the hope that doing so will create broader awareness of issues that need to be seen to by software vendors (and may evolve into solutions that work across the board)? Also, in the latter event, what’s wrong with simply putting a link to the media file within the offending object element, so that the visitor gets their hands on the conent no matter what?

    Yes, I concede that there are situations where the approach I just described will be ruled out by pointy-headed types, which is why I believe that SWFObject and its cousins are good to have around. But you’ll get nothing but snorts of derision from me if you insist that your stewardship of SWFObject entitles you to web standards cred. Sorry.

    My personal feelings about how Flash and how tools like SWFObject enable its abuse in the same way a codependent spouse might enable their partner’s addictive behavior may have limited relevance to my arguments, but are highly relevant to their tenacity. Again, sorry.

    You take the shorter view, I take the longer view, and neither of us is alone. I also concede that I’m far more likely to be forced to do things your way, than vice versa. (I was led to read through swfobject.js’s source code for exactly that reason.)

  14. The position I’m coming from is that structure gets markup, behavior gets scripting, and presentation gets styling. Content remains content. End of story.

    So then, since Flash can be all three, how do you treat it? I could use Flash to enhance the behavior of a navbar, I could use it to display a chunk of text, or I could use it to add some flair to my page. Each of these uses deserves it’s own look. I’ve written on this subject before, you should read it.

    is the better course to work around the breakage and accept the status quo indefinitely… or adopt practices that reveal to the end user the breakage in their software in the hope that doing so will create broader awareness of issues that need to be seen to by software vendors
    […]
    Also, in the latter event, what’s wrong with simply putting a link to the media file within the offending object element, so that the visitor gets their hands on the conent no matter what?

    Why should my users suffer because of software makers? While I applaud your utopian views, this just won’t work in the capitalist nature of the internet. When Site B sees that Site A’s users don’t have to ‘click to activate’ or they can upgrade their Flash plugin right there without having to go to a different site, you can be damn sure that Site B better get with the program or they could potentially lose business to Site A. That’s the reality we live in, and planting a sign chiding the software developers for their bad decisions in front of your usres when all they want to do is buy a wife from russia won’t work. Ever.

    But you’ll get nothing but snorts of derision from me if you insist that your stewardship of SWFObject entitles you to web standards cred

    This isn’t what I’m looking for, and it has been addressed before (see my response on the WaSP site). Again, it’s about giving my users the best experience possible.

  15. The web needs people like you who address the full browser spectrum and provide solutions that work pan browser pan generation pan mostly-anything, with whatever few drawbacks you list above, yourself. But it also needs the standards zealots who try to take us to a future where we don’t need hacks, in due time, when ten years from now nobody worth considering use the generation of browsers dating back to today or the next few years either, where only the object tag (for instance) is needed.

    We have to cut them some slack for being way into the future already, and learn to filter their truths knowing their perspectives. Yes, they do harm, but they also fortunately do some good. And the browser people, independent of the zealots, hopefully also pull their weight, especially if probed once in a while over issues like those you also list. Keep up the good work!

  16. I read your SEO article, and it states a good case. It also fails to address the problem of tool misuse, but I think we’ve established that I’m on a trip about that, so I’ll just need to stay in my corner and continue eating paste.

    Elsewhere, you write:

    “Why should my users suffer because of software makers? While I applaud your utopian views, this just won’t work in the capitalist nature of the internet.”

    The greater part of my attack is upon so-called conventional wisdom, e.g. that we need to do Whatever It Takes to give project sponsors exactly what they want.

    The logical reply to your opening question is that users should be allowed to suffer because in most cases, they paid for their browsing software (albeit as one component of their stock OS install). As developers, our common response to that apparently is to fly through hoops like good little trained dolphins, even though that outcome means that someone (the sponsor or the developer) eats time and/or money because the software vendor screwed up.

    Put mildly, that sucks out loud.

    My assertion that there’s some fishing for credibility going on came from the simple fact that such a lather’s been worked up over the whole issue. If my posts have been nothing more than the ranting of a validation obsessive, why were they dignified in the first place, much less to this degree?

  17. Hi all.. I struggled long to get SWFObject NOT to show that stupid grey border around my flash movies and NOT having to the movie to activate it. With all my customers and my colleges it worked perfectly, except on my work- and home computer. Than I discovered what caused displaying the border and the ‘activate’ annoyence: I had Java Virtual Machine installed and activated !!! .. So I disabled it, and guess what: no more borders and no more ‘click to activate’ message !!!.. So now I can use SWFObject even on my own computer :D .. Thought this might be helpful for people who are struggling with the same… (you can check if you have Java Virtual Machine installed in IE by navigating to EXTRA/INTERNET OPTIONS/Advanced.
    Kind regards,
    Roel

  18. Ben,

    This whole argument exposes the fundamental irony of the “standards” movement. WaSP claims to be for a more open, accessable and usable internet. But, if someone uses it in a way they dont approve, they cry foul. The fact is, the model of the internet applauded by the standards folks does not provide everything that businesses and consumers want to do with the latest technology available. You have it backward if you think that they are doing something wrong by pursuing their goals without consulting your standards. It is your standards that are failing to meet real demands. Not the other way around.

    Like governments and economies, the sensible agents to determine how the internet is used are the people and the market, not some panel of wise-men.

    Honestly, you sound like the Hugo Chavez of the internet.

  19. As developers, our common response to that apparently is to fly through hoops like good little trained dolphins

    Thats why we get paid so well. You just have to press a few more buttons. Its not hard labour.

    Honestly, you sound like the Hugo Chavez of the internet.

    Not really, Hugo Chavez is democratically elected and has the support of most people in his country. He is trying to make life better for the majority of the population (i.e. the poor people).

    This dude is a programmer giving out bad advice who wants most people to suffer for the sake of idealised standards so it will eventually make *his* life better.

    Quite the opposite.

  20. “Not really, Hugo Chavez is democratically elected and has the support of most people in his country. He is trying to make life better for the majority of the population (i.e. the poor people).”

    Haha. Riiiiiight. Not really the place for that kind of debate and we agree about the relavent subject. So, I’ll say no more. :)

  21. Joe: In all fairness, it’s not the Web Standards people that are at fault here (or the W3C) – the object tag’s spec is perfectly capable of handling everything we need. It’s the implementation that needs to be fixed.

    And as a sort of side note: As for Web Standards, I’m all for them. And if you read this blog you probably realize that. It’s just that this issue is a very special case: What do you do when you need an existing technology that the current browsers don’t all handle in a standards compliant way? Should you just use the ‘approved’ method and let your customers suffer, or use the tools you have available to come up with something better, even if it bends the rules a little bit?

    In the case of Flash, I choose the latter, because to me it’s the better choice. My issue then is with people who ignore this better solution and continue to push people to use the broken methods.

  22. Geoff, I loved that post, it was great – the perfect mix of fact and fire. I had a good laugh, and your reasoning spoke for itself. It seems pretty obvious that at the very least, Ben has overlooked some fundamental development principles himself. Graceful degragation being the big one. The fact that SWFObject provides accurate version detection, and abolishes some bugs that would otherwise exist (eg. ExternalInterface usage, which I imagine would be a very real real for Ben with all his RIA development), but this is only step one in the flow; if this fails and Flash content is not displayed, it is totally up to the user to add in additional steps of detection, degradation, or semi-supported half-broken object embedding if they want. I feel this one point alone can justify the usage of SWFObject, despite its many other benefits.

    I think that as long as there are web developers out there who *care* about what they do, and *investigate* all the options available becuase of the pride they have in there work, then they will see for themselves who is spouting crap, and who is making beautifully written tools for the real world. So more power to ya, and thanks for the continued development of SWFObject!

  23. Consider that this entire brouhaha started because I wrote about markup-only plug-in publishing, a whole lotta people wrote in to say “JavaScript is better!” to which I responded “but these JavaScript implementations do a lousy job of observing the spirit of the standards!” and, because both cases are strong, the fecal matter really struck the air circulator.

    Joe Miller writes:

    “This whole argument exposes the fundamental irony of the ‘standards’ movement. WaSP claims to be for a more open, accessable and usable internet. But, if someone uses it in a way they dont approve, they cry foul.”

    The targets of our ire tend to be the ones who have enough resources, brains, and/or experience to know better.

    The extra-spicy vitriol is saved for those who rah-rah standards aloud, but regress every time there’s atual work to be done.

    The fact is, the model of the internet applauded by the standards folks does not provide everything that businesses and consumers want to do with the latest technology available.”

    No, it doesn’t. That’s why we’re here. What’s the point to bothering with standards, or pushing for new Recommendations, if we haven’t even explored the limits of the ones that have already been published?

    In making that claim, you’re also glossing over the design goal of the entire system, which are laudable as all get out: one instance of one information system (usually a site, at present) and several stylesheets, using well-written markup to meet the needs of its operator even down to the fine details… and without regard to platform or medium. That’s what the technology was designed to do, and if you’re going to tell me that project sponsors wouldn’t want that, I’ll tell you that you’re wrong.

    Thanks to a ton of mitigating circumstances accumulated over thirteen years, we’re still arguing about presentation and behavior.

    That sucks out loud, too.

    “You have it backward if you think that they are doing something wrong by pursuing their goals without consulting your standards. It is your standards that are failing to meet real demands. Not the other way around.”

    If their real demands are that their Web presence work in exactly the same fashion as an interative CD-ROM or a PDF file, you’re right, standards can’t meet those demands.

    No small part of what I’ve been trying to say is that as developers, we’re taking things on in a way that is seriously broken, in effect treating webdev like interactive-DTP-over-the-wire. And if DTP services are what you want to sell your clients, at least have the balls to tell them that’s what you’re selling.

    “Like governments and economies, the sensible agents to determine how the internet is used are the people and the market, not some panel of wise-men.”

    I’m down with capitalism, but what does it get us without foresight? Last I checked, in the real world the environment is in tatters, every durable you buy has a design life past which your purchase needs to be replaced outright (talk to any former Dodge Neon owner for a poignant account of how that works), and the thought of what’s going to happen after oil becomes too expensive to serve as a primary energy source is scaring a lot of people.

    Well, guess what? That’s what ineffective oversight of capitalism is getting us in meatspace, and I’ll be damned if I’m just going to roll over and play dead while the same thing happens in micro online.

    “Honestly, you sound like the Hugo Chavez of the internet.”

    …And you sound like the Thomas Dewey of the Internet.

    Darn.

    …And Martin writes:

    This dude is a programmer giving out bad advice who wants most people to suffer for the sake of idealised standards so it will eventually make his life better.

    Do you honestly believe that I expect to be taken seriously when I preach immediate revolution against – of all things – conventional wisdom? Oh, puh-leeze! Of course I’d like people to give the matter some thought, because life is too short to live without guiding principles… but I don’t mistake myself for any kind of messiah.

    As for the self-interest of my advice, go and read the fucking specs already. The (achievable!) goal is an environment in which one information system can be deployed per sponsor. Compare that to the present SOP in which multiple servers, networks, and databases are deployed piecemeal. I concede that such an arrangement would make my life better, because I have many better things to do with my time than duplicating effort all over the place. However, you’re going to have a hard time convincing me that the TCO of such a system wouldn’t be deliciously low, or that there is some extant and fair way of getting there that doesn’t rely on web standards.

  24. I don’t think anyone would argue that having one information system would reduce the TCO of a given system. And, I know at least I think that moving towards web standards is the best way of doing this.

    But unfortunatley, the implementation of these standards are governed by the borwser manufacturers. Coating every current web based information system using flash with the “flash satay is best” brush is not going to help – the trade offs for doing so are not worth it 9 times out of 10. And, taking low shots at SWFObject is really misguiding anyone that may be uninformed of what exactly it is capable of, and the lack of features and bugs you’ll be buying into by not using it.

    SWFObject is in fact leading the “one information system” battle. We are going to have face the fact that browsers right now do not support the object tag across the board to a degree where it can realisticly be used in the real world – without major trade offs in features and reliability. SWFObject is a simple encapsulated object that provides one interface for flash embedding. It is wrapped in one file too, allowing updates to be easily rolled out. In the real world, right now, this offers the best TCO out of any implementation that actually works.

    It has already been mentioned that we need standardisation. But you should be posting this on the browser development blogs. Trying to publically shame the one guy who’s doing the best job of moving towards one solution for everyone is not going to help your cause though.

  25. Odders writes:

    “…Trying to publically shame the one guy who’s doing the best job of moving towards one solution for everyone is not going to help your cause though.”

    That’s why I just wrote a post to apologize and explain my attitude unequivocally.

  26. Geoff: I hear you about the standards. I would agree that they are generally well intentioned and do lend toward sound structuring of projects. Its another layer of irony in an irony clad discussion that you’re clearly an advocate of standards and received this flak. Thats why I characterized this debate as exposing. It was because you got slammed for breaking the grand orthodoxy. “How dare you try to claim our holy cred and make something thats useful for publishing flash!” It shows that much of the standards movement (not all) is about belonging to a club of blood-brothers rather than a sincere effort to improve development and user experience.

    To clarify my position on standards and, I suspect, distinguish it from your own:
    The way the standards suggest we develop is not bad oop. However, the relationship between the standards and browsers is horribly coupled and thus flawed oop. The standards movements insistence that they are right and browsers just need to conform is not only unrealistic but it gets in the way of us looking at more plausible solutions that address the underlying problems in the over-all model.

    Its unfortunate that even the word ‘plug-in’ itself causes so many to curl their lips in elitist angst. I really believe that a completely plug-in based model would make more sense and remove the strong dependency on browsers. Theres no reason that browsers couldn’t be completely removed from content so that they essentially just switch between plug-ins and track histories. There could be a w3c plug-in that all browsers use, making that particular standard exact across platforms.

    Ben: I agree with you that things are broken. I just think that the standards are part of the brokenness in that they don’t respect the reality that they can’t control how browsers will be built. An improved model would take into consideration that which can be counted on and that which cannot and establish relationships accordingly. Instead, the standards movement has adopted this authoritarian voice and inspired not a little childish snobbery (and undoubtedly a lot of client/user confusion) in the industry.

    Your analogy between capitalism and the environment demonstrates my point perfectly. Capitalism works because the scarcity and expense of one resource lends to the profitability of alternatives. Rising oil prices will do more toward the use of alternative fuels than twenty Al Gores. On the internet, the model of the over-all system should be designed to maximize response to demand and minimize dependencies (monopolies). The standards movement, so far, has not been conducive to that kind of change. Probably because it would mean releasing some of the frail authority they have carved out for themselves.

    You’ll have to explain if you had some other idea in mind when comparing me to Thomas Dewey. It seems to me that you have more in common with him when you seem to be losing the race on how development is actually being done on the internet.

  27. Joe Miller writes:

    “I just think that the standards are part of the brokenness in that they don’t respect the reality that they can’t control how browsers will be built.”

    Oh, but they can. Every rendering engine needs to account for its sponsors’ involvement in the W3C to one degree or another; Apple, Microsoft, Adobe, and the Mozilla Foundation are all dues-paying members of the W3C.

    While the W3C can’t penalize its members, you’d think that they could all play nicely together.

    Nor do I believe for a split second that the responsible W3C Working Group demands more of software publishers than they can deliver.

    Yes, the standard is off-base, but it’s been in final form for far more time than was needed for browser vendors to get it right already. Yet, here we are.

    “…An improved model would take into consideration that which can be counted on and that which cannot and establish relationships accordingly. Instead, the standards movement has adopted this authoritarian voice and inspired not a little childish snobbery (and undoubtedly a lot of client/user confusion) in the industry.

    To the extent that the standards can be considered a voice of authority, they’re pretty unambiguous about what’s allowed and what isn’t.

    I have a news flash for ya:

    Validation’s not that hard. Neither is standards-friendly implementation.

    What’s difficult is asking people to add yet more to their skillset and adjust large stretches of their process. What’s hard is getting people to think of a site as an infosystem and not a collection of pages printed on screen rather than on paper.

    …And we don’t get medieval on the ones who make an honest effort. The conniptions are saved for the people who dismiss or ignore standards because they’re too lazy to step up and learn something new.

    Meanwhile, the only confusion I see comes from the people who discover after all these years that hey, there are standards, and hey. there’s a point to the way they fit together. (Who would’ve thought?)

    “Your analogy between capitalism and the environment demonstrates my point perfectly. Capitalism works because the scarcity and expense of one resource lends to the profitability of alternatives. Rising oil prices will do more toward the use of alternative fuels than twenty Al Gores.”

    I hope fiercely that you’re right… but either way, the environmental damage has already been dealt to an extent that at this point we can only hope to mitigate, while energy companies laugh all the way to the bank and the rest of us get screwed. (Or perhaps you’ve forgotten the California electricty crisis and the fact that oil companies have been screaming about scarcity on one hand and posting record profits on the other.) I’m sure that a lot of net-focussed companies would love to find themselves in the same sweet spot, after considering the actions that some have taken. And that, folks, is what we get from capitalism without the benefit of foresight or oversight.

    “On the internet, the model of the over-all system should be designed to maximize response to demand and minimize dependencies (monopolies).”

    That is how the system is supposed to work – the Recommendations are written unambiguously precisely so that the playing field is kept level! However, there’s never been any doubt as to who gets the lion’s share of the market in a given niche – and as I recall, one of the companies responsible for the current state of affairs was successfully sued in federal court some years back!

    “…The standards movement, so far, has not been conducive to that kind of change. Probably because it would mean releasing some of the frail authority they have carved out for themselves.”

    ‘Scuse me? You’re either misinformed, deliberately spreading disinformation, or making your address from within a context I can’t parse. Standards advocates welcome competition and don’t care who does what, as long as they do it right and minimize the barriers to entry.

    Successful web standards advocates have invested a lot of time and energy into mastering their trade, and it stands to reason that most are fairly proud of what they can do… but you seem to be under the impression that we’re all mad scientists or something. Okay, whatever.

    On review, I figure that you’d be all right with a Web composed of nothing but Flash, and you’re trying to cut down someone who disagrees vehemently with you. I’ll be pleasantly surprised if you can prove that wrong with a straight face.

    As for the Thomas Dewey reference, you’re either ducking the implication, or you just don’t know 20th century history all that well. Either way, there’s no point in pressing that any further – except to point out that I don’t see standards advocacy as a fight or a popularity contest.

  28. hah!

    Ben, I apologize if anything I’ve said ruffled your feathers. I respect your view and just as much it being different than mine.

    I just think you guys are barking up the wrong tree. Maybe it would work beautifully if everybody played along by the book. Thats just never going to happen. Until we acknowledge that, we wont be moving as effectively toward an all-things-considered solution. Even if W3C always got its way, Im not sure that that would be such a great thing. I don’t really trust all the rules to be made by some panel. What if they’re just wrong? What if they play favorites? The entire industry has to suffer their mistakes? A more democratic, market-correcting system is going to benefit more people in the long run.

    I don’t think the internet would be better off if it were all flash.

    Can you say with a straight face that you think the internet wouldn’t be better off without flash? I can probably find 30 links to such statements in a matter of minutes. On the other hand, I don’t recall ever hearing or reading a flash developer say they believe everything should be in flash.

    You’ve misunderstood me if you think Im saying that all standards programming is wrong or useless. There are many advantages to it. But, I differentiate between developing and the aims and behaviors of a movement. You’ve characterized your self as being frustrated and harboring vehemence, spite, angst or whatever toward people. That’s the type of thing I’m taking issue with here. If standards programmers are proud of what they do, why isn’t that enough? Are you sure that some aren’t taking it too far and are really more than proud? It seems to me that some of them are convinced that they know better than everyone else. It’s called elitism.

    Regarding 20th century history, I’m sure I don’t know as much as some. But, I’m fairly certain that I study history more than the average person. Enough to say with confidence that the particulars of Thomas Dewey’s career are not high on the list of significant historical events of the 20th century.

    Anyway, I don’t want to disrespect Geoff’s blog by going back and forth about this here forever. I’m interested in the subject and will continue this debate elsewhere if you’re interested. Let me know. I am curious as to what the standards movements thoughts would be toward creating a W3C plug-in that they could manage directly rather than relying on compliance from browsers.

  29. I can’t really say much that hasn’t already been said, I couldn’t agree more Geoff!

    However regarding – “The logical reply to your opening question is that users should be allowed to suffer because in most cases, they paid for their browsing software (albeit as one component of their stock OS install).”

    So when a user suffers do you really think they blame their browsing software? Really? No, they blame their designer/developer for doing a shit job because their site (that they also paid for, and probably paid a higher price than they do for their browsing experience) isn’t as usable as it could be.

    I agree completely that standards have a place and we need people pushing for them. Not at the expense of the user however, this should be at the expense of the supplier. Rather than attack a technology like Flash or SWFObject that has made conventions available to work with browsers that don’t conform, why not attack the non conforming browser themselves if that’s where your frustration really lies. Seems to me if you have a fundamental problem with the embed tag, you don’t go after the people who are forced to use it to achieve cross-browser friendliness, you go after the browsers that force this need. But maybe its just more sheik to bash Flash than Mozilla.

    As far as I’m concerned (which I’m sure means little to anyone but myself) I’ll keep giving my users the best experience I can, using the best tools available, and not forcing them to suffer the civil war we as designers/developers have to fight daily… that’s what I get paid for.

  30. Congratulations for your work! I am trying to use it in my Blogger-hosted blog and I am facing a strage problem. As you might know, Blogger doesn’t allow you to upload the “swfobject.js” script as a separate file, so I thought I could put it inline between

  31. Sorry for asking a stupid question. Now I understand that IE appears to distinguish between “local” and “external” source for embedded <object>s, so the reason for the behavior I observed is clear.

  32. All that fire, all that energy, all of that “they’ve got it wrong, if they advocate this they don’t live in the real world” directed at WaSP should really be directed at the web browser developers. Why is it that *they* can’t seem to implement a relatively clear specification (the OBJECT element) in their products, leaving developers to work on browser-specific techniques and workarounds?

  33. I’ve managed to hack SWFObject to work in Firefox (2b2 tested) in application/xhtml+xml mode.

    Here’s the relevant fragment:

    _19=”

  34. IE isn’t the only browser that does “click to activate this plugin” thing – Opera 9 does that too and I think that Firefox will also join this team in the near future.

  35. This whole EOLAS thing is stupid. Microsoft ought to just reference the HTML 4.01 dtd from w3c.org – that would place the functionality for the object tag under the software license for the dtd. That would allow them to keep IE working with flash the same way it always did. See section 5.10 of this document: http://www.w3.org/Consortium/Legal/IPR-FAQ-20000620

  36. I haven’t yet tried it because of the note about it not working with application/xhtml+xml – does it break the rendering when used sending XHTML properly? We’re currently using the Satay method on our site and would love to switch to swfobject, however we use XHTML 1.1 as application/xhtml+xml and HTML 4.01 as text/html via content negotiation.

    Any explanation would be great.

    Thanks

  37. Sorry I’m late to the discussion, but…

    Let me say first, I use SWFObject every chance I can get and it’s great. No bones to pick.

    But how do you propose to handle the following case:

    Many sites these days use flash to show their media content (think YouTube) and offer HTML code so that people can post the content on blogs / social networking sites, etc. Now most sites (save for your own) don’t have SWFObject imported into their pages, so you can’t really offer SWFObject code to them to post their content (I think including the entire SWFObject code in with your postable “HTML” is a little out of the question). So what are sites like YouTube left with, other than offering the satay method “postable” HTML code?

    Regards,
    Jeff

  38. Well, YouTube uses SWFOBject on their pages, but for the syndication links they just let the user copy+paste an object+embed tag.

    I would suggest changing this to a method more like this:

    Give the users code that looks something like this:

    <div id="videoid"><a href="http://www.example.com/path/to/content/">Click here to see the content (or video, etc.)</a></div>
    
    <script type="text/javascript" src="http://www.example.com/embed.js?contentid=12345"></script>
    

    Then on the server side, you have embed.js spit out all the Javascript code you need, including the swfobject detection code, and with the ‘contentid’ variable, you embed the correct video. This way you can always modify the embed code at a later time, or update the script as needed.

    This also gives you a huge bonus with Google, in that every person that posts that video on their blog now links back to your page, which will improve your page rank and credibility with Google and other search engines.

    This also has the benefit of not breaking the validation of your user’s pages as well, and you could even invoke Flash’s Express Install feature if you wanted to, which would upgrade users and send them right back to the page they were on when they started the install.

  39. For valid Flash in xhtml, we do not need to wrap in Popular dance Continuity man or others method. According to suggestions A List Apart, ( http://www.alistapart.com/articles/flashsatay ) there is average of convertire simple code Flash for Valid xhtml according to W3C. We already have create ‘Flash XHTML Validator’ here is link to try functionality his: http://www.pagerank.seo-katalog.com/en/flash-xhtml-validator.php
    If ever I had a quick dip subject look after me excused.
    Romuald

  40. I read you article and thought; great! I have some banners for users to add to their sites, and it’s annoying to have to activate a banner to be able to see it… My approach so far have been to make it as easy as possible for the users and just let them copy a code-snippet and add to their site (swf and js still on my server). But how do I do this? Displaying one swf is easy enough and works like a charm. But adding more will nmake duplicate loads of the swfobjects.js and the id “flashcontent”. I don’t see how I can work around this one…

  41. Geoff, I loved that post, it was great – the perfect mix of fact and fire. I had a good laugh, and your reasoning spoke for itself. It seems pretty obvious that at the very least, Ben has overlooked some fundamental development principles himself. Graceful degragation being the big one. The fact that SWFObject provides accurate version detection, and abolishes some bugs that would otherwise exist (eg. ExternalInterface usage, which I imagine would be a very real real for Ben with all his RIA development), but this is only step one in the flow; if this fails and Flash content is not displayed, it is totally up to the user to add in additional steps of detection, degradation, or semi-supported half-broken object embedding if they want. I feel this one point alone can justify the usage of SWFObject, despite its many other benefits.

    I think that as long as there are web developers out there who *care* about what they do, and *investigate* all the options available becuase of the pride they have in there work, then they will see for themselves who is spouting crap, and who is making beautifully written tools for the real world. So more power to ya, and thanks for the continued development of SWFObject!

Comments are closed.