Bug 451393 - Can't select active media player
Summary: Can't select active media player
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Media Player (show other bugs)
Version: 5.24.3
Platform: Manjaro Linux
: NOR normal
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords: usability
Depends on:
Blocks:
 
Reported: 2022-03-11 13:28 UTC by Micael Jarniac
Modified: 2024-03-14 14:33 UTC (History)
7 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
GIF showing me fighting with the Media Player Controls panel (3.68 MB, image/gif)
2022-03-11 13:29 UTC, Micael Jarniac
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Micael Jarniac 2022-03-11 13:28:03 UTC
SUMMARY
The active media player, which can be interacted with by pressing play/pause on the keyboard, can't be manually selected when there are multiple media players open, and sometimes, an inactive media player will steal that spot, making it impossible to use play/pause on the keyboard to control the actual media player in use.

I have noticed this behavior when listening to music on Spotify, then listening to an audio message on WhatsApp Web on the browser.
Before listening to the audio message, all is well, and my keyboard media controls successfully control Spotify.
But as soon as I listen to the audio message on WhatsApp Web, that becomes the active media player, and it remains as such indefinitely, with no way to set Spotify back as the active media player, so after listening to the audio message, my keyboard media controls stop working.

It'd be great to be able to select Spotify back as the active media player through the Media Player Controls panel.


STEPS TO REPRODUCE
1. Launch a media player (MP A) (like Spotify)
2. Start playing music
3. Press play/pause on the keyboard
4. Notice how it controls MP A
5. Open the Media Player panel (Media Player Controls)
6. Notice that MP A is the one with the star, the active one
7. Pause MP A
8. Open another media player (MP B) (like listening to an audio message on WhatsApp Web)
9. Notice that now, MP B is the "active" one, the one with a star in the Media Player panel
10. Resume playing on MP A
11. Press play/pause on the keyboard
12. Notice that now nothing happens, MP B is still the "active" media player
13. Open the Media Player panel, and go to the tab for MP A
14. Notice that while on that tab, you can hit play/pause, but the key on the keyboard still does nothing
15. Notice that it's impossible to select MP A as the active media player

OBSERVED RESULT
MP B remains the active media player indefinitely, with no way to manually set MP A as the active media player.

EXPECTED RESULT
There should be a button, like a star button, on the Media Player Controls panel, to allow the user to manually select which media player is the active one.

SOFTWARE/OS VERSIONS
Operating System: Manjaro Linux
KDE Plasma Version: 5.24.2
KDE Frameworks Version: 5.91.0
Qt Version: 5.15.2
Kernel Version: 5.15.25-1-MANJARO (64-bit)
Graphics Platform: X11
Processors: 4 × AMD Ryzen 3 2200G with Radeon Vega Graphics
Memory: 7.7 GiB of RAM
Graphics Processor: NVIDIA GeForce GTX 970/PCIe/SSE2

By the way, I'm not sure if this fits as a bug report, but I'm extremely confused as to where this kind of thing should go, so I'm posting it here. If this is not the place for it, please inform me, and I'll gladly repost it on the correct place.
Comment 1 Micael Jarniac 2022-03-11 13:29:10 UTC
Created attachment 147438 [details]
GIF showing me fighting with the Media Player Controls panel
Comment 2 naikinnn 2022-08-03 09:51:24 UTC
I would add that sometimes the active media player is not at all controllable with the keyboard media buttons. Usually happens to Spotify. When I click on the media player in the system tray, spotify is not even one of the players detected. Only sometimes it fixes itself if I restart spotify. This problem usually happens after waking up from suspend, while before suspend everything has been working flawlessly.
Comment 3 sowieso 2022-09-03 10:05:15 UTC
I have the same problem with Firefox (plasma-browser-integration) and VLC. Playing just one tiny sound in Firefox and I can't control VLC by keyboard anymore. It would really be nice to have a smarter algorithm to select the active media player, or at least to let the user make a permanent decision.
Comment 4 Nate Graham 2022-09-09 17:15:10 UTC
It all works for me. When this happens, is the play or pause button in the Media Player widget grayed out, by any chance?
Comment 5 sowieso 2022-09-10 03:18:22 UTC
It's a tricky bug and for now it looks like it depends a lot on chance. I tried the combination with Youtube + VLC, and that work flawlessly for my tests today (failed before too). But Soundcloud + VLC with various pause/resumes gets the widget in several incorrect states.
It could be that it works better when the widget is pinned, at least it *feels* like it.

Problems that I found, but couldn't reproduce every time:

Problem 1: 
Step 1: VLC playing, Soundcloud playing → Soundcloud selected as main, playing ✓
Step 2: VLC playing, Soundcloud paused → Soundcloud selected as main not playing, VLC shown as not playing
Step 3: Close the Soundcloud tab in FF, VLC still playing → main: "No media playing", I can still control VLC through its tab inside the widget, but the widget's main tab refuses to acknowledge VLC
Restart of VLC fixed it.

Problem 2:
Step1: VLC playing, Soundcloud playing → Soundcloud selected ✓
Step2: VLC playing, Soundcloud paused → VLC gets selected ✓ but pause button is grayed out.

Problem 3:
Step1: Click inside Dolphin on media file, VLC starts, plays → is shown inside widget
Step2: Instead, open VLC manually, open file inside VLC (drag from Dolphin), click play → is not shown inside widget

My guess is that there are some events transmitted between media player and widget that get lost *some* times. If only one event is lost, the media widget gets in an invalid state that it can't recover from.
Comment 6 Bug Janitor Service 2022-09-25 04:48:31 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 7 sowieso 2022-09-25 06:38:46 UTC
[Sorry, didn't know that I had to update the status]
Comment 8 Fushan Wen 2024-03-14 14:33:25 UTC
The logic has been improved in Plasma 6. Please reopen this bug if it's not fixed.