-
Notifications
You must be signed in to change notification settings - Fork 715
Description
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!!!!!!!!