po5 / chapterskip

mpv script to skip chapters based on their title
32 stars 7 forks source link

Add Delay --Request #4

Open Cananbolt opened 2 years ago

Cananbolt commented 2 years ago

I would like to know if there can be a way to add a delay to the script.

For example, say I put a 5-second delay. After those 5 seconds, the chapter skips.

po5 commented 2 years ago

You can wrap time-pos property setting inside an anonymous function with mp.addtimeout.
Interesting idea, may implement whenever I have a burst of motivation (and also implement more user requested features like pausing), but for now you'll have to do it yourself.

Cananbolt commented 2 years ago

Sounds good. Thank you for acknowledging the request. Hopefully, sometime in the future, you may fulfill it when you have the chance. Nonetheless, thank you for the script.

po5 commented 1 year ago

addtimeout solution: what if you get to a skipped chapter and decide to pause before the 5 seconds? I wouldn't want it to jump.
Adding an offset to chapter times would be a better solution, and play nicer with other functionality we may want to add.

Cananbolt commented 1 year ago

Now that you mentioned it, that is a great point. Could the offset to chapter times be completed by a keybind? Something that may toggle to script on or off. On default, it would be on letting it skip the chapter, and once pressed, it will be off letting the chapter play all the way through.