From b765dc005ba22cb41e01439f1b07d567d2de68da Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Tue, 11 Nov 2014 04:39:16 +0000 Subject: major CSS overhaul to try to make things look a bit cleaner --- syweb/webclient/room/room-controller.js | 19 ++++- syweb/webclient/room/room.html | 131 +++++++++++++++----------------- 2 files changed, 77 insertions(+), 73 deletions(-) (limited to 'syweb/webclient/room') diff --git a/syweb/webclient/room/room-controller.js b/syweb/webclient/room/room-controller.js index b878a1f718..be433d6e80 100644 --- a/syweb/webclient/room/room-controller.js +++ b/syweb/webclient/room/room-controller.js @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -angular.module('RoomController', ['ngSanitize', 'matrixFilter', 'mFileInput']) +angular.module('RoomController', ['ngSanitize', 'matrixFilter', 'mFileInput', 'angular-peity']) .controller('RoomController', ['$modal', '$filter', '$scope', '$timeout', '$routeParams', '$location', '$rootScope', 'matrixService', 'mPresence', 'eventHandlerService', 'mFileUpload', 'matrixPhoneService', 'MatrixCall', 'notificationService', 'modelService', function($modal, $filter, $scope, $timeout, $routeParams, $location, $rootScope, matrixService, mPresence, eventHandlerService, mFileUpload, matrixPhoneService, MatrixCall, notificationService, modelService) { 'use strict'; @@ -905,7 +905,20 @@ angular.module('RoomController', ['ngSanitize', 'matrixFilter', 'mFileInput']) paginate(MESSAGES_PER_PAGINATION); }; - $scope.startVoiceCall = function() { + $scope.checkWebRTC = function() { + if (!$rootScope.isWebRTCSupported()) { + alert("Your browser does not support WebRTC"); + return false; + } + if ($scope.memberCount() != 2) { + alert("WebRTC calls are currently only supported on rooms with two members"); + return false; + } + return true; + }; + + $scope.startVoiceCall = function() { + if (!$scope.checkWebRTC()) return; var call = new MatrixCall($scope.room_id); call.onError = $rootScope.onCallError; call.onHangup = $rootScope.onCallHangup; @@ -916,6 +929,8 @@ angular.module('RoomController', ['ngSanitize', 'matrixFilter', 'mFileInput']) }; $scope.startVideoCall = function() { + if (!$scope.checkWebRTC()) return; + var call = new MatrixCall($scope.room_id); call.onError = $rootScope.onCallError; call.onHangup = $rootScope.onCallHangup; diff --git a/syweb/webclient/room/room.html b/syweb/webclient/room/room.html index e59cc30edc..018d66f4fb 100644 --- a/syweb/webclient/room/room.html +++ b/syweb/webclient/room/room.html @@ -15,6 +15,15 @@