Player does not load in FF when not in visible part of page

Jul 10, 2009 at 2:53 PM

I'm seeing a weird behavior in Firefox (3.x), when SL2 player is rendered outside of visible part of the page in a browser, it does not render. When you scroll the page and reload with the player visible, it is working all fine.

Anyone seen such behavior or better have a fix for it?

Thanks!

Coordinator
Jul 10, 2009 at 5:01 PM

There is some known issues with FF and plugins when you mess with their visibility.  Do you have a page I can look at?

Jul 10, 2009 at 5:16 PM

Tim,

you can check http://test.b1905.cz/clanek/9008/do-bohemky-prichazi-utocnik-ludek-zelenka.aspx - player is under text in the main (middle) column. When you load the page in FF first time, you'll notice a big white space under text. When you scroll down (with white space visible) and just hit F5 or Reload button, player will appear.

Player itsefl is being served from an .ascx user control, with following markup:

<div style="text-align:center;height:100%;">
    <asp:Silverlight ID="Xaml1" runat="server" Source="~/ClientBin/VideoPlayer.xap" MinimumVersion="2.0.31005" Width="580" Height="435"/>
</div> 

I do set initparams from codebehind (within Page_Load of control itself).

I tried other SL control (very basic one) instead of the player and with the same markup code it was visible always, i.e. even if the SL part of page was not visible on load (I mean, I only changed Source param in the code above).

Hope you don't mind Czech language on the page :-)

Thanks,

Antonin

Oct 13, 2009 at 4:43 PM

I just wanted to echo Tim's point. The same bug exists with Flash in FF.

The assumption that plug-ins are for visible content is flawed. E.g. we could legitimately want to use a plug-in as an invisible engine to play audio or do something else on the web page. I've had to resort to 1px square hacks for FF in the past.

You just can't beat IE. ;)

Oct 14, 2009 at 7:40 AM

Well, sorry guys, I do not agree with you. I switched to another SL videoplayer (Mino Player, http://www.silverlight-blog.it/ontheroad/videoplayer/minoplayer_ver1_2.html) and this one is working fine in all browsers regardless of whether it is rendered in visible or invisible part of a page. It must be something in the implementation of SL2 player that is causing this behavior.

I know it is much easier to blame plugins and browser incompatibility but you can hardly use this excuse when you are building commercial websites that should generate you money.

 

Oct 14, 2009 at 9:42 AM

I'm glad to hear you've solved the problem. I like the Mino player, though SL2VideoPlayer is better IMHO.

I'd love to get to the bottom of what the actual problem was. Can you provide a URL or example where so can see your solution working?

Previously I was simply stating an established fact, that there are known issues in Firefox with plug-ins not running when they are not rendered, e.g if the plug-in is embedded in an element that is not visible due to CSS or in an area of a frame which isn't displayed.

If your solution works, then I suspect there was some other problem, perhaps with your implimentation of the app. I suspect something else about your use of the Mino player may have solved the problem, such as differences in the way you implimented. E.g. Perhaps you used JavaScript rather than HTML to initialise the Mino app.