diff options
author | rcombs <rcombs@rcombs.me> | 2022-12-16 13:43:30 -0600 |
---|---|---|
committer | rcombs <rcombs@rcombs.me> | 2023-01-28 14:37:24 -0600 |
commit | 3ec2a0988aca7cba4620b6c22929b91a34ea6eb4 (patch) | |
tree | a1c3c70ac18f8301724398231b5cdec6568ab58c /DOCS/man/input.rst | |
parent | 68a20e7ae44d211bba1de10739734e38117855f5 (diff) | |
download | mpv-3ec2a0988aca7cba4620b6c22929b91a34ea6eb4.tar.bz2 mpv-3ec2a0988aca7cba4620b6c22929b91a34ea6eb4.tar.xz |
docs: document new user-data property
Diffstat (limited to 'DOCS/man/input.rst')
-rw-r--r-- | DOCS/man/input.rst | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/DOCS/man/input.rst b/DOCS/man/input.rst index 280e30cc8c..3613fb7dac 100644 --- a/DOCS/man/input.rst +++ b/DOCS/man/input.rst @@ -3256,6 +3256,26 @@ Property list (There is no way to ensure synchronization if two scripts try to update the same key at the same time.) +``user-data`` (RW) + This is a recursive key/value map of arbitrary nodes shared between clients for + general use (i.e. scripts, IPC clients, host applications, etc). + The player itself does not use any data in it (although some builtin scripts may). + The property is not preserved across player restarts. + + This is a more powerful replacement for ``shared-script-properties``. + + Sub-paths can be accessed directly; e.g. ``user-data/my-script/state/a`` can be + read, written, or observed. + + The top-level object itself cannot be written directly; write to sub-paths instead. + + Lua scripting has helpers starting with ``utils.user_data_``. + + Converting this property or its sub-properties to strings will give a JSON + representation. If converting a leaf-level object (i.e. not a map or array) + and not using raw mode, the underlying content will be given (e.g. strings will be + printed directly, rather than quoted and JSON-escaped). + ``working-directory`` The working directory of the mpv process. Can be useful for JSON IPC users, because the command line player usually works with relative paths. |