Skip to content
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

Feature request: MPRIS support #45

Closed
aanderse opened this issue Nov 23, 2023 · 4 comments
Closed

Feature request: MPRIS support #45

aanderse opened this issue Nov 23, 2023 · 4 comments

Comments

@aanderse
Copy link

What a great program. Any chance we could get MPRIS support?

@Siriusmart
Copy link
Owner

Since youtube-tui uses mpv internally, it would be possible to take advantage of preexisting mpv scripts.

For example, I use this plugin called mpv-discord to tell everyone that I am not an average spotify user, I would just install the plugin and load it by adding mpv load-script /etc/mpv/scripts/discord.lua to the end of my launch command in ~/.config/youtube-tui/commands.yml.

There are multiple mpv mpris plugins available, and I assume that the setup process is similar to how I setup mpv-discord.

@aanderse
Copy link
Author

I'm not familiar with the mpv load-script syntax you provided. When I ran mpv --script /path/to/mpris/plugin.so $url the media showed up in my MPRIS client, but when I tried what you suggested it did not.

Is this what you meant?

$ cat ~/.config/youtube-tui/commands.yml
launch_command: loadpage library ;; flush ;; history clear ;; key Esc 0 ;; key Up 0 ;; key Up 0 ;; key Left 0 ;; key Enter 0 ;; mpv load-script /path/to/mpris/plugin.so

Thank you for your help!

@Siriusmart
Copy link
Owner

out.mp4

Since I use arch (btw), mpv-mpris installs to /etc/mpv/scripts/mpris.so by default. As shown in the video i was able to get it working

If you want to try and see what went wrong, you can run commands while running the tui by pressing : and entering the command u want to do. If the command ran without output then ur proabably good to go, or else if u get -4 exit code something bad happened, if its -12 then its file not found.

@aanderse
Copy link
Author

Thanks for the help.

Interesting... the MPRIS plugin doesn't work when I play a video for the first time, though it does work after I either play another video, or pause the first video, etc...

@Siriusmart Siriusmart mentioned this issue Jan 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants