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
4 changed files with 24 additions and 6 deletions

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);