Getting the flash player version in IE (SWFObject v2.2)
I'm using the swfobject.js file from http://code.google.com/p/swfobject/. I'm trying to see if the user has Flash installed AND active. It is supposed to displays the version n开发者_如何转开发umber as 0.0.0 when it is installed but disabled. This page alerts 0.0.0 when I disable Flash. That's what I want.
If i copy the source code from the page above, and run it from my desktop - it works fine. I then try to use the same code, but on my IIS, and it gives me the installed version, even though it is disabled. Could it have something to do with MIME-mapping?
I'm using the following code:
var playerVersion = swfobject.getFlashPlayerVersion();
var output = "You have Flash player " + playerVersion.major +
"." + playerVersion.minor + "." + playerVersion.release +
" installed";
alert(output);
EDIT: Firefox correctly alerts 0.0.0 when I disable Flash. IE does not.You have made a false assumption -- SWFObject does not claim to return 0.0.0 when Flash is installed but not active. It may be a byproduct of Flash Player handling in non-IE browsers, but it is not an official SWFObject feature.
(You can read the swfobject.getFlashPlayerVersion
API documentation here)
SWFObject detects whether Flash Player is installed, it does not check to see whether it has been disabled by the user. In fact, it is nearly impossible to reliably detect whether Flash has been disabled by the user due to the various ways browsers implement their Flash Player plugins. Similarly, Flash developers who use SWFObject frequently have issues with end-users who install browser extensions like AdBlock and FlashBlock.
精彩评论