Find pluin for Midi : PlugIn « Development « JavaScript DHTML






Find pluin for Midi

<html>
<head>
<script language="JavaScript">
<!--
var extNeed, namePlug;

function findPlugin(ext) {
  var thisExt, findExt;
  extNeed = ext;
  for (var n=0; n < navigator.plugins.length; n++) {
      for (var m=0; m < navigator.plugins[n].length; m++) {
          thisExt = navigator.plugins[n][m].description.toLowerCase();
          findExt = thisExt.substring(0, thisExt.indexOf(" "));
          if (findExt == ext) {
             namePlug = navigator.plugins[n].name;
             return(true);
          }
      }
  }
  return(false);
}

if (findPlugin("midi")) {
   alert("A plug-in for " + namePlug +" is installed.");
}else {
   alert("A plug-in application to play ." + extNeed + " files is not installed!");
}
//-->
</script>
</head>
</html>



           
       








Related examples in the same category

1. Listing Plug-In Properties
2.Synchronizing Two Plug-Ins
3. Accessing a Plug-In
4.Determining Whether the LiveVideo Plug-In Is Installed
5.JavaScript to enumerate and display all installed plug-ins
6.Displaying Plug-In Information
7.Display PDF using plugin
8.Scan through each plug-in by provided parameters
9.Displaying a List of Navigator Plug-Ins
10.Properties of the Plugin Object