Jingle Media Data Session
To make sure incoming sessions are created as MediaDataSessions, when you create the jingle SessionManager, override prepare session
to return a MediaDataSession
instance.
jingle = { return opts; };
When creating outgoing sessions, create a MediaDataSession
and add it to the jingle SessionManager:
var session = sid: sid peer: jid initiator: true stream: stream parent: jingle iceServers: jingleiceServers; jingle;
Then, (when your session is started), you can create and use data channels:
session;
And get channel messages with:
jingle; // or session.on('channelMessage', handler)
Installing
$ npm install jingle-media-data-session
Building bundled/minified version (for AMD, etc)
$ make
The bundled and minified files will be in the generated build
directory.
License
MIT
Created by
Xander Dumaine put this together from work done in other jingle and webrtc projects by Lance Stout, Phillip Hancke, and the other &yetis.
If you like this, follow @xanderdumaine @lancestout or @hcornflower on twitter.