TOOLS: add a lua script for a -stay on top only during playback- mode

Signed-off-by: wm4 <wm4@nowhere>
This commit is contained in:
Patrick Hipp 2015-03-23 16:18:18 +01:00 committed by wm4
parent 53f24ac5ad
commit c48de9e399
1 changed files with 19 additions and 0 deletions

View File

@ -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)