diff --git a/html5/verto/verto_communicator/src/css/verto.css b/html5/verto/verto_communicator/src/css/verto.css index 89ffc0e7ca..84666c880a 100644 --- a/html5/verto/verto_communicator/src/css/verto.css +++ b/html5/verto/verto_communicator/src/css/verto.css @@ -861,6 +861,10 @@ body .modal-body .btn-group .btn.active { padding-right: 360px; } + .watcher #wrapper { + padding-right: 0; + } + #wrapper.toggled { padding-right: 0; } @@ -1566,3 +1570,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/chat.html b/html5/verto/verto_communicator/src/partials/chat.html index 9cefd72615..afe85c1af7 100644 --- a/html5/verto/verto_communicator/src/partials/chat.html +++ b/html5/verto/verto_communicator/src/partials/chat.html @@ -93,6 +93,24 @@ Transfer +
  • + + + Canvas In + +
  • +
  • + + + Canvas Out + +
  • +
  • + + + Layer + +
  • 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 7fcb9b71b2..5b83e19d5e 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 c990e0d5c2..0e4d821288 100644 --- a/html5/verto/verto_communicator/src/vertoControllers/controllers/ChatController.js +++ b/html5/verto/verto_communicator/src/vertoControllers/controllers/ChatController.js @@ -131,6 +131,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) { @@ -229,6 +234,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'; @@ -259,6 +299,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/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 4285ace586..f030b5d611 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(); }); }); @@ -82,6 +82,24 @@ $rootScope.$emit('changedSpeaker', speakerId); }; + $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 = 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; + + 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(); @@ -90,6 +108,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 4a46b09066..3b2c01758a 100644 --- a/html5/verto/verto_communicator/src/vertoService/services/vertoService.js +++ b/html5/verto/verto_communicator/src/vertoService/services/vertoService.js @@ -605,6 +605,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()) { @@ -625,6 +630,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); @@ -635,6 +641,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, @@ -695,10 +702,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, @@ -715,7 +722,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; @@ -933,6 +940,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 set a member's resevartion Id. */