I am trying to set the audio input in a webRTC Electron App. This function runs with no errors but it is completely ignored. The app is based on jssip. Anyone got any ideas?
function setaudioinput(audioSource){
log.info("Trying to set audio input to",audioSource)
const constraints = { audio: {deviceId: audioSource ? {exact: audioSource} : undefined}, };
navigator.mediaDevices.getUserMedia(constraints)
.then(function(stream) {
var audioTracks = stream.getAudioTracks();
log.info('Got stream with constraints:', constraints);
log.info('Using Audio device: ' + audioTracks[0].label);
localStorage.setItem('AUDIOINPUT', audioSource);
})
}