Copy link to clipboard
Copied
Hi all – I have a dumb question – I’m not the worlds best scripter…
I’ve got a ColdFusion page, with an element in it that is either flash, or HTML5.
I need a way to detect what is happening client-side and push the client to either the Flash element, or the HTML element (or a s “you’re WAY behind the times” element if neither).
I’ve found, and used, modernizr, but it does things the wrong way round for me. I need to direct my clients to flash 1st, then HTML5, then the sorry page. Modernizr only gives me HTML 5 first then Flash, and this isn’t working for me. the flash element is the preferred element. I’ve screwed around with trying to “swap out” modernizr, but my glasses aren’t thick enough.
Thus, I (roughly) need something that does this:
<cfif “flash”>
Direct them to flash page
<cfelseif “html5”>
Direct them to HTML 5 page
<cfelse>
So, how is life in the 18th century?
</cfif>
Help, please.. It does not have to be CFM, it can be a JavaScript or anything.
Copy link to clipboard
Copied
Did you ever find a solution to this?
I posted a similar issue, I can't find any way to detect flash in CF. There must be a way with them both being Adobe products
Thanks
Mark
Copy link to clipboard
Copied
Detecting flash is not a server side issue it is a client issue. A user having / not having flash doesn't mean anything to CF.
Copy link to clipboard
Copied
understood
I read there was a flash player detection script. I found a link on here
http://www.raymondcamden.com/index.cfm/2006/2/21/Ask-a-Jedi-Flash-Detection
However, when I go to the link, it does not work.
http://www.macromedia.com/software/flashplayer/download/detection_kit/
I did a search on adobe dev and can't find anything, it just runs me around in circles
Copy link to clipboard
Copied
Flash detection is all client side. Just do a google search for flash detection.. there are tons of resources. Just make sure you use somethign that is recent. The post you mention from above from Ray is 8 years old and probably not relevent anymore.
Copy link to clipboard
Copied
I am going to try looking at the user agent info to see if there are some indicators in there that might tell me it's in there or not. Although it would concern me that an install and uninstall might not change the header back
Copy link to clipboard
Copied
The user agent will tell you what the browser is. You have to check browser capabilities, not what the browser can do. Again, the detection has to be done on the client.
Copy link to clipboard
Copied
I was hoping that there might have been something written into the user agent, but it looks like there isn't
I just took a look here http://useragent.cc/
I see javascript values that detect it, but they won't be any good for my purpose.
Shame that the install does not tweak up the user agent description so it could then be found server side
Looks like a lost cause
Copy link to clipboard
Copied
If I read this correctly, there may be a solution
https://www.cyscape.com/products/bhawk/workshop/detect-flash.aspx?bhcp=1#exampleinaction
Copy link to clipboard
Copied
I would be curious to see the code the custom tag in BrowserHawk generates.
Copy link to clipboard
Copied
What about just serving the file using the cfmediaplayer tag, but without the type attribute.
<cfmediaplayer name="player" source="my_music.flv"/>
Copy link to clipboard
Copied
In my case I'm not playing a video, I have a peel ad that runs in the corner of the page, currently in flash, but I just got a Jquery version running that does not need flash, however it does not look quite as good so I want to display the flash whenever I can, however it looks like that is going to be a problem so I think I'll just go with the Jquery on all hits