All Projects → gitsummore → Nile.js

gitsummore / Nile.js

Licence: mit
Server

Programming Languages

javascript
184084 projects - #8 most used programming language
HTML
75241 projects
CSS
56736 projects

Projects that are alternatives of or similar to Nile.js

Wt Tracker
High-performance WebTorrent tracker
Stars: ✭ 144 (-91.8%)
Mutual labels:  webrtc, torrent, peer-to-peer, webtorrent
Webtorrent Hybrid
WebTorrent (with WebRTC support in Node.js)
Stars: ✭ 422 (-75.98%)
Mutual labels:  webrtc, torrent, webtorrent
P2p Cdn Sdk Javascript
Free p2p cdn github javascript sdk to reduce video streaming costs of live and on demand video using webrtc by upto 90% and improve scalability by 6x - 🚀 Vadootv 🚀
Stars: ✭ 158 (-91.01%)
Mutual labels:  livestream, webrtc, peer-to-peer
Bittorrent Tracker
🌊 Simple, robust, BitTorrent tracker (client & server) implementation
Stars: ✭ 1,184 (-32.61%)
Mutual labels:  webrtc, torrent, webtorrent
Diffy
🎞️💓🍿 Love streaming - It's always best to watch a movie together ! 🤗
Stars: ✭ 37 (-97.89%)
Mutual labels:  torrent, webrtc, webtorrent
Magnet Player
🎥 A place for streaming torrents directly from your browser
Stars: ✭ 346 (-80.31%)
Mutual labels:  webrtc, torrent, webtorrent
Webtorrent
⚡️ Streaming torrent client for the web
Stars: ✭ 25,554 (+1354.41%)
Mutual labels:  webrtc, torrent, webtorrent
Camus
Peer-to-peer group video chat using WebRTC, Python, and Javascript
Stars: ✭ 75 (-95.73%)
Mutual labels:  webrtc, peer-to-peer
Js Dag Service
Library for storing and replicating hash-linked data over the IPFS network.
Stars: ✭ 81 (-95.39%)
Mutual labels:  peer-to-peer, distributed
Laverna
Laverna is a JavaScript note taking application with Markdown editor and encryption support. Consider it like open source alternative to Evernote.
Stars: ✭ 8,770 (+399.15%)
Mutual labels:  webrtc, peer-to-peer
Webtorrent.io
The code that runs the WebTorrent website
Stars: ✭ 106 (-93.97%)
Mutual labels:  webrtc, webtorrent
Bittorrent Peerid
Map a BitTorrent peer ID to a human-readable client name and version
Stars: ✭ 47 (-97.32%)
Mutual labels:  torrent, webtorrent
Rn Voice Video Call
Usage of WebRTC for voice & video call with peer-to-peer or conference with Login and Register screen using response & Async storage with Call Dis/Connect, Failed and Idle views in react native. Youtube:
Stars: ✭ 100 (-94.31%)
Mutual labels:  webrtc, peer-to-peer
Enslavism
A framework to manage distributed WebRTC servers that communicate with browser clients
Stars: ✭ 143 (-91.86%)
Mutual labels:  webrtc, distributed
Webtorrent Desktop
❤️ Streaming torrent app for Mac, Windows, and Linux
Stars: ✭ 8,587 (+388.73%)
Mutual labels:  webrtc, webtorrent
Laplace
Laplace is an open-source project to enable screen sharing directly via browser. Based on WebRTC for low latency peer-to-peer connections, and WebSocket implemented in golang for signaling.
Stars: ✭ 81 (-95.39%)
Mutual labels:  webrtc, peer-to-peer
Vett
P2P Dots & Boxes game with WebRTC & WebTorrent
Stars: ✭ 49 (-97.21%)
Mutual labels:  webrtc, webtorrent
Cloud Game
Web-based Cloud Gaming service for Retro Game
Stars: ✭ 1,374 (-21.8%)
Mutual labels:  webrtc, distributed
Ice
A Go implementation of ICE
Stars: ✭ 114 (-93.51%)
Mutual labels:  webrtc, peer-to-peer
Netsix
Netsix allows you to share videos with your friends in a real peer-to-peer manner using WebRTC.
Stars: ✭ 113 (-93.57%)
Mutual labels:  webrtc, peer-to-peer

