1
0
mirror of https://github.com/signalwire/freeswitch.git synced 2025-04-26 12:37:26 +00:00

19 lines
590 B
JavaScript
Raw Normal View History

function attachSinkId(element, sinkId) {
if (typeof element.sinkId !== 'undefined') {
element.setSinkId(sinkId)
.then(function() {
console.log('Success, audio output device attached:', sinkId);
})
.catch(function(error) {
var errorMessage = error;
if (error.name === 'SecurityError') {
errorMessage = 'You need to use HTTPS for selecting audio output ' +
'device: ' + error;
}
console.error(errorMessage);
});
} else {
console.warn('Browser does not support output device selection.');
}
}