finds.dev← search

// the find

Novage/p2p-media-loader

★ 1,689 · TypeScript · Apache-2.0 · updated Jun 2026

An open-source engine for P2P streaming of live and on demand video directly in a web browser HTML page

P2P Media Loader is a TypeScript library that offloads HLS/MPEG-DASH segment delivery from your CDN to WebRTC peer connections between viewers watching the same stream. It hooks into Hls.js or Shaka Player as a custom segment loader, so the player itself doesn't know anything has changed. Aimed at anyone running live video at scale who wants to cut CDN bills without standing up a full CDN replacement.

The hybrid fallback design is correct: if no peers are available, it falls back to HTTP silently, so a sparse audience doesn't degrade playback. The custom segment storage interface (see segment-memory-storage.ts) lets you swap in IndexedDB for persistent caching across page loads, which is a real differentiator for VOD use cases. Binary protocol for peer commands (binary-command-creator.ts, binary-serialization.ts) keeps P2P overhead low. The monorepo structure is clean — core, hlsjs, and shaka are separate packages so you only ship what you use.

The default public trackers (tracker.novage.com.ua, openwebtorrent.com) are a single point of failure the README buries under 'simple use cases' — in production you will need your own tracker, and the operational cost of that is underplayed. NAT traversal is STUN-only with public servers; no TURN fallback means peers behind symmetric NAT (common in enterprise and mobile networks) will silently fall back to HTTP, potentially defeating the whole point in the environments where eCDN is most appealing. Test coverage is thin: three test files covering binary serialization, hashing, and utils — the actual P2P swarm logic and hybrid loader scheduling have no automated tests, so regressions in the core delivery path are invisible until someone's stream breaks.

View on GitHub → Homepage ↗

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →