19 lines
561 B
JavaScript
19 lines
561 B
JavaScript
var hasFlash = false;
|
|
|
|
// Check if the browser can play Flash content
|
|
try {
|
|
hasFlash = Boolean(new ActiveXObject('ShockwaveFlash.ShockwaveFlash'));
|
|
} catch(exception) {
|
|
hasFlash = ('undefined' != typeof navigator.mimeTypes['application/x-shockwave-flash']);
|
|
}
|
|
|
|
// Function to embed Flash content, or if Flash is not present, either load server-side
|
|
// Ruffle on modern systems or let the user know to install Flash or Ruffle otherwise.
|
|
function embedFlash(swf) {
|
|
if (hasFlash) {
|
|
document.write('a');
|
|
} else {
|
|
document.write('b');
|
|
}
|
|
}
|