Published on

Introducing Local Music Player (FileSystem API & IndexedDB)

Authors
  • avatar
    Name
    Teddy Xinyuan Chen
    Twitter

https://gg.teddysc.me/music/

alt text
100% local
Table of Contents

Why?

  • It's easier than managing a Navidrome server, configuration and migration can be a headache for Navidrome - I want something that's up forever and I don't have to manage at all
  • I already have tons of music files on my computer
  • Better than streaming from Telegram (lol ik) - I'm using private group as playlists, the music aren't searchable, unfortunately. Bad discoverability
  • I have ad-free Spotify and YouTube, but I still strongly prefer streaming locally

Features

  • 100% local - no server, no cloud, no ads, no tracking, bring your own music
  • Persistent filesystem access (you don't need to grant filesystem access every time you visit the app)
  • Persistent app state tracking via IndexedDB (See 2nd screenshot below)
  • Basic searching, sorting, tagging, and favoriting the music 🥰
  • Suggests random songs from your library
  • Automatically detects if a file is downloaded from YouTube from filename pattern and take you to YouTube if you right click on it (for trackpad users, it's command-click)

Demo

Screenshots

Full screen: https://gg.teddysc.me/?g=fb577abcd2bfe223eb6c5ae32669fb56&a&c=4

Demo for the first release (old)

Limitations

  • Does not support Safari, which isn't eager to support new Web APIs like FileSystem API

User Review (me)

alt text
Discovered old music again! Feels like new now 🥰

I rediscovered Lenka - Everything At Once that I used to listen to when I was practicing speed cubing. I like the MV - very different from what I listen to recently.

alt text
lenka

My web app with most lines of code (yet)!

alt text
3,000+ lines of TypeScript; (In comparison, Gist Gallery is 1666 lines, Surface plotter is 1062 lines (backend is 20x this), TopNetImpactChart is 1104 lines)

And this is my first app using the filesystem and indexeddb APIs.

Code screenshot

alt text
1300+ songs in IndexedDB! | FileSystemFileHandle created for each file to avoid permission re-prompt
alt text
YouTube original video detection
alt text
Arrow key for seeking (10 seconds jump) - turns out that the features we took for granted on any media playback sites aren't implemented by browsers automatically after all.
alt text
Everything is local! Users can see and export their own full data
alt text
lucide lucide-pause text-blue-600 dark:text-blue-400 | (Modified: 1/19/2020) -> metadata extracted with FileSystem API
alt text
🤤