zappar-xr / universal-ar-unity

57 stars 13 forks source link

Unresponsive browser after permissions request #1

Closed diegomazala closed 3 years ago

diegomazala commented 3 years ago

Describe the bug The application become unresponsive after user grant the camera/sensor permissions. It does not update the browser after finishing the call. The camera permission is an example. Once the permission is granted, the permission ui is hidden and the unity render screen is revealed. However, it is unresponsive. The user has to refresh the browser to have the behavior normalized. Notice: if you have the permissions given, the error does not manifest. So, clear the browser history to see the issue.

To Reproduce Steps to reproduce the behavior:

  1. Used UAR version 1.1.1-preview_1
  2. With Unity version 2020.3.12f1 using SRP (No) and build platform as WebGL
  3. Describe the unity scene setup - You can have the minimum setup to ask for permissions.

    Canvas with a text showing Time.time Script with two calls: Z.Initialize() and Z.PermissionRequestUi()

  4. See error

Expected behavior I expected to have the game/app playing normally after requesting permissions without having to refresh the browser

Screenshots If applicable, add screenshots to help explain your problem. image

Desktop

Smartphone (please complete the following information):

ZapparTest.txt

diegomazala commented 3 years ago

Adding more information. The result of calling Z.PermissionRequestUi() or Z.PermissionRequestCamera() is the same. Of course, they are called after Z.HasInitialized()==true

The browser doesn't respond unless I refresh or change tabs

nfynt-zap commented 3 years ago

Thanks for trying our package @diegomazala

With a quick reproduce step, we didn't encounter any freezing on android/iOS browser. Are you still encountering this issue? If so can you share any console log (if relevant) or stripped minimum project which we can test.

Further note that you'll need to test the webgl build from a HTTPS server (either publicly hosted or self signed locally i.e. Zapworks CLI). General HTTP server doesn't allow camera access which may be the reason in your case.

Cheers