Skip to main content
Known Participant
July 27, 2012
Question

Coldfusion – detecting Flash vs HTML5

  • July 27, 2012
  • 2 replies
  • 1799 views

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. 

    This topic has been closed for replies.

    2 replies

    BKBK
    Community Expert
    Community Expert
    April 16, 2014

    What about just serving the file using the cfmediaplayer tag, but without the type attribute.

    <cfmediaplayer name="player" source="my_music.flv"/>

    Inspiring
    April 16, 2014

    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

    Inspiring
    April 16, 2014

    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

    Dave Ferguson
    Participating Frequently
    April 16, 2014

    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.

    Inspiring
    April 16, 2014

    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