Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org
#

Q1284 How can I detect if the user has a Flash plug-in?

You are here: irt.org | FAQ | DHTML | Q1284 [ previous next ]

Try:

<img name="testMime" src="test.swf">

<script language="JavaScript"><!--
var can_play = false;

var mimetype = 'application/x-shockwave-flash';

if (navigator.mimeTypes) {
   if (navigator.mimeTypes[mimetype] != null) {
      if (navigator.mimeTypes[mimetype].enabledPlugin != null) {
         can_play = true;
      }
   }
}

if (!can_play && navigator.appVersion.indexOf('MSIE') !=-1) {
   if (document.all && document.testMime.mimeType.toLowercase().indexOf('flash') !=-1)
      can_play = true;
   }
}

if (can_play)
   window.location = 'plug.html';
else
    window.location = 'noplug.html'; /* not necessary if this page is noplug.htm */
//--></script>

Feedback on 'Q1284 How can I detect if the user has a Flash plug-in?'

©2018 Martin Webb