aboutsummaryrefslogtreecommitdiffhomepage
path: root/DOCS/man/javascript.rst
Commit message (Collapse)AuthorAge
* js: implement mp.register_idleGravatar Avi Halachmi (:avih)2018-04-07
| | | | | | | | | | Due to earlier misinterpretation of the Lua docs as if mp.register_idle registers a one-shot callback, the JS docs suggested to use setTimeout. But the behavior and Lua docs are such that it's a repeating callback which fires just before the script thread goes to sleep. Implement it for JS too.
* js: implement mp.options.read_optionsGravatar Avi Halachmi (:avih)2018-04-07
|
* lua+js: Implement utils.getpid()Gravatar sfan52018-02-13
| | | | | | | Usable for uniquely identifying mpv instances from subprocesses, controlling mpv with AppleScript, ... Adds a new mp_getpid() wrapper for cross-platform reasons.
* js: implement mp.msg.trace()Gravatar TheAMM2017-12-16
| | | | | | | To match the new Lua helper introduced in 1afdeee1ad8bca1c703e741002fa3b882d162968 Add documentation for both.
* lua+js: implement utils.file_info()Gravatar TSaaristo2017-12-13
| | | | | | | | | | | | | | | This commit introduces mp.utils.file_info() for querying information on file paths, implemented for both Lua and Javascript. The function takes a file path as an argument and returns a Lua table / JS object upon success. The table/object will contain the values: mode, size, atime, mtime, ctime and the convenience booleans is_file, is_dir. On error, the Lua side will return `nil, error` and the Javascript side will return `undefined` (and mark the last error). This feature utilizes the already existing cross-platform `mp_stat()` function.
* manpage: Fix typo (reomve -> remove)Gravatar Anna-Maria Meriniemi2017-12-10
| | | | This commit fixes the "reomve" typo in the Javascript docs.
* manpage: upcase JavaScript for section title case consistency.Gravatar torque2017-07-17
|
* js: utils.getenv(): fix crash on undefined varGravatar Avi Halachmi (:avih)2017-07-06
|
* js: add javascript scripting support using MuJSGravatar Avi Halachmi (:avih)2017-06-14
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.