Jingle WebRTC
Example
var Jingle = require('jingle');
var conn = new RealtimeConnection();
var jingle = new Jingle();
var attachMediaStream = require('attachmediastream');
var localMedia = require('localMedia');
localMedia.on('localStream', function (stream) {
attachMediaStream(stream, document.getElementById('localVideo'), {
mirror: true,
muted: true
});
});
conn.on('data', function (data) {
jingle.process(data);
});
jingle.on('send', function (data) {
conn.send(data);
});
jingle.on('peerStreamAdded', function (session, stream) {
attachMediaStream(stream, document.getElementById('remoteVideo'));
});
jingle.on('incoming', function (session) {
session.accept();
});
localMedia.start(null, function (stream) {
var sess = jingle.createMediaSession('peer@example.com/resouce');
sess.addStream(stream);
sess.start();
});
Integrations
stanza.io and strophe.jinglejs for integrations of this library.
Installing
$ npm install jingle
Building bundled/minified version (for AMD, etc)
$ make build
The bundled and minified files will be in the generated build
directory.
Documentation
License
MIT
Created by
If you like this, follow @lancestout or @hcornflower on twitter.