Skip to content

Instantly share code, notes, and snippets.

@bitingsock
Created September 6, 2021 10:35
Show Gist options
  • Save bitingsock/0f22c631295273d5a53e4337c25fe161 to your computer and use it in GitHub Desktop.
Save bitingsock/0f22c631295273d5a53e4337c25fe161 to your computer and use it in GitHub Desktop.
keybind to rewind to the end of the previous playlist entry
local optStart = 0
function seekHandler(duration)
if mp.get_property_number("playlist-pos") > 0 then
optStart = mp.get_property("start")
mp.set_property("start", duration)
mp.command("playlist-prev")
end
end
mp.register_event("file-loaded", function() mp.set_property("start", optStart) end)
mp.add_key_binding("Ctrl+left","rewindPlaylist",function() seekHandler(-5) end)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment