mirror of
https://github.com/KDE/kdeconnect-android
synced 2025-08-30 21:55:10 +00:00
Correctly handle changing canPlay, canPause, canGoNext and canGoPrevious
Summary: Gwenview is adding MPRIS support in D10972. I tested it and noticed that it was quite buggy. Turns out, Gwenviews implementation is (almost) fine, the problem was on our side. Unlike pure music players like Spotify Gwenview changes canPlay, canPause, canGoNext and canGoPrevious when needed, but those updates didn't reach our UI. The packages containing those updates were not parsed because they didn't contain several fields. Test Plan: Controlling Spotify and Gwenview (patched to support playPause) works fine now. Reviewers: #kde_connect, mtijink Reviewed By: #kde_connect, mtijink Subscribers: mtijink, #kde_connect Tags: #kde_connect Differential Revision: https://phabricator.kde.org/D10981
This commit is contained in:
@@ -263,7 +263,7 @@ public class MprisPlugin extends Plugin {
|
||||
|
||||
@Override
|
||||
public boolean onPackageReceived(NetworkPackage np) {
|
||||
if (np.has("nowPlaying") || np.has("volume") || np.has("isPlaying") || np.has("length") || np.has("pos")) {
|
||||
if (np.has("player")) {
|
||||
MprisPlayer playerStatus = players.get(np.getString("player"));
|
||||
if (playerStatus != null) {
|
||||
playerStatus.currentSong = np.getString("nowPlaying", playerStatus.currentSong);
|
||||
|
Reference in New Issue
Block a user