From d4d4165bac4ee178037c9baaee86147c1116e485 Mon Sep 17 00:00:00 2001 From: Jaon EarlWolf Date: Fri, 27 Nov 2015 15:11:16 -0300 Subject: [PATCH 1/2] FS-7800 [verto_communicator] - Added an option in user's hover buttons to open another canvas when canvasCount is higher than 1 --- .../verto_communicator/src/css/verto.css | 43 +++++++++++++++++++ .../src/partials/incall.html | 2 +- .../src/partials/video_call.html | 18 ++++++-- .../controllers/ChatController.js | 5 +++ .../controllers/DialPadController.js | 21 ++++++--- .../controllers/InCallController.js | 26 ++++++++++- .../controllers/MainController.js | 23 ++++++++++ .../vertoDirectives/directives/videoTag.js | 2 +- .../src/vertoService/services/vertoService.js | 13 ++++-- 9 files changed, 139 insertions(+), 14 deletions(-) diff --git a/html5/verto/verto_communicator/src/css/verto.css b/html5/verto/verto_communicator/src/css/verto.css index 4e0175d583..b8514ac084 100644 --- a/html5/verto/verto_communicator/src/css/verto.css +++ b/html5/verto/verto_communicator/src/css/verto.css @@ -850,6 +850,10 @@ body .modal-body .btn-group .btn.active { padding-right: 360px; } + .watcher #wrapper { + padding-right: 0; + } + #wrapper.toggled { padding-right: 0; } @@ -1545,3 +1549,42 @@ body:-webkit-full-screen #incall .video-footer { #preview .refresh { margin: 15px 0px 0px 0px; } + +.watcher { + padding: 0; + background-color: #333333; +} + +.watcher .navbar, .watcher #sidebar-wrapper, .watcher #dialpad { + display: none; +} + +.watcher #wrapper.toggled { + padding-right: 0; +} + +.watcher #incall .panel { + margin: 0; +} + +.watcher #video-tag-wrapper { + background: linear-gradient(to bottom, #272627, #27252A); + background-color: #27252A; +} + +.watcher #incall .video-call { + width: 100%; + height: 100%; + padding: 0; + max-width: none; + max-height: none; +} + +.watcher #webcam { + max-width: 160.78vh; + margin: auto; +} + +.watcher .spinner { + top: 20%; +} diff --git a/html5/verto/verto_communicator/src/partials/incall.html b/html5/verto/verto_communicator/src/partials/incall.html index 702c943994..9f58c25456 100644 --- a/html5/verto/verto_communicator/src/partials/incall.html +++ b/html5/verto/verto_communicator/src/partials/incall.html @@ -1,5 +1,5 @@
-
+
diff --git a/html5/verto/verto_communicator/src/partials/video_call.html b/html5/verto/verto_communicator/src/partials/video_call.html index 9633149c77..d6fb097b67 100644 --- a/html5/verto/verto_communicator/src/partials/video_call.html +++ b/html5/verto/verto_communicator/src/partials/video_call.html @@ -1,6 +1,6 @@
-
+
+
+ + +
@@ -80,13 +91,14 @@
- {{hhours}}:{{mminutes}}:{{sseconds}} + Room {{ extension }} - Canvas {{ canvasID }} + {{hhours}}:{{mminutes}}:{{sseconds}}
diff --git a/html5/verto/verto_communicator/src/vertoControllers/controllers/ChatController.js b/html5/verto/verto_communicator/src/vertoControllers/controllers/ChatController.js index 3129db87c7..99c6359c96 100644 --- a/html5/verto/verto_communicator/src/vertoControllers/controllers/ChatController.js +++ b/html5/verto/verto_communicator/src/vertoControllers/controllers/ChatController.js @@ -98,6 +98,11 @@ }); $rootScope.$on('members.del', function(event, uuid) { + if ($rootScope.watcher && $rootScope.master === uuid) { + verto.hangup(); + window.close(); + } + $scope.$apply(function() { var memberIdx = findMemberByUUID(uuid); if (memberIdx != -1) { diff --git a/html5/verto/verto_communicator/src/vertoControllers/controllers/DialPadController.js b/html5/verto/verto_communicator/src/vertoControllers/controllers/DialPadController.js index 305befeea1..305e4e60fb 100644 --- a/html5/verto/verto_communicator/src/vertoControllers/controllers/DialPadController.js +++ b/html5/verto/verto_communicator/src/vertoControllers/controllers/DialPadController.js @@ -10,6 +10,15 @@ eventQueue.process(); + if ($location.search().autocall) { + $rootScope.dialpadNumber = $location.search().autocall; + delete $location.search().autocall; + call($rootScope.dialpadNumber); + if($rootScope.watcher) { + return; + } + } + $scope.call_history = CallHistory.all(); $scope.history_control = CallHistory.all_control(); $scope.has_history = Object.keys($scope.call_history).length; @@ -32,11 +41,6 @@ /** * fill dialpad via querystring [?autocall=\d+] */ - if ($location.search().autocall) { - $rootScope.dialpadNumber = $location.search().autocall; - delete $location.search().autocall; - call($rootScope.dialpadNumber); - } /** * fill in dialpad via config.json @@ -83,6 +87,13 @@ return false; } + if (extension.indexOf('-canvas-') != -1) { + $rootScope.watcher = true; + verto.call($rootScope.dialpadNumber, null, { useCamera: false, useMic: false, caller_id_name: null, userVariables: {}, caller_id_number: null, mirrorInput: false }); + $location.path('/incall'); + return; + } + storage.data.mutedVideo = false; storage.data.mutedMic = false; diff --git a/html5/verto/verto_communicator/src/vertoControllers/controllers/InCallController.js b/html5/verto/verto_communicator/src/vertoControllers/controllers/InCallController.js index 93e510d5e3..10887d3195 100644 --- a/html5/verto/verto_communicator/src/vertoControllers/controllers/InCallController.js +++ b/html5/verto/verto_communicator/src/vertoControllers/controllers/InCallController.js @@ -15,7 +15,6 @@ $scope.dialpadTemplate = ''; $scope.incall = true; - if (storage.data.videoCall) { $scope.callTemplate = 'partials/video_call.html'; } @@ -25,6 +24,7 @@ if($scope.chatStatus) { $scope.openChat(); } + buildCanvasesData(); }); }); @@ -80,6 +80,22 @@ $rootScope.$emit('changedSpeaker', speakerId); }; + $scope.confPopup = function(canvas_id) { + var s = window.location.href; + var curCall = verto.data.call.callID; + var extension = verto.data.call.params.remote_caller_id_number; + var width = 465, height = 360; + var x = screen.width/2 - width/2 + var y = screen.height/2 - height/2 + + s = s.replace(/\#.*/, ''); + s += "#/?sessid=random&master=" + curCall + "&watcher=true&extension=" + extension+ "&canvas_id=" + canvas_id; + + console.log("opening new window to " + s); + var popup = window.open(s, "canvas_window_" + canvas_id, "toolbar=0,location=0,menubar=0,directories=0,width=" + width + ",height=" + height, + ',left=' + x + ',top=' + y); + popup.moveTo(x, y); + }; + $scope.screenshare = function() { if(verto.data.shareCall) { verto.screenshareHangup(); @@ -88,6 +104,14 @@ verto.screenshare(storage.data.called_number); }; + function buildCanvasesData() { + $scope.conf = verto.data.conf.params.laData; + $scope.canvases = [{ id: 1, name: 'Super Canvas' }]; + for (var i = 1; i < $scope.conf.canvasCount; i++) { + $scope.canvases.push({ id: i+1, name: 'Canvas ' + (i+1) }); + } + } + $scope.muteMic = verto.muteMic; $scope.muteVideo = verto.muteVideo; diff --git a/html5/verto/verto_communicator/src/vertoControllers/controllers/MainController.js b/html5/verto/verto_communicator/src/vertoControllers/controllers/MainController.js index 3c245301a4..5f965a2a74 100644 --- a/html5/verto/verto_communicator/src/vertoControllers/controllers/MainController.js +++ b/html5/verto/verto_communicator/src/vertoControllers/controllers/MainController.js @@ -8,6 +8,24 @@ console.debug('Executing MainController.'); + $rootScope.master = $location.search().master; + if ($location.search().watcher === 'true') { + $rootScope.watcher = true; + angular.element(document.body).addClass('watcher'); + var dialpad; + var extension = dialpad = $location.search().extension; + var canvasID = $location.search().canvas_id; + + if (dialpad) { + if (canvasID) { + dialpad += '-canvas-' + canvasID; + } + $rootScope.extension = extension; + $rootScope.canvasID = canvasID; + $location.search().autocall = dialpad; + } + } + var myVideo = document.getElementById("webcam"); $scope.verto = verto; $scope.storage = storage; @@ -432,6 +450,11 @@ return; } + if ($rootScope.watcher) { + window.close(); + return; + } + //var hangupCallback = function(v, hangup) { // if (hangup) { // $location.path('/dialpad'); diff --git a/html5/verto/verto_communicator/src/vertoDirectives/directives/videoTag.js b/html5/verto/verto_communicator/src/vertoDirectives/directives/videoTag.js index 38b50552f7..e40adc879a 100644 --- a/html5/verto/verto_communicator/src/vertoDirectives/directives/videoTag.js +++ b/html5/verto/verto_communicator/src/vertoDirectives/directives/videoTag.js @@ -32,4 +32,4 @@ } }); -})(); \ No newline at end of file +})(); diff --git a/html5/verto/verto_communicator/src/vertoService/services/vertoService.js b/html5/verto/verto_communicator/src/vertoService/services/vertoService.js index 9bf54c3cbd..68ed52c4bc 100644 --- a/html5/verto/verto_communicator/src/vertoService/services/vertoService.js +++ b/html5/verto/verto_communicator/src/vertoService/services/vertoService.js @@ -584,6 +584,11 @@ vertoService.service('verto', ['$rootScope', '$cookieStore', '$location', 'stora var that = this; function ourBootstrap() { + var sessid = $location.search().sessid; + if (sessid === 'random') { + sessid = $.verto.genUUID(); + $location.search().sessid = sessid; + } // Checking if we have a failed connection attempt before // connecting again. if (data.instance && !data.instance.rpcClient.socketReady()) { @@ -604,6 +609,7 @@ vertoService.service('verto', ['$rootScope', '$cookieStore', '$location', 'stora googNoiseSuppression: storage.data.googNoiseSuppression || true, googHighpassFilter: storage.data.googHighpassFilter || true }, + sessid: sessid, iceServers: storage.data.useSTUN }, callbacks); @@ -614,6 +620,7 @@ vertoService.service('verto', ['$rootScope', '$cookieStore', '$location', 'stora jQuery.verto.unloadJobs.push(function() { that.reloaded = true; }); + data.instance.deviceParams({ useCamera: storage.data.selectedVideo, useSpeak: storage.data.selectedSpeaker, @@ -674,10 +681,10 @@ vertoService.service('verto', ['$rootScope', '$cookieStore', '$location', 'stora * * @param callback */ - call: function(destination, callback) { + call: function(destination, callback, custom) { console.debug('Attempting to call destination ' + destination + '.'); - var call = data.instance.newCall({ + var call = data.instance.newCall(angular.extend({ destination_number: destination, caller_id_name: data.name, caller_id_number: data.callerid ? data.callerid : data.email, @@ -694,7 +701,7 @@ vertoService.service('verto', ['$rootScope', '$cookieStore', '$location', 'stora email : storage.data.email, avatar: "http://gravatar.com/avatar/" + md5(storage.data.email) + ".png?s=600" } - }); + }, custom)); data.call = call; From 05ff8ec711d35c9817ef409e0ad2d55b76e898d7 Mon Sep 17 00:00:00 2001 From: Jaon EarlWolf Date: Fri, 27 Nov 2015 18:03:13 -0300 Subject: [PATCH 2/2] FS-7800 [verto_communicator] - Added Canvas controls and now opening popup with original (master) dimensions --- .../verto_communicator/src/partials/chat.html | 18 +++++++ .../controllers/ChatController.js | 48 +++++++++++++++++++ .../controllers/InCallController.js | 8 ++-- .../src/vertoService/services/vertoService.js | 9 ++++ 4 files changed, 80 insertions(+), 3 deletions(-) diff --git a/html5/verto/verto_communicator/src/partials/chat.html b/html5/verto/verto_communicator/src/partials/chat.html index 23797d0b51..81eaf12912 100644 --- a/html5/verto/verto_communicator/src/partials/chat.html +++ b/html5/verto/verto_communicator/src/partials/chat.html @@ -99,6 +99,24 @@ Transfer +
  • + + + Canvas In + +
  • +
  • + + + Canvas Out + +
  • +
  • + + + Layer + +
  • diff --git a/html5/verto/verto_communicator/src/vertoControllers/controllers/ChatController.js b/html5/verto/verto_communicator/src/vertoControllers/controllers/ChatController.js index 99c6359c96..1e725857d2 100644 --- a/html5/verto/verto_communicator/src/vertoControllers/controllers/ChatController.js +++ b/html5/verto/verto_communicator/src/vertoControllers/controllers/ChatController.js @@ -196,6 +196,41 @@ }); }; + $scope.confCanvasIn = function(memberID, canvasID) { + if (canvasID) { + verto.setCanvasIn(memberID, canvasID); + return; + } + + shortPrompt('Please insert the Canvas Id', function(canvasID) { + console.log(memberID, canvasID); + verto.setCanvasIn(memberID, canvasID); + }); + + }; + + $scope.confCanvasOut = function(memberID, canvasID) { + if (canvasID) { + verto.setCanvasOut(memberID, canvasID); + return; + } + + shortPrompt('Please insert the Canvas Id', function(canvasID) { + verto.setCanvasOut(memberID, canvasID); + }); + }; + + $scope.confLayer = function(memberID, canvasID) { + if (canvasID) { + verto.setLayer(memberID, canvasID); + return; + } + + shortPrompt('Please insert the Layer', function(canvasID) { + verto.setLayer(memberID, canvasID); + }); + }; + $scope.confResetBanner = function(memberID) { console.log('$scope.confResetBanner'); var text = 'reset'; @@ -226,6 +261,19 @@ } }); }; + + function shortPrompt(text, cb) { + prompt({ + title: text, + input: true, + label: '', + value: '', + }).then(function(val) { + if (val && cb) { + cb(val); + } + }); + } } ]); diff --git a/html5/verto/verto_communicator/src/vertoControllers/controllers/InCallController.js b/html5/verto/verto_communicator/src/vertoControllers/controllers/InCallController.js index 10887d3195..ab59171d85 100644 --- a/html5/verto/verto_communicator/src/vertoControllers/controllers/InCallController.js +++ b/html5/verto/verto_communicator/src/vertoControllers/controllers/InCallController.js @@ -81,12 +81,14 @@ }; $scope.confPopup = function(canvas_id) { + var video = document.getElementById('webcam'); var s = window.location.href; var curCall = verto.data.call.callID; var extension = verto.data.call.params.remote_caller_id_number; - var width = 465, height = 360; - var x = screen.width/2 - width/2 - var y = screen.height/2 - height/2 + var width = webcam.offsetWidth; + var height = webcam.offsetHeight + 100; + var x = (screen.width - width)/2 + var y = (screen.height - height)/2 s = s.replace(/\#.*/, ''); s += "#/?sessid=random&master=" + curCall + "&watcher=true&extension=" + extension+ "&canvas_id=" + canvas_id; diff --git a/html5/verto/verto_communicator/src/vertoService/services/vertoService.js b/html5/verto/verto_communicator/src/vertoService/services/vertoService.js index 68ed52c4bc..480ccb13ac 100644 --- a/html5/verto/verto_communicator/src/vertoService/services/vertoService.js +++ b/html5/verto/verto_communicator/src/vertoService/services/vertoService.js @@ -919,6 +919,15 @@ vertoService.service('verto', ['$rootScope', '$cookieStore', '$location', 'stora sendConferenceChat: function(message) { data.conf.sendChat(message, "message"); }, + setCanvasIn: function(memberID, canvasID) { + data.conf.modCommand('vid-canvas', memberID, canvasID); + }, + setCanvasOut: function(memberID, canvasID) { + data.conf.modCommand('vid-watching-canvas', memberID, canvasID); + }, + setLayer: function(memberID, canvasID) { + data.conf.modCommand('vid-layer', memberID, canvasID); + }, /* * Method is used to send user2user chats. * VC does not yet support that.