How to check if browser supports flash?

I have a flash banner that I want to replace with a static image if the flash is not enabled in the client browser.

I was wondering if I can do this with php - or if anyone knows a good method

thanks

+1
source share
5 answers

You can only do this with javascript using navigator.plugins . Sort of:

 if(typeof navigator.plugins['Shockwave Flash']!=='undefined'){ } 

However, a much more reliable solution that does not require any javascript will simply position your backup image behind the flash object, so that if the flash does not appear, the image will be displayed. You can put the <img/> inside the <object/> flash, or you can put the CSS background image on the object.

+5
source

Allow <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 also cannot load.

+7
source

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

This is what I use when I need to embed flash memory and it checks for support and what items are needed.

+3
source

I do not think that you can check using PHP, you can do it using javascript or ActionScript from a SWF file. Here is the official detection kit:

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

+1
source

You can use SWFobject

An alternative code is displayed in the SWF object by default, for example

 <div id="myContent"> <p>Alternative content</p> </div> 

This place is then replaced whenever possible using flash content as follows:

 <script type="text/javascript"> swfobject.embedSWF("myContent.swf", "myContent", "300", "120", "9.0.0"); </script> 

It has a dependency on JavaScript, although this is the only major flaw

0
source

Source: https://habr.com/ru/post/912056/


All Articles