Skip to content
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

FR - Show mpv-start-options in the WebUI #331

Closed
francwalter opened this issue Nov 4, 2021 · 7 comments · Fixed by #332
Closed

FR - Show mpv-start-options in the WebUI #331

francwalter opened this issue Nov 4, 2021 · 7 comments · Fixed by #332

Comments

@francwalter
Copy link

francwalter commented Nov 4, 2021

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 😢

@open-dynaMIX
Copy link
Owner

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.

@francwalter
Copy link
Author

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!

@francwalter
Copy link
Author

francwalter commented Nov 11, 2021

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!

@open-dynaMIX
Copy link
Owner

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.

@francwalter
Copy link
Author

francwalter commented Nov 23, 2021

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.

@open-dynaMIX
Copy link
Owner

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?

@francwalter
Copy link
Author

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants