Pergunta

I am making a web app that uses MediaElement.js (ME.js) for playing audio and displaying video across different browsers. However, I am having trouble with IE8: When I instantiate the MediaElement with an <audio>element from the DOM, the flash object gets created and inserted in DOM but then the media does not get loaded. No errors are reported. Instead nothing happens.

Trying to debug it, I have created a small test page which also uses ME.js that tries to play the same audio file. Strangely, this page works fine. IE8 loads and plays the file. I have tried to look at what both of these pages output in the DOM to see if I could get a hint about what is going wrong.

This is from the web app:

<OBJECT id=me_flash_0 codeBase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab" classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000 width=1 height=1><PARAM NAME="_cx" VALUE="26"><PARAM NAME="_cy" VALUE="26"><PARAM NAME="FlashVars" VALUE="id=me_flash_0&amp;isvideo=false&amp;autoplay=false&amp;preload=auto&amp;width=1&amp;startvolume=0.8&amp;timerrate=250&amp;height=1&amp;file=http%3A%2F%2Fgsv%2Felearning%2Fapp%2F_dev%2Ftest1.mp3"><PARAM NAME="Movie" VALUE="plugins/flashmediaelement.swf?x=Tue Dec 6 16:06:01 UTC+0100 2011"><PARAM NAME="Src" VALUE="plugins/flashmediaelement.swf?x=Tue Dec 6 16:06:01 UTC+0100 2011"><PARAM NAME="WMode" VALUE="Transparent"><PARAM NAME="Play" VALUE="-1"><PARAM NAME="Loop" VALUE="-1"><PARAM NAME="Quality" VALUE="High"><PARAM NAME="SAlign" VALUE=""><PARAM NAME="Menu" VALUE="-1"><PARAM NAME="Base" VALUE=""><PARAM NAME="AllowScriptAccess" VALUE="always"><PARAM NAME="Scale" VALUE="ShowAll"><PARAM NAME="DeviceFont" VALUE="0"><PARAM NAME="EmbedMovie" VALUE="0"><PARAM NAME="BGColor" VALUE="000000"><PARAM NAME="SWRemote" VALUE=""><PARAM NAME="MovieData" VALUE=""><PARAM NAME="SeamlessTabbing" VALUE="1"><PARAM NAME="Profile" VALUE="0"><PARAM NAME="ProfileAddress" VALUE=""><PARAM NAME="ProfilePort" VALUE="0"><PARAM NAME="AllowNetworking" VALUE="all"><PARAM NAME="AllowFullScreen" VALUE="true"></OBJECT>

… and this is from the test page:

<OBJECT id=me_flash_0 codeBase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab" classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000 width=1 height=1><PARAM NAME="_cx" VALUE="26"><PARAM NAME="_cy" VALUE="26"><PARAM NAME="FlashVars" VALUE="id=me_flash_0&amp;isvideo=false&amp;autoplay=false&amp;preload=auto&amp;width=1&amp;startvolume=0.8&amp;timerrate=250&amp;height=1&amp;file=http%3A%2F%2Fgsv%2Felearning%2Fapp%2F_dev%2Ftest1.mp3"><PARAM NAME="Movie" VALUE="plugins/flashmediaelement.swf?x=Tue Dec 6 16:08:13 UTC+0100 2011"><PARAM NAME="Src" VALUE="plugins/flashmediaelement.swf?x=Tue Dec 6 16:08:13 UTC+0100 2011"><PARAM NAME="WMode" VALUE="Transparent"><PARAM NAME="Play" VALUE="0"><PARAM NAME="Loop" VALUE="-1"><PARAM NAME="Quality" VALUE="High"><PARAM NAME="SAlign" VALUE="LT"><PARAM NAME="Menu" VALUE="-1"><PARAM NAME="Base" VALUE=""><PARAM NAME="AllowScriptAccess" VALUE="always"><PARAM NAME="Scale" VALUE="NoScale"><PARAM NAME="DeviceFont" VALUE="0"><PARAM NAME="EmbedMovie" VALUE="0"><PARAM NAME="BGColor" VALUE="000000"><PARAM NAME="SWRemote" VALUE=""><PARAM NAME="MovieData" VALUE=""><PARAM NAME="SeamlessTabbing" VALUE="1"><PARAM NAME="Profile" VALUE="0"><PARAM NAME="ProfileAddress" VALUE=""><PARAM NAME="ProfilePort" VALUE="0"><PARAM NAME="AllowNetworking" VALUE="all"><PARAM NAME="AllowFullScreen" VALUE="true"></OBJECT>

Notice there's a difference: In the first snippet it says <PARAM NAME="Play" VALUE="-1">and in the second it says <PARAM NAME="Play" VALUE="0">. This seems significant somehow, but I have no idea how to interpret it. Please not that this is not the markup generate by ME.js but something that somehow gets generated when the .swf file has loaded. Not being any kind of a flash expert, I can't really explain how.

When I use Fiddler to monitor which assets get loaded, the difference between the two pages are that the first page loads the .swf file as the last thing and the second loads the .swf file and then loads the .mp3.

I should mention that the web app works in Chrome when I force it to use the flash plugin instead of native HTML elements.

Foi útil?

Solução

It turns out that the flash objects won't load its media file if it is inside an element that has visibility:hidden. Only in IE though.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top