Music controls in the notification drawer fail to work
Categories
(Firefox for Android :: Media, defect, P2)
Tracking
()
People
(Reporter: jimm, Assigned: jhlin)
References
Details
Attachments
(12 files, 2 obsolete files)
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
phab-bot
:
approval-mozilla-release+
|
Details | Review |
|
48 bytes,
text/x-phabricator-request
|
phab-bot
:
approval-mozilla-release+
|
Details | Review |
|
48 bytes,
text/x-phabricator-request
|
phab-bot
:
approval-mozilla-release+
|
Details | Review |
|
6.76 MB,
video/quicktime
|
Details | |
|
6.83 MB,
video/mp4
|
Details | |
|
6.28 MB,
video/quicktime
|
Details | |
|
5.66 MB,
video/mp4
|
Details |
STR:
- Open a youtube video page, press play. (Music starts)
- Press the Android home button, minimizing Firefox. (Music stops)
- Pull the upper phone notification shade down. There should be a media control visible with a play button and youtube artist info.
- Press play.
Issue: Music does not play
This might be a dupe? If this is recent, a regression range would be helpful.
| Reporter | ||
Updated•6 months ago
|
Comment 2•5 months ago
|
||
When Step 2 is omitted, this behaves as expected: play and pause are effective.
That makes me suspect that the behavior of comment 0 is an intentional anti-feature chosen by YouTube.
When the desktop site is loaded, the audio can play in the background and the media control in the notification drawer behaves as expected.
If there is a way for Firefox to determine that play and pause will not be effective while the page is in the background, then it would be helpful to not show the controls.
| Assignee | ||
Comment 3•5 months ago
|
||
I did some more testing and found that Fenix changes behavior when logging in as a YouTube Premium subscriber. The music will keep playing after Fenix is minimized, and the media control continues to work as expected. Like Karl said in comment 2, YouTube intentionally breaks background play for non-Premium subscribers so it could be something YouTube did that prevents the music from resuming. Other websites, such as TikTok, don't stop the music at all when minimized, and the music control keeps working, so it's more like a YouTube-specific issue.
Also noticed that Chrome behaves differently. When it goes to the background, the music stops and media control disappears (like Karl suggested in comment 2)
| Reporter | ||
Comment 4•5 months ago
•
|
||
I believe the correct fix here is to emulate what Chrome is doing. We should not display the notification controls when the browser is in the background. Pretty sure this is a feature GeckoView code controls.
| Reporter | ||
Updated•5 months ago
|
| Reporter | ||
Updated•5 months ago
|
Updated•5 months ago
|
I spent some time digging into this, but I'm running into some PC issues. I ended up using Claude to hash some of this out - the general approach looks reasonable to me, but I can't test it and wanted to get something up before the day was over. Would you be able to take a quick look at this :jolin ? I'll take another look tomorrow once I manage to get my PC sorted out.
| Assignee | ||
Comment 9•5 months ago
•
|
||
Sorry for the late reply. My local build stops working on emulator and it took me some time to get it working on the phone.
I captured a profile and it seems Youtube clears the media element source when Fenix is minimized so even though the control sends the 'play' command to call HTMLMediaElement.play(), it cannot load the media source and fails.
I think although the 'check browser in background and if the media is paused' approach fixes the Youtube issue, it will regress current background playback behavior on other websites like Tiktok, where the control continues to work regardless of background and playback states. I tried Tiktok in Chrome and it also supports this behavior.
In the profile I noticed 'MediaControl' log shows a playback state eStopped which is not defined by the MediaSession API but is available in the MediaSession.Feature. Maybe it can be used in this case?
Alastor, would you like to give some suggestions?
Comment 10•5 months ago
|
||
Adding more info: this seems to be due to the Page Visibility API. There doesn't appear to be a preference to disable it, but if you modify ComputeVisibilityState() to always return dom::VisibilityState::Visible, the controls appear to work as expected.
| Assignee | ||
Comment 11•5 months ago
|
||
As mentioned in comment 9, Youtube throws media element source away to make content un-playable to stop background playback. It makes the media un-controllable, but in order to support some desktop use case (see bug 1665527), MediaController is kept alive when there is no controlled media, so GeckoView media control module JS won't receive 'none' state change when the situation happens. Also, currently the media session delegate component implementation dismisses notification only when deactivated, so the 'stopped' state behavior needs to be changed, too.
The fix should includes:
- exposing un-controllable media status for GeckoView to detect the situation
- canceling notification when the playback state becomes 'stopped'
| Assignee | ||
Comment 12•5 months ago
|
||
Sometimes PlayInternal() calls StartMediaControlKeyListenerIfNeeded()
when source is not ready yet (e.g., Youtube calls play() when switching
from ad to content) and ShouldStartMediaControlKeyListener() will
return false, therefore the listener won't be started and media control
events lost. Calling it in NotifyAboutPlaying() ensures the listener
will be started when about to play.
| Assignee | ||
Comment 13•5 months ago
|
||
On Android, Youtube removes media element source to make content un-playable when
browser is minimized. In order to detect the situation and update media control UI
accordingly, GeckoView needs to check if there is controllable media.
| Assignee | ||
Comment 14•5 months ago
|
||
Updated•5 months ago
|
| Reporter | ||
Updated•5 months ago
|
Comment 16•5 months ago
|
||
Comment 17•5 months ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/7e6326492984
https://hg.mozilla.org/mozilla-central/rev/f4ea59d9af60
https://hg.mozilla.org/mozilla-central/rev/e94e18b67153
Comment 18•5 months ago
|
||
The patch landed in nightly and beta is affected.
:jhlin, is this bug important enough to require an uplift?
- If yes, please nominate the patch for beta approval.
- See https://wiki.mozilla.org/Release_Management/Requesting_an_Uplift for documentation on how to request an uplift.
- If no, please set
status-firefox149towontfix.
For more information, please visit BugBot documentation.
Updated•5 months ago
|
| Assignee | ||
Comment 19•5 months ago
|
||
Sometimes PlayInternal() calls StartMediaControlKeyListenerIfNeeded()
when source is not ready yet (e.g., Youtube calls play() when switching
from ad to content) and ShouldStartMediaControlKeyListener() will
return false, therefore the listener won't be started and media control
events lost. Calling it in NotifyAboutPlaying() ensures the listener
will be started when about to play.
Original Revision: https://phabricator.services.mozilla.com/D286844
Updated•5 months ago
|
| Assignee | ||
Comment 20•5 months ago
|
||
On Android, Youtube removes media element source to make content un-playable when
browser is minimized. In order to detect the situation and update media control UI
accordingly, GeckoView needs to check if there is controllable media.
Original Revision: https://phabricator.services.mozilla.com/D286845
Updated•5 months ago
|
| Assignee | ||
Comment 21•5 months ago
|
||
Comment on attachment 9551330 [details]
Bug 2017451 - p3: cancel notification when media is stopped and un-controllable.
Beta/Release Uplift Approval Request
- User impact if declined/Reason for urgency: Media control doesn't work as expected after user plays video in Youtube and minimize Fenix.
- Is this code covered by automated tests?: No
- Has the fix been verified in Nightly?: Yes
- Needs manual test from QE?: Yes
- If yes, steps to reproduce: Follow bug STR and verify that media control disappears in notifications.
- List of other uplifts needed: None
- Risk to taking this patch: Low
- Why is the change risky/not risky? (and alternatives if risky): No major changes in patches.
- String changes made/needed:
- Is Android affected?: Yes
| Assignee | ||
Updated•5 months ago
|
| Assignee | ||
Comment 22•5 months ago
|
||
Lando failed so requesting beta uplifting manually.
| Assignee | ||
Comment 23•5 months ago
|
||
Sometimes PlayInternal() calls StartMediaControlKeyListenerIfNeeded()
when source is not ready yet (e.g., Youtube calls play() when switching
from ad to content) and ShouldStartMediaControlKeyListener() will
return false, therefore the listener won't be started and media control
events lost. Calling it in NotifyAboutPlaying() ensures the listener
will be started when about to play.
Original Revision: https://phabricator.services.mozilla.com/D286844
Updated•5 months ago
|
| Assignee | ||
Comment 24•5 months ago
|
||
On Android, Youtube removes media element source to make content un-playable when
browser is minimized. In order to detect the situation and update media control UI
accordingly, GeckoView needs to check if there is controllable media.
Original Revision: https://phabricator.services.mozilla.com/D286845
Updated•5 months ago
|
Comment 25•5 months ago
|
||
firefox-beta Uplift Approval Request
- User impact if declined/Reason for urgency: Media control doesn't work as expected after user plays video in Youtube and minimize Fenix.
- Code covered by automated testing?: no
- Fix verified in Nightly?: yes
- Needs manual QE testing?: yes
- Steps to reproduce for manual QE testing: Follow STR in bug and verify that media control disappear in notifications.
- Risk associated with taking this patch: low
- Explanation of risk level: No major changes in the patches.
- String changes made/needed?: N/A
- Is Android affected?: yes
| Assignee | ||
Comment 26•5 months ago
|
||
Original Revision: https://phabricator.services.mozilla.com/D286846
Updated•5 months ago
|
Updated•5 months ago
|
| Assignee | ||
Updated•5 months ago
|
Comment 27•5 months ago
|
||
Fx149 is now in release, changing uplift request from beta to release
Updated•5 months ago
|
Updated•5 months ago
|
Updated•5 months ago
|
Comment 28•5 months ago
|
||
This issue does not appear to be fixed in the latest Nightly 150.0a1 (03/18) on Moto G72 (Android 13).
On Google Pixel 10 (Android 16), the song stops when the app is sent to the background, and the notification does not appear in the notification tray. When playback is active in the Fenix browser (normal view) and accessed via the notification controls, the pause/resume button does not work—it cannot be paused.
Comment 29•5 months ago
|
||
Updated•5 months ago
|
Updated•5 months ago
|
| Assignee | ||
Comment 30•5 months ago
•
|
||
Hi Adina, Thanks a lot for verifying!
(In reply to Adina Petridean QA [:apetridean] from comment #28)
Created attachment 9554865 [details]
This issue doesn't seem fixed on the latest Nightly 150.0a1 from 18/03 on Moto G72 (Android 13).This issue does not appear to be fixed in the latest Nightly 150.0a1 (03/18) on Moto G72 (Android 13).
From the Moto G72 video it looks like that in this case (fullscreen -> PIP), the video was still playing. Could you please confirm this? If so, I think it's reasonable to keep the notification. Sorry for not being clear enough in the request form about it.
On Google Pixel 10 (Android 16), the song stops when the app is sent to the background, and the notification does not appear in the notification tray. When playback is active in the Fenix browser (normal view) and accessed via the notification controls, the pause/resume button does not work—it cannot be paused.
I couldn't reproduce this (pause/resume button does not work) on Galaxy Z Flip4 (Android 16). Could you please help check that it works in the release build and only fails in latest nightly?
Comment 31•4 months ago
•
|
||
(In reply to John Lin [:jhlin][:jolin] from comment #30)
Hi Adina, Thanks a lot for verifying!
(In reply to Adina Petridean QA [:apetridean] from comment #28)
Created attachment 9554865 [details]
This issue doesn't seem fixed on the latest Nightly 150.0a1 from 18/03 on Moto G72 (Android 13).This issue does not appear to be fixed in the latest Nightly 150.0a1 (03/18) on Moto G72 (Android 13).
From the Moto G72 video it looks like that in this case (fullscreen -> PIP), the video was still playing. Could you please confirm this? If so, I think it's reasonable to keep the notification. Sorry for not being clear enough in the request form about it.
Yes, the music is playing in that case. When switching from fullscreen to PiP, the video keeps playing, so it makes sense to keep the notification. Thanks for the clarification!On Google Pixel 10 (Android 16), the song stops when the app is sent to the background, and the notification does not appear in the notification tray. When playback is active in the Fenix browser (normal view) and accessed via the notification controls, the pause/resume button does not work—it cannot be paused.
I couldn't reproduce this (pause/resume button does not work) on Galaxy Z Flip4 (Android 16). Could you please help check that it works in the release build and only fails in latest nightly?
On Pixel 10, this is expected behavior. You need to pull the notification shade all the way down in order to resume/pause it. Chrome works the same way, so this is not a bug — my mistake.
Verified as fixed on Pixel 11 (Android 16) and Samsung Galaxy S25( Android 15).
Updated•4 months ago
|
Updated•4 months ago
|
| Assignee | ||
Comment 32•4 months ago
|
||
Adina, thanks a lot for your help! Changing to RESOLVED/FIXED.
Comment 33•4 months ago
|
||
Is this fix not live yet on Google Play (150.0a1)? When I tap on the play button in the notification, nothing happens (Firefox minimized, a YouTube video open). This used to work in the past and still works fine this way on other browsers. (in latest Brave browser - release version - for example; pause video, minimize Brave, then tap on play button in the brave notification window)
Updated•4 months ago
|
Comment 34•4 months ago
|
||
Still not fixed on Moto G54 (uses ARMv8.2-A). It seems that this bug is still present for either any device with 8.2-A or even all versions below ARMv8.7-A. (The Pixel 10 - 11 is typo - has v9.2-A and the S25 v8.7-A)
Comment 35•4 months ago
|
||
Adina can you please test again on your Moto G72?
Comment 36•4 months ago
|
||
On the Moto G72 (Android 13), after entering a video in full screen and tapping the Home button, the app enters PiP mode, the music continues to play, and the notification is still displayed. I understand from comment 30 that this is the expected behavior.
Comment 37•4 months ago
|
||
@Dan: I think "INCOMPLETE" means something different from what you intended with the resolution change.
https://wiki.mozilla.org/BMO/UserGuide/BugStatuses#Resolutions
Comment 38•4 months ago
|
||
(In reply to Adina Petridean QA [:apetridean] from comment #36)
On the Moto G72 (Android 13), after entering a video in full screen and tapping the Home button, the app enters PiP mode, the music continues to play, and the notification is still displayed. I understand from comment 30 that this is the expected behavior.
Yes that too, but the bug title is "Music controls in the notification drawer fail to work" (which is a different issue) and was filed by Jim Mathies, not by John Lin, and in STR Jim described the issue (that I am having too) that the media controls in the notification. Please reopen the bug
Comment 39•4 months ago
|
||
*that the media controls in the notification area do not work when Firefox is fully minimized (NOT even in PiP mode).
Comment 40•4 months ago
|
||
I have re-verified the scenario reported by Dan, and the notification button functions correctly in both PiP mode and full-screen mode on Moto G72 (Android 13), using the latest Nightly build 151.0a1 from March 24, 2026. Please see the attached video for reference.
Comment 41•4 months ago
|
||
Misunderstanding. The issue is a different one. It worked in the past that you first paused the video, _then _minimized Fx (so _NO _PiP would appear), then open notification bar and tap play icon and the audio-track of the video would continue in the background. (that feature still works fine on other browsers). That's also the exact issue Jim meant when he created this bug report, as he neither mentioned "go into fullscreen" nor "PiP" in his STR.
Updated•4 months ago
|
Updated•4 months ago
|
Updated•4 months ago
|
Updated•4 months ago
|
Comment 42•4 months ago
|
||
| uplift | ||
Comment 43•4 months ago
|
||
This issue seems to be fixed on Samsung S24 Ultra (Android 16) but intermittently still occurs on Pixel 10 (Android 16) and Pixel 10 Pro (Android 16) for which I filed a separate issue Bug 2028121. Tested on Firefox for Android 149.0.1.
Based on this, I will mark this bug as Verified and continue monitoring the follow-up issue.
Updated•4 months ago
|
Updated•4 months ago
|
Comment 44•2 months ago
|
||
Still bugged on Android 15. Is none of you testing this on Android 15?? Don't you even have an Android 15 device available anymore to test on? xD Wow.
Comment 45•2 months ago
•
|
||
:Dan, thanks for reporting the bug. I'd invite you to remain respectful though.
If you want to provide more details on the bug you still enconter, feel free to do it, and we will see if we can reproduce the bug and fix it.
I just tested and the STR provided as the original description of the bug doesn't reproduce the bug for me.
It could totally be related to some A/B testing applied by youtube.
Edit: I see that Bug 2041904 was opened.
Description
•