Skip navigation
Currently Being Moderated

Coldfusion – detecting Flash vs HTML5

Jul 27, 2012 1:43 AM

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. 

 
Replies
  • Currently Being Moderated
    Apr 16, 2014 8:44 AM   in reply to Jellyhead

    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

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 16, 2014 8:47 AM   in reply to ACS LLC

    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.

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 16, 2014 8:57 AM   in reply to fergusondj

    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-Dete ction

     

    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

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 16, 2014 9:09 AM   in reply to ACS LLC

    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.

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 16, 2014 9:15 AM   in reply to fergusondj

    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

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 16, 2014 9:18 AM   in reply to ACS LLC

    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.

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 16, 2014 9:21 AM   in reply to fergusondj

    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

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 16, 2014 9:24 AM   in reply to fergusondj
     
    |
    Mark as:
  • Currently Being Moderated
    Apr 16, 2014 9:42 AM   in reply to ACS LLC

    I would be curious to see the code the custom tag in BrowserHawk generates.

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 16, 2014 10:51 AM   in reply to Jellyhead

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

     

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

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 16, 2014 10:54 AM   in reply to BKBK

    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

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points