SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Addict sstaubin01's Avatar
    Join Date
    Nov 2000
    Location
    Ont, Canada
    Posts
    234
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Detecting Flash Player with PHP

    I have a page that runs a .swf movie. It was created with Live Motion 2. A user complains he cannot see the movie with his browser but is able to see other flash movies. I use an Object tag to run the movie. Here is the code:
    Code:
    <OBJECT CLASSID="clsid27CDB6E-AE6D-11cf-96B8-444553540000" 
    CODEBASE="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" 
    ID="AboutTheArtist" WIDTH="435" HEIGHT="25"> 
    <PARAM NAME=movie VALUE="AboutTheArtist.swf"> 
    <PARAM NAME=quality VALUE=high> 
    <PARAM NAME=bgcolor VALUE=#ffffff> 
    <EMBED SRC="AboutTheArtist.swf" QUALITY=high BGCOLOR=#ffffff WIDTH="435" HEIGHT="25" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"> </EMBED> 
    </OBJECT>
    Is there a way PHP can detect if the user is capable of playing the movie, if not display a static image instead?

    Check out the site at http://mylittlechampion.com

  2. #2
    SitePoint Evangelist cyngon's Avatar
    Join Date
    Aug 2001
    Location
    Livonia, MI, USA
    Posts
    513
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I don't think its possible to do with PHP because PHP is a server-side language.

    PHP would only be able to determine if a browser has flash installed if that information was passed in the headers along with the browser version and platform, etc., which it isn't (as far as I know).

    It can, however, be done using Javascript. Some basic detection scripts are available here:

    http://www.dithered.com/javascript/flash.html

    With those, I suspect it would be a simple matter to detect if a browser is flash enabled and then document.write either the code for the flash movie, or a static image.

    -Bryan

  3. #3
    SitePoint Zealot webQS's Avatar
    Join Date
    Oct 2002
    Location
    Sydney : Australia
    Posts
    144
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •