2015-03-23 15:18:18 +00:00
|
|
|
--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
|
|
|
|
|
2024-05-12 00:14:00 +00:00
|
|
|
mp.observe_property("pause", "bool", function(_, value)
|
2015-03-23 15:18:18 +00:00
|
|
|
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)
|