MozillaZine

Detecting Flash Player blocking

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

Post Posted July 16th, 2015, 7:20 am

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!

LoudNoise
New Member

User avatar
 
Posts: 40048
Joined: October 18th, 2007, 1:45 pm
Location: Next door to the west

Post Posted July 16th, 2015, 7:23 am

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."

trolly
Moderator

User avatar
 
Posts: 39908
Joined: August 22nd, 2005, 7:25 am

Post Posted July 16th, 2015, 10:52 am

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.

jscher2000

User avatar
 
Posts: 10715
Joined: December 19th, 2004, 12:26 am
Location: Silicon Valley, CA USA

Post Posted July 16th, 2015, 4:27 pm

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

Post Posted July 17th, 2015, 12:12 am

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!

trolly
Moderator

User avatar
 
Posts: 39908
Joined: August 22nd, 2005, 7:25 am

Post Posted July 17th, 2015, 1:58 am

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.

jscher2000

User avatar
 
Posts: 10715
Joined: December 19th, 2004, 12:26 am
Location: Silicon Valley, CA USA

Post Posted July 17th, 2015, 4:39 pm

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/

Return to Web Development / Standards Evangelism


Who is online

Users browsing this forum: No registered users and 1 guest