How to infinite loop every video I play as defaut on MPV player without having to press shift+L hotkey every single time?

Solution 1:

As far as I know there is no configuration in this program.

While it isn't created by default, mpv supports a file called mpv.conf, which allows mpv behavior to be customized (globally, for particular media extensions, or by setting other custom "profiles" that refer to an arbitrary group of options and that can be used with --profile=). An overview of the general format of mpv.conf for the most recent versions of mpv can be found here ("Stable" version here).

How do I infinitely loop every video I play by defaut with MPV player?

  1. Create a text file called mpv.conf.

  2. Place the following line in that file:

    ex. mpv.conf

    loop-file=inf
    
  3. Place mpv.conf under one of the following directories (depending on your platform):

    # Linux
    
    # System-wide
    /etc/mpv
    /usr/local/etc/mpv
    
    # User specific
    ~/.config/mpv/mpv.conf
    
    # Windows
    C:\users\USERNAME\AppData\Roaming\mpv\mpv.conf
    
    # Create "portable_config" in the same folder as mpv.exe
    C:\path\to\mpv\portable_config\mpv.conf
    

If you want to infinitely loop a playlist, use loop-playlist=inf. You can add both options to mpv.conf to create an infinite playlist where each entry loops infinitely as well:

ex. mpv.conf

loop-playlist=inf
loop-file=inf

For usability, you can also add a profile to disable looping:

ex. mpv.conf

# global (default) options
loop-playlist=inf
loop-file=inf

# "finite" playback profile (disable looping)
# usage: mpv --profile=finite ...
# Note that "finite" is an arbitrary name
[finite]
loop-playlist=no
loop-file=no

References (mpv)

  • loop-file
  • loop-playlist

Solution 2:

You could make alias with loop option and save it to .profile or .zshrc or .bashrc like:

alias mpvl='mpv --loop '