summaryrefslogtreecommitdiffstats
path: root/player/lua
diff options
context:
space:
mode:
authorAvi Halachmi (:avih) <avihpit@yahoo.com>2021-07-05 11:01:22 +0300
committeravih <avih@users.noreply.github.com>2021-07-06 16:12:36 +0300
commitd2dd4cacb804f8f95f648c6dc4b0b9481ffa9410 (patch)
treeb84980efeeffcba6bfdd44dd36ba4eb4fa8211b6 /player/lua
parentf2afae55e95b4b1eec1aeb828ba6ff1f0695d993 (diff)
downloadmpv-d2dd4cacb804f8f95f648c6dc4b0b9481ffa9410.tar.bz2
mpv-d2dd4cacb804f8f95f648c6dc4b0b9481ffa9410.tar.xz
osc: expose osc-visibility via shared-script-properties
osc-visibility can already be changed at runtime via script-message or other means, but until now there was no way to tell what the current state is. Now shared-script-properties/osc-visibility reflects this state. It's output-only by the osc - changing it does not affect the osc. Useful if a script wants to change osc-visibility temporarily, and later restore to its original state. There's no way to coordinate if more than one script wants to change it, but that would be a hard problem to solve anyway, even if the osc itself tried to coordinate such requests from different sources.
Diffstat (limited to 'player/lua')
-rw-r--r--player/lua/osc.lua1
1 files changed, 1 insertions, 0 deletions
diff --git a/player/lua/osc.lua b/player/lua/osc.lua
index e3cefd1642..18e8d4e048 100644
--- a/player/lua/osc.lua
+++ b/player/lua/osc.lua
@@ -2803,6 +2803,7 @@ function visibility_mode(mode, no_osd)
end
user_opts.visibility = mode
+ utils.shared_script_property_set("osc-visibility", mode)
if not no_osd and tonumber(mp.get_property("osd-level")) >= 1 then
mp.osd_message("OSC visibility: " .. mode)