Unsurprisingly, Internet Explorer 8 broke yet another feature of the web. This time, the folks at Redmond broke how Internet Explorer passes the flashvars parameter into Flash. Typically, when placing a Flash object on an HTML page, you use the following syntax:
<object id="flv" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="692" height="516" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" align="middle"> <param name="allowScriptAccess" value="sameDomain" /> <param name="allowFullScreen" value="true" /> <param name="quality" value="high" /> <param name="bgcolor" value="#424242" /> <param name="FlashVars" value="name=value" /> <param name="wmode" value="transparent" /> <embed type="application/x-shockwave-flash" width="692" height="516" src="http://www.example.com/mysample.swf" name="flv" allowfullscreen="true" allowscriptaccess="sameDomain" wmode="transparent" bgcolor="#424242" quality="high" flashvars="name=value" pluginspage="http://www.macromedia.com/go/getflashplayer" align="middle"></embed> <param name="movie" value="http://www.example.com/mysample.swf" /> </object>
The OBJECT tag is used by Internet Explorer and the EMBED tag is used by everyone else (Firefox, Safari, etc.). Although the flashvars paramter is not formally described in the HTML 4.0.1 spec1, this code worked fine with IE 6 and IE 7. Unfortunately, IE 8 does not pass flashvars into the Flash Player. The only work around is to pass the flashvars parameter as part of the movie name parameter, as shown below:
<object id="flv" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="692" height="516" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" align="middle"> <param name="allowScriptAccess" value="sameDomain" /> <param name="allowFullScreen" value="true" /> <param name="quality" value="high" /> <param name="bgcolor" value="#424242" /> <param name="FlashVars" value="name=value" /> <param name="wmode" value="transparent" /> <embed type="application/x-shockwave-flash" width="692" height="516" src="http://www.example.com/mysample.swf" name="flv" allowfullscreen="true" allowscriptaccess="sameDomain" wmode="transparent" bgcolor="#424242" quality="high" flashvars="name=value" pluginspage="http://www.macromedia.com/go/getflashplayer" align="middle"></embed> <param name="movie" value="http://www.example.com/mysample.swf?name=value" /> </object>
Notes:
I found a great article on creating a visualization for audio in Flash on the CommunityMX site. Unfortunately, I'm trying to accomplish with audio streaming over RMTP from a Red5 server and that seems to be causing me problems. No matter what I do, the spectrum data return from SoundMixer.computeSpectrum() is empty (all zeros). Meanwhile, I'm seeing conflicting reports across the web and even conflicting information from Adobe.
In one location, Adobe writes that SoundMixer.computeSpectrum() does not work with RTMP data:
For media loaded from RTMP sources, you cannot use the BitmapData.draw() and SoundMixer.computeSpectrum() methods to extract run-time graphics and sound data.1
Then there is the actual documentation for SoundMixer.computeSpectrum():
Note: This method is subject to local file security restrictions and restrictions on cross-domain loading. If you are working with local files or sounds loaded from a server in a different domain than the calling content, you might need to address sandbox restrictions through a cross-domain policy file. For more information, see the Sound class description. In addition, this method cannot be used to extract data from RTMP streams, even when it is called by content that reside in the same domain as the RTMP server.
This method is supported over RTMP in Flash Player 9.0.115.0 and later and in Adobe AIR.2
And finally there's this thread over at the forums for Wowza:
It's official! computeSpectrum does work with Netstream and RTMP served by Wowza
3
Of course, there's no explanation as to how this was actually accomplished using a NetStream/NetConnection and content streamed via RTMP.
Now I'm just horribly confused. Does it work? Or doesn't it? If it's supposed to work, what am I doing wrong?
Footnotes:
Recent comments
13 weeks 3 days ago