How to play a folders worth of music/video in VLC media player
By commandline, with recent versions, it should work with your command options and the name of the directory(ies) instead of the files:
vlc --LZ "Party Music"
If your path includes spaces you need to include it between ""
.
Only if you modified the default options you may need to add also --playlist-autostart
.
The option --playlist-tree
only shows the playlist as a tree. Enable if you want.
If you are not in the parent directory of "Party Music"
you have to specify the whole path, complinat with your operating system (e.g. "C:\Music\Party Music"
or "~/Music/All Music/Party Music"
or /media/user/usb/Party Music
).
Note:
VLC usually remembers the last setting you decided. If you run from commandline (or with a link built for this purpose) it will overcome the usual behaviour following the prescription specified by the options without changing it. If instead you will change some setting during its run it will remember the next time.
From vlc --help
-L, --loop, --no-loop Repeat all (default disabled) -Z, --random, --no-random Play files randomly forever (default disabled) VLC will randomly play files in the playlist until interrupted. (default disabled) --playlist-autostart, --no-playlist-autostart Auto start (default enabled) --playlist-tree, --no-playlist-tree Display playlist tree (default disabled)
Tested on VLC media player 2.1.6 Rincewind on Ubuntu, but it should work on precedent versions and for different operating systems too.
According to this blog post the --playlist-tree will play everything in the folder passed into it. For example:
"C:\Program Files (x86)\VideoLAN\VLC\vlc.exe" --playlist-autostart --loop --playlist-tree c:\playlist\
Also note that the example is for a Windows system, you may need to modify the syntax slightly if you are using a Unix based system.
As I didn't get tbenz9's solution working, I wrote a little batch script doing the trick:
cd C:\your\directory\with\music
for /r %a in (*) do "C:\Program Files (x86)\VideoLAN\VLC\vlc.exe" -LZ --one-instance --playlist-enqueue "%a"
The --one-instance
option tells VLC media player to keep only one window, and I think --playlist-enqueue
is quite explicit.
On Linux, it can be simply achieved with:
find /my/music/directory/ -type f -exec vlc -LZ '{}' +
I often need to work my way thru a lot of videos, in a particular sequence. When I stop watching one, I want my player to remember where I was, and resume from that point.
VLC cannot do either of these, not without extra work. Instead, I use "Media Player Classic - Home Cinema" http://mpc-hc.org/ for this very reason. I even created my own tiny script to launch MPC-HC and resume the most recently-played file automatically.
The VLC development team is opposed to automatically playing the next file, even as an option. They insist that you must select the files manually, and then add them to a playlist, or open the folder (which would start from the first file, which isn't what I want), or add them individually. Their dogma is NOT user-friendly!