Commit Graph

4 Commits

Author SHA1 Message Date
Avi Halachmi (:avih) 2dd2acac89 js: fix broken mp.set_property_number, mp.set_property_native
Also implicitly fixes memory leak when mp.set_property_native was used,
because the cleanup did not expect more allocations from the accidental
use of mpv_get_property.
2017-09-23 14:41:17 +03:00
Avi Halachmi (:avih) fa857ac7bc js: utils.getenv(): fix crash on undefined var 2017-07-06 18:11:24 +03:00
wm4 aa690e3997 javascript: replace custom MIN macro with MPMIN 2017-06-17 14:28:42 +02:00
Avi Halachmi (:avih) d223a63bc5 js: add javascript scripting support using MuJS
Implements JS with almost identical API to the Lua support.

Key differences from Lua:
- The global mp, mp.msg and mp.utils are always available.
- Instead of returning x, error, return x and expose mp.last_error().
- Timers are JS standard set/clear Timeout/Interval.
- Supports CommonJS modules/require.
- Added at mp.utils: getenv, read_file, write_file and few more.
- Global print and dump (expand objects) functions.
- mp.options currently not supported.

See DOCS/man/javascript.rst for more details.
2017-06-14 12:29:32 +02:00