views:

199

answers:

2

Is there a way in GWT to check if the browser running is supporting Flash?

+1  A: 

Check out swfobject, and particularly you might want to check out this method:

swfobject.hasFlashPlayerVersion(versionStr)

API docs here.

Of course, if swfobject is too big you could just check the sources to see how they do it. I'm not sure if it's possible that you could get a proper return value from that method even if the Flash player is somehow disabled but in that case I suppose you could simply try and embed a swf with swfobject and see if it worked, there's a callback that tell's you wether the embedding was successful or not, check the api docs for more info.

macke
+1  A: 

The simplest solution was to incorporate the Flash detection KIT as a native java script call.

Drejc
Actually, Adobe's Flash Detection Kit is all but obsolete at this point. In fact, as of Flex 4, Adobe actually officially supports swfobject (2.2) instead, even bundling it with Flash Builder 4. FDKIT should really have been put offline by now in my opinion, but I guess it's not really a high priority issue at Adobe.
macke
Probably the swfobject solution is the more correct from the developers view. But it just to heavyweight for my purpose. So I went with the simple and working solution of the detection kit.
Drejc