0

I have another question which i think is most easily solved by using javascript to find out if flash exist or not and dynamically modify the page. In my case place a placeholder, call jcupload code if flash exist or replace the placeholding div with my html

But the problem is i havent been able to find any javascript functions to tell me if flash is installed. All i found were html that displays alt html if flash isnt shown/enabled.

3 Answers 3

2

http://www.featureblend.com/javascript-flash-detection-library.html works for me every time.

Sign up to request clarification or add additional context in comments.

1 Comment

I tried it out, it was easy :) jsfiddle.net/d56MZ -edit- the text generate the **required** HTML is pretty scary. Lucky i didnt have to do anything more then my link
0

http://www.adobe.com/products/flashplayer/download/detection_kit/

here you go check the client side map

Comments

0

Chris's answer is probably the simplest given your situation, where your upload control handles the embedding, but for future readers it's worth checking out swfobject, which can handle both the feature detection and the embedding. I believe something like this would work:

if (swfobject.getFlashPlayerVersion().major === 0)
{
    // Do alternate content stuff
}
else
{
    swfobject.embedSWF(flashUrl, "jcupload_content", width, height, "10.0.0", expressInstallUrl,
                       {}
                       { menu: "false", allowScriptAccess: "always", scale: "noScale", wmode: "transparent", salign: "lt" },
                       {});
}

Substitute in your own flashUrl, width, height, and expressInstallUrl values. You can use the second parameter to supply flashvars, the third to customize the params to the embedding, and the fourth to customize any attributes you want the resulting object or embed tags to have.

2 Comments

you seem to like swfobject a little too much ;). Using the js function i was able to solve this in <5mins. One line in my html app, another line added in jcupload and one jquery line in my js file to show the hidden alternative html. easy! It beats modifying min JS source or even 'other ppl code'
For sure :). As I said, this is for future users who come here after searching for "JavaScript flash detection" or something like that.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.