fixed karma test bug

This commit is contained in:
Manuel Araoz 2014-06-18 13:01:50 -03:00
commit 0c03af53a8
8 changed files with 44 additions and 30 deletions

View file

@ -7,7 +7,9 @@ var Video = function() {
this.mediaConnections = {};
this.localStream = null;
this.onlineSound = new Audio('sound/online.wav');
if (typeof Audio !== 'undefined') {
this.onlineSound = new Audio('sound/online.wav');
}
};
Video.prototype.setOwnPeer = function(peer, wallet, cb) {
@ -64,7 +66,7 @@ Video.prototype._addCall = function(mediaConnection, cb) {
// Wait for stream on the call, then set peer video display
mediaConnection.on('stream', function(stream) {
self.onlineSound.play();
if (self.onlineSound) self.onlineSound.play();
cb(null, peerID, URL.createObjectURL(stream));
});