-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
plexamp play-pause workaround #110
Conversation
Perhaps we should just ignore |
As the commit states I haven't tested it. |
Makes total sense that the application can't switch status fast enough. I guess we could add a small timer to the |
yeah, or we keep things even simpler and only leave I have pushed a proof concept with a timer. Based on my pc, 100ms is sufficient to get an updated |
Yeah, I think so too. Would you be able to revert and merge? I'm afraid I might mess it up. |
For the record:
(without the |
It's a little bit frustrating to have two distinct workarounds on such a simple (or supposed to be simple) function. A one-size-fits-all solution against any buggy mpris interface sounds to me now, well, impossible. |
yeah, it's a bit frustrating having to work around improper implementation but that's probably a necessary evil. On the plus side all these players support the same standard and most of it works so it's not too bad. At least this isn't affecting performance for players which properly implement is since is should exist with the first |
I recently started to play with Plex and when installing Plexamp, I noticed that while I could Pause, I couldn't resume the songs. the rest of the funcitonalities works (artwork, song info, ...) so that's good.
on further inspection, he reason PlayPause is flakey is because Plexamp incorrectly sets CanPause to false when the song is paused (see below, CanPause changing from true to false):
![image](https://private-user-images.githubusercontent.com/56710655/377369738-2af6aeee-1f27-4fb5-b432-cd9943e2d41a.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk1NzEzNjQsIm5iZiI6MTczOTU3MTA2NCwicGF0aCI6Ii81NjcxMDY1NS8zNzczNjk3MzgtMmFmNmFlZWUtMWYyNy00ZmI1LWI0MzItY2Q5OTQzZTJkNDFhLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE0VDIyMTEwNFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWRmMWU0YTEyYjZmNDUxODEyMzNlMjRmNGQ0N2U2ODk0ZTE2YTI3NTAxN2Q4MTM4MDM3MWE3MTU0Zjc4MjllNTQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.68wk5isoD5bC7Z6Ho3fGtGG2lGaC04f-FX4rzstW-Rg)
If your widget checks for CanPlay && CanPause at the same time to trigger PlayPauseRemote, it will assume that is can’t control the song. Normally, players leave CanPlay and CanPause to true when these functionalities are enabled which is the way the specification intends it to be so it’s a bug.
I have reported this bug on the Plexamp forum. However, since it's proprietary, I doubt the Plex team is going to fix it anytime soon so I took it upon myself to include a workaround. Basically, we need to only check CanPlay if the song status is Paused.
Note that technically, we could remove
<method name="Play" />
and usethis.proxy.PlayPauseRemote()
. The main reason I'm using Play is because technically, CanPause isfalse
and using Play is a fit clearer in my view. We could change that if you find this overly pedantic.