Skip to content

A generic Jingle session manager implementation, suitable for integration by other XMPP libraries.

License

Notifications You must be signed in to change notification settings

piotrekbator/jingle.js

 
 

Repository files navigation

Jingle WebRTC

Example

var conn = new RealtimeConnection(); // stanza.io, xmpp-ftw, strophe, etc
var jingle = new Jingle();
var attachMediaStream = require('attachmediastream');

jingle.on('localStream', function (stream) {
    attachMediaStream(stream, document.getElementById('localVideo'), {
        mirror: true,
        muted: true
    });
});

jingle.on('send', function (data) {
     conn.send(data);
});

jingle.on('peerStreamAdded', function (session, stream) {
     attachMediaStream(stream, document.getElementById('remoteVideo'));
});

// Answering a call request.
jingle.on('incoming', function (session) {
     session.accept(); // Or display an incoming call banner, etc
});

// Starting an A/V session.
jingle.startLocalMedia(null, function () {
    var sess = jingle.createMediaSession('[email protected]/resouce');
    sess.start();
});

Installing

$ npm install jingle

Building bundled/minified version (for AMD, etc)

$ grunt

The bundled and minified files will be in the generated build directory.

License

MIT

Created by

If you like this, follow @lancestout or @hcornflower on twitter.

About

A generic Jingle session manager implementation, suitable for integration by other XMPP libraries.

Resources

License

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%