Skip to content

Instantly share code, notes, and snippets.

@po5
Last active September 4, 2022 11:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save po5/9de69c90f9dc44427e58b1a2f9ad4ffd to your computer and use it in GitHub Desktop.
Save po5/9de69c90f9dc44427e58b1a2f9ad4ffd to your computer and use it in GitHub Desktop.
Skip to current subtitle start/end
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-forward", function() return sub_seek_two(1) end)
mp.add_key_binding("B", "sub-seek-backward", 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