open-dynaMIX / simple-mpv-webui

A web based user interface with controls for the mpv mediaplayer.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Feature Request: Option to run server in the background and open player only when somethings starts playing

enchained opened this issue · comments

I used https://github.com/iwalton3/plex-mpv-shim for a while, and it runs in the background all the time, which is very convenient.

I found simple-mpv-webui when I was looking for something similar to use with youtube. I share youtube urls on my phone to iOS shortcut, it creates a post request to the /api, and the video starts playing on my PC. However, I have to keep the player open at all times to make this remote cast feature available, and it takes up space in the windows 10 taskbar.

Is it possible to make it run in the background similarly to the plex-mpv-shim? I'm not sure what lua scripts for mpv are capable of. Maybe some python server wrapper, that can be run as a service, is possible? Sadly I'm not experienced in a service scripting, so I decided to propose it as a feature.

Hey @enchained

Thank you very much for your interest in this project and your ideas.

I was thinking about this in the past, also for solving different problems (see for example this comment).

My decision to not implement this still stands. My reasons for this are as follows:

  • Running as MPV user script provides the least necessary effort for users to make it run
  • It also takes on lots of the work the webui would have to do on its own as a stand-alone service
  • The installation documentation can be kept minimal this way, because the MPV documentation covers running of user scripts perfectly
  • I like doing some lua in this project, despite its obvious limitations. I'm working as a python/Django dev and this is a nice change from my usual environment (and quality expectations ;))

About the problems you want to solve, I see two possible work-arounds:

  1. Have MPV run at all times (--keep-open=yes)
  2. Write a small wrapper service that handles requests before forwarding them to the webui. This service could start MPV on demand.

Such service wrapper is outside of the scope of the webui project, but it could be developed independently as an additional tool. If this happens, I will be glad to give my support, but I don't have the time to implement it myself.