0

The question is very simple, I hope the solution too.

I have a flash player that I use for streaming sound via rtmp. When I visit the website with a browser that doesn't support flash I get an ugly grey square. So I was thinking it would be great if I could hide that div if flash is not enabled, or if the browser doesn't support it. Pretty much the same way one can hide stuff using media-query for different screen sizes.

Is that possible? And if so..how?

Thank you!

Edvard Haugland
  • 125
  • 1
  • 9
  • [Cross Browser Flash Detection in Javascript](http://stackoverflow.com/questions/159261/cross-browser-flash-detection-in-javascript) – Andreas Jun 05 '13 at 16:46

1 Answers1

0

You can use a library like SWFObject and check if the browser has flash.

if(!swfobject.hasFlashPlayerVersion("1"))
{
    var flashObjects = document.getElementsByTagName("object");
    for(var i=0;i<flashObjects.length;i++)
    {
        flashObjects[i].style.display = "none";
    }
}
Parthik Gosar
  • 10,998
  • 3
  • 24
  • 16