summaryrefslogtreecommitdiffstats
path: root/wscript
diff options
context:
space:
mode:
authorAvi Halachmi (:avih) <avihpit@yahoo.com>2014-12-13 18:27:47 +0200
committerwm4 <wm4@nowhere>2017-06-14 12:29:32 +0200
commitd223a63bc5de423bca7337795fe165678cf6d236 (patch)
treeea803184506cec7c5bc1aac8250ace9d93604907 /wscript
parent82aa1ea87f1c83e9c32f8aa1bc8ce6acb14fa4e6 (diff)
downloadmpv-d223a63bc5de423bca7337795fe165678cf6d236.tar.bz2
mpv-d223a63bc5de423bca7337795fe165678cf6d236.tar.xz
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.
Diffstat (limited to 'wscript')
-rw-r--r--wscript4
1 files changed, 4 insertions, 0 deletions
diff --git a/wscript b/wscript
index 163f25bc4a..4a7d15e92e 100644
--- a/wscript
+++ b/wscript
@@ -290,6 +290,10 @@ iconv support use --disable-iconv.",
'desc' : 'Lua',
'func': check_lua,
}, {
+ 'name' : '--javascript',
+ 'desc' : 'Javascript (MuJS backend)',
+ 'func': check_statement('mujs.h', 'js_setreport(js_newstate(0, 0, 0), 0)', lib='mujs'),
+ }, {
'name': '--libass',
'desc': 'SSA/ASS support',
'func': check_pkg_config('libass', '>= 0.12.1'),