Jitsi error obtaining camera and microphone permission

I’m trying to build a system where I open a jitsi meet room in a webView in my android studio app. The problem is that jitsi doesn’t give me access to the camera and microphone.

The smartphone app is right now looking like this with the jitsi view on top and two buttons for left and right:

The system works like this: one part is a raspberry pi with camera and a small screen and a motor. The other part is a smartphone with my android app. Both are connected to the internet and have access to the same jitsi meet room: https://meet.jit.si/fußballLive2020Uebertragung1

The idea is that you can place the raspberry somewhere, say at your families house. And then from your smartphone you can see what the raspberry camera can see and the video from your smartphone is transferred to the raspberry screen, so your family can see and talk to you too while you’re somewhere else. Additionally I want you to be able to move the rasberry camera to the left and right from your smartphone.

Sending the commands “left” and “right” to the raspberry motor from the smartphone already works, but the video and audio are always deactivated and when I click on the camera or microphone buttons (red circled in picture above) I get the error: Error obtaining camera permission or Èrror obtaining microphone permission`. When I start the app, I also can see from my raspberry that the app user joined the room.

In the android manifest I’m asking for following permissions:

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />

and when I started the app for the first time it also asked me for internet and camera permissions. I also loaded the apk to my real phone to see if it’s a problem with the android studio emulator.

My MainActivity.java:

package com.example.quarantina;

import android.Manifest;
import android.content.pm.PackageManager;
import android.os.Bundle;
import android.webkit.WebView;
import android.webkit.WebViewClient;

import androidx.appcompat.app.AppCompatActivity;
import androidx.core.app.ActivityCompat;
import androidx.core.content.ContextCompat;

public class MainActivity extends AppCompatActivity {
private static final int MY_CAMERA_REQUEST_CODE = 100;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    WebView webview = findViewById(R.id.webview);
    webview.getSettings().setJavaScriptEnabled(true);
    String newUA=  "Mozilla/5.0 (Macintosh; Intel Mac OS X 10 7 4) AppleWebKit/537.13 (KHTML, like Gecko) Chrome/24.0.1290.1 Safari/537.13";
    webview.getSettings().setUserAgentString(newUA);  // this is necesarry, because jitsi blocks requests from mobile phones, so we make it look like where on a PC
    webview.setWebViewClient(new WebViewClient());
    webview.loadUrl("https://meet.jit.si/fußballLive2020Uebertragung1");
}

(The code for the buttons is here not relevant so I didn’t add that)

I know I could just join the chat by opening the link in a browser on my phone and making it request the desktop version. But it’s very important for my project to have it all combined in my own app, the chat and the two buttons to control the motor.

I get the same error in firefox developer edition, cant access camera, though it can access audio.

oh, but cool how did you access the audio? maybe your code would help me.