An open-source media server that has two goals:
- Don't fall prey to commercial interests (the freedom to change a program, so that you can control it instead of it controlling you)
- Don't aim to be anything more than be the best music server possible (Worse is better)
It's your music.
It's your features.
It's your data.
No subscriptions.
No tracking.
No restrictions.
This project is licensed under the Mozilla Public License 2.0.
See the LICENSE
file for more.
media/drums.wav
sample file by alexround
via freesound.
The ideal use-case is:
- Add your music files to a computer you own
- Download the source code and compile it
- Run the server on that computer within your LAN
- Play music from it on any of your devices without signups, tracking or limits
xfern supports a great event-based plugin system where you can build your own integrations and functionality.
Want automatically-downloaded album art? Make a plugin!
Want last.fm
tracking? Make a plugin!!
Want visual lyrics sync? Make a plugin!!!
You'll need the following:
Yarn
- A modern browser
- Some music files!
To setup everything, run:
cd path/to/xfern
yarn install
Then add some .mp3
(or other supported formats) to the /media
folder in any
directory structure that suits you.
Then to run the development server:
yarn start
This will start the xfern server on port 3000 (the UI) and port 3001 (the API).
xfern is an extensible media server, but you don't have to edit its source to get new functionality. Instead, you can write small, independent plugins that can do anything you like.
If you put a Javascript file into the /plugins
folder, xfern will load it at
bootup and will invoke the plugin's handler function will any events that the
server generates (eg: start-track
, do-search
).
Your plugin code can do anything it likes -- xfern's functionality is limited only by your imagination.
Here is an example of what should go in your plugin file:
// myPlugin.js
const handleEvent = (eventName, data) => {
console.log('Received event: ', eventName);
console.log('Received data: ', data);
}
export default {
name: 'My Plugin',
handler: handleEvent
}