Bug 509705

Summary: Play/pause button doesn't affect the expected app
Product: [Plasma] plasmashell Reporter: dauntless <60f31543-f82f-492a-8430-25db5521568b>
Component: Media Player widgetAssignee: Plasma Bugs List <plasma-bugs-null>
Status: REPORTED ---    
Severity: normal CC: kde, kdedev, nate
Priority: NOR Keywords: usability
Version First Reported In: 6.4.5   
Target Milestone: 1.0   
Platform: Kubuntu   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description dauntless 2025-09-20 10:48:26 UTC
SUMMARY
When multiple media playing apps are open (e.g. Strawberry music player, Firefox, Haruna) using the play/pause button doesn't toggle the expected app (which would be either the most recently toggled one, or the one currently playing media). Instead it toggles to start playing a paused media stream. 

My best guess is it goes from left-to-right in the Media Player widget to decide what is the next media player that can currently be toggled, and this order doesn't seem to be customisable. 

STEPS TO REPRODUCE
1. Open several media playing apps
2. Use play/pause button on bluetooth headphones
3. Observe which apps can be toggled 

OBSERVED RESULT
Strawberry music player in my case was being toggled

EXPECTED RESULT
Either the most recently toggled one, or the one currently playing media

SOFTWARE/OS VERSIONS
Operating System: Kubuntu 25.04
KDE Plasma Version: 6.4.5
KDE Frameworks Version: 6.14.0
Qt Version: 6.8.3
Kernel Version: 6.14.0-29-generic (64-bit)
Graphics Platform: Wayland
Processors: 16 × AMD Ryzen 7 7840U w/ Radeon  780M Graphics
Memory: 64 GiB of RAM (60.6 GiB usable)
Graphics Processor: AMD Radeon 780M

ADDITIONAL INFORMATION
Comment 1 TraceyC 2025-09-30 19:07:09 UTC
I'm not able to reproduce this in Plasma built from git-master, or in Plasma 6.4.5

Locally opened media players:
- SMPlayer
- Haruna - focused

The Media Player widget also has a few streams from KDE Connect from my phone and another machine
The Starred pane has the correct content, from Haruna
After toggling play in SMPlayer with the mouse, that is shown in the Star panel
In every case, toggling play / pause from bluetooth earbuds affects the last focused app

Could you attach a screen recording where you reproduce the bug, so we can see exactly how you're triggering it? Thanks.
Comment 2 dauntless 2025-10-11 09:57:40 UTC
https://streamable.com/mezyki as you can see the YouTube video is my last focused app yet toggling the play/pause button is affecting Strawberry instead which is closed to tray.
Comment 3 TraceyC 2025-10-16 16:55:56 UTC
Thanks for the screen recording. I definitely see and hear the bug you're describing.

I tried testing this with the most of the same audio software, on git-master using a pair of bluetooth earbuds
- YouTube in a Firefox tab - focused
- Strawberry, paused
- Haruna, paused

Pausing works without issue, the YT video is paused
Trying to unpause, the signal reaches Firefox but the video doesn't want to start playing until I use the play button in the video. That seems to be more of a YouTube issue than a KDE issue. I'm able to pause and play the video you sent the link for
No other players are affected, they remain paused

I'll let those more familiar with the audio integration take things from here