This is application features a song player and playlist of songs for the self-hosted media enthusiast, which executes in a web browser for both desktop and mobile. The playlist allows filtering and a variety of sorting features.
git clone https://github.com/prettydiff/mp3-master-list.gitnode lib/index.ts my_config.jsonThis application makes use of a config file in JSON format. Here is an example:
{
"paths": {
"media": "C:\\demo_music\\",
"write": "c:\\demo_music\\"
},
"split": true,
"type": "music"
}
I did not want to be reliant on a streaming media service when I have thousands of song files. I wanted an experience that allowed me to play these song files both locally and across a network. The proper solution needed to work on a desktop and a phone.
My primary design inspiration is WinAmp. I love the simplicity of the media playback application paired against a long playlist. It feels like I have everything I need immediately present to enjoy access to my media collection.
I looked at the Apple App store for something like I wanted, but was disappointed. My native iPhone apps wanted to achieve the experience I was looking for, but couldn't. I also examined the JavaScript remake of WinAmp, but could not get it to work correctly on an iPhone. So, I wrote my own solution.
When I started writing this application it became clear why such a simple vision was so challenging for well funded projects to achieve. Apple handicaps access to certain file system APIs provided to JavaScript on mobile platform that are otherwise available to desktop Safari, particularly the ability to read directories. I solved for this by reading from directories using a Node.js script and preparing the output on song file data into a JSON data list a web browser could import.
I also found iPhone features an artificially restricted memory buffer for parsing JSON. To solve for this I prepare large playlists into a series of JSON files of no more than 500 songs each. I request and then parse each of these files one at a time in order to populate the complete music playlist in a way that fully achieves large playlists even on iPhones.
The application just makes use of HTTP streaming media. This requests a range header in a typical HTTP request and receives 206 status HTTP response with the requested media file segment. This application uses only a 1mb range to balance between the fewests requests per large song file against the needs to support continuous play across extremely slow networks.