mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-08-14 01:49:05 +00:00
FS-8563 [verto_communicator] - Added callback to setAudioPlaybackDevice
This commit is contained in:
@@ -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);
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
@@ -527,6 +526,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');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
);
|
||||
|
@@ -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);
|
||||
|
Reference in New Issue
Block a user