Merge pull request #645 in FS/freeswitch from ~JAONZE/freeswitch:bugfix/FS-8563-output-device-mechanism-needs-feedback to master

* commit 'ef3e43840614e3e62238c1e48fbfad6344ff0b2f':
  FS-8563 [verto_communicator] - Added callback to setAudioPlaybackDevice
This commit is contained in:
Ítalo Rossi 2015-12-22 12:10:15 -06:00
commit 2765893b27
4 changed files with 24 additions and 6 deletions

View File

@ -1679,6 +1679,11 @@ body:-webkit-full-screen #incall .video-footer {
animation: growY .2s reverse;
}
.unsupported {
color: grey;
font-size: 10px;
}
@keyframes growY {
from { max-height:2000px;}
to { max-height:0px;}

View File

@ -24,8 +24,13 @@
</div>
<div class="form-group">
<label for="settings-microphone">Speaker:</label>
<select name="microphone" id="settings-microphone" class="form-control"
<label for="settings-microphone">
Speaker:
<span ng-show="!speakerFeature" class="unsupported">
Your browser doesn't seem to support this feature
</span>
</label>
<select name="microphone" id="settings-microphone" class="form-control" ng-disabled="!speakerFeature"
ng-model="mydata.selectedSpeaker" ng-options="item.id as item.label for item in verto.data.speakerDevices">
</select>
</div>

View File

@ -54,10 +54,9 @@
});
$rootScope.$on('changedSpeaker', function(event, speakerId) {
// This should provide feedback
//setAudioPlaybackDevice(<id>[,<callback>[,<callback arg>]]);
// if callback is set it will be called as callback(<bool success/fail>, <device name>, <arg if you supplied it>)
verto.data.call.setAudioPlaybackDevice(speakerId);
if (verto.data.call) {
verto.data.call.setAudioPlaybackDevice(speakerId, sinkIdCallback);
}
});
/**
@ -528,6 +527,13 @@
});
};
function sinkIdCallback(success, deviceName) {
if (success) {
toastr.info('Speaker is now <span class="install">' + deviceName + '</a>', 'Success', { allowHtml: true });
} else {
toastr.error('Your browser doesn\'t seem to support this feature', 'Error');
}
}
}
);

View File

@ -12,6 +12,8 @@
$scope.verto = verto;
$scope.mydata = angular.copy(storage.data);
$scope.speakerFeature = typeof document.getElementById('webcam').sinkId !== 'undefined';
$scope.ok = function() {
if ($scope.mydata.selectedSpeaker != storage.data.selectedSpeaker) {
$rootScope.$emit('changedSpeaker', $scope.mydata.selectedSpeaker);