Background media playback

RESOLVED WONTFIX

Status

()

Firefox for Android
Plugins
RESOLVED WONTFIX
5 years ago
3 months ago

People

(Reporter: Andreas Kloeckner, Unassigned)

Tracking

16 Branch
ARM
Android
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

5 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 mog.com, or youtube, or ...
* Switched to a different tab

OR

* 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

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

Updated

5 years ago
Duplicate of this bug: 802159

Comment 3

5 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

5 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:

https://wiki.mozilla.org/WebAPI/AudioChannels

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

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

Comment 8

a year 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

3 months ago
I don't think that this is a bug actually. Anyway Flash is finally going, Bug 1381916.
Severity: enhancement → normal
Status: NEW → RESOLVED
Last Resolved: 3 months ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.