2

OS: Ubuntu 22.04.2 LTS

Hey there! A friend advertised mpv to me as the holy grail of media players, so I installed it, and I was wondering how to set a custom shortcut for going to the next file in a folder! Example:

name@computer:~/Videos$ ls
1.mkv 2.mkv 3.mkv 4.mkv
name@computer:~$ mpv 1.mkv

mpv now opened. We are playing the file 1.mkv. I wanna set a custom shortcut, on F11, to play the file 2.mkv. If I then pressed F11 again, 3.mkv should play.

I already modified the default shortcuts by doing:

name@computer:~$ vim ~/.config/mpv/input.conf

and writing:

d add speed 0.1
s add speed -0.1
+ add speed 0.5
- add speed -0.5
ENTER add chapter 1

and stuff like that. It all worked flawlessly, and was very intuitive. But now I've hit a roadblock. I tried to add the functionality I described above, but couldn't. I looked everywhere, at the mpv website, at the github page, but nowhere could I find how to do this. There were options like "playlist-next" and "playlist-prev" but they didn't work at all, even tho the described functionality was "skip to the next/previous file". input.conf on github

So my question is: What do I have to do (or write into input.conf) in order to have a shortcut to go back and forth between video files in a folder?

Thanks in advance!

User1986
  • 371

1 Answers1

0

I use mpv-nextfile on Windows 10 but I should work on Linux too. Place nextfile.lua to your scripts folder. Change the key bindings and paste it inside input.conf :

F10 script-binding previousfile

F11 script-binding nextfile