Replies: 2 comments 2 replies
-
We can't read or set window position or size. And this is more of a job for desktop environment imo. I'm personally using autohotkey to position window to a specific place: +PrintScreen::
if WinExist("ahk_exe mpv.exe") {
WinGetPos,,,W,H
WinMove,,, 2560-620, 40, 620, % 620 * (H/W)
}
return And I have an old autotop script which enables on top only when media is playing, or is in fullscreen/maximized mode: local options = {enabled = false}
require('mp.options').read_options(options, 'autotop')
function decide_on_top()
local is_fullscreen = mp.get_property_native('fullscreen') == true
local is_paused = mp.get_property_native('pause') == true
mp.set_property_native('ontop', is_fullscreen or (options.enabled and not is_paused))
end
function set_enabled(value)
options.enabled = value
mp.commandv('script-message-to', 'uosc', 'set', 'autotop', options.enabled and 'yes' or 'no')
decide_on_top()
end
mp.observe_property('pause', 'bool', decide_on_top)
mp.observe_property('fullscreen', 'bool', decide_on_top)
mp.add_key_binding(nil, 'toggle', function() set_enabled(not options.enabled) end)
-- uosc integration
mp.register_script_message('set', function(name, value)
if name == 'autotop' then set_enabled(value == 'yes') end
end)
-- initialization
mp.add_timeout(0.5, function() set_enabled(options.enabled) end) Which I add to controls bar with:
I then have another autohotkey script which converts global PrintScreen to |
Beta Was this translation helpful? Give feedback.
-
mpv doesn't use any OS's PIP api. I think the request should be firstly posted to mpv instead. |
Beta Was this translation helpful? Give feedback.
-
I have an suggestion to add this sort of button, there is really not much that probably need to be done:
Clicking button again will restore previous state.
I think it would be really useful feature. I, myself sometimes watching steams in mpv and while I can do this manually with a bunch of hotkeys, this process always take some time and I couldn't revert it instantly as well. I wish to have this sort of convenient button.
Beta Was this translation helpful? Give feedback.
All reactions