Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4839

Android Camera Permission Denied on MAUI Hybrid App with MediaPipe JS Pose Detection

$
0
0

I'm developing a .NET MAUI Hybrid app that uses a Blazor WebView to run a web interface with MediaPipe JS for pose detection. On Windows everything works fine the camera activates and MediaPipe processes frames. But when I deploy the app to Android devices, I continuously get a "camera permission denied" error even though:

I have added the camera permission (e.g. <uses-permission android:name="android.permission.CAMERA" />) in my Android manifest.

I've tried implementing a custom WebClient to request permissions programmatically.

I signed and published the app correctly.

Below is a simplified snippet of my JavaScript code (from my mediapipePose.js file) where I request camera access using navigator.mediaDevices.getUserMedia:

if (navigator.mediaDevices && navigator.mediaDevices.getUserMedia) {    navigator.mediaDevices.getUserMedia({        video: true    })    .then((stream) => {        videoElement.srcObject = stream;        videoElement.play();    })    .catch((error) => {        console.error("Error accessing camera:", error);    });} else {    console.error("getUserMedia is not supported in this browser.");}

Additionally, the HTML includes my custom JS and all MediaPipe scripts in the correct order. Since the same code runs without issues on Windows, I'm not sure what might be causing Android to deny permission.

Has anyone encountered a similar issue or can suggest additional steps to troubleshoot or configure my MAUI Hybrid app so that camera access works on Android?


Viewing all articles
Browse latest Browse all 4839

Trending Articles