Audio Player Hack

This is a bit of a hack at the moment...

Upload a file (this could also be a file generated by a code cell — doesn’t matter as long as it lives in NJ’s content-addressed storage):

Magic Flute Clip.mp3

Once you have a file like that, right-click the Download symbol (on the right) and copy its URL. You can then add a ClojureScript cell that renders a HTML5 audio tag that uses the copied URL as source.

^{:nextjournal/viewer :hiccup}
[:audio {:controls true :src "https://nextjournal.com/data/QmYWy3sjRuj1ikrnEfraNx2pZziBq8A4U6qxg6hriS4pGE?content-type=audio%2Fmpeg&filename=Magic%20Flute%20Clip.mp3"}]
Shift+Enter to run
ClojureScript

Note that ClojureScript cells are pretty sketchy in how they evaluate. That’s why they’re hidden behind the ?experimental=1 feature flag. If they don’t react to executing them anymore after you added changes, reload the browser window. Hopefully you won’t have to do this often.

Runtimes (1)