FS-8018 [verto_communicator] separation of concerns. Get storage service to manage all settings instead of vertoService.
This commit is contained in:
parent
ac945c012a
commit
6a6d2ae8d6
|
@ -3,24 +3,24 @@
|
|||
</div>
|
||||
<div class="modal-body">
|
||||
|
||||
<div class="form-group" ng-show="verto.data.useVideo">
|
||||
<div class="form-group" ng-show="mydata.useVideo">
|
||||
<label for="settings-camera">Camera:</label>
|
||||
<select name="camera" id="settings-camera" class="form-control"
|
||||
ng-model="verto.data.selectedVideo" ng-options="item.id as item.label for item in verto.data.videoDevices">
|
||||
ng-model="mydata.selectedVideo" ng-options="item.id as item.label for item in verto.data.videoDevices">
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group" ng-show="verto.data.useVideo">
|
||||
<div class="form-group" ng-show="mydata.useVideo">
|
||||
<label for="settings-share-device">Share device:</label>
|
||||
<select name="share-device" id="settings-share-device" class="form-control"
|
||||
ng-model="verto.data.selectedShare" ng-options="item.id as item.label for item in verto.data.shareDevices">
|
||||
ng-model="mydata.selectedShare" ng-options="item.id as item.label for item in verto.data.shareDevices">
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="settings-microphone">Microphone:</label>
|
||||
<select name="microphone" id="settings-microphone" class="form-control"
|
||||
ng-model="verto.data.selectedAudio" ng-options="item.id as item.label for item in verto.data.audioDevices">
|
||||
ng-model="mydata.selectedAudio" ng-options="item.id as item.label for item in verto.data.audioDevices">
|
||||
</select>
|
||||
|
||||
<a class="btn btn-primary" href="" ng-click="refreshDeviceList()">Refresh device list</a>
|
||||
|
@ -30,37 +30,37 @@
|
|||
<label for="settings-microphone">General settings:</label>
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" name="use_video" value="verto.data.useVideo" ng-model="verto.data.useVideo">
|
||||
<input type="checkbox" name="use_video" value="mydata.useVideo" ng-model="mydata.useVideo">
|
||||
Use Video
|
||||
</label>
|
||||
</div>
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" name="use_stereo_audio" ng-value="verto.data.useStereo" ng-model="verto.data.useStereo">
|
||||
<input type="checkbox" name="use_stereo_audio" ng-value="mydata.useStereo" ng-model="mydata.useStereo">
|
||||
Stereo Audio
|
||||
</label>
|
||||
</div>
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" name="use_stun" ng-value="verto.data.useSTUN" ng-model="verto.data.useSTUN">
|
||||
<input type="checkbox" name="use_stun" ng-value="mydata.useSTUN" ng-model="mydata.useSTUN">
|
||||
Use STUN
|
||||
</label>
|
||||
</div>
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" name="use_dedenc" ng-value="verto.data.useDedenc" ng-model="verto.data.useDedenc">
|
||||
<input type="checkbox" name="use_dedenc" ng-value="mydata.useDedenc" ng-model="mydata.useDedenc">
|
||||
Use Dedicated Remote Encoder
|
||||
</label>
|
||||
</div>
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" name="mirror_input" ng-value="verto.data.mirrorInput" ng-model="verto.data.mirrorInput">
|
||||
<input type="checkbox" name="mirror_input" ng-value="mydata.mirrorInput" ng-model="mydata.mirrorInput">
|
||||
Scale Remote Video To Match Camera Resolution
|
||||
</label>
|
||||
</div>
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" name="ask_recover_call" ng-value="storage.data.askRecoverCall" ng-model="storage.data.askRecoverCall">
|
||||
<input type="checkbox" name="ask_recover_call" ng-value="mydata.askRecoverCall" ng-model="mydata.askRecoverCall">
|
||||
Ask before recovering call
|
||||
</label>
|
||||
</div>
|
||||
|
@ -70,21 +70,21 @@
|
|||
<div class="form-group">
|
||||
<label for="video-quality">Video quality:</label>
|
||||
<select name="video_quality" id="video-quality" class="form-control"
|
||||
ng-model="verto.data.vidQual"
|
||||
ng-model="mydata.vidQual"
|
||||
ng-options="item.id as item.label for item in verto.videoQuality"></select>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="outgoing-bandwidth">Max outgoing bandwidth:</label>
|
||||
<select name="outgoing_bandwidth" id="outgoing-bandwidth" class="form-control"
|
||||
ng-model="verto.data.outgoingBandwidth"
|
||||
ng-model="mydata.outgoingBandwidth"
|
||||
ng-options="item.id as item.label for item in verto.bandwidth"></select>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="incoming-bandwidth">Max incoming bandwidth:</label>
|
||||
<select name="incoming_bandwidth" id="incoming-bandwidth" class="form-control"
|
||||
ng-model="verto.data.incomingBandwidth"
|
||||
ng-model="mydata.incomingBandwidth"
|
||||
ng-options="item.id as item.label for item in verto.bandwidth"></select>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -24,17 +24,13 @@
|
|||
selectedVideo: null,
|
||||
selectedAudio: null,
|
||||
selectedShare: null,
|
||||
useVideo: '',
|
||||
useCamera: '',
|
||||
useVideo: '',
|
||||
useCamera: '',
|
||||
useStereo: '',
|
||||
useSTUN: '',
|
||||
useDedenc: '',
|
||||
mirrorInput: '',
|
||||
outgoingBandwidth: '',
|
||||
incomingBandwidth: '',
|
||||
vidQual: '',
|
||||
useStereo: true,
|
||||
useSTUN: true,
|
||||
useDedenc: false,
|
||||
mirrorInput: false,
|
||||
outgoingBandwidth: 'default',
|
||||
incomingBandwidth: 'default',
|
||||
vidQual: 'qvga',
|
||||
askRecoverCall: false,
|
||||
googNoiseSuppression: false,
|
||||
googHighpassFilter: false,
|
||||
|
@ -42,18 +38,7 @@
|
|||
});
|
||||
|
||||
function changeData(verto_data) {
|
||||
data.selectedVideo = verto_data.data.selectedVideo;
|
||||
data.selectedAudio = verto_data.data.selectedAudio;
|
||||
data.selectedShare = verto_data.data.selectedShare;
|
||||
data.useVideo = verto_data.data.useVideo;
|
||||
data.useCamera = verto_data.data.useCamera;
|
||||
data.useStereo = verto_data.data.useStereo;
|
||||
data.useDedenc = verto_data.data.useDedenc;
|
||||
data.useSTUN = verto_data.data.useSTUN;
|
||||
data.vidQual = verto_data.data.vidQual;
|
||||
data.mirrorInput = verto_data.data.mirrorInput;
|
||||
data.outgoingBandwidth = verto_data.data.outgoingBandwidth;
|
||||
data.incomingBandwidth = verto_data.data.incomingBandwidth;
|
||||
angular.extend(data, verto_data);
|
||||
}
|
||||
|
||||
return {
|
||||
|
|
|
@ -277,7 +277,6 @@
|
|||
verto.hangup();
|
||||
});
|
||||
} else {
|
||||
verto.changeData(storage);
|
||||
console.log('redirect to incall page');
|
||||
$location.path('/incall');
|
||||
}
|
||||
|
@ -381,9 +380,9 @@
|
|||
storage.data.onHold = false;
|
||||
|
||||
verto.data.call.answer({
|
||||
useStereo: verto.data.useStereo,
|
||||
useCamera: verto.data.useCamera,
|
||||
useMic: verto.data.useMic,
|
||||
useStereo: storage.data.useStereo,
|
||||
useCamera: storage.data.selectedVideo,
|
||||
useMic: storage.data.useMic,
|
||||
callee_id_name: verto.data.name,
|
||||
callee_id_number: verto.data.login
|
||||
});
|
||||
|
|
|
@ -4,16 +4,16 @@
|
|||
angular
|
||||
.module('vertoControllers')
|
||||
.controller('ModalSettingsController', ['$scope', '$http',
|
||||
'$location', '$modalInstance', 'verto', 'storage',
|
||||
function($scope, $http, $location, $modalInstance, verto, storage) {
|
||||
'$location', '$modalInstance', 'storage', 'verto',
|
||||
function($scope, $http, $location, $modalInstance, storage, verto) {
|
||||
console.debug('Executing ModalSettingsController.');
|
||||
|
||||
verto.changeData(storage);
|
||||
$scope.verto = verto;
|
||||
$scope.storage = storage;
|
||||
$scope.verto = verto;
|
||||
$scope.mydata = angular.copy(storage.data);
|
||||
|
||||
$scope.ok = function() {
|
||||
storage.changeData(verto);
|
||||
storage.changeData($scope.mydata);
|
||||
$modalInstance.close('Ok.');
|
||||
};
|
||||
|
||||
|
|
|
@ -117,23 +117,8 @@ vertoService.service('verto', ['$rootScope', '$cookieStore', '$location', 'stora
|
|||
textTo: $cookieStore.get('verto_demo_textto') || "1000",
|
||||
login: $cookieStore.get('verto_demo_login') || "1008",
|
||||
password: $cookieStore.get('verto_demo_passwd') || "1234",
|
||||
hostname: $cookieStore.get('verto_demo_hostname') || window.location.hostname,
|
||||
wsURL: $cookieStore.get('verto_demo_wsurl') || ("wss://" + window.location.hostname + ":8082"),
|
||||
useVideo: $cookieStore.get('verto_demo_vid_checked') || true,
|
||||
useCamera: $cookieStore.get('verto_demo_camera_checked') || true,
|
||||
useStereo: $cookieStore.get('verto_demo_stereo_checked') || true,
|
||||
useSTUN: $cookieStore.get('verto_demo_stun_checked') || true,
|
||||
useDedenc: $cookieStore.get('verto_demo_dedenc_checked') || false,
|
||||
mirrorInput: $cookieStore.get('verto_demo_mirror_input_checked') || false,
|
||||
outgoingBandwidth: $cookieStore.get('verto_demo_outgoingBandwidth') || 'default',
|
||||
incomingBandwidth: $cookieStore.get('verto_demo_incomingBandwidth') || 'default',
|
||||
vidQual: $cookieStore.get('verto_demo_vqual') || 'qvga',
|
||||
localVideo: $cookieStore.get('verto_demo_local_video_checked') || false,
|
||||
bestWidth: '',
|
||||
bestHeight: '',
|
||||
selectedVideo: null,
|
||||
selectedAudio: null,
|
||||
selectedShare: null
|
||||
hostname: window.location.hostname,
|
||||
wsURL: ("wss://" + window.location.hostname + ":8082")
|
||||
};
|
||||
|
||||
function cleanShareCall(that) {
|
||||
|
@ -195,31 +180,6 @@ vertoService.service('verto', ['$rootScope', '$cookieStore', '$location', 'stora
|
|||
};
|
||||
}
|
||||
|
||||
function changeData(verto_data) {
|
||||
$cookieStore.put('verto_demo_vid_checked', verto_data.data.useVideo);
|
||||
$cookieStore.put('verto_demo_camera_checked', verto_data.data.useCamera);
|
||||
$cookieStore.put('verto_demo_stereo_checked', verto_data.data.useStereo);
|
||||
$cookieStore.put('verto_demo_stun_checked', verto_data.data.useSTUN);
|
||||
$cookieStore.put('verto_demo_dedenc_checked', verto_data.data.useDedenc);
|
||||
$cookieStore.put('verto_demo_mirror_input_checked', verto_data.data.mirrorInput);
|
||||
$cookieStore.put('verto_demo_outgoingBandwidth', verto_data.data.outgoingBandwidth);
|
||||
$cookieStore.put('verto_demo_incomingBandwidth', verto_data.data.incomingBandwidth);
|
||||
$cookieStore.put('verto_demo_vqual', verto_data.data.vidQual);
|
||||
|
||||
data.selectedVideo = verto_data.data.selectedVideo;
|
||||
data.selectedAudio = verto_data.data.selectedAudio;
|
||||
data.selectedShare = verto_data.data.selectedShare;
|
||||
data.useVideo = verto_data.data.useVideo;
|
||||
data.useCamera = verto_data.data.useCamera;
|
||||
data.useStereo = verto_data.data.useStereo;
|
||||
data.useDedenc = verto_data.data.useDedenc;
|
||||
data.useSTUN = verto_data.data.useSTUN;
|
||||
data.vidQual = verto_data.data.vidQual;
|
||||
data.mirrorInput = verto_data.data.mirrorInput;
|
||||
data.outgoingBandwidth = verto_data.data.outgoingBandwidth;
|
||||
data.incomingBandwidth = verto_data.data.incomingBandwidth;
|
||||
}
|
||||
|
||||
var callState = {
|
||||
muteMic: false,
|
||||
muteVideo: false
|
||||
|
@ -228,7 +188,7 @@ vertoService.service('verto', ['$rootScope', '$cookieStore', '$location', 'stora
|
|||
return {
|
||||
data: data,
|
||||
callState: callState,
|
||||
changeData: changeData,
|
||||
// changeData: changeData,
|
||||
|
||||
// Options to compose the interface.
|
||||
videoQuality: videoQuality,
|
||||
|
@ -366,7 +326,7 @@ vertoService.service('verto', ['$rootScope', '$cookieStore', '$location', 'stora
|
|||
|
||||
var conf = new $.verto.conf(v, {
|
||||
dialog: dialog,
|
||||
hasVid: data.useVideo,
|
||||
hasVid: storage.data.useVideo,
|
||||
laData: pvtData,
|
||||
onBroadcast: function(v, conf, message) {
|
||||
console.log('>>> conf.onBroadcast:', arguments);
|
||||
|
@ -557,10 +517,6 @@ vertoService.service('verto', ['$rootScope', '$cookieStore', '$location', 'stora
|
|||
socketUrl: data.wsURL,
|
||||
tag: "webcam",
|
||||
ringFile: "sounds/bell_ring2.wav",
|
||||
loginParams: {
|
||||
foo: true,
|
||||
bar: "yes"
|
||||
},
|
||||
videoParams: getVideoParams(),
|
||||
// TODO: Add options for this.
|
||||
audioParams: {
|
||||
|
@ -627,14 +583,14 @@ vertoService.service('verto', ['$rootScope', '$cookieStore', '$location', 'stora
|
|||
destination_number: destination,
|
||||
caller_id_name: data.name,
|
||||
caller_id_number: data.login,
|
||||
outgoingBandwidth: data.outgoingBandwidth,
|
||||
incomingBandwidth: data.incomingBandwidth,
|
||||
useVideo: data.useVideo,
|
||||
useStereo: data.useStereo,
|
||||
useCamera: data.selectedVideo,
|
||||
useMic: data.selectedAudio,
|
||||
dedEnc: data.useDedenc,
|
||||
mirrorInput: data.mirrorInput,
|
||||
outgoingBandwidth: storage.data.outgoingBandwidth,
|
||||
incomingBandwidth: storage.data.incomingBandwidth,
|
||||
useVideo: storage.data.useVideo,
|
||||
useStereo: storage.data.useStereo,
|
||||
useCamera: storage.data.selectedVideo,
|
||||
useMic: storage.data.selectedAudio,
|
||||
dedEnc: storage.data.useDedenc,
|
||||
mirrorInput: storage.data.mirrorInput,
|
||||
userVariables: {
|
||||
email : storage.data.email,
|
||||
avatar: "http://gravatar.com/avatar/" + md5(storage.data.email) + ".png?s=600"
|
||||
|
@ -665,13 +621,13 @@ vertoService.service('verto', ['$rootScope', '$cookieStore', '$location', 'stora
|
|||
destination_number: destination + '-screen',
|
||||
caller_id_name: data.name + ' (Screen)',
|
||||
caller_id_number: data.login + ' (Screen)',
|
||||
outgoingBandwidth: data.outgoingBandwidth,
|
||||
incomingBandwidth: data.incomingBandwidth,
|
||||
outgoingBandwidth: storage.data.outgoingBandwidth,
|
||||
incomingBandwidth: storage.data.incomingBandwidth,
|
||||
videoParams: screen_constraints.video.mandatory,
|
||||
useVideo: data.useVideo,
|
||||
useVideo: storage.data.useVideo,
|
||||
screenShare: true,
|
||||
dedEnc: data.useDedenc,
|
||||
mirrorInput: data.mirrorInput,
|
||||
dedEnc: storage.data.useDedenc,
|
||||
mirrorInput: storage.data.mirrorInput,
|
||||
userVariables: {
|
||||
email : storage.data.email,
|
||||
avatar: "http://gravatar.com/avatar/" + md5(storage.data.email) + ".png?s=600"
|
||||
|
|
Loading…
Reference in New Issue