nile.js

A tool for scalable peer-to-peer video streaming using WebTorrent.

NOTE: This project is no longer being actively maintained

Why WebTorrent?

By using the collective power of WebTorrent, video streams get progressively stronger as more peers contribute to a torrent. With torrents, it is also possible for users to access previous parts of a stream unlike traditional WebRTC video streaming.

About

Server

This is the plug-and-play middleware that receives the torrent link from the broadcasting client and sets up the proper Socket.io connections for the viewing clients.

Broadcaster

This is the client component that records video from a device's camera, saving it to generated torrent files, and sending those torrents' magnet link out to the viewing clients.

Viewer

This is the client which views what the Broadcaster is recording. It receives a torrent magnet link and renders the video from that torrent to an injected video tag using WebTorrent.

Usage

Server

Nile.js utilizes Express middleware and socket.io to receive torrent information, broadcast it to as many clients it can comfortably handle who will then send it out to the rest of the clients.

To use it, require nileServer from our package and pass in the Node Server instance you're using. In Express, you can get this instance by calling app.listen.

You'll also need to pass in the number of WebSockets the server has to maintain. Let's use 10 for now.

Here's how you would use it in your server:

const server = app.listen(8000);
const socketLimit = 10;
const nileServer = require('nile.js/nileServer')(server, 10);

Now add the nile.js middleware w/ app.use:

app.use('/', nileServer);

Note that this middleware will use a "magnet" route to accept POST requests with the magnet link from the Broadcaster.

Client

Broadcaster

If using a file bundler e.g. (webpack), you may import the module.

import { Broadcaster } from 'nile.js'

If you just want to test the module without bundling, it is currently being hosted on unpkg CDN. Use it as a script in your html file.

https://unpkg.com/[email protected]/client/dist/nile.Broadcaster.min.js

4 parameters:

  1. recordInterval - The Interval that the webcam recording should seed each segment of the video (ms)
  2. videoNodeIDForPlayback - The id of the video node in the html where the broadcaster can see their own recording
  3. startStreamID - The id of the button node that BEGINS the recording/live streaming
  4. stopStreamID - The id of the button node that ENDS the recording/live streaming

The Broadcaster object is used to stream video to a torrent and send the torrent link to the server and then to the network of viewers.

Because torrents are immutable, we approximate streaming with torrents by setting a recordInterval, in milliseconds. This sets how long each clip will be before being sent via torrent. From our experience, we recommend an interval 6000-10000 (6-10 seconds).

Next, pass in the ID of the video tag you'd like to view your recording playback from as well as button IDs for the starting and stopping the stream.

Example:

const broadcaster = new Broadcaster(8000, 'video', 'button-play-gum', 'button-stop-gum');

Viewer

If using a file bundler e.g. (webpack), you may import the module.

import { Viewer } from 'nile.js'

If you just want to test the module without bundling, it is currently being hosted on unpkg CDN. Use it as a script in your html file.

https://unpkg.com/[email protected]/client/dist/nile.Viewer.min.js

2 parameters:

  1. ID_of_NodeToRenderVideo - ID of DOM element to render live feed to
  2. addedIceServers - Array of extra WebRTC ICE servers, based on this interface laid out by W3C

The Viewer object receives torrent links from Socket.io or RTCDataChannel connections and progressively renders the videos from the torrents to the supplied ID, ID_of_NodeToRenderVideo.

Example:

const viewer = new Viewer('videos');

The Viewer maintains two WebRTC connections, one to a parent (client closest to server) and a child client (farther from server). These two connections create a chain of clients that propagate server-sent torrent information down to subsequent viewers down the chain.

In the event of a client disconnecting, the disconnecting Viewer will let its immediate child client know and tell it to reconnect to its parent. This maintains network integrity and ensures that the stream will still reach every client in that chain.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].