-
Notifications
You must be signed in to change notification settings - Fork 579
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
Add support for media keys using mpris2 on the linux platform #65
Comments
There is some kind of mpris implementation because it works for me on Manjaro on Gnome. I can press pause/play/prev/next successfully and it carries over to my bluetooth headset buttons too. Maybe its not to spec like you say as some things are working for some and not others? In any case, here's what I noticed related to mpris: When i query qdbus for track information by mpris, the app name is a random chromium instance number like The notifications show proper track information however: Hope this info helps implementing the mpris spec fully! |
@azizLIGHT I can only guess why it's working for you but not for me: since you mention you're using Gnome, would it be possible for Gnome to be using its own media keys solution independent of mpris? Maybe even something similar to this On my end, my DE has no such media key service built in. I'm using a keyboard shortcut tied to https://github.com/mackstann/mpris-remote (actually I updated the code a fair bit, long story short it works with mpris2. Tested and confirmed all players work except this one). Per my understanding, the way dbus works internally is it looks for any mpris-compatible players that registered themselves and dispatches them the message - so my guess is the name of the app doesn't matter, it's just that there's no mpris support at the moment, or that it didn't register. Would there be a way for you to confirm that the media keys are actually working through mpris on your setup? Possibly EDIT: I have to say I'm quite mystified by your gnome plugin which doesn't seem to be using anything other than mpris (or maybe I'm missing something, I spent all of 10min looking through the source) - though I'm still rather confident that mpris isn't supported by |
Hey @jrabinow & @azizLIGHT, thanks for the precise feedback! I have opened a draft PR #78 but I have no setup to test it 😬 git clone https://github.com/th-ch/youtube-music
cd youtube-music
git checkout mpris
yarn
yarn start |
Hey @th-ch thanks so much! I'm afraid there's a bug somewhere, attached are the tracebacks: dbus-monitor-out.txt I'm not sure if you have a linux distro available to test things out on, if you do you can check out playerctl or mpris-remote... otherwise I'll do my best to test things out whenever I get the chance |
Are there any updates to this? I could maybe test it on my Linux Mint install, if that helps. |
I have tested on Arch linux with playerctl. So please merge this. |
@th-ch when this will be release? I am waiting only for this because I don't know how do I install in arch linux. (PS- I am also lazy to go through tutorials) |
Hey @itzmanish, I still need to go through a few PRs (like #389) and then I'll release a new version, probably in the following weeks! |
I'm going to close this issue as all changes have shipped with the latest release. If people are still running into problems, please feel free to reopen. Thanks everyone! |
I'm still having issues with this after updating to the newest version(1.14.0). EDIT: Also the progress bar doesn't work as in, it doesn't reflect the progress of the playing song and changing it in the mpris control interface doesn't seek to that part. The "Chromium" control doesn't even show a progress bar. EDIT2: I have looked into this using d-feet and qdbusviewer and the Play() and Pause() methods work, but the PlayPause() and Stop() methods do not. Also the Position property stays at 0 and the Seek method does nothing, no matter, what the argument value is. I'm on Linux Mint Cinnamon 20.2 64x and have installed the .deb version. |
@JoeJoeTV I have possible fixes in mind but no way to test on windows. would you be willing to help me test? if so add me on discord fix playPause: MPRISPlayer.on("playpause", playpause); fix displayed time in mpris: youtubePlayer.onTimeUpdate = time =>
mprisPlayer.seeked(time) seek from mpris progress bar: player.on('seek', (offset) => {
// note that offset may be negative
const currentPosition = youtubePlayer.getPositionInMicroseconds();
const newPosition = currentPosition + offset;
realPlayer.setPosition(newPosition);
});
|
This app is perfect in every way ❤️ , except for one thing: currently, media keys don't seem to work on my setup (linux).
Would it be possible to add support for the mpris2 protocol? You can find a working implementation here
and the full spec is here in case you needed to refer to it
The text was updated successfully, but these errors were encountered: