• Resolved pbwordp

    (@pbwordp)


    Hello there, I have a Flash animation on the “header” of my blog and need some help with the following issues.

    *I need a script to detect the flash player. If player is not available, then to redirect and open a .jpg file on the “header” instead. The script can’t redirect to a new page only to load on the “header” a different format file in the player’s absence.

    Thanks!!

Viewing 5 replies - 1 through 5 (of 5 total)
  • are you wanting to use php to detect the player? I just read this on php flash detection:

    <?php
    if(eregi(“application/x-shockwave-flash”, $_SERVER[‘HTTP_ACCEPT’]))
    {
    PRINT_FLASH_CONTENT
    } else {
    PRINT_IMAGE_FILE
    }
    ?>

    I took the comments out but you can find that (almost) exact same snippet at http://www.sitepoint.com/article/techniques-unearthed/5/

    As far as using javascript you’d just have to search for it a little bit. I’m not that great with javascript :/

    Thread Starter pbwordp

    (@pbwordp)

    There seems to be a conflict with the code because nothing loads in the browser, not even the post. Is there something in the code I’m not writing properly?

    here is what I have:

    <?php
    
if(eregi(“application/x-shockwave-flash”, $_SERVER[‘HTTP_ACCEPT’]))
    
{
    <object classid=”….. This is the flash object etc…
    } else {
    <img src=”my_folder/my_image.jpg”>…. this is the image path.
    ?>

    You need to close the php tags and reopen them, like:

    <?php
    
if(eregi(“application/x-shockwave-flash”, $_SERVER[‘HTTP_ACCEPT’]))
    
{ ?>

    <object classid=”….. This is the flash object etc…

    <?php } else { ?>

    <img src=”my_folder/my_image.jpg”>…. this is the image path.

    <?php } ?>

    Thread Starter pbwordp

    (@pbwordp)

    Thanks Adam, but I can’t get the code to work, it just opens the .jpg image straight forward, ignoring the flash object.

    Any thought on why is bypassing the first lines?

    ok I tested the $_SERVER[‘HTTP_ACCEPT’] part and apparently that doesn’t always read like I thought/understood it to. I’ve read all over the net that php flash detection is pretty much impossible, although I’m sure there’s got to be some way to do it. That being said, I found a group of files on the Adobe website that use javascript to detect if flash is there and if not, display an image. They also work so that if javascript is disabled, it assumes no flash and display the image. The files can be found at http://kb2.adobe.com/cps/141/tn_14147.html . All you need to do is plug in the image info and the movie info. I tested these files and they seem to work great in firefox (only browser I tested).

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Flash header/detect/redirect’ is closed to new replies.