]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-8040: [verto_communicator] Check if we have a valid resolution reported before...
authorJoao Mesquita <jmesquita@indicium.com.ar>
Thu, 27 Aug 2015 18:57:41 +0000 (15:57 -0300)
committerJoao Mesquita <jmesquita@indicium.com.ar>
Thu, 27 Aug 2015 18:57:41 +0000 (15:57 -0300)
html5/verto/verto_communicator/src/partials/video_call.html
html5/verto/verto_communicator/src/vertoService/services/vertoService.js

index 314ad5a70932d45aa7de0bd2e2196235780a67a4..8c5ec45e7fd0ba890ae4a4104e8451257488fde6 100644 (file)
@@ -36,7 +36,7 @@
       <button tooltips="" tooltip-title="(un)Mute Mic" tooltip-side="bottom" tooltip-lazy="false" class="btn btn-material-blue-900" ng-click="muteMic(cbMuteMic)">
         <i class="" ng-class="{'mdi-av-mic': !verto.data.mutedMic, 'mdi-av-mic-off': verto.data.mutedMic}"></i>
       </button>
-      <button tooltips="" tooltip-title="(un)Mute Video" tooltip-side="bottom" tooltip-lazy="false" class="btn btn-material-blue-900" ng-click="muteVideo(cbMuteVideo)">
+      <button tooltips="" tooltip-title="(un)Mute Video" tooltip-side="bottom" tooltip-lazy="false" class="btn btn-material-blue-900" ng-click="muteVideo(cbMuteVideo)" ng-if="verto.data.canVideo">
         <i class="" ng-class="{'mdi-av-videocam': !verto.data.mutedVideo, 'mdi-av-videocam-off': verto.data.mutedVideo}"></i>
       </button>
       <button tooltips="" tooltip-title="Toggle Fullscreen Mode" tooltip-side="bottom" tooltip-lazy="false" class="btn btn-material-blue-900" ng-click="goFullscreen()">
index a4faf52704bc21e2430c4eeed3c4bb4a5e901ff0..a69e05a9368337e0055c1468347aa62a5f8ba151 100644 (file)
@@ -177,11 +177,15 @@ vertoService.service('verto', ['$rootScope', '$cookieStore', '$location', 'stora
       maxHeight = data.bestHeight;
 
       if(!data.bestWidth) {
-        maxWidth = videoResolution[data.vidQual].width;
+        if (videoResolution[data.vidQual]) {
+          maxWidth = videoResolution[data.vidQual].width;
+        }
       }
 
       if(!data.bestHeight) {
-        maxHeight = videoResolution[data.vidQual].height;
+        if (videoResolution[data.vidQual]) {
+          maxHeight = videoResolution[data.vidQual].height;
+        }
       }
 
       return {
@@ -539,12 +543,21 @@ vertoService.service('verto', ['$rootScope', '$cookieStore', '$location', 'stora
         };
 
         var init = function(resolutions) {
+          // This means that we cannot use video!
+          if (resolutions.validRes.length === 0) {
+            console.log('No valid resolutions, disabling video.');
+            data.canVideo = false;
+          } else {
+            data.canVideo = true;
+          }
           data.bestWidth = resolutions['bestResSupported'][0];
           data.bestHeight = resolutions['bestResSupported'][1];
 
-          that.updateResolutions(resolutions['validRes']);
-
-          that.refreshVideoResolution();
+          if (data.canVideo) {
+            that.updateResolutions(resolutions['validRes']);
+            that.refreshVideoResolution();
+          }
+          
           // Checking if we have a failed connection attempt before
           // connecting again.
           if (data.instance && !data.instance.rpcClient.socketReady()) {
@@ -557,10 +570,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: {