IR Vinyl: A Turntable and Cassette Player for YouTube
Music on YouTube is easy to find, but the player is built for video. If I only want to listen, I get a tab full of recommendations, a screen I do not need, and an interface that feels the same for every song. I wanted something that treats listening as the main activity and looks like a physical object you would enjoy using. That is the problem I set out to solve with IR Vinyl.
IR Vinyl is a web app that takes a YouTube video or playlist link and plays it as audio through a turntable or a cassette deck. This article covers what it does, how it is put together, and what I took from building it.
Why I built it
I build side projects in the evenings, and music players are a good playground. They combine state, animation, media APIs, and a lot of small details that make an interface feel right or wrong. I also like the idea of a player that has a point of view. A plain list of tracks is functional, but a spinning record with a tonearm that moves as the song progresses tells you where you are in the music without any text.
The project is small in terms of languages: it is HTML and JavaScript, served as static files. That was deliberate. I wanted something I could run with a single command and host anywhere.
What it does
The basic flow is simple: paste a YouTube video or playlist link and it plays. Around that, there are a few features I spent most of my time on.
- Two players. A tab at the top switches between a vinyl turntable and a cassette deck.
- Turntable behaviour. The record spins up and coasts down with simple physics rather than starting and stopping instantly, and the tonearm tracks the progress of the song.
- Record looks. Each play gets a random coloured vinyl, or you can choose a picture disc that uses the cover art.
- Cassette deck. Your queue appears as a tape rack. You drag a tape into the deck, or tap it, to play. The panel has REW, PLAY, FF and STOP/EJECT keys, a tape counter, a seek control and volume.
- Record crate. Recently played songs are kept in a crate, stored in your browser.
- Extras. Optional vinyl crackle, lock-screen media controls, and a layout that works on mobile.
- Your own files. You can play local audio files such as MP3, AAC, FLAC and WAV, with a bitrate and quality badge.
- Google sign-in. Signing in pulls your YouTube playlists and liked videos into the crate.
One point about local files needs to be clear, and the app says it too: files are never uploaded to a server. They stay only in that browser on that device. They can disappear if browser data is cleared, and they do not sync with sign-in.
How it works
The app is plain HTML and JavaScript with no server component for playback. To run it locally you serve the folder over HTTP:
python3 -m http.server 8080
Then open http://localhost:8080. It must be served over HTTP rather than opened as a file, because features like sign-in and browser storage behave differently or fail under a file:// address. This is a reusable tip: if a static page uses browser APIs that care about origin, run a tiny local server from the start instead of debugging odd failures later.
Two views, one queue
The vinyl and cassette views are two presentations of the same queue. Switching tabs changes how the queue is shown, not what is playing. In the cassette view the queue becomes a rack of tapes, and in the vinyl view the current item becomes a record. Keeping the playback state separate from the way it is drawn is what makes adding a second player practical. If the state lived inside the turntable code, the cassette would have needed its own copy.
Motion that follows state
The spin-up and coast-down behaviour is a good example of a small idea with a large effect on feel. Instead of switching the rotation on and off, the speed eases toward a target: up when playing, down when paused. The tonearm position is derived from the playback position of the current song, so it is always a display of real progress rather than a separate animation that could drift out of sync.
Storage in the browser
The record crate and the locally played files live in the browser, which keeps the app free of a backend for personal data. The trade-off is the one stated in the disclaimer: clearing browser data clears the crate and the files, and nothing follows you to another device. For a personal listening tool I think that is an acceptable exchange, as long as it is stated plainly.
Sign-in and lock screen
Sign in with Google is optional and exists to bring your YouTube playlists and liked videos into the crate. The repository includes a SETUP.md that covers that configuration. Lock-screen media controls let you pause and skip without opening the page, which matters a lot for a player you use on a phone.
What I learned
- Derive visuals from state. Tying the tonearm to actual playback progress removed a whole class of sync bugs.
- Ease, do not toggle. A little inertia on the record makes the interface feel physical for very little code.
- Separate state from presentation. Supporting both a turntable and a cassette deck was easy because they share one queue.
- Be honest about storage. Saying that local files stay on the device and can be lost is better than letting people find out the hard way.
- Serve static apps over HTTP early. It avoids confusing origin-related problems.
Try it
You can use IR Vinyl at https://vinyl.iramesh.com. Paste a YouTube link, pick the turntable or the cassette deck, and let it play.
Conclusion
IR Vinyl started from a small annoyance: a video player is the wrong shape for listening. A spinning record or a cassette deck is a better shape, and building it showed me how much of a good interface comes from simple things like easing, shared state and clear statements about where data lives. If you have feedback or ideas, you can reach me at hello@iramesh.com.