d87 / mpv-persist-properties Goto Github PK
View Code? Open in Web Editor NEWKeeps selected property values (like volume) between player sessions
License: MIT License
Keeps selected property values (like volume) between player sessions
License: MIT License
Hi, The script does not work in Win 8.1 with portable_config. I have placed script, persist-properties.lua, in /portable_config/scripts. The conf file, persist_properties.conf, is placed in portable_config/script-opts.
So far tried to name both script and conf file similarly, placing the script file in /script and removing volume=## from mpv.conf. None of which worked. I am using latest windows build of mpv by shinchiro.
persist-properties.lua
saves persistent_config.json
in APPDATA
, which I do not want, I want it to detect where my mpv.conf
and the rest of the files are, and save the persistent_config.json
there.
For example: If I save everything on C:/mpv
, I want persistent_config.json
to be saved there aswell, not in APPDATA
.
Hi,
thanks for this script, but I missed one important feature: saving volume of different videos independently.
For example, when I watch some streams or films, sometimes the volume is not enough so I have to turn it up. But when I watch some music clips, it is often necessary to turn it down. Script saves volume between player sessions, but I would like it to save volume separately for each video.
Can you implement this feature?
As subject, the filename mentioned in the README.md
is incorrect.
Despite the script name is persist-properties.lua
with the hyphen,
mp.get_script_name()
will format the filename with underscores and return 'persist_properties'
.
Such value will be used as the identifier
, when omitted, in
options.read_options(table [, identifier [, on_update]])
which is the case in the script.
Fixing the above reveals another issue when a non-number property is saved and later loaded.
[persist_properties] Lua error: ...\user\AppData\Roaming/mpv/scripts/persist-properties.lua:65: bad argument #2 to 'set_property_number' (number expected, got boolean)
I believe the following line in the onInitialLoad
function,
mp.set_property_number(name, value)
should be
mp.set_property_native(name, value)
(or with set_property
and ensuring value
to be a string?)
Although I'm new to the mpv scripting API and haven't read all the document to be totally sure yet.
By the way thanks for the useful script.
Publishing code without a license, even if it's a small script, is a worst practice: nobody knows what to do with it, if it's fine to redistribute, to modify, or if someone should pay you a fee just to look at it.
If you just don't want to think about licensing and allow people to do anything with it, which is what I guess are your intentions, the best licenses for that are the MIT, the Unlicense, and the WTFPL.
Hi,
If the property is a Boolean false the property is not set but some property require be set example "aid":false will not work
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.