Skip to content

Mic and Camera Permission issue #1175

@noman5412

Description

@noman5412

I am using this plugin in my project using prebuilt AARs and ensures granting android permissions before creating webview object but mic and camera are not working.
here is my code
public void OpenMicTesting()
{
if (webView == null)
{
canvas.SetActive(false);
webView = (new GameObject("WebViewObject")).AddComponent();
webView.SetCameraAccess(true);
webView.SetMicrophoneAccess(true);
webView.SetInteractionEnabled(true);
webView.Init(transparent: false, enableWKWebView: true, cb: (msg) => Debug.Log("WV MSG: " + msg));
webView.SetMargins(0, 0, 0, 0);
webView.SetVisibility(true);
Screen.sleepTimeout = SleepTimeout.NeverSleep;
}
string url = "https://webrtc.github.io/samples/src/content/devices/input-output/";
webView.LoadURL(url);
webView.SetVisibility(true);
}
public void OpenCameraTesting()
{
if (webView == null)
{
canvas.SetActive(false);
webView = (new GameObject("WebViewObject")).AddComponent();
webView.SetCameraAccess(true);
webView.SetMicrophoneAccess(true);
webView.SetInteractionEnabled(true);
webView.Init(transparent: false, enableWKWebView: true, cb: (msg) => Debug.Log("WV MSG: " + msg));
webView.SetMargins(0, 0, 0, 0);
webView.SetVisibility(true);
Screen.sleepTimeout = SleepTimeout.NeverSleep;
}
string url = "https://webrtc.github.io/samples/src/content/getusermedia/gum/";
webView.LoadURL(url);
webView.SetVisibility(true);
}
The android permissions are called in awake as follows
void Awake()
{
if (!Permission.HasUserAuthorizedPermission(Permission.Camera))
Permission.RequestUserPermission(Permission.Camera);
if (!Permission.HasUserAuthorizedPermission(Permission.Microphone))
Permission.RequestUserPermission(Permission.Microphone);
}
the permission i grant but still not working
my testing device is redmi note 14.

please guide me!!!!!!!!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions