How to determine if quicktime is installed using javascript?

I want to play a sound notification, so I used the method described here: Cross-platform, cross-browser way to play sound from Javascript? However, when quicktime is not installed on the client machine, every time a function is called soundPlay, a Windows popup window appears. It says that quicktime is not installed and offers to install it.

For the convenience of users, I would not bother users without a quick time:

function hasQuickTime() {
  // how do I know ?
}

// play sound only if quickTime is installed
if (hasQuickTime()) {
  soundPlay();
}
+5
source share
1 answer

. Apple JavaScript: QuickTime JavaScript

var haveqt = false;

if (navigator.plugins) {
    for (i=0; i < navigator.plugins.length; i++ ) {
        if (navigator.plugins[i].name.indexOf
        ("QuickTime") >= 0)
        { haveqt = true; }
    }
}

if ((navigator.appVersion.indexOf("Mac") > 0)
    && (navigator.appName.substring(0,9) == "Microsoft")
    && (parseInt(navigator.appVersion) < 5) )
{ haveqt = true; }

haveqt QuickTime.

+6

All Articles