Bug 441934

Summary: Media controls don't recognize when media players terminate
Product: [Plasma] plasmashell Reporter: David <david.cortes.rivera>
Component: Media Player widgetAssignee: Kai Uwe Broulik <kde>
Status: RESOLVED WORKSFORME    
Severity: normal CC: nate, nicolas.fella, plasma-bugs
Priority: NOR    
Version: 5.21.5   
Target Milestone: 1.0   
Platform: Debian unstable   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description David 2021-09-03 05:51:11 UTC
SUMMARY
After an update to plasma 5.21.5, the media controls (the kind that by default show as a tray icon with a play button and allow pausing and playing next track) do not recognize when a media-playing application terminates, keeping the controls for a media that was previous playing after it is closed. The only media-playing app that deactivates the controls correctly after closing is the plasma browser integration (tested in a chromium-based browser).

STEPS TO REPRODUCE
1. Add a media control widget to the taskbar so that media controls will be clearly visible, ideally choosing some widget that would display the name of the media that is playing to make the bug more clear.
2. Play some video or audio file through e.g. JuK, VLC, or whatever other app (save for web browsers which still work correctly).
3. Either close the app that was playing media, or stop the media that was playing through the button that looks like a square (if the app has it). Perhaps make sure the app was killed from ksysguard as an optional step.

OBSERVED RESULT
The media controls keep triggered with the media that is not playing anymore, but do not do anything since the application they try to control is no longer running.

EXPECTED RESULT
Should deactivate once the media-playing application terminates or the media itself terminates (e.g. video reaches the end).

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 5.21.5
KDE Frameworks Version: 5.85.0
Qt Version: 5.15.2

ADDITIONAL INFORMATION
Comment 1 Nate Graham 2021-09-09 16:23:11 UTC
Cannot reproduce in Plasma 5.22. Can you upgrade and try again?
Comment 2 David 2021-09-09 17:17:09 UTC
Still reproducible in 5.22.3 from opensuse. For an easier reproducer, install the widget "Media Player Compact" which will additionally show you the name of the media alongside, and then open some PNG image with gwenview or in the browser (which is BTW not supposed to trigger it).
Comment 3 Nate Graham 2021-09-09 17:23:31 UTC
I can reproduce the fact that Gwenview is inappropriately visible in the Media Player widget (let's keep this bug report about the 1st party widget), but when I quit Gwenview, it disappears from the widget. You're seeing something different?
Comment 4 David 2021-09-09 17:28:31 UTC
(In reply to Nate Graham from comment #3)
> I can reproduce the fact that Gwenview is inappropriately visible in the
> Media Player widget (let's keep this bug report about the 1st party widget),
> but when I quit Gwenview, it disappears from the widget. You're seeing
> something different?

Yes: once I kill gwenview (or MPV or VLC or JuK), it keeps the media controls active.
Comment 5 Nate Graham 2021-09-09 22:02:42 UTC
And this is happens with both the 1st Party Media Player widget as well we the 3rd-party widget you mentioned?
Comment 6 David 2021-09-09 22:08:11 UTC
(In reply to Nate Graham from comment #5)
> And this is happens with both the 1st Party Media Player widget as well we
> the 3rd-party widget you mentioned?

Those widgets are showing the same things, it's just that the 3rd party widget has everything showing up up front while in the official ones the controls are more hidden. If you use the official widgets and right-click them you'll see the same issue.
Comment 7 Nate Graham 2021-09-14 15:18:35 UTC
Thanks. Still cannot reproduce the issue.
Comment 8 Nate Graham 2023-09-19 20:21:45 UTC
Hello and thank you again for the bug report! Unfortunately we were not able to address it yet, nor even manage to reproduce the issue ourselves. Can we ask you to please check if this issue is still happening with Plasma 5.27?

If it is, please change the status to REPORTED. Thanks a lot!
Comment 9 Bug Janitor Service 2023-10-04 03:46:56 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 10 Bug Janitor Service 2023-10-19 03:46:16 UTC
This bug has been in NEEDSINFO status with no change for at least
30 days. The bug is now 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

Thank you for helping us make KDE software even better for everyone!