0.2.2 • Published 7 years ago

spreadcast v0.2.2

Weekly downloads
4
License
MIT
Repository
github
Last release
7 years ago

spreadcast.js

npm version

Broadcast WebRTC streams to many receivers

Installation

npm install spreadcast --save

Usage

Node Server

var Spreadcast = require('spreadcast');

var server = require('http').createServer();
server.listen();

Spreadcast.serve({server: server});

Browser Client

// If you use Browserify in your project already,
// you can require spreadcast directly

var spreadcast = require('spreadcast');

// Otherwise include the bundle from
// ./node_modules/spreadcast/dist/spreadcast.min.js in your HTML

// Use the Room class to easily implement a video chat
// among several publishers with many viewers

var room = new spreadcast.Room('roomName');

room.onAddStream = function(video) {
  document.body.appendChild(video);
};

room.onRemoveStream = function(video) {
  video.parentElement.removeChild(video);
};

// Call publish/unpublish at any time
// You can pass a regular WebRTC constraints object to configure your stream
room.publish({
  video: {
    width: 320,
    height: 240,
    frameRate: 24
  }
}).then(function(video) {
  document.body.appendChild(video);
}).catch(function(error) {
  console.error(error);
});

License

MIT

0.2.2

7 years ago

0.2.1

7 years ago

0.2.0

7 years ago

0.1.10

7 years ago

0.1.9

7 years ago

0.1.8

7 years ago

0.1.7

7 years ago

0.1.6

7 years ago

0.1.5

7 years ago

0.1.4

7 years ago

0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago