Put a tape on your page

One small script and an audio file. The cassette is drawn to scale, its label carries your title and artist, and the reels turn at the tape’s real rate as it plays. Good for a mix, a demo or a podcast.

Try it

Press play. Hold the winding keys to wind, or tap them to skip 30 seconds. Click the bar to go there. A second player starts only when the first has stopped.

The second has no title, artist or cover, so the label uses the file’s name.

Two lines to paste

<script src="https://www.andybateman.com/tapedeck/embed/tapedeck.js" defer></script>
<tape-deck-player src="mix.mp3" title="Friday mix" artist="DJ Name" cover="cover.jpg"></tape-deck-player>

Or copy tapedeck.js to your own site and point the script tag at it. It is one file with nothing to install: no other script, no font and no stylesheet is fetched, and nothing is sent anywhere. The only requests are your audio file and your cover.

Attributes

AttributeWhat it does
srcThe audio file: MP3, M4A, WAV or anything the browser plays. Required.
titleWritten on the label. Left out, the file’s name is used.
artistWritten under the title. Optional.
coverA square picture for the label’s corner. Optional, and needs no special headers.

How it behaves

Tape Deck’s link under the player is part of it. It opens in a new tab.