Flash video gets interrupted while browsing in other tabs Topic is solved

Talk about code development, features, specific bugs, enhancements, patches, and similar things.
Forum rules
Please keep everything here strictly on-topic.
This board is meant for Pale Moon source code development related subjects only like code snippets, patches, specific bugs, git, the repositories, etc.

This is not for tech support! Please do not post tech support questions in the "Development" board!
Please make sure not to use this board for support questions. Please post issues with specific websites, extensions, etc. in the relevant boards for those topics.

Please keep things on-topic as this forum will be used for reference for Pale Moon development. Expect topics that aren't relevant as such to be moved or deleted.
Buggle

Flash video gets interrupted while browsing in other tabs

Unread post by Buggle » 2013-04-29, 07:03

First off, I do not know whether this is a Firefox, PaleMoon, Flash or "MyComputer" problem, but maybe we can start debugging it here and move from there.

The problem is that I often have some flash clip of a TV program for instance running in one tab, and because this is mostly speech, I like to do things in other tabs like searching the news, etc.
Whenever I do that however, the sound (and video I assume) stops playing after a few seconds, and as soon as I switch back to the tab with the video, it immediately resumes playing. If I do not switch back, it will resume playback for a short instance after about 10 seconds, only to stop again, etc. etc.
If I use another browser to search the web while the flash video is playing in PaleMoon, there is no problem at all as long as I do not minimise PaleMoon, but simply switch to the other browser. If I minimise PM to get to the other browser, the same problem arises again.

So my guess is this has something to do either with bandwidth or computing resources available for inactive tabs; I do not see this being flash player itself (unless there is some feature in FF code base for Flash to 'request' resources from the browser?). Maybe therefore a problem with detecting whether an inactive tab is in fact really an inactive tab?

I'm running PM20x64 under Windows7x64, all latest (LDR) updates; flash is 11.7.700.182. I haven't yet been able to check whether this happens with Silverlight as well.

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35602
Joined: 2011-08-28, 17:27
Location: Motala, SE
Contact:

Re: Flash video gets interrupted while browsing in other tab

Unread post by Moonchild » 2013-04-29, 11:13

Actually, it depends on how the site is programmed that this occurs on - for performance reasons, interval scripts in background tabs are "throttled" - this has been the case in the browser for a very long time already:
MDN wrote:Inactive tabs

Starting in Gecko 5.0 (Firefox 5.0 / Thunderbird 5.0 / SeaMonkey 2.2), intervals are clamped to fire no more often than once per second in inactive tabs.
Source

They should switch to HTML5 Web Workers if they need events to fire more often, or recode their script so the video is no longer dependent on javascript running in the page. Using a separate window to play the video will also work around the issue (so it's a new foreground tab in its own window)
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

Buggle

Re: Flash video gets interrupted while browsing in other tab

Unread post by Buggle » 2013-04-29, 12:16

Well, the funny thing is, the website I'm checking (www.rtl.nl, more specificly http://www.rtl.nl/xl/#/a/197775, if you're interested) recently switched from silverlight to flash, and around the same time PM was updated to 19 or 20.
It used to work flawlessly, so considering your comment I would blame it on their switch to Flash.
Is there any way to modify such settings browser-side?

Indeed the problem does not occur if I use it in a separate window. To me this is just plain weird...

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35602
Joined: 2011-08-28, 17:27
Location: Motala, SE
Contact:

Re: Flash video gets interrupted while browsing in other tab

Unread post by Moonchild » 2013-04-30, 12:42

Buggle wrote:Is there any way to modify such settings browser-side?
You can set dom.min_background_timeout_value to a lower clamp value (default is 1000 ms) - depending on how the site is programmed this may fix your issue.
Indeed the problem does not occur if I use it in a separate window. To me this is just plain weird...
It really is not :)
Javascript is event driven - and you can set timed intervals to trigger events like downloading chunks of data in the background through Javascript. If you switch to a different tab, the previously active one will have timeout values clamped to a minimum value (Since gecko v5) making those events fire no more than once per second, which may be too slow for the streaming you are trying to do.
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

Locked