feat(linux): add MPRIS media controls - #653
wiktorekdev wants to merge 4 commits into
Conversation
|
Looks promising, but I found three blockers: MprisBridgeTest is in generic desktopTest while both dbus-java and MprisObject only exist on Linux, so non-Linux desktop tests will not compile. Previous dispatches playPreviousEpisode, but there is no handler for that event, so previous-episode navigation is currently broken. Also, the MPRIS track ID is regenerated whenever any PlayerNowPlayingInfo field changes; it should remain stable for the same media item and only change when the actual track/item changes. |
|
I’ll take a look |
|
Fixed all three blockers:
While testing the real app, I also found that metadata published before the native player attached was being cleared during MPRIS registration. That lifecycle case is fixed and covered by regression tests. Verified with the full desktop test suite: 950 tests passing. I also tested the flow in Nuvio—sending Previous through MPRIS while paused near the beginning of an episode correctly opened the previous episode. |
|
The previous three blockers are fixed, thanks. I found one remaining logic issue: CanGoPrevious is derived from the raw episodeItems index, while the actual Previous action resolves episodes after sorting by season/episode. With unsorted addon episode lists, MPRIS can advertise the wrong capability. Please derive the capability from the same episode-ordering logic used by resolvePreviousEpisode(). Also, the new generic previous-episode/autoplay changes live in commonMain while Mobile still has the old shared implementation; please upstream that shared behavior to Mobile first or keep the MPRIS change isolated to the desktop seam. |
|
Pushed the follow-up fix.
I also re-tested MPRIS live: Previous, Next, Play/Pause, Seek, Volume, Rate and Stop are working, including Previous from S1E2 -> S1E1. |
|
Thanks, the previous fixes look good. The I still see two blockers before merging:
After those are addressed, please update/rebase the branch onto the current |
0a5a497 to
55449e8
Compare
|
not ready yet |
|
I opened NuvioMedia/NuvioMobile#1928 to move playEpisodeAtIndex upstream. Once that’s merged, I’ll rebase this PR, use the shared action for MPRIS Previous. The stable track ID fix is already back in place with a regression test. |
Summary
Expose the Linux player through MPRIS so desktop media controls and tools such as
playerctlcan read playback state and control playback, seeking, volume, speed, and episode navigation.PR type
This is a new feature associated with #565 and does not yet have explicit maintainer approval.
Why
Nuvio currently does not expose its player through the standard Linux media-control interface requested in #565.
Desktop scope
Linux desktop only. The D-Bus implementation and dependencies are included only in Linux builds. Other desktop platforms use a no-op bridge.
Issue or approval
Related to #565. The request is open but does not contain explicit maintainer approval.
UI / behavior impact
Policy check
CONTRIBUTING.md.Scope boundaries
No UI, URI-handler, taskbar, playback-setting, repeat, or shuffle changes are included.
Testing
./gradlew :composeApp:desktopTest --tests com.nuvio.app.features.player.desktop.MprisBridgeTest --no-daemonplayerctlstatus, pause, play, and volume checksgit diff --checkThe focused desktop test suite passed on the current upstream
Dev. KDE widgets, lock-screen controls, and Bluetooth media buttons were not tested.Screenshots / Video
Not a UI change.
Breaking changes
None.
Linked issues
Related to #565.