javascript - swfobject not defined error -


i'm trying detect flash support, , i'm trying proceed in answer: cross browser flash detection in javascript

my code following, same error: swfobject not defined. shouldn't because i'm trying in browsers support flash (chrome , firefox).

if(swfobject){     console.log("you have swfobject.");      if(swfobject.hasflashplayerversion("1")){         console.log("you have flash!");     }     else{         console.log("you not flash :(");     } }else{     console.log("you don't have swfobject"); } 

is problem newest browsers? there other way detect it?

mdn page on flash led me through completly diferent path:

if(navigator.mimetypes["application/x-shockwave-flash"]){     var plugin = navigator.mimetypes["application/x-shockwave-flash"].enabledplugin;     var description = plugin.description;     var versionarray = description.match(/[\d.]+/g);     var flashversionosxscriptable = 12;     var flashversion = parseint(versionarray[0]);      if(navigator.useragent.indexof("mach-o")==-1){         if(flashversion >= flashversionosxscriptable){             console.log("you have flash");         }else{             console.log("you don't have flash");         }     } }else{     console.log("you don't have flash"); } 

Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -