Download:
child 62:51d1f9ce4f11
parent 60:bbab4c40a2ba
61:fbdf2a0985d1
Anton Shestakov <av6@dwimlabs.net>, Mon, 28 Mar 2016 14:04:44 +0800
webrtc: add glue code, contact controls, styles

8 файлов изменено, 234 вставок(+), 9 удалений(-) [+]
coffee/contacts.coffee file | annotate | diff | comparison | revisions
coffee/index.coffee file | annotate | diff | comparison | revisions
css/tram-im.css file | annotate | diff | comparison | revisions
index.html file | annotate | diff | comparison | revisions
js/contacts.js file | annotate | diff | comparison | revisions
js/contacts.js.map file | annotate | diff | comparison | revisions
js/index.js file | annotate | diff | comparison | revisions
js/index.js.map file | annotate | diff | comparison | revisions
--- a/coffee/contacts.coffee Mon Mar 28 13:56:42 2016 +0800
+++ b/coffee/contacts.coffee Mon Mar 28 14:04:44 2016 +0800
@@ -15,10 +15,21 @@
@on 'add change:fullname change:nickname change:bjid', ->
@set('d/handle', @get('fullname') or @get('nickname') or @get('bjid'))
- @on 'add change:type change:presence', ->
+ @on 'add change:type change:presence change:callstate', ->
if @get('type') is 'self' then return @unset('d/actions')
if @get('presence') is 'subscribe' then return @set('d/actions', ['authorize', 'unauthorize'])
- @set('d/actions', ['remove'])
+ actions = ['remove']
+ if @get('presence') isnt 'unavailable'
+ switch @get 'callstate'
+ when 'established'
+ actions.push('hang-up')
+ when 'outgoing'
+ actions.push('wait', 'hang-up')
+ when 'incoming'
+ actions.push('accept', 'decline')
+ else
+ actions.push('call')
+ @set('d/actions', actions)
class Tram.Contacts extends Backbone.Collection
@@ -64,6 +75,10 @@
events:
'click [data-authorize]': -> @model.trigger('authorize')
'click [data-unauthorize]': -> @model.trigger('unauthorize')
+ 'click [data-call]': (event) -> @model.trigger('call', event.currentTarget.getAttribute('data-call'))
+ 'click [data-accept]': (event) -> @model.trigger('accept', event.currentTarget.getAttribute('data-accept'))
+ 'click [data-decline]': -> @model.trigger('decline')
+ 'click [data-hang-up]': -> @model.trigger('hangup')
'click [data-remove]': -> @model.trigger('remove')
initialize: ->
--- a/coffee/index.coffee Mon Mar 28 13:56:42 2016 +0800
+++ b/coffee/index.coffee Mon Mar 28 14:04:44 2016 +0800
@@ -5,6 +5,8 @@
window.contactsApp ?= new Tram.ContactsApp(el: $('[data-app="contacts"]'), collection: contacts)
window.messages ?= new Tram.Messages()
window.logApp ?= new Tram.LogApp(el: $('[data-app="log"]'), collection: messages)
+window.calls ?= new Tram.Calls()
+window.callsApp ?= new Tram.CallsApp(el: $('[data-app="calls"]'), collection: calls)
window.favstate ?= new Tram.FavState()
window.faviconApp ?= new Tram.FaviconApp(model: favstate)
@@ -16,6 +18,7 @@
onConnected = ->
X.conn.addHandler(onPresence, null, 'presence')
X.conn.addHandler(onProfileUpdate, Strophe.NS.VCARD_UPDATE, 'presence')
+ X.conn.addHandler(onWebRTC, Tram.NS.WEBRTC, 'message', 'chat')
X.conn.addHandler(onGetVersion, Strophe.NS.VERSION, 'iq', 'get')
X.conn.send($pres().c('priority').t('1').up().c('status').t('Online').tree())
@@ -110,6 +113,20 @@
X.conn.roster.remove contact.get('bjid'), ->
contacts.remove(contact)
+ contact.w = new Tram.WebRTCInterface(contact)
+
+ contact.on 'call', (media) ->
+ contact.set('callstate', 'outgoing')
+ contact.w.init(true, audio: 'a' in media, video: 'v' in media)
+
+ contact.on 'accept', (media) ->
+ contact.w.init(false, audio: 'a' in media, video: 'v' in media)
+
+ contact.on 'decline hangup', ->
+ contact.w.sendIntent('terminate')
+ contact.w.disconnect()
+ contact.unset('callstate')
+
getContactProfile(contact)
return contact
@@ -180,6 +197,9 @@
status: status
priority: priority
+ if type is 'unavailable'
+ contact.w.disconnect()
+
if type in ['available', 'unavailable'] and contact.get('type') isnt 'self'
delay = stanza.getElementsByTagName('delay')[0]
stamp = if delay? then new Date(delay.getAttribute('stamp')) else new Date()
@@ -208,6 +228,36 @@
return true
+onWebRTC = (stanza) ->
+ from = stanza.getAttribute('from')
+ contact = getContact(from)
+ intent = stanza.getElementsByTagName('intent')[0]
+ payload = stanza.getElementsByTagName('payload')[0]
+ delay = stanza.getElementsByTagName('delay')[0]
+ stamp = if delay? then new Date(delay.getAttribute('stamp')) else new Date()
+
+ if intent?
+ switch getText(intent)
+ when 'initiate'
+ contact.set('callstate', 'incoming')
+ messages.add
+ id: stanza.getAttribute('id')
+ type: 'call'
+ cls: 'call'
+ from: from
+ stamp: stamp
+ contact: contact
+ text: 'incoming call'
+ when 'terminate'
+ contact.w.disconnect()
+ contact.unset('callstate')
+
+ if payload?
+ contact.w.onPayload(stanza)
+
+ return true
+
+
window.X = new Tram.XMPPInterface()
--- a/css/tram-im.css Mon Mar 28 13:56:42 2016 +0800
+++ b/css/tram-im.css Mon Mar 28 14:04:44 2016 +0800
@@ -100,3 +100,48 @@
li.contact > .column {
vertical-align: middle;
}
+.video-block {
+ position: relative;
+ max-width: 400px;
+}
+.video-block video {
+ display: block;
+}
+.video-block video.remote {
+ width: 100%;
+ background: darkgray;
+}
+.video-block video.local {
+ background: black;
+ position: absolute;
+ bottom: 0;
+ right: 0;
+ max-width: 30%;
+ max-height: 30%;
+ z-index: 1;
+}
+.video-block .buttons {
+ position: absolute;
+ bottom: 10px;
+ width: 100%;
+ z-index: 2;
+}
+.video-block .buttons > button.autofade {
+ transition: opacity 0.1s ease-in-out;
+ opacity: 0;
+}
+.video-block:hover .buttons > button.autofade {
+ opacity: 1;
+}
+@keyframes pulsation {
+ 0% { opacity: 1; }
+ 50% { opacity: 0; }
+ 100% { opacity: 1; }
+}
+.calling-icon {
+ margin-right: 10px;
+ animation: pulsation 1s infinite;
+}
+.calling-icon.hide {
+ animation: none;
+}
--- a/index.html Mon Mar 28 13:56:42 2016 +0800
+++ b/index.html Mon Mar 28 14:04:44 2016 +0800
@@ -142,6 +142,25 @@
</div>
</div>
<div class="column uk-text-nowrap">
+ <i class="uk-icon-phone calling-icon" data-wait rv-if="model:d/actions | has 'wait'"></i>
+ <button type="button" class="uk-button" data-call="av" rv-if="model:d/actions | has 'call'">
+ <i class="uk-icon-video-camera"></i>
+ </button>
+ <button type="button" class="uk-button" data-call="a" rv-if="model:d/actions | has 'call'">
+ <i class="uk-icon-phone"></i>
+ </button>
+ <button type="button" class="uk-button uk-button-success" data-accept="av" rv-if="model:d/actions | has 'accept'">
+ <i class="uk-icon-video-camera"></i>
+ </button>
+ <button type="button" class="uk-button uk-button-success" data-accept="a" rv-if="model:d/actions | has 'accept'">
+ <i class="uk-icon-phone"></i>
+ </button>
+ <button type="button" class="uk-button uk-button-danger" data-decline rv-if="model:d/actions | has 'decline'">
+ <i class="uk-icon-times"></i>
+ </button>
+ <button type="button" class="uk-button uk-button-danger" data-hang-up rv-if="model:d/actions | has 'hang-up'">
+ <i class="uk-icon-phone"></i> Hang up
+ </button>
<div class="uk-button-dropdown" data-uk-dropdown="{mode:'click',pos:'bottom-right'}" rv-if="model:d/actions | has 'remove'">
<button class="uk-button"><i class="uk-icon-caret-down"></i></button>
<div class="uk-dropdown uk-dropdown-small">
--- a/js/contacts.js Mon Mar 28 13:56:42 2016 +0800
+++ b/js/contacts.js Mon Mar 28 14:04:44 2016 +0800
@@ -31,14 +31,31 @@
this.on('add change:fullname change:nickname change:bjid', function() {
return this.set('d/handle', this.get('fullname') || this.get('nickname') || this.get('bjid'));
});
- return this.on('add change:type change:presence', function() {
+ return this.on('add change:type change:presence change:callstate', function() {
+ var actions;
if (this.get('type') === 'self') {
return this.unset('d/actions');
}
if (this.get('presence') === 'subscribe') {
return this.set('d/actions', ['authorize', 'unauthorize']);
}
- return this.set('d/actions', ['remove']);
+ actions = ['remove'];
+ if (this.get('presence') !== 'unavailable') {
+ switch (this.get('callstate')) {
+ case 'established':
+ actions.push('hang-up');
+ break;
+ case 'outgoing':
+ actions.push('wait', 'hang-up');
+ break;
+ case 'incoming':
+ actions.push('accept', 'decline');
+ break;
+ default:
+ actions.push('call');
+ }
+ }
+ return this.set('d/actions', actions);
});
};
@@ -136,6 +153,18 @@
'click [data-unauthorize]': function() {
return this.model.trigger('unauthorize');
},
+ 'click [data-call]': function(event) {
+ return this.model.trigger('call', event.currentTarget.getAttribute('data-call'));
+ },
+ 'click [data-accept]': function(event) {
+ return this.model.trigger('accept', event.currentTarget.getAttribute('data-accept'));
+ },
+ 'click [data-decline]': function() {
+ return this.model.trigger('decline');
+ },
+ 'click [data-hang-up]': function() {
+ return this.model.trigger('hangup');
+ },
'click [data-remove]': function() {
return this.model.trigger('remove');
}
--- a/js/contacts.js.map Mon Mar 28 13:56:42 2016 +0800
+++ b/js/contacts.js.map Mon Mar 28 14:04:44 2016 +0800
@@ -6,5 +6,5 @@
"coffee/contacts.coffee"
],
"names": [],
- "mappings": ";AAAA;AAAA,MAAA;;;;EAAM,IAAI,CAAC;;;;;;;sBACT,WAAA,GAAa;;sBACb,QAAA,GACE;MAAA,QAAA,EAAU,aAAV;MACA,IAAA,EAAM,SADN;;;sBAGF,UAAA,GAAY,SAAA;MACV,IAAC,CAAA,EAAD,CAAI,mBAAJ,EAAyB,SAAA;AACvB,YAAA;QAAA,MAAA,GAAS,IAAC,CAAA,GAAD,CAAK,QAAL;QACT,sBAAG,MAAM,CAAE,cAAR,sBAAiB,MAAM,CAAE,cAA5B;iBACE,IAAC,CAAA,GAAD,CAAK,UAAL,EAAiB,OAAA,GAAS,MAAM,CAAC,IAAhB,GAAsB,UAAtB,GAAiC,MAAM,CAAC,IAAzD,EADF;SAAA,MAAA;iBAGE,IAAC,CAAA,KAAD,CAAO,UAAP,EAHF;;MAFuB,CAAzB;MAOA,IAAC,CAAA,EAAD,CAAI,iDAAJ,EAAuD,SAAA;eACrD,IAAC,CAAA,GAAD,CAAK,UAAL,EAAiB,IAAC,CAAA,GAAD,CAAK,UAAL,CAAA,IAAoB,IAAC,CAAA,GAAD,CAAK,UAAL,CAApB,IAAwC,IAAC,CAAA,GAAD,CAAK,MAAL,CAAzD;MADqD,CAAvD;aAGA,IAAC,CAAA,EAAD,CAAI,iCAAJ,EAAuC,SAAA;QACrC,IAAG,IAAC,CAAA,GAAD,CAAK,MAAL,CAAA,KAAgB,MAAnB;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AAY,KAAK,CAAC,IAAI,CAAC,EAAvB;UAFc;QAAA,CAAA,CAAA,CAAA,IAAA,CAAhB,EADF;;IADM;;;;KAlBqB,QAAQ,CAAC;AA3GxC"
}
\ No newline at end of file
--- a/js/index.js Mon Mar 28 13:56:42 2016 +0800
+++ b/js/index.js Mon Mar 28 14:04:44 2016 +0800
@@ -1,9 +1,9 @@
// Generated by CoffeeScript 1.10.0
(function() {
- var $form, ConnectionData, connectfn, getContact, getContactProfile, getText, getVersion, onConnected, onDisconnected, onGetVersion, onPresence, onProfileUpdate,
+ var $form, ConnectionData, connectfn, getContact, getContactProfile, getText, getVersion, onConnected, onDisconnected, onGetVersion, onPresence, onProfileUpdate, onWebRTC,
+ indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; },
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
- hasProp = {}.hasOwnProperty,
- indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
+ hasProp = {}.hasOwnProperty;
Strophe.addNamespace('VCARD_UPDATE', 'vcard-temp:x:update');
@@ -29,6 +29,17 @@
});
}
+ if (window.calls == null) {
+ window.calls = new Tram.Calls();
+ }
+
+ if (window.callsApp == null) {
+ window.callsApp = new Tram.CallsApp({
+ el: $('[data-app="calls"]'),
+ collection: calls
+ });
+ }
+
if (window.favstate == null) {
window.favstate = new Tram.FavState();
}
@@ -48,6 +59,7 @@
onConnected = function() {
X.conn.addHandler(onPresence, null, 'presence');
X.conn.addHandler(onProfileUpdate, Strophe.NS.VCARD_UPDATE, 'presence');
+ X.conn.addHandler(onWebRTC, Tram.NS.WEBRTC, 'message', 'chat');
X.conn.addHandler(onGetVersion, Strophe.NS.VERSION, 'iq', 'get');
X.conn.send($pres().c('priority').t('1').up().c('status').t('Online').tree());
getVersion();
@@ -155,6 +167,25 @@
return contacts.remove(contact);
});
});
+ contact.w = new Tram.WebRTCInterface(contact);
+ contact.on('call', function(media) {
+ contact.set('callstate', 'outgoing');
+ return contact.w.init(true, {
+ audio: indexOf.call(media, 'a') >= 0,
+ video: indexOf.call(media, 'v') >= 0
+ });
+ });
+ contact.on('accept', function(media) {
+ return contact.w.init(false, {
+ audio: indexOf.call(media, 'a') >= 0,
+ video: indexOf.call(media, 'v') >= 0
+ });
+ });
+ contact.on('decline hangup', function() {
+ contact.w.sendIntent('terminate');
+ contact.w.disconnect();
+ return contact.unset('callstate');
+ });
getContactProfile(contact);
return contact;
};
@@ -232,6 +263,9 @@
status: status,
priority: priority
});
+ if (type === 'unavailable') {
+ contact.w.disconnect();
+ }
if ((type === 'available' || type === 'unavailable') && contact.get('type') !== 'self') {
delay = stanza.getElementsByTagName('delay')[0];
stamp = delay != null ? new Date(delay.getAttribute('stamp')) : new Date();
@@ -260,6 +294,39 @@
return true;
};
+ onWebRTC = function(stanza) {
+ var contact, delay, from, intent, payload, stamp;
+ from = stanza.getAttribute('from');
+ contact = getContact(from);
+ intent = stanza.getElementsByTagName('intent')[0];
+ payload = stanza.getElementsByTagName('payload')[0];
+ delay = stanza.getElementsByTagName('delay')[0];
+ stamp = delay != null ? new Date(delay.getAttribute('stamp')) : new Date();
+ if (intent != null) {
+ switch (getText(intent)) {
+ case 'initiate':
+ contact.set('callstate', 'incoming');
+ messages.add({
+ id: stanza.getAttribute('id'),
+ type: 'call',
+ cls: 'call',
+ from: from,
+ stamp: stamp,
+ contact: contact,
+ text: 'incoming call'
+ });
+ break;
+ case 'terminate':
+ contact.w.disconnect();
+ contact.unset('callstate');
+ }
+ }
+ if (payload != null) {
+ contact.w.onPayload(stanza);
+ }
+ return true;
+ };
+
window.X = new Tram.XMPPInterface();
X.on('connecting', function() {
--- a/js/index.js.map Mon Mar 28 13:56:42 2016 +0800
+++ b/js/index.js.map Mon Mar 28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