 	var audioDevicesArr : [MediaDeviceInfo] = []
 	let audioInputDevices: [AVAudioSessionPortDescription] = audioSession.availableInputs!
 	var bluetoothDevice: AVAudioSessionPortDescription? = nil
-	var isBluetoothConnected : Bool = false
 	var wiredDevice: AVAudioSessionPortDescription? = nil
-	var isWiredConnected : Bool = false
 	var builtMicDevice: AVAudioSessionPortDescription? = nil
-	
+
 	for audioInput in audioInputDevices {
-		
+
 		let device = MediaDeviceInfo(
 			deviceId: audioInput.uid,
 			kind: "audioinput",
 			label: audioInput.portName
 		);
-		
+
 		audioDevicesArr.append(device)
-		
+
 		// Initialize audioInputSelected. Default Built-In Microphone
 		if audioInput.portType == AVAudioSession.Port.builtInMic {
 			builtMicDevice = audioInput
 		}
-		
+
 		if audioInput.portType == .bluetoothHFP || audioInput.portType == .bluetoothA2DP {
 			bluetoothDevice = audioInput
-			isBluetoothConnected = true
 		}
-		
+
 		if audioInput.portType == .usbAudio || audioInput.portType == .headsetMic {
 			wiredDevice = audioInput
-			isWiredConnected = true
 		}
 	}
-	
+
 	// Initialize audioInputSelected. Priority: [Wired - Wireless - Built-In Microphone]
-	if isWiredConnected {
+	if wiredDevice != nil {
 		PluginRTCAudioController.saveInputAudioDevice(inputDeviceUID: wiredDevice!.uid)
-	} else if isBluetoothConnected {
+	} else if bluetoothDevice != nil {
 		PluginRTCAudioController.saveInputAudioDevice(inputDeviceUID: bluetoothDevice!.uid)
-	} else {
+	} else if builtMicDevice != nil {
 		PluginRTCAudioController.saveInputAudioDevice(inputDeviceUID: builtMicDevice!.uid)
 	}
 	return audioDevicesArr

			facing = "front"
			facingLabel = "Front Camera"
		}
		
		if device.isConnected == false || (hasAudio == false && hasVideo == false) {
			continue
		}
		
		NSLog("- device [uniqueID:'%@', localizedName:'%@', facing:%@, audio:%@, video:%@, connected:%@]",
			String(device.uniqueID), String(device.localizedName), String(facing),
			String(hasAudio), String(hasVideo), String(device.isConnected))
		
		if hasAudio == false {
			// Add English facingLabel suffix if localizedName does not match for facing detection using label
			let deviceLabel = device.localizedName.contains(facingLabel) ?
					device.localizedName : device.localizedName + " (" + facingLabel + ")";
			
			let device = MediaDeviceInfo(
				deviceId: device.uniqueID,
				kind: "videoinput",
				label: deviceLabel
			)
				
			// Put Front devices at beginning of the videoDevicesArr
			if (facing == "front") {
				// Simple Swift 4 array unshift

			}
		}
	}

	return videoDevicesArr
}

