Background media playback



7 years ago
7 months ago


(Reporter: inform, Unassigned)


16 Branch




7 years ago
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20100101 Firefox/13.0 Iceweasel/13.0
Build ID: 20120605094937

Steps to reproduce:

* Played some music on, or youtube, or ...
* Switched to a different tab


* Switched to a different Android application

Actual results:

The music stopped.

Expected results:

The music should've kept going.

(I realize that there's a potential battery drain issue here if any old piece of Flash is kept running once the focus is gone. But it would be nice if I could tell Firefox that the page I'm viewing will actually be useful to me if kept running in the background, and that I would like it to do so.)

Comment 1

7 years ago
This is reproducible on latest Nightly, sounds like an enhancement. Can we have an input regarding this issue?
Severity: normal → enhancement
Component: General → Plugins
Ever confirmed: true
OS: Linux → Android
Hardware: x86_64 → ARM
Duplicate of this bug: 802159

Comment 3

6 years ago
Chrome beta channel has landed this.
I can't reproduce this. I can load pages in multiple tabs, or multiple apps and things are fine (assuming Android doesn't kill us). It would be nice to request to not be killed if we're doing something like playing music.

Comment 5

6 years ago
This bug is essentially for music to be played from the browser as long as required by the user. So if you're playing a radio station, Fennec shouldn't be killed, even if you're then in another app (e.g. Google+) until the audio stream ends or it's ended by the user.

Background audio has been available in the stock android browser for a while. As well as available on iOS for a while. Firefox is essentially the last browser to implement this ability.
Yes. IMO, the correct fix for this is to implement audio channels:

and to set up a channel that proxies audio to a service for these cases, but don't force pages to incur the service overhead when they don't need it (and allow us to mute audio that should be muted when its in the background). But maybe we can use a service in all cases without incurring to much lag... cc'ing some audio guys on this.

Comment 7

6 years ago
A service sounds good. With that we can create a notification with a basic control to stop/pause the audio.

Comment 8

3 years ago
I believe a service is indeed what is needed. Sorry I cannot help.

The "Internet" stock app does launch a service and display a notification when a tab is emitting some sound AND the app is sent to background. This seems to reduce the risk that it will get killed. On my phone its behavior however is not always reliable: the notification displays the name and some buttons (back/forward whose use I ignore, suspend/resume, close) but sometimes it refers to another tab than the one that actually is emitting sound.

Of course the sound should still be suspended when a foreground app needs it (phone call): I used to have problems with that (the sound would go on during a phone call, not as loud but still audible), but this seems to be solved in Firefox 48.0 on Android 5.0.2 (Samsung Galaxy Core Prime SM-G360F).

The "Internet" stock app also has an option to stop and start the sound using the earphone button (which can be used to pick-up or hang-up a phone call, to suspend/resume the FM radio,...). This is a very good feature, and maybe not very difficult once there is a service.

Comment 9

2 years ago
I don't think that this is a bug actually. Anyway Flash is finally going, Bug 1381916.
Severity: enhancement → normal
Last Resolved: 2 years ago
Resolution: --- → WONTFIX


7 months ago
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.