|
|
@ -58,12 +58,13 @@ angular.module('MatrixCall', []) |
|
|
|
this.didConnect = false; |
|
|
|
this.didConnect = false; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
MatrixCall.prototype.placeCall = function() { |
|
|
|
MatrixCall.prototype.placeCall = function(config) { |
|
|
|
self = this; |
|
|
|
self = this; |
|
|
|
matrixPhoneService.callPlaced(this); |
|
|
|
matrixPhoneService.callPlaced(this); |
|
|
|
navigator.getUserMedia({audio: true, video: false}, function(s) { self.gotUserMediaForInvite(s); }, function(e) { self.getUserMediaFailed(e); }); |
|
|
|
navigator.getUserMedia({audio: config.audio, video: config.video}, function(s) { self.gotUserMediaForInvite(s); }, function(e) { self.getUserMediaFailed(e); }); |
|
|
|
self.state = 'wait_local_media'; |
|
|
|
this.state = 'wait_local_media'; |
|
|
|
this.direction = 'outbound'; |
|
|
|
this.direction = 'outbound'; |
|
|
|
|
|
|
|
this.config = config; |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
MatrixCall.prototype.initWithInvite = function(msg) { |
|
|
|
MatrixCall.prototype.initWithInvite = function(msg) { |
|
|
@ -105,6 +106,8 @@ angular.module('MatrixCall', []) |
|
|
|
this.stopAllMedia(); |
|
|
|
this.stopAllMedia(); |
|
|
|
this.peerConn.close(); |
|
|
|
this.peerConn.close(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.hangupParty = 'local'; |
|
|
|
|
|
|
|
|
|
|
|
var content = { |
|
|
|
var content = { |
|
|
|
version: 0, |
|
|
|
version: 0, |
|
|
|
call_id: this.call_id, |
|
|
|
call_id: this.call_id, |
|
|
@ -285,6 +288,7 @@ angular.module('MatrixCall', []) |
|
|
|
self = this; |
|
|
|
self = this; |
|
|
|
$rootScope.$apply(function() { |
|
|
|
$rootScope.$apply(function() { |
|
|
|
self.state = 'ended'; |
|
|
|
self.state = 'ended'; |
|
|
|
|
|
|
|
this.hangupParty = 'remote'; |
|
|
|
self.stopAllMedia(); |
|
|
|
self.stopAllMedia(); |
|
|
|
this.peerConn.close(); |
|
|
|
this.peerConn.close(); |
|
|
|
self.onHangup(); |
|
|
|
self.onHangup(); |
|
|
@ -300,6 +304,7 @@ angular.module('MatrixCall', []) |
|
|
|
|
|
|
|
|
|
|
|
MatrixCall.prototype.onHangupReceived = function() { |
|
|
|
MatrixCall.prototype.onHangupReceived = function() { |
|
|
|
this.state = 'ended'; |
|
|
|
this.state = 'ended'; |
|
|
|
|
|
|
|
this.hangupParty = 'remote'; |
|
|
|
this.stopAllMedia(); |
|
|
|
this.stopAllMedia(); |
|
|
|
this.peerConn.close(); |
|
|
|
this.peerConn.close(); |
|
|
|
this.onHangup(); |
|
|
|
this.onHangup(); |
|
|
|