Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Script will pause at the beginning of each new subtitle for the amount of time that
- -- the subtitle would normally appear on the screen, multiplied by FACTOR.
- -- So if a sub was going to appear for 4 seconds and you have a FACTOR of 0.5 then
- -- then there will be a 2 second pause when that subtitle appears.
- local FACTOR = 0.5
- local pause_disease = false
- function pause(a, b)
- if not pause_disease then
- return
- end
- if b ~= "" then
- mp.set_property_native("pause", true)
- local pause_length = FACTOR * (mp.get_property_number('sub-end') - mp.get_property_number('sub-start'))
- mp.add_timeout(pause_length, function() mp.set_property_native("pause", false) end)
- end
- end
- function toggle_pause_disease()
- pause_disease = not pause_disease
- mp.osd_message("Pause disease " .. (pause_disease and "activated" or "deactived"), 3)
- end
- mp.add_key_binding("ctrl+p", toggle_pause_disease)
- mp.observe_property("sub-text", 'string', pause)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement