Unexpected behaviour - embedded Flash abc.net.au

Bug reports and enhancement requests
Grumpy Old Lady
Senior Member
Posts: 240
Joined: Fri Jul 03, 2009 7:20 am

Unexpected behaviour - embedded Flash abc.net.au

Post by Grumpy Old Lady » Wed Oct 14, 2009 3:51 pm

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.
Last edited by Grumpy Old Lady on Sat Oct 24, 2009 5:09 am, edited 1 time in total.
Mozilla/5.0 (X11; U; Linux i686; en-AU; rv:1.9.0.14) Gecko/2009090216 Ubuntu/9.04 (jaunty) Firefox/3.0.14

User avatar
therube
Ambassador
Posts: 7608
Joined: Thu Mar 19, 2009 4:17 pm
Location: Maryland USA

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

Post by therube » Wed Oct 14, 2009 4:10 pm

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.)
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.19) Gecko/20110420 SeaMonkey/2.0.14 Pinball NoScript FlashGot AdblockPlus
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.23) Gecko/20090825 SeaMonkey/1.1.18

Alan Baxter
Ambassador
Posts: 1586
Joined: Fri Mar 20, 2009 4:47 am
Location: Colorado, USA

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

Post by Alan Baxter » Wed Oct 14, 2009 4:14 pm

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
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3

User avatar
Giorgio Maone
Site Admin
Posts: 8833
Joined: Wed Mar 18, 2009 11:22 pm
Location: Palermo - Italy
Contact:

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

Post by Giorgio Maone » Wed Oct 14, 2009 5:54 pm

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);
Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)

User avatar
therube
Ambassador
Posts: 7608
Joined: Thu Mar 19, 2009 4:17 pm
Location: Maryland USA

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

Post by therube » Wed Oct 14, 2009 6:19 pm

NoScript the Almighty (TM)

:lol:
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.19) Gecko/20110420 SeaMonkey/2.0.14 Pinball NoScript FlashGot AdblockPlus
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.23) Gecko/20090825 SeaMonkey/1.1.18

User avatar
therube
Ambassador
Posts: 7608
Joined: Thu Mar 19, 2009 4:17 pm
Location: Maryland USA

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

Post by therube » Thu Oct 15, 2009 12:49 am

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.
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.19) Gecko/20110420 SeaMonkey/2.0.14 Pinball NoScript FlashGot AdblockPlus
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.4pre) Gecko/20091007 SeaMonkey/2.0pre

User avatar
Giorgio Maone
Site Admin
Posts: 8833
Joined: Wed Mar 18, 2009 11:22 pm
Location: Palermo - Italy
Contact:

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

Post by Giorgio Maone » Thu Oct 15, 2009 6:47 am

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.
Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)

Grumpy Old Lady
Senior Member
Posts: 240
Joined: Fri Jul 03, 2009 7:20 am

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

Post by Grumpy Old Lady » Thu Oct 15, 2009 7:24 am

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.
Mozilla/5.0 (X11; U; Linux i686; en-AU; rv:1.9.0.14) Gecko/2009090216 Ubuntu/9.04 (jaunty) Firefox/3.0.14

Grumpy Old Lady
Senior Member
Posts: 240
Joined: Fri Jul 03, 2009 7:20 am

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

Post by Grumpy Old Lady » Thu Oct 15, 2009 7:38 am

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.
Mozilla/5.0 (X11; U; Linux i686; en-AU; rv:1.9.0.14) Gecko/2009090216 Ubuntu/9.04 (jaunty) Firefox/3.0.14

al_9x
Master Bug Buster
Posts: 931
Joined: Thu Mar 19, 2009 4:52 pm

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

Post by al_9x » Fri Oct 16, 2009 2:59 am

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?
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.20) Gecko/20081217 Firefox/2.0.0.20

User avatar
Giorgio Maone
Site Admin
Posts: 8833
Joined: Wed Mar 18, 2009 11:22 pm
Location: Palermo - Italy
Contact:

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

Post by Giorgio Maone » Mon Oct 19, 2009 8:10 pm

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".
Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)

al_9x
Master Bug Buster
Posts: 931
Joined: Thu Mar 19, 2009 4:52 pm

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

Post by al_9x » Wed Oct 28, 2009 3:26 am

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.
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.20) Gecko/20081217 Firefox/2.0.0.20

User avatar
Giorgio Maone
Site Admin
Posts: 8833
Joined: Wed Mar 18, 2009 11:22 pm
Location: Palermo - Italy
Contact:

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

Post by Giorgio Maone » Wed Oct 28, 2009 10:06 am

@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...
Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)

al_9x
Master Bug Buster
Posts: 931
Joined: Thu Mar 19, 2009 4:52 pm

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

Post by al_9x » Wed Oct 28, 2009 3:18 pm

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.
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.20) Gecko/20081217 Firefox/2.0.0.20

User avatar
therube
Ambassador
Posts: 7608
Joined: Thu Mar 19, 2009 4:17 pm
Location: Maryland USA

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

Post by therube » Wed Oct 28, 2009 4:15 pm

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
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.19) Gecko/20110420 SeaMonkey/2.0.14 Pinball NoScript FlashGot AdblockPlus
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.4) Gecko/20091017 SeaMonkey/2.0

Post Reply