Page 1 of 2

Unexpected behaviour - embedded Flash abc.net.au

Posted: Wed Oct 14, 2009 3:51 pm
by Grumpy Old Lady
A heads-up about unexpected embedded flash video placeholder behaviour.

NS 1.9.9.11, all defaults except - block all "Embedded" on trusted.
abc.net.au whitelisted.


Steps to show unexpected behaviour:

Navigate to

http://www.abc.net.au/news/video/2009/10/14/2714488.htm,
Flash placeholder displays, choose Temp Allow blocked embedded, only audio plays. Expect video presentation, so refresh page.

Video presentation plays.

A variation of this isolated audio is on this page
http://www.abc.net.au/news/stories/2009 ... 714431.htm
Steps to show:
Choose Video link in the page
Flash placeholder is then displayed.
Choose Temp Allow Flash Embedded, audio but no video plays.
Refreshing page (or the video link - either is the same behaviour) reverts status to no placeholder. Refreshing again shows video playing as expected.
Refreshing page reverts to no video.
Refreshing page shows video as expected
Repeat ad infinitum.


Sorry I can't be around to follow up but I thought these examples were notable.

Re: Unexpected behaviour - embedded Flash abc.net.au

Posted: Wed Oct 14, 2009 4:10 pm
by therube
Both working as expected for me. Getting both audio & video, first time.

SeaMonkey 1.1.18, NoScript 1.9.9.10, Win XP.

EDIT: No issue with NoScript 1.9.9.11 either.


