Skip to content

Instantly share code, notes, and snippets.

@Shudouken
Created April 9, 2015 19:07
Show Gist options
  • Select an option

  • Save Shudouken/efb9891041592cbe3e2b to your computer and use it in GitHub Desktop.

Select an option

Save Shudouken/efb9891041592cbe3e2b to your computer and use it in GitHub Desktop.
Slideshow
local on = false
function slideshow_handler()
if on == false then
mp.osd_message("Starting slideshow")
on = true
mp.command("playlist_next")
if sl_timer then
sl_timer:resume()
else
sl_timer = mp.add_periodic_timer(5, function() mp.command("playlist_next") end)
end
else
mp.osd_message("Stopping slideshow")
on = false
sl_timer:kill()
end
mp.resume_all()
end
mp.add_key_binding("ctrl+s", "slideshow", slideshow_handler)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment