GitHub - Atreyagaurav/local-mpv: Run MPV with a webserver to control from local network - eviltoast

cross-posted from: https://lemmy.world/post/17984566

Hi all,

mpv communities seem to be tiny in lemmy, so I’m sharing it here.

This is a program I made for music control from local network.

You can run it in a computer with some local media files, or youtube links or any other links yt-dlp supports. And then with the server, you can control the media player and the playlist from any devices in your local network. So that you can just show a QR code or something to house guests for parties, or have it bookmarked within family to control the music.

I wanted to make something similar to how youtube app let’s you play in TV and such, but my skills were not enough to do that. So I tried a simple alternative that works with computers. In an ideal world, I could make “Play with local mpv server” option come while on other android apps, but I have zero experience in android app development and it looks complicated.

I know some other programs also give option to control media, but I wanted to give it a go with a simple implementation. Making the web-server was a tricky part. Only tutorial from the rust book was useful here as every other web server developement in rust seems to be async ones using libraries so I would have to make a complicated system to communicate with the mpv. Using the simple Tcp connection let me make a thread with mpv instance in the scope. I do need to support https and file uploads and other things, but I haven’t had any luck finding a solution that works with simple Tcp connection like in the tutorial. Let me know if you know anything.

Github: https://github.com/Atreyagaurav/local-mpv

  • Thann@lemmy.ml
    link
    fedilink
    English
    arrow-up
    1
    ·
    26 days ago

    This is a fantastic idea! Ive been wanting a simple Chromecast replacement software for a while, and I think you’re on the right path. A simple android app or Firefox extension would make adding links a lot smoother. All they would need to do is open a link in the browser, so they would be trivial really.

    I would be down to help with this and getting more complicated features working =]

    • thevoidzero@lemmy.worldOP
      link
      fedilink
      arrow-up
      2
      ·
      26 days ago

      For adding with Firefox or similar apps on laptop. I have another program that monitors clipboard (or selection), can filter with regex and run custom commands. So simply copying the url to the video can trigger the curl command to add to playlist.

      Making it in the phone is the hard part. I don’t know much about android dev so any help would be appreciated. I did find somewhere you can make a simple app with protocol definition for sharing, and on share to the app, run the request to the server in the local network.

      I also want to implement file share, if you share a file to that app from local storage, it could upload to the server and mpv can stream it. Since I have used the basic tcp connection, I couldn’t do that in this version either.