Skip to main content
Known Participant
July 13, 2010
Question

Flash detection in embed code

  • July 13, 2010
  • 1 reply
  • 1208 views

How can I detect if the user has flash within the embed code I distribute?

I have my custom videoplayer created in flash, I have a share option and the user gets a embed string to use.

Then if the user is viewing the embedded video from an iphone with no flash, I want to be able to replace my player with a youtube video.

Is this possible..?

This topic has been closed for replies.

1 reply

Inspiring
July 13, 2010

It can be done with JavaScript or on the server side. Both can read information about operating system.

In JavaScript it is:

navigator.appVersion

Known Participant
July 15, 2010

But is it possible to pull this info into the embed code?

I want the embed code to primary chose my flashplayer and if not possible, a mp4 file.

I heard that iphones cant read flash or javascript so I need a solution that will work for both platforms

Like this example:

<object width="640" height="360">

IF FLASH POSSIBLE:

<param name="movie" value="pathToMyFlashPlayerMovie"></param><param name="allowFullScreen" value="true"></param><param name="allowScriptAccess" value="always"></param><embed src="pathToMyFlashPlayerMovie" type="application/x-shockwave-flash" allowfullscreen="true" allowScriptAccess="always" width="640" height="360"></embed>

IF FLASH NOT POSSIBLE:

<Embed a html5 mp4 instead.>

</object>

Kartik_Mehta
Inspiring
July 15, 2010

Go for swfobject It will detect for flash player if not available it will show the alternate content will be your html5 content