View Full Version : if flash player is not available in the sytem...
illangoo
02-07-2008, 07:03 AM
Hi all ,
I need to inform or display alrert msg to viewer if flash player is not available in the sytem when they are are watching my flash file in web site... now its looking blank is there any script available for that,Please let me know.
Thanks,
g.bhaga
02-07-2008, 09:44 AM
This one is done by javascript. This scipt will check the viewer have flash player in his/her system. If the person not have the flash player, the script automatically redirect the page in to a static html page. For this what you can do is create one static html page (yourpage.html).
<SCRIPT language="JavaScript">
<!--
var MM_contentVersion = 6;
var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
if ( plugin ) {
var words = navigator.plugins["Shockwave Flash"].description.split(" ");
for (var i = 0; i < words.length; ++i)
{
if (isNaN(parseInt(words[i])))
continue;
var MM_PluginVersion = words[i];
}
var MM_FlashCanPlay = MM_PluginVersion >= MM_contentVersion;
}
else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 && (navigator.appVersion.indexOf("Win") != -1)) {
document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n'); //FS hide this from IE4.5 Mac by splitting the tag
document.write('on error resume next \n');
document.write('MM_FlashCanPlay = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & MM_contentVersion)))\n');
document.write('</SCR' + 'IPT\> \n');
}
if ( MM_FlashCanPlay ) {
//alert('flash');
} else{
//alert('no flash');
}
//-->
reDirection = 0;
for(var i=0; i<=15; i++)
{
flashVersion = 0;
try
{
var flash = new ActiveXObject("ShockwaveFlash.ShockwaveFlash." + i);
flashVersion = i;
if(i==8||i==9)
{
//latest version flash 8.0 or higher version
reDirection = 1;
}
}
catch(e)
{
}
}
if(reDirection==0)
{
window.location = "yourpage.html";
}
</SCRIPT>
razta
02-12-2008, 05:18 PM
The javascript does not work in IE7, it just automatically redirects to "yourpage.html" weather flash is installed or not. Know of any fix for this?
atomic
02-12-2008, 05:39 PM
Use the swfObject to embed your movie...
http://blog.deconcept.com/swfobject/
And it's ExpressInstall feature...
http://blog.deconcept.com/swfobject/#expressinstall
razta
02-12-2008, 10:18 PM
Nice one! Will have a look at the code and see If I can implement it into my site.
atomic
02-12-2008, 10:40 PM
Grrrrreat! ;)
|
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.