Answer the question
In order to leave comments, you need to log in
How to use javascript to determine if flash is installed in the browser or not?
There was such task, it is necessary to check javascript'om whether flash is supported in the browser or not.
If flash is supported, we include a flash player, if not, then an HTML5 player.
Answer the question
In order to leave comments, you need to log in
If anyone else needs it, here's the solution:
var checkIfFlashEnabled = function() {
var isFlashEnabled = false;
// Проверка для всех браузеров, кроме IE
if (typeof(navigator.plugins)!="undefined" && typeof(navigator.plugins["Shockwave Flash"])=="object") isFlashEnabled = true;
else if (typeof window.ActiveXObject !="undefined") {
// Проверка для IE
try {
if (new ActiveXObject("ShockwaveFlash.ShockwaveFlash")) isFlashEnabled = true;
} catch(e) {};
};
return isFlashEnabled;
};
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question