summaryrefslogtreecommitdiffstats
path: root/player/javascript.c
diff options
context:
space:
mode:
authorAvi Halachmi (:avih) <avihpit@yahoo.com>2020-01-08 11:07:36 +0200
committerAvi Halachmi (:avih) <avihpit@yahoo.com>2020-01-08 11:49:49 +0200
commit5e0875c9e04e6773575703b50264ea39c39bf56c (patch)
tree66ad1fd68dc97d52c314719255469fdd2030c1e3 /player/javascript.c
parentf612de17129054c915c23b18241988a284f0baa5 (diff)
downloadmpv-5e0875c9e04e6773575703b50264ea39c39bf56c.tar.bz2
mpv-5e0875c9e04e6773575703b50264ea39c39bf56c.tar.xz
js: use osd-dimentions for mp.get_osd_{size,margins}
This matches lua's 11b9315b but with the lagacy field names which the js code used previously. Currently the property always returns an object (with dummy/last/null field values if there are no dimensions), but the code is ready for a future case where it might return null if there are no dimensions - at which case it will forward the null, breaking backward compatibility for a better API.
Diffstat (limited to 'player/javascript.c')
-rw-r--r--player/javascript.c10
1 files changed, 0 insertions, 10 deletions
diff --git a/player/javascript.c b/player/javascript.c
index fa3b09c7f3..8d0e7715f1 100644
--- a/player/javascript.c
+++ b/player/javascript.c
@@ -743,15 +743,6 @@ static void push_nums_obj(js_State *J, const char * const names[],
}
}
-// args: none, return: object with properties top, bottom, left, right
-static void script_get_osd_margins(js_State *J)
-{
- struct mp_osd_res r = osd_get_vo_res(jctx(J)->mpctx->osd);
- const char * const names[] = {"left", "top", "right", "bottom", NULL};
- const double vals[] = {r.ml, r.mt, r.mr, r.mb};
- push_nums_obj(J, names, vals);
-}
-
// args: none, return: object with properties x, y
static void script_get_mouse_pos(js_State *J)
{
@@ -1237,7 +1228,6 @@ static const struct fn_entry main_fns[] = {
FN_ENTRY(get_wakeup_pipe, 0),
FN_ENTRY(_hook_add, 3),
FN_ENTRY(_hook_continue, 1),
- FN_ENTRY(get_osd_margins, 0),
FN_ENTRY(get_mouse_pos, 0),
FN_ENTRY(input_set_section_mouse_area, 5),
FN_ENTRY(last_error, 0),