Fenix: FNX-5177 ⁃ [Bug] Video doesn't stop playing when closing Fenix (from "recent apps" list)

Created on 17 Apr 2019  ·  17Comments  ·  Source: mozilla-mobile/fenix

Steps to reproduce

Updated STR (for QA):

  1. Open soundcloud.com and play any video
  2. Background Fenix, open a custom tab Fenix page (e.g. from Reddit Is Fun app)
  3. Swipe away Fenix, notice music still plays
  4. Swipe away custom tab, music still plays

Expected behavior

  • Video stops playing.

Actual behavior

  • Sound keeps playing even when Fenix is closed.

I find it a bit debatable that it keeps playing when switching tabs or apps, though I can see a use case for that. But if I close the app from the menu I definitely expect it to stop.

Device information

  • Android device: OnePlus 6
  • Fenix version: 1.0.1916 (I think this is the right thing to copy here? Let me know otherwise)
Media Release Blocker engverified 🐞 bug

Most helpful comment

To confirm: I am going to just stop media playback in the background always even if the app is just paused and not force quit.

All 17 comments

To clarify what I meant with "closing the app from the menu" is "press bottom right button, discard Fenix by sliding it out of view".

Note that this issue is slightly different to that one (this is not only when minimizing the app, but when _closing_ it completely).

But if they get addressed at the same time that's great, thanks!

I think this bug should get reopened since #1117 got closed and doesn't capture the same issue.

To stop media playback, I am told that Fenix needs to call session.setActive(false) to when a tab (or the app) is backgrounded. I don't see any calls to setActive() in Fenix or AC code, but I did find the AC PR to _remove_ calls the session.setActive(): mozilla-mobile/android-components#703

@agi90 says to call setSuspendedMediaWhenInactive, not setActive.

I cannot reopen the issue, can somebody do it for me?

@agi90 says to call setSuspendedMediaWhenInactive, not setActive.

We will need this to be exposed to us through the Engine abstraction so I filed https://github.com/mozilla-mobile/android-components/issues/2827

Do we want this behavior to always be true?

Do we want this behavior to always be true?

FWIW, Fennec continues to play audio when the app is backgrounded. Fennec users consider this a feature and have pushed back when we tried to change it. Whether Fenix wants to support that is a separate question (#1117). :)

The bug Emilio reported here is about audio continuing to play after Fenix has been "closed" (swiped away from Android's "Recent Apps" list). That is definitely a bug, but I don't know if setSuspendedMediaWhenInactive is the fix for that situation.

The bug Emilio reported here is about audio continuing to play after Fenix has been "closed" (swiped away from Android's "Recent Apps" list). That is definitely a bug, but I don't know if setSuspendedMediaWhenInactive is the fix for that situation.

The "right" fix for this is having a persistent notification that shows up when music is playing and allows the user to stop playback at any time (also provides the user with a visual indication of what is actually playing sound, not always obvious). There's no way for apps to know when they're swiped away or killed (these two things are not related, either).

Without a notification android will start de-prioritizing the browser causing sounds artifacts, see #1461

On Q if I swipe away the app, I'm no longer seeing the first bug. I do still hear audio when the app is paused. Is this still happening on other devices?

@vesta0 do we want to open a new ticket for and/or prioritize adding a notification for media?

The "right" fix for this is having a persistent notification that shows up when music is playing and allows the user to stop playback at any time (also provides the user with a visual indication of what is actually playing sound, not always obvious). There's no way for apps to know when they're swiped away or killed (these two things are not related, either).

Without a notification android will start de-prioritizing the browser causing sounds artifacts, see #1461

@ekager @agi90 @emilio I can't reproduce the reported bug anymore so I am closing it. I have created a new issue (#2551) for a post-mvp feature to add a notification.

This is definitely still a bug.

Easiest way to reproduce for me is:

  • Open soundcloud.com and play any video
  • Background Fenix, open a custom tab Fenix page (e.g. from Reddit Is Fun app)
  • Swipe away Fenix, notice music still plays
  • Swipe away custom tab, music still plays

At this point there is no Fenix visible but still music playing.
Also note this is highly dependent on OS, so it might not work e.g. on Pixel (reproduced on Samsung S10e)

As per @agi90 Fenix can figure out when music is playing using the `MediaDelegate and stop music playing in background (it's a pref)

To confirm: I am going to just stop media playback in the background always even if the app is just paused and not force quit.

Thank you @sblatz . The current behaviour is a huge blocker. If the user closes the app, media continued playing and the only way to stop it is to go to settings and app settings and force stop Fenix. We will re-add this feature once we build media notifications post-mvp.

Verified that the sound is stopped when backgrounding or killing the app.
devices: Pixel, Note 8 (Android 9), P9 lite (Android 6)

Was this page helpful?
0 / 5 - 0 ratings