Merge pull request #619 from matiu/feature/video-as-an-option

Feature/video as an option
This commit is contained in:
Gustavo Maximiliano Cortez 2014-06-09 16:26:31 -03:00
commit fabc8aac85
7 changed files with 43 additions and 25 deletions

View File

@ -43,19 +43,26 @@ var defaultConfig = {
'iceServers': [
// Pass in STUN and TURN servers for maximum network compatibility
{
url: 'stun:stun.l.google.com:19302'
url: 'stun:162.242.219.26'
}, {
url: 'stun:stun1.l.google.com:19302'
}, {
url: 'stun:stun2.l.google.com:19302'
}, {
url: 'stun:stun3.l.google.com:19302'
}, {
url: 'stun:stun4.l.google.com:19302'
}, {
url: 'stun:stunserver.org'
url: 'turn:162.242.219.26',
username: 'bitcore',
credential: 'bitcore',
}
// Options fot TURN servers with p2p communications are not possible.
// {
// url: 'stun:stun.l.google.com:19302'
// }, {
// url: 'stun:stun1.l.google.com:19302'
// }, {
// url: 'stun:stun2.l.google.com:19302'
// }, {
// url: 'stun:stun3.l.google.com:19302'
// }, {
// url: 'stun:stun4.l.google.com:19302'
// }, {
// url: 'stun:stunserver.org'
// }
// // Options fot TURN servers with p2p communications are not possible.
// {
// url: 'turn:numb.viagenie.ca',
// credential: 'muazkh',
@ -104,7 +111,6 @@ var defaultConfig = {
// theme list
themes: ['default'],
disableVideo: 1,
verbose: 1,
};

View File

@ -54,11 +54,11 @@ html, body {height: 100%;}
}
.bottom-copay {
width: 56px;
width: 50px;
text-align: center;
position: relative;
float: right;
margin-left: 15px;
margin-left: 20px;
/* height: 551px; */
}

View File

@ -150,7 +150,7 @@
<div id="footer" data-ng-controller="FooterController" ng-class="{'footer-home': !$root.wallet}">
<link rel="stylesheet" ng-href="{{theme}}">
<div ng-show="!$root.wallet">
<div class="large-12 columns text-right">
<div class="large-12 columns text-left">
Copay
<small>v{{version}}</small>
</div>
@ -163,14 +163,18 @@
<div class="size-12 m10t">
{{$root.wallet.requiredCopayers}}-of-{{$root.wallet.totalCopayers}} wallet
</div>
<div class="text-gray size-12" style="margin-top:5px">
Copay v{{version}}
</div>
<div class="size-12 m10t" ng-if="themes.length > 1">
<a class="size-12" ng-click="change_theme(th)" ng-repeat="th in themes">{{th}} {{$last ? '' : '&middot; '}}</a>
</div>
</div>
<div class="large-9 medium-9 small-9 columns">
<a href="#/addresses" > </a>
<div class="bottom-copay"
ng-repeat="c in $root.wallet.getRegisteredPeerIds()" class="has-tip" tooltip-popup-delay="1000" tooltip-placement="top" tooltip="{{c.nick}}">
<!-- <div class="bottom&#45;copay" ng&#45;repeat="c in $root.wallet.getRegisteredPeerIds()" class="has&#45;tip" tooltip&#45;popup&#45;delay="1000" tooltip&#45;placement="top" tooltip="{{c.nick}}"> -->
<div class="bottom-copay" ng-repeat="c in $root.wallet.getRegisteredPeerIds()">
<video ng-if="$root.videoInfo[c.peerId]"
avatar peer="{{c}}"
autoplay
@ -182,6 +186,9 @@
ng-class="($root.wallet.getOnlinePeerIDs().indexOf(c.peerId) != -1) ? 'online' : 'offline'"
src="./img/satoshi.gif"
/>
<div class="size-12 text-center text-gray" stype="margin-top:4px">
{{c.nick || 'NN'}}
</div>
</div>
</div>
</div>

View File

@ -17,6 +17,8 @@ angular.module('copayApp.controllers').controller('FooterController', function($
$scope.version = copay.version;
$scope.getVideoURL = function(copayer) {
if (config.disableVideo) return;
var vi = $rootScope.videoInfo[copayer]
if (!vi) return;

View File

@ -131,8 +131,10 @@ Wallet.prototype._handleTxProposals = function(senderId, data, isInbound) {
};
Wallet.prototype._handleData = function(senderId, data, isInbound) {
// TODO check message signature
if (this.id !== data.walletId) {
if (data.type !== 'walletId' && this.id !== data.walletId) {
this.emit('badMessage', senderId);
this.log('badMessage FROM:', senderId); //TODO
return;
@ -569,7 +571,7 @@ Wallet.prototype.getBalance = function(cb) {
// we multiply and divide by COIN to avoid rounding errors when adding
for (var a in balanceByAddr) {
balanceByAddr[a] = balanceByAddr[a] / COIN;
balanceByAddr[a] = balanceByAddr[a].toFixed(0) / COIN;
}
balance = balance / COIN;
@ -579,7 +581,7 @@ Wallet.prototype.getBalance = function(cb) {
safeBalance += amt;
}
safeBalance = safeBalance / COIN;
safeBalance = safeBalance.toFixed(0) / COIN;
return cb(null, balance, balanceByAddr, safeBalance);
});
};

View File

@ -61,7 +61,8 @@ angular.module('copayApp.services')
w.on('ready', function(myPeerID) {
$rootScope.wallet = w;
$location.path('addresses');
video.setOwnPeer(myPeerID, w, handlePeerVideo);
if (!config.disableVideo)
video.setOwnPeer(myPeerID, w, handlePeerVideo);
});
w.on('publicKeyRingUpdated', function(dontDigest) {
@ -83,7 +84,7 @@ angular.module('copayApp.services')
root.onErrorDigest(msg);
});
w.on('connect', function(peerID) {
if (peerID) {
if (peerID && !config.disableVideo) {
video.callPeer(peerID, handlePeerVideo);
}
$rootScope.$digest();

View File

@ -180,7 +180,7 @@ describe('TxProposals model', function() {
uuk[0].split(',')[0].should.equal(unspentTest[0].txid);
});
it.skip('#merge with self', function () {
it('#merge with self', function () {
var priv = new PrivateKey(config);
var w = new TxProposals({
networkName: config.networkName,
@ -398,7 +398,7 @@ var _dumpChunks = function (scriptSig, label) {
});
it.skip('#merge, merge signatures case 3', function () {
it('#merge, merge signatures case 3', function () {
var priv = new PrivateKey(config);
var priv2 = new PrivateKey(config);