Flash detection Javascript doesn't work in Firefox

C

Cliff R.

Hi, I use a handy little Javascript Flash detection script on a number
of sites (copied below). Usually works great, but I just started
trying Firefox and it's not working. A few browsers are referenced in
the script so I presume that Firefox needs to be added somewhere --
does anyone know how I could update this to be supported by Firefox?
Thanks!



<SCRIPT TYPE="text/JavaScript">
<!--
var MM_contentVersion = 5;
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)))
continue;
var MM_PluginVersion = words;
}
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 ) {
document.write('<OBJECT
classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
document.write('
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"
');
document.write(' ID="flash5" WIDTH=308 HEIGHT=68 ALIGN="">');
document.write(' <PARAM NAME=movie VALUE="/flash/logo.swf">
<PARAM NAME=loop VALUE=false> <PARAM NAME=quality VALUE=high> <PARAM
NAME=bgcolor VALUE=#4A3476> ');
document.write(' <EMBED src="/flash/logo.swf" loop=false
quality=high bgcolor=#4A3476 ');
document.write(' swLiveConnect=FALSE WIDTH=306 HEIGHT=68
NAME="flash5" ALIGN=""');
document.write(' TYPE="application/x-shockwave-flash"
PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">');
document.write(' </EMBED>');
document.write(' </OBJECT>');
} else{
document.write('<IMG SRC="/images/logo.gif" HEIGHT=68
WIDTH=306 BORDER=0>');
}
//-->
</SCRIPT><NOSCRIPT><IMG SRC="/images/logo.gif" HEIGHT=68 WIDTH=306
BORDER=0></NOSCRIPT>
 
M

Martin Honnen

Cliff said:
Hi, I use a handy little Javascript Flash detection script on a number
of sites (copied below). Usually works great, but I just started
trying Firefox and it's not working.

var MM_contentVersion = 5;
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)))
continue;
var MM_PluginVersion = words;
}
var MM_FlashCanPlay = MM_PluginVersion >= MM_contentVersion;
}


That part of the script is the part to check Netscape or other browsers
like Firefox having the navigator.mimeTypes collection so that script
works with Firefox, for instance when I run that part here with Firefox
1.0 and Shockwave Flash player 7.something installed the variable
MM_FlashCanPlay is true.
So what exactly happens for you when you say "doesn't work with
Firefox", any script errors?
What does
about:plugins
show, does that show Shockwave Flash for the MIME type
application/x-shockwave-flash?
 
C

Cliff R.

Hi -- when I said it doesn't work in Firefox, I mean that nothing is
showing where the Flash should be. Not the Flash itself or the image
that's supposed to show if there is no Flash player. And I don't see
any script errors, it's just not showing anything. I'm not sure what
all the elements of the script mean because I didn't write it, but I
do know that it's always worked.

But here's the weird thing, I just noticed that it works on some sites
and not on others (meaning the Flash movie does display). For
example, the same script works on http://www.skyblues.com/ but not on
http://www.bluerill.com/ . Any thoughts or help? Thank you!



Hi, I use a handy little Javascript Flash detection script on a number
of sites (copied below). Usually works great, but I just started
trying Firefox and it's not working.

var MM_contentVersion = 5;
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)))
continue;
var MM_PluginVersion = words;
}
var MM_FlashCanPlay = MM_PluginVersion >= MM_contentVersion;
}


That part of the script is the part to check Netscape or other browsers
like Firefox having the navigator.mimeTypes collection so that script
works with Firefox, for instance when I run that part here with Firefox
1.0 and Shockwave Flash player 7.something installed the variable
MM_FlashCanPlay is true.
So what exactly happens for you when you say "doesn't work with
Firefox", any script errors?
What does
about:plugins
show, does that show Shockwave Flash for the MIME type
application/x-shockwave-flash?
 
M

Martin Honnen

Cliff said:
when I said it doesn't work in Firefox, I mean that nothing is
showing where the Flash should be. Not the Flash itself or the image
that's supposed to show if there is no Flash player. And I don't see
any script errors, it's just not showing anything.
But here's the weird thing, I just noticed that it works on some sites
and not on others (meaning the Flash movie does display). For
example, the same script works on http://www.skyblues.com/ but not on
http://www.bluerill.com/ .

I see Flash movies on http://www.bluerill.com/ with Firefox 1.0, I
haven't checked how many the page source includes and whether all are
there but there is Flash visible on the page.
 
C

Cliff R.

Weird, I have Firefox 1.0 also and I'm just seeing 2 empty blue spaces
where the Flash animations should be (there are 2 animations on that
page). I checked to make sure Javascript is enabled and it is. Any
other thoughts on why this might be?

Thank you for your help!
 
M

Martin Honnen

Cliff said:
I have Firefox 1.0 also and I'm just seeing 2 empty blue spaces
where the Flash animations should be (there are 2 animations on that
page). I checked to make sure Javascript is enabled and it is. Any
other thoughts on why this might be?

Not really, other than checking
about:plugins
to see whether Firefox correctly finds the Flash player and the right
version of it.
Then to find out what the problem could be I would start by using static
HTML markup to embed the Flash (e.g. <embed ...>) and see whether that
is rendered by Firefox. Only if it is I would look at the script again
as then it is likely that the script use is the cause of the problem.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,969
Messages
2,570,161
Members
46,705
Latest member
Stefkari24

Latest Threads

Top