In the web developers world, Microsoft’s Internet Explorer has gone though a metamorphosis of love and hate. In the beginning there was Mosiac, and it was good. Then came Netscape, and the internet really got rolling. But, Mosaic really wasn’t a competitor to Netscape, and Netscape was alone in the market; stagnating. Then came Internet Explorer (MSIE), and it was really innovative. It pushed the entire industry. It pushed Netscape (some would say unfairly, but this article is not about that). Then Netscape tried to keep up with MSIE, and failed. And tried again, and failed. Developers had to code for Netscape 4.1, 4.2, 4.3, 4.5, 6 (which should have been 5, and the User Agent string reported itself as 5, but was called 6 in response to MSIE 6), and MSIE. It was a pain. And Netscape, even though they were trying, kept failing, and kept making things worse for developers. So Netscape opened its source, got purchased by AOL, and died. Then the unthinkable happened: Microsoft seemingly gave up on MSIE. They’d patch it when security problems arose, but they wouldn’t fix the inherent problems, and they didn’t innovate anymore. This gave birth to Opera, Safari, Mozilla, and Firefox (to name a few). All were (and still are) worthy opponents to MSIE, and they are more standards compliant.
Way back when, MSIE implemented OBJECTs differently than the others, favoring their proprietary ActiveX concept. This caught the attention of Dr. Michael David Doyle his patent licensing company, EOLAS. The problem stemmed from US Patent 5,838,906 (or simply by ‘906 in context), titled “Distributed hypermedia method for automatically invoking external application providing interaction and display of embedded objects within a hypermedia document,” which was filed on October 17, 1994 and granted on November 17, 1998.
Doyle argued that EOLAS’ ‘906 patent covered how Microsoft implemented ActiveX in MSIE and sued for over half-a-million USD. Rather than pony up Microsoft decided to change the way ActiveX controls were implemented in MSIE and distrubuted this change via a forced “Critical Update.” The “loophole” has been seen by the community as the “automatic” stipulation in the EOLAS ‘906 patent, therefore, by requiring some other method of activation, the patent no longer applies (or so goes the argument).
The Microsoft solution requires users to “Click to Activate” each instance of a control on a web page to be able to use it. This, they say, changes the manner in which ActiveX controls are used, and they are no longer “automatically invoked” (as covered by the EOLAS ‘906 patent).
While keeping Microsoft out of hot water, this can be a major problem for content providers and web developers (such as myself).
There are many documented “workarounds” that serve to “activate” an ActiveX control (whether a Flash or other embedded media object). This, theoretically, also avoids the EOLAS ‘906 patent issue, since all you’re doing as a developer is starting (invoking, activating, removing the gray dotted border, whatever you want to call it) the ActiveX control, that’s an extra layer of interaction, and therefore, NOT “automatic” (the theory is that you’re using a method to activate or invoke an embedded object), and therefore NOT in violation of the EOLAS ‘906 patent.
Most of the solutions involve some type of javascript dynamically writing OBJECT tag (or re-writing the tag). There are lots and lots of approaches. Here’s mine.
First, add this function to your common javascript library (you know, the .js file that you load on every page that holds the collection of javascript functions that you’ve written/collected). If you don’t have a common javascript library, create a folder called “js” off the root of your website, then plop a file in it called common.js. Inside common.js you want the following:
function flashFix(source, width, height) {
document.write('<object type="application/x-shockwave-flash" data="' + source + '" width="' + width + '" height="' + height + '">');
document.write('<param name="movie" value="' + source + '" />');
document.write('<param name="wmode" value="transparent" />');
document.write('<param name="quality" value="high" />');
document.write('<param name="allowscriptaccess" value="always" />');
document.write('<param name="menu" value="false" />');
document.write('</object>');
}
Then, in your site’s master page (or common header control, or header server side include, header.php, etc.) add a script reference in your head (<script type="text/javascript" src="/js/common.js"></script>
) to load up your script library on every page (or at least every page that you want to load up the “fix”).
Then, in your pages where you want to embed a flash control, here’s the code to use (change the “/flash/file.swf” references to the path and name of your flash object, and the 563 and 463 to width and height, respectively).
<script type="text/javascript">
flashFix("/flash/file.swf", 563, 463);
</script>
<noscript>
<object type="application/x-shockwave-flash" data="/flash/file.swf" width="563" height="463">
<param name="movie" value="/flash/file.swf" />
<param name="wmode" value="transparent" />
<param name="quality" value="high" />
<param name="allowscriptaccess" value="always" />
<param name="menu" value="false" />
</object>
</noscript>
That’s it. This works across all browsers that I’ve tested, and as long as your MSIE users have not disabled javascript no one will have to “Click to Activate” ever again; if your MSIE users HAVE disabled javascript then the flash object will still show up, it will just revert back to its default behavior, requiring a click to activate it.
It should be noted that this DOES NOT use the EMBED tag (since it’s not XHTML compliant), and does not use the the classid number for the Flash Player ActiveX control (clsid:D27CDB6E-AE6D-11cf-96B8-444553540000), streaming of larger flash files does not work in MSIE (the entire project must load before it starts playing). This is a problem with the implementation of the flash player for MSIE and (hopefully, eventually) a fix will be released to address the problem. In the meantime, if you need to stream your flash files, refer to Flash Satay: Embedding Flash While Supporting Standards by Drew McLellan for a workaround.
If you find this solution to be useful please feel free to add a link to your site in the comments. If you have ideas for improvement, the forum is open! 🙂
I have some trouble with Flash External Interface + Active Content+ Streaming Sounds in IE7. i hope i can bypass it