-
Notifications
You must be signed in to change notification settings - Fork 127
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
Suggestion - MPRIS #166
Comments
Hi @elkrien This is something that has already been requested in the past, so yes, I will eventually look into it... |
FYI Mpris can be added to mpv through https://github.com/hoyon/mpv-mpris. One thing would be cool is that Pyradio constitutes a playlist with the searched radios so we could press next to change without having to recall pyradio window. |
Hi @jediafr I am aware of the mpv-mpris plugin; vlc also has mpris enabled, and even an mplayer mpris plugin exists. It's not that I haven't looked into it, but... I have tried to use mpris-server with PyRadio, but I just cannot seem to get it to work as intended. The problem is that in order for it to enter the DBus event loop (apparently that's the way it gets to send and receive signals), I have to use from gi.repository import GLib
loop = GLib.MainLoop()
loop.run() or similar code, running in a different thread. And once I do that, the logger starts printing debug messages to the terminal, which actually breaks the TUI, and this happens even when debug is off ( This may be an absolutely fine and acceptable behavior for a GUI application, but for a TUI one, as PyRadio it's a no go. Now, removing the logger would not be an option; I would not be able to continue the development without it, plus the Titles Logging feature depends on it... I know this is too technical and all, but I put it up here so that if anyone can provide some help on how to go on with it, I would be grateful |
2 cents here: I dont think using mpv mpris support is the proper way to do this because some radios simply does not export anything on stream metadata, as next screenshot shows: I would suggest to add a "third player" option python-mpv (https://github.com/jaseg/python-mpv) and use this to play and fetch metadata from stream - and if stream does not have any metadata, fullfull mpris data with stations.csv information (name and image). That said, a little bridge with mpris-server and ptrhon-mpv metadata may help. Using python-mpv does not instantiate an entire mpv thread and allow mpv to be controlled from python instead a IPC socket. And also allow a better metadata handling. About mpris-server, you posted GLib example, but the functional example at https://github.com/alexdelorenzo/mpris_server?tab=readme-ov-file#example does not use this kind of instancing. Is this right? |
Thank you for the suggestion @leleobhz I will look into this! |
Hi there! Congratulations on this project.
Do you plan on adding MPRIS support so it can be controlled with media keys on Linux?
The text was updated successfully, but these errors were encountered: