P2P-assisted media deliveryThe CDN delivers the source stream over HTTP to the first viewers. Viewers then share video segments with each other over P2P, so the swarm grows without adding load on the CDN.CDNsource streamHTTP from the CDNP2P between viewers

P2P Media Loader is an open-source JavaScript library that uses modern browser technologies — HTML5 video and WebRTC — to deliver media over peer-to-peer (P2P) connections. It integrates with popular HTML5 video players and requires no browser plugins or add-ons. Try the live demo to see it in action.

It makes it possible to build large-scale P2P mesh networks — often called peer-to-peer content delivery networks (P2P CDN), Hybrid CDN, Multi CDN, peer-to-peer television (P2PTV), or Enterprise Content Delivery Networks (eCDN) — in which viewers watching the same live or video on demand (VOD) stream over HLS or MPEG-DASH share traffic in real time.

The result: far less load on your CDN or origin server, lower delivery costs, and the capacity to reach a larger audience.

Why use Hybrid CDN + P2P delivery

  • Works everywhere. All modern desktop and mobile browsers — Chrome, Safari, Edge, Firefox and Opera — on Windows, macOS, Linux, Android, iOS and iPadOS. See our guide to setting up P2P video in five minutes. You can also embed it into native iOS and Android apps and use it with native players.
  • No setup cost, no server software. For smaller audiences (1,000–2,000 simultaneous viewers), public trackers alone can connect peers, so in many cases you don't need to install or maintain any server-side components. Free alternatives scale to 100,000 simultaneous peers and beyond — see running dedicated trackers.
  • Significant cost savings. The more viewers watch the same content at the same time, the more traffic they share. In ideal conditions each video segment is downloaded over HTTP once and then shared between peers: on a live stream with 10 viewers, 90% of traffic goes over P2P, with 100 viewers 99%, and with 1,000 viewers 99.9%. For video on demand, savings depend on how many viewers watch the same part of the video at the same time. Real-world ratios also depend on network conditions and peer connectivity.
  • Reduced load on the origin. Offloading requests from the CDN or media server to peers eases the strain on centralized infrastructure and makes the whole system more reliable.
  • More total bandwidth. When viewers share video data, they collectively expand network capacity, which means smoother streaming for everyone.
  • Live and VOD. Live events and on-demand video work the same way, with no added complexity.
  • Enterprise eCDN. Inside a corporate network, peers interconnect with few constraints, so video reaches screens, desktops and mobile devices across an organization without straining external bandwidth or internal infrastructure.

Key features

Players and engines
Engines: HLS.js, Shaka Player, dash.js and Video.js 8 (VHS). Video.js 10 needs no separate integration: it plays HLS and MPEG-DASH through HLS.js and dash.js, which P2P Media Loader drives directly. Viewers on different players share the same swarm.
Players: Vidstack, Clappr, MediaElement, Plyr, DPlayer, OpenPlayerJS, PlayerJS and others built on the supported engines. Any other player can be integrated through the library API.

Streaming formats
Live and VOD streams over HLS or MPEG-DASH, with adaptive bitrate streaming.

DRM and encrypted streams
Works with Widevine, PlayReady, FairPlay and HLS AES-128. Peers exchange segments exactly as the CDN delivers them, still encrypted: decryption stays in the video player, and license requests always go directly to your license server. P2P must be disabled for per-session encryption or forensic watermarking, where every viewer receives different bytes.

Smart TVs and older browsers
Besides ES modules, every integration ships as an IIFE build for older browsers and Smart TVs.

Free and open source
All components of the P2P network are available as open-source products:

No server-side software needed to start
By default P2P Media Loader uses publicly available servers:

  • STUN servers - Public STUN server list
  • WebTorrent trackers - wss://tracker.novage.com.ua (ours), wss://tracker.webtorrent.dev, wss://tracker.openwebtorrent.com

Public trackers are fine to start with. For production, we recommend running your own tracker, such as wt-tracker.

Privacy
For privacy, you can run private instances of the STUN server and WebTorrent tracker. Information about your P2P network and its peers is then not available to third parties.

Built and supported by Novage

P2P Media Loader is developed by Novage, a software engineering and R&D company. The same team works with clients on:

  • Integration — adding P2P delivery to your web players, native iOS and Android apps, and Smart TV applications
  • Custom P2P CDN and eCDN — delivery networks designed around your audience, infrastructure and security requirements
  • Tracker infrastructure — running and scaling WebTorrent trackers for tens or hundreds of thousands of simultaneous viewers
  • Performance and cost optimization — tuning P2P ratio, startup time and CDN usage on real traffic
  • R&D — streaming, WebRTC and networking problems without an off-the-shelf answer
  • Full-cycle product development — product design, development, QA and delivery for products well beyond video

Discuss your next product with us

Share a brief outline of what you intend to build. We will respond with a proposed team composition, delivery plan, and first milestone.

Email us a brief