// Sending a call
var rtc = holla.connect();
rtc.register("tom", function(worked) {
holla.createFullStream(function(err, stream) {
var call = rtc.call("bob");
call.addStream(stream);
holla.pipe(stream, $("#myVideo"));
call.on("answered", function() {
console.log("Remote user answered the call");
});
console.log("Calling ", call.user);
});
});
// Receiving a call
var rtc = holla.connect();
rtc.register("bob", function(worked) {
rtc.on("call", function(call) {
console.log("Inbound call from ", call.user);
holla.createFullStream(function(err, stream) {
call.addStream(stream);
call.answer();
holla.pipe(stream, $("#myVideo"));
call.ready(function(stream) {
holla.pipe(stream, $("#theirVideo"));
});
});
});
});
An abstraction over P2P video/voice/data connections using WebRTC