@@ -10447,6 +10447,8 @@ <h2>List of Input Commands</h2>
10447
10447
</dd>
10448
10448
<dt><tt class="docutils literal">set <name> <value></tt></dt>
10449
10449
<dd>Set the given property or option to the given value.</dd>
10450
+ <dt><tt class="docutils literal">del <name></tt></dt>
10451
+ <dd>Delete the given property. Most properties cannot be deleted.</dd>
10450
10452
<dt><tt class="docutils literal">add <name> [<value>]</tt></dt>
10451
10453
<dd>Add the given value to the property or option. On overflow or underflow,
10452
10454
clamp the property to the maximum. If <tt class="docutils literal"><value></tt> is omitted, assume <tt class="docutils literal">1</tt>.</dd>
@@ -12954,6 +12956,20 @@ <h2>Property list</h2>
12954
12956
<p class="last">(There is no way to ensure synchronization if two scripts try to update the
12955
12957
same key at the same time.)</p>
12956
12958
</dd>
12959
+ <dt><tt class="docutils literal"><span class="pre">user-data</span></tt> (RW)</dt>
12960
+ <dd><p class="first">This is a recursive key/value map of arbitrary nodes shared between clients for
12961
+ general use (i.e. scripts, IPC clients, host applications, etc).
12962
+ The player itself does not use any data in it (although some builtin scripts may).
12963
+ The property is not preserved across player restarts.</p>
12964
+ <p>This is a more powerful replacement for <tt class="docutils literal"><span class="pre">shared-script-properties</span></tt>.</p>
12965
+ <p>Sub-paths can be accessed directly; e.g. <tt class="docutils literal"><span class="pre">user-data/my-script/state/a</span></tt> can be
12966
+ read, written, or observed.</p>
12967
+ <p>The top-level object itself cannot be written directly; write to sub-paths instead.</p>
12968
+ <p class="last">Converting this property or its sub-properties to strings will give a JSON
12969
+ representation. If converting a leaf-level object (i.e. not a map or array)
12970
+ and not using raw mode, the underlying content will be given (e.g. strings will be
12971
+ printed directly, rather than quoted and JSON-escaped).</p>
12972
+ </dd>
12957
12973
<dt><tt class="docutils literal"><span class="pre">working-directory</span></tt></dt>
12958
12974
<dd>The working directory of the mpv process. Can be useful for JSON IPC users,
12959
12975
because the command line player usually works with relative paths.</dd>
@@ -14304,6 +14320,11 @@ <h2>mp functions</h2>
14304
14320
of that command (which starts asynchronous execution of the command).
14305
14321
Whether this works and how long it takes depends on the command and the
14306
14322
situation. The abort call itself is asynchronous. Does not return anything.</dd>
14323
+ <dt><tt class="docutils literal">mp.del_property(name [,def])</tt></dt>
14324
+ <dd><p class="first">Delete the given property. See <tt class="docutils literal">mp.get_property</tt> and <a class="reference internal" href="#properties">Properties</a> for more
14325
+ information about properties. Most properties cannot be deleted.</p>
14326
+ <p class="last">Returns true on success, or <tt class="docutils literal">nil, error</tt> on error.</p>
14327
+ </dd>
14307
14328
<dt><tt class="docutils literal">mp.get_property(name [,def])</tt></dt>
14308
14329
<dd><p class="first">Return the value of the given property as string. These are the same
14309
14330
properties as used in input.conf. See <a class="reference internal" href="#properties">Properties</a> for a list of
@@ -15004,6 +15025,7 @@ <h2>Scripting APIs - identical to Lua</h2>
15004
15025
<p><tt class="docutils literal">id = mp.command_native_async(table [,fn])</tt> (LE) Notes: <tt class="docutils literal">id</tt> is true-thy on
15005
15026
success, <tt class="docutils literal">error</tt> is empty string on success.</p>
15006
15027
<p><tt class="docutils literal">mp.abort_async_command(id)</tt></p>
15028
+ <p><tt class="docutils literal">mp.del_property(name)</tt> (LE)</p>
15007
15029
<p><tt class="docutils literal">mp.get_property(name [,def])</tt> (LE)</p>
15008
15030
<p><tt class="docutils literal">mp.get_property_osd(name [,def])</tt> (LE)</p>
15009
15031
<p><tt class="docutils literal">mp.get_property_bool(name [,def])</tt> (LE)</p>
@@ -15360,8 +15382,8 @@ <h2>Asynchronous commands</h2>
15360
15382
{"request_id":123,"error":"success","data":null}
15361
15383
</pre>
15362
15384
<p>By design, you will not get a confirmation that the command was started. If a
15363
- command is long running, sending the message will lead to any reply until much
15364
- later when the command finishes.</p>
15385
+ command is long running, sending the message will not lead to any reply until
15386
+ much later when the command finishes.</p>
15365
15387
<p>Some commands execute synchronously, but these will behave like asynchronous
15366
15388
commands that finished execution immediately.</p>
15367
15389
<p>Cancellation of asynchronous commands is available in the libmpv API, but has
0 commit comments