-
Notifications
You must be signed in to change notification settings - Fork 6
Module: Local Files
Allows you to browse and view video content from a local or mounted directory.
Browse
- Folder browsing
- M3U playlist directory creation
Playback (through MPV)
- Supported file types: "mp4", "mkv", "avi", "mov", "m4v", "webm", "wmv", "flv", "f4v", "mpg", "mpeg", "vob"
- Playlist support using m3u and m3u8 files
- Loop playback support
- Progress save and resume
- Switch audio/subtitle tracks during playback
- Custom MPV OSC/OSD designed for CRT usage
| Option | Values | Info |
|---|---|---|
| Enabled | On/Off | Sets if the Local Files module should display in the main module list when you start 240-MP. |
| Media Directory | Default or User Selected | Allows you to choose where the Local Files module will look for content |
| Loop Playback | On/Off | Defines if playback should loop or not |
| Shuffle Playback | On/Off | Defines if playback should shuffle its items or not. When this is turned on Resume Playback will not activate for playlists. |
| Resume Playback | Ask/Always/Never | 'Ask' will present you with an option to restart playback or resume, 'Always' will resume without asking and 'Never' will restart playback from the beginning without asking |
Local Files will display and allow you to play any of the supported file types listed above as long as they exist in the local files media directory.
The default media directory is located at:
- RaspberryPi:
~/.local/share/240-MP/media - MacOS:
~/Library/Application Support/240-MP/media
And you can change that to any directory you like (a different local folder, usb, remote share, etc...) through the Media Directory option in settings.
Folder browsing is supported as well so feel free to organize your files in the media directory however you prefer.
Local Files also supports .m3u/.m3u8 playlists and you can use them to create playlists for things like a season of a given TV Show. Combined with the Resume Playback setting, playlists can allow you to keep track of where you are in a given list of videos.
On a Raspberry Pi, CIFS Utilities can be used to map a remote share and then you can set that share to automount on boot through fstab.
Here are the steps:
-
Install CIFS utilities
CIFS should be included as part of Raspberry Pi OS Lite but if it's not simply run the following to install it:
sudo apt update sudo apt install cifs-utils
-
Create a mount point
Create a directory on your Pi where your remote files will be accessible. A common location is inside the
/mntdirectory. Change[YOUR_FOLDER_NAME]in the below command to the name you'd like to use.sudo mkdir -p /mnt/[YOUR_FOLDER_NAME]
-
Mount your share to that mount point
Mount the network share replacing the placeholders with your server details and login credentials
sudo mount -t cifs -o username=[YOUR_SHARE_USERNAME],password=[YOUR_SHARE_PASSWORD] //[YOUR_SHARE_IP]/[YOUR_SHARE_FOLDER] /mnt/[YOUR_FOLDER_NAME]
-
Mount the share automatically on boot
To ensure the share reconnects automatically every time the Pi boots, add an entry to your
fstabfile:- Open the file in the nano editor:
sudo nano /etc/fstab
- Add the following line to the bottom of the file:
//[YOUR_SHARE_IP]/[YOUR_SHARE_FOLDER] /mnt/[YOUR_FOLDER_NAME] cifs credentials=/home/[YOUR_PI_USERNAME]/.smbcredentials,uid=1000,gid=1000,nofail 0 0
- Note: The
nofailoption ensures your Pi will still boot properly if the network share is offline and the.smbcredentialsfile is where you'll store your share's username/password in the next step - Save the file and exit
- Open the file in the nano editor:
-
Store your remote share credentials in
.smbcredentialsWhen using
fstab, it is best practice to store your credentials in a separate, hidden file so it isn't viewable by other users on the same pi:- Create a credentials file:
nano /home/[YOUR_PI_USERNAME]/.smbcredentials
- Add your username and password to that file:
username=[YOUR_SHARE_USERNAME] password=[YOUR_SHARE_PASSWORD]
- Save the file and then restrict its permissions for security with:
chmod 600 /home/[YOUR_PI_USERNAME]/.smbcredentials
That's it, with those steps complete your remote share should automount on boot and you can update the local files media directory to point to your new directory in
/mnt/to list files for playback from it. - Create a credentials file:
- Music/Audio playback support
