nageeb2016 / swfobject

Automatically exported from code.google.com/p/swfobject
0 stars 0 forks source link

flash instance for version probing is visible for short while on slow mobile devices #468

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
On certain slow mobile devices running Opera Mobile browser I've seen a 
white box flicker by during page load (seen on 
http://mediathek.daserste.de/daserste/servlet/ for example). I've narrowed 
it down to swfembed and I can recreate the issue using this minimal TC:
http://files.minimum.se/bug_attachments/swfembed/dynamic.html

This can also be reproduced in Opera 10.10 desktop version if you 
artificially slow it down using valgrind:
valgrind --trace-children=yes ./opera 
http://files.minimum.se/bug_attachments/swfembed/dynamic.html

When I debug the js I see it enter the "testPlayerVersion" function where a 
temporary Flash object is quickly inserted in order to probe the Flash 
player version. This Flash object is the white box that I see flickering by 
during page load.

The page load gets rendered without flaws when I make the Flash element 
hidden, by adding this in testPlayerVersion():

$ svn diff
Index: swfobject.js
===================================================================
--- swfobject.js    (revision 408)
+++ swfobject.js    (working copy)
@@ -194,6 +194,7 @@
        var b = doc.getElementsByTagName("body")[0];
        var o = createElement(OBJECT);
        o.setAttribute("type", FLASH_MIME_TYPE);
+       o.setAttribute("style", "visibility: hidden;");
        var t = b.appendChild(o);
        if (t) {
            var counter = 0;

Original issue reported on code.google.com by mar...@minimum.se on 20 May 2010 at 11:46

GoogleCodeExporter commented 9 years ago
Same issue on:

Opera
Version: 10.63
Build: 3516
Plattform: Win32
OS: WinXP

What's wrong:
Upon page load, there is a white box visible, which then disappears.
I traced it back to the "testPlayerVersion" method, where a new OBJECT element 
is created and added to the DOM, without hiding it. 

Fix:
hide the element

Fix example:
var b = doc.getElementsByTagName("body")[0];
var o = createElement(OBJECT);
o.setAttribute("type", FLASH_MIME_TYPE);
o.style.display = "none"; /* THIS IS THE FIX */

Original comment by smilingr...@googlemail.com on 26 Oct 2010 at 3:09

GoogleCodeExporter commented 9 years ago
testPlayerVersion never appends the element to the page, so it should never be 
visible.

It's possible what you're seeing is the result of swfobject's CSS manipulation. 
Try using swfobject.switchOffAutoHideShow() and see if it makes a difference.
http://code.google.com/p/swfobject/wiki/api#swfobject.switchOffAutoHideShow%28%2
9

Original comment by platelu...@gmail.com on 8 Nov 2010 at 5:12

GoogleCodeExporter commented 9 years ago
I take that back -- testPlayerVersion *does* append an *empty* <object> to the 
page. Empty Flash objects display as white blocks.

However, the solution you describe may not be feasible, as hidden Flash objects 
are not accessible via JavaScript in some browsers. We will need to investigate.

Original comment by platelu...@gmail.com on 8 Nov 2010 at 5:58

GoogleCodeExporter commented 9 years ago
I believe this issue is addressed by issue 357, though the proposed solution 
here is much simpler.

Original comment by platelu...@gmail.com on 1 Jun 2011 at 4:30