From 91e86ab352b2cbe403486fc271b78e284a4906ae Mon Sep 17 00:00:00 2001 From: Italo Rossi Date: Fri, 6 Nov 2015 16:38:15 -0300 Subject: [PATCH] FS-8400 [verto_communicator] Removing deprecated use of stream.stop(), removing unused code and making volume meter gray so we can see it in a white background --- .../verto_communicator/src/css/verto.css | 6 +-- .../src/partials/preview.html | 23 -------- .../controllers/PreviewController.js | 52 ++++++------------- 3 files changed, 19 insertions(+), 62 deletions(-) diff --git a/html5/verto/verto_communicator/src/css/verto.css b/html5/verto/verto_communicator/src/css/verto.css index c9694e15d3..84ca62e730 100644 --- a/html5/verto/verto_communicator/src/css/verto.css +++ b/html5/verto/verto_communicator/src/css/verto.css @@ -1488,7 +1488,7 @@ body:-webkit-full-screen #incall .video-footer { } #mic-meter .icon { margin-left: 3px; - color: white; + color: #CCC; } #mic-meter .volumes { width: 30px; @@ -1497,13 +1497,13 @@ body:-webkit-full-screen #incall .video-footer { height: 10px; width: 100%; border-radius: 5px; - border: 2px solid white; + border: 2px solid #CCC; display: block; margin-top: 1.5px; } #mic-meter .volumes .volume-segment.active { - background-color: white; + background-color: #CCC; } #preview .refresh { diff --git a/html5/verto/verto_communicator/src/partials/preview.html b/html5/verto/verto_communicator/src/partials/preview.html index 947b0afb04..76e3b68744 100644 --- a/html5/verto/verto_communicator/src/partials/preview.html +++ b/html5/verto/verto_communicator/src/partials/preview.html @@ -1,26 +1,3 @@ - -
diff --git a/html5/verto/verto_communicator/src/vertoControllers/controllers/PreviewController.js b/html5/verto/verto_communicator/src/vertoControllers/controllers/PreviewController.js index 61fbc5f2e2..6a1d649430 100644 --- a/html5/verto/verto_communicator/src/vertoControllers/controllers/PreviewController.js +++ b/html5/verto/verto_communicator/src/vertoControllers/controllers/PreviewController.js @@ -37,8 +37,22 @@ var meter; var streamObj = {}; + function stopMedia(stream) { + if (typeof stream == 'function') { + stream.stop(); + } else { + if (stream.active) { + var tracks = stream.getTracks(); + tracks.forEach(function(track, index) { + track.stop(); + }) + } + } + } function handleMedia(stream) { - streamObj.stop ? streamObj.stop() : streamObj.active = false; + if (streamObj) { + stopMedia(streamObj); + } streamObj = stream; localVideo.src = window.URL.createObjectURL(stream); @@ -97,45 +111,11 @@ localVideo.src = null; meter.shutdown(); meter.onaudioprocess = null; - streamObj.stop(); + stopMedia(streamObj); $location.path('/dialpad'); storage.data.preview = false; }; - $scope.screenshare = function() { - if(verto.data.shareCall) { - verto.screenshareHangup(); - return false; - } - verto.screenshare(storage.data.called_number); - }; - - $scope.call = function() { - if($rootScope.dialpadNumber) { - localVideo.src = null; - meter.shutdown(); - meter.onaudioprocess = null; - streamObj.stop(); - } - $rootScope.call($rootScope.dialpadNumber); - }; - - $scope.muteMic = verto.muteMic; - $scope.muteVideo = verto.muteVideo; - - $rootScope.$on('ScreenShareExtensionStatus', function(event, error) { - var pluginUrl = 'https://chrome.google.com/webstore/detail/screen-capturing/ajhifddimkapgcifgcodmmfdlknahffk'; - switch(error) { - case 'permission-denied': - toastr.info('Please allow the plugin in order to use Screen Share', 'Error'); break; - case 'not-installed': - toastr.warning('Please install the plugin in order to use Screen Share', 'Warning', { allowHtml: true }); break; - case 'installed-disabled': - toastr.info('Please enable the plugin in order to use Screen Share', 'Error'); break; - // case 'not-chrome' - // toastr.info('Chrome', 'Error'); - } - }); $scope.localVideo(); } ]);