Repository: openmeetings
Updated Branches:
  refs/heads/master 7efc23702 -> d0136edcb


[OPENMEETINGS-1643] code is simplified


Project: http://git-wip-us.apache.org/repos/asf/openmeetings/repo
Commit: http://git-wip-us.apache.org/repos/asf/openmeetings/commit/d0136edc
Tree: http://git-wip-us.apache.org/repos/asf/openmeetings/tree/d0136edc
Diff: http://git-wip-us.apache.org/repos/asf/openmeetings/diff/d0136edc

Branch: refs/heads/master
Commit: d0136edcbac2cd7ee763517f6425835404521b62
Parents: 7efc237
Author: Maxim Solodovnik <solomax...@gmail.com>
Authored: Tue Aug 8 14:15:18 2017 +0700
Committer: Maxim Solodovnik <solomax...@gmail.com>
Committed: Tue Aug 8 14:15:18 2017 +0700

----------------------------------------------------------------------
 openmeetings-flash/src/main/flex/main.mxml | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/openmeetings/blob/d0136edc/openmeetings-flash/src/main/flex/main.mxml
----------------------------------------------------------------------
diff --git a/openmeetings-flash/src/main/flex/main.mxml 
b/openmeetings-flash/src/main/flex/main.mxml
index 1a0478c..5e906a7 100644
--- a/openmeetings-flash/src/main/flex/main.mxml
+++ b/openmeetings-flash/src/main/flex/main.mxml
@@ -60,21 +60,21 @@
                        return Microphone.names.length > 0;
                }
 
+               private function getIntParam(param:String, def:int):int {
+                       var val:int = parseInt(param);
+                       return (isNaN(val) || val < 1 ? def : val);
+               }
+
                private function appInit(evt:Event):void {
                        var params:Object = 
FlexGlobals.topLevelApplication.parameters;
                        debug("appInit()", params);
                        audioOnly = 'true' == params.audioOnly;
                        interview = 'true' == params.interview;
-                       var _fps:int = parseInt(params.fps);
-                       FPS = (isNaN(_fps) || _fps < 1 ? 30 : _fps);
-                       var _bandwidth:int = parseInt(params.bandwidth);
-                       bandwidth = (isNaN(_bandwidth) || _bandwidth < 1 ? 0 : 
_bandwidth);
-                       var _quality:int = parseInt(params.quality);
-                       quality = (isNaN(_quality) || _quality < 1 ? 90 : 
_quality);
-                       var _echoPath:int = parseInt(params.echoPath);
-                       echoPath = (isNaN(_echoPath) || _echoPath < 1 ? 128 : 
_echoPath);
-                       var _micRate:int = parseInt(params.micRate);
-                       micRate = (isNaN(_micRate) || _micRate < 1 ? 22 : 
_micRate);
+                       FPS = getIntParam("fps", 30);
+                       bandwidth = getIntParam(params.bandwidth, 0);
+                       quality = getIntParam(params.quality, 90);
+                       echoPath = getIntParam(params.echoPath, 128);
+                       micRate = getIntParam(params.micRate, 22);
                        video = new OmVideo(videoDisplay, params);
                        switch (params.mode) {
                                case 'settings':

Reply via email to