From d223a63bc5de423bca7337795fe165678cf6d236 Mon Sep 17 00:00:00 2001 From: "Avi Halachmi (:avih)" Date: Sat, 13 Dec 2014 18:27:47 +0200 Subject: 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. --- wscript_build.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'wscript_build.py') diff --git a/wscript_build.py b/wscript_build.py index ab50b107a6..41827906ef 100644 --- a/wscript_build.py +++ b/wscript_build.py @@ -92,6 +92,12 @@ def build(ctx): target = os.path.splitext(fn)[0] + ".inc", ) + ctx( + features = "file2string", + source = "player/javascript/defaults.js", + target = "player/javascript/defaults.js.inc", + ) + ctx(features = "ebml_header", target = "ebml_types.h") ctx(features = "ebml_definitions", target = "ebml_defs.c") @@ -237,6 +243,7 @@ def build(ctx): ( "player/misc.c" ), ( "player/lavfi.c" ), ( "player/lua.c", "lua" ), + ( "player/javascript.c", "javascript" ), ( "player/osd.c" ), ( "player/playloop.c" ), ( "player/screenshot.c" ), -- cgit v1.2.3