Home Articles FAQs XREF Games Software Instant Books About Feedback Search Site-Map
irt.org logo

Q1359 How can redirect depending on whether the browser has a QuickTime plug-in?

irt.org | Knowledge Base | JavaScript | Misc | Q1359 [ previous next ]

Q1359 How can redirect depending on whether the browser has a QuickTime plug-in?

Try this:

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

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

var mimetype = 'image/x-quicktime';

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('quicktime') !=-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 'Q1359 How can redirect depending on whether the browser has a QuickTime plug-in?'


Provide feedback ...
AddThis Social Bookmark Button

Provide feedback ... AddThis Social Bookmark Button


Last Updated: 30th March 2008. Maintained by: Martin Webb and Michel Plungjan
irt.org liability, trademark, document use, privacy statement and software licensing rules apply.
Copyright © 1996-2008 irt.org, All Rights Reserved.