CaptureVideoAsync always returning null when using Windows Machine
See original GitHub issueDescription
When trying to capture video running the app as Windows Machine, the video capture method does not show the webcam, and immediately returns null.
private async Task OnCaptureVideoClickedAsync()
{
if (await Permissions.CheckStatusAsync<Camera>() != PermissionStatus.Granted)
{
var result = await Permissions.RequestAsync<Camera>();
if (result != PermissionStatus.Granted)
{
ToastService.ShowError("You need to grant the camera permission to use this feature");
return;
}
}
var video = await MediaPicker.Default.CaptureVideoAsync();
}
Permissions are set like this
<Capabilities>
<rescap:Capability Name="runFullTrust" />
<DeviceCapability Name="location"></DeviceCapability>
<DeviceCapability Name="webcam" />
<DeviceCapability Name="microphone" />
</Capabilities>
Steps to Reproduce
- Create a MAUI Blazor app
- Add a button and invoke a method containing. var video = await MediaPicker.Default.CaptureVideoAsync();
- Configure the permissions as in the description
- Run the app as Windows Machine.
Version with bug
6.0 (current)
Last version that worked well
Unknown/Other
Affected platforms
Windows
Affected platform versions
net6.0-windows10.0.19041.0
Did you find any workaround?
No, haven’t found a workaround.
Relevant log output
No response
Issue Analytics
- State:
- Created a year ago
- Comments:8 (2 by maintainers)
Top Results From Across the Web
net Maui MediaPicker.CaptureVideoAsync returns null for ...
I'm trying to use default media capture tool MediaPicker to shoot ... the function CaptureVideoAsync() always returns Fileresult as a null:.
Read more >Media picker for photos and videos - .NET MAUI
Learn how to use the IMediaPicker interface in the Microsoft.Maui.Media namespace, to prompt the user to select or take a photo or video....
Read more >Xamarin.Essentials: Media Picker
CaptureVideoAsync : Opens the camera to take a video. Each method optionally takes in a MediaPickerOptions parameter that allows the Title to be ......
Read more >MediaPicker.CaptureVideoAsync(MediaPickerOptions) ...
CaptureVideoAsync in the Xamarin.Essentials namespace. ... public static System.Threading.Tasks. ... Essentials.MediaPickerOptions options = null); ...
Read more >HidDevice.FromIdAsync returns null for my USB keyboard
FromIdAsync always returns null and the corresponding status is DeviceAccessStatus.DeniedBySystem. I can communicate with the keyboard in non- ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Seems it is related to this issue and that it’s not a MAUI issue, but instead a WinUI/platform issue https://github.com/dotnet/maui/issues/5849
Duplicate of #7660