summaryrefslogtreecommitdiffstats
path: root/TOOLS
diff options
context:
space:
mode:
authorPatrick Hipp <patrick.hipp@student.tugraz.at>2015-03-23 16:18:18 +0100
committerwm4 <wm4@nowhere>2015-03-23 20:45:12 +0100
commitc48de9e399cad3c1b181d0e0e53841e5c15e7610 (patch)
tree0d0b69aff138524ed496d2d5ae1ca718336d9c53 /TOOLS
parent53f24ac5adc07a1498cbf430d826f67554c019bf (diff)
downloadmpv-c48de9e399cad3c1b181d0e0e53841e5c15e7610.tar.bz2
mpv-c48de9e399cad3c1b181d0e0e53841e5c15e7610.tar.xz
TOOLS: add a lua script for a -stay on top only during playback- mode
Signed-off-by: wm4 <wm4@nowhere>
Diffstat (limited to 'TOOLS')
-rw-r--r--TOOLS/lua/ontop-playback.lua19
1 files changed, 19 insertions, 0 deletions
diff --git a/TOOLS/lua/ontop-playback.lua b/TOOLS/lua/ontop-playback.lua
new file mode 100644
index 0000000000..b02716c4f1
--- /dev/null
+++ b/TOOLS/lua/ontop-playback.lua
@@ -0,0 +1,19 @@
+--makes mpv disable ontop when pausing and re-enable it again when resuming playback
+--please note that this won't do anything if ontop was not enabled before pausing
+
+local was_ontop = false
+
+mp.observe_property("pause", "bool", function(name, value)
+ local ontop = mp.get_property_native("ontop")
+ if value then
+ if ontop then
+ mp.set_property_native("ontop", false)
+ was_ontop = true
+ end
+ else
+ if was_ontop and not ontop then
+ mp.set_property_native("ontop", true)
+ end
+ was_ontop = false
+ end
+end)