Detecting Flash Player blocking

Discuss how to use and promote Web standards with the Mozilla Gecko engine.
Post Reply
Geoff346
Posts: 2
Joined: July 16th, 2015, 5:07 am

Detecting Flash Player blocking

Post by Geoff346 »

Hi all,

I'm a content dev and I make both html5 and flash content.

On the back of recent notices it's becoming increasingly important to detect when flash player is being blocked, allowing me to display nice alternative content.

I already use swfobject for flash player detection of installed/not installed, but this doesn't reflect the blocked status....

Does anyone know of a way of detecting this?

I'm hoping there might be a flash.blocked = true property I can read via Javascript in firefox?

Thanks in advance!
User avatar
LoudNoise
New Member
Posts: 39900
Joined: October 18th, 2007, 1:45 pm
Location: Next door to the west

Re: Detecting Flash Player blocking

Post by LoudNoise »

Moving to Web Development.
Post wrangler
"Choose between the Food Select Feature or other Functions. If no food or function is chosen, Toast is the default."
User avatar
trolly
Moderator
Posts: 39851
Joined: August 22nd, 2005, 7:25 am

Re: Detecting Flash Player blocking

Post by trolly »

As far as I know blocking is done silently. The content is simply not requested.
A suggestion:
Provide HTML5 as default and fall back to flash if the content is not requested.
To check if the content is requested you can make an ajax call after a few seconds to check if the content was requested. Otherwise activate the flash object.
Think for yourself. Otherwise you have to believe what other people tell you.
A society based on individualism is an oxymoron. || Freedom is at first the freedom to starve.
Constitution says: One man, one vote. Supreme court says: One dollar, one vote.
User avatar
jscher2000
Posts: 11742
Joined: December 19th, 2004, 12:26 am
Location: Silicon Valley, CA USA
Contact:

Re: Detecting Flash Player blocking

Post by jscher2000 »

In the case of a soft block, where the user has the option to activate or not activate Flash, the site generally does not know about it.

Nor would you necessarily want to immediately switch away from Flash if the user simply prefers to choose Flash on a site-by-site basis depending on whether it looks useful.

I think I have seen some sites use a timeout: if Flash hasn't auto-started within a certain amount of time they assume it isn't going to work, and then they go to Plan B.
Geoff346
Posts: 2
Joined: July 16th, 2015, 5:07 am

Re: Detecting Flash Player blocking

Post by Geoff346 »

Thanks for the suggestions :)

The timeout route had crossed my mind, but I never like using timers where events or properties are accessible!

We're aiming to go HTML5 first for future situations, but unfortunately Flash does still have more power under the hood - and old spec computers (even ones with recent browsers) don't have the same performance.

I have come across 'Modernizr' and looks like their 3.0 beta picks up on a flash blocking property. I'll see how well that works....

Thanks!
User avatar
trolly
Moderator
Posts: 39851
Joined: August 22nd, 2005, 7:25 am

Re: Detecting Flash Player blocking

Post by trolly »

Another suggestion:
If flash is not loaded the access to the flash object should result in an error. Maybe this can be used to switch.
Think for yourself. Otherwise you have to believe what other people tell you.
A society based on individualism is an oxymoron. || Freedom is at first the freedom to starve.
Constitution says: One man, one vote. Supreme court says: One dollar, one vote.
User avatar
jscher2000
Posts: 11742
Joined: December 19th, 2004, 12:26 am
Location: Silicon Valley, CA USA
Contact:

Re: Detecting Flash Player blocking

Post by jscher2000 »

What I see with Modernizr is:

* Flash set to Always Activate: blocked=false (plugin notification icon appears)
* Flash set to Ask to Activate: blocked=true (no plugin notification icon appears)

Tested on: http://modernizr.github.io/Modernizr/test/index.html

Oh, Flash detection is in version 3 (beta): http://v3.modernizr.com/download/
Post Reply