Flash Detection and Alternative Content

Posted in tutorials, web | July 27th, 2010. Trackback URI: trackback

Although Flash is reaching more and more devices every day and expects to be on 50% of all mobile devices by 2012, it is always a good idea to have alternative content for older devices that can not support Flash, or users that choose to disable it.

Here are a few quick ways for web designers/developers to display alternative content for devices without Flash.

1) Embed Code


	
	
		
	
	Alternative content
	
		
	

2) SWFObject

http://code.google.com/p/swfobject/

You can display the alternative content in the <div> that you are writting the Flash object to. If you wish to do other things (redirects or content changes) you can detect if Flash is installed with the JavaScript below.

     var flashSupported = document.getElementById('myContent');
     // if flash is not supported then go to a HTML page
     if( flashSupported.innerHTML.indexOf('embed') == -1 )
          document.location.href="noFlash.html";

3) Flash Player Detection Kit

The Flash® Player Detection Kit helps developers implement robust player detection for a variety of deployment environments by providing a set of templates and techniques to successfully detect the version of Flash Player installed on a user’s computer, and, if needed, to then install the latest version of Flash Player. The kit also includes a detailed explanation and sample files for implementing the new, player-based Flash Player Express Install experience.

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

4) User Agent

If you have some programming knowledge you can check the User Agent sent from the browser. If you know the agents that do not have Flash support or you would like to show alternative content this is easily done.

List of User Agents

http://www.user-agents.org/

C#

Request.UserAgent

PHP

$_SERVER['HTTP_USER_AGENT']

JavaScript

http://www.quirksmode.org/js/detect.html

Posted by Beau Durrant

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)
Ping This!

No Responses to “Flash Detection and Alternative Content”

Leave a Reply

Spam Protection by WP-SpamFree