Genymobile / scrcpy

Display and control your Android device
Apache License 2.0
108.89k stars 10.48k forks source link

Integrate with mediakeys dbus extension (MPRIS) #4080

Open Gottox opened 1 year ago

Gottox commented 1 year ago

Thanks for scrcpy! I'm always surprised how seamless this tool works!

Is your feature request related to a problem? Please describe. With the introduction of audio forward in scrcpy 2.0, I want to start using my smartphone as my main media player. While sound and mouse/keyboard control works nicely I wished that it could integrate with my Linux Desktop even better.

Describe the solution you'd like

It would be awesome if scrcpy could interact with the MPRIS interface to support media buttons and maybe even report the current play state/artist/title from android (I'm not sure if that's possible though)

Describe alternatives you've considered

Currently I'm using the spotify webinterface as kind of "remote control" to make the media buttons work on linux. While this is enough for my use case, it is clumsy and only works with spotify.

AzlanCoding commented 3 months ago

Hello, it's been a year.
I too use my smartphone as my main media player and really wanted this feature. So I wrote a python script to help forward mediakeys in the dbus extension to the media key controls on the phone. Check out here and let me know what you think about it.
Screenshot of scrcpyMediaController in use
I wrote this script when I got tired studying for Organic Chemistry in preparation for my GCE O-Level examination. Slowly, I kept fixing some bugs until I was satisfied with it. I might compile a proper release binary or maybe even learn C and make a pull request to scrcpy after my exams.