GithubHelp home page GithubHelp logo

Comments (12)

th-ch avatar th-ch commented on June 25, 2024 3

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!

from youtube-music.

jrabinow avatar jrabinow commented on June 25, 2024 2

Hey @th-ch thanks so much! I'm afraid there's a bug somewhere, attached are the tracebacks:

dbus-monitor-out.txt
mpris-remote-cmd-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

from youtube-music.

th-ch avatar th-ch commented on June 25, 2024 1

Hey @jrabinow & @azizLIGHT, thanks for the precise feedback! I have opened a draft PR #78 but I have no setup to test it 😬
Feel free to test it out and update the issue accordingly! To run it, you need node.js and yarn, then:

git clone https://github.com/th-ch/youtube-music
cd youtube-music
git checkout mpris
yarn
yarn start

from youtube-music.

jrabinow avatar jrabinow commented on June 25, 2024 1

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!

from youtube-music.

Araxeus avatar Araxeus commented on June 25, 2024 1

@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 Araxeus#0819

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);
});

docs:
https://www.npmjs.com/package/mpris-service
https://github.com/dbusjs/mpris-service/blob/master/src/index.js#L26-L132
https://github.com/dbusjs/mpris-service/search?q=seeked
https://github.com/dbusjs/mpris-service/blob/master/examples/player.js

from youtube-music.

azizLIGHT avatar azizLIGHT commented on June 25, 2024

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 org.mpris.MediaPlayer2.chromium.instance1820402 instead of something like org.mpris.MediaPlayer2.youtube-music. I also can't query full track information with qdbus org.mpris.MediaPlayer2.chromium.instance1820402 org.freedesktop.DBus.Properties.Get org.mpris.MediaPlayer2.Player Metadata like you would for a player like vlc, I get nothing returned back on the prompt. A Gnome extension I use to display now-playing information in my top panel can find track information, but the Artist has - Topic appended at the end of it and Title seems cutoff
image.

The notifications show proper track information however:
image

Hope this info helps implementing the mpris spec fully!

from youtube-music.

jrabinow avatar jrabinow commented on June 25, 2024

@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 dbus-monitor would be of help https://wiki.ubuntu.com/DebuggingDBus I'm not sure it'll display when apps receive a sent message but it's worth a shot IMO

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 youtube-music app since grepping the source for mpris didn't reveal a single result

from youtube-music.

JoeJoeTV avatar JoeJoeTV commented on June 25, 2024

Are there any updates to this? I could maybe test it on my Linux Mint install, if that helps.

from youtube-music.

itzmanish avatar itzmanish commented on June 25, 2024

I have tested on Arch linux with playerctl. So please merge this.

from youtube-music.

itzmanish avatar itzmanish commented on June 25, 2024

@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)

from youtube-music.

itzmanish avatar itzmanish commented on June 25, 2024

@th-ch I created new PR #431 for this issue. Please check the PR for details.

from youtube-music.

JoeJoeTV avatar JoeJoeTV commented on June 25, 2024

I'm still having issues with this after updating to the newest version(1.14.0).
The mpris2 control now properly shows YouTube Music with the song info(title and artist) and also the cover, but only the previous and next buttons work.
There is also still a "Chromium" control, that shows the song info without a cover art, but there, all buttons(previous, play/pause, stop and skip) work in contrast to the "correct" control.

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.

from youtube-music.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.