Created
May 8, 2018 12:10
-
-
Save avspeed/ab1b43aa49d04d1c88caf8dec6bc1e25 to your computer and use it in GitHub Desktop.
get devices
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RTCControl rtcControl; | |
rtcControl = new RTCControl(); | |
//event triggered when new devices are found | |
rtcControl.NewDevices += RtcControl_NewDevices; | |
.... | |
private void RtcControl_NewDevices(object sender, DeviceEventArgs e) | |
{ | |
if (e.DeviceType == DeviceType.Video) //list of video devices | |
{ | |
var videoDevices = e.Devices; | |
foreach (var videoDevice in videoDevices) | |
{ | |
Debug.WriteLine("label " + videoDevice.label + " -- id " + videoDevice.id); | |
} | |
} | |
else if (e.DeviceType == DeviceType.AudioIn) //list of audio in devices | |
{ | |
var audioInDevices = e.Devices; | |
foreach (var audioInDevice in audioInDevices) | |
{ | |
Debug.WriteLine("label " + audioInDevice.label + " -- id " + audioInDevice.id); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment