Last active
December 2, 2024 14:18
-
-
Save stutstev/95caf9dc23d1daefc2f02cf542ac556c to your computer and use it in GitHub Desktop.
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
-- description : continuously reattempts playback of mpv streams upon network errors. | |
-- author : char101 (github.com/char101) | |
function check_stream() | |
local prev_pos = 0 | |
local time_pos = mp.get_property_number('time-pos') | |
if time_pos == prev_pos then | |
mp.commandv('loadfile', mp.get_property('path'), 'replace') | |
end | |
prev_pos = time_pos | |
end | |
mp.add_periodic_timer(5, check_stream) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment