我有一个问题,访问IOT相机,我尝试创建一个简单的代码,访问相机,观看现场直播从该相机。它可以在Windows 10和Windows 10上工作。但是当我在IOT设备上尝试它时,我发现了错误,它说“找不到设备”--相机就像在这个链接中
这是代码
private async Task StartPreviewAsync()
{
try
{
mediaCapture = new MediaCapture();
var allVideoDevices = await DeviceInformation.FindAllAsync(DeviceClass.VideoCapture);
var count = allVideoDevices.Count;
System.Diagnostics.Debug.WriteLine(count+"Video Capture Device");
await mediaCapture.InitializeAsync();
PreviewControl.Source = mediaCapture;
await mediaCapture.StartPreviewAsync();
}
catch (UnauthorizedAccessException)
{
// This will be thrown if the user denied access to the camera in privacy settings
System.Diagnostics.Debug.WriteLine("The app was denied access to the camera");
}
catch (Exception)
{
System.Diagnostics.Debug.WriteLine("MediaCapture initialization failed.");
}
}
//protected async override void OnNavigatedFrom(NavigationEventArgs e)
//{
// await CleanupCameraAsync();
//}
protected async override void OnNavigatedTo(NavigationEventArgs e)
{
StartPreviewAsync();
}对我的问题有什么建议吗?
https://stackoverflow.com/questions/37269163
复制相似问题