diff options
author | Avi Halachmi (:avih) <avihpit@yahoo.com> | 2017-12-14 21:22:56 +0200 |
---|---|---|
committer | Kevin Mitchell <kevmitch@gmail.com> | 2018-04-07 16:02:19 -0700 |
commit | b04f0cad43eb627fb4e970367062329e3331d9fe (patch) | |
tree | 1efa6536ec401f7c7c10577db0f300f10b7bda62 /DOCS/man | |
parent | 9eadc068fa13b8d83ad049e83960883d06d3c125 (diff) | |
download | mpv-b04f0cad43eb627fb4e970367062329e3331d9fe.tar.bz2 mpv-b04f0cad43eb627fb4e970367062329e3331d9fe.tar.xz |
js: implement mp.options.read_options
Diffstat (limited to 'DOCS/man')
-rw-r--r-- | DOCS/man/javascript.rst | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/DOCS/man/javascript.rst b/DOCS/man/javascript.rst index cd553510eb..5b446cea69 100644 --- a/DOCS/man/javascript.rst +++ b/DOCS/man/javascript.rst @@ -27,16 +27,16 @@ otherwise, the documented Lua options, script directories, loading, etc apply to JavaScript files too. Script initialization and lifecycle is the same as with Lua, and most of the Lua -functions at the modules ``mp``, ``mp.utils`` and ``mp.msg`` are available to -JavaScript with identical APIs - including running commands, getting/setting -properties, registering events/key-bindings/property-changes/hooks, etc. +functions at the modules ``mp``, ``mp.utils``, ``mp.msg`` and ``mp.options`` are +available to JavaScript with identical APIs - including running commands, +getting/setting properties, registering events/key-bindings/hooks, etc. Differences from Lua -------------------- -No need to load modules. ``mp``, ``mp.utils`` and ``mp.msg`` are preloaded, and -you can use e.g. ``var cwd = mp.utils.getcwd();`` without prior setup. -``mp.options`` is currently not implemented, but ``mp.get_opt(...)`` is. +No need to load modules. ``mp``, ``mp.utils``, ``mp.msg`` and ``mp.options`` +are preloaded, and you can use e.g. ``var cwd = mp.utils.getcwd();`` without +prior setup. Errors are slightly different. Where the Lua APIs return ``nil`` for error, the JavaScript ones return ``undefined``. Where Lua returns ``something, error`` @@ -87,8 +87,6 @@ Unsupported Lua APIs and their JS alternatives ``mp.dispatch_events([allow_wait])`` see event loop below. -``mp.options`` module is not implemented currently for JS. - Scripting APIs - identical to Lua --------------------------------- @@ -184,6 +182,8 @@ Otherwise, where the Lua APIs return ``nil`` on error, JS returns ``undefined``. ``mp.add_hook(type, priority, fn)`` +``mp.options.read_options(obj [, identifier])`` (types: string/boolean/number) + Additional utilities -------------------- |