(Can't test SeaMonkey 2 at the moment.)

Re: Unexpected behaviour - embedded Flash abc.net.au

Posted: Wed Oct 14, 2009 4:14 pm
by Alan Baxter
Grumpy Old Lady wrote:http://www.abc.net.au/news/video/2009/10/14/2714488.htm,
Flash placeholder displays, choose Temp Allow blocked embedded, only audio plays. Expect video presentation, so refresh page.

Video presentation plays.
Confirmed.
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3
NoScript 1.9.9.11

Re: Unexpected behaviour - embedded Flash abc.net.au

Posted: Wed Oct 14, 2009 5:54 pm
by Giorgio Maone
It's the expected behavior, unluckily.
The size of the player is set to 0 pixels initially, and only adjusted as soon as the page finishes to load.
When you click the placeholder is already too late, and player's height sticks to 0.

However, NoScript the Almighty (TM) will save your day again, thanks to its powerful surrogate scripts.
Just open about:config and create the following two string preferences:

noscript.surrogate.abc_video.sources
@*.abc.net.au

noscript.surrogate.abc_video.replacement
if (!document.getElementById("inpageplayerObject")) document.addEventListener("DOMContentLoaded", function() { document.documentElement.firstChild.appendChild(document.createElement("style")).innerHTML = "#inpageplayerObject: { height: 338px !important}"; }, false);

Re: Unexpected behaviour - embedded Flash abc.net.au

Posted: Wed Oct 14, 2009 6:19 pm
by therube
NoScript the Almighty (TM)
:lol:

Re: Unexpected behaviour - embedded Flash abc.net.au

Posted: Thu Oct 15, 2009 12:49 am
by therube
Now with SeaMonkey 2, I see what you're saying.

Surrogates aside, IMO the behavior is wrong.

Going to the site for the first time (as I did today), I did not know what to expect.
And could quite easily have missed entirely that there was a video on that page (in the first example).
And once I clicked the placeholder & nothing further happened, at that point, I may have just given up, figuring it to be a bum page.

The second example still worked for me.

With SeaMonkey 1.1.18, & NP-MSWMP.dll, the video played, embedded in the browser window.
With SeaMonkey 2, & npdsplay.dll, the video played, opening externally into Windows Media Player.

Re: Unexpected behaviour - embedded Flash abc.net.au

Posted: Thu Oct 15, 2009 6:47 am
by Giorgio Maone
The only approach I can try to mitigate this and similar cases without using a surrogate is checking the size and visibility of the object as soon as I restore it and, if it's too small (<= 1px) or invisible, automatically refresh the page.
Will test this in next dev build.

Re: Unexpected behaviour - embedded Flash abc.net.au

Posted: Thu Oct 15, 2009 7:24 am
by Grumpy Old Lady
Ah, the old Zero Pixel trick ;-) I can live with that.
I can now see that the second example is a nice way for the site to attempt to "roll up" the video until it's needed. Oh well, at least they're trying to be cool and hip etc :-)
However, for completeness, I tested your mighty sword, oh Great OneĀ®, and it failed :-( With your surrogate string in config, there was no change in the behaviour reported in my original post.
I copied/pasted all from your post, so typos are eliminated as an error source.
But this result, for me, is just feeding back fyi; I'm not that fussed about adding a surrogate for abc.net.au videos because I don't really mind hitting refresh occasionally.

Re: Unexpected behaviour - embedded Flash abc.net.au

Posted: Thu Oct 15, 2009 7:38 am
by Grumpy Old Lady
Quoth therube
Surrogates aside, IMO the behavior is wrong.

Going to the site for the first time (as I did today), I did not know what to expect.
And could quite easily have missed entirely that there was a video on that page (in the first example).
Well, it's a little bit less than magic-meatery, because these links are all reached via buttons entitled "video" or similar - as in this kind of page
http://www.abc.net.au/news/wa/default.htm
See the block of thumbs around 2/3 down the page with the title "Video"

- so the user is already looking for video when they arrive at the first example.
And once I clicked the placeholder & nothing further happened, at that point, I may have just given up, figuring it to be a bum page.
I agree that a novice NS user would be stretched at this point.

Re: Unexpected behaviour - embedded Flash abc.net.au

Posted: Fri Oct 16, 2009 2:59 am
by al_9x
Giorgio Maone wrote:It's the expected behavior, unluckily.
I was curious why it is working in 1.8.1. There is a resize function

Code: Select all

function resize16x9 (element) {
	if (typeof element == 'undefined') return;
	if (typeof element == 'string') {
		if (element = document.getElementById(element));
		else return;
	}
	width = element.clientWidth;
	height = Math.round((width/16)*9);
	element.style.height = height+'px';
}
that gets called right after the dummy object is written

Code: Select all

	var so = new SWFObject(swfurl, inpageplayer+'Object', width, height, '8', '#000000', true);
	so.addParam('allowFullScreen', 'true');
	so.addVariable('mediaURL', url);
	so.addVariable('autoPlay', autoplay);
	so.write(inpageplayer);
	resize16x9(inpageplayer+'Object');
The problem seems to be that while in 1.8.1 clientWidth returns the proper width, in 1.9.1 it returns 0. Do you know why?

Re: Unexpected behaviour - embedded Flash abc.net.au

Posted: Mon Oct 19, 2009 8:10 pm
by Giorgio Maone
al_9x wrote: The problem seems to be that while in 1.8.1 clientWidth returns the proper width, in 1.9.1 it returns 0. Do you know why?
Not specifically. I guess I could try to trace it back from http://mxr.mozilla.org, but I've got no time for this currently.
Chalk it up to "layout differences between Gecko 1.8.x and Gecko 1.9.x, probably due to HTML 5 conformance".

Re: Unexpected behaviour - embedded Flash abc.net.au

Posted: Wed Oct 28, 2009 3:26 am
by al_9x
In 1.9.9.12, the player is hidden when activated, and only appears when the page is resized.

Do you think you'll get a chance to investigate the root cause of this, why the dummy node doesn't return the right size? Script base instantiation seems to be getting more common, and therefore also post instantiation scripting of the dummy.

Re: Unexpected behaviour - embedded Flash abc.net.au

Posted: Wed Oct 28, 2009 10:06 am
by Giorgio Maone
@al_9x:
this is a particular case, where the size of the object is set after it's inserted in the DOM (and blocked).
.12 and above work around by forcing a quick (cache) page reload if the object is not properly sized when inserted in the DOM.
This is working fine in 3.5, but apparently failed (checked after your report) in 3.0.
Investigating...

Re: Unexpected behaviour - embedded Flash abc.net.au

Posted: Wed Oct 28, 2009 3:18 pm
by al_9x
Giorgio Maone wrote:This is working fine in 3.5, but apparently failed (checked after your report) in 3.0.
Investigating...
I didn't try 3.0. Just verified it in a new profile, 3.5.4, 1.9.9.14, XP32 SP3. When I activate the placeholder, the player starts playing but is invisible (0 size, no space in the layout), it appears when you resize the page.
Giorgio Maone wrote:this is a particular case, where the size of the object is set after it's inserted in the DOM (and blocked).
I'll drop this, but, the setting of the size after instantiation and insertion is not the problem, per se. Were it set to a non-zero value, I think it would be fine. The issue is that the hight is set to a 9/16 * clientWidth, and the clientWidth returns 0, starting with Fx3.
Giorgio Maone wrote:work around by forcing a quick (cache) page reload
In cases when you are forcing a reload (I think there are other situations besides this) and "automatic reload" is off, it would be nice to have some sort of optional notification, since the reload is unexpected and you can't tell that it happened.

Re: Unexpected behaviour - embedded Flash abc.net.au

Posted: Wed Oct 28, 2009 4:15 pm
by therube
the player starts playing but is invisible (0 size, no space in the layout), it appears when you resize the page
Heh. That's neat. (Confirmed.)

FWIW, https://bugzilla.mozilla.org/buglist.cg ... +disappear