hello all,
I have a flash banner that I want to replace with a static image if the clients browser doesn't have flash enabled.
I was wondering if I can do this with php - or if anyone knows of a good method
Thanks
hello all,
I have a flash banner that I want to replace with a static image if the clients browser doesn't have flash enabled.
I was wondering if I can do this with php - or if anyone knows of a good method
Thanks
http://code.google.com/p/swfobject/
This is what I use when i need to embed flash and it checks for relavent support and what elements are needed.
I don't think you can check with PHP, you can do it with javascript or Actionscript from SWF file. Here is the official detection kit:
http://www.adobe.com/products/flashplayer/download/detection_kit/
You can only do this with javascript, using the navigator.plugins
interface. Something like:
if(typeof navigator.plugins['Shockwave Flash']!=='undefined'){ }
However, a far more reliable solution that doesn't require any javascript would be simply to position your fallback image "behind" the flash object so that if the flash doesn't turn up, the image will show through. You can either put an <img/>
tag inside the flash <object/>
or you can put a CSS background-image on the object.
Allow the <object>
(your Flash movie) to degrade:
<object width="640" height="480">
<param name="movie" value="yourflash.swf">
<img src="yourimage.png">
</object>
This will show the image if the Flash video can't load, too.
You could use SWFobject
With SWFobject you display alternative code by default, e.g.
<div id="myContent">
<p>Alternative content</p>
</div>
This is then replaced where possible with flash content like this:
<script type="text/javascript">
swfobject.embedSWF("myContent.swf", "myContent", "300", "120", "9.0.0");
</script>
It does have a dependency on JavaScript though which is its only major drawback