Skip to content

Instantly share code, notes, and snippets.

@avspeed
Created May 8, 2018 12:10
Show Gist options
  • Save avspeed/ab1b43aa49d04d1c88caf8dec6bc1e25 to your computer and use it in GitHub Desktop.
Save avspeed/ab1b43aa49d04d1c88caf8dec6bc1e25 to your computer and use it in GitHub Desktop.
get devices
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