Is there a way to detect Flash blockers?

I am wondering if there is a Javascript way to determine if the user has any flash blocking plugin, so I can correctly place these users.

For example, I use click to flash, but sites that use SiFR to render text are dotted with click to flash buttons, which is very annoying. For this reason, I do not use SiFR in my projects. But if I could notice that a flash-lock plugin is installed, I would simply not name the SiFR function.

Any ideas?

+6
javascript plugins flash
source share
2 answers

Take a look at http://www.adobe.com/support/flash/publishexport/scriptingwithflash/scriptingwithflash_03.html . You can call the following after the page loads.

var movie = window.document.movie; try { //if the movie is blocked then PercentLoaded() should through an exception if (movie.PercentLoaded() > 0) { //Movie loaded or is loading } } catch (e) { //Movie is blocked } 
+4
source share

soundmanager2 The JS library uses the PercentLoaded link function.
Excerpts:

 return (flash && 'PercentLoaded' in flash ? flash.PercentLoaded() : null); 

Interesting syntax notes ... Modified Flash / ExternalInterface (ActiveX / NPAPI) methods are not functions like "function" and instanceof Function, but are still valid. In addition, JSLint does not like ("PercentLoaded in flash") syntax and recommends hasOwnProperty (), which in this case does not work. In addition, using (flash && flash.PercentLoaded) causes IE to throw "the object does not support this property or method." Therefore, you must use the syntax.

This page may be useful for getting a link to a Flash movie.

+2
source share

All Articles