Caught Redhanded: QuickTime Stealing Flash
Sometimes QuickTime may take over handling Flash content. As QuickTime is only compatible with Flash 5, this can pose major problems. Here’s some code which detects if QuickTime is handling Flash:
var qtFlash = false; // Is QuickTime rendering Flash?
var flashPlugin = navigator.plugins['Shockwave Flash'];
for(var i = 0; i < navigator.mimeTypes.length; i++) {
var mime = navigator.mimeTypes[i];
if(mime.type == 'application/x-shockwave-flash'
&& mime.enabledPlugin != flashPlugin) {
qtFlash = true;
break;
}
}
[Update April 28, 2006] If there are multiple Flash versions installed this test won’t work. Instead try this:
var qtFlash = false; // Is QuickTime rendering Flash?
var flashVersion = 7; // Stub for real detection code
for(var i = 0; i < navigator.mimeTypes.length; i++) {
var mime = navigator.mimeTypes[i];
if(mime.type == 'application/x-shockwave-flash'
&& !new RegExp('.*Shockwave\\sFlash\\s' + flashVersion
+ '.*').exec(mime.enabledPlugin.description)) {
qtFlash = true;
break;
}
}
If you want to test this see these Mozilla guidelines and apply them in reverse order.
This workaround doesn’t work in IE, though, which leaves me wondering how to detect QuickTime for that browser. Here’s the Flash detection code for IE in sIFR:
if(this.ieWin) {
try {
this.flashVersion = parseFloat(
new ActiveXObject('ShockwaveFlash.ShockwaveFlash.7')
.GetVariable('$version').match(/([\d,?]+)/)[1].replace(/,/g, '.')
);
} catch(e) {}
}
I haven’t been able to get IE to use QuickTime, so the question is: will IE be able to create a Shockwave Flash object if QuickTime is handling Flash? If not, problem solved. If so, any ideas on detecting QuickTime?



