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

FR - Show mpv-start-options in the WebUI

francwalter opened this issue · comments

commented

Hallo

I use mpv to show movies to my children, but not too long, only some few minutes, e.g. old Disney Cartoons.
I start the movies (full play time about 3 hours) from a start time to an end time with the options --start= and --end=
To show the end option, and to know when the kids movie-time will be over, I write the end time additionaly to the screen, with e.g.: --osg-msg1="Ende: 7:24", so I can see, how many time left (e.g. by pressing "o" to see the actual time tag).

Now I found this great tool here, simple-mpv-webui, which is a good help already, I can see on my phone (without need to stay in the movie-room), at what time the movie is.
But I have to remember the end-time, it is not to find in the WebUI page.

Could it be done theoretically that the webui.lua hands over the mpv-options (--start and --end) to the WebUI?
Or is that beyond the scope of the capabilities of lua scripts?
I don't know if Lua can get grip of that.

Thanks for hints.
frank

EDIT: I found this documentation: LUA SCRIPTING about it, but it would take hours for me to understand it 😢

Hallo

This is certainly possible, but not in the way you describe. CLI options just set properties in MPV and from lua we have access to those properties. There is no difference between a property set on the command line and one set in a config file or a default, so there is no way of showing all the mpv cli options. That said, there are properties for start and end we can access.
In this PR the properties are already available over the API. As soon as I find some time, I will integrate them in the UI.

commented

Perfect!!! Thank a lot!
I immediately used it in a little Tasker Action (Tasker is an automation app for android, where I can put http requests and so on).
Works like charming 😄
Thanks!

commented

I will now create some homescreen buttons with Tasker for Android to start, pause and so on.
Or a complete scene with my important functions using the api.
Great work this is!
It should be called mpv-web-ui and not "simple-..."
Vice versa to the other repo ;)

I close the issue (feature Request) now, for me it's solved, thanks!

It should be called mpv-web-ui and not "simple-..."

😁

I'd like to keep this open for now, until it's integrated in the UI and merged into the main branch.

commented

Sorry, I made a mistake, have to check more thorrowly...

I thought, that the "start" value is missing in the /api/status but it is there, even if not set as parameter or option.
Because if the resume option is set in options (mpv.conf > save-position-on-quit=yes), then there is a "start" value (the value of last position).
No way to distinguish it from a start-parameter, I guess.

Apart from that, the "end" value changed from "none" to "null" after the last update, this was irritating me too, but "null" is better than "none" I think too.

Yeah exactly, save-position-on-quit will set the start property. I didn't like the none string and prefer to use null.

So all is working for you now, right?

commented

Yes, perfect.
My next project is to start mpv with ssh and include all that commands in one spot (Tasker). Also the open files commands.
Thanks!