After using SWFObject for a while I started to notice strange behaviour in IE. Sometimes swf embedded isnt playing so you have to rightclick and select [Play] to see it. That issue resolving _sometimes_ after complete remove and reinstall of flash plugin, but as you understand its not an option telling clients to download uninstall_flash_player.exe from adobe.com and anyway, it fixes only 50% cases.
After abandoning SWFObject first, I finally decided to take a look what's going on and made this test page with the results of research: http://imagevuex.com/temp/swftest/ (check in IE)
Funny to notice <embed> plays just fine in IE, but what more important is the lower part of the page with <object> code - You can see <PARAM NAME="Play" VALUE="0">, if you change it in code to "1" movie will play just fine.
Can't dig into SWFObject code right now, but this is quite critical issue, so I think it would be nice if you can post a fix for it. From my observation IE6, IE7 and SWFObject 1.4, 1.5 both are affected. This happens on ~40% of machines I tried, sometimes it works when you first look at the page but then swf dissapears _after_refresh_ or vice versa. And funny part is even if you reinstall flashPlugin the bug sometimes comes back after a while.
Interesting observations. You can force Play=1 by adding it as a param when you write the swfobject like:
so.addParam("Play", 1);
But here is the swfObject 1.5 code block which creates the <object> block. You can see it doesn't actually write anything other than the bare minimum required + whatever the user has passed as params (using the addParam() method).
Thanks, but my point was - maybe its good idea to have an array of parameters which will exclude junk like <PARAM NAME="_cx" VALUE="5080"><PARAM NAME="_cy" VALUE="5080"> from attributes and also will ensure that play is set to 1 if user not set it to 0 by default. Because what we have now is nowhere near 'the bare minimum required' for IE. Mozilla code is fine, actually IE plays swf using only embed code.
But the more important issue is <div> sometimes not being replaced with <object> in IE. I personally observed it with my testpage on IE7/Vista. Maybe its better to just document.write everything if div can't be found in document or let user ability to choose output method?
I just hardcoded play=1 btw, didnt figure out addParam ;) , but after div not being replaced had to abandon SWFObject.
I would like to come to a working solution for you.
Can you share how you did your test ?
If I alert or fill a text area with the code SWFObject is outputting for IE, I only get a minimum block for the <object> tag, just like the <embed> tag for NS/FF. The only params are movie and quality which is set to high.
I am grabbing the value outputted from the getSWFHTML() function of which the returned value is directly written to the div with: n.innerHTML = this.getSWFHTML(); (where n is the div as returned by a getElementById search).
Sorry, I've been bit busy, didn't followed this forum for a while. So after everything I've decided to give SWFObject another shot and added addParam('play',1) everywhere, but today after deciding to check site im working on in IE i noticed that swfs dissapear at random. If you want to check I can give you link to example and fla sources.
Something fishy going on and frankly I'd like to get to the bottom of this. Thanks.
PS. Oh and forgot to say - I kinda made two-fold navigation which first being placed in div using html a href and then being replaced on-the-fly with flash using swfobject, also i supply loads of parameters using addVariable and ofcourse I'd like to see it working the way it is rather then re-work again 3rd time :<
If you can give me a link to your actual page which is failing, and let me know any reproduction steps to get the <div>'s not to write correctly that should be enought to get me started. send to aran at misterhee dot com.
Are you able to get it to fail in any other OS/ browser combo besides Vista/IE7 (neither of which I have so it could be difficult for me to track down the problem)