← All posts

Press play: streaming and a built-in media player

Your music and video were already on the mesh. Now you can actually play them — streamed block by block, without downloading the whole file first.

Press play: streaming and a built-in media player

Storing files is necessary but, let's be honest, a little boring. This week MeshHold learned to play them.

Streaming over a block store

The catch with a content-addressed store is that a file is really a pile of hashed blocks, possibly scattered across several peers, possibly not all present locally. Streaming media on top of that means serving HTTP Range requests by lazily fetching exactly the blocks a given byte range needs — pulling from whichever peer has them, verifying each one, and feeding the player a smooth stream. Seek to the middle of a two-hour video and it fetches the middle, not the whole thing.

An actual media player

On top of streaming there's now a Player tab: a music library, a queue, a little "streaming" indicator when bytes are coming off the mesh rather than local disk, and near-end prewarming so the next track is buffered before the current one ends. Your library finally feels like a library instead of a directory listing.

A bonus: browse through a node

While wiring up the proxying needed for media, the same plumbing turned into something fun — a tunnel browser. Pick any node as an exit and route an in-app browser through a multi-hop, end-to-end-encrypted circuit to it. Your phone can browse as if it were sitting on your home network. It's the seed of a lot of the networking features to come.


Since Android landed

  • audio + video streaming: HTTP Range served over per-block lazy fetch, verified on the fly
  • music Player tab: library, queue, live "streaming" chip, near-end prewarm
  • multi-hop tunnel + in-app browser through a CONNECT proxy — use any node as an exit
  • cross-compile build scripts for Windows, Linux, and the Android APK