Give basic feedback on the state of VoIP calls in the UI (manually adding to master having added to develop)

This commit is contained in:
David Baker 2014-08-29 18:11:20 +01:00
parent 52203edbce
commit 8c36179d35
3 changed files with 6 additions and 3 deletions

View File

@ -36,7 +36,7 @@ var forAllTracksOnStream = function(s, f) {
} }
angular.module('MatrixCall', []) angular.module('MatrixCall', [])
.factory('MatrixCall', ['matrixService', 'matrixPhoneService', function MatrixCallFactory(matrixService, matrixPhoneService) { .factory('MatrixCall', ['matrixService', 'matrixPhoneService', '$rootScope', function MatrixCallFactory(matrixService, matrixPhoneService, $rootScope) {
var MatrixCall = function(room_id) { var MatrixCall = function(room_id) {
this.room_id = room_id; this.room_id = room_id;
this.call_id = "c" + new Date().getTime(); this.call_id = "c" + new Date().getTime();
@ -204,6 +204,7 @@ angular.module('MatrixCall', [])
// ideally we'd consider the call to be connected when we get media but chrome doesn't implement nay of the 'onstarted' events yet // ideally we'd consider the call to be connected when we get media but chrome doesn't implement nay of the 'onstarted' events yet
if (this.peerConn.iceConnectionState == 'completed' || this.peerConn.iceConnectionState == 'connected') { if (this.peerConn.iceConnectionState == 'completed' || this.peerConn.iceConnectionState == 'connected') {
this.state = 'connected'; this.state = 'connected';
$rootScope.$apply();
} }
}; };

View File

@ -487,7 +487,5 @@ angular.module('RoomController', ['ngSanitize', 'mFileInput'])
} }
$scope.onCallHangup = function() { $scope.onCallHangup = function() {
$scope.feedback = "Call ended";
$scope.currentCall = undefined;
} }
}]); }]);

View File

@ -105,6 +105,10 @@
<button ng-click="hangupCall()">Reject</button> <button ng-click="hangupCall()">Reject</button>
</div> </div>
<button ng-click="hangupCall()" ng-show="currentCall && currentCall.state != 'ringing'">Hang up</button> <button ng-click="hangupCall()" ng-show="currentCall && currentCall.state != 'ringing'">Hang up</button>
<span ng-show="currentCall.state == 'invite_sent'">Calling...</span>
<span ng-show="currentCall.state == 'connecting'">Call Connecting...</span>
<span ng-show="currentCall.state == 'connected'">Call Connected</span>
<span ng-show="currentCall.state == 'ended'">Call Ended</span>
<span style="display: none; ">{{ currentCall.state }}</span> <span style="display: none; ">{{ currentCall.state }}</span>
</div> </div>