Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
_onRNCallKeepDidActivateAudioSession = () => {
console.log('CallKitManager: _onRNCallKeepDidActivateAudioSession');
Voximplant.Hardware.AudioDeviceManager.getInstance().callKitStartAudio();
};
_onRNCallKeepPerformAnswerCallAction = (event) => {
console.log('CallKitManager: _onRNCallKeepPerformAnswerCallAction' + this.callId);
if (!this.callKitUuid) {
this.callKitUuid = event.callUUID;
}
Voximplant.Hardware.AudioDeviceManager.getInstance().callKitConfigureAudioSession();
NavigationService.navigate('Call', {
callId: this.callId,
isVideo: this.withVideo,
isIncoming: true,
});
};
async switchAudioDevice() {
console.log('CallScreen[' + this.callId + '] switchAudioDevice');
let devices = await Voximplant.Hardware.AudioDeviceManager.getInstance().getAudioDevices();
this.setState({audioDevices: devices, audioDeviceSelectionVisible: true});
}
(async() => {
let currentAudioDevice = await Voximplant.Hardware.AudioDeviceManager.getInstance().getActiveDevice();
switch (currentAudioDevice) {
case Voximplant.Hardware.AudioDevice.BLUETOOTH:
this.setState({audioDeviceIcon: 'bluetooth-audio'});
break;
case Voximplant.Hardware.AudioDevice.SPEAKER:
this.setState({audioDeviceIcon: 'volume-up'});
break;
case Voximplant.Hardware.AudioDevice.WIRED_HEADSET:
this.setState({audioDeviceIcon: 'headset'});
break;
case Voximplant.Hardware.AudioDevice.EARPIECE:
default:
this.setState({audioDeviceIcon: 'hearing'});
break;
}
})();
}