diff --git a/html5/verto/verto_communicator/src/partials/menu.html b/html5/verto/verto_communicator/src/partials/menu.html
index b14aad0061..55e0cee35b 100644
--- a/html5/verto/verto_communicator/src/partials/menu.html
+++ b/html5/verto/verto_communicator/src/partials/menu.html
@@ -19,9 +19,21 @@
+
+
+
+
+
+
Refresh device list
+
diff --git a/html5/verto/verto_communicator/src/partials/preview.html b/html5/verto/verto_communicator/src/partials/preview.html
new file mode 100644
index 0000000000..76e3b68744
--- /dev/null
+++ b/html5/verto/verto_communicator/src/partials/preview.html
@@ -0,0 +1,47 @@
+
+
+
+
+
Setup your camera and microphone settings
+
+
+
+
+
diff --git a/html5/verto/verto_communicator/src/partials/video_call.html b/html5/verto/verto_communicator/src/partials/video_call.html
index da339e4878..9633149c77 100644
--- a/html5/verto/verto_communicator/src/partials/video_call.html
+++ b/html5/verto/verto_communicator/src/partials/video_call.html
@@ -2,23 +2,30 @@
-
diff --git a/html5/verto/verto_communicator/src/storageService/services/splash_screen.js b/html5/verto/verto_communicator/src/storageService/services/splash_screen.js
index da7a156f63..40c2b6951b 100644
--- a/html5/verto/verto_communicator/src/storageService/services/splash_screen.js
+++ b/html5/verto/verto_communicator/src/storageService/services/splash_screen.js
@@ -4,7 +4,7 @@
.module('storageService')
.service('splashscreen', ['$rootScope', '$q', 'storage', 'config', 'verto',
function($rootScope, $q, storage, config, verto) {
-
+
var checkBrowser = function() {
return $q(function(resolve, reject) {
var activity = 'browser-upgrade';
@@ -22,10 +22,10 @@
if (!navigator.getUserMedia) {
result['status'] = 'error';
result['message'] = 'Error: browser doesn\'t support WebRTC.';
- reject(result);
+ reject(result);
}
- resolve(result);
+ resolve(result);
});
};
@@ -48,7 +48,7 @@
reject(result);
}
verto.data.mediaPerm = true;
- resolve(result);
+ resolve(result);
});
});
};
@@ -62,7 +62,7 @@
'activity': activity,
'message': 'Refresh Media Devices.'
};
-
+
verto.refreshDevices(function(status) {
verto.refreshDevicesCallback(function() {
resolve(result);
@@ -72,6 +72,28 @@
});
};
+ var checkConnectionSpeed = function() {
+ return $q(function(resolve, reject) {
+ var activity = 'check-connection-speed';
+ var result = {
+ 'status': 'success',
+ 'soft': true,
+ 'activity': activity,
+ 'message': 'Check Connection Speed.'
+ };
+
+ if (storage.data.autoBand && verto.data.instance) {
+ verto.testSpeed(cb);
+ } else {
+ resolve(result);
+ }
+
+ function cb(data) {
+ resolve(result);
+ }
+ });
+ };
+
var provisionConfig = function() {
return $q(function(resolve, reject) {
var activity = 'provision-config';
@@ -100,7 +122,7 @@
});
result['promise'] = configPromise;
-
+
resolve(result);
});
};
@@ -136,13 +158,13 @@
verto.data.connecting = false;
resolve(result);
});
- };
+ };
};
if(storage.data.ui_connected && storage.data.ws_connected) {
- checkUserStored();
+ checkUserStored();
} else {
- resolve(result);
+ resolve(result);
};
});
};
@@ -152,7 +174,8 @@
checkMediaPerm,
refreshMediaDevices,
provisionConfig,
- checkLogin
+ checkLogin,
+ checkConnectionSpeed
];
var progress_message = [
@@ -160,12 +183,13 @@
'Checking media permissions',
'Refresh Media Devices.',
'Provisioning configuration.',
- 'Checking login.'
+ 'Checking login.',
+ 'Check Connection Speed.'
];
-
+
var getProgressMessage = function(current_progress) {
if(progress_message[current_progress] != undefined) {
- return progress_message[current_progress];
+ return progress_message[current_progress];
} else {
return 'Please wait...';
}
@@ -176,7 +200,7 @@
var calculateProgress = function(index) {
var _progress;
-
+
_progress = index + 1;
progress_percentage = (_progress / progress.length) * 100;
return progress_percentage;
@@ -186,12 +210,12 @@
var fn, fn_return, status, interrupt, activity, soft, message, promise;
interrupt = false;
current_progress++;
-
+
if(current_progress >= progress.length) {
$rootScope.$emit('progress.complete', current_progress);
return;
}
-
+
fn = progress[current_progress];
fn_return = fn();
@@ -221,7 +245,7 @@
emitNextProgress(fn_return);
}
);
-
+
};
return {
@@ -232,4 +256,3 @@
};
}]);
-
diff --git a/html5/verto/verto_communicator/src/storageService/services/storage.js b/html5/verto/verto_communicator/src/storageService/services/storage.js
index f0b8bb1b80..da3a600589 100644
--- a/html5/verto/verto_communicator/src/storageService/services/storage.js
+++ b/html5/verto/verto_communicator/src/storageService/services/storage.js
@@ -21,9 +21,11 @@
userStatus: 'disconnected',
mutedVideo: false,
mutedMic: false,
+ preview: true,
selectedVideo: null,
selectedAudio: null,
selectedShare: null,
+ selectedSpeaker: null,
useStereo: true,
useSTUN: true,
useDedenc: false,
@@ -34,7 +36,9 @@
askRecoverCall: false,
googNoiseSuppression: true,
googHighpassFilter: true,
- googEchoCancellation: true
+ googEchoCancellation: true,
+ autoBand: true,
+ testSpeedJoin: true
};
data.$default(defaultSettings);
diff --git a/html5/verto/verto_communicator/src/vertoApp/vertoApp.module.js b/html5/verto/verto_communicator/src/vertoApp/vertoApp.module.js
index 966a7c1f7e..2edbad2d37 100644
--- a/html5/verto/verto_communicator/src/vertoApp/vertoApp.module.js
+++ b/html5/verto/verto_communicator/src/vertoApp/vertoApp.module.js
@@ -15,6 +15,7 @@
'cgPrompt',
'720kb.tooltips',
'ui.gravatar',
+ 'ui.bootstrap',
'directive.g+signin',
]);
@@ -41,6 +42,11 @@
templateUrl: 'partials/incall.html',
controller: 'InCallController'
}).
+ when('/preview', {
+ title: 'Preview Video',
+ templateUrl: 'partials/preview.html',
+ controller: 'PreviewController'
+ }).
when('/browser-upgrade', {
title: '',
templateUrl: 'partials/browser_upgrade.html',
diff --git a/html5/verto/verto_communicator/src/vertoControllers/controllers/ChatController.js b/html5/verto/verto_communicator/src/vertoControllers/controllers/ChatController.js
index 256d1bb3e5..3129db87c7 100644
--- a/html5/verto/verto_communicator/src/vertoControllers/controllers/ChatController.js
+++ b/html5/verto/verto_communicator/src/vertoControllers/controllers/ChatController.js
@@ -120,6 +120,8 @@
if (parseInt(member.id) == parseInt(verto.data.conferenceMemberID)) {
verto.data.mutedMic = member.status.audio.muted;
verto.data.mutedVideo = member.status.video.muted;
+ verto.data.call.setMute(member.status.audio.muted ? "off" : "on");
+ verto.data.call.setVideoMute(member.status.video.muted ? "off" : "on");
}
angular.extend($scope.members[memberIdx], member);
});
diff --git a/html5/verto/verto_communicator/src/vertoControllers/controllers/DialPadController.js b/html5/verto/verto_communicator/src/vertoControllers/controllers/DialPadController.js
index 2944cae46d..305befeea1 100644
--- a/html5/verto/verto_communicator/src/vertoControllers/controllers/DialPadController.js
+++ b/html5/verto/verto_communicator/src/vertoControllers/controllers/DialPadController.js
@@ -7,9 +7,9 @@
'$http', '$location', 'toastr', 'verto', 'storage', 'CallHistory', 'eventQueue',
function($rootScope, $scope, $http, $location, toastr, verto, storage, CallHistory, eventQueue) {
console.debug('Executing DialPadController.');
-
+
eventQueue.process();
-
+
$scope.call_history = CallHistory.all();
$scope.history_control = CallHistory.all_control();
$scope.has_history = Object.keys($scope.call_history).length;
@@ -55,6 +55,10 @@
$rootScope.dialpadNumber = number;
};
+ $scope.preview = function() {
+ $location.path('/preview');
+ };
+
$rootScope.transfer = function() {
if (!$rootScope.dialpadNumber) {
return false;
@@ -93,8 +97,17 @@
/**
* Call to the number in the $rootScope.dialpadNumber.
*/
+ $scope.loading = false;
$rootScope.call = function(extension) {
- return call(extension);
+ if (!storage.data.testSpeedJoin || !$rootScope.dialpadNumber) {
+ return call(extension);
+ }
+ $scope.loading = true;
+
+ verto.testSpeed(function() {
+ $scope.loading = false;
+ call(extension);
+ });
}
}
]);
diff --git a/html5/verto/verto_communicator/src/vertoControllers/controllers/InCallController.js b/html5/verto/verto_communicator/src/vertoControllers/controllers/InCallController.js
index 84d8894b28..93e510d5e3 100644
--- a/html5/verto/verto_communicator/src/vertoControllers/controllers/InCallController.js
+++ b/html5/verto/verto_communicator/src/vertoControllers/controllers/InCallController.js
@@ -5,7 +5,7 @@
.module('vertoControllers')
.controller('InCallController', ['$rootScope', '$scope',
'$http', '$location', '$modal', '$timeout', 'toastr', 'verto', 'storage', 'prompt', 'Fullscreen',
- function($rootScope, $scope, $http, $location, $modal, $timeout, toatr,
+ function($rootScope, $scope, $http, $location, $modal, $timeout, toastr,
verto, storage, prompt, Fullscreen) {
console.debug('Executing InCallController.');
@@ -19,7 +19,7 @@
if (storage.data.videoCall) {
$scope.callTemplate = 'partials/video_call.html';
}
-
+
$rootScope.$on('call.conference', function(event, data) {
$timeout(function() {
if($scope.chatStatus) {
@@ -75,9 +75,36 @@
verto.data.conf.setVideoLayout(layout);
};
+ $scope.confChangeSpeaker = function(speakerId) {
+ storage.data.selectedSpeaker = speakerId;
+ $rootScope.$emit('changedSpeaker', speakerId);
+ };
+
+ $scope.screenshare = function() {
+ if(verto.data.shareCall) {
+ verto.screenshareHangup();
+ return false;
+ }
+ verto.screenshare(storage.data.called_number);
+ };
+
$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');
+ }
+ });
+
$timeout(function() {
console.log('broadcast time-start incall');
$scope.$broadcast('timer-start');
diff --git a/html5/verto/verto_communicator/src/vertoControllers/controllers/MainController.js b/html5/verto/verto_communicator/src/vertoControllers/controllers/MainController.js
index b34aad8631..3c245301a4 100644
--- a/html5/verto/verto_communicator/src/vertoControllers/controllers/MainController.js
+++ b/html5/verto/verto_communicator/src/vertoControllers/controllers/MainController.js
@@ -24,16 +24,24 @@
* @type {string}
*/
$rootScope.dialpadNumber = '';
-
+
// If verto is not connected, redirects to login page.
if (!verto.data.connected) {
console.debug('MainController: WebSocket not connected. Redirecting to login.');
$location.path('/');
}
-
+
$rootScope.$on('config.http.success', function(ev) {
$scope.login(false);
});
+
+ $rootScope.$on('changedSpeaker', function(event, speakerId) {
+ // This should provide feedback
+ //setAudioPlaybackDevice(
[,[,]]);
+ // if callback is set it will be called as callback(, , )
+ verto.data.call.setAudioPlaybackDevice(speakerId);
+ });
+
/**
* Login the user to verto server and
* redirects him to dialpad page.
@@ -52,13 +60,19 @@
storage.data.email = verto.data.email;
storage.data.login = verto.data.login;
storage.data.password = verto.data.password;
- if (redirect) {
+ if (storage.data.autoBand) {
+ verto.testSpeed();
+ }
+
+ if (redirect && storage.data.preview) {
+ $location.path('/preview');
+ } else if (redirect) {
$location.path('/dialpad');
}
}
});
};
-
+
verto.data.connecting = true;
verto.connect(connectCallback);
};
@@ -135,7 +149,7 @@
templateUrl: templateUrl,
controller: controller,
};
-
+
angular.extend(options, _options);
var modalInstance = $modal.open(options);
@@ -154,7 +168,7 @@
jQuery.material.init();
}
);
-
+
return modalInstance;
};
@@ -177,6 +191,9 @@
};
function onWSLogin(ev, data) {
+ if(storage.data.autoBand) {
+ verto.testSpeed();
+ }
if(!ws_modalInstance) {
return;
};
@@ -454,14 +471,6 @@
$scope.incomingCall = false;
};
- $scope.screenshare = function() {
- if (verto.data.shareCall) {
- verto.screenshareHangup();
- return false;
- }
- verto.screenshare(storage.data.called_number);
- };
-
$scope.play = function() {
var file = $scope.promptInput('Please, enter filename', '', 'File',
function(file) {
diff --git a/html5/verto/verto_communicator/src/vertoControllers/controllers/MenuController.js b/html5/verto/verto_communicator/src/vertoControllers/controllers/MenuController.js
index 6d77567714..104b5c2b50 100644
--- a/html5/verto/verto_communicator/src/vertoControllers/controllers/MenuController.js
+++ b/html5/verto/verto_communicator/src/vertoControllers/controllers/MenuController.js
@@ -4,10 +4,43 @@
angular
.module('vertoControllers')
.controller('MenuController', ['$scope', '$http', '$location',
- 'verto', 'storage',
- function($scope, $http, $location, verto, storage) {
+ 'verto', 'storage', '$rootScope',
+ function($scope, $http, $location, verto, storage, $rootScope) {
console.debug('Executing MenuController.');
- }
+ $scope.storage = storage;
+
+ $rootScope.$on('testSpeed', function(e, data) {
+ var vidQual = storage.data.vidQual;
+ var bwp = 4;
+
+ $scope.bandDown = data.downKPS;
+ $scope.bandUp = data.upKPS;
+
+ if (data.downKPS < 2000) {
+ bwp--;
+ }
+
+ if (data.upKPS < 2000) {
+ bwp--;
+ }
+
+ $scope.iconClass = 'mdi-device-signal-wifi-4-bar green';
+
+ if (bwp < 4) {
+ $scope.iconClass = 'mdi-device-signal-wifi-3-bar yellow';
+ } else if (bwp < 2) {
+ $scope.iconClass = 'mdi-device-signal-wifi-1-bar red';
+ }
+
+ verto.videoQuality.forEach(function(vid) {
+ if (vid.id == vidQual){
+ $scope.vidRes = vid.label;
+ }
+ });
+
+ $scope.$apply();
+ });
+ }
]);
-})();
\ No newline at end of file
+})();
diff --git a/html5/verto/verto_communicator/src/vertoControllers/controllers/ModalSettingsController.js b/html5/verto/verto_communicator/src/vertoControllers/controllers/ModalSettingsController.js
index 2b70948bbe..20f8823878 100644
--- a/html5/verto/verto_communicator/src/vertoControllers/controllers/ModalSettingsController.js
+++ b/html5/verto/verto_communicator/src/vertoControllers/controllers/ModalSettingsController.js
@@ -4,8 +4,8 @@
angular
.module('vertoControllers')
.controller('ModalSettingsController', ['$scope', '$http',
- '$location', '$modalInstance', 'storage', 'verto',
- function($scope, $http, $location, $modalInstance, storage, verto) {
+ '$location', '$modalInstance', '$rootScope', 'storage', 'verto',
+ function($scope, $http, $location, $modalInstance, $rootScope, storage, verto) {
console.debug('Executing ModalSettingsController.');
$scope.storage = storage;
@@ -13,8 +13,15 @@
$scope.mydata = angular.copy(storage.data);
$scope.ok = function() {
+ if ($scope.mydata.selectedSpeaker != storage.data.selectedSpeaker) {
+ $rootScope.$emit('changedSpeaker', $scope.mydata.selectedSpeaker);
+ }
storage.changeData($scope.mydata);
verto.data.instance.iceServers(storage.data.useSTUN);
+
+ if (storage.data.autoBand) {
+ $scope.testSpeed();
+ }
$modalInstance.close('Ok.');
};
@@ -26,6 +33,16 @@
return verto.refreshDevices();
};
+ $scope.testSpeed = function() {
+ return verto.testSpeed(cb);
+
+ function cb(data) {
+ $scope.mydata.vidQual = storage.data.vidQual;
+ $scope.speedMsg = 'Up: ' + data.upKPS + ' Down: ' + data.downKPS;
+ $scope.$apply();
+ }
+ };
+
$scope.resetSettings = function() {
if (confirm('Factory Reset Settings?')) {
storage.factoryReset();
@@ -35,11 +52,22 @@
};
};
- $scope.checkUseDedRemoteEncoder = function(option) {
- if ($scope.mydata.incomingBandwidth != 'default' || $scope.mydata.outgoingBandwidth != 'default') {
- $scope.mydata.useDedenc = true;
+ $scope.checkAutoBand = function(option) {
+ $scope.mydata.useDedenc = false;
+ if (!option) {
+ $scope.mydata.outgoingBandwidth = 'default';
+ $scope.mydata.incomingBandwidth = 'default';
+ $scope.mydata.vidQual = 'hd';
} else {
+ $scope.mydata.testSpeedJoin = true;
+ }
+ };
+
+ $scope.checkUseDedRemoteEncoder = function(option) {
+ if (['0', 'default', '5120'].indexOf(option) != -1) {
$scope.mydata.useDedenc = false;
+ } else {
+ $scope.mydata.useDedenc = true;
}
};
}
diff --git a/html5/verto/verto_communicator/src/vertoControllers/controllers/PreviewController.js b/html5/verto/verto_communicator/src/vertoControllers/controllers/PreviewController.js
new file mode 100644
index 0000000000..6a1d649430
--- /dev/null
+++ b/html5/verto/verto_communicator/src/vertoControllers/controllers/PreviewController.js
@@ -0,0 +1,122 @@
+(function() {
+ 'use strict';
+
+ angular
+ .module('vertoControllers')
+ .controller('PreviewController', ['$rootScope', '$scope',
+ '$http', '$location', '$modal', '$timeout', 'toastr', 'verto', 'storage', 'prompt', 'Fullscreen',
+ function($rootScope, $scope, $http, $location, $modal, $timeout, toastr,
+ verto, storage, prompt, Fullscreen) {
+
+ $scope.storage = storage;
+ console.debug('Executing PreviewController.');
+ var localVideo = document.getElementById('videopreview');
+ var volumes = document.querySelector('#mic-meter .volumes').children;
+
+ $scope.localVideo = function() {
+ var constraints = {
+ mirrored: true,
+ audio: {
+ optional: [{ sourceId: storage.data.selectedAudio }]
+ }
+ };
+
+ if (storage.data.selectedVideo !== 'none') {
+ constraints.video = {
+ optional: [{ sourceId: storage.data.selectedVideo }]
+ };
+ }
+
+ navigator.getUserMedia(constraints, handleMedia, function(err, data) {
+
+ });
+ };
+
+ var audioContext = new AudioContext();
+ var mediaStreamSource = null;
+ 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) {
+ if (streamObj) {
+ stopMedia(streamObj);
+ }
+
+ streamObj = stream;
+ localVideo.src = window.URL.createObjectURL(stream);
+
+ mediaStreamSource = audioContext.createMediaStreamSource(stream);
+ meter = createAudioMeter(audioContext);
+ mediaStreamSource.connect(meter);
+
+ renderMic();
+ }
+
+ function renderMic() {
+ // meter.volume;
+ var n = Math.round(meter.volume * 25);
+ for(var i = volumes.length -1, j = 0; i >= 0; i--, j++) {
+ var el = angular.element(volumes[j]);
+ if (i >= n) el.removeClass('active');
+ else el.addClass('active');
+ }
+
+ if(!verto.data.call) {
+ window.requestAnimationFrame(renderMic);
+ }
+ }
+ /**
+ * TODO: useless?
+ */
+
+ $scope.refreshDeviceList = function() {
+ return verto.refreshDevices();
+ };
+
+ $scope.videoCall = function() {
+ prompt({
+ title: 'Would you like to activate video for this call?',
+ message: 'Video will be active during the next calls.'
+ }).then(function() {
+ storage.data.videoCall = true;
+ $scope.callTemplate = 'partials/video_call.html';
+ });
+ };
+
+ $scope.cbMuteVideo = function(event, data) {
+ storage.data.mutedVideo = !storage.data.mutedVideo;
+ }
+
+ $scope.cbMuteMic = function(event, data) {
+ storage.data.mutedMic = !storage.data.mutedMic;
+ }
+
+ $scope.confChangeVideoLayout = function(layout) {
+ verto.data.conf.setVideoLayout(layout);
+ };
+
+ $scope.endPreview = function() {
+ localVideo.src = null;
+ meter.shutdown();
+ meter.onaudioprocess = null;
+ stopMedia(streamObj);
+ $location.path('/dialpad');
+ storage.data.preview = false;
+ };
+
+ $scope.localVideo();
+ }
+ ]);
+})();
diff --git a/html5/verto/verto_communicator/src/vertoControllers/controllers/SplashScreenController.js b/html5/verto/verto_communicator/src/vertoControllers/controllers/SplashScreenController.js
index fdc96efd59..6fd32f9de7 100644
--- a/html5/verto/verto_communicator/src/vertoControllers/controllers/SplashScreenController.js
+++ b/html5/verto/verto_communicator/src/vertoControllers/controllers/SplashScreenController.js
@@ -3,10 +3,10 @@
angular
.module('vertoControllers')
- .controller('SplashScreenController', ['$scope', '$rootScope', '$location', '$timeout', 'splashscreen', 'prompt', 'verto',
- function($scope, $rootScope, $location, $timeout, splashscreen, prompt, verto) {
+ .controller('SplashScreenController', ['$scope', '$rootScope', '$location', '$timeout', 'storage', 'splashscreen', 'prompt', 'verto',
+ function($scope, $rootScope, $location, $timeout, storage, splashscreen, prompt, verto) {
console.debug('Executing SplashScreenController.');
-
+
$scope.progress_percentage = splashscreen.progress_percentage;
$scope.message = '';
$scope.interrupt_next = false;
@@ -18,26 +18,26 @@
link = activity;
}
}
-
+
$location.path(link);
}
var checkProgressState = function(current_progress, status, promise, activity, soft, interrupt, message) {
- $scope.progress_percentage = splashscreen.calculate(current_progress);
+ $scope.progress_percentage = splashscreen.calculate(current_progress);
$scope.message = message;
if(interrupt && status == 'error') {
$scope.errors.push(message);
if(!soft) {
- redirectTo('', activity);
+ redirectTo('', activity);
return;
} else {
- message = message + '. Continue?';
+ message = message + '. Continue?';
};
if(!confirm(message)) {
- $scope.interrupt_next = true;
- };
+ $scope.interrupt_next = true;
+ };
};
if($scope.interrupt_next) {
@@ -48,7 +48,7 @@
return true;
};
-
+
$rootScope.$on('progress.next', function(ev, current_progress, status, promise, activity, soft, interrupt, message) {
$timeout(function() {
if(promise) {
@@ -62,11 +62,11 @@
return;
}
-
+
if(!checkProgressState(current_progress, status, promise, activity, soft, interrupt, message)) {
return;
}
-
+
splashscreen.next();
}, 400);
});
@@ -74,7 +74,12 @@
$rootScope.$on('progress.complete', function(ev, current_progress) {
$scope.message = 'Complete';
if(verto.data.connected) {
- redirectTo('/dialpad');
+ if (storage.data.preview) {
+ $location.path('/preview');
+ }
+ else {
+ $location.path('/dialpad');
+ }
} else {
redirectTo('/login');
$location.path('/login');
diff --git a/html5/verto/verto_communicator/src/vertoService/services/configService.js b/html5/verto/verto_communicator/src/vertoService/services/configService.js
index 105a20b324..9fd789e81f 100644
--- a/html5/verto/verto_communicator/src/vertoService/services/configService.js
+++ b/html5/verto/verto_communicator/src/vertoService/services/configService.js
@@ -40,7 +40,7 @@ vertoService.service('config', ['$rootScope', '$http', '$location', 'storage', '
verto.data.googlelogin = data.googlelogin;
verto.data.googleclientid = data.googleclientid;
}
-
+
angular.extend(verto.data, data);
/**
@@ -62,13 +62,13 @@ vertoService.service('config', ['$rootScope', '$http', '$location', 'storage', '
console.debug("auto login per config.json");
verto.data.autologin_done = true;
}
-
+
if(verto.data.autologin && storage.data.name.length && storage.data.email.length && storage.data.login.length && storage.data.password.length) {
- $rootScope.$emit('config.http.success', data);
+ $rootScope.$emit('config.http.success', data);
};
return response;
}, function(response) {
- $rootScope.$emit('config.http.error', response);
+ $rootScope.$emit('config.http.error', response);
return response;
});
@@ -79,4 +79,3 @@ vertoService.service('config', ['$rootScope', '$http', '$location', 'storage', '
'configure': configure
};
}]);
-
diff --git a/html5/verto/verto_communicator/src/vertoService/services/vertoService.js b/html5/verto/verto_communicator/src/vertoService/services/vertoService.js
index 26c13c6fc1..9bf54c3cbd 100644
--- a/html5/verto/verto_communicator/src/vertoService/services/vertoService.js
+++ b/html5/verto/verto_communicator/src/vertoService/services/vertoService.js
@@ -76,6 +76,12 @@ var bandwidth = [{
}, {
id: '2048',
label: '2mb'
+}, {
+ id: '3196',
+ label: '3mb'
+}, {
+ id: '4192',
+ label: '4mb'
}, {
id: '5120',
label: '5mb'
@@ -169,7 +175,7 @@ vertoService.service('verto', ['$rootScope', '$cookieStore', '$location', 'stora
var height = res[1];
if(resolution.width == width && resolution.height == height) {
- videoQuality.push(resolution);
+ videoQuality.push(resolution);
}
});
});
@@ -200,14 +206,15 @@ vertoService.service('verto', ['$rootScope', '$cookieStore', '$location', 'stora
refreshDevicesCallback : function refreshDevicesCallback(callback) {
data.videoDevices = [{
- id: 'none',
- label: 'No Camera'
- }];
+ id: 'none',
+ label: 'No Camera'
+ }];
data.shareDevices = [{
id: 'screen',
label: 'Screen'
}];
data.audioDevices = [];
+ data.speakerDevices = [];
if(!storage.data.selectedShare) {
storage.data.selectedShare = data.shareDevices[0]['id'];
@@ -265,6 +272,26 @@ vertoService.service('verto', ['$rootScope', '$cookieStore', '$location', 'stora
label: device.label || device.id
});
}
+
+ for (var i in jQuery.verto.audioOutDevices) {
+ var device = jQuery.verto.audioOutDevices[i];
+ // Selecting the first source.
+ if (i == 0 && !storage.data.selectedSpeaker) {
+ storage.data.selectedSpeaker = device.id;
+ }
+
+ if (!device.label) {
+ data.speakerDevices.push({
+ id: 'Speaker ' + i,
+ label: 'Speaker ' + i
+ });
+ continue;
+ }
+ data.speakerDevices.push({
+ id: device.id,
+ label: device.label || device.id
+ });
+ }
console.debug('Devices were refreshed, checking that we have cameras.');
// This means that we cannot use video!
@@ -465,13 +492,17 @@ vertoService.service('verto', ['$rootScope', '$cookieStore', '$location', 'stora
if (params.pvtData) {
switch (params.pvtData.action) {
case "conference-liveArray-join":
- console.log("conference-liveArray-join");
- stopConference();
- startConference(v, dialog, params.pvtData);
+ if (!params.pvtData.screenShare && !params.pvtData.videoOnly) {
+ console.log("conference-liveArray-join");
+ stopConference();
+ startConference(v, dialog, params.pvtData);
+ }
break;
case "conference-liveArray-part":
- console.log("conference-liveArray-part");
- stopConference();
+ if (!params.pvtData.screenShare && !params.pvtData.videoOnly) {
+ console.log("conference-liveArray-part");
+ stopConference();
+ }
break;
}
}
@@ -556,10 +587,10 @@ vertoService.service('verto', ['$rootScope', '$cookieStore', '$location', 'stora
// Checking if we have a failed connection attempt before
// connecting again.
if (data.instance && !data.instance.rpcClient.socketReady()) {
- clearTimeout(data.instance.rpcClient.to);
- data.instance.logout();
- data.instance.login();
- return;
+ clearTimeout(data.instance.rpcClient.to);
+ data.instance.logout();
+ data.instance.login();
+ return;
};
data.instance = new jQuery.verto({
login: data.login + '@' + data.hostname,
@@ -583,22 +614,23 @@ vertoService.service('verto', ['$rootScope', '$cookieStore', '$location', 'stora
jQuery.verto.unloadJobs.push(function() {
that.reloaded = true;
});
- data.instance.deviceParams({
- useCamera: storage.data.selectedVideo,
- useMic: storage.data.selectedAudio,
- onResCheck: that.refreshVideoResolution
- });
+ data.instance.deviceParams({
+ useCamera: storage.data.selectedVideo,
+ useSpeak: storage.data.selectedSpeaker,
+ useMic: storage.data.selectedAudio,
+ onResCheck: that.refreshVideoResolution
+ });
}
if (data.mediaPerm) {
ourBootstrap();
} else {
- $.FSRTC.checkPerms(ourBootstrap, true, true);
+ $.FSRTC.checkPerms(ourBootstrap, true, true);
}
},
mediaPerm: function(callback) {
- $.FSRTC.checkPerms(callback, true, true);
+ $.FSRTC.checkPerms(callback, true, true);
},
/**
@@ -654,6 +686,7 @@ vertoService.service('verto', ['$rootScope', '$cookieStore', '$location', 'stora
useVideo: storage.data.useVideo,
useStereo: storage.data.useStereo,
useCamera: storage.data.selectedVideo,
+ useSpeak: storage.data.selectedSpeaker,
useMic: storage.data.selectedAudio,
dedEnc: storage.data.useDedenc,
mirrorInput: storage.data.mirrorInput,
@@ -681,6 +714,12 @@ vertoService.service('verto', ['$rootScope', '$cookieStore', '$location', 'stora
var that = this;
getScreenId(function(error, sourceId, screen_constraints) {
+
+ if(error) {
+ $rootScope.$emit('ScreenShareExtensionStatus', error);
+ return;
+ }
+
var call = data.instance.newCall({
destination_number: destination + '-screen',
caller_id_name: data.name + ' (Screen)',
@@ -698,6 +737,24 @@ vertoService.service('verto', ['$rootScope', '$cookieStore', '$location', 'stora
}
});
+ // Override onStream callback in $.FSRTC instance
+ call.rtc.options.callbacks.onStream = function(rtc, stream) {
+ if(stream) {
+ var StreamTrack = stream.getVideoTracks()[0];
+ StreamTrack.addEventListener('ended', stopSharing);
+ // (stream.getVideoTracks()[0]).onended = stopSharing;
+ }
+
+ console.log("screenshare started");
+
+ function stopSharing() {
+ if(that.data.shareCall) {
+ that.screenshareHangup();
+ console.log("screenshare ended");
+ }
+ }
+ };
+
data.shareCall = call;
console.log('shareCall', data);
@@ -773,6 +830,39 @@ vertoService.service('verto', ['$rootScope', '$cookieStore', '$location', 'stora
}
},
+ /**
+ * Do speed test.
+ *
+ * @param callback
+ */
+ testSpeed: function(cb) {
+
+ data.instance.rpcClient.speedTest(1024 * 256, function(e, data) {
+ var upBand = Math.ceil(data.upKPS * .75),
+ downBand = Math.ceil(data.downKPS * .75);
+
+
+ if (storage.data.autoBand) {
+ storage.data.incomingBandwidth = downBand;
+ storage.data.outgoingBandwidth = upBand;
+ storage.data.useDedenc = false;
+ storage.data.vidQual = 'hd';
+
+ if (upBand < 512) {
+ storage.data.vidQual = 'qvga';
+ }
+ else if (upBand < 1024) {
+ storage.data.vidQual = 'vga';
+ }
+ }
+
+ if(cb) {
+ cb(data);
+ }
+
+ $rootScope.$emit('testSpeed', data);
+ });
+ },
/**
* Mute the microphone for the current call.
*
diff --git a/html5/verto/video_demo/index.html b/html5/verto/video_demo/index.html
index bd3d98fe4a..74992e5807 100644
--- a/html5/verto/video_demo/index.html
+++ b/html5/verto/video_demo/index.html
@@ -91,7 +91,7 @@ div#preload { display: none; }
@@ -108,6 +108,18 @@ div#preload { display: none; }