Skip to content

Instantly share code, notes, and snippets.

@po5
Created September 29, 2020 11:02
Show Gist options
  • Save po5/36d6a3ea5451598eb6ddd3d1036fa9c1 to your computer and use it in GitHub Desktop.
Save po5/36d6a3ea5451598eb6ddd3d1036fa9c1 to your computer and use it in GitHub Desktop.
function sub_seek_two(dir)
if dir == 1 then
target = mp.get_property_number("sub-end")
if target then
mp.commandv("seek", target-0.03, "absolute+exact")
end
else
target = mp.get_property_number("sub-start")
if target then
mp.commandv("seek", target+0.01, "absolute+exact")
end
end
end
mp.add_key_binding("b", "sub_seek_right", function() return sub_seek_two(1) end)
mp.add_key_binding("B", "sub_seek_left", function() return sub_seek_two(-1) end)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment