gree / gree/unity-webview

Mic and Camera Permission issue

Open
#1,175 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Objective-C++
Stars
2.7k
Forks
734
Avg merge
11h 39m
Merged PRs (30d)
1

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!!!!!!!!

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue on the Redmi Note 14 using the shown Awake permission flow and the OpenMicTesting/OpenCameraTesting entry points. Check the WebViewObject calls and the two WebRTC sample URLs, then compare the permission state and runtime behavior; done means microphone and camera access works in both tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, csharp, unity
Domain
game-dev, mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.