Last active
September 4, 2022 11:17
-
-
Save po5/9de69c90f9dc44427e58b1a2f9ad4ffd to your computer and use it in GitHub Desktop.
Skip to current subtitle start/end
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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