1
0
mirror of https://github.com/moparisthebest/kaiwa synced 2024-11-05 17:15:04 -05:00

get camera on demand, accept calls on cam accept

This commit is contained in:
Philipp Hancke 2014-04-21 18:15:27 +02:00
parent 5d01d57738
commit 0c738e5334
3 changed files with 9 additions and 8 deletions

View File

@ -67,10 +67,6 @@ module.exports = {
client.use(pushNotifications);
xmppEventHandlers(self.api, self);
if (self.api.jingle.capabilities.length > 1) {
self.api.jingle.startLocalMedia();
}
self.api.once('session:started', function () {
app.state.hasConnected = true;
cb();

View File

@ -409,7 +409,13 @@ module.exports = function (client, app) {
state: 'incoming',
jingleSession: session
});
session.accept();
if (!client.jingle.localStream) {
client.jingle.startLocalMedia(null, function (err) {
session.accept();
});
} else {
session.accept();
}
contact.jingleCall = call;
me.calls.add(call);
});
@ -449,11 +455,10 @@ module.exports = function (client, app) {
client.on('jingle:remotestream:added', function (session) {
var contact = me.getContact(session.peer);
if (!contact) {
contact = new Contact({jid: client.JID(session.peer).bare});
contact.resources.add({id: session.peer});
me.contacts.add(contact);
}
contact.stream = session.stream;
contact.stream = session.streams[0];
});
client.on('jingle:remotestream:removed', function (session) {

View File

@ -25,7 +25,7 @@
"oembed": "0.1.0",
"semi-static": "0.0.4",
"sound-effect-manager": "0.0.5",
"stanza.io": "3.2.4",
"stanza.io": "3.6.x",
"staydown": "1.0.3",
"templatizer": "0.1.2",
"underscore": "1.5.1",