summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAvi Halachmi (:avih) <avihpit@yahoo.com>2021-09-30 18:23:02 +0300
committerAvi Halachmi (:avih) <avihpit@yahoo.com>2021-09-30 18:28:46 +0300
commit38b55c862fcf919428d8a7e0fd21b00b3aaf37c1 (patch)
treed18939f4d593fa06fd4d6604ef8f7e03ab68966d
parent6123e97e318122e128b4c034f897e8a82840a067 (diff)
downloadmpv-38b55c862fcf919428d8a7e0fd21b00b3aaf37c1.tar.bz2
mpv-38b55c862fcf919428d8a7e0fd21b00b3aaf37c1.tar.xz
DOCS/javascript.rst: clarifications (file_info, custom init)
-rw-r--r--DOCS/man/javascript.rst7
1 files changed, 5 insertions, 2 deletions
diff --git a/DOCS/man/javascript.rst b/DOCS/man/javascript.rst
index 6d4d207fbc..a8687ff692 100644
--- a/DOCS/man/javascript.rst
+++ b/DOCS/man/javascript.rst
@@ -179,7 +179,8 @@ success, ``fn`` is called always a-sync, ``error`` is empty string on success.
``mp.utils.readdir(path [, filter])`` (LE)
-``mp.utils.file_info(path)`` (LE)
+``mp.utils.file_info(path)`` (LE) Note: like lua - this does NOT expand
+meta-paths like ``~~/foo`` (other JS file functions do expand meta paths).
``mp.utils.split_path(path)``
@@ -338,7 +339,9 @@ After mpv initializes the JavaScript environment for a script but before it
loads the script - it tries to run the file ``.init.js`` at the root of the mpv
configuration directory. Code at this file can update the environment further
for all scripts. E.g. if it contains ``mp.module_paths.push("/foo")`` then
-``require`` at all scripts will search global module id's also at ``/foo``.
+``require`` at all scripts will search global module id's also at ``/foo``
+(do NOT do ``mp.module_paths = ["/foo"];`` because this will remove existing
+paths - like ``<script-dir>/modules`` for scripts which load from a directory).
The event loop
--------------