Bug 500000

Summary: Can't control videos playing on Flatpak Firefox through Media Player Widget
Product: [Plasma] plasma-browser-integration Reporter: Luís Alexandre <contribute.2f8md>
Component: FirefoxAssignee: Kai Uwe Broulik <kde>
Status: RESOLVED FIXED    
Severity: normal CC: bizyaev, sitter
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Flatpak   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: Can't pause or seek a YouTube video through Media Player Widget
Plasma Integration Extension while a video is playing

Description Luís Alexandre 2025-02-13 16:05:56 UTC
SUMMARY
Hey, I wanted to try out the new Firefox Flatpak support and noticed that while I can see the video being played on Plasma Media Player Controls (with thumbnail and seekbar following the video) I can't control it. Can't pause it, can't seek to another time, can't go to the previous or next video, etc

STEPS TO REPRODUCE
1. Open Flatpak Firefox with plasma integration extension installed
2. Play any video on Firefox
3. While it's playing try to pause the video via Plasma Media Player Controls

OBSERVED RESULT
The video keeps playing

EXPECTED RESULT
The video would pause

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Fedora Kinoite 41 
KDE Plasma Version: 6.3.0
KDE Frameworks Version: 6.10.0
Qt Version: 6.8.2

ADDITIONAL INFORMATION
Firefox Version: 135.0 (Flatpak)
Plasma Integration Extension Version: 1.9.1
Comment 1 Ilya Bizyaev 2025-02-13 20:35:21 UTC
Congrats on the number :)
Comment 2 Harald Sitter 2025-02-15 12:58:34 UTC
Screenshot please
Comment 3 Luís Alexandre 2025-02-15 16:36:51 UTC
Created attachment 178404 [details]
Can't pause or seek a YouTube video through Media Player Widget
Comment 4 Harald Sitter 2025-02-15 17:24:52 UTC
Curious.

What's the output of this command when you play a video

busctl --user | grep -i mpris

And are you quite sure the browser side extension picks up the media correctly? It's not visible in your video.
Comment 5 Luís Alexandre 2025-02-15 17:50:04 UTC
> What's the output of this command when you play a video
> 
> busctl --user | grep -i mpris

:1.0                                                                                            1768 mpris-proxy              luis :1.0            user@1000.service -       -
org.mpris.MediaPlayer2.plasma-browser-integration    10925 plasma-browser-   luis :1.155        user@1000.service -       -

> And are you quite sure the browser side extension picks up the media
> correctly? It's not visible in your video.
What do you mean? When I click on the Firefox extension? I'll upload a screenshot
Comment 6 Luís Alexandre 2025-02-15 17:51:11 UTC
Created attachment 178405 [details]
Plasma Integration Extension while a video is playing
Comment 7 Harald Sitter 2025-02-15 18:03:30 UTC
> org.mpris.MediaPlayer2.plasma-browser-integration    10925 plasma-browser-   luis :1.155        user@1000.service -       -

Suggests the flatpak bridging is working in principal, maybe the host->flatpak direction has a bug :(
Comment 8 Bug Janitor Service 2025-02-16 01:25:21 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-browser-integration/-/merge_requests/144
Comment 9 Harald Sitter 2025-02-17 16:45:51 UTC
Git commit 0709617882d5992bafce766528fdcc250f4b9ab5 by Harald Sitter.
Committed on 16/02/2025 at 01:24.
Pushed by sitter into branch 'master'.

flatpak-integrator: use more sophisticated code to pass around fds

the previous approach didn't pass stdout/err properly causing the
host->browser communication to fail while browser->host was working
fine.

M  +14   -5    flatpak-integrator/flatpak-host-wrapper

https://invent.kde.org/plasma/plasma-browser-integration/-/commit/0709617882d5992bafce766528fdcc250f4b9ab5
Comment 10 Harald Sitter 2025-02-17 16:48:12 UTC
Git commit 6d907f12aa80c4205f46ba2c2e575926c6fec3d7 by Harald Sitter.
Committed on 17/02/2025 at 16:46.
Pushed by sitter into branch 'Plasma/6.3'.

flatpak-integrator: use more sophisticated code to pass around fds

the previous approach didn't pass stdout/err properly causing the
host->browser communication to fail while browser->host was working
fine.


(cherry picked from commit 0709617882d5992bafce766528fdcc250f4b9ab5)

Co-authored-by: Harald Sitter <sitter@kde.org>

M  +14   -5    flatpak-integrator/flatpak-host-wrapper

https://invent.kde.org/plasma/plasma-browser-integration/-/commit/6d907f12aa80c4205f46ba2c2e575926c6fec3d7