camera and audio permissions used to be handled in webview. they are now handled with runtime
permissions and permission requests in the manifest. in addition - and because of this - you need
to grant camera/audio permissions in the webchromeclient. you have done this, or at least, you tried.
in order to debug webview, you need to handle console messages. that means overriding
webchromeclient's normal handling. for the most part, console messages are generated for you;
you simply need to override webchromeclient's handling and redirect them to BA.Log
so, with all of this in mind, do the following
in b4a:
remove this:
we.Initialize(WebView1)
Dim client As DefaultWebViewClient
client.Initialize("client")
we.SetWebViewClient(client)
replace with:
Dim jo As JavaObject
jo.InitializeContext
jo.RunMethod("addWCC", Array(webview))
in inline java, do this:
remove your inline java
replace with:
#if Java
import android.webkit.*;
public static void addWCC( WebView wv ) {
wv.getSettings().setJavaScriptEnabled(true);
wv.getSettings().setMediaPlaybackRequiresUserGesture(false);
wv.setWebChromeClient(new WebChromeClient() {
@Override
public boolean onConsoleMessage (ConsoleMessage consoleMessage) {
BA.Log(consoleMessage.message() + " (" + consoleMessage.messageLevel() + ")");
return true;
}
@Override
public void onPermissionRequest(PermissionRequest request) {
wv.evaluateJavascript("console.log('overriding permission request');",null);
request.grant(request.getResources()); // this alone is enough to grant all the permissions, currently only video/audio
}
}); // end of add webchromeclient
wv.evaluateJavascript("console.log('webchrome client added');",null);
}
#End If
when i run a simple webcam app in a webview, my camera opens. as far as webrtc is concerned,
i cannot comment on what you have implemented there. i can only say my camera opens when i
run a simple html document in a webview.