Figured it out. For anyone having the same issue as me, check this example script out. Keybinds only work through the mp.add_forced_key_binding() function, non-forced does nothing.
The keybinds are Shift++, Shift+- and Shift+0 to add, subtract and reset the zoom level respectively.
Don’t forget to change the extension to .lua, and then you can just put it in %LOCALAPPDATA%\Plex\scripts\ for it to work.
zoom-keybinds.txt (798 Bytes)
[admin edit: file attachments are automatically purged after a few months, so it is better to embed short scripts directly]
function round(num, numDecimalPlaces)
local mult = 10^(numDecimalPlaces or 0)
return math.floor(num * mult + 0.5) / mult
end
function zoomAdd()
mp.command("add video-zoom +0.05")
zoom_level = mp.get_property("video-zoom")
zoom_level = round(zoom_level, 2)
mp.osd_message("Zoom: "..zoom_level, 0.5)
end
function zoomSub()
mp.command("add video-zoom -0.05")
zoom_level = mp.get_property("video-zoom")
zoom_level = round(zoom_level, 2)
mp.osd_message("Zoom: "..zoom_level, 0.5)
end
function zoomReset()
mp.command("set video-zoom 0")
mp.osd_message("Zoom reset")
end
mp.add_forced_key_binding("+", "zoomAdd", zoomAdd)
mp.add_forced_key_binding("_", "zoomSub", zoomSub)
mp.add_forced_key_binding(")", "zoomReset", zoomReset)