how to detect flash using SWFObject
Asked Answered
S

2

14

I have downloaded SWFObject, and included it in my website. Now I want to simply get a true or false value based on whether or not Flash is installed in the users browser when they visit my site.

How can I do this?

Sonni answered 19/4, 2011 at 13:24 Comment(4)
I don't think that's what swfobject is for.Bourassa
I think that's exactly what SWFObject is for...Sonni
OK, I guess I'm wrong. I was going from the fact that the main use of it is just to embed Flash in a page, given a minimum version. But I guess it has detection features you can access directly as well.Bourassa
version detection is automatic with SWFObject. swfobject.embedSWF() function has version control and will display alternate content for a flash player installer if you set it up correctly.Zymogenesis
I
27
if (swfobject.hasFlashPlayerVersion("9.0.18")) {
  // has Flash
}
else {
  // no Flash
}

or replace "9.0.18" with the minimum version you require

Instructor answered 19/4, 2011 at 13:31 Comment(0)
A
1

If You use jQuery SWFObject you could use:

if (!$.flash.hasVersion('9')) {
 //has Flash
}
else {
 //no_flash
}
Autosome answered 24/10, 2012 at 0:29 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.