0

Is there a way to test whether a device supports Flash, similar to the way http://www.modernizr.com can feature-detect browsers and add a class to the body?

Sam Hanley
  • 4,707
  • 7
  • 35
  • 63
SparrwHawk
  • 13,581
  • 22
  • 61
  • 91

1 Answers1

1

The template files created by Flash or Flashbuilder etc. have javascript checks in place to verify the user has the correct flash player version installed, if not they are given the option to download the player. You can replace this download link with anything you want so it'll fall back on whatever you choose if there is no flash player present. Alternatively you can use the User-Agent HTTP Header to determine if they are using an iOS device and eliminate the possibility of them running flash entirely and then assume that if they have anything else they can install the flash player (yes I'm a bit bitter).

shaunhusain
  • 19,630
  • 4
  • 38
  • 51
  • Thanks @shaunhusain, can you suggest how to determine if it's an iOS device though - as in show me some code. Your method sounds good but I wouldn't know where to start. – SparrwHawk Jan 27 '12 at 20:15
  • In terms of where to look for the built in code that re-directs to the flash player download, are you using Flash IDE or Flashbuilder IDE? I know with Flashbuilder/eclipse whatever it generates an ACOETags.js file that's used if javascript is enabled in the browser to do the check and insert the appropriate plugin container or html into the main DOM. – shaunhusain Jan 27 '12 at 20:20