Bug 427904 - Media playing in Firefox appears twice in Media Control plasmoid
Summary: Media playing in Firefox appears twice in Media Control plasmoid
Status: RESOLVED FIXED
Alias: None
Product: plasma-browser-integration
Classification: Plasma
Component: Firefox (show other bugs)
Version: unspecified
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Kai Uwe Broulik
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-10-18 07:22 UTC by Schlaefer
Modified: 2023-02-21 16:05 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.27
Sentry Crash Report:


Attachments
firefox two times in media control plasmoid (154.43 KB, video/mp4)
2020-10-18 07:22 UTC, Schlaefer
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Schlaefer 2020-10-18 07:22:29 UTC
Created attachment 132512 [details]
firefox two times in media control plasmoid

STEPS TO REPRODUCE
1. Go to e.g. youtube and start playing a video

OBSERVED RESULT

The Media Control plasmoid shows Firefox two times as source (one time with cover image, one time without).

EXPECTED RESULT

Firefox should only be shown once in the Media Control plasmoid.

SOFTWARE/OS VERSIONS
Operating System: EndeavourOS
KDE Plasma Version: 5.20.0
KDE Frameworks Version: 5.75.0
Qt Version: 5.15.1
Firefox 81.0.2 (64-bit)
Extension version: 1.7.6
Comment 1 Kai Uwe Broulik 2020-10-18 08:36:09 UTC
One comes from Firefox, one from p-b-i.
Comment 2 Schlaefer 2020-10-18 08:53:48 UTC
> One comes from Firefox, one from p-b-i.

You're right. It seems to be Firefox' new media control features [1]. Setting "media.hardwaremediakeys.enabled" to "false" in "about:config" removes the "ugly" control.

Maybe there's something p-b-i can do about it? Have a checkbox to disable the native FF control? Or provide a short info somewhere pointing into the right direction, maybe next to the Media Controls checkbox?

[1] https://support.mozilla.org/en-US/kb/control-audio-or-video-playback-your-keyboard
Comment 3 Kai Uwe Broulik 2020-10-18 09:01:47 UTC
This isn't accessible from extension API. There's some logic in the automatic player selection that prefers p-b-i over the browser's built-in feature but that suffers from timing-related issues (which service emitted a play signal first etc) and it doesn't filter the player tab bar.
Comment 4 Nate Graham 2020-10-26 17:50:21 UTC
I can reproduce this with git master too. Quite annoying.

Is there really nothing we can do about this? Users aren't going to know about the media.hardwaremediakeys.enabled=false hack.
Comment 5 2wxsy58236r3 2021-03-05 07:33:50 UTC
(In reply to Nate Graham from comment #4)
> Is there really nothing we can do about this? Users aren't going to know
> about the media.hardwaremediakeys.enabled=false hack.

How about adding a note to the extension's `options_plugin_mpris_description`, so that the p-b-i settings page shows a message under "Media Controls", e.g.:

"Note: Please set media.hardwaremediakeys.enabled to false in about:config to avoid media appearing twice in Media Control plasmoid"

(There is also an option in about:preferences (at least in Nightly) to disable Firefox's built-in controls, so the above message may need to be edited.)
Comment 6 Bharadwaj Raju 2021-05-17 20:21:03 UTC
(In reply to Nate Graham from comment #4)
> I can reproduce this with git master too. Quite annoying.
> 
> Is there really nothing we can do about this? Users aren't going to know
> about the media.hardwaremediakeys.enabled=false hack.

Maybe we could add a workaround in the Media Control plasmoid, to not show Firefox's hardwaremediakeys controls if plasma-browser-integ controls are available?
Comment 8 Patrick Silva 2021-12-05 13:26:13 UTC
On neon unstable, chromium-based Opera browser also appears twice in Media Player applet.
Comment 9 wazhai 2023-02-21 16:05:14 UTC
Seems fixed with this commit, just bug not closed
https://invent.kde.org/plasma/plasma-workspace/-/commit/669be1280ad319447ee2336ef9620dc349b771e5