FS-8040: [verto_communicator] Check if we have a valid resolution reported before calling camera routines and hide controls if none are found.

This commit is contained in:
Joao Mesquita 2015-08-27 15:57:41 -03:00
parent 82fc6075cc
commit da0750231e
2 changed files with 19 additions and 10 deletions

View 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()">

View 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: {