0

I'd like to reproduce this behavior:

Pressing the number keys 1-9 would automatically skip ahead in the current video to the corresponding percentage of time. So pressing "4" would jump to the 40% mark of the video, regardless of specific time length of the video. Basically similar to how this works on YouTube.

It seems there's no built-in method for this (and number keys are already assigned other tasks by default) but is there any sort of Lua Script that could achieve this?

Thank you

colorful-shirts
  • 238
  • 1
  • 8
  • 1
    Are you writing a lua add-on script and you're stuck on something? Because asking for the existence/link to an existing add-on is not really a good question for stack overflow. If you are writing a script perhaps you can share where you got stuck. – Evert Jan 13 '23 at 03:28
  • Not writing my own script, but also have not seen anything in existence already that could achieve this. I'm appealing to the better minds here. I've done scripts simply for remapping hotkeys but in my searches I can't find a command for mpv that would achieve the percentages thing. – colorful-shirts Jan 14 '23 at 06:50
  • If you can't find an add-on, and you can't write one you're out of luck. Stack overflow is strictly a place for programming, not for support with software. You might have better luck on the superuser website! – Evert Jan 14 '23 at 08:06
  • Normally I would use StackExchange, but the mpv tag is only on StackOverflow. Anyway I figured it out! – colorful-shirts Jan 14 '23 at 22:18

1 Answers1

1

It was more simple than I anticipated. There is already a percentage command native to MPV. So to produce the desired behavior, I just added this to my input.conf file:

1 seek 10 absolute-percent
2 seek 20 absolute-percent
3 seek 30 absolute-percent
4 seek 40 absolute-percent
5 seek 50 absolute-percent
6 seek 60 absolute-percent
7 seek 70 absolute-percent
8 seek 80 absolute-percent
9 seek 90 absolute-percent
colorful-shirts
  • 238
  • 1
  • 8